public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public boolean ignoreIfBetter() { return this.accessRestriction != null && this.accessRestriction.ignoreIfBetter(); }
protected AccessRestriction getAccessRestriction(String packageName) { if (exportedPackages != null && !exportedPackages.contains(packageName)) { AccessRule rule = new AccessRule(null /* pattern */, IProblem.ForbiddenReference, true /* keep looking for accessible type */); return new AccessRestriction(rule, AccessRestriction.COMMAND_LINE, getEntryName()); } return null; }
protected AccessRestriction getAccessRestriction(String packageName) { if (exportedPackages != null && !exportedPackages.contains(packageName)) { AccessRule rule = new AccessRule(null /* pattern */, IProblem.ForbiddenReference, true /* keep looking for accessible type */); return new AccessRestriction(rule, AccessRestriction.COMMAND_LINE, getEntryName()); } return null; }
public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
/** * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath, true/*case sensitive*/, '/')) { switch (accessRule.getProblemId()) { case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: return new AccessRestriction(accessRule, this.classpathEntryType, this.classpathEntryName); default: return null; } } } return null; }
public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /*
public boolean isBetter(NameEnvironmentAnswer otherAnswer) { if (otherAnswer == null) return true; if (this.accessRestriction == null) return true; return otherAnswer.accessRestriction != null && this.accessRestriction.getProblemId() < otherAnswer.accessRestriction.getProblemId(); } }
/** * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath, true/*case sensitive*/, '/')) { switch (accessRule.getProblemId()) { case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: return new AccessRestriction(accessRule, this.classpathEntryType, this.classpathEntryName); default: return null; } } } return null; }
public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /*
public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } public String toString() {
/** * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath, true/*case sensitive*/, '/')) { switch (accessRule.getProblemId()) { case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: return new AccessRestriction(accessRule, this.classpathEntryType, this.classpathEntryName); default: return null; } } } return null; }
public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /*
public boolean isBetter(NameEnvironmentAnswer otherAnswer) { if (otherAnswer == null) return true; if (this.accessRestriction == null) return true; return otherAnswer.accessRestriction != null && this.accessRestriction.getProblemId() < otherAnswer.accessRestriction.getProblemId(); } }
/** * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath, true/*case sensitive*/, '/')) { switch (accessRule.getProblemId()) { case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: return new AccessRestriction(accessRule, this.classpathEntryType, this.classpathEntryName); default: return null; } } } return null; }
public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /*
public boolean isBetter(NameEnvironmentAnswer otherAnswer) { if (otherAnswer == null) return true; if (this.accessRestriction == null) return true; return otherAnswer.accessRestriction != null && this.accessRestriction.getProblemId() < otherAnswer.accessRestriction.getProblemId(); } }
/** * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath, true/*case sensitive*/, '/')) { switch (accessRule.getProblemId()) { case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: return new AccessRestriction(accessRule, this.classpathEntryType, this.classpathEntryName); default: return null; } } } return null; }
public boolean ignoreIfBetter() { return this.accessRestriction != null && this.accessRestriction.ignoreIfBetter(); }
public boolean isBetter(NameEnvironmentAnswer otherAnswer) { if (otherAnswer == null) return true; if (this.accessRestriction == null) return true; return otherAnswer.accessRestriction != null && this.accessRestriction.getProblemId() < otherAnswer.accessRestriction.getProblemId(); } }