Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: make private class final with default constructor #2407

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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