Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 48238 - [compiler] JDT : report final, report static
Summary: [compiler] JDT : report final, report static
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 48239 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-07 16:28 EST by Mohamed ZERGAOUI CLA
Modified: 2007-10-11 02:26 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mohamed ZERGAOUI CLA 2003-12-07 16:28:30 EST
Report final use :
It is possible with this architecture to report that a member, a method or a 
parameter or a local variable is used as an final one (not reassigned). In that 
case a hint would be to mention that.
Report static use :
It is possible with this architecture to report that a method is a static one 
(no access to this). In that case a hint would be to mention that
Comment 1 Philipe Mulet CLA 2003-12-07 18:17:47 EST
Doing a full analysis would be quite expensive, and would require a dedicated 
QA tool. A local diagnosis to a compilation unit is in range for the compiler 
though, and we currently perform similar analysis for diagnosing unused private 
members (as we known private members cannot be used from the outside, the 
amount of analysis involved here is quite small).

We could extend our diagnosis to report these particular scenarii. 
Comment 2 Philipe Mulet CLA 2003-12-07 18:18:41 EST
*** Bug 48239 has been marked as a duplicate of this bug. ***
Comment 3 Philipe Mulet CLA 2004-05-10 05:38:38 EDT
Will reconsider post 3.0
Comment 4 Mohamed ZERGAOUI CLA 2004-05-19 14:36:25 EDT
Some hints

Report static
-------------

If IsImplicitThisMask is not flagged in non static method or inner class, to
report in MethodScope and in ClassScope a
IProblem.PotentiallyStaticMethodOrClass (or something like that)

Report final 
------------

I propose in org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers the
constant "AccReUsed" for member, method, parameter or local variable which could
overlapp the value of AccIsDefaultConstructor (for example) or something in ASTNode.
It simply check in Assignment :
 * it will position AccReUsed in non final member, parameter or local variable
if assigned a second time.

and in MethodDeclaration (or may be in MethodScope) :
 * position AccReUsed in non final method if the method is overridden
Comment 5 Mohamed ZERGAOUI CLA 2004-09-30 08:01:04 EDT
reopen bug for 3.1 or later
Comment 6 Philipe Mulet CLA 2005-04-07 08:07:35 EDT
Deferring post 3.1
Comment 7 Mohamed ZERGAOUI CLA 2007-03-27 12:48:42 EDT
Can we reconsider this RFE ?
Comment 8 Philipe Mulet CLA 2007-03-28 05:49:27 EDT
Too late for 3.3. 
Comment 9 Mohamed ZERGAOUI CLA 2007-10-10 14:50:55 EDT
Can we reconsider it for 3.4 ?
Comment 10 Jerome Lanneluc CLA 2007-10-11 02:26:42 EDT
This is not on the plan, but a patch is always welcome.