mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-11 21:05:38 +01:00
Fixed merge conflict
Former-commit-id: 4a4bfd553bd5b91c53e87f7e327beb0a605bc21f
This commit is contained in:
@@ -127,7 +127,7 @@ public class App {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(App.class.getName()).log(Level.SEVERE, "There was an IO error while attempting to generate the report.");
|
Logger.getLogger(App.class.getName()).log(Level.SEVERE, "There was an IO error while attempting to generate the report.");
|
||||||
Logger.getLogger(App.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(App.class.getName()).log(Level.FINE, null, ex);
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(App.class.getName()).log(Level.SEVERE, "There was an error while attempting to generate the report.");
|
Logger.getLogger(App.class.getName()).log(Level.SEVERE, "There was an error while attempting to generate the report.");
|
||||||
Logger.getLogger(App.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(App.class.getName()).log(Level.FINE, null, ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,13 +299,13 @@ public class Engine {
|
|||||||
final String msg = String.format("Initializing %s", a.getName());
|
final String msg = String.format("Initializing %s", a.getName());
|
||||||
Logger.getLogger(Engine.class.getName()).log(Level.FINE, msg);
|
Logger.getLogger(Engine.class.getName()).log(Level.FINE, msg);
|
||||||
a.initialize();
|
a.initialize();
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
final String msg = String.format("Exception occurred initializing %s.", a.getName());
|
final String msg = String.format("Exception occurred initializing %s.", a.getName());
|
||||||
Logger.getLogger(Engine.class.getName()).log(Level.SEVERE, msg);
|
Logger.getLogger(Engine.class.getName()).log(Level.SEVERE, msg);
|
||||||
Logger.getLogger(Engine.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(Engine.class.getName()).log(Level.FINE, null, ex);
|
||||||
try {
|
try {
|
||||||
a.close();
|
a.close();
|
||||||
} catch (Exception ex1) {
|
} catch (Throwable ex1) {
|
||||||
Logger.getLogger(Engine.class.getName()).log(Level.FINEST, null, ex1);
|
Logger.getLogger(Engine.class.getName()).log(Level.FINEST, null, ex1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,7 +354,7 @@ public class Engine {
|
|||||||
Logger.getLogger(Engine.class.getName()).log(Level.FINE, msg);
|
Logger.getLogger(Engine.class.getName()).log(Level.FINE, msg);
|
||||||
try {
|
try {
|
||||||
a.close();
|
a.close();
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(Engine.class.getName()).log(Level.FINEST, null, ex);
|
Logger.getLogger(Engine.class.getName()).log(Level.FINEST, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,9 +175,10 @@ public class ArchiveAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
public void close() throws Exception {
|
public void close() throws Exception {
|
||||||
if (tempFileLocation != null && tempFileLocation.exists()) {
|
if (tempFileLocation != null && tempFileLocation.exists()) {
|
||||||
Logger.getLogger(ArchiveAnalyzer.class.getName()).log(Level.FINE, "Attempting to delete temporary files");
|
Logger.getLogger(ArchiveAnalyzer.class.getName()).log(Level.FINE, "Attempting to delete temporary files");
|
||||||
boolean success = FileUtils.delete(tempFileLocation);
|
final boolean success = FileUtils.delete(tempFileLocation);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
Logger.getLogger(ArchiveAnalyzer.class.getName()).log(Level.WARNING, "Failed to delete some temporary files, see the log for more details");
|
Logger.getLogger(ArchiveAnalyzer.class.getName()).log(Level.WARNING,
|
||||||
|
"Failed to delete some temporary files, see the log for more details");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,14 +180,14 @@ public class AssemblyAnalyzer extends AbstractAnalyzer {
|
|||||||
if (fos != null) {
|
if (fos != null) {
|
||||||
try {
|
try {
|
||||||
fos.close();
|
fos.close();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
LOG.fine("Error closing output stream");
|
LOG.fine("Error closing output stream");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
try {
|
try {
|
||||||
is.close();
|
is.close();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
LOG.fine("Error closing input stream");
|
LOG.fine("Error closing input stream");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,9 +206,10 @@ public class AssemblyAnalyzer extends AbstractAnalyzer {
|
|||||||
grokAssemblyExe = null;
|
grokAssemblyExe = null;
|
||||||
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");
|
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details.");
|
LOG.warning("An error occured with the .NET AssemblyAnalyzer; "
|
||||||
LOG.fine("Could not execute GrokAssembly " + e.getMessage());
|
+ "this can be ignored unless you are scanning .NET dlls. Please see the log for more details.");
|
||||||
|
LOG.log(Level.FINE, "Could not execute GrokAssembly {0}", e.getMessage());
|
||||||
throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e);
|
throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -393,11 +394,9 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
closeStream(bos);
|
||||||
input.close();
|
closeStream(fos);
|
||||||
} catch (IOException ex) {
|
closeStream(input);
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Model model = null;
|
Model model = null;
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
@@ -423,17 +422,41 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINE, null, ex);
|
||||||
throw ex;
|
throw ex;
|
||||||
} finally {
|
} finally {
|
||||||
if (fis != null) {
|
closeStream(fis);
|
||||||
try {
|
|
||||||
fis.close();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINEST, null, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Silently closes an input stream ignoring errors.
|
||||||
|
*
|
||||||
|
* @param stream an input stream to close
|
||||||
|
*/
|
||||||
|
private void closeStream(InputStream stream) {
|
||||||
|
if (stream != null) {
|
||||||
|
try {
|
||||||
|
stream.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINEST, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Silently closes an output stream ignoring errors.
|
||||||
|
*
|
||||||
|
* @param stream an output stream to close
|
||||||
|
*/
|
||||||
|
private void closeStream(OutputStream stream) {
|
||||||
|
if (stream != null) {
|
||||||
|
try {
|
||||||
|
stream.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINEST, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the specified POM from a jar file and converts it to a Model.
|
* Retrieves the specified POM from a jar file and converts it to a Model.
|
||||||
*
|
*
|
||||||
@@ -938,9 +961,10 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
public void close() {
|
public void close() {
|
||||||
if (tempFileLocation != null && tempFileLocation.exists()) {
|
if (tempFileLocation != null && tempFileLocation.exists()) {
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINE, "Attempting to delete temporary files");
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.FINE, "Attempting to delete temporary files");
|
||||||
boolean success = FileUtils.delete(tempFileLocation);
|
final boolean success = FileUtils.delete(tempFileLocation);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.WARNING, "Failed to delete some temporary files, see the log for more details");
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.WARNING,
|
||||||
|
"Failed to delete some temporary files, see the log for more details");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.owasp.dependencycheck.analyzer;
|
package org.owasp.dependencycheck.analyzer;
|
||||||
|
|
||||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.owasp.dependencycheck.Engine;
|
import org.owasp.dependencycheck.Engine;
|
||||||
|
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||||
import org.owasp.dependencycheck.data.nuget.NugetPackage;
|
import org.owasp.dependencycheck.data.nuget.NugetPackage;
|
||||||
import org.owasp.dependencycheck.data.nuget.NuspecParser;
|
import org.owasp.dependencycheck.data.nuget.NuspecParser;
|
||||||
import org.owasp.dependencycheck.data.nuget.XPathNuspecParser;
|
import org.owasp.dependencycheck.data.nuget.XPathNuspecParser;
|
||||||
@@ -128,7 +127,7 @@ public class NuspecAnalyzer extends AbstractAnalyzer {
|
|||||||
if (fis != null) {
|
if (fis != null) {
|
||||||
try {
|
try {
|
||||||
fis.close();
|
fis.close();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
LOGGER.fine("Error closing input stream");
|
LOGGER.fine("Error closing input stream");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,7 +142,7 @@ public class NuspecAnalyzer extends AbstractAnalyzer {
|
|||||||
if (np.getTitle() != null) {
|
if (np.getTitle() != null) {
|
||||||
dependency.getProductEvidence().addEvidence("nuspec", "title", np.getTitle(), Confidence.MEDIUM);
|
dependency.getProductEvidence().addEvidence("nuspec", "title", np.getTitle(), Confidence.MEDIUM);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
throw new AnalysisException(e);
|
throw new AnalysisException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class NexusSearch {
|
|||||||
* Nexus. This is useful upstream for recovery, so we just re-throw it
|
* Nexus. This is useful upstream for recovery, so we just re-throw it
|
||||||
*/
|
*/
|
||||||
throw fnfe;
|
throw fnfe;
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
// Anything else is jacked-up XML stuff that we really can't recover
|
// Anything else is jacked-up XML stuff that we really can't recover
|
||||||
// from well
|
// from well
|
||||||
throw new IOException(e.getMessage(), e);
|
throw new IOException(e.getMessage(), e);
|
||||||
@@ -151,7 +151,7 @@ public class NexusSearch {
|
|||||||
*/
|
*/
|
||||||
public boolean preflightRequest() {
|
public boolean preflightRequest() {
|
||||||
try {
|
try {
|
||||||
HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(new URL(rootURL, "status"));
|
final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(new URL(rootURL, "status"));
|
||||||
conn.addRequestProperty("Accept", "application/xml");
|
conn.addRequestProperty("Accept", "application/xml");
|
||||||
conn.connect();
|
conn.connect();
|
||||||
if (conn.getResponseCode() != 200) {
|
if (conn.getResponseCode() != 200) {
|
||||||
@@ -164,7 +164,7 @@ public class NexusSearch {
|
|||||||
LOGGER.warning("Expected root node name of status, got " + doc.getDocumentElement().getNodeName());
|
LOGGER.warning("Expected root node name of status, got " + doc.getDocumentElement().getNodeName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,10 @@
|
|||||||
package org.owasp.dependencycheck.data.nuget;
|
package org.owasp.dependencycheck.data.nuget;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.xpath.XPath;
|
import javax.xml.xpath.XPath;
|
||||||
import javax.xml.xpath.XPathConstants;
|
import javax.xml.xpath.XPathConstants;
|
||||||
import javax.xml.xpath.XPathFactory;
|
import javax.xml.xpath.XPathFactory;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
@@ -33,6 +31,7 @@ import org.w3c.dom.Node;
|
|||||||
* @author colezlaw
|
* @author colezlaw
|
||||||
*/
|
*/
|
||||||
public class XPathNuspecParser implements NuspecParser {
|
public class XPathNuspecParser implements NuspecParser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the string value of a node or null if it's not present
|
* Gets the string value of a node or null if it's not present
|
||||||
*
|
*
|
||||||
@@ -71,11 +70,11 @@ public class XPathNuspecParser implements NuspecParser {
|
|||||||
nuspec.setId(xpath.evaluate("/package/metadata/id", d));
|
nuspec.setId(xpath.evaluate("/package/metadata/id", d));
|
||||||
nuspec.setVersion(xpath.evaluate("/package/metadata/version", d));
|
nuspec.setVersion(xpath.evaluate("/package/metadata/version", d));
|
||||||
nuspec.setAuthors(xpath.evaluate("/package/metadata/authors", d));
|
nuspec.setAuthors(xpath.evaluate("/package/metadata/authors", d));
|
||||||
nuspec.setOwners(getOrNull((Node) xpath.evaluate("/package/metadata/owners", d, XPathConstants.NODE)));
|
nuspec.setOwners(getOrNull((Node) xpath.evaluate("/package/metadata/owners", d, XPathConstants.NODE)));
|
||||||
nuspec.setLicenseUrl(getOrNull((Node) xpath.evaluate("/package/metadata/licenseUrl", d, XPathConstants.NODE)));
|
nuspec.setLicenseUrl(getOrNull((Node) xpath.evaluate("/package/metadata/licenseUrl", d, XPathConstants.NODE)));
|
||||||
nuspec.setTitle(getOrNull((Node) xpath.evaluate("/package/metadata/title", d, XPathConstants.NODE)));
|
nuspec.setTitle(getOrNull((Node) xpath.evaluate("/package/metadata/title", d, XPathConstants.NODE)));
|
||||||
return nuspec;
|
return nuspec;
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
throw new NuspecParseException("Unable to parse nuspec", e);
|
throw new NuspecParseException("Unable to parse nuspec", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public class CveDB {
|
|||||||
* @throws DatabaseException thrown when there is an error retrieving the data from the DB
|
* @throws DatabaseException thrown when there is an error retrieving the data from the DB
|
||||||
*/
|
*/
|
||||||
public Set<Pair<String, String>> getVendorProductList() throws DatabaseException {
|
public Set<Pair<String, String>> getVendorProductList() throws DatabaseException {
|
||||||
HashSet data = new HashSet<Pair<String, String>>();
|
final HashSet data = new HashSet<Pair<String, String>>();
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class DriverShim implements Driver {
|
|||||||
Method m = null;
|
Method m = null;
|
||||||
try {
|
try {
|
||||||
m = driver.getClass().getMethod("getParentLogger");
|
m = driver.getClass().getMethod("getParentLogger");
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
throw new SQLFeatureNotSupportedException();
|
throw new SQLFeatureNotSupportedException();
|
||||||
}
|
}
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ public class StandardUpdate {
|
|||||||
if (cveDB != null) {
|
if (cveDB != null) {
|
||||||
try {
|
try {
|
||||||
cveDB.close();
|
cveDB.close();
|
||||||
} catch (Exception ignore) {
|
} catch (Throwable ignore) {
|
||||||
Logger.getLogger(StandardUpdate.class.getName()).log(Level.FINEST, "Error closing the cveDB", ignore);
|
Logger.getLogger(StandardUpdate.class.getName()).log(Level.FINEST, "Error closing the cveDB", ignore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,13 +85,13 @@ public final class Downloader {
|
|||||||
while ((bytesRead = reader.read(buffer)) > 0) {
|
while ((bytesRead = reader.read(buffer)) > 0) {
|
||||||
writer.write(buffer, 0, bytesRead);
|
writer.write(buffer, 0, bytesRead);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
throw new DownloadFailedException("Error saving downloaded file.", ex);
|
throw new DownloadFailedException("Error saving downloaded file.", ex);
|
||||||
} finally {
|
} finally {
|
||||||
if (writer != null) {
|
if (writer != null) {
|
||||||
try {
|
try {
|
||||||
writer.close();
|
writer.close();
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(Downloader.class.getName()).log(Level.FINEST,
|
Logger.getLogger(Downloader.class.getName()).log(Level.FINEST,
|
||||||
"Error closing the writer in Downloader.", ex);
|
"Error closing the writer in Downloader.", ex);
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ public final class Downloader {
|
|||||||
if (reader != null) {
|
if (reader != null) {
|
||||||
try {
|
try {
|
||||||
reader.close();
|
reader.close();
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(Downloader.class.getName()).log(Level.FINEST,
|
Logger.getLogger(Downloader.class.getName()).log(Level.FINEST,
|
||||||
"Error closing the reader in Downloader.", ex);
|
"Error closing the reader in Downloader.", ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public final class LogUtils {
|
|||||||
if (in != null) {
|
if (in != null) {
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(LogUtils.class.getName()).log(Level.FINEST, "Error closing resource stream", ex);
|
Logger.getLogger(LogUtils.class.getName()).log(Level.FINEST, "Error closing resource stream", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,12 @@ package org.owasp.dependencycheck.utils;
|
|||||||
/**
|
/**
|
||||||
* A generic pair of elements.
|
* A generic pair of elements.
|
||||||
*
|
*
|
||||||
|
* @param <L> the type for the left element in the pair
|
||||||
|
* @param <R> the type for the right element in the pair
|
||||||
|
*
|
||||||
* @author Jeremy Long <jeremy.long@owasp.org>
|
* @author Jeremy Long <jeremy.long@owasp.org>
|
||||||
*/
|
*/
|
||||||
public class Pair<K, V> {
|
public class Pair<L, R> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new empty pair.
|
* Constructs a new empty pair.
|
||||||
@@ -36,52 +39,52 @@ public class Pair<K, V> {
|
|||||||
* @param left the value for the left pair
|
* @param left the value for the left pair
|
||||||
* @param right the value for the right pair
|
* @param right the value for the right pair
|
||||||
*/
|
*/
|
||||||
public Pair(K left, V right) {
|
public Pair(L left, R right) {
|
||||||
this.left = left;
|
this.left = left;
|
||||||
this.right = right;
|
this.right = right;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The left element of the pair.
|
* The left element of the pair.
|
||||||
*/
|
*/
|
||||||
private K left = null;
|
private L left = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of left
|
* Get the value of left.
|
||||||
*
|
*
|
||||||
* @return the value of left
|
* @return the value of left
|
||||||
*/
|
*/
|
||||||
public K getLeft() {
|
public L getLeft() {
|
||||||
return left;
|
return left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of left
|
* Set the value of left.
|
||||||
*
|
*
|
||||||
* @param left new value of left
|
* @param left new value of left
|
||||||
*/
|
*/
|
||||||
public void setLeft(K left) {
|
public void setLeft(L left) {
|
||||||
this.left = left;
|
this.left = left;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The right element of the pair.
|
* The right element of the pair.
|
||||||
*/
|
*/
|
||||||
private V right = null;
|
private R right = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of right
|
* Get the value of right.
|
||||||
*
|
*
|
||||||
* @return the value of right
|
* @return the value of right
|
||||||
*/
|
*/
|
||||||
public V getRight() {
|
public R getRight() {
|
||||||
return right;
|
return right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of right
|
* Set the value of right.
|
||||||
*
|
*
|
||||||
* @param right new value of right
|
* @param right new value of right
|
||||||
*/
|
*/
|
||||||
public void setRight(V right) {
|
public void setRight(R right) {
|
||||||
this.right = right;
|
this.right = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public static final String ANALYZER_NEXUS_URL = "analyzer.nexus.url";
|
public static final String ANALYZER_NEXUS_URL = "analyzer.nexus.url";
|
||||||
/**
|
/**
|
||||||
* The properties key for using the proxy to reach Nexus
|
* The properties key for using the proxy to reach Nexus.
|
||||||
*/
|
*/
|
||||||
public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy";
|
public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy";
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import java.net.URL;
|
|||||||
*
|
*
|
||||||
* @author Jeremy Long <jeremy.long@owasp.org>
|
* @author Jeremy Long <jeremy.long@owasp.org>
|
||||||
*/
|
*/
|
||||||
public class URLConnectionFactory {
|
public final class URLConnectionFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor for this factory.
|
* Private constructor for this factory.
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assume;
|
import org.junit.Assume;
|
||||||
|
import static org.junit.Assume.assumeFalse;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||||
@@ -53,7 +54,7 @@ public class AssemblyAnalyzerTest {
|
|||||||
* @throws Exception if anything goes sideways
|
* @throws Exception if anything goes sideways
|
||||||
*/
|
*/
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
try {
|
try {
|
||||||
analyzer = new AssemblyAnalyzer();
|
analyzer = new AssemblyAnalyzer();
|
||||||
analyzer.initialize();
|
analyzer.initialize();
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public abstract class BaseDBTestCase extends TestCase {
|
|||||||
while ((count = zin.read(data, 0, BUFFER_SIZE)) != -1) {
|
while ((count = zin.read(data, 0, BUFFER_SIZE)) != -1) {
|
||||||
dest.write(data, 0, count);
|
dest.write(data, 0, count);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(BaseDBTestCase.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(BaseDBTestCase.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class NvdCve_2_0_HandlerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testParse() {
|
public void testParse() {
|
||||||
Exception results = null;
|
Throwable results = null;
|
||||||
try {
|
try {
|
||||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
SAXParser saxParser = factory.newSAXParser();
|
SAXParser saxParser = factory.newSAXParser();
|
||||||
@@ -64,7 +64,7 @@ public class NvdCve_2_0_HandlerTest {
|
|||||||
NvdCve20Handler instance = new NvdCve20Handler();
|
NvdCve20Handler instance = new NvdCve20Handler();
|
||||||
|
|
||||||
saxParser.parse(file, instance);
|
saxParser.parse(file, instance);
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
results = ex;
|
results = ex;
|
||||||
}
|
}
|
||||||
assertTrue("Exception thrown during parse of 2012 CVE version 2.0?", results == null);
|
assertTrue("Exception thrown during parse of 2012 CVE version 2.0?", results == null);
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
|
|||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.SEVERE,
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.SEVERE,
|
||||||
"Unexpected exception occurred during analysis; please see the verbose error log for more details.");
|
"Unexpected exception occurred during analysis; please see the verbose error log for more details.");
|
||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, null, ex);
|
||||||
} catch (Exception ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.SEVERE,
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.SEVERE,
|
||||||
"Unexpected exception occurred during analysis; please see the verbose error log for more details.");
|
"Unexpected exception occurred during analysis; please see the verbose error log for more details.");
|
||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, null, ex);
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -73,7 +73,7 @@ Copyright (c) 2012 - Jeremy Long
|
|||||||
<role>developer</role>
|
<role>developer</role>
|
||||||
</roles>
|
</roles>
|
||||||
<properties>
|
<properties>
|
||||||
<twitter>@willathome</twitter>
|
<twitter>@willathome</twitter>
|
||||||
</properties>
|
</properties>
|
||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|||||||
BIN
src/site/resources/images/logos/Button-Built-on-CB-1.png
Normal file
BIN
src/site/resources/images/logos/Button-Built-on-CB-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
src/site/resources/images/logos/logo_intellij_idea.png
Normal file
BIN
src/site/resources/images/logos/logo_intellij_idea.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.9 KiB |
@@ -20,7 +20,7 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<skin>
|
<skin>
|
||||||
<groupId>org.apache.maven.skins</groupId>
|
<groupId>org.apache.maven.skins</groupId>
|
||||||
<artifactId>maven-fluido-skin</artifactId>
|
<artifactId>maven-fluido-skin</artifactId>
|
||||||
<version>1.3.0</version>
|
<version>1.3.1</version>
|
||||||
</skin>
|
</skin>
|
||||||
<custom>
|
<custom>
|
||||||
<fluidoSkin>
|
<fluidoSkin>
|
||||||
@@ -37,6 +37,7 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<showUser>true</showUser>
|
<showUser>true</showUser>
|
||||||
<showFollowers>true</showFollowers>
|
<showFollowers>true</showFollowers>
|
||||||
</twitter>
|
</twitter>
|
||||||
|
<googlePlusOne />
|
||||||
</fluidoSkin>
|
</fluidoSkin>
|
||||||
</custom>
|
</custom>
|
||||||
<bannerLeft>
|
<bannerLeft>
|
||||||
@@ -44,6 +45,21 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
</bannerLeft>
|
</bannerLeft>
|
||||||
<publishDate position="right" />
|
<publishDate position="right" />
|
||||||
<version position="right" />
|
<version position="right" />
|
||||||
|
<poweredBy>
|
||||||
|
<logo name="Maven" href="http://maven.apache.org/"
|
||||||
|
title="built with maven"
|
||||||
|
alt="built with maven"
|
||||||
|
img="http://jeremylong.github.io/DependencyCheck/images/logos/maven-feather.png"/>
|
||||||
|
<logo name="IntelliJ" href="http://maven.apache.org/"
|
||||||
|
title="developed using" width="170px"
|
||||||
|
alt="developed using"
|
||||||
|
img="http://jeremylong.github.io/DependencyCheck/images/logos/logo_intellij_idea.png"/>
|
||||||
|
<logo name="Cloudbees" href="http://www.cloudbees.com/"
|
||||||
|
title="built on cloudbees"
|
||||||
|
alt="built on cloudbees"
|
||||||
|
img="http://jeremylong.github.io/DependencyCheck/images/logos/Button-Built-on-CB-1.png"/>
|
||||||
|
</poweredBy>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@@ -59,13 +75,13 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<item name="False Positives" href="./suppression.html">
|
<item name="False Positives" href="./suppression.html">
|
||||||
<description>Suppressing False Positives</description>
|
<description>Suppressing False Positives</description>
|
||||||
</item>
|
</item>
|
||||||
<item name="Project Presentation (pptx)" href="./dependency-check.pptx">
|
<item name="Project Presentation (pptx)" href="./dependency-check.pptx">
|
||||||
<description>PowerPoint Deck</description>
|
<description>PowerPoint Deck</description>
|
||||||
</item>
|
</item>
|
||||||
<item name="Project Presentation (pdf)" href="./dependency-check.pdf">
|
<item name="Project Presentation (pdf)" href="./dependency-check.pdf">
|
||||||
<description>PowerPoint Deck</description>
|
<description>PowerPoint Deck</description>
|
||||||
</item>
|
</item>
|
||||||
<item name="Sample Report" href="./SampleReport.html">
|
<item name="Sample Report" href="./SampleReport.html">
|
||||||
<description>Sample Report</description>
|
<description>Sample Report</description>
|
||||||
</item>
|
</item>
|
||||||
</menu>
|
</menu>
|
||||||
@@ -86,6 +102,6 @@ Copyright (c) 2013 Jeremy Long. All Rights Reserved.
|
|||||||
<description>A Jenkins plugin for dependency-check.</description>
|
<description>A Jenkins plugin for dependency-check.</description>
|
||||||
</item>
|
</item>
|
||||||
</menu>
|
</menu>
|
||||||
<footer/>
|
<footer>Copyright © 2012-2014 Jeremy Long. All Rights Reserved.</footer>
|
||||||
</body>
|
</body>
|
||||||
</project>
|
</project>
|
||||||
Reference in New Issue
Block a user