811 |
{ |
{ |
812 |
String topLevelName = name; |
String topLevelName = name; |
813 |
int ndx = topLevelName.indexOf('.'); |
int ndx = topLevelName.indexOf('.'); |
814 |
String innerClassName = null; |
|
815 |
|
String _innerClassName = null; |
816 |
if (ndx > 0) { |
if (ndx > 0) { |
817 |
innerClassName = topLevelName.substring(ndx + 1); |
_innerClassName = topLevelName.substring(ndx + 1); |
818 |
topLevelName = topLevelName.substring(0, ndx); |
topLevelName = topLevelName.substring(0, ndx); |
819 |
} |
} |
820 |
|
|
821 |
if (this.name.equals(topLevelName)) { |
if (this.name.equals(topLevelName)) { |
822 |
if (null == innerClassName) { |
if (null == _innerClassName) { |
823 |
return qualifiedName; |
return qualifiedName; |
824 |
} |
} |
825 |
else { |
else { |
826 |
return qualifiedName + "." + innerClassName; |
return qualifiedName + "." + _innerClassName; |
827 |
} |
} |
828 |
} |
} |
829 |
else { |
else { |
1027 |
|
|
1028 |
for (Iterator it=sourcePath.iterator(); it.hasNext(); ) { |
for (Iterator it=sourcePath.iterator(); it.hasNext(); ) { |
1029 |
|
|
1030 |
File sourcePath = (File)it.next(); |
File _sourcePath = (File)it.next(); |
1031 |
|
|
1032 |
StringBuffer packageOrClassPrefix = new StringBuffer(); |
StringBuffer packageOrClassPrefix = new StringBuffer(); |
1033 |
StringTokenizer st = new StringTokenizer(importSpecifier, "."); |
StringTokenizer st = new StringTokenizer(importSpecifier, "."); |
1034 |
while (st.hasMoreTokens() && sourcePath.isDirectory()) { |
while (st.hasMoreTokens() && _sourcePath.isDirectory()) { |
1035 |
String token = st.nextToken(); |
String token = st.nextToken(); |
1036 |
if ("*".equals(token)) { |
if ("*".equals(token)) { |
1037 |
return new ResolvedImportPackageFile(sourcePath, |
return new ResolvedImportPackageFile(_sourcePath, |
1038 |
packageOrClassPrefix.substring(0, packageOrClassPrefix.length() - 1)); |
packageOrClassPrefix.substring(0, packageOrClassPrefix.length() - 1)); |
1039 |
} |
} |
1040 |
else { |
else { |
1041 |
packageOrClassPrefix.append(token); |
packageOrClassPrefix.append(token); |
1042 |
packageOrClassPrefix.append('.'); |
packageOrClassPrefix.append('.'); |
1043 |
File classFile = new File(sourcePath, token + ".java"); |
File classFile = new File(_sourcePath, token + ".java"); |
1044 |
//System.err.println(" looking for file " + classFile); |
//System.err.println(" looking for file " + classFile); |
1045 |
if (classFile.exists()) { |
if (classFile.exists()) { |
1046 |
StringBuffer innerClassName = new StringBuffer(); |
StringBuffer innerClassName = new StringBuffer(); |
1054 |
return new ResolvedImportClassFile(classFile, innerClassName.toString(), token, importSpecifier); |
return new ResolvedImportClassFile(classFile, innerClassName.toString(), token, importSpecifier); |
1055 |
} |
} |
1056 |
else { |
else { |
1057 |
sourcePath = new File(sourcePath, token); |
_sourcePath = new File(_sourcePath, token); |
1058 |
} |
} |
1059 |
} |
} |
1060 |
} |
} |