Lines 1960-1965
Link Here
|
1960 |
private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, String container, IPath sourceAttachment, String entryPathMsg) { |
1960 |
private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, String container, IPath sourceAttachment, String entryPathMsg) { |
1961 |
if (path.isAbsolute() && !path.isEmpty()) { |
1961 |
if (path.isAbsolute() && !path.isEmpty()) { |
1962 |
Object target = JavaModel.getTarget(path, true); |
1962 |
Object target = JavaModel.getTarget(path, true); |
|
|
1963 |
if (target == null) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661 |
1964 |
IPath workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation(); |
1965 |
if (workspaceRoot.isPrefixOf(path)) { |
1966 |
target = JavaModel.getTarget(path.makeRelativeTo(workspaceRoot).makeAbsolute(), true); |
1967 |
} |
1968 |
} |
1963 |
if (target != null && !JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) { |
1969 |
if (target != null && !JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) { |
1964 |
long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)); |
1970 |
long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)); |
1965 |
long libraryJDK = Util.getJdkLevel(target); |
1971 |
long libraryJDK = Util.getJdkLevel(target); |