• Post Reply Bookmark Topic Watch Topic
  • New Topic

Annotations- some problem with java releases?  RSS feed

 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried this code out on
jdk 1.5.0-rc
and jdk 1.5.0_04

though the @override annotation works perfectly,
the @SuppressWarnings and @Deprecated just won't work!!!

take a look at this code

@SuppressWarnings("unchecked")
public void doX(){
Collection c= new ArrayList();
c.add("hi there"); //here's the unsafe operation and
// this warning, the compiler is supposed to suppress
}

but when I try to compile it, it just gives the same old warnings about unsafe operations,

Secondly, I mark a method as Deprecated and then use it but the compiler doesn't flag it

what am I doing wrong?

Immediate help will be duly appreciated,
thanks a ton!
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun introduced the @SuppressWarnings annotation in 1.5.0 but didn't provide any compiler support for it. Thankfully the annotation is fully supported in the newest release 1.5.0_06.
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a ton for the feedback, I'm downloading update 7 immediately

arrgghhhh and I was breaking my head over it all day.


and there's not even a mention of this in the JSR that talks of annotations. these people should have put in a word or two about the reference implementations shouldn't they?

or it'll be a story all the way!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!