Browse Source

committing formatted to see what new errors pop up

rickard 3 years ago
parent
commit
5a54a74ecc

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

@@ -67,7 +67,7 @@ public class ExternalChangeScanner implements AssetDataPropertyChangeListener,
     private static final AtomicBoolean userNotified = new AtomicBoolean(false);
     protected final AssetDataObject assetDataObject;
     protected final AssetData assetData;
-    protected FileObject originalObject;
+    protected final FileObject originalObject;
 
     public ExternalChangeScanner(AssetDataObject assetDataObject) {
         this.assetDataObject = assetDataObject;

+ 3 - 2
jme3-core/src/com/jme3/gde/core/util/SpatialUtil.java

@@ -87,8 +87,8 @@ public class SpatialUtil {
         final ArrayList<String> geomMap = new ArrayList<>();
         if (spat != null) {
             spat.depthFirstTraversal(geom -> {
-                Spatial curSpat = geom;
-                String geomName = geom.getName();
+
+                final String geomName = geom.getName();
                 if (geomName == null) {
                     LOGGER.log(Level.WARNING, "Null Spatial name!");
                     geomName = "null";
@@ -96,6 +96,7 @@ public class SpatialUtil {
                 geom.setUserData((SpatialUtil.ORIGINAL_NAME, geomName);
                 LOGGER.log(Level.FINE, "Set ORIGINAL_NAME for {0}",
                         geomName);
+                final Spatial curSpat = geom;
                 String id = SpatialUtil.getSpatialPath(curSpat);
                 if (geomMap.contains(id)) {
                     LOGGER.log(Level.WARNING, "Cannot create unique name "

+ 2 - 6
jme3-core/src/com/jme3/gde/core/util/TaggedSpatialFinder.java

@@ -13,10 +13,6 @@ public class TaggedSpatialFinder {
     private static final Logger LOGGER =
             Logger.getLogger(TaggedSpatialFinder.class.getName());
 
-    public TaggedSpatialFinder() {
-
-    }
-
     public Spatial find(final Spatial root, final Spatial needle) {
         if (needle == null) {
             LOGGER.log(Level.WARNING, "Trying to find null needle for {0}",
@@ -31,8 +27,8 @@ public class TaggedSpatialFinder {
             return null;
         }
         final Class<? extends Spatial> clazz = needle.getClass();
-        String rootName = root.getUserData(SpatialUtil.ORIGINAL_NAME);
-        String rootPath = root.getUserData(SpatialUtil.ORIGINAL_PATH);
+        final String rootName = root.getUserData(SpatialUtil.ORIGINAL_NAME);
+        final String rootPath = root.getUserData(SpatialUtil.ORIGINAL_PATH);
         if (name.equals(rootName) && path.equals(rootPath)) {
             return root;
         }

+ 1 - 1
jme3-core/src/com/jme3/gde/core/util/datatransfer/AnimationDataFromOriginal.java

@@ -33,7 +33,7 @@ public final class AnimationDataFromOriginal implements SpatialDataTransferInter
             final AnimComposer animComposer =
                     spatial.getControl(AnimComposer.class);
             if (animComposer != null) {
-                Spatial mySpatial = finder.find(root, spatial);
+                final Spatial mySpatial = finder.find(root, spatial);
                 if (mySpatial != null) {
                     //TODO: move attachments: have to scan through all
                     // nodes and find the ones

+ 0 - 1
jme3-core/src/com/jme3/gde/core/util/datatransfer/MaterialDataFromOriginal.java

@@ -5,7 +5,6 @@ import com.jme3.gde.core.util.TaggedSpatialFinder;
 import com.jme3.scene.Geometry;
 import com.jme3.scene.SceneGraphVisitorAdapter;
 import com.jme3.scene.Spatial;
-
 import java.util.logging.Logger;
 
 /**