From 93b19bb935995d16bda35180af54956cae95e1b0 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Sat, 9 Mar 2024 12:35:38 -0800 Subject: [PATCH] java: standardize the explanations of explicit no-arg constructors --- src/main/java/com/jme3/bullet/NativePhysicsObject.java | 7 +++++-- .../com/jme3/bullet/collision/PhysicsCollisionObject.java | 5 ++++- .../com/jme3/bullet/collision/shapes/CollisionShape.java | 5 ++++- .../java/com/jme3/bullet/collision/shapes/ConvexShape.java | 5 ++++- src/main/java/com/jme3/bullet/joints/PhysicsJoint.java | 5 ++++- src/main/java/com/jme3/bullet/objects/PhysicsBody.java | 7 +++++-- src/main/java/com/jme3/util/PrimitiveAllocator.java | 5 ++++- src/main/java/jme3utilities/debug/Describer.java | 7 +++++-- src/main/java/jme3utilities/minie/PhysicsDescriber.java | 5 ++++- 9 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/jme3/bullet/NativePhysicsObject.java b/src/main/java/com/jme3/bullet/NativePhysicsObject.java index 5516461a..063328ee 100644 --- a/src/main/java/com/jme3/bullet/NativePhysicsObject.java +++ b/src/main/java/com/jme3/bullet/NativePhysicsObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 jMonkeyEngine + * Copyright (c) 2020-2024 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,8 +76,11 @@ abstract public class NativePhysicsObject /** * Instantiate with no tracker and no assigned native object. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected NativePhysicsObject() { // to avoid a warning from JDK 18 javadoc + protected NativePhysicsObject() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java b/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java index 3db394e9..0b4875ad 100644 --- a/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java +++ b/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java @@ -165,8 +165,11 @@ abstract public class PhysicsCollisionObject extends NativePhysicsObject { /** * Instantiate a collision object with no tracker and no assigned native * object. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected PhysicsCollisionObject() { // avoid a warning from JDK 18 javadoc + protected PhysicsCollisionObject() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java b/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java index a592af4a..a419d29c 100644 --- a/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java +++ b/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java @@ -102,8 +102,11 @@ abstract public class CollisionShape extends NativePhysicsObject { /** * Instantiate a collision shape with no tracker and no assigned native * object. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected CollisionShape() { // to avoid a warning from JDK 18 javadoc + protected CollisionShape() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/bullet/collision/shapes/ConvexShape.java b/src/main/java/com/jme3/bullet/collision/shapes/ConvexShape.java index 7b484abd..b82a3bf4 100644 --- a/src/main/java/com/jme3/bullet/collision/shapes/ConvexShape.java +++ b/src/main/java/com/jme3/bullet/collision/shapes/ConvexShape.java @@ -58,8 +58,11 @@ abstract public class ConvexShape extends CollisionShape { /** * Instantiate a collision shape with no tracker and no assigned native * object. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected ConvexShape() { // explicit to avoid a warning from JDK 18 javadoc + protected ConvexShape() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java b/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java index 2a3982b7..b0e1cee8 100644 --- a/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java +++ b/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java @@ -75,8 +75,11 @@ abstract public class PhysicsJoint extends NativePhysicsObject { /** * Instantiate a PhysicsJoint. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected PhysicsJoint() { // to avoid a warning from JDK 18 javadoc + protected PhysicsJoint() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/bullet/objects/PhysicsBody.java b/src/main/java/com/jme3/bullet/objects/PhysicsBody.java index b1c286ba..92f7f511 100644 --- a/src/main/java/com/jme3/bullet/objects/PhysicsBody.java +++ b/src/main/java/com/jme3/bullet/objects/PhysicsBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023 jMonkeyEngine + * Copyright (c) 2019-2024 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,8 +62,11 @@ abstract public class PhysicsBody extends PhysicsCollisionObject { /** * Instantiate a PhysicsBody. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - protected PhysicsBody() { // explicit to avoid a warning from JDK 18 javadoc + protected PhysicsBody() { } // ************************************************************************* // new methods exposed diff --git a/src/main/java/com/jme3/util/PrimitiveAllocator.java b/src/main/java/com/jme3/util/PrimitiveAllocator.java index 336ed3f6..4ee544d6 100644 --- a/src/main/java/com/jme3/util/PrimitiveAllocator.java +++ b/src/main/java/com/jme3/util/PrimitiveAllocator.java @@ -41,8 +41,11 @@ public final class PrimitiveAllocator implements BufferAllocator { /** * Instantiate an allocator. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - public PrimitiveAllocator() { // to avoid a warning from JDK 18 javadoc + public PrimitiveAllocator() { } /** diff --git a/src/main/java/jme3utilities/debug/Describer.java b/src/main/java/jme3utilities/debug/Describer.java index 284ac090..8d024aa7 100644 --- a/src/main/java/jme3utilities/debug/Describer.java +++ b/src/main/java/jme3utilities/debug/Describer.java @@ -1,5 +1,5 @@ /* - Copyright (c) 2013-2023, Stephen Gold + Copyright (c) 2013-2024 Stephen Gold All rights reserved. Redistribution and use in source and binary forms, with or without @@ -54,7 +54,10 @@ public class Describer implements Cloneable { // constructors /** - * A no-arg constructor to avoid javadoc warnings from JDK 18. + * Instantiate a Describer with the default separator. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ public Describer() { // do nothing diff --git a/src/main/java/jme3utilities/minie/PhysicsDescriber.java b/src/main/java/jme3utilities/minie/PhysicsDescriber.java index 16cbda0b..ee3765a3 100644 --- a/src/main/java/jme3utilities/minie/PhysicsDescriber.java +++ b/src/main/java/jme3utilities/minie/PhysicsDescriber.java @@ -98,8 +98,11 @@ public class PhysicsDescriber extends Describer { /** * Instantiate a describer with the default separator. + *

+ * This no-arg constructor was made explicit to avoid javadoc warnings from + * JDK 18+. */ - public PhysicsDescriber() { // to avoid a warning from JDK 18 javadoc + public PhysicsDescriber() { } // ************************************************************************* // new methods exposed