Skip to content

Commit 1031e03

Browse files
committed
add private constructors to utility classes
1 parent 16b2c58 commit 1031e03

File tree

67 files changed

+429
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+429
-41
lines changed

jme3-android/src/main/java/com/jme3/input/android/AndroidKeyMapping.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2012 jMonkeyEngine
2+
* Copyright (c) 2009-2021 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -143,6 +143,12 @@ public class AndroidKeyMapping {
143143
0x0,//mute
144144
};
145145

146+
/**
147+
* A private constructor to inhibit instantiation of this class.
148+
*/
149+
private AndroidKeyMapping() {
150+
}
151+
146152
public static int getJmeKey(int androidKey) {
147153
if (androidKey > ANDROID_TO_JME.length) {
148154
return androidKey;

jme3-android/src/main/java/com/jme3/renderer/android/RendererUtil.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ public class RendererUtil {
5151
*/
5252
public static boolean ENABLE_ERROR_CHECKING = true;
5353

54+
/**
55+
* A private constructor to inhibit instantiation of this class.
56+
*/
57+
private RendererUtil() {
58+
}
59+
5460
/**
5561
* Checks for an OpenGL error and throws a {@link RendererException} if
5662
* there is one. Ignores the value of

jme3-android/src/main/java/com/jme3/util/AndroidScreenshots.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ public final class AndroidScreenshots {
88

99
private static final Logger logger = Logger.getLogger(AndroidScreenshots.class.getName());
1010

11+
/**
12+
* A private constructor to inhibit instantiation of this class.
13+
*/
14+
private AndroidScreenshots() {
15+
}
16+
1117
/**
1218
* Convert OpenGL GLES20.GL_RGBA to Bitmap.Config.ARGB_8888 and store result
1319
* in a Bitmap

jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2020 jMonkeyEngine
2+
* Copyright (c) 2009-2021 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,11 @@
5151
* @author normenhansen, tim8dev
5252
*/
5353
public class CollisionShapeFactory {
54+
/**
55+
* A private constructor to inhibit instantiation of this class.
56+
*/
57+
private CollisionShapeFactory() {
58+
}
5459

5560
/**
5661
* Calculate the correct transform for a collision shape relative to the

jme3-core/src/main/java/com/jme3/anim/interpolator/AnimInterpolators.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2020 jMonkeyEngine
2+
* Copyright (c) 2009-2021 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -176,5 +176,9 @@ public Float interpolate(float t, int currentIndex, TrackDataReader<Float> data,
176176

177177
public static final TimeInterpolator constant = new TimeInterpolator(Easing.constant);
178178

179-
179+
/**
180+
* A private constructor to inhibit instantiation of this class.
181+
*/
182+
private AnimInterpolators() {
183+
}
180184
}

jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public class Tweens {
5252
private static final CurveFunction SMOOTH = new SmoothStep();
5353
private static final CurveFunction SINE = new Sine();
5454

55+
/**
56+
* A private constructor to inhibit instantiation of this class.
57+
*/
58+
private Tweens() {
59+
}
60+
5561
/**
5662
* Creates a tween that will interpolate over an entire sequence
5763
* of tweens in order.

jme3-core/src/main/java/com/jme3/anim/util/AnimMigrationUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ public class AnimMigrationUtils {
1313
final private static AnimControlVisitor animControlVisitor = new AnimControlVisitor();
1414
final private static SkeletonControlVisitor skeletonControlVisitor = new SkeletonControlVisitor();
1515

16+
/**
17+
* A private constructor to inhibit instantiation of this class.
18+
*/
19+
private AnimMigrationUtils() {
20+
}
1621

1722
public static Spatial migrate(Spatial source) {
1823
Map<Skeleton, Armature> skeletonArmatureMap = new HashMap<>();

jme3-core/src/main/java/com/jme3/anim/util/Primitives.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public class Primitives {
3333
PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap);
3434
}
3535

36+
/**
37+
* A private constructor to inhibit instantiation of this class.
38+
*/
39+
private Primitives() {
40+
}
41+
3642
/**
3743
* Returns the corresponding wrapper type of {@code type} if it is a primitive type; otherwise
3844
* returns {@code type} itself. Idempotent.

jme3-core/src/main/java/com/jme3/audio/AudioContext.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public class AudioContext {
4040

4141
final private static ThreadLocal<AudioRenderer> audioRenderer = new ThreadLocal<AudioRenderer>();
4242

43+
/**
44+
* A private constructor to inhibit instantiation of this class.
45+
*/
46+
private AudioContext() {
47+
}
48+
4349
public static void setAudioRenderer( AudioRenderer ar ) {
4450
audioRenderer.set(ar);
4551
}

jme3-core/src/main/java/com/jme3/environment/LightProbeFactory.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2020 jMonkeyEngine
2+
* Copyright (c) 2009-2021 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,12 @@
7272
*/
7373
public class LightProbeFactory {
7474

75+
/**
76+
* A private constructor to inhibit instantiation of this class.
77+
*/
78+
private LightProbeFactory() {
79+
}
80+
7581
/**
7682
* Creates a LightProbe with the giver EnvironmentCamera in the given scene.
7783
*

0 commit comments

Comments
 (0)