Skip to content

Commit c69679b

Browse files
author
Dennis Labordus
committed
Fixed sonar code smells.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 2a06d48 commit c69679b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

repository/src/main/java/org/lfenergy/compas/scl/data/model/ChangeSetType.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
import org.eclipse.microprofile.openapi.annotations.media.Schema;
88

9-
@Schema(description = "The type of change used to determine the next version value.\n" +
10-
"Major change updating the first digit, for example from 1.2.4 to 2.0.0.\n" +
11-
"Minor change updating the second digit, for example from 1.2.4 to 1.3.0.\n" +
12-
"Patch change updating the third digit, for example from 1.2.4 to 1.2.5.\n")
9+
@Schema(description = """
10+
The type of change used to determine the next version value.
11+
Major change updating the first digit, for example from 1.2.4 to 2.0.0.
12+
Minor change updating the second digit, for example from 1.2.4 to 1.3.0.
13+
Patch change updating the third digit, for example from 1.2.4 to 1.2.5.
14+
""")
1315
public enum ChangeSetType {
1416
MAJOR,
1517
MINOR,

repository/src/main/java/org/lfenergy/compas/scl/data/model/Version.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public int hashCode() {
8383
public boolean equals(final Object obj) {
8484
if (obj == this) return true;
8585
if (obj == null) return false;
86-
if (obj instanceof Version) {
87-
final Version other = (Version) obj;
86+
if (obj instanceof Version other) {
8887
return majorVersion == other.majorVersion
8988
&& minorVersion == other.minorVersion
9089
&& patchVersion == other.patchVersion;

repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public List<Element> getChildNodesByName(Element root, String localName) {
166166
if (childNodes.getLength() > 0) {
167167
for (int i = 0; i < childNodes.getLength(); i++) {
168168
Node node = childNodes.item(i);
169-
if (node instanceof Element && localName.equals(node.getLocalName())) {
170-
foundElements.add((Element) node);
169+
if (node instanceof Element element && localName.equals(element.getLocalName())) {
170+
foundElements.add(element);
171171
}
172172
}
173173
}

0 commit comments

Comments
 (0)