Skip to content

Commit

Permalink
Merge branch 'stefanneuhaus-misc_performance_tweaking_and_cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylong committed Mar 4, 2017
2 parents 295ba06 + d588092 commit 5ed5764
Show file tree
Hide file tree
Showing 14 changed files with 259 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import java.util.zip.ZipEntry;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.owasp.dependencycheck.Engine;
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
Expand Down Expand Up @@ -1150,7 +1151,7 @@ protected static class ClassNameInformation {
ClassNameInformation(String className) {
name = className;
if (name.contains("/")) {
final String[] tmp = className.toLowerCase().split("/");
final String[] tmp = StringUtils.split(className.toLowerCase(), '/');
int start = 0;
int end = 3;
if ("com".equals(tmp[0]) || "org".equals(tmp[0])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.apache.commons.lang3.StringUtils;

/**
* A CPE entry containing the name, vendor, product, and version.
Expand Down Expand Up @@ -143,7 +144,8 @@ public void setSearchScore(float searchScore) {
*/
public void parseName(String cpeName) throws UnsupportedEncodingException {
if (cpeName != null && cpeName.length() > 7) {
final String[] data = cpeName.substring(7).split(":");
final String cpeNameWithoutPrefix = cpeName.substring(7);
final String[] data = StringUtils.split(cpeNameWithoutPrefix, ':');
if (data.length >= 1) {
vendor = URLDecoder.decode(data[0].replace("+", "%2B"), "UTF-8");
if (data.length >= 2) {
Expand Down
Loading

0 comments on commit 5ed5764

Please sign in to comment.