Commit 52ba6c01 authored by pcregut's avatar pcregut

Initial commit of asmdex on OW2 forge.

parent 4aa86cc9
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/conform"/>
<classpathentry kind="src" path="test/perf"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/baksmali-1.2.6.jar"/>
<classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
[Dolphin]
Timestamp=2011,9,1,15,26,4
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AsmDex</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>de.tud.st.ispace.builder.ISpaceBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>de.tud.st.ispace.builder.ISpaceNature</nature>
</natures>
</projectDescription>
#Thu Mar 10 14:33:52 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
#Wed Apr 20 09:22:06 CEST 2011
cleanup.add_default_serial_version_id=true
cleanup.add_generated_serial_version_id=false
cleanup.add_missing_annotations=false
cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_serial_version_id=false
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=false
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.convert_to_enhanced_for_loop=false
cleanup.correct_indentation=false
cleanup.format_source_code=false
cleanup.format_source_code_changes_only=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=false
cleanup.make_private_fields_final=true
cleanup.make_type_abstract_if_missing_method=false
cleanup.make_variable_declarations_final=false
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=true
cleanup.organize_imports=false
cleanup.qualify_static_field_accesses_with_declaring_class=false
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
cleanup.qualify_static_member_accesses_with_declaring_class=false
cleanup.qualify_static_method_accesses_with_declaring_class=false
cleanup.remove_private_constructors=true
cleanup.remove_trailing_whitespaces=false
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_casts=false
cleanup.remove_unnecessary_nls_tags=false
cleanup.remove_unused_imports=true
cleanup.remove_unused_local_variables=false
cleanup.remove_unused_private_fields=true
cleanup.remove_unused_private_members=false
cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.use_blocks=false
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_parentheses_in_expressions=false
cleanup.use_this_for_non_static_field_access=false
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access=false
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup_profile=_RemoveUnusedImports
cleanup_settings_version=2
eclipse.preferences.version=1
Software Name : AsmDex
Version : 1.0
Copyright © 2012 France Télécom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
This directory is the base directory of AsmDex.
It contains the following items:
- src : the sources files of Asmdex.
- test/case : dex files used for testing.
- test/conform : source files of the tests of conformity.
- test/perf : source files of the tests of performance.
- build.xml: main ant file to build AsmDex.
- lib : folder containing the libraries used by the AsmDex unit tests :
- JUnit-4-8-2 (included).
- Baksmali (NOT included).
- readme.txt : this file.
In order to execute AsmDex tests, one must :
- use src, test/conform and test/perf as source folders.
- add baksmali to the classpath. The version used for the development of AsmDex is baksmali-1.2.6.jar.
<project name="AsmDexMain" default="jar">
<property file="build.properties"/>
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
<classpath>
<pathelement location="${findbugs.location}"/>
</classpath>
</taskdef>
<import file="build.xml"/>
<target name="jar" depends="AsmDex.init,AsmDex.build">
<jar jarfile="asmdex.jar">
<fileset dir="bin"/>
</jar>
</target>
<target name="findbugs" depends="jar">
<findbugs home="${findbugs.home}"
output="xml"
excludeFilter="exclude.xml"
outputFile="asmdex-fb.xml" >
<auxClasspath>
<path refid="AsmDex.classpath"/>
</auxClasspath>
<sourcePath path="${basedir}/src" />
<class location="${basedir}/bin" />
</findbugs>
</target>
<target name="javadoc">
<javadoc sourcepath="src" destdir="apidoc"/>
</target>
</project>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Build file made from the build.xml generated by Eclipse.
It also contain the "createZip" action to generate the zip containing a clean project.
It will be copied as the build.xml inside the zip archive created. -->
<project basedir="." default="build" name="AsmDex">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../local/eclipse"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="AsmDex.classpath">
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target name="jar" depends="init,build">
<jar jarfile="AsmDex.jar">
<fileset dir="bin"/>
</jar>
</target>
<target name="zip">
<zip destfile="AsmDex.zip">
<zipfileset dir="src/org" prefix="src/org" includes="**/*.java" />
<zipfileset dir="test" prefix="test" includes="**/*.java,**/*.dex" />
<zipfileset dir="lib" prefix="lib" excludes="baksmali*.jar" />
<zipfileset dir="." includes="readme.txt" />
<zipfileset dir="." includes="build-release.xml" fullpath="build.xml" />
</zip>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="AsmDex.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>
# Release number
release=1.0
# Path to findbugs
findbugs.location=/usr/local/findbugs-1.3.9/lib/findbugs-ant.jar
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="AsmDex">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../usr/lib/eclipse"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="AsmDex.classpath">
<pathelement location="bin"/>
<pathelement location="lib/baksmali-1.2.6.jar"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="test/conform">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="test/perf">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="AsmDex.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="test/conform"/>
<classpath refid="AsmDex.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="test/perf"/>
<classpath refid="AsmDex.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>
<FindBugsFilter>
<Match>
<!-- Rationale : we are not going to use it against code that may want to modify array and even if they do
it will just crash. The benefit of no copying is more important. -->
<Bug code="EI,EI2"/>
</Match>
</FindBugsFilter>
<?xml version="1.0" encoding="UTF-8"?>
<jrat>
<!-- ********************************************************************
** Java Runtime Analysis Toolkit Configuration **
** sample, default configuration file - modify as need **
** Author : Jeff Drost **
********************************************************************* -->
<settings>
<property name="httpServerEnabled" value="true"/>
</settings>
<!--
A profile defines a set of handlers and the criteria that must
be satisfied in order for a method to be monitored with those handlers.
In a single configuration file you can have multiple profile.
-->
<profile name="my code">
<criteria>
<!--
A profile's handlers are used if any of the includes are
satisfied and none of the excludes are.
( includeA or includeB... ) and ( not( excludeA or excludeB... ) )
-->
<!--
<include className="*" methodName="*" signature="*"/>
<exclude className="*" methodName="*" signature="*"/>
-->
<include/>
</criteria>
<handlers>
<!--
The Tree Method Handler is the general purpose included method handler,
but you can choose to write your own. Simply implement MethodHandlerFactory
and get ready to receieve runtime events.
-->
<handler factory="org.shiftone.jrat.provider.tree.TreeMethodHandlerFactory">
<property name="outputFile" value="my_code_tree.jrat"/>
</handler>
</handlers>
</profile>
</jrat>
\ No newline at end of file
/* Software Name : AsmDex
* Version : 1.0
*
* Copyright © 2012 France Télécom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.objectweb.asmdex;
/**
* A visitor to visit a Java annotation. The methods of this interface must be
* called in the following order: (<tt>visit<tt> | <tt>visitEnum<tt> |
* <tt>visitAnnotation<tt> | <tt>visitArray<tt> | <tt>visitClass<tt>)* <tt>visitEnd<tt>.
* <br />
* Differences with ASM :
* <ul><li> visitClass is added. Is it useful to declare classes in annotations such as :<br />
* class<Short> a() <br />
* class<Short>[] b() <br />
* ASM used the visit method with a Type Object possessing a String (the class name) and
* an "Object" as an internal type ("sort" field). Since we don't implement Type in AsmDex,
* and in order to be more consistent with the other methods (visitArray, visitEnum...), we
* decided to add this visitClass method.</li></ul>
*
* @author Eric Bruneton
* @author Eugene Kuleshov
* @author Julien Névo (adaptation to AsmDex)
*/
public abstract class AnnotationVisitor {
/**
* The annotation visitor to which this visitor must delegate method calls.
* May be null.
*/
protected AnnotationVisitor av;
/**
* Constructs a new {@link AnnotationVisitor}.
*
*/
public AnnotationVisitor() { }
/**
* Constructs a new {@link AnnotationVisitor}.
*
* @param av the annotation visitor to which this visitor must delegate
* method calls. May be null.
*/
public AnnotationVisitor(final AnnotationVisitor av) {
this.av = av;
}
/**
* Visits a primitive value of the annotation.
*
* @param name the value name.
* @param value the actual value, whose type must be {@link Byte},
* {@link Boolean}, {@link Character}, {@link Short},
* {@link Integer}, {@link Long}, {@link Float}, {@link Double},
* {@link String} or {@link Type}. This value can also be an array
* of byte, boolean, short, char, int, long, float or double values
* (this is equivalent to using {@link #visitArray visitArray} and
* visiting each array element in turn, but is more convenient).
*/
public void visit(String name, Object value) {
if (av != null) {
av.visit(name, value);
}
}
/**
* Visits an enumeration value of the annotation.
*
* @param name the value name.
* @param desc the class descriptor of the enumeration class.
* @param value the actual enumeration value.
*/
public void visitEnum(String name, String desc, String value) {
if (av != null) {
av.visitEnum(name, desc, value);
}
}
/**
* Visits a nested annotation value of the annotation.
*
* @param name the value name.
* @param desc the class descriptor of the nested annotation class.
* @return a visitor to visit the actual nested annotation value, or
* <tt>null</tt> if this visitor is not interested in visiting
* this nested annotation. <i>The nested annotation value must be
* fully visited before calling other methods on this annotation
* visitor</i>.
*/
public AnnotationVisitor visitAnnotation(String name, String desc) {
if (av != null) {
return av.visitAnnotation(name, desc);
}
return null;
}
/**
* Visits an array value of the annotation. Note that arrays of primitive
* types (such as byte, boolean, short, char, int, long, float or double)
* can be passed as value to {@link #visit visit}. This is what
* {@link ClassReader} does.
*
* @param name the value name.
* @return a visitor to visit the actual array value elements, or
* <tt>null</tt> if this visitor is not interested in visiting
* these values. The 'name' parameters passed to the methods of this
* visitor are ignored. <i>All the array values must be visited
* before calling other methods on this annotation visitor</i>.
*/
public AnnotationVisitor visitArray(String name) {
if (av != null) {
return av.visitArray(name);
}
return null;
}
/**
* Visits a Class declaration inside an annotation (example : class<Short> a()).
* @param annotationName the name of the annotation. Null if the visit of the Class is
* inside an Array.
* @param className the name of the class.
*/
public void visitClass(String annotationName, String className) {
if (av != null) {
av.visitClass(annotationName,className);
}
}
/**
* Visits the end of the annotation.
*/