Skip to content

Commit

Permalink
minor: make private class final with default constructor (spotbugs#2407)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin222004 authored and NazirMuhammadZafarIqbal committed Apr 25, 2023
1 parent 2597e3d commit e23caa2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testWorked() {
verify(delegate).worked(2 + 4);
}

private static class Clock {
private static final class Clock {
private long currentTime;

protected long getCurrentTime() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,13 @@ public static void importResources(IContainer importTarget, Bundle bundle, Strin
}
}

private static class ImportOverwriteQuery implements IOverwriteQuery {
private static final class ImportOverwriteQuery implements IOverwriteQuery {
@Override
public String queryOverwrite(String file) {
return ALL;
}
}

private static class Requestor extends TypeNameRequestor {
private static final class Requestor extends TypeNameRequestor {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void startAnalysis(int numClasses) {
updateCount(0, numClasses);
}

private class AnalysisThread extends Thread {
private final class AnalysisThread extends Thread {
{
// Give the analysis thread its (possibly user-defined) priority.
// The default is a slightly lower priority than the UI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void initMethod(Method method) {
abstract public void sawOpcode(int seen);
}

private class InvalidMinMaxSubDetector extends SubDetector {
private final class InvalidMinMaxSubDetector extends SubDetector {
Number lowerBound, upperBound;

@Override
Expand Down Expand Up @@ -130,7 +130,7 @@ public void sawOpcode(int seen) {
}
}

private class NullMethodsSubDetector extends SubDetector {
private final class NullMethodsSubDetector extends SubDetector {

@Override
public void sawOpcode(int seen) {
Expand Down Expand Up @@ -201,7 +201,7 @@ public void sawOpcode(int seen) {
}
}

private class FutilePoolSizeSubDetector extends SubDetector {
private final class FutilePoolSizeSubDetector extends SubDetector {
@Override
public void sawOpcode(int seen) {
if (seen == Const.INVOKEVIRTUAL && "java/util/concurrent/ScheduledThreadPoolExecutor".equals(getClassConstantOperand())
Expand All @@ -213,7 +213,7 @@ public void sawOpcode(int seen) {
}
}

private class RangeCheckSubDetector extends SubDetector {
private final class RangeCheckSubDetector extends SubDetector {



Expand Down Expand Up @@ -373,7 +373,7 @@ public void sawOpcode(int seen) {
}
}

private class UrlCollectionSubDetector extends SubDetector {
private final class UrlCollectionSubDetector extends SubDetector {
@Override
public void sawOpcode(int seen) {
if ((seen == Const.INVOKEVIRTUAL && "java/util/HashMap".equals(getClassConstantOperand()) && "get".equals(getNameConstantOperand()))
Expand All @@ -391,7 +391,7 @@ public void sawOpcode(int seen) {
}
}

private class VacuousComparisonSubDetector extends SubDetector {
private final class VacuousComparisonSubDetector extends SubDetector {
@Override
public void sawOpcode(int seen) {
boolean foundVacuousComparison = false;
Expand Down Expand Up @@ -428,7 +428,7 @@ public void sawOpcode(int seen) {
}
}

private class BadCastInEqualsSubDetector extends SubDetector {
private final class BadCastInEqualsSubDetector extends SubDetector {
private boolean isEqualsObject;

private boolean sawInstanceofCheck;
Expand Down Expand Up @@ -482,7 +482,7 @@ public void sawOpcode(int seen) {
@SlashedClassName
private static final String CLASS_NAME_RANDOM = "java/util/Random";

private class RandomOnceSubDetector extends SubDetector {
private final class RandomOnceSubDetector extends SubDetector {
/**
* True if a freshly created {@code Random} instance exists on ToS (Top op Stack)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class PrettyPrintBugDescriptions extends PlainPrintBugDescriptions {

private static final String[] TABLE_COLORS = new String[] { "#eeeeee", "#ffffff" };

private static class BugPatternComparator implements Comparator<BugPattern>, Serializable {
private static final class BugPatternComparator implements Comparator<BugPattern>, Serializable {
@Override
public int compare(BugPattern a, BugPattern b) {
int cmp = a.getCategory().compareTo(b.getCategory());
Expand Down

0 comments on commit e23caa2

Please sign in to comment.