core: Warning fixes.
* Remove useless SuppressWarnings.
* Generification.
* Use varargs MessageFormat.format method.
* Remove unused imports.
Change-Id: I24608bcc82a313ee239d7ddbaf7967962a9e3aa0
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
index 1e40261..73150cf 100644
--- a/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
+++ b/core/plugins/org.eclipse.dltk.core.manipulation/src/org/eclipse/dltk/internal/corext/refactoring/RefactoringScopeFactory.java
@@ -17,7 +17,6 @@
import java.util.Set;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.dltk.core.DLTKCore;
diff --git a/core/plugins/org.eclipse.dltk.core/environment/org/eclipse/dltk/core/internal/environment/LazyEnvironment.java b/core/plugins/org.eclipse.dltk.core/environment/org/eclipse/dltk/core/internal/environment/LazyEnvironment.java
index cec2f13..0e90100 100644
--- a/core/plugins/org.eclipse.dltk.core/environment/org/eclipse/dltk/core/internal/environment/LazyEnvironment.java
+++ b/core/plugins/org.eclipse.dltk.core/environment/org/eclipse/dltk/core/internal/environment/LazyEnvironment.java
@@ -121,7 +121,7 @@
return environment != null ? environment.isLocal() : false;
}
- public Object getAdapter(@SuppressWarnings("unchecked") Class adapter) {
+ public Object getAdapter(Class adapter) {
initialize();
return environment != null ? environment.getAdapter(adapter) : null;
}
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ResourceChangeToNonScriptDelta.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ResourceChangeToNonScriptDelta.java
index bfe1c38..bb27f4f 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ResourceChangeToNonScriptDelta.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ResourceChangeToNonScriptDelta.java
@@ -98,7 +98,6 @@
return resource;
}
- @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}
diff --git a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/DebugConsoleManager.java b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/DebugConsoleManager.java
index 6b649eb..1e373c0 100644
--- a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/DebugConsoleManager.java
+++ b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/DebugConsoleManager.java
@@ -298,8 +298,8 @@
}
DLTKDebugUIPlugin.logErrorMessage(MessageFormat.format(
"Extension {0} must specify an instanceof IConsoleColorProvider for class attribute.", //$NON-NLS-1$
- new String[] { extension.getDeclaringExtension()
- .getUniqueIdentifier() }));
+ extension.getDeclaringExtension()
+ .getUniqueIdentifier()));
} catch (CoreException e) {
DLTKDebugUIPlugin.log(e);
}
diff --git a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/display/ScriptDisplayView.java b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/display/ScriptDisplayView.java
index 2475818..262a412 100644
--- a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/display/ScriptDisplayView.java
+++ b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/debug/ui/display/ScriptDisplayView.java
@@ -633,7 +633,6 @@
/**
* Initialize the PageSwitcher.
*/
- @SuppressWarnings("unused")
private void initPageSwitcher() {
new PageSwitcher(this) {
public void activatePage(Object page) {
diff --git a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/internal/debug/ui/console/ScriptDebugConsolePageParticipant.java b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/internal/debug/ui/console/ScriptDebugConsolePageParticipant.java
index 445dfdc..fb1566c 100644
--- a/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/internal/debug/ui/console/ScriptDebugConsolePageParticipant.java
+++ b/core/plugins/org.eclipse.dltk.debug.ui/src/org/eclipse/dltk/internal/debug/ui/console/ScriptDebugConsolePageParticipant.java
@@ -51,8 +51,8 @@
/**
* Creates and manages process console specific actions
*/
-public class ScriptDebugConsolePageParticipant implements
- IConsolePageParticipant, IShowInSource, IShowInTargetList,
+public class ScriptDebugConsolePageParticipant
+ implements IConsolePageParticipant, IShowInSource, IShowInTargetList,
IDebugEventSetListener, IDebugContextListener {
// actions
@@ -69,7 +69,7 @@
private IConsoleView fView;
private EOFHandler fEOFHandler;
- private String fContextId = "org.eclipse.debug.ui.console"; //$NON-NLS-1$;
+ private String fContextId = "org.eclipse.debug.ui.console"; //$NON-NLS-1$ ;
private IContextActivation fActivatedContext;
private IHandlerActivation fActivatedHandler;
@@ -105,18 +105,18 @@
fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getLaunch());
fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction();
- fTerminate = new ConsoleTerminateAction(page.getSite()
- .getWorkbenchWindow(), fConsole);
+ fTerminate = new ConsoleTerminateAction(
+ page.getSite().getWorkbenchWindow(), fConsole);
// fStdOut = new ShowStandardOutAction();
// fStdErr = new ShowStandardErrorAction();
- fView = (IConsoleView) fPage.getSite().getPage().findView(
- IConsoleConstants.ID_CONSOLE_VIEW);
+ fView = (IConsoleView) fPage.getSite().getPage()
+ .findView(IConsoleConstants.ID_CONSOLE_VIEW);
DebugPlugin.getDefault().addDebugEventListener(this);
- DebugUITools.getDebugContextManager().getContextService(
- fPage.getSite().getWorkbenchWindow()).addDebugContextListener(
- this);
+ DebugUITools.getDebugContextManager()
+ .getContextService(fPage.getSite().getWorkbenchWindow())
+ .addDebugContextListener(this);
// contribute to toolbar
IActionBars actionBars = fPage.getSite().getActionBars();
@@ -132,8 +132,8 @@
* @see org.eclipse.ui.console.IConsolePageParticipant#dispose()
*/
public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(
- fPage.getSite().getWorkbenchWindow())
+ DebugUITools.getDebugContextManager()
+ .getContextService(fPage.getSite().getWorkbenchWindow())
.removeDebugContextListener(this);
DebugPlugin.getDefault().removeDebugEventListener(this);
if (fRemoveTerminated != null) {
@@ -173,7 +173,7 @@
/*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public Object getAdapter(@SuppressWarnings("unchecked") Class required) {
+ public Object getAdapter(Class required) {
if (IShowInSource.class.equals(required)) {
return this;
}
@@ -205,13 +205,13 @@
.getAdapter(IDebugTarget.class);
ISelection selection = null;
if (target == null) {
- selection = new TreeSelection(new TreePath(new Object[] {
- DebugPlugin.getDefault().getLaunchManager(),
- process.getLaunch(), process }));
+ selection = new TreeSelection(new TreePath(
+ new Object[] { DebugPlugin.getDefault().getLaunchManager(),
+ process.getLaunch(), process }));
} else {
- selection = new TreeSelection(new TreePath(new Object[] {
- DebugPlugin.getDefault().getLaunchManager(),
- target.getLaunch(), target }));
+ selection = new TreeSelection(new TreePath(
+ new Object[] { DebugPlugin.getDefault().getLaunchManager(),
+ target.getLaunch(), target }));
}
return new ShowInContext(null, selection);
}
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DLTKLaunchingPlugin.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DLTKLaunchingPlugin.java
index b73d5e8..35e180a 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DLTKLaunchingPlugin.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DLTKLaunchingPlugin.java
@@ -62,8 +62,9 @@
import com.ibm.icu.text.MessageFormat;
-public class DLTKLaunchingPlugin extends Plugin implements
- Preferences.IPropertyChangeListener, IInterpreterInstallChangedListener {
+public class DLTKLaunchingPlugin extends Plugin
+ implements Preferences.IPropertyChangeListener,
+ IInterpreterInstallChangedListener {
public static final String PLUGIN_ID = "org.eclipse.dltk.launching"; //$NON-NLS-1$
@@ -73,9 +74,8 @@
+ ".LAUNCH_COMMAND_LINE"; //$NON-NLS-1$
public static final boolean TRACE_EXECUTION = Boolean
- .valueOf(
- Platform
- .getDebugOption("org.eclipse.dltk.launching/traceExecution")) //$NON-NLS-1$
+ .valueOf(Platform.getDebugOption(
+ "org.eclipse.dltk.launching/traceExecution")) //$NON-NLS-1$
.booleanValue();
/**
@@ -87,7 +87,7 @@
/**
* Runtime buildpath extensions
*/
- private HashMap fBuildpathEntryExtensions = null;
+ private HashMap<String, IConfigurationElement> fBuildpathEntryExtensions = null;
private String fOldInterpreterPrefString = EMPTY_STRING;
@@ -135,8 +135,8 @@
}
public static void logWarning(Throwable t) {
- log(new Status(IStatus.WARNING, getUniqueIdentifier(), IStatus.ERROR, t
- .getMessage(), t));
+ log(new Status(IStatus.WARNING, getUniqueIdentifier(), IStatus.ERROR,
+ t.getMessage(), t));
}
public static void logWarning(String message, Throwable t) {
@@ -145,8 +145,8 @@
}
public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e
- .getMessage(), e));
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR,
+ e.getMessage(), e));
}
public static void log(String message, Throwable e) {
@@ -176,8 +176,8 @@
* document to serialize
* @return the document as a string
*/
- public static String serializeDocument(Document doc) throws IOException,
- TransformerException {
+ public static String serializeDocument(Document doc)
+ throws IOException, TransformerException {
ByteArrayOutputStream s = new ByteArrayOutputStream();
TransformerFactory factory = TransformerFactory.newInstance();
@@ -189,7 +189,7 @@
StreamResult outputTarget = new StreamResult(s);
transformer.transform(source, outputTarget);
- return s.toString("UTF8"); //$NON-NLS-1$
+ return s.toString("UTF8"); //$NON-NLS-1$
}
/**
@@ -226,8 +226,9 @@
*/
protected static void abort(String message, Throwable exception)
throws CoreException {
- IStatus status = new Status(IStatus.ERROR, DLTKLaunchingPlugin
- .getUniqueIdentifier(), 0, message, exception);
+ IStatus status = new Status(IStatus.ERROR,
+ DLTKLaunchingPlugin.getUniqueIdentifier(), 0, message,
+ exception);
throw new CoreException(status);
}
@@ -249,7 +250,7 @@
.get(id);
if (config == null) {
abort(MessageFormat.format(LaunchingMessages.LaunchingPlugin_32,
- new String[] { id }), null);
+ id), null);
}
return (IRuntimeBuildpathEntry2) config
.createExecutableExtension("class"); //$NON-NLS-1$
@@ -264,10 +265,11 @@
ID_EXTENSION_POINT_RUNTIME_BUILDPATH_ENTRIES);
IConfigurationElement[] configs = extensionPoint
.getConfigurationElements();
- fBuildpathEntryExtensions = new HashMap(configs.length);
+ fBuildpathEntryExtensions = new HashMap<String, IConfigurationElement>(
+ configs.length);
for (int i = 0; i < configs.length; i++) {
- fBuildpathEntryExtensions.put(
- configs[i].getAttribute("id"), configs[i]); //$NON-NLS-1$
+ fBuildpathEntryExtensions.put(configs[i].getAttribute("id"), //$NON-NLS-1$
+ configs[i]);
}
}
@@ -279,10 +281,11 @@
// Exclude launch configurations from being copied to the output
// directory
- String launchFilter = "*." + ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION; //$NON-NLS-1$
- Hashtable optionsMap = DLTKCore.getOptions();
- String filters = (String) optionsMap
- .get("org.eclipse.dltk.core.builder.resourceCopyExclusionFilter"); //$NON-NLS-1$
+ String launchFilter = "*." //$NON-NLS-1$
+ + ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION;
+ Hashtable<String, String> optionsMap = DLTKCore.getOptions();
+ String filters = (String) optionsMap.get(
+ "org.eclipse.dltk.core.builder.resourceCopyExclusionFilter"); //$NON-NLS-1$
boolean modified = false;
if (filters == null || filters.length() == 0) {
filters = launchFilter;
@@ -293,9 +296,9 @@
}
if (modified) {
- optionsMap
- .put(
- "org.eclipse.dltk.core.builder.resourceCopyExclusionFilter", filters); //$NON-NLS-1$
+ optionsMap.put(
+ "org.eclipse.dltk.core.builder.resourceCopyExclusionFilter", //$NON-NLS-1$
+ filters);
DLTKCore.setOptions(optionsMap);
}
@@ -411,10 +414,12 @@
.addInterpreterInstallChangedListener(InterpreterChanges);
// Generate the previous Interpreters
- InterpreterDefinitionsContainer oldResults = getInterpreterDefinitions(oldPrefString);
+ InterpreterDefinitionsContainer oldResults = getInterpreterDefinitions(
+ oldPrefString);
// Generate the current
- InterpreterDefinitionsContainer newResults = getInterpreterDefinitions(newPrefString);
+ InterpreterDefinitionsContainer newResults = getInterpreterDefinitions(
+ newPrefString);
// Determine the deteled Interpreters
List deleted = oldResults.getInterpreterList();
@@ -466,8 +471,8 @@
// stop batch changes
fBatchingChanges = false;
if (InterpreterChanges != null) {
- ScriptRuntime
- .removeInterpreterInstallChangedListener(InterpreterChanges);
+ ScriptRuntime.removeInterpreterInstallChangedListener(
+ InterpreterChanges);
try {
InterpreterChanges.process();
} catch (CoreException e) {
@@ -485,7 +490,8 @@
* @param xml
* @return InterpreterDefinitionsContainer
*/
- private InterpreterDefinitionsContainer getInterpreterDefinitions(String xml) {
+ private InterpreterDefinitionsContainer getInterpreterDefinitions(
+ String xml) {
if (xml.length() > 0) {
try {
Reader stream = new StringReader(xml);
@@ -580,8 +586,8 @@
} else {
// replace old bp entry with a new one
IBuildpathEntry newEntry = DLTKCore
- .newContainerEntry(newBinding, entry
- .isExported());
+ .newContainerEntry(newBinding,
+ entry.isExported());
entries[j] = newEntry;
replace = true;
}
@@ -606,7 +612,7 @@
class InterpreterChanges implements IInterpreterInstallChangedListener {
// old container ids to new
- private HashMap fRenamedContainerIds = new HashMap();
+ private HashMap<IPath, IPath> fRenamedContainerIds = new HashMap<IPath, IPath>();
public void defaultInterpreterInstallChanged(
IInterpreterInstall previous, IInterpreterInstall current) {
@@ -628,8 +634,8 @@
String oldName = (String) event.getOldValue();
String oldTypeId = Interpreter.getInterpreterInstallType()
.getId();
- IPath oldId = ScriptRuntime.newInterpreterContainerPath(
- oldTypeId, oldName);
+ IPath oldId = ScriptRuntime
+ .newInterpreterContainerPath(oldTypeId, oldName);
if (oldId != null) {
fRenamedContainerIds.put(oldId, newId);
}
@@ -650,9 +656,10 @@
protected void doit(IProgressMonitor monitor) throws CoreException {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor1) throws CoreException {
- IScriptProject[] projects = DLTKCore.create(
- ResourcesPlugin.getWorkspace().getRoot())
+ public void run(IProgressMonitor monitor1)
+ throws CoreException {
+ IScriptProject[] projects = DLTKCore
+ .create(ResourcesPlugin.getWorkspace().getRoot())
.getScriptProjects();
monitor1.beginTask(LaunchingMessages.LaunchingPlugin_0,
projects.length + 1);
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DebugRunnerDelegate.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DebugRunnerDelegate.java
index d245731..7bb8748 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DebugRunnerDelegate.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DebugRunnerDelegate.java
@@ -53,18 +53,13 @@
if (runner != null) {
runner.run(config, launch, monitor);
} else {
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- DLTKLaunchingPlugin.PLUGIN_ID,
- ScriptLaunchConfigurationConstants.ERR_INTERPRETER_RUNNER_DOES_NOT_EXIST,
- MessageFormat
- .format(
- LaunchingMessages.InterpreterRunnerDoesntExist,
- new String[] {
- install.getName(),
- ILaunchManager.DEBUG_MODE }),
- null));
+ throw new CoreException(new Status(IStatus.ERROR,
+ DLTKLaunchingPlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERPRETER_RUNNER_DOES_NOT_EXIST,
+ MessageFormat.format(
+ LaunchingMessages.InterpreterRunnerDoesntExist,
+ install.getName(), ILaunchManager.DEBUG_MODE),
+ null));
}
}
}
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DefaultProjectBuildpathEntry.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DefaultProjectBuildpathEntry.java
index 60c92f5..f6c9c35 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DefaultProjectBuildpathEntry.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/DefaultProjectBuildpathEntry.java
@@ -36,7 +36,8 @@
/**
* Default user buildpath entries for a script project
*/
-public class DefaultProjectBuildpathEntry extends AbstractRuntimeBuildpathEntry {
+public class DefaultProjectBuildpathEntry
+ extends AbstractRuntimeBuildpathEntry {
public static final String TYPE_ID = "org.eclipse.dltk.launching.buildpathentry.defaultBuildpath"; //$NON-NLS-1$
@@ -65,8 +66,8 @@
protected void buildMemento(Document document, Element memento)
throws CoreException {
memento.setAttribute("project", getScriptProject().getElementName()); //$NON-NLS-1$
- memento.setAttribute(
- "exportedEntriesOnly", Boolean.toString(fExportedEntriesOnly)); //$NON-NLS-1$
+ memento.setAttribute("exportedEntriesOnly", //$NON-NLS-1$
+ Boolean.toString(fExportedEntriesOnly));
}
public void initializeFrom(Element memento) throws CoreException {
@@ -74,8 +75,8 @@
if (name == null) {
abort(LaunchingMessages.DefaultProjectBuildpathEntry_3, null);
}
- IScriptProject project = DLTKCore.create(ResourcesPlugin.getWorkspace()
- .getRoot().getProject(name));
+ IScriptProject project = DLTKCore.create(
+ ResourcesPlugin.getWorkspace().getRoot().getProject(name));
setScriptProject(project);
name = memento.getAttribute("exportedEntriesOnly"); //$NON-NLS-1$
if (name == null) {
@@ -115,8 +116,8 @@
public IRuntimeBuildpathEntry[] getRuntimeBuildpathEntries(
ILaunchConfiguration configuration) throws CoreException {
- IBuildpathEntry entry = DLTKCore.newProjectEntry(getScriptProject()
- .getProject().getFullPath());
+ IBuildpathEntry entry = DLTKCore
+ .newProjectEntry(getScriptProject().getProject().getFullPath());
List buildpathEntries = new ArrayList(5);
List expanding = new ArrayList(5);
expandProject(entry, buildpathEntries, expanding);
@@ -134,7 +135,8 @@
// remove bootpath entries - this is a default user buildpath
List ordered = new ArrayList(runtimeEntries.length);
for (int i = 0; i < runtimeEntries.length; i++) {
- if (runtimeEntries[i].getBuildpathProperty() == IRuntimeBuildpathEntry.USER_ENTRY) {
+ if (runtimeEntries[i]
+ .getBuildpathProperty() == IRuntimeBuildpathEntry.USER_ENTRY) {
ordered.add(runtimeEntries[i]);
}
}
@@ -163,8 +165,8 @@
// 1. Get the raw buildpath
// 2. Replace source folder entries with a project entry
IPath projectPath = projectEntry.getPath();
- IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(
- projectPath.lastSegment());
+ IResource res = ResourcesPlugin.getWorkspace().getRoot()
+ .findMember(projectPath.lastSegment());
if (res == null) {
// add project entry and return
expandedPath.add(projectEntry);
@@ -232,28 +234,28 @@
break;
}
IRuntimeBuildpathEntry r = ScriptRuntime
- .newRuntimeContainerBuildpathEntry(entry
- .getPath(), property, project);
+ .newRuntimeContainerBuildpathEntry(
+ entry.getPath(), property, project);
// check for duplicate/redundant entries
boolean duplicate = false;
BuildpathContainerInitializer initializer = DLTKCore
- .getBuildpathContainerInitializer(r.getPath()
- .segment(0));
+ .getBuildpathContainerInitializer(
+ r.getPath().segment(0));
for (int i = 0; i < expandedPath.size(); i++) {
Object o = expandedPath.get(i);
if (o instanceof IRuntimeBuildpathEntry) {
IRuntimeBuildpathEntry re = (IRuntimeBuildpathEntry) o;
if (re.getType() == IRuntimeBuildpathEntry.CONTAINER) {
BuildpathContainerInitializer initializer2 = DLTKCore
- .getBuildpathContainerInitializer(re
- .getPath().segment(0));
+ .getBuildpathContainerInitializer(
+ re.getPath().segment(0));
Object id1 = null;
Object id2 = null;
if (initializer == null) {
id1 = r.getPath().segment(0);
} else {
- id1 = initializer.getComparisonID(r
- .getPath(), project);
+ id1 = initializer.getComparisonID(
+ r.getPath(), project);
}
if (initializer2 == null) {
id2 = re.getPath().segment(0);
@@ -263,8 +265,8 @@
if (context == null) {
context = project;
}
- id2 = initializer2.getComparisonID(re
- .getPath(), context);
+ id2 = initializer2.getComparisonID(
+ re.getPath(), context);
}
if (id1 == null) {
duplicate = id2 == null;
@@ -301,11 +303,11 @@
if (isExportedEntriesOnly()) {
return MessageFormat.format(
LaunchingMessages.DefaultProjectBuildpathEntry_2,
- new String[] { getScriptProject().getElementName() });
+ getScriptProject().getElementName());
}
return MessageFormat.format(
LaunchingMessages.DefaultProjectBuildpathEntry_4,
- new String[] { getScriptProject().getElementName() });
+ getScriptProject().getElementName());
}
/*
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/InterpreterContainerInitializer.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/InterpreterContainerInitializer.java
index 4c436f5..2331664 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/InterpreterContainerInitializer.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/InterpreterContainerInitializer.java
@@ -37,8 +37,8 @@
/**
* Resolves a container for a InterpreterEnvironment buildpath container entry.
*/
-public class InterpreterContainerInitializer extends
- BuildpathContainerInitializer {
+public class InterpreterContainerInitializer
+ extends BuildpathContainerInitializer {
/**
* @see BuildpathContainerInitializer#initialize(IPath, IScriptProject)
@@ -48,8 +48,8 @@
throws CoreException {
int size = containerPath.segmentCount();
if (size > 0) {
- if (containerPath.segment(0).equals(
- ScriptRuntime.INTERPRETER_CONTAINER)) {
+ if (containerPath.segment(0)
+ .equals(ScriptRuntime.INTERPRETER_CONTAINER)) {
IInterpreterInstall interp = resolveInterpreter(
getNatureFromProject(project),
@@ -85,9 +85,8 @@
return installType.findInterpreterInstallByName(name);
}
}
- return ScriptRuntime
- .getDefaultInterpreterInstall(new DefaultInterpreterEntry(
- natureId, environment));
+ return ScriptRuntime.getDefaultInterpreterInstall(
+ new DefaultInterpreterEntry(natureId, environment));
}
/**
@@ -116,11 +115,12 @@
public boolean canUpdateBuildpathContainer(IPath containerPath,
IScriptProject project) {
if (containerPath != null && containerPath.segmentCount() > 0) {
- if (ScriptRuntime.INTERPRETER_CONTAINER.equals(containerPath
- .segment(0))) {
+ if (ScriptRuntime.INTERPRETER_CONTAINER
+ .equals(containerPath.segment(0))) {
try {
return resolveInterpreter(getNatureFromProject(project),
- getEnvironmentFromProject(project), containerPath) != null;
+ getEnvironmentFromProject(project),
+ containerPath) != null;
} catch (CoreException e) {
return false;
}
@@ -145,19 +145,17 @@
@Override
public void requestBuildpathContainerUpdate(IPath containerPath,
IScriptProject project, IBuildpathContainer containerSuggestion)
- throws CoreException {
+ throws CoreException {
IInterpreterInstall interpreter = resolveInterpreter(
getNatureFromProject(project),
getEnvironmentFromProject(project), containerPath);
if (interpreter == null) {
- IStatus status = new Status(
- IStatus.ERROR,
+ IStatus status = new Status(IStatus.ERROR,
DLTKLaunchingPlugin.getUniqueIdentifier(),
ScriptLaunchConfigurationConstants.ERR_INTERPRETER_INSTALL_DOES_NOT_EXIST,
- MessageFormat
- .format(
- LaunchingMessages.InterpreterEnvironmentContainerInitializer_InterpreterEnvironment_referenced_by_classpath_container__0__does_not_exist__1,
- new String[] { containerPath.toString() }),
+ MessageFormat.format(
+ LaunchingMessages.InterpreterEnvironmentContainerInitializer_InterpreterEnvironment_referenced_by_classpath_container__0__does_not_exist__1,
+ containerPath.toString()),
null);
throw new CoreException(status);
}
@@ -172,27 +170,23 @@
if (lib.exists()) {
libs[i] = new LibraryLocation(path);
} else {
- IStatus status = new Status(
- IStatus.ERROR,
+ IStatus status = new Status(IStatus.ERROR,
DLTKLaunchingPlugin.getUniqueIdentifier(),
ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
- MessageFormat
- .format(
- LaunchingMessages.InterpreterEnvironmentContainerInitializer_Buildpath_entry__0__does_not_refer_to_an_existing_library__2,
- new String[] { entry.getPath()
- .toString() }), null);
+ MessageFormat.format(
+ LaunchingMessages.InterpreterEnvironmentContainerInitializer_Buildpath_entry__0__does_not_refer_to_an_existing_library__2,
+ entry.getPath().toString()),
+ null);
throw new CoreException(status);
}
} else {
- IStatus status = new Status(
- IStatus.ERROR,
+ IStatus status = new Status(IStatus.ERROR,
DLTKLaunchingPlugin.getUniqueIdentifier(),
ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
- MessageFormat
- .format(
- LaunchingMessages.InterpreterEnvironmentContainerInitializer_Buildpath_entry__0__does_not_refer_to_a_library__3,
- new String[] { entry.getPath()
- .toString() }), null);
+ MessageFormat.format(
+ LaunchingMessages.InterpreterEnvironmentContainerInitializer_Buildpath_entry__0__does_not_refer_to_a_library__3,
+ entry.getPath().toString()),
+ null);
throw new CoreException(status);
}
}
@@ -209,10 +203,9 @@
tag = getInterpreterName(containerPath);
}
if (tag != null) {
- return MessageFormat
- .format(
- LaunchingMessages.InterpreterEnvironmentContainer_InterpreterEnvironment_System_Library_1,
- new String[] { tag });
+ return MessageFormat.format(
+ LaunchingMessages.InterpreterEnvironmentContainer_InterpreterEnvironment_System_Library_1,
+ tag);
}
return LaunchingMessages.InterpreterEnvironmentContainerInitializer_Default_System_Library_1;
}
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/ScriptSourceLookupUtil.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/ScriptSourceLookupUtil.java
index a66903e..65ecc70 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/ScriptSourceLookupUtil.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/internal/launching/ScriptSourceLookupUtil.java
@@ -9,7 +9,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
import org.eclipse.dltk.core.DLTKCore;
@@ -31,8 +30,10 @@
*
* @return source container representation of the build path entries
*/
- public static ISourceContainer[] translate(IRuntimeBuildpathEntry[] entries) {
- List containers = new ArrayList(entries.length);
+ public static ISourceContainer[] translate(
+ IRuntimeBuildpathEntry[] entries) {
+ List<ISourceContainer> containers = new ArrayList<ISourceContainer>(
+ entries.length);
for (int i = 0; i < entries.length; i++) {
IRuntimeBuildpathEntry entry = entries[i];
@@ -61,11 +62,12 @@
.toArray(new ISourceContainer[containers.size()]);
}
- private static ISourceContainer createArchivePathContainer(IRuntimeBuildpathEntry entry) {
+ private static ISourceContainer createArchivePathContainer(
+ IRuntimeBuildpathEntry entry) {
// getPath works, use that?
return new BuildpathContainerSourceContainer(entry.getLocation());
}
-
+
private static ISourceContainer createBuildPathContainer(
IRuntimeBuildpathEntry entry) {
ISourceContainer container = null;
diff --git a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/launching/AbstractScriptLaunchConfigurationDelegate.java b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/launching/AbstractScriptLaunchConfigurationDelegate.java
index 455a652..3825ab9 100644
--- a/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/launching/AbstractScriptLaunchConfigurationDelegate.java
+++ b/core/plugins/org.eclipse.dltk.launching/src/org/eclipse/dltk/launching/AbstractScriptLaunchConfigurationDelegate.java
@@ -67,8 +67,8 @@
* this class.
* </p>
*/
-public abstract class AbstractScriptLaunchConfigurationDelegate extends
- LaunchConfigurationDelegate {
+public abstract class AbstractScriptLaunchConfigurationDelegate
+ extends LaunchConfigurationDelegate {
/**
* A list of prerequisite projects ordered by their build order.
@@ -110,10 +110,10 @@
*/
protected CoreException abort(String message, Throwable exception)
throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR,
- DLTKLaunchingPlugin.PLUGIN_ID,
- ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message,
- exception));
+ throw new CoreException(
+ new Status(IStatus.ERROR, DLTKLaunchingPlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
+ message, exception));
}
/**
@@ -159,16 +159,14 @@
throw abort(
MessageFormat.format(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_InterpreterEnvironment_home_directory_not_specified_for__0__5,
- new String[] { interpreter.getName() }),
+ interpreter.getName()),
null,
ScriptLaunchConfigurationConstants.ERR_INTERPRETER_INSTALL_DOES_NOT_EXIST);
}
if (!location.exists()) {
abort(MessageFormat.format(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_InterpreterEnvironment_home_directory_for__0__does_not_exist___1__6,
- new String[] { interpreter.getName(),
- location.toURI().toString() }),
- null,
+ interpreter.getName(), location.toURI().toString()), null,
ScriptLaunchConfigurationConstants.ERR_INTERPRETER_INSTALL_DOES_NOT_EXIST);
}
return interpreter;
@@ -221,7 +219,8 @@
// Get USER_ENTRY
List<String> userEntries = new ArrayList<String>();
for (int i = 0; i < entries.length; i++) {
- if (entries[i].getBuildpathProperty() == IRuntimeBuildpathEntry.USER_ENTRY) {
+ if (entries[i]
+ .getBuildpathProperty() == IRuntimeBuildpathEntry.USER_ENTRY) {
final IPath path = entries[i].getPath();
final String userPath;
if (EnvironmentPathUtils.isFull(path)) {
@@ -278,13 +277,14 @@
boolean empty = true;
boolean allStandard = true;
for (int i = 0; i < entries.length; i++) {
- if (entries[i].getBuildpathProperty() != IRuntimeBuildpathEntry.USER_ENTRY) {
+ if (entries[i]
+ .getBuildpathProperty() != IRuntimeBuildpathEntry.USER_ENTRY) {
String location = entries[i].getLocation();
if (location != null) {
empty = false;
bootEntries.add(location);
- allStandard = allStandard
- && entries[i].getBuildpathProperty() == IRuntimeBuildpathEntry.STANDARD_ENTRY;
+ allStandard = allStandard && entries[i]
+ .getBuildpathProperty() == IRuntimeBuildpathEntry.STANDARD_ENTRY;
}
}
}
@@ -327,10 +327,11 @@
IEnvironment environment = EnvironmentManager.getEnvironment(project);
while (interpreterEnvironmentEntry == null && index < entries.length) {
IRuntimeBuildpathEntry entry = entries[index++];
- if (entry.getBuildpathProperty() == IRuntimeBuildpathEntry.BOOTSTRAP_ENTRY
+ if (entry
+ .getBuildpathProperty() == IRuntimeBuildpathEntry.BOOTSTRAP_ENTRY
|| entry.getBuildpathProperty() == IRuntimeBuildpathEntry.STANDARD_ENTRY) {
- if (ScriptRuntime.isInterpreterInstallReference(
- getLanguageId(), environment.getId(), entry)) {
+ if (ScriptRuntime.isInterpreterInstallReference(getLanguageId(),
+ environment.getId(), entry)) {
interpreterEnvironmentEntry = entry;
} else {
bootEntriesPrepend.add(entry);
@@ -338,9 +339,9 @@
}
}
IRuntimeBuildpathEntry[] bootEntriesPrep = ScriptRuntime
- .resolveRuntimeBuildpath(bootEntriesPrepend
- .toArray(new IRuntimeBuildpathEntry[bootEntriesPrepend
- .size()]), configuration);
+ .resolveRuntimeBuildpath(bootEntriesPrepend.toArray(
+ new IRuntimeBuildpathEntry[bootEntriesPrepend.size()]),
+ configuration);
String[] entriesPrep = null;
if (bootEntriesPrep.length > 0) {
entriesPrep = new String[bootEntriesPrep.length];
@@ -352,16 +353,17 @@
List<IRuntimeBuildpathEntry> bootEntriesAppend = new ArrayList<IRuntimeBuildpathEntry>();
for (; index < entries.length; index++) {
IRuntimeBuildpathEntry entry = entries[index];
- if (entry.getBuildpathProperty() == IRuntimeBuildpathEntry.BOOTSTRAP_ENTRY) {
+ if (entry
+ .getBuildpathProperty() == IRuntimeBuildpathEntry.BOOTSTRAP_ENTRY) {
bootEntriesAppend.add(entry);
}
}
bootpathInfo[0] = entriesPrep;
IRuntimeBuildpathEntry[] bootEntriesApp = ScriptRuntime
- .resolveRuntimeBuildpath(
- bootEntriesAppend
- .toArray(new IRuntimeBuildpathEntry[bootEntriesAppend
- .size()]), configuration);
+ .resolveRuntimeBuildpath(bootEntriesAppend.toArray(
+ new IRuntimeBuildpathEntry[bootEntriesAppend
+ .size()]),
+ configuration);
if (bootEntriesApp.length > 0) {
bootpathInfo[2] = new String[bootEntriesApp.length];
for (int i = 0; i < bootEntriesApp.length; i++) {
@@ -381,17 +383,17 @@
// compare that to the resolved entries for the
// "InterpreterEnvironmentEntry" to see if they
// are different (requires explicit bootpath)
- if (!InterpreterRuntimeBuildpathEntryResolver
- .isSameArchives(
- libraryLocations,
- install.getInterpreterInstallType()
- .getDefaultLibraryLocations(
- install.getInstallLocation(),
- install.getEnvironmentVariables(),
- null))) {
+ if (!InterpreterRuntimeBuildpathEntryResolver.isSameArchives(
+ libraryLocations,
+ install.getInterpreterInstallType()
+ .getDefaultLibraryLocations(
+ install.getInstallLocation(),
+ install.getEnvironmentVariables(),
+ null))) {
// resolve bootpath entries in InterpreterEnvironment entry
IRuntimeBuildpathEntry[] bootEntries = null;
- if (interpreterEnvironmentEntry.getType() == IRuntimeBuildpathEntry.CONTAINER) {
+ if (interpreterEnvironmentEntry
+ .getType() == IRuntimeBuildpathEntry.CONTAINER) {
IRuntimeBuildpathEntry bootEntry = ScriptRuntime
.newRuntimeContainerBuildpathEntry(
interpreterEnvironmentEntry.getPath(),
@@ -496,8 +498,8 @@
* @exception CoreException
* if unable to retrieve the attribute
*/
- public static String getScriptProjectName(ILaunchConfiguration configuration)
- throws CoreException {
+ public static String getScriptProjectName(
+ ILaunchConfiguration configuration) throws CoreException {
return configuration.getAttribute(
ScriptLaunchConfigurationConstants.ATTR_PROJECT_NAME,
(String) null);
@@ -584,11 +586,9 @@
*/
public Map<String, String> getInterpreterSpecificAttributesMap(
ILaunchConfiguration configuration) throws CoreException {
- @SuppressWarnings("unchecked")
- Map<String, String> map = configuration
- .getAttribute(
- ScriptLaunchConfigurationConstants.ATTR_INTERPRETER_INSTALL_TYPE_SPECIFIC_ATTRS_MAP,
- (Map<String, String>) null);
+ Map<String, String> map = configuration.getAttribute(
+ ScriptLaunchConfigurationConstants.ATTR_INTERPRETER_INSTALL_TYPE_SPECIFIC_ATTRS_MAP,
+ (Map<String, String>) null);
return map;
}
@@ -662,8 +662,7 @@
if (!dir.isDirectory()) {
abort(MessageFormat.format(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[] { dir.toString() }),
- null,
+ dir.toString()), null,
ScriptLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
return dir.toOSString();
@@ -684,8 +683,7 @@
}
abort(MessageFormat.format(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[] { path.toString() }),
- null,
+ path.toString()), null,
ScriptLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
} else {
IResource res = getWorkspaceRoot().findMember(path);
@@ -694,8 +692,7 @@
}
abort(MessageFormat.format(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[] { path.toString() }),
- null,
+ path.toString()), null,
ScriptLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
}
@@ -741,16 +738,14 @@
if (!file.exists()) {
abort(NLS.bind(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_Main_script_not_exist,
- file.toOSString()),
- null,
+ file.toOSString()), null,
ScriptLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_SCRIPT);
}
return file.getPath().toOSString();
} else {
abort(NLS.bind(
LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_Main_script_not_resolved,
- mainScriptName),
- null,
+ mainScriptName), null,
ScriptLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_SCRIPT);
}
}
@@ -762,7 +757,7 @@
// Should be overriden in for any language
protected InterpreterConfig createInterpreterConfig(
ILaunchConfiguration configuration, ILaunch launch)
- throws CoreException {
+ throws CoreException {
// Validation already included
IEnvironment scriptEnvironment = getScriptEnvironment(configuration);
@@ -773,8 +768,8 @@
// if (scriptLaunchPath == null) {
// return null;
// }
- final IPath workingDirectory = new Path(getWorkingDirectory(
- configuration, scriptEnvironment));
+ final IPath workingDirectory = new Path(
+ getWorkingDirectory(configuration, scriptEnvironment));
IPath mainScript = null;//
if (scriptLaunchPath != null) {
@@ -796,7 +791,6 @@
// .getNativeEnvironmentCasePreserved());
final boolean append = configuration.getAttribute(
ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- @SuppressWarnings("unchecked")
final Map<String, String> configEnv = configuration.getAttribute(
ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
(Map<String, String>) null);
@@ -830,8 +824,8 @@
return config;
}
- private IEnvironment getScriptEnvironment(ILaunchConfiguration configuration)
- throws CoreException {
+ private IEnvironment getScriptEnvironment(
+ ILaunchConfiguration configuration) throws CoreException {
IScriptProject scriptProject = AbstractScriptLaunchConfigurationDelegate
.getScriptProject(configuration);
return EnvironmentManager.getEnvironment(scriptProject);
@@ -839,7 +833,7 @@
protected void validateLaunchConfiguration(
ILaunchConfiguration configuration, String mode, IProject project)
- throws CoreException {
+ throws CoreException {
// Validation of available debugging engine
if (ILaunchManager.DEBUG_MODE.equals(mode)) {
@@ -903,25 +897,25 @@
*/
launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, null);
try {
- IScriptProject scriptProject = ScriptRuntime.getScriptProject(configuration);
- IProject project = scriptProject == null ? null : scriptProject.getProject();
+ IScriptProject scriptProject = ScriptRuntime
+ .getScriptProject(configuration);
+ IProject project = scriptProject == null ? null
+ : scriptProject.getProject();
if (monitor == null) {
monitor = new NullProgressMonitor();
}
- monitor.beginTask(
- MessageFormat
- .format(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_startingLaunchConfiguration,
- new Object[] { configuration.getName() }),
- 10);
+ monitor.beginTask(MessageFormat.format(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_startingLaunchConfiguration,
+ new Object[] { configuration.getName() }), 10);
if (monitor.isCanceled()) {
return;
}
- monitor.subTask(MessageFormat
- .format(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_validatingLaunchConfiguration,
- new Object[] { configuration.getName() }));
+ monitor.subTask(MessageFormat.format(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_validatingLaunchConfiguration,
+ new Object[] { configuration.getName() }));
validateLaunchConfiguration(configuration, mode, project);
monitor.worked(1);
if (monitor.isCanceled()) {
@@ -929,7 +923,8 @@
}
// Getting InterpreterConfig
- monitor.subTask(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_generatingInterpreterConfiguration);
+ monitor.subTask(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_generatingInterpreterConfiguration);
final InterpreterConfig config = createInterpreterConfig(
configuration, launch);
if (config == null) {
@@ -942,7 +937,8 @@
monitor.worked(1);
// Getting IInterpreterRunner
- monitor.subTask(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_gettingInterpreterRunner);
+ monitor.subTask(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_gettingInterpreterRunner);
final IInterpreterRunner runner = getInterpreterRunner(
configuration, mode);
if (monitor.isCanceled()) {
@@ -951,28 +947,25 @@
monitor.worked(1);
// Real run
- monitor.subTask(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_executingRunner);
+ monitor.subTask(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_executingRunner);
runRunner(configuration, runner, config, launch,
new SubProgressMonitor(monitor, 7));
} catch (CoreException e) {
tryHandleStatus(e, this);
} catch (AssertionFailedException e) {
- tryHandleStatus(
- new CoreException(
- new Status(
- IStatus.ERROR,
- DLTKLaunchingPlugin.PLUGIN_ID,
- ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
- e.getMessage(), e)), this);
+ tryHandleStatus(new CoreException(
+ new Status(IStatus.ERROR, DLTKLaunchingPlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
+ e.getMessage(), e)),
+ this);
} catch (IllegalArgumentException e) {
- tryHandleStatus(
- new CoreException(
- new Status(
- IStatus.ERROR,
- DLTKLaunchingPlugin.PLUGIN_ID,
- ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
- e.getMessage(), e)), this);
+ tryHandleStatus(new CoreException(
+ new Status(IStatus.ERROR, DLTKLaunchingPlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
+ e.getMessage(), e)),
+ this);
} finally {
monitor.done();
}
@@ -993,8 +986,8 @@
}
protected void runRunner(ILaunchConfiguration configuration,
- IInterpreterRunner runner, InterpreterConfig config,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ IInterpreterRunner runner, InterpreterConfig config, ILaunch launch,
+ IProgressMonitor monitor) throws CoreException {
try {
runner.run(config, launch, monitor);
} catch (CoreException e) {
@@ -1044,16 +1037,15 @@
@Override
protected IProject[] getProjectsForProblemSearch(
ILaunchConfiguration configuration, String mode)
- throws CoreException {
+ throws CoreException {
return fOrderedProjects;
}
@Override
protected boolean isLaunchProblem(IMarker problemMarker)
throws CoreException {
- return super.isLaunchProblem(problemMarker)
- && problemMarker.getType().equals(
- IScriptModelMarker.DLTK_MODEL_PROBLEM_MARKER);
+ return super.isLaunchProblem(problemMarker) && problemMarker.getType()
+ .equals(IScriptModelMarker.DLTK_MODEL_PROBLEM_MARKER);
}
@Override
@@ -1061,7 +1053,8 @@
String mode, IProgressMonitor monitor) throws CoreException {
if (monitor != null) {
- monitor.subTask(LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_20);
+ monitor.subTask(
+ LaunchingMessages.AbstractScriptLaunchConfigurationDelegate_20);
}
fOrderedProjects = null;
@@ -1069,8 +1062,8 @@
.getScriptProject(configuration);
if (scriptProject != null) {
- fOrderedProjects = computeReferencedBuildOrder(new IProject[] { scriptProject
- .getProject() });
+ fOrderedProjects = computeReferencedBuildOrder(
+ new IProject[] { scriptProject.getProject() });
}
return super.preLaunchCheck(configuration, mode, monitor);
@@ -1100,16 +1093,16 @@
*/
public IInterpreterRunner getInterpreterRunner(
ILaunchConfiguration configuration, String mode)
- throws CoreException {
+ throws CoreException {
- final IInterpreterInstall install = verifyInterpreterInstall(configuration);
+ final IInterpreterInstall install = verifyInterpreterInstall(
+ configuration);
final IInterpreterRunner runner = install.getInterpreterRunner(mode);
if (runner == null) {
abort(MessageFormat.format(
LaunchingMessages.InterpreterRunnerDoesntExist,
- new String[] { install.getName(), mode }),
- null,
+ install.getName(), mode), null,
ScriptLaunchConfigurationConstants.ERR_INTERPRETER_RUNNER_DOES_NOT_EXIST);
}
@@ -1152,7 +1145,8 @@
IEnvironment environment = EnvironmentManager
.getEnvironment(project);
if (environment != null) {
- final String mainScriptName = verifyMainScriptName(configuration);
+ final String mainScriptName = verifyMainScriptName(
+ configuration);
if (mainScriptName.length() == 0) {
final URI projectURI = project.getLocationURI();
if (projectURI != null) {
diff --git a/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java b/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
index 7aedc95..6470753 100644
--- a/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
+++ b/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.dltk.internal.corext.util;
-import org.eclipse.dltk.core.IDLTKLanguageToolkit;
import org.eclipse.dltk.core.ISearchPatternProcessor;
import org.eclipse.dltk.core.ISearchPatternProcessor.ITypePattern;
import org.eclipse.dltk.core.search.IDLTKSearchConstants;
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/IdBasedExtensionManager.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/IdBasedExtensionManager.java
index de0e5d2..c71698c 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/IdBasedExtensionManager.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/IdBasedExtensionManager.java
@@ -6,7 +6,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.dltk.core.PriorityDLTKExtensionManager;
-import org.eclipse.dltk.core.PriorityDLTKExtensionManager.ElementInfo;
import org.eclipse.dltk.ui.actions.IActionFilterTester;
class IdBasedExtensionManager extends PriorityDLTKExtensionManager {
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java
index 0731639..2a7e000 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/editor/ScriptOutlinePage.java
@@ -831,7 +831,6 @@
/*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- @SuppressWarnings("unchecked")
public Object getAdapter(Class key) {
if (key == IShowInSource.class) {
return getShowInSource();
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/browsing/ext/MultiSelectionListViewer.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/browsing/ext/MultiSelectionListViewer.java
index 688a6a4..b8b2eb7 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/browsing/ext/MultiSelectionListViewer.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/browsing/ext/MultiSelectionListViewer.java
@@ -15,7 +15,6 @@
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -24,7 +23,7 @@
public class MultiSelectionListViewer extends ScrolledComposite {
// Contain ListViewers
- private List viewers = new ArrayList();
+ private List<TreeViewer> viewers = new ArrayList<TreeViewer>();
private int elements = 0;
private ColumnForm columnForm;
private ITreeContentProvider contentProvider;
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/dialogs/PropToPrefLinkArea.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/dialogs/PropToPrefLinkArea.java
index 3ac963f..8fafd4d 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/dialogs/PropToPrefLinkArea.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/dialogs/PropToPrefLinkArea.java
@@ -39,8 +39,7 @@
result = NLS
.bind(WorkbenchMessages.PreferenceNode_NotFound, pageId);
} else {
- result = MessageFormat.format(message, new String[] { node
- .getLabelText() });
+ result = MessageFormat.format(message, node.getLabelText());
// only add the selection listener if the node is found
pageLink.addSelectionListener(new SelectionAdapter() {
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/heredoc/HereDocEnabledPartitioner.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/heredoc/HereDocEnabledPartitioner.java
index ac090b0..120d3dc 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/heredoc/HereDocEnabledPartitioner.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/text/heredoc/HereDocEnabledPartitioner.java
@@ -256,7 +256,6 @@
Assert.isNotNull(ident,
"unable to find line of a starting heredoc partition");
- @SuppressWarnings("null")
int hdLine = fDocument.getLineOfOffset(ident.getOffset());
return findReparseStartForIdent(hdLine, positions, index);