Extracting class dependency for iBUGS

55 views
Skip to first unread message

Shivani

unread,
Nov 7, 2011, 10:20:54 AM11/7/11
to iBugs
Hello all,
I am trying to find tools that will help me extract class dependency
graph for the ASPECTJ software of the iBUGS software.

Any help in this regard would be great.

Regards,
Shivani

Valentin Dallmeier

unread,
Nov 7, 2011, 11:43:22 AM11/7/11
to ib...@googlegroups.com
Hi Shivani!

One framework that comes to mind is Soot:

http://www.sable.mcgill.ca/soot/

Rumor has it it's rather complicated to use.

Regards,

Valentin


Shivani

--
You received this message because you are subscribed to the Google Groups "iBugs" group.
To post to this group, send email to ib...@googlegroups.com.
To unsubscribe from this group, send email to ibugs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ibugs?hl=en.


Shivani

unread,
Nov 7, 2011, 4:49:22 PM11/7/11
to iBugs
Hello Valentin,

Thanks for your email. I am looking into soot for sure.
For soot or any other class dependency analysis tool, I need to
provide the .class or the .jar files.
In order to generate the .jar or the .class files, I need to compile
the versions. I followed the technical report and I realized that I
need to compile the ASPECTJ source code using ant.

This is what I tried

cd ibugs_aspectj-1.3
ant -DfixId=28919 checkoutversion
and it failed with the following message

BUILD FAILED
/home/shivani/research/database/ibugs_aspectj-1.3/build.xml:179: The
following error occurred while executing this line:
/home/shivani/research/database/ibugs_aspectj-1.3/build.xml:131:
<fixcrlf> error: srcdir does not exist: '/home/shivani/research/
database/ibugs_aspectj-1.3/versions/28919/post-fix/org.aspectj/modules/
lib/ant/bin'


I am newbie to both java and ant... Any help is appreicated.

Shivani

On Nov 7, 11:43 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
wrote:
> Hi Shivani!
>
> One framework that comes to mind is Soot:
>
> http://www.sable.mcgill.ca/soot/
>
> Rumor has it it's rather complicated to use.
>
> Regards,
>
> Valentin
>

Valentin Dallmeier

unread,
Nov 8, 2011, 2:32:38 AM11/8/11
to ib...@googlegroups.com
Hi!

It seems that the checkout has failed. Can you try to create directory versions in folder ibugs_aspectj-1.3 ?

Valentin

Shivani

unread,
Nov 14, 2011, 9:24:05 AM11/14/11
to iBugs
Hello Valentine!

I checked that that folder versions and 28919 is being created.
I think the error is due to a wrong java path..

[java] Java Result: -1
[java] /home/shivani/research/database/ibugs_aspectj-1.3/
build.xml:169: java.io.IOException: Cannot run program "/opt/
j2sdk-1.4.2/bin/java": java.io.IOException: error=2, No such file or
directory

Any ideas?

Your help is appreciated very much.

Shivani

On Nov 8, 2:32 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
wrote:
> Hi!
>
> It seems that the checkout has failed. Can you try to create directory
> versions in folder ibugs_aspectj-1.3 ?
>
> Valentin
>

Shivani

unread,
Nov 14, 2011, 9:47:23 AM11/14/11
to iBugs

A little more investigation revealed that the local.properties in
versions/28919/pre-fix/org.aspectj/modules/build/ has the following
settings...

java14.home=/opt/j2sdk-1.4.2
java15.home=/opt/j2sdk-1.4.2

These files are of-course non-existent on my desktop which is why
building is failing

Shivani

On Nov 8, 2:32 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
wrote:
> Hi!
>
> It seems that the checkout has failed. Can you try to create directory
> versions in folder ibugs_aspectj-1.3 ?
>
> Valentin
>

Shivani

unread,
Nov 14, 2011, 10:03:35 AM11/14/11
to iBugs
Also my Apache ant version is 1.8.2
Apache Ant(TM) version 1.8.2 compiled on December 20 2010

Do you think that has different paths set?

Shivani

