-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast error in RegularLevel and Heap #1
Conversation
The (Collection<? extends Item>) bundle.getCollection(ITEM) cast fails at compile time because Item extends (well, implements) Bundlable, not the opposite.
you might want to update to java 7 |
Well, you can make that pull request a "Compatibility backport for java 6" then. |
Just get Java 7. Compatability can be really annoying at times. |
I tried building it with the following in
Still getting the same error, although the encoding warnings are gone. @watabou, could you please upload your ant.properties or project.properties files so that we can use the setup that you use? Or do you build with maven, gradle or something else other than ant? |
Forgot to note: I'm using OpenJDK 1.7.0_65, which afaik is the latest version. |
I can take a look at it, I'm pretty good with Java. What is |
compile with the android sdk bundle works perfect .... ant/maven will fail other wise |
@tehface you mean with an IDE? building with ant is standard, getting it to work should be very easy. |
Could you be more specific ? what steps are you taking to build with no error ? I didn't manage to do just that. From what I understand, this looks like a mere casting error:
A cast as |
This pull request has no reason to be anymore. Closing. |
Hi !
First of all, thanks for releasing the source code of your amazing game !
Unfortunately, the code does not compile as is on my station (java 6). It fails with two similar casting errors, in Heap.java and RegularLevel.java. I looked it up, and the statement
(Collection<? extends Item>) bundle.getCollection(ITEM)
seems bogus to me: Item implements Bundlable, not the opposite. The error is very similar in RegularLevel.java.
I tried to fix it but I'm not a Java Guru, so feel free to reject my pull request and provide a better version of this fix. :]