jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java
changeset 29839 6d5d546e953b
parent 29142 49c84c7ed2ad
child 29953 d5894097fe65
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Thu Apr 09 06:40:17 2015 -0700
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Fri Apr 10 14:54:20 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -30,8 +30,6 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.ref.WeakReference;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
@@ -87,25 +85,19 @@
         if(consRef!=null)
             cons = consRef.get();
         if(cons==null) {
-            cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
-                @Override
-                public Constructor<T> run() {
-                    try {
-                        return clazz.getDeclaredConstructor(emptyClass);
-                    } catch (NoSuchMethodException e) {
-                        logger.log(Level.INFO,"No default constructor found on "+clazz,e);
-                        NoSuchMethodError exp;
-                        if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
-                            exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS
-                                                                .format(clazz.getName()));
-                        } else {
-                            exp = new NoSuchMethodError(e.getMessage());
-                        }
-                        exp.initCause(e);
-                        throw exp;
-                    }
+            try {
+                cons = clazz.getDeclaredConstructor(emptyClass);
+            } catch (NoSuchMethodException e) {
+                logger.log(Level.INFO,"No default constructor found on "+clazz,e);
+                NoSuchMethodError exp;
+                if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
+                    exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS.format(clazz.getName()));
+                } else {
+                    exp = new NoSuchMethodError(e.getMessage());
                 }
-            });
+                exp.initCause(e);
+                throw exp;
+            }
 
             int classMod = clazz.getModifiers();