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 7175355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:16:26+00:00 2026-05-28T16:16:26+00:00

I see from the javadoc that the @SuppressWarnings annotation applies to TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE targets. Why

  • 0

I see from the javadoc that the @SuppressWarnings annotation applies to

TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE

targets. Why does it not also apply to PACKAGE?

I have some generated code which contains some raw types warnings. I’d like to be able to add a package-info.java file for the generated classes (in a separate physical directory but the same java package) which tells eclipse to ignore any raw types warnings emanating from the generated classes in package.

Why is this not supported? Is there an alternate way of suppressing a warning in an entire package?

  • 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-28T16:16:27+00:00Added an answer on May 28, 2026 at 4:16 pm

    The reason that suppressing warnings at the package level is not allowed was explained in the response to an old bug report (Status – Closed, Will Not Fix): Allow SuppressWarnings to be specified at the package level.

    The warnings actually indicates potential problems in the
    generated code.

    Currently, SuppressWarnings have the desirable property of
    only affecting lexically nested code. This means that you
    can immediately see if a warning might be suppressed in
    code you’re reading.

    This proposal would violate this property to solve an uncommon
    problem which in most cases can be worked around.

    There are a couple of work arounds suggested in that response as well.

    1. compile the generated code by itself using -source 1.4 and -target 5.
    1. request an updated version of javacc which either uses suppresswarnings
      or doesn’t generate code which causes warnings.

    I think the first suggestion, putting the generated code in its own project, should work for you. The second suggestion looks like its more specific to the problem in the bug report. I don’t know if you’re using javacc or not.

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

Sidebar

Related Questions

One thing I really, really miss from Javadoc is the ability to see which
I see from Virtual inheritance doesn't break static composition? that virtual inheritance adds sizeof(pointer)
As you can see from the following array, there are three elements that appear
I see from the Postgres 8.1 docs that EXPLAIN generated something like tabular data:
I am trying to see from an SQL console what is inside an Oracle
How can I create a Popup balloon like you would see from Windows Messenger
I'm been reading up on Ajax and would like to see from the stackoverflow
I'm setting up a new project using CruiseControl.net 1.4. I see from ccnet contributions
I have some really funky code. As you can see from the code below
I see this from time to time and want to know what it is.

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.