瀏覽代碼

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

Stephen Gold 4 年之前
父節點
當前提交
80eebb4e81
共有 28 個文件被更改,包括 90 次插入90 次删除
  1. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/AnimationList.java
  2. 4 4
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/FbxLoader.java
  3. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java
  4. 1 1
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneWithAnimationLoader.java
  5. 4 4
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxAnimCurveNode.java
  6. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxAnimLayer.java
  7. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxBindPose.java
  8. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxLimbNode.java
  9. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxSkinDeformer.java
  10. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxToJmeTrack.java
  11. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.java
  12. 4 4
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxElement.java
  13. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxFile.java
  14. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/material/FbxMaterialProperties.java
  15. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayer.java
  16. 6 6
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.java
  17. 5 5
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.java
  18. 2 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxMesh.java
  19. 7 7
      jme3-plugins/src/main/java/com/jme3/scene/plugins/IrUtils.java
  20. 5 5
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java
  21. 2 2
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java
  22. 2 2
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.java
  23. 1 1
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMeshLoader.java
  24. 2 2
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.java
  25. 2 2
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtension.java
  26. 3 3
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionSet.java
  27. 16 16
      jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java
  28. 2 2
      jme3-plugins/src/xml/java/com/jme3/export/xml/DOMOutputCapsule.java

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/AnimationList.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
@@ -43,7 +43,7 @@ import java.util.List;
  */
 public class AnimationList {
 	
-	List<AnimInverval> list = new ArrayList<AnimInverval>();
+	List<AnimInverval> list = new ArrayList<>();
 	
 	/**
 	 * Use in the case of multiple animation layers in FBX asset

+ 4 - 4
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/FbxLoader.java

@@ -80,10 +80,10 @@ public class FbxLoader implements AssetLoader {
     private String sceneFilename;
     private String sceneFolderName;
     private FbxGlobalSettings globalSettings;
-    private final Map<FbxId, FbxObject> objectMap = new HashMap<FbxId, FbxObject>();
+    private final Map<FbxId, FbxObject> objectMap = new HashMap<>();
     
-    private final List<FbxAnimStack> animStacks = new ArrayList<FbxAnimStack>();
-    private final List<FbxBindPose> bindPoses = new ArrayList<FbxBindPose>();
+    private final List<FbxAnimStack> animStacks = new ArrayList<>();
+    private final List<FbxBindPose> bindPoses = new ArrayList<>();
     
     @Override
     public Object load(AssetInfo assetInfo) throws IOException {
@@ -308,7 +308,7 @@ public class FbxLoader implements AssetLoader {
         // So, we need to use heuristics to find which node(s) 
         // an animation is associated with, so we can create the AnimControl
         // in the appropriate location in the scene.
-        Map<FbxToJmeTrack, FbxToJmeTrack> pairs = new HashMap<FbxToJmeTrack, FbxToJmeTrack>();
+        Map<FbxToJmeTrack, FbxToJmeTrack> pairs = new HashMap<>();
         for (FbxAnimStack stack : animStacks) {
             for (FbxAnimLayer layer : stack.getLayers()) {
                 for (FbxAnimCurveNode curveNode : layer.getAnimationCurveNodes()) {

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java

@@ -310,7 +310,7 @@ public class SceneLoader implements AssetLoader {
 			}
 		}
 		// Extract animations
-		HashMap<String, Animation> anims = new HashMap<String, Animation>();
+		HashMap<String, Animation> anims = new HashMap<>();
 		for(AnimInverval animInfo : animList.list) {
 			float realLength = 0;
 			float length = (animInfo.lastFrame - animInfo.firstFrame) / this.animFrameRate;
@@ -331,7 +331,7 @@ public class SceneLoader implements AssetLoader {
 				// Animation channels may have different keyframes (non-baked animation).
 				//   So we have to restore intermediate values for all channels cause of JME requires
 				//   a bone track as a single channel with collective transformation for each keyframe
-				Set<Long> stamps = new TreeSet<Long>(); // Sorted unique timestamps
+				Set<Long> stamps = new TreeSet<>(); // Sorted unique timestamps
 				FbxAnimNode animTranslation = limb.animTranslation(sourceLayerId);
 				FbxAnimNode animRotation = limb.animRotation(sourceLayerId);
 				FbxAnimNode animScale = limb.animScale(sourceLayerId);

+ 1 - 1
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneWithAnimationLoader.java

@@ -57,7 +57,7 @@ public class SceneWithAnimationLoader implements AssetLoader {
 	}
 	
 	private String[] split(String src) {
-		List<String> list = new ArrayList<String>();
+		List<String> list = new ArrayList<>();
 		Matcher m = splitStrings.matcher(src);
 		while(m.find())
 			list.add(m.group(1).replace("\"", ""));

+ 4 - 4
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxAnimCurveNode.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
@@ -48,9 +48,9 @@ public class FbxAnimCurveNode extends FbxObject {
 
     private static final Logger logger = Logger.getLogger(FbxAnimCurveNode.class.getName());
     
-    private final Map<FbxNode, String> influencedNodePropertiesMap = new HashMap<FbxNode, String>();
-    private final Map<String, FbxAnimCurve> propertyToCurveMap = new HashMap<String, FbxAnimCurve>();
-    private final Map<String, Float> propertyToDefaultMap = new HashMap<String, Float>();
+    private final Map<FbxNode, String> influencedNodePropertiesMap = new HashMap<>();
+    private final Map<String, FbxAnimCurve> propertyToCurveMap = new HashMap<>();
+    private final Map<String, Float> propertyToDefaultMap = new HashMap<>();
     
     public FbxAnimCurveNode(AssetManager assetManager, String sceneFolderName) {
         super(assetManager, sceneFolderName);

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxAnimLayer.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 FbxAnimLayer extends FbxObject {
 
     private static final Logger logger = Logger.getLogger(FbxAnimLayer.class.getName());
     
-    private final List<FbxAnimCurveNode> animCurves = new ArrayList<FbxAnimCurveNode>();
+    private final List<FbxAnimCurveNode> animCurves = new ArrayList<>();
     
     public FbxAnimLayer(AssetManager assetManager, String sceneFolderName) {
         super(assetManager, sceneFolderName);

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxBindPose.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
@@ -41,7 +41,7 @@ import java.util.Map;
 
 public class FbxBindPose extends FbxObject<Map<FbxId, Matrix4f>> {
 
-    private final Map<FbxId, Matrix4f> bindPose = new HashMap<FbxId, Matrix4f>();
+    private final Map<FbxId, Matrix4f> bindPose = new HashMap<>();
     
     public FbxBindPose(AssetManager assetManager, String sceneFolderName) {
         super(assetManager, sceneFolderName);

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxLimbNode.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,7 +67,7 @@ public class FbxLimbNode extends FbxNode {
             throw new UnsupportedOperationException("Limb nodes cannot be skeleton holders");
         }
         
-        List<Bone> bones = new ArrayList<Bone>();
+        List<Bone> bones = new ArrayList<>();
         
         for (FbxNode child : skeletonHolderNode.getChildren()) {
             if (child instanceof FbxLimbNode) {

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxSkinDeformer.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
@@ -38,7 +38,7 @@ import java.util.List;
 
 public class FbxSkinDeformer extends FbxObject<List<FbxCluster>> {
 
-    private final List<FbxCluster> clusters = new ArrayList<FbxCluster>();
+    private final List<FbxCluster> clusters = new ArrayList<>();
     
     public FbxSkinDeformer(AssetManager assetManager, String sceneFolderName) {
         super(assetManager, sceneFolderName);

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/anim/FbxToJmeTrack.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
@@ -58,7 +58,7 @@ public final class FbxToJmeTrack {
     public transient final Map<String, FbxAnimCurveNode> animCurves = new HashMap<String, FbxAnimCurveNode>();
 
     public long[] getKeyTimes() {
-        Set<Long> keyFrameTimesSet = new HashSet<Long>();
+        Set<Long> keyFrameTimesSet = new HashSet<>();
         for (FbxAnimCurveNode curveNode : animCurves.values()) {
             for (FbxAnimCurve curve : curveNode.getCurves()) {
                 for (long keyTime : curve.getKeyTimes()) {

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.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
@@ -63,7 +63,7 @@ public final class FbxDump {
      * @return The UID to object map.
      */
     private static Map<FbxId, FbxElement> createUidToObjectMap(FbxFile file) {
-        Map<FbxId, FbxElement> uidToObjectMap = new HashMap<FbxId, FbxElement>();
+        Map<FbxId, FbxElement> uidToObjectMap = new HashMap<>();
         for (FbxElement rootElement : file.rootElements) {
             if (rootElement.id.equals("Objects")) {
                 for (FbxElement fbxObj : rootElement.children) {

+ 4 - 4
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxElement.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2014 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 class FbxElement {
 	 * c - array of unsigned bytes (represented as array of ints)
 	 */
 	public char[] propertiesTypes;
-	public List<FbxElement> children = new ArrayList<FbxElement>();
+	public List<FbxElement> children = new ArrayList<>();
 	
 	public FbxElement(int propsCount) {
 		this.properties = new ArrayList<Object>(propsCount);
@@ -72,7 +72,7 @@ public class FbxElement {
         }
         
         public List<FbxElement> getFbxProperties() {
-            List<FbxElement> props = new ArrayList<FbxElement>();
+            List<FbxElement> props = new ArrayList<>();
             FbxElement propsElement = null;
             boolean legacy = false;
             
@@ -99,7 +99,7 @@ public class FbxElement {
                         types[1] = prop.propertiesTypes[0];
                         System.arraycopy(prop.propertiesTypes, 1, types, 2, types.length - 2);
                         
-                        List<Object> values = new ArrayList<Object>(prop.properties);
+                        List<Object> values = new ArrayList<>(prop.properties);
                         values.add(1, values.get(0));
                         
                         FbxElement dummyProp = new FbxElement(types.length);

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxFile.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2014 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@ import java.util.List;
 
 public class FbxFile {
 	
-	public List<FbxElement> rootElements = new ArrayList<FbxElement>();
+	public List<FbxElement> rootElements = new ArrayList<>();
 	public long version;
 	
         @Override

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/material/FbxMaterialProperties.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
@@ -44,7 +44,7 @@ public class FbxMaterialProperties {
     
     private static final Map<String, FBXMaterialProperty> propertyMetaMap = new HashMap<String, FBXMaterialProperty>();
     
-    private final Map<String, Object> propertyValueMap = new HashMap<String, Object>();
+    private final Map<String, Object> propertyValueMap = new HashMap<>();
     
     private static enum Type {
         Color,

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayer.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
@@ -49,7 +49,7 @@ public final class FbxLayer {
     
     int layer;
     final EnumMap<FbxLayerElement.Type, FbxLayerElementRef> references = 
-            new EnumMap<FbxLayerElement.Type, FbxLayerElementRef>(FbxLayerElement.Type.class);
+            new EnumMap<>(FbxLayerElement.Type.class);
     
     private FbxLayer() { }
     

+ 6 - 6
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.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
@@ -78,8 +78,8 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
     public void fromElement(FbxElement element) {
         super.fromElement(element);
         
-        List<FbxLayerElement> layerElementsList = new ArrayList<FbxLayerElement>();
-        List<FbxLayer> layersList = new ArrayList<FbxLayer>();
+        List<FbxLayerElement> layerElementsList = new ArrayList<>();
+        List<FbxLayer> layersList = new ArrayList<>();
         
         for (FbxElement e : element.children) {
             if (e.id.equals("Vertices")) {
@@ -172,10 +172,10 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
     }
     
     private void setPolygonVertexIndices(int[] polygonVertexIndices) {
-        List<FbxPolygon> polygonList = new ArrayList<FbxPolygon>();
+        List<FbxPolygon> polygonList = new ArrayList<>();
 
         boolean finishPolygon = false;
-        List<Integer> vertexIndices = new ArrayList<Integer>();
+        List<Integer> vertexIndices = new ArrayList<>();
 
         for (int i = 0; i < polygonVertexIndices.length; i++) {
             int vertexIndex = polygonVertexIndices[i];
@@ -230,7 +230,7 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
         IntMap<IrMesh> irMeshes = IrUtils.splitByMaterial(irMesh);
         
         // Create a jME3 Mesh for each material index.
-        IntMap<Mesh> jmeMeshes = new IntMap<Mesh>();
+        IntMap<Mesh> jmeMeshes = new IntMap<>();
         for (IntMap.Entry<IrMesh> irMeshEntry : irMeshes) {
             Mesh jmeMesh = IrUtils.convertIrMeshToJmeMesh(irMeshEntry.getValue());
             jmeMeshes.put(irMeshEntry.getKey(), jmeMesh);

+ 5 - 5
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.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
@@ -98,10 +98,10 @@ public class FbxNode extends FbxObject<Spatial> {
     private InheritMode inheritMode = InheritMode.ScaleAfterChildRotation;
 
     protected FbxNode parent;
-    protected List<FbxNode> children = new ArrayList<FbxNode>();
-    protected List<FbxMaterial> materials = new ArrayList<FbxMaterial>();
-    protected Map<String, Object> userData = new HashMap<String, Object>();
-    protected Map<String, List<FbxAnimCurveNode>> propertyToAnimCurveMap = new HashMap<String, List<FbxAnimCurveNode>>();
+    protected List<FbxNode> children = new ArrayList<>();
+    protected List<FbxMaterial> materials = new ArrayList<>();
+    protected Map<String, Object> userData = new HashMap<>();
+    protected Map<String, List<FbxAnimCurveNode>> propertyToAnimCurveMap = new HashMap<>();
     protected FbxNodeAttribute nodeAttribute;
     protected double visibility = 1.0;
     

+ 2 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxMesh.java

@@ -334,7 +334,7 @@ public class FbxMesh extends FbxObject {
 			for(int i = 0; i < vCount; ++i) {
 				vertexMap.set(i, i);
 				indexMap.set(i, i);
-				List<Integer> l = new ArrayList<Integer>(1);
+				List<Integer> l = new ArrayList<>(1);
 				l.add(i);
 				reverseVertexMap.add(l);
 			}
@@ -488,7 +488,7 @@ public class FbxMesh extends FbxObject {
 				tcBuf.put(u).put(v);
 			}
 		}
-		List<Geometry> geometries = new ArrayList<Geometry>();
+		List<Geometry> geometries = new ArrayList<>();
 		if(materialsReference.equals("IndexToDirect") && materialsMapping.equals("ByPolygon")) {
 			IntMap<List<Integer>> indexBuffers = new IntMap<>();
 			for(int polygon = 0; polygon < materials.length; ++polygon) {

+ 7 - 7
jme3-plugins/src/main/java/com/jme3/scene/plugins/IrUtils.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
@@ -176,7 +176,7 @@ public final class IrUtils {
      * Convert mesh from quads / triangles to triangles only.
      */
     public static void triangulate(IrMesh mesh) {
-        List<IrPolygon> newPolygons = new ArrayList<IrPolygon>(mesh.polygons.length);
+        List<IrPolygon> newPolygons = new ArrayList<>(mesh.polygons.length);
         for (IrPolygon inputPoly : mesh.polygons) {
             if (inputPoly.vertices.length == 4) {
                 IrPolygon[] tris = quadToTri(inputPoly);
@@ -202,7 +202,7 @@ public final class IrUtils {
      * Polygons without a material will be added to key = -1.
      */
     public static IntMap<IrMesh> splitByMaterial(IrMesh mesh) {
-        IntMap<List<IrPolygon>> materialToPolyList = new IntMap<List<IrPolygon>>();
+        IntMap<List<IrPolygon>> materialToPolyList = new IntMap<>();
         for (IrPolygon polygon : mesh.polygons) {
             int materialIndex = -1;
             for (IrVertex vertex : polygon.vertices) {
@@ -223,7 +223,7 @@ public final class IrUtils {
             }
             polyList.add(polygon);
         }
-        IntMap<IrMesh> materialToMesh = new IntMap<IrMesh>();
+        IntMap<IrMesh> materialToMesh = new IntMap<>();
         for (IntMap.Entry<List<IrPolygon>> entry : materialToPolyList) {
             int key = entry.getKey();
             List<IrPolygon> polygons = entry.getValue();
@@ -241,9 +241,9 @@ public final class IrUtils {
      * Convert IrMesh to jME3 mesh.
      */
     public static Mesh convertIrMeshToJmeMesh(IrMesh mesh) {
-        Map<IrVertex, Integer> vertexToVertexIndex = new HashMap<IrVertex, Integer>();
-        List<IrVertex> vertices = new ArrayList<IrVertex>();
-        List<Integer> indexes = new ArrayList<Integer>();
+        Map<IrVertex, Integer> vertexToVertexIndex = new HashMap<>();
+        List<IrVertex> vertices = new ArrayList<>();
+        List<Integer> indexes = new ArrayList<>();
         
         int vertexIndex = 0;
         for (IrPolygon polygon : mesh.polygons) {

+ 5 - 5
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.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
@@ -98,9 +98,9 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
     private int meshIndex = 0;
     private int texCoordIndex = 0;
     private String ignoreUntilEnd = null;
-    private List<Geometry> geoms = new ArrayList<Geometry>();
-    private ArrayList<Boolean> usesSharedMesh = new ArrayList<Boolean>();
-    private IntMap<List<VertexBuffer>> lodLevels = new IntMap<List<VertexBuffer>>();
+    private List<Geometry> geoms = new ArrayList<>();
+    private ArrayList<Boolean> usesSharedMesh = new ArrayList<>();
+    private IntMap<List<VertexBuffer>> lodLevels = new IntMap<>();
     private AnimData animData;
 
     public MeshLoader() {
@@ -595,7 +595,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
     }
 
     private void startSkeleton(String name) {
-        AssetKey<AnimData> assetKey = new AssetKey<AnimData>(folderName + name + ".xml");
+        AssetKey<AnimData> assetKey = new AssetKey<>(folderName + name + ".xml");
         try {
             animData = assetManager.loadAsset(assetKey);
         } catch (AssetNotFoundException ex) {

+ 2 - 2
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.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
@@ -71,7 +71,7 @@ public class SceneLoader extends DefaultHandler implements AssetLoader {
     private static final Logger logger = Logger.getLogger(SceneLoader.class.getName());
     private SceneMaterialLoader materialLoader = new SceneMaterialLoader();
     private SceneMeshLoader meshLoader=new SceneMeshLoader();
-    private Stack<String> elementStack = new Stack<String>();
+    private Stack<String> elementStack = new Stack<>();
     private AssetKey key;
     private String sceneName;
     private String folderName;

+ 2 - 2
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.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
@@ -61,7 +61,7 @@ import org.xml.sax.helpers.DefaultHandler;
 class SceneMaterialLoader extends DefaultHandler {
     
     private static final Logger logger = Logger.getLogger(SceneMaterialLoader.class.getName());
-    private Stack<String> elementStack = new Stack<String>();
+    private Stack<String> elementStack = new Stack<>();
     private String folderName;
     private MaterialList materialList;
     private AssetManager assetManager;

+ 1 - 1
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMeshLoader.java

@@ -9,7 +9,7 @@ import com.jme3.asset.AssetKey;
 import com.jme3.scene.Spatial;
 
 public class SceneMeshLoader extends MeshLoader{
-	private Map<AssetKey,Spatial> cache=new HashMap<AssetKey,Spatial>();
+	private Map<AssetKey,Spatial> cache=new HashMap<>();
 	@Override
     public Object load(AssetInfo info) throws IOException {
 		AssetKey key=info.getKey();

+ 2 - 2
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.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
@@ -51,7 +51,7 @@ public class SkeletonLoader extends DefaultHandler implements AssetLoader {
 
     private static final Logger logger = Logger.getLogger(SceneLoader.class.getName());
     //private AssetManager assetManager;
-    private Stack<String> elementStack = new Stack<String>();
+    private Stack<String> elementStack = new Stack<>();
     private HashMap<Integer, Joint> indexToJoint = new HashMap<>();
     private HashMap<String, Joint> nameToJoint = new HashMap<>();
     private TransformTrack track;

+ 2 - 2
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtension.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
@@ -41,7 +41,7 @@ public class MaterialExtension {
 
     private String baseMatName;
     private String jmeMatDefName;
-    private HashMap<String, String> textureMappings = new HashMap<String, String>();
+    private HashMap<String, String> textureMappings = new HashMap<>();
 
     /**
      * Material extension defines a mapping from an Ogre3D "base" material

+ 3 - 3
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/matext/MaterialExtensionSet.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
@@ -42,8 +42,8 @@ import java.util.List;
  */
 public class MaterialExtensionSet {
 
-    private HashMap<String, MaterialExtension> extensions = new HashMap<String, MaterialExtension>();
-    private HashMap<String, List<String>> nameMappings = new HashMap<String, List<String>>();
+    private HashMap<String, MaterialExtension> extensions = new HashMap<>();
+    private HashMap<String, List<String>> nameMappings = new HashMap<>();
 
     /**
      * Adds a new material extension to the set of extensions.

+ 16 - 16
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.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
@@ -62,7 +62,7 @@ public class DOMInputCapsule implements InputCapsule {
     private Element currentElem;
     private XMLImporter importer;
     private boolean isAtRoot = true;
-    private Map<String, Savable> referencedSavables = new HashMap<String, Savable>();
+    private Map<String, Savable> referencedSavables = new HashMap<>();
     
     private int[] classHierarchyVersions;
     private Savable savable;
@@ -196,7 +196,7 @@ public class DOMInputCapsule implements InputCapsule {
 
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<byte[]> byteArrays = new ArrayList<byte[]>();
+            List<byte[]> byteArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -302,7 +302,7 @@ public class DOMInputCapsule implements InputCapsule {
 
 
             NodeList nodes = currentElem.getChildNodes();
-            List<int[]> intArrays = new ArrayList<int[]>();
+            List<int[]> intArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -493,7 +493,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<double[]> doubleArrays = new ArrayList<double[]>();
+            List<double[]> doubleArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -595,7 +595,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<long[]> longArrays = new ArrayList<long[]>();
+            List<long[]> longArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -698,7 +698,7 @@ public class DOMInputCapsule implements InputCapsule {
 
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<short[]> shortArrays = new ArrayList<short[]>();
+            List<short[]> shortArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -792,7 +792,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<boolean[]> booleanArrays = new ArrayList<boolean[]>();
+            List<boolean[]> booleanArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -851,7 +851,7 @@ public class DOMInputCapsule implements InputCapsule {
              }
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = tmpEl.getChildNodes();
-            List<String> strings = new ArrayList<String>();
+            List<String> strings = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -896,7 +896,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
             String sizeString = tmpEl.getAttribute("size");
             NodeList nodes = currentElem.getChildNodes();
-            List<String[]> stringArrays = new ArrayList<String[]>();
+            List<String[]> stringArrays = new ArrayList<>();
 
             for (int i = 0; i < nodes.getLength(); i++) {
                         Node n = nodes.item(i);
@@ -1044,7 +1044,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
 
             String sizeString = tmpEl.getAttribute("size");
-            List<Savable> savables = new ArrayList<Savable>();
+            List<Savable> savables = new ArrayList<>();
             for (currentElem = findFirstChildElement(tmpEl);
                     currentElem != null;
                     currentElem = findNextSiblingElement(currentElem)) {
@@ -1114,7 +1114,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
 
             String sizeString = tmpEl.getAttribute("size");
-            ArrayList<Savable> savables = new ArrayList<Savable>();
+            ArrayList<Savable> savables = new ArrayList<>();
             for (currentElem = findFirstChildElement(tmpEl);
                     currentElem != null;
                     currentElem = findNextSiblingElement(currentElem)) {
@@ -1157,7 +1157,7 @@ public class DOMInputCapsule implements InputCapsule {
 
             ArrayList<Savable> sal;
             List<ArrayList<Savable>> savableArrayLists =
-                    new ArrayList<ArrayList<Savable>>();
+                    new ArrayList<>();
             int i = -1;
             while (true) {
                 sal = readSavableArrayList("SavableArrayList_" + ++i, null);
@@ -1198,7 +1198,7 @@ public class DOMInputCapsule implements InputCapsule {
             String sizeString = tmpEl.getAttribute("size");
 
             ArrayList<Savable>[] arr;
-            List<ArrayList<Savable>[]> sall = new ArrayList<ArrayList<Savable>[]>();
+            List<ArrayList<Savable>[]> sall = new ArrayList<>();
             int i = -1;
             while ((arr = readSavableArrayListArray(
                     "SavableArrayListArray_" + ++i, null)) != null) sall.add(arr);
@@ -1231,7 +1231,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
 
             String sizeString = tmpEl.getAttribute("size");
-            ArrayList<FloatBuffer> tmp = new ArrayList<FloatBuffer>();
+            ArrayList<FloatBuffer> tmp = new ArrayList<>();
             for (currentElem = findFirstChildElement(tmpEl);
                     currentElem != null;
                     currentElem = findNextSiblingElement(currentElem)) {
@@ -1501,7 +1501,7 @@ public class DOMInputCapsule implements InputCapsule {
             }
 
             String sizeString = tmpEl.getAttribute("size");
-            ArrayList<ByteBuffer> tmp = new ArrayList<ByteBuffer>();
+            ArrayList<ByteBuffer> tmp = new ArrayList<>();
             for (currentElem = findFirstChildElement(tmpEl);
                     currentElem != null;
                     currentElem = findNextSiblingElement(currentElem)) {

+ 2 - 2
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMOutputCapsule.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
@@ -61,7 +61,7 @@ public class DOMOutputCapsule implements OutputCapsule {
     private Document doc;
     private Element currentElement;
     private JmeExporter exporter;
-    private Map<Savable, Element> writtenSavables = new IdentityHashMap<Savable, Element>();
+    private Map<Savable, Element> writtenSavables = new IdentityHashMap<>();
 
     public DOMOutputCapsule(Document doc, JmeExporter exporter) {
         this.doc = doc;