Skip to content

Commit 80e5629

Browse files
Fix quality flaws (#268)
1 parent 6675564 commit 80e5629

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sonar-xml-plugin/src/main/java/org/sonar/plugins/xml/checks/XPathCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public String getNamespaceForPrefix(String prefix) {
189189

190190
@CheckForNull
191191
public String getNamespaceForPrefix(String prefix, Node namespaceContext) {
192-
if (prefix.equals("xml")) {
192+
if ("xml".equals(prefix)) {
193193
return "http://www.w3.org/XML/1998/namespace";
194194
}
195195

sonar-xml-plugin/src/main/java/org/sonar/plugins/xml/checks/security/HardcodedCredentialsCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private static boolean isCredentialNode(Node node, Set<String> credentialWords)
122122
return false;
123123
}
124124
return credentialWords.contains(localName.toLowerCase(Locale.ROOT)) &&
125-
!node.getNodeName().equalsIgnoreCase("android:password");
125+
!"android:password".equalsIgnoreCase(node.getNodeName());
126126
}
127127

128128
private void checkCredential(Node node, String candidate) {

sonar-xml-plugin/src/test/java/org/sonar/plugins/xml/XmlSensorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void testPerformance() throws Exception {
112112
fs.add(createInputFile(Paths.get(bigXmlFile.getParent()), bigXmlFile.getName(), StandardCharsets.UTF_8));
113113
long timeBigFile = measureTimeToAnalyzeFile();
114114

115-
assertThat(timeBigFile < (2.5 * timeSmallFile)).isTrue();
115+
assertThat(timeBigFile).isLessThan((long) Math.floor(2.5 * timeSmallFile));
116116
}
117117

118118
@Test

0 commit comments

Comments
 (0)