private static void checkConflict( String earlierRequirement, Set<Feature<?>> earlierFeatures, String newRequirement, Set<Feature<?>> newFeatures, Object source) throws ConflictingRequirementsException { if (!Collections.disjoint(newFeatures, earlierFeatures)) { throw new ConflictingRequirementsException( String.format( Locale.ROOT, "Annotation requires to be %s features that earlier " + "annotations required to be %s.", newRequirement, earlierRequirement), intersection(newFeatures, earlierFeatures), source); } }
+ "implicitly requires one or more features to be both present " + "and absent.", intersection(allPresentFeatures, allAbsentFeatures), testerAnnotation);
/** * Construct a new {@link java.util.Set} that is the intersection * of the given sets. */ // Calls generic varargs method. @SuppressWarnings("unchecked") public static <T> Set<T> intersection( Set<? extends T> set1, Set<? extends T> set2) { return intersection(new Set[] {set1, set2}); }
private static void checkConflict( String earlierRequirement, Set<Feature<?>> earlierFeatures, String newRequirement, Set<Feature<?>> newFeatures, Object source) throws ConflictingRequirementsException { Set<Feature<?>> conflictingFeatures; conflictingFeatures = intersection(newFeatures, earlierFeatures); if (!conflictingFeatures.isEmpty()) { throw new ConflictingRequirementsException(String.format( "Annotation requires to be %s features that earlier " + "annotations required to be %s.", newRequirement, earlierRequirement), conflictingFeatures, source); } }
private static void checkConflict( String earlierRequirement, Set<Feature<?>> earlierFeatures, String newRequirement, Set<Feature<?>> newFeatures, Object source) throws ConflictingRequirementsException { if (!Collections.disjoint(newFeatures, earlierFeatures)) { throw new ConflictingRequirementsException( String.format( Locale.ROOT, "Annotation requires to be %s features that earlier " + "annotations required to be %s.", newRequirement, earlierRequirement), intersection(newFeatures, earlierFeatures), source); } }
+ "implicitly requires one or more features to be both present " + "and absent.", intersection(allPresentFeatures, allAbsentFeatures), testerAnnotation);
addImpliedFeatures(Helpers.<Feature<?>>copyToSet(absentFeatures)); Set<Feature<?>> conflictingFeatures = intersection(allPresentFeatures, allAbsentFeatures); if (!conflictingFeatures.isEmpty()) { throw new ConflictingRequirementsException("Annotation explicitly or " +