浏览代码

jme3-core: use diamond notation when it clarifies the code

Stephen Gold 4 年之前
父节点
当前提交
548b181569
共有 82 个文件被更改,包括 259 次插入259 次删除
  1. 4 4
      jme3-core/src/main/java/com/jme3/animation/AnimControl.java
  2. 5 5
      jme3-core/src/main/java/com/jme3/animation/Animation.java
  3. 2 2
      jme3-core/src/main/java/com/jme3/animation/Bone.java
  4. 2 2
      jme3-core/src/main/java/com/jme3/animation/CompactArray.java
  5. 2 2
      jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
  6. 2 2
      jme3-core/src/main/java/com/jme3/animation/TrackInfo.java
  7. 3 3
      jme3-core/src/main/java/com/jme3/app/LegacyApplication.java
  8. 3 3
      jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java
  9. 2 2
      jme3-core/src/main/java/com/jme3/asset/AssetKey.java
  10. 2 2
      jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java
  11. 8 8
      jme3-core/src/main/java/com/jme3/asset/ImplHandler.java
  12. 2 2
      jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java
  13. 3 3
      jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java
  14. 4 4
      jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java
  15. 3 3
      jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java
  16. 3 3
      jme3-core/src/main/java/com/jme3/effect/shapes/EmitterMeshFaceShape.java
  17. 6 6
      jme3-core/src/main/java/com/jme3/effect/shapes/EmitterMeshVertexShape.java
  18. 1 1
      jme3-core/src/main/java/com/jme3/environment/EnvironmentCamera.java
  19. 4 4
      jme3-core/src/main/java/com/jme3/environment/util/LightsDebugState.java
  20. 2 2
      jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java
  21. 2 2
      jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java
  22. 1 1
      jme3-core/src/main/java/com/jme3/font/BitmapCharacterSet.java
  23. 2 2
      jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java
  24. 1 1
      jme3-core/src/main/java/com/jme3/font/ColorTags.java
  25. 2 2
      jme3-core/src/main/java/com/jme3/input/AbstractJoystick.java
  26. 9 9
      jme3-core/src/main/java/com/jme3/input/InputManager.java
  27. 2 2
      jme3-core/src/main/java/com/jme3/light/BasicProbeBlendingStrategy.java
  28. 2 2
      jme3-core/src/main/java/com/jme3/light/DefaultLightFilter.java
  29. 2 2
      jme3-core/src/main/java/com/jme3/light/LightList.java
  30. 2 2
      jme3-core/src/main/java/com/jme3/light/WeightedProbeBlendingStrategy.java
  31. 2 2
      jme3-core/src/main/java/com/jme3/material/Material.java
  32. 7 7
      jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java
  33. 4 4
      jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java
  34. 2 2
      jme3-core/src/main/java/com/jme3/math/Spline.java
  35. 2 2
      jme3-core/src/main/java/com/jme3/opencl/DefaultPlatformChooser.java
  36. 2 2
      jme3-core/src/main/java/com/jme3/opencl/OpenCLObjectManager.java
  37. 1 1
      jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java
  38. 4 4
      jme3-core/src/main/java/com/jme3/renderer/Statistics.java
  39. 3 3
      jme3-core/src/main/java/com/jme3/renderer/ViewPort.java
  40. 2 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
  41. 2 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTimingState.java
  42. 3 3
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java
  43. 3 3
      jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java
  44. 6 6
      jme3-core/src/main/java/com/jme3/scene/BatchNode.java
  45. 4 4
      jme3-core/src/main/java/com/jme3/scene/Node.java
  46. 3 3
      jme3-core/src/main/java/com/jme3/scene/Spatial.java
  47. 4 4
      jme3-core/src/main/java/com/jme3/scene/UserData.java
  48. 2 2
      jme3-core/src/main/java/com/jme3/scene/control/UpdateControl.java
  49. 4 4
      jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java
  50. 4 4
      jme3-core/src/main/java/com/jme3/scene/shape/Surface.java
  51. 5 5
      jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java
  52. 2 2
      jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
  53. 1 1
      jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java
  54. 2 2
      jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java
  55. 1 1
      jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java
  56. 2 2
      jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java
  57. 2 2
      jme3-core/src/main/java/com/jme3/util/ListMap.java
  58. 4 4
      jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java
  59. 2 2
      jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java
  60. 4 4
      jme3-core/src/main/java/com/jme3/util/NativeObjectManager.java
  61. 11 11
      jme3-core/src/main/java/com/jme3/util/TangentBinormalGenerator.java
  62. 2 2
      jme3-core/src/main/java/com/jme3/util/TempVars.java
  63. 1 1
      jme3-core/src/main/java/com/jme3/util/blockparser/BlockLanguageParser.java
  64. 2 2
      jme3-core/src/main/java/com/jme3/util/blockparser/Statement.java
  65. 2 2
      jme3-core/src/main/java/com/jme3/util/clone/Cloner.java
  66. 1 1
      jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java
  67. 5 5
      jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java
  68. 4 4
      jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java
  69. 7 7
      jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java
  70. 2 2
      jme3-core/src/plugins/java/com/jme3/material/plugins/ConditionParser.java
  71. 3 3
      jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java
  72. 2 2
      jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java
  73. 10 10
      jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java
  74. 4 4
      jme3-core/src/plugins/java/com/jme3/shader/plugins/ShaderDependencyNode.java
  75. 2 2
      jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java
  76. 2 2
      jme3-core/src/plugins/java/com/jme3/texture/plugins/ktx/KTXLoader.java
  77. 1 1
      jme3-core/src/test/java/com/jme3/renderer/OpaqueComparatorTest.java
  78. 3 3
      jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java
  79. 2 2
      jme3-core/src/test/java/com/jme3/util/ListMapTest.java
  80. 7 7
      jme3-core/src/tools/java/jme3tools/optimize/GeometryBatchFactory.java
  81. 7 7
      jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java
  82. 2 2
      jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java

+ 4 - 4
jme3-core/src/main/java/com/jme3/animation/AnimControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -79,15 +79,15 @@ public final class AnimControl extends AbstractControl implements Cloneable, Jme
     /**
      * List of animations
      */
-    HashMap<String, Animation> animationMap = new HashMap<String, Animation>();
+    HashMap<String, Animation> animationMap = new HashMap<>();
     /**
      * Animation channels
      */
-    private transient ArrayList<AnimChannel> channels = new ArrayList<AnimChannel>();
+    private transient ArrayList<AnimChannel> channels = new ArrayList<>();
     /**
      * Animation event listeners
      */
-    private transient ArrayList<AnimEventListener> listeners = new ArrayList<AnimEventListener>();
+    private transient ArrayList<AnimEventListener> listeners = new ArrayList<>();
 
     /**
      * Creates a new animation control for the given skeleton.

+ 5 - 5
jme3-core/src/main/java/com/jme3/animation/Animation.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -60,7 +60,7 @@ public class Animation implements Savable, Cloneable, JmeCloneable {
     /** 
      * The tracks of the animation. 
      */
-    private SafeArrayList<Track> tracks = new SafeArrayList<Track>(Track.class);
+    private SafeArrayList<Track> tracks = new SafeArrayList<>(Track.class);
 
     /**
      * Serialization-only. Do not use.
@@ -181,7 +181,7 @@ public class Animation implements Savable, Cloneable, JmeCloneable {
     public Animation clone() {
         try {
             Animation result = (Animation) super.clone();
-            result.tracks = new SafeArrayList<Track>(Track.class);
+            result.tracks = new SafeArrayList<>(Track.class);
             for (Track track : tracks) {
                 result.tracks.add(track.clone());
             }
@@ -199,7 +199,7 @@ public class Animation implements Savable, Cloneable, JmeCloneable {
     public Animation cloneForSpatial(Spatial spat) {
         try {
             Animation result = (Animation) super.clone();
-            result.tracks = new SafeArrayList<Track>(Track.class);
+            result.tracks = new SafeArrayList<>(Track.class);
             for (Track track : tracks) {
                 if (track instanceof ClonableTrack) {
                     result.tracks.add(((ClonableTrack) track).cloneForSpatial(spat));
@@ -265,7 +265,7 @@ public class Animation implements Savable, Cloneable, JmeCloneable {
             // tracks set at all even though it makes no sense.
             // Since there's a null check in setTime(),
             // it's only appropriate that the check is made here as well.
-            tracks = new SafeArrayList<Track>(Track.class);
+            tracks = new SafeArrayList<>(Track.class);
             for (Savable savable : arr) {
                 tracks.add((Track) savable);
             }

+ 2 - 2
jme3-core/src/main/java/com/jme3/animation/Bone.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -76,7 +76,7 @@ public final class Bone implements Savable, JmeCloneable {
     public static final int SAVABLE_VERSION = 2;
     private String name;
     private Bone parent;
-    private ArrayList<Bone> children = new ArrayList<Bone>();
+    private ArrayList<Bone> children = new ArrayList<>();
     /**
      * If enabled, user can control bone transform with setUserTransforms.
      * Animation transforms are not applied to this bone when enabled.

+ 2 - 2
jme3-core/src/main/java/com/jme3/animation/CompactArray.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@ import java.util.Map;
  */
 public abstract class CompactArray<T> implements JmeCloneable {
 
-    protected Map<T, Integer> indexPool = new HashMap<T, Integer>();
+    protected Map<T, Integer> indexPool = new HashMap<>();
     protected int[] index;
     protected float[] array;
     private boolean invalid;

+ 2 - 2
jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -71,7 +71,7 @@ public class SkeletonControl extends AbstractControl implements Cloneable, JmeCl
     /**
      * List of geometries affected by this control.
      */
-    private SafeArrayList<Geometry> targets = new SafeArrayList<Geometry>(Geometry.class);
+    private SafeArrayList<Geometry> targets = new SafeArrayList<>(Geometry.class);
 
     /**
      * Used to track when a mesh was updated. Meshes are only updated if they

+ 2 - 2
jme3-core/src/main/java/com/jme3/animation/TrackInfo.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ import java.util.ArrayList;
 @Deprecated
 public class TrackInfo implements Savable, JmeCloneable {
 
-    ArrayList<Track> tracks = new ArrayList<Track>();
+    ArrayList<Track> tracks = new ArrayList<>();
 
     public TrackInfo() {
     }

+ 3 - 3
jme3-core/src/main/java/com/jme3/app/LegacyApplication.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ public class LegacyApplication implements Application, SystemListener {
 
     protected AppProfiler prof;
 
-    private final ConcurrentLinkedQueue<AppTask<?>> taskQueue = new ConcurrentLinkedQueue<AppTask<?>>();
+    private final ConcurrentLinkedQueue<AppTask<?>> taskQueue = new ConcurrentLinkedQueue<>();
 
     /**
      * Create a new instance of <code>LegacyApplication</code>.
@@ -702,7 +702,7 @@ public class LegacyApplication implements Application, SystemListener {
      */
     @Override
     public <V> Future<V> enqueue(Callable<V> callable) {
-        AppTask<V> task = new AppTask<V>(callable);
+        AppTask<V> task = new AppTask<>(callable);
         taskQueue.add(task);
         return task;
     }

+ 3 - 3
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java

@@ -71,18 +71,18 @@ public class AppStateManager {
      *  initialization.  Once initialized they will be added to
      *  the running app states.  
      */
-    private final SafeArrayList<AppState> initializing = new SafeArrayList<AppState>(AppState.class);
+    private final SafeArrayList<AppState> initializing = new SafeArrayList<>(AppState.class);
     
     /**
      *  Holds the active states once they are initialized.  
      */
-    private final SafeArrayList<AppState> states = new SafeArrayList<AppState>(AppState.class);
+    private final SafeArrayList<AppState> states = new SafeArrayList<>(AppState.class);
     
     /**
      *  List holding the detached app states that are pending
      *  cleanup.  
      */
-    private final SafeArrayList<AppState> terminating = new SafeArrayList<AppState>(AppState.class);
+    private final SafeArrayList<AppState> terminating = new SafeArrayList<>(AppState.class);
 
     /**
      *  Thread-safe index of every state that is currently attached and has

+ 2 - 2
jme3-core/src/main/java/com/jme3/asset/AssetKey.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -147,7 +147,7 @@ public class AssetKey<T> implements Savable, Cloneable {
             return path;
         }
         String[] parts = path.split("/");
-        LinkedList<String> list = new LinkedList<String>();
+        LinkedList<String> list = new LinkedList<>();
         for (int i = 0; i < parts.length; i++) {
             String string = parts[i];
             if (string.length() == 0 || string.equals(".")) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java

@@ -71,10 +71,10 @@ public class DesktopAssetManager implements AssetManager {
     private final ImplHandler handler = new ImplHandler(this);
 
     final private CopyOnWriteArrayList<AssetEventListener> eventListeners = 
-            new CopyOnWriteArrayList<AssetEventListener>();
+            new CopyOnWriteArrayList<>();
     
     final private List<ClassLoader> classLoaders =
-            Collections.synchronizedList(new ArrayList<ClassLoader>());
+            Collections.synchronizedList(new ArrayList<>());
 
     public DesktopAssetManager(){
         this(null);

+ 8 - 8
jme3-core/src/main/java/com/jme3/asset/ImplHandler.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,22 +55,22 @@ final class ImplHandler {
     private final AssetManager assetManager;
     
     private final ThreadLocal<AssetKey> parentAssetKey 
-            = new ThreadLocal<AssetKey>();
+            = new ThreadLocal<>();
     
     private final CopyOnWriteArrayList<ImplThreadLocal<AssetLocator>> locatorsList =
-                new CopyOnWriteArrayList<ImplThreadLocal<AssetLocator>>();
+                new CopyOnWriteArrayList<>();
     
     private final HashMap<Class<?>, ImplThreadLocal<AssetLoader>> classToLoaderMap = 
-                new HashMap<Class<?>, ImplThreadLocal<AssetLoader>>();
+                new HashMap<>();
 
     private final ConcurrentHashMap<String, ImplThreadLocal<AssetLoader>> extensionToLoaderMap =
-                new ConcurrentHashMap<String, ImplThreadLocal<AssetLoader>>();
+                new ConcurrentHashMap<>();
     
     private final ConcurrentHashMap<Class<? extends AssetProcessor>, AssetProcessor> classToProcMap =
-                new ConcurrentHashMap<Class<? extends AssetProcessor>, AssetProcessor>();
+                new ConcurrentHashMap<>();
     
     private final ConcurrentHashMap<Class<? extends AssetCache>, AssetCache> classToCacheMap =
-                new ConcurrentHashMap<Class<? extends AssetCache>, AssetCache>();
+                new ConcurrentHashMap<>();
 
     public ImplHandler(AssetManager assetManager){
         this.assetManager = assetManager;
@@ -294,7 +294,7 @@ final class ImplHandler {
     }
 
     public void removeLocator(final Class<? extends AssetLocator> locatorType, String rootPath){
-        ArrayList<ImplThreadLocal<AssetLocator>> locatorsToRemove = new ArrayList<ImplThreadLocal<AssetLocator>>();
+        ArrayList<ImplThreadLocal<AssetLocator>> locatorsToRemove = new ArrayList<>();
         Iterator<ImplThreadLocal<AssetLocator>> it = locatorsList.iterator();
        
         while (it.hasNext()){

+ 2 - 2
jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@ import java.util.concurrent.ConcurrentHashMap;
  */
 public class SimpleAssetCache implements AssetCache {
 
-    private final ConcurrentHashMap<AssetKey, Object> keyToAssetMap = new ConcurrentHashMap<AssetKey, Object>();
+    private final ConcurrentHashMap<AssetKey, Object> keyToAssetMap = new ConcurrentHashMap<>();
     
     @Override
     public <T> void addToCache(AssetKey<T> key, T obj) {

+ 3 - 3
jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,10 +55,10 @@ public class WeakRefAssetCache implements AssetCache {
 
     private static final Logger logger = Logger.getLogger(WeakRefAssetCache.class.getName());
     
-    private final ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
+    private final ReferenceQueue<Object> refQueue = new ReferenceQueue<>();
     
     private final ConcurrentHashMap<AssetKey, AssetRef> assetCache 
-            = new ConcurrentHashMap<AssetKey, AssetRef>();
+            = new ConcurrentHashMap<>();
 
     private static class AssetRef extends WeakReference<Object> {
         

+ 4 - 4
jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -54,14 +54,14 @@ public class WeakRefCloneAssetCache implements AssetCache {
 
     private static final Logger logger = Logger.getLogger(WeakRefAssetCache.class.getName());
     
-    private final ReferenceQueue<AssetKey> refQueue = new ReferenceQueue<AssetKey>();
+    private final ReferenceQueue<AssetKey> refQueue = new ReferenceQueue<>();
     
     /**
      * Maps cloned key to AssetRef which has a weak ref to the original 
      * key and a strong ref to the original asset.
      */
     private final ConcurrentHashMap<AssetKey, AssetRef> smartCache 
-            = new ConcurrentHashMap<AssetKey, AssetRef>();
+            = new ConcurrentHashMap<>();
     
     /**
      * Stored in the ReferenceQueue to find out when originalKey is collected
@@ -98,7 +98,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
             = new ThreadLocal<ArrayList<AssetKey>>() {
         @Override
         protected ArrayList<AssetKey> initialValue() {
-            return new ArrayList<AssetKey>();
+            return new ArrayList<>();
         }
     };
     

+ 3 - 3
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -65,7 +65,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
     private int[] channels;
     private AudioSource[] chanSrcs;
     private int nextChan = 0;
-    private final ArrayList<Integer> freeChans = new ArrayList<Integer>();
+    private final ArrayList<Integer> freeChans = new ArrayList<>();
     private Listener listener;
     private boolean audioDisabled = false;
     private boolean supportEfx = false;
@@ -101,7 +101,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
         }
 
         // Find maximum # of sources supported by this implementation
-        ArrayList<Integer> channelList = new ArrayList<Integer>();
+        ArrayList<Integer> channelList = new ArrayList<>();
         for (int i = 0; i < MAX_NUM_CHANNELS; i++) {
             int chan = al.alGenSources();
             if (al.alGetError() != 0) {

+ 3 - 3
jme3-core/src/main/java/com/jme3/effect/shapes/EmitterMeshFaceShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2018 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,8 +67,8 @@ public class EmitterMeshFaceShape extends EmitterMeshVertexShape {
         for (Mesh mesh : meshes) {
             Vector3f[] vertexTable = BufferUtils.getVector3Array(mesh.getFloatBuffer(Type.Position));
             int[] indices = new int[3];
-            List<Vector3f> vertices = new ArrayList<Vector3f>(mesh.getTriangleCount() * 3);
-            List<Vector3f> normals = new ArrayList<Vector3f>(mesh.getTriangleCount());
+            List<Vector3f> vertices = new ArrayList<>(mesh.getTriangleCount() * 3);
+            List<Vector3f> normals = new ArrayList<>(mesh.getTriangleCount());
             for (int i = 0; i < mesh.getTriangleCount(); ++i) {
                 mesh.getTriangle(i, indices);
                 vertices.add(vertexTable[indices[0]]);

+ 6 - 6
jme3-core/src/main/java/com/jme3/effect/shapes/EmitterMeshVertexShape.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2018 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@ public class EmitterMeshVertexShape implements EmitterShape {
      *        a list of meshes that will form the emitter's shape
      */
     public void setMeshes(List<Mesh> meshes) {
-        Map<Vector3f, Vector3f> vertToNormalMap = new HashMap<Vector3f, Vector3f>();
+        Map<Vector3f, Vector3f> vertToNormalMap = new HashMap<>();
 
         this.vertices = new ArrayList<List<Vector3f>>(meshes.size());
         this.normals = new ArrayList<List<Vector3f>>(meshes.size());
@@ -100,8 +100,8 @@ public class EmitterMeshVertexShape implements EmitterShape {
             }
 
             // adding data to vertices and normals
-            List<Vector3f> vertices = new ArrayList<Vector3f>(vertToNormalMap.size());
-            List<Vector3f> normals = new ArrayList<Vector3f>(vertToNormalMap.size());
+            List<Vector3f> vertices = new ArrayList<>(vertToNormalMap.size());
+            List<Vector3f> normals = new ArrayList<>(vertToNormalMap.size());
             for (Entry<Vector3f, Vector3f> entry : vertToNormalMap.entrySet()) {
                 vertices.add(entry.getKey());
                 normals.add(entry.getValue().normalizeLocal());
@@ -146,7 +146,7 @@ public class EmitterMeshVertexShape implements EmitterShape {
             if (this.vertices != null) {
                 clone.vertices = new ArrayList<List<Vector3f>>(vertices.size());
                 for (List<Vector3f> list : vertices) {
-                    List<Vector3f> vectorList = new ArrayList<Vector3f>(list.size());
+                    List<Vector3f> vectorList = new ArrayList<>(list.size());
                     for (Vector3f vector : list) {
                         vectorList.add(vector.clone());
                     }
@@ -156,7 +156,7 @@ public class EmitterMeshVertexShape implements EmitterShape {
             if (this.normals != null) {
                 clone.normals = new ArrayList<List<Vector3f>>(normals.size());
                 for (List<Vector3f> list : normals) {
-                    List<Vector3f> vectorList = new ArrayList<Vector3f>(list.size());
+                    List<Vector3f> vectorList = new ArrayList<>(list.size());
                     for (Vector3f vector : list) {
                         vectorList.add(vector.clone());
                     }

+ 1 - 1
jme3-core/src/main/java/com/jme3/environment/EnvironmentCamera.java

@@ -111,7 +111,7 @@ public class EnvironmentCamera extends BaseAppState {
      */
     protected int size = 256;
 
-    private final List<SnapshotJob> jobs = new ArrayList<SnapshotJob>();
+    private final List<SnapshotJob> jobs = new ArrayList<>();
 
     /**
      * Creates an EnvironmentCamera with a size of 256

+ 4 - 4
jme3-core/src/main/java/com/jme3/environment/util/LightsDebugState.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -54,14 +54,14 @@ import java.util.Map;
 public class LightsDebugState extends BaseAppState {
 
     private Node debugNode;
-    private final Map<LightProbe, Node> probeMapping = new HashMap<LightProbe, Node>();
-    private final List<LightProbe> garbage = new ArrayList<LightProbe>();
+    private final Map<LightProbe, Node> probeMapping = new HashMap<>();
+    private final List<LightProbe> garbage = new ArrayList<>();
     private Geometry debugGeom;
     private Geometry debugBounds;
     private Material debugMaterial;
     private float probeScale = 1.0f;
     private Spatial scene = null;
-    private final List<LightProbe> probes = new ArrayList<LightProbe>();
+    private final List<LightProbe> probes = new ArrayList<>();
 
     @Override
     protected void initialize(Application app) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -96,7 +96,7 @@ public class SavableClassUtil {
 
     @SuppressWarnings("unchecked")
     public static int[] getSavableVersions(Class<? extends Savable> clazz) throws IOException{
-        ArrayList<Integer> versionList = new ArrayList<Integer>();
+        ArrayList<Integer> versionList = new ArrayList<>();
         Class superclass = clazz;
         do {
             versionList.add(getSavableVersion(superclass));

+ 2 - 2
jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@ public class BitmapCharacter implements Savable, Cloneable {
     private int xOffset;
     private int yOffset;
     private int xAdvance;
-    private IntMap<Integer> kerning = new IntMap<Integer>();
+    private IntMap<Integer> kerning = new IntMap<>();
     private int page;
     
     public BitmapCharacter() {}

+ 1 - 1
jme3-core/src/main/java/com/jme3/font/BitmapCharacterSet.java

@@ -100,7 +100,7 @@ public class BitmapCharacterSet implements Savable {
     }
 
     private IntMap<BitmapCharacter> readCharset(InputCapsule ic, int style) throws IOException {
-        IntMap<BitmapCharacter> charset = new IntMap<BitmapCharacter>();
+        IntMap<BitmapCharacter> charset = new IntMap<>();
         short[] indexes = ic.readShortArray("indexes"+style, null);
         Savable[] chars = ic.readSavableArray("chars"+style, null);
 

+ 2 - 2
jme3-core/src/main/java/com/jme3/font/BitmapTextPage.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,7 @@ class BitmapTextPage extends Geometry {
     private final byte[] color;
     private final int page;
     private final Texture2D texture;
-    private final LinkedList<LetterQuad> pageQuads = new LinkedList<LetterQuad>();
+    private final LinkedList<LetterQuad> pageQuads = new LinkedList<>();
 
     BitmapTextPage(BitmapFont font, boolean arrayBased, int page) {
         super("BitmapFont", new Mesh());

+ 1 - 1
jme3-core/src/main/java/com/jme3/font/ColorTags.java

@@ -47,7 +47,7 @@ import java.util.regex.Pattern;
 class ColorTags {
     private static final Pattern colorPattern = Pattern.compile("\\\\#([0-9a-fA-F]{8})#|\\\\#([0-9a-fA-F]{6})#|" +
                                                                 "\\\\#([0-9a-fA-F]{4})#|\\\\#([0-9a-fA-F]{3})#");
-    final private LinkedList<Range> colors = new LinkedList<Range>();
+    final private LinkedList<Range> colors = new LinkedList<>();
     private String text;
     private String original;
     private float baseAlpha = -1;

+ 2 - 2
jme3-core/src/main/java/com/jme3/input/AbstractJoystick.java

@@ -47,8 +47,8 @@ public abstract class AbstractJoystick implements Joystick {
     final private int joyId;
     final private String name;
     
-    final private List<JoystickAxis> axes = new ArrayList<JoystickAxis>();       
-    final private List<JoystickButton> buttons = new ArrayList<JoystickButton>();       
+    final private List<JoystickAxis> axes = new ArrayList<>();       
+    final private List<JoystickButton> buttons = new ArrayList<>();       
 
     /**
      * Creates a new joystick instance. Only used internally.

+ 9 - 9
jme3-core/src/main/java/com/jme3/input/InputManager.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -101,19 +101,19 @@ public class InputManager implements RawInputListener {
     private float globalAxisDeadZone = 0.05f;
     private final Vector2f cursorPos = new Vector2f();
     private Joystick[] joysticks;
-    private final IntMap<ArrayList<Mapping>> bindings = new IntMap<ArrayList<Mapping>>();
-    private final HashMap<String, Mapping> mappings = new HashMap<String, Mapping>();
-    private final IntMap<Long> pressedButtons = new IntMap<Long>();
-    private final IntMap<Float> axisValues = new IntMap<Float>();
-    private final SafeArrayList<RawInputListener> rawListeners = new SafeArrayList<RawInputListener>(RawInputListener.class);
-    private final ArrayList<InputEvent> inputQueue = new ArrayList<InputEvent>();
+    private final IntMap<ArrayList<Mapping>> bindings = new IntMap<>();
+    private final HashMap<String, Mapping> mappings = new HashMap<>();
+    private final IntMap<Long> pressedButtons = new IntMap<>();
+    private final IntMap<Float> axisValues = new IntMap<>();
+    private final SafeArrayList<RawInputListener> rawListeners = new SafeArrayList<>(RawInputListener.class);
+    private final ArrayList<InputEvent> inputQueue = new ArrayList<>();
     private final List<JoystickConnectionListener> joystickConnectionListeners = new ArrayList<>();
 
     private static class Mapping {
 
         private final String name;
-        private final ArrayList<Integer> triggers = new ArrayList<Integer>();
-        private final ArrayList<InputListener> listeners = new ArrayList<InputListener>();
+        private final ArrayList<Integer> triggers = new ArrayList<>();
+        private final ArrayList<InputListener> listeners = new ArrayList<>();
 
         public Mapping(String name) {
             this.name = name;

+ 2 - 2
jme3-core/src/main/java/com/jme3/light/BasicProbeBlendingStrategy.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ import java.util.List;
  */
 public class BasicProbeBlendingStrategy implements LightProbeBlendingStrategy {
 
-    List<LightProbe> lightProbes = new ArrayList<LightProbe>();
+    List<LightProbe> lightProbes = new ArrayList<>();
 
     @Override
     public void registerProbe(LightProbe probe) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/light/DefaultLightFilter.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@ import java.util.HashSet;
 public final class DefaultLightFilter implements LightFilter {
 
     private Camera camera;
-    private final HashSet<Light> processedLights = new HashSet<Light>();
+    private final HashSet<Light> processedLights = new HashSet<>();
     private LightProbeBlendingStrategy probeBlendStrat;
 
     public DefaultLightFilter() {

+ 2 - 2
jme3-core/src/main/java/com/jme3/light/LightList.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -332,7 +332,7 @@ public final class LightList implements Iterable<Light>, Savable, Cloneable, Jme
         OutputCapsule oc = ex.getCapsule(this);
 //        oc.write(owner, "owner", null);
 
-        ArrayList<Light> lights = new ArrayList<Light>();
+        ArrayList<Light> lights = new ArrayList<>();
         for (int i = 0; i < listSize; i++){
             lights.add(list[i]);
         }

+ 2 - 2
jme3-core/src/main/java/com/jme3/light/WeightedProbeBlendingStrategy.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ import java.util.List;
 public class WeightedProbeBlendingStrategy implements LightProbeBlendingStrategy {
 
     private final static int MAX_PROBES = 3;
-    List<LightProbe> lightProbes = new ArrayList<LightProbe>();
+    List<LightProbe> lightProbes = new ArrayList<>();
 
     @Override
     public void registerProbe(LightProbe probe) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/material/Material.java

@@ -77,9 +77,9 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
     private AssetKey key;
     private String name;
     private MaterialDef def;
-    private ListMap<String, MatParam> paramValues = new ListMap<String, MatParam>();
+    private ListMap<String, MatParam> paramValues = new ListMap<>();
     private Technique technique;
-    private HashMap<String, Technique> techniques = new HashMap<String, Technique>();
+    private HashMap<String, Technique> techniques = new HashMap<>();
     private RenderState additionalState = null;
     final private RenderState mergedRenderState = new RenderState();
     private boolean transparent = false;

+ 7 - 7
jme3-core/src/main/java/com/jme3/material/ShaderGenerationInfo.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -53,11 +53,11 @@ public class ShaderGenerationInfo implements Savable, Cloneable {
     /**
      * the list of attributes of the vertex shader
      */
-    protected List<ShaderNodeVariable> attributes = new ArrayList<ShaderNodeVariable>();
+    protected List<ShaderNodeVariable> attributes = new ArrayList<>();
     /**
      * the list of all the uniforms to declare in the vertex shader
      */
-    protected List<ShaderNodeVariable> vertexUniforms = new ArrayList<ShaderNodeVariable>();
+    protected List<ShaderNodeVariable> vertexUniforms = new ArrayList<>();
     /**
      * the global output of the vertex shader (to assign ot gl_Position)
      */
@@ -65,19 +65,19 @@ public class ShaderGenerationInfo implements Savable, Cloneable {
     /**
      * the list of varyings
      */
-    protected List<ShaderNodeVariable> varyings = new ArrayList<ShaderNodeVariable>();
+    protected List<ShaderNodeVariable> varyings = new ArrayList<>();
     /**
      * the list of all the uniforms to declare in the fragment shader
      */
-    protected List<ShaderNodeVariable> fragmentUniforms = new ArrayList<ShaderNodeVariable>();
+    protected List<ShaderNodeVariable> fragmentUniforms = new ArrayList<>();
     /**
      * the list of all the fragment shader global outputs (to assign ot gl_FragColor or gl_Fragdata[n])
      */
-    protected List<ShaderNodeVariable> fragmentGlobals = new ArrayList<ShaderNodeVariable>();
+    protected List<ShaderNodeVariable> fragmentGlobals = new ArrayList<>();
     /**
      * the unused node names of this shader (node whose output are never used)
      */
-    protected List<String> unusedNodes = new ArrayList<String>();
+    protected List<String> unusedNodes = new ArrayList<>();
 
     /**
      *

+ 4 - 4
jme3-core/src/main/java/com/jme3/material/logic/StaticPassLightingLogic.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,9 +67,9 @@ public final class StaticPassLightingLogic extends DefaultTechniqueDefLogic {
     private final int numPointLightsDefineId;
     private final int numSpotLightsDefineId;
 
-    private final ArrayList<DirectionalLight> tempDirLights = new ArrayList<DirectionalLight>();
-    private final ArrayList<PointLight> tempPointLights = new ArrayList<PointLight>();
-    private final ArrayList<SpotLight> tempSpotLights = new ArrayList<SpotLight>();
+    private final ArrayList<DirectionalLight> tempDirLights = new ArrayList<>();
+    private final ArrayList<PointLight> tempPointLights = new ArrayList<>();
+    private final ArrayList<SpotLight> tempSpotLights = new ArrayList<>();
 
     private final ColorRGBA ambientLightColor = new ColorRGBA(0, 0, 0, 1);
     private final Vector3f tempPosition = new Vector3f();

+ 2 - 2
jme3-core/src/main/java/com/jme3/math/Spline.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ public class Spline implements Savable {
         Nurb
     }
 
-    private List<Vector3f> controlPoints = new ArrayList<Vector3f>();
+    private List<Vector3f> controlPoints = new ArrayList<>();
     private List<Float> knots;       //knots of NURBS spline
     private float[] weights;         //weights of NURBS spline
     private int basisFunctionDegree; //degree of NURBS spline basis function (computed automatically)

+ 2 - 2
jme3-core/src/main/java/com/jme3/opencl/DefaultPlatformChooser.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2016 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ public class DefaultPlatformChooser implements PlatformChooser {
 
     @Override
     public List<? extends Device> chooseDevices(List<? extends Platform> platforms) {
-        ArrayList<Device> result = new ArrayList<Device>();
+        ArrayList<Device> result = new ArrayList<>();
         for (Platform p : platforms) {
             if (!p.hasOpenGLInterop()) {
                 continue; //must support interop

+ 2 - 2
jme3-core/src/main/java/com/jme3/opencl/OpenCLObjectManager.java

@@ -53,8 +53,8 @@ public class OpenCLObjectManager {
         return INSTANCE;
     }
     
-    final private ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
-    final private HashSet<OpenCLObjectRef> activeObjects = new HashSet<OpenCLObjectRef>();
+    final private ReferenceQueue<Object> refQueue = new ReferenceQueue<>();
+    final private HashSet<OpenCLObjectRef> activeObjects = new HashSet<>();
     
     private static class OpenCLObjectRef extends PhantomReference<Object> {
         

+ 1 - 1
jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java

@@ -563,7 +563,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);
         numSamples = ic.readInt("numSamples", 0);
-        filters = new SafeArrayList<Filter>(Filter.class, ic.readSavableArrayList("filters", null));
+        filters = new SafeArrayList<>(Filter.class, ic.readSavableArrayList("filters", null));
         for (Filter filter : filters.getArray()) {
             filter.setProcessor(this);
             setFilterState(filter, filter.isEnabled());

+ 4 - 4
jme3-core/src/main/java/com/jme3/renderer/Statistics.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2018 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -60,9 +60,9 @@ public class Statistics {
     protected int memoryFrameBuffers;
     protected int memoryTextures;
 
-    protected IntMap<Void> shadersUsed = new IntMap<Void>();
-    protected IntMap<Void> texturesUsed = new IntMap<Void>();
-    protected IntMap<Void> fbosUsed = new IntMap<Void>();
+    protected IntMap<Void> shadersUsed = new IntMap<>();
+    protected IntMap<Void> texturesUsed = new IntMap<>();
+    protected IntMap<Void> fbosUsed = new IntMap<>();
 
     protected int lastShader = -1;
     

+ 3 - 3
jme3-core/src/main/java/com/jme3/renderer/ViewPort.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,8 +67,8 @@ public class ViewPort {
     protected final String name;
     protected final Camera cam;
     protected final RenderQueue queue = new RenderQueue();
-    protected final SafeArrayList<Spatial> sceneList = new SafeArrayList<Spatial>(Spatial.class);
-    protected final SafeArrayList<SceneProcessor> processors = new SafeArrayList<SceneProcessor>(SceneProcessor.class);
+    protected final SafeArrayList<Spatial> sceneList = new SafeArrayList<>(Spatial.class);
+    protected final SafeArrayList<SceneProcessor> processors = new SafeArrayList<>(SceneProcessor.class);
     protected FrameBuffer out = null;
 
     protected final ColorRGBA backColor = new ColorRGBA(0,0,0,0);

+ 2 - 2
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

@@ -88,7 +88,7 @@ public final class GLRenderer implements Renderer {
     private final RenderContext context = new RenderContext();
     private final NativeObjectManager objManager = new NativeObjectManager();
     private final EnumSet<Caps> caps = EnumSet.noneOf(Caps.class);
-    private final EnumMap<Limits, Integer> limits = new EnumMap<Limits, Integer>(Limits.class);
+    private final EnumMap<Limits, Integer> limits = new EnumMap<>(Limits.class);
 
     private FrameBuffer mainFbOverride = null;
     private int defaultFBO = 0;
@@ -134,7 +134,7 @@ public final class GLRenderer implements Renderer {
     }
 
     private HashSet<String> loadExtensions() {
-        HashSet<String> extensionSet = new HashSet<String>(64);
+        HashSet<String> extensionSet = new HashSet<>(64);
         if (caps.contains(Caps.OpenGL30)) {
             // If OpenGL3+ is available, use the non-deprecated way
             // of getting supported extensions.

+ 2 - 2
jme3-core/src/main/java/com/jme3/renderer/opengl/GLTimingState.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,5 +37,5 @@ public class GLTimingState {
     long timeSpentInGL = 0;
     int sampleCount = 0;
     long lastPrintOutTime = 0;
-    final HashMap<String, Long> callTiming = new HashMap<String, Long>();
+    final HashMap<String, Long> callTiming = new HashMap<>();
 }

+ 3 - 3
jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -69,7 +69,7 @@ public final class GLTracer implements InvocationHandler {
     private static final String ANSI_WHITE = "\u001B[37m";
 
     private static void noEnumArgs(String method, int... argSlots) {
-        IntMap<Void> argSlotsMap = new IntMap<Void>();
+        IntMap<Void> argSlotsMap = new IntMap<>();
         for (int argSlot : argSlots) {
             argSlotsMap.put(argSlot, null);
         }
@@ -146,7 +146,7 @@ public final class GLTracer implements InvocationHandler {
     }
     
     private static IntMap<String> generateConstantMap(Class<?> ... classes) {
-        IntMap<String> constMap = new IntMap<String>();
+        IntMap<String> constMap = new IntMap<>();
         for (Class<?> clazz : classes) {
             for (Field field : clazz.getFields()) {
                 if (field.getType() == int.class) {

+ 3 - 3
jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,8 +55,8 @@ import java.util.logging.Logger;
  */
 public class AssetLinkNode extends Node {
 
-    protected ArrayList<ModelKey> assetLoaderKeys = new ArrayList<ModelKey>();
-    protected Map<ModelKey, Spatial> assetChildren = new HashMap<ModelKey, Spatial>();
+    protected ArrayList<ModelKey> assetLoaderKeys = new ArrayList<>();
+    protected Map<ModelKey, Spatial> assetChildren = new HashMap<>();
 
     public AssetLinkNode() {
     }

+ 6 - 6
jme3-core/src/main/java/com/jme3/scene/BatchNode.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -73,11 +73,11 @@ public class BatchNode extends GeometryGroupNode {
     /**
      * the list of geometry holding the batched meshes
      */
-    protected SafeArrayList<Batch> batches = new SafeArrayList<Batch>(Batch.class);
+    protected SafeArrayList<Batch> batches = new SafeArrayList<>(Batch.class);
     /**
      * a map for storing the batches by geometry to quickly access the batch when updating
      */
-    protected Map<Geometry, Batch> batchesByGeom = new HashMap<Geometry, Batch>();
+    protected Map<Geometry, Batch> batchesByGeom = new HashMap<>();
     /**
      * used to store transformed vectors before proceeding to a bulk put into the FloatBuffer
      */
@@ -185,7 +185,7 @@ public class BatchNode extends GeometryGroupNode {
     }
 
     protected void doBatch() {
-        Map<Material, List<Geometry>> matMap = new HashMap<Material, List<Geometry>>();
+        Map<Material, List<Geometry>> matMap = new HashMap<>();
         int nbGeoms = 0;
 
         gatherGeometries(matMap, this, needsFullRebatch);
@@ -688,7 +688,7 @@ public class BatchNode extends GeometryGroupNode {
                 }
             }
             clone.needsFullRebatch = true;
-            clone.batches = new SafeArrayList<Batch>(Batch.class);
+            clone.batches = new SafeArrayList<>(Batch.class);
             clone.batchesByGeom = new HashMap<Geometry, Batch>();
             clone.batch();
         }
@@ -708,7 +708,7 @@ public class BatchNode extends GeometryGroupNode {
         this.tmpFloatT = cloner.clone(tmpFloatT);
 
 
-        HashMap<Geometry, Batch> newBatchesByGeom = new HashMap<Geometry, Batch>();
+        HashMap<Geometry, Batch> newBatchesByGeom = new HashMap<>();
         for (Map.Entry<Geometry, Batch> e : batchesByGeom.entrySet()) {
             newBatchesByGeom.put(cloner.clone(e.getKey()), cloner.clone(e.getValue()));
         }

+ 4 - 4
jme3-core/src/main/java/com/jme3/scene/Node.java

@@ -62,7 +62,7 @@ public class Node extends Spatial {
     /**
      * This node's children.
      */
-    protected SafeArrayList<Spatial> children = new SafeArrayList<Spatial>(Spatial.class);
+    protected SafeArrayList<Spatial> children = new SafeArrayList<>(Spatial.class);
     /**
      * If this node is a root, this list will contain the current
      * set of children (and children of children) that require
@@ -212,7 +212,7 @@ public class Node extends Spatial {
             return updateList;
         }
         if (updateList == null) {
-            updateList = new SafeArrayList<Spatial>(Spatial.class);
+            updateList = new SafeArrayList<>(Spatial.class);
         } else {
             updateList.clear();
         }
@@ -653,7 +653,7 @@ public class Node extends Spatial {
     @SuppressWarnings("unchecked")
     public <T extends Spatial> List<T> descendantMatches(
             Class<T> spatialSubclass, String nameRegex) {
-        List<T> newList = new ArrayList<T>();
+        List<T> newList = new ArrayList<>();
         if (getQuantity() < 1) {
             return newList;
         }
@@ -717,7 +717,7 @@ public class Node extends Spatial {
 
     public Spatial oldDeepClone() {
         Node nodeClone = (Node) super.clone();
-        nodeClone.children = new SafeArrayList<Spatial>(Spatial.class);
+        nodeClone.children = new SafeArrayList<>(Spatial.class);
         for (Spatial child : children) {
             Spatial childClone = child.deepClone();
             childClone.parent = nodeClone;

+ 3 - 3
jme3-core/src/main/java/com/jme3/scene/Spatial.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -153,7 +153,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable,
     public transient float queueDistance = Float.NEGATIVE_INFINITY;
     protected Transform localTransform;
     protected Transform worldTransform;
-    protected SafeArrayList<Control> controls = new SafeArrayList<Control>(Control.class);
+    protected SafeArrayList<Control> controls = new SafeArrayList<>(Control.class);
     protected HashMap<String, Savable> userData = null;
     /**
      * Used for smart asset caching
@@ -1800,7 +1800,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable,
      * @param visitor
      */
     public void breadthFirstTraversal(SceneGraphVisitor visitor) {
-        Queue<Spatial> queue = new LinkedList<Spatial>();
+        Queue<Spatial> queue = new LinkedList<>();
         queue.add(this);
 
         while (!queue.isEmpty()) {

+ 4 - 4
jme3-core/src/main/java/com/jme3/scene/UserData.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -219,7 +219,7 @@ public final class UserData implements Savable {
                 value = this.readList(ic, "0");
                 break;
             case TYPE_MAP:
-                Map<Object, Object> map = new HashMap<Object, Object>();
+                Map<Object, Object> map = new HashMap<>();
                 List<?> keys = this.readList(ic, "0");
                 List<?> values = this.readList(ic, "1");
                 for (int i = 0; i < keys.size(); ++i) {
@@ -316,7 +316,7 @@ public final class UserData implements Savable {
      */
     private List<?> readList(InputCapsule ic, String listName) throws IOException {
         int size = ic.readInt(listName + "size", 0);
-        List<Object> list = new ArrayList<Object>(size);
+        List<Object> list = new ArrayList<>(size);
         for (int i = 0; i < size; ++i) {
             int type = ic.readInt(listName + "t" + i, 0);
             switch (type) {
@@ -345,7 +345,7 @@ public final class UserData implements Savable {
                     list.add(this.readList(ic, listName + "v" + i));
                     break;
                 case TYPE_MAP:
-                    Map<Object, Object> map = new HashMap<Object, Object>();
+                    Map<Object, Object> map = new HashMap<>();
                     List<?> keys = this.readList(ic, listName + "v(keys)" + i);
                     List<?> values = this.readList(ic, listName + "v(vals)" + i);
                     for (int j = 0; j < keys.size(); ++j) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/scene/control/UpdateControl.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -61,7 +61,7 @@ public class UpdateControl extends AbstractControl {
      * rendering thread.
      */
     public <V> Future<V> enqueue(Callable<V> callable) {
-        AppTask<V> task = new AppTask<V>(callable);
+        AppTask<V> task = new AppTask<>(callable);
         taskQueue.add(task);
         return task;
     }

+ 4 - 4
jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java

@@ -176,12 +176,12 @@ public class InstancedNode extends GeometryGroupNode {
     protected InstancedNodeControl control;
 
     protected HashMap<Geometry, InstancedGeometry> igByGeom
-            = new HashMap<Geometry, InstancedGeometry>();
+            = new HashMap<>();
 
     private InstanceTypeKey lookUp = new InstanceTypeKey();
 
     private HashMap<InstanceTypeKey, InstancedGeometry> instancesMap =
-            new HashMap<InstanceTypeKey, InstancedGeometry>();
+            new HashMap<>();
 
     /**
      * Serialization only. Do not use.
@@ -374,13 +374,13 @@ public class InstancedNode extends GeometryGroupNode {
         this.control = cloner.clone(control);
         this.lookUp = cloner.clone(lookUp);
 
-        HashMap<Geometry, InstancedGeometry> newIgByGeom = new HashMap<Geometry, InstancedGeometry>();
+        HashMap<Geometry, InstancedGeometry> newIgByGeom = new HashMap<>();
         for( Map.Entry<Geometry, InstancedGeometry> e : igByGeom.entrySet() ) {
             newIgByGeom.put(cloner.clone(e.getKey()), cloner.clone(e.getValue()));
         }
         this.igByGeom = newIgByGeom;
 
-        HashMap<InstanceTypeKey, InstancedGeometry> newInstancesMap = new HashMap<InstanceTypeKey, InstancedGeometry>();
+        HashMap<InstanceTypeKey, InstancedGeometry> newInstancesMap = new HashMap<>();
         for( Map.Entry<InstanceTypeKey, InstancedGeometry> e : instancesMap.entrySet() ) {
             newInstancesMap.put(cloner.clone(e.getKey()), cloner.clone(e.getValue()));
         }

+ 4 - 4
jme3-core/src/main/java/com/jme3/scene/shape/Surface.java

@@ -137,7 +137,7 @@ public class Surface extends Mesh {
         float maxVKnot = this.getMaxVNurbKnot();
         float deltaV = (maxVKnot - minVKnot) / vSegments;
 
-        List<Vector3f> vertices = new ArrayList<Vector3f>((uSegments + 1) * (vSegments + 1));// new Vector3f[(uSegments + 1) * (vSegments + 1)];
+        List<Vector3f> vertices = new ArrayList<>((uSegments + 1) * (vSegments + 1));// new Vector3f[(uSegments + 1) * (vSegments + 1)];
 
         float u = minUKnot, v = minVKnot;
         for (int i = 0; i <= vSegments; ++i) {
@@ -164,7 +164,7 @@ public class Surface extends Mesh {
             int uVerticesAmount = uSegments + 1;
             int vVerticesAmount = vSegments + 1;
             int newUVerticesAmount = 2 + (uVerticesAmount - 2) * 2;
-            List<Vector3f> verticesWithUDuplicates = new ArrayList<Vector3f>(vVerticesAmount * newUVerticesAmount);
+            List<Vector3f> verticesWithUDuplicates = new ArrayList<>(vVerticesAmount * newUVerticesAmount);
             for(int i=0;i<vertices.size();++i) {
                 verticesWithUDuplicates.add(vertices.get(i));
                 if(i % uVerticesAmount != 0 && i % uVerticesAmount != uVerticesAmount - 1) {
@@ -172,7 +172,7 @@ public class Surface extends Mesh {
                 }
             }
             // and then duplicate all verts that are not on the border along the V axis
-            List<Vector3f> verticesWithVDuplicates = new ArrayList<Vector3f>(verticesWithUDuplicates.size() * vVerticesAmount);
+            List<Vector3f> verticesWithVDuplicates = new ArrayList<>(verticesWithUDuplicates.size() * vVerticesAmount);
             verticesWithVDuplicates.addAll(verticesWithUDuplicates.subList(0, newUVerticesAmount));
             for(int i=1;i<vSegments;++i) {
                 verticesWithVDuplicates.addAll(verticesWithUDuplicates.subList(i * newUVerticesAmount, i * newUVerticesAmount + newUVerticesAmount));
@@ -212,7 +212,7 @@ public class Surface extends Mesh {
 
         Vector3f[] verticesArray = vertices.toArray(new Vector3f[vertices.size()]);
         // normalMap merges normals of faces that will be rendered smooth
-        Map<Vector3f, Vector3f> normalMap = new HashMap<Vector3f, Vector3f>(verticesArray.length);
+        Map<Vector3f, Vector3f> normalMap = new HashMap<>(verticesArray.length);
         for (int i = 0; i < indices.length; i += 3) {
             Vector3f n = FastMath.computeNormal(verticesArray[indices[i]], verticesArray[indices[i + 1]], verticesArray[indices[i + 2]]);
             this.addNormal(n, normalMap, smooth, verticesArray[indices[i]], verticesArray[indices[i + 1]], verticesArray[indices[i + 2]]);

+ 5 - 5
jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -52,11 +52,11 @@ public class ShaderNodeDefinition implements Savable {
 
     private String name;
     private Shader.ShaderType type;
-    private List<String> shadersLanguage = new ArrayList<String>();
-    private List<String> shadersPath = new ArrayList<String>();
+    private List<String> shadersLanguage = new ArrayList<>();
+    private List<String> shadersPath = new ArrayList<>();
     private String documentation;
-    private List<ShaderNodeVariable> inputs = new ArrayList<ShaderNodeVariable>();
-    private List<ShaderNodeVariable> outputs = new ArrayList<ShaderNodeVariable>();
+    private List<ShaderNodeVariable> inputs = new ArrayList<>();
+    private List<ShaderNodeVariable> outputs = new ArrayList<>();
     private String path = null;
     private boolean noOutput = false;
 

+ 2 - 2
jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -109,7 +109,7 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable,
     /**
      * list of materials for post shadow queue geometries
      */
-    protected List<Material> matCache = new ArrayList<Material>();
+    protected List<Material> matCache = new ArrayList<>();
     protected GeometryList lightReceivers = new GeometryList(new OpaqueComparator());
     protected GeometryList shadowMapOccluders = new GeometryList(new OpaqueComparator());
     private String[] shadowMapStringCache;

+ 1 - 1
jme3-core/src/main/java/com/jme3/shadow/PssmShadowRenderer.java

@@ -171,7 +171,7 @@ public class PssmShadowRenderer implements SceneProcessor {
     protected boolean applyPCFEdge = true;
     protected boolean applyShadowIntensity = true;
     //a list of material of the post shadow queue geometries.
-    protected List<Material> matCache = new ArrayList<Material>();
+    protected List<Material> matCache = new ArrayList<>();
     //Holding the info for fading shadows in the far distance 
     protected Vector2f fadeInfo;
     protected float fadeLength;

+ 2 - 2
jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,7 @@ public abstract class JmeSystemDelegate {
     protected final Logger logger = Logger.getLogger(JmeSystem.class.getName());
     protected boolean initialized = false;
     protected boolean lowPermissions = false;
-    protected Map<JmeSystem.StorageFolderType, File> storageFolders = new EnumMap<JmeSystem.StorageFolderType, File>(JmeSystem.StorageFolderType.class);
+    protected Map<JmeSystem.StorageFolderType, File> storageFolders = new EnumMap<>(JmeSystem.StorageFolderType.class);
     protected SoftTextDialogInput softTextDialogInput = null;
 
     public synchronized File getStorageFolder(JmeSystem.StorageFolderType type) {

+ 1 - 1
jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java

@@ -80,7 +80,7 @@ public class FrameBuffer extends NativeObject {
     private int width = 0;
     private int height = 0;
     private int samples = 1;
-    final private ArrayList<RenderBuffer> colorBufs = new ArrayList<RenderBuffer>();
+    final private ArrayList<RenderBuffer> colorBufs = new ArrayList<>();
     private RenderBuffer depthBuf = null;
     private int colorBufIndex = 0;
     private boolean srgb;

+ 2 - 2
jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@ public class TextureCubeMap extends Texture {
 
     private static Image createEmptyLayeredImage(int width, int height,
             int layerCount, Image.Format format) {
-        ArrayList<ByteBuffer> layers = new ArrayList<ByteBuffer>();
+        ArrayList<ByteBuffer> layers = new ArrayList<>();
         for(int i = 0; i < layerCount; i++) {
             layers.add(null);
         }

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/ListMap.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -303,7 +303,7 @@ public final class ListMap<K, V> extends AbstractMap<K, V> implements Cloneable,
 
     @Override
     public ListMap<K, V> clone(){
-        ListMap<K, V> clone = new ListMap<K, V>(size());
+        ListMap<K, V> clone = new ListMap<>(size());
         clone.putAll(this);
         return clone;
     }

+ 4 - 4
jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java

@@ -98,8 +98,8 @@ public class MaterialDebugAppState extends AbstractAppState {
     private RenderManager renderManager;
     private AssetManager assetManager;
     private InputManager inputManager;
-    final private List<Binding> bindings = new ArrayList<Binding>();
-    final private Map<Trigger,List<Binding>> fileTriggers = new HashMap<Trigger,List<Binding>> ();
+    final private List<Binding> bindings = new ArrayList<>();
+    final private Map<Trigger,List<Binding>> fileTriggers = new HashMap<> ();
     
 
     @Override
@@ -304,7 +304,7 @@ public class MaterialDebugAppState extends AbstractAppState {
             Field[] fields1 = filter.getClass().getDeclaredFields();
             Field[] fields2 = filter.getClass().getSuperclass().getDeclaredFields();
 
-            List<Field> fields = new ArrayList<Field>();
+            List<Field> fields = new ArrayList<>();
             fields.addAll(Arrays.asList(fields1));
             fields.addAll(Arrays.asList(fields2));
             Material m = new Material();
@@ -335,7 +335,7 @@ public class MaterialDebugAppState extends AbstractAppState {
                     }
                     if (field.getName().equals("postRenderPasses")) {
                         field.setAccessible(true);
-                        List<Pass> passes = new ArrayList<Pass>();
+                        List<Pass> passes = new ArrayList<>();
                         passes = (List<Pass>) field.get(filter);
                         if (passes != null) {
                             for (Pass pass : passes) {

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -98,7 +98,7 @@ public class MipMapGenerator {
         int height = image.getHeight();
 
         Image current = image;
-        ArrayList<ByteBuffer> output = new ArrayList<ByteBuffer>();
+        ArrayList<ByteBuffer> output = new ArrayList<>();
         int totalSize = 0;
         
         while (height >= 1 || width >= 1){

+ 4 - 4
jme3-core/src/main/java/com/jme3/util/NativeObjectManager.java

@@ -69,17 +69,17 @@ public class NativeObjectManager {
     /**
      * Reference queue for {@link NativeObjectRef native object references}.
      */
-    private ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
+    private ReferenceQueue<Object> refQueue = new ReferenceQueue<>();
 
     /**
      * List of currently active GLObjects.
      */
-    final private HashMap<Long, NativeObjectRef> refMap = new HashMap<Long, NativeObjectRef>();
+    final private HashMap<Long, NativeObjectRef> refMap = new HashMap<>();
     
     /**
      * List of real objects requested by user for deletion.
      */
-    final private ArrayDeque<NativeObject> userDeletionQueue = new ArrayDeque<NativeObject>();
+    final private ArrayDeque<NativeObject> userDeletionQueue = new ArrayDeque<>();
 
     private static class NativeObjectRef extends PhantomReference<Object> {
         
@@ -199,7 +199,7 @@ public class NativeObjectManager {
      */
     public void deleteAllObjects(Object rendererObject){
         deleteUnused(rendererObject);
-        ArrayList<NativeObjectRef> refMapCopy = new ArrayList<NativeObjectRef>(refMap.values());
+        ArrayList<NativeObjectRef> refMapCopy = new ArrayList<>(refMap.values());
         for (NativeObjectRef ref : refMapCopy) {
             deleteNativeObject(rendererObject, ref.objClone, ref, true, false);
         }

+ 11 - 11
jme3-core/src/main/java/com/jme3/util/TangentBinormalGenerator.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@ public class TangentBinormalGenerator {
         public final Vector3f position;
         public final Vector3f normal;
         public final Vector2f texCoord;
-        public final ArrayList<Integer> indices = new ArrayList<Integer>();
+        public final ArrayList<Integer> indices = new ArrayList<>();
         
         public VertexInfo(Vector3f position, Vector3f normal, Vector2f texCoord) {
             this.position = position;
@@ -91,7 +91,7 @@ public class TangentBinormalGenerator {
     /** Collects all the triangle data for one vertex.
      */
     private static class VertexData {
-        public final ArrayList<TriangleData> triangles = new ArrayList<TriangleData>();
+        public final ArrayList<TriangleData> triangles = new ArrayList<>();
         
         public VertexData() { }
     }
@@ -118,7 +118,7 @@ public class TangentBinormalGenerator {
     }
     
     private static List<VertexData> initVertexData(int size) {
-        List<VertexData> vertices = new ArrayList<VertexData>(size);        
+        List<VertexData> vertices = new ArrayList<>(size);        
         for (int i = 0; i < size; i++) {
             vertices.add(new VertexData());
         }
@@ -152,7 +152,7 @@ public class TangentBinormalGenerator {
     }
     
     public static void generateParallel(Spatial scene, ExecutorService executor) {
-        final Set<Mesh> meshes = new HashSet<Mesh>();
+        final Set<Mesh> meshes = new HashSet<>();
         scene.breadthFirstTraversal(new SceneGraphVisitor() {
             @Override
             public void visit(Spatial spatial) {
@@ -168,7 +168,7 @@ public class TangentBinormalGenerator {
                 }
             }
         });
-        List<Future<?>> futures = new ArrayList<Future<?>>();
+        List<Future<?>> futures = new ArrayList<>();
         for (final Mesh m : meshes) {
             futures.add(executor.submit(new Runnable() {
                 @Override
@@ -269,8 +269,8 @@ public class TangentBinormalGenerator {
     //add another splitRotated boolean 
     private static List<VertexData> splitVertices(Mesh mesh, List<VertexData> vertexData, boolean splitMirorred) {
         int nbVertices = mesh.getBuffer(Type.Position).getNumElements();
-        List<VertexData> newVertices = new ArrayList<VertexData>();
-        Map<Integer, Integer> indiceMap = new HashMap<Integer, Integer>();
+        List<VertexData> newVertices = new ArrayList<>();
+        Map<Integer, Integer> indiceMap = new HashMap<>();
         FloatBuffer normalBuffer = mesh.getFloatBuffer(Type.Normal);
 
         for (int i = 0; i < vertexData.size(); i++) {
@@ -278,8 +278,8 @@ public class TangentBinormalGenerator {
             Vector3f givenNormal = new Vector3f();
             populateFromBuffer(givenNormal, normalBuffer, i);
           
-            ArrayList<TriangleData> trianglesUp = new ArrayList<TriangleData>();
-            ArrayList<TriangleData> trianglesDown = new ArrayList<TriangleData>();  
+            ArrayList<TriangleData> trianglesUp = new ArrayList<>();
+            ArrayList<TriangleData> trianglesDown = new ArrayList<>();  
             for (int j = 0; j < triangles.size(); j++) {
                 TriangleData triangleData = triangles.get(j);
                 if(parity(givenNormal, triangleData.normal) > 0){
@@ -625,7 +625,7 @@ public class TangentBinormalGenerator {
     }
     
     private static ArrayList<VertexInfo> linkVertices(Mesh mesh, boolean splitMirrored) {
-        ArrayList<VertexInfo> vertexMap = new ArrayList<VertexInfo>();
+        ArrayList<VertexInfo> vertexMap = new ArrayList<>();
         
         FloatBuffer vertexBuffer = mesh.getFloatBuffer(Type.Position);
         FloatBuffer normalBuffer = mesh.getFloatBuffer(Type.Normal);

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/TempVars.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -225,5 +225,5 @@ public class TempVars {
      */
     public final CollisionResults collisionResults = new CollisionResults();
     public final float[] bihSwapTmp = new float[9];
-    public final ArrayList<BIHStackData> bihStack = new ArrayList<BIHStackData>();
+    public final ArrayList<BIHStackData> bihStack = new ArrayList<>();
 }

+ 1 - 1
jme3-core/src/main/java/com/jme3/util/blockparser/BlockLanguageParser.java

@@ -41,7 +41,7 @@ import java.util.List;
 public class BlockLanguageParser {
     
     private Reader reader;
-    final private ArrayList<Statement> statementStack = new ArrayList<Statement>();
+    final private ArrayList<Statement> statementStack = new ArrayList<>();
     private Statement lastStatement;
     private int lineNumber = 1;
     

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/blockparser/Statement.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@ public class Statement {
 
     protected int lineNumber;
     protected String line;
-    protected List<Statement> contents = new ArrayList<Statement>();
+    protected List<Statement> contents = new ArrayList<>();
 
     protected Statement(int lineNumber, String line) {
         this.lineNumber = lineNumber;

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/clone/Cloner.java

@@ -104,12 +104,12 @@ public class Cloner {
     /**
      *  Keeps track of the objects that have been cloned so far.
      */
-    final private IdentityHashMap<Object, Object> index = new IdentityHashMap<Object, Object>();
+    final private IdentityHashMap<Object, Object> index = new IdentityHashMap<>();
 
     /**
      *  Custom functions for cloning objects.
      */
-    final private Map<Class, CloneFunction> functions = new HashMap<Class, CloneFunction>();
+    final private Map<Class, CloneFunction> functions = new HashMap<>();
 
     /**
      *  Cache the clone methods once for all cloners.

+ 1 - 1
jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java

@@ -1666,7 +1666,7 @@ public class MikktspaceTangentGenerator {
 
     private static class Group {
         int nrFaces;
-        List<Integer> faceIndices = new ArrayList<Integer>();
+        List<Integer> faceIndices = new ArrayList<>();
         int vertexRepresentitive;
         boolean orientPreservering;
     }

+ 5 - 5
jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java

@@ -148,16 +148,16 @@ public class BinaryExporter implements JmeExporter {
     protected int idCount = 1;
 
     protected IdentityHashMap<Savable, BinaryIdContentPair> contentTable
-             = new IdentityHashMap<Savable, BinaryIdContentPair>();
+             = new IdentityHashMap<>();
 
     protected HashMap<Integer, Integer> locationTable
-             = new HashMap<Integer, Integer>();
+             = new HashMap<>();
 
     // key - class name, value = bco
     final private HashMap<String, BinaryClassObject> classes
-             = new HashMap<String, BinaryClassObject>();
+             = new HashMap<>();
 
-    final private ArrayList<Savable> contentKeys = new ArrayList<Savable>();
+    final private ArrayList<Savable> contentKeys = new ArrayList<>();
 
     public static boolean debug = false;
     public static boolean useFastBufs = true;
@@ -259,7 +259,7 @@ public class BinaryExporter implements JmeExporter {
         // write out data to a separate stream
         int location = 0;
         // keep track of location for each piece
-        HashMap<String, ArrayList<BinaryIdContentPair>> alreadySaved = new HashMap<String, ArrayList<BinaryIdContentPair>>(
+        HashMap<String, ArrayList<BinaryIdContentPair>> alreadySaved = new HashMap<>(
                 contentTable.size());
         for (Savable savable : contentKeys) {
             // look back at previous written data for matches

+ 4 - 4
jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java

@@ -55,16 +55,16 @@ public final class BinaryImporter implements JmeImporter {
 
     //Key - alias, object - bco
     final private HashMap<String, BinaryClassObject> classes
-             = new HashMap<String, BinaryClassObject>();
+             = new HashMap<>();
     //Key - id, object - the savable
     final private HashMap<Integer, Savable> contentTable
-            = new HashMap<Integer, Savable>();
+            = new HashMap<>();
     //Key - savable, object - capsule
     final private IdentityHashMap<Savable, BinaryInputCapsule> capsuleTable
-             = new IdentityHashMap<Savable, BinaryInputCapsule>();
+             = new IdentityHashMap<>();
     //Key - id, opject - location in the file
     final private HashMap<Integer, Integer> locationTable
-             = new HashMap<Integer, Integer>();
+             = new HashMap<>();
 
     public static boolean debug = false;
 

+ 7 - 7
jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -561,7 +561,7 @@ final class BinaryInputCapsule implements InputCapsule {
         if(savables == null) {
             return null;
         }
-        ArrayList<Savable> arrayList = new ArrayList<Savable>(savables.length);
+        ArrayList<Savable> arrayList = new ArrayList<>(savables.length);
         for (int x = 0; x < savables.length; x++) {
             arrayList.add(savables[x]);
         }
@@ -573,7 +573,7 @@ final class BinaryInputCapsule implements InputCapsule {
         if(savables == null) {
             return null;
         }
-        Map<Savable, Savable> map = new HashMap<Savable, Savable>(savables.length);
+        Map<Savable, Savable> map = new HashMap<>(savables.length);
         for (int x = 0; x < savables.length; x++) {
             map.put(savables[x][0], savables[x][1]);
         }
@@ -585,7 +585,7 @@ final class BinaryInputCapsule implements InputCapsule {
             return null;
         }
 
-        Map<String, Savable> map = new HashMap<String, Savable>(keys.length);
+        Map<String, Savable> map = new HashMap<>(keys.length);
         for (int x = 0; x < keys.length; x++)
             map.put(keys[x], values[x]);
 
@@ -597,7 +597,7 @@ final class BinaryInputCapsule implements InputCapsule {
             return null;
         }
 
-        IntMap<Savable> map = new IntMap<Savable>(keys.length);
+        IntMap<Savable> map = new IntMap<>(keys.length);
         for (int x = 0; x < keys.length; x++)
             map.put(keys[x], values[x]);
 
@@ -1168,7 +1168,7 @@ final class BinaryInputCapsule implements InputCapsule {
         if (length == BinaryOutputCapsule.NULL_OBJECT) {
             return null;
         }
-        ArrayList<FloatBuffer> rVal = new ArrayList<FloatBuffer>(length);
+        ArrayList<FloatBuffer> rVal = new ArrayList<>(length);
         for (int x = 0; x < length; x++) {
             rVal.add(readFloatBuffer(content));
         }
@@ -1183,7 +1183,7 @@ final class BinaryInputCapsule implements InputCapsule {
         if (length == BinaryOutputCapsule.NULL_OBJECT) {
             return null;
         }
-        ArrayList<ByteBuffer> rVal = new ArrayList<ByteBuffer>(length);
+        ArrayList<ByteBuffer> rVal = new ArrayList<>(length);
         for (int x = 0; x < length; x++) {
             rVal.add(readByteBuffer(content));
         }

+ 2 - 2
jme3-core/src/plugins/java/com/jme3/material/plugins/ConditionParser.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,7 +89,7 @@ public class ConditionParser {
      * @return the list of defines
      */
     public List<String> extractDefines(String expression) {
-        List<String> defines = new ArrayList<String>();
+        List<String> defines = new ArrayList<>();
         expression = expression.replaceAll("#ifdef", "").replaceAll("#if", "").replaceAll("defined", "");
         Pattern pattern = Pattern.compile("(\\w+)");
         formattedExpression = expression;

+ 3 - 3
jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

@@ -73,7 +73,7 @@ public class J3MLoader implements AssetLoader {
     private Material material;
     private TechniqueDef technique;
     private RenderState renderState;
-    final private ArrayList<String> presetDefines = new ArrayList<String>();
+    final private ArrayList<String> presetDefines = new ArrayList<>();
 
     final private List<EnumMap<Shader.ShaderType, String>> shaderLanguages;
     final private EnumMap<Shader.ShaderType, String> shaderNames;
@@ -151,7 +151,7 @@ public class J3MLoader implements AssetLoader {
     }
 
     private List<String> tokenizeTextureValue(final String value) {
-        final List<String> matchList = new ArrayList<String>();
+        final List<String> matchList = new ArrayList<>();
         final Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
         final Matcher regexMatcher = regex.matcher(value.trim());
 
@@ -169,7 +169,7 @@ public class J3MLoader implements AssetLoader {
     }
 
     private List<TextureOptionValue> parseTextureOptions(final List<String> values) {
-        final List<TextureOptionValue> matchList = new ArrayList<TextureOptionValue>();
+        final List<TextureOptionValue> matchList = new ArrayList<>();
 
         if (values.isEmpty() || values.size() == 1) {
             return matchList;

+ 2 - 2
jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java

@@ -75,12 +75,12 @@ public class ShaderNodeLoaderDelegate {
     protected Set<String> varNames = new HashSet<>();
     protected AssetManager assetManager;
     protected ConditionParser conditionParser = new ConditionParser();
-    protected List<String> nulledConditions = new ArrayList<String>();
+    protected List<String> nulledConditions = new ArrayList<>();
 
     protected class DeclaredVariable {
 
         ShaderNodeVariable var;
-        List<ShaderNode> nodes = new ArrayList<ShaderNode>();
+        List<ShaderNode> nodes = new ArrayList<>();
 
         public DeclaredVariable(ShaderNodeVariable var) {
             this.var = var;

+ 10 - 10
jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java

@@ -63,17 +63,17 @@ public final class OBJLoader implements AssetLoader {
 
     private static final Logger logger = Logger.getLogger(OBJLoader.class.getName());
 
-    protected final ArrayList<Vector3f> verts = new ArrayList<Vector3f>();
-    protected final ArrayList<Vector2f> texCoords = new ArrayList<Vector2f>();
-    protected final ArrayList<Vector3f> norms = new ArrayList<Vector3f>();
+    protected final ArrayList<Vector3f> verts = new ArrayList<>();
+    protected final ArrayList<Vector2f> texCoords = new ArrayList<>();
+    protected final ArrayList<Vector3f> norms = new ArrayList<>();
 
-    private final ArrayList<Group> groups = new ArrayList<Group>();
+    private final ArrayList<Group> groups = new ArrayList<>();
 
     protected String currentMatName;
     protected String currentObjectName;
 
-    protected final HashMap<Vertex, Integer> vertIndexMap = new HashMap<Vertex, Integer>(100);
-    protected final IntMap<Vertex> indexVertMap = new IntMap<Vertex>(100);
+    protected final HashMap<Vertex, Integer> vertIndexMap = new HashMap<>(100);
+    protected final IntMap<Vertex> indexVertMap = new IntMap<>(100);
     protected int curIndex    = 0;
     protected int objectIndex = 0;
     protected int geomIndex   = 0;
@@ -88,8 +88,8 @@ public final class OBJLoader implements AssetLoader {
 
     private static class Group {
         final private String name;
-        private final ArrayList<Face> faces = new ArrayList<Face>();
-        private final HashMap<String, ArrayList<Face>> matFaces = new HashMap<String, ArrayList<Face>>();
+        private final ArrayList<Face> faces = new ArrayList<>();
+        private final HashMap<String, ArrayList<Face>> matFaces = new HashMap<>();
 
         public Group(final String name) {
             this.name = name;
@@ -237,7 +237,7 @@ public final class OBJLoader implements AssetLoader {
         return t;
     }
 
-    final private ArrayList<Vertex> vertList = new ArrayList<Vertex>();
+    final private ArrayList<Vertex> vertList = new ArrayList<>();
 
     protected void readFace(){
         Face f = new Face();
@@ -453,7 +453,7 @@ public final class OBJLoader implements AssetLoader {
         boolean hasTexCoord = false;
         boolean hasNormals  = false;
 
-        ArrayList<Face> newFaces = new ArrayList<Face>(faceList.size());
+        ArrayList<Face> newFaces = new ArrayList<>(faceList.size());
         for (int i = 0; i < faceList.size(); i++){
             Face f = faceList.get(i);
 

+ 4 - 4
jme3-core/src/plugins/java/com/jme3/shader/plugins/ShaderDependencyNode.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,9 @@ class ShaderDependencyNode {
     private String shaderSource;
     private String shaderName;
 
-    private final List<ShaderDependencyNode> dependencies = new ArrayList<ShaderDependencyNode>();
-    private final List<Integer> dependencyInjectIndices   = new ArrayList<Integer>();
-    private final List<ShaderDependencyNode> dependOnMe   = new ArrayList<ShaderDependencyNode>();
+    private final List<ShaderDependencyNode> dependencies = new ArrayList<>();
+    private final List<Integer> dependencyInjectIndices   = new ArrayList<>();
+    private final List<ShaderDependencyNode> dependOnMe   = new ArrayList<>();
 
     public ShaderDependencyNode(String shaderName){
         this.shaderName = shaderName;

+ 2 - 2
jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -746,7 +746,7 @@ public class DDSLoader implements AssetLoader {
             totalSize += sizes[i];
         }
 
-        ArrayList<ByteBuffer> allMaps = new ArrayList<ByteBuffer>();
+        ArrayList<ByteBuffer> allMaps = new ArrayList<>();
         if (depth > 1 && !texture3D) {
             for (int i = 0; i < depth; i++) {
                 if (compressed) {

+ 2 - 2
jme3-core/src/plugins/java/com/jme3/texture/plugins/ktx/KTXLoader.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2018 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -259,7 +259,7 @@ public class KTXLoader implements AssetLoader {
      * @return 
      */
     private Image createImage(int nbSlices, int byteBuffersSize, Image.Format imgFormat, int pixelWidth, int pixelHeight, int depth) {
-        ArrayList<ByteBuffer> imageData = new ArrayList<ByteBuffer>(nbSlices);
+        ArrayList<ByteBuffer> imageData = new ArrayList<>(nbSlices);
         for (int i = 0; i < nbSlices; i++) {
             imageData.add(BufferUtils.createByteBuffer(byteBuffersSize));
         }

+ 1 - 1
jme3-core/src/test/java/com/jme3/renderer/OpaqueComparatorTest.java

@@ -108,7 +108,7 @@ public class OpaqueComparatorTest {
             System.out.println(mat);
         }
         
-        Set<String> alreadySeen = new HashSet<String>();
+        Set<String> alreadySeen = new HashSet<>();
         Material current = null;
         for (int i = 0; i < gl.size(); i++) {
             Material mat = gl.get(i).getMaterial();

+ 3 - 3
jme3-core/src/test/java/com/jme3/scene/MPOTestUtils.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2016 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,12 +55,12 @@ public class MPOTestUtils {
     private static void validateSubScene(Spatial scene) {
         scene.checkCulling(DUMMY_CAM);
 
-        Set<MatParamOverride> actualOverrides = new HashSet<MatParamOverride>();
+        Set<MatParamOverride> actualOverrides = new HashSet<>();
         for (MatParamOverride override : scene.getWorldMatParamOverrides()) {
             actualOverrides.add(override);
         }
 
-        Set<MatParamOverride> expectedOverrides = new HashSet<MatParamOverride>();
+        Set<MatParamOverride> expectedOverrides = new HashSet<>();
         Spatial current = scene;
         while (current != null) {
             for (MatParamOverride override : current.getLocalMatParamOverrides()) {

+ 2 - 2
jme3-core/src/test/java/com/jme3/util/ListMapTest.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@ public class ListMapTest {
 
     @Test
     public void testListMap() {
-        ListMap<String, String> listMap = new ListMap<String, String>();
+        ListMap<String, String> listMap = new ListMap<>();
         listMap.put("bob", "hello");
         assert "hello".equals(listMap.get("bob"));
         assert "hello".equals(listMap.remove("bob"));

+ 7 - 7
jme3-core/src/tools/java/jme3tools/optimize/GeometryBatchFactory.java

@@ -312,8 +312,8 @@ public class GeometryBatchFactory {
      * @return A List of newly created Geometries, each with a  distinct material
      */
     public static List<Geometry> makeBatches(Collection<Geometry> geometries, boolean useLods) {
-        ArrayList<Geometry> retVal = new ArrayList<Geometry>();
-        HashMap<Material, List<Geometry>> matToGeom = new HashMap<Material, List<Geometry>>();
+        ArrayList<Geometry> retVal = new ArrayList<>();
+        HashMap<Material, List<Geometry>> matToGeom = new HashMap<>();
 
         for (Geometry geom : geometries) {
             List<Geometry> outList = matToGeom.get(geom.getMaterial());
@@ -384,7 +384,7 @@ public class GeometryBatchFactory {
      * @return The newly created optimized geometries attached to a node
      */
     public static Node optimize(Node scene, boolean useLods) {
-        ArrayList<Geometry> geoms = new ArrayList<Geometry>();
+        ArrayList<Geometry> geoms = new ArrayList<>();
 
         gatherGeoms(scene, geoms);
 
@@ -447,7 +447,7 @@ public class GeometryBatchFactory {
 
         Geometry g1 = new Geometry("g1", mesh);
 
-        ArrayList<Geometry> geoms = new ArrayList<Geometry>();
+        ArrayList<Geometry> geoms = new ArrayList<>();
         geoms.add(g1);
 
         Mesh outMesh = new Mesh();
@@ -481,12 +481,12 @@ public class GeometryBatchFactory {
      * Very experimental for now.
      */
     public static void alignBuffers(Node n, AlignOption option) {
-        List<Geometry> geoms = new ArrayList<Geometry>();
+        List<Geometry> geoms = new ArrayList<>();
         gatherGeoms(n, geoms);
 
         //gather buffer types
-        Map<VertexBuffer.Type, VertexBuffer> types = new EnumMap<VertexBuffer.Type, VertexBuffer>(VertexBuffer.Type.class);
-        Map<VertexBuffer.Type, Integer> typesCount = new EnumMap<VertexBuffer.Type, Integer>(VertexBuffer.Type.class);
+        Map<VertexBuffer.Type, VertexBuffer> types = new EnumMap<>(VertexBuffer.Type.class);
+        Map<VertexBuffer.Type, Integer> typesCount = new EnumMap<>(VertexBuffer.Type.class);
         for (Geometry geom : geoms) {
             for (VertexBuffer buffer : geom.getMesh().getBufferList()) {
                 if (types.get(buffer.getBufferType()) == null) {

+ 7 - 7
jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java

@@ -103,10 +103,10 @@ public class LodGenerator {
     private Vector3f tmpV2 = new Vector3f();
     private boolean bestQuality = true;
     private int indexCount = 0;
-    private List<Vertex> collapseCostSet = new ArrayList<Vertex>();
+    private List<Vertex> collapseCostSet = new ArrayList<>();
     private float collapseCostLimit;
     private List<Triangle> triangleList;
-    private List<Vertex> vertexList = new ArrayList<Vertex>();
+    private List<Vertex> vertexList = new ArrayList<>();
     private float meshBoundingSphereRadius;
     final private Mesh mesh;
 
@@ -183,8 +183,8 @@ public class LodGenerator {
         
         Vector3f position = new Vector3f();
         float collapseCost = UNINITIALIZED_COLLAPSE_COST;
-        List<Edge> edges = new ArrayList<Edge>();
-        Set<Triangle> triangles = new HashSet<Triangle>();
+        List<Edge> edges = new ArrayList<>();
+        Set<Triangle> triangles = new HashSet<>();
         Vertex collapseTo;
         boolean isSeam;
         int index;//index in the buffer for debugging
@@ -279,7 +279,7 @@ public class LodGenerator {
         BoundingSphere bs = new BoundingSphere();
         bs.computeFromPoints(mesh.getFloatBuffer(VertexBuffer.Type.Position));
         meshBoundingSphereRadius = bs.getRadius();
-        List<Vertex> vertexLookup = new ArrayList<Vertex>();
+        List<Vertex> vertexLookup = new ArrayList<>();
         initialize();
         
         gatherVertexData(mesh, vertexLookup);
@@ -896,7 +896,7 @@ public class LodGenerator {
         // It may have vertexIDs and triangles from different submeshes(different vertex buffers),
         // so we need to connect them correctly based on deleted triangle's edge.
         // mCollapsedEdgeIDs will be used, when looking up the connections for replacement.
-        List<CollapsedEdge> tmpCollapsedEdges = new ArrayList<CollapsedEdge>();
+        List<CollapsedEdge> tmpCollapsedEdges = new ArrayList<>();
         for (Iterator<Triangle> it = src.triangles.iterator(); it.hasNext();) {
             Triangle triangle = it.next();
             if (triangle.hasVertex(dest)) {
@@ -981,7 +981,7 @@ public class LodGenerator {
             // TODO: Find out why is this needed. assertOutdatedCollapseCost() fails on some
             // rare situations without this. For example goblin.mesh fails.
             //Treeset to have an ordered list with unique values
-            SortedSet<Vertex> updatable = new TreeSet<Vertex>(collapseComparator);
+            SortedSet<Vertex> updatable = new TreeSet<>(collapseComparator);
             
             for (Edge edge : src.edges) {
                 updatable.add(edge.destination);

+ 2 - 2
jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java

@@ -469,7 +469,7 @@ public class TextureAtlas {
      * @return Null if the atlas cannot be created because not all textures fit.
      */
     public static TextureAtlas createAtlas(Spatial root, int atlasSize) {
-        List<Geometry> geometries = new ArrayList<Geometry>();
+        List<Geometry> geometries = new ArrayList<>();
         GeometryBatchFactory.gatherGeoms(root, geometries);
         TextureAtlas atlas = new TextureAtlas(atlasSize, atlasSize);
         for (Geometry geometry : geometries) {
@@ -490,7 +490,7 @@ public class TextureAtlas {
      * @return A new geometry that uses the generated texture atlas and merges all meshes of the root spatial, null if the atlas cannot be created because not all textures fit.
      */
     public static Geometry makeAtlasBatch(Spatial spat, AssetManager mgr, int atlasSize) {
-        List<Geometry> geometries = new ArrayList<Geometry>();
+        List<Geometry> geometries = new ArrayList<>();
         GeometryBatchFactory.gatherGeoms(spat, geometries);
         TextureAtlas atlas = createAtlas(spat, atlasSize);
         if (atlas == null) {