Skip to content

Commit 6d81ff0

Browse files
eclipse-equinox-botlaeubi
authored andcommitted
Perform clean code of bundles/org.eclipse.equinox.p2.updatesite
1 parent 4cc4cc5 commit 6d81ff0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/VersionSuffixGenerator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private static int getIntSegment(Version v, int segment) {
9696
return 0;
9797
}
9898
Object seg = v.getSegment(segment);
99-
return seg instanceof Integer ? ((Integer) seg).intValue() : 0;
99+
return seg instanceof Integer i ? i.intValue() : 0;
100100
}
101101

102102
private static int getMajor(Version v) {
@@ -117,7 +117,7 @@ private static String getQualifier(Version v) {
117117
return null;
118118
}
119119
Object seg = v.getSegment(segCount - 1);
120-
return seg instanceof String ? (String) seg : null;
120+
return seg instanceof String s ? s : null;
121121
}
122122

123123
// Encode a non-negative number as a variable length string, with the

0 commit comments

Comments
 (0)