// Note : the flag inherited is set to true
for (EasyBeansEjbJarMethodMetadata methodAnnotationMetadata : superClassMetadata.getMethodMetadataCollection()) {
// check that the method has not be redefined
JMethod method = methodAnnotationMetadata.getJMethod();
EasyBeansEjbJarMethodMetadata beanMethod = beanclassAnnotationMetadata.getMethodMetadata(method);
// overriding ?
boolean overrided = true;
overrided = !((method.getAccess() & Opcodes.ACC_PRIVATE) == Opcodes.ACC_PRIVATE);
// Add only if it is not present or if current method is not
// overriding super method (it means super method is private)
if (beanMethod == null || (!overrided && beanMethod != null && !beanMethod.isInherited())) {
// Add a clone of the method to bean class
EasyBeansEjbJarMethodMetadata clonedMethodAnnotationMetadata =
(EasyBeansEjbJarMethodMetadata) methodAnnotationMetadata.clone();
// set new class linked to this method metadata
clonedMethodAnnotationMetadata
.setClassMetadata(beanclassAnnotationMetadata);
// method is inherited
clonedMethodAnnotationMetadata.setInherited(true, superClassMetadata);
// Final method ? ignore it
if ((method.getAccess() & Opcodes.ACC_FINAL) == Opcodes.ACC_FINAL) {
logger.warn("Ignoring final method ''{0}'' from the class ''{1}''", method.getName(),
beanclassAnnotationMetadata.getClassName());
clonedMethodAnnotationMetadata.setIgnored(true);
}
beanclassAnnotationMetadata
.addStandardMethodMetadata(clonedMethodAnnotationMetadata);
// lifecycle / aroundInvoke
if (clonedMethodAnnotationMetadata.isPostConstruct()) {
beanclassAnnotationMetadata.addPostConstructMethodMetadata(clonedMethodAnnotationMetadata);
}
if (clonedMethodAnnotationMetadata.isPreDestroy()) {
beanclassAnnotationMetadata.addPreDestroyMethodMetadata(clonedMethodAnnotationMetadata);
}
if (clonedMethodAnnotationMetadata.isPostActivate()) {
beanclassAnnotationMetadata.addPostActivateMethodMetadata(clonedMethodAnnotationMetadata);
}
if (clonedMethodAnnotationMetadata.isPrePassivate()) {
beanclassAnnotationMetadata.addPrePassivateMethodMetadata(clonedMethodAnnotationMetadata);
}
if (clonedMethodAnnotationMetadata.isAroundInvoke()) {
beanclassAnnotationMetadata.addAroundInvokeMethodMetadata(clonedMethodAnnotationMetadata);
}
}
}