You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(94) |
Dec
(99) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(49) |
Feb
(27) |
Mar
(35) |
Apr
(22) |
May
|
Jun
(13) |
Jul
(71) |
Aug
(1) |
Sep
(11) |
Oct
(23) |
Nov
(2) |
Dec
(6) |
2005 |
Jan
(15) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
(82) |
Jul
(46) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(17) |
May
|
Jun
|
Jul
|
Aug
(73) |
Sep
(7) |
Oct
(15) |
Nov
|
Dec
(25) |
From: Francesco R. <fr...@us...> - 2006-12-29 17:31:23
|
Update of /cvsroot/jefnet/jef/src/jef/dna/attributes In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5500/attributes Modified Files: Attribute.java Added Files: RuntimeVisibleAnnotationsAttribute.java Log Message: JSR-202 related works Defined some new attributes interfaces (no implementation yet). Index: Attribute.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/attributes/Attribute.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Attribute.java 1 Sep 2006 19:56:10 -0000 1.21 --- Attribute.java 29 Dec 2006 17:31:15 -0000 1.22 *************** *** 18,21 **** --- 18,22 ---- import jef.dna.exceptions.MissingDnaContainerException; import jef.dna.util.BytesCountable; + import jef.dna.util.UpdatableCPTRefs; /** *************** *** 25,29 **** * @author Francesco Russo fr...@cs... */ ! public interface Attribute extends Cloneable, BytesCountable { /** * Set a valid index into the constant pool table. This index has to point to an entry of type --- 26,30 ---- * @author Francesco Russo fr...@cs... */ ! public interface Attribute extends Cloneable, BytesCountable, UpdatableCPTRefs { /** * Set a valid index into the constant pool table. This index has to point to an entry of type --- NEW FILE: RuntimeVisibleAnnotationsAttribute.java --- /* * RuntimeVisibleAnnotationsAttribute.java * * Created on December 29, 2006, 4:57 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes; import java.util.List; import jef.dna.attributes.annotation.DnaAnnotation; /** * The RuntimeVisibleAnnotations attribute is a variable length attribute in the * attributes table of the ClassFile, field_info, and method_info structures. The * RuntimeVisibleAnnotations attribute records runtime-visible Java programming * language annotations on the corresponding class, method, or field. Each * ClassFile, field_info, and method_info structure may contain at most one * RuntimeVisibleAnnotations attribute, which records all the runtime-visible * Java programming language annotations on the corresponding program element. * (Taken from JSR-202 Official Spec.) * * @author frusso */ public interface RuntimeVisibleAnnotationsAttribute extends Attribute { /** * The value of the num_annotations item gives the number of runtime-visible * annotations represented by the structure. Note that a maximum of 65535 * runtimevisible Java programming language annotations may be directly attached * to a program element. * (Taken from JSR-202 Official Spec.) */ public void setNumAnnotations(int num); public int getNumAnnotations(); /** * Each value of the annotations table represents a single runtime-visible * annotation on a program element. * (Taken from JSR-202 Official Spec.) */ public List<DnaAnnotation> getAnnotations(); } |
From: Francesco R. <fr...@us...> - 2006-12-29 17:31:23
|
Update of /cvsroot/jefnet/jef/src/jef/dna/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5500/util Added Files: UpdatableCPTRefs.java Log Message: JSR-202 related works Defined some new attributes interfaces (no implementation yet). --- NEW FILE: UpdatableCPTRefs.java --- /* * UpdatableCPTRefs.java * * Created on December 29, 2006, 5:17 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.util; /** * This interface defines the contract between the JEF runtime and all those * classes/components that hold references to constant pool table entries. * Instances of these classes/components might be subejct to runtime-manipulation, * thus they must implement this interface to enable the JEF runtime correctly * update all their references to the constant pool table as needed. * * @author frusso */ public interface UpdatableCPTRefs { /** * This method updates by the specified offset the references to the * constant pool table that an implementing class/component holds. * @param offset An either positive or negative offset to be applied to all the existing references */ public void updateRefs(int offset); } |
From: Francesco R. <fr...@us...> - 2006-12-29 17:31:20
|
Update of /cvsroot/jefnet/jef/src/jef/dna/attributes/annotation In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5500/attributes/annotation Added Files: DnaAnnotation.java ElementValue.java Log Message: JSR-202 related works Defined some new attributes interfaces (no implementation yet). --- NEW FILE: DnaAnnotation.java --- package jef.dna.attributes.annotation; import java.io.DataInputStream; import java.io.DataOutputStream; import java.util.List; import jef.dna.Dna; import jef.dna.attributes.annotation.DnaAnnotation; import jef.dna.util.UpdatableCPTRefs; /** * This interface represents what an annotation is as dictated by the Java * Class File Spec. */ public interface DnaAnnotation extends UpdatableCPTRefs { /** * The value of the type_index item must be a valid index into the * constant_pool table. The constant_pool entry at that index must be a * CONSTANT_Utf8_info structure representing a field descriptor representing the * annotation type corresponding to the annotation represented by this annotation * structure. */ public void setTypeIndex(int ti); public int getTypeIndex(); /** * The value of the num_element_value_pairs item gives the number of element-value * pairs of the annotation represented by this annotations tructure. Note that a * maximum of 65535 element-value pairs may be contained in a single annotation. */ public void setNumElementValuePairs(int num); public int getNumElementValuePairs(); /** * Each value of the element_value_pairs table represents a single element-value * pair in the annotation represented by this annotation structure. */ public void setElementValuePairs(List<ElementValuePair> pairs); public List<ElementValuePair> getElementValuePairs(); /** * This method allows you to initialize a <code>DnaAnnotation</code> instance * from the provided input stream. */ public void fromStream(DataInputStream dis, Dna dna); /** * This method allows you to flush a <code>DnaAnnotation</code> instance to * the provided output stream. */ public void toStream(DataOutputStream dos); /** * An element_value_pair represents a single element-value * pair in the annotation represented by an annotation structure. */ public interface ElementValuePair extends UpdatableCPTRefs { /** * The value of the element_name_index item must be a valid index into the * constant_pool table. The constant_pool entry at that index must be a * CONSTANT_Utf8_info structure representing the name of the annotation type * element represented by this element_value_pairs entry. */ public void setElementNameIndex(int eni); public int getElementNameIndex(); /** * The value of the value item represents the value of the element-value pair * represented by thiselement_value_pairs entry. */ public void setValue(ElementValue val); public ElementValue getValue(); public void fromStream(DataInputStream dis, Dna dna); public void toStream(DataOutputStream dos); } } --- NEW FILE: ElementValue.java --- /* * ElementValue.java * * Created on December 23, 2006, 5:51 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes.annotation; import java.io.DataInputStream; import java.io.DataOutputStream; import java.util.List; import jef.dna.Dna; import jef.dna.util.UpdatableCPTRefs; /** * The element_value structure is a discriminated union representing the value of an * element-value pair. It is used to represent element values in all attributes that * describe annotations (RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, * RuntimeVisibleParameterAnnotations, and RuntimeInvisibleParameterAnnotations). * * @author frusso */ public interface ElementValue { /** * The tag item indicates the type of this annotatio nelement-value pair.The letters * 'B', 'C', 'D', 'F', 'I', 'J', 'S', and'Z' indicate a primitive type. These letters * are interpreted as BaseType characters (Table 4.2 of the Java Class File Spec.). * The other legal values for tag are listed with their interpretations:<br><br> * <b>s</b>: <code>String</code><br> * <b>e</b>: enum constant<br> * <b>c</b>: class<br> * <b>@</b>: annotation type<br> * <b>[</b>: array<br> */ public void setTag(Tag tag); public Tag getTag(); /** * The value item represents the value of this annotation element. This item is a * union. The tag item, above, determines which item of the union is to be used. * Please, see the Java Class File Spec. for further details. */ public void setValue(Union value); public Union getValue(); public void fromStream(DataInputStream dis, Dna dna); public void toStream(DataOutputStream dos); /********************************************************************************* * A <code>Union</code> represents the value of an annotation element according * to what stated by the JSR-202. This is actually a data-structure that can admit * only one over a set of five different configurations. Which of them will be * applied is dictated by the value of the {@link ElementValue#getTag()} method. */ public interface Union extends UpdatableCPTRefs { /** * The const_value_index item is used if the tag item is one of 'B','C','D','F', * 'I', 'J', 'S', 'Z', or 's'. The value of the const_value_index item must be a valid * index into the constant_pool table. The constant_pool entry at that index must * be of the correct entry type for the field type designated by the tag item. */ public void setConstValueIndex(int cvi); public int getConstValueIndex(); /** * The enum_const_value item is used if the tag item is 'e'. */ public void setEnumConstValue(EnumConstValue ecv); public EnumConstValue getEnumConstValue(); /** * The class_info_index item is used if the tag itemis 'c'. The * class_info_index item must be a valid index into the constant_pool table. * The constant_pool entry at that index must be a CONSTANT_Utf8_info structure * representing the return descriptor (¤4.4.3) of the type that is reified by the * class represented by this element_value structure (e.g., ÔVÕ for Void.class, ÔLjava/lang/Object;Õ for Object, etc.) */ public void setClassInfoIndex(int cii); public int getClassInfoIndex(); /** * The annotation_value item is used if the tag item is '@'.The element_value structure represents a "nested" annotation. */ public void setAnnotationValue(DnaAnnotation a); public DnaAnnotation getAnnotationValue(); /** * The array_value item is used if the tag item is '['. */ public void setArrayValue(ArrayValue av); public ArrayValue getArrayValue(); public void fromStream(DataInputStream dis, Dna dna); public void toStream(DataOutputStream dos); /****************************************************************************** * This interface models the data-structure defined by the Class File Spec. for * representing enum-based annotation values. */ public interface EnumConstValue extends UpdatableCPTRefs { /** * The value of the type_name_index item must be a valid index into the * constant_pool table. The constant_pool entry at that index must be a * CONSTANT_Utf8_info structure representing the binary name (JLS13.1) of the * type of the enum constant represented by this element_value structure. */ public void setTypeNameIndex(int tni); public int getTypeNameIndex(); /** * The value of the const_name_index item must be a valid index into the * constant_pool table. The constant_pool entry at that index must be a * CONSTANT_Utf8_info structure representing the simple name of the enum * constant represented by this element_value structure. */ public void setConstNameIndex(int cni); public int getConstNameIndex(); public void fromStream(DataInputStream dis, Dna dna); public void toStream(DataOutputStream dos); } /******************************************************* * The array_value item is used if the tag item is '['. */ public interface ArrayValue { /** * The value of the num_values item gives the number o felements in the * array-typed value represented by this element_value structure. * Note that a maximum of 65535 elements are permitted in an array-typed element value. */ public void setNumValues(int nv); public int getNumValues(); /** * Each value of the values table gives the value of an element of the array-typed * value represented by this element_value structure. */ public void setValues(List<ElementValue> vals); public List<ElementValue> getValues(); public void fromStream(DataInputStream dis, Dna dna); public void toStream(DataOutputStream dos); } } /** * This enumeration provides all the values admitted by the <code>tag</code> property * of the <code>ElementValue</code> data-structure. * The enumeration provides utility factory methods for instantiating a new <code>Tag</code> * from an <code>int</code>, and for translating an already instantiated <code>Tag</code> * to an <code>int</code>. */ public enum Tag { B { public int getTagValue() { return 'B'; } }, C { public int getTagValue() { return 'C'; } }, D { public int getTagValue() { return 'D'; } }, F { public int getTagValue() { return 'F'; } }, I { public int getTagValue() { return 'I'; } }, J { public int getTagValue() { return 'J'; } }, S { public int getTagValue() { return 'S'; } }, Z { public int getTagValue() { return 'Z'; } }, STRING { public int getTagValue() { return 's'; } }, ENUM_CONSTANT { public int getTagValue() { return 'e'; } }, CLASS { public int getTagValue() { return 'c'; } }, ANNOTATION_TYPE { public int getTagValue() { return '@'; } }, ARRAY { public int getTagValue() { return '['; } }; /** * This method allows you to obtain the <code>int</code> value associated * with the current enum. */ public abstract int getTagValue(); /** * This method allows you to obtain a new <code>Tag</code> instance starting * from its <code>int</code> value. */ public Tag fromInt(int val) { Tag res = null; switch(val) { case 'B' : { res = B; break; } case 'C' : { res = C; break; } case 'D' : { res = D; break; } case 'F' : { res = F; break; } case 'I' : { res = I; break; } case 'J' : { res = J; break; } case 'S' : { res = S; break; } case 'Z' : { res = Z; break; } case 's' : { res = STRING; break; } case 'e' : { res = ENUM_CONSTANT; break; } case 'c' : { res = CLASS; break; } case '@' : { res = ANNOTATION_TYPE; break; } case '[' : { res = ARRAY; break; } default : { //TODO error handling } } return res; } } } |
From: Francesco R. <fr...@us...> - 2006-12-29 17:30:24
|
Update of /cvsroot/jefnet/jef/src/jef/dna/attributes/annotation In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5434/annotation Log Message: Directory /cvsroot/jefnet/jef/src/jef/dna/attributes/annotation added to the repository |
From: Francesco R. <fr...@us...> - 2006-12-23 00:11:13
|
Update of /cvsroot/jefnet/jef In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18507 Modified Files: build.release.xml build.xml Log Message: Committing the new build files produced by Giovanni. Index: build.xml =================================================================== RCS file: /cvsroot/jefnet/jef/build.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** build.xml 21 Dec 2006 18:58:06 -0000 1.29 --- build.xml 23 Dec 2006 00:11:09 -0000 1.30 *************** *** 14,17 **** --- 14,18 ---- <pathelement location="lib/optional.jar"/> <pathelement location="lib/xercesImpl.jar"/> + <pathelement location="lib/clover.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> *************** *** 24,31 **** --- 25,47 ---- <pathelement location="lib/optional.jar"/> <pathelement location="lib/xercesImpl.jar"/> + <pathelement location="lib/clover.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> <path location="classes"/> </path> + + <taskdef resource="clovertasks"/> + + + <target name="init" depends="execution.environment"> + <!-- You can set up any variables you want used throughout the script here. --> + <!-- property name="hello" value="world"/ --> + <!-- To use e.g. Jikes, uncomment this line. --> + <!-- (Or make the same change in Tools | Options | Ant Settings | Properties.) --> + <!-- <property name="build.compiler" value="jikes"/> --> + <!-- You might like to set up some overridable paths, etc.: --> + <property environment="env" /> + <property name="runtimeJefJar" value="dist/jef.jar"/> + </target> <target name="execution.environment"> *************** *** 92,101 **** </target> ! <target description="The JEF Project" name="javadoc"> <mkdir dir="docs"/> <javadoc destdir="docs" packagenames="jef.*" Windowtitle="The JEF Project API" author="true" use="true" source="1.5"> <sourcepath> <pathelement location="src"/> - <pathelement location="${log4j.src}"/> </sourcepath> </javadoc> --- 108,116 ---- </target> ! <target description="The JEF Project" name="javadoc" depends="init"> <mkdir dir="docs"/> <javadoc destdir="docs" packagenames="jef.*" Windowtitle="The JEF Project API" author="true" use="true" source="1.5"> <sourcepath> <pathelement location="src"/> </sourcepath> </javadoc> *************** *** 122,126 **** </target> ! <target depends="clean, cleanLogs, jar" description="Run the test suite." name="simpleTest"> <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"/> --- 137,141 ---- </target> ! <target depends="jar" description="Run the test suite." name="simpleTest"> <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"/> *************** *** 130,133 **** --- 145,149 ---- <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> + <!--jvmarg value="-Djef.home=${env.JEF_HOME}"/--> <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> *************** *** 144,152 **** </target> ! <target depends="clean, cleanLogs, jar" description="Run the deep copy test." name="deepCopyTest"> <echo message="JefNET Proj. deep copy test:"/> <java classname="jef.test.DeepCopyTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> --- 160,169 ---- </target> ! <target depends="jar" description="Run the deep copy test." name="deepCopyTest"> <echo message="JefNET Proj. deep copy test:"/> <java classname="jef.test.DeepCopyTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> + <!--jvmarg value="-Djef.home=${env.JEF_HOME}"/--> <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> *************** *** 165,168 **** --- 182,186 ---- <jvmarg value="-DDna.ConfigFile.URL=config${file.separator}DnaConfig.xml"/> <jvmarg value="-Djef.injection.innerDnasOutFolder=${basedir}${file.separator}classes"/> + <!--jvmarg value="-Djef.home=${env.JEF_HOME}"/--> <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> </java> *************** *** 170,180 **** </target> ! <target depends="clean, cleanLogs, jar" description="Parses the provided class file." name="parse"> <echo message="Working..."/> <loadproperties srcFile="inputParams.properties"/> ! <java classname="jef.test.DnaTest" fork="yes" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> <arg value="${target.parse.inputClass}"/> <arg value="${target.parse.outputClass}"/> --- 188,198 ---- </target> ! <target depends="jar" description="Parses the provided class file." name="parse"> <echo message="Working..."/> <loadproperties srcFile="inputParams.properties"/> ! <java classname="jef.test.DnaTest" fork="yes" output="logs/jefLog" classpathref="rutime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> <arg value="${target.parse.inputClass}"/> <arg value="${target.parse.outputClass}"/> *************** *** 183,185 **** </target> ! </project> \ No newline at end of file --- 201,203 ---- </target> ! </project> Index: build.release.xml =================================================================== RCS file: /cvsroot/jefnet/jef/build.release.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build.release.xml 20 Sep 2004 17:54:02 -0000 1.6 --- build.release.xml 23 Dec 2006 00:11:08 -0000 1.7 *************** *** 9,14 **** <import file="build.xml"/> ! <target name="release-bundle" depends="jar,javadoc,clover.generateReports" description="Distribution with 3rd party libs"> ! <loadproperties srcFile="version.properties"/> <property name="dist.file.name" value="jefnet-${ver.maj}.${ver.min}.${ver.sub}-${ver.state}-bundle"/> <property name="dist.dir" value="releases/${dist.file.name}"/> --- 9,15 ---- <import file="build.xml"/> ! <!-- <target name="release-bundle" depends="jar,javadoc,clover.generateReports" description="Distribution with 3rd party libs"> --> ! <target name="release-bundle" depends="jar,javadoc" description="Distribution with 3rd party libs"> ! <loadproperties srcFile="version.properties"/> <property name="dist.file.name" value="jefnet-${ver.maj}.${ver.min}.${ver.sub}-${ver.state}-bundle"/> <property name="dist.dir" value="releases/${dist.file.name}"/> *************** *** 24,27 **** --- 25,33 ---- <copy file="inputParams.properties" todir="${dist.dir}"/> <copy todir="${dist.dir}/lib"> + <fileset dir="dist"> + <include name="jef.jar"/> + </fileset> + </copy> + <copy todir="${dist.dir}/lib"> <fileset dir="lib"> <exclude name="clover.jar"/> *************** *** 40,46 **** --- 46,54 ---- <fileset dir="docs"/> </copy> + <!-- <copy todir="${dist.dir}/doc/reports"> <fileset dir="clover/reports/clover_html"/> </copy> + --> <copy todir="${dist.dir}/examples/jef/test"> <fileset dir="src/jef/test" casesensitive="yes" excludes="**/CVS, DnaSwapTest.java, DnaSwapper.java, *************** *** 51,55 **** </target> ! <target name="release" depends="jar,javadoc,clover.generateReports" description="Generates a release with no 3rd libs"> <loadproperties srcFile="version.properties"/> <property name="dist.file.name" value="jefnet-${ver.maj}.${ver.min}.${ver.sub}-${ver.state}"/> --- 59,64 ---- </target> ! <!-- <target name="release" depends="jar,javadoc,clover.generateReports" description="Generates a release with no 3rd libs"> --> ! <target name="release" depends="jar,javadoc" description="Generates a release with no 3rd libs"> <loadproperties srcFile="version.properties"/> <property name="dist.file.name" value="jefnet-${ver.maj}.${ver.min}.${ver.sub}-${ver.state}"/> *************** *** 66,70 **** <copy file="inputParams.properties" todir="${dist.dir}"/> <copy todir="${dist.dir}/lib"> ! <fileset dir="lib"> <include name="jef.jar"/> </fileset> --- 75,79 ---- <copy file="inputParams.properties" todir="${dist.dir}"/> <copy todir="${dist.dir}/lib"> ! <fileset dir="dist"> <include name="jef.jar"/> </fileset> |
From: Francesco R. <fr...@us...> - 2006-12-23 00:11:12
|
Update of /cvsroot/jefnet/jef/distware In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18507/distware Modified Files: build.xml Log Message: Committing the new build files produced by Giovanni. Index: build.xml =================================================================== RCS file: /cvsroot/jefnet/jef/distware/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 21 Dec 2006 18:58:06 -0000 1.4 --- build.xml 23 Dec 2006 00:11:08 -0000 1.5 *************** *** 16,24 **** <pathelement location="lib/xercesImpl.jar"/> <pathelement location="lib/commons-beanutils.jar"/> - <pathelement location="lib/commons-beanutils-core.jar"/> - <pathelement location="lib/commons-beanutils-bean-collections.jar"/> <pathelement location="lib/commons-logging-api.jar"/> ! <path location="classes"/> ! <pathelement location="lib/jef.jar"/> </path> --- 16,23 ---- <pathelement location="lib/xercesImpl.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> ! <path location="classes"/> ! <pathelement location="lib/jef.jar"/> ! </path> *************** *** 76,82 **** --- 75,85 ---- <target depends="cleanLogs" description="Run the disconnection test." name="disconnectionTest"> <echo message="JefNET Proj. disconnection test:"/> + <delete dir="classes"/> + <mkdir dir="classes"/> + <unjar src="lib/jef.jar" dest="classes" overwrite="true"/> <java classname="jef.test.MethodDisconnectionTest" fork="yes" classpathref="runtime.class.path"> <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassD.class"/> <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassE.class"/> + <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=1978,server=y,suspend=n"/> <jvmarg value="-DJef.ConfigFile.URL=config${file.separator}JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config${file.separator}DnaConfig.xml"/> |
From: Francesco R. <fr...@us...> - 2006-12-21 19:05:52
|
Update of /cvsroot/jefnet/jef/.settings In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3453 Removed Files: org.eclipse.jdt.core.prefs org.eclipse.jdt.ui.prefs Log Message: Removing old eclipse config files. --- org.eclipse.jdt.core.prefs DELETED --- --- org.eclipse.jdt.ui.prefs DELETED --- |
From: Francesco R. <fr...@us...> - 2006-12-21 18:58:12
|
Update of /cvsroot/jefnet/jef/distware In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32642/distware Modified Files: build.xml Log Message: build.xml Removal of clover dependencies distware/build.xml Removal of clover dependencies, and changes to the classpath. Update to the two previous tests and addition of the disconnectionTest Index: build.xml =================================================================== RCS file: /cvsroot/jefnet/jef/distware/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 20 Sep 2004 17:55:15 -0000 1.3 --- build.xml 21 Dec 2006 18:58:06 -0000 1.4 *************** *** 11,22 **** <!-- Path for execution --> ! <path id="class.path"> ! <pathelement location="lib/ant.jar"/> ! <pathelement location="lib/log4j-1.2.8.jar"/> ! <pathelement location="lib/optional.jar"/> ! <pathelement location="lib/xercesImpl.jar"/> ! <pathelement location="lib/xml-apis.jar"/> ! <pathelement location="lib/jef.jar"/> ! <pathelement location="lib/clover.jar"/> </path> --- 11,24 ---- <!-- Path for execution --> ! <path id="runtime.class.path"> ! <pathelement location="lib/log4j-1.2.8.jar"/> ! <pathelement location="lib/optional.jar"/> ! <pathelement location="lib/xercesImpl.jar"/> ! <pathelement location="lib/commons-beanutils.jar"/> ! <pathelement location="lib/commons-beanutils-core.jar"/> ! <pathelement location="lib/commons-beanutils-bean-collections.jar"/> ! <pathelement location="lib/commons-logging-api.jar"/> ! <path location="classes"/> ! <pathelement location="lib/jef.jar"/> </path> *************** *** 32,91 **** </target> - <target name="check_jef_home" depends="init" unless="env.JEF_HOME"> - <echo message="JEF_HOME environment variable is not defined; the log4j log file will not be generated."/> - </target> - - <!-- Run this target for removing all old log files --> <target description="Remove the old log files." name="cleanLogs"> ! <delete> ! <fileset dir="logs"> ! <include name="*"/> ! </fileset> ! </delete> </target> ! <!-- This target runs a simple example of today basic functionalities of the JEFNet Proj. --> ! <!-- The test firstly run an already existing Java class (SimpleClassA), then manipulates this class adding all the ! methods exposed by another already existing Java class (SimpleClassB). The offspring Java class, which is still ! called SimpleClassA (but it might have any other name!), is then run showing it has been enhanced with all the ! methods of SimpleClassB --> ! <target depends="check_jef_home" description="Run the test suite." name="simpleTest"> ! <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> ! <mkdir dir="classes"/> ! <unjar src="lib/jef.jar" dest="classes"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="class.path"/> ! <echo message=" now mixing SimpleClassA with SimpleClassB..."/> ! <java classname="jef.test.DnaMixTest" fork="yes" output="logs/jefLog" classpathref="class.path"> ! <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <arg value="classes/jef/test/dummies/SimpleClassA.class"/> ! <arg value="classes/jef/test/dummies/SimpleClassB.class"/> ! </java> ! <echo message=" done!"/> ! <move file="SimpleClassA.class" todir="classes/jef/test/dummies/"/> ! <echo message=" SimpleClassA's inner structure and methods output after combination with SimpleClassB:"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes"> ! <classpath> ! <pathelement location="classes"/> ! </classpath> ! </java> ! <delete dir="classes"/> </target> ! <!-- Run the simple parser. See README for more information. --> ! <target depends="check_jef_home" description="Parses the provided class file." name="parse"> ! <echo message="Working..."/> ! <loadproperties srcFile="inputParams.properties"/> ! <java classname="jef.test.DnaTest" fork="yes" output="logs/jefLog" classpathref="class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <arg value="${target.parse.inputClass}"/> ! <arg value="${target.parse.outputClass}"/> </java> ! <echo message="Done!"/> </target> ! </project> ! --- 34,89 ---- </target> <target description="Remove the old log files." name="cleanLogs"> ! <delete> ! <fileset dir="logs"> ! <include name="*"/> ! </fileset> ! </delete> </target> ! <target depends="cleanLogs" description="Run the test suite." name="simpleTest"> ! <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> ! <mkdir dir="classes"/> ! <unjar src="lib/jef.jar" dest="classes" overwrite="true"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"/> ! <echo message=" now mixing SimpleClassA with SimpleClassB..."/> ! <java classname="jef.test.DnaMixTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> ! <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassB.class"/> ! </java> ! <echo message=" done!"/> ! <move file="SimpleClassA.class" todir="classes${file.separator}jef${file.separator}test${file.separator}dummies/"/> ! <echo message=" SimpleClassA's inner structure and methods output after combination with SimpleClassB:"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"> ! </java> </target> ! <target depends="cleanLogs" description="Run the deep copy test." name="deepCopyTest"> ! <echo message="JefNET Proj. deep copy test:"/> ! <java classname="jef.test.DeepCopyTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassB.class"/> </java> ! <echo message="done!"/> ! </target> ! ! <target depends="cleanLogs" description="Run the disconnection test." name="disconnectionTest"> ! <echo message="JefNET Proj. disconnection test:"/> ! <java classname="jef.test.MethodDisconnectionTest" fork="yes" classpathref="runtime.class.path"> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassD.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassE.class"/> ! <jvmarg value="-DJef.ConfigFile.URL=config${file.separator}JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config${file.separator}DnaConfig.xml"/> ! <jvmarg value="-Djef.injection.innerDnasOutFolder=${basedir}${file.separator}classes"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> ! </java> ! <echo message="done!"/> </target> ! </project> \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:58:12
|
Update of /cvsroot/jefnet/jef In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32642 Modified Files: inputParams.properties build.xml Log Message: build.xml Removal of clover dependencies distware/build.xml Removal of clover dependencies, and changes to the classpath. Update to the two previous tests and addition of the disconnectionTest Index: build.xml =================================================================== RCS file: /cvsroot/jefnet/jef/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** build.xml 4 Oct 2006 16:35:53 -0000 1.28 --- build.xml 21 Dec 2006 18:58:06 -0000 1.29 *************** *** 14,18 **** <pathelement location="lib/optional.jar"/> <pathelement location="lib/xercesImpl.jar"/> - <pathelement location="lib/clover.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> --- 14,17 ---- *************** *** 25,38 **** <pathelement location="lib/optional.jar"/> <pathelement location="lib/xercesImpl.jar"/> - <pathelement location="lib/clover.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> <path location="classes"/> </path> - - <taskdef resource="clovertasks"/> ! <target name="execution.environment"> ! <echo message=""/> <echo message="Operating System"/> --- 24,33 ---- <pathelement location="lib/optional.jar"/> <pathelement location="lib/xercesImpl.jar"/> <pathelement location="lib/commons-beanutils.jar"/> <pathelement location="lib/commons-logging-api.jar"/> <path location="classes"/> </path> ! <target name="execution.environment"> <echo message=""/> <echo message="Operating System"/> *************** *** 58,103 **** <echo message=""/> <echo message="Ant"/> ! <echo message="ant.version: ${ant.version}"/> ! <echo message="ant.java.version: ${ant.java.version}"/> ! </target> ! ! <target name="with.clover"> ! <mkdir dir="clover"/> ! <clover-setup initString="clover/mycoverage.db"/> ! </target> ! ! <target name="clover.html" depends="with.clover"> ! <mkdir dir="clover/reports"/> ! <clover-report> ! <current outfile="clover/reports/clover_html"> ! <format type="html"/> ! </current> ! </clover-report> ! </target> ! ! <target name="init" depends="execution.environment"> ! <!-- You can set up any variables you want used throughout the script here. --> ! <!-- property name="hello" value="world"/ --> ! <!-- To use e.g. Jikes, uncomment this line. --> ! <!-- (Or make the same change in Tools | Options | Ant Settings | Properties.) --> ! <!-- <property name="build.compiler" value="jikes"/> --> ! <!-- You might like to set up some overridable paths, etc.: --> ! <property environment="env" /> ! <property name="runtimeJefJar" value="dist/jef.jar"/> ! <property name="log4j.src" value="/usr/local/ApplInst/Languages/JavaAdds/jakarta-log4j-1.2.8/src"/> ! </target> ! ! <target name="check_jef_home" unless="env.JEF_HOME"> ! <echo message="JEF_HOME environment variable is not defined; the log4j log file will not be generated."/> ! </target> ! ! <target depends="init,clean" name="clover.compileDummies"> ! <mkdir dir="classes"/> ! <javac debug="true" optimize="true" deprecation="true" destdir="classes" srcdir="src/jef/test/dummies/" classpathref="class.path" source="1.5"> ! <compilerarg line="-Xlint:unchecked"/> ! </javac> </target> ! <target depends="init,clean" name="compile"> <!-- Both srcdir and destdir should be package roots. --> <!-- They could be different of course; in that case NetBeans can also be set --> --- 53,61 ---- <echo message=""/> <echo message="Ant"/> ! <echo message="ant.version: ${ant.version}"/> ! <echo message="ant.java.version: ${ant.java.version}"/> </target> ! <target depends="clean" name="compile"> <!-- Both srcdir and destdir should be package roots. --> <!-- They could be different of course; in that case NetBeans can also be set --> *************** *** 113,131 **** </target> ! <target depends="init" name="clover.compile"> ! <!-- Both srcdir and destdir should be package roots. --> ! <!-- They could be different of course; in that case NetBeans can also be set --> ! <!-- up to compile to a different filesystem in the same way; see Compiler Types: --> ! <mkdir dir="classes"/> ! <javac debug="true" optimize="true" deprecation="true" destdir="classes" srcdir="src" classpathref="class.path"> ! <!-- To add something to the classpath: --> ! <!-- <classpath> <pathelement location="${mylib}"/> </classpath>--> ! <!-- To exclude some files: --> ! <!-- <exclude name="com/foo/SomeFile.java"/> <exclude name="com/foo/somepackage/"/>--> ! <exclude name="jef/test/dummies/"/> ! </javac> ! </target> ! ! <target depends="init,clean,compile" name="jar"> <!-- To make a standalone app: --> <!-- 1. Create a myapp.mf manifest somewhere. --> --- 71,75 ---- </target> ! <target depends="clean,compile" name="jar"> <!-- To make a standalone app: --> <!-- 1. Create a myapp.mf manifest somewhere. --> *************** *** 144,168 **** </target> ! <target depends="clover.compile" name="clover.jar"> ! <!-- To make a standalone app: --> ! <!-- 1. Create a myapp.mf manifest somewhere. --> ! <!-- 2. Put in it: --> ! <!-- Manifest-Version: 1.0 --> ! <!-- Main-Class: com.foo.Main --> ! <!-- 3. Pass to <jar>: manifest="myapp.mf" --> ! <jar basedir="classes" compress="true" jarfile="dist/jef.jar"> ! <exclude name="**/*.java"/> ! <exclude name="**/*.form"/> ! <exclude name="jef.mf"/> ! <exclude name="jef.jar"/> ! <exclude name="apidoc"/> ! </jar> ! </target> ! ! <target depends="init,clean,compile,jar" description="Build everything." name="all"> <echo message="Application built!"/> </target> ! <target depends="init" description="The JEF Project" name="javadoc"> <mkdir dir="docs"/> <javadoc destdir="docs" packagenames="jef.*" Windowtitle="The JEF Project API" author="true" use="true" source="1.5"> --- 88,96 ---- </target> ! <target depends="clean,compile,jar" description="Build everything." name="all"> <echo message="Application built!"/> </target> ! <target description="The JEF Project" name="javadoc"> <mkdir dir="docs"/> <javadoc destdir="docs" packagenames="jef.*" Windowtitle="The JEF Project API" author="true" use="true" source="1.5"> *************** *** 174,178 **** </target> ! <target depends="init" description="Clean all build products." name="clean"> <mkdir dir="classes"/> <delete> --- 102,106 ---- </target> ! <target description="Clean all build products." name="clean"> <mkdir dir="classes"/> <delete> *************** *** 194,198 **** </target> ! <target depends="jar, check_jef_home" description="Run the test suite." name="simpleTest"> <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"/> --- 122,126 ---- </target> ! <target depends="clean, cleanLogs, jar" description="Run the test suite." name="simpleTest"> <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="runtime.class.path"/> *************** *** 202,211 **** <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <arg value="classes/jef/test/dummies/SimpleClassA.class"/> ! <arg value="classes/jef/test/dummies/SimpleClassB.class"/> </java> <echo message=" done!"/> ! <move file="SimpleClassA.class" todir="classes/jef/test/dummies/"/> <echo message=" SimpleClassA's inner structure and methods output after combination with SimpleClassB:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes"> --- 130,139 ---- <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassB.class"/> </java> <echo message=" done!"/> ! <move file="SimpleClassA.class" todir="classes${file.separator}jef${file.separator}test${file.separator}dummies/"/> <echo message=" SimpleClassA's inner structure and methods output after combination with SimpleClassB:"/> <java classname="jef.test.dummies.SimpleClassA" fork="yes"> *************** *** 216,227 **** </target> ! <target depends="jar, check_jef_home" description="Run the deep copy test." name="deepCopyTest"> <echo message="JefNET Proj. deep copy test:"/> <java classname="jef.test.DeepCopyTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <arg value="classes/jef/test/dummies/SimpleClassA.class"/> ! <arg value="classes/jef/test/dummies/SimpleClassB.class"/> </java> <echo message="done!"/> --- 144,155 ---- </target> ! <target depends="clean, cleanLogs, jar" description="Run the deep copy test." name="deepCopyTest"> <echo message="JefNET Proj. deep copy test:"/> <java classname="jef.test.DeepCopyTest" fork="yes" output="logs/jefLog" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassA.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassB.class"/> </java> <echo message="done!"/> *************** *** 231,276 **** <echo message="JefNET Proj. disconnection test:"/> <java classname="jef.test.MethodDisconnectionTest" fork="yes" classpathref="runtime.class.path"> ! <arg value="classes/jef/test/dummies/SimpleClassD.class"/> ! <arg value="classes/jef/test/dummies/SimpleClassE.class"/> <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=1978,server=y,suspend=n"/> ! <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <jvmarg value="-Dlog4j.configuration=config/log4j.xml"/> </java> <echo message="done!"/> </target> ! <target depends="clover.compileDummies, with.clover, clover.jar" description="Run the test suite to generate Clover reports." name="clover.generateReports"> ! <echo message="Test suite for generating Clover code coverage reports, only available to developers..."/> ! <echo message="JefNET Proj. simple test: jef.test.dummies.SimpleClassA's inner structure and methods output before manipulation:"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes" classpathref="class.path"/> ! <echo message=" now mixing SimpleClassA with SimpleClassB..."/> ! <java classname="jef.test.DnaMixTest" fork="yes" output="logs/jefLog" classpathref="class.path"> ! <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> ! <arg value="classes/jef/test/dummies/SimpleClassA.class"/> ! <arg value="classes/jef/test/dummies/SimpleClassB.class"/> ! </java> ! <echo message=" done!"/> ! <move file="SimpleClassA.class" todir="classes/jef/test/dummies/"/> ! <echo message=" SimpleClassA's inner structure and methods output after combination with SimpleClassB:"/> ! <java classname="jef.test.dummies.SimpleClassA" fork="yes"> ! <classpath> ! <pathelement location="classes"/> ! </classpath> ! </java> ! <antcall target="clover.genericsTest"/> ! <antcall target="clover.html"/> ! </target> ! ! <target depends="check_jef_home" description="Parses the provided class file." name="parse"> <echo message="Working..."/> <loadproperties srcFile="inputParams.properties"/> ! <java classname="jef.test.DnaTest" fork="yes" output="logs/jefLog" classpathref="rutime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Djef.home=${env.JEF_HOME}"/> <arg value="${target.parse.inputClass}"/> <arg value="${target.parse.outputClass}"/> --- 159,180 ---- <echo message="JefNET Proj. disconnection test:"/> <java classname="jef.test.MethodDisconnectionTest" fork="yes" classpathref="runtime.class.path"> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassD.class"/> ! <arg value="classes${file.separator}jef${file.separator}test${file.separator}dummies${file.separator}SimpleClassE.class"/> <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=1978,server=y,suspend=n"/> ! <jvmarg value="-DJef.ConfigFile.URL=config${file.separator}JefConfig.xml"/> ! <jvmarg value="-DDna.ConfigFile.URL=config${file.separator}DnaConfig.xml"/> ! <jvmarg value="-Djef.injection.innerDnasOutFolder=${basedir}${file.separator}classes"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> </java> <echo message="done!"/> </target> ! <target depends="clean, cleanLogs, jar" description="Parses the provided class file." name="parse"> <echo message="Working..."/> <loadproperties srcFile="inputParams.properties"/> ! <java classname="jef.test.DnaTest" fork="yes" classpathref="runtime.class.path"> <jvmarg value="-DJef.ConfigFile.URL=config/JefConfig.xml"/> <jvmarg value="-DDna.ConfigFile.URL=config/DnaConfig.xml"/> ! <jvmarg value="-Dlog4j.configuration=config${file.separator}log4j.xml"/> <arg value="${target.parse.inputClass}"/> <arg value="${target.parse.outputClass}"/> *************** *** 278,287 **** <echo message="Done!"/> </target> - - <target description="Run the test suite." name="clover.genericsTest"> - <echo message="Testing the ValidationExceptionHelper..."/> - <java classname="jef.dna.util.ValidationExceptionHelperTest" fork="yes" classpathref="class.path"/> - <echo message="... done!"/> - </target> ! </project> --- 182,185 ---- <echo message="Done!"/> </target> ! </project> \ No newline at end of file Index: inputParams.properties =================================================================== RCS file: /cvsroot/jefnet/jef/inputParams.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inputParams.properties 13 Apr 2006 17:33:08 -0000 1.3 --- inputParams.properties 21 Dec 2006 18:58:06 -0000 1.4 *************** *** 14,16 **** # Dna instance will be written to. target.parse.inputClass=classes/jef/test/dummies/SimpleClassE.class ! target.parse.outputClass= --- 14,16 ---- # Dna instance will be written to. target.parse.inputClass=classes/jef/test/dummies/SimpleClassE.class ! target.parse.outputClass=ParsedClass.class |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:46
|
Update of /cvsroot/jefnet/jef/src/jef/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/test Modified Files: MethodDisconnectionTest.java DnaMixTest.java DeepCopyTest.java DnaTest.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: DnaMixTest.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/test/DnaMixTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DnaMixTest.java 2 Jul 2005 21:07:58 -0000 1.18 --- DnaMixTest.java 21 Dec 2006 18:49:32 -0000 1.19 *************** *** 32,37 **** public static void main(String[] args) throws InstantiatorException, MissingDnaContainerException, DnaDeserializationException, DnaSerializationException, IOException { ! // configuring log properties from file ! DOMConfigurator.configure(System.getProperty("jef.home") + "/config/log4j.xml"); try { logger.info(className + ".main(); start"); --- 32,37 ---- public static void main(String[] args) throws InstantiatorException, MissingDnaContainerException, DnaDeserializationException, DnaSerializationException, IOException { ! System.out.println("log4j.configuration value: " + System.getProperty("log4j.configuration")); ! DOMConfigurator.configure(System.getProperty("log4j.configuration")); try { logger.info(className + ".main(); start"); Index: DeepCopyTest.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/test/DeepCopyTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DeepCopyTest.java 2 Jul 2005 21:07:58 -0000 1.7 --- DeepCopyTest.java 21 Dec 2006 18:49:32 -0000 1.8 *************** *** 35,41 **** public static void main(String[] args) throws DnaDeserializationException, DeepCopyException, MissingDnaContainerException, DnaSerializationException, InstantiatorException, UnknownDeepCopierException, CloneNotSupportedException { - System.out.println("JEF_HOME value: " + System.getenv("JEF_HOME")); System.out.println("log4j.configuration value: " + System.getProperty("log4j.configuration")); ! DOMConfigurator.configure(System.getProperty("jef.home") + "/config/log4j.xml"); try { logger.info(className + ".main(); start"); --- 35,40 ---- public static void main(String[] args) throws DnaDeserializationException, DeepCopyException, MissingDnaContainerException, DnaSerializationException, InstantiatorException, UnknownDeepCopierException, CloneNotSupportedException { System.out.println("log4j.configuration value: " + System.getProperty("log4j.configuration")); ! DOMConfigurator.configure(System.getProperty("log4j.configuration")); try { logger.info(className + ".main(); start"); Index: MethodDisconnectionTest.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/test/MethodDisconnectionTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MethodDisconnectionTest.java 4 Oct 2006 16:35:52 -0000 1.8 --- MethodDisconnectionTest.java 21 Dec 2006 18:49:32 -0000 1.9 *************** *** 66,70 **** /** Creates a new instance of MethodDisconnectionTest */ public MethodDisconnectionTest(String classFileName1,String classFileName2) { - System.out.println("JEF_HOME value: " + System.getenv("JEF_HOME")); System.out.println("log4j.configuration value: " + System.getProperty("log4j.configuration")); DOMConfigurator.configure(System.getProperty("log4j.configuration")); --- 66,69 ---- *************** *** 101,106 **** // and let's extract it md.extract(srcMis, dnaIn, dm); ! logger.info("Method with nameIndex "+srcMis.getNameIndex()+" has been disconnected."); // now we obtain a valid injector --- 100,108 ---- // and let's extract it + long start = System.nanoTime(); md.extract(srcMis, dnaIn, dm); ! long elapsed = System.nanoTime() - start; ! System.out.println("* Method-chain has been disconnected in "+elapsed+" nanosec(s) *"); ! logger.info("Method with nameIndex "+srcMis.getNameIndex()+" has been disconnected in "+elapsed+" nanosec(s)"); // now we obtain a valid injector *************** *** 108,112 **** --- 110,117 ---- Injector injector = injectorsFactory.getInstance(); // and inject into the destination class the extracted chain of methods + start = System.nanoTime(); injector.inject(dnaOut,dm); + elapsed = System.nanoTime() - start; + System.out.println("* Method-chain has been injected in "+elapsed+" nanosec(s) *"); // that's all, now simply write down the newly modified class Index: DnaTest.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/test/DnaTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DnaTest.java 2 Jul 2005 21:07:58 -0000 1.17 --- DnaTest.java 21 Dec 2006 18:49:32 -0000 1.18 *************** *** 19,23 **** public class DnaTest { public static void main(String[] args) throws DnaSerializationException, DnaDeserializationException, MissingDnaContainerException, InstantiatorException, FileNotFoundException { ! DOMConfigurator.configure(System.getProperty("jef.home") + "/config/log4j.xml"); if (args.length > 0) { DnaReader dnaReader1 = new DnaReader(new File(args[0])); --- 19,24 ---- public class DnaTest { public static void main(String[] args) throws DnaSerializationException, DnaDeserializationException, MissingDnaContainerException, InstantiatorException, FileNotFoundException { ! System.out.println("log4j.configuration value: " + System.getProperty("log4j.configuration")); ! DOMConfigurator.configure(System.getProperty("log4j.configuration")); if (args.length > 0) { DnaReader dnaReader1 = new DnaReader(new File(args[0])); |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:40
|
Update of /cvsroot/jefnet/jef/src/jef/injection/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/injection/impl Modified Files: DefaultInjector.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: DefaultInjector.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/injection/impl/DefaultInjector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultInjector.java 4 Oct 2006 16:35:53 -0000 1.1 --- DefaultInjector.java 21 Dec 2006 18:49:33 -0000 1.2 *************** *** 10,18 **** --- 10,25 ---- package jef.injection.impl; + import java.io.File; import java.util.Collection; + import java.util.HashMap; + import java.util.List; + import java.util.Set; import jef.disconnection.DisconnectedMethod; + import jef.disconnection.impl.InnerDnaSpawningException; import jef.dna.Dna; + import jef.dna.DnaWriter; import jef.dna.attributes.Attribute; import jef.dna.attributes.CodeAttribute; + import jef.dna.attributesTable.AttributesTable; import jef.dna.constantInfo.ConstUtf8; import jef.dna.constantInfo.ConstantInfo; *************** *** 22,25 **** --- 29,34 ---- import jef.dna.constantPoolTable.ConstantPoolTable; import jef.dna.constantPoolTable.exceptions.WrongReferenceInConstantPoolTableException; + import jef.dna.exceptions.DnaSerializationException; + import jef.dna.exceptions.MissingDnaContainerException; import jef.dna.fieldsTable.FieldsTable; import jef.dna.instructions.impl.ALoad_0; *************** *** 48,51 **** --- 57,61 ---- FieldsTable f = dm.getFields(); ConstantPoolTable cpt = dm.getConstantPoolTable(); + AttributesTable attrs = dm.getAttributes(); int dim = dstDna.getConstantPoolTable().size(); *************** *** 57,64 **** dstDna.getConstantPoolTable().addAll(cpt); } try { updateConstantClassInfoRefs(dstDna.getConstantPoolTable(),dm.getSrcClassFqn(),dstDna.getFqnAsString(dstDna.getFqnReference())); } catch (WrongReferenceInConstantPoolTableException e) { ! String msg = ""; InjectionException ie = new InjectionException(msg,e); logger.fatal(msg,ie); --- 67,75 ---- dstDna.getConstantPoolTable().addAll(cpt); } + try { updateConstantClassInfoRefs(dstDna.getConstantPoolTable(),dm.getSrcClassFqn(),dstDna.getFqnAsString(dstDna.getFqnReference())); } catch (WrongReferenceInConstantPoolTableException e) { ! String msg = "Unable to properly replace all those ConstUTF8 CPT entries with the new destination DNA FQN"; InjectionException ie = new InjectionException(msg,e); logger.fatal(msg,ie); *************** *** 84,92 **** } // at the end of the <init> method of the dstDna instance, we have to add // the invocation of the "_jef_init()" method // this is accomplished by means of the following two bytecode instructions: // 0. aload_0 ! // 1. invokevirtual #CPT_INDEX; //Method jef/test/dummies/SimpleClassE._jef_init:()V Collection<Attribute> initAttrs = dstDna.getInitMethod().getAttributes(); for(Attribute attr : initAttrs) { --- 95,112 ---- } + if(attrs!=null) { + for(int i=0;i<attrs.size();i++) { + attrs.get(i).updateRefs(dim); + attrs.get(i).setDna(dstDna); + } + attrs.setDna(dstDna); + dstDna.getAttributes().addAll(attrs); + } + // at the end of the <init> method of the dstDna instance, we have to add // the invocation of the "_jef_init()" method // this is accomplished by means of the following two bytecode instructions: // 0. aload_0 ! // 1. invokevirtual #CPT_INDEX; //Method fully/qualified/ClassName._jef_init:()V Collection<Attribute> initAttrs = dstDna.getInitMethod().getAttributes(); for(Attribute attr : initAttrs) { *************** *** 99,108 **** // method name ConstantUtf8 cutf8MethodName = new ConstantUtf8(); ! cutf8MethodName.setValue(/*_jef_init*/"_jef_init".getBytes()); dstDna.getConstantPoolTable().addElement(cutf8MethodName); int nameIdx = dstDna.getConstantPoolTable().size(); // method descr ConstantUtf8 cutf8MethodDesc = new ConstantUtf8(); ! cutf8MethodDesc.setValue(/*()V*/"()V".getBytes()); dstDna.getConstantPoolTable().addElement(cutf8MethodDesc); int descIdx = dstDna.getConstantPoolTable().size(); --- 119,128 ---- // method name ConstantUtf8 cutf8MethodName = new ConstantUtf8(); ! cutf8MethodName.setValue("_jef_init".getBytes()); dstDna.getConstantPoolTable().addElement(cutf8MethodName); int nameIdx = dstDna.getConstantPoolTable().size(); // method descr ConstantUtf8 cutf8MethodDesc = new ConstantUtf8(); ! cutf8MethodDesc.setValue("()V".getBytes()); dstDna.getConstantPoolTable().addElement(cutf8MethodDesc); int descIdx = dstDna.getConstantPoolTable().size(); *************** *** 125,128 **** --- 145,166 ---- } } + try { + processInnerClasses(dm.getInnerClasses(),dstDna.getFqnAsString(dstDna.getFqnReference())); + } catch (MissingDnaContainerException ex) { + String msg = "Unable to generate new Java class file for a new inner-dna instance."; + InnerDnaSpawningException e = new InnerDnaSpawningException(msg,ex); + logger.fatal(msg,e); + throw e; + } catch (WrongReferenceInConstantPoolTableException ex) { + String msg = "Unable to generate new Java class file for a new inner-dna instance."; + InnerDnaSpawningException e = new InnerDnaSpawningException(msg,ex); + logger.fatal(msg,e); + throw e; + } catch (DnaSerializationException ex) { + String msg = "Unable to generate new Java class file for a new inner-dna instance."; + InnerDnaSpawningException e = new InnerDnaSpawningException(msg,ex); + logger.fatal(msg,e); + throw e; + } } *************** *** 142,146 **** */ protected void updateConstantClassInfoRefs(ConstantPoolTable cpt, String fqClassName, String newFqn) throws WrongReferenceInConstantPoolTableException { - long startTime = System.currentTimeMillis(); int size = cpt.size(); logger.info(className + ".updateConstantClassInfoRefs(); updating references to fully qualified class name: old FQN is " + fqClassName); --- 180,183 ---- *************** *** 151,155 **** String value = new String(utf8.getValue()); if(value.contains(fqClassName)) { - logger.debug("### index i = "+i+": Replacing "+value+" with "+newFqn+"..."); int start = value.indexOf(fqClassName); String value1 = value.substring(0,start); --- 188,191 ---- *************** *** 163,166 **** --- 199,218 ---- } + //TODO: comment + protected void processInnerClasses(HashMap<String,Dna> innerClasses, String newFqn) throws WrongReferenceInConstantPoolTableException, DnaSerializationException, MissingDnaContainerException { + Set<String> innerClassesFqns = innerClasses.keySet(); + for(String innerFqn : innerClassesFqns) { + Dna innerDna = innerClasses.get(innerFqn); + String oldOuterFqn = innerFqn.substring(0,innerFqn.indexOf("$")); + updateConstantClassInfoRefs(innerDna.getConstantPoolTable(),oldOuterFqn,newFqn); + + String newPkgName = newFqn.substring(0,newFqn.lastIndexOf("/")); + String newSimpleName = newFqn.substring(newFqn.lastIndexOf("/")+1,newFqn.length()); + String innerSimpleName = innerFqn.substring(innerFqn.indexOf("$")+1,innerFqn.length()); + //TODO: redefine how we decide where new innerclasses should be written to + DnaWriter.write(System.getProperty("jef.injection.innerDnasOutFolder")+File.separator+newPkgName,newSimpleName+"$"+innerSimpleName,innerDna); + } + } + private static String className = DefaultInjector.class.getName(); protected static Logger logger = Logger.getRootLogger(); |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:40
|
Update of /cvsroot/jefnet/jef/src/jef/test/dummies In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/test/dummies Modified Files: SimpleClassD.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: SimpleClassD.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/test/dummies/SimpleClassD.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleClassD.java 28 Aug 2006 18:40:26 -0000 1.3 --- SimpleClassD.java 21 Dec 2006 18:49:33 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- package jef.test.dummies; + import java.util.Date; + /** * *************** *** 20,28 **** } public void foo() { ! System.out.println("Beginning of the 'public void foo()' method taken from class SimpleClassD"); System.out.println(bar()); ! InnerClass innerClass = new InnerClass(); ! innerClass.nop(); System.out.println("End of the 'public void foo()' method taken from class SimpleClassD"); } --- 22,33 ---- } + //****************************************************************** methods public void foo() { ! System.out.println("*** TEST METHOD CHAIN & NESTED CLASSES ***"); ! System.out.println("Beginning of the 'public void foo()' method taken from class SimpleClassD\nToday is: "+date); System.out.println(bar()); ! NestedClass nestedClass = new NestedClass(); ! nestedClass.nop(); ! testInnerClasses(); System.out.println("End of the 'public void foo()' method taken from class SimpleClassD"); } *************** *** 49,59 **** } private int value = 10; } ! // inner class for testing the InnerClasses attribute ! class InnerClass { public void nop() { ! System.out.println("This is the 'public void nop()' method taken from inner class SimpleClassD.InnerClass"); } } \ No newline at end of file --- 54,103 ---- } + private void testInnerClasses() { + System.out.println("*** TEST INNER CLASSES ***"); + FirstInnerClass firstInnerClass = new FirstInnerClass(); + firstInnerClass.firstInnerClassMethod(); + secondInnerClass.secondInnerClassMethod(); + thirdInnerClass.thirdInnerClassMethod(); + FourthInnerClass fourthInnerClass = new FourthInnerClass(); + fourthInnerClass.fourthInnerClassMethod(); + } + + //*************************************************************** properties private int value = 10; + private SecondInnerClass secondInnerClass = new SecondInnerClass(); + private ThirdInnerClass thirdInnerClass = new ThirdInnerClass(); + private Date date = new Date(System.currentTimeMillis()); + + //************************************************************ Inner classes + public class FirstInnerClass { + public void firstInnerClassMethod() { + System.out.println("This is the 'public void firstInnerClassMethod()' method taken from inner 'public class SimpleClassD$FirstInnerClass'"); + } + } + + protected class SecondInnerClass { + protected void secondInnerClassMethod() { + System.out.println("This is the 'protected void secondInnerClassMethod()' method taken from inner 'protected class SimpleClassD$SecondInnerClass'"); + } + } + + class ThirdInnerClass { + void thirdInnerClassMethod() { + System.out.println("This is the 'void thirdInnerClassMethod()' method taken from inner 'class SimpleClassD$ThirdInnerClass'"); + } + } + + private class FourthInnerClass { + private void fourthInnerClassMethod() { + System.out.println("This is the 'private void fourthInnerClassMethod()' method taken from inner 'private class SimpleClassD$FourthInnerClass'"); + } + } } ! //***************************************************************** Nested class ! class NestedClass { public void nop() { ! System.out.println("This is the 'public void nop()' method taken from nested class SimpleClassD.NestedClass"); } } \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:39
|
Update of /cvsroot/jefnet/jef/src/jef/dna/constantInfo In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna/constantInfo Modified Files: ConstUtf8.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: ConstUtf8.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/constantInfo/ConstUtf8.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConstUtf8.java 2 Jul 2005 21:07:56 -0000 1.8 --- ConstUtf8.java 21 Dec 2006 18:49:33 -0000 1.9 *************** *** 52,54 **** */ public void setValue(byte[] val); ! } --- 52,54 ---- */ public void setValue(byte[] val); ! } \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/disconnection In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/disconnection Modified Files: DisconnectedField.java DisconnectedMethod.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: DisconnectedMethod.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/disconnection/DisconnectedMethod.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DisconnectedMethod.java 13 Apr 2006 17:33:09 -0000 1.6 --- DisconnectedMethod.java 21 Dec 2006 18:49:32 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- import jef.config.exceptions.InstantiatorException; + import jef.dna.Dna; import jef.dna.infoStructures.MethodInfoStructure; import jef.dna.methodsTable.MethodsTable; Index: DisconnectedField.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/disconnection/DisconnectedField.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DisconnectedField.java 4 Oct 2006 16:35:53 -0000 1.8 --- DisconnectedField.java 21 Dec 2006 18:49:32 -0000 1.9 *************** *** 10,16 **** --- 10,20 ---- import java.util.Collection; + import java.util.HashMap; import java.util.List; import jef.config.exceptions.InstantiatorException; + import jef.dna.Dna; + import jef.dna.attributes.Attribute; import jef.dna.attributes.CodeAttribute; + import jef.dna.attributesTable.AttributesTable; import jef.dna.constantPoolTable.ConstantPoolTable; import jef.dna.fieldsTable.FieldsTable; *************** *** 79,81 **** --- 83,116 ---- */ public String getSrcClassFqn(); + + /** + * This method allows adding a class-level attribute to this disconnected structure. + * All the attributes added by means of this method will be added to the class-level + * attributes of the resulting class. + * + * @param attr The attribute to add + */ + public void addAttribute(Attribute attr) throws InstantiatorException; + + /** + * Returns the whole list of added attributes by reference, or <code>null</code>. + * + * @return The added attributes or <code>null</code> + */ + public AttributesTable getAttributes(); + + /** + * This method adds a new <i>inner Dna</i> to the disconnected data-structure. + * + * @param fqn + * @param innerDna + */ + public void addInnerClass(String fqn, Dna innerDna); + + /** + * Returns the map of <i>inner Dnas</i> indexed by their fully qualified class names. + * + * @return The map of <i>inner Dnas</i> indexed by their fully qualified class names + */ + public HashMap<String,Dna> getInnerClasses(); } \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/dna/attributes/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna/attributes/impl Modified Files: ExceptionAttr.java AttributeFactory.java Added Files: Signature.java SourceDebugExtension.java EnclosingMethod.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: AttributeFactory.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/attributes/impl/AttributeFactory.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AttributeFactory.java 2 Jul 2005 21:07:54 -0000 1.14 --- AttributeFactory.java 21 Dec 2006 18:49:32 -0000 1.15 *************** *** 15,18 **** --- 15,19 ---- import jef.dna.attributes.AttribFactory; import jef.dna.attributes.Attribute; + import jef.dna.attributes.AttributeTypes; import jef.dna.attributes.exceptions.UnsupportedAttributeException; import jef.dna.constantInfo.ConstUtf8; *************** *** 31,73 **** private static final String className = AttributeFactory.class.getName(); ! public Attribute getInstance(int type) throws UnsupportedAttributeException { Attribute res = null; switch (type) { ! case CODE: { res = new Code(); break; } ! case CONSTANT: { res = new ConstantValue(); break; } ! case DEPRECATED: { res = new DeprecatedAttribute(); break; } ! case EXCEPTIONS: { res = new ExceptionAttr(); break; } ! case INNERCLASSES: { res = new InnerClasses(); break; } ! case LINENUMBERTABLE: { res = new LineNumberTableAttribute(); break; } ! case LOCALVARIABLETABLE: { res = new LocalVariableTableAttribute(); break; } ! case SOURCEFILE: { res = new SourceFileAttribute(); break; } ! case SYNTHETIC: { res = new SyntheticAttribute(); break; } default: { UnsupportedAttributeException uae = new UnsupportedAttributeException("Unable to instantiate the requested attribute. Supplied code is: " + type); --- 32,86 ---- private static final String className = AttributeFactory.class.getName(); ! public Attribute getInstance(AttributeTypes type) throws UnsupportedAttributeException { Attribute res = null; switch (type) { ! case Code: { res = new Code(); break; } ! case ConstantValue: { res = new ConstantValue(); break; } ! case Deprecated: { res = new DeprecatedAttribute(); break; } ! case Exceptions: { res = new ExceptionAttr(); break; } ! case InnerClasses: { res = new InnerClasses(); break; } ! case LineNumberTable: { res = new LineNumberTableAttribute(); break; } ! case LocalVariableTable: { res = new LocalVariableTableAttribute(); break; } ! case SourceFile: { res = new SourceFileAttribute(); break; } ! case Synthetic: { res = new SyntheticAttribute(); break; } + case EnclosingMethod: { + res = new EnclosingMethod(); + break; + } + case Signature: { + res = new Signature(); + break; + } + case SourceDebugExtension: { + res = new SourceDebugExtension(); + break; + } default: { UnsupportedAttributeException uae = new UnsupportedAttributeException("Unable to instantiate the requested attribute. Supplied code is: " + type); *************** *** 102,155 **** throw dde; } ! if (attributeType.equals(ATTRIBUTE_CONSTANT)) { ! res = new ConstantValue(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_CODE)) { ! res = new Code(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_EXCEPTIONS)) { ! res = new ExceptionAttr(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_INNERCLASSES)) { ! res = new InnerClasses(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_SYNTHETIC)) { ! res = new SyntheticAttribute(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_SOURCEFILE)) { ! res = new SourceFileAttribute(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_LINENUMBERTABLE)) { ! res = new LineNumberTableAttribute(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_LOCALVARIABLETABLE)) { ! res = new LocalVariableTableAttribute(); ! } ! else { ! if (attributeType.equals(ATTRIBUTE_DEPRECATED)) { ! res = new DeprecatedAttribute(); ! } ! else { ! String msg = "Unable to instantiate the requested attribute. Supplied code is: " + attributeType; ! UnsupportedAttributeException uae = new UnsupportedAttributeException(msg); ! DnaDeserializationException dde = new DnaDeserializationException(msg, uae); ! logger.error(className + ".getInstance(); " + msg, dde); ! throw dde; ! } ! } ! } ! } ! } ! } ! } ! } ! } if (res != null) { res.fromStream(dis, dna, nameIndex, len); --- 115,119 ---- throw dde; } ! res = this.getInstance(AttributeTypes.valueOf(attributeType)); if (res != null) { res.fromStream(dis, dna, nameIndex, len); *************** *** 169,194 **** throw dde; } } ! public static final String ATTRIBUTE_CONSTANT = "ConstantValue"; ! public static final String ATTRIBUTE_CODE = "Code"; ! public static final String ATTRIBUTE_EXCEPTIONS = "Exceptions"; ! public static final String ATTRIBUTE_INNERCLASSES = "InnerClasses"; ! public static final String ATTRIBUTE_SYNTHETIC = "Synthetic"; ! public static final String ATTRIBUTE_SOURCEFILE = "SourceFile"; ! public static final String ATTRIBUTE_LINENUMBERTABLE = "LineNumberTable"; ! public static final String ATTRIBUTE_LOCALVARIABLETABLE = "LocalVariableTable"; ! public static final String ATTRIBUTE_DEPRECATED = "Deprecated"; ! public static final int CONSTANT = 0; ! public static final int CODE = 1; ! public static final int EXCEPTIONS = 2; ! public static final int INNERCLASSES = 3; ! public static final int SYNTHETIC = 4; ! public static final int SOURCEFILE = 5; ! public static final int LINENUMBERTABLE = 6; ! public static final int LOCALVARIABLETABLE = 7; ! public static final int DEPRECATED = 8; /** * Logger */ protected static Logger logger = Logger.getRootLogger(); ! } --- 133,147 ---- throw dde; } + catch (UnsupportedAttributeException e) { + String msg = "Caught an UnsupportedAttributeException while reading the attribute from the stream"; + DnaDeserializationException dde = new DnaDeserializationException(msg, e); + logger.error(className + ".getInstance(); " + msg, e); + throw dde; + } } ! /** * Logger */ protected static Logger logger = Logger.getRootLogger(); ! } \ No newline at end of file Index: ExceptionAttr.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/attributes/impl/ExceptionAttr.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ExceptionAttr.java 1 Sep 2006 19:56:10 -0000 1.24 --- ExceptionAttr.java 21 Dec 2006 18:49:32 -0000 1.25 *************** *** 15,19 **** import java.util.List; import jef.dna.Dna; ! import jef.dna.attributes.ExceptionAttribute; import jef.dna.attributes.exceptions.AttributeOutOfRangeException; import jef.dna.attributes.exceptions.AttributeValidationException; --- 15,19 ---- import java.util.List; import jef.dna.Dna; ! import jef.dna.attributes.ExceptionsAttribute; import jef.dna.attributes.exceptions.AttributeOutOfRangeException; import jef.dna.attributes.exceptions.AttributeValidationException; *************** *** 32,36 **** * Class representing an Exception Attribute. */ ! public class ExceptionAttr extends GenericAttribute implements ExceptionAttribute { /** * Class name --- 32,36 ---- * Class representing an Exception Attribute. */ ! public class ExceptionAttr extends GenericAttribute implements ExceptionsAttribute { /** * Class name --- NEW FILE: SourceDebugExtension.java --- /* * SourceDebugExtension.java * * Created on November 26, 2006, 12:40 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes.impl; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import jef.dna.Dna; import jef.dna.attributes.SourceDebugExtensionAttribute; import jef.dna.exceptions.DnaDeserializationException; import jef.dna.exceptions.DnaSerializationException; import jef.dna.exceptions.MissingDnaContainerException; /** * * @author frusso */ public class SourceDebugExtension extends GenericAttribute implements SourceDebugExtensionAttribute { /** Creates a new instance of SourceDebugExtension */ public SourceDebugExtension() { } public void updateRefs(int offset) { // nop } public Object clone() throws CloneNotSupportedException { return super.clone(); } public void fromStream(DataInputStream dis, Dna dna, int nameIndex, int length) throws DnaDeserializationException, MissingDnaContainerException { if (dna != null) { logger.info(this.getClass().getName() + ".fromStream(); replacing dna container instance..."); setDna(dna); } if (this.dna != null) { try { setNameIndex(nameIndex); super.length = length; //TODO verify if the byte[] suites the need: it might be necessary an int[] byte[] tmp = new byte[length]; for(int i=0; i<length; i++) { //TODO according to the previous node, here we might need a readUnsignedByte() tmp[i] = dis.readByte(); } debugExtension = new String(tmp); logger.info(className + ".fromStream(); debugExtension: " + debugExtension); } catch(IOException e) { String msg = "Caught an IOException while reading the attribute from the stream"; DnaDeserializationException dde = new DnaDeserializationException(msg, e); logger.error(this.getClass().getName() + ".fromStream(); " + msg, e); throw dde; } } else { MissingDnaContainerException mdce = new MissingDnaContainerException(); logger.error(className + ".formStream(); MissingDnaContainerException", mdce); throw mdce; } } public void toStream(DataOutputStream dos) throws DnaSerializationException { try { dos.writeShort(super.getNameIndex()); dos.writeShort(length); //TODO verfy byte[] tmp = debugExtension.getBytes(); dos.write(tmp); } catch(IOException e) { String msg = "Caught an IOException while writing the attribute to the stream"; DnaSerializationException dse = new DnaSerializationException(msg, e); logger.error(this.getClass().getName() + ".toStream(); " + msg, e); throw dse; } } public int getBytesCount() { if(debugExtension!=null) return 6 + debugExtension.getBytes().length; else return 6; } public String getDebugExtension() { return debugExtension; } public void setDebugExtension(String de) { debugExtension = de; } private String debugExtension; } --- NEW FILE: Signature.java --- /* * Signature.java * * Created on November 26, 2006, 12:24 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes.impl; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import jef.dna.Dna; import jef.dna.attributes.SignatureAttribute; import jef.dna.exceptions.DnaDeserializationException; import jef.dna.exceptions.DnaSerializationException; import jef.dna.exceptions.MissingDnaContainerException; /** * * @author frusso */ public class Signature extends GenericAttribute implements SignatureAttribute { /** Creates a new instance of Signature */ public Signature() { this.length = 8; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public void updateRefs(int offset) { attributeNameIndex += offset; signatureIndex += offset; } public void fromStream(DataInputStream dis, Dna dna, int nameIndex, int length) throws DnaDeserializationException, MissingDnaContainerException { if (dna != null) { logger.info(this.getClass().getName() + ".fromStream(); replacing dna container instance..."); setDna(dna); } if (this.dna != null) { try { setNameIndex(nameIndex); super.length = length; signatureIndex = dis.readUnsignedShort(); logger.info(className + ".fromStream(); signatureIndex: " + signatureIndex); } catch(IOException e) { String msg = "Caught an IOException while reading the attribute from the stream"; DnaDeserializationException dde = new DnaDeserializationException(msg, e); logger.error(this.getClass().getName() + ".fromStream(); " + msg, e); throw dde; } } else { MissingDnaContainerException mdce = new MissingDnaContainerException(); logger.error(className + ".formStream(); MissingDnaContainerException", mdce); throw mdce; } } public void toStream(DataOutputStream dos) throws DnaSerializationException { try { dos.writeShort(super.getNameIndex()); dos.writeShort(length); dos.writeShort(signatureIndex); } catch(IOException e) { String msg = "Caught an IOException while writing the attribute to the stream"; DnaSerializationException dse = new DnaSerializationException(msg, e); logger.error(this.getClass().getName() + ".toStream(); " + msg, e); throw dse; } } public int getBytesCount() { return 8; } public int getSignatureIndex() { return signatureIndex; } public void setSignatureIndex(int index) { signatureIndex = index; } private int signatureIndex; } --- NEW FILE: EnclosingMethod.java --- /* * EnclosingMethod.java * * Created on November 25, 2006, 3:58 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes.impl; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import jef.dna.Dna; import jef.dna.attributes.EnclosingMethodAttribute; import jef.dna.attributes.exceptions.AttributeOutOfRangeException; import jef.dna.attributes.exceptions.AttributeValidationException; import jef.dna.constantPoolTable.ConstantPoolTable; import jef.dna.exceptions.DnaDeserializationException; import jef.dna.exceptions.DnaSerializationException; import jef.dna.exceptions.MissingCPTableException; import jef.dna.exceptions.MissingDnaContainerException; /** * * @author frusso */ public class EnclosingMethod extends GenericAttribute implements EnclosingMethodAttribute { /** Creates a new instance of EnclosingMethod */ public EnclosingMethod() { this.length = 4; } public void updateRefs(int offset) { attributeNameIndex += offset; classIndex += offset; methodIndex += offset; } public void fromStream(DataInputStream dis, Dna dna, int nameIndex, int length) throws DnaDeserializationException, MissingDnaContainerException { if (dna != null) { logger.info(this.getClass().getName() + ".fromStream(); replacing dna container instance..."); setDna(dna); } if (this.dna != null) { try { classIndex = dis.readUnsignedShort(); methodIndex = dis.readUnsignedShort(); setNameIndex(nameIndex); super.length = length; logger.info(this.getClass().getName() + ".fromStream(); classIndex: " + classIndex + " methodIndex: " + methodIndex); } catch(IOException e) { String msg = "Caught an IOException while reading the attribute from the stream"; DnaDeserializationException dde = new DnaDeserializationException(msg, e); logger.error(this.getClass().getName() + ".fromStream(); " + msg, e); throw dde; } } else { MissingDnaContainerException mdce = new MissingDnaContainerException(); logger.error(this.getClass().getName() + ".formStream(); MissingDnaContainerException", mdce); throw mdce; } } public void toStream(DataOutputStream dos) throws DnaSerializationException { try { dos.writeShort(super.getNameIndex()); dos.writeShort(length); dos.writeShort(classIndex); dos.writeShort(methodIndex); } catch(IOException e) { String msg = "Caught an IOException while writing the attribute to the stream"; DnaSerializationException dde = new DnaSerializationException(msg, e); logger.error(this.getClass().getName() + ".toStream(); " + msg, e); throw dde; } } /** * The <code>clone()</code> method will return a new instance whose reference to the * containing <code>Dna</code> instance is set to <code>null</code>. It is up to you * appropriately setting it to the correct value. */ public Object clone() throws CloneNotSupportedException { return super.clone(); } //TODO complete this protected void innerValidations(ConstantPoolTable cpt) throws AttributeValidationException, AttributeOutOfRangeException, MissingDnaContainerException, MissingCPTableException { super.innerValidations(cpt); } public int getBytesCount() { return 10; } public void setClassIndex(int cIndx) { classIndex = cIndx; } public int getClassIndex() { return classIndex; } public void setMethodIndex(int mIndx) { methodIndex = mIndx; } public int getMethodIndex() { return methodIndex; } private int classIndex; private int methodIndex; } |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/dna/attributes In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna/attributes Modified Files: AttribFactory.java Added Files: SourceDebugExtensionAttribute.java SignatureAttribute.java AttributeTypes.java EnclosingMethodAttribute.java ExceptionsAttribute.java Removed Files: ExceptionAttribute.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 --- ExceptionAttribute.java DELETED --- --- NEW FILE: EnclosingMethodAttribute.java --- /* * EnclosingMethodAttribute.java * * Created on November 25, 2006, 3:45 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes; /** * This interface represents the <code>EnclosingMethod</code> attribute defined * by the Java class file specification.<br> * The EnclosingMethodattribute is an optional fixed-length attribute in the * attributes table of the ClassFile (¤4.2) structure. Aclass must have an * EnclosingMethodattributeif andonlyif it isalocal classor ananonymous * class. A class may have no more than oneEnclosingMethod attribute. * * @author frusso */ public interface EnclosingMethodAttribute extends Attribute { /** * Thevalue of theclass_index item must be a valid index into the * constant_pool table. Theconstant_pool entry at that index * mustbea CONSTANT_Class_info (¤4.5.1) structure representing * the innermost class that encloses the declaration of the current * class. */ public void setClassIndex(int cIndx); /** * Thevalue of theclass_index item must be a valid index into the * constant_pool table. Theconstant_pool entry at that index * mustbea CONSTANT_Class_info (¤4.5.1) structure representing * the innermost class that encloses the declaration of the current * class. */ public int getClassIndex(); /** * If the current class is not immediately enclosed by a method or * constructor, then the value of themethod_index item must be * zero. Otherwise, the value of themethod_index item must be a * valid index into theconstant_pool table. Theconstant_pool * entry at that index must be a CONSTANT_NameAndType_info * (¤4.5.6) structure representing the name and type of a method in * the class referenced by the class_index attribute above. It is the * responsibility of the Java compiler to ensure that the method * identified via themethod_index is indeed the closest lexically * enclosing method of the class that contains this EnclosingMethod attribute. */ public void setMethodIndex(int mIndx); /** * If the current class is not immediately enclosed by a method or * constructor, then the value of themethod_index item must be * zero. Otherwise, the value of themethod_index item must be a * valid index into theconstant_pool table. Theconstant_pool * entry at that index must be a CONSTANT_NameAndType_info * (¤4.5.6) structure representing the name and type of a method in * the class referenced by the class_index attribute above. It is the * responsibility of the Java compiler to ensure that the method * identified via themethod_index is indeed the closest lexically * enclosing method of the class that contains this EnclosingMethod attribute. */ public int getMethodIndex(); } --- NEW FILE: ExceptionsAttribute.java --- /*************************************************************************************************** * File: ExceptionAttr.java created 24-Feb-02 3:00:56 PM by root JEFNet is free software; you can * redistribute it and/or modify it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2, or (at your option) any later version. */ package jef.dna.attributes; import java.util.List; /** * Class representing an Exception Attribute. The Exceptions attribute is a variable-length * attribute used in the attributes table of a method_info structure. The Exceptions attribute * indicates which checked exceptions a method may throw. There may be at most one Exceptions * attribute in each method_info structure. * * @author Francesco Russo fr...@cs... */ public interface ExceptionsAttribute extends Attribute { /** * Gets the number of exceptions that will be stored within the * <code>exception_index_table</code>. * * @return int Dimension of the <code>exception_index_table</code> */ public int getNumberOfExceptions(); /** * Sets the <code>exception_index_table</code>. This data strucutre is actually a * <code>List</code> containing indexes pointing to constant pool table entries of type * <code>CONSTANT_Class_info</code>. These entries define the classes of the exceptions this * method is declareced to throw * * @param table * The <code>exception_index_table</code> */ // public void setExceptionIndexTable(List<Integer> table); /** * Gets the <code>exception_index_table</code>. This data strucutre is actually a * <code>List</code> containing indexes pointing to constant pool table entries of type * <code>CONSTANT_Class_info</code>. These entries define the classes of the exceptions this * method is declareced to throw * * @return List<Integer> The <code>exception_index_table</code> */ public List<Integer> getExceptionIndexTable(); } --- NEW FILE: SignatureAttribute.java --- /* * SignatureAttribute.java * * Created on November 26, 2006, 12:20 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes; /** * The Signature attribute is an optional fixed-length attribute in the attributes * table of the ClassFile (¤4.2), field_info (¤4.6) and method_info (¤4.7)structures. * * @author frusso */ public interface SignatureAttribute extends Attribute { /** * The value of thesignature_index item must be a valid index * into the constant_pool table. The constant pool entry at that * index must be a CONSTANT_Utf8_info (¤4.5.7) structure * representing either a class signature, if this signature attribute is * an attribute of a ClassFile structure, a method type signature, if * this signature is an attribuute of amethod_info structure, or a * field type signature otherwise. */ public int getSignatureIndex(); /** * The value of thesignature_index item must be a valid index * into the constant_pool table. The constant pool entry at that * index must be a CONSTANT_Utf8_info (¤4.5.7) structure * representing either a class signature, if this signature attribute is * an attribute of a ClassFile structure, a method type signature, if * this signature is an attribuute of amethod_info structure, or a * field type signature otherwise. */ public void setSignatureIndex(int index); } Index: AttribFactory.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/attributes/AttribFactory.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AttribFactory.java 2 Jul 2005 21:07:57 -0000 1.13 --- AttribFactory.java 21 Dec 2006 18:49:32 -0000 1.14 *************** *** 27,31 **** * @return Attribute The requested attribute */ ! public Attribute getInstance(int type) throws UnsupportedAttributeException; /** --- 27,31 ---- * @return Attribute The requested attribute */ ! public Attribute getInstance(AttributeTypes type) throws UnsupportedAttributeException; /** *************** *** 41,79 **** */ public Attribute getInstance(DataInputStream dis, Dna dna) throws DnaDeserializationException; ! /** ! * Type for the Constant Attribute ! */ ! public static final int CONSTANT = 0; ! /** ! * Type for the Code Attribute ! */ ! public static final int CODE = 1; ! /** ! * Type for the Exceptions Attribute ! */ ! public static final int EXCEPTIONS = 2; ! /** ! * Type for the Inner Classes Attribute ! */ ! public static final int INNERCLASSES = 3; ! /** ! * Type for the Synthetic Attribute ! */ ! public static final int SYNTHETIC = 4; ! /** ! * Type for the Source File Attribute ! */ ! public static final int SOURCEFILE = 5; ! /** ! * Type for the Line Number Table Attribute ! */ ! public static final int LINENUMBERTABLE = 6; ! /** ! * Type for the Local Variable Table Attribute ! */ ! public static final int LOCALVARIABLETABLE = 7; ! /** ! * Type for the Deprecated Attribute ! */ ! public static final int DEPRECATED = 8; ! } --- 41,43 ---- */ public Attribute getInstance(DataInputStream dis, Dna dna) throws DnaDeserializationException; ! } \ No newline at end of file --- NEW FILE: SourceDebugExtensionAttribute.java --- /* * SourceDebugExtensionAttribute.java * * Created on November 26, 2006, 12:38 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes; /** * * @author frusso */ public interface SourceDebugExtensionAttribute extends Attribute { /** * Thedebug_extension array holds a string, which must be in * UTF-8format.There is no terminating zero byte. The string in the * debug_extension item will be interpreted as extended * debugging information. The content of this string has no semantic * effect on the Java Virtual Machine. */ public String getDebugExtension(); /** * Thedebug_extension array holds a string, which must be in * UTF-8format.There is no terminating zero byte. The string in the * debug_extension item will be interpreted as extended * debugging information. The content of this string has no semantic * effect on the Java Virtual Machine. */ public void setDebugExtension(String de); } --- NEW FILE: AttributeTypes.java --- /* * AttributeTypes.java * * Created on November 26, 2006, 5:50 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.dna.attributes; /** * * @author frusso */ public enum AttributeTypes { SourceFile, ConstantValue, Code, StackMapTable, Exceptions, InnerClasses, EnclosingMethod, Synthetic, Signature, LineNumberTable, LocalVariableTable, Deprecated, SourceDebugExtension, LocalVariableTypeTable, RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations, AnnotationDefault; } |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/test/dummies/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/test/dummies/impl Removed Files: simpleInterfaceImpl_1.java simpleInterfaceImpl_2.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 --- simpleInterfaceImpl_1.java DELETED --- --- simpleInterfaceImpl_2.java DELETED --- |
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"); } |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/dna/constantInfo/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna/constantInfo/impl Modified Files: ConstantUtf8.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: ConstantUtf8.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/constantInfo/impl/ConstantUtf8.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ConstantUtf8.java 2 Jul 2005 21:07:56 -0000 1.15 --- ConstantUtf8.java 21 Dec 2006 18:49:33 -0000 1.16 *************** *** 95,98 **** --- 95,104 ---- return clone; } + + public String toString() { + return new String(getValue()); + } + + private boolean modifiable = true; private int length; private byte[] value; |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/dna/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna/util Modified Files: BytesCountable.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: BytesCountable.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/util/BytesCountable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BytesCountable.java 28 Aug 2006 18:40:25 -0000 1.1 --- BytesCountable.java 21 Dec 2006 18:49:32 -0000 1.2 *************** *** 15,18 **** --- 15,24 ---- */ public interface BytesCountable { + + /** + * This method must return the overall number of bytes + * required by the component implementing this interface. + * + */ public int getBytesCount(); } \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:37
|
Update of /cvsroot/jefnet/jef/src/jef/deepCopier In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/deepCopier Modified Files: DeepCopier.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: DeepCopier.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/deepCopier/DeepCopier.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DeepCopier.java 2 Jul 2005 21:07:57 -0000 1.6 --- DeepCopier.java 21 Dec 2006 18:49:31 -0000 1.7 *************** *** 69,71 **** --- 69,73 ---- */ public int deepCopy(int index) throws DeepCopyException, CloneNotSupportedException; + + public int deepCopy(int index, boolean duplicate) throws DeepCopyException, CloneNotSupportedException; } |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:36
|
Update of /cvsroot/jefnet/jef/src/jef/test/dummies/interfaces In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/test/dummies/interfaces Removed Files: simpleInterface.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 --- simpleInterface.java DELETED --- |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:36
|
Update of /cvsroot/jefnet/jef/src/jef/config In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/config Modified Files: Instantiator.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: Instantiator.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/config/Instantiator.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Instantiator.java 4 Oct 2006 16:35:53 -0000 1.15 --- Instantiator.java 21 Dec 2006 18:49:32 -0000 1.16 *************** *** 13,16 **** --- 13,17 ---- import jef.JefPropertyKeys; import jef.config.exceptions.InstantiatorException; + import org.apache.log4j.Logger; import org.w3c.dom.Document; |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:36
|
Update of /cvsroot/jefnet/jef/src/jef/disconnection/impl In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/disconnection/impl Modified Files: DefaultMethodDisconnector.java DefaultDisconnectedField.java Added Files: InnerDnaSpawningException.java JEFClassResolver.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 --- NEW FILE: InnerDnaSpawningException.java --- /* * InnerDnaSpawningException.java * * Created on November 18, 2006, 4:11 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jef.disconnection.impl; /** * * @author frusso */ public class InnerDnaSpawningException extends RuntimeException { /** Creates a new instance of InnerDnaSpawningException */ public InnerDnaSpawningException(String msg) { super(msg); } public InnerDnaSpawningException(String msg, Throwable cause) { super(msg,cause); } } --- NEW FILE: JEFClassResolver.java --- package jef.disconnection.impl; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import org.apache.log4j.Logger; public class JEFClassResolver { protected static byte[] getByteCode(String fqn) { fqn = fqn.replace(".","/")+".class"; ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = cl.getResourceAsStream(fqn); Collection<Byte> c = new ArrayList<Byte>(); is = cl.getResourceAsStream(fqn); Integer b = -1; try { while( (b=is.read())!=-1 ) { c.add(b.byteValue()); } is.close(); } catch (IOException ex) { String msg = "Unable to accomplish class resolution for FQN "+fqn+" due to an I/O exception."; JEFClassResolverException e = new JEFClassResolverException(msg,ex); logger.fatal(msg,e); } Byte[] bytecode = (Byte[]) c.toArray(new Byte[c.size()]); byte[] res = new byte[bytecode.length]; for (int i = 0; i<bytecode.length; i++) { res[i] = bytecode[i]; } return res; } private static final Logger logger = Logger.getLogger(JEFClassResolver.class); } class JEFClassResolverException extends RuntimeException { JEFClassResolverException(String msg) { super(msg); } JEFClassResolverException(String msg, Throwable cause) { super(msg,cause); } } Index: DefaultDisconnectedField.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/disconnection/impl/DefaultDisconnectedField.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefaultDisconnectedField.java 4 Oct 2006 16:35:52 -0000 1.8 --- DefaultDisconnectedField.java 21 Dec 2006 18:49:32 -0000 1.9 *************** *** 9,12 **** --- 9,15 ---- import java.util.ArrayList; + import java.util.Collection; + import java.util.HashMap; + import java.util.LinkedHashMap; import java.util.List; import java.util.Hashtable; *************** *** 15,19 **** --- 18,26 ---- import jef.config.exceptions.InstantiatorException; import jef.disconnection.DisconnectedField; + import jef.dna.Dna; + import jef.dna.attributes.Attribute; import jef.dna.attributes.CodeAttribute; + import jef.dna.attributesTable.AttributesTable; + import jef.dna.attributesTable.AttributesTableFactory; import jef.dna.constantPoolTable.ConstantPoolTable; import jef.dna.constantPoolTable.ConstantPoolTableFactory; *************** *** 22,25 **** --- 29,33 ---- import jef.dna.infoStructures.FieldInfoStructure; import jef.dna.instructions.Instruction; + import jef.dna.util.NotifyingList; import org.apache.log4j.Logger; *************** *** 111,118 **** --- 119,150 ---- return srcClassFqn; } + + public void addAttribute(Attribute attr) throws InstantiatorException { + if(attributes==null) { + attributes = ((AttributesTableFactory)Instantiator.getInstance(Instantiator.dnaAttributesTableFactory)).getInstance(); + } + attributes.addElement(attr); + } + + public AttributesTable getAttributes() { + return attributes; + } + + public void addInnerClass(String fqn, Dna innerDna) { + if(innerClasses==null) + innerClasses = new LinkedHashMap(); + if(!innerClasses.containsKey(fqn)) + innerClasses.put(fqn,innerDna); + } + + public HashMap<String,Dna> getInnerClasses() { + return innerClasses; + } + protected HashMap<String,Dna> innerClasses; protected ConstantPoolTable constantPoolTable; protected FieldsTable fields; protected String srcClassFqn; + protected AttributesTable attributes; private static Logger logger = Logger.getLogger(DefaultDisconnectedField.class); } \ No newline at end of file Index: DefaultMethodDisconnector.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/disconnection/impl/DefaultMethodDisconnector.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DefaultMethodDisconnector.java 4 Oct 2006 16:35:52 -0000 1.12 --- DefaultMethodDisconnector.java 21 Dec 2006 18:49:32 -0000 1.13 *************** *** 1,5 **** /* * DefaultMethodDisconnector.java ! * * Created on 31 December 2004, 15:43 JEFNet is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by the Free Software --- 1,5 ---- /* * DefaultMethodDisconnector.java ! * * Created on 31 December 2004, 15:43 JEFNet is free software; you can redistribute it and/or modify [...1063 lines suppressed...] /** * This method searches over the provided <code>Dna</code> instance for a method having the * given <code>nameIndex</code> and <code>descriptorIndex</code>. If found, the first * matching method is returned, otherwise <code>null</code> will be the expected return value. ! * * @param dna * The <code>Dna</code> instance to be inspected *************** *** 716,719 **** private Hashtable<Integer,Integer> processedFieldInfo = null; private Hashtable<Integer,Integer> processedMethodInfo = null; ! private ConstantInfoFactory cptEntryFactory = null; } \ No newline at end of file --- 677,680 ---- private Hashtable<Integer,Integer> processedFieldInfo = null; private Hashtable<Integer,Integer> processedMethodInfo = null; ! private ConstantInfoFactory cptEntryFactory = null; } \ No newline at end of file |
From: Francesco R. <fr...@us...> - 2006-12-21 18:49:36
|
Update of /cvsroot/jefnet/jef/src/jef/dna In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29324/dna Modified Files: DnaReader.java DnaWriter.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: DnaWriter.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/DnaWriter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DnaWriter.java 2 Jul 2005 21:07:58 -0000 1.8 --- DnaWriter.java 21 Dec 2006 18:49:32 -0000 1.9 *************** *** 9,14 **** --- 9,18 ---- import java.io.File; import java.io.FileNotFoundException; + import java.io.FileOutputStream; + import java.io.IOException; + import jef.dna.exceptions.DnaDeserializationException; import jef.dna.exceptions.DnaSerializationException; import jef.dna.exceptions.MissingDnaContainerException; + import org.apache.log4j.Logger; /** *************** *** 36,46 **** * @throws DnaSerializationException * @throws MissingDnaContainerException - * @throws FileNotFoundException */ ! public void write(Dna dna) throws MissingDnaContainerException, DnaSerializationException, FileNotFoundException { ! java.io.FileOutputStream fos = new java.io.FileOutputStream(classFile); ! DataOutputStream dos = new DataOutputStream(fos); ! dna.toStream(dos); } private java.io.File classFile; } \ No newline at end of file --- 40,74 ---- * @throws DnaSerializationException * @throws MissingDnaContainerException */ ! public void write(Dna dna) throws MissingDnaContainerException, DnaSerializationException { ! try { ! FileOutputStream fos = new FileOutputStream(classFile); ! DataOutputStream dos = new DataOutputStream(fos); ! dna.toStream(dos); ! } catch(FileNotFoundException ex) { ! String msg = "Unable to serialize a Dna instance."; ! DnaSerializationException e = new DnaSerializationException(msg,ex); ! logger.fatal(msg,e); ! throw e; ! } } + + public static void write(String path, String newSimpleName, Dna dna) throws DnaSerializationException, MissingDnaContainerException { + try { + File f = new File(path,newSimpleName+".class"); + if(f.createNewFile()) { + FileOutputStream fos = new FileOutputStream(f); + DataOutputStream dos = new DataOutputStream(fos); + dna.toStream(dos); + } + } catch (IOException ex) { + String msg = "Unable to serialize a Dna instance."; + DnaSerializationException e = new DnaSerializationException(msg,ex); + logger.fatal(msg,e); + throw e; + } + } + private java.io.File classFile; + protected static final Logger logger = Logger.getLogger(DnaWriter.class); } \ No newline at end of file Index: DnaReader.java =================================================================== RCS file: /cvsroot/jefnet/jef/src/jef/dna/DnaReader.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DnaReader.java 2 Jul 2005 21:07:58 -0000 1.17 --- DnaReader.java 21 Dec 2006 18:49:32 -0000 1.18 *************** *** 6,9 **** --- 6,10 ---- package jef.dna; + import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.File; *************** *** 51,54 **** --- 52,63 ---- return dna; } + + public static Dna read(byte[] bytecode) throws InstantiatorException, DnaDeserializationException, MissingDnaContainerException { + DataInputStream dis = new DataInputStream(new ByteArrayInputStream(bytecode)); + Dna dna = new Dna(); + dna.fromStream(dis); + return dna; + } + private File classFile; } \ No newline at end of file |