diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/AbstractSourceTree.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/AbstractSourceTree.java index bb981336..693d96da 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/AbstractSourceTree.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/AbstractSourceTree.java @@ -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) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/SourceTreeNode.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/SourceTreeNode.java index 4afe130b..344bf79c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/SourceTreeNode.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/SourceTreeNode.java @@ -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) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/css/PropertyValueCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/css/PropertyValueCompletionProvider.java index 41a64ed1..89fc12f5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/css/PropertyValueCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/css/PropertyValueCompletionProvider.java @@ -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()); @@ -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); } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/html/HtmlLanguageSupport.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/html/HtmlLanguageSupport.java index c98b8959..2ad911ca 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/html/HtmlLanguageSupport.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/html/HtmlLanguageSupport.java @@ -100,7 +100,7 @@ private static Set 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()); } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JarManager.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JarManager.java index a78c1b54..2388f21d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JarManager.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JarManager.java @@ -81,7 +81,7 @@ public void addCompletions(CompletionProvider p, String text, jar.addCompletions(p, pkgNames, addTo); } */ - if (text.length()==0) { + if (text.isEmpty()) { return; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JavadocUrlHandler.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JavadocUrlHandler.java index 8a6b3ce2..3a039c8f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JavadocUrlHandler.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/JavadocUrlHandler.java @@ -332,7 +332,7 @@ public void urlClicked(HyperlinkEvent e, Completion c, } else { // Try methods second List 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); } @@ -343,7 +343,7 @@ public void urlClicked(HyperlinkEvent e, Completion c, String[] args = getArgs(member); String methodName = member.substring(0, lparen); List 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"); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/buildpath/ClassEnumerationReader.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/buildpath/ClassEnumerationReader.java index 08285665..85367894 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/buildpath/ClassEnumerationReader.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/buildpath/ClassEnumerationReader.java @@ -77,7 +77,7 @@ public static List 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; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/ClassFile.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/ClassFile.java index 920a3c68..9a130483 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/ClassFile.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/ClassFile.java @@ -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()); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/MethodInfo.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/MethodInfo.java index f1fb28a1..2ca453c5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/MethodInfo.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/MethodInfo.java @@ -180,7 +180,7 @@ private String[] createParamTypesFromDescriptor(boolean qualified) { List 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. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/attributes/Signature.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/attributes/Signature.java index e17c828d..c811ee24 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/attributes/Signature.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/classreader/attributes/Signature.java @@ -153,7 +153,7 @@ public List 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); @@ -357,7 +357,7 @@ private ParamDescriptorResult parseParamDescriptor(String str, ParamDescriptorResult res2 = new ParamDescriptorResult(); List 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); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/rjc/lang/Modifiers.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/rjc/lang/Modifiers.java index 47d888a3..a1d1dfdf 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/rjc/lang/Modifiers.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/java/rjc/lang/Modifiers.java @@ -186,7 +186,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); for (int i=0; i0) { + if (i 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); } @@ -317,7 +317,7 @@ public void urlClicked(HyperlinkEvent e, Completion c, String[] args = getArgs(member); String methodName = member.substring(0, lparen); List 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"); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptHelper.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptHelper.java index cc7059c8..975320b9 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptHelper.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptHelper.java @@ -10,8 +10,6 @@ */ package org.fife.rsta.ac.js; -import java.io.StringReader; - import org.fife.rsta.ac.js.ast.type.ArrayTypeDeclaration; import org.fife.rsta.ac.js.ast.type.TypeDeclaration; import org.fife.rsta.ac.js.ast.type.ecma.TypeDeclarations; @@ -33,12 +31,19 @@ import org.mozilla.javascript.ast.NodeVisitor; -public class JavaScriptHelper { +public final class JavaScriptHelper { private static final String INFIX = org.mozilla.javascript.ast.InfixExpression.class .getName(); + /** + * Private constructor to prevent instantiation. + */ + private JavaScriptHelper() { + // Do nothing + } + /** * Test whether the start of the variable is the same name as the variable * being initialised. This is not possible. @@ -56,7 +61,7 @@ public static boolean canResolveVariable(AstNode target, AstNode initializer) { return !varName.equals(splitInit[0]); } } - catch(Exception e) { + catch (Exception e) { //AstNode can throw exceptions if toSource() is invalid e.g. new Date(""..toString()); } return false; @@ -70,7 +75,7 @@ public static boolean canResolveVariable(AstNode target, AstNode initializer) { * @param text to parse * @return expression statement text from source */ - public static final ParseText parseEnteredText(String text) { + public static ParseText parseEnteredText(String text) { CompilerEnvirons env = new CompilerEnvirons(); env.setIdeMode(true); env.setErrorReporter(new ErrorReporter() { @@ -139,9 +144,8 @@ public static String getFunctionNameLookup(AstNode node, SourceCompletionProvide */ public static FunctionCall findFunctionCallFromNode(AstNode node) { AstNode parent = node; - for(int i=0; i<3; i++) - { - if(parent == null || (parent instanceof AstRoot)) + for (int i=0; i<3; i++) { + if (parent == null || (parent instanceof AstRoot)) break; if (parent instanceof FunctionCall) { return (FunctionCall) parent; @@ -160,7 +164,7 @@ public static FunctionCall findFunctionCallFromNode(AstNode node) { * @return TypeDeclaration if node resolves to supported type, e.g. Number, * New etc., otherwise null */ - public static final TypeDeclaration tokenToNativeTypeDeclaration( + public static TypeDeclaration tokenToNativeTypeDeclaration( AstNode typeNode, SourceCompletionProvider provider) { if (typeNode != null) { switch (typeNode.getType()) { @@ -191,7 +195,7 @@ public static final TypeDeclaration tokenToNativeTypeDeclaration( return createArrayType(typeNode, provider); case Token.GETELEM: { TypeDeclaration dec = findGetElementType(typeNode, provider); - if(dec != null) { + if (dec != null) { return dec; } break; @@ -199,15 +203,14 @@ public static final TypeDeclaration tokenToNativeTypeDeclaration( case Token.THIS : { //ask the provider for the base object String self = provider.getSelf(); - if(self == null) + if (self == null) self = TypeDeclarations.ECMA_GLOBAL; return getTypeDeclaration(self, provider); } //xml support case Token.XML : { - if(provider.isXMLSupported()) - { + if (provider.isXMLSupported()) { return getTypeDeclaration(TypeDeclarations.ECMA_XML, provider); } } @@ -234,16 +237,15 @@ public static final TypeDeclaration tokenToNativeTypeDeclaration( * @param provider * @return */ - private static TypeDeclaration findGetElementType(AstNode node, SourceCompletionProvider provider) - { + private static TypeDeclaration findGetElementType(AstNode node, SourceCompletionProvider provider) { ElementGet getElement = (ElementGet) node; //get target AstNode target = getElement.getTarget(); - if(target != null) { + if (target != null) { JavaScriptCompletionResolver resolver = new JavaScriptCompletionResolver(provider); TypeDeclaration typeDec = resolver.resolveNode(target); - if(typeDec != null) { - if(typeDec instanceof ArrayTypeDeclaration) { + if (typeDec != null) { + if (typeDec instanceof ArrayTypeDeclaration) { return ((ArrayTypeDeclaration) typeDec).getArrayType(); } } @@ -257,10 +259,9 @@ private static TypeDeclaration findGetElementType(AstNode node, SourceCompletion * @param provider * @return */ - private static TypeDeclaration createArrayType(AstNode typeNode, SourceCompletionProvider provider) - { + private static TypeDeclaration createArrayType(AstNode typeNode, SourceCompletionProvider provider) { TypeDeclaration array = getTypeDeclaration(TypeDeclarations.ECMA_ARRAY, provider); - if(array != null) { + if (array != null) { //create a new ArrayTypeDeclaration ArrayTypeDeclaration arrayDec = new ArrayTypeDeclaration(array.getPackageName(), array.getAPITypeName(), array.getJSName()); ArrayLiteral arrayLit = (ArrayLiteral) typeNode; @@ -285,12 +286,12 @@ private static TypeDeclaration findArrayType(ArrayLiteral arrayLit, SourceComple JavaScriptResolver resolver = provider.getJavaScriptEngine().getJavaScriptResolver(provider); for (AstNode element : arrayLit.getElements()) { TypeDeclaration elementType = resolver.resolveNode(element); - if(first) { + if (first) { dec = elementType; first = false; } else { - if(elementType != null && !elementType.equals(dec)) { + if (elementType != null && !elementType.equals(dec)) { dec = provider.getTypesFactory().getDefaultTypeDeclaration(); break; } @@ -305,7 +306,7 @@ private static TypeDeclaration processNewNode(AstNode typeNode, SourceCompletion if (newName != null) { TypeDeclaration newType = createNewTypeDeclaration(newName); - if(newType.isQualified()) { + if (newType.isQualified()) { return newType; } else { return findOrMakeTypeDeclaration(newName, provider); @@ -315,8 +316,7 @@ private static TypeDeclaration processNewNode(AstNode typeNode, SourceCompletion } - public static TypeDeclaration findOrMakeTypeDeclaration(String name, SourceCompletionProvider provider) - { + public static TypeDeclaration findOrMakeTypeDeclaration(String name, SourceCompletionProvider provider) { TypeDeclaration newType = getTypeDeclaration(name, provider); if (newType == null) { newType = createNewTypeDeclaration(name); @@ -324,8 +324,7 @@ public static TypeDeclaration findOrMakeTypeDeclaration(String name, SourceCompl return newType; } - public static TypeDeclaration createNewTypeDeclaration(String newName) - { + public static TypeDeclaration createNewTypeDeclaration(String newName) { // create a new Type String pName = newName.indexOf('.') > 0 ? newName.substring(0, newName.lastIndexOf('.')) : ""; @@ -350,7 +349,7 @@ public static boolean isInfixOnly(AstNode typeNode) { * * TODO most probably need some work on this */ - private static class InfixVisitor implements NodeVisitor { + private static final class InfixVisitor implements NodeVisitor { private String type = null; private SourceCompletionProvider provider; @@ -362,13 +361,12 @@ private InfixVisitor(SourceCompletionProvider provider) { @Override public boolean visit(AstNode node) { - if (!(node instanceof InfixExpression)) // ignore infix expression - { + if (!(node instanceof InfixExpression)) { // ignore infix expression JavaScriptResolver resolver = provider.getJavaScriptEngine().getJavaScriptResolver(provider); TypeDeclaration dec = resolver.resolveNode(node); boolean isNumber = TypeDeclarations.ECMA_NUMBER.equals(dec.getAPITypeName()) || TypeDeclarations.ECMA_BOOLEAN.equals(dec.getAPITypeName()); - if(isNumber && (type == null || (isNumber && TypeDeclarations.ECMA_NUMBER.equals(type)))) { + if (isNumber && (type == null || (isNumber && TypeDeclarations.ECMA_NUMBER.equals(type)))) { type = TypeDeclarations.ECMA_NUMBER; } else { @@ -391,14 +389,12 @@ public boolean visit(AstNode node) { */ private static TypeDeclaration getTypeFromInFixExpression(AstNode node, SourceCompletionProvider provider) { InfixExpression infix = (InfixExpression) node; - switch(infix.getType()) - { + switch (infix.getType()) { case Token.ADD: case Token.SUB: case Token.MOD: case Token.MUL: - case Token.DIV: - { + case Token.DIV: { InfixVisitor visitor = new InfixVisitor(provider); infix.visit(visitor); return getTypeDeclaration(visitor.type, provider); @@ -411,14 +407,11 @@ private static TypeDeclaration getTypeFromInFixExpression(AstNode node, SourceCo } - public static String convertNodeToSource(AstNode node) - { - try - { + public static String convertNodeToSource(AstNode node) { + try { return node.toSource(); } - catch(Exception e) - { + catch (Exception e) { Logger.log(e.getMessage()); } return null; @@ -434,7 +427,7 @@ public static String convertNodeToSource(AstNode node) */ public static int findIndexOfFirstOpeningBracket(String text) { int index = 0; - if (text != null && text.length() > 0) { + if (text != null && !text.isEmpty()) { char[] chars = text.toCharArray(); for (int i = chars.length - 1; i >= 0; i--) { switch (chars[i]) { @@ -457,7 +450,7 @@ public static int findIndexOfFirstOpeningBracket(String text) { public static int findIndexOfFirstOpeningSquareBracket(String text) { int index = 0; - if (text != null && text.length() > 0) { + if (text != null && !text.isEmpty()) { char[] chars = text.toCharArray(); for (int i = chars.length - 1; i >= 0; i--) { switch (chars[i]) { @@ -524,7 +517,6 @@ public static int findLastIndexOfJavaScriptIdentifier(String input) { } /** - * * @param text to trim * @return text up to the last dot e.g. a.getText().length returns a.getText() */ @@ -570,7 +562,7 @@ public static String trimFromLastParam(String text) { i2++; break; case ',': { - if(i1 == 0 && i2 ==0) { + if (i1 == 0 && i2 ==0) { return text.substring(i+1).trim(); } break; @@ -587,7 +579,7 @@ public static String trimFromLastParam(String text) { } - private static class ParseTextVisitor implements NodeVisitor { + private static final class ParseTextVisitor implements NodeVisitor { private AstNode lastNode; private String text; @@ -622,15 +614,13 @@ public String getLastNodeSource() { return lastNode != null ? lastNode.toSource() : isNew ? "" : text; } - public boolean isNew() - { + public boolean isNew() { return isNew; } } - public static class ParseText - { + public static class ParseText { public String text = ""; public boolean isNew; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLanguageSupport.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLanguageSupport.java index 024ce9eb..86de807c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLanguageSupport.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLanguageSupport.java @@ -181,16 +181,16 @@ public JavaScriptParser getJavaScriptParser() { public int getJsHintIndent() { - final int DEFAULT = 4; + final int defaultValue = 4; /* if (jshintrc==null) { - return DEFAULT; + return defaultValue; } long lastModified = jshintrc.lastModified(); if (lastModified!=jshintrcLastModified) { RSyntaxDocument doc = new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); try { - jshintIndent = DEFAULT; + jshintIndent = defaultValue; loadFile(jshintrc, doc); for (org.fife.ui.rsyntaxtextarea.Token t : doc) { if (t.is(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "\"indent\"") || @@ -202,9 +202,9 @@ public int getJsHintIndent() { if (t!=null && t.getType()==TokenTypes.LITERAL_NUMBER_DECIMAL_INT) { try { jshintIndent = Integer.parseInt(t.getLexeme()); - System.out.println("Reloading jshint indent: " + jshintIndent); + LOG.log(System.Logger.Level.DEBUG, "Reloading jshint indent: " + jshintIndent); } catch (NumberFormatException nfe) { - jshintIndent = DEFAULT; + jshintIndent = defaultValue; } } break; @@ -212,13 +212,13 @@ public int getJsHintIndent() { } } catch (IOException ioe) { ioe.printStackTrace(); - jshintIndent = DEFAULT; + jshintIndent = defaultValue; } jshintrcLastModified = lastModified; } return jshintIndent; */ -return DEFAULT; +return defaultValue; } /* @@ -280,7 +280,7 @@ public void install(RSyntaxTextArea textArea) { ac.setAutoActivationEnabled(isAutoActivationEnabled()); ac.setAutoActivationDelay(getAutoActivationDelay()); ac.setParameterAssistanceEnabled(isParameterAssistanceEnabled()); - ac.setExternalURLHandler(new JavaScriptDocUrlhandler(this)); + ac.setExternalURLHandler(new JavaScriptDocUrlHandler(this)); ac.setShowDescWindow(getShowDescWindow()); ac.install(textArea); installImpl(textArea, ac); @@ -534,7 +534,7 @@ private static class Info implements PropertyChangeListener { // public JavaScriptParser parser; - public Info(JavaScriptCompletionProvider provider, JavaScriptParser parser) { + Info(JavaScriptCompletionProvider provider, JavaScriptParser parser) { this.provider = provider; // this.parser = parser; parser.addPropertyChangeListener(JavaScriptParser.PROPERTY_AST, @@ -569,7 +569,7 @@ private class JavaScriptAutoCompletion extends AutoCompletion { private RSyntaxTextArea textArea; - public JavaScriptAutoCompletion(JavaScriptCompletionProvider provider, + JavaScriptAutoCompletion(JavaScriptCompletionProvider provider, RSyntaxTextArea textArea) { super(provider); this.textArea = textArea; @@ -580,10 +580,8 @@ protected String getReplacementText(Completion c, Document doc, int start, int len) { String replacement = super.getReplacementText(c, doc, start, len); - if(c instanceof JavaScriptShorthandCompletion) - { - try - { + if (c instanceof JavaScriptShorthandCompletion) { + try { int caret = textArea.getCaretPosition(); String leadingWS = RSyntaxUtilities.getLeadingWhitespace(doc, caret); if (replacement.indexOf('\n')>-1) { @@ -591,7 +589,7 @@ protected String getReplacementText(Completion c, Document doc, } } - catch(BadLocationException ble){} + catch (BadLocationException ble){} } return replacement; } @@ -621,7 +619,7 @@ private class Listener implements CaretListener, ActionListener { private Timer t; private DeepestScopeVisitor visitor; - public Listener(RSyntaxTextArea textArea) { + Listener(RSyntaxTextArea textArea) { this.textArea = textArea; textArea.addCaretListener(this); t = new Timer(650, this); @@ -711,7 +709,7 @@ public void uninstall() { } - private static class DeepestScopeVisitor implements NodeVisitor { + private static final class DeepestScopeVisitor implements NodeVisitor { private int offs; private AstNode deepestScope; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLinkGenerator.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLinkGenerator.java index 9d1fd4dd..ed73589f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLinkGenerator.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptLinkGenerator.java @@ -36,11 +36,9 @@ public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, int offs) { Token t = result.token; boolean function = result.function; String name = t.getLexeme(); - if(name != null && name.length() > 0) - { + if (name != null && !name.isEmpty()) { //only re-parse the document if there is a character that could potentially be a variable or function - if(name.length() > 1 || (name.length() == 1 && Character.isJavaIdentifierPart(name.charAt(0)))) - { + if (name.length() > 1 || (name.length() == 1 && Character.isJavaIdentifierPart(name.charAt(0)))) { language.reparseDocument(offs); } } @@ -56,7 +54,7 @@ public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, int offs) { String lookup = getLookupNameForFunction(textArea, offs, name); // lookup Function based on the name dec = variableResolver.findFunctionDeclaration(lookup, findLocal, findPreprocessed); - if(dec == null) { + if (dec == null) { dec = variableResolver.findFunctionDeclarationByFunctionName(name, findLocal, findPreprocessed); } } @@ -73,8 +71,9 @@ public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, int offs) { /** * @return LinkGeneratorResult based on the JavaScriptDeclaration and the position */ - protected LinkGeneratorResult createSelectedRegionResult(RSyntaxTextArea textArea, Token t, JavaScriptDeclaration dec) { - if(dec.getTypeDeclarationOptions() != null && !dec.getTypeDeclarationOptions().isSupportsLinks()) { + protected LinkGeneratorResult createSelectedRegionResult(RSyntaxTextArea textArea, Token t, + JavaScriptDeclaration dec) { + if (dec.getTypeDeclarationOptions() != null && !dec.getTypeDeclarationOptions().isSupportsLinks()) { return null; } return new SelectRegionLinkGeneratorResult(textArea, t.getOffset(), dec.getStartOffSet(), dec.getEndOffset()); @@ -142,32 +141,32 @@ private String getLookupNameForFunction(RSyntaxTextArea textArea, int offs, Stri boolean params = false; int count = 0; StringBuilder sb = new StringBuilder(); - for(int i=0; ipossibly link-able. */ - private static class IsLinkableCheckResult { + private static final class IsLinkableCheckResult { /** * The token under the mouse position. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptParser.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptParser.java index 3476f386..bec1cbc3 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptParser.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptParser.java @@ -115,7 +115,7 @@ public static CompilerEnvirons createCompilerEnvironment(ErrorReporter env.setRecordingComments(true); env.setRecordingLocalJsDocComments(true); env.setRecoverFromErrors(true); - if(langSupport != null) { + if (langSupport != null) { env.setXmlAvailable(langSupport.isXmlAvailable()); env.setStrictMode(langSupport.isStrictMode()); int version = langSupport.getLanguageVersion(); @@ -160,7 +160,7 @@ private void gatherParserErrorsRhino(ErrorCollector errorHandler, Element root) { List errors = errorHandler.getErrors(); - if (errors != null && errors.size() > 0) { + if (errors != null && !errors.isEmpty()) { for (ParseProblem problem : errors) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptShorthandCompletionCache.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptShorthandCompletionCache.java index c24893ad..35dd0aa6 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptShorthandCompletionCache.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JavaScriptShorthandCompletionCache.java @@ -27,8 +27,8 @@ */ public class JavaScriptShorthandCompletionCache extends ShorthandCompletionCache { - private static final String MSG = "org.fife.rsta.ac.js.resources"; - private static final ResourceBundle msg = ResourceBundle.getBundle(MSG); + private static final String MSG_CLASS = "org.fife.rsta.ac.js.resources"; + private static final ResourceBundle MSG = ResourceBundle.getBundle(MSG_CLASS); public JavaScriptShorthandCompletionCache(DefaultCompletionProvider templateProvider, DefaultCompletionProvider commentsProvider, boolean e4xSupport) { @@ -50,64 +50,64 @@ public JavaScriptShorthandCompletionCache(DefaultCompletionProvider templateProv //iterate array String template = "for (var ${i} = 0; ${i} < ${array}.length; ${i}++) {\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "for", "for-loop-array", - template, msg.getString("for.array.shortDesc"), msg.getString("for.array.summary"))); + template, MSG.getString("for.array.shortDesc"), MSG.getString("for.array.summary"))); //standard for template = "for (var ${i} = 0; ${i} < ${10}; ${i}++) {\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "for", "for-loop", - template, msg.getString("for.loop.shortDesc"),msg.getString("for.loop.summary"))); + template, MSG.getString("for.loop.shortDesc"), MSG.getString("for.loop.summary"))); //for in template = "for (var ${iterable_element} in ${iterable})\n{\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "for", "for-loop-in", - template, msg.getString("for.in.shortDesc"), msg.getString("for.in.summary"))); + template, MSG.getString("for.in.shortDesc"), MSG.getString("for.in.summary"))); //e4x specific - if(e4xSupport) { + if (e4xSupport) { //for each template = "for each (var ${iterable_element} in ${iterable})\n{\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "for", "for-loop-in-each", - template, msg.getString("for.in.each.shortDesc"), msg.getString("for.in.each.summary"))); + template, MSG.getString("for.in.each.shortDesc"), MSG.getString("for.in.each.summary"))); } //do while template = "do {\n\t${cursor}\n} while (${condition});"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "do-while", - "do-loop", template, msg.getString("do.shortDesc"), msg.getString("do.summary"))); + "do-loop", template, MSG.getString("do.shortDesc"), MSG.getString("do.summary"))); //if condition template = "if (${condition}) {\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "if", "if-cond", - template, msg.getString("if.cond.shortDesc"), msg.getString("if.cond.summary"))); + template, MSG.getString("if.cond.shortDesc"), MSG.getString("if.cond.summary"))); //if else condition template = "if (${condition}) {\n\t${cursor}\n} else {\n\t\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "if", "if-else", - template, msg.getString("if.else.shortDesc"), msg.getString("if.else.summary"))); + template, MSG.getString("if.else.shortDesc"), MSG.getString("if.else.summary"))); //while condition template = "while (${condition}) {\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "while", "while-cond", - template, msg.getString("while.shortDesc"), msg.getString("while.summary"))); + template, MSG.getString("while.shortDesc"), MSG.getString("while.summary"))); //switch case statement template = "switch (${key}) {\n\tcase ${value}:\n\t\t${cursor}\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "switch", "switch-statement", - template, msg.getString("switch.case.shortDesc"), msg.getString("switch.case.summary"))); + template, MSG.getString("switch.case.shortDesc"), MSG.getString("switch.case.summary"))); //try catch statement template = "try {\n\t ${cursor} \n} catch (${err}) {\n\t\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "try", "try-catch", - template, msg.getString("try.catch.shortDesc"), msg.getString("try.catch.summary"))); + template, MSG.getString("try.catch.shortDesc"), MSG.getString("try.catch.summary"))); //catch block template = "catch (${err}) {\n\t${cursor}\n}"; addShorthandCompletion(new JavaScriptTemplateCompletion(templateProvider, "catch", "catch-block", - template, msg.getString("catch.block.shortDesc"), msg.getString("catch.block.summary"))); + template, MSG.getString("catch.block.shortDesc"), MSG.getString("catch.block.summary"))); // Comments - addCommentCompletion(new BasicCompletion(commentsProvider, "TODO:", null, msg.getString("todo"))); - addCommentCompletion(new BasicCompletion(commentsProvider, "FIXME:", null, msg.getString("fixme"))); + addCommentCompletion(new BasicCompletion(commentsProvider, "TODO:", null, MSG.getString("todo"))); + addCommentCompletion(new BasicCompletion(commentsProvider, "FIXME:", null, MSG.getString("fixme"))); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsDocCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsDocCompletionProvider.java index aa9cd1e1..9d08e10a 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsDocCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsDocCompletionProvider.java @@ -85,14 +85,14 @@ private static class JsDocCompletion extends BasicCompletion { private String inputText; private String icon; - public JsDocCompletion(CompletionProvider provider, + JsDocCompletion(CompletionProvider provider, String replacementText) { super(provider, replacementText); this.inputText = replacementText; this.icon = IconFactory.JSDOC_ITEM_ICON; } - public JsDocCompletion(CompletionProvider provider, + JsDocCompletion(CompletionProvider provider, String inputText, String replacementText, String shortDesc, String icon) { super(provider, replacementText, shortDesc, shortDesc); @@ -117,13 +117,13 @@ private static class JsDocParameterizedCompletion extends TemplateCompletion { private String icon; - public JsDocParameterizedCompletion(CompletionProvider provider, + JsDocParameterizedCompletion(CompletionProvider provider, String inputText, String definitionString, String template) { this(provider, inputText, definitionString, template, IconFactory.JSDOC_ITEM_ICON); } - public JsDocParameterizedCompletion(CompletionProvider provider, + JsDocParameterizedCompletion(CompletionProvider provider, String inputText, String definitionString, String template, String icon) { super(provider, inputText, definitionString, template); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsHinter.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsHinter.java index 517e43ea..1f4690e3 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsHinter.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/JsHinter.java @@ -39,7 +39,7 @@ * @author Robert Futrell * @version 1.0 */ -class JsHinter { +final class JsHinter { private JavaScriptParser parser; // private RSyntaxDocument doc; @@ -338,7 +338,7 @@ static class StreamReaderThread extends Thread { * * @param in The stream (stdout or stderr) to read from. */ - public StreamReaderThread(InputStream in) { + StreamReaderThread(InputStream in) { r = new BufferedReader(new InputStreamReader(in)); this.buffer = new StringBuilder(); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Logger.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Logger.java index 53e0b34d..734f0ef2 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Logger.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Logger.java @@ -1,27 +1,35 @@ package org.fife.rsta.ac.js; -public class Logger { +public final class Logger { - private static boolean DEBUG; + private static final System.Logger LOG = System.getLogger(Logger.class.getName()); - static - { + private static final boolean DEBUG; + + /** + * Private constructor to prevent instantiation. + */ + private Logger() { + // Do nothing + } + + static { DEBUG = Boolean.parseBoolean(System.getProperty("javascript.debug")); } /** - * TODO change logging to Log4J? - * Log message to console + * Log message to console if debug logging is enabled. + * * @param msg */ - public static final void log(String msg) { + public static void log(String msg) { if (DEBUG) { - System.out.println(msg); + LOG.log(System.Logger.Level.DEBUG, msg); } } - public static final void logError(String msg) { - System.err.println(msg); + public static void logError(String msg) { + LOG.log(System.Logger.Level.ERROR, msg); } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/PreProcessingScripts.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/PreProcessingScripts.java index e7238963..29a32e4e 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/PreProcessingScripts.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/PreProcessingScripts.java @@ -1,7 +1,5 @@ package org.fife.rsta.ac.js; -import java.io.IOException; -import java.io.StringReader; import java.util.HashSet; import java.util.Set; @@ -23,15 +21,12 @@ public class PreProcessingScripts { private Set preProcessingCompletions = new HashSet<>(); - public PreProcessingScripts(SourceCompletionProvider provider) - { + public PreProcessingScripts(SourceCompletionProvider provider) { this.provider = provider; } - public void parseScript(String scriptText, TypeDeclarationOptions options) - { - if(scriptText != null && scriptText.length() > 0) - { + public void parseScript(String scriptText, TypeDeclarationOptions options) { + if (scriptText != null && !scriptText.isEmpty()) { CompilerEnvirons env = JavaScriptParser.createCompilerEnvironment(new JavaScriptParser.JSErrorReporter(), provider.getLanguageSupport()); Parser parser = new Parser(env); AstRoot root = parser.parse(scriptText, null, 0); @@ -41,15 +36,13 @@ public void parseScript(String scriptText, TypeDeclarationOptions options) } - public void reset() - { + public void reset() { preProcessingCompletions.clear(); //remove all preProcessing Variables provider.getVariableResolver().resetPreProcessingVariables(true); } - public Set getCompletions() - { + public Set getCompletions() { return preProcessingCompletions; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/SourceCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/SourceCompletionProvider.java index 4935cf2e..a940d277 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/SourceCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/SourceCompletionProvider.java @@ -58,6 +58,9 @@ */ public class SourceCompletionProvider extends DefaultCompletionProvider { + private static final System.Logger LOG = System.getLogger( + SourceCompletionProvider.class.getName()); + private JavaScriptCompletionProvider parent; private JarManager jarManager; private int dot; @@ -87,7 +90,7 @@ public SourceCompletionProvider(String javaScriptEngine, boolean xmlSupported) { this.xmlSupported = xmlSupported; setParameterizedCompletionParams('(', ", ", ')'); setAutoActivationRules(false, "."); // Default - only activate after '.' - engine = JavaScriptEngineFactory.Instance().getEngineFromCache(javaScriptEngine); + engine = JavaScriptEngineFactory.instance().getEngineFromCache(javaScriptEngine); javaScriptTypesFactory = engine.getJavaScriptTypesFactory(this); //set default for self to Global setSelf(TypeDeclarations.ECMA_GLOBAL); @@ -102,7 +105,7 @@ public SourceCompletionProvider(String javaScriptEngine, boolean xmlSupported) { */ private void addShorthandCompletions(Set set) { - if(shorthandCache != null) { + if (shorthandCache != null) { set.addAll(shorthandCache.getShorthandCompletions()); } } @@ -228,22 +231,21 @@ protected List getCompletionsImpl(JTextComponent comp) { // Don't add shorthand completions if they're typing something // qualified // only add shorthand completions if the user has started typing something in (Eclipse behaviour) - if (text.length() > 0) { + if (!text.isEmpty()) { addShorthandCompletions(set); } - if (text.length() > 0) { // try to convert text by removing + if (!text.isEmpty()) { // try to convert text by removing // any if, while etc.. ParseText pt = JavaScriptHelper.parseEnteredText(text); text = pt.text; isNew = pt.isNew; - if(isNew) { + if (isNew) { return handleNewFilter(set, text); } - else - { + else { //load classes and move on loadECMAClasses(set, ""); } @@ -271,8 +273,7 @@ protected List getCompletionsImpl(JTextComponent comp) { } - private List handleNewFilter(Set set, String text) - { + private List handleNewFilter(Set set, String text) { set.clear(); //reset as just interested in the //just load the constructors loadECMAClasses(set, text); @@ -280,8 +281,7 @@ private List handleNewFilter(Set set, String text) } @SuppressWarnings("unchecked") - private List resolveCompletions(String text, Set set) - { + private List resolveCompletions(String text, Set set) { completions.addAll(set); // Do a sort of all of our completions to put into case-insensitive order and we're good to go! @@ -316,20 +316,19 @@ private List resolveCompletions(String text, Set set) * @param set completion set * @param text */ - private void loadECMAClasses(Set set, String text) - { + private void loadECMAClasses(Set set, String text) { //all the constructors List list = engine.getJavaScriptTypesFactory(this). getECMAObjectTypes(this); for (JavaScriptType type : list) { //iterate through the constructors - if(text.length() == 0) { - if(type.getClassTypeCompletion() != null) + if (text.isEmpty()) { + if (type.getClassTypeCompletion() != null) set.add(type.getClassTypeCompletion()); } else { - if(type.getType().getJSName().startsWith(text)) { + if (type.getType().getJSName().startsWith(text)) { set.addAll(type.getConstructorCompletions().values()); } } @@ -341,22 +340,20 @@ private void loadECMAClasses(Set set, String text) * e.g. set to 'Global' for server side or 'Window' for client JavaScript support * @return base class for the completion provider */ - public String getSelf() - { + public String getSelf() { return self; } /** * Parse Text and add completions to set */ - private void parseTextAndResolve(Set set, String text) - { + private void parseTextAndResolve(Set set, String text) { // Compile the entered text and resolve the variables/function JavaScriptResolver compiler = engine.getJavaScriptResolver(this); try { JavaScriptType type = compiler.compileText(text); boolean resolved = populateCompletionsFromType(type, set); - if(!resolved) { + if (!resolved) { type = compiler.compileText("this." + text); populateCompletionsFromType(type, set); } @@ -382,12 +379,12 @@ private boolean populateCompletionsFromType(JavaScriptType type, @Override public String getAlreadyEnteredText(JTextComponent comp) { String text = super.getAlreadyEnteredText(comp); - if(text != null) { + if (text != null) { int charIndex = JavaScriptHelper.findIndexOfFirstOpeningBracket(text); text = text.substring(charIndex); int sqIndex = JavaScriptHelper.findIndexOfFirstOpeningSquareBracket(text); text = text.substring(sqIndex).trim(); - if(charIndex > 0 || sqIndex > 0) { + if (charIndex > 0 || sqIndex > 0) { text = JavaScriptHelper.trimFromLastParam(text); Logger.log("SourceCompletionProvider:getAlreadyEnteredText()::afterTrim " + text); } @@ -572,13 +569,11 @@ private boolean supportsPreProcessingScripts() { return preProcessing != null; } - public JavaScriptEngine getJavaScriptEngine() - { + public JavaScriptEngine getJavaScriptEngine() { return engine; } - public void setJavaScriptEngine(JavaScriptEngine engine) - { + public void setJavaScriptEngine(JavaScriptEngine engine) { this.engine = engine; } @@ -587,32 +582,27 @@ public SourceLocation getSourceLocForClass(String className) { } - public boolean isXMLSupported() - { + public boolean isXMLSupported() { return xmlSupported; } - public void setXMLSupported(boolean xmlSupported) - { + public void setXMLSupported(boolean xmlSupported) { this.xmlSupported = xmlSupported; } - public void setSelf(String self) - { + public void setSelf(String self) { this.self = self; } - public void parseDocument(int dot) - { + public void parseDocument(int dot) { AstRoot ast = this.parent.getASTRoot(); Set set = new HashSet<>(); variableResolver.resetLocalVariables(); iterateAstRoot(ast, set, "", dot, typeDeclarationOptions); } - public TypeDeclarationFactory getTypesFactory() - { + public TypeDeclarationFactory getTypesFactory() { return engine.getTypesFactory(); } @@ -626,19 +616,20 @@ public void setTypeDeclationOptions(TypeDeclarationOptions typeDeclarationOption // TODO remove public void debugCodeBlock(CodeBlock block, int tab) { - System.out.println(); + LOG.log(System.Logger.Level.INFO, ""); tab++; if (block != null) { + StringBuilder sb = new StringBuilder(); for (int i = 0; i < tab; i++) { - System.out.print("\t"); + sb.append(" "); } - System.out.print("Start: " + block.getStartOffset() + " end:" - + block.getEndOffset()); + sb.append("Start: ").append(block.getStartOffset()).append(" end:").append(block.getEndOffset()); for (int ii = 0; ii < block.getVariableDeclarationCount(); ii++) { JavaScriptVariableDeclaration vd = block .getVariableDeclaration(ii); - System.out.print(" " + vd.getName() + " "); + sb.append(" ").append(vd.getName()).append(" "); } + LOG.log(System.Logger.Level.INFO, sb.toString()); for (int i = 0; i < block.getChildCodeBlockCount(); i++) { debugCodeBlock(block.getChildCodeBlock(i), tab); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Util.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Util.java index 357c06e1..08185bab 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Util.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/Util.java @@ -17,7 +17,7 @@ * @author Robert Futrell * @version 1.0 */ -public class Util { +public final class Util { /** * Private constructor to prevent instantiation. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/CodeBlock.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/CodeBlock.java index 263f4850..6fa83558 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/CodeBlock.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/CodeBlock.java @@ -28,6 +28,8 @@ */ public class CodeBlock { + private static final System.Logger LOG = System.getLogger(CodeBlock.class.getName()); + private int start; private int end; private CodeBlock parent; @@ -182,8 +184,7 @@ public void setEndOffset(int end) { * @param start the start offset * @see #getStartOffset() */ - public void setStartOffSet(int start) - { + public void setStartOffSet(int start) { this.start = start; } @@ -191,13 +192,12 @@ public void setStartOffSet(int start) public void debug() { StringBuilder sb = new StringBuilder(); outputChild(sb, this, 0); - System.out.println(sb); + LOG.log(System.Logger.Level.DEBUG, sb.toString()); } private void outputChild(StringBuilder sb, CodeBlock block, int tab) { StringBuilder tabs = new StringBuilder(); - for(int i=0; iTypeDeclarations + * JavaScript Variable Declaration class TypeDeclarations. */ public class JavaScriptVariableDeclaration extends JavaScriptDeclaration { @@ -41,7 +41,7 @@ public JavaScriptVariableDeclaration(String name, int offset, /** - * Lookup TypeDeclaration from the Rhino AstNode + * Lookup TypeDeclaration from the Rhino AstNode. * * @param typeNode - Rhino AstNode linked to this variable */ @@ -72,7 +72,7 @@ public void setTypeDeclaration(AstNode typeNode, boolean overrideOriginal) { } /** - * Resets the TypeDeclaration to the original value + * Resets the TypeDeclaration to the original value. */ public void resetVariableToOriginalType() { if (reassigned) { @@ -84,7 +84,7 @@ public void resetVariableToOriginalType() { /** - * Set TypeDeclaration + * Set TypeDeclaration. * * @param typeDec */ diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/TypeDeclarationOptions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/TypeDeclarationOptions.java index fcc3f935..884fa2ae 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/TypeDeclarationOptions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/TypeDeclarationOptions.java @@ -8,56 +8,54 @@ *
  • Whether the JavaScriptDeclaration supports searchable hyperlinks * */ -public class TypeDeclarationOptions -{ +public class TypeDeclarationOptions { private String ownerScriptName; private boolean supportsLinks; private boolean preProcessing; - public TypeDeclarationOptions(String ownerScriptName, boolean supportsLinks, boolean preProcessing) - { + public TypeDeclarationOptions(String ownerScriptName, boolean supportsLinks, boolean preProcessing) { this.ownerScriptName = ownerScriptName; this.supportsLinks = supportsLinks; this.preProcessing = preProcessing; } /** - * @return the owner script name + * @return the owner script name. */ public String getOwnerScriptName() { return ownerScriptName; } /** - * set the owner script name + * set the owner script name. */ public void setOwnerScriptName(String ownerScriptName) { this.ownerScriptName = ownerScriptName; } /** - * @return whether the type declaration supports hyperlinks + * @return whether the type declaration supports hyperlinks. */ public boolean isSupportsLinks() { return supportsLinks; } /** - * set whether the type declaration supports hyperlinks + * set whether the type declaration supports hyperlinks. */ public void setSupportsLinks(boolean supportsLinks) { this.supportsLinks = supportsLinks; } /** - * @return whether the type declaration has been created from a pre-processed script + * @return whether the type declaration has been created from a pre-processed script. */ public boolean isPreProcessing() { return preProcessing; } /** - * set whether the type declaration has been created from a pre-processed script + * set whether the type declaration has been created from a pre-processed script. */ public void setPreProcessing(boolean preProcessing) { this.preProcessing = preProcessing; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/VariableResolver.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/VariableResolver.java index 8fadb9c3..a8984e31 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/VariableResolver.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/VariableResolver.java @@ -11,33 +11,29 @@ package org.fife.rsta.ac.js.ast; import java.util.HashMap; +import java.util.Map; import org.fife.rsta.ac.js.ast.type.TypeDeclaration; /** - * Cache Local and System scope variables Local scope variables are cleared each + * Cache Local and System scope variables. Local scope variables are cleared each * time the SourceCompletionProvider finishes parsing the script * System scope variables will not be cleared */ public class VariableResolver { // HashMap of local variables mapped Name --> JSVariableDeclaration - private HashMap localVariables = - new HashMap<>(); + private Map localVariables = new HashMap<>(); // pre-processing variables - these are set when pre-processing - private HashMap preProcessedVariables = - new HashMap<>(); + private Map preProcessedVariables = new HashMap<>(); // HashMap of system variables mapped Name --> JSVariableDeclaration // system variables do not get cleared as they are always available to the // system - private HashMap systemVariables = - new HashMap<>(); + private Map systemVariables = new HashMap<>(); - private HashMap localFunctions = - new HashMap<>(); - private HashMap preProcessedFunctions = - new HashMap<>(); + private Map localFunctions = new HashMap<>(); + private Map preProcessedFunctions = new HashMap<>(); /** @@ -61,7 +57,7 @@ public void addPreProcessingVariable(JavaScriptVariableDeclaration declaration) /** - * Add system scope variable to cache + * Add system scope variable to cache. * * @param declaration variable to add */ @@ -71,7 +67,7 @@ public void addSystemVariable(JavaScriptVariableDeclaration declaration) { /** - * remove pre-processing variable from system variable cache + * remove pre-processing variable from system variable cache. * * @param name of the system variable to remove */ @@ -81,7 +77,7 @@ public void removePreProcessingVariable(String name) { /** - * remove system variable from system variable cache + * remove system variable from system variable cache. * * @param name of the system variable to remove */ @@ -91,7 +87,7 @@ public void removeSystemVariable(String name) { /** - * Find JSVariableDeclaration for name against all variable types and check is in scope of caret position + * Find JSVariableDeclaration for name against all variable types and check is in scope of caret position. * * @param name * @param dot @@ -108,10 +104,12 @@ public JavaScriptVariableDeclaration findDeclaration(String name, int dot) { dot) : findDeclaration; } - public JavaScriptVariableDeclaration findDeclaration(String name, int dot, boolean local, boolean preProcessed, boolean system) { + public JavaScriptVariableDeclaration findDeclaration(String name, int dot, boolean local, boolean preProcessed, + boolean system) { JavaScriptVariableDeclaration findDeclaration = local ? findDeclaration(localVariables, name, dot) : null; // test whether this was found and then try pre-processing variable - findDeclaration = findDeclaration == null ? preProcessed ? findDeclaration(preProcessedVariables, name, dot) : null : findDeclaration; + findDeclaration = findDeclaration == null ? + preProcessed ? findDeclaration(preProcessedVariables, name, dot) : null : findDeclaration; // last chance... look in system variables return findDeclaration == null ? system ? findDeclaration(systemVariables, name, dot) : null : findDeclaration; } @@ -134,14 +132,14 @@ public JavaScriptVariableDeclaration findNonLocalDeclaration(String name, int do /** - * Find JSVariableDeclaration and check the scope of the caret position + * Find JSVariableDeclaration and check the scope of the caret position. * * @param name * @param dot * @return JSVariableDeclaration from the name */ private JavaScriptVariableDeclaration findDeclaration( - HashMap variables, + Map variables, String name, int dot) { JavaScriptVariableDeclaration dec = variables.get(name); @@ -159,7 +157,7 @@ private JavaScriptVariableDeclaration findDeclaration( /** * Find the TypeDeclaration for the variable and check the - * scope of the caret position + * scope of the caret position. * * @param name name of variable * @param dot position @@ -172,7 +170,7 @@ public TypeDeclaration getTypeDeclarationForVariable(String name, int dot) { /** - * Clear all local scope variables + * Clear all local scope variables. */ public void resetLocalVariables() { localVariables.clear(); @@ -200,7 +198,7 @@ public void resetSystemVariables() { /** * Resolve the entered text by chopping up the text and working from left to - * right, resolving each type in turn + * right, resolving each type in turn. * * @param varName * @param dot @@ -213,41 +211,39 @@ public TypeDeclaration resolveType(String varName, int dot) { } - public void addLocalFunction(JavaScriptFunctionDeclaration func) - { + public void addLocalFunction(JavaScriptFunctionDeclaration func) { localFunctions.put(func.getName(), func); } - public JavaScriptFunctionDeclaration findFunctionDeclaration(String name) - { + public JavaScriptFunctionDeclaration findFunctionDeclaration(String name) { JavaScriptFunctionDeclaration dec = localFunctions.get(name); - if(dec == null) { + if (dec == null) { dec = preProcessedFunctions.get(name); } return dec; } - public JavaScriptFunctionDeclaration findFunctionDeclaration(String name, boolean local, boolean preProcessed) - { + public JavaScriptFunctionDeclaration findFunctionDeclaration(String name, boolean local, boolean preProcessed) { JavaScriptFunctionDeclaration dec = local ? localFunctions.get(name) : null; - if(dec == null) { + if (dec == null) { dec = preProcessed ? preProcessedFunctions.get(name) : null; } return dec; } - public JavaScriptFunctionDeclaration findFunctionDeclarationByFunctionName(String name, boolean local, boolean preprocessed) { + public JavaScriptFunctionDeclaration findFunctionDeclarationByFunctionName(String name, boolean local, + boolean preprocessed) { JavaScriptFunctionDeclaration func = local ? findFirstFunction(name, localFunctions) : null; - if(func == null) { + if (func == null) { func = preprocessed ? findFirstFunction(name, preProcessedFunctions) : null; } return func; } private JavaScriptFunctionDeclaration findFirstFunction(String name, - HashMap functions) { + Map functions) { for (JavaScriptFunctionDeclaration func : functions.values()) { - if(name.equals(func.getFunctionName())) { + if (name.equals(func.getFunctionName())) { return func; } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223JavaScriptTypesFactory.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223JavaScriptTypesFactory.java index 756d64e9..87dde820 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223JavaScriptTypesFactory.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223JavaScriptTypesFactory.java @@ -6,8 +6,7 @@ public class JSR223JavaScriptTypesFactory extends JavaScriptTypesFactory { - public JSR223JavaScriptTypesFactory(TypeDeclarationFactory typesFactory) - { + public JSR223JavaScriptTypesFactory(TypeDeclarationFactory typesFactory) { super(typesFactory); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223Type.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223Type.java index 70fe2cf5..e8385b16 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223Type.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JSR223Type.java @@ -2,6 +2,7 @@ import java.util.HashSet; import java.util.Map; +import java.util.Set; import org.fife.rsta.ac.js.Logger; import org.fife.rsta.ac.js.SourceCompletionProvider; @@ -23,8 +24,8 @@ public JSR223Type(TypeDeclaration type) { * @see JSCompletion */ @Override - protected JSCompletion _getCompletion(String completionLookup, - SourceCompletionProvider provider) { + protected JSCompletion getCompletionImpl(String completionLookup, + SourceCompletionProvider provider) { JSCompletion completion = methodFieldCompletions.get(completionLookup); if (completion != null) { return completion; @@ -53,16 +54,14 @@ protected JSCompletion _getCompletion(String completionLookup, int weight = matchFunctionType.compare(javaScriptFunctionType, provider, isJavaScriptType); Logger.log("Weight: " + weight); - if (weight < JavaScriptFunctionType.CONVERSION_NONE - && (weight < bestFitWeight || bestFitIndex == -1)) { + if (weight < JavaScriptFunctionType.CONVERSION_NONE && + (weight < bestFitWeight || bestFitIndex == -1)) { bestFitIndex = i; bestFitWeight = weight; } } if (bestFitIndex > -1) { - Logger - .log("BEST FIT: " - + matches[bestFitIndex].getLookupName()); + Logger.log("BEST FIT: " + matches[bestFitIndex].getLookupName()); return matches[bestFitIndex]; } } @@ -70,17 +69,16 @@ protected JSCompletion _getCompletion(String completionLookup, return null; } - private JSCompletion[] getPotentialLookupList(String name) - { + private JSCompletion[] getPotentialLookupList(String name) { //get a list of all potential matches, including extended - HashSet completionMatches = new HashSet<>(); + Set completionMatches = new HashSet<>(); getPotentialLookupList(name, completionMatches, this); return completionMatches.toArray(new JSCompletion[0]); } // get a list of all potential method matches private void getPotentialLookupList(String name, - HashSet completionMatches, JavaScriptType type) { + Set completionMatches, JavaScriptType type) { Map typeCompletions = type.methodFieldCompletions; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptFunctionType.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptFunctionType.java index 20eb4aca..d4a2cc0d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptFunctionType.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptFunctionType.java @@ -12,30 +12,30 @@ import org.mozilla.javascript.Kit; -public class JavaScriptFunctionType { +public final class JavaScriptFunctionType { public static int CONVERSION_NONE = 999; public static int CONVERSION_JS = 99; - public static Class BooleanClass = Kit.classOrNull("java.lang.Boolean"), - ByteClass = Kit.classOrNull("java.lang.Byte"), - CharacterClass = Kit.classOrNull("java.lang.Character"), - ClassClass = Kit.classOrNull("java.lang.Class"), - DoubleClass = Kit.classOrNull("java.lang.Double"), - FloatClass = Kit.classOrNull("java.lang.Float"), - IntegerClass = Kit.classOrNull("java.lang.Integer"), - LongClass = Kit.classOrNull("java.lang.Long"), - NumberClass = Kit.classOrNull("java.lang.Number"), - ObjectClass = Kit.classOrNull("java.lang.Object"), - ShortClass = Kit.classOrNull("java.lang.Short"), - StringClass = Kit.classOrNull("java.lang.String"), - DateClass = Kit.classOrNull("java.util.Date"), - JSBooleanClass = null, - JSStringClass = null, - JSNumberClass = null, - JSObjectClass = null, - JSDateClass = null, - JSArray = null; + public static Class BooleanClass = Kit.classOrNull("java.lang.Boolean"); + public static Class ByteClass = Kit.classOrNull("java.lang.Byte"); + public static Class CharacterClass = Kit.classOrNull("java.lang.Character"); + public static Class ClassClass = Kit.classOrNull("java.lang.Class"); + public static Class DoubleClass = Kit.classOrNull("java.lang.Double"); + public static Class FloatClass = Kit.classOrNull("java.lang.Float"); + public static Class IntegerClass = Kit.classOrNull("java.lang.Integer"); + public static Class LongClass = Kit.classOrNull("java.lang.Long"); + public static Class NumberClass = Kit.classOrNull("java.lang.Number"); + public static Class ObjectClass = Kit.classOrNull("java.lang.Object"); + public static Class ShortClass = Kit.classOrNull("java.lang.Short"); + public static Class StringClass = Kit.classOrNull("java.lang.String"); + public static Class DateClass = Kit.classOrNull("java.util.Date"); + public static Class JSBooleanClass = null; + public static Class JSStringClass = null; + public static Class JSNumberClass = null; + public static Class JSObjectClass = null; + public static Class JSDateClass = null; + public static Class JSArray = null; private String name; private List arguments; @@ -98,9 +98,11 @@ public TypeDeclaration getArgument(int index) { * whether the parameters are compatible. * @param compareType method to compare with this * @param provider SourceCompletionProvider + * @param isJavaScriptType TODO * @return weight based on the compatibleness of method to compare */ - public int compare(JavaScriptFunctionType compareType, SourceCompletionProvider provider, boolean isJavaScriptType) { + public int compare(JavaScriptFunctionType compareType, SourceCompletionProvider provider, + boolean isJavaScriptType) { //first check name if (!compareType.getName().equals(getName())) { return CONVERSION_NONE; @@ -112,7 +114,8 @@ public int compare(JavaScriptFunctionType compareType, SourceCompletionProvider //if Java type and args do not match... cannot match if (!isJavaScriptType && !argsMatch) { return CONVERSION_NONE; - } else if(isJavaScriptType && !argsMatch) { //is javascript type and args do not match, return higher compare number + } else if (isJavaScriptType && !argsMatch) { + //if javascript type and args don't match, return higher compare number return CONVERSION_JS; } @@ -131,7 +134,7 @@ public int compare(JavaScriptFunctionType compareType, SourceCompletionProvider /** - * Convert parameter into TypeDeclaration + * Convert parameter into TypeDeclaration. * @param type * @param provider * @return @@ -150,7 +153,7 @@ private TypeDeclaration convertParamType(TypeDeclaration type, /** * Converts TypeDeclaration into Java Class and compares whether another parameter is compatible based - * on JSR-223 + * on JSR-223. * @param param parameter to compare * @param compareParam compare parameter * @param provider SourceCompletionProvider @@ -306,7 +309,7 @@ else if (from.isPrimitive() && to != Boolean.TYPE) { /** - * Converts TypeDeclaration qualified name to Java Class + * Converts TypeDeclaration qualified name to Java Class. * @param name * @return * @throws ClassNotFoundException @@ -314,7 +317,7 @@ else if (from.isPrimitive() && to != Boolean.TYPE) { private Class convertClassToJavaClass(String name, TypeDeclarationFactory typesFactory) throws ClassNotFoundException { - if (name.equals("any")) + if ("any".equals(name)) return ObjectClass; // check type is converted properly @@ -359,7 +362,7 @@ else if (cls == JSObjectClass) { // strip parameters and resolve types String paramsStr = function.substring(paramStartIndex + 1, paramEndIndex).trim(); - if(paramsStr.length() > 0) { + if (paramsStr.length() > 0) { // iterate through params String[] params = paramsStr.split(","); for (int i = 0; i < params.length; i++) { @@ -376,7 +379,7 @@ else if (cls == JSObjectClass) { * Convenience method to parse function string and converts to JavaScriptFunctionType * @param function String to parse e.g. convertValue(java.util.String val); * @param provider used for type conversions - * @return + * @return The function type. */ public static JavaScriptFunctionType parseFunction(String function, SourceCompletionProvider provider) { @@ -390,7 +393,7 @@ public static JavaScriptFunctionType parseFunction(String function, String paramsStr = function.substring(paramStartIndex + 1, paramEndIndex).trim(); // iterate through params - if(paramsStr.length() > 0) { + if (!paramsStr.isEmpty()) { String[] params = paramsStr.split(","); for (String s : params) { String param = provider.getTypesFactory().convertJavaScriptType( @@ -413,7 +416,7 @@ public static JavaScriptFunctionType parseFunction(String function, /** - * Converts JavaScript class name to integer code + * Converts JavaScript class name to integer code. * @param clsName * @return * @throws ClassNotFoundException @@ -421,7 +424,7 @@ public static JavaScriptFunctionType parseFunction(String function, private static int getJSTypeCode(String clsName, TypeDeclarationFactory typesFactory) throws ClassNotFoundException { - if (clsName.equals("any")) { + if ("any".equals(clsName)) { return JSTYPE_UNDEFINED; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptType.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptType.java index ac1b8ed5..d4059b76 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptType.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptType.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.fife.rsta.ac.js.SourceCompletionProvider; import org.fife.rsta.ac.js.ast.type.TypeDeclaration; @@ -21,7 +22,7 @@ /** * Cached Type Tree Node with pointer to a list of super classes to make it easy - * to walk through Completion hierarchy Contains a HashMap of lookup keys to + * to walk through Completion hierarchy. Contains a HashMap of lookup keys to * JSCompletion * * @author steveup @@ -32,9 +33,9 @@ public class JavaScriptType { // base type protected TypeDeclaration type; // completions for base type String-->JSCompletion - protected HashMap methodFieldCompletions; + protected Map methodFieldCompletions; //constructor completions - protected HashMap constructors; + protected Map constructors; //class type protected JSCompletion classType; @@ -51,7 +52,7 @@ public JavaScriptType(TypeDeclaration type) { /** - * Add method or field completion to CachedType + * Add method or field completion to CachedType. * * @param completion * @see JSCompletion @@ -60,23 +61,23 @@ public void addCompletion(JSCompletion completion) { methodFieldCompletions.put(completion.getLookupName(), completion); } - public JSCompletion removeCompletion(String completionLookup, SourceCompletionProvider provider) - { + public JSCompletion removeCompletion(String completionLookup, SourceCompletionProvider provider) { JSCompletion completion = getCompletion(completionLookup, provider); - if(completion != null) { + if (completion != null) { removeCompletion(this, completion); } return completion; } /** - * Recursively walk through completions for this and extended classes to remove completion for this lookup name + * Recursively walk through completions for this and extended classes to remove completion for this lookup name. + * * @param type * @param completion The completion to remove. */ private void removeCompletion(JavaScriptType type, JSCompletion completion) { - if(type.methodFieldCompletions.containsKey(completion.getLookupName())) { + if (type.methodFieldCompletions.containsKey(completion.getLookupName())) { type.methodFieldCompletions.remove(completion.getLookupName()); } //get extended classes and recursively remove method from them @@ -86,15 +87,15 @@ private void removeCompletion(JavaScriptType type, JSCompletion completion) { } /** - * Adds a constructor completion to CachedType object type + * Adds a constructor completion to CachedType object type. + * * @param completion */ public void addConstructor(JSCompletion completion) { constructors.put(completion.getLookupName(), completion); } - public void removeConstructor(JSCompletion completion) - { + public void removeConstructor(JSCompletion completion) { constructors.remove(completion.getLookupName()); } @@ -114,7 +115,8 @@ public JSCompletion getClassTypeCompletion() { } /** - * @param completionLookup + * @param completionLookup The lookup. + * @param provider The completion provider. * @return JSCompletion using lookup name * @see JSCompletion */ @@ -129,7 +131,7 @@ public JSCompletion getCompletion(String completionLookup, * @return JSCompletion using lookup name * @see JSCompletion */ - protected JSCompletion _getCompletion(String completionLookup, SourceCompletionProvider provider) { + protected JSCompletion getCompletionImpl(String completionLookup, SourceCompletionProvider provider) { return methodFieldCompletions.get(completionLookup); } @@ -144,8 +146,7 @@ protected JSCompletion _getCompletion(String completionLookup, SourceCompletionP */ private static JSCompletion getCompletion(JavaScriptType cachedType, String completionLookup, SourceCompletionProvider provider) { - JSCompletion completion = cachedType._getCompletion(completionLookup, - provider); + JSCompletion completion = cachedType.getCompletionImpl(completionLookup, provider); if (completion == null) { // try the extended types for (JavaScriptType javaScriptType : cachedType.getExtendedClasses()) { @@ -162,16 +163,17 @@ private static JSCompletion getCompletion(JavaScriptType cachedType, * @return A map of completion names to completions. * @see JSCompletion */ - public HashMap getMethodFieldCompletions() { + public Map getMethodFieldCompletions() { return methodFieldCompletions; } - public HashMap getConstructorCompletions() { + public Map getConstructorCompletions() { return constructors; } /** + * Returns the type. * * @return Get type declaration for CachedType * @see TypeDeclaration @@ -182,7 +184,7 @@ public TypeDeclaration getType() { /** - * Add Cached Type extension + * Add Cached Type extension. * * @param type * @see JavaScriptType @@ -193,6 +195,7 @@ public void addExtension(JavaScriptType type) { /** + * Returns the list of extended classes. * * @return list of CachedType extended classes */ diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptTypesFactory.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptTypesFactory.java index 5f96f105..e2ba88d8 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptTypesFactory.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/JavaScriptTypesFactory.java @@ -37,29 +37,26 @@ public abstract class JavaScriptTypesFactory { - protected HashMap cachedTypes = - new HashMap<>(); + protected Map cachedTypes = new HashMap<>(); private boolean useBeanproperties; protected TypeDeclarationFactory typesFactory; private static final List UNSUPPORTED_COMPLETIONS; - private static String SPECIAL_METHOD = ""; + private static final String SPECIAL_METHOD = ""; //list of unsupported completions e.g. java.lang.Object as JavaScript has it's own - static - { + static { UNSUPPORTED_COMPLETIONS = new ArrayList<>(); UNSUPPORTED_COMPLETIONS.add("java.lang.Object"); } - public JavaScriptTypesFactory(TypeDeclarationFactory typesFactory) - { + public JavaScriptTypesFactory(TypeDeclarationFactory typesFactory) { this.typesFactory = typesFactory; } private static class DefaultJavaScriptTypeFactory extends JavaScriptTypesFactory { - public DefaultJavaScriptTypeFactory(TypeDeclarationFactory typesFactory) { + DefaultJavaScriptTypeFactory(TypeDeclarationFactory typesFactory) { super(typesFactory); } } @@ -88,7 +85,8 @@ public boolean isUseBeanProperties() { * @param type TypeDeclaration to read from the API e.g. JSString * @param manager JarManager containing source and classes * @param text - full text entered by user - * @param provider CompletionsProvider to bind the Completion + * @param provider CompletionsProvider to bind the Completion. + * @return The type, or {@code null} if ???. */ public JavaScriptType getCachedType(TypeDeclaration type, JarManager manager, DefaultCompletionProvider provider, @@ -111,14 +109,13 @@ public JavaScriptType getCachedType(TypeDeclaration type, } - public ClassFile getClassFile(JarManager manager, TypeDeclaration type) - { + public ClassFile getClassFile(JarManager manager, TypeDeclaration type) { return manager != null ? manager.getClassEntry(type.getQualifiedName()) : null; } /** * Read the class file and extract all completions, add them all to the - * CachedType + * CachedType. * * @param cachedType CachedType to populate all completions * @param cf ClassFile to read @@ -167,7 +164,7 @@ private void readMethodsAndFieldsFromTypeDeclaration( boolean isJSType = typesFactory.isJavaScriptType(cachedType.getType()); //set the class type only for JavaScript types for now - if(isJSType) { + if (isJSType) { cachedType.setClassTypeCompletion(new JSClassCompletion(provider, cf, false)); } @@ -176,7 +173,8 @@ private void readMethodsAndFieldsFromTypeDeclaration( for (int i = 0; i < methodCount; i++) { MethodInfo info = cf.getMethodInfo(i); if (!info.isConstructor() && !SPECIAL_METHOD.equals(info.getName())) { - if(isAccessible(info.getAccessFlags(), staticOnly, isJSType) && ((staticOnly && info.isStatic()) || !staticOnly)) { + if (isAccessible(info.getAccessFlags(), staticOnly, isJSType) && + ((staticOnly && info.isStatic()) || !staticOnly)) { JSFunctionCompletion completion = new JSFunctionCompletion(provider, info, true); cachedType.addCompletion(completion); } @@ -190,9 +188,8 @@ private void readMethodsAndFieldsFromTypeDeclaration( } //load constructors for JavaScript types only - if(isJSType && info.isConstructor() && !SPECIAL_METHOD.equals(info.getName())) { - if(typesFactory.canJavaScriptBeInstantiated(cachedType.getType().getQualifiedName())) - { + if (isJSType && info.isConstructor() && !SPECIAL_METHOD.equals(info.getName())) { + if (typesFactory.canJavaScriptBeInstantiated(cachedType.getType().getQualifiedName())) { JSConstructorCompletion completion = new JSConstructorCompletion(provider, info); cachedType.addConstructor(completion); } @@ -250,7 +247,7 @@ private boolean isAccessible(MemberInfo info, boolean staticOnly, boolean isJJTy } /** - * Returns whether the value is accessible based on the access flag for Methods and Fields + * Returns whether the value is accessible based on the access flag for Methods and Fields. * Rules are as follows: *
      *
    1. staticsOnly && public return true; //All public static methods and fields
    2. @@ -260,21 +257,20 @@ private boolean isAccessible(MemberInfo info, boolean staticOnly, boolean isJJTy * @param access - access flag to test * @param staticsOnly - whether loading static methods and fields only * @param isJSType - is a built in JavasScript type - * @return + * @return Whether the value is accessible. */ - private boolean isAccessible(int access, boolean staticsOnly, boolean isJSType) - { + private boolean isAccessible(int access, boolean staticsOnly, boolean isJSType) { boolean accessible = false; - if (staticsOnly && org.fife.rsta.ac.java.classreader.Util.isPublic(access) - || !staticsOnly && org.fife.rsta.ac.java.classreader.Util.isPublic(access) || (isJSType && org.fife.rsta.ac.java.classreader.Util.isProtected(access))){ + if (staticsOnly && org.fife.rsta.ac.java.classreader.Util.isPublic(access) || + !staticsOnly && org.fife.rsta.ac.java.classreader.Util.isPublic(access) || + (isJSType && org.fife.rsta.ac.java.classreader.Util.isProtected(access))){ accessible = true; } return accessible; } - public TypeDeclaration createNewTypeDeclaration(ClassFile cf, boolean staticOnly) - { + public TypeDeclaration createNewTypeDeclaration(ClassFile cf, boolean staticOnly) { return createNewTypeDeclaration(cf, staticOnly, true); } @@ -282,8 +278,7 @@ public TypeDeclaration createNewTypeDeclaration(ClassFile cf, boolean staticOnly String className = cf.getClassName(false); String packageName = cf.getPackageName(); - if(staticOnly && !addToCache) - { + if (staticOnly && !addToCache) { return new TypeDeclaration(packageName, className, cf .getClassName(true), staticOnly); } @@ -291,11 +286,11 @@ public TypeDeclaration createNewTypeDeclaration(ClassFile cf, boolean staticOnly String qualified = cf.getClassName(true); //lookup type TypeDeclaration td = typesFactory.getTypeDeclaration(qualified); - if(td == null) { + if (td == null) { td = new TypeDeclaration(packageName, className, cf .getClassName(true), staticOnly); // now add to types factory - if(addToCache) + if (addToCache) typesFactory.addType(qualified, td); } @@ -373,9 +368,10 @@ public JavaScriptType makeJavaScriptType(TypeDeclaration type) { } /** - * Return all the JavaScript types that are part of the ECMA API + * Return all the JavaScript types that are part of the ECMA API. + * * @param provider SourceCompletionProvider - * @return + * @return The types. */ public List getECMAObjectTypes(SourceCompletionProvider provider) { List constructors = new ArrayList<>(); @@ -385,7 +381,7 @@ public List getECMAObjectTypes(SourceCompletionProvider provider for (JavaScriptObject object : types) { TypeDeclaration type = typesFactory.getTypeDeclaration(object.getName()); JavaScriptType js = getCachedType(type, manager, provider, null); - if(js != null) { + if (js != null) { constructors.add(js); } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/RhinoJavaScriptTypesFactory.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/RhinoJavaScriptTypesFactory.java index 3a8240eb..45339773 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/RhinoJavaScriptTypesFactory.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/jsType/RhinoJavaScriptTypesFactory.java @@ -2,6 +2,7 @@ import java.util.HashSet; import java.util.LinkedHashSet; +import java.util.Set; import org.fife.rsta.ac.java.JarManager; import org.fife.rsta.ac.java.classreader.ClassFile; @@ -24,8 +25,7 @@ public class RhinoJavaScriptTypesFactory extends JSR223JavaScriptTypesFactory { private LinkedHashSet importClasses = new LinkedHashSet<>(); private LinkedHashSet importPackages = new LinkedHashSet<>(); - public RhinoJavaScriptTypesFactory(TypeDeclarationFactory typesFactory) - { + public RhinoJavaScriptTypesFactory(TypeDeclarationFactory typesFactory) { super(typesFactory); } @@ -38,31 +38,27 @@ public void addImportPackage(String packageName) { importPackages.add(packageName); } - public void mergeImports(HashSet packages, HashSet classes) - { + public void mergeImports(Set packages, Set classes) { mergeImports(packages, importPackages, true); mergeImports(classes, importClasses, false); } - private void mergeImports(HashSet newImports, LinkedHashSet oldImports, boolean packages) - { + private void mergeImports(Set newImports, LinkedHashSet oldImports, boolean packages) { //iterate through the old imports and check whether the import exists in new. If not then add to remove and remove all types for that package/class HashSet remove = new HashSet<>(); for (String obj : oldImports) { - if(!newImports.contains(obj)) { + if (!newImports.contains(obj)) { remove.add(obj); } } //now iterate through the remove list and remove imports not needed - if(!remove.isEmpty()) - { + if (!remove.isEmpty()) { HashSet removeTypes = new HashSet<>(); for (String name : remove) { for (TypeDeclaration dec : cachedTypes.keySet()) { - if((packages && dec.getQualifiedName().startsWith(name)) || (!packages && dec.getQualifiedName().equals(name))) - { + if ((packages && dec.getQualifiedName().startsWith(name)) || (!packages && dec.getQualifiedName().equals(name))) { removeAllTypes(cachedTypes.get(dec)); removeTypes.add(dec); } @@ -71,8 +67,7 @@ private void mergeImports(HashSet newImports, LinkedHashSet oldI cachedTypes.keySet().removeAll(removeTypes); } - if(canClearCache(newImports, oldImports)) - { + if (canClearCache(newImports, oldImports)) { //now clear and swap oldImports.clear(); //remove types @@ -88,13 +83,13 @@ private void mergeImports(HashSet newImports, LinkedHashSet oldI * @param oldImports * @return */ - private boolean canClearCache(HashSet newImports, LinkedHashSet oldImports) { - if(newImports.size() != oldImports.size()) { + private boolean canClearCache(Set newImports, LinkedHashSet oldImports) { + if (newImports.size() != oldImports.size()) { return true; } for (String im : oldImports) { - if(!newImports.contains(im)) { + if (!newImports.contains(im)) { return true; } } @@ -102,15 +97,13 @@ private boolean canClearCache(HashSet newImports, LinkedHashSet return false; } - public void clearImportCache() - { + public void clearImportCache() { importClasses.clear(); importPackages.clear(); clearAllImportTypes(); } - private void clearAllImportTypes() - { + private void clearAllImportTypes() { HashSet removeTypes = new HashSet<>(); //clear all non ECMA (JavaScript types) for importPackage and importClass to work properly for (TypeDeclaration dec : cachedTypes.keySet()) { @@ -126,13 +119,10 @@ private void clearAllImportTypes() * Remove all TypeDeclarations from the TypeDeclarationFactory from the JavaScriptType and all it's extended classes * @param type */ - private void removeAllTypes(JavaScriptType type) - { - if(type != null) - { + private void removeAllTypes(JavaScriptType type) { + if (type != null) { typesFactory.removeType(type.getType().getQualifiedName()); - if(type.getExtendedClasses().size() > 0) - { + if (!type.getExtendedClasses().isEmpty()) { for (JavaScriptType extendedType : type.getExtendedClasses()) { removeAllTypes(extendedType); } @@ -158,10 +148,8 @@ public ClassFile getClassFile(JarManager manager, TypeDeclaration type) { return file; } - private String removePackagesFromType(String type) - { - if(type.startsWith(RhinoJavaScriptAstParser.PACKAGES)) - { + private String removePackagesFromType(String type) { + if (type.startsWith(RhinoJavaScriptAstParser.PACKAGES)) { return RhinoJavaScriptAstParser.removePackages(type); } return type; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptAstParser.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptAstParser.java index 163fc556..0125243b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptAstParser.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptAstParser.java @@ -77,8 +77,8 @@ private void setFunctionValues() { /** - * for each child of parent AstNode add a new code block and add completions - * for each block of code + * For each child of parent AstNode add a new code block and add completions + * for each block of code. * * @param parent AstNode to iterate children * @param set completions set to add to @@ -89,7 +89,7 @@ private void setFunctionValues() { private void addCodeBlock(Node parent, Set set, String entered, CodeBlock codeBlock, int offset) { - if(parent == null) + if (parent == null) return; Node child = parent.getFirstChild(); @@ -290,7 +290,7 @@ private void addVariableToResolver(AstNode name, AstNode target, dec.setTypeDeclaration(target); } else { - if(dec != null) { + if (dec != null) { dec.setTypeDeclaration(provider.getTypesFactory().getDefaultTypeDeclaration()); } } @@ -321,7 +321,7 @@ private void processCaseNode(Node child, CodeBlock block, if (canProcessNode(switchCase)) { block = block.addChildCodeBlock(start); block.setEndOffset(offset); - if(statements != null) { + if (statements != null) { for (AstNode node : statements) { iterateNode(node, set, entered, block, offset); } @@ -330,13 +330,13 @@ private void processCaseNode(Node child, CodeBlock block, } - /** Extract local variables from switch node* */ + /** Extract local variables from switch node. */ private void processSwitchNode(Node child, CodeBlock block, Set set, String entered, int offset) { SwitchStatement switchStatement = (SwitchStatement) child; if (canProcessNode(switchStatement)) { List cases = switchStatement.getCases(); - if(cases != null) { + if (cases != null) { for (SwitchCase switchCase : cases) { iterateNode(switchCase, set, entered, block, offset); } @@ -346,7 +346,7 @@ private void processSwitchNode(Node child, CodeBlock block, /** - * Extract variables from try/catch node(s) + * Extract variables from try/catch node(s). */ private void processTryCatchNode(Node child, CodeBlock block, Set set, String entered, int offset) { @@ -397,7 +397,7 @@ private void processTryCatchNode(Node child, CodeBlock block, /** - * Extract variables from if/else node(s) + * Extract variables from if/else node(s). */ private void processIfThenElse(Node child, CodeBlock block, Set set, String entered, int offset) { @@ -420,7 +420,7 @@ private void processIfThenElse(Node child, CodeBlock block, /** - * Extract completions from expression node + * Extract completions from expression node. */ private void processExpressionNode(Node child, CodeBlock block, Set set, String entered, int offset) { @@ -432,7 +432,7 @@ private void processExpressionNode(Node child, CodeBlock block, /** - * Extract while loop from node and add new code block + * Extract while loop from node and add new code block. */ private void processWhileNode(Node child, CodeBlock block, Set set, String entered, int offset) { @@ -445,7 +445,7 @@ private void processWhileNode(Node child, CodeBlock block, /** - * Extract while loop from node and add new code block + * Extract while loop from node and add new code block. */ private void processDoNode(Node child, CodeBlock block, Set set, String entered, int offset) { @@ -473,7 +473,7 @@ private void processInfix(Node child, CodeBlock block, /** * Add function to completions set and extract local variables to add to - * code block TODO: functions can have local scope, so add function to it's + * code block. TODO: functions can have local scope, so add function to it's * own codeblock when applicable */ private void processFunctionNode(Node child, CodeBlock block, @@ -535,7 +535,7 @@ private void processFunctionNode(Node child, CodeBlock block, private JavaScriptFunctionDeclaration createJavaScriptFunction(String lookupName, int offset, CodeBlock block, TypeDeclaration returnType, FunctionNode fn) { Name name = fn.getFunctionName(); JavaScriptFunctionDeclaration function = new JavaScriptFunctionDeclaration(lookupName, offset, block, returnType); - if(name != null) { + if (name != null) { int start = name.getAbsolutePosition(); int end = start + name.getLength(); function.setStartOffset(start); @@ -562,13 +562,12 @@ private TypeDeclaration getFunctionType(FunctionNode fn) { /** - * Extract variable from node and add to code block + * Extract variable from node and add to code block. */ private void processVariableNode(Node child, CodeBlock block, Set set, String entered, int offset) { //check block can resolve variable or is pre-processing variables - if(block.contains(dot) || isPreProcessing()) - { + if (block.contains(dot) || isPreProcessing()) { VariableDeclaration varDec = (VariableDeclaration) child; List vars = varDec.getVariables(); for (VariableInitializer var : vars) { @@ -601,12 +600,10 @@ else if (child instanceof ForInLoop) { AstNode iteratedObject = loop.getIteratedObject(); AstNode iterator = loop.getIterator(); if (iterator != null) { - if (iterator.getType() == Token.VAR) // expected - { + if (iterator.getType() == Token.VAR) { // expected VariableDeclaration vd = (VariableDeclaration) iterator; List variables = vd.getVariables(); - if (variables.size() == 1) // expected - { + if (variables.size() == 1) { // expected VariableInitializer vi = variables.get(0); if (loop.isForEach()) { extractVariableForForEach(vi, block, offset, @@ -626,7 +623,7 @@ else if (child instanceof ForInLoop) { /** - * Extract the variable from the Variable initializer and set the Type + * Extract the variable from the Variable initializer and set the Type. * * @param initializer AstNode from which to extract the variable * @param block code block to add the variable too @@ -746,7 +743,7 @@ private boolean canAddVariable(CodeBlock block) { /** - * Extract the variable from the Rhino node and add to the CodeBlock + * Extract the variable from the Rhino node and add to the CodeBlock. * * @param node AstNode node from which to extract the variable * @param block code block to add the variable too @@ -759,7 +756,7 @@ private JavaScriptVariableDeclaration extractVariableFromNode(AstNode node, /** - * Extract the variable from the Rhino node and add to the CodeBlock + * Extract the variable from the Rhino node and add to the CodeBlock. * * @param node AstNode node from which to extract the variable * @param block code block to add the variable too @@ -817,7 +814,7 @@ public int getDot() { } - private class FunctionReturnVisitor implements NodeVisitor { + private final class FunctionReturnVisitor implements NodeVisitor { private ArrayList returnStatements = new ArrayList<>(); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptParser.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptParser.java index 9388d0fa..af217b6e 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptParser.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/JavaScriptParser.java @@ -16,7 +16,8 @@ public abstract class JavaScriptParser { protected TypeDeclarationOptions options; /** - * JavaScriptParser constructor + * JavaScriptParser constructor. + * * @param provider * @param dot * @param options @@ -29,7 +30,8 @@ public JavaScriptParser(SourceCompletionProvider provider, int dot, } /** - * Converts AstRoot to CodeBlock + * Converts AstRoot to CodeBlock. + * * @param root AstRoot to iterate * @param set completions set * @param entered text entered by user @@ -39,7 +41,7 @@ public abstract CodeBlock convertAstNodeToCodeBlock(AstRoot root, Set set, String entered); /** - * If options are null, then it is assumed that the main editor text is being parsed + * If options are null, then it is assumed that the main editor text is being parsed. * @return whether options is not null and is in pre-processing mode. * */ diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/RhinoJavaScriptAstParser.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/RhinoJavaScriptAstParser.java index a48f1dd8..a7729186 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/RhinoJavaScriptAstParser.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/parser/RhinoJavaScriptAstParser.java @@ -1,6 +1,5 @@ package org.fife.rsta.ac.js.ast.parser; -import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; @@ -38,7 +37,7 @@ public RhinoJavaScriptAstParser(SourceCompletionProvider provider, int dot, */ public void clearImportCache(SourceCompletionProvider provider) { JavaScriptTypesFactory typesFactory = provider.getJavaScriptTypesFactory(); - if(typesFactory instanceof RhinoJavaScriptTypesFactory) { + if (typesFactory instanceof RhinoJavaScriptTypesFactory) { ((RhinoJavaScriptTypesFactory) typesFactory).clearImportCache(); } } @@ -58,27 +57,27 @@ public CodeBlock convertAstNodeToCodeBlock(AstRoot root, } } - private void mergeImportCache(HashSet packages, HashSet classes) { + private void mergeImportCache(Set packages, Set classes) { JavaScriptTypesFactory typesFactory = provider.getJavaScriptTypesFactory(); - if(typesFactory instanceof RhinoJavaScriptTypesFactory) { + if (typesFactory instanceof RhinoJavaScriptTypesFactory) { ((RhinoJavaScriptTypesFactory) typesFactory).mergeImports(packages, classes); } } /** - * Overridden iterateNode to intercept Token.EXPR_RESULT and check for importPackage and importClass named nodes + * Overridden iterateNode to intercept Token.EXPR_RESULT and check for importPackage and importClass named nodes. * If found, then process them and extract the imports and add them to RhinoJavaScriptTypesFactory then return * otherwise call super.iterateNode() */ @Override - protected void iterateNode(AstNode child, Set set, + protected void iterateNode(AstNode child, Set set, String entered, CodeBlock block, int offset) { //look for importPackage and importClass switch (child.getType()) { case Token.EXPR_RESULT: boolean importFound = processImportNode(child, set, entered, block, offset); - if(importFound) + if (importFound) return; //already processed node break; } @@ -87,7 +86,8 @@ protected void iterateNode(AstNode child, Set set, } /** - * Look for text importPackage and importClass and add to cache + * Look for text importPackage and importClass and add to cache. + * * @param child AstNode to check. This will always be Token.EXPR_RESULT AstNode * @param set Set to add completions * @param entered text entered by user if applicable @@ -100,12 +100,12 @@ private boolean processImportNode(AstNode child, int offset) { String src = JavaScriptHelper.convertNodeToSource(child); - if(src != null) { - if(src.startsWith("importPackage")) { + if (src != null) { + if (src.startsWith("importPackage")) { processImportPackage(src); return true; } - else if(src.startsWith("importClass")) { + else if (src.startsWith("importClass")) { processImportClass(src); return true; } @@ -115,12 +115,10 @@ else if(src.startsWith("importClass")) { return false; } - public static String removePackages(String src) - { - if(src.startsWith(PACKAGES)) - { + public static String removePackages(String src) { + if (src.startsWith(PACKAGES)) { String pkg = src.substring(PACKAGES.length()); - if(pkg != null) { + if (pkg != null) { StringBuilder sb = new StringBuilder(); //remove any non java characters char[] chars = pkg.toCharArray(); @@ -129,7 +127,7 @@ public static String removePackages(String src) sb.append(ch); } } - if(sb.length() > 0) { + if (sb.length() > 0) { return sb.toString(); } } @@ -149,14 +147,15 @@ public static String removePackages(String src) private String extractNameFromSrc(String src) { int startIndex = src.indexOf("("); int endIndex = src.indexOf(")"); - if(startIndex != -1 && endIndex != -1) { + if (startIndex != -1 && endIndex != -1) { return removePackages(src.substring(startIndex + 1, endIndex)); } return removePackages(src); } /** - * Adds package name to RhinoJavaScriptTypesFactory + * Adds package name to RhinoJavaScriptTypesFactory. + * * @param src source text to extract the package */ private void processImportPackage(String src) { @@ -165,7 +164,8 @@ private void processImportPackage(String src) { } /** - * Adds class name to RhinoJavaScriptTypesFactory + * Adds class name to RhinoJavaScriptTypesFactory. + * * @param src source text to extract the class name */ private void processImportClass(String src) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ArrayTypeDeclaration.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ArrayTypeDeclaration.java index 2c497f66..a012bac9 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ArrayTypeDeclaration.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ArrayTypeDeclaration.java @@ -66,4 +66,12 @@ public boolean equals(Object obj) { return equals; } + @Override + public int hashCode() { + int hash = super.hashCode(); + if (arrayType != null) { + hash = 31 * hash + arrayType.hashCode(); + } + return hash; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclaration.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclaration.java index e7efeb9c..c497d02f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclaration.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclaration.java @@ -52,11 +52,10 @@ public String getJSName() { public String getQualifiedName() { - return pkg != null && pkg.length() > 0 ? (pkg + '.' + apiName) : apiName; + return pkg != null && !pkg.isEmpty() ? (pkg + '.' + apiName) : apiName; } - public boolean isQualified() - { + public boolean isQualified() { return getQualifiedName().indexOf('.') != -1; } @@ -82,7 +81,7 @@ public boolean equals(Object obj) { if (this == obj) return true; - if((obj == null) || (obj.getClass() != this.getClass())) + if ((obj == null) || (obj.getClass() != this.getClass())) return false; if (obj instanceof TypeDeclaration) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclarationFactory.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclarationFactory.java index 25c4431e..1c4dce27 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclarationFactory.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/TypeDeclarationFactory.java @@ -32,8 +32,7 @@ public class TypeDeclarationFactory { private TypeDeclarations ecma; - public TypeDeclarationFactory() - { + public TypeDeclarationFactory() { setTypeDeclarationVersion(null, false, false); } @@ -41,25 +40,23 @@ public TypeDeclarationFactory() public List setTypeDeclarationVersion(String ecmaVersion, boolean xmlSupported, boolean client) { - try - { + try { ecmaVersion = ecmaVersion == null ? getDefaultECMAVersion() : ecmaVersion; //try to instantiate classes Class ecmaClass = TypeDeclarationFactory.class.getClassLoader().loadClass(ecmaVersion); ecma = (TypeDeclarations) ecmaClass.getDeclaredConstructor().newInstance(); } - catch(Exception e) - { + catch (Exception e) { //TODO log error? //ignore this ecma = new TypeDeclarationsECMAv5(); } - if(xmlSupported) { //add E4X API + if (xmlSupported) { //add E4X API new ECMAvE4xAdditions().addAdditionalTypes(ecma); } - if(client) { + if (client) { //for client we are going to add DOM, HTML DOM and Browser attributes/methods new ClientBrowserAdditions().addAdditionalTypes(ecma); new DOMAdditions().addAdditionalTypes(ecma); @@ -73,8 +70,7 @@ public List setTypeDeclarationVersion(String ecmaVersion, /** * @return Default base ECMA implementation */ - protected String getDefaultECMAVersion() - { + protected String getDefaultECMAVersion() { return TypeDeclarationsECMAv5.class.getName(); } @@ -97,14 +93,13 @@ public void removeType(String name) { * @param td The type declaration to check. * @return Whether it is a built-in JS type. */ - public boolean isJavaScriptType(TypeDeclaration td) - { + public boolean isJavaScriptType(TypeDeclaration td) { return ecma.isJavaScriptType(td); } /** - * + * Returns the type declaration. * @param name * @return Lookup type declaration from name. If the * TypeDeclaration cannot be found, then lookup using @@ -139,7 +134,7 @@ public String convertJavaScriptType(String lookupName, boolean qualified) { //remove param descriptor type from type e.g. java.util.Iterator --> java.util.Iterator //as JavaScript does not support this - if(lookupName.indexOf('<') > -1) { + if (lookupName.indexOf('<') > -1) { lookupName = lookupName.substring(0, lookupName.indexOf('<')); } @@ -168,9 +163,9 @@ public void addType(String name, TypeDeclaration dec) { ecma.addTypeDeclaration(name, dec); } - public String getClassName(String lookup) throws RuntimeException { + public String getClassName(String lookup) { TypeDeclaration td = getTypeDeclaration(lookup); - if(td != null) { + if (td != null) { return td.getQualifiedName(); } //else @@ -178,8 +173,9 @@ public String getClassName(String lookup) throws RuntimeException { } /** + * Returns the set of ECMA {@code JavaScriptObjects}. * - * @return a list of ECMA JavaScriptObjects + * @return The set of ECMA JavaScriptObjects */ public Set getECMAScriptObjects() { return ecma.getJavaScriptObjects(); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/TypeDeclarations.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/TypeDeclarations.java index 8a49216b..81d4cde2 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/TypeDeclarations.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/TypeDeclarations.java @@ -1,10 +1,6 @@ package org.fife.rsta.ac.js.ast.type.ecma; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import org.fife.rsta.ac.js.JavaScriptHelper; import org.fife.rsta.ac.js.ast.type.ArrayTypeDeclaration; @@ -40,10 +36,10 @@ public abstract class TypeDeclarations { public static String NULL_TYPE = "void"; - private final HashMap types = new HashMap<>(); + private final Map types = new HashMap<>(); // reverse lookup for Java types to Javascript types - private final HashMap javascriptReverseLookup = new HashMap<>(); + private final Map javascriptReverseLookup = new HashMap<>(); private final HashSet ecmaObjects = new HashSet<>(); @@ -197,8 +193,9 @@ public boolean isJavaScriptType(TypeDeclaration td) { /** + * Returns the type declaration. * - * @param name + * @param name The type to look up. * @return Lookup type declaration from name. If the * TypeDeclaration cannot be found, then lookup using * reserve lookup @@ -261,14 +258,13 @@ public Set getJavaScriptObjects() { * @param name name of class to test * */ - public boolean canECMAObjectBeInstantiated(String name) - { + public boolean canECMAObjectBeInstantiated(String name) { String tempName = javascriptReverseLookup.get(name); - if(tempName != null) { + if (tempName != null) { name = tempName; } for (JavaScriptObject jo : ecmaObjects) { - if(jo.getName().equals(name)) { + if (jo.getName().equals(name)) { return jo.canBeInstantiated(); } } @@ -303,11 +299,10 @@ public boolean canBeInstantiated() { @Override public boolean equals(Object jsObj) { - if(jsObj == this) + if (jsObj == this) return true; - if(jsObj instanceof JavaScriptObject) - { + if (jsObj instanceof JavaScriptObject) { return ((JavaScriptObject) jsObj).getName().equals(getName()); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/DOMAdditions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/DOMAdditions.java index a1110aeb..1ae58e1c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/DOMAdditions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/DOMAdditions.java @@ -10,31 +10,31 @@ public class DOMAdditions implements ECMAAdditions { @Override public void addAdditionalTypes(TypeDeclarations typeDecs) { //add all client DOM objects - typeDecs.addTypeDeclaration("Attr", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSAttr", "Attr", false, false)); - typeDecs.addTypeDeclaration("CDATASection", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSCDATASection", "CDATASection", false, false)); - typeDecs.addTypeDeclaration("CharacterData", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSCharacterData", "CharacterData", false, false)); - typeDecs.addTypeDeclaration("Comment", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSComment", "Comment", false, false)); - typeDecs.addTypeDeclaration("Document", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDocument", "Document", false, false)); - typeDecs.addTypeDeclaration("DocumentFragment", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDocumentFragment", "DocumentFragment", false, false)); - typeDecs.addTypeDeclaration("DocumentType", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDocumentType", "DocumentType", false, false)); - typeDecs.addTypeDeclaration("DOMConfiguration", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDOMConfiguration", "DOMConfiguration", false, false)); - typeDecs.addTypeDeclaration("DOMImplementation", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDOMImplementation", "DOMImplementation", false, false)); - typeDecs.addTypeDeclaration("DOMImplementationList", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDOMImplementationList", "DOMImplementationList", false, false)); - typeDecs.addTypeDeclaration("DOMImplementationSource", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "DOMImplementationSource", "DOMImplementationSource", false, false)); - typeDecs.addTypeDeclaration("DOMLocator", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDOMLocator", "DOMLocator", false, false)); - typeDecs.addTypeDeclaration("DOMStringList", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSDOMStringList", "DOMStringList", false, false)); - typeDecs.addTypeDeclaration("Element", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSElement", "Element", false, false)); - typeDecs.addTypeDeclaration("Entity", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSEntity", "Entity", false, false)); - typeDecs.addTypeDeclaration("EntityReference", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSEntityReference", "EntityReference", false, false)); - typeDecs.addTypeDeclaration("NamedNodeMap", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSNamedNodeMap", "NamedNodeMap", false, false)); - typeDecs.addTypeDeclaration("NameList", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSNameList", "NameList", false, false)); - typeDecs.addTypeDeclaration("Node", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSNode", "Node", false, false)); - typeDecs.addTypeDeclaration("NodeList", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSNodeList", "NodeList", false, false)); - typeDecs.addTypeDeclaration("Notation", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSNotation", "Notation", false, false)); - typeDecs.addTypeDeclaration("ProcessingInstruction", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSProcessingInstruction", "ProcessingInstruction", false, false)); - typeDecs.addTypeDeclaration("Text", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSText", "Text", false, false)); - typeDecs.addTypeDeclaration("TypeInfo", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSTypeInfo", "TypeInfo", false, false)); - typeDecs.addTypeDeclaration("UserDataHandler", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom", "JSUserDataHandler", "UserDataHandler", false, false)); + typeDecs.addTypeDeclaration("Attr", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSAttr", "Attr", false, false)); + typeDecs.addTypeDeclaration("CDATASection", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSCDATASection", "CDATASection", false, false)); + typeDecs.addTypeDeclaration("CharacterData", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSCharacterData", "CharacterData", false, false)); + typeDecs.addTypeDeclaration("Comment", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSComment", "Comment", false, false)); + typeDecs.addTypeDeclaration("Document", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDocument", "Document", false, false)); + typeDecs.addTypeDeclaration("DocumentFragment", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDocumentFragment", "DocumentFragment", false, false)); + typeDecs.addTypeDeclaration("DocumentType", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDocumentType", "DocumentType", false, false)); + typeDecs.addTypeDeclaration("DOMConfiguration", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDOMConfiguration", "DOMConfiguration", false, false)); + typeDecs.addTypeDeclaration("DOMImplementation", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDOMImplementation", "DOMImplementation", false, false)); + typeDecs.addTypeDeclaration("DOMImplementationList", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDOMImplementationList", "DOMImplementationList", false, false)); + typeDecs.addTypeDeclaration("DOMImplementationSource", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "DOMImplementationSource", "DOMImplementationSource", false, false)); + typeDecs.addTypeDeclaration("DOMLocator", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDOMLocator", "DOMLocator", false, false)); + typeDecs.addTypeDeclaration("DOMStringList", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSDOMStringList", "DOMStringList", false, false)); + typeDecs.addTypeDeclaration("Element", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSElement", "Element", false, false)); + typeDecs.addTypeDeclaration("Entity", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSEntity", "Entity", false, false)); + typeDecs.addTypeDeclaration("EntityReference", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSEntityReference", "EntityReference", false, false)); + typeDecs.addTypeDeclaration("NamedNodeMap", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSNamedNodeMap", "NamedNodeMap", false, false)); + typeDecs.addTypeDeclaration("NameList", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSNameList", "NameList", false, false)); + typeDecs.addTypeDeclaration("Node", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSNode", "Node", false, false)); + typeDecs.addTypeDeclaration("NodeList", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSNodeList", "NodeList", false, false)); + typeDecs.addTypeDeclaration("Notation", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSNotation", "Notation", false, false)); + typeDecs.addTypeDeclaration("ProcessingInstruction", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSProcessingInstruction", "ProcessingInstruction", false, false)); + typeDecs.addTypeDeclaration("Text", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSText", "Text", false, false)); + typeDecs.addTypeDeclaration("TypeInfo", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSTypeInfo", "TypeInfo", false, false)); + typeDecs.addTypeDeclaration("UserDataHandler", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom", "JSUserDataHandler", "UserDataHandler", false, false)); // add dom ecma objects diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/HTMLDOMAdditions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/HTMLDOMAdditions.java index 04d9fe29..b1598a52 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/HTMLDOMAdditions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ast/type/ecma/client/HTMLDOMAdditions.java @@ -9,65 +9,65 @@ public class HTMLDOMAdditions implements ECMAAdditions { @Override public void addAdditionalTypes(TypeDeclarations typeDecs) { - + //add HTML DOM Elements - typeDecs.addTypeDeclaration("HTMLAnchorElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAnchorElement", "HTMLAnchorElement", false, false)); - typeDecs.addTypeDeclaration("HTMLAppletElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAppletElement", "HTMLAppletElement", false, false)); - typeDecs.addTypeDeclaration("HTMLAreaElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAreaElement", "HTMLAreaElement", false, false)); - typeDecs.addTypeDeclaration("HTMLBaseElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBaseElement", "HTMLBaseElement", false, false)); - typeDecs.addTypeDeclaration("HTMLBaseFontElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBaseFontElement", "HTMLBaseFontElement", false, false)); - typeDecs.addTypeDeclaration("HTMLBodyElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBodyElement", "HTMLBodyElement", false, false)); - typeDecs.addTypeDeclaration("HTMLBRElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBRElement", "HTMLBRElement", false, false)); - typeDecs.addTypeDeclaration("HTMLButtonElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLButtonElement", "HTMLButtonElement", false, false)); - typeDecs.addTypeDeclaration("HTMLCollection", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLCollection", "HTMLCollection", false, false)); - typeDecs.addTypeDeclaration("HTMLDirectoryElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDirectoryElement", "HTMLDirectoryElement", false, false)); - typeDecs.addTypeDeclaration("HTMLDivElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDivElement", "HTMLDivElement", false, false)); - typeDecs.addTypeDeclaration("HTMLDListElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDListElement", "HTMLDListElement", false, false)); - typeDecs.addTypeDeclaration("HTMLDocument", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDocument", "HTMLDocument", false, false)); - typeDecs.addTypeDeclaration("HTMLElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLElement", "HTMLElement", false, false)); - typeDecs.addTypeDeclaration("HTMLFieldSetElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFieldSetElement", "HTMLFieldSetElement", false, false)); - typeDecs.addTypeDeclaration("HTMLFontElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFontElement", "HTMLFontElement", false, false)); - typeDecs.addTypeDeclaration("HTMLFormElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFormElement", "HTMLFormElement", false, false)); - typeDecs.addTypeDeclaration("HTMLFrameElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFrameElement", "HTMLFrameElement", false, false)); - typeDecs.addTypeDeclaration("HTMLFrameSetElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFrameSetElement", "HTMLFrameSetElement", false, false)); - typeDecs.addTypeDeclaration("HTMLHeadElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHeadElement", "HTMLHeadElement", false, false)); - typeDecs.addTypeDeclaration("HTMLHeadingElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHeadingElement", "HTMLHeadingElement", false, false)); - typeDecs.addTypeDeclaration("HTMLHRElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHRElement", "HTMLHRElement", false, false)); - typeDecs.addTypeDeclaration("HTMLHtmlElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHtmlElement", "HTMLHtmlElement", false, false)); - typeDecs.addTypeDeclaration("HTMLIFrameElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLIFrameElement", "HTMLIFrameElement", false, false)); - typeDecs.addTypeDeclaration("HTMLImageElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLImageElement", "HTMLImageElement", false, false)); - typeDecs.addTypeDeclaration("HTMLInputElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLInputElement", "HTMLInputElement", false, false)); - typeDecs.addTypeDeclaration("HTMLIsIndexElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLIsIndexElement", "HTMLIsIndexElement", false, false)); - typeDecs.addTypeDeclaration("HTMLLabelElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLabelElement", "HTMLLabelElement", false, false)); - typeDecs.addTypeDeclaration("HTMLLegendElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLegendElement", "HTMLLegendElement", false, false)); - typeDecs.addTypeDeclaration("HTMLLIElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLIElement", "HTMLLIElement", false, false)); - typeDecs.addTypeDeclaration("HTMLLinkElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLinkElement", "HTMLLinkElement", false, false)); - typeDecs.addTypeDeclaration("HTMLMapElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMapElement", "HTMLMapElement", false, false)); - typeDecs.addTypeDeclaration("HTMLMenuElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMenuElement", "HTMLMenuElement", false, false)); - typeDecs.addTypeDeclaration("HTMLMetaElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMetaElement", "HTMLMetaElement", false, false)); - typeDecs.addTypeDeclaration("HTMLModElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLModElement", "HTMLModElement", false, false)); - typeDecs.addTypeDeclaration("HTMLObjectElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLObjectElement", "HTMLObjectElement", false, false)); - typeDecs.addTypeDeclaration("HTMLOListElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOListElement", "HTMLOListElement", false, false)); - typeDecs.addTypeDeclaration("HTMLOptGroupElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptGroupElement", "HTMLOptGroupElement", false, false)); - typeDecs.addTypeDeclaration("HTMLOptionElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptionElement", "HTMLOptionElement", false, false)); - typeDecs.addTypeDeclaration("HTMLOptionsCollection", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptionsCollection", "HTMLOptionsCollection", false, false)); - typeDecs.addTypeDeclaration("HTMLParagraphElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLParagraphElement", "HTMLParagraphElement", false, false)); - typeDecs.addTypeDeclaration("HTMLParamElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLParamElement", "JSHTMLParamElement", false, false)); - typeDecs.addTypeDeclaration("HTMLPreElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLPreElement", "HTMLPreElement", false, false)); - typeDecs.addTypeDeclaration("HTMLQuoteElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLQuoteElement", "HTMLQuoteElement", false, false)); - typeDecs.addTypeDeclaration("HTMLScriptElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLScriptElement", "HTMLScriptElement", false, false)); - typeDecs.addTypeDeclaration("HTMLSelectElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLSelectElement", "HTMLSelectElement", false, false)); - typeDecs.addTypeDeclaration("HTMLStyleElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLStyleElement", "HTMLStyleElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableCaptionElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableCaptionElement", "HTMLTableCaptionElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableCellElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableCellElement", "JSHTMLTableCellElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableColElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableColElement", "HTMLTableColElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableElement", "HTMLTableElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableRowElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableRowElement", "HTMLTableRowElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTableSectionElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableSectionElement", "HTMLTableSectionElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTextAreaElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTextAreaElement", "HTMLTextAreaElement", false, false)); - typeDecs.addTypeDeclaration("HTMLTitleElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTitleElement", "HTMLTitleElement", false, false)); - typeDecs.addTypeDeclaration("HTMLUListElement", new TypeDeclaration( "org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLUListElement", "HTMLUListElement", false, false)); - + typeDecs.addTypeDeclaration("HTMLAnchorElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAnchorElement", "HTMLAnchorElement", false, false)); + typeDecs.addTypeDeclaration("HTMLAppletElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAppletElement", "HTMLAppletElement", false, false)); + typeDecs.addTypeDeclaration("HTMLAreaElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLAreaElement", "HTMLAreaElement", false, false)); + typeDecs.addTypeDeclaration("HTMLBaseElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBaseElement", "HTMLBaseElement", false, false)); + typeDecs.addTypeDeclaration("HTMLBaseFontElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBaseFontElement", "HTMLBaseFontElement", false, false)); + typeDecs.addTypeDeclaration("HTMLBodyElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBodyElement", "HTMLBodyElement", false, false)); + typeDecs.addTypeDeclaration("HTMLBRElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLBRElement", "HTMLBRElement", false, false)); + typeDecs.addTypeDeclaration("HTMLButtonElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLButtonElement", "HTMLButtonElement", false, false)); + typeDecs.addTypeDeclaration("HTMLCollection", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLCollection", "HTMLCollection", false, false)); + typeDecs.addTypeDeclaration("HTMLDirectoryElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDirectoryElement", "HTMLDirectoryElement", false, false)); + typeDecs.addTypeDeclaration("HTMLDivElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDivElement", "HTMLDivElement", false, false)); + typeDecs.addTypeDeclaration("HTMLDListElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDListElement", "HTMLDListElement", false, false)); + typeDecs.addTypeDeclaration("HTMLDocument", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLDocument", "HTMLDocument", false, false)); + typeDecs.addTypeDeclaration("HTMLElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLElement", "HTMLElement", false, false)); + typeDecs.addTypeDeclaration("HTMLFieldSetElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFieldSetElement", "HTMLFieldSetElement", false, false)); + typeDecs.addTypeDeclaration("HTMLFontElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFontElement", "HTMLFontElement", false, false)); + typeDecs.addTypeDeclaration("HTMLFormElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFormElement", "HTMLFormElement", false, false)); + typeDecs.addTypeDeclaration("HTMLFrameElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFrameElement", "HTMLFrameElement", false, false)); + typeDecs.addTypeDeclaration("HTMLFrameSetElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLFrameSetElement", "HTMLFrameSetElement", false, false)); + typeDecs.addTypeDeclaration("HTMLHeadElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHeadElement", "HTMLHeadElement", false, false)); + typeDecs.addTypeDeclaration("HTMLHeadingElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHeadingElement", "HTMLHeadingElement", false, false)); + typeDecs.addTypeDeclaration("HTMLHRElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHRElement", "HTMLHRElement", false, false)); + typeDecs.addTypeDeclaration("HTMLHtmlElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLHtmlElement", "HTMLHtmlElement", false, false)); + typeDecs.addTypeDeclaration("HTMLIFrameElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLIFrameElement", "HTMLIFrameElement", false, false)); + typeDecs.addTypeDeclaration("HTMLImageElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLImageElement", "HTMLImageElement", false, false)); + typeDecs.addTypeDeclaration("HTMLInputElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLInputElement", "HTMLInputElement", false, false)); + typeDecs.addTypeDeclaration("HTMLIsIndexElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLIsIndexElement", "HTMLIsIndexElement", false, false)); + typeDecs.addTypeDeclaration("HTMLLabelElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLabelElement", "HTMLLabelElement", false, false)); + typeDecs.addTypeDeclaration("HTMLLegendElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLegendElement", "HTMLLegendElement", false, false)); + typeDecs.addTypeDeclaration("HTMLLIElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLIElement", "HTMLLIElement", false, false)); + typeDecs.addTypeDeclaration("HTMLLinkElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLLinkElement", "HTMLLinkElement", false, false)); + typeDecs.addTypeDeclaration("HTMLMapElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMapElement", "HTMLMapElement", false, false)); + typeDecs.addTypeDeclaration("HTMLMenuElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMenuElement", "HTMLMenuElement", false, false)); + typeDecs.addTypeDeclaration("HTMLMetaElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLMetaElement", "HTMLMetaElement", false, false)); + typeDecs.addTypeDeclaration("HTMLModElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLModElement", "HTMLModElement", false, false)); + typeDecs.addTypeDeclaration("HTMLObjectElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLObjectElement", "HTMLObjectElement", false, false)); + typeDecs.addTypeDeclaration("HTMLOListElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOListElement", "HTMLOListElement", false, false)); + typeDecs.addTypeDeclaration("HTMLOptGroupElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptGroupElement", "HTMLOptGroupElement", false, false)); + typeDecs.addTypeDeclaration("HTMLOptionElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptionElement", "HTMLOptionElement", false, false)); + typeDecs.addTypeDeclaration("HTMLOptionsCollection", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLOptionsCollection", "HTMLOptionsCollection", false, false)); + typeDecs.addTypeDeclaration("HTMLParagraphElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLParagraphElement", "HTMLParagraphElement", false, false)); + typeDecs.addTypeDeclaration("HTMLParamElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLParamElement", "JSHTMLParamElement", false, false)); + typeDecs.addTypeDeclaration("HTMLPreElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLPreElement", "HTMLPreElement", false, false)); + typeDecs.addTypeDeclaration("HTMLQuoteElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLQuoteElement", "HTMLQuoteElement", false, false)); + typeDecs.addTypeDeclaration("HTMLScriptElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLScriptElement", "HTMLScriptElement", false, false)); + typeDecs.addTypeDeclaration("HTMLSelectElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLSelectElement", "HTMLSelectElement", false, false)); + typeDecs.addTypeDeclaration("HTMLStyleElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLStyleElement", "HTMLStyleElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableCaptionElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableCaptionElement", "HTMLTableCaptionElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableCellElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableCellElement", "JSHTMLTableCellElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableColElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableColElement", "HTMLTableColElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableElement", "HTMLTableElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableRowElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableRowElement", "HTMLTableRowElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTableSectionElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTableSectionElement", "HTMLTableSectionElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTextAreaElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTextAreaElement", "HTMLTextAreaElement", false, false)); + typeDecs.addTypeDeclaration("HTMLTitleElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLTitleElement", "HTMLTitleElement", false, false)); + typeDecs.addTypeDeclaration("HTMLUListElement", new TypeDeclaration("org.fife.rsta.ac.js.ecma.api.dom.html", "JSHTMLUListElement", "HTMLUListElement", false, false)); + //add HTML dom objects typeDecs.addECMAObject("HTMLAnchorElement", true); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSBeanCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSBeanCompletion.java index 93e58709..88f1b564 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSBeanCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSBeanCompletion.java @@ -99,8 +99,7 @@ public String getEnclosingClassName(boolean fullyQualified) { return methodData.getEnclosingClassName(fullyQualified); } - public JSMethodData getMethodData() - { + public JSMethodData getMethodData() { return methodData; } @@ -112,7 +111,7 @@ private static String convertNameToBean(String name) { if (memberIsGetMethod || memberIsIsMethod || memberIsSetMethod) { // Double check name component. String nameComponent = name.substring(memberIsIsMethod ? 2 : 3); - if (nameComponent.length() == 0) + if (nameComponent.isEmpty()) return name; // return name // Make the bean property name. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSClassCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSClassCompletion.java index ea4e4857..a3ce872a 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSClassCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSClassCompletion.java @@ -45,7 +45,7 @@ public int compareTo(Completion c2) { return 0; } // Check for classes with same name, but in different packages - else if(c2.toString().equalsIgnoreCase(toString())) { + else if (c2.toString().equalsIgnoreCase(toString())) { if (c2 instanceof JSClassCompletion) { JSClassCompletion jsc2 = (JSClassCompletion) c2; return getReplacementText().compareTo(jsc2.getReplacementText()); @@ -69,8 +69,7 @@ public String getAlreadyEntered(JTextComponent comp) { if (lastDot > -1) { return temp.substring(lastDot + 1); } - if(temp.contains("new")) - { + if (temp.contains("new")) { return ""; } @@ -118,7 +117,7 @@ public String getSummary() { CompilationUnit cu = Util.getCompilationUnitFromDisk(loc, cf); if (cu!=null) { Iterator i = cu.getTypeDeclarationIterator(); - for (; i.hasNext(); ) { + while (i.hasNext()) { TypeDeclaration td = i.next(); String typeName = td.getName(); // Avoid inner classes, etc. @@ -163,8 +162,7 @@ public void rendererText(Graphics g, int x, int y, boolean selected) { } x = newX; - if(qualified) - { + if (qualified) { s = " - "; g.drawString(s, x, y); x += fm.stringWidth(s); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldCompletion.java index 8cd2706e..8c29d26b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldCompletion.java @@ -27,9 +27,8 @@ public JSFieldCompletion(CompletionProvider provider, FieldInfo fieldInfo) { setRelevance(fieldData); } - private void setRelevance(JSFieldData data) - { - if(data.isStatic()) { + private void setRelevance(JSFieldData data) { + if (data.isStatic()) { setRelevance(STATIC_FIELD_RELEVANCE); } else { setRelevance(GLOBAL_VARIABLE_RELEVANCE); @@ -97,11 +96,10 @@ public String getType(boolean qualified) { @Override public boolean equals(Object obj) { - if(obj == this) { + if (obj == this) { return true; } - if(obj instanceof JSFieldCompletion) - { + if (obj instanceof JSFieldCompletion) { JSFieldCompletion jsComp = (JSFieldCompletion) obj; return getLookupName().equals(jsComp.getLookupName()); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldData.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldData.java index 76f71d37..fd8aeb60 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldData.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFieldData.java @@ -17,15 +17,13 @@ public class JSFieldData { private FieldInfo info; private JarManager jarManager; - public JSFieldData(FieldInfo info, JarManager jarManager) - { + public JSFieldData(FieldInfo info, JarManager jarManager) { this.info = info; this.jarManager = jarManager; } - public Field getField() - { + public Field getField() { ClassFile cf = info.getClassFile(); SourceLocation loc = jarManager.getSourceLocForClass( cf.getClassName(true)); @@ -82,18 +80,15 @@ private Field getFieldFromSourceLoc(SourceLocation loc, ClassFile cf) { } - public String getType(boolean qualified) - { + public String getType(boolean qualified) { return info.getTypeString(qualified); } - public boolean isStatic() - { + public boolean isStatic() { return info.isStatic(); } - public boolean isPublic() - { + public boolean isPublic() { int access = info.getAccessFlags(); return org.fife.rsta.ac.java.classreader.Util.isPublic(access); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFunctionCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFunctionCompletion.java index 920d8749..2a19772d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFunctionCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSFunctionCompletion.java @@ -48,9 +48,8 @@ public JSFunctionCompletion(CompletionProvider provider, setParams(params); } - private static String getMethodName(MethodInfo info, CompletionProvider provider) - { - if(info.isConstructor()){ + private static String getMethodName(MethodInfo info, CompletionProvider provider) { + if (info.isConstructor()){ return ((SourceCompletionProvider) provider).getTypesFactory().convertJavaScriptType(info.getClassFile().getClassName(true), false); } else { return info.getName(); @@ -253,8 +252,7 @@ public String getEnclosingClassName(boolean fullyQualified) { return methodData.getEnclosingClassName(fullyQualified); } - public JSMethodData getMethodData() - { + public JSMethodData getMethodData() { return methodData; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSMethodData.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSMethodData.java index f4f6a0f3..43272a0b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSMethodData.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSMethodData.java @@ -24,8 +24,7 @@ public class JSMethodData { private JarManager jarManager; private ArrayList paramNames; - public JSMethodData(MethodInfo info, JarManager jarManager) - { + public JSMethodData(MethodInfo info, JarManager jarManager) { this.info = info; this.jarManager = jarManager; } @@ -48,8 +47,7 @@ public String getParameterName(int index) { //try the method next Method method = getMethod(); - if(method != null) - { + if (method != null) { name = method.getParameter(index).getName(); } @@ -110,10 +108,8 @@ public String getParameterName(int index) { } - public String getParameterType(String[] paramTypes, int index, CompletionProvider provider) - { - if(paramTypes != null && index < paramTypes.length) - { + public String getParameterType(String[] paramTypes, int index, CompletionProvider provider) { + if (paramTypes != null && index < paramTypes.length) { return ((SourceCompletionProvider) provider).getTypesFactory().convertJavaScriptType(paramTypes[index], true); } return null; @@ -142,8 +138,7 @@ public String getSummary() { } - public Method getMethod() - { + public Method getMethod() { ClassFile cf = info.getClassFile(); SourceLocation loc = jarManager.getSourceLocForClass( cf.getClassName(true)); @@ -186,7 +181,7 @@ private Method getMethodFromSourceLoc(SourceLocation loc, ClassFile cf) { if (cu!=null) { Iterator i = cu.getTypeDeclarationIterator(); - for (; i.hasNext(); ) { + while (i.hasNext()) { TypeDeclaration td = i.next(); String typeName = td.getName(); @@ -198,7 +193,7 @@ private Method getMethodFromSourceLoc(SourceLocation loc, ClassFile cf) { // parameters we're looking for. 99% of the time, there // will only be 1, the method we're looking for. List contenders = null; - for (Iterator j=td.getMemberIterator(); j.hasNext(); ) { + for (Iterator j=td.getMemberIterator(); j.hasNext();) { Member member = j.next(); if (member instanceof Method && member.getName().equals(info.getName())) { @@ -259,23 +254,19 @@ private Method getMethodFromSourceLoc(SourceLocation loc, ClassFile cf) { } - public MethodInfo getMethodInfo() - { + public MethodInfo getMethodInfo() { return info; } - public String getType(boolean qualified) - { + public String getType(boolean qualified) { return info.getReturnTypeString(qualified); } - public int getParameterCount() - { + public int getParameterCount() { return info.getParameterCount(); } - public boolean isStatic() - { + public boolean isStatic() { return info.isStatic(); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSVariableCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSVariableCompletion.java index a0633c82..97403ab2 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSVariableCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JSVariableCompletion.java @@ -127,8 +127,7 @@ public String getSummary() { SourceCompletionProvider scp = (SourceCompletionProvider)getProvider(); ClassFile cf = scp.getJavaScriptTypesFactory().getClassFile(scp.getJarManager(), JavaScriptHelper.createNewTypeDeclaration(getType(true))); - if(cf != null) - { + if (cf != null) { SourceLocation loc = scp.getSourceLocForClass(cf.getClassName(true)); if (loc!=null) { diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptInScriptFunctionCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptInScriptFunctionCompletion.java index bf22467d..63d0da4d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptInScriptFunctionCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptInScriptFunctionCompletion.java @@ -82,11 +82,10 @@ public String getEnclosingClassName(boolean fullyQualified) { @Override public boolean equals(Object obj) { - if(obj == this) { + if (obj == this) { return true; } - if(obj instanceof JSCompletion) - { + if (obj instanceof JSCompletion) { JSCompletion jsComp = (JSCompletion) obj; return getLookupName().equals(jsComp.getLookupName()); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptMethodCompletion.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptMethodCompletion.java index 29a872ee..25a2dc68 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptMethodCompletion.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/completion/JavaScriptMethodCompletion.java @@ -145,11 +145,10 @@ else if (other!=null) { @Override public boolean equals(Object obj) { - if(obj == this) { + if (obj == this) { return true; } - if(obj instanceof JSCompletion) - { + if (obj instanceof JSCompletion) { JSCompletion jsComp = (JSCompletion) obj; return getLookupName().equals(jsComp.getLookupName()); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/client/funtions/WindowFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/client/funtions/WindowFunctions.java index 370dd5de..b07d430e 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/client/funtions/WindowFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/client/funtions/WindowFunctions.java @@ -87,14 +87,14 @@ public interface WindowFunctions extends JS5ObjectFunctions { /** * function open(URL, name, specs, replace) Opens a new browser window * - * @param URL + * @param url * @param name * @param specs * @param replace * @memberOf Window * @returns opened Window object */ - Window open(JSString URL, JSString name, JSString specs, JSBoolean replace); + Window open(JSString url, JSString name, JSString specs, JSBoolean replace); /** * function print() Prints the content of the current window diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAnchorElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAnchorElement.java index cf238935..977c15ab 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAnchorElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAnchorElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLAnchorElement implements HTMLAnchorElement, JS5Objec /** * Object HTMLAnchorElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAppletElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAppletElement.java index b0fa52d3..6b02fef6 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAppletElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAppletElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLAppletElement implements HTMLAppletElement, JS5Objec /** * Object HTMLAppletElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAreaElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAreaElement.java index 4b4ed8b0..fba5a75c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAreaElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLAreaElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLAreaElement implements HTMLAreaElement, JS5ObjectFun /** * Object HTMLAreaElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBRElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBRElement.java index 5b8c4d06..ea440c61 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBRElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBRElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLBRElement implements HTMLBRElement, JS5ObjectFunctio /** * Object HTMLBRElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseElement.java index 6cf16c04..cf7ef390 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLBaseElement implements HTMLBaseElement, JS5ObjectFun /** * Object HTMLBaseElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseFontElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseFontElement.java index 01e2b1fa..3a26c312 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseFontElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBaseFontElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLBaseFontElement implements HTMLBaseFontElement, JS5O /** * Object HTMLBaseFontElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBodyElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBodyElement.java index f6e9ef56..e8621631 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBodyElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLBodyElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLBodyElement implements HTMLBodyElement, JS5ObjectFun /** * Object HTMLBodyElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLButtonElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLButtonElement.java index e0b709be..3ad736b5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLButtonElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLButtonElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLButtonElement implements HTMLButtonElement, JS5Objec /** * Object HTMLButtonElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLCollection.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLCollection.java index 517b2e95..22bc3987 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLCollection.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLCollection.java @@ -9,7 +9,7 @@ public abstract class JSHTMLCollection implements HTMLCollection, JS5ObjectFunct /** * Object HTMLCollection() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDListElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDListElement.java index 587786b5..bc448f79 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDListElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDListElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLDListElement implements HTMLDListElement, JS5ObjectF /** * Object HTMLDListElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDirectoryElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDirectoryElement.java index 39bee2f3..3427e48a 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDirectoryElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDirectoryElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLDirectoryElement implements HTMLDirectoryElement, JS /** * Object HTMLDirectoryElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDivElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDivElement.java index 3ee2e083..8175d575 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDivElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDivElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLDivElement implements HTMLDivElement, JS5ObjectFunct /** * Object HTMLDivElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDocument.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDocument.java index b1ba2117..7e65d368 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDocument.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLDocument.java @@ -9,7 +9,7 @@ public abstract class JSHTMLDocument implements HTMLDocument, JS5ObjectFunctions /** * Object HTMLDocument() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLElement.java index 31f08ceb..72d71bf6 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLElement implements HTMLElement, JS5ObjectFunctions { /** * Object HTMLElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFieldSetElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFieldSetElement.java index e50862d1..d4592940 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFieldSetElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFieldSetElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLFieldSetElement implements HTMLFieldSetElement, JS5O /** * Object HTMLFieldSetElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFontElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFontElement.java index c4a0c111..115c6e33 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFontElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFontElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLFontElement implements HTMLFontElement, JS5ObjectFun /** * Object HTMLFontElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFormElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFormElement.java index dc4cac11..3908fd7d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFormElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFormElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLFormElement implements HTMLFormElement, JS5ObjectFun /** * Object HTMLFormElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameElement.java index 81c6d53a..943c2ce9 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLFrameElement implements HTMLFrameElement, JS5ObjectF /** * Object HTMLFrameElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameSetElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameSetElement.java index 45349b18..6951f627 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameSetElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLFrameSetElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLFrameSetElement implements HTMLFrameSetElement, JS5O /** * Object HTMLFrameSetElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHRElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHRElement.java index c081c502..52f752eb 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHRElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHRElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLHRElement implements HTMLHRElement, JS5ObjectFunctio /** * Object HTMLHRElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadElement.java index 9a6b0c4f..69a40beb 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLHeadElement implements HTMLHeadElement, JS5ObjectFun /** * Object HTMLHeadElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadingElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadingElement.java index 44eeccd4..05f3735b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadingElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHeadingElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLHeadingElement implements HTMLHeadingElement, JS5Obj /** * Object HTMLHeadingElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHtmlElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHtmlElement.java index ab7bfc77..fe4db50e 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHtmlElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLHtmlElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLHtmlElement implements HTMLHtmlElement, JS5ObjectFun /** * Object HTMLHtmlElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIFrameElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIFrameElement.java index a0a33eef..dd10b947 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIFrameElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIFrameElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLIFrameElement implements HTMLIFrameElement, JS5Objec /** * Object HTMLIFrameElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLImageElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLImageElement.java index d6fec3d9..d7d67226 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLImageElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLImageElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLImageElement implements HTMLImageElement, JS5ObjectF /** * Object HTMLImageElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLInputElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLInputElement.java index 45d5ddea..86884b8b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLInputElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLInputElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLInputElement implements HTMLInputElement, JS5ObjectF /** * Object HTMLInputElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIsIndexElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIsIndexElement.java index 7e5afef5..53897604 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIsIndexElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLIsIndexElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLIsIndexElement implements HTMLIsIndexElement, JS5Obj /** * Object HTMLIsIndexElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLIElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLIElement.java index a2320c52..cce12d0c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLIElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLIElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLLIElement implements HTMLLIElement, JS5ObjectFunctio /** * Object HTMLLIElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLabelElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLabelElement.java index 4aa02991..b8fb17bf 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLabelElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLabelElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLLabelElement implements HTMLLabelElement, JS5ObjectF /** * Object HTMLLabelElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLegendElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLegendElement.java index 48b0a51c..212a5532 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLegendElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLegendElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLLegendElement implements HTMLLegendElement, JS5Objec /** * Object HTMLLegendElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLinkElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLinkElement.java index 83977deb..20bcd004 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLinkElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLLinkElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLLinkElement implements HTMLLinkElement, JS5ObjectFun /** * Object HTMLLinkElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMapElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMapElement.java index fe39f5eb..0dcb9e75 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMapElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMapElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLMapElement implements HTMLMapElement, JS5ObjectFunct /** * Object HTMLMapElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMenuElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMenuElement.java index ead48c49..b4c2061d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMenuElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMenuElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLMenuElement implements HTMLMenuElement, JS5ObjectFun /** * Object HTMLMenuElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMetaElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMetaElement.java index 1be8c094..bca750cf 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMetaElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLMetaElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLMetaElement implements HTMLMetaElement, JS5ObjectFun /** * Object HTMLMetaElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLModElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLModElement.java index 2b61984c..75991e37 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLModElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLModElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLModElement implements HTMLModElement, JS5ObjectFunct /** * Object HTMLModElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOListElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOListElement.java index d35d4d36..e0e36dac 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOListElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOListElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLOListElement implements HTMLOListElement, JS5ObjectF /** * Object HTMLOListElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLObjectElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLObjectElement.java index ee7b7bac..bf11d966 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLObjectElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLObjectElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLObjectElement implements HTMLObjectElement, JS5Objec /** * Object HTMLObjectElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptGroupElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptGroupElement.java index 7b5b46f4..9b02146f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptGroupElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptGroupElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLOptGroupElement implements HTMLOptGroupElement, JS5O /** * Object HTMLOptGroupElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionElement.java index 79892ff8..1aba2337 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLOptionElement implements HTMLOptionElement, JS5Objec /** * Object HTMLOptionElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionsCollection.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionsCollection.java index c2a20d53..840939b5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionsCollection.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLOptionsCollection.java @@ -8,7 +8,7 @@ public abstract class JSHTMLOptionsCollection implements JS5ObjectFunctions { /** * Object HTMLOptionsCollection() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParagraphElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParagraphElement.java index 6760498d..24c20c39 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParagraphElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParagraphElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLParagraphElement implements HTMLParagraphElement, JS /** * Object HTMLParagraphElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParamElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParamElement.java index 68372124..1e3bc01f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParamElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLParamElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLParamElement implements HTMLParamElement, JS5ObjectF /** * Object HTMLParamElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLPreElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLPreElement.java index 4ed719f8..5d1dde54 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLPreElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLPreElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLPreElement implements HTMLPreElement, JS5ObjectFunct /** * Object HTMLPreElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLQuoteElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLQuoteElement.java index f9d4d4da..eb8b3848 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLQuoteElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLQuoteElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLQuoteElement implements HTMLQuoteElement, JS5ObjectF /** * Object HTMLQuoteElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLScriptElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLScriptElement.java index 9126a323..933e6d5a 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLScriptElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLScriptElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLScriptElement implements HTMLScriptElement, JS5Objec /** * Object HTMLScriptElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLSelectElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLSelectElement.java index dbbe5aee..f9e5e7c0 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLSelectElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLSelectElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLSelectElement implements HTMLSelectElement, JS5Objec /** * Object HTMLSelectElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLStyleElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLStyleElement.java index ef45b0bd..3c721158 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLStyleElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLStyleElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLStyleElement implements HTMLStyleElement, JS5ObjectF /** * Object HTMLStyleElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCaptionElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCaptionElement.java index eb6c4c2f..6fd8c91f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCaptionElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCaptionElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableCaptionElement implements HTMLTableCaptionEleme /** * Object HTMLTableCaptionElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCellElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCellElement.java index 20c5f4ad..933f9a7e 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCellElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableCellElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableCellElement implements HTMLTableCellElement, JS /** * Object HTMLTableCellElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableColElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableColElement.java index fea6afff..44d038ef 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableColElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableColElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableColElement implements HTMLTableColElement, JS5O /** * Object HTMLTableColElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableElement.java index e68a1805..4c616795 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableElement implements HTMLTableElement, JS5ObjectF /** * Object HTMLTableElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableRowElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableRowElement.java index b35d9aa6..df637fdb 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableRowElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableRowElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableRowElement implements HTMLTableRowElement, JS5O /** * Object HTMLTableRowElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableSectionElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableSectionElement.java index 22cc8851..ab6d674b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableSectionElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTableSectionElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTableSectionElement implements HTMLTableSectionEleme /** * Object HTMLTableSectionElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTextAreaElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTextAreaElement.java index b7c0e0f6..5ed851eb 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTextAreaElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTextAreaElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTextAreaElement implements HTMLTextAreaElement, JS5O /** * Object HTMLTextAreaElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTitleElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTitleElement.java index f98befce..0118d4a7 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTitleElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLTitleElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLTitleElement implements HTMLTitleElement, JS5ObjectF /** * Object HTMLTitleElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLUListElement.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLUListElement.java index 43fbb0c9..a547c4b8 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLUListElement.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/dom/html/JSHTMLUListElement.java @@ -9,7 +9,7 @@ public abstract class JSHTMLUListElement implements HTMLUListElement, JS5ObjectF /** * Object HTMLUListElement() - * See also the Document Object Model (DOM) Level 2 Specification + * See also the Document Object Model (DOM) Level 2 Specification * * @constructor * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XNamespace.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XNamespace.java index 2dfc641a..2ae2e451 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XNamespace.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XNamespace.java @@ -20,7 +20,7 @@ public abstract class E4XNamespace implements JSObjectFunctions { * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XNamespace ( ){} + public E4XNamespace() {} /** * Object Namespace(uriValue) @@ -31,7 +31,7 @@ public E4XNamespace ( ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XNamespace ( JSString uriValue ){} + public E4XNamespace(JSString uriValue) {} /** * Object Namespace(prefixValue, uriValue) @@ -43,7 +43,7 @@ public E4XNamespace ( JSString uriValue ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XNamespace ( JSString prefixValue, JSString uriValue ){} + public E4XNamespace(JSString prefixValue, JSString uriValue) {} /** * property prototype diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XQName.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XQName.java index f45941ee..260db1f0 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XQName.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XQName.java @@ -19,7 +19,8 @@ public abstract class E4XQName implements JSObjectFunctions { * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XQName ( ){} + public E4XQName() { + } /** * Object QName(name) @@ -30,7 +31,8 @@ public E4XQName ( ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XQName ( JSString name ){} + public E4XQName(JSString name) { + } /** * Object QName(namespace, name) @@ -41,7 +43,8 @@ public E4XQName ( JSString name ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XQName ( E4XNamespace namespace, JSString name ){} + public E4XQName(E4XNamespace namespace, JSString name) { + } /** * property prototype diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXML.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXML.java index 3c0f7621..bdd8cfb5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXML.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXML.java @@ -24,7 +24,8 @@ public abstract class E4XXML implements E4XXMLFunctions { * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XXML ( JSObject xml ){} + public E4XXML(JSObject xml) { + } /** @@ -128,7 +129,9 @@ public E4XXML ( JSObject xml ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public static JSObject settings(){return null;} + public static JSObject settings() { + return null; + } /** * function setSetting(settings) The setSettings method is a convenience method for managing the collection of global XML settings stored as properties of the XML constructor. @@ -138,7 +141,8 @@ public E4XXML ( JSObject xml ){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public static void setSettings(JSObject settings){} + public static void setSettings(JSObject settings) { + } /** * function defaultSettings() The defaultSettings method is a convenience method for managing the collection of global XML settings stored as properties of the XML constructor. @@ -148,5 +152,7 @@ public static void setSettings(JSObject settings){} * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public static JSObject defaultSettings(){return null;} + public static JSObject defaultSettings() { + return null; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXMLList.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXMLList.java index 044c4f05..fb2001f8 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXMLList.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/E4XXMLList.java @@ -21,7 +21,8 @@ public abstract class E4XXMLList implements E4XXMLListFunctions { * @since Standard ECMA-357 2nd. Edition * @since Level 3 Document Object Model Core Definition. */ - public E4XXMLList ( JSObject xml ){} + public E4XXMLList(JSObject xml) { + } /** * property prototype diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XGlobalFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XGlobalFunctions.java index e338038f..6ce35c91 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XGlobalFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XGlobalFunctions.java @@ -10,7 +10,7 @@ public interface E4XGlobalFunctions extends JS5ObjectFunctions { /** * function isXMLName(name) determines whether name is a valid XML name. * @param name The name to be tested. - * @returns examines the given value and determines whether it is a valid XML name that can be used as an XML element or attribute name. If so, it returns true, otherwise it returns false. + * @returns examines the given value and determines whether it is a valid XML {@code name} that can be used as an XML element or attribute name. If so, it returns true, otherwise it returns false. * @memberOf Global * @see org.fife.rsta.ac.js.ecma.api.e4x.E4XGlobal Global * @since Standard ECMA-357 2nd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java index bee3e3e5..bd900ce7 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/e4x/functions/E4XXMLFunctions.java @@ -228,22 +228,23 @@ public interface E4XXMLFunctions extends JSObjectFunctions { JSArray inScopeNamespaces(); /** - * function insertChildAfter( child1 , child2) inserts the given child2 after the given child1 in this XML object and returns this XML object. If child1 is null, the insertChildAfter method inserts child2 before all children of this XML object (i.e., after none of them). If child1 does not exist in this XML object, it returns without modifying this XML object. + * function insertChildAfter( child1 , child2) inserts the given {@code child2} after the given {@code child1} in this XML object and returns this XML object. If {@code child1} is null, the insertChildAfter method inserts {@code child2} before all children of this XML object (i.e., after none of them). If {@code child1} does not exist in this XML object, it returns without modifying this XML object. * @returns XML object representing x. * @memberOf XML * @see org.fife.rsta.ac.js.ecma.api.e4x.E4XXML XML * @since Standard ECMA-357 2nd. Edition */ - E4XXML insertChildAfter ( E4XXML child1 , E4XXML child2); + E4XXML insertChildAfter(E4XXML child1 , E4XXML child2); /** - * function insertChildBefore( child1 , child2) inserts the given child2 before the given child1 in this XML object and returns this XML object. If child1 is null, the insertChildBefore method inserts child2 after all children in this XML object (i.e., before none of them). If child1 does not exist in this XML object, it returns without modifying this XML object. + * Inserts the given {@code child2} before the given {@code child1} in this XML object and returns this XML object. If {@code child1} is null, the insertChildBefore method inserts {@code child2} after all children in this XML object (i.e., before none of them). If {@code child1} does not exist in this XML object, it returns without modifying this XML object. + * * @returns XML object representing x. * @memberOf XML * @see org.fife.rsta.ac.js.ecma.api.e4x.E4XXML XML * @since Standard ECMA-357 2nd. Edition */ - E4XXML insertChildBefore ( E4XXML child1 , E4XXML child2); + E4XXML insertChildBefore(E4XXML child1 , E4XXML child2); /** * function length() the length method always returns the integer 1 for XML objects. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSArray.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSArray.java index 97ec315a..56b2c48a 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSArray.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSArray.java @@ -25,7 +25,7 @@ public JSArray() { * * @constructor * @extends Object - * @param size The desired number of elements in the array. The returned value has its length field set to size + * @param size The desired number of elements in the array. The returned value has its length field set to {@code size} * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSDate.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSDate.java index fc441cdb..89675d78 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSDate.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSDate.java @@ -111,7 +111,11 @@ public JSDate(JSNumber year, JSNumber month, JSNumber day, JSNumber hours, JSNum * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber UTC(JSNumber year, JSNumber month, JSNumber day, JSNumber hour, JSNumber min, JSNumber sec, JSNumber ms){return null;} + @SuppressWarnings("checkstyle:MethodName") // Matches the casing in JS + public static JSNumber UTC(JSNumber year, JSNumber month, JSNumber day, JSNumber hour, JSNumber min, + JSNumber sec, JSNumber ms) { + return null; + } /** @@ -125,6 +129,8 @@ public JSDate(JSNumber year, JSNumber month, JSNumber day, JSNumber hours, JSNum * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber parse(JSString string){return null;} + public static JSNumber parse(JSString string) { + return null; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSError.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSError.java index 771e4d35..82aff85d 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSError.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSError.java @@ -48,7 +48,7 @@ public JSError(JSString message) { public JSError prototype; /** - * property constructor + * Property constructor. * * @type Function * @memberOf Error diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSFunction.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSFunction.java index 2fdef19a..c41db07f 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSFunction.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSFunction.java @@ -13,12 +13,12 @@ public abstract class JSFunction implements JSFunctionFunctions { * Object Function(argument_names..., body) * @constructor * @extends Object - * @param argument_names Any number of string arguments, each naming one or more arguments of the Function object to be created. + * @param argumentNames Any number of string arguments, each naming one or more arguments of the Function object to be created. * @param body A string that represents the body of the function. It may contain a number of JavaScript statements, separated by semicolons. * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public JSFunction(JSString argument_names, JSString body) { + public JSFunction(JSString argumentNames, JSString body) { } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSMath.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSMath.java index f27535c8..77d63f00 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSMath.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSMath.java @@ -98,7 +98,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber abs(JSNumber x){return null;} + public static JSNumber abs(JSNumber x) { + return null; + } /** * function acos(x) compute an arccosine @@ -111,7 +113,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber acos(JSNumber x){return null;} + public static JSNumber acos(JSNumber x) { + return null; + } /** * function asin(x) compute an arcsine @@ -124,7 +128,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber asin(JSNumber x){return null;} + public static JSNumber asin(JSNumber x) { + return null; + } /** * function atan(x) compute an arctangent @@ -137,7 +143,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber atan(JSNumber x){return null;} + public static JSNumber atan(JSNumber x) { + return null; + } /** * function atan2(x,y) compute the angle from the X axis to a point. @@ -151,7 +159,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber atan2(JSNumber y, JSNumber x){return null;} + public static JSNumber atan2(JSNumber y, JSNumber x) { + return null; + } /** * function ceil(x) round a number up. @@ -171,7 +181,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber ceil(JSNumber x){return null;} + public static JSNumber ceil(JSNumber x) { + return null; + } /** * function cos(x) compute a cosine. @@ -184,7 +196,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber cos(JSNumber x){return null;} + public static JSNumber cos(JSNumber x) { + return null; + } /** * function exp(x) compute Ex. @@ -197,7 +211,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber exp(JSNumber x){return null;} + public static JSNumber exp(JSNumber x) { + return null; + } /** * function floor(x) round a number down. @@ -217,7 +233,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber floor(JSNumber x){return null;} + public static JSNumber floor(JSNumber x) { + return null; + } /** * function log(x) compute a natural logarithm. @@ -230,7 +248,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber log(JSNumber x){return null;} + public static JSNumber log(JSNumber x) { + return null; + } /** * function max(args) Return the largest argument. @@ -243,7 +263,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber max(JSNumber args){return null;} + public static JSNumber max(JSNumber args) { + return null; + } /** * function min(args) return the smallest argument. @@ -256,7 +278,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber min(JSNumber args){return null;} + public static JSNumber min(JSNumber args) { + return null; + } /** * function pow(x,y) compute Xy @@ -270,7 +294,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber pow(JSNumber x, JSNumber y){return null;} + public static JSNumber pow(JSNumber x, JSNumber y) { + return null; + } /** * function random() return a pseudorandom number @@ -282,7 +308,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber random(){return null;} + public static JSNumber random() { + return null; + } /** * function round(x) round to the nearest integer. @@ -295,7 +323,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber round(JSNumber x){return null;} + public static JSNumber round(JSNumber x) { + return null; + } /** * function sin(x) compute a sine. @@ -308,7 +338,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber sin(JSNumber x){return null;} + public static JSNumber sin(JSNumber x) { + return null; + } /** * function sqrt(x) compute a square root. @@ -321,7 +353,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber sqrt(JSNumber x){return null;} + public static JSNumber sqrt(JSNumber x) { + return null; + } /** * function tan(x) compute a tangent. @@ -334,7 +368,9 @@ public abstract class JSMath { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSNumber tan(JSNumber x){return null;} + public static JSNumber tan(JSNumber x) { + return null; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSString.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSString.java index c39b982d..deab1800 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSString.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/JSString.java @@ -70,5 +70,7 @@ public JSString(JSString s){} * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public static JSString fromCharCode(JSNumber charCode){return null;} + public static JSString fromCharCode(JSNumber charCode) { + return null; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSArrayFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSArrayFunctions.java index 833d1dee..253d2c63 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSArrayFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSArrayFunctions.java @@ -136,7 +136,7 @@ public interface JSArrayFunctions extends JSObjectFunctions { * * @param start The array index from where to begin. If negative, this argument specifies a position measured from the end of the array. * @param end The array index immediately after the end of the slice. If not specified then the slice includes all the array elements from the start to the end of the array. - * @returns A new array containing elements from the start up to, but not including the end of the slice. + * @returns A new array containing elements from the {@code start} up to, but not including the end of the slice. * @memberOf Array * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSArray Array * @see #splice(JSNumber, JSNumber, JSArray) splice(); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSDateFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSDateFunctions.java index 4fa45b40..c2ff6c37 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSDateFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSDateFunctions.java @@ -316,7 +316,7 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setMilliseconds(value) set the milliseconds field of a Date. * * @memberOf Date - * @param value The milliseconds field expressed in local time, to be set in date. + * @param value The milliseconds field expressed in local time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -329,7 +329,7 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCMilliseconds(ms) set the milliseconds field of a Date (universal time). * * @memberOf JSDate - * @param ms The millisecond field expressed in universal time, to be set in date. + * @param ms The millisecond field expressed in universal time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -342,8 +342,8 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setSeconds(sec,ms) set the seconds and milliseconds field of a Date. * * @memberOf Date - * @param sec The second field expressed in local time, to be set in date. - * @param ms Optional millisecond field expressed in local time, to be set in date. + * @param sec The second field expressed in local time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in local time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -356,8 +356,8 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCSeconds(sec,ms) set the seconds and milliseconds field of a Date (universal time). * * @memberOf Date - * @param sec The second field expressed in universal time, to be set in date. - * @param ms Optional millisecond field expressed in universal time, to be set in date. + * @param sec The second field expressed in universal time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in universal time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -370,9 +370,9 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setMinutes(min,sec,ms) set the minutes, seconds and milliseconds field of a Date. * * @memberOf Date - * @param min The minute field expressed in local time, to be set in date. - * @param sec Optional second field expressed in local time, to be set in date. - * @param ms Optional millisecond field expressed in local time, to be set in date. + * @param min The minute field expressed in local time, to be set in {@code date}. + * @param sec Optional second field expressed in local time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in local time, to be set in {@code date}. * @returns {Number} The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -385,9 +385,9 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCMinute(min,sec,ms) set the minutes, seconds and milliseconds field of a Date (universal time). * * @memberOf Date - * @param min The minute field expressed in universal time, to be set in date. - * @param sec Optional second field expressed in universal time, to be set in date. - * @param ms Optional millisecond field expressed in universal time, to be set in date. + * @param min The minute field expressed in universal time, to be set in {@code date}. + * @param sec Optional second field expressed in universal time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in universal time, to be set in {@code date}. * @returns {Number} The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -400,10 +400,10 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setHours(hour,min,sec,ms) set the hours, minutes, seconds and milliseconds field of a Date. * * @memberOf Date - * @param hour The hour field expressed in local time, to be set in date. - * @param min Optional minute field expressed in local time, to be set in date. - * @param sec Optional second field expressed in local time, to be set in date. - * @param ms Optional millisecond field expressed in local time, to be set in date. + * @param hour The hour field expressed in local time, to be set in {@code date}. + * @param min Optional minute field expressed in local time, to be set in {@code date}. + * @param sec Optional second field expressed in local time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in local time, to be set in {@code date}. * @returns {The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -416,10 +416,10 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCHours(hour,min,sec,ms) set the hours, minutes, seconds and milliseconds field of a Date (universal time). * * @memberOf Date - * @param hour The hour field expressed in universal time, to be set in date. - * @param min Optional minute field expressed in universal time, to be set in date. - * @param sec Optional second field expressed in universal time, to be set in date. - * @param ms Optional millisecond field expressed in universal time, to be set in date. + * @param hour The hour field expressed in universal time, to be set in {@code date}. + * @param min Optional minute field expressed in universal time, to be set in {@code date}. + * @param sec Optional second field expressed in universal time, to be set in {@code date}. + * @param ms Optional millisecond field expressed in universal time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -432,7 +432,7 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setDate(date) set the day of month field of a Date. * * @memberOf Date - * @param date The day of the month field expressed in local time, to be set in date. + * @param date The day of the month field expressed in local time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -445,7 +445,7 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCDate(date) set the day of month field of a Date (universal time). * * @memberOf Date - * @param date The day of the month field expressed in universal time, to be set in date. + * @param date The day of the month field expressed in universal time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -458,8 +458,8 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setMonth(month,date) set the month, day field of a Date. * * @memberOf Date - * @param month An integer between 0 (January) and 11 (December) representing the month field expressed in local time, to be set in date. - * @param date Optional day of the month field expressed in local time, to be set in date. + * @param month An integer between 0 (January) and 11 (December) representing the month field expressed in local time, to be set in {@code date}. + * @param date Optional day of the month field expressed in local time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -472,8 +472,8 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCMonth(month,date) set the month, day field of a Date (Universal time). * * @memberOf Date - * @param month An integer between 0 (January) and 11 (December) representing the month field expressed in universal time, to be set in date. - * @param date Optional day of the month field expressed in universal time, to be set in date. + * @param month An integer between 0 (January) and 11 (December) representing the month field expressed in universal time, to be set in {@code date}. + * @param date Optional day of the month field expressed in universal time, to be set in date. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -486,9 +486,9 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setFullYear(year,month,date) set the year, month, day field of a Date. * * @memberOf Date - * @param year The year field expressed in local time, to be set in date. - * @param month Optional integer between 0 (January) and 11 (December) representing the month field expressed in local time, to be set in date. - * @param date Optional day of the month field expressed in local time, to be set in date. + * @param year The year field expressed in local time, to be set in date. + * @param month Optional integer between 0 (January) and 11 (December) representing the month field expressed in local time, to be set in {@code date}. + * @param date Optional day of the month field expressed in local time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition @@ -501,9 +501,9 @@ public interface JSDateFunctions extends JSObjectFunctions { * function setUTCFullYear(year,month,date) set the year, month, day field of a Date (Universal time). * * @memberOf Date - * @param year The year field expressed in universal time, to be set in date. - * @param month Optional integer between 0 (January) and 11 (December) representing the month field expressed in universal time, to be set in date. - * @param date Optional day of the month field expressed in universal time, to be set in date. + * @param year The year field expressed in universal time, to be set in date. + * @param month Optional integer between 0 (January) and 11 (December) representing the month field expressed in universal time, to be set in {@code date}. + * @param date Optional day of the month field expressed in universal time, to be set in {@code date}. * @returns The millisecond representation of the adjusted date. * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSDate Date * @since Standard ECMA-262 3rd. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSRegExpFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSRegExpFunctions.java index 0a572781..46402400 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSRegExpFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSRegExpFunctions.java @@ -4,7 +4,7 @@ import org.fife.rsta.ac.js.ecma.api.ecma3.JSBoolean; -public interface JSRegExpFunctions extends JSObjectFunctions{ +public interface JSRegExpFunctions extends JSObjectFunctions { /** * function exec(string) general purpose pattern matching. @@ -13,7 +13,7 @@ public interface JSRegExpFunctions extends JSObjectFunctions{ *
       	 * var r = new RegExp("/\bJava\w*\b/g");
       	 * var text = "JavaScript is not the same as Java";
      -	 * while((result = e.exec(text)) != null)
      +	 * while ((result = e.exec(text)) != null)
       	 * {
       	 *   alert("Matched: " + result[0]);
       	 * }
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSStringFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSStringFunctions.java
      index fd057f42..9fc0d093 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSStringFunctions.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma3/functions/JSStringFunctions.java
      @@ -28,7 +28,7 @@ public interface JSStringFunctions extends JSObjectFunctions {
            *
            * @memberOf String
            * @param position The index of the character whose encoding is to be returned.
      -     * @returns The Unicode encoding of the i>nth character within string.
      +     * @returns The Unicode encoding of the nth character within string.
            * @see org.fife.rsta.ac.js.ecma.api.ecma3.JSString String
            * @see #charAt(JSNumber) charAt()
            * @since Standard ECMA-262 3rd. Edition
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Array.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Array.java
      index 601b17a9..e9a51cce 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Array.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Array.java
      @@ -30,7 +30,7 @@ public JS5Array() {
       	 *
       	 * @constructor
       	 * @extends Object
      -	 * @param size The desired number of elements in the array. The returned value has its length field set to size
      +	 * @param size The desired number of elements in the array. The returned value has its length field set to {@code size}
       	 * @since Standard ECMA-262 3rd. Edition
       	 * @since Level 2 Document Object Model Core Definition.
       	 */
      @@ -55,12 +55,14 @@ public JS5Array(JSObject element0, JSObject elementn) {
       	 * function isArray(o) test whether argument is an array.
       	 *
       	 * @param o object to test.
      -	 * @returns true if object is of type array, otherwise false.
      +	 * @returns {code true} if object is of type array, otherwise {code false}.
       	 * @memberOf Array
       	 * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Array Array
       	 * @since Standard ECMA-262 5th. Edition
       	 */
      -	public static JSBoolean isArray(JS5Object o) {return null;}
      +	public static JSBoolean isArray(JS5Object o) {
      +		return null;
      +	}
       
       
       }
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Date.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Date.java
      index c5d63738..30ac2249 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Date.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Date.java
      @@ -80,5 +80,7 @@ public JS5Date(JSNumber year, JSNumber month, JSNumber day, JSNumber hours, JSNu
       	 * @since Standard ECMA-262 5th. Edition
       	 * @since Level 2 Document Object Model Core Definition.
       	 */
      -	public static JSNumber now(){return null;}
      +	public static JSNumber now() {
      +		return null;
      +	}
       }
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Function.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Function.java
      index b61c8f03..20878601 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Function.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Function.java
      @@ -14,12 +14,12 @@ public abstract class JS5Function extends JSFunction implements JS5FunctionFunct
            * Object Function(argument_names..., body)
            * @constructor
            * @extends Object
      -     * @param argument_names Any number of string arguments, each naming one or more arguments of the Function object to be created.
      +     * @param argumentNames Any number of string arguments, each naming one or more arguments of the Function object to be created.
            * @param body A string that represents the body of the function. It may contain an number of JavaScript statements, separated by semicolons.
            * @since Standard ECMA-262 3rd. Edition
            * @since Level 2 Document Object Model Core Definition.
           */
      -    public JS5Function(JSString argument_names, JSString body) {
      -    	super(argument_names, body);
      +    public JS5Function(JSString argumentNames, JSString body) {
      +    	super(argumentNames, body);
           }
       }
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5JSON.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5JSON.java
      index 90aeff38..ed6173a8 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5JSON.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5JSON.java
      @@ -17,7 +17,9 @@ public abstract class JS5JSON  {
       	 * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5JSON JSON
       	 * @since Standard ECMA-262 5th. Edition
       	 */
      -	public static JS5Object parse(JS5String s, JS5Function reviver){return null;}
      +	public static JS5Object parse(JS5String s, JS5Function reviver) {
      +		return null;
      +	}
       
       	/**
       	 * function stringify(o, filter, indent) serialize an object, array or primitive value.
      @@ -30,5 +32,7 @@ public abstract class JS5JSON  {
       	 * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5JSON JSON
       	 * @since Standard ECMA-262 5th. Edition
       	 */
      -	public static JS5Object stringify(JS5Object o, JS5Function filter, JS5Object indent){return null;}
      +	public static JS5Object stringify(JS5Object o, JS5Function filter, JS5Object indent) {
      +		return null;
      +	}
       }
      diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Object.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Object.java
      index 8b1095c6..f902ed56 100644
      --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Object.java
      +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5Object.java
      @@ -47,7 +47,7 @@ public JS5Object(JSObject value) {
       	 * 
      * @param proto The prototype of the newly created object, or null. * @param descriptors An optional object that maps property names to property descriptors. - * @returns A newly created object that inherits from proto and has properties described by descriptors + * @returns A newly created object that inherits from {@code proto} and has properties described by descriptors * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @see #defineProperties(JS5Object, JS5Object) defineProperties() @@ -55,7 +55,9 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object create(JS5Object proto, JS5Object descriptors){return null;} + public static JS5Object create(JS5Object proto, JS5Object descriptors) { + return null; + } /** @@ -70,7 +72,7 @@ public JS5Object(JSObject value) { * * @param o The object on which properties are to be created or configured. * @param descriptors An object that maps property names to property descriptors. - * @returns The object o + * @returns The object {@code o} * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #create(JS5Object, JS5Object) create() * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() @@ -78,7 +80,9 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object defineProperties(JS5Object o, JS5Object descriptors){return null;} + public static JS5Object defineProperties(JS5Object o, JS5Object descriptors) { + return null; + } /** * function defineProperty(o, name, desc) create or configure an object property. @@ -92,18 +96,20 @@ public JS5Object(JSObject value) { * @param o The object on which a property is to be created or configured. * @param name The name of the property created or configured. * @param desc A property descriptor object that describes the new property. - * @returns The object o + * @returns The object {@code o} * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object defineProperty(JS5Object o, JS5String name, JS5Object desc){return null;} + public static JS5Object defineProperty(JS5Object o, JS5String name, JS5Object desc) { + return null; + } /** * function freeze(o) make an object immutable. * * @param o The object to be frozen. - * @returns The now-frozen argument object o. + * @returns The now-frozen argument object {@code o}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @see #isFrozen(JS5Object) isFrozen() @@ -112,20 +118,24 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object freeze(JS5Object o){return null;} + public static JS5Object freeze(JS5Object o) { + return null; + } /** * function getOwnPropertyDescriptor(o, name) query property attributes. * * @param o The object that is to have its property attributes queried. * @param name The name of the property to query. - * @returns A property descriptor object for the specified property or undefined if no such property exists. + * @returns A property descriptor object for the specified property or {@code undefined} if no such property exists. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object getOwnPropertyDescriptor(JS5Object o, JS5String name){return null;} + public static JS5Object getOwnPropertyDescriptor(JS5Object o, JS5String name) { + return null; + } /** * function getOwnPropertyNames(o) return the names of non-inherited properties. @@ -135,13 +145,15 @@ public JS5Object(JSObject value) { * Object.getOwnPropertyNames([]); //returns [length]: "length" is non enumerable * * @param o An object - * @returns An array that contains the names of all non-inherited properties of o, including non-enumerable properties. + * @returns An array that contains the names of all non-inherited properties of {@code o}, including non-enumerable properties. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #keys(JS5Object) keys() * @since Standard ECMA-262 5th. Edition * */ - public static JS5Array getOwnPropertyNames(JS5Object o){return null;} + public static JS5Array getOwnPropertyNames(JS5Object o) { + return null; + } /** * function getPrototypeOf(o) return the prototype of an object @@ -154,13 +166,15 @@ public JS5Object(JSObject value) { * Object.getPrototypeOf(o); //=> p * * @param o An object. - * @returns The prototype of object o. + * @returns The prototype of object {@code o}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #create(JS5Object, JS5Object) create() * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object getPrototypeOf(JS5Object o){return null;} + public static JS5Object getPrototypeOf(JS5Object o) { + return null; + } /** * function isExtensible(o) can new properties be added to an object? @@ -173,18 +187,20 @@ public JS5Object(JSObject value) { * Object.isExtensible(o); //=> false * * @param o The object to be checked for extensibility - * @returns true if the object can be extended with new properties, otherwise false. + * @returns {code true} if the object can be extended with new properties, otherwise {code false}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @since Standard ECMA-262 5th. Edition * */ - public static JSBoolean isExtensible(JS5Object o){return null;} + public static JSBoolean isExtensible(JS5Object o) { + return null; + } /** * function isFrozen(o) is an object immutable? * * @param o The object to be checked. - * @returns true if the object is frozen or immutable, otherwise false. + * @returns {code true} if the object is frozen or immutable, otherwise {code false}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @see #freeze(JS5Object) freeze() @@ -195,13 +211,15 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JSBoolean isFrozen(JS5Object o){return null;} + public static JSBoolean isFrozen(JS5Object o) { + return null; + } /** * function isSealed(o) can properties be added or deleted from an object? * * @param o The object to be checked. - * @returns true if the object is sealed, otherwise false. + * @returns {code true} if the object is sealed, otherwise {code false}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @see #freeze(JS5Object) freeze() @@ -212,7 +230,9 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JSBoolean isSealed(JS5Object o){return null;} + public static JSBoolean isSealed(JS5Object o) { + return null; + } /** * function keys(o) return enumerable property names. @@ -222,19 +242,21 @@ public JS5Object(JSObject value) { * Object.keys({x:1, y:2}); // => ["x", "y"] * * @param o an object - * @returns An array that contains the names of all enumerable own (non-inherited) properties of o. + * @returns An array that contains the names of all enumerable own (non-inherited) properties of {@code o}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #getOwnPropertyNames(JS5Object) getOwnPropertyNames() * @since Standard ECMA-262 5th. Edition * */ - public static JS5Array keys(JS5Object o){return null;} + public static JS5Array keys(JS5Object o) { + return null; + } /** * function preventExtensions(o) don't allow new properties on an object. * * @param o The object is to have its extensibility attribute set. - * @returns The argument o. + * @returns The argument {@code o}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #freeze(JS5Object) freeze() * @see #isExtensible(JS5Object) isExtensible() @@ -242,13 +264,15 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object preventExtensions(JS5Object o){return null;} + public static JS5Object preventExtensions(JS5Object o){ + return null; + } /** * function seal(o) prevent the addition or deletion of properties. * * @param o The object to be sealed. - * @returns The now-sealed argument of o. + * @returns The now-sealed argument of {@code o}. * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Object Object * @see #defineProperty(JS5Object, JS5String, JS5Object) defineProperty() * @see #freeze(JS5Object) freeze() @@ -257,6 +281,8 @@ public JS5Object(JSObject value) { * @since Standard ECMA-262 5th. Edition * */ - public static JS5Object seal(JS5Object o){return null;} + public static JS5Object seal(JS5Object o){ + return null; + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5String.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5String.java index 206c0051..c4f127ad 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5String.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/JS5String.java @@ -20,5 +20,7 @@ public abstract class JS5String extends JSString implements JS5StringFunctions { * @since Standard ECMA-262 3rd. Edition * @since Level 2 Document Object Model Core Definition. */ - public JS5String(JSString s){super(s);} + public JS5String(JSString s) { + super(s); + } } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/functions/JS5ArrayFunctions.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/functions/JS5ArrayFunctions.java index 6303783d..54932fdf 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/functions/JS5ArrayFunctions.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/ecma/api/ecma5/functions/JS5ArrayFunctions.java @@ -63,7 +63,7 @@ public interface JS5ArrayFunctions extends JS5ObjectFunctions, JSArrayFunctions * a.forEach(function(x,i,a){a[i]++;}); //a is now [2,3,4] * * @param f The function to invoke for each element of array - * @param o An optional value on which f is invoked + * @param o An optional value on which {@code f} is invoked * @memberOf Array * @see org.fife.rsta.ac.js.ecma.api.ecma5.JS5Array Array * @since Standard ECMA-262 5th. Edition diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/ECMAJavaScriptEngine.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/ECMAJavaScriptEngine.java index 5dcfff4c..b2e6a8b3 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/ECMAJavaScriptEngine.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/ECMAJavaScriptEngine.java @@ -20,7 +20,7 @@ public JavaScriptResolver getJavaScriptResolver(SourceCompletionProvider provide @Override public JavaScriptTypesFactory getJavaScriptTypesFactory(SourceCompletionProvider provider) { - if(jsFactory == null) + if (jsFactory == null) jsFactory = JavaScriptTypesFactory.getDefaultJavaScriptTypesFactory(provider.getTypesFactory()); return jsFactory; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JSR223JavaScriptEngine.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JSR223JavaScriptEngine.java index 3e48a906..ab680f5c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JSR223JavaScriptEngine.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JSR223JavaScriptEngine.java @@ -23,7 +23,7 @@ public JavaScriptResolver getJavaScriptResolver(SourceCompletionProvider provide @Override public JavaScriptTypesFactory getJavaScriptTypesFactory(SourceCompletionProvider provider) { - if(jsFactory == null) + if (jsFactory == null) jsFactory = new JSR223JavaScriptTypesFactory(provider.getTypesFactory()); return jsFactory; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngine.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngine.java index 364b0255..8ae4dfc5 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngine.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngine.java @@ -11,7 +11,7 @@ /** - * JavaScript Engine Interface used for resolving Types + * JavaScript Engine Interface used for resolving Types. * SourceCompletionProvider needs a JavaScriptEngine for creating the following: *
        *
      • JavaScriptResolver @@ -43,6 +43,7 @@ public TypeDeclarationFactory getTypesFactory() { public abstract JavaScriptResolver getJavaScriptResolver(SourceCompletionProvider provider); /** + * Returns the types factory. * * @param provider SourceCompletionProvider * @return JavaScriptTypesFactory that holds a cache of JavaScriptType @@ -50,6 +51,7 @@ public TypeDeclarationFactory getTypesFactory() { public abstract JavaScriptTypesFactory getJavaScriptTypesFactory(SourceCompletionProvider provider); /** + * Returns the parser. * * @param provider SourceCompletionProvider * @param dot caret position @@ -57,6 +59,7 @@ public TypeDeclarationFactory getTypesFactory() { * @return JavaScriptParser that converts AstRoot to CodeBlock * */ - public abstract JavaScriptParser getParser(SourceCompletionProvider provider, int dot, TypeDeclarationOptions options); + public abstract JavaScriptParser getParser(SourceCompletionProvider provider, int dot, + TypeDeclarationOptions options); } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngineFactory.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngineFactory.java index dd7433ca..54a9b6c1 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngineFactory.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/JavaScriptEngineFactory.java @@ -1,22 +1,23 @@ package org.fife.rsta.ac.js.engine; import java.util.HashMap; +import java.util.Map; -public class JavaScriptEngineFactory { +public final class JavaScriptEngineFactory { public static final String DEFAULT = ECMAJavaScriptEngine.ECMA_ENGINE; - private HashMap supportedEngines = + private Map supportedEngines = new HashMap<>(); - private static JavaScriptEngineFactory Instance = new JavaScriptEngineFactory(); + private static final JavaScriptEngineFactory INSTANCE = new JavaScriptEngineFactory(); static { - Instance().addEngine(ECMAJavaScriptEngine.ECMA_ENGINE, new ECMAJavaScriptEngine()); - Instance().addEngine(JSR223JavaScriptEngine.JSR223_ENGINE, new JSR223JavaScriptEngine()); - Instance().addEngine(RhinoJavaScriptEngine.RHINO_ENGINE, new RhinoJavaScriptEngine()); + instance().addEngine(ECMAJavaScriptEngine.ECMA_ENGINE, new ECMAJavaScriptEngine()); + instance().addEngine(JSR223JavaScriptEngine.JSR223_ENGINE, new JSR223JavaScriptEngine()); + instance().addEngine(RhinoJavaScriptEngine.RHINO_ENGINE, new RhinoJavaScriptEngine()); } @@ -24,13 +25,13 @@ private JavaScriptEngineFactory() { } - public static JavaScriptEngineFactory Instance() { - return Instance; + public static JavaScriptEngineFactory instance() { + return INSTANCE; } public JavaScriptEngine getEngineFromCache(String name) { - if(name == null) { + if (name == null) { name = DEFAULT; } return supportedEngines.get(name); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/RhinoJavaScriptEngine.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/RhinoJavaScriptEngine.java index 37577c43..4a128c2c 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/RhinoJavaScriptEngine.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/engine/RhinoJavaScriptEngine.java @@ -23,7 +23,7 @@ public JavaScriptResolver getJavaScriptResolver(SourceCompletionProvider provide @Override public JavaScriptTypesFactory getJavaScriptTypesFactory(SourceCompletionProvider provider) { - if(jsFactory == null) + if (jsFactory == null) jsFactory = new RhinoJavaScriptTypesFactory(provider.getTypesFactory()); return jsFactory; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JSR223JavaScriptCompletionResolver.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JSR223JavaScriptCompletionResolver.java index afd31d00..bd67aaf3 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JSR223JavaScriptCompletionResolver.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JSR223JavaScriptCompletionResolver.java @@ -80,16 +80,16 @@ public String getFunctionNameLookup(FunctionCall call, SourceCompletionProvider AstNode paramNode = call.getArguments().get(i); JavaScriptResolver resolver = provider.getJavaScriptEngine().getJavaScriptResolver(provider); Logger.log("PARAM: " + JavaScriptHelper.convertNodeToSource(paramNode)); - try - { + try { TypeDeclaration type = resolver.resolveParamNode(JavaScriptHelper.convertNodeToSource(paramNode)); String resolved = type != null ? type.getQualifiedName() : "any"; sb.append(resolved); if (i < count - 1) { sb.append(","); } + } catch (IOException io) { + io.printStackTrace(); } - catch(IOException io){io.printStackTrace();} } sb.append(")"); return sb.toString(); @@ -99,7 +99,7 @@ public String getFunctionNameLookup(FunctionCall call, SourceCompletionProvider /** - * Try to resolve the Token.NAME AstNode and return a TypeDeclaration + * Try to resolve the Token.NAME AstNode and return a TypeDeclaration. * @param node node to resolve * @return TypeDeclaration if the name can be resolved as a Java Class else null */ @@ -108,15 +108,13 @@ protected TypeDeclaration findJavaStaticType(AstNode node) { // check parent is of type property get String testName = null; if (node.getParent() != null - && node.getParent().getType() == Token.GETPROP) { // ast - // parser + && node.getParent().getType() == Token.GETPROP) { // ast parser String name = node.toSource(); - try - { + try { String longName = node.getParent().toSource(); - if(longName.indexOf('[') == -1 && longName.indexOf(']') == -1 && + if (longName.indexOf('[') == -1 && longName.indexOf(']') == -1 && longName.indexOf('(') == -1 && longName.indexOf(')') == -1) { // trim the text to the short name @@ -125,9 +123,7 @@ protected TypeDeclaration findJavaStaticType(AstNode node) { testName = longName.substring(0, index + name.length()); } } - } - catch(Exception e) - { + } catch (Exception e) { Logger.log(e.getMessage()); } } @@ -138,7 +134,7 @@ protected TypeDeclaration findJavaStaticType(AstNode node) { if (testName != null) { TypeDeclaration dec = JavaScriptHelper.getTypeDeclaration(testName, provider); - if(dec == null) + if (dec == null) dec = JavaScriptHelper.createNewTypeDeclaration(testName); ClassFile cf = provider.getJavaScriptTypesFactory().getClassFile( diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptCompletionResolver.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptCompletionResolver.java index 964463fd..4a4d92d1 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptCompletionResolver.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptCompletionResolver.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.Set; import org.fife.rsta.ac.java.classreader.ClassFile; import org.fife.rsta.ac.js.JavaScriptHelper; @@ -46,7 +47,8 @@ public class JavaScriptCompletionResolver extends JavaScriptResolver { /** - * Standard ECMA JavaScript resolver + * Standard ECMA JavaScript resolver. + * * @param provider */ public JavaScriptCompletionResolver(SourceCompletionProvider provider) { @@ -64,7 +66,8 @@ public JavaScriptCompletionResolver(SourceCompletionProvider provider) { */ @Override public JavaScriptType compileText(String text) { - CompilerEnvirons env = JavaScriptParser.createCompilerEnvironment(new JavaScriptParser.JSErrorReporter(), provider.getLanguageSupport()); + CompilerEnvirons env = JavaScriptParser.createCompilerEnvironment(new JavaScriptParser.JSErrorReporter(), + provider.getLanguageSupport()); String parseText = JavaScriptHelper.removeLastDotFromText(text); @@ -85,8 +88,9 @@ public JavaScriptType compileText(String text) { @Override public TypeDeclaration resolveParamNode(String text) { - if(text != null) { - CompilerEnvirons env = JavaScriptParser.createCompilerEnvironment(new JavaScriptParser.JSErrorReporter(), provider.getLanguageSupport()); + if (text != null) { + CompilerEnvirons env = JavaScriptParser.createCompilerEnvironment(new JavaScriptParser.JSErrorReporter(), + provider.getLanguageSupport()); int charIndex = JavaScriptHelper.findIndexOfFirstOpeningBracket(text); env.setRecoverFromErrors(true); @@ -101,13 +105,15 @@ public TypeDeclaration resolveParamNode(String text) { } /** - * Resolve node type to TypeDeclaration. Called instead of #compileText(String text) when document is already parsed + * Resolve node type to TypeDeclaration. Called instead of #compileText(String text) when document is already + * parsed. + * * @param node AstNode to resolve * @return TypeDeclaration for node or null if not found. */ @Override public TypeDeclaration resolveNode(AstNode node) { - if(node == null) return provider.getTypesFactory().getDefaultTypeDeclaration(); + if (node == null) return provider.getTypesFactory().getDefaultTypeDeclaration(); CompilerNodeVisitor visitor = new CompilerNodeVisitor(true); node.visit(visitor); return lastJavaScriptType != null ? lastJavaScriptType.getType() @@ -115,17 +121,16 @@ public TypeDeclaration resolveNode(AstNode node) { } /** - * Resolve node type to TypeDeclaration + * Resolve node type to TypeDeclaration. * N.B called from CompilerNodeVisitor.visit() * * @param node AstNode to resolve * @return TypeDeclaration for node or null if not found. */ @Override - protected TypeDeclaration resolveNativeType(AstNode node) - { + protected TypeDeclaration resolveNativeType(AstNode node) { TypeDeclaration dec = JavaScriptHelper.tokenToNativeTypeDeclaration(node, provider); - if(dec == null) { + if (dec == null) { dec = testJavaStaticType(node); } @@ -147,7 +152,7 @@ protected TypeDeclaration testJavaStaticType(AstNode node) { } /** - * Try to resolve the Token.NAME AstNode and return a TypeDeclaration + * Try to resolve the Token.NAME AstNode and return a TypeDeclaration. * @param node node to resolve * @return TypeDeclaration if the name can be resolved as a Java Class else null */ @@ -158,8 +163,7 @@ protected TypeDeclaration findJavaStaticType(AstNode node) { if (testName != null) { TypeDeclaration dec = JavaScriptHelper.getTypeDeclaration(testName, provider); - if(dec != null) - { + if (dec != null) { ClassFile cf = provider.getJavaScriptTypesFactory().getClassFile( provider.getJarManager(), dec); if (cf != null) { @@ -176,12 +180,10 @@ protected TypeDeclaration findJavaStaticType(AstNode node) { // TODO not sure how right this is, but is very tricky problem resolving // complex completions - private class CompilerNodeVisitor implements NodeVisitor { + private final class CompilerNodeVisitor implements NodeVisitor { private boolean ignoreParams; - private HashSet paramNodes = new HashSet<>(); - - + private Set paramNodes = new HashSet<>(); private CompilerNodeVisitor(boolean ignoreParams) { this.ignoreParams = ignoreParams; @@ -194,8 +196,7 @@ public boolean visit(AstNode node) { Logger.log(JavaScriptHelper.convertNodeToSource(node)); Logger.log(node.shortName()); - if(!validNode(node)) - { + if (!validNode(node)) { //invalid node found, set last completion invalid and stop processing lastJavaScriptType = null; return false; @@ -209,9 +210,9 @@ public boolean visit(AstNode node) { TypeDeclaration dec; //only resolve native type if last type is null //otherwise it can be assumed that this is part of multi depth - e.g. "".length.toString() - if(lastJavaScriptType == null) { + if (lastJavaScriptType == null) { dec = resolveNativeType(node); - if(dec == null && node.getType() == Token.NAME) { + if (dec == null && node.getType() == Token.NAME) { lastJavaScriptType = null; return false; } @@ -244,13 +245,12 @@ else if (lastJavaScriptType != null) { lastJavaScriptType = jsType; } } - else if(node instanceof FunctionCall) - { + else if (node instanceof FunctionCall) { FunctionCall fn = (FunctionCall) node; String lookupText = createLookupString(fn); - JavaScriptFunctionDeclaration funcDec = provider.getVariableResolver().findFunctionDeclaration(lookupText); - if(funcDec != null) - { + JavaScriptFunctionDeclaration funcDec = provider.getVariableResolver(). + findFunctionDeclaration(lookupText); + if (funcDec != null) { jsType = provider.getJavaScriptTypesFactory().getCachedType( funcDec.getTypeDeclaration(), provider.getJarManager(), provider, JavaScriptHelper.convertNodeToSource(node)); @@ -265,32 +265,28 @@ else if(node instanceof FunctionCall) return true; } - private boolean validNode(AstNode node) - { - switch(node.getType()) - { - case Token.NAME: return ((Name) node).getIdentifier() != null && ((Name) node).getIdentifier().length() > 0; + private boolean validNode(AstNode node) { + switch (node.getType()) { + case Token.NAME: return ((Name) node).getIdentifier() != null && + !((Name) node).getIdentifier().isEmpty(); } return true; } - private String createLookupString(FunctionCall fn) - { + private String createLookupString(FunctionCall fn) { StringBuilder sb = new StringBuilder(); String name = ""; - switch(fn.getTarget().getType()) - { + switch (fn.getTarget().getType()) { case Token.NAME : name = ((Name) fn.getTarget()).getIdentifier(); break; } sb.append(name); sb.append("("); Iterator i = fn.getArguments().iterator(); - while (i.hasNext()) - { + while (i.hasNext()) { i.next(); sb.append("p"); - if(i.hasNext()) + if (i.hasNext()) sb.append(","); } sb.append(")"); @@ -299,14 +295,14 @@ private String createLookupString(FunctionCall fn) /** * Test node to check whether to ignore resolving, this is for - * parameters + * parameters. * * @param node node to test * @return true to ignore */ private boolean ignore(AstNode node, boolean ignoreParams) { switch (node.getType()) { - // ignore errors e.g. if statement - if(a. //no closing brace + // ignore errors e.g. if statement - if (a. //no closing brace case Token.EXPR_VOID: case Token.EXPR_RESULT: return ((ExpressionStatement) node).getExpression() @@ -333,7 +329,7 @@ private boolean ignore(AstNode node, boolean ignoreParams) { /** - * Get all nodes within AstNode and add to an ArrayList + * Get all nodes within AstNode and add to an ArrayList. * * @param node */ @@ -352,7 +348,7 @@ private void collectAllNodes(AstNode node) { /** * Check the function that a name may belong to contains this actual - * parameter + * parameter. * * @param node Node to check * @return true if the function contains the parameter @@ -501,7 +497,7 @@ private JavaScriptType lookupJavaScriptType( /** - * Creates a new JavaScriptType based on the String type + * Creates a new JavaScriptType based on the String type. * @param provider SourceCompletionProvider * @param type type of JavaScript type to create e.g. java.sql.Connection * @param text Text entered from the user to resolve the node. This will be null if resolveNode(AstNode node) is called @@ -537,9 +533,9 @@ protected TypeDeclaration resolveTypeFromLastJavaScriptType(AstNode node) { /** - * Visit all nodes in the AstNode tree and all to a single list + * Visit all nodes in the AstNode tree and all to a single list. */ - private static class VisitorAll implements NodeVisitor { + private static final class VisitorAll implements NodeVisitor { private ArrayList all = new ArrayList<>(); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptResolver.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptResolver.java index f788b72a..70c8cb54 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptResolver.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/resolver/JavaScriptResolver.java @@ -15,11 +15,11 @@ public abstract class JavaScriptResolver { protected SourceCompletionProvider provider; /** - * Base JavaScriptResolver + * Base JavaScriptResolver. + * * @param provider SourceCompletionProvider */ - public JavaScriptResolver(SourceCompletionProvider provider) - { + public JavaScriptResolver(SourceCompletionProvider provider) { this.provider = provider; } @@ -45,18 +45,21 @@ public JavaScriptResolver(SourceCompletionProvider provider) * "Hello World".length; //resolve as a Number * * @param text to compile and resolve + * @return The type. */ public abstract JavaScriptType compileText(String text) throws IOException; /** - * Resolve node type to TypeDeclaration + * Resolve node type to TypeDeclaration. + * * @param node AstNode to resolve * @return TypeDeclaration for node or null if not found. */ protected abstract TypeDeclaration resolveNativeType(AstNode node); /** - * Get lookup string for function completions + * Get lookup string for function completions. + * * @param method JSMethodData holding method information * @param name name of method * @return The lookup text. @@ -64,7 +67,8 @@ public JavaScriptResolver(SourceCompletionProvider provider) public abstract String getLookupText(JSMethodData method, String name); /** - * Returns same string format as {@link #getLookupText(JSMethodData, String)} but from AstNode Function + * Returns same string format as {@link #getLookupText(JSMethodData, String)} but from AstNode Function. + * * @param call * @param provider * @return The function name. diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTree.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTree.java index 29836848..5763593b 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTree.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTree.java @@ -244,7 +244,7 @@ public void updateUI() { * Listens for events this tree is interested in (events in the associated * editor, for example), as well as events in this tree. */ - private class Listener implements PropertyChangeListener, + private final class Listener implements PropertyChangeListener, TreeSelectionListener { /** diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTreeGenerator.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTreeGenerator.java index 830ce70f..c7661af7 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTreeGenerator.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/tree/JavaScriptOutlineTreeGenerator.java @@ -44,6 +44,9 @@ */ class JavaScriptOutlineTreeGenerator implements NodeVisitor { + private static final System.Logger LOG = System.getLogger( + JavaScriptOutlineTreeGenerator.class.getName()); + private JavaScriptTreeNode root; private RSyntaxTextArea textArea; @@ -98,7 +101,8 @@ private void addPrototypeAdditionsToRoot() { * The "Foo" global variable is complained about. Note that this does not * occur if there is not JS code *before* and *after* the Foo stuff (?)... else { - System.out.println("Node with null text: " + ((AstNode)((java.util.List)childNode.getUserObject()).get(0)).toSource()); + LOG.log(System.Logger.Level.INFO, "Node with null text: " + + ((AstNode)((java.util.List)childNode.getUserObject()).get(0)).toSource()); } */ } @@ -613,11 +617,10 @@ private boolean visitVariableDeclaration(VariableDeclaration varDec) { switch (target.getType()) { case Token.NAME: varNameNode = (Name)target; - //System.out.println("... Variable: " + name.getIdentifier()); varName = varNameNode.getIdentifier(); break; default: - System.out.println("... Unknown var target type: " + target.getClass()); + LOG.log(System.Logger.Level.INFO, "... Unknown var target type: " + target.getClass()); varName = "?"; break; } diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/util/RhinoUtil.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/util/RhinoUtil.java index 8656bca3..e242a6ae 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/util/RhinoUtil.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/js/util/RhinoUtil.java @@ -28,8 +28,9 @@ * @author Robert Futrell * @version 1.0 */ -public class RhinoUtil { +public final class RhinoUtil { + private static final System.Logger LOG = System.getLogger(RhinoUtil.class.getName()); /** * Private constructor to prevent instantiation. @@ -59,7 +60,7 @@ public static String getFunctionArgsString(FunctionNode fn) { paramName = ((Name)paramNode).getIdentifier(); break; default: - System.out.println("Unhandled class for param: " + + LOG.log(System.Logger.Level.INFO, "Unhandled class for param: " + paramNode.getClass()); paramName = "?"; break; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/less/LessCodeCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/less/LessCodeCompletionProvider.java index 309a7d5b..fa48fa08 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/less/LessCodeCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/less/LessCodeCompletionProvider.java @@ -57,7 +57,7 @@ protected boolean addLessCompletions(List completions, boolean modified = false; - if (alreadyEntered != null && alreadyEntered.length() > 0 && + if (alreadyEntered != null && !alreadyEntered.isEmpty() && alreadyEntered.charAt(0) == '@') { addLessVariableCompletions(completions, comp, alreadyEntered); modified = true; diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/perl/PerlCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/perl/PerlCompletionProvider.java index 8eb1c2d9..82c779f9 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/perl/PerlCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/perl/PerlCompletionProvider.java @@ -162,7 +162,7 @@ private SortedSet getVariableCompletions(JTextComponent comp) { CompletionProvider p = getDefaultCompletionProvider(); String text = p.getAlreadyEnteredText(comp); - char firstChar = text.length()==0 ? 0 : text.charAt(0); + char firstChar = text.isEmpty() ? 0 : text.charAt(0); if (firstChar!='$' && firstChar!='@' && firstChar!='%') { return null; } @@ -173,7 +173,7 @@ private SortedSet getVariableCompletions(JTextComponent comp) { recursivelyAddLocalVars(varCompletions, block, dot, firstChar); // Get only those that match what's typed - if (varCompletions.size()>0) { + if (!varCompletions.isEmpty()) { Completion from = new BasicCompletion(p, text); Completion to = new BasicCompletion(p, text + '{'); varCompletions = varCompletions.subSet(from, to); diff --git a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/php/PhpCompletionProvider.java b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/php/PhpCompletionProvider.java index b05df9bf..cbd075a1 100644 --- a/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/php/PhpCompletionProvider.java +++ b/RSTALanguageSupport/src/main/java/org/fife/rsta/ac/php/PhpCompletionProvider.java @@ -101,7 +101,7 @@ public void loadPhpCompletionsFromXML(InputStream in) throws IOException { if (startChar != 0) { char endChar = handler.getParamEndChar(); String sep = handler.getParamSeparator(); - if (endChar != 0 && sep != null && sep.length() > 0) { // Sanity + if (endChar != 0 && sep != null && !sep.isEmpty()) { // Sanity setParameterizedCompletionParams(startChar, sep, endChar); } } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 18da6ade..5c7a5227 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -69,6 +69,9 @@ + + + @@ -84,7 +87,7 @@ - + diff --git a/config/checkstyle/lsSuppressions.xml b/config/checkstyle/lsSuppressions.xml index aaf8ef36..1cc398ec 100644 --- a/config/checkstyle/lsSuppressions.xml +++ b/config/checkstyle/lsSuppressions.xml @@ -6,11 +6,12 @@ - - +