Skip to content

Commit

Permalink
finishing version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fjelmer committed Apr 10, 2011
1 parent 004be64 commit 33fd2d8
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Classycle/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<body>
<tt>
<pre>
Classycle 1.3.3
===============
Classycle 1.4
=============


This distribution contains:
Expand Down
2 changes: 1 addition & 1 deletion Classycle/build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<project default="jar" name="Classycle" basedir=".">
<property name="version" value="1.3.3"/>
<property name="version" value="1.4"/>

<!-- prefix that allows to reference environment variables ===============-->
<property environment="env"/>
Expand Down
6 changes: 4 additions & 2 deletions Classycle/dependencyCheckingTaskTestBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@
<fileset dir="../classes/example">
<include name="**/*.class"/>
</fileset>
[A-not-p] = *A excluding example.p.*
check [A-not-p] dependentOnlyOn java.lang.* example.A*
check example.B* example.p.* dependentOnlyOn java.lang.* example.A*
[set] = example.B* example.p.*
check [set] dependentOnlyOn java.lang.*
check example.B* dependentOnlyOn *A
</classycleDependencyCheck>
</target>

Expand Down
4 changes: 2 additions & 2 deletions Classycle/src/classycle/Analyser.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*/
public class Analyser
{
private static final String VERSION = "1.3.3";
private static final String VERSION = "1.4";
private static final DateFormat DATE_FORMAT
= new SimpleDateFormat("yyyy-MM-dd");
private static final String CSV_TEMPLATE
Expand Down Expand Up @@ -397,7 +397,7 @@ public void readAndAnalyse(boolean packagesOnly) throws IOException
{
System.out.println("============= Classycle V" + VERSION
+ " =============");
System.out.println("=========== by Franz-Josef Elmer ===========");
System.out.println("========== by Franz-Josef Elmer ==========");
System.out.print("read class files and create class graph ... ");
long duration = createClassGraph();
System.out.println("done after " + duration + " ms: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class DependencyCheckerCommandLine extends CommandLine
RENDERER = "-renderer=";

private String _dependencyDefinition;
private ResultRenderer _renderer = new DefaultResultRenderer();
private ResultRenderer _renderer;

public DependencyCheckerCommandLine(String[] args)
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public String getDependencyDefinition()

public ResultRenderer getRenderer()
{
return _renderer;
return _renderer == null ? new DefaultResultRenderer() : _renderer;
}

private void handleDependenciesOption(String option)
Expand Down
10 changes: 5 additions & 5 deletions Classycle/src/classycle/dependency/DependencyStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

import static classycle.dependency.DependencyDefinitionParser.DIRECTLY_INDEPENDENT_OF_KEY_WORD;

import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.util.Set;

import classycle.graph.AtomicVertex;
import classycle.graph.PathsFinder;
Expand Down Expand Up @@ -112,19 +112,19 @@ public Result execute(AtomicVertex[] graph)
StringPattern startSet = _startSets[i];
if (dependsOnly)
{
List<AtomicVertex> invalids = new ArrayList<AtomicVertex>();
Set<AtomicVertex> invalids = new HashSet<AtomicVertex>();
for (AtomicVertex vertex : graph)
{
if (startCondition.isFulfilled(vertex))
{
for (int j = 0, n = vertex.getNumberOfOutgoingArcs(); j < n; j++)
{
Vertex headVertex = vertex.getHeadVertex(j);
if (_finalCondition.isFulfilled(headVertex) == false)
if (_finalCondition.isFulfilled(headVertex) == false
&& startCondition.isFulfilled(headVertex) == false)
{
invalids.add(vertex);
invalids.add((AtomicVertex) headVertex);
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Classycle/src/classycle/dependency/XMLResultRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import classycle.util.Text;

/**
* Renderer which renders dependency checking results as XML.
* Renderer which renders dependency checking results as XML. It ignores preferences.
*
* @author Franz-Josef Elmer
*/
Expand Down
23 changes: 20 additions & 3 deletions Classycle/srcTest/classycle/ant/DependencyCheckingTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,28 @@ public void testResetGraphAfterCheck() throws Exception
public void testDependentOnlyOn() throws Exception
{
executeTarget("testDependentOnlyOn");
assertEquals("check [A-not-p] dependentOnlyOn java.lang.* example.A*\n"
assertEquals("check example.B* dependentOnlyOn java.lang.* example.A*\n"
+ " Unexpected dependencies found:\n"
+ " example.B$M\n"
+ " -> example.p.A\n"
+ " example.BofA\n"
+ " -> example.p.A\n",
getOutput());
+ " -> example.p.A\n"
+ "check [set] dependentOnlyOn java.lang.*\n"
+ " Unexpected dependencies found:\n"
+ " example.B$M\n"
+ " -> example.A\n"
+ " example.p.A\n"
+ " -> example.A\n"
+ " example.B\n"
+ " -> example.A\n"
+ "check example.B* dependentOnlyOn *A\n"
+ " Unexpected dependencies found:\n"
+ " example.B$M\n"
+ " -> java.lang.Object\n"
+ " example.BofA\n"
+ " -> java.lang.Object\n"
+ " -> java.lang.Class\n"
+ " -> java.lang.Thread\n", getOutput());
}

public void testReflection() throws Exception
Expand Down

0 comments on commit 33fd2d8

Please sign in to comment.