On Tue, 7 Feb 2023 20:54:20 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> We aren't very consistent on this. Most of the places where we produce 
>> warnings, or where we provide verbose output, are done by printing. At a 
>> minimum, those should go to `System.err` rather than `System.out`. Unless 
>> there is an API whose expected result is to print something to `System.out`, 
>> a library really shouldn't print to System.out (as opposed to a test or a 
>> demo app, where it's fine). So the only places I would expect to see it in 
>> the library -- meaning source code under `modules/javafx.*/src/main/java/` 
>> -- would be in examples in javadoc comments.
>> 
>> We could file a second follow-up issue (RFE) to consider changing some of 
>> our print statements to use logging.
>
> Some investigation is needed if source can ever be null in such cases.  I 
> think some of these are to inform the programmer (not the user) something 
> unexpected happens, in which case it should be an assert or exception.  If it 
> then ever does happen, it should be fixed.

The drag/drop code is full of what looks like asserts that are just dumped to 
`System.err`.  It looks like left overs that helped during development of the 
underlying state machine, but it shouldn't get in such states normally.  When I 
run the tests, none of the exceptional cases or `System.err` code has any 
coverage which can be a sign that these cases can't be reached.

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

PR: https://git.openjdk.org/jfx/pull/1025

Reply via email to