JDK-6402077 : Start position is wrong for package private constructors
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-22
  • Updated: 2012-09-21
  • Resolved: 2011-03-08
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.
JDK 6 JDK 7
6u38Fixed 7 b03Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
See the constructor start position in the following example:


public class Test {

    Test() {
    }
}

Comments
EVALUATION Should be fixed using supplied patch.
21-04-2006

SUGGESTED FIX --- com/sun/tools/javac/tree/TreeInfo.java 8 Feb 2006 09:04:10 -0000 1.2.2.6 +++ com/sun/tools/javac/tree/TreeInfo.java 22 Mar 2006 10:39:54 -0000 1.12 @@ -264,7 +264,9 @@ return node.mods.pos; if (node.typarams.nonEmpty()) // List.nil() used for no typarams return getStartPos(node.typarams.head); - return getStartPos(node.restype); + if (node.restype != null) + return getStartPos(node.restype); + return node.pos; } case(JCTree.SELECT): return getStartPos(((JCFieldAccess) tree).selected);
22-03-2006