Porting form JDK 1.4.x

Hey all, my first post ;D,

Anyway, today I finally downloaded the JDK 1.5 and compiled a 2d game engine that I’ve worked on for the past few weeks. Now while compiling I got several “Note: unchecked or unsae operations” in reguard to the add method of java.util.LinkedList. I assume this has to do with the new Generic types. Also I noticed a big framerate drop from my previous compiles.

The point I want to raise is what suggestions do people have for porting 2d graphics code between 1.4.x and 1.5 . I’ve seen use of the System.nanoTime() method that apparently works better (I’m just using System.getCurrentMillis() ???). Also are there any java 2D optimizations techniques new to 1.5?

Thanks

the unsafe warnings are telling you you aren’t making your lists type-specific… i think it’s more of a safety measure to warn you you might add something that is not supposed to go in the list, and personally, i just ignore it, as to code using lists the way they want you to is not backwards compatible to 1.4 compilers. (having said that, i do appreciate the value of typed lists…)

NanoTime will get you the highest possible precision on your timing, so that means you don’t need to rely on addons such as the gage timer for precision.

i haven’t personally noticed any real performance change using Java2D for my game… but you’ll probably only gain for special effects and transparency.