--- old/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldGetter.java 2014-03-04 17:55:48.000000000 +0100
+++ new/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/FieldGetter.java 2014-03-04 17:55:48.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,7 @@
package com.sun.xml.internal.ws.spi.db;
import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
+import javax.xml.ws.WebServiceException;
/**
@@ -42,6 +40,7 @@
protected Field field;
public FieldGetter(Field f) {
+ verifyWrapperType(f.getDeclaringClass());
field = f;
type = f.getType();
}
@@ -50,43 +49,12 @@
return field;
}
- static class PrivilegedGetter implements PrivilegedExceptionAction {
- private Object value;
- private Field field;
- private Object instance;
- public PrivilegedGetter(Field field, Object instance) {
- super();
- this.field = field;
- this.instance = instance;
- }
- public Object run() throws IllegalAccessException {
- if (!field.isAccessible()) {
- field.setAccessible(true);
- }
- value = field.get(instance);
- return null;
- }
- }
-
public Object get(final Object instance) {
- if (field.isAccessible()) {
- try {
- return field.get(instance);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else {
- PrivilegedGetter privilegedGetter = new PrivilegedGetter(field, instance);
- try {
- AccessController.doPrivileged(privilegedGetter);
- } catch (PrivilegedActionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return privilegedGetter.value;
+ try {
+ return field.get(instance);
+ } catch (Exception e) {
+ throw new WebServiceException(e);
}
- return null;
}
public A getAnnotation(Class annotationType) {