Browse Source

Merge pull request #216 from tonihele/cleanups

Cleanups
MeFisto94 5 years ago
parent
commit
f0bfc437f4
93 changed files with 526 additions and 426 deletions
  1. 1 1
      branding/modules/org-netbeans-core.jar/org/netbeans/core/ui/Bundle.properties
  2. 1 1
      build.gradle
  3. BIN
      gradle/wrapper/gradle-wrapper.jar
  4. 1 1
      gradle/wrapper/gradle-wrapper.properties
  5. 19 3
      gradlew
  6. 17 1
      gradlew.bat
  7. 1 1
      jme3-android/nbproject/project.properties
  8. 1 1
      jme3-angelfont/nbproject/project.properties
  9. 3 3
      jme3-assetpack-support/nbproject/project.properties
  10. 1 4
      jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java
  11. 11 3
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java
  12. 9 4
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java
  13. 19 12
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java
  14. 17 14
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/wizards/CreateProjectWizardIterator.java
  15. 1 1
      jme3-blender/nbproject/project.properties
  16. 1 1
      jme3-cinematics/nbproject/project.properties
  17. 1 1
      jme3-code-check/nbproject/project.properties
  18. 1 1
      jme3-codepalette/nbproject/project.properties
  19. 1 1
      jme3-core-baselibs/nbproject/project.properties
  20. 1 1
      jme3-core-libraries/nbproject/project.properties
  21. 1 1
      jme3-core-updatecenters/nbproject/project.properties
  22. 1 1
      jme3-core/nbproject/project.properties
  23. 5 9
      jme3-core/src/com/jme3/gde/core/appstates/NewAppStateWizardAction.java
  24. 5 7
      jme3-core/src/com/jme3/gde/core/appstates/RunAppStateAction.java
  25. 1 1
      jme3-core/src/com/jme3/gde/core/assets/AssetDataNode.java
  26. 10 7
      jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java
  27. 1 1
      jme3-core/src/com/jme3/gde/core/editor/nodes/ConnectionStraight.java
  28. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java
  29. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewDirectionalLightShadowFilterAction.java
  30. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewPointLightShadowFilterAction.java
  31. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewSpotLightShadowFilterAction.java
  32. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java
  33. 1 2
      jme3-core/src/com/jme3/gde/core/filters/impl/dlsf/DLSFWizardAction.java
  34. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/plsf/PLSFWizardAction.java
  35. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/slsf/SLSFWizardAction.java
  36. 2 3
      jme3-core/src/com/jme3/gde/core/j2seproject/actions/UpgradeProjectWizardPanel1.java
  37. 11 2
      jme3-core/src/com/jme3/gde/core/navigator/SceneNavigatorPanel.java
  38. 24 23
      jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java
  39. 1 1
      jme3-dark-laf/nbproject/project.properties
  40. 1 1
      jme3-desktop-executables/nbproject/project.properties
  41. 1 1
      jme3-documentation/nbproject/project.properties
  42. 1 1
      jme3-glsl-highlighter/nbproject/project.properties
  43. 1 1
      jme3-gui/nbproject/project.properties
  44. 1 2
      jme3-gui/src/com/jme3/gde/gui/NiftyGuiDataObject.java
  45. 8 11
      jme3-gui/src/com/jme3/gde/gui/swing/ConvertToNifty.java
  46. 15 27
      jme3-gui/src/com/jme3/gde/gui/view/NiftyGuiVisualElement.java
  47. 1 1
      jme3-ios/nbproject/project.properties
  48. 2 1
      jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.java
  49. 1 1
      jme3-lwjgl-applet/nbproject/project.properties
  50. 1 1
      jme3-materialeditor/nbproject/project.properties
  51. 1 1
      jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java
  52. 1 1
      jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java
  53. 37 40
      jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java
  54. 1 0
      jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java
  55. 26 22
      jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java
  56. 1 1
      jme3-model-importer/nbproject/project.properties
  57. 11 12
      jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java
  58. 1 1
      jme3-navmesh-gen/nbproject/project.properties
  59. 5 2
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshAction.java
  60. 5 4
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshGenerator.java
  61. 1 1
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshToolController.java
  62. 12 9
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshTopComponent.java
  63. 3 5
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/wizard/NewNavMeshWizardAction.java
  64. 1 1
      jme3-obfuscate/nbproject/project.properties
  65. 5 3
      jme3-ogretools/src/com/jme3/gde/ogretools/blender/InstallBlenderExporterPanel.java
  66. 1 1
      jme3-ogrexml/nbproject/project.properties
  67. 1 1
      jme3-project-baselibs/nbproject/project.properties
  68. 1 1
      jme3-project-libraries/nbproject/project.properties
  69. 1 1
      jme3-project-testdata/nbproject/project.properties
  70. 1 1
      jme3-scenecomposer/nbproject/project.properties
  71. 1 2
      jme3-scenecomposer/src/com/jme3/gde/scenecomposer/gizmo/light/LightProbeGizmo.java
  72. 2 4
      jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java
  73. 1 1
      jme3-templates/nbproject/project.properties
  74. 17 14
      jme3-templates/src/com/jme3/gde/templates/basic/BasicGameWizardIterator.java
  75. 1 1
      jme3-terrain-editor/nbproject/project.properties
  76. 1 1
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/AddTerrainAction.java
  77. 1 1
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainVisualPanel2.java
  78. 4 1
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardAction.java
  79. 9 2
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel1.java
  80. 13 6
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel2.java
  81. 8 1
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel3.java
  82. 77 62
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java
  83. 17 12
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java
  84. 1 1
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java
  85. 2 2
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardAction.java
  86. 6 6
      jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java
  87. 1 1
      jme3-tests-template/nbproject/project.properties
  88. 17 14
      jme3-tests-template/src/com/jme3/gde/templates/tests/testsandroid/JME3TestsAndroidWizardIterator.java
  89. 17 14
      jme3-tests-template/src/com/jme3/gde/templates/tests/testsdesktop/JmeTestsWizardIterator.java
  90. 1 1
      jme3-texture-editor/nbproject/project.properties
  91. 1 1
      jme3-vehicle-creator/nbproject/project.properties
  92. 1 1
      jme3-wavefront/nbproject/project.properties
  93. 1 1
      jme3-welcome-screen/nbproject/project.properties

+ 1 - 1
branding/modules/org-netbeans-core.jar/org/netbeans/core/ui/Bundle.properties

@@ -1,3 +1,3 @@
-LBL_Copyright=<p><em>Copyright &copy; 2018 jMonkeyEngine.\n<br>Please visit <a style="color: #f3c802;" href="http://jmonkeyengine.org">http://jmonkeyengine.org</a> for more information.</em></p><p>Icons sets : <ul><li><a style="color: #f3c802;" href="http://brankic1979.com/icons/">Brankic1979</a></li><li><a style="color: #f3c802;" href="http://www.entypo.com/index.php">Entypo+</a></li><li><a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/ogli">Ogli</a> (edited by <a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/grizeldi">grizeldi</a></li><ul> </p>
+LBL_Copyright=<p><em>Copyright &copy; 2020 jMonkeyEngine.\n<br>Please visit <a style="color: #f3c802;" href="http://jmonkeyengine.org">http://jmonkeyengine.org</a> for more information.</em></p><p>Icons sets : <ul><li><a style="color: #f3c802;" href="http://brankic1979.com/icons/">Brankic1979</a></li><li><a style="color: #f3c802;" href="http://www.entypo.com/index.php">Entypo+</a></li><li><a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/ogli">Ogli</a> (edited by <a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/grizeldi">grizeldi</a>)</li><ul> </p>
 updates_not_found=<p style="margin: 0"><b>Updates:</b> jMonkeyEngine SDK is updated to version {0}</p>\n 
 URL_ON_IMG=http://jmonkeyengine.org/

+ 1 - 1
build.gradle

@@ -698,7 +698,7 @@ task fixPlatformIndependent(dependsOn: patchPlatformIndependent, type: Zip) {
 }
 
 wrapper {
-    gradleVersion = '4.10.2'
+    gradleVersion = '5.6.4'
 }
 
 //jar.dependsOn(buildSdk)

BIN
gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 19 - 3
gradlew

@@ -1,5 +1,21 @@
 #!/usr/bin/env sh
 
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 ##############################################################################
 ##
 ##  Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
 
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
     GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
 fi
 
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
     JAVACMD=`cygpath --unix "$JAVACMD"`

+ 17 - 1
gradlew.bat

@@ -1,3 +1,19 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
 @if "%DEBUG%" == "" @echo off
 @rem ##########################################################################
 @rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
 set APP_HOME=%DIRNAME%
 
 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
 
 @rem Find java.exe
 if defined JAVA_HOME goto findJavaFromJavaHome

+ 1 - 1
jme3-android/nbproject/project.properties

@@ -1,6 +1,6 @@
 #Updated by build script
 #Thu, 25 Aug 2011 21:00:54 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 1 - 1
jme3-angelfont/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 nbm.homepage=http\://www.jmonkeyengine.org
 nbm.module.author=Normen Hansen

+ 3 - 3
jme3-assetpack-support/nbproject/project.properties

@@ -1,8 +1,8 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
-javac.compilerargs=-Xlint -Xlint\:-serial
+javac.source=11
+javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
-nbm.homepage=http\://www.jmonkeyengine.org
+nbm.homepage=http://www.jmonkeyengine.org
 nbm.module.author=Normen Hansen
 nbm.needs.restart=true
 spec.version.base=3.3.0

+ 1 - 4
jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java

