User Tools

Site Tools


How to Use Ptidej to Identify Occurrences of Design Motifs: A Quick Start

By Chushu Gao

1. Environment

This guide based on the experience on Ecilpes 3.5 in WindowsXP and Fedora Eclipse released with FC11.

2. Check out Ptidej projects

You will need an account to access Ptidej SVN repository ( 5 Workspace/).

Check out Ptidej using the Team Set file ( The early version has missing projects to my experience. I have exported a team set file using Eclipse 3.5 with subclipse plugin installed (as attached).

If there are build errors after checking out, it usually results from the missing project dependencies. Use the quick fix in Eclipse or manually add projects in the project's Java Build Path. Other errors may relate to the incorrect library setting, such as JUnit or JRE.

3. Run in Eclipse

3.1 Ptidej UI Viewer Swing Standalone

Even if there are projects that failed to build, the Ptidej UI Viewer Swing Standalone is still able to start. In Eclipse, run it as an applicaiton and see video for details to use this GUI tool(

3.2 Batch mode

Make sure the project 'Ptidej Solver Test' is successfully built. Some projects are not required though listed in the required projects section of Java Build Path of this project. My working set of projects added includes CPL, JChoco, PADL, PADL Analyses, PADL Creator ClassFile, PADL Design Motifs, Ptidej, Ptidej Solver 4.

The path to JAR or class files you want to analyse is hard-coded in the class DesignMotifIdentificationCaller(/Ptidej Solver Tests/src/ptidej/solver/helper/

Modify code to fit your settings and run this class. The path to the result file is also hard-coded in this class.

4. Run as JAR

I Compile the project to a runnable JAR with the Run Configuration in step 3.2 using Eclipse Export on Eclipse 3.5 in WinXP. If the tool seems work fine but just output 0 solution for all design motif. Try copying 'padl' folder from project PADL/bin to where your runable JAR is. This works for me.

Unfortunately I got error messages as below when running this JAR in Fedora where default JDK is OpenJDK1.6:

at padl.util.repository.file.ClassFileRepository.storeFiles(
at padl.util.repository.file.ClassFileRepository.getMetaModelFiles(
at padl.util.repository.file.ClassFileRepository.getFiles(
at padl.util.repository.constituent.ConstituentRepository.<init>(
at padl.util.repository.constituent.ConstituentRepository.getInstance(
at ptidej.solver.helper.DesignMotifIdentificationCaller.analyseCodeLevelModelFromJAR(
at ptidej.solver.helper.DesignMotifIdentificationCaller.main(
Loading class files in: ./1_0/org.eclipse.jdt.core/jdtcore.jar
Exception in thread "main" java.lang.NullPointerException
at padl.creator.AbstractClassFileCreator.createElements(
at padl.creator.AbstractClassFileCreator.create(
at padl.kernel.impl.CodeLevelModel.create(
at ptidej.solver.helper.DesignMotifIdentificationCaller.analyseCodeLevelModelFromJAR(
at ptidej.solver.helper.DesignMotifIdentificationCaller.main(

So you may consider to run this JAR in the java environment using SunJDK.

5. Memory Usage

For big JAR or class files, set enough memory for jvm, I have tried -Xmx2048M and got out of memory error when solving UI part of jdt3.0.

howto.txt · Last modified: 2019/10/06 20:37 (external edit)