Skip to content

Commit fbc0bbf

Browse files
diorcetyYann Diorcet
and
Yann Diorcet
authored
Property: only add marshal methods (#841)
The issue is that on OpenJ9 adapterCls.getMethods() returns all the classes' methods. The current code add all the methods to "marshalMethods", so marshal methods but also getClass, equals and so on. On openjdk the marshal method is the first one to pop, which is not the case on OpenJ9, the first one is getClass So in the second loop: JavaClass paramType = method.getParameterTypes()[0]; an ArrayIndexOutOfBoundsException is thrown. The modification will only add to "marshalMethods" methods named marshal with one argument. Which seems to me the wanted behaviour from the start. Co-authored-by: Yann Diorcet <[email protected]>
1 parent 66ac0c0 commit fbc0bbf

File tree

1 file changed

+3
-3
lines changed
  • moxy/org.eclipse.persistence.moxy/src/main/java/org/eclipse/persistence/jaxb/compiler

1 file changed

+3
-3
lines changed

moxy/org.eclipse.persistence.moxy/src/main/java/org/eclipse/persistence/jaxb/compiler/Property.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ public void setAdapterClass(JavaClass adapterCls) {
218218
setTypeFromAdapterClass(returnType, parameterTypes[0]);
219219
return;
220220
}
221+
// Found a marshal method with an Object return type; add
222+
// it to the list in case we need to process it later
223+
marshalMethods.add(method);
221224
}
222-
// Found a marshal method with an Object return type; add
223-
// it to the list in case we need to process it later
224-
marshalMethods.add(method);
225225
}
226226
// At this point we didn't find a marshal method with a non-Object return type
227227
for (JavaMethod method : marshalMethods) {

0 commit comments

Comments
 (0)