• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java: -Xlint help  RSS feed

 
Dwain Bravo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy friends,
I am trying to compile my code using xlint option enabled.
I am confused as to why the compiler is able to capture the warning in one case and in another it does not.

Code1: (Compiler does not warn the use of depricated method)




Code2: [Compiler warns this time]


Is there something which i am missing in using the xlint options?

When does the deprecated Message print and does not print.

Thanks in advance..

Regards,
Dwain Brown
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a wild guess: Since you're calling the deprecated getHours() method from within a method that is itself deprecated, lint maybe decided that it would be redundant to warn about both of them. After all, if nobody calls your print() method, they won't hit the getHours() call, and if they do call your print() method, they'll get a warning about deprecation from that method itself. As long as every path that calls one or more deprecated methods gets one warning, perhaps they decided that's good enough.
 
Dwain Bravo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Jeff,

Well...the problem is that , in any case,
i expected that the compiler would give one deprecated warning atleast, but i find no warning being generated.

I wanted to track all the deprecated methods, which the class consisits of...
Wondering if there is a solution to this ?

Regards,
Dwain
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have added code tags and deleted some blank lines from your code, and it looks a lot better . Use spaces for indenting, not tabs.
If you want to find out about deprecated members, try adding documentation comments and looking for the deprecated link in the output from the javadoc tool.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!