United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6402077 : Start position is wrong for package private constructors

Details
Type:
Bug
Submit Date:
2006-03-22
Status:
Closed
Updated Date:
2012-09-21
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
tools
OS:
generic
Sub-Component:
javac
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
See the constructor start position in the following example:


public class Test {

    Test() {
    }
}

                                    

Comments
EVALUATION

Should be fixed using supplied patch.
                                     
2006-04-21
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);
                                     
2006-03-22



Hardware and Software, Engineered to Work Together