Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void filter(String pattern) {
if ((pattern==null && this.pattern!=null) ||
(pattern!=null && this.pattern==null) ||
(pattern!=null && !pattern.equals(this.pattern.pattern()))) {
this.pattern = (pattern==null || pattern.length()==0) ? null :
this.pattern = (pattern==null || pattern.isEmpty()) ? null :
RSyntaxUtilities.wildcardToPattern("^" + pattern, false, false);
Object root = getModel().getRoot();
if (root instanceof SourceTreeNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ public void refresh() {
/**
* Refreshes what children are visible in the tree.
*/
@SuppressWarnings("unchecked")
private void refreshVisibleChildren() {
visibleChildren.clear();
if (children!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public String getAlreadyEnteredText(JTextComponent comp) {


private static String removeVendorPrefix(String text) {
if (text.length()>0 && text.charAt(0)=='-') {
if (!text.isEmpty() && text.charAt(0)=='-') {
Matcher m = VENDOR_PREFIXES.matcher(text);
if (m.find()) {
text = text.substring(m.group().length());
Expand Down Expand Up @@ -414,7 +414,7 @@ private void loadPropertyCompletions() throws IOException {
String line;
try {
while ((line=r.readLine())!=null) {
if (line.length()>0 && line.charAt(0)!='#') {
if (!line.isEmpty() && line.charAt(0)!='#') {
parsePropertyValueCompletionLine(line);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static Set<String> getTagsToClose(String res) {
try {
BufferedReader r = new BufferedReader(new InputStreamReader(in));
while ((line=r.readLine())!=null) {
if (line.length()>0 && line.charAt(0)!='#') {
if (!line.isEmpty() && line.charAt(0)!='#') {
tags.add(line.trim());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void addCompletions(CompletionProvider p, String text,
jar.addCompletions(p, pkgNames, addTo);
}
*/
if (text.length()==0) {
if (text.isEmpty()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void urlClicked(HyperlinkEvent e, Completion c,
}
else { // Try methods second
List<MethodInfo> miList = cf.getMethodInfoByName(member, -1);
if (miList!=null && miList.size()>0) {
if (miList!=null && !miList.isEmpty()) {
MethodInfo mi = miList.get(0);// Just show the first if multiple
memberCompletion = new MethodCompletion(c.getProvider(), mi);
}
Expand All @@ -343,7 +343,7 @@ public void urlClicked(HyperlinkEvent e, Completion c,
String[] args = getArgs(member);
String methodName = member.substring(0, lparen);
List<MethodInfo> miList = cf.getMethodInfoByName(methodName, args.length);
if (miList!=null && miList.size()>0) {
if (miList!=null && !miList.isEmpty()) {
if (miList.size()>1) {
// TODO: Pick correct overload based on args
logError("Multiple overload support not yet implemented");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static List<String> getClassNames(InputStream in) throws IOException {

// Skip blank lines and comments
line = line.trim();
if (line.length() == 0 || line.charAt(0) == '#') {
if (line.isEmpty() || line.charAt(0) == '#') {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ protected String getClassNameFromConstantPool(int cpIndex,
}

// cpi is never null
throw new InternalError("Expected ConstantClassInfo, found " +
cpi.getClass().toString());
throw new InternalError("Expected ConstantClassInfo, found " + cpi.getClass());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private String[] createParamTypesFromDescriptor(boolean qualified) {
List<String> paramTypeList = new ArrayList<>();
String type;

while (paramDescriptors.length()>0) {
while (!paramDescriptors.isEmpty()) {

// Can't do lastIndexOf() as there may be > 1 array parameter
// in the descriptors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public List<String> getMethodParamTypes(MethodInfo mi, ClassFile cf,
String paramDescriptors = signature.substring(1, rparen);
ParamDescriptorResult res = new ParamDescriptorResult();

while (paramDescriptors.length()>0) {
while (!paramDescriptors.isEmpty()) {
parseParamDescriptor(paramDescriptors, cf, additionalTypeArgs,
mi, "Error parsing method signature for ", res, qualified);
paramTypeList.add(res.type);
Expand Down Expand Up @@ -357,7 +357,7 @@ private ParamDescriptorResult parseParamDescriptor(String str,
ParamDescriptorResult res2 = new ParamDescriptorResult();
List<String> paramTypeList = new ArrayList<>();
// Recursively parse type parameters of this parameter
while (paramDescriptors.length()>0) {
while (!paramDescriptors.isEmpty()) {
parseParamDescriptor(paramDescriptors, cf, additionalTypeArgs,
mi, "Error parsing method signature for ", res2, qualified);
paramTypeList.add(res2.type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
for (int i=0; i<annotations.size(); i++) {
sb.append(annotations.get(i).toString());
if (i<annotations.size()-1 || modifiers.size()>0) {
if (i<annotations.size()-1 || !modifiers.isEmpty()) {
sb.append(' ');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author Robert Futrell
* @version 1.0
*/
public class IconFactory {
public final class IconFactory {

public static final String FUNCTION_ICON = "function";
public static final String LOCAL_VARIABLE_ICON = "local_variable";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public JavaScriptLanguageSupport getLanguageSupport() {
return languageSupport;
}

public SourceCompletionProvider getProvider()
{
public SourceCompletionProvider getProvider() {
return sourceProvider;
}

Expand All @@ -103,7 +102,7 @@ public void setShorthandCompletionCache(
*/
private void setCommentCompletions(ShorthandCompletionCache shorthandCache){
AbstractCompletionProvider provider = shorthandCache.getCommentProvider();
if(provider != null) {
if (provider != null) {
for (Completion c : shorthandCache.getCommentCompletions()) {
provider.addCompletion(c);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import org.fife.ui.autocomplete.Util;


public class JavaScriptDocUrlhandler implements ExternalURLHandler {
public class JavaScriptDocUrlHandler implements ExternalURLHandler {


private JavaScriptLanguageSupport languageSupport;

public JavaScriptDocUrlhandler(JavaScriptLanguageSupport languageSupport){
public JavaScriptDocUrlHandler(JavaScriptLanguageSupport languageSupport){
this.languageSupport = languageSupport;
}
/**
Expand Down Expand Up @@ -94,8 +94,8 @@ private String getPackage(Completion c, String desc) {
*/
private boolean isRelativeUrl(String text) {
// Javadoc is always ".html", and we support full URL's elsewhere.
final String[] EXTS = { ".html", ".htm" };
for (String ext : EXTS) {
final String[] extensions = { ".html", ".htm" };
for (String ext : extensions) {
if (text.endsWith(ext) || text.contains(ext + "#") ||
text.contains(ext + "?")) {
return true;
Expand Down Expand Up @@ -306,7 +306,7 @@ public void urlClicked(HyperlinkEvent e, Completion c,
}
else { // Try methods second
List<MethodInfo> miList = cf.getMethodInfoByName(member, -1);
if (miList!=null && miList.size()>0) {
if (miList!=null && !miList.isEmpty()) {
MethodInfo mi = miList.get(0);// Just show the first if multiple
memberCompletion = new JSFunctionCompletion(c.getProvider(), mi);
}
Expand All @@ -317,7 +317,7 @@ public void urlClicked(HyperlinkEvent e, Completion c,
String[] args = getArgs(member);
String methodName = member.substring(0, lparen);
List<MethodInfo> miList = cf.getMethodInfoByName(methodName, args.length);
if (miList!=null && miList.size()>0) {
if (miList!=null && !miList.isEmpty()) {
if (miList.size()>1) {
// TODO: Pick correct overload based on args
Logger.log("Multiple overload support not yet implemented");
Expand Down
Loading