|
Lines 253-263
Link Here
|
| 253 |
if (visibilityModifiers == VisibilityModifiers.API) { |
253 |
if (visibilityModifiers == VisibilityModifiers.API) { |
| 254 |
int currentTypeVisibility = 0; |
254 |
int currentTypeVisibility = 0; |
| 255 |
String superTypeName = this.descriptor1.superName; |
255 |
String superTypeName = this.descriptor1.superName; |
| 256 |
String superTypeName2 = this.descriptor2.superName; |
|
|
| 257 |
if (!superTypeName.equals(superTypeName2)) { |
| 258 |
// we don't need to check the superclass if it has changed |
| 259 |
return; |
| 260 |
} |
| 261 |
LookupResult pair = getType(superTypeName, this.component, this.apiProfile); |
256 |
LookupResult pair = getType(superTypeName, this.component, this.apiProfile); |
| 262 |
if (pair == null) return; |
257 |
if (pair == null) return; |
| 263 |
IClassFile superclassType1 = pair.classFile; |
258 |
IClassFile superclassType1 = pair.classFile; |
|
Lines 267-272
Link Here
|
| 267 |
if (superclassAnnotations != null) { |
262 |
if (superclassAnnotations != null) { |
| 268 |
currentTypeVisibility = superclassAnnotations.getVisibility(); |
263 |
currentTypeVisibility = superclassAnnotations.getVisibility(); |
| 269 |
if (!VisibilityModifiers.isAPI(currentTypeVisibility)) { |
264 |
if (!VisibilityModifiers.isAPI(currentTypeVisibility)) { |
|
|
265 |
String superTypeName2 = this.descriptor2.superName; |
| 266 |
if (!superTypeName.equals(superTypeName2)) { |
| 267 |
// we don't need to check the superclass if it has changed |
| 268 |
// all visible members (methods, fields and types) should be reported as removed |
| 269 |
for (Iterator iterator = superTypeDescriptor.methods.values().iterator(); iterator.hasNext(); ) { |
| 270 |
MethodDescriptor methodDescriptor = (MethodDescriptor) iterator.next(); |
| 271 |
int access = methodDescriptor.access; |
| 272 |
if (methodDescriptor.isClinit() |
| 273 |
|| methodDescriptor.isConstructor() |
| 274 |
|| Util.isDefault(access) |
| 275 |
|| Util.isPrivate(access) |
| 276 |
|| (Util.isProtected(access) |
| 277 |
&& RestrictionModifiers.isExtendRestriction(currentDescriptorRestrictions))) continue; |
| 278 |
String methodDisplayName = getMethodDisplayName(methodDescriptor, this.descriptor1); |
| 279 |
this.addDelta( |
| 280 |
this.descriptor1.getElementType(), |
| 281 |
IDelta.REMOVED, |
| 282 |
IDelta.METHOD, |
| 283 |
this.initialDescriptorRestrictions, |
| 284 |
this.descriptor1.access, |
| 285 |
this.classFile, |
| 286 |
this.descriptor1.name, |
| 287 |
new String[] {Util.getDescriptorName(this.descriptor1), methodDisplayName}); |
| 288 |
} |
| 289 |
for (Iterator iterator = superTypeDescriptor.fields.values().iterator(); iterator.hasNext(); ) { |
| 290 |
FieldDescriptor fieldDescriptor = (FieldDescriptor) iterator.next(); |
| 291 |
int access = fieldDescriptor.access; |
| 292 |
if (Util.isDefault(access) |
| 293 |
|| Util.isPrivate(access) |
| 294 |
|| (Util.isProtected(access) |
| 295 |
&& RestrictionModifiers.isExtendRestriction(currentDescriptorRestrictions))) continue; |
| 296 |
this.addDelta( |
| 297 |
this.descriptor1.getElementType(), |
| 298 |
IDelta.REMOVED, |
| 299 |
IDelta.FIELD, |
| 300 |
this.initialDescriptorRestrictions, |
| 301 |
this.descriptor1.access, |
| 302 |
this.classFile, |
| 303 |
this.descriptor1.name, |
| 304 |
new String[] {Util.getDescriptorName(this.descriptor1), fieldDescriptor.name}); |
| 305 |
} |
| 306 |
return; |
| 307 |
} |
| 270 |
// superclass is not an API type so we need to check it for visible members |
308 |
// superclass is not an API type so we need to check it for visible members |
| 271 |
// if this is an API, it will be checked when the supertype is checked |
309 |
// if this is an API, it will be checked when the supertype is checked |
| 272 |
final boolean ignoreProtected = RestrictionModifiers.isExtendRestriction(this.currentDescriptorRestrictions) || Util.isFinal(this.descriptor1.access); |
310 |
final boolean ignoreProtected = RestrictionModifiers.isExtendRestriction(this.currentDescriptorRestrictions) || Util.isFinal(this.descriptor1.access); |