(final List<CachedClass> superClasses, final CachedClass firstGroovySuper)
| 432 | } |
| 433 | |
| 434 | private void populateMethods(final List<CachedClass> superClasses, final CachedClass firstGroovySuper) { |
| 435 | var header = metaMethodIndex.getHeader(firstGroovySuper.getTheClass()); |
| 436 | CachedClass c; |
| 437 | Iterator<CachedClass> iter = superClasses.iterator(); |
| 438 | while (iter.hasNext()) { |
| 439 | c = iter.next(); |
| 440 | |
| 441 | for (var metaMethod : c.getMethods()) { |
| 442 | addToAllMethodsIfPublic(metaMethod); |
| 443 | if (c == firstGroovySuper || (metaMethod.isPublic() || metaMethod.isProtected() || |
| 444 | (!metaMethod.isPrivate() && inSamePackage(metaMethod.getDeclaringClass().getTheClass(), theClass)))) { // GROOVY-11357 |
| 445 | addMetaMethodToIndex(metaMethod, header); |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | for (var metaMethod : getNewMetaMethods(c)) { |
| 450 | if (newGroovyMethodsSet.add(metaMethod)) { |
| 451 | addMetaMethodToIndex(metaMethod, header); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | if (c == firstGroovySuper) |
| 456 | break; |
| 457 | } |
| 458 | |
| 459 | var last = header; |
| 460 | while (iter.hasNext()) { |
| 461 | c = iter.next(); |
| 462 | header = metaMethodIndex.getHeader(c.getTheClass()); |
| 463 | |
| 464 | if (last != null) { |
| 465 | metaMethodIndex.copyNonPrivateMethods(last, header); |
| 466 | } |
| 467 | last = header; |
| 468 | |
| 469 | for (var metaMethod : c.getMethods()) { |
| 470 | addToAllMethodsIfPublic(metaMethod); |
| 471 | addMetaMethodToIndex(metaMethod, header); |
| 472 | } |
| 473 | |
| 474 | for (var metaMethod : getNewMetaMethods(c)) { |
| 475 | if (metaMethod.getName().equals(CONSTRUCTOR_NAME) |
| 476 | && !metaMethod.getDeclaringClass().equals(theCachedClass)) continue; |
| 477 | if (newGroovyMethodsSet.add(metaMethod)) { |
| 478 | addMetaMethodToIndex(metaMethod, header); |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | private MetaMethod[] getNewMetaMethods(final CachedClass c) { |
| 485 | if (c != theCachedClass) { |
no test coverage detected