This pull request addresses several issues with the MatParamTexture class:
Duplicate variable: The texture variable is redundant as it's already stored in the inherited value variable. This PR removes the unnecessary texture field.
Missing Javadoc: The class and its methods lacked proper documentation. This PR adds comprehensive Javadoc comments to improve code readability and maintainability.
Inconsistent null handling: The behavior of setValue methods regarding null values differed. This PR modifies setValue to allow null values, aligning it with the behavior of setTextureValue and the superclass's setValue.
Key improvements:
Code simplification: By removing the duplicate variable, the code becomes cleaner and easier to understand.
Improved documentation: Clear Javadoc comments explain the class, its purpose, and how to use its methods.
Consistent null handling: All setValue methods now allow null values, preventing unnecessary exceptions.
Overall, this PR enhances the MatParamTexture class by streamlining the code, providing proper documentation, and ensuring consistent behavior.
--Edit:
Instead of overriding setValue in MatParamTexture, we can leverage the existing behavior in the superclass. The superclass method likely performs type and value checking, making an override unnecessary in this case (see https://github.com/jMonkeyEngine/jmonkeyengine/pull/1797).
This pull request addresses several issues with the
MatParamTexture
class:texture
variable is redundant as it's already stored in the inheritedvalue
variable. This PR removes the unnecessary texture field.setValue
methods regarding null values differed. This PR modifiessetValue
to allow null values, aligning it with the behavior ofsetTextureValue
and the superclass'ssetValue
.Key improvements:
Overall, this PR enhances the MatParamTexture class by streamlining the code, providing proper documentation, and ensuring consistent behavior.
--Edit: Instead of overriding
setValue
inMatParamTexture
, we can leverage the existing behavior in the superclass. The superclass method likely performs type and value checking, making an override unnecessary in this case (see https://github.com/jMonkeyEngine/jmonkeyengine/pull/1797).