openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r581356 - in /openjpa/branches/1.0.x: ./ openjpa-kernel-5/ openjpa-lib-5/ openjpa-lib-5/src/ openjpa-lib-5/src/main/ openjpa-lib-5/src/main/java/ openjpa-lib-5/src/main/java/org/ openjpa-lib-5/src/main/java/org/apache/ openjpa-lib-5/src/mai...
Date Tue, 02 Oct 2007 19:21:51 GMT
Author: allee8285
Date: Tue Oct  2 12:21:50 2007
New Revision: 581356

URL: http://svn.apache.org/viewvc?rev=581356&view=rev
Log:
OPENJPA-369, apply same changes in trunk to the 1.0.x branch.

Added:
    openjpa/branches/1.0.x/openjpa-lib-5/
    openjpa/branches/1.0.x/openjpa-lib-5/pom.xml
    openjpa/branches/1.0.x/openjpa-lib-5/src/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/
    openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java
Modified:
    openjpa/branches/1.0.x/openjpa-kernel-5/pom.xml
    openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
    openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
    openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
    openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
    openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
    openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
    openjpa/branches/1.0.x/pom.xml

Modified: openjpa/branches/1.0.x/openjpa-kernel-5/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel-5/pom.xml?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-kernel-5/pom.xml (original)
+++ openjpa/branches/1.0.x/openjpa-kernel-5/pom.xml Tue Oct  2 12:21:50 2007
@@ -39,6 +39,12 @@
             <version>${pom.version}</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-lib-5</artifactId>
+            <version>${pom.version}</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

Added: openjpa/branches/1.0.x/openjpa-lib-5/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib-5/pom.xml?rev=581356&view=auto
==============================================================================
--- openjpa/branches/1.0.x/openjpa-lib-5/pom.xml (added)
+++ openjpa/branches/1.0.x/openjpa-lib-5/pom.xml Tue Oct  2 12:21:50 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.openjpa</groupId>
+    <artifactId>openjpa-lib-5</artifactId>
+    <packaging>jar</packaging>
+    <name>OpenJPA Utilities 1.5</name>
+    <description>OpenJPA Utilities 1.5</description>
+    <url>http://openjpa.apache.org</url>
+    <parent>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa-parent</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-lib</artifactId>
+            <version>${pom.version}</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java?rev=581356&view=auto
==============================================================================
--- openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java
(added)
+++ openjpa/branches/1.0.x/openjpa-lib-5/src/main/java/org/apache/openjpa/lib/util/J2DoPriv5Helper.java
Tue Oct  2 12:21:50 2007
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.lib.util;
+
+import java.lang.reflect.AnnotatedElement;
+import java.security.PrivilegedAction;
+
+/**
+ * Helper class to obtain the Privilege(Exception)Action object to perform
+ * Java 2 doPrivilege security sensitive function call in the following
+ * methods:
+ * <ul>
+ * <li>AnnotatedElement.getAnnotations
+ * <li>AnnotatedElement.getDeclaredAnnotations
+ * <li>AnnotatedElement.isAnnotationPresent
+ * </ul>
+ *
+ * @author Albert Lee
+ */
+
+public abstract class J2DoPriv5Helper extends J2DoPrivHelper {
+
+    /**
+     * Return a PrivilegeAction object for AnnotatedElement.getAnnotations().
+     *
+     * Requires security policy:
+     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
+     *
+     * @return Annotation[]
+     */
+    public static final PrivilegedAction getAnnotationsAction(
+        final AnnotatedElement element) {
+        return new PrivilegedAction() {
+            public Object run() {
+                return element.getAnnotations();
+            }
+        };
+    }
+
+    /**
+     * Return a PrivilegeAction object for
+     *   AnnotatedElement.getDeclaredAnnotations().
+     *
+     * Requires security policy:
+     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
+     *
+     * @return Annotation[]
+     */
+    public static final PrivilegedAction getDeclaredAnnotationsAction(
+        final AnnotatedElement element) {
+        return new PrivilegedAction() {
+            public Object run() {
+                return element.getDeclaredAnnotations();
+            }
+        };
+    }
+
+    /**
+     * Return a PrivilegeAction object for
+     *   AnnotatedElement.isAnnotationPresent().
+     *
+     * Requires security policy:
+     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
+     *
+     * @return Boolean
+     */
+    public static final PrivilegedAction isAnnotationPresentAction(
+        final AnnotatedElement element, final Class annotationClazz) {
+        return new PrivilegedAction() {
+            public Object run() {
+                return element.isAnnotationPresent(annotationClazz)
+                    ? Boolean.TRUE : Boolean.FALSE;
+            }
+        };
+    }
+}

Modified: openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
(original)
+++ openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/J2DoPrivHelper.java
Tue Oct  2 12:21:50 2007
@@ -24,7 +24,6 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.AnnotatedElement;
 import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.ServerSocket;
@@ -49,9 +48,6 @@
  * methods:
  * <ul>
  * <li>AccessibleObject.setAccessible
- * <li>AnnotatedElement.getAnnotations
- * <li>AnnotatedElement.getDeclaredAnnotations
- * <li>AnnotatedElement.isAnnotationPresent
  * <li>Class.forName
  * <li>Class.getClassLoader
  * <li>Class.getDeclaredField
@@ -324,60 +320,6 @@
         return new PrivilegedAction() {
             public Object run() {
                 return clazz.getResource(resource);
-            }
-        };
-    }
-
-    /**
-     * Return a PrivilegeAction object for AnnotatedElement.getAnnotations().
-     * 
-     * Requires security policy:
-     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
-     * 
-     * @return Annotation[]
-     */
-    public static final PrivilegedAction getAnnotationsAction(
-        final AnnotatedElement element) {
-        return new PrivilegedAction() {
-            public Object run() {
-                return element.getAnnotations();
-            }
-        };
-    }
-
-    /**
-     * Return a PrivilegeAction object for 
-     *   AnnotatedElement.getDeclaredAnnotations().
-     * 
-     * Requires security policy:
-     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
-     * 
-     * @return Annotation[]
-     */
-    public static final PrivilegedAction getDeclaredAnnotationsAction(
-        final AnnotatedElement element) {
-        return new PrivilegedAction() {
-            public Object run() {
-                return element.getDeclaredAnnotations();
-            }
-        };
-    }
-
-    /**
-     * Return a PrivilegeAction object for
-     *   AnnotatedElement.isAnnotationPresent().
-     * 
-     * Requires security policy:
-     *   'permission java.lang.RuntimePermission "accessDeclaredMembers";'
-     * 
-     * @return Boolean
-     */
-    public static final PrivilegedAction isAnnotationPresentAction(
-        final AnnotatedElement element, final Class annotationClazz) {
-        return new PrivilegedAction() {
-            public Object run() {
-                return element.isAnnotationPresent(annotationClazz)
-                    ? Boolean.TRUE : Boolean.FALSE;
             }
         };
     }

Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
(original)
+++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Tue Oct  2 12:21:50 2007
@@ -75,7 +75,7 @@
 import org.apache.openjpa.jdbc.schema.Unique;
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.lib.log.Log;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
+import org.apache.openjpa.lib.util.J2DoPriv5Helper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
@@ -1060,7 +1060,7 @@
             
             if (xmlTypeClass != null
                 && StringUtils.isEmpty(pcols[i].columnDefinition())
-                && ((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                && ((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                     .isAnnotationPresentAction(fm.getDeclaredType(),
                         xmlTypeClass))).booleanValue()) {
                 DBDictionary dict = ((MappingRepository) getRepository())

Modified: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
(original)
+++ openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
Tue Oct  2 12:21:50 2007
@@ -87,7 +87,7 @@
 import org.apache.openjpa.kernel.jpql.JPQLParser;
 import org.apache.openjpa.lib.conf.Configurations;
 import org.apache.openjpa.lib.log.Log;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
+import org.apache.openjpa.lib.util.J2DoPriv5Helper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.DelegatingMetaDataFactory;
@@ -465,12 +465,12 @@
         // check immediately whether the user is using any annotations,
         // regardless of mode.  this prevents adding non-entity classes to
         // repository if we're ignoring these annotations in mapping mode
-        if (!((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+        if (!((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
             .isAnnotationPresentAction(_cls, Entity.class))).booleanValue()
-            && !((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            && !((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(_cls, Embeddable.class)))
                 .booleanValue()
-            && !((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            && !((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(_cls, MappedSuperclass.class)))
                 .booleanValue())
             return null;
@@ -669,17 +669,17 @@
 
         String rsrc = StringUtils.replace(cls.getName(), ".", "/");
         ClassLoader loader = (ClassLoader) AccessController.doPrivileged(
-            J2DoPrivHelper.getClassLoaderAction(cls)); 
+            J2DoPriv5Helper.getClassLoaderAction(cls)); 
         if (loader == null)
             loader = (ClassLoader) AccessController.doPrivileged(
-                J2DoPrivHelper.getSystemClassLoaderAction()); 
+                J2DoPriv5Helper.getSystemClassLoaderAction()); 
         if (loader == null)
             return null;
         URL url = (URL) AccessController.doPrivileged(
-            J2DoPrivHelper.getResourceAction(loader, rsrc + ".java")); 
+            J2DoPriv5Helper.getResourceAction(loader, rsrc + ".java")); 
         if (url == null) {
             url = (URL) AccessController.doPrivileged(
-                J2DoPrivHelper.getResourceAction(loader, rsrc + ".class")); 
+                J2DoPriv5Helper.getResourceAction(loader, rsrc + ".class")); 
             if (url == null)
                 return null;
         }
@@ -764,10 +764,10 @@
                 meta.setDetachedState(detached.fieldName());
         } else {
             Field[] fields = (Field[]) AccessController.doPrivileged(
-                J2DoPrivHelper.getDeclaredFieldsAction(
+                J2DoPriv5Helper.getDeclaredFieldsAction(
                     meta.getDescribedType())); 
             for (int i = 0; i < fields.length; i++)
-                if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                     .isAnnotationPresentAction(fields[i], DetachedState.class)))
                     .booleanValue())
                     meta.setDetachedState(fields[i].getName());
@@ -808,7 +808,7 @@
         Set<MethodKey> seen = new HashSet<MethodKey>();
         do {
             for (Method m : (Method[]) AccessController.doPrivileged(
-                J2DoPrivHelper.getDeclaredMethodsAction(sup))) {
+                J2DoPriv5Helper.getDeclaredMethodsAction(sup))) {
                 mods = m.getModifiers();
                 if (Modifier.isStatic(mods) || Modifier.isFinal(mods) ||
                     Object.class.equals(m.getDeclaringClass()))
@@ -826,7 +826,8 @@
         MetaDataDefaults def = repos.getMetaDataFactory().getDefaults();
         for (Method m : methods) {
             for (Annotation anno : (Annotation[]) AccessController
-                .doPrivileged(J2DoPrivHelper.getDeclaredAnnotationsAction(m))) {
+                .doPrivileged(J2DoPriv5Helper
+                    .getDeclaredAnnotationsAction(m))) {
                 MetaDataTag tag = _tags.get(anno.annotationType());
                 if (tag == null)
                     continue;
@@ -964,7 +965,7 @@
         fmd.setExplicit(true);
 
         AnnotatedElement el = (AnnotatedElement) member;
-        boolean lob = ((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+        boolean lob = ((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
             .isAnnotationPresentAction(el, Lob.class))).booleanValue();
         if (isMetaDataMode()) {
             switch (pstrat) {

Modified: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
(original)
+++ openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
Tue Oct  2 12:21:50 2007
@@ -27,7 +27,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.lib.log.Log;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
+import org.apache.openjpa.lib.util.J2DoPriv5Helper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.DelegatingMetaDataFactory;
 import org.apache.openjpa.meta.FieldMetaData;
@@ -173,10 +173,10 @@
     private XMLMetaData parseXMLClassAnnotations() {
         // check immediately whether the class has JAXB XML annotations
         if (_cls == null || xmlTypeClass == null
-            || !(((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            || !(((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(_cls, xmlTypeClass))).booleanValue()
                 && ((Boolean) AccessController
-                .doPrivileged(J2DoPrivHelper.isAnnotationPresentAction(_cls,
+                .doPrivileged(J2DoPriv5Helper.isAnnotationPresentAction(_cls,
                     xmlRootElementClass))).booleanValue()))
             return null;
 
@@ -225,7 +225,7 @@
         Class superclass = cls.getSuperclass();
 
         // handle inheritance at sub-element level
-        if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+        if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
             .isAnnotationPresentAction(superclass, xmlTypeClass)))
             .booleanValue())
             populateFromReflection(superclass, meta);
@@ -247,7 +247,7 @@
                     // avoid JAXB XML bind default name
                     if (StringUtils.equals(XMLMetaData.defaultName, xmlname))
                         xmlname = member.getName();
-                    if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+                    if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                         .isAnnotationPresentAction(((Field) member).getType(),
                             xmlTypeClass))).booleanValue()) {
                         field = _repos.addXMLMetaData(((Field) member).getType()

Modified: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
(original)
+++ openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataDefaults.java
Tue Oct  2 12:21:50 2007
@@ -48,7 +48,7 @@
 import javax.persistence.Transient;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
+import org.apache.openjpa.lib.util.J2DoPriv5Helper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.meta.AbstractMetaDataDefaults;
@@ -116,7 +116,7 @@
         if (member == null)
             return null;
         AnnotatedElement el = (AnnotatedElement) member;
-        if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+        if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
             .isAnnotationPresentAction(el, Transient.class))).booleanValue())
             return TRANSIENT;
         if (fmd != null
@@ -183,7 +183,7 @@
         }
 
         //### EJB3: what if defined in XML?
-        if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+        if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
             .isAnnotationPresentAction(type, Embeddable.class))).booleanValue())
             return EMBEDDED;
         if (Serializable.class.isAssignableFrom(type))
@@ -258,10 +258,10 @@
 
         int access = 0;
         if (usesAccess((Field[]) AccessController.doPrivileged(
-            J2DoPrivHelper.getDeclaredFieldsAction(cls))))
+            J2DoPriv5Helper.getDeclaredFieldsAction(cls))))
             access |= ClassMetaData.ACCESS_FIELD;
         if (usesAccess((Method[]) AccessController.doPrivileged(
-            J2DoPrivHelper.getDeclaredMethodsAction(cls))))
+            J2DoPriv5Helper.getDeclaredMethodsAction(cls))))
             access |= ClassMetaData.ACCESS_PROPERTY;
         return (access == 0) ? getAccessType(cls.getSuperclass()) : access;
     }
@@ -273,7 +273,7 @@
         Annotation[] annos;
         String name;
         for (int i = 0; i < members.length; i++) {
-            annos = (Annotation[]) AccessController.doPrivileged(J2DoPrivHelper
+            annos = (Annotation[]) AccessController.doPrivileged(J2DoPriv5Helper
                 .getAnnotationsAction(members[i]));
             for (int j = 0; j < annos.length; j++) {
                 name = annos[j].annotationType().getName();
@@ -296,7 +296,7 @@
             try {
                 // check for setters for methods
                 Method setter = (Method) AccessController.doPrivileged(
-                    J2DoPrivHelper.getDeclaredMethodAction(
+                    J2DoPriv5Helper.getDeclaredMethodAction(
                         meta.getDescribedType(), "set" +
                         StringUtils.capitalize(name), new Class[] { 
                             ((Method) member).getReturnType() }));
@@ -320,7 +320,7 @@
 
     private boolean isAnnotatedTransient(Member member) {
         return member instanceof AnnotatedElement
-            && ((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            && ((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(((AnnotatedElement) member),
                     Transient.class))).booleanValue();
     }

Modified: openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
(original)
+++ openjpa/branches/1.0.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
Tue Oct  2 12:21:50 2007
@@ -46,7 +46,7 @@
 import org.apache.openjpa.lib.meta.ClassArgParser;
 import org.apache.openjpa.lib.meta.MetaDataFilter;
 import org.apache.openjpa.lib.meta.MetaDataParser;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
+import org.apache.openjpa.lib.util.J2DoPriv5Helper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.meta.AbstractCFMetaDataFactory;
@@ -293,24 +293,24 @@
             return null;
         Collection classes = repos.loadPersistentTypes(false, loader);
         for (Class cls : (Collection<Class>) classes) {
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, NamedQuery.class)))
                 .booleanValue() && hasNamedQuery
                 (queryName, (NamedQuery) cls.getAnnotation(NamedQuery.class)))
                 return cls;
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, NamedQueries.class)))
                 .booleanValue() &&
                 hasNamedQuery(queryName, ((NamedQueries) cls.
                     getAnnotation(NamedQueries.class)).value()))
                 return cls;
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, NamedNativeQuery.class)))
                 .booleanValue() &&
                 hasNamedNativeQuery(queryName, (NamedNativeQuery) cls.
                     getAnnotation(NamedNativeQuery.class)))
                 return cls;
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, NamedNativeQueries.class)))
                 .booleanValue() &&
                 hasNamedNativeQuery(queryName, ((NamedNativeQueries) cls.
@@ -329,14 +329,14 @@
         Collection classes = repos.loadPersistentTypes(false, loader);
         for (Class cls : (Collection<Class>) classes) {
 
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, SqlResultSetMapping.class)))
                 .booleanValue() &&
                 hasRSMapping(rsMappingName, (SqlResultSetMapping) cls.
                 getAnnotation(SqlResultSetMapping.class)))
                 return cls;
 
-            if (((Boolean) AccessController.doPrivileged(J2DoPrivHelper
+            if (((Boolean) AccessController.doPrivileged(J2DoPriv5Helper
                 .isAnnotationPresentAction(cls, SqlResultSetMappings.class)))
                 .booleanValue() &&
                 hasRSMapping(rsMappingName, ((SqlResultSetMappings) cls.
@@ -458,11 +458,11 @@
         ClassLoader loader = repos.getConfiguration().
             getClassResolverInstance().getClassLoader(getClass(), null);
         URL rsrc = (URL) AccessController.doPrivileged(
-            J2DoPrivHelper.getResourceAction(loader, "META-INF/orm.xml"));
+            J2DoPriv5Helper.getResourceAction(loader, "META-INF/orm.xml"));
         if (rsrc != null) {
             File file = new File(rsrc.getFile());
             if (((Boolean) AccessController.doPrivileged(
-                J2DoPrivHelper.existsAction(file))).booleanValue())
+                J2DoPriv5Helper.existsAction(file))).booleanValue())
                 return file;
         }
         return new File("orm.xml");

Modified: openjpa/branches/1.0.x/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/pom.xml?rev=581356&r1=581355&r2=581356&view=diff
==============================================================================
--- openjpa/branches/1.0.x/pom.xml (original)
+++ openjpa/branches/1.0.x/pom.xml Tue Oct  2 12:21:50 2007
@@ -121,6 +121,7 @@
                 <jdk>1.5</jdk>
             </activation>
             <modules>
+                <module>openjpa-lib-5</module>
                 <module>openjpa-persistence</module>
                 <module>openjpa-persistence-jdbc</module>
                 <module>openjpa-kernel-5</module>



Mime
View raw message