@@ -6,9 +6,6 @@ package com.jme3.gde.assetpack.online;
 
 import java.io.*;
 import java.net.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.netbeans.api.progress.ProgressHandle;
 
 /**
  * <code>MultiPartFormOutputStream</code> is used to write
@@ -70,7 +67,7 @@ public class MultiPartFormOutputStream {
      */
     public void writeField(String name, boolean value)
             throws java.io.IOException {
-        writeField(name, new Boolean(value).toString());
+        writeField(name, Boolean.toString(value));
     }
 
     /**

+ 11 - 3
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java

@@ -35,6 +35,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -49,6 +50,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         if (!cancelled) {
             new Thread(new Runnable() {
 
+                @Override
                 public void run() {
                     scanDir(((AssetPackProject) context).getAssetsFolder().getPath(), deleteFiles);
                 }
@@ -62,8 +64,8 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         try {
             File zipDir = new File(dir2scan);
             String[] dirList = zipDir.list();
-            for (int i = 0; i < dirList.length; i++) {
-                File f = new File(zipDir, dirList[i]);
+            for (String dirList1 : dirList) {
+                File f = new File(zipDir, dirList1);
                 if (f.isDirectory()) {
                     String filePath = f.getPath();
                     scanDir(filePath, delete);
@@ -107,7 +109,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -122,6 +124,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Convert Binary Ogre Meshes..";
@@ -129,19 +132,24 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 9 - 4
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java

@@ -15,7 +15,6 @@ import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.text.MessageFormat;
-import java.util.Iterator;
 import java.util.List;
 import javax.swing.Action;
 import javax.swing.JComponent;
@@ -34,6 +33,7 @@ public final class ImportAssetAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -65,8 +65,7 @@ public final class ImportAssetAction implements Action {
         asset.appendChild(license);
 
         List<FileDescription> files = (List<FileDescription>) desc.getProperty("filelist");
-        for (Iterator<FileDescription> it = files.iterator(); it.hasNext();) {
-            FileDescription fileObject = it.next();
+        for (FileDescription fileObject : files) {
             Element file = context.getConfiguration().createElement("file");
             asset.appendChild(file);
             file.setAttribute("path", fileObject.getPath() + fileObject.getFile().getNameExt());
@@ -117,7 +116,7 @@ public final class ImportAssetAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -132,6 +131,7 @@ public final class ImportAssetAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Add Asset..";
@@ -139,19 +139,24 @@ public final class ImportAssetAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 19 - 12
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java

@@ -42,6 +42,7 @@ public final class PublishAssetPackAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -57,6 +58,7 @@ public final class PublishAssetPackAction implements Action {
         if (!cancelled) {
             new Thread(new Runnable() {
 
+                @Override
                 public void run() {
                     ProgressHandle handle = ProgressHandle.createHandle("Publishing AssetPack..");
                     handle.start();
@@ -67,7 +69,7 @@ public final class PublishAssetPackAction implements Action {
                     cleanup(wizardDescriptor);
                     handle.finish();
                 }
-            }).start();
+            }, "AssetPackPublisher").start();
         }
     }
 
@@ -87,23 +89,22 @@ public final class PublishAssetPackAction implements Action {
         try {
             FileObject[] dirList = dir2zip.getChildren();
             byte[] readBuffer = new byte[2156];
-            int bytesIn = 0;
-            for (int i = 0; i < dirList.length; i++) {
-                FileObject f = dirList[i];
+            int bytesIn;
+            for (FileObject f : dirList) {
                 if (f.isFolder()) {
                     zipDir(f, zos, fileName);
                     //loop again
                     continue;
                 }
-                InputStream fis = f.getInputStream();
                 if (!f.getNameExt().equals(fileName) && !f.getNameExt().startsWith(".")) {
-                    String filePathName = f.getPath().replaceAll(context.getProjectDirectory().getPath(), "");
-                    ZipEntry anEntry = new ZipEntry(filePathName);
-                    zos.putNextEntry(anEntry);
-                    while ((bytesIn = fis.read(readBuffer)) != -1) {
-                        zos.write(readBuffer, 0, bytesIn);
+                    try(InputStream fis = f.getInputStream()) {
+                        String filePathName = f.getPath().replaceAll(context.getProjectDirectory().getPath(), "");
+                        ZipEntry anEntry = new ZipEntry(filePathName);
+                        zos.putNextEntry(anEntry);
+                        while ((bytesIn = fis.read(readBuffer)) != -1) {
+                            zos.write(readBuffer, 0, bytesIn);
+                        }
                     }
-                    fis.close();
                 }
             }
         } catch (Exception e) {
@@ -162,7 +163,7 @@ public final class PublishAssetPackAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -177,6 +178,7 @@ public final class PublishAssetPackAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Publish AssetPack..";
@@ -184,19 +186,24 @@ public final class PublishAssetPackAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 17 - 14
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/wizards/CreateProjectWizardIterator.java

@@ -41,7 +41,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
     private int index;
     private WizardDescriptor.Panel[] panels;
     private WizardDescriptor wiz;
-    private String name = "Create AssetPack Project";
+    private final String name = "Create AssetPack Project";
 
     public static CreateProjectWizardIterator createIterator() {
         return new CreateProjectWizardIterator();
@@ -68,7 +68,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -83,19 +83,23 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         return panels;
     }
 
+    @Override
     public void addChangeListener(ChangeListener l) {
 //        throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public void removeChangeListener(ChangeListener l) {
 //        throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public void initialize(WizardDescriptor wizard) {
         wiz = wizard;
         getPanels();
     }
 
+    @Override
     public void uninitialize(WizardDescriptor wizard) {
 //        this.wiz.putProperty("projdir", null);
 //        this.wiz.putProperty("name", null);
@@ -103,8 +107,9 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         panels = null;
     }
 
+    @Override
     public Set<FileObject> instantiate() throws IOException {
-        Set<FileObject> mySet = new LinkedHashSet<FileObject>();
+        Set<FileObject> mySet = new LinkedHashSet<>();
         //create folders
         File dirF = FileUtil.normalizeFile(new File((String) wiz.getProperty("folder")));
         dirF.mkdirs();
@@ -125,14 +130,17 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         return mySet;
     }
 
+    @Override
     public boolean hasNext() {
         return index < panels.length - 1;
     }
 
+    @Override
     public boolean hasPrevious() {
         return index > 0;
     }
 
+    @Override
     public void nextPanel() {
         if (!hasNext()) {
             throw new NoSuchElementException();
@@ -140,6 +148,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         index++;
     }
 
+    @Override
     public void previousPanel() {
         if (!hasPrevious()) {
             throw new NoSuchElementException();
@@ -147,16 +156,18 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         index--;
     }
 
+    @Override
     public WizardDescriptor.Panel current() {
         return panels[index];
     }
 
+    @Override
     public String name() {
         return name;
     }
 
     private void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
-        try {
+        try (source) {
             ZipInputStream str = new ZipInputStream(source);
             ZipEntry entry;
             while ((entry = str.getNextEntry()) != null) {
@@ -172,17 +183,12 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
                     }
                 }
             }
-        } finally {
-            source.close();
         }
     }
 
     private void writeFile(ZipInputStream str, FileObject fo) throws IOException {
-        OutputStream out = fo.getOutputStream();
-        try {
+        try (OutputStream out = fo.getOutputStream()) {
             FileUtil.copy(str, out);
-        } finally {
-            out.close();
         }
     }
 
@@ -198,11 +204,8 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
             doc.getDocumentElement().setAttribute("name", (String) wiz.getProperty("name"));
             XMLUtil.findElement(doc.getDocumentElement(), "description", null).setTextContent((String) wiz.getProperty("description"));
             XMLUtil.findElement(doc.getDocumentElement(), "license", null).setTextContent((String) wiz.getProperty("license"));
-            OutputStream out = fo.getOutputStream();
-            try {
+            try (OutputStream out = fo.getOutputStream()) {
                 XMLUtil.write(doc, out, "UTF-8");
-            } finally {
-                out.close();
             }
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);

+ 1 - 1
jme3-blender/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-cinematics/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-code-check/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-codepalette/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-core-baselibs/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-core-libraries/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-core-updatecenters/nbproject/project.properties

@@ -1,4 +1,4 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 spec.version.base=3.3.0

+ 1 - 1
jme3-core/nbproject/project.properties

@@ -1,7 +1,7 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
 file.reference.DDSUtils.jar=release/modules/ext/DDSUtils.jar
 #Thu, 25 Aug 2011 19:32:54 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 5 - 9
jme3-core/src/com/jme3/gde/core/appstates/NewAppStateWizardAction.java

@@ -92,11 +92,10 @@ public final class NewAppStateWizardAction implements ActionListener {
         if (configuration == null) {
             return null;
         }
-        WizardDescriptor wizardDescriptor = (WizardDescriptor) configuration;
-        ProjectAssetManager manager = (ProjectAssetManager) wizardDescriptor.getProperty("asset_manager");
+        ProjectAssetManager manager = (ProjectAssetManager) configuration.getProperty("asset_manager");
         List<ClassLoader> loaders = manager.getClassLoaders();
 
-        String className = (String) wizardDescriptor.getProperty("class_name");
+        String className = (String) configuration.getProperty("class_name");
         Class clazz = null;
         try {
             clazz = getClass().getClassLoader().loadClass(className);
@@ -112,17 +111,14 @@ public final class NewAppStateWizardAction implements ActionListener {
         }
         if (clazz != null) {
             try {
-                Object contr = clazz.newInstance();
+                Object contr = clazz.getDeclaredConstructor().newInstance();
                 //TODO: remove sillyness-test
                 if (contr instanceof AppState || contr instanceof AbstractAppState) {
                     return (AppState) contr;
                 } else {
                     DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("This is no AppState class!"));
                 }
-            } catch (InstantiationException ex) {
-                Exceptions.printStackTrace(ex);
-                DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error instatiating class!"));
-            } catch (IllegalAccessException ex) {
+            } catch (Exception ex) {
                 Exceptions.printStackTrace(ex);
                 DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error instatiating class!"));
             }
@@ -152,7 +148,7 @@ public final class NewAppStateWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 5 - 7
jme3-core/src/com/jme3/gde/core/appstates/RunAppStateAction.java

@@ -34,9 +34,7 @@ package com.jme3.gde.core.appstates;
 import com.jme3.app.state.AppState;
 import com.jme3.gde.core.assets.ProjectAssetManager;
 import com.jme3.gde.core.scene.FakeApplication;
-import com.jme3.gde.core.scene.PreviewRequest;
 import com.jme3.gde.core.scene.SceneApplication;
-import com.jme3.gde.core.scene.SceneListener;
 import com.jme3.gde.core.scene.SceneRequest;
 import com.sun.source.tree.ClassTree;
 import com.sun.source.tree.CompilationUnitTree;
@@ -44,6 +42,7 @@ import com.sun.source.tree.Tree;
 import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.lang.model.element.TypeElement;
@@ -233,8 +232,10 @@ public class RunAppStateAction implements ContextAwareAction {
                     }
                 }
 
+                @Override
                 public void cancel() {
                 }
+                
             };
             src.runUserActionTask(task, true);
             return ret;
@@ -247,13 +248,10 @@ public class RunAppStateAction implements ContextAwareAction {
     private void attachState(FakeApplication app) {
         try {
             assert (config.className != null);
-            AppState state = (AppState) app.getClassByName(config.className).newInstance();
+            AppState state = (AppState) app.getClassByName(config.className).getDeclaredConstructor().newInstance();
             app.getStateManager().attach(state);
             AppStateExplorerTopComponent.openExplorer();
-        } catch (InstantiationException ex) {
-            DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error creating AppState, is the project compiled?\nAlso make sure it has an empty constructor!\n" + ex.getMessage()));
-            Exceptions.printStackTrace(ex);
-        } catch (IllegalAccessException ex) {
+        } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException | InvocationTargetException ex) {
             DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error creating AppState, is the project compiled?\nAlso make sure it has an empty constructor!\n" + ex.getMessage()));
             Exceptions.printStackTrace(ex);
         } catch (Exception ex) {

+ 1 - 1
jme3-core/src/com/jme3/gde/core/assets/AssetDataNode.java

@@ -70,7 +70,7 @@ public class AssetDataNode extends DataNode {
             return sheet;
         }
         
-        Sheet.Set set = sheet.createPropertiesSet();
+        Sheet.Set set = Sheet.createPropertiesSet();
         set.setName("AssetKey");
         set.setDisplayName("Conversion Settings");
         for (Field field : key.getClass().getDeclaredFields()) {

+ 10 - 7
jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java

@@ -69,6 +69,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
     private static final Logger logger = Logger.getLogger(CodelessProjectWizardAction.class.getName());
     private WizardDescriptor.Panel[] panels;
 
+    @Override
     public void performAction() {
         WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -91,13 +92,13 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
             FileObject properties = project.createData(CodelessProjectFactory.CONFIG_NAME);
             Properties propertiesObj = new Properties();
             FileLock lock = properties.lock();
-            InputStream in = properties.getInputStream();
-            propertiesObj.load(in);
-            in.close();
+            try (InputStream in = properties.getInputStream()) {
+                propertiesObj.load(in);
+            }
             propertiesObj.setProperty("assets.folder.name", assetsFolder);
-            OutputStream out = properties.getOutputStream(lock);
-            propertiesObj.store(out, "assets properties");
-            out.close();
+            try (OutputStream out = properties.getOutputStream(lock)) {
+                propertiesObj.store(out, "assets properties");
+            }
             lock.releaseLock();
 
             Project theProject = ProjectManager.getDefault().findProject(project);
@@ -134,7 +135,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -149,6 +150,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
         return panels;
     }
 
+    @Override
     public String getName() {
         return "External Project Assets..";
     }
@@ -158,6 +160,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
         return null;
     }
 
+    @Override
     public HelpCtx getHelpCtx() {
         return HelpCtx.DEFAULT_HELP;
     }

+ 1 - 1
jme3-core/src/com/jme3/gde/core/editor/nodes/ConnectionStraight.java

@@ -572,7 +572,7 @@ public class ConnectionStraight extends JPanel implements ComponentListener,
 
     @Override
     public void propertyChange(PropertyChangeEvent evt) {
-        mapping = (Object) evt.getSource();
+        mapping = evt.getSource();
         key = "error";
         //key = MaterialUtils.makeKey(mapping, getDiagram().getCurrentTechniqueName());
     }

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java

@@ -106,7 +106,7 @@ public class NewBloomFilterAction extends AbstractNewFilterWizardAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewDirectionalLightShadowFilterAction.java

@@ -103,7 +103,7 @@ public class NewDirectionalLightShadowFilterAction extends AbstractNewFilterWiza
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewPointLightShadowFilterAction.java

@@ -102,7 +102,7 @@ public class NewPointLightShadowFilterAction extends AbstractNewFilterWizardActi
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewSpotLightShadowFilterAction.java

@@ -103,7 +103,7 @@ public class NewSpotLightShadowFilterAction extends AbstractNewFilterWizardActio
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java

@@ -55,7 +55,7 @@ public final class BloomWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 2
jme3-core/src/com/jme3/gde/core/filters/impl/dlsf/DLSFWizardAction.java

@@ -1,7 +1,6 @@
 
 package com.jme3.gde.core.filters.impl.dlsf;
 
-import com.jme3.gde.core.filters.impl.bloom.BloomWizardPanel1;
 import java.awt.Component;
 import java.awt.Dialog;
 import java.awt.event.ActionEvent;
@@ -56,7 +55,7 @@ public final class DLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/plsf/PLSFWizardAction.java

@@ -54,7 +54,7 @@ public final class PLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/slsf/SLSFWizardAction.java

@@ -54,7 +54,7 @@ public final class SLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 2 - 3
jme3-core/src/com/jme3/gde/core/j2seproject/actions/UpgradeProjectWizardPanel1.java

@@ -17,7 +17,7 @@ public class UpgradeProjectWizardPanel1 implements WizardDescriptor.ValidatingPa
     /**
      * The reference to the project we work on.
      */
