diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000000..46f3230490a
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,13 @@
+name: CodeQL call
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+ schedule:
+ - cron: '15 8 * * 1'
+
+jobs:
+ callCodeQLworkflow:
+ uses: eclipse-platform/eclipse.platform.releng.aggregator/.github/workflows/codeQLworkflow.yml@master
diff --git a/.github/workflows/verifyFreezePeriod.yml b/.github/workflows/verifyFreezePeriod.yml
deleted file mode 100644
index fed6cc53c54..00000000000
--- a/.github/workflows/verifyFreezePeriod.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# This workflow calls the Code-Freeze-Period check
-
-name: Check Code Freeze Period
-
-on:
- pull_request:
- branches:
- - 'master'
-
-jobs:
- check-freeze-period:
- uses: eclipse-platform/eclipse.platform.releng.aggregator/.github/workflows/verifyFreezePeriod.yml@master
diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml
index 8dd4ff06375..1372e21cbfb 100644
--- a/.mvn/extensions.xml
+++ b/.mvn/extensions.xml
@@ -4,6 +4,6 @@
org.eclipse.tychotycho-build
- 4.0.0
+ 4.0.3
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
index 15bfb61fe69..d5b058cadf2 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,7 +17,7 @@ pipeline {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh """
mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \
- -Pbree-libs -Papi-check \
+ -Pbree-libs -Papi-check -Pjavadoc \
-Dcompare-version-with-baselines.skip=false \
-Dmaven.compiler.failOnWarning=true -Dproject.build.sourceEncoding=UTF-8 \
-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS \
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000000..6085fd86e98
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,3 @@
+# How To Report a Vulnerability
+
+See https://github.com/eclipse-platform/.github/blob/main/SECURITY.md
diff --git a/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
index bf1717126be..c35b9be3bf6 100644
--- a/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ant.core; singleton:=true
-Bundle-Version: 3.7.100.qualifier
+Bundle-Version: 3.7.200.qualifier
Bundle-Activator: org.eclipse.ant.core.AntCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,8 +15,7 @@ Export-Package: org.eclipse.ant.core,
org.eclipse.ant.internal.core.ant;x-friends:="org.eclipse.ant.launching",
org.eclipse.ant.internal.core.contentDescriber;x-internal:=true
Require-Bundle: org.eclipse.core.variables;bundle-version="[3.1.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.28.0,4.0.0)"
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)"
Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.ant.internal.core.contentDescriber"
Bundle-RequiredExecutionEnvironment: JavaSE-17
-Bundle-ClassPath: .
Automatic-Module-Name: org.eclipse.ant.core
diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
index 695ad3e7b61..453bd81f179 100644
--- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
+++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
@@ -43,7 +43,6 @@
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
@@ -82,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();
@@ -138,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();
@@ -157,9 +156,9 @@ public String toString() {
}
};
- private List defaultTasks;
- private List defaultTypes;
- private List extraClasspathURLs;
+ private final List defaultTasks;
+ private final List defaultTypes;
+ private final List extraClasspathURLs;
private List defaultProperties;
private IAntClasspathEntry[] defaultAntHomeEntries;
@@ -347,7 +346,7 @@ public String getDefaultAntHome() {
IAntClasspathEntry[] entries = getDefaultAntHomeEntries();
if (entries.length > 0) {
URL antjar = entries[entries.length - 1].getEntryURL();
- IPath antHomePath = new Path(antjar.getFile());
+ IPath antHomePath = IPath.fromOSString(antjar.getFile());
// parent directory of the lib directory
antHomePath = antHomePath.removeLastSegments(2);
return antHomePath.toFile().getAbsolutePath();
@@ -865,7 +864,7 @@ public IAntClasspathEntry getToolsJarEntry(IPath javaHomePath) {
*/
@Deprecated
public URL getToolsJarURL() {
- IPath path = new Path(System.getProperty("java.home")); //$NON-NLS-1$
+ IPath path = IPath.fromOSString(System.getProperty("java.home")); //$NON-NLS-1$
IAntClasspathEntry entry = getToolsJarEntry(path);
if (entry == null) {
IDynamicVariable variable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("env_var"); //$NON-NLS-1$
@@ -875,7 +874,7 @@ public URL getToolsJarURL() {
javaHome = variable.getValue("JAVA_HOME"); //$NON-NLS-1$
}
if (javaHome != null) {
- path = new Path(javaHome);
+ path = IPath.fromOSString(javaHome);
entry = getToolsJarEntry(path);
}
}
@@ -897,7 +896,7 @@ public URL getToolsJarURL() {
* @return IAntClasspathEntry tools.jar IAntClasspathEntry or null
*/
public IAntClasspathEntry getToolsJarEntry() {
- IPath path = new Path(System.getProperty("java.home")); //$NON-NLS-1$
+ IPath path = IPath.fromOSString(System.getProperty("java.home")); //$NON-NLS-1$
IAntClasspathEntry entry = getToolsJarEntry(path);
if (entry == null) {
IDynamicVariable variable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("env_var"); //$NON-NLS-1$
@@ -907,7 +906,7 @@ public IAntClasspathEntry getToolsJarEntry() {
javaHome = variable.getValue("JAVA_HOME"); //$NON-NLS-1$
}
if (javaHome != null) {
- path = new Path(javaHome);
+ path = IPath.fromOSString(javaHome);
entry = getToolsJarEntry(path);
}
}
diff --git a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
index e3625956329..53ee217e153 100644
--- a/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
+++ b/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/AntCoreUtil.java
@@ -26,7 +26,6 @@
import org.eclipse.ant.core.AntCorePlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.osgi.framework.BundleContext;
@@ -114,15 +113,15 @@ public static void processMinusDProperties(List commands, Map fTasks = new Stack();
+ private final Stack fTasks = new Stack();
@SuppressWarnings("unused")
- private Map fTaskToProxies = new HashMap();
+ private final Map fTaskToProxies = new HashMap();
private Task fCurrentTask;
private Task fStepOverTask;
private Task fStepIntoTask;
@@ -51,9 +51,9 @@ public class AntDebugState {
private Map> fProjectToTargetNames = null;
private Map>> fProjectToMapOfTargetToBuildSequence = null;
@SuppressWarnings("unused")
- private Stack fTargetsToExecute = new Stack();
+ private final Stack fTargetsToExecute = new Stack();
@SuppressWarnings("unused")
- private Stack fTargetsExecuting = new Stack();
+ private final Stack fTargetsExecuting = new Stack();
private boolean fConsiderTargetBreakpoints = false;
private boolean fShouldSuspend;
diff --git a/ant/org.eclipse.ant.launching/loggers/org/eclipse/ant/internal/launching/runtime/logger/NullBuildLogger.java b/ant/org.eclipse.ant.launching/loggers/org/eclipse/ant/internal/launching/runtime/logger/NullBuildLogger.java
index 9b8b03b3c69..643dc936c7b 100644
--- a/ant/org.eclipse.ant.launching/loggers/org/eclipse/ant/internal/launching/runtime/logger/NullBuildLogger.java
+++ b/ant/org.eclipse.ant.launching/loggers/org/eclipse/ant/internal/launching/runtime/logger/NullBuildLogger.java
@@ -41,7 +41,7 @@ public void setMessageOutputLevel(int level) {
fMessageOutputLevel = level;
}
- protected int getMessageOutputLevel() {
+ public int getMessageOutputLevel() {
return fMessageOutputLevel;
}
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
index 2be642061c8..f94fe04a92a 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/InternalAntRunner.java
@@ -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 propertyFiles = new ArrayList();
+ private final List propertyFiles = new ArrayList();
/**
* The Ant InputHandler class. There may be only one input handler.
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBreakpoint.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBreakpoint.java
index 738452cb504..90f655c7fd3 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBreakpoint.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBreakpoint.java
@@ -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);
diff --git a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
index f6cec999bd8..10662ce49e1 100644
--- a/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
+++ b/ant/org.eclipse.ant.launching/remote/org/eclipse/ant/internal/launching/remote/logger/RemoteAntBuildLogger.java
@@ -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.
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/AntLaunchingUtil.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/AntLaunchingUtil.java
index 33d2d767fac..b9cf5097147 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/AntLaunchingUtil.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/AntLaunchingUtil.java
@@ -38,7 +38,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunch;
@@ -277,7 +276,7 @@ public static String[] parseString(String delimString, String delim) {
*/
public static IFile getFile(String fullPath) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- return root.getFile(new Path(fullPath));
+ return root.getFile(IPath.fromOSString(fullPath));
}
/**
@@ -295,7 +294,7 @@ public static IFile getFileForLocation(String path, File buildFileParent) {
if (path == null) {
return null;
}
- IPath filePath = new Path(path);
+ IPath filePath = IPath.fromOSString(path);
IFile file = null;
URI location = filePath.makeAbsolute().toFile().toURI();
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
@@ -308,7 +307,7 @@ public static IFile getFileForLocation(String path, File buildFileParent) {
try {
// this call is ok if buildFileParent is null
relativeFile = FileUtils.getFileUtils().resolveFile(buildFileParent, path);
- filePath = new Path(relativeFile.getAbsolutePath());
+ filePath = IPath.fromOSString(relativeFile.getAbsolutePath());
location = filePath.makeAbsolute().toFile().toURI();
files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
if (files.length > 0) {
@@ -400,11 +399,11 @@ public static void linkBuildFailedMessage(String message, IProcess process) {
String fileName = null;
String lineNumber = ""; //$NON-NLS-1$
int fileStart = 0;
- int index = message.indexOf("xml"); //$NON-NLS-1$
+ int index = message.indexOf(".xml"); //$NON-NLS-1$
if (index > 0) {
- int numberStart = index + 4;
+ int numberStart = index + 5;
int numberEnd = message.indexOf(':', numberStart);
- int fileEnd = index + 3;
+ int fileEnd = index + 4;
if (numberStart > 0 && fileEnd > 0) {
fileName = message.substring(fileStart, fileEnd).trim();
if (numberEnd > 0) {
@@ -421,7 +420,7 @@ public static void linkBuildFailedMessage(String message, IProcess process) {
catch (NumberFormatException e) {
// do nothing
}
- URI location = new Path(fileName).makeAbsolute().toFile().toURI();
+ URI location = IPath.fromOSString(fileName).makeAbsolute().toFile().toURI();
IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
IFile file = null;
if (files.length > 0) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
index 616c00478ab..6ca39f42a10 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/AntSourceContainer.java
@@ -24,14 +24,13 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
public class AntSourceContainer extends AbstractSourceContainer {
- private IWorkspaceRoot fRoot;
+ private final IWorkspaceRoot fRoot;
public AntSourceContainer() {
fRoot = ResourcesPlugin.getWorkspace().getRoot();
@@ -43,7 +42,7 @@ public Object[] findSourceElements(String path) throws CoreException {
File osFile = new File(path);
if (osFile.exists()) {
try {
- IPath canonicalPath = new Path(osFile.getCanonicalPath());
+ IPath canonicalPath = IPath.fromOSString(osFile.getCanonicalPath());
IFile[] files = fRoot.findFilesForLocationURI(canonicalPath.makeAbsolute().toFile().toURI());
if (files.length > 0) {
for (IFile file : files) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntDebugTarget.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntDebugTarget.java
index 8f3b6054d3b..765c07f2953 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntDebugTarget.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntDebugTarget.java
@@ -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;
@@ -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 fRunToLineBreakpoints;
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntLineBreakpoint.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntLineBreakpoint.java
index dbbc80c058a..3b12e04d22b 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntLineBreakpoint.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntLineBreakpoint.java
@@ -51,7 +51,7 @@ public AntLineBreakpoint() {
* if unable to create the breakpoint
*/
public AntLineBreakpoint(IResource resource, int lineNumber) throws CoreException {
- this(resource, lineNumber, new HashMap(), true);
+ this(resource, lineNumber, new HashMap<>(), true);
}
/**
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperties.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperties.java
index c0696d90639..431210ef9a5 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperties.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperties.java
@@ -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) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntPropertiesValue.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntPropertiesValue.java
index 22b31c9e5b4..5f2dbe8067d 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntPropertiesValue.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntPropertiesValue.java
@@ -23,7 +23,7 @@
public class AntPropertiesValue extends AntDebugElement implements IValue {
- private List fProperties = new ArrayList<>();
+ private final List fProperties = new ArrayList<>();
public AntPropertiesValue(AntDebugTarget target) {
super(target);
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperty.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperty.java
index ea93286bb9f..7c9ef6ea3af 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperty.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntProperty.java
@@ -22,8 +22,8 @@
*/
public class AntProperty extends AntDebugElement implements IVariable, Comparable {
- private String fName;
- private AntValue fValue;
+ private final String fName;
+ private final AntValue fValue;
private String fLabel;
/**
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
index 6da7b1e0063..015767a0210 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntStackFrame.java
@@ -15,7 +15,7 @@
import org.eclipse.ant.internal.launching.AntLaunchingUtil;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IRegisterGroup;
import org.eclipse.debug.core.model.IStackFrame;
@@ -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;
@@ -84,7 +84,7 @@ public void setFilePath(String fullPath) {
if (file != null) {
fFilePath = file.getProjectRelativePath().toString();
} else {
- fFilePath = new Path(fullPath).lastSegment();
+ fFilePath = IPath.fromOSString(fullPath).lastSegment();
}
}
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntThread.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntThread.java
index 3925776bef3..3723cba8a5c 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntThread.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntThread.java
@@ -38,7 +38,7 @@ public class AntThread extends AntDebugElement implements IThread {
/**
* The stackframes associated with this thread
*/
- private List fFrames = new ArrayList<>(1);
+ private final List fFrames = new ArrayList<>(1);
/**
* The stackframes to be reused on suspension
@@ -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
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntValue.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntValue.java
index 45f7e853439..59d703678ea 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntValue.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/debug/model/AntValue.java
@@ -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) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
index 109acb6d880..8ec61b53791 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntHomeClasspathEntry.java
@@ -24,7 +24,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.internal.launching.AbstractRuntimeClasspathEntry;
@@ -71,7 +70,7 @@ protected void buildMemento(Document document, Element memento) throws CoreExcep
if (antHomeLocation == null) {
memento.setAttribute("default", "true"); //$NON-NLS-1$//$NON-NLS-2$
} else {
- memento.setAttribute("antHome", new Path(antHomeLocation).toString()); //$NON-NLS-1$
+ memento.setAttribute("antHome", IPath.fromOSString(antHomeLocation).toString()); //$NON-NLS-1$
}
}
@@ -79,7 +78,7 @@ protected void buildMemento(Document document, Element memento) throws CoreExcep
public void initializeFrom(Element memento) throws CoreException {
String antHome = memento.getAttribute("antHome"); //$NON-NLS-1$
if (antHome != null && (antHome.length() > 0)) {
- IPath path = new Path(antHome);
+ IPath path = IPath.fromOSString(antHome);
antHomeLocation = path.toOSString();
} else {
antHomeLocation = null;
@@ -100,9 +99,9 @@ public IRuntimeClasspathEntry[] getRuntimeClasspathEntries(ILaunchConfiguration
libs.add(JavaRuntime.newStringVariableClasspathEntry(entry.getLabel()));
}
} else {
- IPath libDir = new Path(antHomeLocation).append("lib"); //$NON-NLS-1$
+ IPath libDir = IPath.fromOSString(antHomeLocation).append("lib"); //$NON-NLS-1$
for (String name : resolveAntHome().list()) {
- IPath path = new Path(name);
+ IPath path = IPath.fromOSString(name);
String fileExtension = path.getFileExtension();
if ("jar".equalsIgnoreCase(fileExtension)) { //$NON-NLS-1$
libs.add(JavaRuntime.newArchiveRuntimeClasspathEntry(libDir.append(path)));
@@ -116,7 +115,7 @@ public File resolveAntHome() throws CoreException {
if (antHomeLocation == null) { // using the default ant home
return null;
}
- IPath libDir = new Path(antHomeLocation).append("lib"); //$NON-NLS-1$
+ IPath libDir = IPath.fromOSString(antHomeLocation).append("lib"); //$NON-NLS-1$
File lib = libDir.toFile();
File parentDir = lib.getParentFile();
if (parentDir == null || !parentDir.exists()) {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
index ce1320f0f05..03429d9ec13 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntLaunchDelegate.java
@@ -51,7 +51,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
@@ -122,7 +121,7 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
String path = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, new String("")); //$NON-NLS-1$
String vmver = null;
if (!path.isEmpty()) {
- IPath jrePath = Path.fromPortableString(path);
+ IPath jrePath = IPath.fromPortableString(path);
IVMInstall vm = JavaRuntime.getVMInstall(jrePath);
if (vm instanceof AbstractVMInstall) {
AbstractVMInstall install = (AbstractVMInstall) vm;
@@ -745,7 +744,7 @@ private String getSWTLibraryLocation() {
try {
URL url = FileLocator.toFileURL(fragBundle.getEntry("/")); //$NON-NLS-1$
try {
- IPath path = new Path(URIUtil.toURL(URIUtil.toURI(url)).getPath());
+ IPath path = IPath.fromOSString(URIUtil.toURL(URIUtil.toURI(url)).getPath());
path = path.removeTrailingSeparator();
fgSWTLibraryLocation = path.toOSString();
}
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamMonitor.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamMonitor.java
index cc74443df34..428c0ab6569 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamMonitor.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamMonitor.java
@@ -22,8 +22,8 @@
*/
public class AntStreamMonitor implements IFlushableStreamMonitor {
- private StringBuffer fContents = new StringBuffer();
- private ListenerList fListeners = new ListenerList<>(1);
+ private final StringBuffer fContents = new StringBuffer();
+ private final ListenerList fListeners = new ListenerList<>(1);
private boolean fBuffered = true;
@Override
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamsProxy.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamsProxy.java
index b9c15b9662e..d9306489205 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamsProxy.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/AntStreamsProxy.java
@@ -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() {
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
index 5164b496be6..b13e2ff048d 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/ContributedClasspathEntriesEntry.java
@@ -34,7 +34,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -102,7 +101,7 @@ public IRuntimeClasspathEntry[] getRuntimeClasspathEntries(ILaunchConfiguration
for (IAntClasspathEntry userEntry : userEntries) {
entry = userEntry;
path = entry.getLabel();
- IPath toolsPath = new Path(path);
+ IPath toolsPath = IPath.fromOSString(path);
if (toolsPath.lastSegment().equals("tools.jar")) { //$NON-NLS-1$
haveToolsEntry = true;
// replace with dynamically resolved tools.jar based on
@@ -128,18 +127,18 @@ private void addToolsJar(ILaunchConfiguration configuration, List rtes) {
AntLaunching.log(e);
continue;
}
- IPath fragmentPath = new Path(urlFileName);
+ IPath fragmentPath = IPath.fromOSString(urlFileName);
if (fragmentPath.getFileExtension() != null) { // JAR file
fgSWTEntries.add(JavaRuntime.newArchiveRuntimeClasspathEntry(fragmentPath));
} else { // folder
@@ -228,9 +227,9 @@ private IRuntimeClasspathEntry getToolsJar(ILaunchConfiguration configuration) {
try {
IVMInstall install = JavaRuntime.computeVMInstall(configuration);
if (install != null) {
- IAntClasspathEntry entry = AntCorePlugin.getPlugin().getPreferences().getToolsJarEntry(new Path(install.getInstallLocation().getAbsolutePath()));
+ IAntClasspathEntry entry = AntCorePlugin.getPlugin().getPreferences().getToolsJarEntry(IPath.fromOSString(install.getInstallLocation().getAbsolutePath()));
if (entry != null) {
- return JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(entry.getEntryURL().getPath()));
+ return JavaRuntime.newArchiveRuntimeClasspathEntry(IPath.fromOSString(entry.getEntryURL().getPath()));
}
}
}
diff --git a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/RemoteAntBuildListener.java b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/RemoteAntBuildListener.java
index 8cf246fb0d3..d333af44e09 100644
--- a/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/RemoteAntBuildListener.java
+++ b/ant/org.eclipse.ant.launching/src/org/eclipse/ant/internal/launching/launchConfigurations/RemoteAntBuildListener.java
@@ -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$
diff --git a/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
index 24fe02aeef1..8e26e1ac857 100644
--- a/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ant.tests.core; singleton:=true
-Bundle-Version: 3.7.100.qualifier
+Bundle-Version: 3.7.200.qualifier
Bundle-ClassPath: anttestscore.jar
Bundle-Activator: org.eclipse.ant.tests.core.testplugin.AntTestPlugin
Bundle-Vendor: %providerName
diff --git a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
index 5775a940a84..91cbbc5eaca 100644
--- a/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
+++ b/ant/org.eclipse.ant.tests.core/test plugin/org/eclipse/ant/tests/core/testplugin/ProjectHelper.java
@@ -28,9 +28,9 @@
*/
public class ProjectHelper {
- public static final IPath TEST_BUILDFILES_DIR = new Path("testbuildfiles"); //$NON-NLS-1$
- public static final IPath TEST_RESOURCES_DIR = new Path("testresources"); //$NON-NLS-1$
- public static final IPath TEST_LIB_DIR = new Path("testlib"); //$NON-NLS-1$
+ public static final IPath TEST_BUILDFILES_DIR = IPath.fromOSString("testbuildfiles"); //$NON-NLS-1$
+ public static final IPath TEST_RESOURCES_DIR = IPath.fromOSString("testresources"); //$NON-NLS-1$
+ public static final IPath TEST_LIB_DIR = IPath.fromOSString("testlib"); //$NON-NLS-1$
/**
* Creates a IProject.
diff --git a/ant/org.eclipse.ant.tests.core/test support/org/eclipse/ant/tests/core/support/testloggers/TestBuildLogger.java b/ant/org.eclipse.ant.tests.core/test support/org/eclipse/ant/tests/core/support/testloggers/TestBuildLogger.java
index 646ed3499d5..5b8465c3073 100644
--- a/ant/org.eclipse.ant.tests.core/test support/org/eclipse/ant/tests/core/support/testloggers/TestBuildLogger.java
+++ b/ant/org.eclipse.ant.tests.core/test support/org/eclipse/ant/tests/core/support/testloggers/TestBuildLogger.java
@@ -42,7 +42,7 @@ public void setMessageOutputLevel(int level) {
fMessageOutputLevel = level;
}
- protected int getMessageOutputLevel() {
+ public int getMessageOutputLevel() {
return fMessageOutputLevel;
}
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
index 95350a9c485..02ddfe9f8df 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/AbstractAntTest.java
@@ -40,7 +40,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.IWorkbench;
@@ -292,7 +291,7 @@ protected String getAntHome() {
AntCorePreferences prefs = AntCorePlugin.getPlugin().getPreferences();
IAntClasspathEntry[] entries = prefs.getAntHomeClasspathEntries();
IAntClasspathEntry antjar = entries[0];
- IPath antHomePath = new Path(antjar.getEntryURL().getFile());
+ IPath antHomePath = IPath.fromOSString(antjar.getEntryURL().getFile());
antHomePath = antHomePath.removeLastSegments(1);
return antHomePath.toFile().getAbsolutePath();
}
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
index 29c68447d8f..b762e0791af 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/FrameworkTests.java
@@ -36,7 +36,7 @@
import org.eclipse.ant.tests.core.testplugin.ProjectHelper;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.junit.Test;
public class FrameworkTests extends AbstractAntTest {
@@ -296,7 +296,7 @@ public void testAntClasspathEntryFromUrl() throws MalformedURLException {
IAntClasspathEntry resultedEntries[] = prefs.getAntHomeClasspathEntries();
int index = resultedEntries[entries.length].getLabel().indexOf("hub"); //$NON-NLS-1$
assertNotSame("Missing machine details", index, -1); //$NON-NLS-1$
- assertFalse("Incorrect classpath entry. This would have been the value before the fix", resultedEntries[entries.length].getLabel().equals(new Path("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Incorrect classpath entry", resultedEntries[entries.length].getLabel().substring(index).equals(new Path("hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Incorrect classpath entry. This would have been the value before the fix", resultedEntries[entries.length].getLabel().equals(IPath.fromOSString("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Incorrect classpath entry", resultedEntries[entries.length].getLabel().substring(index).equals(IPath.fromOSString("hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
index ad02d7b456e..4853423324b 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
@@ -31,14 +31,23 @@
import org.eclipse.ant.tests.core.testplugin.AntTestChecker;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.junit.Test;
+import org.osgi.framework.Version;
public class OptionTests extends AbstractAntTest {
protected static final String UNKNOWN_ARG = "Unknown argument: "; //$NON-NLS-1$
protected static final String START_OF_HELP = "ant [options] [target [target2 [target3] ...]]"; //$NON-NLS-1$
- protected static final String VERSION = "Apache Ant(TM) version 1.10.12"; //$NON-NLS-1$
- protected static final String PLUGIN_VERSION = "org.apache.ant_1.10.12"; //$NON-NLS-1$
+ protected static final String VERSION;
+ protected static final String PLUGIN_VERSION;
+
+ static {
+ Version antVersion = Platform.getBundle("org.apache.ant").getVersion(); //$NON-NLS-1$
+ VERSION = "Apache Ant(TM) version " + antVersion.getMajor() + '.' + antVersion.getMinor() + '.' //$NON-NLS-1$
+ + antVersion.getMicro();
+ PLUGIN_VERSION = antVersion.toString();
+ }
/**
* Tests the "-help" option
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
index 729016c573e..de834bdaf5a 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/AbstractAntDebugTest.java
@@ -24,7 +24,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -490,7 +490,7 @@ protected AntDebugTarget resumeAndExit(AntThread thread) throws Exception {
}
protected IResource getBreakpointResource(String typeName) throws Exception {
- IJavaElement element = getJavaProject().findElement(new Path(typeName + ".java")); //$NON-NLS-1$
+ IJavaElement element = getJavaProject().findElement(IPath.fromOSString(typeName + ".java")); //$NON-NLS-1$
IResource resource = element.getCorrespondingResource();
if (resource == null) {
resource = getJavaProject().getProject();
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
index 25a1aa36749..7d0243e0c04 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
@@ -19,15 +19,23 @@
import org.eclipse.ant.internal.launching.debug.model.AntValue;
import org.eclipse.ant.launching.IAntLaunchConstants;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.model.ILineBreakpoint;
import org.eclipse.debug.core.model.IVariable;
+import org.osgi.framework.Version;
public class PropertyTests extends AbstractAntDebugTest {
- private static final String ANT_VERSION = "Apache Ant(TM) version 1.10.12"; //$NON-NLS-1$
+ private static final String ANT_VERSION;
+
+ static {
+ Version antVersion = Platform.getBundle("org.apache.ant").getVersion(); //$NON-NLS-1$
+ ANT_VERSION = "Apache Ant(TM) version " + antVersion.getMajor() + '.' + antVersion.getMinor() + '.' //$NON-NLS-1$
+ + antVersion.getMicro();
+ }
public PropertyTests(String name) {
super(name);
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/RunToLineTests.java b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/RunToLineTests.java
index bec2248a252..9b35235efc6 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/RunToLineTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/RunToLineTests.java
@@ -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 {
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
index b1bc08d75fa..14827a64cc5 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
@@ -1,15 +1,15 @@
/*******************************************************************************
* Copyright (c) 2002, 2014 GEBIT Gesellschaft fuer EDV-Beratung
- * und Informatik-Technologien mbH,
+ * und Informatik-Technologien mbH,
* Berlin, Duesseldorf, Frankfurt (Germany) and others.
*
- * This program and the accompanying materials
+ * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* GEBIT Gesellschaft fuer EDV-Beratung und Informatik-Technologien mbH - initial implementation
* IBM Corporation - additional tests
@@ -22,7 +22,6 @@
import java.io.FileNotFoundException;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.ant.core.AntCorePlugin;
@@ -35,6 +34,7 @@
import org.eclipse.ant.tests.ui.editor.performance.EditorTestHelper;
import org.eclipse.ant.tests.ui.editor.support.TestTextCompletionProcessor;
import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
+import org.eclipse.core.internal.runtime.XmlProcessorFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.TextSelection;
@@ -47,14 +47,14 @@
/**
* Tests everything about code completion and code assistance.
- *
+ *
*/
@SuppressWarnings("restriction")
public class CodeCompletionTest extends AbstractAntUITest {
/**
* Constructor for CodeCompletionTest.
- *
+ *
* @param name
*/
public CodeCompletionTest(String name) {
@@ -692,7 +692,7 @@ public void testMixedElements() {
public void testFindChildElement() throws ParserConfigurationException {
// Create the test data
- DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ DocumentBuilder docBuilder = XmlProcessorFactory.createDocumentBuilderWithErrorOnDOCTYPE();
Document doc = docBuilder.newDocument();
Element parentElement = doc.createElement("parent"); //$NON-NLS-1$
Attr attribute = doc.createAttribute("att1"); //$NON-NLS-1$
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
index a3a257ede44..60b83fc0764 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/support/TestLocationProvider.java
@@ -18,11 +18,10 @@
import org.eclipse.ant.internal.ui.model.LocationProvider;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
public class TestLocationProvider extends LocationProvider {
- private File buildFile;
+ private final File buildFile;
public TestLocationProvider(File buildFile) {
super(null);
@@ -31,6 +30,6 @@ public TestLocationProvider(File buildFile) {
@Override
public IPath getLocation() {
- return new Path(buildFile.getAbsolutePath());
+ return IPath.fromOSString(buildFile.getAbsolutePath());
}
}
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/BuildTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/BuildTests.java
index eec802fdc08..229ac2b71a8 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/BuildTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/BuildTests.java
@@ -30,6 +30,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.console.IHyperlink;
@@ -79,9 +80,10 @@ public void testBuildFailedMessage() throws CoreException, BadLocationException
assertTrue("Incorrect last message. Should start with BUILD FAILED. Message: " + message, //$NON-NLS-1$
message.startsWith("BUILD FAILED")); //$NON-NLS-1$
int offset = -1;
- offset = ConsoleLineTracker.getDocument().getLineOffset(4) + 30; // link to buildfile that failed
- IHyperlink link = getHyperlink(offset, ConsoleLineTracker.getDocument());
- assertNotNull("No hyperlink found at offset " + offset, link); //$NON-NLS-1$
+ IDocument document = ConsoleLineTracker.getDocument();
+ offset = document.getLineOffset(4) + 30; // link to buildfile that failed
+ IHyperlink link = getHyperlink(offset, document);
+ assertNotNull("No hyperlink found at offset " + offset + "\n" + document, link); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -106,9 +108,10 @@ public void testLinks() throws CoreException, BadLocationException {
*/
public void testBuildFailedLinks() throws CoreException, BadLocationException {
launch("102282"); //$NON-NLS-1$
- int offset = ConsoleLineTracker.getDocument().getLineOffset(9) + 10; // second line of build failed link
- IHyperlink link = getHyperlink(offset, ConsoleLineTracker.getDocument());
- assertNotNull("No hyperlink found at offset " + offset, link); //$NON-NLS-1$
+ IDocument document = ConsoleLineTracker.getDocument();
+ int offset = document.getLineOffset(9) + 10; // second line of build failed link
+ IHyperlink link = getHyperlink(offset, document);
+ assertNotNull("No hyperlink found at offset " + offset + "\n" + document, link); //$NON-NLS-1$ //$NON-NLS-2$
activateLink(link);
}
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
index 4008107d45e..08c8c7b2fce 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
@@ -31,17 +31,23 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.console.IHyperlink;
@SuppressWarnings("restriction")
public class SeparateVMTests extends AbstractAntUIBuildTest {
- protected static final String PLUGIN_VERSION = "org.apache.ant_1.10.12"; //$NON-NLS-1$
+ protected static final String PLUGIN_VERSION;
+
+ static {
+ PLUGIN_VERSION = Platform.getBundle("org.apache.ant").getVersion().toString(); //$NON-NLS-1$
+ }
public SeparateVMTests(String name) {
super(name);
@@ -153,9 +159,10 @@ public void testLinks() throws CoreException, BadLocationException {
*/
public void testBuildFailedLinks() throws CoreException, BadLocationException {
launch("102282"); //$NON-NLS-1$
- int offset = ConsoleLineTracker.getDocument().getLineOffset(9) + 10; // second line of build failed link
- IHyperlink link = getHyperlink(offset, ConsoleLineTracker.getDocument());
- assertNotNull("No hyperlink found at offset " + offset, link); //$NON-NLS-1$
+ IDocument document = ConsoleLineTracker.getDocument();
+ int offset = document.getLineOffset(9) + 10; // second line of build failed link
+ IHyperlink link = getHyperlink(offset, document);
+ assertNotNull("No hyperlink found at offset " + offset + "\n" + document, link); //$NON-NLS-1$ //$NON-NLS-2$
activateLink(link);
}
diff --git a/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
index 6d68cf925d9..1d86b31592e 100644
--- a/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ant.tests.ui; singleton:=true
-Bundle-Version: 3.11.100.qualifier
+Bundle-Version: 3.11.200.qualifier
Bundle-ClassPath: anttestsui.jar
Bundle-Activator: org.eclipse.ant.tests.ui.testplugin.AntUITestPlugin
Bundle-Vendor: %providerName
diff --git a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AbstractAntUITest.java b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AbstractAntUITest.java
index a07e6a0112f..55da39bbb9c 100644
--- a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AbstractAntUITest.java
+++ b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AbstractAntUITest.java
@@ -24,9 +24,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
import org.eclipse.ant.internal.ui.AntUIPlugin;
import org.eclipse.ant.internal.ui.IAntUIPreferenceConstants;
@@ -421,23 +419,6 @@ protected String getFileContentAsString(File aFile) throws FileNotFoundException
return getReaderContentAsString(bufferedReader);
}
- /**
- * @return a new SAX parser instrance
- */
- protected SAXParser getSAXParser() {
- SAXParser parser = null;
- try {
- parser = SAXParserFactory.newInstance().newSAXParser();
- }
- catch (ParserConfigurationException e) {
- AntUIPlugin.log(e);
- }
- catch (SAXException e) {
- AntUIPlugin.log(e);
- }
- return parser;
- }
-
/**
* Parses the given input stream with the given parser using the given handler
*
diff --git a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
index 417c686c73f..1bb5c05179c 100644
--- a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
+++ b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/ProjectHelper.java
@@ -32,7 +32,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -53,9 +52,9 @@
@SuppressWarnings("restriction")
public class ProjectHelper {
- public static final IPath TEST_BUILDFILES_DIR = new Path("testbuildfiles"); //$NON-NLS-1$
- public static final IPath TEST_RESOURCES_DIR = new Path("testresources"); //$NON-NLS-1$
- public static final IPath TEST_LIB_DIR = new Path("testlib"); //$NON-NLS-1$
+ public static final IPath TEST_BUILDFILES_DIR = IPath.fromOSString("testbuildfiles"); //$NON-NLS-1$
+ public static final IPath TEST_RESOURCES_DIR = IPath.fromOSString("testresources"); //$NON-NLS-1$
+ public static final IPath TEST_LIB_DIR = IPath.fromOSString("testlib"); //$NON-NLS-1$
public static final String PROJECT_NAME = "Ant UI Tests"; //$NON-NLS-1$
diff --git a/ant/org.eclipse.ant.ui/Ant Editor Content Assist Dev/TaskXMLFileMerger.java b/ant/org.eclipse.ant.ui/Ant Editor Content Assist Dev/TaskXMLFileMerger.java
index d0a6fb54f8d..a71d46bfe8e 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor Content Assist Dev/TaskXMLFileMerger.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor Content Assist Dev/TaskXMLFileMerger.java
@@ -259,7 +259,7 @@ private Node getChildNodeNamedWithTypeFromNode(String aName, short aNodeType, No
private Document parseFile(String aFileName) {
Document tempDocument = null;
- DocumentBuilderFactory tempFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory tempFactory = XmlProcessorFactory.createDocumentBuilderFactoryWithErrorOnDOCTYPE();
tempFactory.setIgnoringComments(true);
tempFactory.setIgnoringElementContentWhitespace(true);
tempFactory.setCoalescing(true);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/Parser.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/Parser.java
index 4aeb9f6305b..5cd5a0a7122 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/Parser.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/Parser.java
@@ -19,7 +19,6 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
import org.eclipse.ant.internal.ui.dtd.schema.SchemaFactory;
import org.xml.sax.EntityResolver;
@@ -98,7 +97,9 @@ public ISchema parse(InputSource inputSource, EntityResolver entityResolver) thr
private XMLReader getXMLReader() throws ParseError {
SAXParser parser = null;
try {
- parser = SAXParserFactory.newInstance().newSAXParser();
+ @SuppressWarnings("restriction")
+ SAXParser p = org.eclipse.core.internal.runtime.XmlProcessorFactory.createSAXParserNoExternal();
+ parser = p;
return parser.getXMLReader();
}
catch (ParserConfigurationException e) {
@@ -176,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 = "<" + root + "/>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
@@ -195,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;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Attribute.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Attribute.java
index a2ebeac2a1f..9edd65d4548 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Attribute.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Attribute.java
@@ -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;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java
index bc7e3f45b4e..76aed27c46f 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java
@@ -27,7 +27,7 @@ public class Element extends Atom implements IElement {
private boolean fUndefined = true;
private boolean fText;
private IModel fModel;
- private Map fMap = new HashMap<>(4);
+ private final Map fMap = new HashMap<>(4);
private Dfm fElementDfm;
/**
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java
index cd962a255fd..488a21eaf22 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java
@@ -25,16 +25,22 @@
* @author Bob Foster
*/
public class Schema implements ISchema {
- private HashMap fElementMap = new HashMap<>();
+ private final HashMap fElementMap = new HashMap<>();
private Exception fErrorException;
@Override
public IElement getElement(String qname) {
+ if (fErrorException != null) {
+ throw new RuntimeException(fErrorException);
+ }
return fElementMap.get(qname);
}
@Override
public IElement[] getElements() {
+ if (fErrorException != null) {
+ throw new RuntimeException(fErrorException);
+ }
return fElementMap.values().toArray(new IElement[fElementMap.size()]);
}
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java
index 12c532ac3d1..3abe3415a48 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java
@@ -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 fTypes = new HashSet<>();
private Exception fErrorException;
static {
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/SortedMap.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/SortedMap.java
index 92dca39c588..23ddf0a3081 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/SortedMap.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/SortedMap.java
@@ -22,7 +22,7 @@
*/
public class SortedMap implements FactoryObject {
- private SortedSet fSet;
+ private final SortedSet fSet;
private IMapHolder fHolder;
private SortedMap fNext;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntAutoEditStrategy.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntAutoEditStrategy.java
index 6e0115e7377..9ee8159a712 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntAutoEditStrategy.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntAutoEditStrategy.java
@@ -32,7 +32,7 @@
*/
public class AntAutoEditStrategy extends DefaultIndentLineAutoEditStrategy {
- private AntModel fModel;
+ private final AntModel fModel;
private int fAccumulatedChange = 0;
public AntAutoEditStrategy(AntModel model) {
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntCompletionProposal.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntCompletionProposal.java
index 1bf899080a0..9aa13e6dc17 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntCompletionProposal.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntCompletionProposal.java
@@ -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.
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditor.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditor.java
index 7c0ac87af92..c3f710c81d9 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditor.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditor.java
@@ -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 fPositions;
+ private final List fPositions;
public OccurrencesFinderJob(IDocument document, List positions, ISelection selection) {
super("Occurrences Marker"); //$NON-NLS-1$
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorActionContributor.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorActionContributor.java
index cb768de1090..708b04cf4dd 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorActionContributor.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorActionContributor.java
@@ -46,9 +46,9 @@ public class AntEditorActionContributor extends TextEditorActionContributor {
private final static String TOGGLE_MARK_OCCURRENCES_ID = "org.eclipse.ant.ui.toggleMarkOccurrences"; //$NON-NLS-1$
protected RetargetTextEditorAction fContentAssistProposal;
protected RetargetTextEditorAction fContentFormat;
- private TogglePresentationAction fTogglePresentation;
- private ToggleMarkOccurrencesAction fToggleMarkOccurrencesAction;
- private ToggleAutoReconcileAction fToggleAutoReconcileAction;
+ private final TogglePresentationAction fTogglePresentation;
+ private final ToggleMarkOccurrencesAction fToggleMarkOccurrencesAction;
+ private final ToggleAutoReconcileAction fToggleAutoReconcileAction;
public AntEditorActionContributor() {
super();
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java
index fd81df586c8..eb8db484af1 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java
@@ -119,7 +119,7 @@
*/
public class AntEditorCompletionProcessor extends TemplateCompletionProcessor implements ICompletionListener {
- private Comparator proposalComparator = new Comparator<>() {
+ private final Comparator proposalComparator = new Comparator<>() {
@Override
public int compare(ICompletionProposal o1, ICompletionProposal o2) {
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorSourceViewerConfiguration.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorSourceViewerConfiguration.java
index 46cf64608ac..51c73766ba7 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorSourceViewerConfiguration.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorSourceViewerConfiguration.java
@@ -61,7 +61,7 @@
*/
public class AntEditorSourceViewerConfiguration extends AntSourceViewerConfiguration {
- private AntEditor fEditor;
+ private final AntEditor fEditor;
private XMLTextHover fTextHover;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntSourceViewerInformationControl.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntSourceViewerInformationControl.java
index c99c8450299..5f15e28ed7b 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntSourceViewerInformationControl.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntSourceViewerInformationControl.java
@@ -45,7 +45,7 @@ public class AntSourceViewerInformationControl implements IInformationControl, I
private Shell fShell;
/** The control's source viewer */
- private SourceViewer fViewer;
+ private final SourceViewer fViewer;
/** The control's text widget */
private StyledText fText;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java
index ee1b36c3039..c1050172f37 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java
@@ -27,10 +27,10 @@
public class OccurrencesFinder {
- private AntModel fAntModel;
- private AntEditor fEditor;
- private int fOffset;
- private IDocument fDocument;
+ private final AntModel fAntModel;
+ private final AntEditor fEditor;
+ private final int fOffset;
+ private final IDocument fDocument;
public OccurrencesFinder(AntEditor editor, AntModel model, IDocument document, int offset) {
fAntModel = model;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java
index b319a46409a..f01038dc7d8 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java
@@ -205,7 +205,8 @@ String getDescription(Element element) {
private Document parseFile(String aFileName) {
Document tempDocument = null;
- DocumentBuilderFactory tempFactory = DocumentBuilderFactory.newInstance();
+ @SuppressWarnings("restriction")
+ DocumentBuilderFactory tempFactory = org.eclipse.core.internal.runtime.XmlProcessorFactory.createDocumentBuilderFactoryWithErrorOnDOCTYPE();
tempFactory.setIgnoringComments(true);
tempFactory.setIgnoringElementContentWhitespace(true);
tempFactory.setCoalescing(true);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java
index 231f53b0fe3..47d95cca721 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java
@@ -30,7 +30,7 @@ public class XmlDocumentFormattingStrategy extends ContextBasedFormattingStrateg
private final LinkedList fDocuments = new LinkedList<>();
/** access to the preferences store * */
- private FormattingPreferences prefs;
+ private final FormattingPreferences prefs;
private int indent = -1;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java
index 052fd2fd2f2..c7e4f392684 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java
@@ -24,9 +24,9 @@ public class XmlTagFormatter {
public static class AttributePair {
- private String fAttribute;
- private String fValue;
- private char fQuote;
+ private final String fAttribute;
+ private final String fValue;
+ private final char fQuote;
public AttributePair(String attribute, String value, char attributeQuote) {
fAttribute = attribute;
@@ -58,7 +58,7 @@ public ParseException(String message) {
protected static class Tag {
- private List fAttributes = new ArrayList<>();
+ private final List fAttributes = new ArrayList<>();
private boolean fClosed;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorContentOutlinePage.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorContentOutlinePage.java
index a98ae87af75..11ab4d945bb 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorContentOutlinePage.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorContentOutlinePage.java
@@ -76,8 +76,8 @@ public class AntEditorContentOutlinePage extends ContentOutlinePage implements I
private IAntModelListener fListener;
private IAntModel fModel;
- private AntModelCore fCore;
- private ListenerList fPostSelectionChangedListeners = new ListenerList<>();
+ private final AntModelCore fCore;
+ private final ListenerList fPostSelectionChangedListeners = new ListenerList<>();
private boolean fIsModelEmpty = true;
private boolean fFilterInternalTargets;
private boolean fFilterImportedElements;
@@ -87,9 +87,9 @@ public class AntEditorContentOutlinePage extends ContentOutlinePage implements I
private ViewerComparator fComparator;
- private AntEditor fEditor;
+ private final AntEditor fEditor;
- private TogglePresentationAction fTogglePresentation;
+ private final TogglePresentationAction fTogglePresentation;
/**
* A viewer filter for the Ant Content Outline
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorMarkerUpdater.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorMarkerUpdater.java
index 30d5c2e4d7c..37163852e3f 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorMarkerUpdater.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/AntEditorMarkerUpdater.java
@@ -58,7 +58,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) {
}
private IAntModel fModel = null;
- private List fCollectedProblems = new ArrayList<>();
+ private final List fCollectedProblems = new ArrayList<>();
public static final String BUILDFILE_PROBLEM_MARKER = AntUIPlugin.PI_ANTUI + ".buildFileProblem"; //$NON-NLS-1$
private IFile fFile = null;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterImportedElementsAction.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterImportedElementsAction.java
index e0346f4fbf0..b87567523d2 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterImportedElementsAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterImportedElementsAction.java
@@ -23,7 +23,7 @@
*/
public class FilterImportedElementsAction extends Action {
- private AntEditorContentOutlinePage fPage;
+ private final AntEditorContentOutlinePage fPage;
public FilterImportedElementsAction(AntEditorContentOutlinePage page) {
super(AntOutlineMessages.FilterImportedElementsAction_0);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterInternalTargetsAction.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterInternalTargetsAction.java
index 2e76ae18ba3..c6c8d2bc9a2 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterInternalTargetsAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterInternalTargetsAction.java
@@ -23,7 +23,7 @@
*/
public class FilterInternalTargetsAction extends Action {
- private AntEditorContentOutlinePage fPage;
+ private final AntEditorContentOutlinePage fPage;
public FilterInternalTargetsAction(AntEditorContentOutlinePage page) {
super(AntOutlineMessages.FilterInternalTargetsAction_0);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterPropertiesAction.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterPropertiesAction.java
index 23b28e7d6ca..105d2bc6a03 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterPropertiesAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterPropertiesAction.java
@@ -23,7 +23,7 @@
*/
public class FilterPropertiesAction extends Action {
- private AntEditorContentOutlinePage fPage;
+ private final AntEditorContentOutlinePage fPage;
public FilterPropertiesAction(AntEditorContentOutlinePage page) {
super(AntOutlineMessages.FilterPropertiesAction_0);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterTopLevelAction.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterTopLevelAction.java
index 5d95e943ed9..654563fb07d 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterTopLevelAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/FilterTopLevelAction.java
@@ -23,7 +23,7 @@
*/
public class FilterTopLevelAction extends Action {
- private AntEditorContentOutlinePage fPage;
+ private final AntEditorContentOutlinePage fPage;
public FilterTopLevelAction(AntEditorContentOutlinePage page) {
super(AntOutlineMessages.FilterTopLevelAction_0);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/ToggleSortAntOutlineAction.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/ToggleSortAntOutlineAction.java
index c4b4c275715..aa33a191d67 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/ToggleSortAntOutlineAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/outline/ToggleSortAntOutlineAction.java
@@ -22,7 +22,7 @@
*/
public class ToggleSortAntOutlineAction extends Action {
- private AntEditorContentOutlinePage fPage;
+ private final AntEditorContentOutlinePage fPage;
public ToggleSortAntOutlineAction(AntEditorContentOutlinePage page) {
super(AntOutlineMessages.ToggleSortAntOutlineAction_0);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntContext.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntContext.java
index c86d34657e3..a0015b74770 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntContext.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntContext.java
@@ -30,7 +30,7 @@
public class AntContext extends DocumentTemplateContext {
- private IAntModel fAntModel;
+ private final IAntModel fAntModel;
public AntContext(TemplateContextType type, IDocument document, IAntModel model, Position position) {
super(type, document, position);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntTemplatePreferencePage.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntTemplatePreferencePage.java
index de7d787de61..e625ae3a5e4 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntTemplatePreferencePage.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/templates/AntTemplatePreferencePage.java
@@ -37,7 +37,7 @@
public class AntTemplatePreferencePage extends TemplatePreferencePage {
- private FormattingPreferences fFormattingPreferences = new FormattingPreferences();
+ private final FormattingPreferences fFormattingPreferences = new FormattingPreferences();
public AntTemplatePreferencePage() {
setPreferenceStore(AntUIPlugin.getDefault().getPreferenceStore());
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java
index 94284347028..3aacbdc4f48 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java
@@ -34,8 +34,8 @@
public class AntAnnotationModel extends ResourceMarkerAnnotationModel implements IProblemRequestor {
- private List fGeneratedAnnotations = new ArrayList<>();
- private List fCollectedProblems = new ArrayList<>();
+ private final List fGeneratedAnnotations = new ArrayList<>();
+ private final List fCollectedProblems = new ArrayList<>();
public AntAnnotationModel(IFile file) {
super(file);
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntEditorTagScanner.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntEditorTagScanner.java
index 260a45bd5f2..6ae593bea81 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntEditorTagScanner.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntEditorTagScanner.java
@@ -31,7 +31,7 @@
*/
public class AntEditorTagScanner extends AbstractAntEditorScanner {
- private Token fStringToken;
+ private final Token fStringToken;
public AntEditorTagScanner() {
fStringToken = new Token(createTextAttribute(IAntEditorColorConstants.STRING_COLOR, IAntEditorColorConstants.STRING_COLOR
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java
index 03381b2b406..172a0fe7ea3 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java
@@ -27,8 +27,8 @@
public class AntExternalAnnotationModel extends AnnotationModel implements IProblemRequestor {
- private List fGeneratedAnnotations = new ArrayList<>();
- private List fCollectedProblems = new ArrayList<>();
+ private final List fGeneratedAnnotations = new ArrayList<>();
+ private final List fCollectedProblems = new ArrayList<>();
@Override
public void acceptProblem(IProblem problem) {
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java
index 9aa82f2f9ab..320d5b1b9fa 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java
@@ -36,7 +36,7 @@
public class AntFoldingStructureProvider {
- private AntEditor fEditor;
+ private final AntEditor fEditor;
private IDocument fDocument;
/**
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java
index 78a713e79b6..02523e8a0bc 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java
@@ -23,7 +23,7 @@
public class NotifyingReconciler extends MonoReconciler {
- private ArrayList fReconcilingParticipants = new ArrayList<>();
+ private final ArrayList fReconcilingParticipants = new ArrayList<>();
/**
* Constructor for NotifyingReconciler.
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLProblemAnnotation.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLProblemAnnotation.java
index e2df76ee6e5..11a9cdd9b51 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLProblemAnnotation.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLProblemAnnotation.java
@@ -25,7 +25,7 @@ public class XMLProblemAnnotation extends Annotation {
public static final String WARNING_ANNOTATION_TYPE = "org.eclipse.ui.workbench.texteditor.warning"; //$NON-NLS-1$
public static final String INFO_ANNOTATION_TYPE = "org.eclipse.ui.workbench.texteditor.info"; //$NON-NLS-1$
- private IProblem fProblem;
+ private final IProblem fProblem;
public XMLProblemAnnotation(IProblem problem) {
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLReconcilingStrategy.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLReconcilingStrategy.java
index b9d0569e3d0..a21af38df51 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLReconcilingStrategy.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLReconcilingStrategy.java
@@ -32,7 +32,7 @@ public class XMLReconcilingStrategy implements IReconcilingStrategy, IReconcilin
*/
public static final int DELAY = 500;
- private AntEditor fEditor;
+ private final AntEditor fEditor;
public XMLReconcilingStrategy(AntEditor editor) {
fEditor = editor;
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java
index 44ab3ce4c92..0aea5d58e15 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/XMLTextHover.java
@@ -52,7 +52,7 @@
public class XMLTextHover implements ITextHover, ITextHoverExtension, IInformationProviderExtension2 {
- private AntEditor fEditor;
+ private final AntEditor fEditor;
public XMLTextHover(AntEditor editor) {
super();
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
index 89085f7ae88..f23384b0784 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
@@ -102,7 +102,7 @@ public static class ElementHandler extends ProjectHelper2.ElementHandler {
private UnknownElement task = null;
private Task currentTask = null;
- private Map fNormalizedFileNames = new HashMap<>();
+ private final Map fNormalizedFileNames = new HashMap<>();
@Override
public AntHandler onStartChild(String uri, String tag, String qname, Attributes attrs, AntXMLContext context) {
@@ -718,7 +718,7 @@ public void parse(Project project, Object source) throws BuildException {
newCurrent.setProject(project);
newCurrent.setName(IAntCoreConstants.EMPTY_STRING);
context.setCurrentTarget(newCurrent);
- context.setCurrentTargets(new HashMap());
+ context.setCurrentTargets(new HashMap<>());
context.setImplicitTarget(newCurrent);
parse(project, source, new RootHandler(context, mainHandler));
}
@@ -729,7 +729,7 @@ public void parse(Project project, Object source) throws BuildException {
}
} else {
// top level file
- context.setCurrentTargets(new HashMap());
+ context.setCurrentTargets(new HashMap<>());
parse(project, source, new RootHandler(context, mainHandler));
}
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntRunnerWorkbenchAdvisor.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntRunnerWorkbenchAdvisor.java
index dfb286c80ba..2bea8565439 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntRunnerWorkbenchAdvisor.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntRunnerWorkbenchAdvisor.java
@@ -25,7 +25,7 @@
*/
public class AntRunnerWorkbenchAdvisor extends WorkbenchAdvisor {
- private Object fContext;
+ private final Object fContext;
protected AntRunnerWorkbenchAdvisor(Object context) {
fContext = context;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
index 513a6684b26..36ad44e8436 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUIImages.java
@@ -17,7 +17,7 @@
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -116,7 +116,7 @@ private final static void declareRegistryImage(String key, String path) {
Bundle bundle = Platform.getBundle(AntUIPlugin.getUniqueIdentifier());
URL url = null;
if (bundle != null) {
- url = FileLocator.find(bundle, new Path(path), null);
+ url = FileLocator.find(bundle, IPath.fromOSString(path), null);
desc = ImageDescriptor.createFromURL(url);
}
imageRegistry.put(key, desc);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
index d3b5e95f60e..96922b3c37b 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java
@@ -51,7 +51,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
@@ -301,7 +300,7 @@ public IFile getFile() {
@Override
public IPath getLocation() {
if (file == null) {
- return new Path(buildFile.getAbsolutePath());
+ return IPath.fromOSString(buildFile.getAbsolutePath());
}
return file.getLocation();
}
@@ -316,7 +315,7 @@ public IPath getLocation() {
private static IDocument getDocument(File buildFile) {
ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
- IPath location = new Path(buildFile.getAbsolutePath());
+ IPath location = IPath.fromOSString(buildFile.getAbsolutePath());
boolean connected = false;
try {
ITextFileBuffer buffer = manager.getTextFileBuffer(location, LocationKind.NORMALIZE);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ExternalHyperlink.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ExternalHyperlink.java
index 95e17e795ca..945060bcfb0 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ExternalHyperlink.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ExternalHyperlink.java
@@ -32,8 +32,8 @@
public class ExternalHyperlink implements IHyperlink {
- private File fFile;
- private int fLineNumber;
+ private final File fFile;
+ private final int fLineNumber;
public ExternalHyperlink(File file, int lineNumber) {
super();
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ImageDescriptorRegistry.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ImageDescriptorRegistry.java
index 937ab52e6b6..879380cb64e 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ImageDescriptorRegistry.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ImageDescriptorRegistry.java
@@ -27,8 +27,8 @@
*/
public class ImageDescriptorRegistry {
- private Map fRegistry = Collections.synchronizedMap(new HashMap(10));
- private Display fDisplay;
+ private final Map fRegistry = Collections.synchronizedMap(new HashMap<>(10));
+ private final Display fDisplay;
/**
* Creates a new image descriptor registry for the current or default display, respectively.
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
index 10ec2f7ddcc..b5ad45ca92c 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java
@@ -25,7 +25,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.ui.console.FileLink;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -41,7 +41,7 @@ public abstract class AbstractJavacPatternMatcher implements IPatternMatchListen
protected TextConsole fConsole;
private static Pattern fgLineNumberPattern = Pattern.compile("\\d+"); //$NON-NLS-1$
private static List fgPatternMatchers = new ArrayList<>();
- private Map fFileNameToIFile = new HashMap<>();
+ private final Map fFileNameToIFile = new HashMap<>();
private JavacMarkerCreator fMarkerCreator;
protected static final Integer fgWarningType = Integer.valueOf(IMarker.SEVERITY_WARNING);
@@ -69,7 +69,7 @@ protected IFile getIFile(String filePath) {
}
IFile file = fFileNameToIFile.get(filePath);
if (file == null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new Path(filePath).toFile().toURI());
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(IPath.fromOSString(filePath).toFile().toURI());
if (files.length > 0) {
file = files[0];
fFileNameToIFile.put(filePath, file);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java
index d4c28233879..740169dc17f 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java
@@ -41,7 +41,7 @@ public class JavacMarkerCreator {
private final TextConsole fConsole;
private IProcess fProcess;
private static List fgFilesToBeCleaned = new ArrayList<>();
- private Map> fFileToMarkerInfo = new HashMap<>();
+ private final Map> fFileToMarkerInfo = new HashMap<>();
private final boolean fUseCustomMessage;
private static class MarkerInfo {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java
index 5d9dcdb6a75..303b7393fd0 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java
@@ -61,7 +61,7 @@
public class AntBuildfileExportPage extends WizardPage {
private CheckboxTableViewer fTableViewer;
- private List fSelectedJavaProjects = new ArrayList<>();
+ private final List fSelectedJavaProjects = new ArrayList<>();
private Button compatibilityCheckbox;
private Button compilerCheckbox;
private Text buildfilenameText;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
index 1d57dde1d8b..3977075cc9d 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java
@@ -41,7 +41,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -87,7 +86,7 @@ public String queryOverwrite(String file) {
private IAntModel fAntModel;
private TableViewer fTableViewer;
- private ModifyListener fLocationModifyListener = e -> {
+ private final ModifyListener fLocationModifyListener = e -> {
// no lexical or position, has task info
fAntModel = AntUtil.getAntModel(getProjectLocationFieldValue(), false, false, true);
AntProjectNode projectNode = fAntModel == null ? null : fAntModel.getProjectNode();
@@ -107,7 +106,7 @@ public String queryOverwrite(String file) {
setPageComplete(validatePage());
};
- private ModifyListener fNameModifyListener = e -> setPageComplete(validatePage());
+ private final ModifyListener fNameModifyListener = e -> setPageComplete(validatePage());
private static final int SIZING_TEXT_FIELD_WIDTH = 250;
@@ -278,7 +277,7 @@ private void handleBrowseButtonPressed() {
if (result == null) {
return;
}
- IPath filterPath = new Path(dialog.getFilterPath());
+ IPath filterPath = IPath.fromOSString(dialog.getFilterPath());
String buildFileName = dialog.getFileName();
IPath path = filterPath.append(buildFileName).makeAbsolute();
@@ -300,7 +299,7 @@ private boolean validatePage() {
return false;
}
- IPath path = new Path(IAntCoreConstants.EMPTY_STRING);
+ IPath path = IPath.fromOSString(IAntCoreConstants.EMPTY_STRING);
if (!path.isValidPath(locationFieldContents)) {
setErrorMessage(DataTransferMessages.AntNewJavaProjectPage_16);
return false;
@@ -425,7 +424,7 @@ protected void importBuildFile(IProgressMonitor monitor, IJavaProject javaProjec
IFile iBuildFile = project.getFile(buildFile.getName());
if (!iBuildFile.exists()) {
try {
- iBuildFile.createLink(new Path(buildFile.getAbsolutePath()), IResource.ALLOW_MISSING_LOCAL, monitor);
+ iBuildFile.createLink(IPath.fromOSString(buildFile.getAbsolutePath()), IResource.ALLOW_MISSING_LOCAL, monitor);
}
catch (CoreException e) {
ErrorDialog.openError(getShell(), DataTransferMessages.AntNewJavaProjectPage_22, null, e.getStatus());
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
index ce778b9ac0e..e13b9707d6f 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java
@@ -35,7 +35,7 @@
import java.util.TreeMap;
import java.util.TreeSet;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
@@ -48,7 +48,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.DebugPlugin;
@@ -91,14 +90,14 @@ public class BuildFileCreator {
protected static boolean CHECK_SOURCE_CYCLES = true;
protected static boolean CREATE_ECLIPSE_COMPILE_TARGET = true;
- private Document doc;
+ private final Document doc;
private Element root;
- private IJavaProject project;
- private String projectName;
- private String projectRoot;
- private Map variable2valueMap;
- private Shell shell;
- private Set visited = new TreeSet<>(); // record used subclasspaths
+ private final IJavaProject project;
+ private final String projectName;
+ private final String projectRoot;
+ private final Map variable2valueMap;
+ private final Shell shell;
+ private final Set visited = new TreeSet<>(); // record used subclasspaths
private Node classpathNode;
/**
@@ -115,8 +114,9 @@ public BuildFileCreator(IJavaProject project, Shell shell) throws ParserConfigur
this.projectName = project.getProject().getName();
this.projectRoot = ExportUtil.getProjectRoot(project);
this.variable2valueMap = new LinkedHashMap<>();
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- this.doc = dbf.newDocumentBuilder().newDocument();
+ @SuppressWarnings("restriction")
+ DocumentBuilder db = org.eclipse.core.internal.runtime.XmlProcessorFactory.createDocumentBuilderWithErrorOnDOCTYPE();
+ this.doc = db.newDocument();
this.shell = shell;
}
@@ -304,7 +304,9 @@ public void createImports() {
// child
Document docCandidate;
try {
- docCandidate = ExportUtil.parseXmlFile(file);
+ @SuppressWarnings("restriction")
+ Document doc1 = org.eclipse.core.internal.runtime.XmlProcessorFactory.parseWithErrorOnDOCTYPE(file);
+ docCandidate = doc1;
NodeList nodes = docCandidate.getChildNodes();
for (int j = 0; j < nodes.getLength(); j++) {
Node node = nodes.item(j);
@@ -392,7 +394,7 @@ public void createClasspaths(String pathId, IJavaProject currentProject, Eclipse
{
String currentProjectRoot = ExportUtil.getProjectRoot(currentProject);
entry = ExportUtil.getRelativePath(entry, currentProjectRoot);
- if (!new Path(entry).isAbsolute()) {
+ if (!IPath.fromOSString(entry).isAbsolute()) {
prefix = "${" + currentProject.getProject().getName() + ".location}/"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
index 81753bea0fd..ac80bfa594a 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java
@@ -15,6 +15,7 @@
package org.eclipse.ant.internal.ui.datatransfer;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
@@ -30,7 +31,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -57,7 +57,7 @@ public class EclipseClasspath {
protected List rawClassPathEntries = new ArrayList<>();
protected List rawClassPathEntriesAbsolute = new ArrayList<>();
- private IJavaProject project;
+ private final IJavaProject project;
private static Map userLibraryCache = new HashMap<>();
@@ -467,7 +467,9 @@ public String resolveLinkedResource(String s) {
*/
private IClasspathEntry convertVariableClasspathEntry(IRuntimeClasspathEntry entry) {
try {
- Document doc = ExportUtil.parseXmlString(entry.getMemento());
+ ByteArrayInputStream is = new ByteArrayInputStream(entry.getMemento().getBytes());
+ @SuppressWarnings("restriction")
+ Document doc = org.eclipse.core.internal.runtime.XmlProcessorFactory.parseWithErrorOnDOCTYPE(is);
Element element = (Element) doc.getElementsByTagName("memento").item(0); //$NON-NLS-1$
String variableString = element.getAttribute("variableString"); //$NON-NLS-1$
ExportUtil.addVariable(variable2valueMap, variableString, ExportUtil.getProjectRoot(project));
@@ -477,7 +479,7 @@ private IClasspathEntry convertVariableClasspathEntry(IRuntimeClasspathEntry ent
if (i != -1) {
variableString = variableString.substring(0, i) + variableString.substring(i + 1);
}
- IPath path = new Path(variableString);
+ IPath path = IPath.fromOSString(variableString);
return JavaCore.newVariableEntry(path, null, null);
}
catch (Exception e) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
index 77589302c1b..dc222239cf1 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java
@@ -19,7 +19,6 @@
package org.eclipse.ant.internal.ui.datatransfer;
import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
@@ -38,8 +37,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -65,7 +62,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jdt.core.IClasspathEntry;
@@ -81,7 +77,6 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
/**
* Collection of utility methods to help when exporting to an Ant build file.
@@ -171,7 +166,7 @@ public static String resolve(IPath file) {
* Get Java project for given root.
*/
public static IJavaProject getJavaProject(String root) {
- IPath path = new Path(root);
+ IPath path = IPath.fromOSString(root);
if (path.segmentCount() == 1) {
return getJavaProjectByName(root);
}
@@ -463,7 +458,8 @@ public static String toString(Document doc) throws TransformerConfigurationExcep
StringWriter writer = new StringWriter();
Source source = new DOMSource(doc);
Result result = new StreamResult(writer);
- TransformerFactory factory = TransformerFactory.newInstance();
+ @SuppressWarnings("restriction")
+ TransformerFactory factory = org.eclipse.core.internal.runtime.XmlProcessorFactory.createTransformerFactoryWithErrorOnDOCTYPE();
// https://ant.apache.org/manual/Tasks/style.html
// Need this feature to set true for Java 9 to enable extension Functions in the presence of Security manager
factory.setFeature("http://www.oracle.com/xml/jaxp/properties/enableExtensionFunctions", Boolean.TRUE); //$NON-NLS-1$
@@ -486,26 +482,6 @@ public static String toString(Document doc) throws TransformerConfigurationExcep
return writer.toString();
}
- /**
- * Read XML file.
- */
- public static Document parseXmlFile(File file) throws SAXException, IOException, ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- Document doc = factory.newDocumentBuilder().parse(file);
- return doc;
- }
-
- /**
- * Read XML string.
- */
- public static Document parseXmlString(String s) throws SAXException, IOException, ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(s.getBytes()));
- return doc;
- }
-
/**
* Converts collection to a separated string.
*
@@ -700,8 +676,8 @@ public static void addVariable(Map variable2valueMap, String s,
*/
public static String getRelativePath(String otherLocation, String basePath) {
- IPath location = new Path(otherLocation);
- IPath base = new Path(basePath);
+ IPath location = IPath.fromOSString(otherLocation);
+ IPath base = IPath.fromOSString(basePath);
if ((location.getDevice() != null && !location.getDevice().equalsIgnoreCase(base.getDevice())) || !location.isAbsolute()) {
return otherLocation;
}
@@ -711,7 +687,7 @@ public static String getRelativePath(String otherLocation, String basePath) {
for (int j = 0; j < baseCount - count; j++) {
temp += "../"; //$NON-NLS-1$
}
- String relative = new Path(temp).append(location.removeFirstSegments(count)).toString();
+ String relative = IPath.fromOSString(temp).append(location.removeFirstSegments(count)).toString();
if (relative.length() == 0) {
relative = "."; //$NON-NLS-1$
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
index f88bb8bab51..518f1d34e00 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ProjectCreator.java
@@ -30,7 +30,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -51,7 +50,7 @@ public IJavaProject createJavaProjectFromJavacNode(String projectName, Javac jav
createSourceDirectories(destDir, destDirName, sourceDirs, javaProject, monitor);
// add rt.jar
- addVariableEntry(javaProject, new Path(JavaRuntime.JRELIB_VARIABLE), new Path(JavaRuntime.JRESRC_VARIABLE), new Path(JavaRuntime.JRESRCROOT_VARIABLE), monitor);
+ addVariableEntry(javaProject, IPath.fromOSString(JavaRuntime.JRELIB_VARIABLE), IPath.fromOSString(JavaRuntime.JRESRC_VARIABLE), IPath.fromOSString(JavaRuntime.JRESRCROOT_VARIABLE), monitor);
setClasspath(javacTask, javaProject, monitor);
@@ -73,9 +72,9 @@ private void setClasspath(Javac javacTask, IJavaProject javaProject, IProgressMo
for (String cp : classpath.list()) {
File classpathEntry = new File(cp);
if (classpathEntry.isFile()) {
- addLibrary(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
+ addLibrary(javaProject, IPath.fromOSString(classpathEntry.getAbsolutePath()), monitor);
} else {
- addContainer(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
+ addContainer(javaProject, IPath.fromOSString(classpathEntry.getAbsolutePath()), monitor);
}
}
}
@@ -143,7 +142,7 @@ private void addSourceContainer(IJavaProject jproject, String srcName, String sr
} else {
IFolder folder = project.getFolder(srcName);
if (!folder.exists()) {
- folder.createLink(new Path(srcPath), IResource.ALLOW_MISSING_LOCAL, monitor);
+ folder.createLink(IPath.fromOSString(srcPath), IResource.ALLOW_MISSING_LOCAL, monitor);
}
container = folder;
}
@@ -153,7 +152,7 @@ private void addSourceContainer(IJavaProject jproject, String srcName, String sr
if (outputName != null) {
IFolder outputFolder = project.getFolder(outputName);
if (!outputFolder.exists()) {
- outputFolder.createLink(new Path(outputPath), IResource.ALLOW_MISSING_LOCAL, monitor);
+ outputFolder.createLink(IPath.fromOSString(outputPath), IResource.ALLOW_MISSING_LOCAL, monitor);
}
output = outputFolder.getFullPath();
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java
index a38e1918235..dc3d6deb182 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java
@@ -59,12 +59,12 @@ public class AntBuilderTargetsTab extends AbstractLaunchConfigurationTab {
private Text fAutoBuildTargetText;
private Text fDuringCleanTargetText;
- private Map fAttributeToTargets = new HashMap<>();
+ private final Map fAttributeToTargets = new HashMap<>();
private static final String NOT_ENABLED = AntLaunchConfigurationMessages.AntBuilderTargetsTab_0;
private static final String DEFAULT_TARGET_SELECTED = AntLaunchConfigurationMessages.AntBuilderTargetsTab_10;
- private SelectionListener fSelectionListener = new SelectionAdapter() {
+ private final SelectionListener fSelectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String attribute = null;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java
index 935652ca32a..2f9240188f9 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java
@@ -46,8 +46,8 @@ public class AntJRETab extends JavaJRETab {
private static final String MAIN_TYPE_NAME = "org.eclipse.ant.internal.launching.remote.InternalAntRunner"; //$NON-NLS-1$
- private VMArgumentsBlock fVMArgumentsBlock = new VMArgumentsBlock();
- private AntWorkingDirectoryBlock fWorkingDirectoryBlock = new AntWorkingDirectoryBlock();
+ private final VMArgumentsBlock fVMArgumentsBlock = new VMArgumentsBlock();
+ private final AntWorkingDirectoryBlock fWorkingDirectoryBlock = new AntWorkingDirectoryBlock();
@Override
public void createControl(Composite parent) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java
index 91979a07bc7..a68bc2798a5 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java
@@ -51,7 +51,7 @@
public class AntPropertiesTab extends AbstractLaunchConfigurationTab implements IAntBlockContainer {
private Button fUseDefaultButton;
- private AntPropertiesBlock fAntPropertiesBlock = new AntPropertiesBlock(this);
+ private final AntPropertiesBlock fAntPropertiesBlock = new AntPropertiesBlock(this);
private boolean fSeparateJRE = true;
@Override
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java
index 60813599210..3d0784f631f 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java
@@ -38,7 +38,7 @@
*/
public class EditAntHomeEntryAction extends RuntimeClasspathAction {
- private AntClasspathTab fTab;
+ private final AntClasspathTab fTab;
/**
* Constructs an action to edit the Ant Home setting for a launch config.
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java
index 1da7c503d1d..40db187eee1 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java
@@ -30,7 +30,7 @@ public class SetTargetsDialog extends Dialog {
private static String DIALOG_SETTINGS_SECTION = "SetTargetsDialogSettings"; //$NON-NLS-1$
- private ILaunchConfigurationWorkingCopy fConfiguration;
+ private final ILaunchConfigurationWorkingCopy fConfiguration;
private AntTargetsTab fTargetsTab;
public SetTargetsDialog(Shell parentShell, ILaunchConfigurationWorkingCopy config) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
index 397a1ebe504..e550e330771 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java
@@ -38,7 +38,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -221,7 +221,7 @@ public void setFilePath(String path) {
URL fileURL = FileLocator.toFileURL(url);
// To be worked in 4.6 via Bug 476266
if (IAntCoreConstants.FILE.equals(fileURL.getProtocol())) {
- fFilePath = new Path((URIUtil.toFile(URIUtil.toURI(fileURL))).getAbsolutePath()).toString();
+ fFilePath = IPath.fromOSString((URIUtil.toFile(URIUtil.toURI(fileURL))).getAbsolutePath()).toString();
}
}
catch (URISyntaxException e) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
index 43d1950eb4e..2a8dc2b171e 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
@@ -132,14 +132,14 @@ public class AntModel implements IAntModel {
private AntEditorMarkerUpdater fMarkerUpdater = null;
private List fNonStructuralNodes = new ArrayList<>(1);
- private IPreferenceChangeListener fCoreListener = event -> {
+ private final IPreferenceChangeListener fCoreListener = event -> {
if (IAntCoreConstants.PREFERENCE_CLASSPATH_CHANGED.equals(event.getKey())) {
if (Boolean.parseBoolean((String) event.getNewValue()) == true) {
reconcileForPropertyChange(true);
}
}
};
- private IPreferenceChangeListener fUIListener = new IPreferenceChangeListener() {
+ private final IPreferenceChangeListener fUIListener = new IPreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent event) {
String property = event.getKey();
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelChangeEvent.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelChangeEvent.java
index 4f228ec024a..b3e83b71af2 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelChangeEvent.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelChangeEvent.java
@@ -16,7 +16,7 @@
public class AntModelChangeEvent {
- private IAntModel fModel;
+ private final IAntModel fModel;
private boolean fPreferenceChange = false;
public AntModelChangeEvent(IAntModel model) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java
index 803d0f8fd81..ab816cfb804 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java
@@ -42,7 +42,7 @@ public static AntModelCore getDefault() {
return inst;
}
- private List fModelChangeListeners = new ArrayList<>();
+ private final List fModelChangeListeners = new ArrayList<>();
private AntModelCore() {
}
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProblem.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProblem.java
index e667904aa02..a50572f3880 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProblem.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProblem.java
@@ -26,9 +26,9 @@ public class AntModelProblem extends Region implements IProblem {
public static final int SEVERITY_ERROR = 1;
public static final int SEVERITY_FATAL_ERROR = 2;
- private String fMessage;
- private String fEscapedMessage;
- private int fSeverity;
+ private final String fMessage;
+ private final String fEscapedMessage;
+ private final int fSeverity;
private int fAdjustedLength = -1;
private int fLineNumber = -1;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
index 50fd8d1aa9d..2c5321e455e 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
@@ -55,7 +55,7 @@ public boolean set(String property, Object value, PropertyHelper propertyHelper)
}
private AntPropertyNode fCurrentConfiguringPropertyNode;
- private Map idrefs = Collections.synchronizedMap(new HashMap<>());
+ private final Map idrefs = Collections.synchronizedMap(new HashMap<>());
private static Object loaderLock = new Object();
private Hashtable loaders = null;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNodeProxy.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNodeProxy.java
index d7db3347fcf..37f72f30e0a 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNodeProxy.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNodeProxy.java
@@ -23,7 +23,7 @@
public class AntProjectNodeProxy extends AntProjectNode {
- private String fBuildFileName;
+ private final String fBuildFileName;
private String fDefaultTargetName;
private boolean fParsed = false;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/LocationProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/LocationProvider.java
index 6d3ae29a86c..c1a7e51cd8c 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/LocationProvider.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/LocationProvider.java
@@ -20,7 +20,7 @@
import org.eclipse.ui.editors.text.ILocationProvider;
public class LocationProvider {
- private IEditorInput fEditorInput;
+ private final IEditorInput fEditorInput;
public LocationProvider(IEditorInput input) {
fEditorInput = input;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java
index 074cd4f660f..1dfc8fa7a81 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java
@@ -48,8 +48,8 @@ public abstract class AbstractAntEditorPreferencePage extends PreferencePage imp
protected List fStatusList;
private boolean fInitialized = false;
- private Map
* @return the java.util.Map of preferred delegates or an empty java.util.Map if no preferred delegates are specified, never null
*
* @since 3.3
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 457712edb2e..27df21ca4cd 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -21,7 +21,6 @@
import java.io.BufferedInputStream;
-import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -30,7 +29,6 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -44,12 +42,10 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
@@ -443,7 +439,7 @@ public void run() throws Exception {
*/
static class ResourceProxyVisitor implements IResourceProxyVisitor {
- private List fList;
+ private final List fList;
protected ResourceProxyVisitor(List list) {
fList= list;
@@ -502,8 +498,8 @@ public ILaunchDelegate getDelegate() {
* The collection of native environment variables on the user's system. Cached
* after being computed once as the environment cannot change.
*/
- private static HashMap fgNativeEnv = null;
- private static HashMap fgNativeEnvCasePreserved = null;
+ private static HashMap fgNativeEnv;
+ private static Map fgNativeEnvCasePreserved;
/**
* Path to the local directory where local launch configurations
@@ -519,8 +515,8 @@ public ILaunchDelegate getDelegate() {
* @since 3.0
*/
public static Document getDocument() throws ParserConfigurationException {
- DocumentBuilderFactory dfactory= DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder= dfactory.newDocumentBuilder();
+ @SuppressWarnings("restriction")
+ DocumentBuilder docBuilder = org.eclipse.core.internal.runtime.XmlProcessorFactory.createDocumentBuilderWithErrorOnDOCTYPE();
return docBuilder.newDocument();
}
@@ -551,7 +547,8 @@ public static String serializeDocument(Document doc) throws TransformerException
*/
public static String serializeDocument(Document doc, String lineDelimiter) throws TransformerException, IOException {
ByteArrayOutputStream s = new ByteArrayOutputStream();
- TransformerFactory factory = TransformerFactory.newInstance();
+ @SuppressWarnings("restriction")
+ TransformerFactory factory = org.eclipse.core.internal.runtime.XmlProcessorFactory.createTransformerFactoryWithErrorOnDOCTYPE();
Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
@@ -571,7 +568,7 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw
* Launch configuration cache. Keys are LaunchConfiguration,
* values are LaunchConfigurationInfo.
*/
- private Map fLaunchConfigurations = new HashMap<>(10);
+ private final Map fLaunchConfigurations = new HashMap<>(10);
/**
* A cache of launch configuration names currently in the workspace.
@@ -611,13 +608,13 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw
/**
* Collection of launches
*/
- private List fLaunches = new ArrayList<>(10);
+ private final List fLaunches = new ArrayList<>(10);
/**
* Set of launches for efficient 'isRegistered()' check TODO remove this -
* Launches don't implement hashCode() or equals() - so its no more
* efficient than walking the other collection
*/
- private Set fLaunchSet = new HashSet<>(10);
+ private final Set fLaunchSet = new HashSet<>(10);
/**
* Collection of listeners
@@ -726,129 +723,6 @@ public void addLaunchListener(ILaunchListener listener) {
fListeners.add(listener);
}
- /**
- * Computes and caches the native system environment variables as a map of
- * variable names and values (Strings) in the given map.
- *
- * Note that WIN32 system environment preserves
- * the case of variable names but is otherwise case insensitive.
- * Depending on what you intend to do with the environment, the
- * lack of normalization may or may not be create problems. This
- * method preserves mixed-case keys using the variable names
- * recorded by the OS.
- *
- * @param cache the map
- * @since 3.1
- */
- private void cacheNativeEnvironment(Map cache) {
- try {
- String nativeCommand= null;
- boolean isWin9xME= false; //see bug 50567
- String fileName= null;
- if (Platform.getOS().equals(Constants.OS_WIN32)) {
- String osName= System.getProperty("os.name"); //$NON-NLS-1$
- isWin9xME= osName != null && (osName.startsWith("Windows 9") || osName.startsWith("Windows ME")); //$NON-NLS-1$ //$NON-NLS-2$
- if (isWin9xME) {
- // Win 95, 98, and ME
- // SET might not return therefore we pipe into a file
- IPath stateLocation= DebugPlugin.getDefault().getStateLocation();
- fileName= stateLocation.toOSString() + File.separator + "env.txt"; //$NON-NLS-1$
- nativeCommand= "command.com /C set > " + fileName; //$NON-NLS-1$
- } else {
- // Win NT, 2K, XP
- nativeCommand= "cmd.exe /C set"; //$NON-NLS-1$
- }
- } else if (!Platform.getOS().equals(Constants.OS_UNKNOWN)){
- nativeCommand= "env"; //$NON-NLS-1$
- }
- if (nativeCommand == null) {
- return;
- }
- Process process= Runtime.getRuntime().exec(nativeCommand);
- if (isWin9xME) {
- //read piped data on Win 95, 98, and ME
- Properties p= new Properties();
- File file= new File(fileName);
- try(InputStream stream = new BufferedInputStream(new FileInputStream(file))){
- p.load(stream);
- if (!file.delete()) {
- file.deleteOnExit(); // if delete() fails try again on VM close
- }
- for (Entry entry : p.entrySet()) {
- // Win32's environment variables are case insensitive. Put everything
- // to uppercase so that (for example) the "PATH" variable will match
- // "pAtH" correctly on Windows.
- String key = (String) entry.getKey();
- //no need to cast value
- cache.put(key, (String) p.get(key));
- }
- }
- } else {
- //read process directly on other platforms
- //we need to parse out matching '{' and '}' for function declarations in .bash environments
- // pattern is [func name]=() { and we must find the '}' on its own line with no trailing ';'
- try (InputStream stream = process.getInputStream();
- InputStreamReader isreader = new InputStreamReader(stream);
- BufferedReader reader = new BufferedReader(isreader)) {
- String line = reader.readLine();
- String key = null;
- String value = null;
- String newLine = System.lineSeparator();
- while (line != null) {
- int func = line.indexOf("=()"); //$NON-NLS-1$
- if (func > 0) {
- key = line.substring(0, func);
- // scan until we find the closing '}' with no
- // following chars
- value = line.substring(func + 1);
- while (line != null && !line.equals("}")) { //$NON-NLS-1$
- line = reader.readLine();
- if (line != null) {
- value += newLine + line;
- }
- }
- line = reader.readLine();
- }
- else {
- int separator = line.indexOf('=');
- if (separator > 0) {
- key = line.substring(0, separator);
- value = line.substring(separator + 1);
- line = reader.readLine();
- if (line != null) {
- // this line has a '=' read ahead to check
- // next line for '=', might be broken on
- // more than one line
- // also if line starts with non-identifier -
- // it is remainder of previous variable
- while (line.indexOf('=') < 0 || (line.length() > 0 && !Character.isJavaIdentifierStart(line.charAt(0)))) {
- value += newLine + line;
- line = reader.readLine();
- if (line == null) {
- // if next line read is the end of
- // the file quit the loop
- break;
- }
- }
- }
- }
- }
- if (key != null) {
- cache.put(key, value);
- key = null;
- value = null;
- } else {
- line = reader.readLine();
- }
- }
- }
- }
- } catch (IOException e) {
- // Native environment-fetching code failed.
- // This can easily happen and is not useful to log.
- }
- }
-
/**
* Clears all launch configurations (if any have been accessed)
*/
@@ -947,7 +821,8 @@ protected LaunchConfigurationInfo createInfoFromXML(InputStream stream) throws C
*/
protected LaunchConfigurationInfo createInfoFromXML(InputStream stream, boolean isPrototype) throws CoreException, ParserConfigurationException, IOException, SAXException {
Element root = null;
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ @SuppressWarnings("restriction")
+ DocumentBuilder parser = org.eclipse.core.internal.runtime.XmlProcessorFactory.createDocumentBuilderWithErrorOnDOCTYPE();
parser.setErrorHandler(new DefaultHandler());
root = parser.parse(new InputSource(stream)).getDocumentElement();
LaunchConfigurationInfo info = new LaunchConfigurationInfo();
@@ -1814,8 +1689,7 @@ public synchronized Map getNativeEnvironment() {
@Override
public synchronized Map getNativeEnvironmentCasePreserved() {
if (fgNativeEnvCasePreserved == null) {
- fgNativeEnvCasePreserved = new HashMap<>();
- cacheNativeEnvironment(fgNativeEnvCasePreserved);
+ fgNativeEnvCasePreserved = System.getenv();
}
return new HashMap<>(fgNativeEnvCasePreserved);
}
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
index 221da791538..04deb531243 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java
@@ -29,7 +29,7 @@
*/
public class LaunchMode implements ILaunchMode {
- private IConfigurationElement fConfigurationElement;
+ private final IConfigurationElement fConfigurationElement;
/**
* Constructs a new launch mode.
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java
index b147cccf465..086a66b013f 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java
@@ -29,9 +29,9 @@
*/
public class LogicalStructureProvider {
- private IConfigurationElement fConfigurationElement;
+ private final IConfigurationElement fConfigurationElement;
- private String fModelIdentifier;
+ private final String fModelIdentifier;
private ILogicalStructureProvider fDelegate;
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
index 074fc67d74e..c48b8084132 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
@@ -33,7 +33,7 @@
*/
public class LogicalStructureType implements ILogicalStructureType, ILogicalStructureTypeDelegate3 {
- private IConfigurationElement fConfigurationElement;
+ private final IConfigurationElement fConfigurationElement;
private ILogicalStructureTypeDelegate fDelegate;
private String fModelId;
// whether the 'description' attribute has been verified to exist: it is only
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
index a7ce39e00e5..f1066b93428 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
@@ -23,8 +23,8 @@
import org.eclipse.debug.core.model.IStreamMonitor;
public class NullStreamsProxy implements IBinaryStreamsProxy {
- private NullStreamMonitor outputStreamMonitor;
- private NullStreamMonitor errorStreamMonitor;
+ private final NullStreamMonitor outputStreamMonitor;
+ private final NullStreamMonitor errorStreamMonitor;
@SuppressWarnings("resource")
public NullStreamsProxy(Process process) {
@@ -65,7 +65,7 @@ public void write(byte[] data, int offset, int length) throws IOException {
}
private static class NullStreamMonitor implements IBinaryStreamMonitor {
- private InputStream fStream;
+ private final InputStream fStream;
public NullStreamMonitor(InputStream stream) {
fStream = stream;
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
index f6932bbbc62..585e1a3cb47 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
@@ -45,17 +45,17 @@ public class OutputStreamMonitor implements IBinaryStreamMonitor {
/**
* The stream being monitored (connected system out or err).
*/
- private InputStream fStream;
+ private final InputStream fStream;
/**
* A collection of listeners interested in decoded content.
*/
- private ListenerList fListeners = new ListenerList<>();
+ private final ListenerList fListeners = new ListenerList<>();
/**
* A collection of listeners interested in the raw content.
*/
- private ListenerList fBinaryListeners = new ListenerList<>();
+ private final ListenerList fBinaryListeners = new ListenerList<>();
/**
* The buffered stream content since last flush. Value of null
@@ -83,9 +83,9 @@ public class OutputStreamMonitor implements IBinaryStreamMonitor {
*/
private boolean fKilled = false;
- private Charset fCharset;
+ private final Charset fCharset;
- private StreamDecoder fDecoder;
+ private final StreamDecoder fDecoder;
private final AtomicBoolean fDone;
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilter.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilter.java
index 8d93c0fc6cf..b33b920863e 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilter.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilter.java
@@ -25,9 +25,9 @@
*/
public class StepFilter {
- private IConfigurationElement fConfigurationElement;
+ private final IConfigurationElement fConfigurationElement;
- private String fModelIdentifier;
+ private final String fModelIdentifier;
private IStepFilter fDelegate;
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
index 3996d954632..4c636238aaf 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
@@ -76,7 +76,7 @@ public StreamsProxy(Process process, Charset charset, String suffix) {
*
* @param process system process to create a streams proxy on
* @param encoding the process's encoding or null if default
- * @deprecated use {@link #StreamsProxy(Process, Charset)} instead
+ * @deprecated use {@link #StreamsProxy(Process, Charset, String)} instead
*/
@Deprecated
public StreamsProxy(Process process, String encoding) {
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
index 55ad375a5b1..aa5191f177b 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
@@ -19,10 +19,8 @@
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
-import java.util.Arrays;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.debug.core.DebugPlugin;
@@ -40,11 +38,9 @@
* An XML memento. Copied from workspace plug-in.
*/
public final class XMLMemento {
- private Document factory;
+ private final Document factory;
- private Element element;
-
- private static String FILE_STRING = "file"; //$NON-NLS-1$
+ private final Element element;
/**
* Creates a Document from the Reader
@@ -63,27 +59,6 @@ public static XMLMemento createReadRoot(Reader reader)
return createReadRoot(reader, null);
}
- /**
- * Clients who need to use the "file" protocol can override this method to
- * return the original attribute value
- *
- * @param attributeOldValue
- * @return return the new attribute value after concatenating the "file"
- * protocol restriction if does not exist already
- */
- private static String getAttributeNewValue(Object attributeOldValue) {
- StringBuffer strNewValue = new StringBuffer(FILE_STRING);
- if (attributeOldValue instanceof String && ((String) attributeOldValue).length() != 0) {
- String strOldValue = (String) attributeOldValue;
- boolean exists = Arrays.asList(strOldValue.split(",")).stream().anyMatch(x -> x.trim().equals(FILE_STRING)); //$NON-NLS-1$
- if (!exists) {
- strNewValue.append(", ").append(strOldValue); //$NON-NLS-1$
- } else {
- strNewValue = new StringBuffer(strOldValue);
- }
- }
- return strNewValue.toString();
- }
/**
* Creates a Document from the Reader
* and returns a memento on the first Element for reading
@@ -102,26 +77,13 @@ public static XMLMemento createReadRoot(Reader reader, String baseDir)
throws Exception {
String errorMessage = null;
Exception exception = null;
- DocumentBuilderFactory factory = null;
- Object attributeDTDOldValue = null;
- Object attributeSchemaOldValue = null;
try {
- factory = DocumentBuilderFactory.newInstance();
- try {
- attributeDTDOldValue = factory.getAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD);
- attributeSchemaOldValue = factory.getAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA);
- } catch (NullPointerException | IllegalArgumentException e) {
- // Attributes not defined
- }
- factory.setAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, getAttributeNewValue(attributeDTDOldValue));
- factory.setAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA, getAttributeNewValue(attributeSchemaOldValue));
-
- DocumentBuilder parser = factory.newDocumentBuilder();
InputSource source = new InputSource(reader);
if (baseDir != null) {
source.setSystemId(baseDir);
}
- Document document = parser.parse(source);
+ @SuppressWarnings("restriction")
+ Document document = org.eclipse.core.internal.runtime.XmlProcessorFactory.parseWithErrorOnDOCTYPE(source);
NodeList list = document.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
@@ -138,11 +100,6 @@ public static XMLMemento createReadRoot(Reader reader, String baseDir)
} catch (SAXException e) {
exception = e;
// errorMessage = WorkbenchMessages.XMLMemento_formatError;
- } finally {
- if (factory != null) {
- factory.setAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, attributeDTDOldValue);
- factory.setAttribute(javax.xml.XMLConstants.ACCESS_EXTERNAL_SCHEMA, attributeSchemaOldValue);
- }
}
String problemText = null;
@@ -165,8 +122,9 @@ public static XMLMemento createReadRoot(Reader reader, String baseDir)
public static XMLMemento createWriteRoot(String type) {
Document document;
try {
- document = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder().newDocument();
+ @SuppressWarnings("restriction")
+ DocumentBuilder b = org.eclipse.core.internal.runtime.XmlProcessorFactory.createDocumentBuilderWithErrorOnDOCTYPE();
+ document = b.newDocument();
Element element = document.createElement(type);
document.appendChild(element);
return new XMLMemento(document, element);
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java
index 14c8f661ace..76ee89938db 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java
@@ -22,7 +22,7 @@
*/
public class DebugCommandRequest extends Request implements IDebugCommandRequest {
- private Object[] fElements;
+ private final Object[] fElements;
public DebugCommandRequest(Object[] elements) {
fElements = elements;
diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
index c87f63bcfd2..0a63d2daa34 100644
--- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
+++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
@@ -52,7 +52,7 @@ public class GroupLaunch extends Launch implements ILaunchesListener2 {
* A map of all our sub-launches and the current processes that belong to
* each one.
*/
- private Map subLaunches = new HashMap<>();
+ private final Map subLaunches = new HashMap<>();
public GroupLaunch(ILaunchConfiguration launchConfiguration, String mode) {
super(launchConfiguration, mode, null);
diff --git a/debug/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
index 4071d5dc939..dc925894616 100644
--- a/debug/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
@@ -2,14 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.debug.examples.core;singleton:=true
-Bundle-Version: 1.6.100.qualifier
+Bundle-Version: 1.6.200.qualifier
Bundle-Activator: org.eclipse.debug.examples.core.pda.DebugCorePlugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.core.variables;bundle-version="3.2.800",
org.eclipse.debug.core;bundle-version="3.9.0",
org.apache.ant;bundle-version="1.9.2";resolution:=optional
-Eclipse-LazyStart: true
Export-Package: org.eclipse.debug.examples.ant.tasks;x-friends:="org.eclipse.debug.examples.ui",
org.eclipse.debug.examples.core.midi.launcher;x-friends:="org.eclipse.debug.examples.ui",
org.eclipse.debug.examples.core.pda;x-friends:="org.eclipse.debug.examples.ui",
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java
index 0f810255f5d..d3df4ca3d88 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java
@@ -29,12 +29,12 @@ public abstract class SequencerControl {
/**
* The launch
*/
- private MidiLaunch fLaunch;
+ private final MidiLaunch fLaunch;
/**
* Control name
*/
- private String fName;
+ private final String fName;
/**
* Constructs a control with the given name.
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java
index df56a425106..ccaae040685 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java
@@ -21,8 +21,8 @@
public class PDAArrayEntry extends PDADebugElement implements IVariable {
- private IValue fValue;
- private int fIndex;
+ private final IValue fValue;
+ private final int fIndex;
/**
* Constructs a new array entry
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
index fad0639f3a5..bdd375a09f9 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
@@ -71,10 +71,10 @@
public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBreakpointManagerListener, IPDAEventListener {
// associated system process (VM)
- private IProcess fProcess;
+ private final IProcess fProcess;
// containing launch object
- private ILaunch fLaunch;
+ private final ILaunch fLaunch;
// sockets to communicate with VM
private Socket fRequestSocket;
@@ -90,13 +90,13 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
private boolean fTerminated = false;
// threads
- private Map fThreads = Collections.synchronizedMap(new LinkedHashMap<>());
+ private final Map fThreads = Collections.synchronizedMap(new LinkedHashMap<>());
// event dispatch job
- private EventDispatchJob fEventDispatch;
+ private final EventDispatchJob fEventDispatch;
// event listeners
- private List fEventListeners = Collections.synchronizedList(new ArrayList<>());
+ private final List fEventListeners = Collections.synchronizedList(new ArrayList<>());
/**
* Listens to events from the PDA VM and fires corresponding
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
index 08086998dfe..8bf516c7940 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
@@ -26,7 +26,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
* The bytes
*/
private byte[] fBytes = null;
- private long fStart, fLength;
+ private final long fStart, fLength;
/**
* Constructs a new memory block
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
index 761ea8211e4..b2235efd6bc 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
@@ -28,11 +28,11 @@
*/
public class PDAStackFrame extends PDADebugElement implements IStackFrame {
- private PDAThread fThread;
+ private final PDAThread fThread;
private String fName;
private int fPC;
private IPath fFilePath;
- private int fId;
+ private final int fId;
/**
* Constructs a stack frame in the given thread with the given
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
index d9bcd16ba2f..e45dae7556c 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
@@ -79,7 +79,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/**
* Table mapping stack frames to current variables
*/
- private Map fVariables = Collections.synchronizedMap(new HashMap());
+ private final Map fVariables = Collections.synchronizedMap(new HashMap());
/**
* Constructs a new thread for the given target
diff --git a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
index 4db49c20989..301709f47b1 100644
--- a/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
+++ b/debug/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
@@ -30,8 +30,8 @@
public class PDAVariable extends PDADebugElement implements IVariable {
// name & stack frmae
- private String fName;
- private PDAStackFrame fFrame;
+ private final String fName;
+ private final PDAStackFrame fFrame;
/**
* Constructs a variable contained in the given stack frame
diff --git a/debug/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java b/debug/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
index 1a600ca28d3..b327426c59b 100644
--- a/debug/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
+++ b/debug/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
@@ -49,10 +49,10 @@
*/
public class PreProcessor extends Task {
- private Vector fFileSets = new Vector<>();
+ private final Vector fFileSets = new Vector<>();
private File fDestDir = null;
- private Set fSymbols = new HashSet<>();
- private FileUtils fUtils = FileUtils.getFileUtils();
+ private final Set fSymbols = new HashSet<>();
+ private final FileUtils fUtils = FileUtils.getFileUtils();
// possible states
private static final int STATE_OUTSIDE_CONDITION = 0;
@@ -61,10 +61,10 @@ public class PreProcessor extends Task {
private static final int STATE_POST_TRUE_CONDITION = 3;
// matchers
- private Matcher IF_DEF_MATCHER = Pattern.compile("#ifdef\\s+\\w+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
- private Matcher ELSE_IF_MATCHER = Pattern.compile("#elseif\\s+\\w+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
- private Matcher ELSE_MATCHER = Pattern.compile("#else$|#else\\W+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
- private Matcher END_MATCHER = Pattern.compile("#endif").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
+ private final Matcher IF_DEF_MATCHER = Pattern.compile("#ifdef\\s+\\w+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
+ private final Matcher ELSE_IF_MATCHER = Pattern.compile("#elseif\\s+\\w+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
+ private final Matcher ELSE_MATCHER = Pattern.compile("#else$|#else\\W+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
+ private final Matcher END_MATCHER = Pattern.compile("#endif").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
/**
diff --git a/debug/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF
index eb2eb1beaf4..1b7be53c980 100644
--- a/debug/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.examples.memory/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.debug.examples.memory;singleton:=true
Bundle-Version: 1.104.0.qualifier
-Bundle-ClassPath: .
Bundle-Activator: org.eclipse.debug.examples.internal.memory.MemoryViewSamplePlugin
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
@@ -13,7 +12,7 @@ Export-Package: org.eclipse.debug.examples.internal.memory;x-internal:=true,
org.eclipse.debug.examples.internal.memory.launchconfig;x-internal:=true
Require-Bundle: org.eclipse.core.expressions,
org.eclipse.ui,
- org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.debug.core;bundle-version="3.9.0",
org.eclipse.debug.ui;bundle-version="3.10.0",
org.eclipse.core.resources,
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
index 685e967cb04..0d071a73480 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
@@ -38,13 +38,13 @@
*/
public class SampleMemoryBlock extends DebugElement implements IMemoryBlockExtension {
- private String fExpression;
- private SampleDebugTarget fDebugTarget;
+ private final String fExpression;
+ private final SampleDebugTarget fDebugTarget;
private boolean isEnabled = true;
private BigInteger fBaseAddress;
- private ArrayList fConnections = new ArrayList<>();
+ private final ArrayList fConnections = new ArrayList<>();
/**
* Creates memory block
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java
index 7a0203404eb..bf554b2567c 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleRegister.java
@@ -19,7 +19,7 @@
public class SampleRegister extends SampleVariable implements IRegister {
- private SampleRegisterGroup fGroup;
+ private final SampleRegisterGroup fGroup;
SampleRegister(SampleStackFrame frame, SampleRegisterGroup group, String name) {
super(frame, name);
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java
index df72a8a8104..0b527153865 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleStackFrame.java
@@ -29,10 +29,10 @@
*/
public class SampleStackFrame extends DebugElement implements IStackFrame {
- private SampleThread fThread;
+ private final SampleThread fThread;
private SampleRegisterGroup fRegisterGroup;
- private long timeStamp;
- private String fName;
+ private final long timeStamp;
+ private final String fName;
/**
* Constructs a SampleStackFrame
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java
index 079103c356b..368dce713d1 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleThread.java
@@ -28,7 +28,7 @@
*/
public class SampleThread extends DebugElement implements IThread {
- private SampleDebugTarget fTarget;
+ private final SampleDebugTarget fTarget;
/**
* Constructs SampleThread
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java
index 2bd079f4573..c3b0590c18f 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleValue.java
@@ -22,7 +22,7 @@
public class SampleValue extends DebugElement implements IValue {
- private SampleVariable fVariable;
+ private final SampleVariable fVariable;
public SampleValue(SampleVariable variable) {
super(variable.getDebugTarget());
diff --git a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java
index 261614b919e..5300ee01fef 100644
--- a/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java
+++ b/debug/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleVariable.java
@@ -23,7 +23,7 @@
public class SampleVariable extends DebugElement implements IVariable {
private final SampleStackFrame fFrame;
- private String fName;
+ private final String fName;
SampleVariable(SampleStackFrame frame, String name) {
super(frame.getDebugTarget());
diff --git a/debug/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
index d1315ca4d45..aec0cc11e1b 100644
--- a/debug/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
@@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.debug.examples.ui;singleton:=true
-Bundle-Version: 1.8.100.qualifier
+Bundle-Version: 1.8.200.qualifier
Bundle-Activator: org.eclipse.debug.examples.ui.pda.DebugUIPlugin
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.core.resources,
org.eclipse.debug.core;bundle-version="3.9.0",
org.eclipse.ui,
@@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
org.eclipse.ui.ide,
org.eclipse.debug.examples.core;bundle-version="1.3.300",
org.eclipse.core.expressions
-Eclipse-LazyStart: true
Export-Package: org.eclipse.debug.examples.ui.midi.adapters;x-internal:=true,
org.eclipse.debug.examples.ui.midi.detailpanes;x-internal:=true,
org.eclipse.debug.examples.ui.midi.launcher;x-internal:=true,
@@ -29,5 +28,4 @@ Export-Package: org.eclipse.debug.examples.ui.midi.adapters;x-internal:=true,
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor
-Bundle-ClassPath: .
Automatic-Module-Name: org.eclipse.debug.examples.ui
diff --git a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java
index 458d9c011dd..90b2ce45a7d 100644
--- a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java
+++ b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java
@@ -22,7 +22,7 @@
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
public class CheckboxModelProxyFactory implements IModelProxyFactory {
- private MidiEventModelProxy fMidiEventProxy = new MidiEventModelProxy();
+ private final MidiEventModelProxy fMidiEventProxy = new MidiEventModelProxy();
@Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
diff --git a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
index 2dc6450b00b..be66c1ee893 100644
--- a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
+++ b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java
@@ -34,7 +34,7 @@ public class ControlEventHandler extends DebugEventHandler {
/**
* Associated launch
*/
- private MidiLaunch fLaunch;
+ private final MidiLaunch fLaunch;
/**
* Timer used to update clock
diff --git a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
index f19183a1c0b..ddb2b91f7cc 100644
--- a/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
+++ b/debug/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java
@@ -34,7 +34,7 @@ public class SequencerControlsModelProxy extends EventHandlerModelProxy {
/**
* Associated launch
*/
- private MidiLaunch fLaunch;
+ private final MidiLaunch fLaunch;
/**
* Event handler
diff --git a/debug/org.eclipse.debug.tests/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.tests/META-INF/MANIFEST.MF
index afc2c215524..ea7fdc95d93 100644
--- a/debug/org.eclipse.debug.tests/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.tests/META-INF/MANIFEST.MF
@@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.tests;singleton:=true
-Bundle-Version: 3.13.200.qualifier
+Bundle-Version: 3.14.0.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.28.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)",
org.junit,
org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)",
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java
index be2dc6124ba..5e5e9ba65f6 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2021 IBM Corporation and others.
+ * Copyright (c) 2009, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -50,6 +50,7 @@
import org.eclipse.debug.tests.viewer.model.ChildrenUpdateTests;
import org.eclipse.debug.tests.viewer.model.FilterTransformTests;
import org.eclipse.debug.tests.viewer.model.PresentationContextTests;
+import org.eclipse.debug.tests.viewer.model.VirtualViewerCheckTests;
import org.eclipse.debug.tests.viewer.model.VirtualViewerContentTests;
import org.eclipse.debug.tests.viewer.model.VirtualViewerDeltaTests;
import org.eclipse.debug.tests.viewer.model.VirtualViewerFilterTests;
@@ -78,6 +79,7 @@
// (Bug 343308).
// Virtual viewer tests
+ VirtualViewerCheckTests.class,
VirtualViewerDeltaTests.class,
VirtualViewerContentTests.class,
VirtualViewerLazyModeTests.class,
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java
index aed1e07b438..12ed8dfff95 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java
@@ -154,12 +154,10 @@ public static void waitWhile(Predicate condition, T context, long timeout
* @return value of condition when method returned
*/
public static boolean waitWhile(Supplier condition, long timeout) throws Exception {
- if (condition == null) {
- condition = () -> true;
- }
+ Supplier nonNullCondition = condition != null ? condition : () -> true;
long start = System.currentTimeMillis();
Display display = Display.getCurrent();
- while (System.currentTimeMillis() - start < timeout && condition.get()) {
+ while (System.currentTimeMillis() - start < timeout && nonNullCondition.get()) {
Thread.yield();
if (display != null && !display.isDisposed()) {
if (!display.readAndDispatch()) {
@@ -169,7 +167,7 @@ public static boolean waitWhile(Supplier condition, long timeout) throw
Thread.sleep(5);
}
}
- return condition.get();
+ return nonNullCondition.get();
}
/**
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/SerialExecutorTest.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/SerialExecutorTest.java
index 0ac6bd73dd1..6d748a35401 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/SerialExecutorTest.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/SerialExecutorTest.java
@@ -23,7 +23,6 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.internal.ui.model.elements.SerialExecutor;
import org.eclipse.debug.tests.AbstractDebugTest;
-import org.junit.Ignore;
import org.junit.Test;
@SuppressWarnings("restriction")
@@ -118,7 +117,6 @@ public void testSchedulingQueue() throws InterruptedException {
}
@Test
- @Ignore("See https://bugs.eclipse.org/bugs/show_bug.cgi?id=574883")
public void testHeavyScheduling() throws InterruptedException {
// Executor has to execute every task. Even when they are scheduled fast
// and execute fast
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleDocumentAdapterTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleDocumentAdapterTests.java
index f2b58e55d93..62b1ecfbd5a 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleDocumentAdapterTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleDocumentAdapterTests.java
@@ -939,7 +939,8 @@ public void testChangeDocument() {
/**
* Test if invalid arguments produces error log messages.
*/
- public void _testInvalidInvocations() {
+ @Test
+ public void testInvalidInvocations() {
final AtomicInteger expectedErrors = new AtomicInteger(0);
final ILogListener logListener = new ILogListener() {
@Override
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
index c615cb40b7d..14be9f3fab1 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/MockProcess.java
@@ -53,7 +53,7 @@ public class MockProcess extends Process {
* Store number of bytes received which are not buffered anymore (i.e. those
* input was already passed through {@link #getReceivedInput()}).
*/
- private AtomicInteger receivedInput = new AtomicInteger(0);
+ private final AtomicInteger receivedInput = new AtomicInteger(0);
/**
* The time (in epoch milliseconds) when the mockup process terminates.
*
@@ -85,7 +85,7 @@ public static enum ProcessState {
*/
LASTREAD('L'), TERMINATED(-1);
- private int code;
+ private final int code;
ProcessState(int c) {
this.code = c;
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ProcessConsoleTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ProcessConsoleTests.java
index a1c6beb2cda..9bc20c1b688 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ProcessConsoleTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ProcessConsoleTests.java
@@ -244,7 +244,7 @@ public void testProcessTerminationNotificationWithInputFile() throws Exception {
assertTrue("Failed to prepare input file.", fileCreated);
try {
ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(LaunchConfigurationTests.ID_TEST_LAUNCH_TYPE);
- ILaunchConfigurationWorkingCopy launchConfiguration = launchType.newInstance(null, "testProcessTerminationNotificationWithInputFromFile");
+ ILaunchConfigurationWorkingCopy launchConfiguration = launchType.newInstance(null, name.getMethodName());
launchConfiguration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_STDIN_FILE, inFile.getAbsolutePath());
TestUtil.log(IStatus.INFO, name.getMethodName(), "Process terminates after Console is initialized.");
processTerminationTest(launchConfiguration, false);
@@ -267,7 +267,7 @@ public void testProcessTerminationNotificationWithInputFile() throws Exception {
public void processTerminationTest(ILaunchConfiguration launchConfig, boolean terminateBeforeConsoleInitialization) throws Exception {
final AtomicBoolean terminationSignaled = new AtomicBoolean(false);
final Process mockProcess = new MockProcess(null, null, terminateBeforeConsoleInitialization ? 0 : -1);
- final IProcess process = DebugPlugin.newProcess(new Launch(launchConfig, ILaunchManager.RUN_MODE, null), mockProcess, "testProcessTerminationNotification");
+ final IProcess process = DebugPlugin.newProcess(new Launch(launchConfig, ILaunchManager.RUN_MODE, null), mockProcess, name.getMethodName());
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider());
console.addPropertyChangeListener(event -> {
@@ -281,8 +281,7 @@ public void processTerminationTest(ILaunchConfiguration launchConfig, boolean te
if (mockProcess.isAlive()) {
mockProcess.destroy();
}
- TestUtil.waitForJobs(name.getMethodName(), 50, 10000);
- assertTrue("No console complete notification received.", terminationSignaled.get());
+ waitWhile(__ -> !terminationSignaled.get(), 10_000, __ -> "No console complete notification received.");
} finally {
consoleManager.removeConsoles(new IConsole[] { console });
TestUtil.waitForJobs(name.getMethodName(), 0, 10000);
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
index 5b11e558c18..6944a4fb587 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
@@ -49,20 +49,20 @@ protected LaunchConfigurationManager getLaunchConfigurationManager() {
/**
* Returns a launch configuration with the given name, creating one if required.
*
- * @param name configuration name
+ * @param configurationName configuration name
* @return launch configuration
* @throws CoreException
*/
- protected ILaunchConfiguration getLaunchConfiguration(String name) throws CoreException {
+ protected ILaunchConfiguration getLaunchConfiguration(String configurationName) throws CoreException {
ILaunchManager manager = getLaunchManager();
ILaunchConfiguration[] configurations = manager.getLaunchConfigurations();
for (ILaunchConfiguration config : configurations) {
- if (config.getName().equals(name)) {
+ if (config.getName().equals(configurationName)) {
return config;
}
}
ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(LaunchConfigurationTests.ID_TEST_LAUNCH_TYPE);
- ILaunchConfigurationWorkingCopy wc = type.newInstance(null, name);
+ ILaunchConfigurationWorkingCopy wc = type.newInstance(null, configurationName);
ILaunchConfiguration saved = wc.doSave();
return saved;
}
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
index f00b2e4b84b..fa75358794e 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
@@ -110,8 +110,8 @@ private static void runCommandLine(String commandLine, String[] arguments) throw
private static ArrayList runCommandLine(String[] execArgs)
throws CoreException, IOException {
- execArgs = quoteWindowsArgs(execArgs);
- Process process = DebugPlugin.exec(execArgs, null);
+ String[] systemDependentExecArgs = quoteWindowsArgs(execArgs);
+ Process process = DebugPlugin.exec(systemDependentExecArgs, null);
BufferedReader procOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
ArrayList procArgs = new ArrayList<>();
@@ -124,14 +124,15 @@ private static ArrayList runCommandLine(String[] execArgs)
private static String[] quoteWindowsArgs(String[] cmdLine) {
// see https://bugs.eclipse.org/387504#c13 , workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002
+ String[] systemDependentCmdLine = cmdLine;
if (Platform.getOS().equals(Constants.OS_WIN32)) {
String[] winCmdLine = new String[cmdLine.length];
for (int i = 0; i < cmdLine.length; i++) {
winCmdLine[i] = winQuote(cmdLine[i]);
}
- cmdLine = winCmdLine;
+ systemDependentCmdLine = winCmdLine;
}
- return cmdLine;
+ return systemDependentCmdLine;
}
@@ -155,9 +156,7 @@ private static String winQuote(String s) {
if (! needsQuoting(s)) {
return s;
}
- s = s.replaceAll("([\\\\]*)\"", "$1$1\\\\\""); //$NON-NLS-1$ //$NON-NLS-2$
- s = s.replaceAll("([\\\\]*)\\z", "$1$1"); //$NON-NLS-1$ //$NON-NLS-2$
- return "\"" + s + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ return "\"" + s.replaceAll("([\\\\]*)\"", "$1$1\\\\\"").replaceAll("([\\\\]*)\\z", "$1$1") + "\"";
}
// -- tests:
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
index 01396b3d46c..8e787b9d66a 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
@@ -33,6 +33,7 @@
import java.nio.charset.CodingErrorAction;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -238,11 +239,11 @@ protected IProject getProject() throws CoreException {
* - Boolean1 = true
* - Boolean2 = false
*/
- protected ILaunchConfigurationWorkingCopy newConfiguration(IContainer container, String name) throws CoreException {
+ protected ILaunchConfigurationWorkingCopy newConfiguration(IContainer container, String configurationName) throws CoreException {
ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE);
assertTrue("Should support debug mode", type.supportsMode(ILaunchManager.DEBUG_MODE)); //$NON-NLS-1$
assertTrue("Should support run mode", type.supportsMode(ILaunchManager.RUN_MODE)); //$NON-NLS-1$
- ILaunchConfigurationWorkingCopy wc = type.newInstance(container, name);
+ ILaunchConfigurationWorkingCopy wc = type.newInstance(container, configurationName);
wc.setAttribute("String1", "String1"); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttribute("Int1", 1); //$NON-NLS-1$
wc.setAttribute("Boolean1", true); //$NON-NLS-1$
@@ -255,9 +256,9 @@ protected ILaunchConfigurationWorkingCopy newConfiguration(IContainer container,
* Creates and returns a new launch configuration with the given name, local
* or shared, with no attributes
*/
- protected ILaunchConfigurationWorkingCopy newEmptyConfiguration(IContainer container, String name) throws CoreException {
+ protected ILaunchConfigurationWorkingCopy newEmptyConfiguration(IContainer container, String configurationName) throws CoreException {
ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE);
- ILaunchConfigurationWorkingCopy wc = type.newInstance(container, name);
+ ILaunchConfigurationWorkingCopy wc = type.newInstance(container, configurationName);
assertEquals("Should have no attributes", 0, wc.getAttributes().size()); //$NON-NLS-1$
return wc;
}
@@ -270,11 +271,11 @@ protected ILaunchConfigurationWorkingCopy newEmptyConfiguration(IContainer conta
* - Boolean1 = true
* - Boolean2 = false
*/
- protected ILaunchConfigurationWorkingCopy newPrototype(IContainer container, String name) throws CoreException {
+ protected ILaunchConfigurationWorkingCopy newPrototype(IContainer container, String configurationName) throws CoreException {
ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE);
assertTrue("Should support debug mode", type.supportsMode(ILaunchManager.DEBUG_MODE)); //$NON-NLS-1$
assertTrue("Should support run mode", type.supportsMode(ILaunchManager.RUN_MODE)); //$NON-NLS-1$
- ILaunchConfigurationWorkingCopy wc = type.newPrototypeInstance(container, name);
+ ILaunchConfigurationWorkingCopy wc = type.newPrototypeInstance(container, configurationName);
wc.setAttribute("String1", "String1"); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttribute("Int1", 1); //$NON-NLS-1$
wc.setAttribute("Boolean1", true); //$NON-NLS-1$
@@ -287,9 +288,9 @@ protected ILaunchConfigurationWorkingCopy newPrototype(IContainer container, Str
* Creates and returns a new launch configuration prototype with the given name, local
* or shared, with no attributes
*/
- protected ILaunchConfigurationWorkingCopy newEmptyPrototype(IContainer container, String name) throws CoreException {
+ protected ILaunchConfigurationWorkingCopy newEmptyPrototype(IContainer container, String configurationName) throws CoreException {
ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE);
- ILaunchConfigurationWorkingCopy wc = type.newPrototypeInstance(container, name);
+ ILaunchConfigurationWorkingCopy wc = type.newPrototypeInstance(container, configurationName);
assertEquals("Should have no attributes", 0, wc.getAttributes().size()); //$NON-NLS-1$
return wc;
}
@@ -514,9 +515,9 @@ public void testDoubleSave() throws CoreException {
ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations();
assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$
- String name = wc.getName();
+ String configurationName = wc.getName();
wc.rename("newName"); //$NON-NLS-1$
- wc.rename(name);
+ wc.rename(configurationName);
assertTrue("Should be dirty", wc.isDirty()); //$NON-NLS-1$
wc.doSave();
@@ -1340,8 +1341,7 @@ public void testLaunchTimeStamp() throws CoreException {
@Test
public void testTerminateTimeStamp() throws Exception {
ILaunchConfigurationWorkingCopy workingCopy = newConfiguration(null, "test-time-stamp"); //$NON-NLS-1$
- ILaunch launch = workingCopy.launch(ILaunchManager.DEBUG_MODE, null);
- AtomicBoolean launchTerminated = new AtomicBoolean();
+ Set terminatedLaunches = Collections.synchronizedSet(new HashSet<>());
ILaunchesListener2 listener = new ILaunchesListener2() {
@Override
public void launchesRemoved(ILaunch[] launches) {
@@ -1357,22 +1357,22 @@ public void launchesAdded(ILaunch[] launches) {
@Override
public void launchesTerminated(ILaunch[] launches) {
- for (ILaunch l : launches) {
- if (l == launch) {
- launchTerminated.set(true);
- }
- }
+ terminatedLaunches.addAll(Arrays.asList(launches));
}
};
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
+ final ILaunch launch = workingCopy.launch(ILaunchManager.DEBUG_MODE, null);
IProcess process = null;
try {
process = DebugPlugin.newProcess(launch, new MockProcess(0), "test-terminate-timestamp");
- waitWhile(c -> !launchTerminated.get(), testTimeout, c -> "Launch did not finished");
- String stamp = launch.getAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP);
- assertNotNull("missing time stamp", stamp); //$NON-NLS-1$
- long lstamp = Long.parseLong(stamp); // should be a long - will throw NumberFormatException if not
- assertTrue("Time travel launch", lstamp <= System.currentTimeMillis());
+ waitWhile(__ -> !terminatedLaunches.contains(launch), testTimeout,
+ __ -> "Launch termination event did not occur: "+
+ "launch termination state is \"" + launch.isTerminated() + "\" " +
+ "and " + terminatedLaunches.size() + " launches have terminated");
+ String launchTerminateTimestampUntyped = launch.getAttribute(DebugPlugin.ATTR_TERMINATE_TIMESTAMP);
+ assertNotNull("Time stamp is missing", launchTerminateTimestampUntyped);
+ long launchTerminateTimestamp = Long.parseLong(launchTerminateTimestampUntyped);
+ assertTrue("Launch time is before current time", launchTerminateTimestamp <= System.currentTimeMillis());
} finally {
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(listener);
if (launch != null) {
@@ -1384,6 +1384,72 @@ public void launchesTerminated(ILaunch[] launches) {
}
}
+ /**
+ * Tests that a launch is properly registered for notifications before a
+ * process is spawned and may already propagate a termination event.
+ *
+ * @see https://github.com/eclipse-platform/eclipse.platform/issues/598
+ */
+ @Test
+ public void testTerminateLaunchListener_Issue598() throws Exception {
+ final ILaunchConfigurationWorkingCopy workingCopy = newConfiguration(null, "test-launch-listener");
+ final AtomicBoolean processStarted = new AtomicBoolean(false);
+ final AtomicBoolean launchTerminated = new AtomicBoolean(false);
+ ILaunchesListener2 listener = new ILaunchesListener2() {
+ @Override
+ public void launchesRemoved(ILaunch[] launches) {
+ }
+
+ @Override
+ public void launchesChanged(ILaunch[] launches) {
+ }
+
+ @Override
+ public void launchesAdded(ILaunch[] launches) {
+ }
+
+ @Override
+ public void launchesTerminated(ILaunch[] launches) {
+ launchTerminated.set(true);
+ }
+ };
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
+
+ MockProcess mockProcess = new MockProcess(0) {
+ @Override
+ public int waitFor() throws InterruptedException {
+ processStarted.set(true);
+ return super.waitFor();
+ }
+ };
+ ILaunch launch = new Launch(workingCopy, ILaunchManager.DEBUG_MODE, null) {
+ @Override
+ public void addProcess(IProcess process) {
+ long msecToWaitForProcessToStart = 500;
+ long startTimeMsec = System.currentTimeMillis();
+ while (System.currentTimeMillis() - startTimeMsec < msecToWaitForProcessToStart) {
+ assertFalse("Process started before registering launch for notifications", processStarted.get());
+ }
+ super.addProcess(process);
+ }
+ };
+ DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
+
+ IProcess runtimeProcess = null;
+ try {
+ runtimeProcess = DebugPlugin.newProcess(launch, mockProcess, "test-terminate-launch-listener");
+ waitWhile(__ -> !launchTerminated.get(), testTimeout, __ -> "Launch termination event did not occur");
+ } finally {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(listener);
+ if (launch != null) {
+ getLaunchManager().removeLaunch(launch);
+ }
+ if (runtimeProcess != null) {
+ runtimeProcess.terminate();
+ }
+ }
+ }
+
/**
* Tests that attributes in a nested map are persisted in alphabetical
* order.
@@ -1767,6 +1833,8 @@ public void testNullLaunchConfigurationInLaunch() throws Exception {
}
// no NPE should be logged
lm.addLaunch(l);
+ // Clean up by removing launch again
+ lm.removeLaunch(l);
}
/**
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchGroupTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchGroupTests.java
index 74ed4a95fda..99dcd14ac53 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchGroupTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchGroupTests.java
@@ -62,7 +62,7 @@ public class LaunchGroupTests extends AbstractLaunchTest {
private final AtomicInteger launchCount = new AtomicInteger(0);
private ILaunchConfiguration lcToCount = null;
- private ILaunchListener lcListener = new ILaunchListener() {
+ private final ILaunchListener lcListener = new ILaunchListener() {
@Override
public void launchRemoved(ILaunch launch) {
}
@@ -475,7 +475,7 @@ public void write(String s) {
private static final class DummyAttachListener implements ILaunchListener {
- private ILaunchConfiguration cfg;
+ private final ILaunchConfiguration cfg;
private DummyStream stream;
public DummyAttachListener(ILaunchConfiguration cfg) {
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchManagerTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchManagerTests.java
index 0b2bc004554..265e731cef8 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchManagerTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchManagerTests.java
@@ -17,7 +17,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.eclipse.core.runtime.CoreException;
@@ -49,9 +48,9 @@ public class LaunchManagerTests extends AbstractLaunchTest {
*/
@Test
public void testGenereateConfigName() {
- String configname = "launch_configuration"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertTrue("the name nust be '" + configname + "'", name.equals(configname)); //$NON-NLS-1$ //$NON-NLS-2$
+ String originalName = "launch_configuration";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", originalName, generatedName);
}
/**
@@ -60,9 +59,9 @@ public void testGenereateConfigName() {
*/
@Test
public void testGenereateConfigNameBadChar() {
- String configname = "config:name"; //$NON-NLS-1$
- String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname);
- assertEquals("config name should be '" + configname + "'", configname, name); //$NON-NLS-1$ //$NON-NLS-2$
+ String originalName = "config:name";
+ String generatedName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(originalName);
+ assertEquals("unexpected generated configuration name", originalName, generatedName);
}
/**
@@ -70,9 +69,9 @@ public void testGenereateConfigNameBadChar() {
*/
@Test
public void testGenerateValidName() {
- String configname = "thisisavalidname"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("Should be the same as the seed", configname, name); //$NON-NLS-1$
+ String originalName = "thisisavalidname";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", originalName, generatedName);
}
/**
@@ -82,9 +81,9 @@ public void testGenerateValidName() {
@Test
public void testGenerateConfigNameReservedName() {
if(Platform.OS_WIN32.equals(Platform.getOS())) {
- String configname = "aux"; //$NON-NLS-1$
- String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname);
- assertEquals("config name should be 'aux'", configname, name); //$NON-NLS-1$
+ String originalName = "aux";
+ String generatedName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(originalName);
+ assertEquals("unexpected generated configuration name", originalName, generatedName);
}
}
@@ -93,9 +92,10 @@ public void testGenerateConfigNameReservedName() {
*/
@Test
public void testGenerateBadConfigName() {
- String configname = "config:name"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'config_name'", "config_name", name); //$NON-NLS-1$ //$NON-NLS-2$
+ String originalName = "config:name";
+ String expectedName = "config_name";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
}
/**
@@ -105,9 +105,10 @@ public void testGenerateBadConfigName() {
@Test
public void testGenerateConflictingName() {
if(Platform.OS_WIN32.equals(Platform.getOS())) {
- String configname = "aux"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'launch_configuration'", "launch_configuration", name); //$NON-NLS-1$ //$NON-NLS-2$
+ String originalName = "aux";
+ String expectedName = "launch_configuration";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
}
}
@@ -117,13 +118,15 @@ public void testGenerateConflictingName() {
*/
@Test
public void testGenerateBadCharConflict() throws Exception {
- String configname = "config:name"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'config_name'", "config_name", name); //$NON-NLS-1$ //$NON-NLS-2$
- getLaunchConfiguration(name);
- name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'config_name (1)'", "config_name (1)", name); //$NON-NLS-1$ //$NON-NLS-2$
- ILaunchConfiguration config = getLaunchConfiguration("config_name"); //$NON-NLS-1$
+ String originalName = "config:name";
+ String expectedName = "config_name";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
+ getLaunchConfiguration(generatedName);
+ expectedName = "config_name (1)";
+ generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
+ ILaunchConfiguration config = getLaunchConfiguration("config_name");
config.delete();
}
@@ -135,13 +138,15 @@ public void testGenerateBadCharConflict() throws Exception {
@Test
public void testGenerateBadNameConflict() throws Exception {
if(Platform.OS_WIN32.equals(Platform.getOS())) {
- String configname = "com2"; //$NON-NLS-1$
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'launch_configuration'", "launch_configuration", name); //$NON-NLS-1$ //$NON-NLS-2$
- getLaunchConfiguration(name);
- name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("config name should be 'launch_configuration (1)'", "launch_configuration (1)", name); //$NON-NLS-1$ //$NON-NLS-2$
- ILaunchConfiguration config = getLaunchConfiguration("launch_configuration"); //$NON-NLS-1$
+ String originalName = "com2";
+ String expectedName = "launch_configuration";
+ String generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
+ getLaunchConfiguration(generatedName);
+ expectedName = "launch_configuration (1)";
+ generatedName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", expectedName, generatedName);
+ ILaunchConfiguration config = getLaunchConfiguration("launch_configuration");
config.delete();
}
}
@@ -205,18 +210,18 @@ public void testValidateConfigBadName() {
*/
@Test
public void testGenerateNameExistingConfig() throws Exception {
- String configname = "x.y.z.configname"; //$NON-NLS-1$
- getLaunchConfiguration(configname);
- String name = getLaunchManager().generateLaunchConfigurationName(configname);
- assertEquals("the configuration name should have been " + configname + " (1)", configname + " (1)", name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- getLaunchConfiguration(name);
- name = getLaunchManager().generateLaunchConfigurationName(name);
- assertEquals("the configuration name should have been " + configname + " (2)", configname + " (2)", name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ILaunchConfiguration config = getLaunchConfiguration(configname);
+ String originalName = "x.y.z.configname"; //$NON-NLS-1$
+ getLaunchConfiguration(originalName);
+ String generatedConfigurationName = getLaunchManager().generateLaunchConfigurationName(originalName);
+ assertEquals("unexpected generated configuration name", originalName + " (1)", generatedConfigurationName); //$NON-NLS-1$ //$NON-NLS-2$
+ getLaunchConfiguration(generatedConfigurationName);
+ generatedConfigurationName = getLaunchManager().generateLaunchConfigurationName(generatedConfigurationName);
+ assertEquals("unexpected generated configuration name", originalName + " (2)", generatedConfigurationName); //$NON-NLS-1$ //$NON-NLS-2$
+ ILaunchConfiguration config = getLaunchConfiguration(originalName);
if(config != null) {
config.delete();
}
- config = getLaunchConfiguration(configname + " (1)"); //$NON-NLS-1$
+ config = getLaunchConfiguration(originalName + " (1)"); //$NON-NLS-1$
if(config != null) {
config.delete();
}
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchTests.java
index 41534438325..6aecbb3deb9 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchTests.java
@@ -54,8 +54,8 @@ public void setUp() throws Exception {
final Launch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
handler = (proxy, method, args) -> {
- String name = method.getName();
- if (name.equals("equals")) { //$NON-NLS-1$
+ String methodName = method.getName();
+ if (methodName.equals("equals")) { //$NON-NLS-1$
return args.length == 1 && proxy == args[0];
}
return Boolean.TRUE;
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/TableRenderingTestsMemoryBlock.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/TableRenderingTestsMemoryBlock.java
index 28b125be5f3..307e57d5d85 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/TableRenderingTestsMemoryBlock.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/TableRenderingTestsMemoryBlock.java
@@ -28,8 +28,8 @@
*/
public class TableRenderingTestsMemoryBlock implements IMemoryBlockExtension {
- private int fAddressableSize;
- private byte[] fBytes;
+ private final int fAddressableSize;
+ private final byte[] fBytes;
public TableRenderingTestsMemoryBlock(byte[] bytes, int addressableSize) {
fBytes = bytes;
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
index bcffbb94253..4099454ef83 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
@@ -18,6 +18,7 @@
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
+import org.junit.Assert;
import org.junit.Test;
/**
@@ -74,35 +75,32 @@ public void testSimpleMultiLevel() throws Exception {
model.validateData(fViewer, TreePath.EMPTY);
}
- // TODO: no idea how to trigger a toggle event on an item
-// public void testCheckReceiver() {
-// // Initial setup
-// TestModel model = TestModel.simpleSingleLevel();
-// fViewer.setAutoExpandLevel(-1);
-// //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-// fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
-// fViewer.setInput(model.getRootElement());
-//
-// // Wait for the updates to complete and validate.
-// while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) Thread.sleep(0);
-// model.validateData(fViewer, TreePath.EMPTY);
-//
-// InternalTreeModelViewer treeViewer = ((InternalTreeModelViewer)fViewer);
-// TreePath elementPath = model.findElement("1");
-// TestElement element = model.getElement(elementPath);
-// boolean initialCheckState = element.getChecked();
-// Event event = new Event();
-// event.item = treeViewer.findItem(elementPath);
-// event.detail = SWT.CHECK;
-// event.display = fDisplay;
-// event.type = SWT.Selection;
-// event.widget = treeViewer.getControl();
-// fDisplay.post(event);
-//
-// while (fDisplay.readAndDispatch ());
-//
-// Assert.assertTrue(element.getChecked() != initialCheckState);
-// }
+ @Test
+ public void testCheckReceiver() throws Exception {
+ // Initial setup
+ TestModel model = TestModel.simpleSingleLevel();
+ fViewer.setAutoExpandLevel(-1);
+ // TreeModelViewerAutopopulateAgent autopopulateAgent = new
+ // TreeModelViewerAutopopulateAgent(fViewer);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fViewer.setInput(model.getRootElement());
+
+ waitWhile(t -> !fListener.isFinished(), createListenerErrorMessage());
+ model.validateData(fViewer, TreePath.EMPTY);
+
+ TestElement element = model.getRootElement().getChildren()[0];
+ boolean initialCheckState = element.getChecked();
+ TreePath elementPath = new TreePath(new Object[] { element });
+ ModelDelta delta = model.setElementChecked(elementPath, true, false);
+
+ fListener.reset(elementPath, element, -1, true, false);
+ model.postDelta(delta);
+
+ waitWhile(t -> !fListener.isFinished(ITestModelUpdatesListenerConstants.MODEL_CHANGED_COMPLETE), createListenerErrorMessage());
+
+ Assert.assertTrue(element.getChecked() != initialCheckState);
+ }
+
@Test
public void testUpdateCheck() throws Exception {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
index 0bd96f04fcc..6133a9620d8 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
@@ -100,7 +100,7 @@ static class TestModelWithCapturedUpdates extends TestModel {
boolean fCaptureLabelUpdates = false;
boolean fCaptureChildrenUpdates = false;
- List fCapturedUpdates = Collections.synchronizedList(new ArrayList());
+ List fCapturedUpdates = Collections.synchronizedList(new ArrayList<>());
@Override
public void update(IChildrenUpdate[] updates) {
@@ -161,7 +161,7 @@ public void testLabelUpdatesCompletedOutOfSequence1() throws Exception {
waitWhile(t -> model.fCapturedUpdates.size() < model.getRootElement().fChildren.length, createModelErrorMessage(model));
List firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = Collections.synchronizedList(new ArrayList(2));
+ model.fCapturedUpdates = Collections.synchronizedList(new ArrayList<>(2));
// // Change the model and run another update set.
model.getElement(model.findElement("1")).setLabelAppendix(" - changed"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -216,7 +216,7 @@ public void testLabelUpdatesCompletedOutOfSequence2() throws Exception {
TestUtil.waitForJobs(name.getMethodName(), 300, 5000);
waitWhile(t -> model.fCapturedUpdates.size() < model.getRootElement().fChildren.length, createModelErrorMessage(model));
List firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = Collections.synchronizedList(new ArrayList(2));
+ model.fCapturedUpdates = Collections.synchronizedList(new ArrayList<>(2));
// Change the model and run another update set.
model.setElementChildren(TreePath.EMPTY, new TestElement[] {
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
index cb4da5b0127..c3cf81ee802 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
@@ -178,7 +178,7 @@ private void installSubModelProxies(TreePath path, ModelDelta delta) {
private IModelSelectionPolicy fModelSelectionPolicy;
private boolean fQueueingUpdates = false;
private boolean fDelayUpdates = false;
- private List fQueuedUpdates = new LinkedList<>();
+ private final List fQueuedUpdates = new LinkedList<>();
/**
* Constructor private. Use static factory methods instead.
@@ -564,10 +564,9 @@ public ModelDelta replaceElementChild(TreePath parentPath, int index, TestElemen
}
public ModelDelta addElementChild(TreePath parentPath, ModelDelta rootDelta, int index, TestElement newChild) {
- if (rootDelta == null) {
- rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE);
- }
- ModelDelta baseDelta = getBaseDelta(rootDelta);
+ ModelDelta nonNullRootDelta = rootDelta != null ? rootDelta : new ModelDelta(fInput, IModelDelta.NO_CHANGE);
+
+ ModelDelta baseDelta = getBaseDelta(nonNullRootDelta);
TreePath relativePath = getRelativePath(parentPath);
// Find the parent element and generate the delta node for it.
@@ -581,7 +580,7 @@ public ModelDelta addElementChild(TreePath parentPath, ModelDelta rootDelta, int
delta.setChildCount(element.getChildren().length);
delta.addNode(newChild, index, IModelDelta.ADDED);
- return rootDelta;
+ return nonNullRootDelta;
}
public ModelDelta insertElementChild(TreePath parentPath, int index, TestElement newChild) {
@@ -589,10 +588,9 @@ public ModelDelta insertElementChild(TreePath parentPath, int index, TestElement
}
public ModelDelta insertElementChild(ModelDelta rootDelta, TreePath parentPath, int index, TestElement newChild) {
- if (rootDelta == null) {
- rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE);
- }
- ModelDelta baseDelta = getBaseDelta(rootDelta);
+ ModelDelta nonNullRootDelta = rootDelta != null ? rootDelta : new ModelDelta(fInput, IModelDelta.NO_CHANGE);
+
+ ModelDelta baseDelta = getBaseDelta(nonNullRootDelta);
TreePath relativePath = getRelativePath(parentPath);
// Find the parent element and generate the delta node for it.
@@ -606,7 +604,7 @@ public ModelDelta insertElementChild(ModelDelta rootDelta, TreePath parentPath,
delta.setChildCount(element.getChildren().length);
delta.addNode(newChild, index, IModelDelta.INSERTED);
- return rootDelta;
+ return nonNullRootDelta;
}
private TestElement[] doInsertElementInArray(TestElement[] children, int index, TestElement newChild) {
@@ -721,12 +719,12 @@ public static TestElement[] makeMultiLevelElements2(TestModel model, int[] level
}
int count = levelCounts[0];
int[] oldLevelCounts = levelCounts;
- levelCounts = new int[levelCounts.length - 1];
- System.arraycopy(oldLevelCounts, 1, levelCounts, 0, levelCounts.length);
+ int[] newlevelCounts = new int[levelCounts.length - 1];
+ System.arraycopy(oldLevelCounts, 1, newlevelCounts, 0, newlevelCounts.length);
TestElement[] elements = new TestElement[count];
for (int i = 0; i < count; i++) {
String name = prefix + i;
- elements[i] = new TestElement(model, name, makeMultiLevelElements2(model, levelCounts, name + ".")); //$NON-NLS-1$
+ elements[i] = new TestElement(model, name, makeMultiLevelElements2(model, newlevelCounts, name + ".")); //$NON-NLS-1$
}
return elements;
}
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
index 0e6bb13277a..3ef119cd0ab 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
@@ -57,30 +57,30 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
private boolean fFailOnRedundantUpdates;
private boolean fFailOnRedundantLabelUpdates;
- private Set fRedundantUpdates = new HashSet<>();
- private Set fRedundantLabelUpdates = new HashSet<>();
- private Set fRedundantHasChildrenUpdateExceptions = new HashSet<>();
- private Set fRedundantChildCountUpdateExceptions = new HashSet<>();
- private Set fRedundantChildrenUpdateExceptions = new HashSet<>();
- private Set fRedundantLabelUpdateExceptions = new HashSet<>();
+ private final Set fRedundantUpdates = new HashSet<>();
+ private final Set fRedundantLabelUpdates = new HashSet<>();
+ private final Set fRedundantHasChildrenUpdateExceptions = new HashSet<>();
+ private final Set fRedundantChildCountUpdateExceptions = new HashSet<>();
+ private final Set fRedundantChildrenUpdateExceptions = new HashSet<>();
+ private final Set fRedundantLabelUpdateExceptions = new HashSet<>();
private boolean fFailOnMultipleModelUpdateSequences;
private boolean fFailOnMultipleLabelUpdateSequences;
- private Set fHasChildrenUpdatesScheduled = new HashSet<>();
- private Set fHasChildrenUpdatesRunning = new HashSet<>();
- private Set fHasChildrenUpdatesCompleted = new HashSet<>();
- private Map> fChildrenUpdatesScheduled = new HashMap<>();
- private Set fChildrenUpdatesRunning = new HashSet<>();
- private Set fChildrenUpdatesCompleted = new HashSet<>();
- private Set fChildCountUpdatesScheduled = new HashSet<>();
- private Set fChildCountUpdatesRunning = new HashSet<>();
- private Set fChildCountUpdatesCompleted = new HashSet<>();
- private Set fLabelUpdates = new HashSet<>();
- private Set fLabelUpdatesRunning = new HashSet<>();
- private Set fLabelUpdatesCompleted = new HashSet<>();
- private Set fProxyModels = new HashSet<>();
- private Set fStateUpdates = new HashSet<>();
+ private final Set fHasChildrenUpdatesScheduled = new HashSet<>();
+ private final Set fHasChildrenUpdatesRunning = new HashSet<>();
+ private final Set fHasChildrenUpdatesCompleted = new HashSet<>();
+ private final Map> fChildrenUpdatesScheduled = new HashMap<>();
+ private final Set fChildrenUpdatesRunning = new HashSet<>();
+ private final Set fChildrenUpdatesCompleted = new HashSet<>();
+ private final Set fChildCountUpdatesScheduled = new HashSet<>();
+ private final Set fChildCountUpdatesRunning = new HashSet<>();
+ private final Set fChildCountUpdatesCompleted = new HashSet<>();
+ private final Set fLabelUpdates = new HashSet<>();
+ private final Set fLabelUpdatesRunning = new HashSet<>();
+ private final Set fLabelUpdatesCompleted = new HashSet<>();
+ private final Set fProxyModels = new HashSet<>();
+ private final Set fStateUpdates = new HashSet<>();
private int fViewerUpdatesStarted = 0;
private int fViewerUpdatesComplete = 0;
private int fViewerUpdatesStartedAtReset;
@@ -356,11 +356,12 @@ public Set getChildrenUpdatesCompleted() {
*/
private TreePath getViewerTreePath(IModelDelta node) {
ArrayList list = new ArrayList<>();
- IModelDelta parentDelta = node.getParentDelta();
+ IModelDelta currentDelta = node;
+ IModelDelta parentDelta = currentDelta.getParentDelta();
while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
+ list.add(0, currentDelta.getElement());
+ currentDelta = parentDelta;
+ parentDelta = currentDelta.getParentDelta();
}
return new TreePath(list.toArray());
}
@@ -400,7 +401,7 @@ public void addUpdates(IInternalTreeModelViewer viewer, TreePath path, TestEleme
}
}
- if (levels-- != 0) {
+ if (levels != 0) {
TestElement[] children = element.getChildren();
if (children.length > 0 && (viewer == null || path.getSegmentCount() == 0 || viewer.getExpandedState(path))) {
if ((flags & CHILD_COUNT_UPDATES) != 0) {
@@ -417,7 +418,7 @@ public void addUpdates(IInternalTreeModelViewer viewer, TreePath path, TestEleme
}
for (TestElement child : children) {
- addUpdates(viewer, path.createChildPath(child), child, filters, levels, flags);
+ addUpdates(viewer, path.createChildPath(child), child, filters, levels - 1, flags);
}
}
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerCheckTests.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerCheckTests.java
new file mode 100644
index 00000000000..f9ea37e11d9
--- /dev/null
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerCheckTests.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2023 Vector Informatik GmbH and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.debug.tests.viewer.model;
+
+import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @since 3.14
+ */
+public class VirtualViewerCheckTests extends CheckTests {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
+ }
+}
diff --git a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java
index 02ebae98ae1..560e0cbd685 100644
--- a/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java
+++ b/debug/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java
@@ -46,11 +46,12 @@ public int getLength() {
@Override
public boolean isItemVisible(VirtualItem item) {
int position = 0;
- while (item.getParent() != null) {
- position += item.getIndex().intValue();
- item = item.getParent();
+ VirtualItem currentItem = item;
+ while (currentItem.getParent() != null) {
+ position += currentItem.getIndex().intValue();
+ currentItem = currentItem.getParent();
}
- return position >= fStart && position < fEnd || isSelected(item);
+ return position >= fStart && position < fEnd || isSelected(currentItem);
}
@Override
@@ -62,9 +63,10 @@ public void showItem(VirtualItem item) {
private int calcPosition(VirtualItem item) {
int position = 0;
- while (item.getParent() != null) {
- position += item.getIndex().intValue();
- item = item.getParent();
+ VirtualItem currentItem = item;
+ while (currentItem.getParent() != null) {
+ position += currentItem.getIndex().intValue();
+ currentItem = currentItem.getParent();
}
return position;
}
@@ -92,9 +94,10 @@ private VirtualItem[] getSelection(VirtualItem item) {
}
private VirtualTree getTree(VirtualItem item) {
- while (item != null && !(item instanceof VirtualTree)) {
- item = item.getParent();
+ VirtualItem currentItem = item;
+ while (currentItem != null && !(currentItem instanceof VirtualTree)) {
+ currentItem = currentItem.getParent();
}
- return (VirtualTree)item;
+ return (VirtualTree) currentItem;
}
}
diff --git a/debug/org.eclipse.debug.ui.launchview.tests/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.ui.launchview.tests/META-INF/MANIFEST.MF
index 6bb23c089a4..f164c6e01b8 100644
--- a/debug/org.eclipse.debug.ui.launchview.tests/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.ui.launchview.tests/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.debug.ui.launchview.tests;singleton:=true
Bundle-Version: 1.1.0.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.28.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)",
org.eclipse.debug.ui.launchview;bundle-version="[1.0.2,2.0.0)",
org.junit
diff --git a/debug/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF
index 76f7a3a8202..a0cd1791f88 100644
--- a/debug/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.ui.launchview/META-INF/MANIFEST.MF
@@ -2,19 +2,19 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.ui.launchview;singleton:=true
-Bundle-Version: 1.1.100.qualifier
+Bundle-Version: 1.1.300.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime;bundle-version="[3.28.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.e4.ui.model.workbench,
org.eclipse.debug.ui,
org.eclipse.e4.core.di.annotations,
org.eclipse.e4.ui.di,
org.eclipse.e4.ui.services
Bundle-RequiredExecutionEnvironment: JavaSE-17
-Import-Package: javax.annotation;version="[1.0.0,2.0.0)",
- javax.inject;version="[1.0.0,2.0.0)"
+Import-Package: jakarta.annotation;version="[2.0.0,3.0.0)",
+ jakarta.inject;version="[2.0.0,3.0.0)"
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/org.eclipse.debug.ui.launchview.internal.model.LaunchViewModel.xml,
OSGI-INF/org.eclipse.debug.ui.launchview.internal.impl.DebugCoreProvider.xml
diff --git a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java
index 3b08bd01a07..dde6d02221f 100644
--- a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java
+++ b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/EditAction.java
@@ -23,7 +23,7 @@
public class EditAction {
- private LaunchViewImpl view;
+ private final LaunchViewImpl view;
public EditAction(LaunchViewImpl view) {
this.view = view;
diff --git a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java
index 8192981343f..69dd6e62def 100644
--- a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java
+++ b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchAction.java
@@ -43,7 +43,7 @@ public class LaunchAction {
}
private final ILaunchMode mode;
- private LaunchViewImpl view;
+ private final LaunchViewImpl view;
public LaunchAction(ILaunchMode mode, LaunchViewImpl view) {
this.mode = mode;
diff --git a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java
index ffcbc24a21d..d05362ff5d5 100644
--- a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java
+++ b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/LaunchViewImpl.java
@@ -23,10 +23,6 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -61,6 +57,10 @@
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
+import jakarta.inject.Inject;
+
public class LaunchViewImpl implements Supplier> {
private static final String CONTEXT_MENU_ID = "LaunchViewContextMenu"; //$NON-NLS-1$
diff --git a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java
index 210397aada8..75902497a8c 100644
--- a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java
+++ b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/RelaunchAction.java
@@ -26,7 +26,7 @@
public class RelaunchAction {
- private LaunchViewImpl view;
+ private final LaunchViewImpl view;
public RelaunchAction(LaunchViewImpl view) {
this.view = view;
diff --git a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java
index 5544e27541e..419bac6391c 100644
--- a/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java
+++ b/debug/org.eclipse.debug.ui.launchview/src/org/eclipse/debug/ui/launchview/internal/view/TerminateAction.java
@@ -26,7 +26,7 @@
public class TerminateAction {
- private LaunchViewImpl view;
+ private final LaunchViewImpl view;
public TerminateAction(LaunchViewImpl view) {
this.view = view;
diff --git a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index ae1e12c6194..35261b4ac26 100644
--- a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
-Bundle-Version: 3.18.100.qualifier
+Bundle-Version: 3.18.200.qualifier
Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -88,11 +88,10 @@ Require-Bundle: org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.27.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
org.eclipse.e4.ui.services;bundle-version="[1.3.700,2.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
Import-Package: org.eclipse.ui.forms.widgets
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.debug.ui
diff --git a/debug/org.eclipse.debug.ui/forceQualifierUpdate.txt b/debug/org.eclipse.debug.ui/forceQualifierUpdate.txt
index a74d93d98ca..05c3dfe8e4c 100644
--- a/debug/org.eclipse.debug.ui/forceQualifierUpdate.txt
+++ b/debug/org.eclipse.debug.ui/forceQualifierUpdate.txt
@@ -3,3 +3,4 @@ Bug 509973 - Comparator errors in I20170105-0320
Bug 534597 - Unanticipated comparator errors in I20180511-2000
Bug 566471 - I20200828-0150 - Comparator Errors Found
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1184
+https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1378
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 1ce802f72da..a5ee07f009c 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -26,7 +26,6 @@
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.expressions.EvaluationContext;
@@ -218,7 +217,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
*
* @since 3.3
*/
- private Set fSaveParticipants = new LinkedHashSet<>();
+ private final Set fSaveParticipants = new LinkedHashSet<>();
/**
* Theme listener.
@@ -234,7 +233,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
* allows termination, which equates to cancellation of the launch.
*/
public static class PendingLaunch extends Launch {
- private Job fJob;
+ private final Job fJob;
public PendingLaunch(ILaunchConfiguration launchConfiguration, String mode, Job job) {
super(launchConfiguration, mode, null);
fJob= job;
@@ -905,11 +904,10 @@ public ProcessConsoleManager getProcessConsoleManager() {
* @since 3.0
*/
public static Document getDocument() throws ParserConfigurationException {
- DocumentBuilderFactory dfactory= DocumentBuilderFactory.newInstance();
-
- DocumentBuilder docBuilder= dfactory.newDocumentBuilder();
- Document doc= docBuilder.newDocument();
- return doc;
+ @SuppressWarnings("restriction")
+ DocumentBuilder docBuilder = org.eclipse.core.internal.runtime.XmlProcessorFactory
+ .createDocumentBuilderWithErrorOnDOCTYPE();
+ return docBuilder.newDocument();
}
/**
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
index cb648f958ae..def31b7085d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
@@ -63,7 +63,7 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* Maps image descriptors to images.
*/
- private Map fImages = new HashMap<>();
+ private final Map fImages = new HashMap<>();
/**
* @see ILabelProvider#getImage(Object)
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index 843e2e0d1bf..4f5ea54f4fa 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -62,11 +62,11 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* A mapping of attribute ids to their values
* @see IDebugModelPresentation#setAttribute
*/
- private HashMap fAttributes = new HashMap<>(3);
+ private final HashMap fAttributes = new HashMap<>(3);
/**
* A table of label providers keyed by debug model identifiers.
*/
- private HashMap fLabelProviders = new HashMap<>(5);
+ private final HashMap fLabelProviders = new HashMap<>(5);
@Override
public void removeAnnotations(IEditorPart editorPart, IThread thread) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
index b40a196cf95..7c3d9871872 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
@@ -26,7 +26,7 @@ public class DynamicInstructionPointerAnnotation extends Annotation {
* The frame for this instruction pointer annotation. This is necessary only so that
* instances of this class can be distinguished by equals().
*/
- private IStackFrame fStackFrame;
+ private final IStackFrame fStackFrame;
/**
*
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
index d095432e07a..2cc5cb5f6e2 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
@@ -29,8 +29,8 @@
*/
public class ImageDescriptorRegistry {
- private Map fRegistry = Collections.synchronizedMap(new HashMap<>(10));
- private Display fDisplay;
+ private final Map fRegistry = Collections.synchronizedMap(new HashMap<>(10));
+ private final Display fDisplay;
/**
* Creates a new image descriptor registry for the current or default display,
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java
index 68c99b17d78..833c191d24a 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java
@@ -25,7 +25,7 @@ public class InstructionPointerAnnotation extends DynamicInstructionPointerAnnot
/**
* The image for this annotation.
*/
- private Image fImage;
+ private final Image fImage;
/**
* Constructs an instruction pointer image.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
index 3da6085fe9c..326f3997d33 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
@@ -28,22 +28,22 @@ public class InstructionPointerContext {
/**
* The thread this context belongs to.
*/
- private IThread fThread;
+ private final IThread fThread;
/**
* The debug target this context belongs to.
*/
- private IDebugTarget fDebugTarget;
+ private final IDebugTarget fDebugTarget;
/**
* The editor that the annotation is being displayed in
*/
- private ITextEditor fEditor;
+ private final ITextEditor fEditor;
/**
* The vertical ruler annotation for this context.
*/
- private Annotation fAnnotation;
+ private final Annotation fAnnotation;
public InstructionPointerContext(IDebugTarget target, IThread thread, ITextEditor editor, Annotation annotation) {
fDebugTarget = target;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
index 42b1aab4e77..6e18221fff6 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
@@ -53,12 +53,12 @@ public class InstructionPointerManager{
/**
* Set containing all instruction pointer contexts this class manages
*/
- private Set fIPCSet = new HashSet<>();
+ private final Set fIPCSet = new HashSet<>();
/**
* Maps ITextEditors to the set of instruction pointer contexts that are displayed in the editor
*/
- private Map> fEditorMap = new HashMap<>();
+ private final Map> fEditorMap = new HashMap<>();
/**
* Part listener added to editors that contain annotations. Allows instruction pointer contexts to
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
index e3fd258780c..e3cd0871bba 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
@@ -51,7 +51,7 @@ public class MultipleInputDialog extends Dialog {
protected List validators = new ArrayList<>();
protected Map valueMap = new HashMap<>();
- private String title;
+ private final String title;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TerminateToggleValue.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TerminateToggleValue.java
index 47074e750c3..6ca27133bf0 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TerminateToggleValue.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TerminateToggleValue.java
@@ -23,8 +23,8 @@
* @since 3.12
*/
public class TerminateToggleValue {
- private boolean fIsShift;
- private LaunchShortcutExtension fShortcut;
+ private final boolean fIsShift;
+ private final LaunchShortcutExtension fShortcut;
public TerminateToggleValue(boolean isShift, LaunchShortcutExtension shortcut) {
fIsShift = isShift;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TextGetSetEditingSupport.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TextGetSetEditingSupport.java
index 41139ea7a04..396a35ea87e 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TextGetSetEditingSupport.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/TextGetSetEditingSupport.java
@@ -25,9 +25,9 @@
import org.eclipse.swt.widgets.Composite;
public class TextGetSetEditingSupport extends EditingSupport {
- private Function getter;
- private BiConsumer setter;
- private ColumnViewer viewer;
+ private final Function getter;
+ private final BiConsumer setter;
+ private final ColumnViewer viewer;
public TextGetSetEditingSupport(ColumnViewer viewer, Function getter, BiConsumer setter) {
super(viewer);
this.viewer = viewer;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
index 80fa4dd19ba..e20a7cbaf0d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
@@ -48,7 +48,7 @@ public class VariableValueEditorManager {
* which are replaced by IVariableValueEditors as the editors
* are instantiated (editors are loaded lazily, then cached).
*/
- private Map fEditorMap = new HashMap<>();
+ private final Map fEditorMap = new HashMap<>();
/**
* The singleton instance of this manager.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
index 7043872a7aa..6d0b1db54d7 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
@@ -26,7 +26,7 @@
*/
public class CollapseAllAction extends Action implements IUpdate {
- private TreeModelViewer fViewer;
+ private final TreeModelViewer fViewer;
public CollapseAllAction(TreeModelViewer viewer) {
super(ActionMessages.CollapseAllAction_0, DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL));
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
index 5157a007994..559fd4e752d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
@@ -41,7 +41,7 @@
*/
public class ConfigureColumnsAction extends Action implements IUpdate {
- private TreeModelViewer fViewer;
+ private final TreeModelViewer fViewer;
static class ColumnContentProvider implements IStructuredContentProvider {
@@ -62,7 +62,7 @@ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
class ColumnLabelProvider extends LabelProvider {
- private Map fImages = new HashMap<>();
+ private final Map fImages = new HashMap<>();
@Override
public Image getImage(Object element) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
index dafdae0a4dd..b26ff378258 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
@@ -31,7 +31,7 @@
*/
public abstract class ExecutionAction implements IActionDelegate2 {
- private String fLaunchGroupIdentifier;
+ private final String fLaunchGroupIdentifier;
public ExecutionAction(String launchGroupIdentifier) {
fLaunchGroupIdentifier = launchGroupIdentifier;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
index e070a9f3d9e..12ad8b40661 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
@@ -34,8 +34,8 @@
*/
public class LaunchConfigurationAction extends Action {
- private ILaunchConfiguration fConfig;
- private String fMode;
+ private final ILaunchConfiguration fConfig;
+ private final String fMode;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
index 212998f47cf..5d003c06b87 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
@@ -46,8 +46,8 @@
*/
public class LaunchShortcutAction extends Action {
- private String fMode;
- private LaunchShortcutExtension fShortcut;
+ private final String fMode;
+ private final LaunchShortcutExtension fShortcut;
private ILaunchConfiguration configuration;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
index 478489982e3..382a4032054 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
@@ -35,7 +35,7 @@
*/
public class RetargetRunToLineAction extends RetargetAction {
- private DebugContextListener fContextListener = new DebugContextListener();
+ private final DebugContextListener fContextListener = new DebugContextListener();
private ISuspendResume fTargetElement = null;
class DebugContextListener implements IDebugContextListener {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
index d316c538214..87c876fc8f1 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
@@ -95,7 +95,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
*/
private static class ToggleTargetFactory implements IToggleBreakpointsTargetFactory {
- private IConfigurationElement fConfigElement;
+ private final IConfigurationElement fConfigElement;
private IToggleBreakpointsTargetFactory fFactory;
private Expression fEnablementExpression;
@@ -445,12 +445,12 @@ public static ToggleBreakpointsTargetManager getDefault(){
* Maps the IDs of toggle targets to the factory that can create them.
* There can currently only be one factory for a given toggle target.
*/
- private Map fFactoriesByTargetID = new HashMap<>();
+ private final Map fFactoriesByTargetID = new HashMap<>();
/**
* List of listeners to changes in the preferred toggle targets list.
*/
- private ListenerList fChangedListners = new ListenerList<>();
+ private final ListenerList fChangedListners = new ListenerList<>();
/**
* Initializes the collection of known factories from extension point contributions.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
index 0266e600cbc..8d705db8774 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
@@ -26,7 +26,7 @@
*/
public class AdvancedGroupBreakpointsByAction extends Action {
- private BreakpointsView fView;
+ private final BreakpointsView fView;
public AdvancedGroupBreakpointsByAction(BreakpointsView view) {
super(IInternalDebugCoreConstants.EMPTY_STRING, IAction.AS_RADIO_BUTTON);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java
index 2c6cdf1e6f3..abaa216896f 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java
@@ -21,7 +21,7 @@
*/
public abstract class BreakpointSelectionAction extends SelectionListenerAction {
- private BreakpointsView fView;
+ private final BreakpointsView fView;
/**
* Constructs an action for the breakpoints view.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
index 365efdeb97c..e70d42190c1 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
@@ -26,8 +26,8 @@
*/
public class GroupBreakpointsAction extends Action {
- private IBreakpointOrganizer fOrganzier;
- private BreakpointsView fView;
+ private final IBreakpointOrganizer fOrganzier;
+ private final BreakpointsView fView;
/**
* Creates a new action which will group breakpoints in the given
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
index 49df424dcd1..47fd39e6df4 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
@@ -57,17 +57,17 @@
*/
public class GroupBreakpointsByDialog extends TrayDialog {
- private BreakpointsView fView;
+ private final BreakpointsView fView;
// Table viewer that presents available containers
private TableViewer fAvailableViewer;
- private AvailableOrganizersProvider fAvailableOrganizersProvider= new AvailableOrganizersProvider();
+ private final AvailableOrganizersProvider fAvailableOrganizersProvider= new AvailableOrganizersProvider();
// Tree viewer that presents selected containers
private TreeViewer fSelectedViewer;
- private SelectedOrganizerProvider fSelectedOrganizersProvider= new SelectedOrganizerProvider();
+ private final SelectedOrganizerProvider fSelectedOrganizersProvider= new SelectedOrganizerProvider();
- private List fResult = new ArrayList<>();
+ private final List fResult = new ArrayList<>();
private Button fAddButton;
private Button fRemoveButton;
@@ -78,7 +78,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* Selection listener that listens to selection from all buttons in this
* dialog.
*/
- private SelectionAdapter fSelectionListener= new SelectionAdapter() {
+ private final SelectionAdapter fSelectionListener= new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
@@ -474,7 +474,7 @@ public Object[] getElements(Object inputElement) {
* Label provider which provides text and images for breakpoint container factories
*/
private class BreakpointOrganzierLabelProvider extends LabelProvider {
- private HashMap fImageCache = new HashMap<>();
+ private final HashMap fImageCache = new HashMap<>();
@Override
public String getText(Object element) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsAction.java
index 7cd9227fed0..0837b9dd1dc 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsAction.java
@@ -27,7 +27,7 @@
*/
public class SortBreakpointsAction extends Action {
- private BreakpointsView fView;
+ private final BreakpointsView fView;
int actionSort;
/**
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
index 551ba922323..c1c0ac12f0e 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
@@ -30,9 +30,9 @@
*/
public class EditWatchExpressinInPlaceAction extends Action implements ISelectionChangedListener {
- private ExpressionView fView;
- private TreeModelViewer fViewer;
- private EditWatchExpressionAction fEditActionDelegate = new EditWatchExpressionAction();
+ private final ExpressionView fView;
+ private final TreeModelViewer fViewer;
+ private final EditWatchExpressionAction fEditActionDelegate = new EditWatchExpressionAction();
public EditWatchExpressinInPlaceAction(ExpressionView view) {
fView = view;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
index 548245b87b1..bfd465f6658 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
@@ -58,7 +58,7 @@ public class WatchExpressionDialog extends StatusDialog {
/**
* The detail formatter to edit.
*/
- private IWatchExpression fWatchExpression;
+ private final IWatchExpression fWatchExpression;
// widgets
private SourceViewer fSnippetViewer;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
index 4aa3b7e61db..f9053d3b557 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
@@ -45,7 +45,7 @@
public class ChangeVariableValueAction extends SelectionProviderAction {
protected IVariable fVariable;
- private VariablesView fView;
+ private final VariablesView fView;
private boolean fEditing= false;
private boolean isApplicable = false;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
index b8895c50374..698f9e9f132 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
@@ -45,12 +45,12 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/**
* The title of the dialog.
*/
- private String title;
+ private final String title;
/**
* The message to display, or null if none.
*/
- private String message;
+ private final String message;
/**
* The input value; the empty string by default.
@@ -60,7 +60,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/**
* The input validator, or null if none.
*/
- private IInputValidator validator;
+ private final IInputValidator validator;
/**
* Ok button widget.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
index c1294b9cc54..b65ef14b744 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
@@ -46,9 +46,9 @@
*/
public class DetailPaneAssignValueAction extends Action{
- private IHandlerActivation fHandlerActivation;
- private IViewSite fViewSite;
- private ITextViewer fTextViewer;
+ private final IHandlerActivation fHandlerActivation;
+ private final IViewSite fViewSite;
+ private final ITextViewer fTextViewer;
private IStructuredSelection fCurrentSelection;
/**
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
index da8a869d8ff..bb0e3acd5d0 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
@@ -28,7 +28,7 @@
*/
public class DetailPaneMaxLengthAction extends Action {
- private Shell fDialogShell;
+ private final Shell fDialogShell;
public DetailPaneMaxLengthAction(Shell dialogShell){
super(ActionMessages.DetailPaneMaxLengthAction_0);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
index 07fedbb2694..f39ae03f4f0 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
@@ -37,7 +37,7 @@
public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter {
private static Map fOthers = new HashMap<>();
- private IBreakpointOrganizer fOrganizer;
+ private final IBreakpointOrganizer fOrganizer;
public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/codemining/DebugValueCodeMining.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/codemining/DebugValueCodeMining.java
index b5355350680..a76ac9c3f43 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/codemining/DebugValueCodeMining.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/codemining/DebugValueCodeMining.java
@@ -27,7 +27,7 @@
public class DebugValueCodeMining extends LineEndCodeMining {
- private IVariable variable;
+ private final IVariable variable;
protected DebugValueCodeMining(IDocument document, int line, IVariable variable, ICodeMiningProvider provider)
throws BadLocationException {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
index d8245e06304..9f4ffeaa9eb 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
@@ -22,8 +22,8 @@
*/
public class ActionsUpdater {
- private IEnabledTarget[] fActions;
- private int fNumVoters;
+ private final IEnabledTarget[] fActions;
+ private final int fNumVoters;
private int fNumOfVotes = 0;
private boolean fDone = false;
private boolean fEnabled = true;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
index ed3c769466b..01f30bca41e 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
@@ -29,7 +29,7 @@
*/
public abstract class DebugActionHandler implements IHandler2 {
- private String fActionId;
+ private final String fActionId;
/**
* Constructs a new handler for the given action identifier.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
index 96afac9b8a0..cdbb71f3561 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
@@ -54,7 +54,7 @@ public class DebugCommandService implements IDebugContextListener {
/**
* The context service for this command service.
*/
- private IDebugContextService fContextService;
+ private final IDebugContextService fContextService;
/**
* Service per window
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
index 7f413108a76..38c2b4648f3 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
@@ -29,7 +29,7 @@
*/
public class RestartCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
- private DebugCommandAction fDebugAction = new RestartCommandAction();
+ private final DebugCommandAction fDebugAction = new RestartCommandAction();
@Override
public void dispose() {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
index 762356a13fc..bebd7e85562 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
@@ -29,7 +29,7 @@
*/
public class ResumeCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
- private DebugCommandAction fDebugAction = new ResumeCommandAction();
+ private final DebugCommandAction fDebugAction = new ResumeCommandAction();
@Override
public void dispose() {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllActionDelegate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllActionDelegate.java
index b809026be99..3b0a623d668 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllActionDelegate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllActionDelegate.java
@@ -29,7 +29,7 @@
*/
public class TerminateAllActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2, IViewActionDelegate {
- private DebugCommandAction fConsoleAction = new TerminateAllAction();
+ private final DebugCommandAction fConsoleAction = new TerminateAllAction();
@Override
public void dispose() {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
index 701099563c3..be6ed7eddd0 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
@@ -27,7 +27,7 @@
*/
public class UpdateActionsRequest extends DebugCommandRequest implements IEnabledStateRequest {
- private IEnabledTarget[] fActions;
+ private final IEnabledTarget[] fActions;
private boolean fEnabled = false;
public UpdateActionsRequest(Object[] elements, IEnabledTarget[] actions) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
index ad0a8a92b02..58e0ebd8158 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
@@ -27,7 +27,7 @@
public class UpdateHandlerRequest extends DebugCommandRequest implements IEnabledStateRequest {
private boolean fEnabled = false;
- private ActionsUpdater fUpdater;
+ private final ActionsUpdater fUpdater;
public UpdateHandlerRequest(Object[] elements, ActionsUpdater updater) {
super(elements);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
index 8e9ab0457ae..040730ed0ab 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
@@ -72,7 +72,7 @@ public static ContextRunner getDefault() {
* The one instance of LaunchingResourceManager we need
* @since 3.4
*/
- private LaunchingResourceManager fLRM = DebugUIPlugin.getDefault().getLaunchingResourceManager();
+ private final LaunchingResourceManager fLRM = DebugUIPlugin.getDefault().getLaunchingResourceManager();
/**
* Performs the context launching given the object context and the mode to
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
index 2b1d97b9095..900389b1aca 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
@@ -89,18 +89,18 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
*The set of label update listeners
*/
- private ListenerList fLabelListeners = new ListenerList<>();
+ private final ListenerList fLabelListeners = new ListenerList<>();
/**
* The map of ToolBars that have mouse tracker listeners associated with them:
* stored as Map
*/
- private HashMap fToolbars = new HashMap<>();
+ private final HashMap fToolbars = new HashMap<>();
/**
* the map of current labels
*/
- private HashMap fCurrentLabels = new HashMap<>();
+ private final HashMap fCurrentLabels = new HashMap<>();
/**
* The selection has changed and we need to update the labels
@@ -110,19 +110,19 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Set of windows that have been opened and that we have registered selection listeners with
*/
- private HashSet fWindows = new HashSet<>();
+ private final HashSet fWindows = new HashSet<>();
/**
* Cache of IResource -> ILaunchConfiguration[] used during a tooltip update job.
* The cache is cleared after each tooltip update job is complete.
*/
- private HashMap fConfigCache = new HashMap<>();
+ private final HashMap fConfigCache = new HashMap<>();
/**
* Cache of IResource -> LaunchShortcutExtension used during a tooltip update job.
* The cache is cleared after each tooltip update job is complete.
*/
- private HashMap> fExtCache = new HashMap<>();
+ private final HashMap> fExtCache = new HashMap<>();
/**
* Constant denoting the empty string;
@@ -132,7 +132,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Provides a mouse tracker listener for the launching main toolbar
*/
- private MouseTrackAdapter fMouseListener = new MouseTrackAdapter() {
+ private final MouseTrackAdapter fMouseListener = new MouseTrackAdapter() {
@Override
public void mouseEnter(MouseEvent e) {
if(fUpdateLabel) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index e244312965f..3df0a107392 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -37,8 +37,8 @@
public class DebugContextManager implements IDebugContextManager {
private static DebugContextManager fgDefault;
- private Map fServices = new HashMap<>();
- private ListenerList fGlobalListeners = new ListenerList<>();
+ private final Map fServices = new HashMap<>();
+ private final ListenerList fGlobalListeners = new ListenerList<>();
/**
* A debug context service that does nothing (used for windows that have been closed)
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
index b81101eedd7..62d7e588774 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
@@ -71,33 +71,33 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* Map of debug model identifier to associated contexts as defined
* by debugModelContextBindings extensions.
*/
- private Map> fModelToContextIds = new HashMap<>();
+ private final Map> fModelToContextIds = new HashMap<>();
/**
* Map of launch objects to enabled model ids
*/
- private Map> fLaunchToModelIds = new HashMap<>();
+ private final Map> fLaunchToModelIds = new HashMap<>();
/**
* Map of launch objects to context activations
*/
- private Map> fLanuchToContextActivations = new HashMap<>();
+ private final Map> fLanuchToContextActivations = new HashMap<>();
/**
* A list of activity pattern bindings for debug models.
*/
- private List fModelPatternBindings = new ArrayList<>();
+ private final List fModelPatternBindings = new ArrayList<>();
/**
* Map of debug model ids to associated activity ids.
*/
- private Map> fModelToActivities = new HashMap<>();
+ private final Map> fModelToActivities = new HashMap<>();
/**
* A set of debug model ids for which activities have been enabled.
* Cleared when enabled activities change.
*/
- private Set fModelsEnabledForActivities = new HashSet<>();
+ private final Set fModelsEnabledForActivities = new HashSet<>();
// extension point
public static final String ID_DEBUG_MODEL_CONTEXT_BINDINGS= "debugModelContextBindings"; //$NON-NLS-1$
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 780901061b2..c89769cf072 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -47,12 +47,12 @@
*/
public class DebugWindowContextService implements IDebugContextService, IPartListener2, IDebugContextListener {
- private Map> fListenersByPartId = new HashMap<>();
- private Map fProvidersByPartId = new HashMap<>();
- private Map> fPostListenersByPartId = new HashMap<>();
+ private final Map> fListenersByPartId = new HashMap<>();
+ private final Map fProvidersByPartId = new HashMap<>();
+ private final Map> fPostListenersByPartId = new HashMap<>();
private IWorkbenchWindow fWindow;
- private List fProviders = new ArrayList<>();
+ private final List fProviders = new ArrayList<>();
private DebugContextSourceProvider fSourceProvider;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
index c7afa1f3dc4..7384ba9f666 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
@@ -25,7 +25,7 @@
*/
public class SuspendTriggerAdapterFactory implements IAdapterFactory {
- private Map fSuspendTriggers = new HashMap<>();
+ private final Map fSuspendTriggers = new HashMap<>();
@SuppressWarnings("unchecked")
@Override
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
index 0ea4beaa7fb..0f19957b13c 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
@@ -64,7 +64,7 @@
public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentationFactory, IElementContentProvider, IElementMementoProvider {
private IRegisterGroup[] fGroups;
- private IStackFrame fFrame;
+ private final IStackFrame fFrame;
private static final String HASH_CODE = "HASH_CODE"; //$NON-NLS-1$
@@ -75,7 +75,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
* models do not know or need to know about the proxy).
*/
private class Update extends Request implements IViewerUpdate {
- private IViewerUpdate fViewerUpdate;
+ private final IViewerUpdate fViewerUpdate;
Update(IViewerUpdate update) {
fViewerUpdate = update;
@@ -111,7 +111,7 @@ public Object getViewerInput() {
private class CountUpdate extends Update implements IChildrenCountUpdate {
- private IChildrenCountUpdate fUpdate;
+ private final IChildrenCountUpdate fUpdate;
CountUpdate(IChildrenCountUpdate delegate) {
super(delegate);
@@ -127,7 +127,7 @@ public void setChildCount(int numChildren) {
private class HasUpdate extends Update implements IHasChildrenUpdate {
- private IHasChildrenUpdate fUpdate;
+ private final IHasChildrenUpdate fUpdate;
HasUpdate(IHasChildrenUpdate delegate) {
super(delegate);
@@ -143,7 +143,7 @@ public void setHasChilren(boolean hasChildren) {
private class ChildrenUpdate extends Update implements IChildrenUpdate {
- private IChildrenUpdate fUpdate;
+ private final IChildrenUpdate fUpdate;
ChildrenUpdate(IChildrenUpdate delegate) {
super(delegate);
@@ -174,7 +174,7 @@ public void setChild(Object child, int offset) {
*/
private class MementoRequest extends Update implements IElementMementoRequest {
- private IElementMementoRequest fUpdate;
+ private final IElementMementoRequest fUpdate;
MementoRequest(IElementMementoRequest request) {
super(request);
fUpdate = request;
@@ -197,7 +197,7 @@ public TreePath getElementPath() {
private class ElementCompare extends MementoRequest implements IElementCompareRequest {
- private IElementCompareRequest fRequest;
+ private final IElementCompareRequest fRequest;
ElementCompare(IElementCompareRequest request) {
super(request);
fRequest = request;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
index 16a2b2669b5..af4ec912fa1 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java
@@ -108,7 +108,7 @@ class CommonTabLite extends AbstractLaunchConfigurationTab {
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
- private ModifyListener fBasicModifyListener = evt -> updateLaunchConfigurationDialog();
+ private final ModifyListener fBasicModifyListener = evt -> updateLaunchConfigurationDialog();
@Override
public void createControl(Composite parent) {
@@ -510,7 +510,7 @@ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
*/
static class FavoritesLabelProvider implements ITableLabelProvider {
- private Map fImages = new HashMap<>();
+ private final Map fImages = new HashMap<>();
@Override
public Image getColumnImage(Object element, int columnIndex) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
index 137c02397d8..b94b96794d2 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
@@ -61,7 +61,7 @@ public class EmbeddedBreakpointsViewer {
private BreakpointsContentProvider fProvider = null;
private Tree fTree = null;
private BreakpointsViewer fViewer = null;
- private ICheckStateListener fCheckListener = event -> updateCheckedState(event.getElement(), event.getChecked());
+ private final ICheckStateListener fCheckListener = event -> updateCheckedState(event.getElement(), event.getChecked());
/**
* This constructor allows a specific selection to be used in stead of the default
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
index b63dd42482b..f8f394a181f 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
@@ -53,7 +53,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage implements
private Button fSelectAll = null;
private Button fDeselectAll = null;
- private ICheckStateListener fImportCheckListener = event -> updateCheckedState(event.getChecked());
+ private final ICheckStateListener fImportCheckListener = event -> updateCheckedState(event.getChecked());
protected WizardImportBreakpointsSelectionPage(String pageName) {
super(pageName, ImportExportMessages.WizardImportBreakpointsSelectionPage_2, null);
}
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
index 37141526cdb..b469b5d0cd5 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
@@ -31,7 +31,7 @@
*/
public class ExportLaunchConfigurationsWizard extends Wizard implements IExportWizard {
- private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
+ private final String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
private IStructuredSelection selectedElements;
/**
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index af569f5cf2d..6d5da743e65 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -74,7 +74,7 @@
*/
public class ExportLaunchConfigurationsWizardPage extends WizardPage {
- private ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ private final ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
/**
* The content provider for the tree viewer
@@ -115,8 +115,8 @@ public Object[] getElements(Object inputElement) {
return getUsedLaunchConfigurationTypes();
}
}
- private String OVERWRITE = "overwrite"; //$NON-NLS-1$
- private String OLD_PATH = "oldpath"; //$NON-NLS-1$
+ private final String OVERWRITE = "overwrite"; //$NON-NLS-1$
+ private final String OLD_PATH = "oldpath"; //$NON-NLS-1$
private CheckboxTreeViewer fViewer = null;
private Text fFilePath = null;
private Button fOverwrite = null;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
index 49935961890..b92dc6eecd7 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
@@ -32,7 +32,7 @@
*/
public class ImportLaunchConfigurationsWizard extends Wizard implements IImportWizard {
- private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
+ private final String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
index 9a39ffb3e19..19c3f61f916 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
@@ -125,8 +125,8 @@ private void populateElementChildren() {
}
}
- private String OVERWRITE = "import_config_overwrite"; //$NON-NLS-1$
- private String OLD_PATH = "import_config_oldpath"; //$NON-NLS-1$
+ private final String OVERWRITE = "import_config_overwrite"; //$NON-NLS-1$
+ private final String OLD_PATH = "import_config_oldpath"; //$NON-NLS-1$
private Text fFromDirectory = null;
private Button fOverwrite = null;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
index 0a261d7e9ce..1aea666072a 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
@@ -29,7 +29,7 @@ public abstract class AbstractLaunchConfigurationAction extends SelectionListene
/**
* The mode this action was created in (run, debug, ...)
*/
- private String fMode;
+ private final String fMode;
/**
* Allows a requestor to abort this action.
@@ -52,7 +52,7 @@ public interface IConfirmationRequestor {
/**
* The viewer this action is working on
*/
- private Viewer fViewer;
+ private final Viewer fViewer;
/**
* Constructor for AbstractLaunchConfigurationAction.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
index acdacf53b2a..54246765853 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
@@ -65,7 +65,7 @@ public class FavoritesDialog extends TrayDialog {
private TableViewer fFavoritesTable;
// history being organized
- private LaunchHistory fHistory;
+ private final LaunchHistory fHistory;
// favorites collection under edit
private List fFavorites;
@@ -80,7 +80,7 @@ public class FavoritesDialog extends TrayDialog {
/**
* Listener that delegates when a button is pressed
*/
- private SelectionAdapter fButtonListener= new SelectionAdapter() {
+ private final SelectionAdapter fButtonListener= new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Button button = (Button) e.widget;
@@ -99,12 +99,12 @@ public void widgetSelected(SelectionEvent e) {
/**
* Listener that delegates when the selection changes in a table
*/
- private ISelectionChangedListener fSelectionChangedListener= event -> handleFavoriteSelectionChanged();
+ private final ISelectionChangedListener fSelectionChangedListener= event -> handleFavoriteSelectionChanged();
/**
* Listener that delegates when a key is pressed in a table
*/
- private KeyListener fKeyListener= new KeyAdapter() {
+ private final KeyListener fKeyListener= new KeyAdapter() {
@Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
index 723394ccb0a..cb35af46ef2 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
@@ -37,7 +37,7 @@ public class FilterLaunchConfigurationAction extends Action {
/**
* the menu for this drop down style action
*/
- private FilterDropDownMenuCreator fMenuCreator;
+ private final FilterDropDownMenuCreator fMenuCreator;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
index 0e6dcdd761c..0ef58900194 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
@@ -28,7 +28,7 @@
*/
public class LaunchCategoryFilter extends ViewerFilter {
- private String fCategory;
+ private final String fCategory;
/**
* Constructs a filter that hides configurations from a specific
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index 95b9ce0b787..9786efcfd38 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -31,7 +31,6 @@
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.expressions.IEvaluationContext;
@@ -46,6 +45,7 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
@@ -162,7 +162,7 @@ private boolean nullOrEqual(String a, String b) {
/**
* The list of registered implementors of ILaunchHistoryChangedListener
*/
- protected List fLaunchHistoryChangedListeners = new ArrayList<>(3);
+ protected ListenerList fLaunchHistoryChangedListeners = new ListenerList<>();
/**
* Launch shortcuts
@@ -371,9 +371,7 @@ public ILaunchConfiguration getFilteredLastLaunch(String groupId) {
* @param listener the listener to add - adding a duplicate listener has no effect
*/
public void addLaunchHistoryListener(ILaunchHistoryChangedListener listener) {
- if (!fLaunchHistoryChangedListeners.contains(listener)) {
- fLaunchHistoryChangedListeners.add(listener);
- }
+ fLaunchHistoryChangedListeners.add(listener);
}
/**
@@ -492,7 +490,9 @@ private void restoreLaunchHistory() {
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
// Parse the history file
try {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ @SuppressWarnings("restriction")
+ DocumentBuilder parser = org.eclipse.core.internal.runtime.XmlProcessorFactory
+ .createDocumentBuilderWithErrorOnDOCTYPE();
parser.setErrorHandler(new DefaultHandler());
rootHistoryElement = parser.parse(new InputSource(stream)).getDocumentElement();
} catch (SAXException e) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
index e3a246c186d..c9623e27012 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
@@ -28,7 +28,7 @@
public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelectionDialog {
private static final String DIALOG_SETTINGS = IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_CONFIGURATION_DIALOG"; //$NON-NLS-1$;
- private Object fInput;
+ private final Object fInput;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index f274d52a90c..83c74b62b5e 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -91,7 +91,7 @@ public class LaunchConfigurationTabGroupViewer {
/**
* Containing launch dialog
*/
- private ILaunchConfigurationDialog fDialog;
+ private final ILaunchConfigurationDialog fDialog;
/**
* The launch configuration (original) being edited
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
index bc37b7c5339..d54be9609bd 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
@@ -69,12 +69,12 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
*
* @since 3.2
*/
- private ILaunchManager fLaunchManager = DebugPlugin.getDefault().getLaunchManager();
+ private final ILaunchManager fLaunchManager = DebugPlugin.getDefault().getLaunchManager();
/**
* The launch group to display
*/
- private LaunchGroupExtension fLaunchGroup;
+ private final LaunchGroupExtension fLaunchGroup;
/**
* Actions
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index 3b59b450d8a..83291fc16ff 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -91,6 +91,7 @@
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.progress.WorkbenchJob;
import org.osgi.framework.FrameworkUtil;
@@ -1371,10 +1372,16 @@ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable
fLastControl = null;
}
// Attach the progress monitor part to the cancel button
- fProgressMonitorPart.attachToCancelComponent(null);
- fProgressMonitorPart.getParent().setVisible(true);
+ if (cancelable) {
+ fProgressMonitorPart.attachToCancelComponent(null);
+ }
+
fActiveRunningOperations++;
+ // only show the progress bar if necessary after a delay
+ UIJob showProgressMonitorPart = createJobToShowProgressMonitorPart();
+ showProgressMonitorPart.schedule(PlatformUI.getWorkbench().getProgressService().getLongOperationTime());
+
//do work here collecting enabled states, otherwise to get these states we would need to
//perform the validation of the dialog again, which is expensive and would cause flashing of widgets.
Control[] children = ((Composite)fButtonComp.getChildren()[0]).getChildren();
@@ -1389,11 +1396,15 @@ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable
ModalContext.run(runnable, fork, fProgressMonitorPart, getShell().getDisplay());
}
finally {
+ showProgressMonitorPart.cancel();
+
fActiveRunningOperations--;
updateRunnnableControls(true, prev);
if (getShell() != null) {
fProgressMonitorPart.getParent().setVisible(false);
- fProgressMonitorPart.removeFromCancelComponent(null);
+ if (cancelable) {
+ fProgressMonitorPart.removeFromCancelComponent(null);
+ }
if (fLastControl != null && !fLastControl.isDisposed()) {
fLastControl.setFocus();
}
@@ -1405,6 +1416,17 @@ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable
}
}
+ private UIJob createJobToShowProgressMonitorPart() {
+ return UIJob.create("", __ -> { //$NON-NLS-1$
+ // only show the progress monitor if there are still active operations by the
+ // time this job is executed
+ if (fActiveRunningOperations > 0) {
+ fProgressMonitorPart.getParent().setVisible(true);
+ }
+ return Status.OK_STATUS;
+ });
+ }
+
/**
* Updates the enablement of the runnable controls to appear disabled as a job is running
* @param enabled the desired enable status of the dialog area, revert//apply buttons, and
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
index a523cc1cc1b..799f6c9aa15 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
@@ -28,7 +28,7 @@
*/
public class LaunchGroupFilter extends ViewerFilter {
- private ILaunchGroup fGroup;
+ private final ILaunchGroup fGroup;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
index 4c84ff29daa..96a9d8f0f58 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
@@ -41,12 +41,12 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* Listing of the complete launch history, which includes favorites in the launched ordering
*/
- private Vector fCompleteHistory = new Vector<>();
+ private final Vector fCompleteHistory = new Vector<>();
/**
* The launch group this history is provided for
*/
- private ILaunchGroup fGroup;
+ private final ILaunchGroup fGroup;
/**
* Ordered listing of the favorites of this history
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
index 140647c476f..4b94b4b3fe7 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
@@ -69,8 +69,8 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
*/
private static class LaunchCommandHandler extends AbstractHandler {
// the shortcut to invoke
- private LaunchShortcutExtension fShortcut;
- private String fMode;
+ private final LaunchShortcutExtension fShortcut;
+ private final String fMode;
/**
* Constructs a new command handler for the given shortcut
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
index 1e715578160..62523968515 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
@@ -22,7 +22,7 @@
public class OrganizeFavoritesAction extends Action {
// launch group identifier
- private String fGroupId;
+ private final String fGroupId;
/**
* @param text
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 7466647b47a..a13aa4e5b49 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -273,7 +273,7 @@ protected IStatus run(final IProgressMonitor monitor) {
* Maps each launch to its perspective context activation. These
* are disabled when a launch terminates.
*/
- private Map fLaunchToContextActivations = new HashMap<>();
+ private final Map fLaunchToContextActivations = new HashMap<>();
/**
* Called by the debug ui plug-in on startup.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
index c933d828d90..355f7506169 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
@@ -70,8 +70,8 @@ public void dispose() {}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
- private LaunchHistory fHistory;
- private List fCurrentFavoriteSet;
+ private final LaunchHistory fHistory;
+ private final List fCurrentFavoriteSet;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
index 30e88863b54..0208bb8c619 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
@@ -41,10 +41,10 @@
public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingManager {
// map of rendering type ids to valid rendering types
- private Map fRenderingTypes = new HashMap<>();
+ private final Map fRenderingTypes = new HashMap<>();
// list of renderingBindings
- private List fBindings = new ArrayList<>();
+ private final List fBindings = new ArrayList<>();
// singleton manager
private static MemoryRenderingManager fgDefault;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
index d1380037a21..a77926f7ce3 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
@@ -30,7 +30,7 @@
*/
class MemoryRenderingType implements IMemoryRenderingType {
- private IConfigurationElement fConfigurationElement;
+ private final IConfigurationElement fConfigurationElement;
private IMemoryRenderingTypeDelegate fDelegate;
// attributes for a memoryRenderingType
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index 18a35daf337..a42615a87f4 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -284,7 +284,7 @@ public void run() {
}
private class SwitchPageJob extends UIJob {
- private Object fLock = new Object();
+ private final Object fLock = new Object();
private boolean fShowMessagePage = false;
private String fMessage = IInternalDebugCoreConstants.EMPTY_STRING;
@@ -389,7 +389,7 @@ public boolean isConflicting(ISchedulingRule rule) {
private NextPageAction fNextAction;
private PrevPageAction fPrevAction;
- private ArrayList fContext = new ArrayList<>();
+ private final ArrayList fContext = new ArrayList<>();
private AbstractHandler fGoToAddressHandler;
private AbstractHandler fNextPageHandler;
@@ -399,7 +399,7 @@ public boolean isConflicting(ISchedulingRule rule) {
private boolean fIsDisposed = false;
private boolean fIsShowAddressColumn = true;
- private SwitchPageJob fSwitchPageJob = new SwitchPageJob();
+ private final SwitchPageJob fSwitchPageJob = new SwitchPageJob();
private boolean fError = false;
private PendingPropertyChanges fPendingSyncProperties;
@@ -408,7 +408,7 @@ public boolean isConflicting(ISchedulingRule rule) {
private ArrayList fMenuListeners;
private MenuManager fMenuMgr;
- private ISchedulingRule serialByRenderingRule = new SerialByObjectRule(this);
+ private final ISchedulingRule serialByRenderingRule = new SerialByObjectRule(this);
/**
* Identifier for an empty group preceding all context menu actions (value
@@ -434,26 +434,26 @@ public boolean isConflicting(ISchedulingRule rule) {
*/
public static final String EMPTY_PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
- private ISelectionChangedListener fViewerSelectionChangedListener = event -> {
+ private final ISelectionChangedListener fViewerSelectionChangedListener = event -> {
updateSyncTopAddress(getTopVisibleAddress());
updateSyncSelectedAddress(getSelectedAddress());
};
- private SelectionAdapter fScrollBarSelectionListener = new SelectionAdapter() {
+ private final SelectionAdapter fScrollBarSelectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateSyncTopAddress(getTopVisibleAddress());
}
};
- private IModelChangedListener fModelChangedListener = (delta, proxy) -> {
+ private final IModelChangedListener fModelChangedListener = (delta, proxy) -> {
if (delta.getElement() == getMemoryBlock()) {
showTable();
updateRenderingLabel(isVisible());
}
};
- private IVirtualContentListener fViewerListener = new IVirtualContentListener() {
+ private final IVirtualContentListener fViewerListener = new IVirtualContentListener() {
private int startThreshold;
private int endThreshold;
@@ -507,7 +507,7 @@ public int getThreshold(int bufferEndOrStart) {
}
};
- private IPresentationErrorListener fPresentationErrorListener = (monitor,
+ private final IPresentationErrorListener fPresentationErrorListener = (monitor,
status) -> showMessage(status.getMessage());
/**
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
index b571b3abb71..e192b37519b 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
@@ -29,9 +29,9 @@
*/
public class MemoryViewPresentationContext extends PresentationContext {
- private IMemoryRenderingContainer fContainer;
- private IMemoryRendering fRendering;
- private IMemoryRenderingSite fMemoryView;
+ private final IMemoryRenderingContainer fContainer;
+ private final IMemoryRendering fRendering;
+ private final IMemoryRenderingSite fMemoryView;
/**
* Constructs MemoryViewPresentationContext
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 92944bf10bc..8eedb18d409 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -92,7 +92,7 @@ private class InputData {
* Element comparator, use to compare the ordering of elements for the model
* Note: We assume that the comparator does not change.
*/
- private ElementComparator fComparator;
+ private final ElementComparator fComparator;
/**
* The breakpoint root container.
@@ -108,11 +108,11 @@ private class InputData {
private IStructuredSelection fDebugContext = StructuredSelection.EMPTY;
- private IPropertyChangeListener fOrganizersListener = event -> updateContainers();
+ private final IPropertyChangeListener fOrganizersListener = event -> updateContainers();
- private IPropertyChangeListener fPresentationContextListener = this::presentationPropertyChanged;
+ private final IPropertyChangeListener fPresentationContextListener = this::presentationPropertyChanged;
- private IDebugContextListener fDebugContextListener = InputData.this::debugContextChanged;
+ private final IDebugContextListener fDebugContextListener = InputData.this::debugContextChanged;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
index a3efe452050..430009e0dd9 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
@@ -33,7 +33,7 @@ public abstract class ElementContentProvider implements IElementContentProvider
protected static final Object[] EMPTY = new Object[0];
- protected abstract class ElementContentProviderJob extends Job {
+ protected abstract static class ElementContentProviderJob extends Job {
public ElementContentProviderJob(String name) {
super(name);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
index 7295f1678cd..9bf92265327 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
@@ -62,7 +62,7 @@ interface ILabelJob {
*/
class LabelJob extends Job implements ILabelJob {
- private LabelUpdater fUpdater = new LabelUpdater();
+ private final LabelUpdater fUpdater = new LabelUpdater();
public LabelJob() {
super("Label Job"); //$NON-NLS-1$
@@ -93,7 +93,7 @@ public boolean shouldRun() {
*/
class UILabelJob extends UIJob implements ILabelJob {
- private LabelUpdater fUpdater = new LabelUpdater();
+ private final LabelUpdater fUpdater = new LabelUpdater();
public UILabelJob() {
super("Label Job"); //$NON-NLS-1$
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
index f01e0922992..f81ee3c8835 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
@@ -78,7 +78,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
*/
class LaunchConfigurationMigrationSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
- private Object fInput;
+ private final Object fInput;
public LaunchConfigurationMigrationSelectionDialog(Shell parentShell, Object input) {
super(parentShell);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
index 2fc1bb843ab..41aae30b9ae 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
@@ -209,7 +209,7 @@ public void refreshPanel(IStructuredSelection selection) {
/**
* A default selection listener to be reused by all combo boxes presenting perspective data
*/
- private SelectionListener fSelectionListener = new SelectionListener() {
+ private final SelectionListener fSelectionListener = new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {}
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index 58e33dea193..dafd071b2f3 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -76,7 +76,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/**
* Set of configurations to be deleted
*/
- private Set fDeletedConfigurations = new HashSet<>();
+ private final Set fDeletedConfigurations = new HashSet<>();
/**
* Set of original default candidates for the resource
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index b6a8adaac85..edeccd016d2 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -472,7 +472,7 @@ private class SimpleVariableContentProvider implements IStructuredContentProvide
/**
* The content provider stores variable wrappers for use during editing.
*/
- private List fWorkingSet = new ArrayList<>();
+ private final List fWorkingSet = new ArrayList<>();
@Override
public Object[] getElements(Object inputElement) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
index b111152ed7c..4edf9f78c52 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
@@ -61,7 +61,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
// This flag indicates whether or not the user has pressed the reset button
private boolean fResetPressed= false;
private PerspectiveLabelProvider fLabelProvider= null;
- private SelectionListener fSelectionListener= new SelectionAdapter() {
+ private final SelectionListener fSelectionListener= new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/quickaccess/LaunchQuickAccessElement.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/quickaccess/LaunchQuickAccessElement.java
index 9b579447a4f..d072d86aae6 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/quickaccess/LaunchQuickAccessElement.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/quickaccess/LaunchQuickAccessElement.java
@@ -36,8 +36,8 @@ public class LaunchQuickAccessElement extends QuickAccessElement {
private static final String MODE_PROFILE = "profile"; //$NON-NLS-1$
private static final ImageRegistry REGISTRY = DebugPluginImages.getImageRegistry();
- private ILaunchConfiguration launch;
- private ILaunchMode launchMode;
+ private final ILaunchConfiguration launch;
+ private final ILaunchMode launchMode;
static {
registerImage(MODE_RUN);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
index 59c8333b0bb..6cd6adb9751 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
@@ -50,8 +50,8 @@
public class AddSourceContainerDialog extends TitleAreaDialog {
private TableViewer fViewer;
- private SourceContainerViewer fSourceContainerViewer;
- private ISourceLookupDirector fDirector;
+ private final SourceContainerViewer fSourceContainerViewer;
+ private final ISourceLookupDirector fDirector;
/**
* Constructor
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
index d1ea20c84b9..a5720983955 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
@@ -27,7 +27,7 @@
*/
public class BasicContainerContentProvider implements ITreeContentProvider {
- private boolean fShowClosedProjects = true;
+ private final boolean fShowClosedProjects = true;
/**
* Creates a new ResourceContentProvider.
*/
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
index 55d9c2b0333..8d705e813fc 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
@@ -45,7 +45,7 @@ public class SourceContainerViewer extends TreeViewer {
/**
* The parent panel
*/
- private SourceLookupPanel fPanel;
+ private final SourceLookupPanel fPanel;
/**
* The source container entries displayed in this viewer
*/
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
index 74e359d7327..96f03786bbe 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
@@ -123,7 +123,7 @@ protected boolean removeEldestEntry(Map.Entry eldest
* Contains a map of the editor to use for each workbench page, when the
* 'reuse editor' preference is on.
*/
- private Map fEditorsByPage;
+ private final Map fEditorsByPage;
/**
* Contains a mapping of artifacts to the source element that was computed
@@ -136,7 +136,7 @@ protected boolean removeEldestEntry(Map.Entry eldest
/**
* Used to generate annotations for stack frames
*/
- private IInstructionPointerPresentation fPresentation = (IInstructionPointerPresentation) DebugUITools.newDebugModelPresentation();
+ private final IInstructionPointerPresentation fPresentation = (IInstructionPointerPresentation) DebugUITools.newDebugModelPresentation();
/**
* Whether to re-use editors when displaying source.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
index 792d769bc96..45ff2136040 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
@@ -34,7 +34,7 @@ public class SourceLookupManager implements IWindowListener {
/**
* Services per window
*/
- private Map fServices = new HashMap<>();
+ private final Map fServices = new HashMap<>();
private SourceLookupManager() {
IWorkbench workbench = PlatformUI.getWorkbench();
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
index 222ddcb1d0f..109be4a87cd 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
@@ -42,7 +42,7 @@
public class SourceLookupService implements IDebugContextListener, ISourceDisplay {
private IWorkbenchWindow fWindow;
- private IDebugContextService fDebugContextService;
+ private final IDebugContextService fDebugContextService;
public SourceLookupService(IWorkbenchWindow window) {
fWindow = window;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
index 7a4940c9df5..5dc19ce9d0a 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
@@ -17,7 +17,6 @@
import java.io.StringReader;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.CoreException;
@@ -55,8 +54,9 @@ public ISourceContainer createSourceContainer(String memento)throws CoreExceptio
Exception ex = null;
try {
Element root = null;
- DocumentBuilder parser =
- DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ @SuppressWarnings("restriction")
+ DocumentBuilder parser = org.eclipse.core.internal.runtime.XmlProcessorFactory
+ .createDocumentBuilderWithErrorOnDOCTYPE();
parser.setErrorHandler(new DefaultHandler());
StringReader reader = new StringReader(memento);
InputSource source = new InputSource(reader);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
index 9a2787ac4e9..f9c173eca87 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
@@ -41,7 +41,7 @@ public class ArchiveFilter extends ViewerFilter {
/**
* Collection of already existing archives
*/
- private List fExisting;
+ private final List fExisting;
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
index 75d6421f608..9cd19de48d0 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
@@ -44,7 +44,7 @@
*/
public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowser {
- private ISelectionStatusValidator validator= selection -> {
+ private final ISelectionStatusValidator validator= selection -> {
if (selection.length == 0) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
}
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
index 31b5363b2b1..57debf5dbb7 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
@@ -18,7 +18,7 @@
import org.eclipse.core.variables.IDynamicVariableResolver;
public class SelectedTextResolver implements IDynamicVariableResolver {
- private SelectedResourceManager selectedResourceManager;
+ private final SelectedResourceManager selectedResourceManager;
public SelectedTextResolver() {
selectedResourceManager = SelectedResourceManager.getDefault();
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
index e09b9bfc716..a089c16835d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
@@ -48,7 +48,7 @@
public abstract class AsynchronousModel {
private ModelNode fRoot; // root node
- private Map fElementToNodes = new HashMap<>(); // map
+ private final Map fElementToNodes = new HashMap<>(); // map
// of
// element
// to
@@ -56,14 +56,14 @@ public abstract class AsynchronousModel {
// tree
// nodes
// (list)
- private Map fModelProxies = new HashMap<>(); // map
+ private final Map fModelProxies = new HashMap<>(); // map
// of
// installed
// model
// proxies,
// by
// element
- private AsynchronousViewer fViewer; // viewer this model works for
+ private final AsynchronousViewer fViewer; // viewer this model works for
private boolean fDisposed = false; // whether disposed
static class EmptyContentAdapter extends AsynchronousContentAdapter {
@@ -89,12 +89,12 @@ protected boolean supportsPartId(String id) {
/**
* List of requests currently being performed.
*/
- private List fPendingUpdates = new ArrayList<>();
+ private final List fPendingUpdates = new ArrayList<>();
/**
* List of pending viewer updates
*/
- private List fViewerUpdates = new ArrayList<>();
+ private final List fViewerUpdates = new ArrayList<>();
/**
* Constructs a new empty tree model
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
index f18dc2e7c8f..89642d93dec 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
@@ -33,12 +33,12 @@ public abstract class AsynchronousRequestMonitor extends AbstractRequestMonitor
/**
* Model node the update is rooted at
*/
- private ModelNode fNode;
+ private final ModelNode fNode;
/**
* Model the update is being performed for
*/
- private AsynchronousModel fModel;
+ private final AsynchronousModel fModel;
/**
* Whether this request's 'done' method has been called.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
index 81c439a0243..d8dd8142287 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
@@ -55,11 +55,11 @@
*/
public class AsynchronousTableViewer extends AsynchronousViewer implements Listener {
- private Table fTable;
+ private final Table fTable;
- private TableEditor fTableEditor;
+ private final TableEditor fTableEditor;
- private TableEditorImpl fTableEditorImpl;
+ private final TableEditorImpl fTableEditorImpl;
public AsynchronousTableViewer(Composite parent) {
this(parent, SWT.VIRTUAL);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
index b287456c9e5..b96eb68c737 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
@@ -85,21 +85,21 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
* use the method getImage(...) to cache images for
* image descriptors. The images are disposed when this viewer is disposed.
*/
- private Map fImageCache = new HashMap<>();
+ private final Map fImageCache = new HashMap<>();
/**
* Cache of the fonts used for elements in this tree viewer. Label updates
* use the method getFont(...) to cache fonts for
* FontData objects. The fonts are disposed with the viewer.
*/
- private Map fFontCache = new HashMap<>();
+ private final Map fFontCache = new HashMap<>();
/**
* Cache of the colors used for elements in this tree viewer. Label updates
* use the method getColor(...) to cache colors for
* RGB values. The colors are disposed with the viewer.
*/
- private Map fColorCache = new HashMap<>();
+ private final Map fColorCache = new HashMap<>();
/**
* The context in which this viewer is being used - i.e. what part it is contained
@@ -414,6 +414,11 @@ protected Widget doFindInputItem(Object element) {
protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
}
+ @Override
+ public void refresh() {
+ refresh(getRoot());
+ }
+
@Override
protected void internalRefresh(Object element) {
// get the nodes in the model
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
index a28ac491bff..22107454819 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
@@ -35,7 +35,7 @@ class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChil
/**
* Collection of children retrieved
*/
- private List fChildren = new ArrayList<>();
+ private final List fChildren = new ArrayList<>();
/**
* Constucts a monitor to retrieve and update the children of the given
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
index 348e9b7e669..c9c2ad2ff7a 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
@@ -27,7 +27,7 @@ public class ModelNode {
private Object fElement; // model element
private boolean fIsContainer; // whether this element may have children
- private ModelNode fParent; // parent node or null for root
+ private final ModelNode fParent; // parent node or null for root
private ModelNode[] fChildren; // child nodes, possibly null
private boolean fDisposed; // whether this node has been disposed
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
index 6261043709c..af7e69d3ffb 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
@@ -47,7 +47,7 @@ public abstract class TableEditorImpl {
private FocusListener fFocusListener;
private MouseListener fMouseListener;
private int fDoubleClickExpirationTime;
- private StructuredViewer fViewer;
+ private final StructuredViewer fViewer;
TableEditorImpl(StructuredViewer viewer) {
fViewer = viewer;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
index 3d560e2ca65..37ddb7dba2d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
@@ -20,7 +20,7 @@
*/
public class TableInsertRequestMonitor extends TableAddRequestMonitor {
- private int fIndex;
+ private final int fIndex;
/**
* @param node
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
index f33c8d5b13b..ba5f22c06e3 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
@@ -20,8 +20,8 @@
*/
public class TableReplaceRequestMonitor extends AsynchronousRequestMonitor {
- private Object fOriginal;
- private Object fReplacement;
+ private final Object fOriginal;
+ private final Object fReplacement;
/**
* @param node
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
index 77e161f1150..54c960517a5 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
@@ -43,10 +43,10 @@ class BreadcrumbItem extends Item {
private TreePath fPath;
private final BreadcrumbViewer fParent;
- private Composite fContainer;
+ private final Composite fContainer;
- private BreadcrumbItemDropDown fExpandBlock;
- private BreadcrumbItemDetails fDetailsBlock;
+ private final BreadcrumbItemDropDown fExpandBlock;
+ private final BreadcrumbItemDetails fDetailsBlock;
private boolean fIsLast;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
index 76f30f905c1..381ab87d98d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
@@ -27,7 +27,7 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
private boolean fEqual;
private final int fModelIndex;
- private ModelDelta fDelta;
+ private final ModelDelta fDelta;
private boolean fKnowsHasChildren;
private boolean fKnowsChildCount;
private boolean fCheckChildrenRealized;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
index d3887179a11..b0e26279675 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
@@ -28,8 +28,8 @@
*/
class ElementMementoRequest extends MementoUpdate implements IElementMementoRequest {
- private IElementMementoCollector fManager;
- private ModelDelta fDelta;
+ private final IElementMementoCollector fManager;
+ private final ModelDelta fDelta;
/**
* @param provider the content provider to use for the update
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index f11f18c966b..1dedff58d23 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -109,13 +109,13 @@ public class InternalVirtualTreeModelViewer extends Viewer
* The display that this virtual tree viewer is associated with. It is used
* for access to the UI thread.
*/
- private Display fDisplay;
+ private final Display fDisplay;
/**
* The object that allows the model to identify what this view
* is presenting.
*/
- private IPresentationContext fContext;
+ private final IPresentationContext fContext;
/**
* Input into the viewer.
@@ -125,14 +125,14 @@ public class InternalVirtualTreeModelViewer extends Viewer
/**
* The tree of items in this viewer.
*/
- private VirtualTree fTree;
+ private final VirtualTree fTree;
/**
* Mapping of data elements in the tree to the items that hold them. The
* tree may contain the same element in several places, so the map values
* are lists.
*/
- private Map> fItemsMap = new HashMap<>();
+ private final Map> fItemsMap = new HashMap<>();
/**
* Whether to notify the content provider when an element is unmapped.
@@ -177,14 +177,14 @@ public class InternalVirtualTreeModelViewer extends Viewer
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
- private Map fVisibleColumns = new HashMap<>();
+ private final Map fVisibleColumns = new HashMap<>();
/**
* Map of column presentation id to whether columns should be displayed
* for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
- private Map fShowColumns = new HashMap<>();
+ private final Map fShowColumns = new HashMap<>();
/**
* Runnable for validating the virtual tree. It is scheduled to run in the
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
index 984ca2e6ed7..0f0291b304f 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
@@ -30,17 +30,17 @@
*/
class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
- private TreePath fElementPath;
- private String[] fColumnIds;
+ private final TreePath fElementPath;
+ private final String[] fColumnIds;
private RGB[] fBackgrounds;
private RGB[] fForegrounds;
private ImageDescriptor[] fImageDescriptors;
- private String[] fLabels;
+ private final String[] fLabels;
private FontData[] fFontDatas;
- private TreeModelLabelProvider fProvider;
+ private final TreeModelLabelProvider fProvider;
private int fNumColumns;
- private IPresentationContext fContext;
- private Object fViewerInput;
+ private final IPresentationContext fContext;
+ private final Object fViewerInput;
private boolean fChecked;
private boolean fGrayed;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
index 0e718ba2e6c..3bcc746c5d7 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
@@ -24,10 +24,10 @@
*/
abstract class MementoUpdate extends Request implements IViewerUpdate {
- private IPresentationContext fContext;
- private Object fElement;
- private TreePath fElementPath;
- private IMemento fMemento;
+ private final IPresentationContext fContext;
+ private final Object fElement;
+ private final TreePath fElementPath;
+ private final IMemento fMemento;
protected TreeModelContentProvider fProvider;
protected Object fViewerInput;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
index 00a70d4984b..30186c297ff 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
@@ -452,7 +452,7 @@ public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
*/
private class SubTreeModelContentProvider implements ITreeModelContentProvider {
- private TreeModelContentProvider fBaseProvider;
+ private final TreeModelContentProvider fBaseProvider;
public SubTreeModelContentProvider() {
fBaseProvider = new TreeModelContentProvider();
@@ -606,7 +606,7 @@ private class SubTreeModelLabelProvider extends ColumnLabelProvider
implements ITreeModelLabelProvider
{
- private TreeModelLabelProvider fBaseProvider;
+ private final TreeModelLabelProvider fBaseProvider;
public SubTreeModelLabelProvider(IInternalTreeModelViewer viewer) {
fBaseProvider = new TreeModelLabelProvider(viewer);
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
index 38b2c29032d..75a9fcdb052 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
@@ -35,7 +35,7 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
/**
* The time considered to be the long operation time.
*/
- private int longOperationTime;
+ private final int longOperationTime;
/**
* The time at which the dialog should be opened.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index c00ae9ffe8f..075bad86e78 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -83,7 +83,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* Used to install different model proxy instances for one element depending
* on the tree path.
*/
- private Map fTreeModelProxies = new HashMap<>(); // tree
+ private final Map fTreeModelProxies = new HashMap<>(); // tree
// model
// proxy
// by
@@ -95,7 +95,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* Used to install a single model proxy which is responsible for all
* instances of an element in the model tree.
*/
- private Map fModelProxies = new HashMap<>(); // model
+ private final Map fModelProxies = new HashMap<>(); // model
// proxy
// by
// element
@@ -103,17 +103,17 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Map of nodes that have been filtered from the viewer.
*/
- private FilterTransform fTransform = new FilterTransform();
+ private final FilterTransform fTransform = new FilterTransform();
/**
* Model listeners
*/
- private ListenerList fModelListeners = new ListenerList<>();
+ private final ListenerList fModelListeners = new ListenerList<>();
/**
* Viewer update listeners
*/
- private ListenerList fUpdateListeners = new ListenerList<>();
+ private final ListenerList fUpdateListeners = new ListenerList<>();
/**
* Flag indicating whether we are currently in a model sequence.
@@ -124,19 +124,19 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Map of updates in progress: element path -> list of requests
*/
- private Map> fRequestsInProgress = new HashMap<>();
+ private final Map> fRequestsInProgress = new HashMap<>();
/**
* Map of dependent requests waiting for parent requests to complete:
* element path -> list of requests
*/
- private Map> fWaitingRequests = new HashMap<>();
+ private final Map> fWaitingRequests = new HashMap<>();
private List fCompletedUpdates = new ArrayList<>();
private Runnable fCompletedUpdatesRunnable;
- private ViewerStateTracker fStateTracker = new ViewerStateTracker(this);
+ private final ViewerStateTracker fStateTracker = new ViewerStateTracker(this);
private TreePath fRevealPath;
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
index bbde049f897..c7803a94647 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
@@ -64,32 +64,32 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* use the method getImage(...) to cache images for
* image descriptors. The images are disposed with this label provider.
*/
- private Map fImageCache = new HashMap<>();
+ private final Map fImageCache = new HashMap<>();
/**
* Cache of the fonts used for elements in this label provider. Label updates
* use the method getFont(...) to cache fonts for
* FontData objects. The fonts are disposed with this label provider.
*/
- private Map fFontCache = new HashMap<>();
+ private final Map fFontCache = new HashMap<>();
/**
* Cache of the colors used for elements in this label provider. Label updates
* use the method getColor(...) to cache colors for
* RGB values. The colors are disposed with this label provider.
*/
- private Map fColorCache = new HashMap<>();
+ private final Map fColorCache = new HashMap<>();
/**
* Label listeners
*/
- private ListenerList fLabelListeners = new ListenerList<>();
+ private final ListenerList fLabelListeners = new ListenerList<>();
/**
* Updates waiting to be sent to the label provider. The map contains
* lists of updates, keyed using the provider.
*/
- private Map> fPendingUpdates = new HashMap<>();
+ private final Map> fPendingUpdates = new HashMap<>();
/**
* A runnable that will send the label update requests.
@@ -101,7 +101,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* List of updates in progress
*/
- private List fUpdatesInProgress = new ArrayList<>();
+ private final List fUpdatesInProgress = new ArrayList<>();
/**
* Delta visitor actively cancels the outstanding label updates for
@@ -124,7 +124,7 @@ public boolean visit(IModelDelta delta, int depth) {
/**
* Delta visitor
*/
- private CancelPendingUpdatesVisitor fCancelPendingUpdatesVisitor = new CancelPendingUpdatesVisitor();
+ private final CancelPendingUpdatesVisitor fCancelPendingUpdatesVisitor = new CancelPendingUpdatesVisitor();
/**
* Constructs a new label provider on the given display
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
index 60336ac9761..92a522394b1 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
@@ -36,12 +36,12 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/**
* Presentation context
*/
- private IPresentationContext fContext;
+ private final IPresentationContext fContext;
/**
* New viewer input
*/
- private Object fSource;
+ private final Object fSource;
/**
* Whether this update is done
@@ -56,12 +56,12 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/**
* Viewer input at the time the request was made
*/
- private Object fViewerInput;
+ private final Object fViewerInput;
/**
* Client making request
*/
- private IViewerInputRequestor fRequestor;
+ private final IViewerInputRequestor fRequestor;
/**
* When done() is called, the viewer must be informed that the update is complete in the UI thread.
diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
index d7d8c5fc9ad..11a42b8a24d 100644
--- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
+++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
@@ -120,7 +120,7 @@ interface IElementMementoCollector {
class LRUMap extends LinkedHashMap {
private static final long serialVersionUID = 1L;
- private int fMaxSize;
+ private final int fMaxSize;
LRUMap(int maxSize) {
super();
@@ -136,7 +136,7 @@ protected boolean removeEldestEntry(Entry eldest) {
/**
* Content provider that is using this state tracker.
*/
- private TreeModelContentProvider fContentProvider;
+ private final TreeModelContentProvider fContentProvider;
ViewerStateTracker(TreeModelContentProvider contentProvider) {
fContentProvider = contentProvider;
@@ -145,7 +145,7 @@ protected boolean removeEldestEntry(Entry eldest) {
/**
* Map of viewer states keyed by viewer input mementos
*/
- private Map