jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.74k stars 1.12k forks source link

Cleans up warnings in jme3-desktop #2244

Open MelVimL opened 2 months ago

MelVimL commented 2 months ago

As written in https://hub.jmonkeyengine.org/t/2079-warnings/47608/3 I tried to remove some warnings.

For the raw type warnings, I replaced it with a simple wildcard; maybe I should change some of them to a upper-bound wildcard. Any thoughts on that?

Class<JmeContext> ctxClazz = (Class<JmeContext>) Class.forName(className);
            return ctxClazz.getDeclaredConstructor().newInstance();

I think this doesn't work while I am writing this.

Ressource Warning in /cursors/plugins/CursorLoader.java was fixed by closing DataInput the int flag wasn't and what the comment implies shoundn't be used so I removed it and nextInt into "nirvana".

/system/AWTComponentRenderer.java and system/AWTFrameProcessor.java had a deprecated FrameBuffer creation. I added AWTUtils with the function getFrameBuffer(...) and suppressed the warning. Is there a better way to create the buffer?

jme3tools/converters/ImageToAwt.java had some unused "constants" I suppressed the warning. I also removed an unused constructor.

richardTingle commented 2 weeks ago

Thank you for doing this, a page full of warnings is always a pain