private AccessRestriction getViolatedRestriction(String typeName, String packageName, ClasspathEntry entry, AccessRestriction accessRestriction) { AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } return accessRestriction; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, ClasspathEntry entry, AccessRestriction accessRestriction) { AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } return accessRestriction; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, ClasspathEntry entry, AccessRestriction accessRestriction) { AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } return accessRestriction; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, IType type, AccessRestriction accessRestriction) { PackageFragmentRoot root = (PackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); ClasspathEntry entry = (ClasspathEntry) this.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } } return accessRestriction; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, IType type, AccessRestriction accessRestriction) { PackageFragmentRoot root = (PackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); ClasspathEntry entry = (ClasspathEntry) this.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } } return accessRestriction; }
private AccessRestriction getViolatedRestriction(String typeName, String packageName, IType type, AccessRestriction accessRestriction) { PackageFragmentRoot root = (PackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); ClasspathEntry entry = (ClasspathEntry) this.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) { // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); char[] typeChars = typeName.toCharArray(); accessRestriction = accessRuleSet.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/')); } } return accessRestriction; }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
void encodeAccessRules(XMLWriter writer, boolean indent, boolean newLine) { writer.startTag(TAG_ACCESS_RULES, indent); AccessRule[] rules = getAccessRuleSet().getAccessRules(); for (int i = 0, length = rules.length; i < length; i++) { encodeAccessRule(rules[i], writer, indent, newLine); } writer.endTag(TAG_ACCESS_RULES, indent, true/*insert new line*/); }
ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) {
ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) {
ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) {
ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root); if (entry != null) { // reverse map always contains resolved CP entry AccessRuleSet accessRuleSet = entry.getAccessRuleSet(); if (accessRuleSet != null) {
private ClasspathLocation mapToClassPathLocation( JavaModelManager manager, PackageFragmentRoot root) { ClasspathLocation cp = null; IPath path = root.getPath(); try { if (root.isArchive()) { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = new ClasspathJar(manager.getZipFile(path), rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } else { Object target = JavaModel.getTarget(path, true); if (target != null) { if (root.getKind() == IPackageFragmentRoot.K_SOURCE) { cp = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars()); } else { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = ClasspathLocation.forBinaryFolder((IContainer) target, false, rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } } } } catch (CoreException e1) { // problem opening zip file or getting root kind // consider root corrupt and ignore } return cp; }
/** * Used to perform export/restriction propagation across referring projects/containers */ public ClasspathEntry combineWith(ClasspathEntry referringEntry) { if (referringEntry == null) return this; if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null ) { boolean combine = this.entryKind == CPE_SOURCE || referringEntry.combineAccessRules(); return new ClasspathEntry( getContentKind(), getEntryKind(), getPath(), this.inclusionPatterns, this.exclusionPatterns, getSourceAttachmentPath(), getSourceAttachmentRootPath(), getOutputLocation(), referringEntry.isExported() || this.isExported, // duplicate container entry for tagging it as exported combine(referringEntry.getAccessRules(), getAccessRules(), combine), this.combineAccessRules, this.extraAttributes); } // no need to clone return this; }
/** * Used to perform export/restriction propagation across referring projects/containers */ public ClasspathEntry combineWith(ClasspathEntry referringEntry) { if (referringEntry == null) return this; if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null ) { boolean combine = this.entryKind == CPE_SOURCE || referringEntry.combineAccessRules(); return new ClasspathEntry( getContentKind(), getEntryKind(), getPath(), this.inclusionPatterns, this.exclusionPatterns, getSourceAttachmentPath(), getSourceAttachmentRootPath(), getOutputLocation(), referringEntry.isExported() || this.isExported, // duplicate container entry for tagging it as exported combine(referringEntry.getAccessRules(), getAccessRules(), combine), this.combineAccessRules, this.extraAttributes); } // no need to clone return this; }
/** * Used to perform export/restriction propagation across referring projects/containers */ public ClasspathEntry combineWith(ClasspathEntry referringEntry) { if (referringEntry == null) return this; if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null ) { boolean combine = this.entryKind == CPE_SOURCE || referringEntry.combineAccessRules(); return new ClasspathEntry( getContentKind(), getEntryKind(), getPath(), this.inclusionPatterns, this.exclusionPatterns, getSourceAttachmentPath(), getSourceAttachmentRootPath(), getOutputLocation(), referringEntry.isExported() || this.isExported, // duplicate container entry for tagging it as exported combine(referringEntry.getAccessRules(), getAccessRules(), combine), this.combineAccessRules, this.extraAttributes); } // no need to clone return this; }