Replace with foreach

This commit is contained in:
Hans Joachim Desserud
2015-09-13 17:04:46 +02:00
parent c7a763ffdc
commit 49b56588b8

View File

@@ -380,18 +380,16 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
*/ */
private void addFalseNegativeCPEs(Dependency dependency) { private void addFalseNegativeCPEs(Dependency dependency) {
//TODO move this to the hint analyzer //TODO move this to the hint analyzer
final Iterator<Identifier> itr = dependency.getIdentifiers().iterator(); for (final Identifier identifier : dependency.getIdentifiers()) {
while (itr.hasNext()) { if ("cpe".equals(identifier.getType()) && identifier.getValue() != null
final Identifier i = itr.next(); && (identifier.getValue().startsWith("cpe:/a:oracle:opensso:")
if ("cpe".equals(i.getType()) && i.getValue() != null || identifier.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:")
&& (i.getValue().startsWith("cpe:/a:oracle:opensso:") || identifier.getValue().startsWith("cpe:/a:sun:opensso_enterprise:")
|| i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:") || identifier.getValue().startsWith("cpe:/a:sun:opensso:"))) {
|| i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:") final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s", identifier.getValue().substring(22));
|| i.getValue().startsWith("cpe:/a:sun:opensso:"))) { final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s", identifier.getValue().substring(22));
final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s", i.getValue().substring(22)); final String newCpe3 = String.format("cpe:/a:sun:opensso:%s", identifier.getValue().substring(22));
final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s", i.getValue().substring(22)); final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s", identifier.getValue().substring(22));
final String newCpe3 = String.format("cpe:/a:sun:opensso:%s", i.getValue().substring(22));
final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s", i.getValue().substring(22));
try { try {
dependency.addIdentifier("cpe", dependency.addIdentifier("cpe",
newCpe, newCpe,