Select-binding still warns about null steps
Werner Lehmann
lehmann at media-interactive.de
Mon Dec 15 12:25:45 UTC 2014
Hi,
it seems as if bindings created with Bindings.selectXXX still do not
support null steps fully. With RT-35957 the log level of NPEs caused by
null steps was reduced to FINE. Howver, in 8u25 there is a still a
warning logged for a perfectly normal operation:
> Dez 15, 2014 12:59:44 PM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
> WARNING: Exception while evaluating select-binding [window]
Example code:
> @Override
> public void start(Stage primaryStage) throws Exception
> {
> ObjectBinding<Object> binding = Bindings.select(primaryStage.sceneProperty(), "window");
> binding.get();
> }
Explanation for this seems obvious, on level WARNING there is at least
one line logged always, unaffected by the change to FINE:
> final PlatformLogger logger = Logging.getLogger();
> if (logger.isLoggable(Level.WARNING)) {
> Logging.getLogger().warning("Exception while evaluating select-binding " + stepsToString());
> if (ex instanceof IllegalStateException) {
> logger.warning("Property '" + propertyNames[i] + "' does not exist in " + obj.getClass(), ex);
> } else if (ex instanceof NullPointerException) {
> logger.fine("Property '" + propertyNames[i] + "' in " + properties[i] + " is null", ex);
> } else {
> Logging.getLogger().warning("", ex);
> }
> }
As a result I am getting exception warnings logged leading to questions
leading to explanations and bug tickets etc. I tried to work around it
by reducing the log level:
- created file "logging.properties" in classpath root with content
"beans.level = OFF"
- added VM argument "-Djava.util.logging.config.file=logging.properties"
While this works standalone it does not seem to be accepted in a
Webstart JNLP file because it is not a whitelisted secure property.
Any ideas about that?
Thx,
Werner
More information about the openjfx-dev
mailing list