From 9b04ceedf15951a2867ab609dbb75172008f5a00 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 12 Jan 2014 07:35:03 -0500 Subject: [PATCH] fixed typos Former-commit-id: 490de2990dab978493b27a8faf8ec6c40b97c6dc --- .../analyzer/AbstractSuppressionAnalyzer.java | 2 +- .../dependencycheck/analyzer/CPEAnalyzer.java | 10 ++++--- .../analyzer/DependencyBundlingAnalyzer.java | 4 +-- .../concurrency/DirectorySpinLock.java | 2 +- .../data/nvdcve/ConnectionFactory.java | 2 +- .../suppression/PropertyType.java | 2 +- .../suppression/SuppressionHandler.java | 18 ++++++------ .../suppression/SuppressionParser.java | 15 ++++------ .../dependencycheck/utils/FileUtils.java | 2 +- .../dependencycheck/utils/UrlStringUtils.java | 2 +- .../main/resources/dependencycheck.properties | 2 +- .../templates/VulnerabilityReport.vsl | 29 +++++++++---------- .../suppression/SuppressionHandlerTest.java | 6 ++-- 13 files changed, 46 insertions(+), 50 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java index 86a539682..5785bec8d 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java @@ -36,7 +36,7 @@ import org.owasp.dependencycheck.utils.Settings; */ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer { - // + // /** * Returns a list of file EXTENSIONS supported by this analyzer. * diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java index 83efcaeab..d2d2e0d5e 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java @@ -434,8 +434,10 @@ public class CPEAnalyzer implements Analyzer { final List list = new ArrayList(); String tempWord = null; for (String word : words) { - //single letter words should be concatonated with the next word. - // so { "m", "core", "sample" } -> { "mcore", "sample" } + /* + single letter words should be concatenated with the next word. + so { "m", "core", "sample" } -> { "mcore", "sample" } + */ if (tempWord != null) { list.add(tempWord + word); tempWord = null; @@ -560,7 +562,7 @@ public class CPEAnalyzer implements Analyzer { dbVer = DependencyVersionUtil.parseVersion(vs.getVersion()); } if (dbVer == null //special case, no version specified - everything is vulnerable - || evVer.equals(dbVer)) { //woot exect match + || evVer.equals(dbVer)) { //yeah! exact match final String url = String.format("http://web.nvd.nist.gov/view/vuln/search?cpe=%s", URLEncoder.encode(vs.getName(), "UTF-8")); final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf); collected.add(match); @@ -626,7 +628,7 @@ public class CPEAnalyzer implements Analyzer { private static class IdentifierMatch implements Comparable { /** - * Constructs an IdentiferMatch. + * Constructs an IdentifierMatch. * * @param type the type of identifier (such as CPE) * @param value the value of the identifier diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java index 83635f8ff..f35384e2d 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java @@ -56,7 +56,7 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal */ private boolean analyzed = false; // - // + // /** * The set of file extensions supported by this analyzer. */ @@ -196,7 +196,7 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal /** * Returns true if the file names (and version if it exists) of the two - * dependencies are sufficiently similiar. + * dependencies are sufficiently similar. * * @param dependency1 a dependency2 to compare * @param dependency2 a dependency2 to compare diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/concurrency/DirectorySpinLock.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/concurrency/DirectorySpinLock.java index 2261846ed..7cf0f7401 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/concurrency/DirectorySpinLock.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/concurrency/DirectorySpinLock.java @@ -258,7 +258,7 @@ public class DirectorySpinLock implements Closeable /*, AutoCloseable*/ { try { lock.release(); } catch (ClosedChannelException ex) { - Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Uable to release file lock", ex); + Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to release file lock", ex); } catch (IOException ex) { Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to release file lock due to IO Exception", ex); } diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java index 71037145a..1ec7afa75 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java @@ -220,7 +220,7 @@ public final class ConnectionFactory { * the database. * * @param conn the database connection object - * @throws DatabaseException thrown if the schema version is not compatable + * @throws DatabaseException thrown if the schema version is not compatible * with this version of dependency-check */ private static void ensureSchemaVersion(Connection conn) throws DatabaseException { diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/PropertyType.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/PropertyType.java index 23046ef78..5f5409a7b 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/PropertyType.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/PropertyType.java @@ -131,7 +131,7 @@ public class PropertyType { } } - // + // /** * Default implementation of hashCode. * diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionHandler.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionHandler.java index 27551f83d..3ff0b6f3d 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionHandler.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionHandler.java @@ -62,15 +62,15 @@ public class SuppressionHandler extends DefaultHandler { /** * A list of suppression rules. */ - private List supressionRules = new ArrayList(); + private List suppressionRules = new ArrayList(); /** - * Get the value of supressionRules. + * Get the value of suppressionRules. * - * @return the value of supressionRules + * @return the value of suppressionRules */ - public List getSupressionRules() { - return supressionRules; + public List getSuppressionRules() { + return suppressionRules; } /** * The current rule being read. @@ -109,7 +109,7 @@ public class SuppressionHandler extends DefaultHandler { /** * Handles the end element event. * - * @param uri the uri of the element + * @param uri the URI of the element * @param localName the local name of the element * @param qName the qName of the element * @throws SAXException thrown if there is an exception processing @@ -117,7 +117,7 @@ public class SuppressionHandler extends DefaultHandler { @Override public void endElement(String uri, String localName, String qName) throws SAXException { if (SUPPRESS.equals(qName)) { - supressionRules.add(rule); + suppressionRules.add(rule); rule = null; } else if (FILE_PATH.equals(qName)) { final PropertyType pt = processPropertyType(); @@ -151,8 +151,8 @@ public class SuppressionHandler extends DefaultHandler { } /** - * Processes field members that have been collected during the characters - * and startElement method to construct a PropertyType object. + * Processes field members that have been collected during the characters and startElement method to construct a + * PropertyType object. * * @return a PropertyType object */ diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionParser.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionParser.java index 171d8d49e..5e6c52039 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionParser.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/suppression/SuppressionParser.java @@ -43,24 +43,20 @@ import org.xml.sax.XMLReader; public class SuppressionParser { /** - * JAXP Schema Language. Source: - * http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html + * JAXP Schema Language. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html */ public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; /** - * W3C XML Schema. Source: - * http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html + * W3C XML Schema. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html */ public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; /** - * JAXP Schema Source. Source: - * http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html + * JAXP Schema Source. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html */ public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; /** - * Parses the given xml file and returns a list of the suppression rules - * contained. + * Parses the given xml file and returns a list of the suppression rules contained. * * @param file an xml file containing suppression rules * @return a list of suppression rules @@ -88,8 +84,7 @@ public class SuppressionParser { xmlReader.parse(in); - - return handler.getSupressionRules(); + return handler.getSuppressionRules(); } catch (ParserConfigurationException ex) { Logger.getLogger(SuppressionParser.class.getName()).log(Level.FINE, null, ex); throw new SuppressionParseException(ex); diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java index 41566f772..d30309dee 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java @@ -98,7 +98,7 @@ public final class FileUtils { * location of the JAR containing the specified class. * * @param configuredFilePath the configured relative or absolute path - * @param clazz the class whos path will be resolved + * @param clazz the class to resolve the path * @return a File object * @throws IOException is thrown if the path could not be decoded * @deprecated This method should no longer be used. See the implementation diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/UrlStringUtils.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/UrlStringUtils.java index 6348eacf2..0aaa88a45 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/UrlStringUtils.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/UrlStringUtils.java @@ -79,7 +79,7 @@ public final class UrlStringUtils { *

Example, given the following input:

* "https://www.somedomain.com/path1/path2/file.php?id=439" *

The function would return:

- * {"somedomain", "path1", "path2", "file"} + * {"some.domain", "path1", "path2", "file"} * * @param text a URL * @return importantParts a list of the important parts of the URL diff --git a/dependency-check-core/src/main/resources/dependencycheck.properties b/dependency-check-core/src/main/resources/dependencycheck.properties index 5606f8d2b..73629aa2b 100644 --- a/dependency-check-core/src/main/resources/dependencycheck.properties +++ b/dependency-check-core/src/main/resources/dependencycheck.properties @@ -23,7 +23,7 @@ data.password=DC-Pass1337! # is not in the current classpath. Setting these properties will add the give path(s) to # the class loader and then register the driver with the DriverManager. If the class is # not in the path you must specify both the driver name (aka the fully qualified driver name) -# and the driver path. The driver path can be a semi-colon seperated list of files/directories +# and the driver path. The driver path can be a semi-colon separated list of files/directories # to ensure any and all needed files can be added to the classpath to load the driver. # For non-JDBC4 drivers in the classpath only the driver_name needs to be set. # For MOST situations these properties likely do not need to be set. diff --git a/dependency-check-core/src/main/resources/templates/VulnerabilityReport.vsl b/dependency-check-core/src/main/resources/templates/VulnerabilityReport.vsl index 34b908079..c65805eb8 100644 --- a/dependency-check-core/src/main/resources/templates/VulnerabilityReport.vsl +++ b/dependency-check-core/src/main/resources/templates/VulnerabilityReport.vsl @@ -39,8 +39,8 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved. diff --git a/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java b/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java index 93165264a..304053a32 100644 --- a/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java +++ b/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java @@ -28,10 +28,10 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.junit.After; import org.junit.AfterClass; +import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import static org.junit.Assert.*; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; @@ -61,7 +61,7 @@ public class SuppressionHandlerTest { } /** - * Test of getSupressionRules method, of class SuppressionHandler. + * Test of getSuppressionRules method, of class SuppressionHandler. * * @throws Exception thrown if there is an exception.... */ @@ -89,7 +89,7 @@ public class SuppressionHandlerTest { xmlReader.parse(in); - List result = handler.getSupressionRules(); + List result = handler.getSuppressionRules(); assertTrue(result.size() > 3); } }