mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 17:41:28 +01:00
Replaced empty string equals check with an isEmpty check.
This commit is contained in:
@@ -147,7 +147,7 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
|
|
||||||
// First, see if there was an error
|
// First, see if there was an error
|
||||||
final String error = xpath.evaluate("/assembly/error", doc);
|
final String error = xpath.evaluate("/assembly/error", doc);
|
||||||
if (error != null && !"".equals(error)) {
|
if (error != null && !error.isEmpty()) {
|
||||||
throw new AnalysisException(error);
|
throw new AnalysisException(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
|
final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
|
||||||
final XPath xpath = XPathFactory.newInstance().newXPath();
|
final XPath xpath = XPathFactory.newInstance().newXPath();
|
||||||
final String error = xpath.evaluate("/assembly/error", doc);
|
final String error = xpath.evaluate("/assembly/error", doc);
|
||||||
if (p.waitFor() != 1 || error == null || "".equals(error)) {
|
if (p.waitFor() != 1 || error == null || error.isEmpty()) {
|
||||||
LOGGER.warn("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details.");
|
LOGGER.warn("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details.");
|
||||||
LOGGER.debug("GrokAssembly.exe is not working properly");
|
LOGGER.debug("GrokAssembly.exe is not working properly");
|
||||||
grokAssemblyExe = null;
|
grokAssemblyExe = null;
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ public class CPEAnalyzer implements Analyzer {
|
|||||||
|
|
||||||
final String cleanText = cleanseText(searchText);
|
final String cleanText = cleanseText(searchText);
|
||||||
|
|
||||||
if ("".equals(cleanText)) {
|
if (cleanText.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,10 +132,10 @@ public class NexusSearch {
|
|||||||
"/org.sonatype.nexus.rest.model.NexusArtifact/pomLink",
|
"/org.sonatype.nexus.rest.model.NexusArtifact/pomLink",
|
||||||
doc);
|
doc);
|
||||||
final MavenArtifact ma = new MavenArtifact(groupId, artifactId, version);
|
final MavenArtifact ma = new MavenArtifact(groupId, artifactId, version);
|
||||||
if (link != null && !"".equals(link)) {
|
if (link != null && !link.isEmpty()) {
|
||||||
ma.setArtifactUrl(link);
|
ma.setArtifactUrl(link);
|
||||||
}
|
}
|
||||||
if (pomLink != null && !"".equals(pomLink)) {
|
if (pomLink != null && !pomLink.isEmpty()) {
|
||||||
ma.setPomUrl(pomLink);
|
ma.setPomUrl(pomLink);
|
||||||
}
|
}
|
||||||
return ma;
|
return ma;
|
||||||
|
|||||||
Reference in New Issue
Block a user