Lines 299-311
Link Here
|
299 |
methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf() |
299 |
methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf() |
300 |
} |
300 |
} |
301 |
// create bindings for source methods |
301 |
// create bindings for source methods |
|
|
302 |
boolean hasNativeMethods = false; |
302 |
if (sourceType.isAbstract()) { |
303 |
if (sourceType.isAbstract()) { |
303 |
for (int i = 0; i < size; i++) { |
304 |
for (int i = 0; i < size; i++) { |
304 |
if (i != clinitIndex) { |
305 |
if (i != clinitIndex) { |
305 |
MethodScope scope = new MethodScope(this, methods[i], false); |
306 |
MethodScope scope = new MethodScope(this, methods[i], false); |
306 |
MethodBinding methodBinding = scope.createMethod(methods[i]); |
307 |
MethodBinding methodBinding = scope.createMethod(methods[i]); |
307 |
if (methodBinding != null) // is null if binding could not be created |
308 |
if (methodBinding != null) { // is null if binding could not be created |
308 |
methodBindings[count++] = methodBinding; |
309 |
methodBindings[count++] = methodBinding; |
|
|
310 |
hasNativeMethods = hasNativeMethods || methodBinding.isNative(); |
311 |
} |
309 |
} |
312 |
} |
310 |
} |
313 |
} |
311 |
} else { |
314 |
} else { |
Lines 317-322
Link Here
|
317 |
if (methodBinding != null) { // is null if binding could not be created |
320 |
if (methodBinding != null) { // is null if binding could not be created |
318 |
methodBindings[count++] = methodBinding; |
321 |
methodBindings[count++] = methodBinding; |
319 |
hasAbstractMethods = hasAbstractMethods || methodBinding.isAbstract(); |
322 |
hasAbstractMethods = hasAbstractMethods || methodBinding.isAbstract(); |
|
|
323 |
hasNativeMethods = hasNativeMethods || methodBinding.isNative(); |
320 |
} |
324 |
} |
321 |
} |
325 |
} |
322 |
} |
326 |
} |
Lines 327-332
Link Here
|
327 |
System.arraycopy(methodBindings, 0, methodBindings = new MethodBinding[count], 0, count); |
331 |
System.arraycopy(methodBindings, 0, methodBindings = new MethodBinding[count], 0, count); |
328 |
sourceType.tagBits &= ~(TagBits.AreMethodsSorted|TagBits.AreMethodsComplete); // in case some static imports reached already into this type |
332 |
sourceType.tagBits &= ~(TagBits.AreMethodsSorted|TagBits.AreMethodsComplete); // in case some static imports reached already into this type |
329 |
sourceType.setMethods(methodBindings); |
333 |
sourceType.setMethods(methodBindings); |
|
|
334 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=243917, conservatively tag all methods and fields as |
335 |
// being in use if there is a native method in the class. |
336 |
if (hasNativeMethods) { |
337 |
MethodBinding[] methods2 = sourceType.methods(); |
338 |
for (int i = 0; i < methods2.length; i++) { |
339 |
methods2[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed; |
340 |
} |
341 |
FieldBinding[] fields = sourceType.fields(); |
342 |
for (int i = 0; i < fields.length; i++) { |
343 |
fields[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed; |
344 |
} |
345 |
} |
330 |
} |
346 |
} |
331 |
|
347 |
|
332 |
SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding, AccessRestriction accessRestriction) { |
348 |
SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding, AccessRestriction accessRestriction) { |