Refactor: AbstractShadowFilter reduce object allocations - #2516
Conversation
| * @author Nehon | ||
| */ | ||
| public abstract class AbstractShadowFilter<T extends AbstractShadowRenderer> extends Filter implements Cloneable, JmeCloneable { | ||
| public abstract class AbstractShadowFilter<T extends AbstractShadowRenderer> extends Filter implements JmeCloneable { |
There was a problem hiding this comment.
Why remove Cloneable? (Why was it here in the first place?)
There was a problem hiding this comment.
The JmeCloneable interface already extends java.lang.Cloneable. Therefore, the explicit extension is redundant and its removal simplifies the code without altering its behavior. Therefore, what checks have you already performed that led you to raise this question?
There was a problem hiding this comment.
Ah yes good point. No objection to removing it then
|
Looks good to me |
|
Thanks for this PR and good find. I have only one question: |
Done! Thank you for your feedback guys. |
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
|
I think I understand the problem. The temp variables passed to the material must be permanent, not volatile. In this case, |

Refactor AbstractShadowFilter: Remove Unused Serialization and Legacy Fields
write/read), simplifying the class.This refactor streamlines the code, reduces clutter, and adheres to modern coding practices without affecting functionality.