/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }
/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }