mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (unneeded delegation; formatting; typos)
This commit is contained in:
@@ -78,9 +78,9 @@ public class JavaDocExternalFilter extends AbstractExternalFilter {
|
||||
return text == null ? null : PlatformDocumentationUtil.fixupText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getExternalDocInfoForElement(@NotNull String docURL, PsiElement element) throws Exception {
|
||||
@Override
|
||||
public String getExternalDocInfoForElement(@NotNull String docURL, PsiElement element) throws Exception {
|
||||
String externalDoc = null;
|
||||
myElement = element;
|
||||
|
||||
|
||||
@@ -224,7 +224,8 @@ public class JavaDocInfoGenerator {
|
||||
int groupStart = matcher.start(1);
|
||||
int groupEnd = matcher.end(1);
|
||||
result.append(text, prev, groupStart);
|
||||
result.append(convertReference(text.substring(groupStart, groupEnd)));
|
||||
String href = text.substring(groupStart, groupEnd);
|
||||
result.append(ObjectUtils.notNull(createReferenceForRelativeLink(href, myElement), href));
|
||||
prev = groupEnd;
|
||||
}
|
||||
if (result.length() == 0) return text; // don't copy text over, if there are no matches
|
||||
@@ -232,10 +233,6 @@ public class JavaDocInfoGenerator {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private String convertReference(String href) {
|
||||
return ObjectUtils.notNull(createReferenceForRelativeLink(href, myElement), href);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a relative link into {@link DocumentationManagerProtocol#PSI_ELEMENT_PROTOCOL PSI_ELEMENT_PROTOCOL}-type link if possible
|
||||
*/
|
||||
|
||||
+6
-8
@@ -91,8 +91,8 @@ public abstract class AbstractExternalFilter {
|
||||
|
||||
public CharSequence correctRefs(String root, CharSequence read) {
|
||||
CharSequence result = read;
|
||||
for (RefConvertor myReferenceConvertor : getRefConverters()) {
|
||||
result = myReferenceConvertor.refFilter(root, result);
|
||||
for (RefConvertor converter : getRefConverters()) {
|
||||
result = converter.refFilter(root, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -187,16 +187,14 @@ public abstract class AbstractExternalFilter {
|
||||
}
|
||||
while (read != null && matchStart && !startSection.matcher(StringUtil.toUpperCase(read)).find());
|
||||
|
||||
if (input instanceof MyReader && contentEncoding != null && !contentEncoding.equalsIgnoreCase(CharsetToolkit.UTF8) &&
|
||||
!contentEncoding.equals(((MyReader)input).getEncoding())) {
|
||||
if (input instanceof MyReader && contentEncoding != null &&
|
||||
!(contentEncoding.equalsIgnoreCase(CharsetToolkit.UTF8) || contentEncoding.equals(((MyReader)input).getEncoding()))) {
|
||||
//restart page parsing with correct encoding
|
||||
try {
|
||||
data.setLength(0);
|
||||
doBuildFromStream(url, new MyReader(((MyReader)input).myInputStream, contentEncoding), data, false, true);
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
return;
|
||||
}
|
||||
catch (ProcessCanceledException ignored) { }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -268,7 +266,7 @@ public abstract class AbstractExternalFilter {
|
||||
}
|
||||
|
||||
private static boolean skipBlockList(String read) {
|
||||
return StringUtil.toUpperCase(read).contains(HR) ||
|
||||
return StringUtil.containsIgnoreCase(read, HR) ||
|
||||
StringUtil.containsIgnoreCase(read, "<ul class=\"blockList\">") ||
|
||||
StringUtil.containsIgnoreCase(read, "<li class=\"blockList\">");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user