Bug 54098 - -deprecation not working?
Summary: -deprecation not working?
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-08 17:42 EST by Wes Isberg CLA
Modified: 2004-03-15 12:12 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2004-03-08 17:42:43 EST
This produces two warnings in javac but none in ajc 1.1.1 or head when run using
-deprecation (from the scripts - haven't tried the harness).  I noticed that no
tests that support eclipse use the -deprecation flag.  This used to be a known
limitation, but I forgot why (and eclipse seems to support it, so...).  If we
don't  support it, perhaps we should warn that the option is not supported
(removing it would break people using ajc as javac).

------------
public class Foo {
    public static void main(String[] args) {
        Bar.bar();
    }
}
/** @deprecated */
class Bar {
    /** @deprecated */
    static void bar() {}
}
Comment 1 Adrian Colyer CLA 2004-03-09 04:27:52 EST
I'll look into this in the codebase and see if I can figure out what's going on. 
Jim - if there was a conscious choice not to support this for some reason that 
would be good to know... thks.
Comment 2 Jim Hugunin CLA 2004-03-09 11:06:29 EST
There is an issue with compiler modes and compilation units here, but I don't 
remember exactly what.  While I was at Hursley we fixed a bug in the one test 
case that checked for deprecation warnings.  This was failing on my machine 
because I was running on the JRE where the standard rt.jar had been compiled 
without information about deprecation messages.  In this case it was a bug in 
the test case and not in the implementation.

This looks like a different issue, but could be sensitive to other weird 
details about how deprecation is handled.  There are special rules for not 
warning about deprecation in the same compilation unit.  Could this particular 
example just be a minor difference between eclipse and javac's notion of a 
CU?  Does this code show a deprecation error when compiling with our 
underlying eclipse compiler?
Comment 3 Adrian Colyer CLA 2004-03-15 12:12:07 EST
As Jim says, this seems to be because the deprecated class is in the same CU as 
the using class.

I tracked the arg parsing through, and -deprecation does set the appropriate 
options. If you put the deprecated class into a separate file, you get the 
expected deprecation messages. I've added a test case to ensure this remains so 
in the future.