protect 47 no-arg constructors in the jme3-core library - #1228
Conversation
|
Some of these I'm not so sure about. In the cases like InstancedGeometry the only difference between the no-arg and String-arg constructor is that the geometry won't have a name. Furthermore, things like LightNode and CameraNode, it's sometimes nice to be able to set the light and camera later after construction... but especially for CameraNode. (Though an argument can be made for simply deprecating these classes in favor of the controls.) |
|
The javadocs for |
|
But at least in the case of InstancedGeometry, it's wrong. The name should never be required. I suspect that many of these comments were just cut-pasted or typed without thought. |
|
Note: it 100% does make sense to make protected the constructors that will make "bad objects"... so I'm completely on board with 90% of these changes as there is no possible way that a user could be using these correctly. But the three cases I mention could be working fine for them... and definitely InstancedGeometry. For example, I almost never use the name-based constructors myself because I couldn't care less about the names of my spatials. |
|
I'll do a partial revert, then, publicizing those 3 constructors and removing the misleading javadocs. |
Now that issue #1119 is closed, protect some of the public no-arg constructors that are intended only for use by JME's serialization system (
SavableClassUtil).