Warning fixes in console bundles.
Change-Id: I4ebfd53de49f9b6e389d0157ad92fa7d5a39a77c
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.console.ui/.settings/org.eclipse.jdt.core.prefs b/core/plugins/org.eclipse.dltk.console.ui/.settings/org.eclipse.jdt.core.prefs
index e11b37e..b98ca7b 100644
--- a/core/plugins/org.eclipse.dltk.console.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/core/plugins/org.eclipse.dltk.console.ui/.settings/org.eclipse.jdt.core.prefs
@@ -27,7 +27,7 @@
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -67,7 +67,7 @@
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -83,6 +83,9 @@
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
diff --git a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/ScriptConsoleManager.java b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/ScriptConsoleManager.java
index 03ac3c2..734694c 100644
--- a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/ScriptConsoleManager.java
+++ b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/ScriptConsoleManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,10 +59,9 @@
* @since 2.0
*/
public IScriptConsole[] getScriptConsoles(String consoleType) {
- List<IScriptConsole> consoles = new ArrayList<IScriptConsole>();
+ List<IScriptConsole> consoles = new ArrayList<>();
for (IConsole console : getConsoleManager().getConsoles()) {
- if (console instanceof IScriptConsole
- && console.getType().equals(consoleType)) {
+ if (console instanceof IScriptConsole && console.getType().equals(consoleType)) {
consoles.add((ScriptConsole) console);
}
}
@@ -73,7 +72,7 @@
private synchronized String[] getConsoleViewIds() {
if (consoleViewIds == null) {
- final List<String> viewIds = new ArrayList<String>();
+ final List<String> viewIds = new ArrayList<>();
for (ConsoleViewManager.Descriptor descriptor : new ConsoleViewManager(
"org.eclipse.dltk.console.ui.consoleView") //$NON-NLS-1$
.getDescriptors()) {
@@ -88,8 +87,7 @@
* @since 2.0
*/
public IScriptConsole getActiveScriptConsole(String consoleType) {
- final IWorkbenchWindow window = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
+ final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
final IWorkbenchPage page = window.getActivePage();
if (page != null) {
@@ -98,8 +96,7 @@
if (part != null && part instanceof IConsoleView) {
IConsoleView view = (IConsoleView) part;
IConsole console = view.getConsole();
- if (console instanceof IScriptConsole
- && console.getType().equals(consoleType)) {
+ if (console instanceof IScriptConsole && console.getType().equals(consoleType)) {
return (IScriptConsole) console;
}
}
@@ -149,21 +146,17 @@
getConsoleManager().removeConsoles(new IConsole[] { console });
}
- protected IScriptConsoleFactory findScriptConsoleFactory(String natureId)
- throws CoreException {
+ protected IScriptConsoleFactory findScriptConsoleFactory(String natureId) throws CoreException {
IExtensionRegistry reg = Platform.getExtensionRegistry();
- IExtensionPoint ep = reg
- .getExtensionPoint(ScriptConsoleUIConstants.SCRIPT_CONSOLE_EP);
+ IExtensionPoint ep = reg.getExtensionPoint(ScriptConsoleUIConstants.SCRIPT_CONSOLE_EP);
IExtension[] extensions = ep.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IExtension ext = extensions[i];
IConfigurationElement[] ce = ext.getConfigurationElements();
for (int j = 0; j < ce.length; j++) {
- if (natureId.equals(ce[j].getAttribute(
- ScriptConsoleUIConstants.SCRIPT_CONSOLE_NATURE_ID))) {
- Object obj = ce[j].createExecutableExtension(
- ScriptConsoleUIConstants.SCRIPT_CONSOLE_CLASS);
+ if (natureId.equals(ce[j].getAttribute(ScriptConsoleUIConstants.SCRIPT_CONSOLE_NATURE_ID))) {
+ Object obj = ce[j].createExecutableExtension(ScriptConsoleUIConstants.SCRIPT_CONSOLE_CLASS);
if (obj instanceof IScriptConsoleFactory) {
return (IScriptConsoleFactory) obj;
} else {
@@ -188,14 +181,12 @@
return;
}
try {
- final ILaunchConfiguration configuration = launch
- .getLaunchConfiguration();
+ final ILaunchConfiguration configuration = launch.getLaunchConfiguration();
if (configuration == null) {
return;
}
- boolean useDltk = configuration.getAttribute(
- ScriptLaunchConfigurationConstants.ATTR_USE_INTERACTIVE_CONSOLE,
- false);
+ boolean useDltk = configuration
+ .getAttribute(ScriptLaunchConfigurationConstants.ATTR_USE_INTERACTIVE_CONSOLE, false);
if (!useDltk) {
return;
}
@@ -210,17 +201,14 @@
}
return;
}
- final String natureId = configuration.getAttribute(
- ScriptLaunchConfigurationConstants.ATTR_SCRIPT_NATURE,
+ final String natureId = configuration.getAttribute(ScriptLaunchConfigurationConstants.ATTR_SCRIPT_NATURE,
(String) null);
if (natureId == null) {
return;
}
- final String consoleId = configuration.getAttribute(
- ScriptLaunchConfigurationConstants.ATTR_DLTK_CONSOLE_ID,
+ final String consoleId = configuration.getAttribute(ScriptLaunchConfigurationConstants.ATTR_DLTK_CONSOLE_ID,
(String) null);
- final IScriptConsoleFactory factory = findScriptConsoleFactory(
- natureId);
+ final IScriptConsoleFactory factory = findScriptConsoleFactory(natureId);
if (factory == null) {
return;
}
@@ -231,12 +219,9 @@
@Override
public void run() throws Exception {
- IScriptInterpreter interpreter = ScriptInterpreterManager
- .getInstance().createInterpreter(natureId);
- ScriptConsoleServer.getInstance().register(consoleId,
- interpreter);
- factory.openConsole(interpreter, configuration.getName(),
- launch);
+ IScriptInterpreter interpreter = ScriptInterpreterManager.getInstance().createInterpreter(natureId);
+ ScriptConsoleServer.getInstance().register(consoleId, interpreter);
+ factory.openConsole(interpreter, configuration.getName(), launch);
}
});
} catch (CoreException e) {
@@ -247,8 +232,7 @@
}
private ScriptConsole getConsole(ILaunch launch) {
- final IConsoleManager manager = ConsolePlugin.getDefault()
- .getConsoleManager();
+ final IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
final IConsole[] consoles = manager.getConsoles();
for (int i = 0; i < consoles.length; i++) {
final IConsole console = consoles[i];
@@ -267,8 +251,7 @@
public void launchRemoved(ILaunch launch) {
final IConsole console = getConsole(launch);
if (console != null) {
- IConsoleManager manager = ConsolePlugin.getDefault()
- .getConsoleManager();
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
manager.removeConsoles(new IConsole[] { console });
}
}
diff --git a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java
index 72e4aa1..e41d769 100644
--- a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java
+++ b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/ScriptConsoleViewer.java
@@ -71,7 +71,7 @@
private AnsiColorHelper ansiHelper = new AnsiColorHelper();
- private List<ScriptConsoleViewer> viewerList = new ArrayList<ScriptConsoleViewer>();
+ private List<ScriptConsoleViewer> viewerList = new ArrayList<>();
private void addViewer(ScriptConsoleViewer viewer) {
viewerList.add(viewer);
diff --git a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/actions/SaveConsoleSessionAction.java b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/actions/SaveConsoleSessionAction.java
index a70c304..65b1f39 100644
--- a/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/actions/SaveConsoleSessionAction.java
+++ b/core/plugins/org.eclipse.dltk.console.ui/src/org/eclipse/dltk/console/ui/internal/actions/SaveConsoleSessionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,14 +42,8 @@
try {
if (file != null) {
- FileWriter writer = null;
- try {
- writer = new FileWriter(file);
+ try (FileWriter writer = new FileWriter(file)) {
writer.write(console.getSession().toString());
- } finally {
- if (writer != null) {
- writer.close();
- }
}
}
} catch (IOException e) {
diff --git a/core/plugins/org.eclipse.dltk.console/.settings/org.eclipse.jdt.core.prefs b/core/plugins/org.eclipse.dltk.console/.settings/org.eclipse.jdt.core.prefs
index 3a21537..75e57bb 100644
--- a/core/plugins/org.eclipse.dltk.console/.settings/org.eclipse.jdt.core.prefs
+++ b/core/plugins/org.eclipse.dltk.console/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,13 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -6,6 +15,94 @@
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
diff --git a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleHistory.java b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleHistory.java
index 9eb6668..db1a7a1 100644
--- a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleHistory.java
+++ b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleHistory.java
@@ -1,11 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
-
*******************************************************************************/
package org.eclipse.dltk.console;
@@ -22,7 +21,7 @@
* since empty line is added to keep the value of the currently selected
* line.
*/
- private final List lines = new ArrayList();
+ private final List<String> lines = new ArrayList<>();
public ScriptConsoleHistory() {
lines.add(Util.EMPTY_STRING);
@@ -30,7 +29,7 @@
/**
* The index of the current item.
- *
+ *
* Invariant:
* <code>selection >= 0 >> selection < lines.size()</code>
*/
@@ -48,7 +47,7 @@
/**
* Adds the specified line to the top of the history
- *
+ *
* @param line
*/
public void add(String line) {
@@ -62,7 +61,7 @@
/**
* Moves the selection to the previous item. Returns <code>true</code> on
* success or <code>false</code> otherwise.
- *
+ *
* @return
*/
public boolean prev() {
@@ -76,7 +75,7 @@
/**
* Moves the selection to the next item. Returns <code>true</code> on
* success or <code>false</code> otherwise.
- *
+ *
* @return
*/
public boolean next() {
@@ -89,16 +88,16 @@
/**
* Returns the text of the currently selected line.
- *
+ *
* @return
*/
public String get() {
- return (String) lines.get(selection);
+ return lines.get(selection);
}
/**
* Updates the text of the currently selected line
- *
+ *
* @param line
*/
public void updateSelectedLine(String line) {
diff --git a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleServer.java b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleServer.java
index 87a53fa..f40fca6 100644
--- a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleServer.java
+++ b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleServer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@
private int port;
- private final Map handlers;
+ private final Map<String, ConsoleRequest> handlers;
protected ScriptConsoleServer() {
this.port = DEFAULT_PORT;
@@ -53,7 +53,7 @@
}
}
- handlers = new HashMap();
+ handlers = new HashMap<>();
(new Thread(this)).start();
}
@@ -93,7 +93,7 @@
ConsoleRequest request = null;
synchronized (handlers) {
- request = (ConsoleRequest) handlers.get(id);
+ request = handlers.get(id);
while (request == null) {
try {
handlers.wait();
diff --git a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleXmlHelper.java b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleXmlHelper.java
index bb5e926..ff05112 100644
--- a/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleXmlHelper.java
+++ b/core/plugins/org.eclipse.dltk.console/src/org/eclipse/dltk/console/ScriptConsoleXmlHelper.java
@@ -1,11 +1,11 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
-
+
*******************************************************************************/
package org.eclipse.dltk.console;
@@ -76,10 +76,10 @@
return null;
}
- protected static List parseCompletionList(Node completionNode) {
+ protected static List<ScriptConsoleCompletionProposal> parseCompletionList(Node completionNode) {
NodeList children = completionNode.getChildNodes();
- List completions = new ArrayList();
+ List<ScriptConsoleCompletionProposal> completions = new ArrayList<>();
for (int i = 0; i < children.getLength(); ++i) {
Node node = children.item(i);
@@ -139,7 +139,7 @@
for (int j = 0; j < list2.getLength(); ++j) {
Node n2 = list2.item(j);
if (isElement(n2, "completion")) { //$NON-NLS-1$
- List completions = parseCompletionList(n2);
+ List<ScriptConsoleCompletionProposal> completions = parseCompletionList(n2);
return new ShellResponse(completions);
} else if (isElement(n2, "description")) { //$NON-NLS-1$
if (n2.getChildNodes().getLength() == 0) {