This site requires JavaScript, please enable it in your browser!
Greenfoot back
sjaaksm
sjaaksm wrote ...

2011/11/24

Compiler Warning (continued)

sjaaksm sjaaksm

2011/11/24

#
This problem has been discussed before and it was suggested that it would be solved in the new version of Greenfoot. The problem occurs not in a program I've written myself but in a scenario the was posted in the Greenroom, namely the “Ausgangsszenario” of resource 51. It seems to me that it has something to do with the latest jdk, at least, it occurred first after I upgraded to jdk7. When a try to compile the Mover class from this scenario, a dialog will pop up with the message that the compiler wants to warn me about something and that i should use the -Xlint:unchecked flag to get more information. This warning is very annoying because every time I press the compile button the dialog will appear. There seems to be nothing wrong with the program; it used to compile smoothly. Does somebody have an idea what goes wrong? I’m using: Greenfoot version: 2.1.2 Java version 1.7.0 Virtual machine: Java HotSpot(TM) 64-Bit Server VM 21.0-b17 (Oracle Corporation) Running on: Windows 7 6.1 (amd64) Thanks, Sjaak
mjrb4 mjrb4

2011/11/24

#
There was an issue IIRC about a warning popping up with JDK7 and the bootstrap path, but that should have gone - and by your description it's not the problem you're getting. Instead, the fact it's suggesting the "-Xlint:unchecked" option points to the fact that it is an issue in the scenario's code. That warning most commonly appears when you're using the raw types of generic classes, for instance:
ArrayList list = new ArrayList();
...will throw up that error, as will any other class that should have generic parameters. The other scenario where you get that warning is if you're using deprecated methods, but it's almost always the generic parameter thing that causes the warning. I can't find the scenario "Ausgangsszenario" on the gallery at all, if you post a link to it I'll check it out.
sjaaksm sjaaksm

2011/11/24

#
I know which method causes the warning, and indeed, it has to do with generics. But whether or not the warning will pop-up seems to depend on the jdk that is used Btw, the link to the Ausgangsszenario is: http://greenroom.greenfoot.org/resources/51 It would be nice if the code could be adjusted in such a way that the warning is not given anymore. Sjaak
You need to login to post a reply.