| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
package org.owasp.dependencycheck.dependency; |
| 19 | |
|
| 20 | |
import java.io.File; |
| 21 | |
import java.io.IOException; |
| 22 | |
import java.io.Serializable; |
| 23 | |
import java.security.NoSuchAlgorithmException; |
| 24 | |
import java.util.Set; |
| 25 | |
import java.util.SortedSet; |
| 26 | |
import java.util.TreeSet; |
| 27 | |
import java.util.logging.Level; |
| 28 | |
import java.util.logging.Logger; |
| 29 | |
import org.owasp.dependencycheck.data.nexus.MavenArtifact; |
| 30 | |
import org.owasp.dependencycheck.utils.Checksum; |
| 31 | |
import org.owasp.dependencycheck.utils.FileUtils; |
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | 2 | public class Dependency implements Serializable, Comparable<Dependency> { |
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | 1 | private static final Logger LOGGER = Logger.getLogger(Dependency.class.getName()); |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
private String actualFilePath; |
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
private String filePath; |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
private String fileName; |
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
private String fileExtension; |
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | |
private String md5sum; |
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
private String sha1sum; |
| 70 | |
|
| 71 | |
|
| 72 | |
|
| 73 | |
private Set<Identifier> identifiers; |
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
private final EvidenceCollection vendorEvidence; |
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
private final EvidenceCollection productEvidence; |
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
private final EvidenceCollection versionEvidence; |
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | 40 | public Dependency() { |
| 91 | 40 | vendorEvidence = new EvidenceCollection(); |
| 92 | 40 | productEvidence = new EvidenceCollection(); |
| 93 | 40 | versionEvidence = new EvidenceCollection(); |
| 94 | 40 | identifiers = new TreeSet<Identifier>(); |
| 95 | 40 | vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator()); |
| 96 | 40 | suppressedIdentifiers = new TreeSet<Identifier>(); |
| 97 | 40 | suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator()); |
| 98 | 40 | } |
| 99 | |
|
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
public Dependency(File file) { |
| 106 | 17 | this(); |
| 107 | 17 | this.actualFilePath = file.getPath(); |
| 108 | 17 | this.filePath = this.actualFilePath; |
| 109 | 17 | this.fileName = file.getName(); |
| 110 | 17 | this.fileExtension = FileUtils.getFileExtension(fileName); |
| 111 | 17 | determineHashes(file); |
| 112 | 17 | } |
| 113 | |
|
| 114 | |
|
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
public String getFileName() { |
| 120 | |
return this.fileName; |
| 121 | |
} |
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
|
| 126 | |
|
| 127 | |
|
| 128 | |
|
| 129 | |
public String getFileNameForJavaScript() { |
| 130 | 0 | return this.fileName.replace("\\", "\\\\"); |
| 131 | |
} |
| 132 | |
|
| 133 | |
|
| 134 | |
|
| 135 | |
|
| 136 | |
|
| 137 | |
|
| 138 | |
public void setFileName(String fileName) { |
| 139 | |
this.fileName = fileName; |
| 140 | |
} |
| 141 | |
|
| 142 | |
|
| 143 | |
|
| 144 | |
|
| 145 | |
|
| 146 | |
|
| 147 | |
public void setActualFilePath(String actualFilePath) { |
| 148 | 2 | this.actualFilePath = actualFilePath; |
| 149 | 2 | if (this.sha1sum == null) { |
| 150 | 2 | final File file = new File(this.actualFilePath); |
| 151 | 2 | determineHashes(file); |
| 152 | |
} |
| 153 | 2 | } |
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
|
| 160 | |
public String getActualFilePath() { |
| 161 | |
return this.actualFilePath; |
| 162 | |
} |
| 163 | |
|
| 164 | |
|
| 165 | |
|
| 166 | |
|
| 167 | |
|
| 168 | |
|
| 169 | |
public File getActualFile() { |
| 170 | 7 | return new File(this.actualFilePath); |
| 171 | |
} |
| 172 | |
|
| 173 | |
|
| 174 | |
|
| 175 | |
|
| 176 | |
|
| 177 | |
|
| 178 | |
public void setFilePath(String filePath) { |
| 179 | |
this.filePath = filePath; |
| 180 | |
} |
| 181 | |
|
| 182 | |
|
| 183 | |
|
| 184 | |
|
| 185 | 40 | private String displayName = null; |
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
|
| 190 | |
|
| 191 | |
|
| 192 | |
public void setDisplayFileName(String displayName) { |
| 193 | |
this.displayName = displayName; |
| 194 | |
} |
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
|
| 202 | |
public String getDisplayFileName() { |
| 203 | 0 | if (displayName == null) { |
| 204 | 0 | return this.fileName; |
| 205 | |
} |
| 206 | 0 | return this.displayName; |
| 207 | |
} |
| 208 | |
|
| 209 | |
|
| 210 | |
|
| 211 | |
|
| 212 | |
|
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
public String getFilePath() { |
| 219 | |
return this.filePath; |
| 220 | |
} |
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
|
| 227 | |
public void setFileExtension(String fileExtension) { |
| 228 | |
this.fileExtension = fileExtension; |
| 229 | |
} |
| 230 | |
|
| 231 | |
|
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
|
| 236 | |
public String getFileExtension() { |
| 237 | |
return this.fileExtension; |
| 238 | |
} |
| 239 | |
|
| 240 | |
|
| 241 | |
|
| 242 | |
|
| 243 | |
|
| 244 | |
|
| 245 | |
public String getMd5sum() { |
| 246 | |
return this.md5sum; |
| 247 | |
} |
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
|
| 252 | |
|
| 253 | |
|
| 254 | |
public void setMd5sum(String md5sum) { |
| 255 | |
this.md5sum = md5sum; |
| 256 | |
} |
| 257 | |
|
| 258 | |
|
| 259 | |
|
| 260 | |
|
| 261 | |
|
| 262 | |
|
| 263 | |
public String getSha1sum() { |
| 264 | |
return this.sha1sum; |
| 265 | |
} |
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
public void setSha1sum(String sha1sum) { |
| 273 | |
this.sha1sum = sha1sum; |
| 274 | |
} |
| 275 | |
|
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
|
| 281 | |
public Set<Identifier> getIdentifiers() { |
| 282 | |
return this.identifiers; |
| 283 | |
} |
| 284 | |
|
| 285 | |
|
| 286 | |
|
| 287 | |
|
| 288 | |
|
| 289 | |
|
| 290 | |
public void setIdentifiers(Set<Identifier> identifiers) { |
| 291 | |
this.identifiers = identifiers; |
| 292 | |
} |
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
|
| 298 | |
|
| 299 | |
|
| 300 | |
|
| 301 | |
public void addIdentifier(String type, String value, String url) { |
| 302 | 11 | final Identifier i = new Identifier(type, value, url); |
| 303 | 11 | this.identifiers.add(i); |
| 304 | 11 | } |
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
|
| 309 | |
|
| 310 | |
|
| 311 | |
|
| 312 | |
|
| 313 | |
|
| 314 | |
public void addIdentifier(String type, String value, String url, Confidence confidence) { |
| 315 | 4 | final Identifier i = new Identifier(type, value, url); |
| 316 | 4 | i.setConfidence(confidence); |
| 317 | 4 | this.identifiers.add(i); |
| 318 | 4 | } |
| 319 | |
|
| 320 | |
|
| 321 | |
|
| 322 | |
|
| 323 | |
|
| 324 | |
|
| 325 | |
|
| 326 | |
|
| 327 | |
public void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence) { |
| 328 | 4 | if (mavenArtifact.getGroupId() != null && !mavenArtifact.getGroupId().isEmpty()) { |
| 329 | 3 | this.getVendorEvidence().addEvidence(source, "groupid", mavenArtifact.getGroupId(), confidence); |
| 330 | |
} |
| 331 | 4 | if (mavenArtifact.getArtifactId() != null && !mavenArtifact.getArtifactId().isEmpty()) { |
| 332 | 3 | this.getProductEvidence().addEvidence(source, "artifactid", mavenArtifact.getArtifactId(), confidence); |
| 333 | |
} |
| 334 | 4 | if (mavenArtifact.getVersion() != null && !mavenArtifact.getVersion().isEmpty()) { |
| 335 | 3 | this.getVersionEvidence().addEvidence(source, "version", mavenArtifact.getVersion(), confidence); |
| 336 | |
} |
| 337 | 4 | if (mavenArtifact.getArtifactUrl() != null && !mavenArtifact.getArtifactUrl().isEmpty()) { |
| 338 | 3 | boolean found = false; |
| 339 | 3 | for (Identifier i : this.getIdentifiers()) { |
| 340 | 0 | if ("maven".equals(i.getType()) && i.getValue().equals(mavenArtifact.toString())) { |
| 341 | 0 | found = true; |
| 342 | 0 | i.setConfidence(Confidence.HIGHEST); |
| 343 | 0 | i.setUrl(mavenArtifact.getArtifactUrl()); |
| 344 | 0 | LOGGER.fine(String.format("Already found identifier %s. Confidence set to highest", i.getValue())); |
| 345 | 0 | break; |
| 346 | |
} |
| 347 | 0 | } |
| 348 | 3 | if (!found) { |
| 349 | 3 | LOGGER.fine(String.format("Adding new maven identifier %s", mavenArtifact.toString())); |
| 350 | 3 | this.addIdentifier("maven", mavenArtifact.toString(), mavenArtifact.getArtifactUrl(), Confidence.HIGHEST); |
| 351 | |
} |
| 352 | |
} |
| 353 | 4 | } |
| 354 | |
|
| 355 | |
|
| 356 | |
|
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
public void addIdentifier(Identifier identifier) { |
| 361 | 4 | this.identifiers.add(identifier); |
| 362 | 4 | } |
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
private Set<Identifier> suppressedIdentifiers; |
| 368 | |
|
| 369 | |
|
| 370 | |
|
| 371 | |
|
| 372 | |
|
| 373 | |
|
| 374 | |
public Set<Identifier> getSuppressedIdentifiers() { |
| 375 | |
return suppressedIdentifiers; |
| 376 | |
} |
| 377 | |
|
| 378 | |
|
| 379 | |
|
| 380 | |
|
| 381 | |
|
| 382 | |
|
| 383 | |
public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) { |
| 384 | |
this.suppressedIdentifiers = suppressedIdentifiers; |
| 385 | |
} |
| 386 | |
|
| 387 | |
|
| 388 | |
|
| 389 | |
|
| 390 | |
|
| 391 | |
|
| 392 | |
public void addSuppressedIdentifier(Identifier identifier) { |
| 393 | 4 | this.suppressedIdentifiers.add(identifier); |
| 394 | 4 | } |
| 395 | |
|
| 396 | |
|
| 397 | |
|
| 398 | |
|
| 399 | |
private SortedSet<Vulnerability> suppressedVulnerabilities; |
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
public SortedSet<Vulnerability> getSuppressedVulnerabilities() { |
| 407 | |
return suppressedVulnerabilities; |
| 408 | |
} |
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) { |
| 416 | |
this.suppressedVulnerabilities = suppressedVulnerabilities; |
| 417 | |
} |
| 418 | |
|
| 419 | |
|
| 420 | |
|
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | |
public void addSuppressedVulnerability(Vulnerability vulnerability) { |
| 425 | 3 | this.suppressedVulnerabilities.add(vulnerability); |
| 426 | 3 | } |
| 427 | |
|
| 428 | |
|
| 429 | |
|
| 430 | |
|
| 431 | |
|
| 432 | |
|
| 433 | |
public EvidenceCollection getEvidence() { |
| 434 | 11 | return EvidenceCollection.merge(this.productEvidence, this.vendorEvidence, this.versionEvidence); |
| 435 | |
} |
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | |
public Set<Evidence> getEvidenceForDisplay() { |
| 443 | 0 | return EvidenceCollection.mergeForDisplay(this.productEvidence, this.vendorEvidence, this.versionEvidence); |
| 444 | |
} |
| 445 | |
|
| 446 | |
|
| 447 | |
|
| 448 | |
|
| 449 | |
|
| 450 | |
|
| 451 | |
public EvidenceCollection getEvidenceUsed() { |
| 452 | 1 | return EvidenceCollection.mergeUsed(this.productEvidence, this.vendorEvidence, this.versionEvidence); |
| 453 | |
} |
| 454 | |
|
| 455 | |
|
| 456 | |
|
| 457 | |
|
| 458 | |
|
| 459 | |
|
| 460 | |
public EvidenceCollection getVendorEvidence() { |
| 461 | |
return this.vendorEvidence; |
| 462 | |
} |
| 463 | |
|
| 464 | |
|
| 465 | |
|
| 466 | |
|
| 467 | |
|
| 468 | |
|
| 469 | |
public EvidenceCollection getProductEvidence() { |
| 470 | |
return this.productEvidence; |
| 471 | |
} |
| 472 | |
|
| 473 | |
|
| 474 | |
|
| 475 | |
|
| 476 | |
|
| 477 | |
|
| 478 | |
public EvidenceCollection getVersionEvidence() { |
| 479 | |
return this.versionEvidence; |
| 480 | |
} |
| 481 | |
|
| 482 | |
|
| 483 | |
|
| 484 | |
|
| 485 | |
private String description; |
| 486 | |
|
| 487 | |
|
| 488 | |
|
| 489 | |
|
| 490 | |
|
| 491 | |
|
| 492 | |
public String getDescription() { |
| 493 | |
return description; |
| 494 | |
} |
| 495 | |
|
| 496 | |
|
| 497 | |
|
| 498 | |
|
| 499 | |
|
| 500 | |
|
| 501 | |
public void setDescription(String description) { |
| 502 | |
this.description = description; |
| 503 | |
} |
| 504 | |
|
| 505 | |
|
| 506 | |
|
| 507 | |
|
| 508 | |
private String license; |
| 509 | |
|
| 510 | |
|
| 511 | |
|
| 512 | |
|
| 513 | |
|
| 514 | |
|
| 515 | |
public String getLicense() { |
| 516 | |
return license; |
| 517 | |
} |
| 518 | |
|
| 519 | |
|
| 520 | |
|
| 521 | |
|
| 522 | |
|
| 523 | |
|
| 524 | |
public void setLicense(String license) { |
| 525 | |
this.license = license; |
| 526 | |
} |
| 527 | |
|
| 528 | |
|
| 529 | |
|
| 530 | |
|
| 531 | |
private SortedSet<Vulnerability> vulnerabilities; |
| 532 | |
|
| 533 | |
|
| 534 | |
|
| 535 | |
|
| 536 | |
|
| 537 | |
|
| 538 | |
public SortedSet<Vulnerability> getVulnerabilities() { |
| 539 | |
return vulnerabilities; |
| 540 | |
} |
| 541 | |
|
| 542 | |
|
| 543 | |
|
| 544 | |
|
| 545 | |
|
| 546 | |
|
| 547 | |
public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) { |
| 548 | |
this.vulnerabilities = vulnerabilities; |
| 549 | |
} |
| 550 | |
|
| 551 | |
|
| 552 | |
|
| 553 | |
|
| 554 | |
|
| 555 | |
|
| 556 | |
private void determineHashes(File file) { |
| 557 | 19 | String md5 = null; |
| 558 | 19 | String sha1 = null; |
| 559 | |
try { |
| 560 | 19 | md5 = Checksum.getMD5Checksum(file); |
| 561 | 16 | sha1 = Checksum.getSHA1Checksum(file); |
| 562 | 3 | } catch (IOException ex) { |
| 563 | 3 | final String msg = String.format("Unable to read '%s' to determine hashes.", file.getName()); |
| 564 | 3 | LOGGER.log(Level.WARNING, msg); |
| 565 | 3 | LOGGER.log(Level.FINE, null, ex); |
| 566 | 0 | } catch (NoSuchAlgorithmException ex) { |
| 567 | 0 | final String msg = "Unable to use MD5 of SHA1 checksums."; |
| 568 | 0 | LOGGER.log(Level.WARNING, msg); |
| 569 | 0 | LOGGER.log(Level.FINE, null, ex); |
| 570 | 19 | } |
| 571 | 19 | this.setMd5sum(md5); |
| 572 | 19 | this.setSha1sum(sha1); |
| 573 | 19 | } |
| 574 | |
|
| 575 | |
|
| 576 | |
|
| 577 | |
|
| 578 | |
|
| 579 | |
|
| 580 | |
public void addVulnerability(Vulnerability vulnerability) { |
| 581 | 3 | this.vulnerabilities.add(vulnerability); |
| 582 | 3 | } |
| 583 | |
|
| 584 | |
|
| 585 | |
|
| 586 | |
|
| 587 | 40 | private Set<Dependency> relatedDependencies = new TreeSet<Dependency>(); |
| 588 | |
|
| 589 | |
|
| 590 | |
|
| 591 | |
|
| 592 | |
|
| 593 | |
|
| 594 | |
public Set<Dependency> getRelatedDependencies() { |
| 595 | |
return relatedDependencies; |
| 596 | |
} |
| 597 | |
|
| 598 | |
|
| 599 | |
|
| 600 | |
|
| 601 | |
|
| 602 | |
|
| 603 | |
public void setRelatedDependencies(Set<Dependency> relatedDependencies) { |
| 604 | |
this.relatedDependencies = relatedDependencies; |
| 605 | |
} |
| 606 | |
|
| 607 | |
|
| 608 | |
|
| 609 | |
|
| 610 | |
|
| 611 | |
|
| 612 | |
public void addRelatedDependency(Dependency dependency) { |
| 613 | 0 | relatedDependencies.add(dependency); |
| 614 | 0 | } |
| 615 | |
|
| 616 | |
|
| 617 | |
|
| 618 | |
|
| 619 | |
|
| 620 | |
|
| 621 | |
|
| 622 | |
public int compareTo(Dependency o) { |
| 623 | 2 | return this.getFilePath().compareToIgnoreCase(o.getFilePath()); |
| 624 | |
} |
| 625 | |
|
| 626 | |
|
| 627 | |
|
| 628 | |
|
| 629 | |
|
| 630 | |
|
| 631 | |
|
| 632 | |
@Override |
| 633 | |
public boolean equals(Object obj) { |
| 634 | 0 | if (obj == null) { |
| 635 | 0 | return false; |
| 636 | |
} |
| 637 | 0 | if (getClass() != obj.getClass()) { |
| 638 | 0 | return false; |
| 639 | |
} |
| 640 | 0 | final Dependency other = (Dependency) obj; |
| 641 | 0 | if ((this.actualFilePath == null) ? (other.actualFilePath != null) : !this.actualFilePath.equals(other.actualFilePath)) { |
| 642 | 0 | return false; |
| 643 | |
} |
| 644 | 0 | if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) { |
| 645 | 0 | return false; |
| 646 | |
} |
| 647 | 0 | if ((this.fileName == null) ? (other.fileName != null) : !this.fileName.equals(other.fileName)) { |
| 648 | 0 | return false; |
| 649 | |
} |
| 650 | 0 | if ((this.fileExtension == null) ? (other.fileExtension != null) : !this.fileExtension.equals(other.fileExtension)) { |
| 651 | 0 | return false; |
| 652 | |
} |
| 653 | 0 | if ((this.md5sum == null) ? (other.md5sum != null) : !this.md5sum.equals(other.md5sum)) { |
| 654 | 0 | return false; |
| 655 | |
} |
| 656 | 0 | if ((this.sha1sum == null) ? (other.sha1sum != null) : !this.sha1sum.equals(other.sha1sum)) { |
| 657 | 0 | return false; |
| 658 | |
} |
| 659 | 0 | if (this.identifiers != other.identifiers && (this.identifiers == null || !this.identifiers.equals(other.identifiers))) { |
| 660 | 0 | return false; |
| 661 | |
} |
| 662 | 0 | if (this.vendorEvidence != other.vendorEvidence && (this.vendorEvidence == null || !this.vendorEvidence.equals(other.vendorEvidence))) { |
| 663 | 0 | return false; |
| 664 | |
} |
| 665 | 0 | if (this.productEvidence != other.productEvidence && (this.productEvidence == null || !this.productEvidence.equals(other.productEvidence))) { |
| 666 | 0 | return false; |
| 667 | |
} |
| 668 | 0 | if (this.versionEvidence != other.versionEvidence && (this.versionEvidence == null || !this.versionEvidence.equals(other.versionEvidence))) { |
| 669 | 0 | return false; |
| 670 | |
} |
| 671 | 0 | if ((this.description == null) ? (other.description != null) : !this.description.equals(other.description)) { |
| 672 | 0 | return false; |
| 673 | |
} |
| 674 | 0 | if ((this.license == null) ? (other.license != null) : !this.license.equals(other.license)) { |
| 675 | 0 | return false; |
| 676 | |
} |
| 677 | 0 | if (this.vulnerabilities != other.vulnerabilities && (this.vulnerabilities == null || !this.vulnerabilities.equals(other.vulnerabilities))) { |
| 678 | 0 | return false; |
| 679 | |
} |
| 680 | 0 | if (this.relatedDependencies != other.relatedDependencies |
| 681 | |
&& (this.relatedDependencies == null || !this.relatedDependencies.equals(other.relatedDependencies))) { |
| 682 | 0 | return false; |
| 683 | |
} |
| 684 | 0 | return true; |
| 685 | |
} |
| 686 | |
|
| 687 | |
|
| 688 | |
|
| 689 | |
|
| 690 | |
|
| 691 | |
|
| 692 | |
@Override |
| 693 | |
public int hashCode() { |
| 694 | 28 | int hash = 3; |
| 695 | 28 | hash = 47 * hash + (this.actualFilePath != null ? this.actualFilePath.hashCode() : 0); |
| 696 | 28 | hash = 47 * hash + (this.filePath != null ? this.filePath.hashCode() : 0); |
| 697 | 28 | hash = 47 * hash + (this.fileName != null ? this.fileName.hashCode() : 0); |
| 698 | 28 | hash = 47 * hash + (this.fileExtension != null ? this.fileExtension.hashCode() : 0); |
| 699 | 28 | hash = 47 * hash + (this.md5sum != null ? this.md5sum.hashCode() : 0); |
| 700 | 28 | hash = 47 * hash + (this.sha1sum != null ? this.sha1sum.hashCode() : 0); |
| 701 | 28 | hash = 47 * hash + (this.identifiers != null ? this.identifiers.hashCode() : 0); |
| 702 | 28 | hash = 47 * hash + (this.vendorEvidence != null ? this.vendorEvidence.hashCode() : 0); |
| 703 | 28 | hash = 47 * hash + (this.productEvidence != null ? this.productEvidence.hashCode() : 0); |
| 704 | 28 | hash = 47 * hash + (this.versionEvidence != null ? this.versionEvidence.hashCode() : 0); |
| 705 | 28 | hash = 47 * hash + (this.description != null ? this.description.hashCode() : 0); |
| 706 | 28 | hash = 47 * hash + (this.license != null ? this.license.hashCode() : 0); |
| 707 | 28 | hash = 47 * hash + (this.vulnerabilities != null ? this.vulnerabilities.hashCode() : 0); |
| 708 | 28 | hash = 47 * hash + (this.relatedDependencies != null ? this.relatedDependencies.hashCode() : 0); |
| 709 | 28 | return hash; |
| 710 | |
} |
| 711 | |
|
| 712 | |
|
| 713 | |
|
| 714 | |
|
| 715 | |
|
| 716 | |
|
| 717 | |
@Override |
| 718 | |
public String toString() { |
| 719 | 0 | return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}"; |
| 720 | |
} |
| 721 | |
} |