JDK-5096931 : TypeDeclaration.getMethods needs to screen out static initializers
  • Type: Bug
  • Component: tools
  • Sub-Component: apt
  • Affected Version: 5.0u1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-09-03
  • Updated: 2012-10-09
  • Resolved: 2004-09-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u1 01Fixed 6Fixed
Related Reports
Relates :  
Relates :  
Description
The present implementation of TypeDeclaration.getMethods does not screen out static initializers (named "<clinit>") from the list of returned methods.  This is inconsistent with the source view of the contents of a type declaration.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.5.0_01 mustang FIXED IN: 1.5.0_01 mustang INTEGRATED IN: 1.5.0_01 mustang
26-09-2004

SUGGESTED FIX src/share/classes/com/sun/tools/apt/mirror/declaration>sccs sccsdiff -r1.4 TypeDeclarationImpl.jav -r1.5 TypeDeclarationImpl.java ------- TypeDeclarationImpl.java ------- 19a20 > import com.sun.tools.javac.util.Name; 21d21 < 35c35 < protected TypeDeclarationImpl(AptEnv env, ClassSymbol sym) { --- > protected TypeDeclarationImpl(AptEnv env, ClassSymbol sym) { 90c90,91 < if (s.kind == Kinds.MTH && !s.isConstructor()) { --- > if (s.kind == Kinds.MTH && !s.isConstructor() && > !env.names.clinit.equals(s.name) ) { // screen out static initializers ###@###.### 2004-09-16
16-09-2004

EVALUATION Should be fixed. ###@###.### 2004-09-03
03-09-2004