RFR: 6852577: Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null [v3]

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Sep 13 14:59:50 UTC 2022


On Tue, 13 Sep 2022 02:58:06 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> it will also probably need change in compiler as to how it generates/parses the type as I am getting
>> 
>> Exception in thread "main" java.lang.NullPointerException: Cannot invoke "build.tools.generatenimbus.UIProperty$PropertyType.ordinal()" because "this.type" is null
>> 	at build.tools.generatenimbus.UIProperty.write(UIProperty.java:87)
>> 	at build.tools.generatenimbus.UIStyle.write(UIStyle.java:156)
>> 	at build.tools.generatenimbus.UIRegion.write(UIRegion.java:213)
>> 	at build.tools.generatenimbus.SynthModel.write(SynthModel.java:102)
>> 	at build.tools.generatenimbus.Generator.generate(Generator.java:212)
>> 	at build.tools.generatenimbus.Generator.main(Generator.java:118)
>> 
>> so I think this is the safer and cleaner alternative as I am not creating a new UIDefaults table, just adding a new entry to it..
>
> It is probably simpler but we already store all tha properties in the generated NimbusDefaults, I do not think we should split the storage in two parts.

Properties are **already** being stored in two parts so I am not inventing it for this fix. I am just adding an entry to the already created UIDefaults. Also, as I told, storing a character in skin.laf involves changing the generator tool which might not be scalable and prone to regressions, not to mention what/where should be changed in the tool for this is not known to me.

Also, as Synth is a skinnable look and feel, I think it would have been an issue if the property to be added affects "skin" in anyways, like **color, font, dimension** property etc, in which case it would have made sense to be mandatorily put in skin.laf which is the "visual designer"
 but this Password echo character property will not affect the skin in anyway, like the other properties added in UIDefaults table in SynthLookAndFeel, so I think it should be ok.

-------------

PR: https://git.openjdk.org/jdk/pull/10035



More information about the client-libs-dev mailing list