On Nov 8, 2:32 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
wrote:
> Hi!
>
> It seems that the checkout has failed. Can you try to create directory
> versions in folder ibugs_aspectj-1.3 ?
>
> Valentin
>

Shivani

unread,
Nov 14, 2011, 4:32:59 PM11/14/11
to iBugs
Issue has been solved!!!

I figured that the JAVA_HOME needs to be set in the properties.xml
as follows
<property name="JAVA_HOME" value="/usr/lib/jvm/java-1.6.0-openjdk/jre"/
>

This was set to /opt/j2sdk-1.4.2 that was overriding my export
JAVA_HOME command in the terminal where I was running ant.

That was simple to fix but took long time to find.

Shivani

Shivani

unread,
Nov 14, 2011, 4:37:21 PM11/14/11
to iBugs
Now I have another question!!!

Does ant compile each of the modules separately. I do not see any jar
files.. i would like to use it to extract the class dependency graph
for the entire version.

a) Do I need to run the testresults.xml to obtain jar files?
b) Is the prefix postfix version that is checked out a single body of
software. If it is, where is the jar file located?

I am new to java, your help would be really helpful and appreciated!

Thanks!
Shivani





On Nov 14, 10:03 am, Shivani <raoshiv...@gmail.com> wrote:

Valentin Dallmeier

unread,
Nov 16, 2011, 2:36:08 AM11/16/11
to ib...@googlegroups.com
Hi!

The short answer is: This depends on the version that you are checking out. If you need a single jar, your best bet is to run target "buildtests", which generates a jar containing all test drivers and AspectJ classes. For version 28919 for example, the jar is generated at

org.aspectj/modules/aj-build/jars/testing-drivers-all.jar

This location is used for most versions. If you can't find the jar there, you need to check the output of buildtests, which should tell you where exactly the jar is generated.

Regards,

Valentin

Shivani

unread,
Nov 16, 2011, 3:42:39 PM11/16/11
to iBugs
Hello Valentine!

I am still unable to execute the step 3 from your algorithm (call it
B)

ant -DfixId=4711 -Dtag=pre-fix buildversion

and this is where the error starts occuring

[exec] build-product:
[exec] testing trimmed for product tools
[exec] cannot handle con yet: <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
[exec] building product module runtime for /home/shivani/research/
database/ibugs_aspectj-1.3/versions/28919/pre-fix/org.aspectj/modules/
build/products/tools

I tried writing a dummy java code in order to test my ant script.
(lets call it A)
Here is how the dummy java code (A simple multiplication code)
compiled

compile:
[javac] /home/shivani/research/toolkit/ant/ant_tutorials/build.xml:
36: warning: 'includeantruntime' was not set, defaulting to
build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to /home/shivani/research/toolkit/
ant/ant_tutorials/build

jar:
[jar] Building jar: /home/shivani/research/toolkit/ant/
ant_tutorials/dist/de.vogella.build.test.ant.jar

docs:
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source file /home/shivani/research/toolkit/ant/
ant_tutorials/src/Main.java...
[javadoc] Loading source file /home/shivani/research/toolkit/ant/
ant_tutorials/src/MyMath.java...
[javadoc] Constructing Javadoc information...
[javadoc] Standard Doclet version 1.6.0_20
[javadoc] Building tree for all the packages and classes...
[javadoc] Building index for all the packages and classes...
[javadoc] Building index for all classes...

So in scenario B, something is going wrong in that, eclipse compiler
is being used

I have spent umpteen hours scanning websites, forums and staring the
configuration files...

Any help is appreciated!

Shivani

On Nov 16, 2:36 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
wrote:
> Hi!
>
> The short answer is: This depends on the version that you are checking out.
> If you need a single jar, your best bet is to run target "buildtests",
> which generates a jar containing all test drivers and AspectJ classes. For
> version 28919 for example, the jar is generated at
>
> org.aspectj/modules/aj-build/jars/testing-drivers-all.jar
>
> This location is used for most versions. If you can't find the jar there,
> you need to check the output of buildtests, which should tell you where
> exactly the jar is generated.
>
> Regards,
>
> Valentin
>

