diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_new_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_new_language.md index ae36818f10..f87d471aea 100644 --- a/docs/pages/pmd/devdocs/major_contributions/adding_new_language.md +++ b/docs/pages/pmd/devdocs/major_contributions/adding_new_language.md @@ -23,7 +23,7 @@ folder: pmd/devdocs * The name of the AST class should be “AST” + “whatever is the name of the node in JJT file”. * For example, if JJT contains a node called “IfStatement”, there should be a class called “ASTIfStatement” * Each AST class should have two constructors: one that takes an int id; and one that takes an instance of the parser, and an int id -* It’s a good idea to create a parent AST class for all AST classes of the language. This simplies rule creation later. *(see SimpleNode for Velocity and AbstractJavaNode for Java for example)* +* It’s a good idea to create a parent AST class for all AST classes of the language. This simplifies rule creation later. *(see SimpleNode for Velocity and AbstractJavaNode for Java for example)* * Note: These AST node classes are generated usually once by javacc/jjtree and can then be modified as needed. ## 4. Compile your parser (if using JJT) @@ -43,7 +43,7 @@ folder: pmd/devdocs ## 7. Create a rule violation factory * Extend `AbstractRuleViolationFactory` *(see VmRuleViolationFactory for example)* -* The purpose of this class is to createa rule violation instance specific to your language +* The purpose of this class is to create a rule violation instance specific to your language ## 8. Create a version handler * Extend `AbstractLanguageVersionHandler` *(see VmHandler for example)* diff --git a/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md b/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md index d224b28ee7..db4ac9846c 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md +++ b/docs/pages/pmd/userdocs/cpd/cpd_report_formats.md @@ -66,7 +66,7 @@ Starting at line 68 of /home/pmd/source/pmd-core/src/test/java/net/sourceforge/p ruleReference.setExternalInfoUrl("externalInfoUrl2"); ruleReference.setPriority(RulePriority.MEDIUM_HIGH); - validateOverridenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference); + validateOverriddenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference); ===================================================================== Found a 16 line (110 tokens) duplication in the following files: Starting at line 66 of /home/pmd/source/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/JaxenXPathRuleQueryTest.java @@ -138,7 +138,7 @@ Example: ruleReference.setExternalInfoUrl("externalInfoUrl2"); ruleReference.setPriority(RulePriority.MEDIUM_HIGH); - validateOverridenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference);]]> + validateOverriddenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference);]]> extends ParametricRuleViolation { * * @deprecated Is internal API, not useful, there's a typo. See #1927 */ + // should be isSuppressed, but as it is already Deprecated, we will not port it. @Deprecated public static boolean isSupressed(Node node, Rule rule) { boolean result = suppresses(node, rule); diff --git a/pmd-apex/src/main/resources/category/apex/design.xml b/pmd-apex/src/main/resources/category/apex/design.xml index b79afaa0e8..819c639128 100644 --- a/pmd-apex/src/main/resources/category/apex/design.xml +++ b/pmd-apex/src/main/resources/category/apex/design.xml @@ -52,7 +52,7 @@ program. As such, they include all control flow statements, such as 'if', 'while Generally, numbers ranging from 1-4 denote low complexity, 5-7 denote moderate complexity, 8-10 denote high complexity, and 11+ is very high complexity. By default, this rule reports methods with a complexity >= 10. -Additionnally, classes with many methods of moderate complexity get reported as well once the total of their +Additionally, classes with many methods of moderate complexity get reported as well once the total of their methods' complexities reaches 40, even if none of the methods was directly reported. Reported methods should be broken down into several smaller methods. Reported classes should probably be broken down diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java index ab731aa1ed..4ef39d585a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/ast/ApexParserTest.java @@ -49,13 +49,13 @@ public class ApexParserTest extends ApexParserTestBase { + "}\n"; // line 6 @Test - public void verifyLineColumNumbers() { + public void verifyLineColumnNumbers() { ApexNode rootNode = parse(testCodeForLineNumbers); assertLineNumbersForTestCode(rootNode); } @Test - public void verifyLineColumNumbersWithWindowsLineEndings() { + public void verifyLineColumnNumbersWithWindowsLineEndings() { String windowsLineEndings = testCodeForLineNumbers.replaceAll(" \n", "\r\n"); ApexNode rootNode = parse(windowsLineEndings); assertLineNumbersForTestCode(rootNode); diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml index 4ce3f629b1..38611b4d27 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/MethodNamingConventions.xml @@ -35,7 +35,7 @@ public class Foo { - #1343 MethodNamingConventions for overriden methods + #1343 MethodNamingConventions for overridden methods 0 { return e.getKey(); } } - return "--unkown--"; + return "--unknown--"; } final void setImage(String image) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/dcd/ClassLoaderUtil.java b/pmd-core/src/main/java/net/sourceforge/pmd/dcd/ClassLoaderUtil.java index fa296c34e8..3757854b32 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/dcd/ClassLoaderUtil.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/dcd/ClassLoaderUtil.java @@ -147,7 +147,12 @@ public final class ClassLoaderUtil { return parameterTypes; } + @Deprecated public static boolean isOverridenMethod(Class clazz, Method method, boolean checkThisClass) { + return isOverriddenMethod(clazz, method, checkThisClass); + } + + public static boolean isOverriddenMethod(Class clazz, Method method, boolean checkThisClass) { try { if (checkThisClass) { clazz.getDeclaredMethod(method.getName(), method.getParameterTypes()); @@ -158,13 +163,13 @@ public final class ClassLoaderUtil { } // Check super class if (clazz.getSuperclass() != null) { - if (isOverridenMethod(clazz.getSuperclass(), method, true)) { + if (isOverriddenMethod(clazz.getSuperclass(), method, true)) { return true; } } // Check interfaces for (Class anInterface : clazz.getInterfaces()) { - if (isOverridenMethod(anInterface, method, true)) { + if (isOverriddenMethod(anInterface, method, true)) { return true; } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/dcd/UsageNodeVisitor.java b/pmd-core/src/main/java/net/sourceforge/pmd/dcd/UsageNodeVisitor.java index 7bb04786e0..fcab1c4152 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/dcd/UsageNodeVisitor.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/dcd/UsageNodeVisitor.java @@ -201,13 +201,13 @@ public class UsageNodeVisitor extends NodeVisitorAdapter { if (methodNode.getUsers().isEmpty()) { boolean log = true; if (options.isIgnoreMethodAllOverride()) { - if (ClassLoaderUtil.isOverridenMethod(methodNode.getClassNode().getClass(), methodNode.getMember(), + if (ClassLoaderUtil.isOverriddenMethod(methodNode.getClassNode().getClass(), methodNode.getMember(), false)) { ignore("method all override", methodNode); log = false; } } else if (options.isIgnoreMethodJavaLangObjectOverride()) { - if (ClassLoaderUtil.isOverridenMethod(java.lang.Object.class, methodNode.getMember(), true)) { + if (ClassLoaderUtil.isOverriddenMethod(java.lang.Object.class, methodNode.getMember(), true)) { ignore("method java.lang.Object override", methodNode); log = false; } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/Language.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/Language.java index eb60d5aade..fa82517522 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/Language.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/Language.java @@ -8,7 +8,7 @@ import java.util.List; /** * Interface each Language implementation has to implement. It is used by the - * LanguageRregistry to access constants and implementation classes in order to + * LanguageRegistry to access constants and implementation classes in order to * provide support for the language. *

* The following are key components of a Language in PMD: diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java index 332369b816..fd65eab7cd 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AbstractNode.java @@ -672,7 +672,7 @@ public abstract class AbstractNode implements Node { @Override // @Deprecated // FUTURE 7.0.0 make abstract public String getXPathNodeName() { - LOG.warning("getXPathNodeName should be overriden in classes derived from AbstractNode. " + LOG.warning("getXPathNodeName should be overridden in classes derived from AbstractNode. " + "The implementation is provided for compatibility with existing implementors," + "but could be declared abstract as soon as release " + PMDVersion.getNextMajorRelease() + "."); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/internal/DeprecatedAttrLogger.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/internal/DeprecatedAttrLogger.java index e6c2358a06..f339f18ab0 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/internal/DeprecatedAttrLogger.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/xpath/internal/DeprecatedAttrLogger.java @@ -109,7 +109,7 @@ public abstract class DeprecatedAttrLogger { if (!replacement.isEmpty()) { msg += ", please use " + replacement + " instead"; } - // log with execption stack trace to help figure out where exactly the xpath is used. + // log with exception stack trace to help figure out where exactly the xpath is used. LOG.log(Level.WARNING, msg, new RuntimeException(msg)); } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/dfa/LinkerException.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/dfa/LinkerException.java index 6b82681b61..7578bf3e95 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/dfa/LinkerException.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/dfa/LinkerException.java @@ -14,7 +14,7 @@ public class LinkerException extends Exception { public LinkerException() { // TODO redefinition | accurate? - super("An error occured by computing the data flow paths"); + super("An error occurred by computing the data flow paths"); } public LinkerException(String message) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRuleQuery.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRuleQuery.java index cd1d36c32f..bf8ba66ffa 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRuleQuery.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/XPathRuleQuery.java @@ -80,7 +80,7 @@ public interface XPathRuleQuery { /** * Indicates which AST Nodes (if any) should be used with the RuleChain. Use - * of the RuleChain will allow the query execute on a targed sub-tree of the + * of the RuleChain will allow the query execute on a targeted sub-tree of the * AST, instead of the entire AST from the root. This can result in great * performance benefits. */ diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractMultiValueProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractMultiValueProperty.java index 339a6554c6..fb00253113 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractMultiValueProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractMultiValueProperty.java @@ -75,7 +75,7 @@ import net.sourceforge.pmd.Rule; } - /* This is the one overriden in PropertyDescriptor */ + /* This is the one overridden in PropertyDescriptor */ @Override public String propertyErrorFor(Rule rule) { List realValues = rule.getProperty(this); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java index 0cc16dc8d9..ec19306bb1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/IDEAJRenderer.java @@ -53,14 +53,14 @@ public class IDEAJRenderer extends AbstractIncrementingRenderer { if (".method".equals(classAndMethodName)) { // working on a directory tree - renderDirectoy(writer, violations); + renderDirectory(writer, violations); } else { // working on one file renderFile(writer, violations); } } - private void renderDirectoy(Writer writer, Iterator violations) throws IOException { + private void renderDirectory(Writer writer, Iterator violations) throws IOException { SourcePath sourcePath = new SourcePath(getProperty(SOURCE_PATH)); StringBuilder buf = new StringBuilder(); while (violations.hasNext()) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java index c4a960c464..9a43070028 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextColorRenderer.java @@ -291,14 +291,14 @@ public class TextColorRenderer extends AbstractAccumulatingRenderer { if (fileName.indexOf(this.pwd) == 0) { relativePath = "." + fileName.substring(this.pwd.length()); - // remove current dir occuring twice - occurs if . was supplied as + // remove current dir occurring twice - occurs if . was supplied as // path if (relativePath.startsWith("." + File.separator + "." + File.separator)) { relativePath = relativePath.substring(2); } } else { // this happens when pmd's supplied argument deviates from the pwd - // 'branch' (god knows this terminolgy - i hope i make some sense). + // 'branch' (god knows this terminology - i hope i make some sense). // for instance, if supplied=/usr/lots/of/src and // pwd=/usr/lots/of/shared/source // TODO: a fix to get relative path? diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java index 5ff8a4e41c..a8bc4a382b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/rules/RuleFactory.java @@ -239,17 +239,17 @@ public class RuleFactory { * @return A map of property names to their value */ private Map getPropertyValuesFrom(Element propertiesNode) { - Map overridenProperties = new HashMap<>(); + Map overriddenProperties = new HashMap<>(); for (int i = 0; i < propertiesNode.getChildNodes().getLength(); i++) { Node node = propertiesNode.getChildNodes().item(i); if (node.getNodeType() == Node.ELEMENT_NODE && PROPERTY.equals(node.getNodeName())) { Entry overridden = getPropertyValue((Element) node); - overridenProperties.put(overridden.getKey(), overridden.getValue()); + overriddenProperties.put(overridden.getKey(), overridden.getValue()); } } - return overridenProperties; + return overriddenProperties; } /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/SearchFunction.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/SearchFunction.java index 709aa57325..a7339b70d0 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/SearchFunction.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/SearchFunction.java @@ -12,7 +12,7 @@ public interface SearchFunction { /** * Applies the search function over a single element. * @param o The element to analyze. - * @return True if the search should continue, false otherwhise. + * @return True if the search should continue, false otherwise. */ boolean applyTo(E o); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java index a12cc8000a..1ece0350ac 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/designer/Designer.java @@ -179,11 +179,11 @@ public class Designer implements ClipboardOwner { frame.setSize(screenWidth * 3 / 4, screenHeight * 3 / 4); frame.setLocation((screenWidth - frame.getWidth()) / 2, (screenHeight - frame.getHeight()) / 2); frame.setVisible(true); - int horozontalMiddleLocation = controlSplitPane.getMaximumDividerLocation() * 3 / 5; - controlSplitPane.setDividerLocation(horozontalMiddleLocation); + int horizontalMiddleLocation = controlSplitPane.getMaximumDividerLocation() * 3 / 5; + controlSplitPane.setDividerLocation(horizontalMiddleLocation); containerSplitPane.setDividerLocation(containerSplitPane.getMaximumDividerLocation() / 2); astAndSymbolTablePane.setDividerLocation(astAndSymbolTablePane.getMaximumDividerLocation() / 3); - resultsSplitPane.setDividerLocation(horozontalMiddleLocation); + resultsSplitPane.setDividerLocation(horizontalMiddleLocation); loadSettings(); } @@ -660,9 +660,9 @@ public class Designer implements ClipboardOwner { entry.getKey().getClass().getSimpleName() + ": " + entry.getKey()); scopeTreeNode.add(nameDeclarationTreeNode); for (NameOccurrence nameOccurrence : entry.getValue()) { - DefaultMutableTreeNode nameOccurranceTreeNode = new DefaultMutableTreeNode( + DefaultMutableTreeNode nameOccurrenceTreeNode = new DefaultMutableTreeNode( "Name occurrence: " + nameOccurrence); - nameDeclarationTreeNode.add(nameOccurranceTreeNode); + nameDeclarationTreeNode.add(nameOccurrenceTreeNode); } } } @@ -890,16 +890,16 @@ public class Designer implements ClipboardOwner { return b; } - private static void makeTextComponentUndoable(JTextComponent textConponent) { + private static void makeTextComponentUndoable(JTextComponent textComponent) { final UndoManager undoManager = new UndoManager(); - textConponent.getDocument().addUndoableEditListener(new UndoableEditListener() { + textComponent.getDocument().addUndoableEditListener(new UndoableEditListener() { @Override public void undoableEditHappened(UndoableEditEvent evt) { undoManager.addEdit(evt.getEdit()); } }); - ActionMap actionMap = textConponent.getActionMap(); - InputMap inputMap = textConponent.getInputMap(); + ActionMap actionMap = textComponent.getActionMap(); + InputMap inputMap = textComponent.getInputMap(); actionMap.put("Undo", new AbstractAction("Undo") { @Override public void actionPerformed(ActionEvent evt) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/log/ConsoleLogHandler.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/log/ConsoleLogHandler.java index 8e61d3d27b..77879f7044 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/log/ConsoleLogHandler.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/log/ConsoleLogHandler.java @@ -14,7 +14,7 @@ import java.util.logging.LogRecord; * Log to the console using a basic formatter. * * @author Wouter Zelle - * @deprecated This class will be complety removed in 7.0.0 + * @deprecated This class will be completely removed in 7.0.0 */ @Deprecated public class ConsoleLogHandler extends Handler { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/gui/menu/ASTNodePopupMenu.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/gui/menu/ASTNodePopupMenu.java index bc4c265552..9374dbf955 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/gui/menu/ASTNodePopupMenu.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/gui/menu/ASTNodePopupMenu.java @@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.util.viewer.model.ViewerModel; /** - * context sensetive menu for the AST Panel + * context sensitive menu for the AST Panel * * @author Boris Gruschko ( boris at gruschko.org ) * @version $Id$ diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/AttributeToolkit.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/AttributeToolkit.java index aedb293b71..4de01a06e3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/AttributeToolkit.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/AttributeToolkit.java @@ -7,7 +7,7 @@ package net.sourceforge.pmd.util.viewer.model; import net.sourceforge.pmd.lang.ast.xpath.Attribute; /** - * A toolkit for vaious attribute translations + * A toolkit for various attribute translations * * @author Boris Gruschko ( boris at gruschko.org ) * @version $Id$ @@ -21,8 +21,8 @@ public final class AttributeToolkit { * formats a value for its usage in XPath expressions * * @param attribute - * atribute which value should be formatted - * @return formmated value + * attribute which value should be formatted + * @return formatted value */ public static String formatValueForXPath(Attribute attribute) { return '\'' + attribute.getStringValue() + '\''; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/SimpleNodeTreeNodeAdapter.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/SimpleNodeTreeNodeAdapter.java index 27bcf3149f..2b8a8368fb 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/SimpleNodeTreeNodeAdapter.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/SimpleNodeTreeNodeAdapter.java @@ -108,7 +108,7 @@ public class SimpleNodeTreeNodeAdapter implements TreeNode { } /** - * checks the children and creates them if neccessary + * checks the children and creates them if necessary */ private void checkChildren() { if (children == null) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/ViewerModelListener.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/ViewerModelListener.java index a38a3826ab..5b6fdcdbea 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/ViewerModelListener.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/viewer/model/ViewerModelListener.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.util.viewer.model; /** - * identiefie a listener of the ViewerModel + * identify a listener of the ViewerModel * * @author Boris Gruschko ( boris at gruschko.org ) * @version $Id$ diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/ConfigurationTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/ConfigurationTest.java index b88e95d8a9..7dd248cf48 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/ConfigurationTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/ConfigurationTest.java @@ -231,7 +231,7 @@ public class ConfigurationTest { cacheFile.deleteOnExit(); final FileAnalysisCache analysisCache = new FileAnalysisCache(cacheFile); configuration.setAnalysisCache(analysisCache); - assertSame("Confgured cache not stored", analysisCache, configuration.getAnalysisCache()); + assertSame("Configured cache not stored", analysisCache, configuration.getAnalysisCache()); } @Test diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java index 34bb80c712..c7e4f6cf1d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/RuleReferenceTest.java @@ -61,7 +61,7 @@ public class RuleReferenceTest { ruleReference.setExternalInfoUrl("externalInfoUrl2"); ruleReference.setPriority(RulePriority.MEDIUM_HIGH); - validateOverridenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference); + validateOverriddenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, ruleReference); } @Test @@ -97,11 +97,11 @@ public class RuleReferenceTest { ruleReference.setExternalInfoUrl("externalInfoUrl2"); ruleReference.setPriority(RulePriority.MEDIUM_HIGH); - validateOverridenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, (RuleReference) ruleReference.deepCopy()); + validateOverriddenValues(PROPERTY1_DESCRIPTOR, PROPERTY2_DESCRIPTOR, (RuleReference) ruleReference.deepCopy()); } - private void validateOverridenValues(final StringProperty propertyDescriptor1, - final StringProperty propertyDescriptor2, RuleReference ruleReference) { + private void validateOverriddenValues(final StringProperty propertyDescriptor1, + final StringProperty propertyDescriptor2, RuleReference ruleReference) { assertEquals("Override failed", LanguageRegistry.getLanguage(DummyLanguageModule.NAME), ruleReference.getLanguage()); assertEquals("Override failed", LanguageRegistry.getLanguage(DummyLanguageModule.NAME), diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java index 08c983529f..c7ffd3fe81 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/RuleSetFactoryTest.java @@ -346,7 +346,7 @@ public class RuleSetFactoryTest { "WARNING: Discontinue using Rule rulesets/dummy/basic.xml/DeprecatedRule as it is scheduled for removal from PMD.")); assertEquals(1, StringUtils.countMatches(logging.getLog(), - "WARNING: Unable to exclude rules [NonExistingRule] from ruleset reference rulesets/dummy/basic.xml; perhaps the rule name is mispelled or the rule doesn't exist anymore?")); + "WARNING: Unable to exclude rules [NonExistingRule] from ruleset reference rulesets/dummy/basic.xml; perhaps the rule name is misspelled or the rule doesn't exist anymore?")); } /** @@ -573,7 +573,7 @@ public class RuleSetFactoryTest { @Test(expected = IllegalArgumentException.class) public void testIncorrectExternalRef() throws IllegalArgumentException, RuleSetNotFoundException { - loadFirstRule(REF_MISPELLED_XREF); + loadFirstRule(REF_MISSPELLED_XREF); } @Test @@ -927,7 +927,7 @@ public class RuleSetFactoryTest { + " \n" + ""; - private static final String REF_MISPELLED_XREF = "\n" + private static final String REF_MISSPELLED_XREF = "\n" + "\n" + "\n" + " testdesc\n" diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDParametersTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDParametersTest.java index 8df2532351..22ca614a06 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDParametersTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cli/PMDParametersTest.java @@ -16,7 +16,7 @@ public class PMDParametersTest { // no language set, uses default language Assert.assertEquals("1.7", parameters.getVersion()); - // now set lanuage + // now set language FieldUtils.writeDeclaredField(parameters, "language", "dummy2", true); Assert.assertEquals("1.0", parameters.getVersion()); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java index 47a2330b7f..2c6de03c26 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/XPathRuleTest.java @@ -74,12 +74,12 @@ public class XPathRuleTest { loggingRule.clear(); eval(ctx, xpr, newNodeWithList()); // with another node assertEquals(2, ctx.getReport().size()); - assertEquals("", loggingRule.getLog()); // no addtional warnings + assertEquals("", loggingRule.getLog()); // no additional warnings // with another rule forked from the same one (in multithreaded processor) eval(ctx, xpr.deepCopy(), newNodeWithList()); assertEquals(3, ctx.getReport().size()); - assertEquals("", loggingRule.getLog()); // no addtional warnings + assertEquals("", loggingRule.getLog()); // no additional warnings // with another rule on the same node, new warnings XPathRule otherRule = makeRuleWithList("OtherTestRuleWithListAccess"); diff --git a/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 b/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 index 01bef8c093..ea7847eeb2 100644 --- a/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 +++ b/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 @@ -673,9 +673,9 @@ statements : statement* ; statement - : label* nonLabledStatment + : label* nonLabelledStatement ; -nonLabledStatment +nonLabelledStatement : block | localVariableDeclaration | forStatement @@ -683,7 +683,7 @@ nonLabledStatment | doStatement | switchStatement | ifStatement - | rethrowStatment + | rethrowStatement | tryStatement | breakStatement | continueStatement @@ -748,7 +748,7 @@ defaultCase ; // 17.10 Rethrow -rethrowStatment +rethrowStatement : 'rethrow' SEMICOLON ; diff --git a/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranLanguage.java b/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranLanguage.java index bcca891bcd..a4128493e7 100644 --- a/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranLanguage.java +++ b/pmd-fortran/src/main/java/net/sourceforge/pmd/cpd/FortranLanguage.java @@ -11,7 +11,7 @@ package net.sourceforge.pmd.cpd; */ public class FortranLanguage extends AbstractLanguage { /** - * Create a Fotran Language instance. + * Create a Fortran Language instance. */ public FortranLanguage() { super("Fortran", "fortran", new FortranTokenizer(), ".for", ".f", ".f66", ".f77", ".f90"); diff --git a/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java b/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java index f0cb3e1ef9..6e18025bda 100644 --- a/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java +++ b/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java @@ -16,7 +16,7 @@ import groovyjarjarantlr.TokenStream; import groovyjarjarantlr.TokenStreamException; /** - * The Grooovy Tokenizer + * The Groovy Tokenizer */ public class GroovyTokenizer implements Tokenizer { diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 06eb097dce..cafd023dcf 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1751,7 +1751,7 @@ void UnaryExpressionNotPlusMinus() #UnaryExpressionNotPlusMinus((jjtn000.getImag /* * This is really ugly... we are repeating the CastExpression lookahead and full expression... * If we don't the lookahead within CastExpression is ignored, and it simply looks for the expression, - * meaning we can't be explicit as to what can be casted depending on the cast type (primitive or otherwhise) + * meaning we can't be explicit as to what can be casted depending on the cast type (primitive or otherwise) */ | LOOKAHEAD("(" (Annotation())* PrimitiveType() ")") CastExpression() | LOOKAHEAD("(" (Annotation())* Type() ( "&" ReferenceType() )* ")" UnaryExpressionNotPlusMinus()) CastExpression() diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java index f98fd3295e..dce851dc8e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java @@ -64,7 +64,7 @@ public class ASTAnnotation extends AbstractJavaTypeNode { *

  • "all" (conventional value to suppress all warnings). * * - *

    Additionnally, the following values suppress a specific set of rules: + *

    Additionally, the following values suppress a specific set of rules: *

      *
    • {@code "unused"}: suppresses rules like UnusedLocalVariable or UnusedPrivateField; *
    • {@code "serial"}: suppresses BeanMembersShouldSerialize and MissingSerialVersionUID; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java index 92d7a521a5..737e735e69 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java @@ -169,7 +169,7 @@ public class ASTFieldDeclaration extends AbstractJavaAccessTypeNode implements D /** * Gets the variable name of this field. This method searches the first - * VariableDeclartorId node and returns its image or null if + * VariableDeclaratorId node and returns its image or null if * the child node is not found. * * @return a String representing the name of the variable diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java index 44ccd8dded..0af1d18eaf 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java @@ -69,7 +69,7 @@ public class ASTFormalParameter extends AbstractJavaAccessTypeNode implements Di } /** - * If true, this formal parameter represents one without explit types. + * If true, this formal parameter represents one without explicit types. * This can appear as part of a lambda expression with java11 using "var". * * @see ASTVariableDeclaratorId#isTypeInferred() diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java index ea9fd20ca7..a5e241d58c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java @@ -112,7 +112,7 @@ public class ASTLocalVariableDeclaration extends AbstractJavaAccessNode implemen /** * Gets the variable name of this declaration. This method searches the first - * VariableDeclartorId node and returns it's image or null if + * VariableDeclaratorId node and returns it's image or null if * the child node is not found. * * @return a String representing the name of the variable diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaAccessNode.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaAccessNode.java index 5ca6472b45..a9166800a1 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaAccessNode.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractJavaAccessNode.java @@ -152,8 +152,8 @@ public abstract class AbstractJavaAccessNode extends AbstractJavaAnnotatableNode @InternalApi @Deprecated @Override - public void setVolatile(boolean isVolative) { - setModifier(isVolative, VOLATILE); + public void setVolatile(boolean isVolatile) { + setModifier(isVolatile, VOLATILE); } @Override diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/Comment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/Comment.java index 44848174dd..391c30a1af 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/Comment.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/Comment.java @@ -17,7 +17,7 @@ import net.sourceforge.pmd.lang.ast.AbstractNode; public abstract class Comment extends AbstractNode { // single regex, that captures: the start of a multi-line comment (/**|/*), the start of a single line comment (//) - // or the start of line within a multine comment (*). It removes the end of the comment (*/) if existing. + // or the start of line within a multiline comment (*). It removes the end of the comment (*/) if existing. private static final Pattern COMMENT_LINE_COMBINED = Pattern.compile("^(?://|/\\*\\*?|\\*)?(.*?)(?:\\*/|/)?$"); // Same as "\\R" - but \\R is only available with java8+ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorReducedAdapter.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorReducedAdapter.java index bfdc26e4e6..97f78f34e2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorReducedAdapter.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorReducedAdapter.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.lang.java.ast; /** - * Visitor adapter with convenient visit methods to e.g. treat contructors and methods the same. + * Visitor adapter with convenient visit methods to e.g. treat constructors and methods the same. * * @author Clément Fournier * @deprecated The functionality of this adapter will be moved into the base java visitor, so this class will diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaMetricsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaMetricsRule.java index 651e8b7282..062f3dcc33 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaMetricsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaMetricsRule.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.lang.java.ast.MethodLikeNode; /** - * Java Rule with convenient visit methods to e.g. treat contructors and methods the same. + * Java Rule with convenient visit methods to e.g. treat constructors and methods the same. * * @author Clément Fournier * @deprecated Internal API diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleChainVisitor.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleChainVisitor.java index bfd1bc2ccc..6701b101f2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleChainVisitor.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleChainVisitor.java @@ -26,7 +26,7 @@ public class JavaRuleChainVisitor extends AbstractRuleChainVisitor { @Override protected void indexNodes(List nodes, RuleContext ctx) { - JavaParserVisitor javaParserVistor = new JavaParserVisitorAdapter() { + JavaParserVisitor javaParserVisitor = new JavaParserVisitorAdapter() { // Perform a visitation of the AST to index nodes which need // visiting by type @Override @@ -37,7 +37,7 @@ public class JavaRuleChainVisitor extends AbstractRuleChainVisitor { }; for (final Node node : nodes) { - javaParserVistor.visit((ASTCompilationUnit) node, ctx); + javaParserVisitor.visit((ASTCompilationUnit) node, ctx); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.java index fe5e0cf086..dee896de25 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.java @@ -84,6 +84,7 @@ public class JavaRuleViolation extends ParametricRuleViolation { * @deprecated Is internal API, not useful, there's a typo. See #1927 */ @Deprecated + // should be isSuppressed. public static boolean isSupressed(Node node, Rule rule) { boolean result = suppresses(node, rule); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java index 998651feef..d09dc1a2c5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPRule.java @@ -164,7 +164,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule { return false; } - // All the intermediate parts must be hexidecimal, or + // All the intermediate parts must be hexadecimal, or int count = 0; boolean ipv4Mapped = false; String[] parts = s.split(":"); @@ -182,7 +182,7 @@ public class AvoidUsingHardCodedIPRule extends AbstractJavaRule { } else { count++; } - // Should be a hexidecimal number in range [0, 65535] + // Should be a hexadecimal number in range [0, 65535] try { int value = Integer.parseInt(part, 16); if (value < 0 || value > 65535) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachRule.java index 2d02deff39..cd0b2142dd 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachRule.java @@ -284,7 +284,7 @@ public class ForLoopCanBeForeachRule extends AbstractJavaRule { if (occ.getLocation().getFirstParentOfType(ASTForUpdate.class) == null && occ.getLocation().getFirstParentOfType(ASTExpression.class) != stmt.getFirstChildOfType(ASTExpression.class) - && !occurenceIsArrayAccess(occ, arrayName)) { + && !occurrenceIsArrayAccess(occ, arrayName)) { return false; } } @@ -292,7 +292,7 @@ public class ForLoopCanBeForeachRule extends AbstractJavaRule { } - private boolean occurenceIsArrayAccess(NameOccurrence occ, String arrayName) { + private boolean occurrenceIsArrayAccess(NameOccurrence occ, String arrayName) { if (occ.getLocation() instanceof ASTName) { ASTPrimarySuffix suffix = occ.getLocation().getFirstParentOfType(ASTPrimarySuffix.class); @@ -320,7 +320,7 @@ public class ForLoopCanBeForeachRule extends AbstractJavaRule { if (occ.getLocation().getFirstParentOfType(ASTForUpdate.class) == null && occ.getLocation().getFirstParentOfType(ASTExpression.class) != stmt.getFirstChildOfType(ASTExpression.class) - && !occurenceIsListGet(occ, listName)) { + && !occurrenceIsListGet(occ, listName)) { return false; } } @@ -329,8 +329,8 @@ public class ForLoopCanBeForeachRule extends AbstractJavaRule { } - /** @return true if this occurence is as an argument to List.get on the correct list */ - private boolean occurenceIsListGet(NameOccurrence occ, String listName) { + /** @return true if this occurrence is as an argument to List.get on the correct list */ + private boolean occurrenceIsListGet(NameOccurrence occ, String listName) { if (occ.getLocation() instanceof ASTName) { ASTPrimarySuffix suffix = occ.getLocation().getFirstParentOfType(ASTPrimarySuffix.class); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideRule.java index 414b7ce2f2..ea081b8e67 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideRule.java @@ -172,7 +172,7 @@ public class MissingOverrideRule extends AbstractJavaRule { } if (cand.getName().equals(dm.getName()) && Arrays.equals(cand.getParameterTypes(), dm.getParameterTypes())) { - // cand is overriden + // cand is overridden result.add(cand); toRemove.add(cand); // Several methods are eligible, because of return type covariance diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorRule.java index ab4075aaa8..37e420ee19 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorRule.java @@ -87,7 +87,7 @@ public class UnnecessaryConstructorRule extends AbstractIgnoredAnnotationRule { } /** - * Returns {@code true} if access modifier of construtor is same as class's, + * Returns {@code true} if access modifier of constructor is same as class's, * otherwise {@code false}. * * @param node the class declaration node diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java index 83988c0421..179134c4ab 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java @@ -117,7 +117,7 @@ public class CouplingBetweenObjectsRule extends AbstractJavaRule { } /** - * convience method to handle hierarchy. This is probably too much work and + * Convenience method to handle hierarchy. This is probably too much work and * will go away once I figure out the framework */ private void handleASTTypeChildren(Node node) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsRule.java index 0b1baa3865..8c96c09629 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsRule.java @@ -11,7 +11,7 @@ import net.sourceforge.pmd.util.NumericConstants; /** * ExcessiveImports attempts to count all unique imports a class contains. This * rule will count a "import com.something.*;" as a single import. This is a - * unqiue situation and I'd like to create an audit type rule that captures + * unique situation and I'd like to create an audit type rule that captures * those. * * @author aglover diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/GenericClassCounterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/GenericClassCounterRule.java index 5ed182a38f..945672be8e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/GenericClassCounterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/GenericClassCounterRule.java @@ -39,8 +39,8 @@ import net.sourceforge.pmd.properties.StringProperty; * <!-- Must be a full name to ensure type control !!! --> * <property name="typeMatch" description="a regex to match on implements/extends classname" * value="javax.servlet.Filter"/> - * <!-- Define after how many occurences one should log a violation --> - * <property name="threshold" description="Defines how many occurences are legal" + * <!-- Define after how many occurrences one should log a violation --> + * <property name="threshold" description="Defines how many occurrences are legal" * value="2"/> * <!-- TODO: Add a parameter to allow "ignore" pattern based on name --> * @@ -64,7 +64,7 @@ public class GenericClassCounterRule extends AbstractJavaRule { // TODO - this should be an IntegerProperty instead? private static final StringProperty THRESHOLD_DESCRIPTOR = new StringProperty("threshold", - "Defines how many occurences are legal", new String(), 4.0f); + "Defines how many occurrences are legal", new String(), 4.0f); private List namesMatch = new ArrayList<>(0); private List typesMatch = new ArrayList<>(0); @@ -136,7 +136,7 @@ public class GenericClassCounterRule extends AbstractJavaRule { addAMatch(classType, data); } } - // TODO: implements the "operand" functionnality + // TODO: implements the "operand" functionality // Is there any names that actually match ? for (Pattern pattern : this.namesMatch) { if (RegexHelper.isMatch(pattern, classType.getImage())) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java index 3761ad29d0..574c9c7967 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterRule.java @@ -376,7 +376,7 @@ public class LawOfDemeterRule extends AbstractJavaRule { List assignmentStmts = block.findDescendantsOfType(ASTAssignmentOperator.class); for (ASTAssignmentOperator stmt : assignmentStmts) { //we only care about it if it occurs prior to (or on) the beginLine of the current expression - //and if it is a simple_assignement_operator + //and if it is a simple_assignment_operator if (stmt.getBeginLine() <= expression.getBeginLine() && stmt.hasImageEqualTo(SIMPLE_ASSIGNMENT_OPERATOR)) { //now we need to make sure it has the right image name diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodRule.java index 0d1c4765af..193a11a5db 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodRule.java @@ -83,9 +83,9 @@ public class UselessOverridingMethodRule extends AbstractJavaRule { // TODO: this method should be externalize into an utility class, shouldn't it ? private boolean isMethodThrowingType(ASTMethodDeclaration node, Class exceptionType) { - ASTNameList thrownsExceptions = node.getThrows(); - if (thrownsExceptions != null) { - List names = thrownsExceptions.findChildrenOfType(ASTName.class); + ASTNameList thrownExceptions = node.getThrows(); + if (thrownExceptions != null) { + List names = thrownExceptions.findChildrenOfType(ASTName.class); for (ASTName name : names) { if (name.getType() != null && name.getType() == exceptionType) { return true; @@ -297,6 +297,7 @@ public class UselessOverridingMethodRule extends AbstractJavaRule { * @deprecated this method will be removed. Just use {@link Node#findChildrenOfType(Class)} directly. */ @Deprecated + // should be findFirstDegreeChildrenOfType public List findFirstDegreeChaildrenOfType(Node n, Class targetType) { return n.findChildrenOfType(targetType); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java index 23006ef1d6..a4c55919e3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java @@ -143,11 +143,16 @@ public class CommentContentRule extends AbstractCommentRule { return super.visit(cUnit, data); } - public boolean hasDissallowedTerms() { + private boolean hasDisallowedTerms() { List terms = getProperty(DISSALLOWED_TERMS_DESCRIPTOR); return !terms.isEmpty(); } + @Deprecated + public boolean hasDissallowedTerms() { + return this.hasDisallowedTerms(); + } + /** * @see PropertySource#dysfunctionReason() */ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java index 4f27e3ee66..8fbd8be374 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java @@ -82,7 +82,7 @@ public class CommentSizeRule extends AbstractCommentRule { int maxLength = getProperty(MAX_LINE_LENGTH); - List indicies = new ArrayList<>(); + List indices = new ArrayList<>(); String[] lines = comment.getImage().split(CR); int offset = comment.getBeginLine(); @@ -90,11 +90,11 @@ public class CommentSizeRule extends AbstractCommentRule { for (int i = 0; i < lines.length; i++) { String cleaned = withoutCommentMarkup(lines[i]); if (cleaned.length() > maxLength) { - indicies.add(i + offset); + indices.add(i + offset); } } - return indicies; + return indices; } @Override diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultRule.java index 112abecbf4..3b5710f780 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultRule.java @@ -47,7 +47,7 @@ public class CheckSkipResultRule extends AbstractJavaRule { // if exp is neither in a bare statement // or between a pair of parentheses, // it's in some other kind of statement - // or assignement so the returned value is used + // or assignment so the returned value is used break; } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java index dc3be5d8be..0589017b57 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodRule.java @@ -1032,7 +1032,7 @@ public final class ConstructorCallsOverridableMethodRule extends AbstractJavaRul } else if (type.getChild(0) instanceof ASTReferenceType) { parameterTypes.add("ref"); } else { - parameterTypes.add(""); + parameterTypes.add(""); } } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java index 1e62eae0e0..6bc0e3a71e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonRule.java @@ -81,11 +81,11 @@ public class NonThreadSafeSingletonRule extends AbstractJavaRule { if (n == null || !fieldDecls.containsKey(n.getImage())) { continue; } - List assigmnents = ifStatement + List assignments = ifStatement .findDescendantsOfType(ASTAssignmentOperator.class); boolean violation = false; - for (int ix = 0; ix < assigmnents.size(); ix++) { - ASTAssignmentOperator oper = assigmnents.get(ix); + for (int ix = 0; ix < assignments.size(); ix++) { + ASTAssignmentOperator oper = assignments.get(ix); if (!(oper.getParent() instanceof ASTStatementExpression)) { continue; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeTestUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeTestUtil.java index a22f21c550..873697e422 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeTestUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeTestUtil.java @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.typeresolution.TypeHelper; /** * Public utilities to test the type of nodes. * - *

      This replaces {@link TypeHelper}. Note that in constrast to methods + *

      This replaces {@link TypeHelper}. Note that in contrast to methods * in {@link TypeHelper}, these methods: *

        *
      • Take the node as the second parameter @@ -196,7 +196,7 @@ public final class TypeTestUtil { /** * Returns true if the class n is a subtype of clazzName, given n - * is an annotationt type. + * is an annotation type. */ private static boolean isAnnotationSubtype(Class n, String clazzName) { assert n != null && n.isAnnotation() : "Not an annotation type"; diff --git a/pmd-java/src/main/resources/category/java/design.xml b/pmd-java/src/main/resources/category/java/design.xml index 0a5c0485d1..0af388760f 100644 --- a/pmd-java/src/main/resources/category/java/design.xml +++ b/pmd-java/src/main/resources/category/java/design.xml @@ -450,7 +450,7 @@ details on the calculation, see the documentation of the [Cyclo metric](pmd_java Generally, numbers ranging from 1-4 denote low complexity, 5-7 denote moderate complexity, 8-10 denote high complexity, and 11+ is very high complexity. By default, this rule reports methods with a complexity >= 10. -Additionnally, classes with many methods of moderate complexity get reported as well once the total of their +Additionally, classes with many methods of moderate complexity get reported as well once the total of their methods' complexities reaches 80, even if none of the methods was directly reported. Reported methods should be broken down into several smaller methods. Reported classes should probably be broken down diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/cli/CLITest.java b/pmd-java/src/test/java/net/sourceforge/pmd/cli/CLITest.java index 9c460e651b..3e82902345 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/cli/CLITest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/cli/CLITest.java @@ -106,6 +106,6 @@ public class CLITest extends BaseCLITest { runPMDWith(args); Assert.assertEquals(1, getStatusCode()); assertTrue(FileUtil.findPatternInFile(new File(filename), Pattern - .quote("No rules found. Maybe you mispelled a rule name?" + " (category/java/design.xml/ThisRuleDoesNotExist)"))); + .quote("No rules found. Maybe you misspelled a rule name?" + " (category/java/design.xml/ThisRuleDoesNotExist)"))); } } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AbstractMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AbstractMetricTestRule.java index 7c1c6aaab6..f50eeda0c5 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AbstractMetricTestRule.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AbstractMetricTestRule.java @@ -26,7 +26,7 @@ import net.sourceforge.pmd.properties.PropertyFactory; /** * Abstract test rule for a metric. Tests of metrics use the standard framework for rule testing, using one dummy rule - * per metric. Default parameters can be overriden by overriding the protected methods of this class. + * per metric. Default parameters can be overridden by overriding the protected methods of this class. * * @author Clément Fournier */ diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/missingoverride/GenericWithOverloadsImpl.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/missingoverride/GenericWithOverloadsImpl.java index 8f7a9004d9..8ee0974ad4 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/missingoverride/GenericWithOverloadsImpl.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/missingoverride/GenericWithOverloadsImpl.java @@ -33,7 +33,7 @@ public class GenericWithOverloadsImpl implements GenericInterfaceWithOverloads FieldAccessGenericParameter() { C constructorGeneric = null; - // access type dependant on constructor type arugments + // access type dependant on constructor type arguments // Primary[Prefix[Name[localGeneric]]] constructorGeneric = null; // Number } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/FieldAccessGenericSimple.java b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/FieldAccessGenericSimple.java index 198b9fdb10..67dda3771a 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/FieldAccessGenericSimple.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/FieldAccessGenericSimple.java @@ -11,7 +11,7 @@ import net.sourceforge.pmd.typeresolution.testdata.dummytypes.GenericSuperClassA /* * TODO: add anonymous class this (Allocation expression) * TODO: add primitives, parameterized arrays - * TODO: diamond, type parmeter declarations can shadow Class declarations + * TODO: diamond, type parameter declarations can shadow Class declarations */ public class FieldAccessGenericSimple extends GenericSuperClassA { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/MethodMostSpecific.java b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/MethodMostSpecific.java index 1c755ef7f0..645f56f605 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/MethodMostSpecific.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/MethodMostSpecific.java @@ -12,7 +12,7 @@ import javax.management.relation.RoleList; public abstract class MethodMostSpecific { void test() { - // Hiararchy: Object, AbstractCollection, AbstractList, ArrayList, RoleList + // Hierarchy: Object, AbstractCollection, AbstractList, ArrayList, RoleList String a = moreSpecific((Number) null, (AbstractCollection) null); Exception b = moreSpecific((Integer) null, (AbstractList) null); diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/PmdStackOverflow.java b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/PmdStackOverflow.java index 328032912b..b2fc5e4899 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/PmdStackOverflow.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/typeresolution/testdata/PmdStackOverflow.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd.typeresolution.testdata; public class PmdStackOverflow { - public void shouldThrowStackOverfloError() { + public void shouldThrowStackOverflowError() { MessageBuilder messageBuilder = new MessageBuilderA(); // Works diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AccessorMethodGeneration.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AccessorMethodGeneration.xml index fef72dfdaf..c6ffc8a927 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AccessorMethodGeneration.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/AccessorMethodGeneration.xml @@ -16,7 +16,7 @@ public class Foo { private long innerField; InnerClass() { - innerField = Foo.this.field; // violation, accesing a private field + innerField = Foo.this.field; // violation, accessing a private field } } } @@ -36,7 +36,7 @@ public class Foo { private long innerField; InnerClass() { - innerField = field; // violation, accesing a private field + innerField = field; // violation, accessing a private field } } } @@ -57,7 +57,7 @@ public class Foo { } long method() { - return new InnerClass().innerField; // violation, accesing a private field + return new InnerClass().innerField; // violation, accessing a private field } } ]]> @@ -95,7 +95,7 @@ public class Foo { public class Foo { public class InnerClass { private void secret() { - outerSecret(); // violation, accesing a private method + outerSecret(); // violation, accessing a private method } } @@ -114,7 +114,7 @@ public class Foo { public class Foo { public class InnerClass { private void secret() { - Foo.this.outerSecret(); // violation, accesing a private method + Foo.this.outerSecret(); // violation, accessing a private method } } @@ -137,7 +137,7 @@ public class Foo { } private void outerSecret() { - new InnerClass().secret(); // violation, accesing a private method + new InnerClass().secret(); // violation, accessing a private method } } ]]> diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/CheckResultSet.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/CheckResultSet.xml index 9bce7fa455..6b259ce064 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/CheckResultSet.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/CheckResultSet.xml @@ -187,7 +187,7 @@ public class Foo { } catch (SQLException se) { throw new DataAccessException(se); } finally { - //call method to close the ResultSet and PreparedStatment + //call method to close the ResultSet and PreparedStatement } return result; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LinguisticNaming.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LinguisticNaming.xml index 69d63634e8..e04efa2d28 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LinguisticNaming.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LinguisticNaming.xml @@ -553,7 +553,7 @@ public class AtomicBooleanFN { - #1543 [java] LinguisticNaming should ignore overriden methods + #1543 [java] LinguisticNaming should ignore overridden methods 1 4 - [1964798] 3 bugs in CloseResourceRule : null object is passed to close conection method (1) + [1964798] 3 bugs in CloseResourceRule : null object is passed to close connection method (1) this.closeConnection java.sql.Connection,java.sql.Statement,java.sql.ResultSet 1 @@ -216,7 +216,7 @@ public class Foo { - [1964798] 3 bugs in CloseResourceRule : null object is passed to close conection method (2) + [1964798] 3 bugs in CloseResourceRule : null object is passed to close connection method (2) this.closeConnection java.sql.Connection,java.sql.Statement,java.sql.ResultSet 1 diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingleMethodSingleton.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingleMethodSingleton.xml index 443680adea..fb15c05ea0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingleMethodSingleton.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/SingleMethodSingleton.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd"> - Not OK! Has overriden getInstance() methods + Not OK! Has overridden getInstance() methods 1 processedElmnts = new ArrayList<>(); + List processedElements = new ArrayList<>(); for (int i = lastRegisteredTagIdx; i >= 0; i--) { ASTElement parent = tagList.get(i); String parentName = parent.getName(); - processedElmnts.add(parent); + processedElements.add(parent); if (parentName.equals(closingTagName)) { // mark this tag as being closed parent.setUnclosed(false); @@ -85,7 +85,7 @@ public class OpenTagRegister { * potentially open parent tag ( but not the one after the ) */ if (matchingTagFound) { - tagList.removeAll(processedElmnts); + tagList.removeAll(processedElements); } return matchingTagFound; diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspDocStyleTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspDocStyleTest.java index 52023dfe40..bc782ead69 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspDocStyleTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspDocStyleTest.java @@ -911,12 +911,12 @@ public class JspDocStyleTest extends AbstractJspNodesTst { private static final String TEST_NO_QUOTE_ATTR_WITH_HASH = " foo "; - private static final String TEST_UNCLOSED_SIMPLE = " "; + private static final String TEST_UNCLOSED_SIMPLE = " "; /** * someTag is closed just once */ - private static final String TEST_UNCLOSED_MULTIPLE_LEVELS = " "; + private static final String TEST_UNCLOSED_MULTIPLE_LEVELS = " "; /** * nested empty tags @@ -947,5 +947,5 @@ public class JspDocStyleTest extends AbstractJspNodesTst { private static final String TEST_UNCLOSED_END_OF_DOC = " "; - private static final String TEST_UNCLOSED_NO_QUOTE_ATTR = " "; + private static final String TEST_UNCLOSED_NO_QUOTE_ATTR = " "; } diff --git a/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.m b/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.m index 915d135159..8d56a318c8 100644 --- a/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.m +++ b/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.m @@ -624,7 +624,7 @@ function [op, dom, data, pref] = parseInputs(op, varargin) fclose(fid); else error('CHEBFUN:parseInputs:unknown', ... - 'Unknow command %s.', op); + 'Unknown command %s.', op); end op = 'done'; dom = []; diff --git a/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.txt b/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.txt index 889d8543ab..b6ee0b51be 100644 --- a/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.txt +++ b/pmd-matlab/src/test/resources/net/sourceforge/pmd/lang/matlab/cpd/testdata/sample-matlab.txt @@ -1759,11 +1759,11 @@ L626 [.] 51 51 [.] 52 52 L627 - ['Unknow command %s.'] 17 36 - [,] 37 37 - [op] 39 40 - [)] 41 41 - [;] 42 42 + ['Unknown command %s.'] 17 37 + [,] 38 38 + [op] 40 41 + [)] 42 42 + [;] 43 43 L628 [end] 9 11 L629 diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/CompositeName.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/CompositeName.java index 06c80a3868..e37b053ca6 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/CompositeName.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/CompositeName.java @@ -36,8 +36,8 @@ public final class CompositeName { return create(components, 0, components.length, isAbsolute); } - public static CompositeName create(boolean isAbsolute, String[] componenets, int prefixLength) { - return create(componenets, 0, prefixLength, isAbsolute); + public static CompositeName create(boolean isAbsolute, String[] components, int prefixLength) { + return create(components, 0, prefixLength, isAbsolute); } public static CompositeName create(String simpleName) { diff --git a/pmd-plsql/etc/grammar/PldocAST.jjt b/pmd-plsql/etc/grammar/PldocAST.jjt index d16efa29df..08594717da 100644 --- a/pmd-plsql/etc/grammar/PldocAST.jjt +++ b/pmd-plsql/etc/grammar/PldocAST.jjt @@ -355,7 +355,7 @@ void attachLibrary() : /** * All global definitions of triggers, functions and procedures are evaluated here. - * Every occurence goes under a new PACKAGE-Node in the XML document. + * Every occurrence goes under a new PACKAGE-Node in the XML document. * This happens, cause a global "block" does not have a definied start and end token * like a package specification or a package body. * Thats why every construct is handled like a new part of the global package. @@ -4393,7 +4393,7 @@ ASTTriggerUnit TriggerUnit() : [ [|] ] // 11G Syntax to specify Cross Edition Trigger [ (|) ( [LOOKAHEAD(2) ID() "."] ID() ) ( "," ( [ LOOKAHEAD(2) ID() "."] ID() ) )* ] // 11G Syntax to specify trigger firing order - [ | ] // 11G Syntax can create the trigger enabled or disabled explcitly + [ | ] // 11G Syntax can create the trigger enabled or disabled explicitly [ "(" ConditionalOrExpression() ")" ] //Trigger Body follows : diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/dfa/StatementAndBraceFinder.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/dfa/StatementAndBraceFinder.java index 1a7daaffce..13691ed12d 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/dfa/StatementAndBraceFinder.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/dfa/StatementAndBraceFinder.java @@ -438,7 +438,7 @@ public class StatementAndBraceFinder extends PLSQLParserVisitorAdapter { ASTStatement lastChild = children.get(children.size() - 1); // Push on stack if this Node is the LAST Statement associated with - // the FOR Statment + // the FOR Statement if (node.equals(lastChild)) { dataFlow.pushOnStack(NodeType.WHILE_LAST_STATEMENT, dataFlow.getLast()); if (LOGGER.isLoggable(Level.FINEST)) { @@ -455,7 +455,7 @@ public class StatementAndBraceFinder extends PLSQLParserVisitorAdapter { ASTStatement lastChild = children.get(children.size() - 1); // Push on stack if this Node is the LAST Statement associated with - // the FOR Statment + // the FOR Statement if (node.equals(lastChild)) { dataFlow.pushOnStack(NodeType.FOR_END, dataFlow.getLast()); if (LOGGER.isLoggable(Level.FINEST)) { diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/PLSQLRuleChainVisitor.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/PLSQLRuleChainVisitor.java index 24b58121b2..b8ed2fb185 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/PLSQLRuleChainVisitor.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/PLSQLRuleChainVisitor.java @@ -31,7 +31,7 @@ public class PLSQLRuleChainVisitor extends AbstractRuleChainVisitor { @Override protected void indexNodes(List nodes, RuleContext ctx) { LOGGER.entering(CLASS_NAME, "indexNodes"); - PLSQLParserVisitor plsqlParserVistor = new PLSQLParserVisitorAdapter() { + PLSQLParserVisitor plsqlParserVisitor = new PLSQLParserVisitorAdapter() { // Perform a visitation of the AST to index nodes which need // visiting by type @Override @@ -42,7 +42,7 @@ public class PLSQLRuleChainVisitor extends AbstractRuleChainVisitor { }; for (int i = 0; i < nodes.size(); i++) { - plsqlParserVistor.visit((ASTInput) nodes.get(i), ctx); + plsqlParserVisitor.visit((ASTInput) nodes.get(i), ctx); } LOGGER.exiting(CLASS_NAME, "indexNodes"); } diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ClassScope.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ClassScope.java index c93c0d0386..605f2456ab 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ClassScope.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ClassScope.java @@ -170,7 +170,7 @@ public class ClassScope extends AbstractScope { if (null == occurrence.getImage()) { if (LOGGER.isLoggable(Level.FINEST)) { - LOGGER.finest("occurrence==" + occurrence.toString() + "with Argumanet Count == " + LOGGER.finest("occurrence==" + occurrence.toString() + "with Argument Count == " + occurrence.getArgumentCount() + " for className=" + className); } } diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ScopeAndDeclarationFinder.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ScopeAndDeclarationFinder.java index c209bb5c0a..0fa1222f07 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ScopeAndDeclarationFinder.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/symboltable/ScopeAndDeclarationFinder.java @@ -123,7 +123,7 @@ public class ScopeAndDeclarationFinder extends PLSQLParserVisitorAdapter { // When we do full symbol resolution, we'll need to add a truly // top-level GlobalScope. Scope scope; - // %TODO generate a SchemaScope, based on inferred or explcitly + // %TODO generate a SchemaScope, based on inferred or explicitly // specified SchemaName ASTObjectDeclaration n = null; // node.getPackageDeclaration(); if (n != null) { diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.sql b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.sql index 8e0171f1c5..e6c44f2f28 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.sql +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/cpd/testdata/sample-plsql.sql @@ -208,7 +208,7 @@ PROCEDURE Upd ( /** Update a table * @param p_data new data * @throws ORA-20001 if some error was recognized -* @throws ORA-xxxxx if some unexpected error occured +* @throws ORA-xxxxx if some unexpected error occurred */ PROCEDURE Upd_Table ( p_data IN bank_table); diff --git a/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyLanguage.java b/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyLanguage.java index e58f6f2880..4ed5440e2b 100644 --- a/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyLanguage.java +++ b/pmd-ruby/src/main/java/net/sourceforge/pmd/cpd/RubyLanguage.java @@ -5,7 +5,7 @@ package net.sourceforge.pmd.cpd; /** - * Language implemention for Ruby. + * Language implementation for Ruby. * * @author Zev Blut zb@ubit.com */ diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java index c235d70ac2..a4c69f8833 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/ast/OpenTagRegister.java @@ -51,12 +51,12 @@ public class OpenTagRegister { * name as element */ boolean matchingTagFound = false; - List processedElmnts = new ArrayList<>(); + List processedElements = new ArrayList<>(); for (int i = lastRegisteredTagIdx; i >= 0; i--) { ASTElement parent = tagList.get(i); String parentName = parent.getName(); - processedElmnts.add(parent); + processedElements.add(parent); if (parentName.equals(closingTagName)) { // mark this tag as being closed parent.setUnclosed(false); @@ -85,7 +85,7 @@ public class OpenTagRegister { * potentially open parent tag ( but not the one after the ) */ if (matchingTagFound) { - tagList.removeAll(processedElmnts); + tagList.removeAll(processedElements); } return matchingTagFound; diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java index 749d61793e..4fe6959f8f 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfDocStyleTest.java @@ -139,9 +139,9 @@ public class VfDocStyleTest extends AbstractVfNodesTest { */ @Test public void testELInTagValue() { - List elememts = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE); - assertEquals("One element expected!", 1, elememts.size()); - ASTElement element = elememts.iterator().next(); + List elements = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE); + assertEquals("One element expected!", 1, elements.size()); + ASTElement element = elements.iterator().next(); ASTAttributeValue attribute = element.getFirstDescendantOfType(ASTAttributeValue.class); ASTIdentifier id = attribute.getFirstDescendantOfType(ASTIdentifier.class); assertEquals("Correct identifier expected", "foo", id.getImage()); @@ -153,9 +153,9 @@ public class VfDocStyleTest extends AbstractVfNodesTest { */ @Test public void testELInTagValueWithCommentDQ() { - List elememts = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE_WITH_COMMENT); - assertEquals("One element expected!", 1, elememts.size()); - ASTElement element = elememts.iterator().next(); + List elements = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE_WITH_COMMENT); + assertEquals("One element expected!", 1, elements.size()); + ASTElement element = elements.iterator().next(); ASTElExpression elExpr = element.getFirstDescendantOfType(ASTElExpression.class); ASTIdentifier id = elExpr.getFirstDescendantOfType(ASTIdentifier.class); assertEquals("Correct identifier expected", "init", id.getImage()); @@ -166,9 +166,9 @@ public class VfDocStyleTest extends AbstractVfNodesTest { */ @Test public void testELInTagValueWithCommentSQ() { - List elememts = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE_WITH_COMMENT_SQ); - assertEquals("One element expected!", 1, elememts.size()); - ASTElement element = elememts.iterator().next(); + List elements = vf.getNodes(ASTElement.class, TEST_EL_IN_TAG_ATTRIBUTE_WITH_COMMENT_SQ); + assertEquals("One element expected!", 1, elements.size()); + ASTElement element = elements.iterator().next(); ASTElExpression elExpr = element.getFirstDescendantOfType(ASTElExpression.class); ASTIdentifier id = elExpr.getFirstDescendantOfType(ASTIdentifier.class); assertEquals("Correct identifier expected", "init", id.getImage()); @@ -723,12 +723,12 @@ public class VfDocStyleTest extends AbstractVfNodesTest { private static final String TEST_TAB_ATTR = " "; - private static final String TEST_UNCLOSED_SIMPLE = " "; + private static final String TEST_UNCLOSED_SIMPLE = " "; /** * someTag is closed just once */ - private static final String TEST_UNCLOSED_MULTIPLE_LEVELS = " "; + private static final String TEST_UNCLOSED_MULTIPLE_LEVELS = " "; /** * nested empty tags @@ -757,7 +757,7 @@ public class VfDocStyleTest extends AbstractVfNodesTest { */ private static final String TEST_UNCLOSED_START_TAG_WITH_UNMATCHED_CLOSE = " "; - private static final String TEST_UNCLOSED_ATTR = " "; + private static final String TEST_UNCLOSED_ATTR = " "; private static final String TEST_NO_QUOTE_ATTR_WITH_EL = " foo "; } diff --git a/pmd-vm/etc/grammar/VmParser.jjt b/pmd-vm/etc/grammar/VmParser.jjt index 3873806180..ecbfe34134 100644 --- a/pmd-vm/etc/grammar/VmParser.jjt +++ b/pmd-vm/etc/grammar/VmParser.jjt @@ -592,7 +592,7 @@ TOKEN: /* * needed because #set is so wacky in it's desired behavior. We want set - * to eat any preceeding whitespace so it is invisible in formatting. + * to eat any preceding whitespace so it is invisible in formatting. * (As it should be.) If this works well, I am going to chuck the whole MORE: * token abomination. * @@ -1955,8 +1955,8 @@ void PrimaryExpression() #void : {} The recent versions of the parser are trying to support precise output to support general template use. The directives do not render trailing whitespace and newlines if followed by a newline. They will render - preceeding whitespace. The only exception is #set, which also eats - preceeding whitespace. + preceding whitespace. The only exception is #set, which also eats + preceding whitespace. So, with a template : diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java index a4dd514966..bdba12b325 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTReference.java @@ -51,7 +51,7 @@ public class ASTReference extends AbstractVmNode { * Indicates if toString() should be called during condition evaluation just * to ensure it does not return null. Check is unnecessary if all toString() * implementations are known to have non-null return values. Disabling the - * check will give a performance improval since toString() may be a complex + * check will give a performance improvement since toString() may be a complex * operation on large objects. * * @deprecated for removal with PMD 7.0.0 @@ -89,7 +89,7 @@ public class ASTReference extends AbstractVmNode { * Routine to allow the literal representation to be externally overridden. * Used now in the VM system to override a reference in a VM tree with the * literal of the calling arg to make it work nicely when calling arg is - * null. It seems a bit much, but does keep things consistant. + * null. It seems a bit much, but does keep things consistent. * * Note, you can only set the literal once... * diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java index 57b527fff2..ea05ccfbdb 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/ASTStringLiteral.java @@ -45,7 +45,7 @@ public class ASTStringLiteral extends AbstractVmNode { /** * Adjust all the line and column numbers that comprise a node so that they * are corrected for the string literals position within the template file. - * This is neccessary if an exception is thrown while processing the node so + * This is necessary if an exception is thrown while processing the node so * that the line and column position reported reflects the error position * within the template and not just relative to the error position within * the string literal. @@ -55,7 +55,7 @@ public class ASTStringLiteral extends AbstractVmNode { @Deprecated public void adjTokenLineNums(final AbstractVmNode node) { Token tok = node.getFirstToken(); - // Test against null is probably not neccessary, but just being safe + // Test against null is probably not necessary, but just being safe while (tok != null && tok != node.getLastToken()) { // If tok is on the first line, then the actual column is // offset by the template column. diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/MacroParseException.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/MacroParseException.java index e6b19accfa..6d7618d3a2 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/MacroParseException.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/MacroParseException.java @@ -53,9 +53,9 @@ public class MacroParseException extends ParseException { } /** - * returns the Template name where this exception occured. + * returns the Template name where this exception occurred. * - * @return The Template name where this exception occured. + * @return The Template name where this exception occurred. * @since 1.5 */ public String getTemplateName() { @@ -63,9 +63,9 @@ public class MacroParseException extends ParseException { } /** - * returns the line number where this exception occured. + * returns the line number where this exception occurred. * - * @return The line number where this exception occured. + * @return The line number where this exception occurred. * @since 1.5 */ public int getLineNumber() { @@ -79,9 +79,9 @@ public class MacroParseException extends ParseException { } /** - * returns the column number where this exception occured. + * returns the column number where this exception occurred. * - * @return The column number where this exception occured. + * @return The column number where this exception occurred. * @since 1.5 */ public int getColumnNumber() { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TemplateParseException.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TemplateParseException.java index d549c50cde..d1d5312b66 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TemplateParseException.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TemplateParseException.java @@ -107,18 +107,18 @@ public class TemplateParseException extends ParseException { } /** - * returns the Template name where this exception occured. + * returns the Template name where this exception occurred. * - * @return The Template name where this exception occured. + * @return The Template name where this exception occurred. */ public String getTemplateName() { return templateName; } /** - * returns the line number where this exception occured. + * returns the line number where this exception occurred. * - * @return The line number where this exception occured. + * @return The line number where this exception occurred. */ public int getLineNumber() { if (currentToken != null && currentToken.next != null) { @@ -129,9 +129,9 @@ public class TemplateParseException extends ParseException { } /** - * returns the column number where this exception occured. + * returns the column number where this exception occurred. * - * @return The column number where this exception occured. + * @return The column number where this exception occurred. */ public int getColumnNumber() { if (currentToken != null && currentToken.next != null) { diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TokenMgrError.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TokenMgrError.java index c4a7ca67d0..7678d4d4ae 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TokenMgrError.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/ast/TokenMgrError.java @@ -18,7 +18,7 @@ public class TokenMgrError extends RuntimeException { private static final long serialVersionUID = 1L; /** - * Lexical error occured. + * Lexical error occurred. */ static final int LEXICAL_ERROR = 0; @@ -63,7 +63,7 @@ public class TokenMgrError extends RuntimeException { } /** - * Replaces unprintable characters by their espaced (or unicode escaped) + * Replaces unprintable characters by their escaped (or unicode escaped) * equivalents in the given string */ protected static final String addEscapes(final String str) { @@ -115,9 +115,9 @@ public class TokenMgrError extends RuntimeException { * Returns a detailed message for the Error when it is thrown by the token * manager to indicate a lexical error. Parameters : EOFSeen : indicates if * EOF caused the lexicl error curLexState : lexical state in which this - * error occured errorLine : line number when the error occured errorColumn - * : column number when the error occured errorAfter : prefix that was seen - * before this error occured curchar : the offending character Note: You can + * error occurred errorLine : line number when the error occurred errorColumn + * : column number when the error occurred errorAfter : prefix that was seen + * before this error occurred curchar : the offending character Note: You can * customize the lexical error message by modifying this method. */ protected static String lexicalError(final boolean eofSeen, final int lexState, final int errorLine, diff --git a/pmd-xml/src/main/resources/category/xsl/performance.xml b/pmd-xml/src/main/resources/category/xsl/performance.xml index bd6218db61..9407f28b5b 100644 --- a/pmd-xml/src/main/resources/category/xsl/performance.xml +++ b/pmd-xml/src/main/resources/category/xsl/performance.xml @@ -16,9 +16,9 @@ Rules that flag suboptimal code. class="net.sourceforge.pmd.lang.rule.XPathRule" externalInfoUrl="${pmd.website.baseurl}/pmd_rules_xsl_performance.html#avoidaxisnavigation"> -Avoid using the 'following' or 'preceeding' axes whenever possible, as these can cut +Avoid using the 'following' or 'preceding' axes whenever possible, as these can cut through 100% of the document in the worst case. Also, try to avoid using 'descendant' -or 'descendant-self' axes, as if you're at the top of the Document, it necessarily means +or 'descendant-or-self' axes, as if you're at the top of the Document, it necessarily means cutting through 100% of the document. 3 @@ -31,7 +31,7 @@ cutting through 100% of the document. - + ]]>