mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
add toString() for Vulnerability
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
package org.owasp.dependencycheck.dependency;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
@@ -33,6 +32,7 @@ public class Vulnerability implements Serializable, Comparable<Vulnerability> {
|
||||
* The serial version uid.
|
||||
*/
|
||||
private static final long serialVersionUID = 307319490326651052L;
|
||||
|
||||
/**
|
||||
* The name of the vulnerability.
|
||||
*/
|
||||
@@ -383,6 +383,24 @@ public class Vulnerability implements Serializable, Comparable<Vulnerability> {
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("Vulnerability ");
|
||||
sb.append(this.name);
|
||||
sb.append("\nReferences:\n");
|
||||
for (Iterator i = this.references.iterator(); i.hasNext();) {
|
||||
sb.append("=> ");
|
||||
sb.append(i.next());
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append("\nSoftware:\n");
|
||||
for (Iterator i = this.vulnerableSoftware.iterator(); i.hasNext();) {
|
||||
sb.append("=> ");
|
||||
sb.append(i.next());
|
||||
sb.append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
/**
|
||||
* Compares two vulnerabilities.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user