Lines Matching refs:from
105 public IApiDelta compare(IApi from, IApi to) { in compare() argument
106 assert from.getVisibility() == to.getVisibility(); in compare()
108 Set<IPackage> fromPackages = from.getPackages(); in compare()
113 public IPackageDelta createChangedDelta(IPackage from, in compare()
115 return comparePackage(from, to); in compare()
118 public IPackageDelta createAddRemoveDelta(IPackage from, in compare()
120 return new SigPackageDelta(from, to); in compare()
123 public boolean considerEqualElement(IPackage from, in compare()
125 return from.getName().equals(to.getName()); in compare()
131 delta = new SigApiDelta(from, to); in compare()
137 private IPackageDelta comparePackage(IPackage from, IPackage to) { in comparePackage() argument
138 assert from.getName().equals(to.getName()); in comparePackage()
140 Set<IClassDefinition> fromClasses = from.getClasses(); in comparePackage()
146 public boolean considerEqualElement(IClassDefinition from, in comparePackage()
148 return sameClassDefinition(from, to); in comparePackage()
152 IClassDefinition from, IClassDefinition to) { in comparePackage()
153 return compareClass(from, to); in comparePackage()
157 IClassDefinition from, IClassDefinition to) { in comparePackage()
158 return new SigClassDefinitionDelta(from, to); in comparePackage()
164 delta = new SigPackageDelta(from, to); in comparePackage()
169 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from in comparePackage()
173 delta = new SigPackageDelta(from, to); in comparePackage()
180 private IClassDefinitionDelta compareClass(IClassDefinition from, in compareClass() argument
182 assert from.getKind() == to.getKind(); in compareClass()
183 assert from.getName().equals(to.getName()); in compareClass()
184 assert from.getPackageName().equals(to.getPackageName()); in compareClass()
189 Set<IModifierDelta> modifierDeltas = compareModifiers(from in compareClass()
193 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
199 ITypeReferenceDelta<?> superTypeDelta = compareType(from in compareClass()
203 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
209 Set<ITypeReferenceDelta<?>> interfaceDeltas = compareInterfaces(from, in compareClass()
213 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
220 compareTypeVariableSequence(from.getTypeParameters(), in compareClass()
224 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
230 Set<IConstructorDelta> constructorDeltas = compareConstructors(from in compareClass()
234 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
240 Set<IMethodDelta> methodDeltas = compareMethods(from, to); in compareClass()
243 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
249 Set<IFieldDelta> fieldDeltas = compareFields(from.getFields(), to in compareClass()
253 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
259 if (from.getKind() == Kind.ENUM) { in compareClass()
260 Set<IEnumConstantDelta> enumDeltas = compareEnumConstants(from in compareClass()
264 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
268 } else if (from.getKind() == Kind.ANNOTATION) { in compareClass()
270 compareAnnotationFields(from.getAnnotationFields(), in compareClass()
274 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
280 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from in compareClass()
284 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
292 IClassDefinition from, IClassDefinition to) { in compareInterfaces() argument
293 Set<ITypeReference> fromClosure = getInterfaceClosure(from); in compareInterfaces()
296 Set<ITypeReference> fromInterfaces = from.getInterfaces(); in compareInterfaces()
379 private Set<IAnnotationDelta> compareAnnotations(Set<IAnnotation> from, in compareAnnotations() argument
381 return compareSets(from, to, in compareAnnotations()
384 IAnnotation from, IAnnotation to) { in compareAnnotations()
385 return new SigAnnotationDelta(from, to); in compareAnnotations()
388 public boolean considerEqualElement(IAnnotation from, in compareAnnotations() argument
390 return sameClassDefinition(from.getType() in compareAnnotations()
396 IAnnotation from, IAnnotation to) { in compareAnnotations() argument
397 return compareAnnotation(from, to); in compareAnnotations()
403 Set<IAnnotationField> from, Set<IAnnotationField> to) {
404 return compareSets(from, to,
406 public boolean considerEqualElement(IAnnotationField from,
408 return from.getName().equals(to.getName());
412 IAnnotationField from, IAnnotationField to) {
413 return new SigAnnotationFieldDelta(from, to);
417 IAnnotationField from, IAnnotationField to) {
418 return compareAnnotationField(from, to);
424 Set<IEnumConstant> from, Set<IEnumConstant> to) {
425 return compareSets(from, to,
427 public boolean considerEqualElement(IEnumConstant from,
429 return from.getName().equals(to.getName());
433 IEnumConstant from, IEnumConstant to) {
434 return new SigEnumConstantDelta(from, to);
438 IEnumConstant from, IEnumConstant to) {
439 return compareEnumConstant(from, to);
444 private Set<IFieldDelta> compareFields(Set<IField> from, Set<IField> to) {
445 return compareSets(from, to, new SigComparator<IField, IFieldDelta>() {
446 public boolean considerEqualElement(IField from, IField to) {
447 return from.getName().equals(to.getName());
450 public IFieldDelta createAddRemoveDelta(IField from, IField to) {
451 return new SigFieldDelta(from, to);
454 public IFieldDelta createChangedDelta(IField from, IField to) {
455 return compareField(from, to);
460 private Set<IMethodDelta> compareMethods(IClassDefinition from,
462 assert from != null;
467 Set<IMethod> fromMethods = new HashSet<IMethod>(from.getMethods());
468 Set<IMethod> fromClosure = getMethodClosure(from);
536 private Set<IConstructorDelta> compareConstructors(Set<IConstructor> from,
538 return compareSets(from, to,
540 public boolean considerEqualElement(IConstructor from,
542 return equalsSignature(from, to);
546 IConstructor from, IConstructor to) {
547 return new SigConstructorDelta(from, to);
551 IConstructor from, IConstructor to) {
552 return compareConstructor(from, to);
558 private boolean equalsSignature(IExecutableMember from,
560 if (from.getName().equals(to.getName())) {
561 return compareTypeSequence(getParameterList(from.getParameters()),
575 private IAnnotationDelta compareAnnotation(IAnnotation from,
577 assert sameClassDefinition(from.getType().getClassDefinition(), to
581 getNormalizedAnnotationElements(from);
591 delta = new SigAnnotationDelta(from, to);
629 Set<IAnnotationElement> from, Set<IAnnotationElement> to) {
630 return compareSets(from, to,
633 IAnnotationElement from, IAnnotationElement to) {
634 return from.getDeclaringField().getName().equals(
639 IAnnotationElement from, IAnnotationElement to) {
640 return new SigAnnotationElementDelta(from, to);
644 IAnnotationElement from, IAnnotationElement to) {
645 return compareAnnotationElement(from, to);
651 IAnnotationElement from, IAnnotationElement to) {
653 SigValueDelta valueDelta = compareValue(from.getValue(), to.getValue());
656 delta = new SigAnnotationElementDelta(from, to);
672 private IMethodDelta compareMethod(IMethod from, IMethod to) {
673 assert from != null && to != null;
677 prepareMethodModifiers(from), prepareMethodModifiers(to));
679 methodDelta = new SigMethodDelta(from, to);
683 Set<IParameterDelta> parameterDeltas = compareParameterSequence(from
687 methodDelta = new SigMethodDelta(from, to);
692 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
696 methodDelta = new SigMethodDelta(from, to);
702 compareTypeVariableSequence(from.getTypeParameters(),
706 methodDelta = new SigMethodDelta(from, to);
712 normalizeExceptions(from.getExceptions()),
716 methodDelta = new SigMethodDelta(from, to);
721 ITypeReferenceDelta<?> returnTypeDelta = compareType(from
725 methodDelta = new SigMethodDelta(from, to);
872 private IConstructorDelta compareConstructor(IConstructor from,
875 Set<IModifierDelta> modiferDeltas = compareModifiers(from
878 constructorDelta = new SigConstructorDelta(from, to);
882 Set<IParameterDelta> parameterDeltas = compareParameterSequence(from
886 constructorDelta = new SigConstructorDelta(from, to);
891 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
895 constructorDelta = new SigConstructorDelta(from, to);
901 compareTypeVariableSequence(from.getTypeParameters(),
905 constructorDelta = new SigConstructorDelta(from, to);
911 normalizeExceptions(from.getExceptions()),
915 constructorDelta = new SigConstructorDelta(from, to);
923 List<IParameter> from, List<IParameter> to) {
924 assert from.size() == to.size();
926 Iterator<IParameter> fromIterator = from.iterator();
938 private IParameterDelta compareParameter(IParameter from, IParameter to) {
940 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
944 delta = new SigParameterDelta(from, to);
949 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
953 delta = new SigParameterDelta(from, to);
961 List<ITypeVariableDefinition> from,
965 if (from.size() != to.size()) {
966 for (ITypeVariableDefinition fromVariable : from) {
977 Iterator<ITypeVariableDefinition> fromIterator = from.iterator();
990 ITypeVariableDefinition from, ITypeVariableDefinition to) {
992 from, to);
996 new SigTypeVariableDefinitionDelta(from, to);
1000 IUpperBoundsDelta upperBoundDelta = compareUpperBounds(from
1005 new SigTypeVariableDefinitionDelta(from, to);
1013 ITypeVariableReference from, ITypeVariableReference to) {
1015 from.getTypeVariableDefinition(), to
1019 new SigTypeVariableReferenceDelta(from, to);
1026 private Set<IModifierDelta> compareModifiers(Set<Modifier> from,
1028 return compareSets(from, to,
1030 public boolean considerEqualElement(Modifier from,
1032 return from.equals(to);
1035 public IModifierDelta createAddRemoveDelta(Modifier from,
1037 return new SigModifierDelta(from, to);
1040 public IModifierDelta createChangedDelta(Modifier from,
1048 private IFieldDelta compareField(IField from, IField to) {
1051 Set<IModifierDelta> modiferDeltas = compareModifiers(from
1054 fieldDelta = new SigFieldDelta(from, to);
1058 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
1062 fieldDelta = new SigFieldDelta(from, to);
1067 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
1071 fieldDelta = new SigFieldDelta(from, to);
1078 private IEnumConstantDelta compareEnumConstant(IEnumConstant from,
1082 Set<IModifierDelta> modiferDeltas = compareModifiers(from
1085 enumConstantDelta = new SigEnumConstantDelta(from, to);
1089 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
1093 enumConstantDelta = new SigEnumConstantDelta(from, to);
1098 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
1102 enumConstantDelta = new SigEnumConstantDelta(from, to);
1120 private IAnnotationFieldDelta compareAnnotationField(IAnnotationField from,
1124 Set<IModifierDelta> modiferDeltas = compareModifiers(from
1127 annotationFieldDelta = new SigAnnotationFieldDelta(from, to);
1131 Set<IAnnotationDelta> annotationDeltas = compareAnnotations(from
1135 annotationFieldDelta = new SigAnnotationFieldDelta(from, to);
1140 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
1144 annotationFieldDelta = new SigAnnotationFieldDelta(from, to);
1149 IValueDelta defaultValueDelta = compareValue(from.getDefaultValue(), to
1153 annotationFieldDelta = new SigAnnotationFieldDelta(from, to);
1161 private SigValueDelta compareValue(Object from, Object to) {
1163 if (from == null && to == null) {
1168 if (from == null || to == null) {
1169 return new SigValueDelta(from, to);
1174 if (from.getClass() == to.getClass()) {
1175 if (from.getClass().isArray()) {
1176 Object[] fromArray = (Object[]) from;
1177 Object[] toArray = (Object[]) from;
1179 delta = new SigValueDelta(from, to);
1181 } else if (from instanceof IEnumConstant) {
1183 (IEnumConstant) from, (IEnumConstant) to);
1185 delta = new SigValueDelta(from, to);
1187 } else if (from instanceof IAnnotation) {
1189 (IAnnotation) from, (IAnnotation) to);
1191 delta = new SigValueDelta(from, to);
1193 } else if (from instanceof IField) {
1194 IFieldDelta fieldDelta = compareField((IField) from,
1197 delta = new SigValueDelta(from, to);
1199 } else if (from instanceof ITypeReference) {
1201 compareType((ITypeReference) from, (ITypeReference) to,
1204 delta = new SigValueDelta(from, to);
1206 } else if (!from.equals(to)) {
1207 delta = new SigValueDelta(from, to);
1210 } else if (!(from == null && to == null)) {
1211 delta = new SigValueDelta(from, to);
1216 private boolean considerEqualTypes(ITypeReference from, ITypeReference to) {
1217 assert from != null && to != null;
1219 if (implementInterface(from, to, IPrimitiveType.class)) {
1220 return comparePrimitiveType((IPrimitiveType) from,
1223 if (implementInterface(from, to, IClassReference.class)) {
1224 return sameClassDefinition(((IClassReference) from)
1228 if (implementInterface(from, to, IArrayType.class)) {
1229 return considerEqualTypes(((IArrayType) from).getComponentType(),
1232 if (implementInterface(from, to, IParameterizedType.class)) {
1233 return compareClassReference(((IParameterizedType) from)
1237 if (implementInterface(from, to, ITypeVariableReference.class)) {
1238 return compareTypeVariableReference((ITypeVariableReference) from,
1249 private boolean areInComparison(ITypeReference from, ITypeReference to) {
1250 return fromComparison.contains(from) && toComparison.contains(to);
1253 private void markInComparison(ITypeReference from, ITypeReference to) {
1254 fromComparison.add(from);
1258 private void markFinishedComparison(ITypeReference from,
1260 fromComparison.remove(from);
1265 ITypeReference from, ITypeReference to, boolean acceptErasedTypes) {
1267 if (from == null && to == null) {
1270 if ((from == null && to != null) || (from != null && to == null)) {
1271 return new SigTypeDelta<ITypeReference>(from, to);
1273 if (areInComparison(from, to)) {
1277 markInComparison(from, to);
1279 if (implementInterface(from, to, IPrimitiveType.class)) {
1280 return comparePrimitiveType((IPrimitiveType) from,
1283 if (implementInterface(from, to, IClassReference.class)) {
1284 return compareClassReference((IClassReference) from,
1287 if (implementInterface(from, to, IArrayType.class)) {
1288 return compareArrayType((IArrayType) from, (IArrayType) to);
1290 if (implementInterface(from, to, IParameterizedType.class)) {
1291 return compareParameterizedType((IParameterizedType) from,
1294 if (implementInterface(from, to, ITypeVariableReference.class)) {
1296 (ITypeVariableReference) from,
1299 if (implementInterface(from, to, IWildcardType.class)) {
1300 return compareWildcardType((IWildcardType) from,
1305 if (isGeneric(from) && !isGeneric(to)) {
1306 return compareType(getErasedType(from), to, false);
1309 if (!isGeneric(from) && isGeneric(to)) {
1310 return compareType(from, getErasedType(to), false);
1313 return new SigTypeDelta<ITypeReference>(from, to);
1315 markFinishedComparison(from, to);
1361 private boolean implementInterface(ITypeReference from, ITypeReference to,
1363 return check.isAssignableFrom(from.getClass())
1367 private IWildcardTypeDelta compareWildcardType(IWildcardType from,
1371 ITypeReference fromLowerBound = from.getLowerBound();
1377 delta = new SigWildcardTypeDelta(from, to);
1381 IUpperBoundsDelta upperBoundsDelta = compareUpperBounds(from
1385 delta = new SigWildcardTypeDelta(from, to);
1397 IGenericDeclaration from = fromVariable.getGenericDeclaration();
1400 if (from != null && to != null) {
1402 if (from.getClass() != to.getClass()) {
1403 delta = new SigGenericDeclarationDelta(from, to);
1404 } else if (from instanceof IClassDefinition) {
1405 IClassDefinition fromDeclaringClass = (IClassDefinition) from;
1410 delta = new SigGenericDeclarationDelta(from, to);
1413 } else if (from instanceof IConstructor) {
1414 IConstructor fromConstructor = (IConstructor) from;
1415 IConstructor toConstructor = (IConstructor) from;
1427 delta = new SigGenericDeclarationDelta(from, to);
1430 } else if (from instanceof IMethod) {
1431 IMethod fromMethod = (IMethod) from;
1432 IMethod toMethod = (IMethod) from;
1444 delta = new SigGenericDeclarationDelta(from, to);
1448 + from);
1452 int fromPosition = getPositionOf(fromVariable, from);
1456 delta = new SigGenericDeclarationDelta(from, to);
1462 delta = new SigGenericDeclarationDelta(from, to);
1472 private IUpperBoundsDelta compareUpperBounds(List<ITypeReference> from,
1474 if (from.isEmpty() && to.isEmpty()) {
1479 ITypeReference fromFirstUpperBound = from.get(0);
1485 delta = new SigUpperBoundsDelta(from, to);
1490 new HashSet<ITypeReference>(from));
1497 delta = new SigUpperBoundsDelta(from, to);
1523 IParameterizedType from, IParameterizedType to,
1528 ITypeReferenceDelta<?> rawTypeDelta = compareType(from.getRawType(), to
1531 delta = new SigParameterizedTypeDelta(from, to);
1535 ITypeReferenceDelta<?> ownerTypeDelta = compareType(from
1538 delta = new SigParameterizedTypeDelta(from, to);
1544 compareTypeSequence(from.getTypeArguments(),
1547 delta = new SigParameterizedTypeDelta(from, to);
1557 List<ITypeReference> from, List<ITypeReference> to,
1561 if (from.size() != to.size()) {
1563 for (ITypeReference type : from) {
1572 Iterator<? extends ITypeReference> fromIterator = from.iterator();
1585 Set<ITypeReference> from, Set<ITypeReference> to) {
1586 return compareSets(from, to,
1589 ITypeReference from, ITypeReference to) {
1590 return new SigTypeDelta<ITypeReference>(from, to);
1593 public boolean considerEqualElement(ITypeReference from,
1595 return considerEqualTypes(from, to);
1599 ITypeReference from, ITypeReference to) {
1600 return compareType(from, to, false);
1606 boolean considerEqualElement(T from, T to);
1608 S createChangedDelta(T from, T to);
1613 S createAddRemoveDelta(T from, T to);
1617 private <T, S extends IDelta<? extends T>> Set<S> compareSets(Set<T> from,
1623 for (T fromType : from) {
1661 private ITypeReferenceDelta<?> compareArrayType(IArrayType from,
1663 ITypeReferenceDelta<?> componentTypeDelta = compareType(from
1666 SigArrayTypeDelta delta = new SigArrayTypeDelta(from, to);
1675 IClassDefinition from = fromRef.getClassDefinition();
1678 if (!sameClassDefinition(from, to)) {
1685 private boolean sameClassDefinition(IClassDefinition from,
1687 boolean sameName = from.getName().equals(to.getName());
1688 boolean samePackage = from.getPackageName().equals(to.getPackageName());
1690 Kind fromKind = from.getKind();
1698 private IPrimitiveTypeDelta comparePrimitiveType(IPrimitiveType from,
1700 if (!from.equals(to)) {
1701 return new SigPrimitiveTypeDelta(from, to);