Bug 39268 - Optional warning for indirect static references
Summary: Optional warning for indirect static references
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-24 08:32 EDT by Philipe Mulet CLA
Modified: 2003-07-16 06:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-06-24 08:32:19 EDT
Build 3.0m1

Would be nice to signal cases where static members are referenced through a 
qualification which doesn't match the declaring class of the target member,

e.g.

public class X {
   public static int FOO = 0;
}

public class Y extends X {
}

Y.FOO  --> <warning> indirect references to X.FOO
Comment 1 Philipe Mulet CLA 2003-07-03 18:17:16 EDT
Warning added for static fields and methods.

Added optional compiler diagnosis for indirect references to static members 
(matching problem IDs are: IProblem.IndirectAccessToStaticField, 
IProblem.IndirectAccessToStaticMethod). 

COMPILER / Reporting Indirect Reference to a Static Member
   When enabled, the compiler will issue an error or a warning whenever a   
   static field or method is accessed in an indirect way. A reference to a 
   static member should preferably be qualified with its declaring type name.
   - opt id         "org.eclipse.jdt.core.compiler.problem.indirectStaticAccess"
   - possible values:   { "error", "warning", "ignore" }
   - default:           "ignore"

Fixed
Comment 2 David Audel CLA 2003-07-16 06:58:29 EDT
Verified.