[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: (Swallowed) Nullpointer access in TextFormatter.updateValue
From: Jens Auer <Jens.Auer () h-d-gmbh ! de>
Date: 2017-03-22 15:36:42
Message-ID: 97a1e8a2db344f2c9b7a384071454144 () td-hud-ex01 ! muc ! hd ! local
[Download RAW message or body]
Hi,
I am using a TextField with a TextFormatter constructed with a predicate:
private TextFormatter.Change validateText(TextFormatter.Change c) { ... }
...
this.textInput.setTextFormatter(new TextFormatter<>(this::validateText));
While debugging some other problem I realized that the Debugger stops with a \
Nullpointer access in TextFormatter.updateValue: void updateValue(String text) {
if (!value.isBound()) {
try {
V v = valueConverter.fromString(text);
setValue(v);
} catch (Exception e) {
updateText(); // Set the text with the latest value
}
}
}
The member valueConverter may not be initialized in the constructor and thus can be \
null. Even though the exception is caught and swallowed, I would consider this an \
issue.
Cheers,
Jens
Jens Auer
(Softwareentwicklung)
___________________________________________________________
Unternehmensberatung H & D GmbH
Niederlassung Weißenthurm
Werftstr. 5 - 56575 Weißenthurm
Tel.: 02637/94238 -110
Fax: 02637/94238 -149
jens.auer@h-d-gmbh.de<mailto:jens.auer@h-d-gmbh.de>
http://www.h-d-gmbh.de<http://www.h-d-gmbh.de/>
http://www.h-d-gmbh.de/impressum.html
___________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic