aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vojtek2014-07-25 04:30:43 (EDT)
committerLukas Jungmann2014-07-25 04:39:19 (EDT)
commitb274dc1249f73801ee7125b961af58fa533228f1 (patch)
treede5323b40687d5450286fd2991dba47266d46a90
parentfd10648097f047c04d010fa20ed8a89b1149c039 (diff)
downloadeclipselink.runtime-b274dc1249f73801ee7125b961af58fa533228f1.zip
eclipselink.runtime-b274dc1249f73801ee7125b961af58fa533228f1.tar.gz
eclipselink.runtime-b274dc1249f73801ee7125b961af58fa533228f1.tar.bz2
Fixed nightly failing tests in MOXy. Class.getDeclaredMethods() returns result in random order (by specification). In some JDK implementations it is always in the same order. The code was ok for get/set order. It was ready for set/get order, but it had some flaws. The bug was visible in XmlTransientUnsetPropTestCase when launched on Linux x64 JDK7 platform.
Signed-off-by: Martin Vojtek <martin.vojtek@oracle.com>
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java26
1 files changed, 10 insertions, 16 deletions
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
index 1fe5aea..f30a0da 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
@@ -2968,7 +2968,6 @@ public final class AnnotationsProcessor {
isPropertyTransient = true;
// XmlLocation can also be transient
if (isLocation) {
- propertyMethod = setMethod;
info.setLocationAware(true);
}
}
@@ -2982,7 +2981,6 @@ public final class AnnotationsProcessor {
isPropertyTransient = true;
// XmlLocation can also be transient
if (isLocation) {
- propertyMethod = getMethod;
info.setLocationAware(true);
}
}
@@ -3014,33 +3012,29 @@ public final class AnnotationsProcessor {
isPropertyTransient = true;
}
if (getMethod != null && hasJAXBAnnotations(getMethod)) {
- // use the set method if it exists and is annotated
+ // use the get method if it exists and is annotated
boolean isTransient = helper.isAnnotationPresent(getMethod, XmlTransient.class);
boolean isLocation = helper.isAnnotationPresent(getMethod, XmlLocation.class) ||
- helper.isAnnotationPresent(setMethod, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) ||
- helper.isAnnotationPresent(setMethod, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS);
- if (!isTransient) {
- propertyMethod = getMethod;
- } else {
+ helper.isAnnotationPresent(getMethod, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) ||
+ helper.isAnnotationPresent(getMethod, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS);
+ propertyMethod = getMethod;
+ if (isTransient) {
isPropertyTransient = true;
// XmlLocation can also be transient
if (isLocation) {
- propertyMethod = getMethod;
info.setLocationAware(true);
}
}
} else if ((onlyExplicit && hasJAXBAnnotations(setMethod)) || !onlyExplicit) {
boolean isTransient = helper.isAnnotationPresent(setMethod, XmlTransient.class);
boolean isLocation = helper.isAnnotationPresent(setMethod, XmlLocation.class) ||
- helper.isAnnotationPresent(setMethod, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) ||
- helper.isAnnotationPresent(setMethod, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS);
- if (!isTransient) {
- propertyMethod = setMethod;
- } else {
+ helper.isAnnotationPresent(getMethod, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) ||
+ helper.isAnnotationPresent(getMethod, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS);
+ propertyMethod = setMethod;
+ if (isTransient) {
isPropertyTransient = true;
// XmlLocation can also be transient
if (isLocation) {
- propertyMethod = setMethod;
info.setLocationAware(true);
}
}
@@ -4971,4 +4965,4 @@ public final class AnnotationsProcessor {
public boolean hasXmlBindings() {
return this.hasXmlBindings;
}
-} \ No newline at end of file
+}