|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2007, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2007, 2009 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 21-26
Link Here
|
| 21 |
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin; |
21 |
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin; |
| 22 |
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations; |
22 |
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations; |
| 23 |
import org.eclipse.pde.api.tools.internal.provisional.IApiDescription; |
23 |
import org.eclipse.pde.api.tools.internal.provisional.IApiDescription; |
|
|
24 |
import org.eclipse.pde.api.tools.internal.provisional.IRequiredComponentDescription; |
| 24 |
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers; |
25 |
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers; |
| 25 |
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers; |
26 |
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers; |
| 26 |
import org.eclipse.pde.api.tools.internal.provisional.model.ApiScopeVisitor; |
27 |
import org.eclipse.pde.api.tools.internal.provisional.model.ApiScopeVisitor; |
|
Lines 65-71
Link Here
|
| 65 |
if (version.getMajor() != version2.getMajor()) { |
66 |
if (version.getMajor() != version2.getMajor()) { |
| 66 |
globalDelta.add( |
67 |
globalDelta.add( |
| 67 |
new Delta( |
68 |
new Delta( |
| 68 |
Util.getDeltaComponentID(apiComponent2), |
69 |
Util.getDeltaComponentVersionsId(apiComponent2), |
| 69 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
70 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 70 |
IDelta.CHANGED, |
71 |
IDelta.CHANGED, |
| 71 |
IDelta.MAJOR_VERSION, |
72 |
IDelta.MAJOR_VERSION, |
|
Lines 81-87
Link Here
|
| 81 |
} else if (version.getMinor() != version2.getMinor()) { |
82 |
} else if (version.getMinor() != version2.getMinor()) { |
| 82 |
globalDelta.add( |
83 |
globalDelta.add( |
| 83 |
new Delta( |
84 |
new Delta( |
| 84 |
Util.getDeltaComponentID(apiComponent2), |
85 |
Util.getDeltaComponentVersionsId(apiComponent2), |
| 85 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
86 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 86 |
IDelta.CHANGED, |
87 |
IDelta.CHANGED, |
| 87 |
IDelta.MINOR_VERSION, |
88 |
IDelta.MINOR_VERSION, |
|
Lines 367-373
Link Here
|
| 367 |
IDelta.API_COMPONENT, |
368 |
IDelta.API_COMPONENT, |
| 368 |
null, |
369 |
null, |
| 369 |
component2.getId(), |
370 |
component2.getId(), |
| 370 |
Util.getDeltaComponentID(component2)); |
371 |
Util.getDeltaComponentVersionsId(component2)); |
| 371 |
} else if (component2 == null) { |
372 |
} else if (component2 == null) { |
| 372 |
String referenceComponentId = referenceComponent.getId(); |
373 |
String referenceComponentId = referenceComponent.getId(); |
| 373 |
return new Delta( |
374 |
return new Delta( |
|
Lines 377-383
Link Here
|
| 377 |
IDelta.API_COMPONENT, |
378 |
IDelta.API_COMPONENT, |
| 378 |
null, |
379 |
null, |
| 379 |
referenceComponentId, |
380 |
referenceComponentId, |
| 380 |
Util.getDeltaComponentID(referenceComponent)); |
381 |
Util.getDeltaComponentVersionsId(referenceComponent)); |
| 381 |
} |
382 |
} |
| 382 |
String referenceComponentId = referenceComponent.getId(); |
383 |
String referenceComponentId = referenceComponent.getId(); |
| 383 |
final Delta globalDelta = new Delta(); |
384 |
final Delta globalDelta = new Delta(); |
|
Lines 391-397
Link Here
|
| 391 |
if (!componentsEEs.remove(currentEE)) { |
392 |
if (!componentsEEs.remove(currentEE)) { |
| 392 |
globalDelta.add( |
393 |
globalDelta.add( |
| 393 |
new Delta( |
394 |
new Delta( |
| 394 |
Util.getDeltaComponentID(referenceComponent), |
395 |
Util.getDeltaComponentVersionsId(referenceComponent), |
| 395 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
396 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 396 |
IDelta.REMOVED, |
397 |
IDelta.REMOVED, |
| 397 |
IDelta.EXECUTION_ENVIRONMENT, |
398 |
IDelta.EXECUTION_ENVIRONMENT, |
|
Lines 399-412
Link Here
|
| 399 |
0, |
400 |
0, |
| 400 |
null, |
401 |
null, |
| 401 |
referenceComponentId, |
402 |
referenceComponentId, |
| 402 |
new String[] { currentEE, Util.getDeltaComponentID(referenceComponent)})); |
403 |
new String[] { currentEE, Util.getDeltaComponentVersionsId(referenceComponent)})); |
| 403 |
} |
404 |
} |
| 404 |
} |
405 |
} |
| 405 |
for (Iterator iterator = componentsEEs.iterator(); iterator.hasNext(); ) { |
406 |
for (Iterator iterator = componentsEEs.iterator(); iterator.hasNext(); ) { |
| 406 |
String currentEE = (String) iterator.next(); |
407 |
String currentEE = (String) iterator.next(); |
| 407 |
globalDelta.add( |
408 |
globalDelta.add( |
| 408 |
new Delta( |
409 |
new Delta( |
| 409 |
Util.getDeltaComponentID(referenceComponent), |
410 |
Util.getDeltaComponentVersionsId(referenceComponent), |
| 410 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
411 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 411 |
IDelta.ADDED, |
412 |
IDelta.ADDED, |
| 412 |
IDelta.EXECUTION_ENVIRONMENT, |
413 |
IDelta.EXECUTION_ENVIRONMENT, |
|
Lines 414-420
Link Here
|
| 414 |
0, |
415 |
0, |
| 415 |
null, |
416 |
null, |
| 416 |
referenceComponentId, |
417 |
referenceComponentId, |
| 417 |
new String[] { currentEE, Util.getDeltaComponentID(referenceComponent)})); |
418 |
new String[] { currentEE, Util.getDeltaComponentVersionsId(referenceComponent)})); |
| 418 |
} |
419 |
} |
| 419 |
return internalCompare(referenceComponent, component2, referenceBaseline, baseline, visibilityModifiers, globalDelta); |
420 |
return internalCompare(referenceComponent, component2, referenceBaseline, baseline, visibilityModifiers, globalDelta); |
| 420 |
} catch(CoreException e) { |
421 |
} catch(CoreException e) { |
|
Lines 501-507
Link Here
|
| 501 |
if (refElementDescription != null) { |
502 |
if (refElementDescription != null) { |
| 502 |
refVisibility = refElementDescription.getVisibility(); |
503 |
refVisibility = refElementDescription.getVisibility(); |
| 503 |
} |
504 |
} |
| 504 |
String deltaComponentID = Util.getDeltaComponentID(component2); |
505 |
String deltaComponentID = Util.getDeltaComponentVersionsId(component2); |
| 505 |
if (typeRoot == null) { |
506 |
if (typeRoot == null) { |
| 506 |
if (isAPI(visibility, typeDescriptor2)) { |
507 |
if (isAPI(visibility, typeDescriptor2)) { |
| 507 |
return new Delta( |
508 |
return new Delta( |
|
Lines 745-751
Link Here
|
| 745 |
} else{ |
746 |
} else{ |
| 746 |
typeRoot2 = component2.findTypeRoot(typeName, id); |
747 |
typeRoot2 = component2.findTypeRoot(typeName, id); |
| 747 |
} |
748 |
} |
| 748 |
String deltaComponentID = Util.getDeltaComponentID(component2); |
749 |
String deltaComponentID = null; |
|
|
750 |
IApiComponent provider = null; |
| 751 |
IApiDescription providerApiDesc = null; |
| 752 |
boolean reexported = false; |
| 753 |
if (typeRoot2 == null) { |
| 754 |
// check if the type is provided by a required component (it could have been moved/re-exported) |
| 755 |
IApiComponent[] providers = component2.getBaseline().resolvePackage(component2, packageName); |
| 756 |
int index = 0; |
| 757 |
while (typeRoot2 == null && index < providers.length) { |
| 758 |
IApiComponent p = providers[index]; |
| 759 |
if (!p.equals(component2)) { |
| 760 |
typeRoot2 = p.findTypeRoot(typeName, p.getId()); |
| 761 |
if (typeRoot2 != null) { |
| 762 |
provider = p; |
| 763 |
providerApiDesc = p.getApiDescription(); |
| 764 |
IRequiredComponentDescription[] required = component2.getRequiredComponents(); |
| 765 |
for (int k = 0; k < required.length; k++) { |
| 766 |
IRequiredComponentDescription description = required[k]; |
| 767 |
if (description.getId().equals(p.getId())) { |
| 768 |
reexported = description.isExported(); |
| 769 |
break; |
| 770 |
} |
| 771 |
} |
| 772 |
} |
| 773 |
} |
| 774 |
index++; |
| 775 |
} |
| 776 |
} else { |
| 777 |
provider = component2; |
| 778 |
providerApiDesc = apiDescription2; |
| 779 |
} |
| 780 |
deltaComponentID = Util.getDeltaComponentVersionsId(component2); |
| 749 |
if(typeRoot2 == null) { |
781 |
if(typeRoot2 == null) { |
| 750 |
if ((visibility & visibilityModifiers) == 0) { |
782 |
if ((visibility & visibilityModifiers) == 0) { |
| 751 |
// we skip the class file according to their visibility |
783 |
// we skip the class file according to their visibility |
|
Lines 768-781
Link Here
|
| 768 |
typeDescriptor.getModifiers(), |
800 |
typeDescriptor.getModifiers(), |
| 769 |
typeName, |
801 |
typeName, |
| 770 |
typeName, |
802 |
typeName, |
| 771 |
new String[] { typeName, deltaComponentID})); |
803 |
new String[] { typeName, deltaComponentID })); |
| 772 |
} else { |
804 |
} else { |
| 773 |
if ((visibility & visibilityModifiers) == 0) { |
805 |
if ((visibility & visibilityModifiers) == 0) { |
| 774 |
// we skip the class file according to their visibility |
806 |
// we skip the class file according to their visibility |
| 775 |
return; |
807 |
return; |
| 776 |
} |
808 |
} |
| 777 |
IApiType typeDescriptor2 = typeRoot2.getStructure(); |
809 |
IApiType typeDescriptor2 = typeRoot2.getStructure(); |
| 778 |
IApiAnnotations elementDescription2 = apiDescription2.resolveAnnotations(typeDescriptor2.getHandle()); |
810 |
IApiAnnotations elementDescription2 = providerApiDesc.resolveAnnotations(typeDescriptor2.getHandle()); |
| 779 |
int visibility2 = 0; |
811 |
int visibility2 = 0; |
| 780 |
if (elementDescription2 != null) { |
812 |
if (elementDescription2 != null) { |
| 781 |
visibility2 = elementDescription2.getVisibility(); |
813 |
visibility2 = elementDescription2.getVisibility(); |
|
Lines 787-805
Link Here
|
| 787 |
return; |
819 |
return; |
| 788 |
} |
820 |
} |
| 789 |
} |
821 |
} |
| 790 |
if (isAPI(visibility, typeDescriptor) && !isAPI(visibility2, typeDescriptor2)) { |
822 |
if (isAPI(visibility, typeDescriptor)) { |
| 791 |
globalDelta.add( |
823 |
if (!isAPI(visibility2, typeDescriptor2)) { |
|
|
824 |
globalDelta.add( |
| 792 |
new Delta( |
825 |
new Delta( |
| 793 |
deltaComponentID, |
826 |
deltaComponentID, |
| 794 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
827 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 795 |
IDelta.REMOVED, |
828 |
IDelta.REMOVED, |
| 796 |
IDelta.API_TYPE, |
829 |
reexported ? IDelta.REEXPORTED_API_TYPE : IDelta.API_TYPE, |
| 797 |
elementDescription2 != null ? elementDescription2.getRestrictions() : RestrictionModifiers.NO_RESTRICTIONS, |
830 |
elementDescription2 != null ? elementDescription2.getRestrictions() : RestrictionModifiers.NO_RESTRICTIONS, |
| 798 |
typeDescriptor2.getModifiers(), |
831 |
typeDescriptor2.getModifiers(), |
| 799 |
typeName, |
832 |
typeName, |
| 800 |
typeName, |
833 |
typeName, |
| 801 |
new String[] { typeName, deltaComponentID})); |
834 |
new String[] { typeName, deltaComponentID })); |
| 802 |
return; |
835 |
return; |
|
|
836 |
} |
| 803 |
} |
837 |
} |
| 804 |
if ((visibility2 & visibilityModifiers) == 0) { |
838 |
if ((visibility2 & visibilityModifiers) == 0) { |
| 805 |
// we simply report a changed visibility |
839 |
// we simply report a changed visibility |
|
Lines 816-822
Link Here
|
| 816 |
new String[] { typeName, deltaComponentID})); |
850 |
new String[] { typeName, deltaComponentID})); |
| 817 |
} |
851 |
} |
| 818 |
typeRootBaseLineNames.add(typeName); |
852 |
typeRootBaseLineNames.add(typeName); |
| 819 |
ClassFileComparator comparator = new ClassFileComparator(typeDescriptor, typeRoot2, component, component2, referenceBaseline, baseline, visibilityModifiers); |
853 |
ClassFileComparator comparator = new ClassFileComparator(typeDescriptor, typeRoot2, component, provider, referenceBaseline, baseline, visibilityModifiers); |
| 820 |
IDelta delta = comparator.getDelta(); |
854 |
IDelta delta = comparator.getDelta(); |
| 821 |
IStatus status = comparator.getStatus(); |
855 |
IStatus status = comparator.getStatus(); |
| 822 |
if(status != null) { |
856 |
if(status != null) { |
|
Lines 836-841
Link Here
|
| 836 |
} |
870 |
} |
| 837 |
} |
871 |
} |
| 838 |
} |
872 |
} |
|
|
873 |
IRequiredComponentDescription[] requiredComponents = component.getRequiredComponents(); |
| 874 |
int length = requiredComponents.length; |
| 875 |
if (length != 0) { |
| 876 |
for (int j = 0; j < length; j++) { |
| 877 |
IRequiredComponentDescription description = requiredComponents[j]; |
| 878 |
if (description.isExported()) { |
| 879 |
final String currentComponentID = Util.getDeltaComponentVersionsId(component); |
| 880 |
String descriptionID = description.getId(); |
| 881 |
IApiComponent currentRequiredApiComponent = referenceBaseline.getApiComponent(descriptionID); |
| 882 |
final IApiDescription reexportedApiDescription = currentRequiredApiComponent.getApiDescription(); |
| 883 |
IApiTypeContainer[] apiTypeContainers = currentRequiredApiComponent.getApiTypeContainers(); |
| 884 |
if (apiTypeContainers != null) { |
| 885 |
for (int i = 0, max = apiTypeContainers.length; i < max; i++) { |
| 886 |
IApiTypeContainer container = apiTypeContainers[i]; |
| 887 |
try { |
| 888 |
container.accept(new ApiTypeContainerVisitor() { |
| 889 |
public void visit(String packageName, IApiTypeRoot typeRoot) { |
| 890 |
String typeName = typeRoot.getTypeName(); |
| 891 |
try { |
| 892 |
IApiType typeDescriptor = typeRoot.getStructure(); |
| 893 |
IApiAnnotations elementDescription = reexportedApiDescription.resolveAnnotations(typeDescriptor.getHandle()); |
| 894 |
if (typeDescriptor.isMemberType() || typeDescriptor.isAnonymous() || typeDescriptor.isLocal()) { |
| 895 |
// we skip nested types (member, local and anonymous) |
| 896 |
return; |
| 897 |
} |
| 898 |
int visibility = 0; |
| 899 |
if (elementDescription != null) { |
| 900 |
visibility = elementDescription.getVisibility(); |
| 901 |
} |
| 902 |
IApiTypeRoot typeRoot2 = null; |
| 903 |
if (isSWT) { |
| 904 |
typeRoot2 = component2.findTypeRoot(typeName); |
| 905 |
} else{ |
| 906 |
typeRoot2 = component2.findTypeRoot(typeName, id); |
| 907 |
} |
| 908 |
IApiDescription providerApiDesc = null; |
| 909 |
if (typeRoot2 == null) { |
| 910 |
// check if the type is provided by a required component (it could have been moved/re-exported) |
| 911 |
IApiComponent[] providers = component2.getBaseline().resolvePackage(component2, packageName); |
| 912 |
int index = 0; |
| 913 |
while (typeRoot2 == null && index < providers.length) { |
| 914 |
IApiComponent p = providers[index]; |
| 915 |
if (!p.equals(component2)) { |
| 916 |
typeRoot2 = p.findTypeRoot(typeName, p.getId()); |
| 917 |
if (typeRoot2 != null) { |
| 918 |
providerApiDesc = p.getApiDescription(); |
| 919 |
} |
| 920 |
} |
| 921 |
index++; |
| 922 |
} |
| 923 |
} else { |
| 924 |
providerApiDesc = apiDescription2; |
| 925 |
} |
| 926 |
if(typeRoot2 == null) { |
| 927 |
if ((visibility & visibilityModifiers) == 0) { |
| 928 |
// we skip the class file according to their visibility |
| 929 |
return; |
| 930 |
} |
| 931 |
if (visibilityModifiers == VisibilityModifiers.API) { |
| 932 |
// if the visibility is API, we only consider public and protected types |
| 933 |
if (Util.isDefault(typeDescriptor.getModifiers()) |
| 934 |
|| Util.isPrivate(typeDescriptor.getModifiers())) { |
| 935 |
return; |
| 936 |
} |
| 937 |
} |
| 938 |
globalDelta.add( |
| 939 |
new Delta( |
| 940 |
currentComponentID, |
| 941 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 942 |
IDelta.REMOVED, |
| 943 |
IDelta.REEXPORTED_TYPE, |
| 944 |
RestrictionModifiers.NO_RESTRICTIONS, |
| 945 |
typeDescriptor.getModifiers(), |
| 946 |
typeName, |
| 947 |
typeName, |
| 948 |
new String[] { typeName, currentComponentID })); |
| 949 |
} else { |
| 950 |
typeRootBaseLineNames.add(typeName); |
| 951 |
IApiType typeDescriptor2 = typeRoot2.getStructure(); |
| 952 |
IApiAnnotations elementDescription2 = providerApiDesc.resolveAnnotations(typeDescriptor2.getHandle()); |
| 953 |
int visibility2 = 0; |
| 954 |
if (elementDescription2 != null) { |
| 955 |
visibility2 = elementDescription2.getVisibility(); |
| 956 |
} |
| 957 |
// if the visibility is API, we only consider public and protected types |
| 958 |
if (Util.isDefault(typeDescriptor.getModifiers()) |
| 959 |
|| Util.isPrivate(typeDescriptor.getModifiers())) { |
| 960 |
return; |
| 961 |
} |
| 962 |
if (isAPI(visibility, typeDescriptor)) { |
| 963 |
if (!isAPI(visibility2, typeDescriptor2)) { |
| 964 |
globalDelta.add( |
| 965 |
new Delta( |
| 966 |
currentComponentID, |
| 967 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 968 |
IDelta.REMOVED, |
| 969 |
IDelta.REEXPORTED_API_TYPE, |
| 970 |
elementDescription2 != null ? elementDescription2.getRestrictions() : RestrictionModifiers.NO_RESTRICTIONS, |
| 971 |
typeDescriptor2.getModifiers(), |
| 972 |
typeName, |
| 973 |
typeName, |
| 974 |
new String[] { typeName, currentComponentID })); |
| 975 |
return; |
| 976 |
} |
| 977 |
} |
| 978 |
} |
| 979 |
} catch (CoreException e) { |
| 980 |
ApiPlugin.log(e); |
| 981 |
} |
| 982 |
} |
| 983 |
}); |
| 984 |
} catch (CoreException e) { |
| 985 |
ApiPlugin.log(e); |
| 986 |
} |
| 987 |
} |
| 988 |
} |
| 989 |
} |
| 990 |
} |
| 991 |
} |
| 839 |
if (typeRootContainers2 != null) { |
992 |
if (typeRootContainers2 != null) { |
| 840 |
for (int i = 0, max = typeRootContainers2.length; i < max; i++) { |
993 |
for (int i = 0, max = typeRootContainers2.length; i < max; i++) { |
| 841 |
IApiTypeContainer container = typeRootContainers2[i]; |
994 |
IApiTypeContainer container = typeRootContainers2[i]; |
|
Lines 858-864
Link Here
|
| 858 |
return; |
1011 |
return; |
| 859 |
} |
1012 |
} |
| 860 |
typeRootBaseLineNames.add(typeName); |
1013 |
typeRootBaseLineNames.add(typeName); |
| 861 |
String deltaComponentID = Util.getDeltaComponentID(component2); |
1014 |
String deltaComponentID = Util.getDeltaComponentVersionsId(component2); |
| 862 |
globalDelta.add( |
1015 |
globalDelta.add( |
| 863 |
new Delta( |
1016 |
new Delta( |
| 864 |
deltaComponentID, |
1017 |
deltaComponentID, |
|
Lines 869-875
Link Here
|
| 869 |
type.getModifiers(), |
1022 |
type.getModifiers(), |
| 870 |
typeName, |
1023 |
typeName, |
| 871 |
typeName, |
1024 |
typeName, |
| 872 |
new String[] { typeName, deltaComponentID})); |
1025 |
new String[] { typeName, deltaComponentID })); |
| 873 |
} catch (CoreException e) { |
1026 |
} catch (CoreException e) { |
| 874 |
ApiPlugin.log(e); |
1027 |
ApiPlugin.log(e); |
| 875 |
} |
1028 |
} |
|
Lines 880-885
Link Here
|
| 880 |
} |
1033 |
} |
| 881 |
} |
1034 |
} |
| 882 |
} |
1035 |
} |
|
|
1036 |
requiredComponents = component2.getRequiredComponents(); |
| 1037 |
length = requiredComponents.length; |
| 1038 |
if (length != 0) { |
| 1039 |
for (int j = 0; j < length; j++) { |
| 1040 |
IRequiredComponentDescription description = requiredComponents[j]; |
| 1041 |
if (description.isExported()) { |
| 1042 |
final String currentComponentID = Util.getDeltaComponentVersionsId(component); |
| 1043 |
String descriptionID = description.getId(); |
| 1044 |
IApiComponent currentRequiredApiComponent = baseline.getApiComponent(descriptionID); |
| 1045 |
IApiTypeContainer[] apiTypeContainers = currentRequiredApiComponent.getApiTypeContainers(); |
| 1046 |
final IApiDescription reexportedApiDescription = currentRequiredApiComponent.getApiDescription(); |
| 1047 |
if (apiTypeContainers != null) { |
| 1048 |
for (int i = 0, max = apiTypeContainers.length; i < max; i++) { |
| 1049 |
IApiTypeContainer container = apiTypeContainers[i]; |
| 1050 |
try { |
| 1051 |
container.accept(new ApiTypeContainerVisitor() { |
| 1052 |
public void visit(String packageName, IApiTypeRoot typeRoot) { |
| 1053 |
String typeName = typeRoot.getTypeName(); |
| 1054 |
try { |
| 1055 |
IApiType typeDescriptor = typeRoot.getStructure(); |
| 1056 |
IApiAnnotations elementDescription = reexportedApiDescription.resolveAnnotations(typeDescriptor.getHandle()); |
| 1057 |
if (typeDescriptor.isMemberType() || typeDescriptor.isAnonymous() || typeDescriptor.isLocal()) { |
| 1058 |
// we skip nested types (member, local and anonymous) |
| 1059 |
return; |
| 1060 |
} |
| 1061 |
if (filterType(visibilityModifiers, elementDescription, typeDescriptor)) { |
| 1062 |
return; |
| 1063 |
} |
| 1064 |
if (typeRootBaseLineNames.contains(typeName)) { |
| 1065 |
// already processed |
| 1066 |
return; |
| 1067 |
} |
| 1068 |
typeRootBaseLineNames.add(typeName); |
| 1069 |
globalDelta.add( |
| 1070 |
new Delta( |
| 1071 |
currentComponentID, |
| 1072 |
IDelta.API_COMPONENT_ELEMENT_TYPE, |
| 1073 |
IDelta.ADDED, |
| 1074 |
IDelta.REEXPORTED_TYPE, |
| 1075 |
elementDescription != null ? elementDescription.getRestrictions() : RestrictionModifiers.NO_RESTRICTIONS, |
| 1076 |
typeDescriptor.getModifiers(), |
| 1077 |
typeName, |
| 1078 |
typeName, |
| 1079 |
new String[] { typeName, currentComponentID })); |
| 1080 |
} catch (CoreException e) { |
| 1081 |
ApiPlugin.log(e); |
| 1082 |
} |
| 1083 |
} |
| 1084 |
}); |
| 1085 |
} catch (CoreException e) { |
| 1086 |
ApiPlugin.log(e); |
| 1087 |
} |
| 1088 |
} |
| 1089 |
} |
| 1090 |
} |
| 1091 |
} |
| 1092 |
} |
| 883 |
return globalDelta.isEmpty() ? NO_DELTA : globalDelta; |
1093 |
return globalDelta.isEmpty() ? NO_DELTA : globalDelta; |
| 884 |
} |
1094 |
} |
| 885 |
|
1095 |
|