Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 88411 invoked from network); 19 Mar 2005 05:16:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Mar 2005 05:16:53 -0000 Received: (qmail 93727 invoked by uid 500); 19 Mar 2005 05:16:53 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Delivered-To: moderator for jdo-commits@db.apache.org Received: (qmail 90794 invoked by uid 99); 19 Mar 2005 01:13:23 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Message-ID: <20050319010558.28031.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sat, 19 Mar 2005 01:05:58 -0000 Subject: svn commit: r158176 [9/79] - in incubator/jdo/trunk/ri11: ./ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jdo/ src/java/org/apache/jdo/ejb/ src/java/org/apache/jdo/enhancer/ src/java/org/apache/jdo/impl/ src/java/org/apache/jdo/impl/enhancer/ src/java/org/apache/jdo/impl/enhancer/classfile/ src/java/org/apache/jdo/impl/enhancer/core/ src/java/org/apache/jdo/impl/enhancer/generator/ src/java/org/apache/jdo/impl/enhancer/meta/ src/java/org/apache/jdo/impl/enhancer/meta/model/ src/java/org/apache/jdo/impl/enhancer/meta/prop/ src/java/org/apache/jdo/impl/enhancer/meta/util/ src/java/org/apache/jdo/impl/enhancer/util/ src/java/org/apache/jdo/impl/fostore/ src/java/org/apache/jdo/impl/jdoql/ src/java/org/apache/jdo/impl/jdoql/jdoqlc/ src/java/org/apache/jdo/impl/jdoql/scope/ src/java/org/apache/jdo/impl/jdoql/tree/ src/java/org/apache/jdo/impl/model/ src/java/org/apache/jdo/impl/model/java/ src/java/org/apache/jdo/impl/model/java/runtime/ src/java/org/apache/jdo/impl/model/jdo/ src/java/org/apache/jdo/impl/model/jdo/caching/ src/java/org/apache/jdo/impl/model/jdo/util/ src/java/org/apache/jdo/impl/model/jdo/xml/ src/java/org/apache/jdo/impl/pm/ src/java/org/apache/jdo/impl/sco/ src/java/org/apache/jdo/impl/state/ src/java/org/apache/jdo/jdoql/ src/java/org/apache/jdo/jdoql/tree/ src/java/org/apache/jdo/model/ src/java/org/apache/jdo/model/java/ src/java/org/apache/jdo/model/jdo/ src/java/org/apache/jdo/pm/ src/java/org/apache/jdo/sco/ src/java/org/apache/jdo/state/ src/java/org/apache/jdo/store/ src/java/org/apache/jdo/util/ test/ test/conf/ test/enhancer/ test/enhancer/sempdept/ test/enhancer/sempdept/src/ test/enhancer/sempdept/src/empdept/ test/fsuid2/ test/fsuid2/org/ test/fsuid2/org/apache/ test/fsuid2/org/apache/jdo/ test/fsuid2/org/apache/jdo/pc/ test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/jdo/ test/java/org/apache/jdo/impl/ test/java/org/apache/jdo/impl/fostore/ test/java/org/apache/jdo/pc/ test/java/org/apache/jdo/pc/appid/ test/java/org/apache/jdo/pc/empdept/ test/java/org/apache/jdo/pc/serializable/ test/java/org/apache/jdo/pc/xempdept/ test/java/org/apache/jdo/test/ test/java/org/apache/jdo/test/query/ test/java/org/apache/jdo/test/util/ test/jdo/ test/jdo/org/ test/jdo/org/apache/ test/jdo/org/apache/jdo/ test/jdo/org/apache/jdo/pc/ test/jdo/org/apache/jdo/pc/appid/ test/jdo/org/apache/jdo/pc/empdept/ test/jdo/org/apache/jdo/pc/serializable/ test/jdo/org/apache/jdo/pc/xempdept/ xdocs/ To: jdo-commits@db.apache.org From: mbo@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/impl/enhancer/class= file/VMOp.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/ap= ache/jdo/impl/enhancer/classfile/VMOp.java?view=3Dauto&rev=3D158176 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/impl/enhancer/classfil= e/VMOp.java (added) +++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/impl/enhancer/classfil= e/VMOp.java Fri Mar 18 17:02:29 2005 @@ -0,0 +1,546 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed 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=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + + +package org.apache.jdo.impl.enhancer.classfile; + +/** + * Description of the VM opcodes + */ +public class VMOp implements VMConstants { + /* The opcode value */ + private int opcodeValue; + + /* The name of the opcode */ + private String opcodeName; + + /* The number of stack argument words */ + private int stackArgs; + + /* The number of stack result words */ + private int stackResults; + + /* The "type" signature of the stack argument words */ + private String stackArgTypes; + + /* The "type" signature of the stack result words */ + private String stackResultTypes; + + /* public accessors */ + + /** + * Return the opcode value=20 + */ + final public int opcode() { + return opcodeValue; + } + + /** + * Return the opcode name + */ + final public String name() { + return opcodeName; + } + + /** + * Return the number of words of stack arguments expected by this oper= ation. + * If the number is not a fixed value, return -1; + */ + final public int nStackArgs() { + return stackArgs; + } + + /** + * Return the number of words of stack results produced by this operat= ion. + * If the number is not a fixed value, return -1; + */ + final public int nStackResults() { + return stackResults; + } + + /** + * Return the type descriptor for the stack arguments to the operation. + */ + final public String argTypes() { + return stackArgTypes; + } + + /** + * Return the type descriptor for the stack results of the operation. + */ + final public String resultTypes() { + return stackResultTypes; + } + + /** + * constructor for a VMOp + */ + =20 + public VMOp(int theOpcode, String theOpcodeName, int nArgs, int nResul= ts, + String argDescr, String resultDescr) { + opcodeValue =3D theOpcode; + opcodeName =3D theOpcodeName; + stackArgs =3D nArgs; + stackResults =3D nResults; + stackArgTypes =3D argDescr; + stackResultTypes =3D resultDescr; + } + + /* package local methods */ + + static VMOp[] ops =3D { + /* | no change*/ + new VMOp(opc_nop, "nop", 0, 0, "", ""), + /* | ... -> ..., null */ + new VMOp(opc_aconst_null, "aconst_null", 0, 1, "", "A"), + /* | ... -> ..., -1 */ + new VMOp(opc_iconst_m1, "iconst_m1", 0, 1, "", "I"), + /* | ... -> ..., 0 */ + new VMOp(opc_iconst_0, "iconst_0", 0, 1, "", "I"), + /* | ... -> ..., 1 */ + new VMOp(opc_iconst_1, "iconst_1", 0, 1, "", "I"), + /* | ... -> ..., 2 */ + new VMOp(opc_iconst_2, "iconst_2", 0, 1, "", "I"), + /* | ... -> ..., 3 */ + new VMOp(opc_iconst_3, "iconst_3", 0, 1, "", "I"), + /* | ... -> ..., 4 */ + new VMOp(opc_iconst_4, "iconst_4", 0, 1, "", "I"), + /* | ... -> ..., 5 */ + new VMOp(opc_iconst_5, "iconst_5", 0, 1, "", "I"), + /* | ... -> ..., 0, 0 */ + new VMOp(opc_lconst_0, "lconst_0", 0, 2, "", "J"), + /* | ... -> ..., 1, 1 */ + new VMOp(opc_lconst_1, "lconst_1", 0, 2, "", "J"), + /* | ... -> ..., 0.0f */ + new VMOp(opc_fconst_0, "fconst_0", 0, 1, "", "F"), + /* | ... -> ..., 1.0f */ + new VMOp(opc_fconst_1, "fconst_1", 0, 1, "", "F"), + /* | ... -> ..., 2.0f */ + new VMOp(opc_fconst_2, "fconst_2", 0, 1, "", "F"), + /* | ... -> ..., 0.0, 0.0 */ + new VMOp(opc_dconst_0, "dconst_0", 0, 2, "", "D"), + /* | ... -> ..., 1.0, 1.0 */ + new VMOp(opc_dconst_1, "dconst_1", 0, 2, "", "D"), + /* byte1 | ... =3D> ..., value */ + new VMOp(opc_bipush, "bipush", 0, 1, "", "I"), + /* byte1 byte2 | ... =3D> ..., value */ + new VMOp(opc_sipush, "sipush", 0, 1, "", "I"), + /* indexbyte1 | ... =3D> ..., item */ + new VMOp(opc_ldc, "ldc", 0, 1, "", "W"), + /* indexbyte1 indexbyte2 | ... =3D> ..., item */ + new VMOp(opc_ldc_w, "ldc_w", 0, 1, "", "W"), + /* indexbyte1 indexbyte2 | ... =3D> ..., item1, item2 */ + new VMOp(opc_ldc2_w, "ldc2_w", 0, 2, "", "X"), + /* vindex | ... =3D> ..., value */ + new VMOp(opc_iload, "iload", 0, 1, "", "I"), + /* vindex | ... =3D> ..., value, value */ + new VMOp(opc_lload, "lload", 0, 2, "", "J"), + /* vindex | ... =3D> ..., value */ + new VMOp(opc_fload, "fload", 0, 1, "", "F"), + /* vindex | ... =3D> ..., value, value */ + new VMOp(opc_dload, "dload", 0, 2, "", "D"), + /* vindex | ... =3D> ..., value */ + new VMOp(opc_aload, "aload", 0, 1, "", "A"), + /* | ... =3D> ..., value<0> */ + new VMOp(opc_iload_0, "iload_0", 0, 1, "", "I"), + /* | ... =3D> ..., value<1> */ + new VMOp(opc_iload_1, "iload_1", 0, 1, "", "I"), + /* | ... =3D> ..., value<2> */ + new VMOp(opc_iload_2, "iload_2", 0, 1, "", "I"), + /* | ... =3D> ..., value<3> */ + new VMOp(opc_iload_3, "iload_3", 0, 1, "", "I"), + /* | ... =3D> ..., value<0>, value<0> */ + new VMOp(opc_lload_0, "lload_0", 0, 2, "", "J"), + /* | ... =3D> ..., value<1>, value<1> */ + new VMOp(opc_lload_1, "lload_1", 0, 2, "", "J"), + /* | ... =3D> ..., value<2>, value<2> */ + new VMOp(opc_lload_2, "lload_2", 0, 2, "", "J"), + /* | ... =3D> ..., value<3>, value<3> */ + new VMOp(opc_lload_3, "lload_3", 0, 2, "", "J"), + /* | ... =3D> ..., value<0> */ + new VMOp(opc_fload_0, "fload_0", 0, 1, "", "F"), + /* | ... =3D> ..., value<1> */ + new VMOp(opc_fload_1, "fload_1", 0, 1, "", "F"), + /* | ... =3D> ..., value<2> */ + new VMOp(opc_fload_2, "fload_2", 0, 1, "", "F"), + /* | ... =3D> ..., value<3> */ + new VMOp(opc_fload_3, "fload_3", 0, 1, "", "F"), + /* | ... =3D> ..., value<0>, value<0> */ + new VMOp(opc_dload_0, "dload_0", 0, 2, "", "D"), + /* | ... =3D> ..., value<1>, value<1> */ + new VMOp(opc_dload_1, "dload_1", 0, 2, "", "D"), + /* | ... =3D> ..., value<2>, value<2> */ + new VMOp(opc_dload_2, "dload_2", 0, 2, "", "D"), + /* | ... =3D> ..., value<3>, value<3> */ + new VMOp(opc_dload_3, "dload_3", 0, 2, "", "D"), + /* | ... =3D> ..., value<0> */ + new VMOp(opc_aload_0, "aload_0", 0, 1, "", "A"), + /* | ... =3D> ..., value<1> */ + new VMOp(opc_aload_1, "aload_1", 0, 1, "", "A"), + /* | ... =3D> ..., value<2> */ + new VMOp(opc_aload_2, "aload_2", 0, 1, "", "A"), + /* | ... =3D> ..., value<3> */ + new VMOp(opc_aload_3, "aload_3", 0, 1, "", "A"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_iaload, "iaload", 2, 1, "AI", "I"), + /* | ..., arrayref, index =3D> ..., value, value */ + new VMOp(opc_laload, "laload", 2, 2, "AI", "J"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_faload, "faload", 2, 1, "AI", "F"), + /* | ..., arrayref, index =3D> ..., value, value */ + new VMOp(opc_daload, "daload", 2, 2, "AI", "D"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_aaload, "aaload", 2, 1, "AI", "A"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_baload, "baload", 2, 1, "AI", "I"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_caload, "caload", 2, 1, "AI", "I"), + /* | ..., arrayref, index =3D> ..., value */ + new VMOp(opc_saload, "saload", 2, 1, "AI", "I"), + /* vindex | ..., value =3D> ... */ + new VMOp(opc_istore, "istore", 1, 0, "I", ""), + /* vindex | ..., value, value =3D> ... */ + new VMOp(opc_lstore, "lstore", 2, 0, "J", ""), + /* vindex | ..., value =3D> ... */ + new VMOp(opc_fstore, "fstore", 1, 0, "F", ""), + /* vindex | ..., value, value =3D> ... */ + new VMOp(opc_dstore, "dstore", 2, 0, "D", ""), + /* vindex | ..., value =3D> ... */ + new VMOp(opc_astore, "astore", 1, 0, "A", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_istore_0, "istore_0", 1, 0, "I", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_istore_1, "istore_1", 1, 0, "I", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_istore_2, "istore_2", 1, 0, "I", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_istore_3, "istore_3", 1, 0, "I", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_lstore_0, "lstore_0", 2, 0, "J", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_lstore_1, "lstore_1", 2, 0, "J", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_lstore_2, "lstore_2", 2, 0, "J", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_lstore_3, "lstore_3", 2, 0, "J", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_fstore_0, "fstore_0", 1, 0, "F", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_fstore_1, "fstore_1", 1, 0, "F", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_fstore_2, "fstore_2", 1, 0, "F", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_fstore_3, "fstore_3", 1, 0, "F", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_dstore_0, "dstore_0", 2, 0, "D", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_dstore_1, "dstore_1", 2, 0, "D", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_dstore_2, "dstore_2", 2, 0, "D", ""), + /* | ..., value, value =3D> ... */ + new VMOp(opc_dstore_3, "dstore_3", 2, 0, "D", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_astore_0, "astore_0", 1, 0, "A", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_astore_1, "astore_1", 1, 0, "A", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_astore_2, "astore_2", 1, 0, "A", ""), + /* | ..., value =3D> ... */ + new VMOp(opc_astore_3, "astore_3", 1, 0, "A", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_iastore, "iastore", 3, 0, "AII", ""), + /* | ..., arrayref, index, value, value =3D> ... */ + new VMOp(opc_lastore, "lastore", 4, 0, "AIJ", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_fastore, "fastore", 3, 0, "AIF", ""), + /* | ..., arrayref, index, value, value =3D> ... */ + new VMOp(opc_dastore, "dastore", 4, 0, "AID", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_aastore, "aastore", 3, 0, "AIA", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_bastore, "bastore", 3, 0, "AII", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_castore, "castore", 3, 0, "AII", ""), + /* | ..., arrayref, index, value =3D> ... */ + new VMOp(opc_sastore, "sastore", 3, 0, "AII", ""), + /* | ..., any =3D> ... */ + new VMOp(opc_pop, "pop", 1, 0, "W", ""), + /* | ..., any1, any2 =3D> ... */ + new VMOp(opc_pop2, "pop2", 2, 0, "WW", ""), + /* | ..., any =3D> ..., any, any */ + new VMOp(opc_dup, "dup", 1, 2, "W", "WW"), + /* | ..., any1, any2 =3D> ..., any2, any1, any2 */ + new VMOp(opc_dup_x1, "dup_x1", 2, 3, "WW", "WWW"), + /* | ..., any1, any2, any3 =3D> ..., any3, any1, any2, any3 */ + new VMOp(opc_dup_x2, "dup_x2", 3, 4, "WWW", "WWWW"), + /* | ..., any1, any2 =3D> ..., any1, any2, any1, any2 */ + new VMOp(opc_dup2, "dup2", 2, 4, "WW", "WWWW"), + /* | ..., any1, any2, any3 =3D> ..., any2, any3, any1, any2, any3 = */ + new VMOp(opc_dup2_x1, "dup2_x1", 3, 5, "WWW", "WWWWW"), + /* | ..., any1, any2, any3, any4 =3D> ..., any3, any4, any1, any2,= any3, any4 */ + new VMOp(opc_dup2_x2, "dup2_x2", 4, 6, "WWWW", "WWWWWW"), + /* | ..., any1, any2 =3D> ..., any2, any1 */ + new VMOp(opc_swap, "swap", 2, 2, "WW", "WW"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_iadd, "iadd", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_ladd, "ladd", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_fadd, "fadd", 2, 1, "FF", "F"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_dadd, "dadd", 4, 2, "DD", "D"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_isub, "isub", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_lsub, "lsub", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_fsub, "fsub", 2, 1, "FF", "F"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_dsub, "dsub", 4, 2, "DD", "D"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_imul, "imul", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_lmul, "lmul", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_fmul, "fmul", 2, 1, "FF", "F"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_dmul, "dmul", 4, 2, "DD", "D"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_idiv, "idiv", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_ldiv, "ldiv", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_fdiv, "fdiv", 2, 1, "FF", "F"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_ddiv, "ddiv", 4, 2, "DD", "D"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_irem, "irem", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_lrem, "lrem", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_frem, "frem", 2, 1, "FF", "F"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_drem, "drem", 4, 2, "DD", "D"), + /* | ..., value =3D> ..., result */ + new VMOp(opc_ineg, "ineg", 1, 1, "I", "I"), + /* | ..., value, value =3D> ..., result, result */ + new VMOp(opc_lneg, "lneg", 2, 2, "J", "J"), + /* | ..., value =3D> ..., result */ + new VMOp(opc_fneg, "fneg", 1, 1, "F", "F"), + /* | ..., value, value =3D> ..., result, result */ + new VMOp(opc_dneg, "dneg", 2, 2, "D", "D"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_ishl, "ishl", 2, 1, "II", "I"), + /* | ..., value1, value1, value2 =3D> ..., result */ + new VMOp(opc_lshl, "lshl", 3, 2, "JI", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_ishr, "ishr", 2, 1, "II", "I"), + /* | ..., value1, value1, value2 =3D> ..., result, = result */ + new VMOp(opc_lshr, "lshr", 3, 2, "JI", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_iushr, "iushr", 2, 1, "II", "I"), + /* | ..., value1, value1, value2 =3D> ..., result, = result */ + new VMOp(opc_lushr, "lushr", 3, 2, "JI", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_iand, "iand", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_land, "land", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_ior, "ior", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_lor, "lor", 4, 2, "JJ", "J"), + /* | ..., value1, value2 =3D> ..., result */ + new VMOp(opc_ixor, "ixor", 2, 1, "II", "I"), + /* | ..., value1, value1, value2, value2 =3D> = .=2E., result, result */ + new VMOp(opc_lxor, "lxor", 4, 2, "JJ", "J"), + /* vindex, const | no change */ + new VMOp(opc_iinc, "iinc", 0, 0, "", ""), + /* | ..., value =3D> ..., value, value */ + new VMOp(opc_i2l, "i2l", 1, 2, "I", "J"), + /* | ..., value =3D> ..., value */ + new VMOp(opc_i2f, "i2f", 1, 1, "I", "F"), + /* | ..., value =3D> ..., value, value */ + new VMOp(opc_i2d, "i2d", 1, 2, "I", "D"), + /* | ..., value, value =3D> ..., value */ + new VMOp(opc_l2i, "l2i", 2, 1, "J", "I"), + /* | ..., value, value =3D> ..., value */ + new VMOp(opc_l2f, "l2f", 2, 1, "J", "F"), + /* | ..., value, value =3D> ..., value, value = */ + new VMOp(opc_l2d, "l2d", 2, 2, "J", "D"), + /* | ..., value =3D> ..., value */ + new VMOp(opc_f2i, "f2i", 1, 1, "F", "I"), + /* | ..., value =3D> ..., value, value */ + new VMOp(opc_f2l, "f2l", 1, 2, "F", "J"), + /* | ..., value =3D> ..., value, value */ + new VMOp(opc_f2d, "f2d", 1, 2, "F", "D"), + /* | ..., value, value =3D> ..., value */ + new VMOp(opc_d2i, "d2i", 2, 1, "D", "I"), + /* | ..., value, value =3D> ..., value, value = */ + new VMOp(opc_d2l, "d2l", 2, 2, "D", "J"), + /* | ..., value, value =3D> ..., value */ + new VMOp(opc_d2f, "d2f", 2, 1, "D", "F"), + /* | ..., value =3D> ..., result */ + new VMOp(opc_i2b, "i2b", 1, 1, "I", "I"), + /* | ..., value =3D> ..., result */ + new VMOp(opc_i2c, "i2c", 1, 1, "I", "I"), + /* | ..., value =3D> ..., result */ + new VMOp(opc_i2s, "i2s", 1, 1, "I", "I"), + /* | ..., v1, v1, v2, v2 =3D> ..., result */ + new VMOp(opc_lcmp, "lcmp", 4, 1, "JJ", "I"), + /* | ..., v1, v1, v2, v2 =3D> ..., result */ + new VMOp(opc_fcmpl, "fcmpl", 2, 1, "FF", "I"), + /* | ..., v1, v2 =3D> ..., result */ + new VMOp(opc_fcmpg, "fcmpg", 2, 1, "FF", "I"), + /* | ..., v1, v1, v2, v2 =3D> ..., result */ + new VMOp(opc_dcmpl, "dcmpl", 4, 1, "DD", "I"), + /* | ..., v1, v1, v2, v2 =3D> ..., result */ + new VMOp(opc_dcmpg, "dcmpg", 4, 1, "DD", "I"), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifeq, "ifeq", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifne, "ifne", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_iflt, "iflt", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifge, "ifge", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifgt, "ifgt", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifle, "ifle", 1, 0, "I", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmpeq, "if_icmpeq", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmpne, "if_icmpne", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmplt, "if_icmplt", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmpge, "if_icmpge", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmpgt, "if_icmpgt", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_icmple, "if_icmple", 2, 0, "II", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_acmpeq, "if_acmpeq", 2, 0, "AA", ""), + /* brbyte1, brbyte2 | ..., value1, value2 =3D> ... */ + new VMOp(opc_if_acmpne, "if_acmpne", 2, 0, "AA", ""), + /* brbyte1, brbyte2 | no change */ + new VMOp(opc_goto, "goto", 0, 0, "", ""), + /* brbyte1, brbyte2 | ... =3D> ..., return_addr */ + new VMOp(opc_jsr, "jsr", 0, 1, "", "W"), + /* vindex | no change */ + new VMOp(opc_ret, "ret", 0, 0, "", ""), + /* ??? | ..., index =3D> ... */ + new VMOp(opc_tableswitch, "tableswitch", 1, 0, "I", ""), + /* ??? | ..., key =3D> ... */ + new VMOp(opc_lookupswitch, "lookupswitch", 1, 0, "I", ""), + /* | ..., value =3D> [empty] */ + new VMOp(opc_ireturn, "ireturn", 1, 0, "I", ""), + /* | ..., value, value =3D> [empty] */ + new VMOp(opc_lreturn, "lreturn", 2, 0, "J", ""), + /* | ..., value =3D> [empty] */ + new VMOp(opc_freturn, "freturn", 1, 0, "F", ""), + /* | ..., value, value =3D> [empty] */ + new VMOp(opc_dreturn, "dreturn", 2, 0, "D", ""), + /* | ..., value =3D> [empty] */ + new VMOp(opc_areturn, "areturn", 1, 0, "A", ""), + /* | ... =3D> [empty] */ + new VMOp(opc_return, "return", 0, 0, "", ""), + /* idxbyte1, idxbyte2 | ... =3D> ..., value [ value2 ] */ + new VMOp(opc_getstatic, "getstatic", 0, -1, "", "?"), + /* idxbyte1, idxbyte2 | ..., value [ value2 ] =3D> ... */ + new VMOp(opc_putstatic, "putstatic", -1, 0, "?", ""), + /* idxbyte1, idxbyte2 | ..., objectref =3D> ..., value [ value2 ] = */ + new VMOp(opc_getfield, "getfield", 1, -1, "A", "?"), + /* idxbyte1, idxbyte2 | ..., objectref, value [ value2 ] =3D> ... = */ + new VMOp(opc_putfield, "putfield", -1, 0, "A?", ""), + /* idxbyte1, idxbyte2 | ..., objectref, [args] =3D> ... */ + new VMOp(opc_invokevirtual, "invokevirtual", -1, -1, "A?", "?"), + /* idxbyte1, idxbyte2 | ..., objectref, [args] =3D> ... */ + new VMOp(opc_invokespecial, "invokespecial", -1, -1, "A?", "?"), + /* idxbyte1, idxbyte2 | ..., [args] =3D> ... */ + new VMOp(opc_invokestatic, "invokestatic", -1, -1, "?", "?"), + /* idxbyte1, idxbyte2, nargs, rsvd | ..., objectref, [args] =3D> .= .=2E */ + new VMOp(opc_invokeinterface, "invokeinterface", -1, -1, "A?", "?"= ), + /* */ + new VMOp(opc_xxxunusedxxx, "xxxunusedxxx", 0, 0, "", ""), + /* idxbyte1, idxbyte2 | ... =3D> ..., objectref */ + new VMOp(opc_new, "new", 0, 1, "", "A"), + /* atype | ..., size =3D> ..., result */ + new VMOp(opc_newarray, "newarray", 1, 1, "I", "A"), + /* indexbyte1, indexbyte2 | ..., size =3D> ..., result */ + new VMOp(opc_anewarray, "anewarray", 1, 1, "I", "A"), + /* | ..., objectref =3D> ..., length */ + new VMOp(opc_arraylength, "arraylength", 1, 1, "A", "I"), + /* | ..., objectref =3D> [undefined] */ + new VMOp(opc_athrow, "athrow", 1, 0, "A", "?"), + /* idxbyte1, idxbyte2 | ..., objectref =3D> ..., objectref */ + new VMOp(opc_checkcast, "checkcast", 1, 1, "A", "A"), + /* idxbyte1, idxbyte2 | ..., objectref =3D> ..., result */ + new VMOp(opc_instanceof, "instanceof", 1, 1, "A", "I"), + /* | ..., objectref =3D> ... */ + new VMOp(opc_monitorenter, "monitorenter", 1, 0, "A", ""), + /* | ..., objectref =3D> ... */ + new VMOp(opc_monitorexit, "monitorexit", 1, 0, "A", ""), + /* an instruction | special */ + new VMOp(opc_wide, "wide", 0, 0, "", ""), + /* indexbyte1, indexbyte2, dimensions | ..., size1, ..., sizen =3D= > ..., result*/ + new VMOp(opc_multianewarray, "multianewarray", -1, 1, "?", "A"), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifnull, "ifnull", 1, 0, "A", ""), + /* brbyte1, brbyte2 | ..., value =3D> ... */ + new VMOp(opc_ifnonnull, "ifnonnull", 1, 0, "A", ""), + /* brbyte1, brbyte2, brbyte3, brbyte4 | no change */ + new VMOp(opc_goto_w, "goto_w", 0, 0, "", ""), + /* brbyte1, brbyte2, brbyte3, brbyte4 | ... =3D> ..., return_addr = */ + new VMOp(opc_jsr_w, "jsr_w", 0, 1, "", "W") }; + + /** + * Check that each entry in the ops array has a valid VMOp entry + */ + private static void check() { + for (int i=3D0; i<=3Dopc_jsr_w; i++) { + VMOp op =3D ops[i]; + if (op =3D=3D null) + throw new InsnError ("null VMOp for " + i); + if (op.opcode() !=3D i) + throw new InsnError ("bad opcode for " + i); + + if (1 =3D=3D 0) { + /* check arg/result data */ + checkTypes(op.argTypes(), op.nStackArgs(), op); + checkTypes(op.resultTypes(), op.nStackResults(), op); + } + } + } + + private static void checkTypes(String types, int n, VMOp op) { + for (int i=3D0; i=3D CC_PersistenceUnknown); + } + + /** + * Returns true if the class is to be enhanced for persistence-capabil= ity. + */ + public boolean isAugmentable() + { + return (persistenceType >=3D CC_PersistenceCapable); + } + + /** + * Returns true if the class is to be enhanced as least-derived, + * persistence-capable class. + */ + public boolean isAugmentableAsRoot() + { + return (persistenceType >=3D CC_PersistenceCapableRoot); + } + + /** + * Returns the methods that are candidates for annotation. + */ + public Collection getAnnotatableMethods() + { + return annotatableMethods.values(); + } + + /** + * Returns the name of the persistence-capable superclass if defined. + */ + public String getPCSuperClassName() + { + return pcSuperClassName; + } + + /** + * Returns the name of the persistence-capable rootclass if defined. + */ + public String getPCRootClassName() + { + return pcRootClassName; + } + + /** + * Returns the name of this class or the next persistence-capable + * superclass that owns a key class. + */ + public String getPCKeyOwnerClassName() + { + return pcKeyOwnerClassName; + } + + /** + * Returns the name of this class or the next persistence-capable + * that owns a key class. + */ + public String getPCSuperKeyOwnerClassName() + { + return pcSuperKeyOwnerClassName; + } + + /** + * Returns the name of the key class if defined. + */ + public String getKeyClassName() + { + return keyClassName; + } + + /** + * Returns the name of the key class of the next persistence-capable + * superclass that defines one. + */ + public String getSuperKeyClassName() + { + return superKeyClassName; + } + + /** + * Returns the number of key field. + */ + public int getKeyFieldCount() + { + return keyFieldCount; + } + + /** + * Returns the names of the key fields. + */ + public int[] getKeyFieldIndexes() + { + return keyFieldIndexes; + } + + /** + * Returns the number of managed field. + */ + public int getManagedFieldCount() + { + return managedFieldCount; + } + + /** + * Returns the number of annotated field. + */ + public int getAnnotatedFieldCount() + { + return annotatedFieldCount; + } + + /** + * Returns the names of the annotated fields. + */ + public String[] getAnnotatedFieldNames() + { + return annotatedFieldNames; + } + + /** + * Returns the types names of the annotated fields. + */ + public String[] getAnnotatedFieldSigs() + { + return annotatedFieldSigs; + } + + /** + * Returns the Java access modifiers of the annotated fields. + */ + public int[] getAnnotatedFieldMods() + { + return annotatedFieldMods; + } + + /** + * Returns the JDO flags of the annotated fields. + */ + public int[] getAnnotatedFieldFlags() + { + return annotatedFieldFlags; + } + + /** + * Returns true if the class has a default (no-argument) constructor. + */ + public boolean hasDefaultConstructor() + { + return hasDefaultConstructor; + } + + /** + * Returns true if the class has a static initializer block. + */ + public boolean hasStaticInitializer() + { + return hasStaticInitializer; + } + + /** + * Returns true if the class has a clone() method. + */ + public boolean hasCloneMethod() + { + return hasCloneMethod; + } + + /** + * Returns true if the class has a writeObject() method. + */ + public boolean hasWriteObjectMethod() + { + return hasWriteObjectMethod; + } + + /** + * Returns true if the class has a writeReplace() method. + */ + public boolean hasWriteReplaceMethod() + { + return hasWriteReplaceMethod; + } + + /** + * Returns true if the class has a readObject() method. + */ + public boolean hasReadObjectMethod() + { + return hasReadObjectMethod; + } + + /** + * Returns true if the class already provides the JDO augmentation. + */ + public boolean hasJDOAugmentation() + { + return hasJDOMembers; + } + + // -------------------------------------------------------------------= --- + =20 + /** + * Analyzes the class for existing augmentation. + */ + public void scan() + { + env.message("scanning class " + userClassName); + + // skip previously enhanced files + checkForEnhancedAttribute(); + if (!isAnnotateable()) { + return; + } + + // skip unenhancable files + initPersistenceType(); + if (!isAnnotateable()) { + return; + } + affirm(persistenceType > CC_Unenhancable); + =20 + scanFields(); + scanMethods(); + + if (isAugmentable()) { + checkPCFeasibility(); + checkSpecificAugmentation(); + checkCallbackAugmentation(); + + if (isAugmentableAsRoot()) { + checkGenericAugmentation(); + } + } + + //^olsen: check +/* + //@olsen: check whether member starts with the reserved jdo prefix + if (methodName.startsWith("jdo")) { + //@olsen: issue a warning only + env.warning( + getI18N("enhancer.class_has_jdo_like_member", + userClassName, methodName)); + return; + } + //@olsen: check whether member starts with the reserved jdo prefix + if (fieldName.startsWith("jdo")) { + //@olsen: issue a warning only + env.warning( + getI18N("enhancer.class_has_jdo_like_member", + userClassName, fieldName)); + return; + } +*/ + } + + /** + * Scans the attributes of a ClassFile + */ + private void checkForEnhancedAttribute() + { + for (Enumeration e =3D classFile.attributes().elements(); + e.hasMoreElements();) { + final ClassAttribute attr =3D (ClassAttribute)e.nextElement(); + final String attrName =3D attr.attrName().asString(); + if (SUNJDO_PC_EnhancedAttribute.equals(attrName)) { + persistenceType =3D CC_PreviouslyEnhanced; + + // At some point we may want to consider stripping old + // annotations and re-annotating, but not yet + env.message("ignoring previously enhanced class " + + userClassName); + return; + } + } + } + + // -------------------------------------------------------------------= --- + =20 + /** + * Sets the persistence type of a class according to JDO metadata. + */ + private void initPersistenceType() + { + affirm(persistenceType =3D=3D CC_PersistenceUnknown); + + // check if class is known not to be changed + final EnhancerMetaData meta =3D env.getEnhancerMetaData(); + if (meta.isKnownUnenhancableClass(className)) { + persistenceType =3D CC_Unenhancable; + return; + } + + // check if class is persistence-capable + if (meta.isPersistenceCapableClass(className)) { + pcSuperClassName + =3D meta.getPersistenceCapableSuperClass(className); + pcRootClassName + =3D meta.getPersistenceCapableRootClass(className); + affirm(pcSuperClassName =3D=3D null || pcRootClassName !=3D nu= ll); + + persistenceType + =3D (pcSuperClassName =3D=3D null + ? CC_PersistenceCapableRoot + : CC_PersistenceCapable); + + //^olsen: assert consistency between Java and JDO metadata + affirm(!classFile.isInterface()); + //affirm(!classFile.isInnerClass()); + + //^olsen: assert consistency between Java and JDO metadata + // disallow enhancing classes not derived from java.lang.Object + final ConstClass superConstClass =3D classFile.superName(); + affirm(superConstClass !=3D null); + + // non-pc-root classes must not derive from java.lang.Object + affirm(pcSuperClassName =3D=3D null + || !superConstClass.asString().equals("java/lang/Object= ")); + + // define the PC key owner class + pcKeyOwnerClassName =3D className; + while (meta.getKeyClass(pcKeyOwnerClassName) =3D=3D null) { + final String pcSuperClassName + =3D meta.getPersistenceCapableSuperClass( + pcKeyOwnerClassName); + if (pcSuperClassName =3D=3D null) + break; + pcKeyOwnerClassName =3D pcSuperClassName; + } + affirm(pcKeyOwnerClassName !=3D null); + + // define the PC super key owner class + pcSuperKeyOwnerClassName =3D pcSuperClassName; + if (pcSuperKeyOwnerClassName !=3D null) { + while (meta.getKeyClass(pcSuperKeyOwnerClassName) =3D=3D n= ull) { + final String pcSuperClassName + =3D meta.getPersistenceCapableSuperClass( + pcSuperKeyOwnerClassName); + if (pcSuperClassName =3D=3D null) + break; + pcSuperKeyOwnerClassName =3D pcSuperClassName; + } + affirm(pcKeyOwnerClassName !=3D null); + } + + keyClassName + =3D meta.getKeyClass(className); + superKeyClassName + =3D meta.getSuperKeyClass(className); + affirm(superKeyClassName =3D=3D null || pcSuperClassName !=3D = null); + } + } + + /** + * Scans the fields. + */ + private void scanFields() + { + // all fields for which accessor/mutator needs to be generated + final Map annotatedFieldMap =3D new HashMap(); + + if (isAugmentable()) { + // loop over class fields to declare them to the model + for (final Enumeration e =3D classFile.fields().elements(); + e.hasMoreElements();) { + final ClassField field =3D (ClassField)e.nextElement(); + final String name =3D field.name().asString(); + final String sig =3D field.signature().asString(); + + // skip jdo fields + if (jdoFieldNames.contains(name)) { + continue; + } + + // skip static fields + if (field.isStatic()) { + continue; + } + + // skip known non-managed fields + if (meta.isKnownNonManagedField(className, name, sig)) { + continue; + } + + // remember field requiring accessor/mutator + Object obj =3D annotatedFieldMap.put(name, field); + affirm(obj =3D=3D null, + ("Error in classfile: repeated declaration of field: " + + userClassName + "." + name)); + + // skip final, transient fields + if (field.isFinal() + || field.isTransient()) { + continue; + } + + if (false) { + System.out.println("Analyzer.scanFields(): declaring " + + className + "." + name + " : " + = sig); + } + meta.declareField(className, name, sig); + } + } + + // nr of fields needing accessor/mutator methods + annotatedFieldCount =3D annotatedFieldMap.size(); + =20 + // get managed field names from meta data + final String[] managedFieldNames =3D meta.getManagedFields(classNa= me); + affirm(managedFieldNames !=3D null); + managedFieldCount =3D managedFieldNames.length; + final Set managedFieldNamesSet + =3D new HashSet(Arrays.asList(managedFieldNames)); + affirm(managedFieldNamesSet.size() =3D=3D managedFieldCount, + "JDO metadata: returned duplicate managed fields."); + affirm(managedFieldCount <=3D annotatedFieldCount, + "JDO metadata: managed fields exceed annotated fields."); + + // data structures for key fields + final String[] keyFieldNames =3D meta.getKeyFields(className); + affirm(keyFieldNames !=3D null); + keyFieldCount =3D keyFieldNames.length; + affirm(keyFieldCount =3D=3D 0 || keyClassName !=3D null, + "JDO metadata: returned key fields but no key class."); + final Set keyFieldNamesSet + =3D new HashSet(Arrays.asList(keyFieldNames)); + affirm(keyFieldNamesSet.size() =3D=3D keyFieldCount, + "JDO metadata: returned duplicate key fields."); + affirm(keyFieldCount <=3D managedFieldCount, + "JDO metadata: key fields exceed managed fields."); + + // loop over class fields to compute 'jdo*' and key/managed fields + for (final Enumeration e =3D classFile.fields().elements(); + e.hasMoreElements();) { + final ClassField field =3D (ClassField)e.nextElement(); + final String name =3D field.name().asString(); + final String sig =3D field.signature().asString(); + final String userFieldName =3D userClassName + "." + name; + =20 + if (false) { + System.out.println("Analyzer.scanFields(): scanning " + + className + "." + name + " : " + sig); + } + + // map 'jdo*' field names to class fields + if (name.startsWith("jdo")) { + final Object f =3D jdoLikeFields.put(name, field); + affirm(f =3D=3D null); + } + + // skip non-managed fields + if (!managedFieldNamesSet.contains(name)) { + affirm(!meta.isManagedField(className, name)); + + // check for non-managed key field + affirm(!keyFieldNamesSet.contains(name), + ("JDO metadata: reported the field " + userFieldName + + " to be non-managed but key.")); + continue; + } + affirm(meta.isManagedField(className, name)); + + // check for managed static field + affirm(!field.isStatic(), + ("JDO metadata: reported the field " + userFieldName + + " to be managed though it's static.")); + + // check for managed final field + affirm(!field.isFinal(), + ("JDO metadata: reported the field " + userFieldName + + " to be managed though it's final.")); + + // allow for managed transient fields + +//^olsen: adopt +/* + r[i++] =3D hasField( + out, + Modifier.PRIVATE | Modifier.FINAL | Modifier.STATIC, + long.class, + "serialVersionUID"); +*/ + } + =20 + // get the managed field flags ordered by relative index + final int[] managedFieldFlags + =3D meta.getFieldFlags(className, managedFieldNames); + + // compute the managed field types ordered by relative index + // and key field indexes + int j =3D 0; + keyFieldIndexes =3D new int[keyFieldCount]; + final String[] managedFieldSigs =3D new String[managedFieldCount]; + final int[] managedFieldMods =3D new int[managedFieldCount]; + for (int i =3D 0; i < managedFieldCount; i++) { + final String name =3D managedFieldNames[i]; + affirm(name !=3D null); + + // assert consistency between Java and JDO metadata + final ClassField field =3D (ClassField)annotatedFieldMap.get(n= ame); + affirm(field !=3D null, + ("The managed field " + userClassName + "." + name + + " is not declared by the class.")); + affirm(!field.isStatic(), + ("The managed field " + userClassName + "." + name + + " is static.")); + affirm(!field.isFinal(), + ("The managed field " + userClassName + "." + name + + " is final.")); + + // mark managed field as taken care of + annotatedFieldMap.remove(name); + + // assign key field index + if (keyFieldNamesSet.contains(name)) { + affirm(meta.isKeyField(className, name)); + keyFieldIndexes[j++] =3D i; + } + =20 + // add field type and Java access modifers + managedFieldSigs[i] =3D field.signature().asString(); + managedFieldMods[i] =3D field.access(); + + // set the serializable bit if field is not (Java) transient + // This code might be removed as soon as the metadata is able + // to retrieve the info as part of meta.getFieldFlags. + if (!field.isTransient()) { + managedFieldFlags[i] |=3D EnhancerMetaData.SERIALIZABLE; + } + =20 + if (false) { + System.out.println("managed field: " + + className + "." + name + " : {"); + System.out.println(" sigs =3D " + managedFieldSigs[i]); + System.out.println(" mods =3D " + + Integer.toHexString(managedFieldMods[= i])); + System.out.println(" flags =3D " + + Integer.toHexString(managedFieldFlags= [i])); + }=20 + } + =20 + // post conditions of managed/key field processing + affirm(keyFieldIndexes.length =3D=3D keyFieldCount); + affirm(keyFieldCount <=3D managedFieldCount); + affirm(managedFieldNames.length =3D=3D managedFieldCount); + affirm(managedFieldSigs.length =3D=3D managedFieldCount); + affirm(managedFieldMods.length =3D=3D managedFieldCount); + affirm(managedFieldFlags.length =3D=3D managedFieldCount); + affirm(managedFieldCount <=3D annotatedFieldCount); + =20 + // assign the annotated field arrays + if (managedFieldCount =3D=3D annotatedFieldCount) { + // return if the annotated fields are equal to the managed ones + annotatedFieldNames =3D managedFieldNames; + annotatedFieldSigs =3D managedFieldSigs; + annotatedFieldMods =3D managedFieldMods; + annotatedFieldFlags =3D managedFieldFlags; + } else { + // fill the annotated field arrays with the managed ones + annotatedFieldNames =3D new String[annotatedFieldCount]; + annotatedFieldSigs =3D new String[annotatedFieldCount]; + annotatedFieldMods =3D new int[annotatedFieldCount]; + annotatedFieldFlags =3D new int[annotatedFieldCount]; + int i =3D managedFieldCount; + System.arraycopy(managedFieldNames, 0, annotatedFieldNames, 0,= i); + System.arraycopy(managedFieldSigs, 0, annotatedFieldSigs, 0, i= ); + System.arraycopy(managedFieldMods, 0, annotatedFieldMods, 0, i= ); + System.arraycopy(managedFieldFlags, 0, annotatedFieldFlags, 0,= i); + + // append the annotated, non-managed fields + for (Iterator k =3D annotatedFieldMap.entrySet().iterator(); + k.hasNext();) { + final Map.Entry entry =3D (Map.Entry)k.next(); + final String name =3D (String)entry.getKey(); + final ClassField field =3D (ClassField)entry.getValue(); + affirm(name.equals(field.name().asString())); + + affirm(!field.isStatic(), + ("The managed field " + userClassName + "." + name + + " is static.")); + + // add field type and Java access modifers + annotatedFieldNames[i] =3D name; + annotatedFieldSigs[i] =3D field.signature().asString(); + annotatedFieldMods[i] =3D field.access(); + annotatedFieldFlags[i] =3D 0x0; // direct read/write access + i++; + } + affirm(i =3D=3D annotatedFieldCount); + } + =20 + // post conditions + affirm(keyFieldIndexes.length =3D=3D keyFieldCount); + affirm(keyFieldCount <=3D managedFieldCount); + affirm(annotatedFieldNames.length =3D=3D annotatedFieldCount); + affirm(annotatedFieldSigs.length =3D=3D annotatedFieldCount); + affirm(annotatedFieldMods.length =3D=3D annotatedFieldCount); + affirm(annotatedFieldFlags.length =3D=3D annotatedFieldCount); + affirm(managedFieldCount <=3D annotatedFieldCount); + } + + /** + * Scans the methods of a ClassFile. + */ + private void scanMethods() + { + // check methods + for (final Enumeration e =3D classFile.methods().elements(); + e.hasMoreElements();) { + final ClassMethod method =3D (ClassMethod)e.nextElement(); + final String name =3D method.name().asString(); + final String sig =3D method.signature().asString(); + affirm(name !=3D null); + affirm(sig !=3D null); + + final String key =3D methodKey(name, sig); + affirm(key !=3D null); + + // for non-abstract, non-native methods, map names to class me= thods + if (!method.isAbstract() && !method.isNative()) { + final Object m =3D annotatableMethods.put(key, method); + affirm(m =3D=3D null); + } + + // for 'jdo*' like methods, map names to class methods + if (name.startsWith("jdo")) { + final Object m =3D jdoLikeMethods.put(key, method); + affirm(m =3D=3D null); + continue; + } + + // check for a default constructor by name and signature + if (name.equals(NameHelper.constructorName()) + && sig.equals(NameHelper.constructorSig())) { + hasDefaultConstructor =3D true; + continue; + } + =20 + // check for a static initializer block by name and signature + if (name.equals(JAVA_clinit_Name) + && sig.equals(JAVA_clinit_Sig)) { + hasStaticInitializer =3D true; + continue; + } + + // check for method clone() by name and signature + if (name.equals(JAVA_Object_clone_Name) + && sig.equals(JAVA_Object_clone_Sig)) { + hasCloneMethod =3D true; + continue; + } + + // check for method writeObject() by name and signature + if (name.equals(JAVA_Object_writeObject_Name) + && sig.equals(JAVA_Object_writeObject_Sig)) { + hasWriteObjectMethod =3D true; + continue; + } + + // check for method writeReplace() by name and signature + if (name.equals(JAVA_Object_writeReplace_Name) + && sig.equals(JAVA_Object_writeReplace_Sig)) { + hasWriteReplaceMethod =3D true; + continue; + } + + // check for method readObject() by name and signature + if (name.equals(JAVA_Object_readObject_Name) + && sig.equals(JAVA_Object_readObject_Sig)) { + hasReadObjectMethod =3D true; + + // remove readObject() method from annotation candidates + Object m =3D annotatableMethods.remove(key); + affirm(m !=3D null); + continue; + } + } + + // check for a default constructor by name and signature + if (hasDefaultConstructor) { + env.message(getI18N("enhancer.class_has_default_constructor")); + } else { + env.message(getI18N("enhancer.class_has_not_default_constructo= r")); + } + =20 + // check for a static initializer block by name and signature + if (hasStaticInitializer) { + env.message(getI18N("enhancer.class_has_static_initializer")); + } else { + env.message(getI18N("enhancer.class_has_not_static_initializer= ")); + } + + // check for method clone() by name and signature + if (hasCloneMethod) { + env.message(getI18N("enhancer.class_has_clone_method")); + } else { + env.message(getI18N("enhancer.class_has_not_clone_method")); + } + + // check for method writeObject() by name and signature + if (hasWriteObjectMethod) { + env.message(getI18N("enhancer.class_has_writeObject_method")); + } else { + env.message(getI18N("enhancer.class_has_not_writeObject_method= ")); + } + + // check for method writeReplace() by name and signature + if (hasWriteReplaceMethod) { + env.message(getI18N("enhancer.class_has_writeReplace_method")); + } else { + env.message(getI18N("enhancer.class_has_not_writeReplace_metho= d")); + } + + // check for method readObject() by name and signature + if (hasReadObjectMethod) { + env.message(getI18N("enhancer.class_has_readObject_method")); + } else { + env.message(getI18N("enhancer.class_has_not_readObject_method"= )); + } + } + + private void checkGenericAugmentation() + { + scanForImplementsPC(); + scanForGenericJDOFields(); + scanForGenericJDOMethods(); + + final boolean all + =3D (hasImplementsPC && hasGenericJDOFields && hasGenericJDOMe= thods); + //^olsen: check + final boolean none + =3D !(hasImplementsPC + || hasGenericJDOFields || hasGenericJDOMethods); + + if (all ^ none) { + hasGenericJDOMembers =3D hasImplementsPC; + env.message( + getI18N("enhancer.class_has_generic_jdo_members", + String.valueOf(hasGenericJDOMembers))); + + //^olsen: check for specific enhancement + + return; + } + + final String key + =3D "enhancer.class_has_inconsistently_declared_jdo_members"; + if (hasGenericJDOFields && !hasGenericJDOMethods) { + env.error( + getI18N(key, + userClassName, + "", + "")); + } else if (!hasGenericJDOFields && hasGenericJDOMethods) { + env.error( + getI18N(key, + userClassName, + "", + "")); + } else if (!hasGenericJDOFields && !hasGenericJDOMethods) { + env.error( + getI18N(key, + userClassName, + "", + "")); + } else { + env.error( + getI18N(key, + userClassName, + "", + ""= )); + } + } + =20 + private void checkSpecificAugmentation() + { + scanForSpecificJDOFields(); + scanForSpecificJDOMethods(); + + final boolean all + =3D (hasSpecificJDOFields && hasSpecificJDOMethods); + //^olsen: check + final boolean none + =3D !(hasSpecificJDOFields || hasSpecificJDOMethods); + + if (all ^ none) { + hasSpecificJDOMembers =3D hasSpecificJDOFields; + env.message( + getI18N("enhancer.class_has_specific_jdo_members", + String.valueOf(hasSpecificJDOMembers))); + return; + } + + final String key + =3D "enhancer.class_has_inconsistently_declared_jdo_members"; + if (hasSpecificJDOFields && !hasSpecificJDOMethods) { + env.error( + getI18N(key, + userClassName, + "", + "")); + } else { + env.error( + getI18N(key, + userClassName, + "", + "")); + } + } + =20 + private void checkCallbackAugmentation() + { + scanForCallbackJDOMethods(); + env.message( + getI18N("enhancer.class_has_callback_jdo_methods", + String.valueOf(hasCallbackJDOMethods))); + } + =20 + private void checkPCFeasibility() + { + if (!hasDefaultConstructor) { + env.error( + getI18N("enhancer.class_missing_default_constructor", + userClassName)); + } + } + =20 + /** + * Scans the class for implementing the PC interface. + */ + private void scanForImplementsPC() + { + hasImplementsPC =3D false; + for (final Iterator ifc =3D classFile.interfaces().iterator(); + ifc.hasNext();) { + final ConstClass i =3D (ConstClass)ifc.next(); + if (i.asString().equals(JDO_PersistenceCapable_Path)) { + hasImplementsPC =3D true; + break; + } + } + env.message( + getI18N("enhancer.class_implements_jdo_pc", + String.valueOf(hasImplementsPC))); + } + + /** + * Scans for JDO fields of generic augmentation. + */ + private void scanForGenericJDOFields() + { + // performance shortcut + if (jdoLikeFields.isEmpty()) { + hasGenericJDOFields =3D false; + env.message( + getI18N("enhancer.class_has_generic_jdo_fields", + String.valueOf(hasGenericJDOFields))); + return; + } + + // sets of found/missing 'jdo*' members + final Set found =3D new HashSet(10); + final Set missing =3D new HashSet(10); + + scanJDOField(JDO_PC_jdoStateManager_Name, + JDO_PC_jdoStateManager_Sig, + JDO_PC_jdoStateManager_Mods, + found, missing); + scanJDOField(JDO_PC_jdoFlags_Name, + JDO_PC_jdoFlags_Sig, + JDO_PC_jdoFlags_Mods, + found, missing); + + if (found.isEmpty() ^ missing.isEmpty()) { + hasGenericJDOFields =3D missing.isEmpty(); + env.message( + getI18N("enhancer.class_has_generic_jdo_fields", + String.valueOf(hasGenericJDOFields))); + return; + } + + reportInconsistentJDOMembers(found, missing); + } + + /** + * Scans for JDO methods of generic augmentation. + */ + private void scanForGenericJDOMethods() + { + // performance shortcut + if (jdoLikeMethods.isEmpty()) { + hasGenericJDOMethods =3D false; + env.message( + getI18N("enhancer.class_has_generic_jdo_methods", + String.valueOf(hasGenericJDOMethods))); + return; + } + + // sets of found/missing 'jdo*' members + final Set found =3D new HashSet(30); + final Set missing =3D new HashSet(30); + + scanJDOMethod(JDO_PC_jdoReplaceStateManager_Name, + JDO_PC_jdoReplaceStateManager_Sig, + JDO_PC_jdoReplaceStateManager_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoReplaceFlags_Name, + JDO_PC_jdoReplaceFlags_Sig, + JDO_PC_jdoReplaceFlags_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoGetPersistenceManager_Name, + JDO_PC_jdoGetPersistenceManager_Sig, + JDO_PC_jdoGetPersistenceManager_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoGetObjectId_Name, + JDO_PC_jdoGetObjectId_Sig, + JDO_PC_jdoGetObjectId_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoGetTransactionalObjectId_Name, + JDO_PC_jdoGetTransactionalObjectId_Sig, + JDO_PC_jdoGetTransactionalObjectId_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoIsPersistent_Name, + JDO_PC_jdoIsPersistent_Sig, + JDO_PC_jdoIsPersistent_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoIsTransactional_Name, + JDO_PC_jdoIsTransactional_Sig, + JDO_PC_jdoIsTransactional_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoIsNew_Name, + JDO_PC_jdoIsNew_Sig, + JDO_PC_jdoIsNew_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoIsDeleted_Name, + JDO_PC_jdoIsDeleted_Sig, + JDO_PC_jdoIsDeleted_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoIsDirty_Name, + JDO_PC_jdoIsDirty_Sig, + JDO_PC_jdoIsDirty_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoMakeDirty_Name, + JDO_PC_jdoMakeDirty_Sig, + JDO_PC_jdoMakeDirty_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoPreSerialize_Name, + JDO_PC_jdoPreSerialize_Sig, + JDO_PC_jdoPreSerialize_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoReplaceFields_Name, + JDO_PC_jdoReplaceFields_Sig, + JDO_PC_jdoReplaceFields_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoProvideFields_Name, + JDO_PC_jdoProvideFields_Sig, + JDO_PC_jdoProvideFields_Mods, + found, missing); + + if (found.isEmpty() ^ missing.isEmpty()) { + hasGenericJDOMethods =3D missing.isEmpty(); + env.message( + getI18N("enhancer.class_has_generic_jdo_methods", + String.valueOf(hasGenericJDOMethods))); + return; + } + + reportInconsistentJDOMembers(found, missing); + } + + /** + * Scans for JDO fields of specific augmentation. + */ + private void scanForSpecificJDOFields() + { + // performance shortcut + if (jdoLikeFields.isEmpty()) { + hasSpecificJDOFields =3D false; + env.message( + getI18N("enhancer.class_has_specific_jdo_fields", + String.valueOf(hasSpecificJDOFields))); + return; + } + + // sets of found/missing 'jdo*' members + final Set found =3D new HashSet(10); + final Set missing =3D new HashSet(10); + + scanJDOField(JDO_PC_jdoInheritedFieldCount_Name, + JDO_PC_jdoInheritedFieldCount_Sig, + JDO_PC_jdoInheritedFieldCount_Mods, + found, missing); + scanJDOField(JDO_PC_jdoFieldNames_Name, + JDO_PC_jdoFieldNames_Sig, + JDO_PC_jdoFieldNames_Mods, + found, missing); + scanJDOField(JDO_PC_jdoFieldTypes_Name, + JDO_PC_jdoFieldTypes_Sig, + JDO_PC_jdoFieldTypes_Mods, + found, missing); + scanJDOField(JDO_PC_jdoFieldFlags_Name, + JDO_PC_jdoFieldFlags_Sig, + JDO_PC_jdoFieldFlags_Mods, + found, missing); + scanJDOField(JDO_PC_jdoPersistenceCapableSuperclass_Name, + JDO_PC_jdoPersistenceCapableSuperclass_Sig, + JDO_PC_jdoPersistenceCapableSuperclass_Mods, + found, missing); + + if (found.isEmpty() ^ missing.isEmpty()) { + hasSpecificJDOFields =3D missing.isEmpty(); + env.message( + getI18N("enhancer.class_has_specific_jdo_fields", + String.valueOf(hasSpecificJDOFields))); + return; + } + + reportInconsistentJDOMembers(found, missing); + } + + /** + * Scans for JDO methods of specific augmentation. + */ + private void scanForSpecificJDOMethods() + { + // performance shortcut + if (jdoLikeMethods.isEmpty()) { + hasSpecificJDOMethods =3D false; + env.message( + getI18N("enhancer.class_has_specific_jdo_methods", + String.valueOf(hasSpecificJDOMethods))); + return; + } + + // sets of found/missing 'jdo*' members + final Set found =3D new HashSet(30); + final Set missing =3D new HashSet(30); + + scanJDOMethod(JDO_PC_jdoGetManagedFieldCount_Name, + JDO_PC_jdoGetManagedFieldCount_Sig, + JDO_PC_jdoGetManagedFieldCount_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoNewInstance_Name, + JDO_PC_jdoNewInstance_Sig, + JDO_PC_jdoNewInstance_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoNewInstance_Name, + JDO_PC_jdoNewInstance_Sig, + JDO_PC_jdoNewInstance_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoNewObjectIdInstance_Name, + JDO_PC_jdoNewObjectIdInstance_Sig, + JDO_PC_jdoNewObjectIdInstance_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoNewObjectIdInstance_Name, + JDO_PC_jdoNewObjectIdInstance_Sig, + JDO_PC_jdoNewObjectIdInstance_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoCopyKeyFieldsToObjectId_Name, + JDO_PC_jdoCopyKeyFieldsToObjectId_Sig, + JDO_PC_jdoCopyKeyFieldsToObjectId_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoCopyKeyFieldsToObjectId_OIFS_Name, + JDO_PC_jdoCopyKeyFieldsToObjectId_OIFS_Sig, + JDO_PC_jdoCopyKeyFieldsToObjectId_OIFS_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoCopyKeyFieldsFromObjectId_OIFC_Name, + JDO_PC_jdoCopyKeyFieldsFromObjectId_OIFC_Sig, + JDO_PC_jdoCopyKeyFieldsFromObjectId_OIFC_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoReplaceField_Name, + JDO_PC_jdoReplaceField_Sig, + JDO_PC_jdoReplaceField_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoProvideField_Name, + JDO_PC_jdoProvideField_Sig, + JDO_PC_jdoProvideField_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoCopyFields_Name, + JDO_PC_jdoCopyFields_Sig, + JDO_PC_jdoCopyFields_Mods, + found, missing); + scanJDOMethod(JDO_PC_jdoCopyField_Name, + JDONameHelper.getJDO_PC_jdoCopyField_Sig(className), + JDO_PC_jdoCopyField_Mods, + found, missing); + + if (found.isEmpty() ^ missing.isEmpty()) { + hasSpecificJDOMethods =3D missing.isEmpty(); + env.message( + getI18N("enhancer.class_has_specific_jdo_methods", + String.valueOf(hasSpecificJDOMethods))); + return; + } + + reportInconsistentJDOMembers(found, missing); + } + + /** + * Scans for JDO methods of generic augmentation. + */ + private void scanForCallbackJDOMethods() + { + // performance shortcut + if (jdoLikeMethods.isEmpty()) { + hasCallbackJDOMethods =3D false; + env.message( + getI18N("enhancer.class_has_callback_jdo_methods", + String.valueOf(hasCallbackJDOMethods))); + return; + } + + // sets of found/missing 'jdo*' members + final Set found =3D new HashSet(30); + final Set missing =3D new HashSet(30); + final boolean annotatable =3D true; + + scanJDOMethod(JDO_IC_jdoPostLoad_Name, + JDO_IC_jdoPostLoad_Sig, + JDO_IC_jdoPostLoad_Mods, + found, missing, !annotatable); + + scanJDOMethod(JDO_IC_jdoPreStore_Name, + JDO_IC_jdoPreStore_Sig, + JDO_IC_jdoPreStore_Mods, + found, missing, annotatable); + + scanJDOMethod(JDO_IC_jdoPreClear_Name, + JDO_IC_jdoPreClear_Sig, + JDO_IC_jdoPreClear_Mods, + found, missing, !annotatable); + + scanJDOMethod(JDO_IC_jdoPreDelete_Name, + JDO_IC_jdoPreDelete_Sig, + JDO_IC_jdoPreDelete_Mods, + found, missing, annotatable); + + // no requirement to check for 'missing' methods + if (!found.isEmpty()) { + hasCallbackJDOMethods =3D true; + env.message( + getI18N("enhancer.class_has_callback_jdo_methods", + String.valueOf(hasCallbackJDOMethods))); + } + } + + /** + * Verifies a JDO field signature. + */ + private void scanJDOField(String fieldName, + String expectedSig, + int expectedMods, + Set found, + Set missing) + { + final ClassField field =3D (ClassField)jdoLikeFields.get(fieldName= ); + if (field =3D=3D null) { + missing.add(fieldName); + return; + } + found.add(fieldName); + + final String foundSig =3D field.signature().asString(); + final int foundMods =3D field.access(); + if (!expectedSig.equals(foundSig) || expectedMods !=3D foundMods) { + env.error( + getI18N("enhancer.class_has_illegally_declared_jdo_member", + new Object[]{ userClassName, + fieldName, + expectedSig, + foundSig, + new Integer(expectedMods), + new Integer(foundMods) })); + } + } + + /** + * Verifies a JDO method signature. + */ + private void scanJDOMethod(String methodName, + String expectedSig, + int expectedMods, + Set found, + Set missing) + { + scanJDOMethod(methodName, expectedSig, expectedMods, + found, missing, true); + } + + /** + * Verifies a JDO method signature. + */ + private void scanJDOMethod(String methodName, + String expectedSig, + int expectedMods, + Set found, + Set missing, + boolean annotatable) + { + final String key =3D methodKey(methodName, expectedSig); + final ClassMethod method =3D (ClassMethod)jdoLikeMethods.get(key); + if (method =3D=3D null) { + missing.add(key); + return; + } + found.add(key); + + final String foundSig =3D method.signature().asString(); + final int foundMods =3D method.access(); + if (!expectedSig.equals(foundSig) || expectedMods !=3D foundMods) { + env.error( + getI18N("enhancer.class_has_illegally_declared_jdo_member", + new Object[]{ userClassName, + methodName, + expectedSig, + foundSig, + new Integer(expectedMods), + new Integer(foundMods) })); + } + + // remove jdo method from annotation candidates + if (!annotatable) { + Object m =3D annotatableMethods.remove(key); + affirm(m !=3D null); + } + } + + /** + * Reports an error for some found/missing JDO fields or methods. + */ + private void reportInconsistentJDOMembers(Set found, + Set missing) + { + final Iterator fi =3D found.iterator(); + final StringBuffer f =3D new StringBuffer((String)fi.next()); + while (fi.hasNext()) { + f.append(", " + fi.next()); + } + + final Iterator mi =3D found.iterator(); + final StringBuffer m =3D new StringBuffer((String)mi.next()); + while (mi.hasNext()) { + m.append(", " + mi.next()); + } + + env.error( + getI18N("enhancer.class_has_inconsistently_declared_jdo_member= s", + userClassName, f.toString(), m.toString())); + } + + // -------------------------------------------------------------------= --- + =20 + static private String methodKey(String name, + String sig) + { + affirm(name !=3D null); + affirm(sig !=3D null && sig.charAt(0) =3D=3D '(' && sig.indexOf(')= ') > 0); + final String parms =3D sig.substring(0, sig.indexOf(')') + 1); + return (name + parms); + } +}