From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/deepCopier/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/deepCopier/impl Modified Files: StatefulDeepCopier.java Log Message: NEW CLASSES ---------------------- InnerDnaSpawningException Thrown whenever a problem occurs while spawning a new Dna representing an inner class JEFClassResolver Utility class for loading a class definition from the classpath as a byte array AttributeTypes New enum representing the set of known attributes EnclosingMethodAttribute, ExceptionsAttribute, SignatureAttribute, SourceDebugExtensionAttribute, and their concrete implementations New attributes CHANGES --------------- DeepCopier Added 'public int deepCopy(int index, boolean duplicate)' StatefulDeepCopier Added 'public int deepCopy(int index, boolean duplicate)' DisconnectedField Added methods for adding attributes and inner classes DefaultDisconnectedField Added methods for adding attributes and inner classes and an AttributesTable property along with a Map of inner-classes DefaultMethodDisconnector Complete refactoring and added support for inner classes DnaReader Added public static method for instantiating a Dna from a byte array DnaWriter Added a public static method for writing a new Dna specifying its destination path and its new file name AttribFactory The attribute-type is now represented by means of an enum (AttributeType) AttributeFactory Reimplemented the attribute instantiation logic leveraging of the AttributeType enum. The factory now supports the following three new attributes: EnclosingMethod, Signature, SourceDebugExtension. ConstantUtf8 Added the toString() method and a flag stating if its value can be modified or not. DefaultInjector Added support for class-level attributes and inner classes DeepCopyTest, DnaMixTest, DnaTest, MethodDisconnectionTest Removed the need of the JEF_HOME env var SimpleClassD Added a number of inner classes for testing purposes Index: StatefulDeepCopier.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/deepCopier/impl/StatefulDeepCopier.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StatefulDeepCopier.java 2 Jul 2005 21:07:55 -0000 1.10 --- StatefulDeepCopier.java 21 Dec 2006 18:49:33 -0000 1.11 *************** *** 76,79 **** --- 76,83 ---- } + public int deepCopy(int index) throws DeepCopyException, CloneNotSupportedException { + return this.deepCopy(index,false); + } + /** * Copies the chain of <code>cp_info</code>s starting at <code>index</code> from the *************** *** 89,93 **** * Unable to perform the deep copy */ ! public int deepCopy(int index) throws DeepCopyException, CloneNotSupportedException { int newIndex = -1; logger.debug("In deepCopy..."); --- 93,97 ---- * Unable to perform the deep copy */ ! public int deepCopy(int index, boolean duplicate) throws DeepCopyException, CloneNotSupportedException { int newIndex = -1; logger.debug("In deepCopy..."); *************** *** 97,101 **** logger.debug("Found a " + ClosingCpInfo.class + " annotation"); // the indexed cp_info is a final cp_info ! if (existsInDstCpt(index)) { newIndex = resolveIndexInDstCpt(index); logger.debug("Src cp_info " + index + " already exists at index " + newIndex + " in dstCPT"); --- 101,105 ---- logger.debug("Found a " + ClosingCpInfo.class + " annotation"); // the indexed cp_info is a final cp_info ! if (!duplicate && existsInDstCpt(index)) { newIndex = resolveIndexInDstCpt(index); logger.debug("Src cp_info " + index + " already exists at index " + newIndex + " in dstCPT"); *************** *** 110,114 **** else { // recursive case: the indexed cp_info is not a final cp_info ! if (existsInDstCpt(index)) { newIndex = resolveIndexInDstCpt(index); logger.debug("Src cp_info " + index + " already exists at index " + newIndex + " in dstCPT"); --- 114,118 ---- else { // recursive case: the indexed cp_info is not a final cp_info ! if (!duplicate && existsInDstCpt(index)) { newIndex = resolveIndexInDstCpt(index); logger.debug("Src cp_info " + index + " already exists at index " + newIndex + " in dstCPT"); *************** *** 134,138 **** int ref = new Integer(BeanUtils.getProperty(dstCpInfo, fields[i].getName())); logger.debug("The " + fields[i].getName() + " field has annotation " + RefersToCpInfo.class + " and refers to srcCPT index " + ref + ": deepCopying it..."); ! BeanUtils.setProperty(dstCpInfo, fields[i].getName(), deepCopy(ref)); logger.debug("... done"); } --- 138,142 ---- int ref = new Integer(BeanUtils.getProperty(dstCpInfo, fields[i].getName())); logger.debug("The " + fields[i].getName() + " field has annotation " + RefersToCpInfo.class + " and refers to srcCPT index " + ref + ": deepCopying it..."); ! BeanUtils.setProperty(dstCpInfo, fields[i].getName(), deepCopy(ref,duplicate)); logger.debug("... done"); } |