diff --git a/.classpath b/.classpath index ad80aee38fc178532685429cfa686ee48e9f8485..842152f32d6fd58a5fd14444c5060254e0200484 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="var" path="ICY_JAR"/> <classpathentry kind="var" path="ICY_PLUGINS/adufour/ezplug/EzPlug.jar"/> <classpathentry kind="var" path="ICY_PLUGINS/adufour/blocks/Blocks.jar"/> diff --git a/src/plugins/tprovoost/scripteditor/completion/IcyCompletionProvider.java b/src/plugins/tprovoost/scripteditor/completion/IcyCompletionProvider.java index 8a71185d6e50ed30193f7850a08fdf6320976dbe..a5a105caa09cb8de2b7a35eda6441c3defe67be6 100644 --- a/src/plugins/tprovoost/scripteditor/completion/IcyCompletionProvider.java +++ b/src/plugins/tprovoost/scripteditor/completion/IcyCompletionProvider.java @@ -999,8 +999,9 @@ public class IcyCompletionProvider extends DefaultCompletionProvider { Enumeration<JarEntry> jarEntries; String entryName; ArrayList<String> toReturn = new ArrayList<String>(); - - try (JarFile jf = new JarFile(jarFileName)) { + JarFile jf = null; + try { + jf= new JarFile(jarFileName); jarEntries = jf.entries(); while (jarEntries.hasMoreElements()) { entryName = jarEntries.nextElement().getName(); @@ -1013,6 +1014,9 @@ public class IcyCompletionProvider extends DefaultCompletionProvider { } } } + } finally { + if (jf != null) + jf.close(); } return toReturn; } diff --git a/src/plugins/tprovoost/scripteditor/gui/CommandPanel.java b/src/plugins/tprovoost/scripteditor/gui/CommandPanel.java index ad59d1d8dddae6cd03c33efaf3983b5b81aed36e..812fb890f51dbd466d7bde43dedb2317c211bbd0 100644 --- a/src/plugins/tprovoost/scripteditor/gui/CommandPanel.java +++ b/src/plugins/tprovoost/scripteditor/gui/CommandPanel.java @@ -112,7 +112,7 @@ class CommandPanel extends JPanel { for (ScriptEngineFactory factory : manager.getEngineFactories()) { values.add(ScriptEngineHandler.getLanguageName(factory)); } - comboLanguages = new JComboBox<>(values.toArray(new String[values.size()])); + comboLanguages = new JComboBox<String>(values.toArray(new String[values.size()])); comboLanguages.setSelectedItem(language); comboLanguages.setMaximumSize(comboLanguages.getPreferredSize()); diff --git a/src/plugins/tprovoost/scripteditor/scriptblock/ScriptBlock.java b/src/plugins/tprovoost/scripteditor/scriptblock/ScriptBlock.java index 2504c4a4113bde22a73291f31a4ead4935d203e9..0ae8a9df080126d7626d72923a49ae4aa2929bbf 100644 --- a/src/plugins/tprovoost/scripteditor/scriptblock/ScriptBlock.java +++ b/src/plugins/tprovoost/scripteditor/scriptblock/ScriptBlock.java @@ -70,7 +70,7 @@ public abstract class ScriptBlock extends Plugin implements Block, VarListListen @Override public void declareInput(VarList inputMap) { ScriptEngineManager factory = new ScriptEngineManager(); - languagesInstalled = new ArrayList<>(); + languagesInstalled = new ArrayList<String>(); for (ScriptEngineFactory f : factory.getEngineFactories()) { languagesInstalled.add(ScriptEngineHandler.getLanguageName(f)); } @@ -197,8 +197,8 @@ public abstract class ScriptBlock extends Plugin implements Block, VarListListen } private void registerVariables() { - Set<VarMutable> inputVars = new HashSet<>(); - Set<VarMutable> outputVars = new HashSet<>(); + Set<VarMutable> inputVars = new HashSet<VarMutable>(); + Set<VarMutable> outputVars = new HashSet<VarMutable>(); if (inputMap != null) for (Var<?> v : inputMap) { if (v instanceof VarMutable || inputMap.isRuntimeVariable(v)) { diff --git a/src/plugins/tprovoost/scripteditor/scriptblock/script/DefaultScript.java b/src/plugins/tprovoost/scripteditor/scriptblock/script/DefaultScript.java index 71fda1ca3cd5bc486be31217635267a25836d0ae..f6b0f82ed55af6d289c530d1d5cb85c9b38e07b0 100644 --- a/src/plugins/tprovoost/scripteditor/scriptblock/script/DefaultScript.java +++ b/src/plugins/tprovoost/scripteditor/scriptblock/script/DefaultScript.java @@ -22,7 +22,7 @@ public abstract class DefaultScript implements Script { public DefaultScript(String code, Collection<VarMutable> variables) { this.code = code; - this.variables = new HashSet<>(variables); + this.variables = new HashSet<VarMutable>(variables); } @Override diff --git a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarJavaScriptScript.java b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarJavaScriptScript.java index 77b64f017d23eaa58642c611dfaaa3692836106c..499e3370a32a62b0fb9ebf1c1160d42971c5b6dd 100644 --- a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarJavaScriptScript.java +++ b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarJavaScriptScript.java @@ -29,8 +29,8 @@ public class VarJavaScriptScript extends VarScript { Collection<VarMutable> outputVariables, VarListener<Script> defaultListener) throws NullPointerException { super(name, new JavaScriptScript(filterNullValue(defaultValue)), defaultListener); - this.inputVariables = new HashSet<>(inputVariables); - this.outputVariables = new HashSet<>(outputVariables); + this.inputVariables = new HashSet<VarMutable>(inputVariables); + this.outputVariables = new HashSet<VarMutable>(outputVariables); } private static String filterNullValue(String defaultValue) { diff --git a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarPythonScript.java b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarPythonScript.java index e17eb2f95acf23c941547f83691541de3ab05815..43995af28f373aa4b4f0fbd944d5323ae91174c7 100644 --- a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarPythonScript.java +++ b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarPythonScript.java @@ -29,8 +29,8 @@ public class VarPythonScript extends VarScript { public VarPythonScript(String name, String defaultValue, Collection<VarMutable> inputVariables, Collection<VarMutable> outputVariables, VarListener<Script> defaultListener) throws NullPointerException { super(name, new PythonScript(filterNullValue(defaultValue)), defaultListener); - this.inputVariables = new HashSet<>(inputVariables); - this.outputVariables = new HashSet<>(outputVariables); + this.inputVariables = new HashSet<VarMutable>(inputVariables); + this.outputVariables = new HashSet<VarMutable>(outputVariables); } private static String filterNullValue(String defaultValue) { diff --git a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarScript.java b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarScript.java index 3cb4feb6bc44bc5f728fa312139c30a9538b2c8a..0a4a9a8bfb348868d85fe13c25ade7b4f4550e08 100644 --- a/src/plugins/tprovoost/scripteditor/scriptblock/var/VarScript.java +++ b/src/plugins/tprovoost/scripteditor/scriptblock/var/VarScript.java @@ -37,8 +37,8 @@ public abstract class VarScript extends Var<Script> { throws NullPointerException { super(name, defaultValue, defaultListener); setValue(defaultValue); - this.inputVariables = new HashSet<>(inputVariables); - this.outputVariables = new HashSet<>(outputVariables); + this.inputVariables = new HashSet<VarMutable>(inputVariables); + this.outputVariables = new HashSet<VarMutable>(outputVariables); } public String getCode() { diff --git a/src/plugins/tprovoost/scripteditor/uitools/userdialogs/ItemCombo.java b/src/plugins/tprovoost/scripteditor/uitools/userdialogs/ItemCombo.java index 5f468e9d9e6c29328401d06131b7b598129463ab..481064b95a9a33b50151c1791c695b2cc89505a0 100644 --- a/src/plugins/tprovoost/scripteditor/uitools/userdialogs/ItemCombo.java +++ b/src/plugins/tprovoost/scripteditor/uitools/userdialogs/ItemCombo.java @@ -18,7 +18,7 @@ public class ItemCombo extends Item public ItemCombo(String name, String[] items, String defaultValue) { setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); - combo = new JComboBox<>(items); + combo = new JComboBox<String>(items); combo.setSelectedItem(defaultValue); add(new JLabel(name)); add(Box.createHorizontalStrut(4));