Lines 997-1005
Link Here
|
997 |
JavaProjectElementInfo projectInfo = (JavaProjectElementInfo) getJavaModelManager().getInfo(project); |
997 |
JavaProjectElementInfo projectInfo = (JavaProjectElementInfo) getJavaModelManager().getInfo(project); |
998 |
ProjectCache projectCache = projectInfo == null ? null : projectInfo.projectCache; |
998 |
ProjectCache projectCache = projectInfo == null ? null : projectInfo.projectCache; |
999 |
HashtableOfArrayToObject allPkgFragmentsCache = projectCache == null ? null : projectCache.allPkgFragmentsCache; |
999 |
HashtableOfArrayToObject allPkgFragmentsCache = projectCache == null ? null : projectCache.allPkgFragmentsCache; |
1000 |
IClasspathEntry[] entries = |
1000 |
boolean isJavaLike = org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(resourcePath.lastSegment()); |
1001 |
org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(resourcePath.lastSegment()) |
1001 |
IClasspathEntry[] entries = isJavaLike ? project.getRawClasspath() // JAVA file can only live inside SRC folder (on the raw path) |
1002 |
? project.getRawClasspath() // JAVA file can only live inside SRC folder (on the raw path) |
|
|
1003 |
: ((JavaProject)project).getResolvedClasspath(); |
1002 |
: ((JavaProject)project).getResolvedClasspath(); |
1004 |
|
1003 |
|
1005 |
int length = entries.length; |
1004 |
int length = entries.length; |
Lines 1011-1016
Link Here
|
1011 |
if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) continue; |
1010 |
if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) continue; |
1012 |
IPath rootPath = entry.getPath(); |
1011 |
IPath rootPath = entry.getPath(); |
1013 |
if (rootPath.equals(resourcePath)) { |
1012 |
if (rootPath.equals(resourcePath)) { |
|
|
1013 |
if (isJavaLike) |
1014 |
return null; |
1014 |
return project.getPackageFragmentRoot(resource); |
1015 |
return project.getPackageFragmentRoot(resource); |
1015 |
} else if (rootPath.isPrefixOf(resourcePath)) { |
1016 |
} else if (rootPath.isPrefixOf(resourcePath)) { |
1016 |
// allow creation of package fragment if it contains a .java file that is included |
1017 |
// allow creation of package fragment if it contains a .java file that is included |