Francisco Servant

unread,
Nov 18, 2011, 4:56:24 PM11/18/11
to iBugs
Hello Shivani,

I think I know what your problem is.

You mention earlier that you set your JAVA_HOME property to:
<property name="JAVA_HOME" value="/usr/lib/jvm/java-1.6.0-openjdk/
jre"/

I assume that this is the folder where your Java SDK is installed.
The problem is that you are using Java 1.6.0.

In order to compile correctly, AspectJ requires Java 1.4.2.

So, you need to download specifically the 1.4.2 version of the Java
SDK and set your JAVA_HOME property in properties.xml to the directory
where you installed the Java 1.4.2 SDK.

Hope that helps!!

Francisco

> > On Mon, Nov 14, 2011 at 10:37 PM,Shivani<raoshiv...@gmail.com> wrote:
> > > Now I have another question!!!
>
> > > Does ant compile each of the modules separately. I do not see any jar
> > > files.. i would like to use it to extract the class dependency graph
> > > for the entire version.
>
> > > a) Do I need to run the testresults.xml to obtain jar files?
> > > b) Is the prefix postfix version that is checked out a single body of
> > > software. If it is, where is the jar file located?
>
> > > I am new to java, your help would be really helpful and appreciated!
>
> > > Thanks!
> > >Shivani
>

> > > On Nov 14, 10:03 am,Shivani<raoshiv...@gmail.com> wrote:
> > > > Also my Apache ant version is 1.8.2
> > > > Apache Ant(TM) version 1.8.2 compiled on December 20 2010
>
> > > > Do you think that has different paths set?
>
> > > >Shivani
>
> > > > On Nov 8, 2:32 am, Valentin Dallmeier <valentin.dallme...@gmail.com>
> > > > wrote:
>
> > > > > Hi!
>
> > > > > It seems that the checkout has failed. Can you try to create directory
> > > > > versions in folder ibugs_aspectj-1.3 ?
>
> > > > > Valentin
>

> > > > > > > On Mon, Nov 7, 2011 at 4:20 PM,Shivani<raoshiv...@gmail.com>

Shivani

unread,
Nov 19, 2011, 2:51:56 PM11/19/11
to iBugs
A little more research on this error message "class file has wrong
version 50.0, should be 48.0" shows that there is still some
compilation error due to mismatch in the java version...

Below are a list of some of the version numbers and their
corresponding Java runtimes:
Version 50.0 = Java 1.6.x
Version 49.0 = Java 1.5.x
Version 48.0 = Java 1.4.x

This is the solution provided
"To resolve this issue, regenerate the proxies using com2java and
compile them with your version of the Java SDK. Alternatively, you
can download some precompiled proxies from our Precompiled Java Proxy
JAR Files KB article."

http://j-integra.intrinsyc.com/support/kb/article.aspx?id=183240

Any ideas?

Shivani

Shivani

unread,
Nov 19, 2011, 3:17:32 PM11/19/11
to iBugs
Actually it worked
I had to run cleanversion before buildversion.
And it worked!!!

Thanks Francisco!!

Shivani

On Nov 18, 4:56 pm, Francisco Servant <fserv...@ics.uci.edu> wrote:

Shivani

unread,
Nov 19, 2011, 2:18:14 PM11/19/11
to iBugs
Hello Francisco,

I installed j2sdk1.4.2 from http://java.sun.com/j2se/1.4.2/install-linux.html
into a directory and provided that path in properties.xml.

I still get the following error. Looks like a module compilation is
missing in the build.xml

[exec] modules to build: [bridge, asm, org.eclipse.jdt.core, weaver,
org.aspectj.ajdt.core, ajde, taskdefs, ajbrowser]
[exec] building bridge
[exec] buildOnly bridge
[exec] [ajbuild-javac] Since fork is true, ignoring compiler
setting.
[exec] [ajbuild-javac] Compiling 14 source files to /tmp/
Builder2968360732516595487tmp/classes-1321730012310
[exec] [ajbuild-javac] Since fork is true, ignoring compiler
setting.
[exec] [ajbuild-javac] /home/shivani/research/database/
ibugs_aspectj-1.3/versions/28919/pre-fix/org.aspectj/modules/bridge/
src/org/aspectj/bridge/MessageUtil.java:17: cannot access
org.aspectj.util.LangUtil
[exec] error building ajbrowser for /home/shivani/research/
database/ibugs_aspectj-1.3/versions/28919/pre-fix/org.aspectj/modules/
build/products/tools: BuildException compiling Module [name=bridge,
srcDirs=[/home/shivani/research/database/ibugs_aspectj-1.3/versions/
28919/pre-fix/org.aspectj/modules/bridge/src], required=[util],
moduleJar=/home/shivani/research/database/ibugs_aspectj-1.3/versions/
28919/pre-fix/org.aspectj/modules/aj-build/jars/bridge.jar, libJars=[]]
[]: Compile failed; see the compiler error output for details.
[exec] Compile failed; see the compiler error output for details.
[exec] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:
842)
[exec] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:
682)
[exec] at
org.aspectj.internal.tools.ant.taskdefs.AntBuilder.executeTask(AntBuilder.java:
434)
[exec] at
org.aspectj.internal.tools.ant.taskdefs.AntBuilder.compile(AntBuilder.java:
249)
[exec] at
org.aspectj.internal.tools.build.Builder.buildOnly(Builder.java:293)
[exec] at
org.aspectj.internal.tools.build.Builder.buildAll(Builder.java:264)
[exec] at
org.aspectj.internal.tools.build.Builder.buildProductModule(Builder.java:
425)
[exec] at
org.aspectj.internal.tools.ant.taskdefs.ProductBuilder.buildProduct(AntBuilder.java:
569)
[exec] at
org.aspectj.internal.tools.build.Builder.build(Builder.java:180)
[exec] at
org.aspectj.internal.tools.ant.taskdefs.BuildModule.build(BuildModule.java:
142)
[exec] at
org.aspectj.internal.tools.ant.taskdefs.BuildModule.execute(BuildModule.java:
116)
[exec] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
[exec] at org.apache.tools.ant.Task.perform(Task.java:319)
[exec] at org.apache.tools.ant.Target.execute(Target.java:309)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:
336)
[exec] at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[exec] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:
371)
[exec] at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
[exec] at org.apache.tools.ant.Task.perform(Task.java:319)
[exec] at org.apache.tools.ant.Target.execute(Target.java:309)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:
336)
[exec] at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[exec] at org.apache.tools.ant.Project.executeTargets(Pr[ajbuild-
javac] bad class file: /home/shivani/research/database/
ibugs_aspectj-1.3/versions/28919/pre-fix/org.aspectj/modules/aj-
oject.java:1250)
[exec] at org.apache.tools.ant.Main.runBuild(Main.java:610)
[exec] at org.apache.tools.ant.Main.start(Main.java:196)
[exec] at orbuild/jars/util.jar(org/aspectj/util/LangUtil.class)
[exec] [ajbuild-javac] class file has wrong version 50.0, should
be 48.0
[exec] [ajbuild-g.apache.tools.ant.Main.main(Main.java:235)
[exec]
[exec]
[exec] BUILD FAILED
[exec] file:/home/shivani/research/database/ibugs_aspectj-1.3/
versions/28919/pre-fix/org.aspectj/modules/build/build.xml:145: error
building product tools
[exec]
[exec] Total time: 1 second
[exec] javac] Please remove or make sure it appears in the
correct subdirectory of the classpath.
[exec] [ajbuild-javac] import org.aspectj.util.LangUtil;
[exec] [ajbuild-javac] ^
[exec] [ajbuild-javac] 1 error
[exec] [ajbuild-javac] Since fork is true, ignoring compiler
setting.
[exec] Result: 1


Your help is appreciated,


Shivani

On Nov 18, 4:56 pm, Francisco Servant <fserv...@ics.uci.edu> wrote:

Reply all
Reply to author
Forward
0 new messages