Author: dkulp
Date: Tue Nov 16 20:48:31 2010
New Revision: 1035804
URL: http://svn.apache.org/viewvc?rev=1035804&view=rev
Log:
Merged revisions 1035787 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1035787 | bimargulies | 2010-11-16 15:30:02 -0500 (Tue, 16 Nov 2010) | 1 line
CXF-3130: ExceptionInInitializerErrors should get the same treatment as
ClassNotFoundException when processing annotations
........
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java
Propchange: cxf/branches/2.3.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 16 20:48:31 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022155,1022157-1023401,1023420-1030540,1030542-1031074,1031076-1033529,1033531,1033533-1033888,1033890-1033925,1033927-1034174,1034637,1035203,1035206,1035220,1035302,1035377,1035391,1035428,1035559,1035614
+/cxf/trunk:1-1022155,1022157-1023401,1023420-1030540,1030542-1031074,1031076-1033529,1033531,1033533-1033888,1033890-1033925,1033927-1034174,1034637,1035203,1035206,1035220,1035302,1035377,1035391,1035428,1035559,1035614,1035787
Modified:
cxf/branches/2.3.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java?rev=1035804&r1=1035803&r2=1035804&view=diff
==============================================================================
---
cxf/branches/2.3.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java
(original)
+++
cxf/branches/2.3.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/AnnotationReader.java
Tue Nov 16 20:48:31 2010
@@ -21,10 +21,14 @@ package org.apache.cxf.aegis.type.java5;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.apache.cxf.aegis.type.AegisType;
+import org.apache.cxf.common.logging.LogUtils;
public class AnnotationReader {
+ private static final Logger LOG =
LogUtils.getL7dLogger(AnnotationReader.class);
private static final Class<? extends Annotation> WEB_PARAM =
load("javax.jws.WebParam");
private static final Class<? extends Annotation> WEB_RESULT =
load("javax.jws.WebResult");
private static final Class<? extends Annotation> XML_ATTRIBUTE =
@@ -37,21 +41,21 @@ public class AnnotationReader {
load("javax.xml.bind.annotation.XmlType");
private static final Class<? extends Annotation> XML_TRANSIENT =
load("javax.xml.bind.annotation.XmlTransient");
-
+
private static final Class<? extends Annotation> XFIRE_IGNORE_PROPERTY =
- load("org.codehaus.xfire.aegis.type.java5.IgnoreProperty");
+ load("org.codehaus.xfire.aegis.type.java5.IgnoreProperty");
private static final Class<? extends Annotation> XFIRE_XML_ATTRIBUTE =
- load("org.codehaus.xfire.aegis.type.java5.XmlAttribute");
+ load("org.codehaus.xfire.aegis.type.java5.XmlAttribute");
private static final Class<? extends Annotation> XFIRE_XML_ELEMENT =
- load("org.codehaus.xfire.aegis.type.java5.XmlElement");
+ load("org.codehaus.xfire.aegis.type.java5.XmlElement");
private static final Class<? extends Annotation> XFIRE_XML_TYPE =
load("org.codehaus.xfire.aegis.type.java5.XmlType");
private static final Class<? extends Annotation> XFIRE_XML_PARAM_TYPE =
load("org.codehaus.xfire.aegis.type.java5.XmlParamType");
private static final Class<? extends Annotation> XFIRE_XML_RETURN_TYPE =
load("org.codehaus.xfire.aegis.type.java5.XmlReturnType");
-
-
+
+
@SuppressWarnings("unchecked")
public boolean isIgnored(AnnotatedElement element) {
return isAnnotationPresent(element,
@@ -326,7 +330,7 @@ public class AnnotationReader {
AnnotatedElement element,
Object ignoredValue,
Class<? extends Annotation>... annotations) {
-
+
for (Class<?> annotation : annotations) {
if (annotation != null) {
try {
@@ -371,7 +375,7 @@ public class AnnotationReader {
int index,
Object ignoredValue,
Class<? extends Annotation>... annotations) {
-
+
if (method.getParameterAnnotations() == null
|| method.getParameterAnnotations().length <= index
|| method.getParameterAnnotations()[index] == null) {
@@ -417,6 +421,10 @@ public class AnnotationReader {
try {
return
AnnotationReader.class.getClassLoader().loadClass(name).asSubclass(Annotation.class);
} catch (ClassNotFoundException e) {
+ LOG.log(Level.WARNING, "Class " + name + " not found.", e);
+ return null;
+ } catch (ExceptionInInitializerError e2) {
+ LOG.log(Level.WARNING, "Initialization error loading " + name + "
not found.", e2);
return null;
}
}