3434
3535public class Range {
3636 private static final String CLASS_DELIMITER = "." ;
37- private final FileEntry fileEntry ;
3837 private final MethodEntry methodEntry ;
3938 private final String fullMethodNameWithParams ;
4039 private final int lo ;
@@ -48,28 +47,19 @@ public class Range {
4847 /*
4948 * Create a primary range.
5049 */
51- public Range (StringTable stringTable , MethodEntry methodEntry , FileEntry fileEntry , int lo , int hi , int line ) {
52- this (stringTable , methodEntry , fileEntry , lo , hi , line , null );
53- }
54-
55- /*
56- * Create a secondary range.
57- */
58- public Range (StringTable stringTable , MethodEntry methodEntry , int lo , int hi , int line , Range primary ) {
59- this (stringTable , methodEntry , methodEntry .fileEntry , lo , hi , line , primary );
50+ public Range (StringTable stringTable , MethodEntry methodEntry , int lo , int hi , int line ) {
51+ this (stringTable , methodEntry , lo , hi , line , null );
6052 }
6153
6254 /*
6355 * Create a primary or secondary range.
6456 */
65- private Range (StringTable stringTable , MethodEntry methodEntry , FileEntry fileEntry , int lo , int hi , int line ,
66- Range primary ) {
67- this .fileEntry = fileEntry ;
68- if (fileEntry != null ) {
69- stringTable .uniqueDebugString (fileEntry .getFileName ());
70- stringTable .uniqueDebugString (fileEntry .getPathName ());
71- }
57+ public Range (StringTable stringTable , MethodEntry methodEntry , int lo , int hi , int line , Range primary ) {
7258 assert methodEntry != null ;
59+ if (methodEntry .fileEntry != null ) {
60+ stringTable .uniqueDebugString (methodEntry .fileEntry .getFileName ());
61+ stringTable .uniqueDebugString (methodEntry .fileEntry .getPathName ());
62+ }
7363 this .methodEntry = methodEntry ;
7464 this .fullMethodNameWithParams = stringTable .uniqueString (constructClassAndMethodNameWithParams ());
7565 this .lo = lo ;
@@ -158,7 +148,7 @@ private String constructClassAndMethodNameWithParams() {
158148 }
159149
160150 public FileEntry getFileEntry () {
161- return fileEntry ;
151+ return methodEntry . fileEntry ;
162152 }
163153
164154 public int getModifiers () {
@@ -167,11 +157,11 @@ public int getModifiers() {
167157
168158 @ Override
169159 public String toString () {
170- return String .format ("Range(lo=0x%05x hi=0x%05x %s %s:%d)" , lo , hi , constructClassAndMethodNameWithParams (), fileEntry .getFullName (), line );
160+ return String .format ("Range(lo=0x%05x hi=0x%05x %s %s:%d)" , lo , hi , constructClassAndMethodNameWithParams (), methodEntry . fileEntry .getFullName (), line );
171161 }
172162
173163 public String getFileName () {
174- return fileEntry .getFileName ();
164+ return methodEntry . fileEntry .getFileName ();
175165 }
176166
177167 public MethodEntry getMethodEntry () {
0 commit comments