• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java compiler warning

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm reviewing some java code (not mine) which displays the following in eclipse: "The Method xxx(xx, xx) from the type xxx is never used locally". I'm a newbie - I checked the balance of the project as best I could - I did not see this method invoked at all.

Does this message indicated that it is not invoked at all?

If not - could you please provide an explanatioin. Thanking you in advance...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the word "locally" is crucial. It means that in your current project the method is not used. You can test that by commenting it out, and rebuilding the complete project - it should compile fine. But if it's not a private method then it may be used by other code that uses this class. Not sure if that's applicable to your project, but think of a library - all of its public methods are probably not used by the library itself, but they're certainly used by applications that use that library. In that case it wouldn't be safe to remove the method, because it's part of the public API the library exposes.
 
bob reilly
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method is private - so I think your answer just about does it. BTW - I enjoyed viewing your website 2002 USA visit.

Thank you for your comments.
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I can remember, you only get that Eclipse warning for private members.
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic