db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r209662 - in /incubator/jdo/trunk: core20/src/java/org/apache/jdo/impl/model/jdo/xml/ enhancer20/ enhancer20/src/java/org/apache/jdo/impl/enhancer/core/ enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ enhancer20/src/java/org/apa...
Date Thu, 07 Jul 2005 22:16:17 GMT
Author: mbo
Date: Thu Jul  7 15:16:14 2005
New Revision: 209662

URL: http://svn.apache.org/viewcvs?rev=209662&view=rev
Log:
- Change enhancer20 dependency from api11 to api20.
- The enhancer generates PC methods doIsDetached, jdoGetVersion and 
jdoNewObjectIdInstance taking Object. The implementation is not yet done, 
the generated methods throw an UnsupportedOperationException.
- The JDOModel XML parser does not yet support all the JDO2 elements and 
attributes. This change comments out the exception thrown by XML parser
when detecting unknown attribute.

Modified:
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java
    incubator/jdo/trunk/enhancer20/project.properties
    incubator/jdo/trunk/enhancer20/project.xml
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Augmenter.java
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Builder.java
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/EnhancerConstants.java
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ImplHelper.java
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/Main.java
    incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/util/AugmentationTest.java

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/xml/JDOHandlerImpl.java
Thu Jul  7 15:16:14 2005
@@ -212,6 +212,8 @@
                     }
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<class>", //NOI18N
                                 name, value)); 
@@ -219,6 +221,10 @@
                         logger.trace("Throwing exception in " +  //NOI18N
                                      "JDOHandlerImpl.start_class:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<class>", name, value)); //NOI18N
                 }
             }
         }
@@ -303,6 +309,8 @@
                         Boolean.valueOf(value).booleanValue());
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<field>", //NOI18N
                                 name, value)); 
@@ -310,6 +318,10 @@
                         logger.trace("Throwing exception in " + //NOI18N
                                      "JDOHandlerImpl.start_field:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<field>", name, value)); //NOI18N
                 }
             }
         }
@@ -369,6 +381,8 @@
                         Boolean.valueOf(value).booleanValue());
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<collection>", //NOI18N
                                 name, value)); 
@@ -376,6 +390,10 @@
                         logger.trace("Throwing exception in " + //NOI18N
                                      "JDOHandlerImpl.start_collection:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<collection>", name, value)); //NOI18N
                 }
             }
         }
@@ -432,6 +450,8 @@
                         Boolean.valueOf(value).booleanValue());
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<array>", //NOI18N
                                 name, value)); 
@@ -439,6 +459,10 @@
                         logger.trace("Throwing exception in " + //NOI18N
                                      "JDOHandlerImpl.start_array:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<array>", name, value)); //NOI18N
                 }
             }
         }
@@ -504,6 +528,8 @@
                         Boolean.valueOf(value).booleanValue());
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<map>", //NOI18N
                                 name, value)); 
@@ -511,6 +537,10 @@
                         logger.trace("Throwing exception in " + //NOI18N
                                      "JDOHandlerImpl.start_map:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<map>", name, value)); //NOI18N
                 }
             }
         }
@@ -573,6 +603,8 @@
                     jdoExtension.setValue(value);
                 }
                 else {
+                    /* JDO2 metadata not yet fully supported => 
+                       do not throw exception now
                     SAXException e = new SAXException(
                         msg.msg("EXC_UnknownAttribute", "<extension>", //NOI18N
                                 name, value));
@@ -580,6 +612,10 @@
                         logger.trace("Throwing exception in " + //NOI18N
                                      "JDOHandlerImpl.start_extension:", e); //NOI18N
                     throw e;
+                    */
+                    if (trace)
+                        logger.trace(msg.msg("EXC_UnknownAttribute", //NOI18N
+                                             "<extension>", name, value)); //NOI18N
                 }
             }
         }

Modified: incubator/jdo/trunk/enhancer20/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/project.properties?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/project.properties (original)
+++ incubator/jdo/trunk/enhancer20/project.properties Thu Jul  7 15:16:14 2005
@@ -17,7 +17,7 @@
 maven.checkstyle.properties = ${basedir}/../jdo_checks.xml
 
 # dependencies
-jdo.jdoapi.jarfile = ${pom.getDependencyPath('apache-jdo:jdo1-api')}
+jdo.jdoapi.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-api')}
 jdo.jdocore.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-core')}
 logging.jarfile = ${pom.getDependencyPath('commons-logging')}
 xmlparser = 

Modified: incubator/jdo/trunk/enhancer20/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/project.xml?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/project.xml (original)
+++ incubator/jdo/trunk/enhancer20/project.xml Thu Jul  7 15:16:14 2005
@@ -37,7 +37,7 @@
     <dependencies>
         <dependency>
             <groupId>apache-jdo</groupId>
-            <artifactId>jdo1-api</artifactId>
+            <artifactId>jdo2-api</artifactId>
             <version>SNAPSHOT</version>
         </dependency>
         <dependency>

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Augmenter.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Augmenter.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Augmenter.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Augmenter.java
Thu Jul  7 15:16:14 2005
@@ -296,11 +296,13 @@
         builder.addJDOIsNewMethod();
         builder.addJDOIsDeletedMethod();
         builder.addJDOIsDirtyMethod();        
+        builder.addJDOIsDetachedMethod();       
         builder.addJDOMakeDirtyMethod();
         builder.addJDOPreSerializeMethod();
         builder.addJDOGetPersistenceManagerMethod();
         builder.addJDOGetObjectIdMethod();
         builder.addJDOGetTransactionalObjectIdMethod();
+        builder.addJDOGetVersionMethod();
         builder.addJDOReplaceStateManager();
         builder.addJDOProvideFieldsMethod();
         builder.addJDOReplaceFieldsMethod();
@@ -340,7 +342,7 @@
         if (analyzer.isAugmentableAsRoot()
             || analyzer.getKeyClassName() != null) {
             builder.addJDONewObjectIdInstanceMethod();
-            builder.addJDONewObjectIdInstanceStringMethod();
+            builder.addJDONewObjectIdInstanceObjectMethod();
             builder.addJDOCopyKeyFieldsToObjectIdMethod();
             builder.addJDOCopyKeyFieldsFromObjectIdMethod();
             builder.addJDOCopyKeyFieldsToObjectIdOIFSMethod();

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Builder.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Builder.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Builder.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/Builder.java
Thu Jul  7 15:16:14 2005
@@ -993,6 +993,17 @@
     }
     
     /**
+     * Build an interrogative method for the class.
+     */
+    public void addJDOIsDetachedMethod()
+    {
+        // TODO: generate real method body
+        addNotYetImplementedMethod(JDO_PC_jdoIsDetached_Name,
+                                   JDO_PC_jdoIsDetached_Sig,
+                                   JDO_PC_jdoIsDetached_Mods);
+    }
+    
+    /**
      * Build an interrogative method named methodName for the class.
      *
      * public boolean isXXX() {
@@ -1097,6 +1108,17 @@
 
     /**
      * Build an object query method for the class.
+     */
+    public void addJDOGetVersionMethod()
+    {
+        // TODO: generate real method body
+        addNotYetImplementedMethod(JDO_PC_jdoGetVersion_Name,
+                                   JDO_PC_jdoGetVersion_Sig,
+                                   JDO_PC_jdoGetVersion_Mods);
+    }
+
+    /**
+     * Build an object query method for the class.
      *
      * public final XXX jdoGetYYY()
      * {
@@ -3007,67 +3029,19 @@
     /**
      * Build the jdoNewObjectIdInstance method for the class.
      *
-     * public java.lang.Object jdoNewObjectIdInstance(String str)
+     * public java.lang.Object jdoNewObjectIdInstance(Object o)
      * {
-     *     return new XXX(str);
+     *     throw new UnsupportedOperationException(
+     *        "Method jdoNewObjectIdInstance not yet implemented");
      * }
      */
-    public void addJDONewObjectIdInstanceStringMethod()
+    public void addJDONewObjectIdInstanceObjectMethod()
     {
-        final String methodName = JDO_PC_jdoNewObjectIdInstance_String_Name;
-        final String methodSig = JDO_PC_jdoNewObjectIdInstance_String_Sig;
-        final int accessFlags = JDO_PC_jdoNewObjectIdInstance_String_Mods;
-        final ExceptionsAttribute exceptAttr = null;
-
-        // begin of method body
-        final InsnTarget begin = new InsnTarget();
-        Insn insn = begin;
-
-        // generate empty method in case of datastore identity
-        final String keyClassName = analyzer.getKeyClassName();
-        if (keyClassName == null){
-            // end of method body
-            insn = insn.append(Insn.create(opc_aconst_null));
-            insn = insn.append(Insn.create(opc_areturn));
-
-            final CodeAttribute codeAttr
-                = new CodeAttribute(getCodeAttributeUtf8(),
-                                    1, // maxStack
-                                    2, // maxLocals
-                                    begin,
-                                    new ExceptionTable(),
-                                    new AttributeVector());
-            augmenter.addMethod(methodName, methodSig, accessFlags,
-                                codeAttr, exceptAttr);
-            return;
-        }
-        affirm(keyClassName != null);
-
-        // push a newly created an instance of this class
-        insn = insn.append(
-            Insn.create(opc_new,
-                        pool.addClass(keyClassName)));
-        insn = insn.append(Insn.create(opc_dup));
-        insn = insn.append(Insn.create(opc_aload_1));
-        insn = insn.append(
-            Insn.create(opc_invokespecial,
-                        pool.addMethodRef(
-                            keyClassName,
-                            NameHelper.constructorName(),
-                            NameHelper.constructorSig(JAVA_String_Sig))));
-
-        // end of method body
-        insn = insn.append(Insn.create(opc_areturn));
-
-        final CodeAttribute codeAttr
-            = new CodeAttribute(getCodeAttributeUtf8(),
-                                3, // maxStack
-                                2, // maxLocals
-                                begin,
-                                new ExceptionTable(),
-                                new AttributeVector());
-        augmenter.addMethod(methodName, methodSig, accessFlags,
-                            codeAttr, exceptAttr);
+        final String methodName = JDO_PC_jdoNewObjectIdInstance_Object_Name;
+        final String methodSig = JDO_PC_jdoNewObjectIdInstance_Object_Sig;
+        final int accessFlags = JDO_PC_jdoNewObjectIdInstance_Object_Mods;
+        // TODO: generate real method body
+        addNotYetImplementedMethod(methodName, methodSig, accessFlags);
     }
 
     // ----------------------------------------------------------------------
@@ -4713,4 +4687,40 @@
         augmenter.addMethod(methodName, methodSig, accessFlags,
                             codeAttr, exceptAttr);
     }
+
+    /**
+     * Builds a method throwing an UnsupportedOperationException.
+     *
+     * public void XXX() {
+     *    throw new UnsupportedOperationException(
+     *        "Method XXX not yet implemented");
+     * }
+     */
+    public void addNotYetImplementedMethod(final String methodName,
+                                           final String methodSig,
+                                           final int accessFlags)
+    {
+        // assumed nonstatic call; otherwise subtract 'this' from maxStack
+        affirm((accessFlags & ACCStatic) == 0);
+        final ExceptionsAttribute exceptAttr = null;
+
+        // begin of method body
+        final InsnTarget begin = new InsnTarget();
+        Insn insn = begin;
+
+        insn = appendThrowJavaException(
+            insn, JAVA_UnsupportedOperationException_Path, 
+            "Method " + methodName + " not yet implemented");
+
+        final CodeAttribute codeAttr
+            = new CodeAttribute(getCodeAttributeUtf8(),
+                                3, // maxStack
+                                countMethodArgWords(methodSig), // maxLocals
+                                begin,
+                                new ExceptionTable(),
+                                new AttributeVector());
+        augmenter.addMethod(methodName, methodSig, accessFlags,
+                            codeAttr, exceptAttr);
+    }
+    
 }

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/EnhancerConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/EnhancerConstants.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/EnhancerConstants.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/core/EnhancerConstants.java
Thu Jul  7 15:16:14 2005
@@ -386,6 +386,15 @@
     String JAVA_IllegalArgumentException_Type
         = NameHelper.typeForPath(JAVA_IllegalArgumentException_Path);
 
+    String JAVA_UnsupportedOperationException_Name
+        = "UnsupportedOperationException";
+    String JAVA_UnsupportedOperationException_Path
+        = NameHelper.javaLangPathForType(JAVA_UnsupportedOperationException_Name);
+    String JAVA_UnsupportedOperationException_Sig
+        = NameHelper.sigForPath(JAVA_UnsupportedOperationException_Path);
+    String JAVA_UnsupportedOperationException_Type
+        = NameHelper.typeForPath(JAVA_UnsupportedOperationException_Path);
+
     String JAVA_IllegalStateException_Name
         = "IllegalStateException";
     String JAVA_IllegalStateException_Path
@@ -707,6 +716,14 @@
     int JDO_PC_jdoGetTransactionalObjectId_Mods
         = (ACCPublic | ACCFinal);
 
+    // Object jdoGetVersion()
+    String JDO_PC_jdoGetVersion_Name
+        = "jdoGetVersion";
+    String JDO_PC_jdoGetVersion_Sig
+        = "()" + JAVA_Object_Sig;
+    int JDO_PC_jdoGetVersion_Mods
+        = (ACCPublic | ACCFinal);
+
     // boolean jdoIsPersistent()
     String JDO_PC_jdoIsPersistent_Name
         = "jdoIsPersistent";
@@ -747,6 +764,14 @@
     int JDO_PC_jdoIsDirty_Mods
         = (ACCPublic | ACCFinal);
 
+    // boolean jdoIsDetached()
+    String JDO_PC_jdoIsDetached_Name
+        = "jdoIsDetached";
+    String JDO_PC_jdoIsDetached_Sig
+        = "()Z";
+    int JDO_PC_jdoIsDetached_Mods
+        = (ACCPublic | ACCFinal);
+
     // void jdoMakeDirty(String)
     String JDO_PC_jdoMakeDirty_Name
         = "jdoMakeDirty";
@@ -887,12 +912,12 @@
     int JDO_PC_jdoNewObjectIdInstance_Mods
         = (ACCPublic);
 
-    // Object jdoNewObjectIdInstance(String)
-    String JDO_PC_jdoNewObjectIdInstance_String_Name
+    // Object jdoNewObjectIdInstance(Object)
+    String JDO_PC_jdoNewObjectIdInstance_Object_Name
         = "jdoNewObjectIdInstance";
-    String JDO_PC_jdoNewObjectIdInstance_String_Sig
-        = "(" + JAVA_String_Sig + ")" + JAVA_Object_Sig;
-    int JDO_PC_jdoNewObjectIdInstance_String_Mods
+    String JDO_PC_jdoNewObjectIdInstance_Object_Sig
+        = "(" + JAVA_Object_Sig + ")" + JAVA_Object_Sig;
+    int JDO_PC_jdoNewObjectIdInstance_Object_Mods
         = (ACCPublic);
 
     // void jdoCopyKeyFieldsToObjectId(Object)

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ImplHelper.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ImplHelper.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ImplHelper.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/ImplHelper.java
Thu Jul  7 15:16:14 2005
@@ -104,6 +104,8 @@
     = "jdoGetObjectId";
     static final String METHODNAME_JDO_GET_TRANSACTIONAL_OBJECT_ID
     = "jdoGetTransactionalObjectId";
+    static final String METHODNAME_JDO_GET_VERSION
+    = "jdoGetVersion";
     static final String METHODNAME_JDO_IS_PERSISTENT
     = "jdoIsPersistent";
     static final String METHODNAME_JDO_IS_TRANSACTIONAL
@@ -114,6 +116,8 @@
     = "jdoIsDirty";
     static final String METHODNAME_JDO_IS_DELETED
     = "jdoIsDeleted";
+    static final String METHODNAME_JDO_IS_DETACHED
+    = "jdoIsDetached";
     static final String METHODNAME_JDO_COPY_KEY_FIELDS_TO_OID
     = "jdoCopyKeyFieldsToObjectId";
     static final String METHODNAME_JDO_COPY_KEY_FIELDS_FROM_OID
@@ -385,14 +389,12 @@
     }
 
     static List getJDONewOidInstanceImpl(String oidclassname,
-                                         String str)
+                                         String o)
     {
         final List impl = new ArrayList(5);
-        if (oidclassname == null) {
-            impl.add("return null;");
-        } else {
-            impl.add("return new " + oidclassname + "(" + str + ");");
-        }
+        // TODO: generate real method body
+        String msg = "Method jdoNewObjectIdInstance not yet supported";
+        impl.add("throw new UnsupportedOperationException(\"" + msg + "\");");
         return impl;
     }
 
@@ -933,6 +935,14 @@
             }
         }
         impl.add("return true;");
+        return impl;
+    }
+
+    static List getNotYetImplemented(String methodName)
+    {
+        final List impl = new ArrayList(5);
+        String msg = "Method " + methodName + " not yet implemented";
+        impl.add("throw new UnsupportedOperationException(\"" + msg + "\");");
         return impl;
     }
 

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/Main.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/Main.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/Main.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/generator/Main.java
Thu Jul  7 15:16:14 2005
@@ -615,6 +615,16 @@
             ImplHelper.getJDOStateManagerObjectDelegationImpl("getTransactionalObjectId(this)"),
             ImplHelper.COMMENT_ENHANCER_ADDED);
 
+        // jdoGetVersion
+        writer.writeMethod(
+            ImplHelper.METHODNAME_JDO_GET_VERSION,
+            Modifier.PUBLIC | Modifier.FINAL,
+            Object.class.getName(), null, null, null,
+            // TODO: generate real method body
+            ImplHelper.getNotYetImplemented(
+                ImplHelper.METHODNAME_JDO_GET_VERSION),
+            ImplHelper.COMMENT_ENHANCER_ADDED);
+
         // is-methods
         writer.writeMethod(
             ImplHelper.METHODNAME_JDO_IS_PERSISTENT,
@@ -651,6 +661,15 @@
             ImplHelper.getJDOStateManagerBooleanDelegationImpl("isDirty(this)"),
             ImplHelper.COMMENT_ENHANCER_ADDED);
 
+        writer.writeMethod(
+            ImplHelper.METHODNAME_JDO_IS_DETACHED,
+            Modifier.PUBLIC | Modifier.FINAL,
+            "boolean", null, null, null,
+            // TODO: generate real method body
+            ImplHelper.getNotYetImplemented(
+                ImplHelper.METHODNAME_JDO_IS_DETACHED),
+            ImplHelper.COMMENT_ENHANCER_ADDED);
+
         // makeDirty
         writer.writeMethod(
             ImplHelper.METHODNAME_JDO_MAKE_DIRTY,
@@ -922,11 +941,11 @@
             ImplHelper.METHODNAME_JDO_NEW_OID_INSTANCE,
             Modifier.PUBLIC,
             Object.class.getName(),
-            new String[]{ "str" },
-            new String[]{ "String" },
+            new String[]{ "o" },
+            new String[]{ "Object" },
             null,
             ImplHelper.getJDONewOidInstanceImpl(oidClassName,
-                                                "str"),
+                                                "o"),
             ImplHelper.COMMENT_ENHANCER_ADDED);
 
         // jdoCopyKeyFieldsTo/FromOid

Modified: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/util/AugmentationTest.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/util/AugmentationTest.java?rev=209662&r1=209661&r2=209662&view=diff
==============================================================================
--- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/util/AugmentationTest.java
(original)
+++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/util/AugmentationTest.java
Thu Jul  7 15:16:14 2005
@@ -331,7 +331,7 @@
         affirm(ERROR < NEGATIVE && NEGATIVE < AFFIRMATIVE);
         affirm(classObject);
 
-        final int nofFeatures = 16;
+        final int nofFeatures = 18;
         final int[] r = new int[nofFeatures];
         {
             int i = 0;
@@ -388,6 +388,13 @@
             r[i++] = hasMethod(
                 out,
                 Modifier.PUBLIC | Modifier.FINAL,
+                Object.class,
+                "jdoGetVersion",
+                new Class[]{});
+
+            r[i++] = hasMethod(
+                out,
+                Modifier.PUBLIC | Modifier.FINAL,
                 boolean.class,
                 "jdoIsPersistent",
                 new Class[]{});
@@ -415,6 +422,12 @@
                 boolean.class,
                 "jdoIsDirty",
                 new Class[]{});
+            r[i++] = hasMethod(
+                out,
+                Modifier.PUBLIC | Modifier.FINAL,
+                boolean.class,
+                "jdoIsDetached",
+                new Class[]{});
 
             r[i++] = hasMethod(
                 out,
@@ -593,7 +606,7 @@
                 Modifier.PUBLIC,
                 Object.class,
                 "jdoNewObjectIdInstance",
-                new Class[]{String.class});
+                new Class[]{Object.class});
 
             r[i++] = hasMethod(
                 out,



Mime
View raw message