openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r707937 [1/2] - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/src/main/java/org/apac...
Date Sun, 26 Oct 2008 04:31:30 GMT
Author: mikedd
Date: Sat Oct 25 21:31:28 2008
New Revision: 707937

URL: http://svn.apache.org/viewvc?rev=707937&view=rev
Log:
Code cleanup: remove some unnescessary casts

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ReverseMappingToolTask.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/MappingRepositoryValue.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/DynamicStorageGenerator.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ClassResolverImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneratedClasses.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Id.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MultiLoaderClassResolver.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Serialization.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/FileValue.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassMetaDataIterator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClasspathMetaDataIterator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ResourceMetaDataIterator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/URLMetaDataIterator.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataSerializer.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Files.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/JavaVersions.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/MultiClassLoader.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParameterTemplate.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Services.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/StreamResourceBundleProvider.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ZipResourceBundleProvider.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestEnhancementWithMultiplePUs.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataSerializer.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
    openjpa/trunk/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLFileHandler.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java Sat Oct 25 21:31:28 2008
@@ -178,14 +178,14 @@
         if (MappingTool.ACTION_IMPORT.equals(flags.action))
             assertFiles(files);
 
-        ClassLoader toolLoader = (ClassLoader) AccessController
+        ClassLoader toolLoader = AccessController
                 .doPrivileged(J2DoPrivHelper
                         .getClassLoaderAction(MappingTool.class));
         ClassLoader loader = toolLoader;
         MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
 
         if (tmpClassLoader) {
-            loader = (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+            loader = AccessController.doPrivileged(J2DoPrivHelper
                     .newTemporaryClassLoaderAction(getClassLoader()));
             resolver.addClassLoader(loader);
         }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ReverseMappingToolTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ReverseMappingToolTask.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ReverseMappingToolTask.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ReverseMappingToolTask.java Sat Oct 25 21:31:28 2008
@@ -262,11 +262,11 @@
         // load customizer properties
         Properties customProps = new Properties();
         File propsFile = Files.getFile(customizerProperties, loader);
-        if (propsFile != null && ((Boolean) AccessController.doPrivileged(
+        if (propsFile != null && (AccessController.doPrivileged(
             J2DoPrivHelper.existsAction(propsFile))).booleanValue()) {
             FileInputStream fis = null;
             try {
-                fis = (FileInputStream) AccessController.doPrivileged(
+                fis = AccessController.doPrivileged(
                     J2DoPrivHelper.newFileInputStreamAction(propsFile));
             } catch (PrivilegedActionException pae) {
                  throw (FileNotFoundException) pae.getException();
@@ -278,7 +278,7 @@
         JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
         flags.customizer = (ReverseCustomizer) Configurations.
             newInstance(customizerClass, conf, null,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(
                         ReverseCustomizer.class)));
         if (flags.customizer != null)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/MappingRepositoryValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/MappingRepositoryValue.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/MappingRepositoryValue.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/MappingRepositoryValue.java Sat Oct 25 21:31:28 2008
@@ -48,7 +48,7 @@
         // we need to manually perform the instantiation
         try {
             Class cls = Strings.toClass(clsName,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(type)));        
             return cls.getConstructor(new Class[]{ JDBCConfiguration.class }).
                 newInstance(new Object[]{ conf });

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java Sat Oct 25 21:31:28 2008
@@ -467,7 +467,7 @@
         try {
             if (strat == null)
                 strat = JavaTypes.classForName(name, cls,
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(
                             ClassStrategy.class)));
             ClassStrategy strategy = 
@@ -501,7 +501,7 @@
         name = Configurations.getClassName(name);
         try {
             Class c = JavaTypes.classForName(name, field,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(FieldStrategy.class)));
             if (FieldStrategy.class.isAssignableFrom(c)) {
                 FieldStrategy strat = (FieldStrategy)
@@ -574,7 +574,7 @@
             if (strat == null)
                 strat = JavaTypes.classForName(name,
                     discrim.getClassMapping(),
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(
                             DiscriminatorStrategy.class)));
             DiscriminatorStrategy strategy = (DiscriminatorStrategy)
@@ -640,7 +640,7 @@
             if (strat == null)
                 strat = JavaTypes.classForName(name,
                     version.getClassMapping(),
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(
                             VersionStrategy.class)));
         } catch (Exception e) {
@@ -982,7 +982,7 @@
         name = Configurations.getClassName(name);
         try {
             Class c = JavaTypes.classForName(name, val,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(FieldStrategy.class)));
             Object o = AccessController.doPrivileged(
                 J2DoPrivHelper.newInstanceAction(c));
@@ -1009,7 +1009,7 @@
         name = Configurations.getClassName(name);
         try {
             Class c = JavaTypes.classForName(name, val,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(ValueHandler.class)));
             if (ValueHandler.class.isAssignableFrom(c)) {
                 ValueHandler vh = (ValueHandler) AccessController.doPrivileged(

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java Sat Oct 25 21:31:28 2008
@@ -179,7 +179,7 @@
     private final Log _log;
     private final Map _tables = new HashMap();
     private final Project _project = new Project();
-    private final BCClassLoader _loader = (BCClassLoader) AccessController
+    private final BCClassLoader _loader = AccessController
         .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(_project));
     private StrategyInstaller _strat = null;
     private String _package = null;
@@ -1899,11 +1899,11 @@
         File customFile = Files.getFile
             (opts.removeProperty("customizerProperties", "cp", null), null);
         Properties customProps = new Properties();
-        if (customFile != null && ((Boolean) AccessController.doPrivileged(
+        if (customFile != null && (AccessController.doPrivileged(
             J2DoPrivHelper.existsAction(customFile))).booleanValue()) {
             FileInputStream fis = null;
             try {
-                fis = (FileInputStream) AccessController.doPrivileged(
+                fis = AccessController.doPrivileged(
                     J2DoPrivHelper.newFileInputStreamAction(customFile));
             } catch (PrivilegedActionException pae) {
                  throw (FileNotFoundException) pae.getException();

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java Sat Oct 25 21:31:28 2008
@@ -114,7 +114,7 @@
             // see if their driver name is actually a data source
             if (DataSource.class.isAssignableFrom(driverClass)) {
                 return (DataSource) Configurations.newInstance(driver,
-                    conf, props, (ClassLoader) AccessController.doPrivileged(
+                    conf, props, AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(
                             DataSource.class))); 
             }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java Sat Oct 25 21:31:28 2008
@@ -79,7 +79,7 @@
     }
 
     public SchemaGroup readSchema() {
-        URL url = (URL) AccessController.doPrivileged(
+        URL url = AccessController.doPrivileged(
             J2DoPrivHelper.getResourceAction(_loader, _fileName)); 
         if (url == null)
             return new SchemaGroup();

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java Sat Oct 25 21:31:28 2008
@@ -117,7 +117,7 @@
         DBDictionary dict = null;
         try {
             Class c = Class.forName(dclass, true,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(
                         DBDictionary.class)));
             dict = (DBDictionary) AccessController.doPrivileged(

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java Sat Oct 25 21:31:28 2008
@@ -133,10 +133,10 @@
 
     private static AbstractStoreManager createStoreManager(String cls,
         String props) {
-        AbstractStoreManager store = (AbstractStoreManager) Configurations.
-            newInstance(cls, (ClassLoader) AccessController.doPrivileged(
-                J2DoPrivHelper.getClassLoaderAction(
-                    AbstractStoreManager.class))); 
+        AbstractStoreManager store =
+            (AbstractStoreManager) Configurations.newInstance(cls,
+                AccessController.doPrivileged(J2DoPrivHelper
+                    .getClassLoaderAction(AbstractStoreManager.class))); 
         Configurations.configureInstance(store, null, props,
             PROP_ABSTRACT_STORE);
         if (store == null)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAVersion.java Sat Oct 25 21:31:28 2008
@@ -111,10 +111,9 @@
         appendProperty("java.vendor", buf).append("\n\n");
 
         buf.append("java.class.path:\n");
-        StringTokenizer tok = new StringTokenizer
-            ((String) AccessController.doPrivileged(
-                J2DoPrivHelper.getPropertyAction("java.class.path")),
-            File.pathSeparator);
+        StringTokenizer tok =
+            new StringTokenizer(AccessController.doPrivileged(J2DoPrivHelper
+                .getPropertyAction("java.class.path")), File.pathSeparator);
         while (tok.hasMoreTokens()) {
             buf.append("\t").append(tok.nextToken());
             buf.append("\n");
@@ -136,8 +135,8 @@
     }
 
     private StringBuffer appendProperty(String prop, StringBuffer buf) {
-        return buf.append(prop).append(": ")
-            .append((String) AccessController.doPrivileged(
-                J2DoPrivHelper.getPropertyAction(prop)));
+        return buf.append(prop).append(": ").append(
+            AccessController.doPrivileged(J2DoPrivHelper
+                .getPropertyAction(prop)));
     }
 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java Sat Oct 25 21:31:28 2008
@@ -78,10 +78,11 @@
             entityTimestampMap = new ConcurrentHashMap<String,Long>();
         
             // Get all persistence types to pre-load the entityTimestamp Map
-            Collection perTypes = conf.getMetaDataRepositoryInstance().
-            getPersistentTypeNames(false,
-                (ClassLoader) AccessController.doPrivileged(
-                J2DoPrivHelper.getContextClassLoaderAction()));
+            Collection perTypes =
+                conf.getMetaDataRepositoryInstance().getPersistentTypeNames(
+                    false,
+                    AccessController.doPrivileged(J2DoPrivHelper
+                        .getContextClassLoaderAction()));
             
             // Pre-load all the entity types into the HashMap to handle 
             // synchronization on the map efficiently

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java Sat Oct 25 21:31:28 2008
@@ -99,9 +99,10 @@
         _caches.put(cache, schedule);
         _stop = false;
         if (_thread == null) {
-            _thread = (Thread) AccessController.doPrivileged(J2DoPrivHelper
-                .newDaemonThreadAction(this, _loc.get("scheduler-name")
-                    .getMessage()));
+            _thread =
+                AccessController.doPrivileged(J2DoPrivHelper
+                    .newDaemonThreadAction(this, _loc.get("scheduler-name")
+                        .getMessage()));
             _thread.start();
             if (_log.isTraceEnabled())
                 _log.trace(_loc.get("scheduler-start", _thread.getName()));

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java Sat Oct 25 21:31:28 2008
@@ -1370,7 +1370,7 @@
         ApplicationIdTool tool;
         Class cls;
         ClassMetaData meta;
-        BCClassLoader bc = (BCClassLoader) AccessController
+        BCClassLoader bc = AccessController
             .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(new Project()));
         for (Iterator itr = classes.iterator(); itr.hasNext();) {
             cls = (Class) itr.next();
@@ -1424,10 +1424,10 @@
             name = Strings.getPackageName(context) + "." + name;
 
         // first try with regular class loader
-        ClassLoader loader = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader loader = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(context)); 
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction()); 
         try {
             return Class.forName(name, false, loader);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/DynamicStorageGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/DynamicStorageGenerator.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/DynamicStorageGenerator.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/DynamicStorageGenerator.java Sat Oct 25 21:31:28 2008
@@ -96,9 +96,9 @@
 
     // the project/classloader for the classes.
     private final Project _project = new Project();
-    private final BCClassLoader _loader = (BCClassLoader) AccessController
-        .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(_project,
-            (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+    private final BCClassLoader _loader =
+        AccessController.doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(
+            _project, AccessController.doPrivileged(J2DoPrivHelper
                 .getClassLoaderAction(DynamicStorage.class))));
 
     /**

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Sat Oct 25 21:31:28 2008
@@ -144,7 +144,7 @@
     static {
         Class[] classes = Services.getImplementorClasses(
             AuxiliaryEnhancer.class,
-            (ClassLoader) AccessController.doPrivileged(
+            AccessController.doPrivileged(
                 J2DoPrivHelper.getClassLoaderAction(AuxiliaryEnhancer.class)));
         List auxEnhancers = new ArrayList(classes.length);
         for (int i = 0; i < classes.length; i++) {
@@ -185,7 +185,7 @@
      * repository.
      */
     public PCEnhancer(OpenJPAConfiguration conf, Class type) {
-        this(conf, (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        this(conf, AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(new Project(), type)),
             (MetaDataRepository) null);
     }
@@ -196,7 +196,7 @@
      * and then loading from <code>conf</code>'s repository.
      */
     public PCEnhancer(OpenJPAConfiguration conf, ClassMetaData meta) {
-        this(conf, (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        this(conf, AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(new Project(), meta.getDescribedType())),
             meta.getRepository());
     }
@@ -730,7 +730,7 @@
      * Package-protected and static for testing.
      */
     static BCField getReturnedField(BCMethod meth) {
-        return findField(meth, ((Code) AccessController.doPrivileged(
+        return findField(meth, (AccessController.doPrivileged(
             J2DoPrivHelper.newCodeAction())).xreturn()
             .setType(meth.getReturnType()), false);
     }
@@ -740,7 +740,7 @@
      * Package-protected and static for testing.
      */
     static BCField getAssignedField(BCMethod meth) {
-        return findField(meth, ((Code) AccessController.doPrivileged(
+        return findField(meth, (AccessController.doPrivileged(
             J2DoPrivHelper.newCodeAction())).putfield(), true);
     }
 
@@ -791,7 +791,7 @@
             // field that's being accessed
             if (!findAccessed && prevIns instanceof GetFieldInstruction) {
                 final FieldInstruction fPrevIns = (FieldInstruction) prevIns;
-                cur = (BCField) AccessController.doPrivileged(
+                cur = AccessController.doPrivileged(
                     J2DoPrivHelper.getFieldInstructionFieldAction(fPrevIns));
                 // if the middle instruction was an xload_1, then the
                 // matched instruction is the field that's being set.
@@ -799,7 +799,7 @@
                 && ((LoadInstruction) prevIns).getParam() == 0) {
                 final FieldInstruction fTemplateIns =
                     (FieldInstruction) templateIns;
-                cur = (BCField) AccessController.doPrivileged(J2DoPrivHelper
+                cur = AccessController.doPrivileged(J2DoPrivHelper
                     .getFieldInstructionFieldAction(fTemplateIns));
             } else
                 return null;
@@ -856,7 +856,7 @@
      */
     private void replaceAndValidateFieldAccess() throws NoSuchMethodException {
         // create template putfield/getfield instructions to search for
-        Code template = (Code) AccessController.doPrivileged(
+        Code template = AccessController.doPrivileged(
             J2DoPrivHelper.newCodeAction());
         Instruction put = template.putfield();
         Instruction get = template.getfield();
@@ -958,7 +958,7 @@
                     loadManagedInstance(code, false);
                     final FieldInstruction fFi = fi;
                     code.getfield().setField(
-                        (BCField) AccessController.doPrivileged(J2DoPrivHelper
+                        AccessController.doPrivileged(J2DoPrivHelper
                             .getFieldInstructionFieldAction(fFi)));
                     int val = code.getNextLocalsIndex();
                     code.xstore().setLocal(val).setType(fi.getFieldType());
@@ -1569,55 +1569,55 @@
         try {
             // pcGetGenericContext
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "get" + CONTEXTNAME, (Class[]) null)), false);
     
             // pcFetchObjectId
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "fetchObjectId", (Class[]) null)), false);
     
             // pcIsDeleted
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "isDeleted", (Class[]) null)), false);
     
             // pcIsDirty
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "isDirty", (Class[]) null)), true);
     
             // pcIsNew
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "isNew", (Class[]) null)), false);
     
             // pcIsPersistent
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "isPersistent", (Class[]) null)), false);
     
             // pcIsTransactional
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "isTransactional", (Class[]) null)), false);
     
             // pcSerializing
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "serializing", (Class[]) null)), false);
     
             // pcDirty
             translateFromStateManagerMethod(
-                (Method) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredMethodAction(
                         SMTYPE, "dirty", new Class[]{ String.class })), false);
     
@@ -2595,7 +2595,7 @@
         Class[] params = (Class[]) plist.toArray(new Class[plist.size()]);
         
         try {
-            return (Method) AccessController.doPrivileged(
+            return AccessController.doPrivileged(
                 J2DoPrivHelper.getDeclaredMethodAction(owner, name, params));
         } catch (PrivilegedActionException pae) {
              throw (NoSuchMethodException) pae.getException();
@@ -2956,7 +2956,7 @@
             code.vreturn();
         }
 
-        Instruction tmplate = ((Code) AccessController.doPrivileged(
+        Instruction tmplate = (AccessController.doPrivileged(
             J2DoPrivHelper.newCodeAction())).vreturn();
         JumpInstruction toret;
         Instruction ret;
@@ -3267,7 +3267,7 @@
         if (clinit != null) {
             code = clinit.getCode(true);
             if (replaceLast) {
-                Code template = (Code) AccessController.doPrivileged(
+                Code template = AccessController.doPrivileged(
                     J2DoPrivHelper.newCodeAction());
                 code.searchForward(template.vreturn());
                 code.previous();
@@ -3346,7 +3346,7 @@
         }
 
         // create template super.clone () instruction to match against
-        Instruction template = ((Code) AccessController.doPrivileged(
+        Instruction template = (AccessController.doPrivileged(
             J2DoPrivHelper.newCodeAction())).invokespecial()
             .setMethod(superName, "clone", Object.class.getName(), null);
 
@@ -3720,7 +3720,7 @@
         // next, find the field in the managed type hierarchy
         BCField field = null;
         outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) {
-            BCField[] fields = (BCField[]) AccessController
+            BCField[] fields = AccessController
                 .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,
                     fieldName));
             for (int i = 0; i < fields.length; i++) {
@@ -4451,7 +4451,7 @@
             loader = conf.getClassResolverInstance().
                 getClassLoader(PCEnhancer.class, null);
         if (flags.tmpClassLoader)
-            loader = (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+            loader = AccessController.doPrivileged(J2DoPrivHelper
                 .newTemporaryClassLoaderAction(loader));
 
         if (repos == null) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java Sat Oct 25 21:31:28 2008
@@ -106,9 +106,9 @@
     		conf.setConnectionDriverName(null);
     		conf.setConnectionFactoryName(null);
     		// set single class resolver
-    		final ClassLoader tmpLoader = (ClassLoader) AccessController
+    		final ClassLoader tmpLoader = AccessController
     		    .doPrivileged(J2DoPrivHelper
-    		    .newTemporaryClassLoaderAction((ClassLoader) AccessController
+    		    .newTemporaryClassLoaderAction(AccessController
     		    .doPrivileged(J2DoPrivHelper.getContextClassLoaderAction())
     		    ));
     		conf.setClassResolver(new ClassResolver() {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java Sat Oct 25 21:31:28 2008
@@ -198,7 +198,7 @@
      * @since 0.9.8
      */
     private static Field getDeclaredField(Class cls, String name) {
-        Field[] fields = (Field[]) AccessController.doPrivileged(
+        Field[] fields = AccessController.doPrivileged(
             J2DoPrivHelper.getDeclaredFieldsAction(cls));
         for (int i = 0 ; i < fields.length; i++) {
     	    if (name.equals(fields[i].getName()))

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/TCPRemoteCommitProvider.java Sat Oct 25 21:31:28 2008
@@ -238,7 +238,7 @@
                     hostname = host;
                     tmpPort = DEFAULT_PORT;
                 }
-                InetAddress tmpAddress = (InetAddress) AccessController
+                InetAddress tmpAddress = AccessController
                     .doPrivileged(J2DoPrivHelper.getByNameAction(hostname)); 
 
                 // bleair: For each address we would rather make use of
@@ -505,7 +505,7 @@
             _port = port;
             _log = log;
             try {
-                _receiveSocket = (ServerSocket) AccessController
+                _receiveSocket = AccessController
                     .doPrivileged(J2DoPrivHelper.newServerSocketAction(_port));
             } catch (PrivilegedActionException pae) {
                 throw (IOException) pae.getException();
@@ -576,7 +576,7 @@
                 try {
                     s = null;
                     // Block, waiting to accept new connection from a peer
-                    s = (Socket) AccessController.doPrivileged(J2DoPrivHelper
+                    s = AccessController.doPrivileged(J2DoPrivHelper
                         .acceptAction(_receiveSocket));
                     if (_log.isTraceEnabled()) {
                         _log.trace(s_loc.get("tcp-received-connection",
@@ -770,12 +770,12 @@
             int colon = host.indexOf(':');
             try {
                 if (colon != -1) {
-                    _address = (InetAddress) AccessController
+                    _address = AccessController
                         .doPrivileged(J2DoPrivHelper.getByNameAction(host
                             .substring(0, colon)));
                     _port = Integer.parseInt(host.substring(colon + 1));
                 } else {
-                    _address = (InetAddress) AccessController
+                    _address = AccessController
                         .doPrivileged(J2DoPrivHelper.getByNameAction(host));
                     _port = DEFAULT_PORT;
                 }
@@ -905,7 +905,7 @@
             public Object makeObject()
                 throws IOException {
                 try {
-                    Socket s = (Socket) AccessController
+                    Socket s = AccessController
                         .doPrivileged(J2DoPrivHelper.newSocketAction(_address,
                             _port));
                     if (log.isTraceEnabled()) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java Sat Oct 25 21:31:28 2008
@@ -116,7 +116,7 @@
             // handle cases where there is a mismatch between loaders by falling
             // back to the configuration's class loader for broker resolution
             cls = getFactoryClass(conf,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(conf.getClass()))); 
             meth = cls.getMethod(methodName, FACTORY_ARGS); 
         }
@@ -139,7 +139,7 @@
     private static Class getFactoryClass(ConfigurationProvider conf,
         ClassLoader loader) {
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction()); 
 
         Object cls = BrokerFactoryValue.get(conf);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Sat Oct 25 21:31:28 2008
@@ -269,7 +269,7 @@
         DelegatingStoreManager sm, boolean managed, int connMode,
         boolean fromDeserialization) {
         _initializeWasInvoked = true;
-        _loader = (ClassLoader) AccessController.doPrivileged(
+        _loader = AccessController.doPrivileged(
             J2DoPrivHelper.getContextClassLoaderAction());
         if (!fromDeserialization)
             _conf = factory.getConfiguration();
@@ -4183,7 +4183,7 @@
         if (!PCRegistry.isRegistered(cls)) {
             try {
                 Class.forName(cls.getName(), true, 
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(cls)));
             } catch (Throwable t) {
             }
@@ -4341,10 +4341,10 @@
             if (intfs[i].getName().equals(PersistenceCapable.class.getName())) {
                 throw new UserException(_loc.get("pc-loader-different",
                     Exceptions.toString(obj),
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(
                             PersistenceCapable.class)),
-                    (ClassLoader) AccessController.doPrivileged(
+                    AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(intfs[i]))))
                     .setFailedObject(obj);
             }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Sat Oct 25 21:31:28 2008
@@ -1569,7 +1569,7 @@
 
         // first check the aliases map in the MetaDataRepository
         ClassLoader loader = (_class == null) ? _loader
-            : (ClassLoader) AccessController.doPrivileged(
+            : AccessController.doPrivileged(
                 J2DoPrivHelper.getClassLoaderAction(_class)); 
         ClassMetaData meta = _broker.getConfiguration().
             getMetaDataRepositoryInstance().getMetaData(name, loader, false);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java Sat Oct 25 21:31:28 2008
@@ -41,7 +41,7 @@
         // Load and cache all the query languages available in the system.
         Class[] classes = Services.getImplementorClasses(
             ExpressionParser.class,
-            (ClassLoader) AccessController.doPrivileged(
+            AccessController.doPrivileged(
                 J2DoPrivHelper.getClassLoaderAction(ExpressionParser.class)));
         for (int i = 0; i < classes.length; i++) {
             ExpressionParser ep;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java Sat Oct 25 21:31:28 2008
@@ -98,7 +98,7 @@
             File file;
             for (int i = 0; i < strs.length; i++) {
                 file = new File(strs[i]);
-                if (((Boolean) AccessController.doPrivileged(
+                if ((AccessController.doPrivileged(
                     J2DoPrivHelper.existsAction(file))).booleanValue())
                     this.files.add(file);
             }
@@ -364,7 +364,7 @@
         for (int i = 0; i < metas.length; i++) {
             if (getSourceFile(metas[i]) == null)
                 setSourceFile(metas[i], defaultSourceFile(metas[i]));
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if ((AccessController.doPrivileged(J2DoPrivHelper
                 .existsAction(getSourceFile(metas[i])))).booleanValue()) {
                 if (files == null)
                     files = new HashSet();
@@ -379,7 +379,7 @@
                 queries[i].setSource(defaultSourceFile(queries[i],
                     clsNames), queries[i].getSourceScope(),
                     queries[i].getSourceType());
-            if (((Boolean) AccessController.doPrivileged(
+            if ((AccessController.doPrivileged(
                 J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
                 .booleanValue()) {
                 if (files == null)
@@ -392,7 +392,7 @@
                 if (getSourceFile(seqs[i]) == null)
                     setSourceFile(seqs[i], defaultSourceFile(seqs[i],
                         clsNames));
-                if (((Boolean) AccessController.doPrivileged(
+                if ((AccessController.doPrivileged(
                     J2DoPrivHelper.existsAction(getSourceFile(seqs[i]))))
                     .booleanValue()) {
                     if (files == null)
@@ -420,7 +420,7 @@
             if (queries[i].getSourceFile() == null)
                 queries[i].setSource(defaultSourceFile(queries[i], clsNames),
                     queries[i].getSourceScope(), queries[i].getSourceType());
-            if (((Boolean) AccessController.doPrivileged(
+            if ((AccessController.doPrivileged(
                 J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
                 .booleanValue()) {
                 if (files == null)
@@ -631,7 +631,7 @@
             File file;
             for (Iterator itr = files.iterator(); itr.hasNext();) {
                 file = (File) itr.next();
-                if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                if ((AccessController.doPrivileged(J2DoPrivHelper
                     .isDirectoryAction(file))).booleanValue()) {
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-directory", file));
@@ -641,7 +641,7 @@
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-jar", file));
                     try {
-                        ZipFile zFile = (ZipFile) AccessController
+                        ZipFile zFile = AccessController
                             .doPrivileged(J2DoPrivHelper
                                 .newZipFileAction(file));
                         scan(new ZipFileMetaDataIterator(zFile,
@@ -657,7 +657,7 @@
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scan-found-names", clss, file));
                     names.addAll(Arrays.asList(clss));
-                    File f = (File) AccessController
+                    File f = AccessController
                         .doPrivileged(J2DoPrivHelper
                             .getAbsoluteFileAction(file));
                     try {
@@ -674,12 +674,12 @@
             for (Iterator itr = urls.iterator(); itr.hasNext();) {
                 url = (URL) itr.next();
                 if ("file".equals(url.getProtocol())) {
-                    File file = (File) AccessController
+                    File file = AccessController
                         .doPrivileged(J2DoPrivHelper
                             .getAbsoluteFileAction(new File(url.getFile()))); 
                     if (files != null && files.contains(file)) {
                         continue;
-                    } else if (((Boolean) AccessController
+                    } else if ((AccessController
                         .doPrivileged(J2DoPrivHelper.isDirectoryAction(file)))
                         .booleanValue()) {
                         if (log.isTraceEnabled())
@@ -726,7 +726,7 @@
             for (Iterator itr = rsrcs.iterator(); itr.hasNext();) {
                 rsrc = (String) itr.next();
                 if (rsrc.endsWith(".jar")) {
-                    url = (URL) AccessController.doPrivileged(
+                    url = AccessController.doPrivileged(
                         J2DoPrivHelper.getResourceAction(loader, rsrc)); 
                     if (url != null) {
                         if (log.isTraceEnabled())

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataDefaults.java Sat Oct 25 21:31:28 2008
@@ -198,7 +198,7 @@
             FieldMetaData fmd;
             for (int i = 0; i < fieldNames.length; i ++) {
                 if (meta.getAccessType() == ClassMetaData.ACCESS_FIELD)
-                    member = (Field) AccessController.doPrivileged(
+                    member = AccessController.doPrivileged(
                         J2DoPrivHelper.getDeclaredFieldAction(
                             cls,fieldNames[i])); 
                 else
@@ -362,7 +362,7 @@
             //### where the superclass uses a different access type
             if (fmd.getDefiningMetaData().getAccessType() ==
                 ClassMetaData.ACCESS_FIELD)
-                return (Field) AccessController.doPrivileged(
+                return AccessController.doPrivileged(
                     J2DoPrivHelper.getDeclaredFieldAction(
                         fmd.getDeclaringType(), fmd.getName())); 
             return Reflection.findGetter(fmd.getDeclaringType(), fmd.getName(),

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Sat Oct 25 21:31:28 2008
@@ -2087,12 +2087,12 @@
             String memberName = (String) in.readObject();
             try {
                 if (isField)
-                    _member = (Field) AccessController.doPrivileged(
+                    _member = AccessController.doPrivileged(
                         J2DoPrivHelper.getDeclaredFieldAction(
                             cls, memberName)); 
                 else {
                     Class[] parameterTypes = (Class[]) in.readObject();
-                    _member = (Method) AccessController.doPrivileged(
+                    _member = AccessController.doPrivileged(
                         J2DoPrivHelper.getDeclaredMethodAction(
                             cls, memberName, parameterTypes));
                 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java Sat Oct 25 21:31:28 2008
@@ -77,12 +77,12 @@
         if (impl != null)
             return impl;
 
-        ClassLoader parentLoader = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader parentLoader = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(iface)); 
-        BCClassLoader loader = (BCClassLoader) AccessController
+        BCClassLoader loader = AccessController
             .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(_project,
                 parentLoader));
-        BCClassLoader enhLoader = (BCClassLoader) AccessController
+        BCClassLoader enhLoader = AccessController
             .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(_enhProject,
                 parentLoader));
         BCClass bc = _project.loadClass(getClassName(meta));
@@ -90,9 +90,9 @@
         ClassMetaData sup = meta.getPCSuperclassMetaData();
         if (sup != null) {
             bc.setSuperclass(sup.getInterfaceImpl());
-            enhLoader = (BCClassLoader) AccessController
+            enhLoader = AccessController
                 .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(
-                    _enhProject, (ClassLoader) AccessController
+                    _enhProject, AccessController
                         .doPrivileged(J2DoPrivHelper.getClassLoaderAction(sup
                             .getInterfaceImpl()))));
         }
@@ -209,7 +209,7 @@
      */
     private static Method getMethodSafe(Class iface, String name, Class arg) {
         try {
-            return (Method) AccessController.doPrivileged(
+            return AccessController.doPrivileged(
                 J2DoPrivHelper.getDeclaredMethodAction(
                     iface, name, arg == null ? null : new Class[]{arg}));
         } catch (PrivilegedActionException pae) {
@@ -221,7 +221,7 @@
         if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class)
             return true;
         try {
-            Method meth = (Method) AccessController.doPrivileged(
+            Method meth = AccessController.doPrivileged(
                 J2DoPrivHelper.getDeclaredMethodAction(iface, "is" +
                     StringUtils.capitalize(fmd.getName()), (Class[]) null));
             return meth == null;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java Sat Oct 25 21:31:28 2008
@@ -454,7 +454,7 @@
             if ((_validate & VALIDATE_RUNTIME) != 0) {
                 try {
                     Class.forName(cls.getName(), true,
-                        (ClassLoader) AccessController.doPrivileged(
+                        AccessController.doPrivileged(
                             J2DoPrivHelper.getClassLoaderAction(cls)));
                 } catch (Throwable t) {
                 }
@@ -1038,7 +1038,7 @@
         if (_log.isTraceEnabled())
             _log.trace(_loc.get("resolve-identity", oidClass));
 
-        ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader cl = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(oidClass)); 
         String className;
         while (oidClass != null && oidClass != Object.class) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java Sat Oct 25 21:31:28 2008
@@ -255,7 +255,7 @@
             String clsName = plugin.getClassName();
 
             Class cls = Class.forName(clsName, true,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(Seq.class)));
             StringBuffer props = new StringBuffer();
             if (plugin.getProperties() != null)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ClassResolverImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ClassResolverImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ClassResolverImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ClassResolverImpl.java Sat Oct 25 21:31:28 2008
@@ -40,15 +40,15 @@
         // class (the bootstrap loader is the parent of the system loader)
         ClassLoader contextLoader = null;
         if (contextClass != null) {
-            contextLoader = (ClassLoader) AccessController.doPrivileged(
+            contextLoader = AccessController.doPrivileged(
                 J2DoPrivHelper.getClassLoaderAction(contextClass)); 
             if (contextLoader == null)
-                contextLoader = (ClassLoader) AccessController.doPrivileged(
+                contextLoader = AccessController.doPrivileged(
                     J2DoPrivHelper.getSystemClassLoaderAction()); 
         }
 
         // if there is only one unique loader, just return it
-        ClassLoader threadLoader = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader threadLoader = AccessController.doPrivileged(
             J2DoPrivHelper.getContextClassLoaderAction());
         if ((contextLoader == null || contextLoader == threadLoader)
             && (envLoader == null || envLoader == threadLoader))
@@ -56,7 +56,7 @@
 
         // construct a multi class loader that will delegate in the order
         // described in section 12.5 of the spec
-        MultiClassLoader loader = (MultiClassLoader) AccessController
+        MultiClassLoader loader = AccessController
             .doPrivileged(J2DoPrivHelper.newMultiClassLoaderAction());
         if (contextLoader != null)
             loader.addClassLoader(contextLoader);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneratedClasses.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneratedClasses.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneratedClasses.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneratedClasses.java Sat Oct 25 21:31:28 2008
@@ -39,9 +39,9 @@
      * classes.
      */
     public static ClassLoader getMostDerivedLoader(Class c1, Class c2) {
-        ClassLoader l1 = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader l1 = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(c1));
-        ClassLoader l2 = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader l2 = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(c2));
         if (l1 == l2)
             return l1;
@@ -60,7 +60,7 @@
      * Load the class represented by the given bytecode.
      */
     public static Class loadBCClass(BCClass bc, ClassLoader loader) {
-        BCClassLoader bcloader = (BCClassLoader) AccessController
+        BCClassLoader bcloader = AccessController
                 .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(bc
                         .getProject(), loader));
         try {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Id.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Id.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Id.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Id.java Sat Oct 25 21:31:28 2008
@@ -78,7 +78,7 @@
      */
     public Id(String str, ClassLoader loader) {
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
 
         if (str == null)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MultiLoaderClassResolver.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MultiLoaderClassResolver.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MultiLoaderClassResolver.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MultiLoaderClassResolver.java Sat Oct 25 21:31:28 2008
@@ -31,7 +31,7 @@
  */
 public class MultiLoaderClassResolver implements ClassResolver {
 
-    final private MultiClassLoader _loader = (MultiClassLoader) AccessController
+    final private MultiClassLoader _loader = AccessController
         .doPrivileged(J2DoPrivHelper.newMultiClassLoaderAction());
 
     public MultiLoaderClassResolver() {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java Sat Oct 25 21:31:28 2008
@@ -48,10 +48,10 @@
     public static void assertAllowedType(Object value, Class allowed) {
         if (value != null && allowed != null && !allowed.isInstance(value)) {
             throw new UserException(_loc.get("bad-elem-type", new Object[]{
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(allowed)),
                 allowed,
-                (ClassLoader) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(value.getClass())),
                 value.getClass()
             }));

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java Sat Oct 25 21:31:28 2008
@@ -440,9 +440,10 @@
                 ProxyBean.class);
             Class pcls = loadBuildTimeProxy(type, l);
             if (pcls == null) {
-                BCClass bc = (BCClass) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+                // TODO Move this to J2DOPrivHelper? 
+                BCClass bc = AccessController
+                    .doPrivileged(new PrivilegedAction<BCClass>() {
+                        public BCClass run() {
                             return generateProxyBeanBytecode(type, true);
                         }
                     });
@@ -513,7 +514,7 @@
         boolean runtime) {
         assertNotFinal(type);
         Project project = new Project(); 
-        BCClass bc = (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(project, getProxyClassName(type, runtime))); 
         bc.setSuperclass(type);
         bc.declareInterface(ProxyCollection.class);
@@ -551,7 +552,7 @@
     protected BCClass generateProxyMapBytecode(Class type, boolean runtime) {
         assertNotFinal(type);
         Project project = new Project(); 
-        BCClass bc = (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(project, getProxyClassName(type, runtime))); 
         bc.setSuperclass(type);
         bc.declareInterface(ProxyMap.class);
@@ -571,7 +572,7 @@
     protected BCClass generateProxyDateBytecode(Class type, boolean runtime) {
         assertNotFinal(type);
         Project project = new Project(); 
-        BCClass bc = (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(project, getProxyClassName(type, runtime))); 
         bc.setSuperclass(type);
         bc.declareInterface(ProxyDate.class);
@@ -591,7 +592,7 @@
         boolean runtime) {
         assertNotFinal(type);
         Project project = new Project(); 
-        BCClass bc = (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(project, getProxyClassName(type, runtime))); 
         bc.setSuperclass(type);
         bc.declareInterface(ProxyCalendar.class);
@@ -626,7 +627,7 @@
         }
 
         Project project = new Project(); 
-        BCClass bc = (BCClass) AccessController.doPrivileged(J2DoPrivHelper
+        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
             .loadProjectClassAction(project, getProxyClassName(type, runtime))); 
         bc.setSuperclass(type);
         bc.declareInterface(ProxyBean.class);
@@ -1585,7 +1586,7 @@
     public static void main(String[] args) 
         throws ClassNotFoundException, IOException {
         File dir = Files.getClassFile(ProxyManagerImpl.class);
-        dir = (dir == null) ? new File((String) AccessController.doPrivileged(
+        dir = (dir == null) ? new File(AccessController.doPrivileged(
             J2DoPrivHelper.getPropertyAction("user.dir")))
             : dir.getParentFile();
 
@@ -1647,9 +1648,10 @@
                 bc = mgr.generateProxyCalendarBytecode(cls, false);
             else {
                 final Class fCls = cls;
-                bc = (BCClass) AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+                // TODO Move this to J2DOPrivHelper
+                bc = AccessController
+                    .doPrivileged(new PrivilegedAction<BCClass>() {
+                        public BCClass run() {
                             return mgr.generateProxyBeanBytecode(fCls, false);
                         }
                     });

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Serialization.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Serialization.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Serialization.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Serialization.java Sat Oct 25 21:31:28 2008
@@ -129,7 +129,7 @@
 
         protected Class resolveClass(ObjectStreamClass desc) 
             throws IOException, ClassNotFoundException {
-            MultiClassLoader loader = (MultiClassLoader) AccessController
+            MultiClassLoader loader = AccessController
                 .doPrivileged(J2DoPrivHelper.newMultiClassLoaderAction());
             addContextClassLoaders(loader);
             loader.addClassLoader(getClass().getClassLoader());
@@ -138,7 +138,7 @@
         }
 
         protected void addContextClassLoaders(MultiClassLoader loader) {
-            loader.addClassLoader((ClassLoader) AccessController.doPrivileged(
+            loader.addClassLoader(AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction()));
         }
     }

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java Sat Oct 25 21:31:28 2008
@@ -57,7 +57,7 @@
     private static final Localizer _loc = Localizer.forPackage
         (AbstractTask.class);
 
-    protected final List fileSets = new ArrayList();
+    protected final List<FileSet> fileSets = new ArrayList<FileSet>();
     protected boolean haltOnError = true;
     protected Path classpath = null;
     protected boolean useParent = false;
@@ -117,10 +117,10 @@
             return _cl;
 
         if (classpath != null)
-            _cl = new AntClassLoader(project, classpath, useParent);
+            _cl = new AntClassLoader(getProject(), classpath, useParent);
         else
-            _cl = new AntClassLoader(project.getCoreLoader(), project,
-                new Path(project), useParent);
+            _cl = new AntClassLoader(getProject().getCoreLoader(), getProject(),
+                new Path(getProject()), useParent);
         _cl.setIsolated(isolate);
 
         return _cl;
@@ -143,7 +143,7 @@
 
     public Path createClasspath() {
         if (classpath == null)
-            classpath = new Path(project);
+            classpath = new Path(getProject());
         return classpath.createPath();
     }
 
@@ -161,7 +161,7 @@
             _conf = newConfiguration();
         if (_conf.getPropertiesResource() == null) {
             ConfigurationProvider cp = ProductDerivations.loadDefaults
-                ((ClassLoader) AccessController.doPrivileged(
+                (AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(_conf.getClass())));
             if (cp != null)
                 cp.setInto(_conf);
@@ -181,18 +181,17 @@
     }
 
     private String[] getFiles() {
-        List files = new ArrayList();
-        for (Iterator i = fileSets.iterator(); i.hasNext();) {
-            FileSet fs = (FileSet) i.next();
-            DirectoryScanner ds = fs.getDirectoryScanner(project);
+        List<String> files = new ArrayList<String>();
+        for(FileSet fs : fileSets) { 
+            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
 
             String[] dsFiles = ds.getIncludedFiles();
             for (int j = 0; j < dsFiles.length; j++) {
                 File f = new File(dsFiles[j]);
-                if (!((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                if (!( AccessController.doPrivileged(J2DoPrivHelper
                     .isFileAction(f))).booleanValue())
                     f = new File(ds.getBasedir(), dsFiles[j]);
-                files.add((String) AccessController.doPrivileged(
+                files.add(AccessController.doPrivileged(
                     J2DoPrivHelper.getAbsolutePathAction(f)));
             }
         }

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Sat Oct 25 21:31:28 2008
@@ -165,9 +165,9 @@
      * {@link ProductDerivation}s, and from System properties.
      */
     public boolean loadGlobals() {
-        MultiClassLoader loader = (MultiClassLoader) AccessController
+        MultiClassLoader loader = AccessController
             .doPrivileged(J2DoPrivHelper.newMultiClassLoaderAction()); 
-        loader.addClassLoader((ClassLoader) AccessController.doPrivileged(
+        loader.addClassLoader(AccessController.doPrivileged(
             J2DoPrivHelper.getContextClassLoaderAction()));
         loader.addClassLoader(getClass().getClassLoader());
         ConfigurationProvider provider = ProductDerivations.loadGlobals(loader);
@@ -177,7 +177,7 @@
         // let system properties override other globals
         try {
             fromProperties(new HashMap(
-                (Properties) AccessController.doPrivileged(
+                AccessController.doPrivileged(
                     J2DoPrivHelper.getPropertiesAction())));
         } catch (SecurityException se) {
             // security manager might disallow

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Sat Oct 25 21:31:28 2008
@@ -245,19 +245,19 @@
         // we always prefer the thread loader, because it's the only thing we
         // can access that isn't bound to the OpenJPA classloader, unless
         // the conf object is of a custom class
-        ClassLoader ctxLoader = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader ctxLoader = AccessController.doPrivileged(
             J2DoPrivHelper.getContextClassLoaderAction());
         if (loader == null) {
             if (ctxLoader != null)
                 return ctxLoader;
             if (conf != null)
-                return (ClassLoader) AccessController.doPrivileged(
+                return AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(conf.getClass())); 
             return Configurations.class.getClassLoader();
         }
 
         for (ClassLoader parent = ctxLoader; parent != null; 
-            parent = (ClassLoader) AccessController.doPrivileged(
+            parent = AccessController.doPrivileged(
                 J2DoPrivHelper.getParentAction(parent))) {
             if (parent == loader)
                 return ctxLoader;
@@ -267,10 +267,10 @@
                 AccessController.doPrivileged(
                     J2DoPrivHelper.getClassLoaderAction(conf.getClass())); 
                 parent != null; 
-                parent = (ClassLoader) AccessController.doPrivileged(
+                parent = AccessController.doPrivileged(
                     J2DoPrivHelper.getParentAction(parent))) {
                 if (parent == loader)
-                    return (ClassLoader) AccessController.doPrivileged(
+                    return AccessController.doPrivileged(
                         J2DoPrivHelper.getClassLoaderAction(conf.getClass())); 
             }
         }
@@ -332,12 +332,12 @@
             }
 
             File file = new File(path);
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if ((AccessController.doPrivileged(J2DoPrivHelper
                 .isFileAction(file))).booleanValue())
                 provider = ProductDerivations.load(file, anchor, null);
             else {
                 file = new File("META-INF" + File.separatorChar + path);
-                if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                if ((AccessController.doPrivileged(J2DoPrivHelper
                     .isFileAction(file))).booleanValue())
                     provider = ProductDerivations.load(file, anchor, null);
                 else

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/FileValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/FileValue.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/FileValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/FileValue.java Sat Oct 25 21:31:28 2008
@@ -60,7 +60,7 @@
     }
 
     protected String getInternalString() {
-        return (value == null) ? null : (String) AccessController.doPrivileged(
+        return (value == null) ? null : AccessController.doPrivileged(
             J2DoPrivHelper.getAbsolutePathAction(value));
     }
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java Sat Oct 25 21:31:28 2008
@@ -98,10 +98,10 @@
             boolean fatal) {
         ClassLoader cl = (ClassLoader) _classloaderCache.get(type);
         if (cl == null) {
-            cl = (ClassLoader) AccessController.doPrivileged(
+            cl = AccessController.doPrivileged(
                 J2DoPrivHelper.getClassLoaderAction(type));
             if (cl == null) {  // System classloader is returned as null
-                cl = (ClassLoader) AccessController.doPrivileged(
+                cl = AccessController.doPrivileged(
                     J2DoPrivHelper.getSystemClassLoaderAction()); 
             }
             _classloaderCache.put(type, cl);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java Sat Oct 25 21:31:28 2008
@@ -52,7 +52,7 @@
     private static final Throwable[] _derivationErrors;
     private static String[] _prefixes;
     static {
-        ClassLoader l = (ClassLoader) AccessController.doPrivileged(
+        ClassLoader l = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(ProductDerivation.class)); 
         _derivationNames = Services.getImplementors(ProductDerivation.class, l);
         _derivationErrors = new Throwable[_derivationNames.length];
@@ -250,7 +250,7 @@
         if (StringUtils.isEmpty(resource))
             return null;
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         ConfigurationProvider provider = null;
         StringBuffer errs = null;
@@ -285,7 +285,7 @@
         if (file == null)
             return null;
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         ConfigurationProvider provider = null;
         StringBuffer errs = null;
@@ -302,7 +302,7 @@
                 errs.append(_derivations[i].getClass().getName() + ":" + t);
             }
         }
-        String aPath = (String) AccessController.doPrivileged(
+        String aPath = AccessController.doPrivileged(
             J2DoPrivHelper.getAbsolutePathAction(file));
         reportErrors(errs, aPath, err);
         String rsrc = aPath + "#" + anchor;
@@ -331,7 +331,7 @@
     private static ConfigurationProvider load(ClassLoader loader, 
        boolean globals) {
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         
         ConfigurationProvider provider = null;

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Sat Oct 25 21:31:28 2008
@@ -188,7 +188,7 @@
                 _out = new PrintStream((FileOutputStream)
                     AccessController.doPrivileged(
                         J2DoPrivHelper.newFileOutputStreamAction(
-                            (String) AccessController.doPrivileged(
+                            AccessController.doPrivileged(
                                 J2DoPrivHelper.getCanonicalPathAction(f)),
                             true)));
             } catch (PrivilegedActionException pae) {

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java?rev=707937&r1=707936&r2=707937&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java Sat Oct 25 21:31:28 2008
@@ -298,7 +298,7 @@
             return null;
 
         if (loader == null)
-            loader = (ClassLoader) AccessController.doPrivileged(
+            loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         boolean fullName = name.indexOf('.') != -1;
         boolean noPackage = StringUtils.isEmpty(pkg);



Mime
View raw message