-    private Project context;
+    private final Project context;
     
     /**
      * The visual component that displays this panel. If you need to access the
@@ -70,8 +70,7 @@ public class UpgradeProjectWizardPanel1 implements WizardDescriptor.ValidatingPa
 
     @Override
     public void storeSettings(WizardDescriptor wiz) {
-        UpgradeProjectVisualPanel1 pnl = (UpgradeProjectVisualPanel1)component;
-        wiz.putProperty("flatUpgrade", pnl.flatUpgrade());
+        wiz.putProperty("flatUpgrade", component.flatUpgrade());
     }
 
     @Override

+ 11 - 2
jme3-core/src/com/jme3/gde/core/navigator/SceneNavigatorPanel.java

@@ -35,9 +35,10 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
     private Lookup.Result<SceneApplication> applicationResult;
     private final Result<AbstractSceneExplorerNode> nodeSelectionResult;
     //ExplorerNode selection listener, does nothing
-    private LookupListener listener = new LookupListener() {
+    private final LookupListener listener = new LookupListener() {
         private Node selectedNode;
 
+        @Override
         public void resultChanged(LookupEvent ev) {
             Collection collection = nodeSelectionResult.allInstances();
             for (Iterator it = collection.iterator(); it.hasNext();) {
@@ -75,22 +76,27 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         nodeSelectionResult = Utilities.actionsGlobalContext().lookupResult(AbstractSceneExplorerNode.class);
     }
 
+    @Override
     public Lookup getLookup() {
         return lookup;
     }
 
+    @Override
     public String getDisplayName() {
         return "SceneExplorer";
     }
 
+    @Override
     public String getDisplayHint() {
         return "Hint";
     }
 
+    @Override
     public JComponent getComponent() {
         return this;
     }
 
+    @Override
     public void panelActivated(Lookup lkp) {
         ExplorerUtils.activateActions(explorerManager, true);
         applicationResult = lkp.lookupResult(SceneApplication.class);
@@ -98,6 +104,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         nodeSelectionResult.addLookupListener(listener);
     }
 
+    @Override
     public void panelDeactivated() {
         ExplorerUtils.activateActions(explorerManager, false);
         applicationResult.removeLookupListener(this);
@@ -108,6 +115,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
     /**
      * result listener for application start
      */
+    @Override
     public void resultChanged(LookupEvent ev) {
 //        System.out.println("Select Thread: " + Thread.currentThread().getName());
         Collection collection = applicationResult.allInstances();
@@ -116,7 +124,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
             if (obj instanceof SceneApplication) {
                 SceneApplication app = (SceneApplication) obj;
                 if (app != null) {
-                    Node node = NodeUtility.createNode(((SceneApplication) app).getRootNode());
+                    Node node = NodeUtility.createNode(app.getRootNode());
                     explorerManager.setRootContext(node);
                     explorerManager.getRootContext().setDisplayName(node.getName());
                     return;
@@ -126,6 +134,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         explorerManager.setRootContext(Node.EMPTY);
     }
 
+    @Override
     public ExplorerManager getExplorerManager() {
         return explorerManager;
     }

+ 24 - 23
jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java

@@ -60,8 +60,6 @@ import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
@@ -358,7 +356,7 @@ public class FakeApplication extends SimpleApplication {
     public static class FakeAppStateManager extends AppStateManager {
 
         private AppStateManagerNode node;
-        ArrayList<AppState> states = new ArrayList<AppState>();
+        List<AppState> states = new ArrayList<>();
 
         public FakeAppStateManager(Application app) {
             super(app);
@@ -403,8 +401,7 @@ public class FakeApplication extends SimpleApplication {
     private ScheduledThreadPoolExecutor fakeAppThread = new ScheduledThreadPoolExecutor(1);
 
     public void removeCurrentStates() {
-        for (Iterator<AppState> it = new ArrayList<AppState>(appStateManager.getAddedStates()).iterator(); it.hasNext();) {
-            AppState appState = it.next();
+        for (AppState appState : new ArrayList<AppState>(appStateManager.getAddedStates())) {
             try {
                 appStateManager.detach(appState);
             } catch (Exception e) {
@@ -469,10 +466,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean runQueuedFake() {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 runQueuedTasks();
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -491,11 +491,14 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateFake(final float tpf) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 AudioContext.setAudioRenderer(audioRenderer);
                 appStateManager.update(tpf);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -516,10 +519,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean renderFake() {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 appStateManager.render(renderManager);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -540,10 +546,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateExternalLogicalState(final Node externalNode, final float tpf) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {               
                 externalNode.updateLogicalState(tpf);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -564,10 +573,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateExternalGeometricState(final Node externalNode) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 externalNode.updateGeometricState();
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -606,8 +618,7 @@ public class FakeApplication extends SimpleApplication {
     private void removeAllStates() {
         try {
             try {
-                for (Iterator<AppState> it = new ArrayList<AppState>(appStateManager.getAddedStates()).iterator(); it.hasNext();) {
-                    AppState appState = it.next();
+                for (AppState appState : new ArrayList<>(appStateManager.getAddedStates())) {
                     appStateManager.detach(appState);
                 }
             } catch (Exception e) {
@@ -631,9 +642,7 @@ public class FakeApplication extends SimpleApplication {
         while (!externalNode.getChildren().isEmpty()) {
             try {
                 externalNode.detachAllChildren();
-            } catch (Exception e) {
-                Exceptions.printStackTrace(e);
-            } catch (Error e) {
+            } catch (Exception | Error e) {
                 Exceptions.printStackTrace(e);
             }
         }
@@ -641,36 +650,28 @@ public class FakeApplication extends SimpleApplication {
         while (control != null) {
             try {
                 externalNode.removeControl(control);
-            } catch (Exception e) {
-                Exceptions.printStackTrace(e);
-            } catch (Error e) {
+            } catch (Exception | Error e) {
                 Exceptions.printStackTrace(e);
             }
             control = externalNode.getControl(Control.class);
         }
         Collection<String> keys = externalNode.getUserDataKeys();
         if (keys != null) {
-            for (Iterator<String> it = keys.iterator(); it.hasNext();) {
-                String string = it.next();
+            for (String string : keys) {
                 externalNode.setUserData(string, null);
             }
         }
         LightList llist = null;
         try {
             llist = externalNode.getLocalLightList();
-            for (Iterator<Light> it = llist.iterator(); it.hasNext();) {
-                Light light = it.next();
+            for (Light light : llist) {
                 try {
                     externalNode.removeLight(light);
-                } catch (Exception e) {
-                    Exceptions.printStackTrace(e);
-                } catch (Error e) {
+                } catch (Exception | Error e) {
                     Exceptions.printStackTrace(e);
                 }
             }
-        } catch (Exception e) {
-            Exceptions.printStackTrace(e);
-        } catch (Error e) {
+        } catch (Exception | Error e) {
             Exceptions.printStackTrace(e);
         }
     }

+ 1 - 1
jme3-dark-laf/nbproject/project.properties

@@ -1,5 +1,5 @@
 file.reference.nimrodlf.jar=release/modules/ext/nimrodlf.jar
-javac.source=1.7
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 1 - 1
jme3-desktop-executables/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-documentation/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 1 - 1
jme3-glsl-highlighter/nbproject/project.properties

@@ -1,3 +1,3 @@
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 project.license=jme license

+ 1 - 1
jme3-gui/nbproject/project.properties

@@ -9,7 +9,7 @@ file.reference.slf4j-simple-1.7.7.jar=release/modules/ext/slf4j-simple-1.7.7.jar
 file.reference.swingtonifty.jar=release/modules/ext/swingtonifty.jar
 file.reference.xsom-20110101-SNAPSHOT.jar=release/modules/ext/xsom-20110101-SNAPSHOT.jar
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 1 - 2
jme3-gui/src/com/jme3/gde/gui/NiftyGuiDataObject.java

@@ -114,8 +114,7 @@ public class NiftyGuiDataObject extends MultiDataObject {
                             return;
                         }
                     }
-                } catch (IOException ex) {
-                } catch (IllegalArgumentException ex) {
+                } catch (IOException | IllegalArgumentException ex) {
                 }
             }
             file = file.getParent();

+ 8 - 11
jme3-gui/src/com/jme3/gde/gui/swing/ConvertToNifty.java

@@ -2,25 +2,22 @@ package com.jme3.gde.gui.swing;
 
 import com.jme3.gde.core.assets.ProjectAssetManager;
 import com.jme3.gde.core.util.ProjectSelection;
-import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.Iterator;
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.java.project.JavaProjectConstants;
 import org.netbeans.api.project.Project;
-
 import org.netbeans.api.project.SourceGroup;
-
 import org.netbeans.api.project.Sources;
-import org.openide.awt.ActionRegistration;
+import org.openide.awt.ActionID;
 import org.openide.awt.ActionReference;
 import org.openide.awt.ActionReferences;
-import org.openide.awt.ActionID;
+import org.openide.awt.ActionRegistration;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 import org.openide.util.Exceptions;
@@ -42,6 +39,7 @@ public final class ConvertToNifty implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
         if (pm == null) {
@@ -60,13 +58,12 @@ public final class ConvertToNifty implements ActionListener {
 
         Sources sources = context.getLookup().lookup(Sources.class);
         if (sources != null) {
-            List<URL> urls = new LinkedList<URL>();
+            List<URL> urls = new ArrayList<>();
             SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
             for (SourceGroup sourceGroup : groups) {
                 try {
                     ClassPath path = ClassPath.getClassPath(sourceGroup.getRootFolder(), ClassPath.COMPILE);
-                    for (Iterator<ClassPath.Entry> it = path.entries().iterator(); it.hasNext();) {
-                        ClassPath.Entry entry = it.next();
+                    for (ClassPath.Entry entry : path.entries()) {
                         urls.add(entry.getURL());
                     }
                 } catch (Exception ex) {
@@ -83,7 +80,7 @@ public final class ConvertToNifty implements ActionListener {
                     clazzConfig.getDeclaredMethod("setOutputDir", clazzString).invoke(null, folder.getPath());
                     Object string = clazzString.getDeclaredConstructor(clazzString).newInstance(sourceGroup.getRootFolder().getPath());//context.getProjectDirectory().getFileObject("build/classes").getPath());
                     Object file = clazzFile.getDeclaredConstructor(clazzString).newInstance(string);
-                    Object factory = clazzFactory.newInstance();
+                    Object factory = clazzFactory.getDeclaredConstructor().newInstance();
                     clazzFactory.getMethod("loadComponents", clazzFile).invoke(factory, file);
                 } catch (Exception ex) {
                     Exceptions.printStackTrace(ex);

+ 15 - 27
jme3-gui/src/com/jme3/gde/gui/view/NiftyGuiVisualElement.java

@@ -78,10 +78,10 @@ import org.xml.sax.SAXException;
 @SuppressWarnings({"unchecked", "rawtypes"})
 public final class NiftyGuiVisualElement extends JPanel implements MultiViewElement , ExplorerManager.Provider,Observer, PropertyChangeListener {
     private static final Logger logger = Logger.getLogger(NiftyGuiVisualElement.class.getName());
-    private NiftyGuiDataObject obj;
-    private JToolBar toolbar = new JToolBar();
+    private final NiftyGuiDataObject obj;
+    private final JToolBar toolbar = new JToolBar();
     private transient MultiViewElementCallback callback;
-    private GUIEditor editor;
+    private final GUIEditor editor;
     private final Nifty nifty;
     private final J2DNiftyView view;
     private final JComboBox layers = new JComboBox();
@@ -89,13 +89,14 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
     private final UndoRedo.Manager undoSupport;
     private int guiID;
      private final InstanceContent content = new InstanceContent();
-     private Lookup lookup;
-     private AssetManager assetManager;
+     private final Lookup lookup;
+     private final AssetManager assetManager;
 
     protected class ResourceLocationJmp implements ResourceLocation {
 
+        @Override
         public InputStream getResourceAsStream(String path) {
-            AssetKey<Object> key = new AssetKey<Object>(path);
+            AssetKey<Object> key = new AssetKey<>(path);
             AssetInfo info = assetManager.locateAsset(key);
             if (info != null){
                 return info.openStream();
@@ -104,12 +105,13 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             }
         }
 
+        @Override
         public URL getResource(String path) {
             throw new UnsupportedOperationException();
         }
     }
     
-    private ResourceLocation resourceLocation = new ResourceLocationJmp();
+    private final ResourceLocation resourceLocation = new ResourceLocationJmp();
     
         
     public NiftyGuiVisualElement(Lookup lkp) {
@@ -151,6 +153,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         JComboBox comboBox = new JComboBox(new String[]{"640x480", "480x800", "800x480", "800x600", "1024x768", "1280x720"});
         comboBox.addItemListener(new ItemListener() {
 
+            @Override
             public void itemStateChanged(ItemEvent e) {
                 String string = (String) e.getItem();
                 if ("640x480".equals(string)) {
@@ -175,6 +178,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         toolbar.add(new JLabel("Current Layer"));
         layers.addItemListener(new ItemListener() {
 
+            @Override
             public void itemStateChanged(ItemEvent e) {
                 GLayer item = (GLayer) e.getItem();
                 editor.selectElement(item);
@@ -254,12 +258,8 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         String path = this.obj.getPrimaryFile().getPath();
         try {
             this.editor.saveGui(path);
-        } catch (FileNotFoundException ex) {
+        } catch (FileNotFoundException | JAXBException | NullPointerException ex) {
             Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (NullPointerException ex){
-             Exceptions.printStackTrace(ex);
         }
     }
 
@@ -349,22 +349,14 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             Collection<GLayer> layers1 = this.editor.getGui().getLayers();
             guiID = this.editor.getGui().getGUIid();
             this.editor.getGui().addObserver(this);
-            DefaultComboBoxModel<GLayer> model = new DefaultComboBoxModel<GLayer>(layers1.toArray(new GLayer[0]));
+            DefaultComboBoxModel<GLayer> model = new DefaultComboBoxModel<>(layers1.toArray(new GLayer[0]));
             layers.setModel(model);
             layers.setSelectedItem(this.editor.getCurrentLayer());
             
             handle.finish();
         } catch (ParserConfigurationException ex) {
             Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ClassNotFoundException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (IOException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (NoProductException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (SAXException ex) {
+        } catch (JAXBException | ClassNotFoundException | IOException | NoProductException | SAXException ex) {
             Exceptions.printStackTrace(ex);
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);
@@ -402,11 +394,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             NiftyGuiVisualElement.this.content.remove(this);
           
             
-        } catch (FileNotFoundException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ClassNotFoundException ex) {
+        } catch (FileNotFoundException | JAXBException | ClassNotFoundException ex) {
             Exceptions.printStackTrace(ex);
         }
     }

+ 1 - 1
jme3-ios/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 # avian compile locations (Now in downloads/)
 #avian.jdk.path=/Users/normenhansen/Documents/Code-Import/avian-ios/openjdk-1.7.0-u40-unofficial-macosx-x86_64-image

+ 2 - 1
jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.java

@@ -50,7 +50,7 @@ import org.openide.util.HelpCtx;
  */
 public class IosCustomizerPanel extends javax.swing.JPanel implements ActionListener {
 
-    private ProjectExtensionProperties properties;
+    private final ProjectExtensionProperties properties;
 
     /**
      * Creates new form LwjglAppletCustomizerPanel
@@ -94,6 +94,7 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
         }
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         saveProperties();
     }

+ 1 - 1
jme3-lwjgl-applet/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-materialeditor/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java

@@ -51,7 +51,7 @@ import javax.swing.ListCellRenderer;
 public class MatDefEditorToolBar extends JPanel {
 
     private MatDefEditorlElement parent;
-    private final DefaultComboBoxModel<TechniqueBlock> comboModel = new DefaultComboBoxModel<TechniqueBlock>();
+    private final DefaultComboBoxModel<TechniqueBlock> comboModel = new DefaultComboBoxModel<>();
     private final static Logger logger = Logger.getLogger(MatDefEditorToolBar.class.getName());
     
     /**

+ 1 - 1
jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java

@@ -81,7 +81,7 @@ public class ShaderEditPanel extends JPanel {
 
             @Override
             public void keyPressed(KeyEvent e) {
-                if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
+                if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0)) {
                     saveCurrent();
                 }
             }

+ 37 - 40
jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java

@@ -52,12 +52,12 @@ public class EditableMaterialFile {
     private static final Logger logger = Logger.getLogger(EditableMaterialFile.class.getName());
     private String name;
     private String matDefName;
-    private FileObject material;
+    private final FileObject material;
     private FileObject matDef;
-    private Map<String, MaterialProperty> materialParameters = new LinkedHashMap<String, MaterialProperty>();
-    private Map<String, MaterialProperty> additionalRenderStates = new HashMap<String, MaterialProperty>();
-    private List<String> matDefEntries = new ArrayList<String>();
-    private ProjectAssetManager manager;
+    private final Map<String, MaterialProperty> materialParameters = new LinkedHashMap<>();
+    private final Map<String, MaterialProperty> additionalRenderStates = new HashMap<>();
+    private final List<String> matDefEntries = new ArrayList<>();
+    private final ProjectAssetManager manager;
     private FileSystem fs;
     public static final String[] variableTypes = new String[]{"Int", "Boolean", "Float", "Vector2", "Vector3", "Vector4", "Color", "Texture2D", "Texture3D", "TextureArray", "TextureBuffer", "TextureCubeMap"};
 
@@ -106,11 +106,11 @@ public class EditableMaterialFile {
                     states = true;
                 }
                 //up a level
-                if (line.indexOf("{") != -1) {
+                if (line.contains("{")) {
                     level++;
                 }
                 //down a level, stop processing parameters/states
-                if (line.indexOf("}") != -1) {
+                if (line.contains("}")) {
                     level--;
                     if (params) {
                         params = false;
@@ -194,17 +194,17 @@ public class EditableMaterialFile {
             try {
                 fs = FileUtil.createMemoryFileSystem();
                 matDef = fs.getRoot().createData(name, "j3md");
-                OutputStream out = matDef.getOutputStream();
-                InputStream in = manager.getResourceAsStream(getMatDefName());
-                if (in != null) {
-                    int input = in.read();
-                    while (input != -1) {
-                        out.write(input);
-                        input = in.read();
+                try (OutputStream out = matDef.getOutputStream()) {
+                    InputStream in = manager.getResourceAsStream(getMatDefName());
+                    if (in != null) {
+                        int input = in.read();
+                        while (input != -1) {
+                            out.write(input);
+                            input = in.read();
+                        }
+                        in.close();
                     }
-                    in.close();
                 }
-                out.close();
             } catch (IOException ex) {
                 Exceptions.printStackTrace(ex);
             }
@@ -229,10 +229,10 @@ public class EditableMaterialFile {
                     if (defLine.startsWith("MaterialParameters ") || defLine.startsWith("MaterialParameters\t") || defLine.startsWith("MaterialParameters{") && level == 1) {
                         params = true;
                     }
-                    if (defLine.indexOf("{") != -1) {
+                    if (defLine.contains("{")) {
                         level++;
                     }
-                    if (defLine.indexOf("}") != -1) {
+                    if (defLine.contains("}")) {
                         level--;
                         if (params) {
                             params = false;
@@ -285,8 +285,8 @@ public class EditableMaterialFile {
         try {
             List<String> matLines = material.asLines();
             StringWriter out = new StringWriter();
-            List<String> setValues = new LinkedList<String>();
-            List<String> setStates = new LinkedList<String>();
+            List<String> setValues = new LinkedList<>();
+            List<String> setStates = new LinkedList<>();
             //goes through the lines of the material file and replaces the values it finds
             for (String line : matLines) {
                 String newLine = line;
@@ -294,7 +294,7 @@ public class EditableMaterialFile {
                 //write material header
                 if (line.startsWith("Material ") || line.startsWith("Material\t") && level == 0) {
                     String suffix = "";
-                    if (line.indexOf("{") > -1) {
+                    if (line.contains("{")) {
                         suffix = "{";
                     }
                     newLine = "Material " + getName() + " : " + matDefName + " " + suffix;
@@ -309,16 +309,15 @@ public class EditableMaterialFile {
                     addedstates = true;
                 }
                 //up a level
-                if (line.indexOf("{") != -1) {
+                if (line.contains("{")) {
                     level++;
                 }
                 //down a level, stop processing states and check if all parameters and states have been written
-                if (line.indexOf("}") != -1) {
+                if (line.contains("}")) {
                     level--;
                     //find and write parameters we did not replace yet at end of parameters section
                     if (params) {
-                        for (Iterator<Map.Entry<String, MaterialProperty>> it = materialParameters.entrySet().iterator(); it.hasNext();) {
-                            Map.Entry<String, MaterialProperty> entry = it.next();
+                        for (Map.Entry<String, MaterialProperty> entry : materialParameters.entrySet()) {
                             if (!setValues.contains(entry.getKey()) && matDefEntries.contains(entry.getKey())) {
                                 MaterialProperty prop = entry.getValue();
                                 if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -331,8 +330,7 @@ public class EditableMaterialFile {
                     }
                     //find and write states we did not replace yet at end of states section
                     if (states) {
-                        for (Iterator<Map.Entry<String, MaterialProperty>> it = additionalRenderStates.entrySet().iterator(); it.hasNext();) {
-                            Map.Entry<String, MaterialProperty> entry = it.next();
+                        for (Map.Entry<String, MaterialProperty> entry : additionalRenderStates.entrySet()) {
                             if (!setStates.contains(entry.getKey())) {
                                 MaterialProperty prop = entry.getValue();
                                 if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -348,8 +346,7 @@ public class EditableMaterialFile {
                         if (!addedstates) {
                             String myLine = "    AdditionalRenderState {\n";
                             out.write(myLine, 0, myLine.length());
-                            for (Iterator<Map.Entry<String, MaterialProperty>> it = additionalRenderStates.entrySet().iterator(); it.hasNext();) {
-                                Map.Entry<String, MaterialProperty> entry = it.next();
+                            for (Map.Entry<String, MaterialProperty> entry : additionalRenderStates.entrySet()) {
                                 if (!setStates.contains(entry.getKey())) {
                                     MaterialProperty prop = entry.getValue();
                                     if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -420,12 +417,12 @@ public class EditableMaterialFile {
     }
 
     private void createBaseMaterialFile() throws IOException {
-        OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream());
-        out.write("Material MyMaterial : " + matDefName + " {\n");
-        out.write("    MaterialParameters {\n");
-        out.write("    }\n");
-        out.write("}\n");
-        out.close();
+        try (OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream())) {
+            out.write("Material MyMaterial : " + matDefName + " {\n");
+            out.write("    MaterialParameters {\n");
+            out.write("    }\n");
+            out.write("}\n");
+        }
     }
 
  
@@ -453,15 +450,16 @@ public class EditableMaterialFile {
     }
 
     public void setAsText(String text) throws IOException {
-        OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream());
-        out.write(text, 0, text.length());
-        out.close();
+        try (OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream())) {
+            out.write(text, 0, text.length());
+        }
     }
 
     /**
      * Creates the data from a material
      *
      * @param mat
+     * @throws java.io.IOException
      */
     public void setAsMaterial(Material mat) throws IOException {
         assert (mat.getMaterialDef().getAssetName() != null);
@@ -491,8 +489,7 @@ public class EditableMaterialFile {
      */
     private void checkPackedTextureProps(Material mat) {
         Collection<MatParam> params = mat.getParams();
-        for (Iterator<MatParam> it = new ArrayList<MatParam>(params).iterator(); it.hasNext();) {
-            MatParam param = it.next();
+        for (MatParam param : new ArrayList<>(params)) {
             MaterialProperty prop = new MaterialProperty(param);
             if (prop.getValue() == null) {
                 switch (param.getVarType()) {

+ 1 - 0
jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java

@@ -308,6 +308,7 @@ private void aLabelFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_a
     protected void readProperty() {
         java.awt.EventQueue.invokeLater(new Runnable() {
             
+            @Override
             public void run() {
                 jLabel1.setText(property.getName());
                 jLabel1.setToolTipText(property.getName());                

+ 26 - 22
jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java

@@ -365,7 +365,7 @@ public class NVCompress extends javax.swing.JFrame {
     }// </editor-fold>//GEN-END:initComponents
 
     private String[] computeCompressParameters(){
-        List<String> params = new ArrayList<String>();
+        List<String> params = new ArrayList<>();
 
         if (!chkCuda.isSelected())
             params.add("-nocuda");
@@ -453,16 +453,17 @@ public class NVCompress extends javax.swing.JFrame {
         if (manager == null)
             manager = JmeSystem.newAssetManager();
 
-        manager.registerLocator(input.getParent().toString(),
+        manager.registerLocator(input.getParent(),
                                 FileLocator.class);
 
         String format = (String) cmbCompressType.getSelectedItem();
         if (format.equals("PNG-RGBE")){
             HDRLoader loader = new HDRLoader(true);
             try{
-                FileInputStream in = new FileInputStream(input);
-                Image image = loader.load(in, false);
-                in.close();
+                Image image;
+                try (FileInputStream in = new FileInputStream(input)) {
+                    image = loader.load(in, false);
+                }
 
                 BufferedImage rgbeImage = ImageToAwt.convert(image, false, true, 0);
                 if (output == null){
@@ -500,22 +501,22 @@ public class NVCompress extends javax.swing.JFrame {
             ProcessBuilder builder = new ProcessBuilder(args);
             updateWork(statusStr, 0);
             p = builder.start();
-            BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String ln;
-            while ((ln = r.readLine()) != null){
-                if (Thread.interrupted())
-                    throw new InterruptedException();
-                
-                if (ln.endsWith("%")){
-                    // show status in bar
-                    int percent = Integer.parseInt(ln.substring(0, ln.length()-1));
-                    updateWork(statusStr, percent);
-                }else if (ln.startsWith("time taken")){
-                    ln = ln.substring(12, ln.length()-7).trim();
-                    System.out.println("Time Taken: "+ln+" seconds");
+            try (BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()))) {
+                String ln;
+                while ((ln = r.readLine()) != null){
+                    if (Thread.interrupted())
+                        throw new InterruptedException();
+                    
+                    if (ln.endsWith("%")){
+                        // show status in bar
+                        int percent = Integer.parseInt(ln.substring(0, ln.length()-1));
+                        updateWork(statusStr, percent);
+                    }else if (ln.startsWith("time taken")){
+                        ln = ln.substring(12, ln.length()-7).trim();
+                        System.out.println("Time Taken: "+ln+" seconds");
+                    }
                 }
             }
-            r.close();
             int error = p.waitFor();
             if (error != 0){
                 System.out.println("Error Code: " + error);
@@ -586,7 +587,7 @@ public class NVCompress extends javax.swing.JFrame {
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("NVCompressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -618,7 +619,7 @@ public class NVCompress extends javax.swing.JFrame {
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("J3Compressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -650,7 +651,7 @@ public class NVCompress extends javax.swing.JFrame {
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("NVDecompressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -866,9 +867,12 @@ public class NVCompress extends javax.swing.JFrame {
         }
 
         java.awt.EventQueue.invokeLater(new Runnable() {
+            
+            @Override
             public void run() {
                 new NVCompress().setVisible(true);
             }
+            
         });
     }
 

+ 1 - 1
jme3-model-importer/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 11 - 12
jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java

@@ -22,16 +22,15 @@ import com.jme3.shader.VarType;
 import com.jme3.texture.Texture;
 import java.awt.Component;
 import java.awt.Dialog;
-import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.logging.Logger;
 import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.JComponent;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.api.project.Project;
@@ -73,6 +72,7 @@ public final class ImportModel implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         Project context = OpenProjects.getDefault().getMainProject();
         if (context == null) {
@@ -95,6 +95,8 @@ public final class ImportModel implements ActionListener {
         boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION;
         if (!cancelled) {
             new Thread(new Runnable() {
+                
+                @Override
                 public void run() {
                     ProgressHandle handle = ProgressHandle.createHandle("Importing Model..");
                     handle.start();
@@ -105,7 +107,7 @@ public final class ImportModel implements ActionListener {
                     }
                     handle.finish();
                 }
-            }).start();
+            }, "ModelImporter").start();
         }
     }
 
@@ -123,11 +125,10 @@ public final class ImportModel implements ActionListener {
             throw new IllegalStateException("Cannot find project AssetManager!");
         }
 
-        List<FileObject> deleteList = new LinkedList<FileObject>();
+        List<FileObject> deleteList = new LinkedList<>();
         int idx = 0;
         //go through list and copy assets to project
-        for (Iterator<FileObject> it = assetList.iterator(); it.hasNext();) {
-            FileObject source = it.next();
+        for (FileObject source : assetList) {
             AssetKey key = assetKeys.get(idx);
             UberAssetInfo info = UberAssetLocator.getInfo(key);
             if (info != null) {
@@ -228,8 +229,7 @@ public final class ImportModel implements ActionListener {
         }
         //delete files if not keeping original
         if (!keepFiles) {
-            for (Iterator<FileObject> it = deleteList.iterator(); it.hasNext();) {
-                FileObject fileObject = it.next();
+            for (FileObject fileObject : deleteList) {
                 try {
                     fileObject.delete();
                 } catch (IOException ex) {
@@ -250,8 +250,7 @@ public final class ImportModel implements ActionListener {
                 Material mat = geom.getMaterial();
                 if (mat != null) {
                     Collection<MatParam> params = mat.getParams();
-                    for (Iterator<MatParam> it = params.iterator(); it.hasNext();) {
-                        MatParam matParam = it.next();
+                    for (MatParam matParam : params) {
                         VarType paramType = matParam.getVarType();
                         String paramName = matParam.getName();
                         switch (paramType) {
@@ -316,7 +315,7 @@ public final class ImportModel implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-navmesh-gen/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint:-serial
 license.file=../license-jme.txt
 nbm.homepage=http://www.jmonkeyengine.org

+ 5 - 2
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshAction.java

@@ -26,6 +26,7 @@ public class NavMeshAction implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final ProjectAssetManager manager = context.getLookup().lookup(ProjectAssetManager.class);
         if (manager == null) {
@@ -33,6 +34,7 @@ public class NavMeshAction implements ActionListener {
         }
         Runnable call = new Runnable() {
 
+            @Override
             public void run() {
                 ProgressHandle progressHandle = ProgressHandle.createHandle("Opening in Nav Mesh Editor");
                 progressHandle.start();
@@ -43,8 +45,9 @@ public class NavMeshAction implements ActionListener {
                 if(asset!=null){
                     java.awt.EventQueue.invokeLater(new Runnable() {
 
+                        @Override
                         public void run() {
-                            manager.getManager().clearCache();
+                            manager.clearCache();
                             NavMeshTopComponent composer = NavMeshTopComponent.findInstance();
                             composer.openScene(asset, context, manager);
                         }
@@ -59,7 +62,7 @@ public class NavMeshAction implements ActionListener {
                 progressHandle.finish();
             }
         };
-        new Thread(call).start();
+        new Thread(call, "NavMeshLoader").start();
     }
     
 }

+ 5 - 4
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshGenerator.java

@@ -8,7 +8,6 @@ import com.jme3.export.Savable;
 import com.jme3.math.FastMath;
 import com.jme3.math.Vector3f;
 import com.jme3.scene.Mesh;
-import com.jme3.scene.Node;
 import com.jme3.scene.VertexBuffer.Type;
 import com.jme3.scene.mesh.IndexBuffer;
 import com.jme3.terrain.Terrain;
@@ -468,6 +467,7 @@ public class NavMeshGenerator implements Savable {
         this.timeout = timeout;
     }
     
+    @Override
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule oc = ex.getCapsule(this);
         oc.write(cellSize, "cellSize", 1f);
@@ -488,6 +488,7 @@ public class NavMeshGenerator implements Savable {
         oc.write(contourMaxDeviation, "contourMaxDeviation", 25);
     }
 
+    @Override
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);
         cellSize = ic.readFloat("cellSize", 1f);
@@ -510,9 +511,9 @@ public class NavMeshGenerator implements Savable {
 
     private class MeshBuildRunnable implements Runnable {
 
-        private float[] positions;
-        private int[] indices;
-        private IntermediateData intermediateData;
+        private final float[] positions;
+        private final int[] indices;
+        private final IntermediateData intermediateData;
         private TriangleMesh triMesh;
 
         public MeshBuildRunnable(float[] positions, int[] indices, IntermediateData intermediateData) {

+ 1 - 1
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshToolController.java

@@ -22,7 +22,7 @@ public class NavMeshToolController extends SceneToolController {
     
     private NavMeshController editorController;
     private NavMeshCameraController cameraController;
-    private JmeSpatial jmeRootNode;
+    private final JmeSpatial jmeRootNode;
     private Geometry navGeom;
     private Material navMaterial;
     

+ 12 - 9
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshTopComponent.java

@@ -20,15 +20,16 @@ import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 import java.util.Collection;
+import java.util.logging.Level;
 import java.util.logging.Logger;
-import org.openide.util.LookupEvent;
-import org.openide.util.NbBundle;
-import org.openide.windows.TopComponent;
 import org.netbeans.api.settings.ConvertAsProperties;
 import org.openide.util.ImageUtilities;
 import org.openide.util.Lookup.Result;
+import org.openide.util.LookupEvent;
 import org.openide.util.LookupListener;
+import org.openide.util.NbBundle;
 import org.openide.util.Utilities;
+import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
 
@@ -46,6 +47,7 @@ import org.openide.windows.WindowManager;
 public final class NavMeshTopComponent extends TopComponent implements SceneListener, LookupListener {
     
     private static NavMeshTopComponent instance;
+    private static final Logger LOGGER = Logger.getLogger(NavMeshTopComponent.class.getName());
     static final String ICON_PATH = "com/sploreg/tritium/editor/navmesh/logo.png";
     private static final String PREFERRED_ID = "NavMeshTopComponent";
     private SceneRequest currentRequest;
@@ -437,14 +439,14 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
     public static synchronized NavMeshTopComponent findInstance() {
         TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
         if (win == null) {
-            Logger.getLogger(NavMeshTopComponent.class.getName()).warning(
+            LOGGER.warning(
                     "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
             return getDefault();
         }
         if (win instanceof NavMeshTopComponent) {
             return (NavMeshTopComponent) win;
         }
-        Logger.getLogger(NavMeshTopComponent.class.getName()).warning(
+        LOGGER.warning(
                 "There seem to be multiple components with the '" + PREFERRED_ID
                 + "' ID. That is a potential source of errors and unexpected behavior.");
         return getDefault();
@@ -469,7 +471,7 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
 
         addSaveNode(jmeNode);
 
-        Logger.getLogger(NavMeshTopComponent.class.getName()).finer("NavMesh openScene " + file.getName());
+        LOGGER.log(Level.FINER, "NavMesh openScene {0}", file.getName());
 
         if (editorController != null) {
             editorController.cleanup();
@@ -489,7 +491,7 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
     /*@Override
     public void sceneRequested(SceneRequest request) {
         if (request.equals(currentRequest)) {
-            Logger.getLogger(NavMeshTopComponent.class.getName()).finer("Terrain sceneRequested " + request.getWindowTitle());
+            LOGGER.finer("Terrain sceneRequested " + request.getWindowTitle());
 
             setSceneInfo(currentRequest.getJmeNode(), true);
             
@@ -546,6 +548,7 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
         final NavMeshTopComponent inst = this;
         java.awt.EventQueue.invokeLater(new Runnable() {
 
+            @Override
             public void run() {
                 if (jmeNode != null) {
                 } else {
@@ -641,7 +644,7 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
     @Override
     public void sceneOpened(SceneRequest request) {
         if (request.equals(currentRequest)) {
-            Logger.getLogger(NavMeshTopComponent.class.getName()).finer("Terrain sceneRequested " + request.getWindowTitle());
+            LOGGER.log(Level.FINER, "Terrain sceneRequested {0}", request.getWindowTitle());
 
             setSceneInfo(currentRequest.getJmeNode(), true);
             
@@ -655,7 +658,7 @@ private void traversableAreaBorderSizeFieldActionPerformed(java.awt.event.Action
             //for (int i=0; i<textureTable.getModel().getRowCount(); i++)
             //    ((TextureTableModel)textureTable.getModel()).removeRow(i);
 
-            toolController = new NavMeshToolController(currentRequest.getToolNode(), currentRequest.getManager().getManager(), request.getJmeNode());
+            toolController = new NavMeshToolController(currentRequest.getToolNode(), currentRequest.getManager(), request.getJmeNode());
             
             cameraController = new NavMeshCameraController(SceneApplication.getApplication().getCamera());
             cameraController.setMaster(this);

+ 3 - 5
jme3-navmesh-gen/src/com/jme3/gde/nmgen/wizard/NewNavMeshWizardAction.java

@@ -19,7 +19,6 @@ import com.jme3.terrain.Terrain;
 import java.awt.Component;
 import java.awt.Dialog;
 import java.text.MessageFormat;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import javax.swing.JComponent;
@@ -79,7 +78,7 @@ public final class NewNavMeshWizardAction extends AbstractNewSpatialWizardAction
 
             Mesh mesh = new Mesh();
 
-            GeometryBatchFactory.mergeGeometries(findGeometries(rootNode, new LinkedList<Geometry>(), generator, rootNode), mesh);
+            GeometryBatchFactory.mergeGeometries(findGeometries(rootNode, new LinkedList<>(), generator, rootNode), mesh);
             Mesh optiMesh = generator.optimize(mesh);
             if(optiMesh == null) return null;
 
@@ -111,8 +110,7 @@ public final class NewNavMeshWizardAction extends AbstractNewSpatialWizardAction
             return geoms;
         }
         
-        for (Iterator<Spatial> it = node.getChildren().iterator(); it.hasNext();) {
-            Spatial spatial = it.next();
+        for (Spatial spatial : node.getChildren()) {
             if (spatial instanceof Geometry) {
                 geoms.add((Geometry) spatial);
             } else if (spatial instanceof Node) {
@@ -142,7 +140,7 @@ public final class NewNavMeshWizardAction extends AbstractNewSpatialWizardAction
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-obfuscate/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://proguard.sourceforge.net/

+ 5 - 3
jme3-ogretools/src/com/jme3/gde/ogretools/blender/InstallBlenderExporterPanel.java

@@ -17,7 +17,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import org.openide.filesystems.FileChooserBuilder;
 import org.openide.util.Exceptions;
-import org.openide.util.Utilities;
 import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.prefs.Preferences;
@@ -35,12 +34,15 @@ import org.openide.NotifyDescriptor.Confirmation;
 @SuppressWarnings({"unchecked", "rawtypes"})
 public class InstallBlenderExporterPanel extends javax.swing.JDialog {
 
-    /** Creates new form InstallBlenderExporterPanel */
+    /** Creates new form InstallBlenderExporterPanel
+     * @param parent
+     * @param modal */
     public InstallBlenderExporterPanel(java.awt.Frame parent, boolean modal) {
         super(parent, modal);
         initComponents();
         java.awt.EventQueue.invokeLater(new Runnable() {
 
+            @Override
             public void run() {
                 jTextField1.setText(findBlenderFolder());
             }
@@ -210,7 +212,7 @@ public class InstallBlenderExporterPanel extends javax.swing.JDialog {
             // Should be: HKEY_CURRENT_USER\Volatile Environment, key NWUSERNAME
             final String subKey = "Volatile Environment";
 
-            Object[] objects1 = {toByteArray(subKey), new Integer(KEY_READ), new Integer(KEY_READ)};
+            Object[] objects1 = {toByteArray(subKey), KEY_READ, KEY_READ};
             Integer hSettings = (Integer) mOpenKey.invoke(userRoot,
                     objects1);
 

+ 1 - 1
jme3-ogrexml/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-project-baselibs/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-project-libraries/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-project-testdata/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-scenecomposer/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 2
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/gizmo/light/LightProbeGizmo.java

@@ -47,7 +47,6 @@ import com.jme3.math.Vector3f;
  */
 public class LightProbeGizmo extends NodeCallback {
 
-    private final Vector3f lastPos = new Vector3f();
     private final LightProbe lightProbe;
     private final JmeLightProbe jmeProbe;    
 
@@ -98,7 +97,7 @@ public class LightProbeGizmo extends NodeCallback {
     /**
      * Handles the SceneComposers Rotate "Requests".
      * Essentially this is called when setLocalRotation is invoked on the Gizmo.
-     * We then need to ensure that the Propertries update and that the light
+     * We then need to ensure that the Properties update and that the light
      * itself updates (since the SceneComposer actually works with our Gizmos).
      * 
      * @param oldRotation The Rotation as it was before

+ 2 - 4
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java

@@ -5,12 +5,10 @@
  */
 package com.jme3.gde.scenecomposer.tools.shortcuts;
 
-import com.jme3.gde.scenecomposer.SceneEditTool;
 import com.jme3.input.KeyInput;
 import com.jme3.input.event.KeyInputEvent;
 import com.jme3.math.Vector3f;
 import java.util.ArrayList;
-import org.openide.util.Lookup;
 import org.openide.util.lookup.ServiceProvider;
 
 /**
@@ -21,7 +19,7 @@ import org.openide.util.lookup.ServiceProvider;
 public class ShortcutManager {
 
     private ShortcutTool currentShortcut;
-    private ArrayList<ShortcutTool> shortcutList;
+    private final ArrayList<ShortcutTool> shortcutList;
     private boolean ctrlDown = false;
     private boolean shiftDown = false;
     private boolean altDown = false;
@@ -321,7 +319,7 @@ public class ShortcutManager {
         if (numberBuilder.length() == 0) {
             return 0;
         } else {
-            return new Float(numberBuilder.toString());
+            return Float.parseFloat(numberBuilder.toString());
         }
     }
 

+ 1 - 1
jme3-templates/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 17 - 14
jme3-templates/src/com/jme3/gde/templates/basic/BasicGameWizardIterator.java

@@ -86,8 +86,9 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
                 };
     }
 
+    @Override
     public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
-        Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
+        Set<FileObject> resultSet = new LinkedHashSet<>();
         File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
         dirF.mkdirs();
 
@@ -114,6 +115,7 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
         return resultSet;
     }
 
+    @Override
     public void initialize(WizardDescriptor wiz) {
         this.wiz = wiz;
         index = 0;
@@ -132,13 +134,14 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
                 JComponent jc = (JComponent) c;
                 // Step #.
                 // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                 // Step name (actually the whole list for reference).
                 jc.putClientProperty("WizardPanel_contentData", steps);
             }
         }
     }
 
+    @Override
     public void uninitialize(WizardDescriptor wiz) {
         this.wiz.putProperty("projdir", null);
         this.wiz.putProperty("name", null);
@@ -146,19 +149,23 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
         panels = null;
     }
 
+    @Override
     public String name() {
         return MessageFormat.format("{0} of {1}",
-                new Object[]{new Integer(index + 1), new Integer(panels.length)});
+                new Object[]{index + 1, panels.length});
     }
 
+    @Override
     public boolean hasNext() {
         return index < panels.length - 1;
     }
 
+    @Override
     public boolean hasPrevious() {
         return index > 0;
     }
 
+    @Override
     public void nextPanel() {
         if (!hasNext()) {
             throw new NoSuchElementException();
@@ -166,6 +173,7 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
         index++;
     }
 
+    @Override
     public void previousPanel() {
         if (!hasPrevious()) {
             throw new NoSuchElementException();
@@ -173,19 +181,22 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
         index--;
     }
 
+    @Override
     public WizardDescriptor.Panel current() {
         return panels[index];
     }
 
     // If nothing unusual changes in the middle of the wizard, simply:
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
 
     private static void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
-        try {
+        try (source) {
             ZipInputStream str = new ZipInputStream(source);
             ZipEntry entry;
             while ((entry = str.getNextEntry()) != null) {
@@ -201,17 +212,12 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
                     }
                 }
             }
-        } finally {
-            source.close();
         }
     }
 
     private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
-        OutputStream out = fo.getOutputStream();
-        try {
+        try (OutputStream out = fo.getOutputStream()) {
             FileUtil.copy(str, out);
-        } finally {
-            out.close();
         }
     }
 
@@ -233,11 +239,8 @@ public class BasicGameWizardIterator implements WizardDescriptor./*Progress*/Ins
                     }
                 }
             }
-            OutputStream out = fo.getOutputStream();
-            try {
+            try (OutputStream out = fo.getOutputStream()) {
                 XMLUtil.write(doc, out, "UTF-8");
-            } finally {
-                out.close();
             }
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);

+ 1 - 1
jme3-terrain-editor/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/AddTerrainAction.java

@@ -219,7 +219,7 @@ public class AddTerrainAction extends AbstractNewSpatialWizardAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainVisualPanel2.java

@@ -436,7 +436,7 @@ public final class CreateTerrainVisualPanel2 extends JPanel {
     
     public float getHeightScale() {
         try {
-            Float scale = new Float(heightScale.getText());
+            Float scale = Float.parseFloat(heightScale.getText());
             return Math.abs(scale);
         } catch (NumberFormatException e) {
             return 1;

+ 4 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardAction.java

@@ -52,6 +52,7 @@ public final class CreateTerrainWizardAction extends CallableSystemAction {
         this.controller = controller;
     }
 
+    @Override
     public void performAction() {
         WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -90,7 +91,7 @@ public final class CreateTerrainWizardAction extends CallableSystemAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -105,6 +106,7 @@ public final class CreateTerrainWizardAction extends CallableSystemAction {
         return panels;
     }
 
+    @Override
     public String getName() {
         return "Terrain Wizard";
     }
@@ -114,6 +116,7 @@ public final class CreateTerrainWizardAction extends CallableSystemAction {
         return null;
     }
 
+    @Override
     public HelpCtx getHelpCtx() {
         return HelpCtx.DEFAULT_HELP;
     }

+ 9 - 2
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel1.java

@@ -49,6 +49,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
     // is kept separate. This can be more efficient: if the wizard is created
     // but never displayed, or not all panels are displayed, it is better to
     // create only those which really need to be visible.
+    @Override
     public Component getComponent() {
         if (component == null) {
             component = new CreateTerrainVisualPanel1();
@@ -56,6 +57,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         return component;
     }
 
+    @Override
     public HelpCtx getHelp() {
         // Show no Help button for this panel:
         return HelpCtx.DEFAULT_HELP;
@@ -63,6 +65,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         // return new HelpCtx(SampleWizardPanel1.class);
     }
 
+    @Override
     public boolean isValid() {
         // If it is always OK to press Next or Finish, then:
         return true;
@@ -73,9 +76,11 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         // and uncomment the complicated stuff below.
     }
 
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
     /*
@@ -106,14 +111,16 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
+    @Override
     public void readSettings(Object settings) {
     }
 
+    @Override
     public void storeSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         CreateTerrainVisualPanel1 comp = (CreateTerrainVisualPanel1) getComponent();
-        int totalSize = new Integer(comp.getTotalSizeField().getText()) + 1;
-        int patchSize = new Integer(comp.getPatchSizeField().getText()) + 1;
+        int totalSize = Integer.parseInt(comp.getTotalSizeField().getText()) + 1;
+        int patchSize = Integer.parseInt(comp.getPatchSizeField().getText()) + 1;
         wiz.putProperty("totalSize", totalSize );
         wiz.putProperty("patchSize", patchSize );
     }

+ 13 - 6
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel2.java

@@ -61,6 +61,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
     // is kept separate. This can be more efficient: if the wizard is created
     // but never displayed, or not all panels are displayed, it is better to
     // create only those which really need to be visible.
+    @Override
     public Component getComponent() {
         if (component == null) {
             component = new CreateTerrainVisualPanel2();
@@ -69,6 +70,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
         return component;
     }
 
+    @Override
     public HelpCtx getHelp() {
         // Show no Help button for this panel:
         return HelpCtx.DEFAULT_HELP;
@@ -77,6 +79,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
     }
 
     // If it is always OK to press Next or Finish, then:
+    @Override
     public boolean isValid() {
         CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent();
 
@@ -98,13 +101,15 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
     public final void removeChangeListener(ChangeListener l) {
     }*/
     
-    private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
+    private final Set<ChangeListener> listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0
+    @Override
     public final void addChangeListener(ChangeListener l) {
     synchronized (listeners) {
     listeners.add(l);
     }
     System.out.println("############ Wizard panel listener added: "+l.toString());
     }
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     synchronized (listeners) {
     listeners.remove(l);
@@ -113,7 +118,7 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
     protected final void fireChangeEvent() {
     Iterator<ChangeListener> it;
     synchronized (listeners) {
-    it = new HashSet<ChangeListener>(listeners).iterator();
+    it = new HashSet<>(listeners).iterator();
     }
     ChangeEvent ev = new ChangeEvent(this);
     while (it.hasNext()) {
@@ -126,11 +131,13 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
+    @Override
     public void readSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         terrainTotalSize = (Integer)wiz.getProperty("totalSize");
     }
 
+    @Override
     public void storeSettings(Object settings) {
 
         CreateTerrainVisualPanel2 comp = (CreateTerrainVisualPanel2) getComponent();
@@ -152,10 +159,10 @@ public class CreateTerrainWizardPanel2 implements WizardDescriptor.Panel {
             }
         }
         else if ("Hill".equals(comp.getHeightmapTypeComboBox().getSelectedItem()) ) {
-            int iterations = new Integer(comp.getHillIterationsTextField().getText());
-            byte flattening = new Byte(comp.getHillFlatteningTextField().getText());
-            float min = new Float(comp.getHillMinRadiusTextField().getText());
-            float max = new Float(comp.getHillMaxRadiusTextField().getText());
+            int iterations = Integer.parseInt(comp.getHillIterationsTextField().getText());
+            byte flattening = Byte.parseByte(comp.getHillFlatteningTextField().getText());
+            float min = Float.parseFloat(comp.getHillMinRadiusTextField().getText());
+            float max = Float.parseFloat(comp.getHillMaxRadiusTextField().getText());
             try {
                 heightmap = new HillHeightMap(terrainTotalSize, iterations, min, max, flattening);
             } catch (Exception ex) {

+ 8 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel3.java

@@ -54,6 +54,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
     // is kept separate. This can be more efficient: if the wizard is created
     // but never displayed, or not all panels are displayed, it is better to
     // create only those which really need to be visible.
+    @Override
     public Component getComponent() {
         if (component == null) {
             component = new CreateTerrainVisualPanel3();
@@ -61,6 +62,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         return component;
     }
 
+    @Override
     public HelpCtx getHelp() {
         // Show no Help button for this panel:
         return HelpCtx.DEFAULT_HELP;
@@ -68,6 +70,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         // return new HelpCtx(SampleWizardPanel1.class);
     }
 
+    @Override
     public boolean isValid() {
         // If it is always OK to press Next or Finish, then:
         return true;
@@ -78,9 +81,11 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         // and uncomment the complicated stuff below.
     }
 
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
     /*
@@ -111,6 +116,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
+    @Override
     public void readSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         int totalSize = (Integer) wiz.getProperty("totalSize");
@@ -118,10 +124,11 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         comp.setDefaultImageSize(totalSize-1); // eg. was 257, now 256
     }
 
+    @Override
     public void storeSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         CreateTerrainVisualPanel3 comp = (CreateTerrainVisualPanel3) getComponent();
-        int textureSize = new Integer(comp.getAlphaBlendSize().getText());
+        int textureSize = Integer.parseInt(comp.getAlphaBlendSize().getText());
         wiz.putProperty("alphaTextureSize", textureSize );
     }
 

+ 77 - 62
jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java

@@ -79,7 +79,6 @@ import org.openide.nodes.NodeMemberEvent;
 import org.openide.nodes.NodeReorderEvent;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
-import org.openide.util.lookup.InstanceContent;
 
 /**
  * Modifies the actual terrain in the scene.
@@ -88,12 +87,13 @@ import org.openide.util.lookup.InstanceContent;
  */
 @SuppressWarnings({"unchecked", "rawtypes"})
 public class TerrainEditorController implements NodeListener {
-    private JmeSpatial jmeRootNode;
+    
+    private final JmeSpatial jmeRootNode;
     private JmeSpatial selectedSpat;
     private Node terrainNode;
     private Node rootNode;
-    private AssetDataObject currentFileObject;
-    private TerrainEditorTopComponent topComponent;
+    private final AssetDataObject currentFileObject;
+    private final TerrainEditorTopComponent topComponent;
 
     // texture settings
     public static final String DEFAULT_TERRAIN_TEXTURE = "com/jme3/gde/terraineditor/dirt.jpg";
@@ -108,10 +108,12 @@ public class TerrainEditorController implements NodeListener {
     class TerrainSaveCookie implements SaveCookie {
         JmeSpatial rootNode;
         
+        @Override
         public void save() throws IOException {
             if (alphaLayersChanged) {
                 SceneApplication.getApplication().enqueue(new Callable() {
 
+                    @Override
                     public Object call() throws Exception {
                         //currentFileObject.saveAsset();
                         //TerrainSaveCookie sc = currentFileObject.getCookie(TerrainSaveCookie.class);
@@ -127,7 +129,7 @@ public class TerrainEditorController implements NodeListener {
             }
         }
     }
-    private TerrainSaveCookie terrainSaveCookie = new TerrainSaveCookie();
+    private final TerrainSaveCookie terrainSaveCookie = new TerrainSaveCookie();
 
     
     public TerrainEditorController(JmeSpatial jmeRootNode, 
@@ -255,8 +257,8 @@ public class TerrainEditorController implements NodeListener {
         float xStepAmount = ((Node)terrain).getLocalScale().x;
         float zStepAmount = ((Node)terrain).getLocalScale().z;
 
-        List<Vector2f> locs = new ArrayList<Vector2f>();
-        List<Float> heights = new ArrayList<Float>();
+        List<Vector2f> locs = new ArrayList<>();
+        List<Float> heights = new ArrayList<>();
 
         for (int z=-radiusStepsZ; z<radiusStepsZ; z++) {
             for (int x=-radiusStepsZ; x<radiusStepsX; x++) {
@@ -365,15 +367,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Float scale =
                     SceneApplication.getApplication().enqueue(new Callable<Float>() {
+                        
                         @Override
                         public Float call() throws Exception {
                             return getTextureScale(layer);
                         }
+                        
                     }).get();
                     return scale;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -395,15 +397,15 @@ public class TerrainEditorController implements NodeListener {
         } else {
             try {
                 SceneApplication.getApplication().enqueue(new Callable() {
+                    
                     @Override
                     public Object call() throws Exception {
                         setTextureScale(layer, scale);
                         return null;
                     }
+                    
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -442,9 +444,7 @@ public class TerrainEditorController implements NodeListener {
                         }
                     }).get();
                     return tex;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return null;
@@ -521,9 +521,7 @@ public class TerrainEditorController implements NodeListener {
                         return null;
                     }
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -548,9 +546,7 @@ public class TerrainEditorController implements NodeListener {
                         return null;
                     }
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -646,14 +642,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Texture tex =
                     SceneApplication.getApplication().enqueue(new Callable<Texture>() {
+                        
+                        @Override
                         public Texture call() throws Exception {
                             return getNormalMap(layer);
                         }
+                        
                     }).get();
                     return tex;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -713,14 +710,15 @@ public class TerrainEditorController implements NodeListener {
         } else {
             try {
                 SceneApplication.getApplication().enqueue(new Callable() {
+                    
+                    @Override
                     public Object call() throws Exception {
                         setNormalMap(layer, texture);
                         return null;
                     }
+                    
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -738,16 +736,17 @@ public class TerrainEditorController implements NodeListener {
         try {
             Terrain terrain =
             SceneApplication.getApplication().enqueue(new Callable<Terrain>() {
+                
+                @Override
                 public Terrain call() throws Exception {
                     //return doCreateTerrain(parent, totalSize, patchSize, alphaTextureSize, heightmapData, sceneName, jmeNodeParent);
                     AddTerrainAction a = new AddTerrainAction();
                     return (Terrain) a.doCreateTerrain(parent, totalSize, patchSize, alphaTextureSize, heightmapData, sceneName, jmeRootNode);
                 }
+                
             }).get();
             return terrain;
-        } catch (InterruptedException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ExecutionException ex) {
+        } catch (InterruptedException | ExecutionException ex) {
             Exceptions.printStackTrace(ex);
         }
         
@@ -873,14 +872,15 @@ public class TerrainEditorController implements NodeListener {
         try {
             Spatial sky =
             SceneApplication.getApplication().enqueue(new Callable<Spatial>() {
+                
+                @Override
                 public Spatial call() throws Exception {
                     return doCreateSky(parent, west, east, north, south, top, bottom, normalScale);
                 }
+                
             }).get();
             return sky;
-        } catch (InterruptedException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ExecutionException ex) {
+        } catch (InterruptedException | ExecutionException ex) {
             Exceptions.printStackTrace(ex);
         }
         return null; // if failed
@@ -913,14 +913,15 @@ public class TerrainEditorController implements NodeListener {
         try {
             Spatial sky =
             SceneApplication.getApplication().enqueue(new Callable<Spatial>() {
+                
+                @Override
                 public Spatial call() throws Exception {
                     return doCreateSky(parent, texture, useSpheremap, normalScale);
                 }
+                
             }).get();
             return sky;
-        } catch (InterruptedException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ExecutionException ex) {
+        } catch (InterruptedException | ExecutionException ex) {
             Exceptions.printStackTrace(ex);
         }
         return null; // if failed
@@ -949,14 +950,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Boolean result =
                     SceneApplication.getApplication().enqueue(new Callable<Boolean>() {
+                        
+                        @Override
                         public Boolean call() throws Exception {
                             return hasTextureAt(i);
                         }
+                        
                     }).get();
                     return result;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return false;
@@ -975,12 +977,15 @@ public class TerrainEditorController implements NodeListener {
                 final boolean remove = getNumDiffuseTextures() > 1;
 
                 java.awt.EventQueue.invokeLater(new Runnable() {
+                    
+                    @Override
                     public void run() {
                         topComponent.enableAddTextureButton(add);
                         topComponent.enableRemoveTextureButton(remove);
                         topComponent.updateTextureCountLabel(numAvailable);
                         topComponent.setAddNormalTextureEnabled(numAvailable>0);
                     }
+                    
                 });
         //        return null;
         //    }
@@ -1010,14 +1015,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Integer count =
                   SceneApplication.getApplication().enqueue(new Callable<Integer>() {
+                      
+                    @Override
                     public Integer call() throws Exception {
                         return getNumDiffuseTextures();
                     }
+                    
                 }).get();
                 return count;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return -1;
@@ -1049,14 +1055,14 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Integer count =
                   SceneApplication.getApplication().enqueue(new Callable<Integer>() {
+                      
+                    @Override
                     public Integer call() throws Exception {
                         return getNumUsedTextures();
                     }
                 }).get();
                 return count;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return -1;
@@ -1077,14 +1083,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Boolean isEnabled =
                 SceneApplication.getApplication().enqueue(new Callable<Boolean>() {
+                    
+                    @Override
                     public Boolean call() throws Exception {
                         return isTriPlanarEnabled();
                     }
+                    
                 }).get();
                 return isEnabled;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return false;
@@ -1123,14 +1130,15 @@ public class TerrainEditorController implements NodeListener {
         } else {
             try {
                 SceneApplication.getApplication().enqueue(new Callable() {
+                    
+                    @Override
                     public Object call() throws Exception {
                         setTriPlanarEnabled(enabled);
                         return null;
                     }
+                    
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -1148,6 +1156,7 @@ public class TerrainEditorController implements NodeListener {
         } else {
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
 
+                @Override
                 public Object call() throws Exception {
                     setShininess(shininess);
                     return null;
@@ -1166,19 +1175,18 @@ public class TerrainEditorController implements NodeListener {
             if (param != null)
                 return (Float)param.getValue();
             
-                return 0;
+            return 0;
         } else {
             try {
                 Float shininess = SceneApplication.getApplication().enqueue(new Callable<Float>() {
 
+                    @Override
                     public Float call() throws Exception {
                         return getShininess();
                     }
                 }).get();
                 return shininess;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return 0;
@@ -1196,14 +1204,15 @@ public class TerrainEditorController implements NodeListener {
         } else {
             try {
                 SceneApplication.getApplication().enqueue(new Callable() {
+                    
+                    @Override
                     public Object call() throws Exception {
                         setWardIsoEnabled(enabled);
                         return null;
                     }
+                    
                 }).get();
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
         }
@@ -1223,14 +1232,15 @@ public class TerrainEditorController implements NodeListener {
             try {
                 Boolean isEnabled =
                 SceneApplication.getApplication().enqueue(new Callable<Boolean>() {
+                    
+                    @Override
                     public Boolean call() throws Exception {
                         return isWardIsoEnabled();
                     }
+                    
                 }).get();
                 return isEnabled;
-            } catch (InterruptedException ex) {
-                Exceptions.printStackTrace(ex);
-            } catch (ExecutionException ex) {
+            } catch (InterruptedException | ExecutionException ex) {
                 Exceptions.printStackTrace(ex);
             }
             return false;
@@ -1238,6 +1248,7 @@ public class TerrainEditorController implements NodeListener {
     }
     
 
+    @Override
     public void propertyChange(PropertyChangeEvent ev) {
         if (ev.getNewValue() == null && ev.getOldValue() != null) {
             topComponent.clearTextureTable(); // terrain deleted
@@ -1245,6 +1256,7 @@ public class TerrainEditorController implements NodeListener {
         }
     }
     
+    @Override
     public void childrenAdded(NodeMemberEvent ev) {
         boolean isTerrain = false;
         for(org.openide.nodes.Node n : ev.getSnapshot()) {
@@ -1258,13 +1270,16 @@ public class TerrainEditorController implements NodeListener {
             topComponent.reinitTextureTable();
     }
 
+    @Override
     public void childrenRemoved(NodeMemberEvent ev) {
         
     }
 
+    @Override
     public void childrenReordered(NodeReorderEvent ev) {
     }
 
+    @Override
     public void nodeDestroyed(NodeEvent ev) {
         
     }

+ 17 - 12
jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java

@@ -88,8 +88,8 @@ import org.openide.nodes.NodeEvent;
 import org.openide.nodes.NodeListener;
 import org.openide.nodes.NodeMemberEvent;
 import org.openide.nodes.NodeReorderEvent;
-import org.openide.util.Lookup.Result;
 import org.openide.util.*;
+import org.openide.util.Lookup.Result;
 import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
@@ -119,7 +119,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
     private boolean availableNormalTextures;
     private HelpCtx ctx = new HelpCtx("sdk.terrain_editor");
     private TexturePreview texPreview;
-    private Map<String, JButton> buttons = new HashMap<String, JButton>();
+    private Map<String, JButton> buttons = new HashMap<>();
     private JPanel insideToolSettings;
     
     //private InstanceContent content;
@@ -792,7 +792,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
 
     private void shininessFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shininessFieldActionPerformed
         try {
-            Float f = new Float(shininessField.getText());
+            Float f = Float.parseFloat(shininessField.getText());
             editorController.setShininess(Math.max(0, f));
         } catch (Exception e) {
             Logger.getLogger(TerrainEditorTopComponent.class.getName()).log(Level.WARNING,
@@ -952,7 +952,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
             if (input instanceof javax.swing.JTextField) {
                 String text = ((javax.swing.JTextField)input).getText();
                 try {
-                    Float f = new Float(text);
+                    Float f = Float.parseFloat(text);
                     if (f > 0)
                         return true;
                 } catch (Exception e) {
@@ -977,7 +977,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
             LevelExtraToolParams params = new LevelExtraToolParams();
             params.absolute = levelAbsoluteCheckbox.isSelected();
             params.precision = levelPrecisionCheckbox.isSelected();
-            params.height = new Float(levelAbsoluteHeightField.getText());
+            params.height = Float.parseFloat(levelAbsoluteHeightField.getText());
             toolController.setExtraToolParams(params);
         } catch (NumberFormatException e) {}
     }
@@ -987,10 +987,10 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
             RoughExtraToolParams params = new RoughExtraToolParams();
             //params.amplitude = new Float(amplitudeField.getText());
             //params.frequency = new Float(frequencyField.getText());
-            params.lacunarity = new Float(lacunarityField.getText());
-            params.octaves = new Float(octavesField.getText());
+            params.lacunarity = Float.parseFloat(lacunarityField.getText());
+            params.octaves = Float.parseFloat(octavesField.getText());
             //params.roughness = new Float(roughnessField.getText());
-            params.scale = new Float(scaleField.getText());
+            params.scale = Float.parseFloat(scaleField.getText());
             toolController.setExtraToolParams(params);
             
         } catch (NumberFormatException e) {}
@@ -1536,7 +1536,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
             super.setValueAt(aValue, row, column);
 
             if (column == 3) {
-                setTextureScale(row, new Float((String) aValue));
+                setTextureScale(row, Float.parseFloat((String) aValue));
             }
         }
 
@@ -1595,6 +1595,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
 
             addListSelectionListener(new ListSelectionListener() {
 
+                @Override
                 public void valueChanged(ListSelectionEvent e) {
                     if (toolController != null) {
                         toolController.setSelectedTextureIndex(textureTable.getSelectedRow());
@@ -1617,6 +1618,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
 
         }
 
+        @Override
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
             return getButton(value, row, column);
         }
@@ -1652,7 +1654,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
                     int index = 0;
                     // this is messy, fix it so we know what values are coming in from where:
                     if (value instanceof String) {
-                        index = new Float((String) value).intValue();
+                        index = (int) Float.parseFloat((String) value);
                     } else if (value instanceof Float) {
                         index = ((Float) value).intValue();
                     } else if (value instanceof Integer) {
@@ -1669,6 +1671,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
 
                 lbl.addActionListener(new ActionListener() {
 
+                    @Override
                     public void actionPerformed(ActionEvent e) {
 
                         if (alreadyChoosing) {
@@ -1785,6 +1788,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
         Utils utils = new Utils();
         //Accept all directories and all gif, jpg, tiff, or png files.
 
+        @Override
         public boolean accept(File f) {
             if (f.isDirectory()) {
                 return true;
@@ -1809,6 +1813,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
         }
 
         //The description of this filter
+        @Override
         public String getDescription() {
             return "Just Images";
         }
@@ -1831,8 +1836,8 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
 
         @Override
         public Boolean isTraversable(File f) {
-            if (f.getAbsolutePath().indexOf(rootDirectories[0].getAbsolutePath()) >= 0) {
-                return Boolean.valueOf(f.isDirectory());
+            if (f.getAbsolutePath().contains(rootDirectories[0].getAbsolutePath())) {
+                return f.isDirectory();
             } else {
                 return false;
             }

+ 1 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java

@@ -130,7 +130,7 @@ public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 2 - 2
jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardAction.java

@@ -45,7 +45,7 @@ import org.openide.util.actions.CallableSystemAction;
 public final class SkyboxWizardAction extends CallableSystemAction {
 
     private WizardDescriptor.Panel[] panels;
-    private TerrainEditorTopComponent topComponent;
+    private final TerrainEditorTopComponent topComponent;
 
     public SkyboxWizardAction(TerrainEditorTopComponent topComponent) {
         this.topComponent = topComponent;
@@ -87,7 +87,7 @@ public final class SkyboxWizardAction extends CallableSystemAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 6 - 6
jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java

@@ -185,15 +185,15 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.ValidatingPanel<Wiza
             settings.putProperty("textureWest", (Texture)comp.getEditorWest().getValue());
             settings.putProperty("textureTop", (Texture)comp.getEditorTop().getValue());
             settings.putProperty("textureBottom", (Texture)comp.getEditorBottom().getValue());
-            float x = new Float(comp.getNormal1X().getText());
-            float y = new Float(comp.getNormal1Y().getText());
-            float z = new Float(comp.getNormal1Z().getText());
+            float x = Float.parseFloat(comp.getNormal1X().getText());
+            float y = Float.parseFloat(comp.getNormal1Y().getText());
+            float z = Float.parseFloat(comp.getNormal1Z().getText());
             settings.putProperty("normalScale", new Vector3f(x,y,z) );
         } else {
             settings.putProperty("textureSingle", (Texture)comp.getEditorSingle().getValue());
-            float x = new Float(comp.getNormal2X().getText());
-            float y = new Float(comp.getNormal2Y().getText());
-            float z = new Float(comp.getNormal2Z().getText());
+            float x = Float.parseFloat(comp.getNormal2X().getText());
+            float y = Float.parseFloat(comp.getNormal2Y().getText());
+            float z = Float.parseFloat(comp.getNormal2Z().getText());
             settings.putProperty("normalScale", new Vector3f(x,y,z) );
             settings.putProperty("envMapType", comp.getEnvMapType());         
             settings.putProperty("flipY", comp.getFlipYCheckBox().isSelected());

+ 1 - 1
jme3-tests-template/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:48 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 17 - 14
jme3-tests-template/src/com/jme3/gde/templates/tests/testsandroid/JME3TestsAndroidWizardIterator.java

@@ -86,8 +86,9 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
                 };
     }
 
+    @Override
     public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
-        Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
+        Set<FileObject> resultSet = new LinkedHashSet<>();
         File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
         dirF.mkdirs();
 
@@ -114,6 +115,7 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
         return resultSet;
     }
 
+    @Override
     public void initialize(WizardDescriptor wiz) {
         this.wiz = wiz;
         index = 0;
@@ -132,13 +134,14 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
                 JComponent jc = (JComponent) c;
                 // Step #.
                 // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                 // Step name (actually the whole list for reference).
                 jc.putClientProperty("WizardPanel_contentData", steps);
             }
         }
     }
 
+    @Override
     public void uninitialize(WizardDescriptor wiz) {
         this.wiz.putProperty("projdir", null);
         this.wiz.putProperty("name", null);
@@ -146,19 +149,23 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
         panels = null;
     }
 
+    @Override
     public String name() {
         return MessageFormat.format("{0} of {1}",
-                new Object[]{new Integer(index + 1), new Integer(panels.length)});
+                new Object[]{index + 1, panels.length});
     }
 
+    @Override
     public boolean hasNext() {
         return index < panels.length - 1;
     }
 
+    @Override
     public boolean hasPrevious() {
         return index > 0;
     }
 
+    @Override
     public void nextPanel() {
         if (!hasNext()) {
             throw new NoSuchElementException();
@@ -166,6 +173,7 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
         index++;
     }
 
+    @Override
     public void previousPanel() {
         if (!hasPrevious()) {
             throw new NoSuchElementException();
@@ -173,19 +181,22 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
         index--;
     }
 
+    @Override
     public WizardDescriptor.Panel current() {
         return panels[index];
     }
 
     // If nothing unusual changes in the middle of the wizard, simply:
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
 
     private static void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
-        try {
+        try (source) {
             ZipInputStream str = new ZipInputStream(source);
             ZipEntry entry;
             while ((entry = str.getNextEntry()) != null) {
@@ -201,17 +212,12 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
                     }
                 }
             }
-        } finally {
-            source.close();
         }
     }
 
     private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
-        OutputStream out = fo.getOutputStream();
-        try {
+        try (OutputStream out = fo.getOutputStream()) {
             FileUtil.copy(str, out);
-        } finally {
-            out.close();
         }
     }
 
@@ -233,11 +239,8 @@ public class JME3TestsAndroidWizardIterator implements WizardDescriptor./*Progre
                     }
                 }
             }
-            OutputStream out = fo.getOutputStream();
-            try {
+            try (OutputStream out = fo.getOutputStream()) {
                 XMLUtil.write(doc, out, "UTF-8");
-            } finally {
-                out.close();
             }
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);

+ 17 - 14
jme3-tests-template/src/com/jme3/gde/templates/tests/testsdesktop/JmeTestsWizardIterator.java

@@ -59,8 +59,9 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
                 };
     }
 
+    @Override
     public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
-        Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
+        Set<FileObject> resultSet = new LinkedHashSet<>();
         File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
         dirF.mkdirs();
 
@@ -87,6 +88,7 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
         return resultSet;
     }
 
+    @Override
     public void initialize(WizardDescriptor wiz) {
         this.wiz = wiz;
         index = 0;
@@ -105,13 +107,14 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
                 JComponent jc = (JComponent) c;
                 // Step #.
                 // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                 // Step name (actually the whole list for reference).
                 jc.putClientProperty("WizardPanel_contentData", steps);
             }
         }
     }
 
+    @Override
     public void uninitialize(WizardDescriptor wiz) {
         this.wiz.putProperty("projdir", null);
         this.wiz.putProperty("name", null);
@@ -119,19 +122,23 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
         panels = null;
     }
 
+    @Override
     public String name() {
         return MessageFormat.format("{0} of {1}",
-                new Object[]{new Integer(index + 1), new Integer(panels.length)});
+                new Object[]{index + 1, panels.length});
     }
 
+    @Override
     public boolean hasNext() {
         return index < panels.length - 1;
     }
 
+    @Override
     public boolean hasPrevious() {
         return index > 0;
     }
 
+    @Override
     public void nextPanel() {
         if (!hasNext()) {
             throw new NoSuchElementException();
@@ -139,6 +146,7 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
         index++;
     }
 
+    @Override
     public void previousPanel() {
         if (!hasPrevious()) {
             throw new NoSuchElementException();
@@ -146,19 +154,22 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
         index--;
     }
 
+    @Override
     public WizardDescriptor.Panel current() {
         return panels[index];
     }
 
     // If nothing unusual changes in the middle of the wizard, simply:
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
 
     private static void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
-        try {
+        try (source) {
             ZipInputStream str = new ZipInputStream(source);
             ZipEntry entry;
             while ((entry = str.getNextEntry()) != null) {
@@ -174,17 +185,12 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
                     }
                 }
             }
-        } finally {
-            source.close();
         }
     }
 
     private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
-        OutputStream out = fo.getOutputStream();
-        try {
+        try (OutputStream out = fo.getOutputStream()) {
             FileUtil.copy(str, out);
-        } finally {
-            out.close();
         }
     }
 
@@ -206,11 +212,8 @@ public class JmeTestsWizardIterator implements WizardDescriptor./*Progress*/Inst
                     }
                 }
             }
-            OutputStream out = fo.getOutputStream();
-            try {
+            try (OutputStream out = fo.getOutputStream()) {
                 XMLUtil.write(doc, out, "UTF-8");
-            } finally {
-                out.close();
             }
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);

+ 1 - 1
jme3-texture-editor/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 1 - 1
jme3-vehicle-creator/nbproject/project.properties

@@ -1,4 +1,4 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 spec.version.base=3.3.0

+ 1 - 1
jme3-wavefront/nbproject/project.properties

@@ -1,4 +1,4 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 spec.version.base=3.3.0

+ 1 - 1
jme3-welcome-screen/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=10
+javac.source=11
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org