fixed typos

Former-commit-id: 490de2990dab978493b27a8faf8ec6c40b97c6dc
This commit is contained in:
Jeremy Long
2014-01-12 07:35:03 -05:00
parent 41a31cdf4c
commit 9b04ceedf1
13 changed files with 46 additions and 50 deletions

View File

@@ -36,7 +36,7 @@ import org.owasp.dependencycheck.utils.Settings;
*/ */
public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer { public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer"> //<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
/** /**
* Returns a list of file EXTENSIONS supported by this analyzer. * Returns a list of file EXTENSIONS supported by this analyzer.
* *

View File

@@ -434,8 +434,10 @@ public class CPEAnalyzer implements Analyzer {
final List<String> list = new ArrayList<String>(); final List<String> list = new ArrayList<String>();
String tempWord = null; String tempWord = null;
for (String word : words) { 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) { if (tempWord != null) {
list.add(tempWord + word); list.add(tempWord + word);
tempWord = null; tempWord = null;
@@ -560,7 +562,7 @@ public class CPEAnalyzer implements Analyzer {
dbVer = DependencyVersionUtil.parseVersion(vs.getVersion()); dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
} }
if (dbVer == null //special case, no version specified - everything is vulnerable 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 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); final IdentifierMatch match = new IdentifierMatch("cpe", vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
collected.add(match); collected.add(match);
@@ -626,7 +628,7 @@ public class CPEAnalyzer implements Analyzer {
private static class IdentifierMatch implements Comparable<IdentifierMatch> { private static class IdentifierMatch implements Comparable<IdentifierMatch> {
/** /**
* Constructs an IdentiferMatch. * Constructs an IdentifierMatch.
* *
* @param type the type of identifier (such as CPE) * @param type the type of identifier (such as CPE)
* @param value the value of the identifier * @param value the value of the identifier

View File

@@ -56,7 +56,7 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal
*/ */
private boolean analyzed = false; private boolean analyzed = false;
//</editor-fold> //</editor-fold>
//<editor-fold defaultstate="collapsed" desc="All standard implmentation details of Analyzer"> //<editor-fold defaultstate="collapsed" desc="All standard implementation details of Analyzer">
/** /**
* The set of file extensions supported by this analyzer. * 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 * 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 dependency1 a dependency2 to compare
* @param dependency2 a dependency2 to compare * @param dependency2 a dependency2 to compare

View File

@@ -258,7 +258,7 @@ public class DirectorySpinLock implements Closeable /*, AutoCloseable*/ {
try { try {
lock.release(); lock.release();
} catch (ClosedChannelException ex) { } 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) { } catch (IOException ex) {
Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to release file lock due to IO Exception", ex); Logger.getLogger(DirectorySpinLock.class.getName()).log(Level.FINEST, "Unable to release file lock due to IO Exception", ex);
} }

View File

@@ -220,7 +220,7 @@ public final class ConnectionFactory {
* the database. * the database.
* *
* @param conn the database connection object * @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 * with this version of dependency-check
*/ */
private static void ensureSchemaVersion(Connection conn) throws DatabaseException { private static void ensureSchemaVersion(Connection conn) throws DatabaseException {

View File

@@ -131,7 +131,7 @@ public class PropertyType {
} }
} }
//<editor-fold defaultstate="collapsed" desc="standard implmentations of hashCode, equals, and toString"> //<editor-fold defaultstate="collapsed" desc="standard implementations of hashCode, equals, and toString">
/** /**
* Default implementation of hashCode. * Default implementation of hashCode.
* *

View File

@@ -62,15 +62,15 @@ public class SuppressionHandler extends DefaultHandler {
/** /**
* A list of suppression rules. * A list of suppression rules.
*/ */
private List<SuppressionRule> supressionRules = new ArrayList<SuppressionRule>(); private List<SuppressionRule> suppressionRules = new ArrayList<SuppressionRule>();
/** /**
* Get the value of supressionRules. * Get the value of suppressionRules.
* *
* @return the value of supressionRules * @return the value of suppressionRules
*/ */
public List<SuppressionRule> getSupressionRules() { public List<SuppressionRule> getSuppressionRules() {
return supressionRules; return suppressionRules;
} }
/** /**
* The current rule being read. * The current rule being read.
@@ -109,7 +109,7 @@ public class SuppressionHandler extends DefaultHandler {
/** /**
* Handles the end element event. * 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 localName the local name of the element
* @param qName the qName of the element * @param qName the qName of the element
* @throws SAXException thrown if there is an exception processing * @throws SAXException thrown if there is an exception processing
@@ -117,7 +117,7 @@ public class SuppressionHandler extends DefaultHandler {
@Override @Override
public void endElement(String uri, String localName, String qName) throws SAXException { public void endElement(String uri, String localName, String qName) throws SAXException {
if (SUPPRESS.equals(qName)) { if (SUPPRESS.equals(qName)) {
supressionRules.add(rule); suppressionRules.add(rule);
rule = null; rule = null;
} else if (FILE_PATH.equals(qName)) { } else if (FILE_PATH.equals(qName)) {
final PropertyType pt = processPropertyType(); final PropertyType pt = processPropertyType();
@@ -151,8 +151,8 @@ public class SuppressionHandler extends DefaultHandler {
} }
/** /**
* Processes field members that have been collected during the characters * Processes field members that have been collected during the characters and startElement method to construct a
* and startElement method to construct a PropertyType object. * PropertyType object.
* *
* @return a PropertyType object * @return a PropertyType object
*/ */

View File

@@ -43,24 +43,20 @@ import org.xml.sax.XMLReader;
public class SuppressionParser { public class SuppressionParser {
/** /**
* JAXP Schema Language. Source: * JAXP Schema Language. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html
* 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"; public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
/** /**
* W3C XML Schema. Source: * W3C XML Schema. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html
* http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html
*/ */
public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
/** /**
* JAXP Schema Source. Source: * JAXP Schema Source. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html
* 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"; 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 * Parses the given xml file and returns a list of the suppression rules contained.
* contained.
* *
* @param file an xml file containing suppression rules * @param file an xml file containing suppression rules
* @return a list of suppression rules * @return a list of suppression rules
@@ -88,8 +84,7 @@ public class SuppressionParser {
xmlReader.parse(in); xmlReader.parse(in);
return handler.getSuppressionRules();
return handler.getSupressionRules();
} catch (ParserConfigurationException ex) { } catch (ParserConfigurationException ex) {
Logger.getLogger(SuppressionParser.class.getName()).log(Level.FINE, null, ex); Logger.getLogger(SuppressionParser.class.getName()).log(Level.FINE, null, ex);
throw new SuppressionParseException(ex); throw new SuppressionParseException(ex);

View File

@@ -98,7 +98,7 @@ public final class FileUtils {
* location of the JAR containing the specified class. * location of the JAR containing the specified class.
* *
* @param configuredFilePath the configured relative or absolute path * @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 * @return a File object
* @throws IOException is thrown if the path could not be decoded * @throws IOException is thrown if the path could not be decoded
* @deprecated This method should no longer be used. See the implementation * @deprecated This method should no longer be used. See the implementation

View File

@@ -79,7 +79,7 @@ public final class UrlStringUtils {
* <p>Example, given the following input:</p> * <p>Example, given the following input:</p>
* <code>"https://www.somedomain.com/path1/path2/file.php?id=439"</code> * <code>"https://www.somedomain.com/path1/path2/file.php?id=439"</code>
* <p>The function would return:</p> * <p>The function would return:</p>
* <code>{"somedomain", "path1", "path2", "file"}</code> * <code>{"some.domain", "path1", "path2", "file"}</code>
* *
* @param text a URL * @param text a URL
* @return importantParts a list of the important parts of the URL * @return importantParts a list of the important parts of the URL

View File

@@ -23,7 +23,7 @@ data.password=DC-Pass1337!
# is not in the current classpath. Setting these properties will add the give path(s) to # 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 # 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) # 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. # 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 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. # For MOST situations these properties likely do not need to be set.

View File

@@ -39,8 +39,8 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var table = $("#vulnTable").stupidtable({ var table = $("#vulnTable").stupidtable({
"severity":function(a,b){ 'severity':function(a,b){
var pattern = "([\\d.]+)"; var pattern = '([\\d.]+)';
var re = new RegExp(pattern); var re = new RegExp(pattern);
var aNum = re.exec(a).slice(1); var aNum = re.exec(a).slice(1);
var bNum = re.exec(b).slice(1); var bNum = re.exec(b).slice(1);
@@ -48,27 +48,26 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
} }
}); });
table.bind('aftertablesort', function (event, data) { table.bind('aftertablesort', function (event, data) {
var th = $(this).find("th"); var th = $(this).find('th');
th.find(".arrow").remove(); th.find(".arrow").remove();
var arrow = data.direction === "asc" ? "↑" : "↓"; var arrow = data.direction === 'asc' ? '↑' : '↓';
th.eq(data.column).append('<span class="arrow">' + arrow +'</span>'); th.eq(data.column).append('<span class="arrow">' + arrow +'</span>');
}); });
$("th.severity").click(); $('th.severity').click();
$(".expandable").click(function (e) { $('.expandable').click(function (e) {
e = e || window.event; e = e || window.event;
var h = e.target || e.srcElement; var h = e.target || e.srcElement;
var content = "#content" + h.id.substr(6); var content = '#content' + h.id.substr(6);
var header = "#" + h.id; var header = '#' + h.id;
$(content).slideToggle("fast"); $(content).slideToggle('fast');
var exprx = /expandedList/; var exprx = /expandedList/;
if (exprx.exec($(header).attr("class"))) { if (exprx.exec($(header).attr('class'))) {
$(header).addClass("collapsedList"); $(header).addClass('collapsedList');
$(header).removeClass("expandedList"); $(header).removeClass('expandedList');
} else { } else {
$(header).addClass("expandedList"); $(header).addClass('expandedList');
$(header).removeClass("collapsedList"); $(header).removeClass('collapsedList');
} }
}); });
}); });
</script> </script>

View File

@@ -28,10 +28,10 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import org.junit.After; import org.junit.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import static org.junit.Assert.assertTrue;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.*;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.XMLReader; 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.... * @throws Exception thrown if there is an exception....
*/ */
@@ -89,7 +89,7 @@ public class SuppressionHandlerTest {
xmlReader.parse(in); xmlReader.parse(in);
List result = handler.getSupressionRules(); List result = handler.getSuppressionRules();
assertTrue(result.size() > 3); assertTrue(result.size() > 3);
} }
} }