Browse Source

public methods and fields shouldn't depend on non-public classes (#1498)

Stephen Gold 4 years ago
parent
commit
c27c24d7ca

+ 2 - 6
jme3-core/src/main/java/com/jme3/app/state/ConstantVerifierState.java

@@ -57,7 +57,7 @@ public class ConstantVerifierState extends BaseAppState {
     // Note: I've used actual constructed objects for the good values
     // Note: I've used actual constructed objects for the good values
     //       instead of clone just to better catch cases where the values
     //       instead of clone just to better catch cases where the values
     //       might have been corrupted even before the app state was touched. -pspeed
     //       might have been corrupted even before the app state was touched. -pspeed
-    public static final Checker[] DEFAULT_CHECKS = new Checker[] {
+    private static final Checker[] DEFAULT_CHECKS = new Checker[] {
             new Checker(Vector3f.ZERO, new Vector3f(0, 0, 0)),
             new Checker(Vector3f.ZERO, new Vector3f(0, 0, 0)),
             new Checker(Vector3f.NAN, new Vector3f(NaN, NaN, NaN)),
             new Checker(Vector3f.NAN, new Vector3f(NaN, NaN, NaN)),
             new Checker(Vector3f.UNIT_X, new Vector3f(1, 0, 0)),
             new Checker(Vector3f.UNIT_X, new Vector3f(1, 0, 0)),
@@ -116,7 +116,7 @@ public class ConstantVerifierState extends BaseAppState {
      * @param errorType the mechanism to use
      * @param errorType the mechanism to use
      * @param checkers which checks to perform
      * @param checkers which checks to perform
      */
      */
-    public ConstantVerifierState( ErrorType errorType, Checker... checkers ) {
+    private ConstantVerifierState( ErrorType errorType, Checker... checkers ) {
         this.errorType = errorType;
         this.errorType = errorType;
         this.checkers.addAll(Arrays.asList(checkers));
         this.checkers.addAll(Arrays.asList(checkers));
     }
     }
@@ -133,10 +133,6 @@ public class ConstantVerifierState extends BaseAppState {
         return errorType;
         return errorType;
     }
     }
     
     
-    protected SafeArrayList<Checker> getCheckers() {
-        return checkers;
-    }
-    
     @Override
     @Override
     protected void initialize( Application app ) {
     protected void initialize( Application app ) {
     }
     }

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

@@ -130,7 +130,7 @@ public class BitmapFont implements Savable {
      * @param sb the block to measure (not null, unaffected)
      * @param sb the block to measure (not null, unaffected)
      * @return the line height
      * @return the line height
      */
      */
-    public float getLineHeight(StringBlock sb) {
+    float getLineHeight(StringBlock sb) {
         return charSet.getLineHeight() * (sb.getSize() / charSet.getRenderedSize());
         return charSet.getLineHeight() * (sb.getSize() / charSet.getRenderedSize());
     }
     }
 
 

+ 1 - 16
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java

@@ -100,7 +100,7 @@ public class JoystickCompatibilityMappings {
      * @return The various axis remappings for the requested joystick, or null of there are none.
      * @return The various axis remappings for the requested joystick, or null of there are none.
      * @author Markil3
      * @author Markil3
      */
      */
-    protected static Map<String, AxisData> getAxisMappings(String joystickName, boolean create) {
+    private static Map<String, AxisData> getAxisMappings(String joystickName, boolean create) {
         Map<String, AxisData> result = axisMappings.get(joystickName.trim());
         Map<String, AxisData> result = axisMappings.get(joystickName.trim());
         if (result == null && create) {
         if (result == null && create) {
             result = new HashMap<String, AxisData>();
             result = new HashMap<String, AxisData>();
@@ -301,21 +301,6 @@ public class JoystickCompatibilityMappings {
         return map.get(componentId);
         return map.get(componentId);
     }
     }
 
 
-    /**
-     * Returns a set of Joystick axis name remappings if they exist otherwise
-     * it returns an empty map.
-     *
-     * @param joystickName which joystick (not null)
-     * @return an unmodifiable map
-     * @author Markil3
-     */
-    public static Map<String, AxisData> getJoystickAxisMappings(String joystickName) {
-        Map<String, AxisData> result = getAxisMappings(joystickName.trim(), false);
-        if (result == null)
-            return Collections.emptyMap();
-        return Collections.unmodifiableMap(result);
-    }
-
     /**
     /**
      * Returns a set of Joystick button name remappings if they exist otherwise
      * Returns a set of Joystick button name remappings if they exist otherwise
      * it returns an empty map.
      * it returns an empty map.

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

@@ -173,7 +173,7 @@ public class InstancedNode extends GeometryGroupNode {
         }
         }
     }
     }
 
 
-    protected InstancedNodeControl control;
+    private InstancedNodeControl control;
 
 
     protected HashMap<Geometry, InstancedGeometry> igByGeom
     protected HashMap<Geometry, InstancedGeometry> igByGeom
             = new HashMap<>();
             = new HashMap<>();

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

@@ -34,6 +34,7 @@ package com.jme3.export.binary;
 import com.jme3.asset.AssetManager;
 import com.jme3.asset.AssetManager;
 import com.jme3.export.FormatVersion;
 import com.jme3.export.FormatVersion;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeExporter;
+import com.jme3.export.OutputCapsule;
 import com.jme3.export.Savable;
 import com.jme3.export.Savable;
 import com.jme3.export.SavableClassUtil;
 import com.jme3.export.SavableClassUtil;
 import com.jme3.math.FastMath;
 import com.jme3.math.FastMath;
@@ -147,7 +148,7 @@ public class BinaryExporter implements JmeExporter {
     protected int aliasCount = 1;
     protected int aliasCount = 1;
     protected int idCount = 1;
     protected int idCount = 1;
 
 
-    protected IdentityHashMap<Savable, BinaryIdContentPair> contentTable
+    final private IdentityHashMap<Savable, BinaryIdContentPair> contentTable
              = new IdentityHashMap<>();
              = new IdentityHashMap<>();
 
 
     protected HashMap<Integer, Integer> locationTable
     protected HashMap<Integer, Integer> locationTable
@@ -323,12 +324,12 @@ public class BinaryExporter implements JmeExporter {
         }
         }
     }
     }
 
 
-    protected String getChunk(BinaryIdContentPair pair) {
+    private String getChunk(BinaryIdContentPair pair) {
         return new String(pair.getContent().bytes, 0, Math.min(64, pair
         return new String(pair.getContent().bytes, 0, Math.min(64, pair
                 .getContent().bytes.length));
                 .getContent().bytes.length));
     }
     }
 
 
-    protected int findPrevMatch(BinaryIdContentPair oldPair,
+    private int findPrevMatch(BinaryIdContentPair oldPair,
             ArrayList<BinaryIdContentPair> bucket) {
             ArrayList<BinaryIdContentPair> bucket) {
         if (bucket == null)
         if (bucket == null)
             return -1;
             return -1;
@@ -364,7 +365,7 @@ public class BinaryExporter implements JmeExporter {
     }
     }
 
 
     @Override
     @Override
-    public BinaryOutputCapsule getCapsule(Savable object) {
+    public OutputCapsule getCapsule(Savable object) {
         return contentTable.get(object).getContent();
         return contentTable.get(object).getContent();
     }
     }
 
 
@@ -419,7 +420,7 @@ public class BinaryExporter implements JmeExporter {
         return bytes;
         return bytes;
     }
     }
 
 
-    protected BinaryIdContentPair generateIdContentPair(BinaryClassObject bco) {
+    private BinaryIdContentPair generateIdContentPair(BinaryClassObject bco) {
         BinaryIdContentPair pair = new BinaryIdContentPair(idCount++,
         BinaryIdContentPair pair = new BinaryIdContentPair(idCount++,
                 new BinaryOutputCapsule(this, bco));
                 new BinaryOutputCapsule(this, bco));
         return pair;
         return pair;

+ 2 - 2
jme3-examples/src/main/java/jme3test/gui/TestBitmapFontLayout.java

@@ -109,7 +109,7 @@ public class TestBitmapFontLayout extends SimpleApplication {
         }
         }
     }
     }
     
     
-    protected Texture renderAwtFont( TestConfig test, int width, int height, BitmapFont bitmapFont ) {
+    private Texture renderAwtFont( TestConfig test, int width, int height, BitmapFont bitmapFont ) {
  
  
         BitmapCharacterSet charset = bitmapFont.getCharSet();
         BitmapCharacterSet charset = bitmapFont.getCharSet();
           
           
@@ -156,7 +156,7 @@ public class TestBitmapFontLayout extends SimpleApplication {
         return new Texture2D(jmeImage);
         return new Texture2D(jmeImage);
     }
     }
     
     
-    protected Node createVisual( TestConfig test ) {
+    private Node createVisual( TestConfig test ) {
         Node result = new Node(test.name);
         Node result = new Node(test.name);
         
         
         // For reasons I have trouble articulating, I want the visual's 0,0,0 to be
         // For reasons I have trouble articulating, I want the visual's 0,0,0 to be

+ 0 - 9
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/material/FbxMaterialProperties.java

@@ -191,13 +191,4 @@ public class FbxMaterialProperties {
     public Object getProperty(String name) { 
     public Object getProperty(String name) { 
         return propertyValueMap.get(name);
         return propertyValueMap.get(name);
     }
     }
-    
-    public static Type getPropertyType(String name) {
-        FBXMaterialProperty prop = propertyMetaMap.get(name);
-        if (prop == null) { 
-            return null;
-        } else {
-            return prop.type;
-        }
-    }
 }
 }

+ 1 - 1
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java

@@ -509,7 +509,7 @@ public class GltfLoader implements AssetLoader {
         return buffs;
         return buffs;
     }
     }
 
 
-    public <R> R readAccessorData(int accessorIndex, Populator<R> populator) throws IOException {
+    private <R> R readAccessorData(int accessorIndex, Populator<R> populator) throws IOException {
 
 
         assertNotNull(accessors, "No accessor attribute in the gltf file");
         assertNotNull(accessors, "No accessor attribute in the gltf file");