Skip to content

Commit 153eb65

Browse files
Fix SpotBugs UPM_UNCALLED_PRIVATE_METHOD warnings and enforce rule in quality report
Removed unused private methods across multiple files to resolve SpotBugs warnings. Updated .github/scripts/generate-quality-report.py to fail the build if UPM_UNCALLED_PRIVATE_METHOD violations occur.
1 parent adebe5d commit 153eb65

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

.github/scripts/generate-quality-report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ def main() -> None:
776776
"EQ_ALWAYS_FALSE",
777777
"SBSC_USE_STRINGBUFFER_CONCATENATION",
778778
"SIC_INNER_SHOULD_BE_STATIC",
779-
"EQ_DOESNT_OVERRIDE_EQUALS"
779+
"EQ_DOESNT_OVERRIDE_EQUALS",
780+
"UPM_UNCALLED_PRIVATE_METHOD",
780781
}
781782
violations = [
782783
f for f in spotbugs.findings

CodenameOne/src/com/codename1/ui/geom/GeneralPath.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,25 +3263,6 @@ public void next() {
32633263
typeIndex++;
32643264
}
32653265

3266-
private void transformSegmentInPlace() {
3267-
if (isDone()) {
3268-
// awt.4B=Iterator out of bounds
3269-
throw new IndexOutOfBoundsException("Path done"); //$NON-NLS-1$
3270-
}
3271-
if (transform == null) {
3272-
return;
3273-
}
3274-
int type = p.types[typeIndex];
3275-
int count = GeneralPath.pointShift[type];
3276-
for (int i = 0; i < count; i += 2) {
3277-
buf[0] = p.points[pointIndex + i];
3278-
buf[1] = p.points[pointIndex + i + 1];
3279-
transform.transformPoint(buf, buf);
3280-
p.points[pointIndex + i] = buf[0];
3281-
p.points[pointIndex + i + 1] = buf[1];
3282-
}
3283-
}
3284-
32853266
public int currentSegment(double[] coords) {
32863267
float[] fcoords = createFloatArrayFromPool(6);
32873268
try {

CodenameOne/src/com/codename1/ui/html/HTMLComponent.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -527,16 +527,6 @@ static int getInt(String intStr, int defaultValue) {
527527
}
528528
}
529529

530-
/**
531-
* A convenience method to convert a string to an int.
532-
* This is mainly intended to save the try-catch for NumericFormatExceptions
533-
*
534-
* @param intStr The string describing the integer
535-
* @return the integer value of the string, or 0 if the string is not numeric
536-
*/
537-
static int getInt(String intStr) {
538-
return getInt(intStr, 0);
539-
}
540530

541531
/**
542532
* Calculates width or height of an element according to its original size, requested size and default size

CodenameOne/src/com/codename1/ui/spinner/SpinnerNode.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ private double getRotationRangeForSide() {
190190
return 360.0 / numSides;
191191
}
192192

193-
private double getFlatVisibleHeight() {
194-
return renderer.getPreferredH() * numSides / 2;
195-
}
196-
197193
public int getSelectedIndex() {
198194
return (int) (flatScrollPos / calcFlatListHeight() * listModel.getSize());
199195
}

0 commit comments

Comments
 (0)