Lines Matching refs:to

105     public IApiDelta compare(IApi from, IApi to) {  in compare()  argument
106 assert from.getVisibility() == to.getVisibility(); in compare()
109 Set<IPackage> toPackages = to.getPackages(); in compare()
114 IPackage to) { in compare()
115 return comparePackage(from, to); in compare()
119 IPackage to) { in compare()
120 return new SigPackageDelta(from, to); in compare()
124 IPackage to) { 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()
141 Set<IClassDefinition> toClasses = to.getClasses(); in comparePackage()
147 IClassDefinition to) { 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()
170 .getAnnotations(), to.getAnnotations()); in comparePackage()
173 delta = new SigPackageDelta(from, to); in comparePackage()
181 IClassDefinition to) { 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()
190 .getModifiers(), to.getModifiers()); in compareClass()
193 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
200 .getSuperClass(), to.getSuperClass(), false); in compareClass()
203 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
210 to); in compareClass()
213 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
221 to.getTypeParameters()); in compareClass()
224 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
231 .getConstructors(), to.getConstructors()); 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()
261 .getEnumConstants(), to.getEnumConstants()); in compareClass()
264 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
271 to.getAnnotationFields()); in compareClass()
274 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
281 .getAnnotations(), to.getAnnotations()); in compareClass()
284 classDelta = new SigClassDefinitionDelta(from, to); in compareClass()
292 IClassDefinition from, IClassDefinition to) { in compareInterfaces() argument
294 Set<ITypeReference> toClosure = getInterfaceClosure(to); in compareInterfaces()
297 Set<ITypeReference> toInterfaces = to.getInterfaces(); in compareInterfaces()
380 Set<IAnnotation> to) { 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()
389 IAnnotation to) { in compareAnnotations() argument
391 .getClassDefinition(), to.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,
407 IAnnotationField to) {
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,
428 IEnumConstant to) {
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);
461 IClassDefinition to) {
463 assert to != null;
465 Set<IMethod> toMethods = new HashSet<IMethod>(to.getMethods());
466 Set<IMethod> toClosure = getMethodClosure(to);
537 Set<IConstructor> to) {
538 return compareSets(from, to,
541 IConstructor to) {
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);
559 IExecutableMember to) {
560 if (from.getName().equals(to.getName())) {
562 getParameterList(to.getParameters()), true) == null;
576 IAnnotation to) {
577 assert sameClassDefinition(from.getType().getClassDefinition(), to
583 getNormalizedAnnotationElements(to);
591 delta = new SigAnnotationDelta(from, to);
629 Set<IAnnotationElement> from, Set<IAnnotationElement> to) {
630 return compareSets(from, to,
633 IAnnotationElement from, IAnnotationElement to) {
635 to.getDeclaringField().getName());
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);
684 .getParameters(), to.getParameters());
687 methodDelta = new SigMethodDelta(from, to);
693 .getAnnotations(), to.getAnnotations());
696 methodDelta = new SigMethodDelta(from, to);
703 to.getTypeParameters());
706 methodDelta = new SigMethodDelta(from, to);
713 normalizeExceptions(to.getExceptions()));
716 methodDelta = new SigMethodDelta(from, to);
722 .getReturnType(), to.getReturnType(), false);
725 methodDelta = new SigMethodDelta(from, to);
873 IConstructor to) {
876 .getModifiers(), to.getModifiers());
878 constructorDelta = new SigConstructorDelta(from, to);
883 .getParameters(), to.getParameters());
886 constructorDelta = new SigConstructorDelta(from, to);
892 .getAnnotations(), to.getAnnotations());
895 constructorDelta = new SigConstructorDelta(from, to);
902 to.getTypeParameters());
905 constructorDelta = new SigConstructorDelta(from, to);
912 normalizeExceptions(to.getExceptions()));
915 constructorDelta = new SigConstructorDelta(from, to);
923 List<IParameter> from, List<IParameter> to) {
924 assert from.size() == to.size();
927 Iterator<IParameter> toIterator = to.iterator();
938 private IParameterDelta compareParameter(IParameter from, IParameter to) {
940 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
944 delta = new SigParameterDelta(from, to);
950 .getAnnotations(), to.getAnnotations());
953 delta = new SigParameterDelta(from, to);
962 List<ITypeVariableDefinition> to) {
965 if (from.size() != to.size()) {
970 for (ITypeVariableDefinition toVariable : to) {
978 Iterator<ITypeVariableDefinition> toIterator = to.iterator();
990 ITypeVariableDefinition from, ITypeVariableDefinition to) {
992 from, to);
996 new SigTypeVariableDefinitionDelta(from, to);
1001 .getUpperBounds(), to.getUpperBounds());
1005 new SigTypeVariableDefinitionDelta(from, to);
1013 ITypeVariableReference from, ITypeVariableReference to) {
1015 from.getTypeVariableDefinition(), to
1019 new SigTypeVariableReferenceDelta(from, to);
1027 Set<Modifier> to) {
1028 return compareSets(from, to,
1031 Modifier to) {
1032 return from.equals(to);
1036 Modifier to) {
1037 return new SigModifierDelta(from, to);
1041 Modifier to) {
1048 private IFieldDelta compareField(IField from, IField to) {
1052 .getModifiers(), to.getModifiers());
1054 fieldDelta = new SigFieldDelta(from, to);
1059 .getAnnotations(), to.getAnnotations());
1062 fieldDelta = new SigFieldDelta(from, to);
1067 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
1071 fieldDelta = new SigFieldDelta(from, to);
1079 IEnumConstant to) {
1083 .getModifiers(), to.getModifiers());
1085 enumConstantDelta = new SigEnumConstantDelta(from, to);
1090 .getAnnotations(), to.getAnnotations());
1093 enumConstantDelta = new SigEnumConstantDelta(from, to);
1098 ITypeReferenceDelta<?> typeDelta = compareType(from.getType(), to
1102 enumConstantDelta = new SigEnumConstantDelta(from, to);
1121 IAnnotationField to) {
1125 .getModifiers(), to.getModifiers());
1127 annotationFieldDelta = new SigAnnotationFieldDelta(from, to);
1132 .getAnnotations(), to.getAnnotations());
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()) {
1179 delta = new SigValueDelta(from, to);
1183 (IEnumConstant) from, (IEnumConstant) to);
1185 delta = new SigValueDelta(from, to);
1189 (IAnnotation) from, (IAnnotation) to);
1191 delta = new SigValueDelta(from, to);
1195 (IField) to);
1197 delta = new SigValueDelta(from, to);
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)) {
1221 (IPrimitiveType) to) == null;
1223 if (implementInterface(from, to, IClassReference.class)) {
1225 .getClassDefinition(), ((IClassReference) to)
1228 if (implementInterface(from, to, IArrayType.class)) {
1230 ((IArrayType) to).getComponentType());
1232 if (implementInterface(from, to, IParameterizedType.class)) {
1234 .getRawType(), ((IParameterizedType) to)
1237 if (implementInterface(from, to, ITypeVariableReference.class)) {
1239 (ITypeVariableReference) to) == null;
1249 private boolean areInComparison(ITypeReference from, ITypeReference to) {
1250 return fromComparison.contains(from) && toComparison.contains(to);
1253 private void markInComparison(ITypeReference from, ITypeReference to) {
1255 toComparison.add(to);
1259 ITypeReference to) {
1261 toComparison.remove(to);
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)) {
1281 (IPrimitiveType) to);
1283 if (implementInterface(from, to, IClassReference.class)) {
1285 (IClassReference) to);
1287 if (implementInterface(from, to, IArrayType.class)) {
1288 return compareArrayType((IArrayType) from, (IArrayType) to);
1290 if (implementInterface(from, to, IParameterizedType.class)) {
1292 (IParameterizedType) to, acceptErasedTypes);
1294 if (implementInterface(from, to, ITypeVariableReference.class)) {
1297 (ITypeVariableReference) to);
1299 if (implementInterface(from, to, IWildcardType.class)) {
1301 (IWildcardType) to);
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,
1364 && check.isAssignableFrom(to.getClass());
1368 IWildcardType to) {
1372 ITypeReference toLowerBound = to.getLowerBound();
1377 delta = new SigWildcardTypeDelta(from, to);
1382 .getUpperBounds(), to.getUpperBounds());
1385 delta = new SigWildcardTypeDelta(from, to);
1398 IGenericDeclaration to = toVariable.getGenericDeclaration();
1400 if (from != null && to != null) {
1402 if (from.getClass() != to.getClass()) {
1403 delta = new SigGenericDeclarationDelta(from, to);
1406 IClassDefinition toDeclaringClass = (IClassDefinition) to;
1410 delta = new SigGenericDeclarationDelta(from, to);
1427 delta = new SigGenericDeclarationDelta(from, to);
1444 delta = new SigGenericDeclarationDelta(from, to);
1453 int toPosition = getPositionOf(toVariable, to);
1456 delta = new SigGenericDeclarationDelta(from, to);
1462 delta = new SigGenericDeclarationDelta(from, to);
1473 List<ITypeReference> to) {
1474 if (from.isEmpty() && to.isEmpty()) {
1480 ITypeReference toFirstUpperBound = to.get(0);
1485 delta = new SigUpperBoundsDelta(from, to);
1492 new HashSet<ITypeReference>(to));
1497 delta = new SigUpperBoundsDelta(from, to);
1523 IParameterizedType from, IParameterizedType to,
1528 ITypeReferenceDelta<?> rawTypeDelta = compareType(from.getRawType(), to
1531 delta = new SigParameterizedTypeDelta(from, to);
1536 .getOwnerType(), to.getOwnerType(), false);
1538 delta = new SigParameterizedTypeDelta(from, to);
1545 to.getTypeArguments(), false);
1547 delta = new SigParameterizedTypeDelta(from, to);
1557 List<ITypeReference> from, List<ITypeReference> to,
1561 if (from.size() != to.size()) {
1566 for (ITypeReference type : to) {
1573 Iterator<? extends ITypeReference> toIterator = to.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);
1594 ITypeReference to) {
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);
1618 Set<T> to, SigComparator<T, S> comparator) {
1620 Set<T> toCopy = new HashSet<T>(to);
1662 IArrayType to) {
1664 .getComponentType(), to.getComponentType(), false);
1666 SigArrayTypeDelta delta = new SigArrayTypeDelta(from, to);
1676 IClassDefinition to = toRef.getClassDefinition();
1678 if (!sameClassDefinition(from, to)) {
1686 IClassDefinition to) {
1687 boolean sameName = from.getName().equals(to.getName());
1688 boolean samePackage = from.getPackageName().equals(to.getPackageName());
1691 Kind toKind = to.getKind();
1699 IPrimitiveType to) {
1700 if (!from.equals(to)) {
1701 return new SigPrimitiveTypeDelta(from, to);