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 12, 2023
1 parent d880fec commit 003bbfc
Show file tree
Hide file tree
Showing 572 changed files with 1,080 additions and 1,080 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public class ApiTestingEnvironment extends TestingEnvironment {
* Modified files for each build so that we can undo the changes
* incrementally rather than recreating the workspace for each test.
*/
private List<IPath> fAdded = new ArrayList<>();
private List<IPath> fChanged = new ArrayList<>();
private List<IPath> fRemoved = new ArrayList<>();
private final List<IPath> fAdded = new ArrayList<>();
private final List<IPath> fChanged = new ArrayList<>();
private final List<IPath> fRemoved = new ArrayList<>();

public ApiTestingEnvironment() throws Exception {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class UnusedApiProblemFilterTests extends UsageTest {
private static final String BEFORE = "before"; //$NON-NLS-1$
private static final String AFTER = "after"; //$NON-NLS-1$

private IPath fRootPath = super.getTestSourcePath().append("filters"); //$NON-NLS-1$
private IPath fFiltersPath = IPath.fromOSString("/usagetests/.settings/.api_filters"); //$NON-NLS-1$
private final IPath fRootPath = super.getTestSourcePath().append("filters"); //$NON-NLS-1$
private final IPath fFiltersPath = IPath.fromOSString("/usagetests/.settings/.api_filters"); //$NON-NLS-1$

public UnusedApiProblemFilterTests(String name) {
super(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/
public class ApiDescriptionTests {

private IApiDescription fManifest = buildManifest();
private final IApiDescription fManifest = buildManifest();

/**
* Wraps an element with its API description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ private void updateTag(BodyDeclaration body) {
}
}

private IPath SRC_LOC = TestSuiteHelper.getPluginDirectoryPath().append("test-source").append("a").append("b").append("c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private IPath PLUGIN_LOC = TestSuiteHelper.getPluginDirectoryPath().append("test-plugins"); //$NON-NLS-1$
private IApiBaselineManager fPMmanager = ApiPlugin.getDefault().getApiBaselineManager();
private final IPath SRC_LOC = TestSuiteHelper.getPluginDirectoryPath().append("test-source").append("a").append("b").append("c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private final IPath PLUGIN_LOC = TestSuiteHelper.getPluginDirectoryPath().append("test-plugins"); //$NON-NLS-1$
private final IApiBaselineManager fPMmanager = ApiPlugin.getDefault().getApiBaselineManager();
private final String TESTING_PACKAGE = "a.b.c"; //$NON-NLS-1$

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class HeadlessApiBaselineManagerTests extends AbstractApiTest {

private ApiBaselineManager fManager = ApiBaselineManager.getManager();
private final ApiBaselineManager fManager = ApiBaselineManager.getManager();

@Override
@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static IStatus newErrorStatus(String message, Throwable exception) {
return Status.error(message, exception);
}

private ISessionListener sessionListener = new ISessionListener() {
private final ISessionListener sessionListener = new ISessionListener() {
@Override
public void sessionAdded(ISession addedSession) {
Display.getDefault().asyncExec(() -> showAPIToolingView());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CompositeApiImageDescriptor extends CompositeImageDescriptor {
public static final int WARNING = 0x0002;

private Image fOriginalImage = null;
private int fFlags;
private final int fFlags;
private Point fSize;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public class CollapseAllAction extends Action {

private TreeViewer fViewer;
private final TreeViewer fViewer;

public CollapseAllAction(TreeViewer viewer) {
setText(ActionMessages.CollapseAllAction_label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public class ExpandAllAction extends Action {

private TreeViewer fViewer;
private final TreeViewer fViewer;

public ExpandAllAction(TreeViewer viewer) {
setText(ActionMessages.ExpandAllAction_label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public class ExportDialog extends Dialog {
/**
* The title of the dialog.
*/
private String title;
private final String title;

/**
* The message to display, or <code>null</code> if none.
*/
private String message;
private final String message;

/**
* The input value; the empty string by default.
Expand All @@ -68,7 +68,7 @@ public class ExportDialog extends Dialog {
/**
* The input validator, or <code>null</code> if none.
*/
private IInputValidator validator;
private final IInputValidator validator;

/**
* Ok button widget.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
*/
public class NavigateAction extends Action {
private final boolean next;
private IViewSite site;
private TreeViewer viewer;
private final IViewSite site;
private final TreeViewer viewer;

public NavigateAction(APIToolingView view, boolean next) {
this.site = view.getViewSite();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Navigation in the tree viewer.
*/
class TreeViewerNavigator {
private TreeViewer fViewer;
private final TreeViewer fViewer;

public TreeViewerNavigator(TreeViewer viewer) {
fViewer = viewer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ApiMarkerResolutionGenerator implements IMarkerResolutionGenerator2
*/
private final IMarkerResolution[] NO_RESOLUTIONS = new IMarkerResolution[0];

private DefaultApiProfileResolution profileResolution = new DefaultApiProfileResolution();
private final DefaultApiProfileResolution profileResolution = new DefaultApiProfileResolution();

@Override
public IMarkerResolution[] getResolutions(IMarker marker) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class NodeFinder extends ASTVisitor {

private BodyDeclaration declaration;
private int position;
private final int position;

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PDEConfigureProblemSeverityAction extends Action {

private final String fOptionId;

private int tab;
private final int tab;


public PDEConfigureProblemSeverityAction(IJavaProject project, String optionId, int t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@

public class UpdateSinceTagOperation {

private IMarker fMarker;
private final IMarker fMarker;
private IMarker[] otherIMarkers;
private int sinceTagType;
private String sinceTagVersion;
private final int sinceTagType;
private final String sinceTagVersion;

public UpdateSinceTagOperation(IMarker marker, IMarker[] otherMarkers, int sinceTagType, String sinceTagVersion) {
this.fMarker = marker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class VersionNumberingResolution implements IMarkerResolution2 {
String newVersionValue;
// major or minor version
private int kind;
private final int kind;
private String description;

public VersionNumberingResolution(IMarker marker) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ApiBaselinesConfigurationBlock extends ConfigurationBlock {
*/
protected static class ControlData {
Key key;
private String[] values;
private final String[] values;

/**
* Constructor
Expand Down Expand Up @@ -110,8 +110,8 @@ public int getSelection(String value) {
*/
protected static class Key {

private String qualifier;
private String key;
private final String qualifier;
private final String key;

/**
* Constructor
Expand Down Expand Up @@ -237,7 +237,7 @@ protected final static Key getApiToolsKey(String key) {
/**
* Default selection listener for controls on the page
*/
private SelectionListener selectionlistener = new SelectionAdapter() {
private final SelectionListener selectionlistener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof Combo) {
Expand All @@ -254,11 +254,11 @@ public void widgetSelected(SelectionEvent e) {
* Listing of all of the {@link Combo}s added to the block
*/

private ArrayList<Combo> fCombos = new ArrayList<>();
private final ArrayList<Combo> fCombos = new ArrayList<>();
/**
* Listing of the label in the block
*/
private ArrayList<Label> fLabels = new ArrayList<>();
private final ArrayList<Label> fLabels = new ArrayList<>();

/**
* The context of settings locations to search for values in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public class ApiErrorsWarningsConfigurationBlock extends ConfigurationBlock {
* Provides data information for created controls
*/
protected static class ControlData {
private Key key;
private String[] values;
private final Key key;
private final String[] values;

/**
* Constructor
Expand Down Expand Up @@ -136,8 +136,8 @@ public int getSelection(String value) {
*/
public static class Key {

private String qualifier;
private String key;
private final String qualifier;
private final String key;

/**
* Constructor
Expand Down Expand Up @@ -596,7 +596,7 @@ protected final static Key getApiToolsKey(String key) {
/**
* Default selection listener for controls on the page
*/
private SelectionListener selectionlistener = new SelectionAdapter() {
private final SelectionListener selectionlistener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Widget widget = e.widget;
Expand Down Expand Up @@ -695,22 +695,22 @@ public void widgetSelected(SelectionEvent e) {
/**
* Listing of all of the {@link ExpandableComposite}s in the block
*/
private ArrayList<ExpandableComposite> fExpComps = new ArrayList<>();
private final ArrayList<ExpandableComposite> fExpComps = new ArrayList<>();

/**
* Listing of all of the {@link Combo}s added to the block
*/
private ArrayList<Combo> fCombos = new ArrayList<>();
private final ArrayList<Combo> fCombos = new ArrayList<>();

/**
* Map of combo and label
*/
private HashMap<Combo, Label> fComboLabelMap = new HashMap<>();
private final HashMap<Combo, Label> fComboLabelMap = new HashMap<>();

/**
* Listing of all of the {@link Button} with SWT.check added to the block
*/
private ArrayList<Button> fCheckBoxes = new ArrayList<>();
private final ArrayList<Button> fCheckBoxes = new ArrayList<>();

/**
* Control used inside the system library ee group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ApiUseScanConfigurationBlock {
*/
protected static class ControlData {
Key key;
private String[] values;
private final String[] values;

/**
* Constructor
Expand Down Expand Up @@ -92,8 +92,8 @@ public int getSelection(String value) {
*/
protected static class Key {

private String qualifier;
private String key;
private final String qualifier;
private final String key;

/**
* Constructor
Expand Down Expand Up @@ -222,7 +222,7 @@ protected final static Key getApiToolsKey(String key) {
/**
* Default selection listener for controls on the page
*/
private SelectionListener selectionlistener = new SelectionAdapter() {
private final SelectionListener selectionlistener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof Combo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class CreateFileChange extends ResourceChange {
private String fSource;
private String fEncoding;
private boolean fExplicitEncoding;
private long fStampToRestore;
private final long fStampToRestore;

public CreateFileChange(IPath path, String source, String encoding) {
this(path, source, encoding, IResource.NULL_STAMP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DescriptionPatternPage extends UsePatternPage {

static final String PAGE_NAME = "description"; //$NON-NLS-1$

private int kind = -1;
private final int kind = -1;
private Button kbutton = null;
private Text patterntext = null;
private String pattern = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static boolean isApplicable(IApiBaseline profile) {
* from which to read plug-ins.
*/
class ReloadOperation implements IRunnableWithProgress {
private String location, name;
private final String location, name;

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class JavadocConversionRefactoring extends Refactoring {
/**
* The projects to check
*/
private HashSet<IProject> projects = new HashSet<>();
private final HashSet<IProject> projects = new HashSet<>();

/**
* Whether to remove the existing javadoc tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public static boolean isApplicable(IApiBaseline profile) {
* definition from which to read plug-ins.
*/
class ReloadTargetOperation implements IRunnableWithProgress {
private ITargetDefinition definition;
private String name;
private final ITargetDefinition definition;
private final String name;

/**
* Constructor
Expand Down Expand Up @@ -153,7 +153,7 @@ public void dispose() {
* Initial collection of targets (handles are realized into definitions as
* working copies)
*/
private List<ITargetDefinition> fTargets = new ArrayList<>();
private final List<ITargetDefinition> fTargets = new ArrayList<>();

private ITargetDefinition selectedTargetDefinition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ApiAnnotations implements IApiAnnotations {
public static final int RESTRICTIONS_MASK = 0x01F0;
public static final int OFFSET_VISIBILITY = 0;
public static final int OFFSET_RESTRICTIONS = 4;
private int bits;
private final int bits;
boolean isExact;

public ApiAnnotations(int visibility, int restrictions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public final class ApiDescriptionManager implements ISaveParticipant {
/**
* Maps Java projects to API descriptions
*/
private Map<IJavaProject, IApiDescription> fDescriptions = new HashMap<>();
private final Map<IJavaProject, IApiDescription> fDescriptions = new HashMap<>();

/**
* Path to the local directory where API descriptions are cached per
Expand Down
Loading

0 comments on commit 003bbfc

Please sign in to comment.