You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create a bean with java.security.SecureRandom type property which is injected.
GenericTypeAwarePropertyDescriptor warns me that SecureRandom has ambiguous write methods with the following message.
Invalid JavaBean property 'seed' being accessed! Ambiguous write methods found next to actually used [public void java.security.SecureRandom.setSeed(long)]: [public synchronized void java.security.SecureRandom.setSeed(byte[])]
I fully understand that it does mean. But java.security.SecureRandom is a JDK's class and I can do nothing to make this bean properly formed. And I don't want to see this warn message in my log too.
See #9606. The class (though it's part of the JDK) doesn't respect the JavaBeans conventions which can cause problems when the application is moved to a different VM.
The warning purpose is to notify users about this risk.
It seems that the check is a bit too eager there and reporting warnings for bean properties that are not actually used at that point. I'll revisit this in time for 3.0 GA.
I've relaxed this warning about ambiguous setters to only be logged in case of actual write access: i.e. when saying <property name="seed" value="...">, where the resolution of the setter method being used at runtime is ambiguous indeed and might lead to a different method being chosen in different VM environments. Pure introspection of the write method will not lead to the warning being logged anymore.
Nickolay Mazurkin opened SPR-6399 and commented
I create a bean with java.security.SecureRandom type property which is injected.
GenericTypeAwarePropertyDescriptor warns me that SecureRandom has ambiguous write methods with the following message.
Invalid JavaBean property 'seed' being accessed! Ambiguous write methods found next to actually used [public void java.security.SecureRandom.setSeed(long)]: [public synchronized void java.security.SecureRandom.setSeed(byte[])]
I fully understand that it does mean. But java.security.SecureRandom is a JDK's class and I can do nothing to make this bean properly formed. And I don't want to see this warn message in my log too.
Affects: 3.0 RC2
Issue Links:
Referenced from: commits 61f2371
The text was updated successfully, but these errors were encountered: