[
https://issues.apache.org/jira/browse/OWB-898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13764347#comment-13764347
]
Romain Manni-Bucau commented on OWB-898:
----------------------------------------
updating
org.apache.webbeans.util.ClassUtil#isOverridden(java.lang.reflect.Method,
java.lang.reflect.Method) to
public static boolean isOverridden(Method subClassMethod, Method
superClassMethod)
{
if (isSuperClass(superClassMethod.getDeclaringClass(),
subClassMethod.getDeclaringClass())
&& subClassMethod.getName().equals(superClassMethod.getName())
&& Arrays.equals(subClassMethod.getParameterTypes(),
superClassMethod.getParameterTypes()))
{
int modifiers = superClassMethod.getModifiers();
if(Modifier.isPrivate(modifiers) || Modifier.isStatic(modifiers))
{
return false;
}
/* if not in the same package we want to ignore parent method which
is not visible by current class
if(!Modifier.isProtected(modifiers) &&
!Modifier.isPublic(modifiers))
{
//Same package
final Class<?> superClass =
superClassMethod.getDeclaringClass();
final Class<?> subClass = subClassMethod.getDeclaringClass();
if(!subClass.getPackage().getName().equals(superClass.getPackage().getName()))
{
return false;
}
}
*/
return true;
}
return false;
}
fixes it, waiting comment from Mark to see if it doesn't cause missed
regressions.
The issue is in the proxying logic of OWB and not ASM (just to make it clear ;)
> ClassFormatError in ASM engine
> ------------------------------
>
> Key: OWB-898
> URL: https://issues.apache.org/jira/browse/OWB-898
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.0, 1.2.1
> Reporter: Tobias Stoeckmann
> Labels: ASM, ClassFormatError, bug
> Attachments: cdi-blow.zip
>
>
> It is possible for OpenWebBeans to throw a ClassFormatError while
> constructing an instance of a class that "overrides" a package private method
> of a super class with an own package private method. Technically, the methods
> are not overriden, which leads to two methods with the same signature --
> therefore the FormatError.
> de.cewecolor.cdi.blow.sub.SuperClass#setValue(String)
> de.cewecolor.cdi.blow.SubClass#setValue(String) extends SuperClass
> BeanManager#getReference(SubClass.class) will throw an Error.
> Please see the attached example project, it's a very small example triggering
> the issue (standalone container).
> I assume that this problem is related to the switch to ASM. For one,
> OpenWebBeans 1.1.8 works fine and it can be seen here too:
> http://issues.gradle.org//browse/GRADLE-2695
> Tested also with 1.2.1-SNAPSHOT which uses ASM 4, still the same issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira