Skip to content

Commit

Permalink
Clean Up: Add final modifier to private fields
Browse files Browse the repository at this point in the history
TextMergeViewer, EditionSelectionDialog manually excluded due to dead
code compilation error
  • Loading branch information
EcljpseB0T authored and jukzi committed Sep 14, 2023
1 parent f10a073 commit e92b727
Show file tree
Hide file tree
Showing 1,120 changed files with 2,310 additions and 2,308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
public class AntCorePreferences implements IPropertyChangeListener {

static class WrappedClassLoader extends ClassLoader {
private Bundle bundle;
private final Bundle bundle;

public WrappedClassLoader(Bundle bundle) {
super();
Expand Down Expand Up @@ -137,7 +137,7 @@ public String toString() {
}
}

private IPreferenceChangeListener prefListener = event -> {
private final IPreferenceChangeListener prefListener = event -> {
String property = event.getKey();
if (property.equals(IAntCoreConstants.PREFERENCE_TASKS) || property.startsWith(IAntCoreConstants.PREFIX_TASK)) {
restoreTasks();
Expand All @@ -156,9 +156,9 @@ public String toString() {
}
};

private List<Task> defaultTasks;
private List<Type> defaultTypes;
private List<AntClasspathEntry> extraClasspathURLs;
private final List<Task> defaultTasks;
private final List<Type> defaultTypes;
private final List<AntClasspathEntry> extraClasspathURLs;
private List<Property> defaultProperties;
private IAntClasspathEntry[] defaultAntHomeEntries;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class EclipseAntMain extends Main {

private Project fEclipseAntProject;
private final Project fEclipseAntProject;

public EclipseAntMain(Project eclipseAntProject) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public class AntDebugState {
private static final String fgAntTaskName = "ant"; //$NON-NLS-1$
private static final String fgAntCallTaskName = "antcall"; //$NON-NLS-1$

private IDebugBuildLogger fLogger;
private final IDebugBuildLogger fLogger;
@SuppressWarnings("unused")
private Stack<Task> fTasks = new Stack<Task>();
private final Stack<Task> fTasks = new Stack<Task>();
@SuppressWarnings("unused")
private Map<Task, Object> fTaskToProxies = new HashMap<Task, Object>();
private final Map<Task, Object> fTaskToProxies = new HashMap<Task, Object>();
private Task fCurrentTask;
private Task fStepOverTask;
private Task fStepIntoTask;
Expand All @@ -51,9 +51,9 @@ public class AntDebugState {
private Map<Project, Vector<?>> fProjectToTargetNames = null;
private Map<Project, Map<Target, Vector<Target>>> fProjectToMapOfTargetToBuildSequence = null;
@SuppressWarnings("unused")
private Stack<Target> fTargetsToExecute = new Stack<Target>();
private final Stack<Target> fTargetsToExecute = new Stack<Target>();
@SuppressWarnings("unused")
private Stack<Target> fTargetsExecuting = new Stack<Target>();
private final Stack<Target> fTargetsExecuting = new Stack<Target>();

private boolean fConsiderTargetBreakpoints = false;
private boolean fShouldSuspend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public class InternalAntRunner {
private String loggerClassname = null;

/** Extra arguments to be parsed as command line arguments. */
private String[] extraArguments = null;
private final String[] extraArguments = null;

private boolean scriptExecuted = false;

@SuppressWarnings("unused")
private List<String> propertyFiles = new ArrayList<String>();
private final List<String> propertyFiles = new ArrayList<String>();

/**
* The Ant InputHandler class. There may be only one input handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

public class RemoteAntBreakpoint {

private File fFile;
private int fLineNumber;
private String fFileName;
private final File fFile;
private final int fLineNumber;
private final String fFileName;

public RemoteAntBreakpoint(String breakpointRepresentation) {
String[] data = breakpointRepresentation.split(DebugMessageIds.MESSAGE_DELIMITER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class RemoteAntBuildLogger extends DefaultLogger {

/** Time of the start of the build */
private long fStartTime = System.currentTimeMillis();
private final long fStartTime = System.currentTimeMillis();

/**
* The client socket.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public class AntSourceContainer extends AbstractSourceContainer {

private IWorkspaceRoot fRoot;
private final IWorkspaceRoot fRoot;

public AntSourceContainer() {
fRoot = ResourcesPlugin.getWorkspace().getRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
public class AntDebugTarget extends AntDebugElement implements IDebugTarget, IDebugEventSetListener, IBreakpointManagerListener {

// associated system process (Ant Build)
private IProcess fProcess;
private final IProcess fProcess;

// containing launch object
private ILaunch fLaunch;
private final ILaunch fLaunch;

// Build file name
private String fName;
Expand All @@ -58,10 +58,10 @@ public class AntDebugTarget extends AntDebugElement implements IDebugTarget, IDe
private boolean fTerminated = false;

// threads
private AntThread fThread;
private final AntThread fThread;
private IThread[] fThreads;

private IAntDebugController fController;
private final IAntDebugController fController;

private List<IBreakpoint> fRunToLineBreakpoints;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class AntProperties extends AntDebugElement implements IVariable {

private IValue fValue;
private String fName;
private final String fName;
private boolean fValid = true;

public AntProperties(AntDebugTarget target, String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class AntPropertiesValue extends AntDebugElement implements IValue {

private List<AntProperty> fProperties = new ArrayList<>();
private final List<AntProperty> fProperties = new ArrayList<>();

public AntPropertiesValue(AntDebugTarget target) {
super(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
public class AntProperty extends AntDebugElement implements IVariable, Comparable<AntProperty> {

private String fName;
private AntValue fValue;
private final String fName;
private final AntValue fValue;
private String fLabel;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public class AntStackFrame extends AntDebugElement implements IStackFrame {

private AntThread fThread;
private final AntThread fThread;
private String fName;
private int fLineNumber;
private String fFilePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AntThread extends AntDebugElement implements IThread {
/**
* The stackframes associated with this thread
*/
private List<AntStackFrame> fFrames = new ArrayList<>(1);
private final List<AntStackFrame> fFrames = new ArrayList<>(1);

/**
* The stackframes to be reused on suspension
Expand Down Expand Up @@ -67,7 +67,7 @@ public class AntThread extends AntDebugElement implements IThread {
*/
private AntProperties fRuntimeProperties;

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

/**
* Constructs a new thread for the given target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class AntValue extends AntDebugElement implements IValue {

private String fValueString;
private final String fValueString;
protected static final IVariable[] EMPTY = new IVariable[0];

public AntValue(AntDebugTarget target, String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
public class AntStreamMonitor implements IFlushableStreamMonitor {

private StringBuffer fContents = new StringBuffer();
private ListenerList<IStreamListener> fListeners = new ListenerList<>(1);
private final StringBuffer fContents = new StringBuffer();
private final ListenerList<IStreamListener> fListeners = new ListenerList<>(1);
private boolean fBuffered = true;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
*/
public class AntStreamsProxy implements IStreamsProxy {

private AntStreamMonitor fErrorMonitor = new AntStreamMonitor();
private AntStreamMonitor fOutputMonitor = new AntStreamMonitor();
private final AntStreamMonitor fErrorMonitor = new AntStreamMonitor();
private final AntStreamMonitor fOutputMonitor = new AntStreamMonitor();

public static final String ANT_DEBUG_STREAM = AntLaunching.PLUGIN_ID + ".ANT_DEBUG_STREAM"; //$NON-NLS-1$
public static final String ANT_VERBOSE_STREAM = AntLaunching.PLUGIN_ID + ".ANT_VERBOSE_STREAM"; //$NON-NLS-1$
public static final String ANT_WARNING_STREAM = AntLaunching.PLUGIN_ID + ".ANT_WARNING_STREAM"; //$NON-NLS-1$

private AntStreamMonitor fDebugMonitor = new AntStreamMonitor();
private AntStreamMonitor fVerboseMonitor = new AntStreamMonitor();
private AntStreamMonitor fWarningMonitor = new AntStreamMonitor();
private final AntStreamMonitor fDebugMonitor = new AntStreamMonitor();
private final AntStreamMonitor fVerboseMonitor = new AntStreamMonitor();
private final AntStreamMonitor fWarningMonitor = new AntStreamMonitor();

@Override
public IStreamMonitor getErrorStreamMonitor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public void handleException(Throwable exception) {
*
* @since 3.7
*/
private String fEncoding;
private final String fEncoding;

/**
* Reads the message stream from the RemoteAntBuildLogger
*/
private class ServerConnection extends Thread {
private int fServerPort;
private final int fServerPort;

public ServerConnection(int port) {
super("Ant Build Server Connection"); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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 @@ -21,7 +21,7 @@

public class TestLocationProvider extends LocationProvider {

private File buildFile;
private final File buildFile;

public TestLocationProvider(File buildFile) {
super(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public ISchema parseDTD(Reader reader, String root) throws ParseError, IOExcepti
}

private static class DTDReader extends Reader {
private Reader fDelegate;
private final Reader fDelegate;

public DTDReader(String pub, String sys, String root) {
String document = "<!DOCTYPE " + root + " PUBLIC '" + pub + "' '" + sys + "'><" + root + "/>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
Expand All @@ -196,7 +196,7 @@ public int read(char[] cbuf, int off, int len) throws IOException {
}

private static class DTDEntityResolver implements EntityResolver {
private Reader reader;
private final Reader reader;

public DTDEntityResolver(Reader reader) {
this.reader = reader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class Attribute extends Atom implements IAttribute {
private String fType;
private String[] fEnum;
private IElement fElement;
private final IElement fElement;
private String fDefault;
private boolean fFixed;
private boolean fRequired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Element extends Atom implements IElement {
private boolean fUndefined = true;
private boolean fText;
private IModel fModel;
private Map<String, IAttribute> fMap = new HashMap<>(4);
private final Map<String, IAttribute> fMap = new HashMap<>(4);
private Dfm fElementDfm;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author Bob Foster
*/
public class Schema implements ISchema {
private HashMap<String, IElement> fElementMap = new HashMap<>();
private final HashMap<String, IElement> fElementMap = new HashMap<>();
private Exception fErrorException;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SchemaFactory implements DeclHandler {
private int fPos;
private Element fElement;

private Schema fSchema;
private final Schema fSchema;
private static HashSet<String> fTypes = new HashSet<>();
private Exception fErrorException;
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class SortedMap implements FactoryObject {

private SortedSet fSet;
private final SortedSet fSet;
private IMapHolder fHolder;
private SortedMap fNext;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class AntAutoEditStrategy extends DefaultIndentLineAutoEditStrategy {

private AntModel fModel;
private final AntModel fModel;
private int fAccumulatedChange = 0;

public AntAutoEditStrategy(AntModel model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ public class AntCompletionProposal implements ICompletionProposal, ICompletionPr
public static final int PROPERTY_PROPOSAL = 2;

/** The string to be displayed in the completion proposal popup */
private String fDisplayString;
private final String fDisplayString;
/** The replacement string */
private String fReplacementString;
private final String fReplacementString;
/** The replacement offset */
private int fReplacementOffset;
private final int fReplacementOffset;
/** The replacement length */
private int fReplacementLength;
/** The cursor position after this proposal has been applied */
private int fCursorPosition;
private final int fCursorPosition;
/** The image to be displayed in the completion proposal popup */
private Image fImage;
private final Image fImage;
/** The additional info of this proposal */
private String fAdditionalProposalInfo;
private final String fAdditionalProposalInfo;

private int fType;
private final int fType;

/**
* Creates a new Ant completion proposal. All fields are initialized based on the provided information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ public void doOperation(int operation) {
*/
class OccurrencesFinderJob extends Job {

private IDocument fDocument;
private ISelection fSelection;
private final IDocument fDocument;
private final ISelection fSelection;
private ISelectionValidator fPostSelectionValidator;
private boolean fCanceled = false;
private IProgressMonitor fProgressMonitor;
private List<Position> fPositions;
private final List<Position> fPositions;

public OccurrencesFinderJob(IDocument document, List<Position> positions, ISelection selection) {
super("Occurrences Marker"); //$NON-NLS-1$
Expand Down
Loading

0 comments on commit e92b727

Please sign in to comment.