checkstyle fixes

Former-commit-id: 6074262a482d3136e7a2b9e12c2b5448dd4d1426
This commit is contained in:
Jeremy Long
2013-05-10 06:03:00 -04:00
parent 0c100c1372
commit d7d6dd5a62
3 changed files with 7 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
/* /*
** This file is part of Dependency-Check. * This file is part of Dependency-Check.
* *
** Dependency-Check is free software: you can redistribute it and/or modify it * Dependency-Check is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free * under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any * Software Foundation, either version 3 of the License, or (at your option) any
* later version. * later version.

View File

@@ -161,19 +161,19 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal
* @return a string representing the base path. * @return a string representing the base path.
*/ */
private String getBaseRepoPath(final String path) { private String getBaseRepoPath(final String path) {
int pos = path.indexOf("repository") + 10; int pos = path.indexOf("repository" + File.separator) + 11;
if (pos<0) { if (pos < 0) {
return path; return path;
} }
int tmp = path.indexOf(File.separator, pos); int tmp = path.indexOf(File.separator, pos);
if (tmp<=0) { if (tmp <= 0) {
return path; return path;
} }
if (tmp>0) { if (tmp > 0) {
pos = tmp + 1; pos = tmp + 1;
} }
tmp = path.indexOf(File.separator, pos); tmp = path.indexOf(File.separator, pos);
if (tmp>0) { if (tmp > 0) {
pos = tmp + 1; pos = tmp + 1;
} }
return path.substring(0, pos); return path.substring(0, pos);

View File

@@ -376,9 +376,7 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
JarFile jar = null; JarFile jar = null;
try { try {
jar = new JarFile(dependency.getActualFilePath()); jar = new JarFile(dependency.getActualFilePath());
final java.util.Enumeration en = jar.entries(); final java.util.Enumeration en = jar.entries();
final HashMap<String, Integer> level0 = new HashMap<String, Integer>(); final HashMap<String, Integer> level0 = new HashMap<String, Integer>();
final HashMap<String, Integer> level1 = new HashMap<String, Integer>(); final HashMap<String, Integer> level1 = new HashMap<String, Integer>();
final HashMap<String, Integer> level2 = new HashMap<String, Integer>(); final HashMap<String, Integer> level2 = new HashMap<String, Integer>();
@@ -438,7 +436,6 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
} }
final EvidenceCollection vendor = dependency.getVendorEvidence(); final EvidenceCollection vendor = dependency.getVendorEvidence();
final EvidenceCollection product = dependency.getProductEvidence(); final EvidenceCollection product = dependency.getProductEvidence();
for (String s : level0.keySet()) { for (String s : level0.keySet()) {
if (!"org".equals(s) && !"com".equals(s)) { if (!"org".equals(s) && !"com".equals(s)) {
vendor.addWeighting(s); vendor.addWeighting(s);