You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2007/12/16 22:32:54 UTC

svn commit: r604714 - in /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa: conf/ map/

Author: aadamchik
Date: Sun Dec 16 13:32:53 2007
New Revision: 604714

URL: http://svn.apache.org/viewvc?rev=604714&view=rev
Log:
generics

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorFactory.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/ClassAnnotationProcessorFactory.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityListenerAnnotationLoader.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaClassDescriptor.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorFactory.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorFactory.java Sun Dec 16 13:32:53 2007
@@ -53,7 +53,7 @@
     /**
      * Dervies processor inner class name, applying naming conventions.
      */
-    static Class processorClass(Class factoryClass, String annotationFQN) {
+    static Class<?> processorClass(Class<?> factoryClass, String annotationFQN) {
         if (annotationFQN.startsWith(ANNOTATIONS_PACKAGE)) {
 
             // derive the processor name from the annotation unqualified name, so that we
@@ -87,7 +87,7 @@
     /**
      * Returns an annotation class handled by the processor, applying naming conventions.
      */
-    static Class annotationClass(Class processorClass) {
+    static Class<?> annotationClass(Class<?> processorClass) {
         String name = processorClass.getName();
         if (!name.endsWith(PROCESSOR_NAME_SUFFIX)) {
             return null;
@@ -111,7 +111,7 @@
         }
         catch (Exception e) {
             // there are a few unsupported annotations in the JPA package related
-            // to Java EE conatiners
+            // to Java EE containers
             return null;
         }
     }
@@ -144,7 +144,7 @@
      */
     AnnotationProcessor createProcessor(String annotationFQN) {
 
-        Class processorClass = processorClass(getClass(), annotationFQN);
+        Class<?> processorClass = processorClass(getClass(), annotationFQN);
 
         if (processorClass != null) {
 

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/AnnotationProcessorStack.java Sun Dec 16 13:32:53 2007
@@ -36,7 +36,7 @@
 
     Object peek();
 
-    void recordConflict(AnnotatedElement element, Class annotatedType, String message);
+    void recordConflict(AnnotatedElement element, Class<?> annotatedType, String message);
 
     int depth();
 }

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/ClassAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/ClassAnnotationProcessorFactory.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/ClassAnnotationProcessorFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/ClassAnnotationProcessorFactory.java Sun Dec 16 13:32:53 2007
@@ -78,7 +78,7 @@
             Entity entityAnnotation = element.getAnnotation(Entity.class);
 
             JpaEntity entity = new JpaEntity();
-            entity.setClassName(((Class) element).getName());
+            entity.setClassName(((Class<?>) element).getName());
             entity.setAttributes(new JpaAttributes());
 
             if (!Util.isEmptyString(entityAnnotation.name())) {
@@ -104,7 +104,7 @@
                 AnnotationProcessorStack context) {
 
             JpaEmbeddable embeddable = new JpaEmbeddable();
-            embeddable.setClassName(((Class) element).getName());
+            embeddable.setClassName(((Class<?>) element).getName());
             embeddable.setAttributes(new JpaAttributes());
             context.push(embeddable);
         }
@@ -125,7 +125,7 @@
                 AnnotationProcessorStack context) {
 
             JpaMappedSuperclass superclass = new JpaMappedSuperclass();
-            superclass.setClassName(((Class) element).getName());
+            superclass.setClassName(((Class<?>) element).getName());
             superclass.setAttributes(new JpaAttributes());
             context.push(superclass);
         }

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityListenerAnnotationLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityListenerAnnotationLoader.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityListenerAnnotationLoader.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityListenerAnnotationLoader.java Sun Dec 16 13:32:53 2007
@@ -56,7 +56,7 @@
      * Returns a listener methods descriptor for the annotated listener, or null if none
      * of the class methods are properly annotated.
      */
-    public JpaEntityListener getEntityListener(Class listenerClass) {
+    public JpaEntityListener getEntityListener(Class<?> listenerClass) {
         JpaEntityListener listener = new JpaEntityListener();
 
         boolean hasAnnotations = false;
@@ -92,7 +92,7 @@
             return false;
         }
 
-        Class[] params = m.getParameterTypes();
+        Class<?>[] params = m.getParameterTypes();
         if (params.length != 1 || !Object.class.equals(params[0])) {
             return false;
         }

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java Sun Dec 16 13:32:53 2007
@@ -171,7 +171,7 @@
      * Processes annotations of a single Java class, loading ORM mapping information to
      * the provided entity map.
      */
-    public void loadClassMapping(Class managedClass) throws JpaProviderException {
+    public void loadClassMapping(Class<?> managedClass) throws JpaProviderException {
 
         // avoid duplicates loaded from annotations per CAY-756
         if (context.getEntityMap().containsManagedClass(managedClass.getName())) {
@@ -335,7 +335,7 @@
      * Returns a collection of methods that match an 'entity callback" pattern, i.e. "void
      * <METHOD>()".
      */
-    protected Collection<Method> getEntityCallbacks(Class managedClass) {
+    protected Collection<Method> getEntityCallbacks(Class<?> managedClass) {
 
         Collection<Method> callbacks = new ArrayList<Method>(3);
 
@@ -351,7 +351,7 @@
                 continue;
             }
 
-            Class[] params = methods[i].getParameterTypes();
+            Class<?>[] params = methods[i].getParameterTypes();
             if (params.length != 0) {
                 continue;
             }
@@ -386,7 +386,7 @@
 
     final class AnnotationContext implements AnnotationProcessorStack {
 
-        LinkedList stack = new LinkedList();
+        LinkedList<Object> stack = new LinkedList<Object>();
         JpaClassDescriptor classDescriptor;
         JpaPropertyDescriptor propertyDescriptor;
 
@@ -427,7 +427,7 @@
 
         public void recordConflict(
                 AnnotatedElement element,
-                Class annotatedType,
+                Class<?> annotatedType,
                 String message) {
 
             StringBuilder buffer = new StringBuilder();

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapLoader.java Sun Dec 16 13:32:53 2007
@@ -145,7 +145,7 @@
 
         EntityMapMergeProcessor merger = new EntityMapMergeProcessor(context);
 
-        Set loadedLocations = new HashSet();
+        Set<String> loadedLocations = new HashSet<String>();
         EntityMapXMLLoader loader = new EntityMapXMLLoader(
                 context.getTempClassLoader(),
                 false);
@@ -187,7 +187,7 @@
      */
     protected void loadFromAnnotations(PersistenceUnitInfo persistenceUnit) {
 
-        Map<String, Class> managedClassMap = new HashMap<String, Class>();
+        Map<String, Class<?>> managedClassMap = new HashMap<String, Class<?>>();
 
         // must use Unit class loader to prevent loading an un-enahnced class in the
         // app ClassLoader
@@ -198,7 +198,7 @@
         if (explicitClasses != null) {
             for (String className : explicitClasses) {
 
-                Class managedClass;
+                Class<?> managedClass;
                 try {
                     managedClass = Class.forName(className, true, loader);
                 }
@@ -219,7 +219,7 @@
                     continue;
                 }
 
-                Class managedClass;
+                Class<?> managedClass;
                 try {
                     managedClass = Class.forName(className, true, loader);
                 }
@@ -239,7 +239,7 @@
 
             EntityMapAnnotationLoader annotationLoader = new EntityMapAnnotationLoader(
                     context);
-            for (Class managedClass : managedClassMap.values()) {
+            for (Class<?> managedClass : managedClassMap.values()) {
                 annotationLoader.loadClassMapping(managedClass);
             }
         }

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaClassDescriptor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaClassDescriptor.java?rev=604714&r1=604713&r2=604714&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaClassDescriptor.java (original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/map/JpaClassDescriptor.java Sun Dec 16 13:32:53 2007
@@ -86,7 +86,7 @@
 
     /**
      * Returns descriptor matching the property name. If the underlying entity map uses
-     * FIELD access, a descritor is looked up in the list of class fields, if it uses
+     * FIELD access, a descriptor is looked up in the list of class fields, if it uses
      * PROPERTY access - descriptor is looked up in the list of class properties.
      */
     public JpaPropertyDescriptor getProperty(String name) {