Replies: 1 comment 1 reply
-
I like the idea and welcome the discussion. I'm aware of this JEP draft and I'm keeping an eye on it as it develops. I think we need to wait until it's final to see what the suggested alternatives to these unsafe operations are. Because our autowire method uses reflection, how would you suggest using a setter? Remember, we might not have setters for variables we define as @config, and they might not be public because we don't want them to be accessible from outside the class. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In JEP draft: integrity by default, it is being proposed to eventually remove
setAccessible
from the reflection API since it undermines encapsulation. The final decision is still to be made, the considerations are reasonable enough to me.I have in mind this method, and I haven't looked if it is used somewhere else in jPOS code base yet.
jPOS/jpos/src/main/java/org/jpos/q2/QFactory.java
Line 458 in f1af198
I propose that for jPOS next, we try to use setter to do this, and start giving warnings when setters are not available. In that case, we could have a property for disabling those warnings, but I feel they should be on by default.
Beta Was this translation helpful? Give feedback.
All reactions