Skip to content

Commit

Permalink
Clean Up: Add final modifier to private fields
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T committed Sep 11, 2023
1 parent 66e4636 commit 2758d22
Show file tree
Hide file tree
Showing 238 changed files with 507 additions and 507 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
*/

public class EventReader extends AbstractReader {
private EventQueue fEventQueue;
private Vector<EventListener> fEventListeners = new Vector<>(); // A Vector of EventListener
private final EventQueue fEventQueue;
private final Vector<EventListener> fEventListeners = new Vector<>(); // A Vector of EventListener

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class EventRequestTest extends AbstractJDITest {

private List<EventRequest> fRequests = new LinkedList<>();
private final List<EventRequest> fRequests = new LinkedList<>();
/**
* Creates a new test.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Tests for JDI com.sun.jdi.event.Event.
*/
public class EventTest extends AbstractJDITest {
private HashMap<EventRequest, Event> fAllEvents = new HashMap<>();
private final HashMap<EventRequest, Event> fAllEvents = new HashMap<>();
/**
* Creates a new test.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Tests continuous reading from a file and input stream
*/
public class FileConsoleReader extends AbstractReader {
private InputStream fInput;
private final InputStream fInput;
private FileOutputStream fFileOutputStream;
/**
* Creates a new console reader that will read from the given input stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* starting and shutting down the VM after each test.
*/
public class JDITestCase extends TestCase {
private AbstractJDITest fTest;
private final AbstractJDITest fTest;
/**
* Creates a new test for the given JDI test.
* @param test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* tearDown method once after.
*/
public class JDITestSuite extends TestSuite {
private AbstractJDITest fTest;
private final AbstractJDITest fTest;
/**
* Creates a new test suite for the given JDI test.
* @param test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
*/
public class LocatableTest extends AbstractJDITest {

private List<Mirror> fLocatables = new LinkedList<>();
private List<EventRequest> fRequests = new LinkedList<>();
private final List<Mirror> fLocatables = new LinkedList<>();
private final List<EventRequest> fRequests = new LinkedList<>();
/**
* Creates a new test.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

public class NullConsoleReader extends AbstractReader {
private InputStream fInput;
private final InputStream fInput;
/**
* Constructor
* @param name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
*/
public class ReferenceTypeTest extends AbstractJDITest {

private List<ReferenceType> fTypes = new LinkedList<>();
private final List<ReferenceType> fTypes = new LinkedList<>();

// These must match what is done in localSetUp
private boolean[] fSystemClassLoader = { true, true, false, false };
private boolean[] fHasMethods = { true, false, true, true };
private boolean[] fIsAbstract = { false, false, false, true };
private boolean[] fIsFinal = { false, true, false, false };
private boolean[] fIsStatic = { false, false, false, false };
private String[] fTypeName =
private final boolean[] fSystemClassLoader = { true, true, false, false };
private final boolean[] fHasMethods = { true, false, true, true };
private final boolean[] fIsAbstract = { false, false, false, true };
private final boolean[] fIsFinal = { false, true, false, false };
private final boolean[] fIsStatic = { false, false, false, false };
private final String[] fTypeName =
{
"java.lang.Object",
"java.lang.String[]",
"org.eclipse.debug.jdi.tests.program.MainClass",
"org.eclipse.debug.jdi.tests.program.Printable" };
private int fObjectIndex = 0;
private int fMainClassIndex = 2;
private final int fObjectIndex = 0;
private final int fMainClassIndex = 2;

/**
* Creates a new test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class MainClass extends Date implements Runnable, Printable {
private static boolean[] booleanArray = new boolean[0];
private static boolean[][] booleanDoubleArray = new boolean[0][0];

private String string = "";
private String[] stringArray = new String[0];
private String[][] stringDoubleArray = new String[0][0];
private final String string = "";
private final String[] stringArray = new String[0];
private final String[][] stringDoubleArray = new String[0][0];

/**
* An integer value
Expand Down Expand Up @@ -98,9 +98,9 @@ public class MainClass extends Date implements Runnable, Printable {
*/
public boolean fBool = false;

private char fChar = 'a';
private final char fChar = 'a';

private String fString2 = "Hello";
private final String fString2 = "Hello";

protected final String fString3 = "HEY";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public class TableDetailPane implements IDetailPane, IValueDetailListener {
*/
class DetailJob implements Runnable{

private IValue fValue;
private IValueDetailListener fListener;
private final IValue fValue;
private final IValueDetailListener fListener;

public DetailJob(IValue value, IValueDetailListener listener){
fValue = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
*/
public class StepFilterTests extends AbstractDebugTest {

private String fOriginalActiveFilters;
private String fOriginalInactiveFilters;
private final String fOriginalActiveFilters;
private final String fOriginalInactiveFilters;

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
*/
public class StepIntoSelectionWithGenerics extends AbstractDebugTest {

private String qtypename = "a.b.c.StepIntoSelectionWithGenerics";
private String pname = "a.b.c";
private String jname = "StepIntoSelectionWithGenerics.java";
private String mname = "hello";
private final String qtypename = "a.b.c.StepIntoSelectionWithGenerics";
private final String pname = "a.b.c";
private final String jname = "StepIntoSelectionWithGenerics.java";
private final String mname = "hello";

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
public class BreakpointFieldLocator extends ASTVisitor {

private int fPosition;
private final int fPosition;

private String fTypeName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class BreakpointMethodLocator extends ASTVisitor {

private int fPosition;
private final int fPosition;

private String fTypeName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public RunToLineTests(String name) {
super(name);
}

private Object fLock = new Object();
private final Object fLock = new Object();
private IEditorPart fEditor = null;

class MyListener implements IPerspectiveListener2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import org.eclipse.debug.core.model.ISourceLocator;

public class MockLaunch implements ILaunch {
private ConcurrentLinkedDeque<IProcess> processes = new ConcurrentLinkedDeque<>();
private ConcurrentLinkedDeque<IDebugTarget> targets = new ConcurrentLinkedDeque<>();
private final ConcurrentLinkedDeque<IProcess> processes = new ConcurrentLinkedDeque<>();
private final ConcurrentLinkedDeque<IDebugTarget> targets = new ConcurrentLinkedDeque<>();
private ISourceLocator sourceLocator;
private Map<String, String> attributes = new HashMap<>();
private final Map<String, String> attributes = new HashMap<>();

@Override
public boolean canTerminate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public MultipleConnectionsTest(String name) {
super(name);
}

private ILaunch launch = new MockLaunch();
private final ILaunch launch = new MockLaunch();

private SocketListenConnector connector;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
public class ArgumentTests extends AbstractDebugTest {

private Object fLock = new Object();
private final Object fLock = new Object();
protected boolean fUseArgfile = false;

private class ConsoleArgumentOutputRetriever implements IConsoleLineTrackerExtension {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private List<IBreakpoint> getUserBreakpoints(JDIDebugTarget target) {

static private class JDIDebugTargetProxy {

private JDIDebugTarget target;
private final JDIDebugTarget target;

public JDIDebugTargetProxy(JDIDebugTarget target) {
this.target = target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class LaunchConfigurationManagerTests extends AbstractDebugTest {

private LaunchConfigurationManager fLCM = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
private final LaunchConfigurationManager fLCM = DebugUIPlugin.getDefault().getLaunchConfigurationManager();

public LaunchConfigurationManagerTests(String name) {
super(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Tests performance of conditional breakpoints.
*/
public class PerfConditionalBreakpointsTests extends AbstractDebugPerformanceTest {
private String fTypeName = "PerfLoop";
private final String fTypeName = "PerfLoop";

private int fHitCount = 0;

Expand All @@ -39,9 +39,9 @@ public class PerfConditionalBreakpointsTests extends AbstractDebugPerformanceTes

private boolean fWarmUpComplete = false;

private int fWarmUpRuns = 2;
private final int fWarmUpRuns = 2;

private int fMeasuredRuns = 10;
private final int fMeasuredRuns = 10;

private class BreakpointListener implements IDebugEventSetListener {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public PerfSteppingTests(String name) {
class MyFilter implements IDebugEventFilter {

private IJavaThread fThread = null;
private Object fLock;
private DebugEvent[] EMPTY = new DebugEvent[0];
private final Object fLock;
private final DebugEvent[] EMPTY = new DebugEvent[0];

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public class PerfVariableDetailTests extends AbstractDebugPerformanceTest implements IValueDetailListener {

private Object fLock = new Object();
private final Object fLock = new Object();

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class Accessor {

/** The class to access. */
private Class<?> fClass;
private final Class<?> fClass;
/** The instance to access. */
private Object fInstance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
*/
public class InstructionPointerManagerTests extends AbstractDebugTest {

private Object fLock = new Object();
private final Object fLock = new Object();
private Annotation fAddedAnnotation = null;
private Annotation fRemovedAnnotation = null;

private MyPerspectiveListener fPerspectiveListener;
private MyAnnotationListener fAnnotationListener;
private IPartListener2 fPartListener;
private Set<IAnnotationModel> fAnnotationModelsWithListeners = new HashSet<>();
private final Set<IAnnotationModel> fAnnotationModelsWithListeners = new HashSet<>();

private static final String typeThreadStack = "org.eclipse.debug.tests.targets.ThreadStack";
private static final String typeClassOne = "org.eclipse.debug.tests.targets.ClassOne";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class OpenFromClipboardTests {

private IPackageFragmentRoot fSourceFolder;

private Accessor fAccessor = new Accessor(OpenFromClipboardAction.class);
private final Accessor fAccessor = new Accessor(OpenFromClipboardAction.class);

public static IJavaProject fJProject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public static Test suite() {
*/
public static final String VIEW_ONE = "org.eclipse.jdt.debug.tests.context.view.one";

private Object fEventLock = new Object();
private final Object fEventLock = new Object();

/**
* List of view ids expecting to open.
*/
private List<String> fExpectingOpenEvents = new ArrayList<>();
private final List<String> fExpectingOpenEvents = new ArrayList<>();

/**
* List of view ids expecting to close.
*/
private List<String> fExpectingCloseEvents = new ArrayList<>();
private final List<String> fExpectingCloseEvents = new ArrayList<>();

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class ModelPresentationTests extends AbstractDebugTest {

private Map<String, Color> colors = new HashMap<>();
private final Map<String, Color> colors = new HashMap<>();
/**
* Constructor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class TestIJavaVariable implements IJavaVariable {

private String name;
private final String name;
private IValue value;

public TestIJavaVariable(String name, IValue value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.eclipse.debug.core.model.IWatchExpression;

public class TestIWatchExpression implements IWatchExpression {
private IValue value;
private String expressionText;
private final IValue value;
private final String expressionText;

public TestIWatchExpression(String expressionText, IValue value) {
this.expressionText = expressionText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public TestIntegerAccessUnboxing15(String name) {

class Listener implements IEvaluationListener {

private Object lock = new Object();
private final Object lock = new Object();
private IEvaluationResult endresult;

/* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
@Deprecated
public class JavaSourceLookupDialog extends Dialog {

private SourceLookupBlock fSourceLookupBlock;
private final SourceLookupBlock fSourceLookupBlock;
private ILaunchConfiguration fConfiguration;
private String fMessage;
private final String fMessage;
private boolean fNotAskAgain;
private Button fAskAgainCheckBox;

Expand Down
Loading

0 comments on commit 2758d22

Please sign in to comment.