RenderDeviceJme.java won’t compile. (fixed but... Weirded-out)

Hey all,

I’ve been busy the last couple of weeks and haven’t touched code or anything. When I updated jMP and jME3 I got the following compile problem.

in RenderDeviceJme.java, at line 112

[java]

public RenderImage createImage(String filename, boolean linear) {

return new RenderImageJme(filename, linear, display); // <


here
}
[/java]
I get:
[java]
incompatible types
required: de.lessvoid.nifty.spi.render.RenderImage
found: com.jme3.niftygui.RenderImageJme
[/java]

Just wondering… is this an actual compile error or just a red-line in the JMP code editor?

The error pasted above is in the editor, but if I run the code, I get the following:



[java]

java.lang.RuntimeException: Uncompilable source code - incompatible types

required: de.lessvoid.nifty.spi.render.RenderImage

found: com.jme3.niftygui.RenderImageJme

at com.jme3.niftygui.RenderDeviceJme.createImage(RenderDeviceJme.java:112)

at de.lessvoid.nifty.render.NiftyImageManager.getImage(NiftyImageManager.java:29)

at de.lessvoid.nifty.render.NiftyRenderEngineImpl.createImage(NiftyRenderEngineImpl.java:151)

at de.lessvoid.nifty.loaderv2.types.apply.ApplyRendererImage.apply(ApplyRendererImage.java:34)

at de.lessvoid.nifty.elements.Element.initializeFromAttributes(Element.java:305)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyAttributes(ElementType.java:217)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:171)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:143)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:250)

at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:174)

at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:143)

at de.lessvoid.nifty.loaderv2.types.ScreenType.create(ScreenType.java:71)

at de.lessvoid.nifty.loaderv2.types.NiftyType.create(NiftyType.java:137)

at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:478)

at de.lessvoid.nifty.Nifty.fromXmlWithoutStartScreen(Nifty.java:389)

at com.madjack.games.sc.MenuUpdater.loadStartMenu(MenuUpdater.java:280)

at com.madjack.games.sc.MenuUpdater.doCommand(MenuUpdater.java:212)

at com.madjack.games.sc.MenuUpdater.doCommand(MenuUpdater.java:136)

at com.madjack.games.sc.Base.loadGUI(Base.java:87)

at com.madjack.games.sc.Base.initialize(Base.java:72)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:117)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:188)

at java.lang.Thread.run(Thread.java:662)

[/java]

I just ask because I’ve found the code editor to be completely wrong in some cases where ANT+javac will happily compile things.



So make sure you rebuild before trying to run… or the JMP may have left a dodgy class file behind?



There still may be a problem but I don’t trust the code editor as it seems to completely forget/ignore super classes and super interfaces sometimes.

It’s been rebuilt. The end result is the same. I just rebuilt it just to make sure I didn’t screw it up the first time.



It is odd though. RenderImageJme implements RenderImage, so it technically should work. :S



OK, now -that- was weird.



Opened RenderImageJme, added a space after “implements RenderImage”, deleted space, saved, rebuilt and it now works as it should.



I’m officially baffled.

You weren’t really running the rebuild or something. Something funky was going on.



The JMP code editor sometimes gets messed up until you resave some things. But a clean build should have run ok regardless of what the code editor says… so that was bizarre.



I have two projects right now with ‘red’ source files because I can’t be bothered anymore to smarten JMP up in this regard, but they build and run fine.

If you already built the project and then update from SVN, netbeans might not realize the files have changes

1 Like

It was built after the update. Twice.

Did you do “Clean and Build”?

1 Like

Of course.



Here’s the exact things I did to make it work:



Added a space. Deleted it. Saved. Ran the game. Failed. “Clean and build”. Ran the game. No error, back to the way it was.