Bug 99638 - [1.5][compiler] @Deprecated does not work in package-info.java
Summary: [1.5][compiler] @Deprecated does not work in package-info.java
Status: VERIFIED DUPLICATE of bug 214948
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 09:44 EDT by Tobias Widmer CLA
Modified: 2009-01-27 04:58 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2005-06-13 09:44:42 EDT
3.1 RC2

Steps to reproduce:
- Create package-info.java
- Insert @Deprecated annotation

-> AST View shows that package binding is not deprecated. I exspect the 
binding and all types declared in this package to be deprecated as well.
Comment 1 Olivier Thomann CLA 2006-10-06 15:15:39 EDT
Need to check what javac is doing in this case.
Comment 2 Olivier Thomann CLA 2007-02-23 11:19:12 EST
This corresponds to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6492694 for the javadoc bug.
javac seems to ignore it as well.
Comment 3 Walter Harley CLA 2007-02-24 21:14:04 EST
As of N20070224-0010, it seems that the package deprecation is now causing warnings to appear, somewhat randomly.  To repro:

Create a project with a class C, an annotation A, and a package-info.java, all in package p.  Contents of C are as follows:

package p;

@A
public class C {
  @A
  void foo() {}
}

Save and build.  No warnings.  Now add @Deprecated to the package-info.  Save.  Note no warnings.  Do a clean build.  For me, I see a warning on the second @A, but not the first.  Edit C by adding a comment somewhere.  Save.  The warning disappears.  Do a clean build again.  The warning reappears.

This is responsible for a jdt.apt test failure in this nightly build.

This behavior was not present in M5A.
Comment 4 Olivier Thomann CLA 2007-02-25 20:49:00 EST
I don't see what could have changed to cause this failure.
I'll investigate.
Walter, could this test be disabled for now?
Thanks.
Comment 5 Walter Harley CLA 2007-02-26 00:07:44 EST
I have changed the test harness so that it explicitly sets the "org.eclipse.jdt.core.compiler.problem.deprecation" option in the test project to "ignore", which causes the test to pass.

The workaround is in apt.tests/ReadAnnotationTests.setupTest().  I'll remove it again when this bug is fixed - arguably it could stay in place, since the test does depend on package deprecations not producing warnings, but I like the fact that it found this problem :-)
Comment 6 Kent Johnson CLA 2008-12-15 11:55:48 EST

*** This bug has been marked as a duplicate of bug 214948 ***
Comment 7 David Audel CLA 2009-01-27 04:58:18 EST
Verified for 3.5M5 using I20090126-1300