Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6002343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:57:52+00:00 2026-05-23T00:57:52+00:00

I would like to know why Eclipse doesn’t by default register an error or

  • 0

I would like to know why Eclipse doesn’t by default register an error or warning about a method like this:

public void setX(int x) {
    // empty method body
}

You can turn a warning on for this that reads “The parameter x is never read”, in Preferences>Java>Compiler>Errors/Warnings>Unnecessary Code. You can set this warning so that it ignores overriding and implementing methods.

I can only think of one reason why you may want to ignore the situation in the code I pasted: you may want to call a particular version of an overloaded method by using an arbitrary-value argument of a particular type. It seems that would be very bad programming practice though. Is there some better reason for leaving this warning off by default?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:57:53+00:00Added an answer on May 23, 2026 at 12:57 am

    One situation where it can be useful is if you’re writing deliberate no-op methods in a base class, which can be overridden by derived classes. Think of things like MouseAdapter for example.

    The problem is there’s no way of indicating in the language “yes, this is deliberately a no-op”… the compiler either has to take comments into account, or you’ve got to use @SuppressWarnings etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know what the error message in Eclipse means: The constructor
I would like to know where can I find the code which eclipse uses
I would like to know how to establish the link between eclipse - tomcat
i would like to know where does eclipse save entered args?(in which file?) because
I would like to know if I can add an average column to this
I would like to know some way to do this, maybe someone can help
I would like to know a bit more about how the entity framework works.
I would like to know if I can open 2 different diagrams using MS
I would like to know which dependency described in my pom.xml brings a transitive
I would like to know what semaphores, messageQueues, etc... are active in my vxWorks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.