Repository: SpoonLabs/gumtree-spoon-ast-diff
Pull request #103 (2019-06-09 10:12:09)

[bugfix] issue #102. A tree node of an invocation  has now the simple
name instead of the signature.


Patch:
diff --git a/src/main/java/gumtree/spoon/builder/LabelFinder.java b/src/main/java/gumtree/spoon/builder/LabelFinder.java
index 746d9a6..603879e 100644
--- a/src/main/java/gumtree/spoon/builder/LabelFinder.java
+++ b/src/main/java/gumtree/spoon/builder/LabelFinder.java
@@ -1,6 +1,23 @@
 package gumtree.spoon.builder;
 
-import spoon.reflect.code.*;
+import spoon.reflect.code.CtAssert;
+import spoon.reflect.code.CtAssignment;
+import spoon.reflect.code.CtBinaryOperator;
+import spoon.reflect.code.CtBlock;
+import spoon.reflect.code.CtBreak;
+import spoon.reflect.code.CtConstructorCall;
+import spoon.reflect.code.CtContinue;
+import spoon.reflect.code.CtIf;
+import spoon.reflect.code.CtInvocation;
+import spoon.reflect.code.CtLiteral;
+import spoon.reflect.code.CtOperatorAssignment;
+import spoon.reflect.code.CtReturn;
+import spoon.reflect.code.CtSuperAccess;
+import spoon.reflect.code.CtThisAccess;
+import spoon.reflect.code.CtTypeAccess;
+import spoon.reflect.code.CtUnaryOperator;
+import spoon.reflect.code.CtVariableAccess;
+import spoon.reflect.code.CtWhile;
 import spoon.reflect.declaration.CtNamedElement;
 import spoon.reflect.path.CtRole;
 import spoon.reflect.reference.CtTypeReference;
@@ -19,12 +36,15 @@ class LabelFinder extends CtInheritanceScanner {
 		label = variableAccess.getVariable().getSimpleName();
 	}
 
-
 	@Override
 	public <T> void visitCtInvocation(CtInvocation<T> invocation) {
 		if (invocation.getExecutable() != null) {
 			CtTypeReference decl = invocation.getExecutable().getDeclaringType();
-			label = (decl!=null?decl.getQualifiedName():"")+"#"+invocation.getExecutable().getSignature();
+			// label =
+			// (decl!=null?decl.getQualifiedName():"")+"#"+invocation.getExecutable().getSignature();
+			//label = (decl != null ? decl.getQualifiedName() : "") + "#" + invocation.getExecutable().getSimpleName();
+			label = invocation.getExecutable().getSimpleName();
+			
 		}
 	}
 
@@ -103,12 +123,12 @@ class LabelFinder extends CtInheritanceScanner {
 
 	@Override
 	public <T> void visitCtThisAccess(CtThisAccess<T> thisAccess) {
-		label =  thisAccess.toString();
+		label = thisAccess.toString();
 	}
 
 	@Override
 	public <T> void visitCtSuperAccess(CtSuperAccess<T> f) {
-		label =  f.toString();
+		label = f.toString();
 	}
 
 	@Override


Test patch:
diff --git a/src/test/java/gumtree/spoon/AstComparatorTest.java b/src/test/java/gumtree/spoon/AstComparatorTest.java
index 1b1dac7..6afc1cb 100644
--- a/src/test/java/gumtree/spoon/AstComparatorTest.java
+++ b/src/test/java/gumtree/spoon/AstComparatorTest.java
@@ -1,6 +1,21 @@
 package gumtree.spoon;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
 import com.github.gumtreediff.matchers.Mapping;
+
 import gumtree.spoon.builder.NodeCreator;
 import gumtree.spoon.builder.SpoonGumTreeBuilder;
 import gumtree.spoon.diff.Diff;
@@ -9,12 +24,16 @@ import gumtree.spoon.diff.operations.MoveOperation;
 import gumtree.spoon.diff.operations.Operation;
 import gumtree.spoon.diff.operations.OperationKind;
 import gumtree.spoon.diff.operations.UpdateOperation;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
 import spoon.Launcher;
 import spoon.SpoonModelBuilder;
-import spoon.reflect.code.*;
+import spoon.reflect.code.CtBinaryOperator;
+import spoon.reflect.code.CtConstructorCall;
+import spoon.reflect.code.CtIf;
+import spoon.reflect.code.CtInvocation;
+import spoon.reflect.code.CtLocalVariable;
+import spoon.reflect.code.CtNewClass;
+import spoon.reflect.code.CtReturn;
+import spoon.reflect.code.CtThrow;
 import spoon.reflect.declaration.CtClass;
 import spoon.reflect.declaration.CtElement;
 import spoon.reflect.declaration.CtType;
@@ -23,13 +42,6 @@ import spoon.support.compiler.VirtualFile;
 import spoon.support.compiler.jdt.JDTBasedSpoonCompiler;
 import spoon.support.compiler.jdt.JDTSnippetCompiler;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.List;
-
-import static org.junit.Assert.*;
-
 /**
  * Test Spoon Diff
  * 
@@ -229,7 +241,7 @@ public class AstComparatorTest {
 		System.out.println(actions);
 		assertEquals(2, actions.size());
 		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation",
-				"QuickNotepadTextArea#addKeyListener(QuickNotepad$KeyHandler)"));
+				"addKeyListener"));
 		assertTrue(result.containsOperation(OperationKind.Delete, "Class", "KeyHandler"));
 
 		CtElement ancestor = result.commonAncestor();
@@ -330,7 +342,8 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		// result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "#addField(<unknown>,<unknown>)"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "addField"));
+
 	}
 
 	@Test
@@ -346,7 +359,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		// result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "#getTarget()"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "getTarget"));
 
 		UpdateOperation updateOp = (UpdateOperation) actions.get(0);
 		CtElement dst = updateOp.getDstNode();
@@ -365,7 +378,9 @@ public class AstComparatorTest {
 
 		List<Operation> actions = result.getAllOperations();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "#getTarget()"));
+		// assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
+		// "#getTarget()"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "getTarget"));
 
 		UpdateOperation updateOp = (UpdateOperation) actions.get(0);
 		CtElement dst = updateOp.getDstNode();
@@ -456,8 +471,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		// result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation",
-				"java.awt.Container#setFocusTraversalPolicyProvider(boolean)"));
+		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation", "setFocusTraversalPolicyProvider"));
 	}
 
 	@Test
@@ -525,7 +539,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation", "java.io.PrintStream#println(char[])"));
+		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation", "println"));
 	}
 
 	@Test
@@ -540,7 +554,9 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "java.util.Vector#remove(int)"));
+		// assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
+		// "java.util.Vector#remove(int)"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "remove"));
 	}
 
 	@Test
@@ -555,8 +571,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
-				"java.util.Vector#removeElement(java.lang.Object)"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "removeElement"));
 	}
 
 	@Test
@@ -630,9 +645,9 @@ public class AstComparatorTest {
 		assertEquals(3, actions.size());
 		assertEquals(229, ancestor.getPosition().getLine());
 
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "#equals(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "equals"));
 		assertTrue(result.containsOperation(OperationKind.Insert, "BinaryOperator", "NE"));
-		assertTrue(result.containsOperation(OperationKind.Move, "Invocation", "#equals(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Move, "Invocation", "equals"));
 
 		// updated the if condition
 		CtElement elem = actions.get(0).getNode();
@@ -653,7 +668,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "#append(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "append"));
 	}
 
 	@Test
@@ -724,8 +739,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(
-				result.containsOperation(OperationKind.Insert, "Invocation", "megamek.client.bot.CEntity#refresh()"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "refresh"));
 	}
 
 	@Test
@@ -797,8 +811,7 @@ public class AstComparatorTest {
 
 		List<Operation> actions = result.getRootOperations();
 		assertTrue(actions.size() >= 3);
-		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation",
-				"java.lang.String#format(java.lang.String,java.lang.Object[])"));
+		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation", "format"));
 		assertTrue(result.containsOperation(OperationKind.Insert, "BinaryOperator", "PLUS"));
 
 		// the move can be either getEntity or getShortName
@@ -820,8 +833,7 @@ public class AstComparatorTest {
 		result.debugInformation();
 		assertEquals(actions.size(), 2);
 		assertTrue(result.containsOperation(OperationKind.Insert, "If"));
-		assertTrue(result.containsOperation(OperationKind.Move, "Invocation",
-				"org.apache.lucene.index.SegmentTermEnum#growBuffer(int)"));
+		assertTrue(result.containsOperation(OperationKind.Move, "Invocation", "growBuffer"));
 	}
 
 	@Test
@@ -837,8 +849,7 @@ public class AstComparatorTest {
 		result.debugInformation();
 		assertEquals(actions.size(), 2);
 		assertTrue(result.containsOperation(OperationKind.Insert, "BinaryOperator", "OR"));
-		assertTrue(result.containsOperation(OperationKind.Move, "Invocation",
-				"org.apache.lucene.index.SegmentReader#hasDeletions()"));
+		assertTrue(result.containsOperation(OperationKind.Move, "Invocation", "hasDeletions"));
 	}
 
 	@Test
@@ -853,7 +864,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(actions.size(), 1);
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "#delete(int)"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "delete"));
 	}
 
 	@Test
@@ -919,10 +930,8 @@ public class AstComparatorTest {
 
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
-		assertEquals(2, actions.size());
+		assertEquals(1, actions.size());
 		assertTrue(result.containsOperation(OperationKind.Update, "Literal", "' '"));
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
-				"java.lang.StringBuffer#insert(int,char)"));
 	}
 
 	/**
@@ -1089,8 +1098,7 @@ public class AstComparatorTest {
 		result.debugInformation();
 		assertEquals(3, actions.size());
 		assertTrue(result.containsOperation(OperationKind.Delete, "Assignment"));
-		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation",
-				"org.apache.lucene.index.IndexWriter#setMaxFieldLength(int)"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "setMaxFieldLength"));
 		assertTrue(result.containsOperation(OperationKind.Move, "FieldRead", "writer"));
 	}
 
@@ -1106,7 +1114,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "java.lang.Throwable#getMessage()"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "getMessage"));
 	}
 
 	@Test
@@ -1151,8 +1159,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		// result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
-				"org.apache.turbine.util.Log#error(java.lang.String,java.lang.Exception)"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "error"));
 	}
 
 	@Test
@@ -1212,8 +1219,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation",
-				"org.apache.turbine.Log#debug(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "debug"));
 	}
 
 	@Test
@@ -1227,14 +1233,15 @@ public class AstComparatorTest {
 
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
-		assertEquals(1, actions.size());
+		assertEquals(2, actions.size());
 		// root actions
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
-				"java.lang.String#lastIndexOf(java.lang.String)"));
+		// Issue #102
+		// assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
+		// "lastIndexOf"));
 		// low level actions
 		assertTrue(
-				result.containsOperations(result.getAllOperations(), OperationKind.Delete, "FieldRead", "separator"));
-		assertTrue(result.containsOperations(result.getAllOperations(), OperationKind.Insert, "Literal", "'/'"));
+				result.containsOperations(result.getRootOperations(), OperationKind.Delete, "FieldRead", "separator"));
+		assertTrue(result.containsOperations(result.getRootOperations(), OperationKind.Insert, "Literal", "'/'"));
 	}
 
 	@Test
@@ -1265,8 +1272,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation",
-				"java.io.PrintStream#println(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Delete, "Invocation", "println"));
 	}
 
 	@Test
@@ -1296,7 +1302,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "#addAscendingOrderByColumn()"));
+		assertTrue(result.containsOperation(OperationKind.Update, "Invocation", "addAscendingOrderByColumn"));
 	}
 
 	@Test
@@ -1342,8 +1348,9 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(2, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
-				"org.tigris.scarab.util.Email#sendEmail(org.apache.fulcrum.template.TemplateContext,org.tigris.scarab.om.Module,<unknown>,<unknown>,java.lang.String,java.lang.String)"));
+		// assertTrue(result.containsOperation(OperationKind.Update, "Invocation",
+		// "sendEmail"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Literal", "null"));
 
 		// one parameter is moved to another argument
 		assertTrue(result.containsOperation(OperationKind.Move, "Invocation"));
@@ -1361,8 +1368,7 @@ public class AstComparatorTest {
 		List<Operation> actions = result.getRootOperations();
 		result.debugInformation();
 		assertEquals(1, actions.size());
-		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation",
-				"#setDisplayDescription(java.lang.String)"));
+		assertTrue(result.containsOperation(OperationKind.Insert, "Invocation", "setDisplayDescription"));
 	}
 
 	@Test
@@ -1529,7 +1535,7 @@ public class AstComparatorTest {
 
 		assertEquals(2, actions.size());
 		assertTrue(result.containsOperation(OperationKind.Insert, "Parameter", "call"));
-        assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "Callback<T>"));
+		assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "Callback<T>"));
 	}
 
 	@Test
@@ -1692,8 +1698,8 @@ public class AstComparatorTest {
 
 		assertEquals(2, actions.size());
 
-        assertTrue(resulta.containsOperation(OperationKind.Insert, "Parameter", "call"));
-        assertTrue(resulta.containsOperation(OperationKind.Update, "SUPER_TYPE", "Callback<T>"));
+		assertTrue(resulta.containsOperation(OperationKind.Insert, "Parameter", "call"));
+		assertTrue(resulta.containsOperation(OperationKind.Update, "SUPER_TYPE", "Callback<T>"));
 
 		DiffImpl idiff = (DiffImpl) resulta;
 
@@ -1706,50 +1712,73 @@ public class AstComparatorTest {
 
 	}
 
+	@Test
+	public void testExtends() throws Exception {
+		CtClass c1a = Launcher.parseClass("class Main extends SuperClass1 { }");
+		CtClass c2a = Launcher.parseClass("class Main extends SuperClass2 { }");
 
-    @Test
-    public void testExtends() throws Exception {
-        CtClass c1a = Launcher.parseClass("class Main extends SuperClass1 { }");
-        CtClass c2a = Launcher.parseClass("class Main extends SuperClass2 { }");
+		AstComparator diff = new AstComparator();
+		Diff result = diff.compare(c1a, c2a);
 
-        AstComparator diff = new AstComparator();
-        Diff result = diff.compare(c1a, c2a);
+		List<Operation> actions = result.getRootOperations();
+		result.debugInformation();
 
-        List<Operation> actions = result.getRootOperations();
-        result.debugInformation();
+		assertEquals(1, actions.size());
+		assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass1"));
+	}
 
-        assertEquals(1, actions.size());
-        assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass1"));
-    }
+	@Test
+	public void testExtendsGenerics1() throws Exception {
+		CtClass c1a = Launcher.parseClass("class Main extends SuperClass<One> { }");
+		CtClass c2a = Launcher.parseClass("class Main extends SuperClass<Two> { }");
 
-    @Test
-    public void testExtendsGenerics1() throws Exception {
-        CtClass c1a = Launcher.parseClass("class Main extends SuperClass<One> { }");
-        CtClass c2a = Launcher.parseClass("class Main extends SuperClass<Two> { }");
+		AstComparator diff = new AstComparator();
+		Diff result = diff.compare(c1a, c2a);
 
-        AstComparator diff = new AstComparator();
-        Diff result = diff.compare(c1a, c2a);
+		List<Operation> actions = result.getRootOperations();
+		result.debugInformation();
 
-        List<Operation> actions = result.getRootOperations();
-        result.debugInformation();
+		assertEquals(1, actions.size());
+		assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass<One>"));
+	}
 
-        assertEquals(1, actions.size());
-        assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass<One>"));
-    }
+	@Test
+	public void testExtendsGenerics2() throws Exception {
+		CtClass c1a = Launcher.parseClass("class Main extends SuperClass { }");
+		CtClass c2a = Launcher.parseClass("class Main extends SuperClass<One> { }");
 
-    @Test
-    public void testExtendsGenerics2() throws Exception {
-        CtClass c1a = Launcher.parseClass("class Main extends SuperClass { }");
-        CtClass c2a = Launcher.parseClass("class Main extends SuperClass<One> { }");
+		AstComparator diff = new AstComparator();
+		Diff result = diff.compare(c1a, c2a);
 
-        AstComparator diff = new AstComparator();
-        Diff result = diff.compare(c1a, c2a);
+		List<Operation> actions = result.getRootOperations();
+		result.debugInformation();
 
-        List<Operation> actions = result.getRootOperations();
-        result.debugInformation();
+		assertEquals(1, actions.size());
+		assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass"));
+	}
 
-        assertEquals(1, actions.size());
-        assertTrue(result.containsOperation(OperationKind.Update, "SUPER_TYPE", "SuperClass"));
-    }
+	@Test
+	public void testD4JLang57() throws Exception {
+		AstComparator diff = new AstComparator();
+		File fl = new File("src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_s.java");
+		File fr = new File("src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_t.java");
+
+		Diff result = diff.compare(fl, fr);
+		List<Operation> actions = result.getAllOperations();
+		assertEquals(4, actions.size());
+
+	}
+
+	@Test
+	public void testD4JMath34() throws Exception {
+		AstComparator diff = new AstComparator();
+		File fl = new File("src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_s.java");
+		File fr = new File("src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_t.java");
+
+		Diff result = diff.compare(fl, fr);
+		List<Operation> actions = result.getAllOperations();
+		assertEquals(4, actions.size());
+
+	}
 
 }
diff --git a/src/test/java/gumtree/spoon/TreeTest.java b/src/test/java/gumtree/spoon/TreeTest.java
index 3a7e56c..ac4db1d 100644
--- a/src/test/java/gumtree/spoon/TreeTest.java
+++ b/src/test/java/gumtree/spoon/TreeTest.java
@@ -196,8 +196,9 @@ public class TreeTest {
 				.build();
 
 		CtType<?> aType = factory.Type().get("QuickNotepad");
-		assertEquals(FileUtils.readFileToString(new File("./src/test/resources/examples/spoon.json")),
-				new Json4SpoonGenerator().getJSONasString(aType));
+		String jsoNasString = new Json4SpoonGenerator().getJSONasString(aType).trim();
+		assertEquals(FileUtils.readFileToString(new File("./src/test/resources/examples/spoon.json")).trim(),
+				jsoNasString);
 	}
 
 	@Test
diff --git a/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_s.java b/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_s.java
new file mode 100644
index 0000000..ceb886e
--- /dev/null
+++ b/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_s.java
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>Operations to assist when working with a {@link Locale}.</p>
+ *
+ * <p>This class tries to handle <code>null</code> input gracefully.
+ * An exception will not be thrown for a <code>null</code> input.
+ * Each method documents its behaviour in more detail.</p>
+ *
+ * @author Stephen Colebourne
+ * @since 2.2
+ * @version $Id$
+ */
+public class LocaleUtils {
+
+    /** Unmodifiable list of available locales. */
+    private static final List cAvailableLocaleList;
+    /** Unmodifiable set of available locales. */
+    private static Set cAvailableLocaleSet;
+    /** Unmodifiable map of language locales by country. */
+    private static final Map cLanguagesByCountry = Collections.synchronizedMap(new HashMap());
+    /** Unmodifiable map of country locales by language. */
+    private static final Map cCountriesByLanguage = Collections.synchronizedMap(new HashMap());
+    static {
+        List list = Arrays.asList(Locale.getAvailableLocales());
+        cAvailableLocaleList = Collections.unmodifiableList(list);
+    }
+
+    /**
+     * <p><code>LocaleUtils</code> instances should NOT be constructed in standard programming.
+     * Instead, the class should be used as <code>LocaleUtils.toLocale("en_GB");</code>.</p>
+     *
+     * <p>This constructor is public to permit tools that require a JavaBean instance
+     * to operate.</p>
+     */
+    public LocaleUtils() {
+      super();
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Converts a String to a Locale.</p>
+     *
+     * <p>This method takes the string format of a locale and creates the
+     * locale object from it.</p>
+     *
+     * <pre>
+     *   LocaleUtils.toLocale("en")         = new Locale("en", "")
+     *   LocaleUtils.toLocale("en_GB")      = new Locale("en", "GB")
+     *   LocaleUtils.toLocale("en_GB_xxx")  = new Locale("en", "GB", "xxx")   (#)
+     * </pre>
+     *
+     * <p>(#) The behaviour of the JDK variant constructor changed between JDK1.3 and JDK1.4.
+     * In JDK1.3, the constructor upper cases the variant, in JDK1.4, it doesn't.
+     * Thus, the result from getVariant() may vary depending on your JDK.</p>
+     *
+     * <p>This method validates the input strictly.
+     * The language code must be lowercase.
+     * The country code must be uppercase.
+     * The separator must be an underscore.
+     * The length must be correct.
+     * </p>
+     *
+     * @param str  the locale String to convert, null returns null
+     * @return a Locale, null if null input
+     * @throws IllegalArgumentException if the string is an invalid format
+     */
+    public static Locale toLocale(String str) {
+        if (str == null) {
+            return null;
+        }
+        int len = str.length();
+        if (len != 2 && len != 5 && len < 7) {
+            throw new IllegalArgumentException("Invalid locale format: " + str);
+        }
+        char ch0 = str.charAt(0);
+        char ch1 = str.charAt(1);
+        if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z') {
+            throw new IllegalArgumentException("Invalid locale format: " + str);
+        }
+        if (len == 2) {
+            return new Locale(str, "");
+        } else {
+            if (str.charAt(2) != '_') {
+                throw new IllegalArgumentException("Invalid locale format: " + str);
+            }
+            char ch3 = str.charAt(3);
+            char ch4 = str.charAt(4);
+            if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
+                throw new IllegalArgumentException("Invalid locale format: " + str);
+            }
+            if (len == 5) {
+                return new Locale(str.substring(0, 2), str.substring(3, 5));
+            } else {
+                if (str.charAt(5) != '_') {
+                    throw new IllegalArgumentException("Invalid locale format: " + str);
+                }
+                return new Locale(str.substring(0, 2), str.substring(3, 5), str.substring(6));
+            }
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of locales to search through when performing
+     * a locale search.</p>
+     *
+     * <pre>
+     * localeLookupList(Locale("fr","CA","xxx"))
+     *   = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr")]
+     * </pre>
+     *
+     * @param locale  the locale to start from
+     * @return the unmodifiable list of Locale objects, 0 being locale, never null
+     */
+    public static List localeLookupList(Locale locale) {
+        return localeLookupList(locale, locale);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of locales to search through when performing
+     * a locale search.</p>
+     *
+     * <pre>
+     * localeLookupList(Locale("fr", "CA", "xxx"), Locale("en"))
+     *   = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr"), Locale("en"]
+     * </pre>
+     *
+     * <p>The result list begins with the most specific locale, then the
+     * next more general and so on, finishing with the default locale.
+     * The list will never contain the same locale twice.</p>
+     *
+     * @param locale  the locale to start from, null returns empty list
+     * @param defaultLocale  the default locale to use if no other is found
+     * @return the unmodifiable list of Locale objects, 0 being locale, never null
+     */
+    public static List localeLookupList(Locale locale, Locale defaultLocale) {
+        List list = new ArrayList(4);
+        if (locale != null) {
+            list.add(locale);
+            if (locale.getVariant().length() > 0) {
+                list.add(new Locale(locale.getLanguage(), locale.getCountry()));
+            }
+            if (locale.getCountry().length() > 0) {
+                list.add(new Locale(locale.getLanguage(), ""));
+            }
+            if (list.contains(defaultLocale) == false) {
+                list.add(defaultLocale);
+            }
+        }
+        return Collections.unmodifiableList(list);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains an unmodifiable list of installed locales.</p>
+     * 
+     * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}.
+     * It is more efficient, as the JDK method must create a new array each
+     * time it is called.</p>
+     *
+     * @return the unmodifiable list of available locales
+     */
+    public static List availableLocaleList() {
+        return cAvailableLocaleList;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains an unmodifiable set of installed locales.</p>
+     * 
+     * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}.
+     * It is more efficient, as the JDK method must create a new array each
+     * time it is called.</p>
+     *
+     * @return the unmodifiable set of available locales
+     */
+    public static Set availableLocaleSet() {
+        Set set = cAvailableLocaleSet;
+        if (set == null) {
+            set = new HashSet(availableLocaleList());
+            set = Collections.unmodifiableSet(set);
+            cAvailableLocaleSet = set;
+        }
+        return set;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Checks if the locale specified is in the list of available locales.</p>
+     *
+     * @param locale the Locale object to check if it is available
+     * @return true if the locale is a known locale
+     */
+    public static boolean isAvailableLocale(Locale locale) {
+        return cAvailableLocaleSet.contains(locale);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of languages supported for a given country.</p>
+     *
+     * <p>This method takes a country code and searches to find the
+     * languages available for that country. Variant locales are removed.</p>
+     *
+     * @param countryCode  the 2 letter country code, null returns empty
+     * @return an unmodifiable List of Locale objects, never null
+     */
+    public static List languagesByCountry(String countryCode) {
+        List langs = (List) cLanguagesByCountry.get(countryCode);  //syncd
+        if (langs == null) {
+            if (countryCode != null) {
+                langs = new ArrayList();
+                List locales = availableLocaleList();
+                for (int i = 0; i < locales.size(); i++) {
+                    Locale locale = (Locale) locales.get(i);
+                    if (countryCode.equals(locale.getCountry()) &&
+                            locale.getVariant().length() == 0) {
+                        langs.add(locale);
+                    }
+                }
+                langs = Collections.unmodifiableList(langs);
+            } else {
+                langs = Collections.EMPTY_LIST;
+            }
+            cLanguagesByCountry.put(countryCode, langs);  //syncd
+        }
+        return langs;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of countries supported for a given language.</p>
+     * 
+     * <p>This method takes a language code and searches to find the
+     * countries available for that language. Variant locales are removed.</p>
+     *
+     * @param languageCode  the 2 letter language code, null returns empty
+     * @return an unmodifiable List of Locale objects, never null
+     */
+    public static List countriesByLanguage(String languageCode) {
+        List countries = (List) cCountriesByLanguage.get(languageCode);  //syncd
+        if (countries == null) {
+            if (languageCode != null) {
+                countries = new ArrayList();
+                List locales = availableLocaleList();
+                for (int i = 0; i < locales.size(); i++) {
+                    Locale locale = (Locale) locales.get(i);
+                    if (languageCode.equals(locale.getLanguage()) &&
+                            locale.getCountry().length() != 0 &&
+                            locale.getVariant().length() == 0) {
+                        countries.add(locale);
+                    }
+                }
+                countries = Collections.unmodifiableList(countries);
+            } else {
+                countries = Collections.EMPTY_LIST;
+            }
+            cCountriesByLanguage.put(languageCode, countries);  //syncd
+        }
+        return countries;
+    }
+
+}
diff --git a/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_t.java b/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_t.java
new file mode 100644
index 0000000..139d9a7
--- /dev/null
+++ b/src/test/resources/examples/d4j/Lang_57/LocaleUtils/Lang_57_LocaleUtils_t.java
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>Operations to assist when working with a {@link Locale}.</p>
+ *
+ * <p>This class tries to handle <code>null</code> input gracefully.
+ * An exception will not be thrown for a <code>null</code> input.
+ * Each method documents its behaviour in more detail.</p>
+ *
+ * @author Stephen Colebourne
+ * @since 2.2
+ * @version $Id$
+ */
+public class LocaleUtils {
+
+    /** Unmodifiable list of available locales. */
+    private static final List cAvailableLocaleList;
+    /** Unmodifiable set of available locales. */
+    private static Set cAvailableLocaleSet;
+    /** Unmodifiable map of language locales by country. */
+    private static final Map cLanguagesByCountry = Collections.synchronizedMap(new HashMap());
+    /** Unmodifiable map of country locales by language. */
+    private static final Map cCountriesByLanguage = Collections.synchronizedMap(new HashMap());
+    static {
+        List list = Arrays.asList(Locale.getAvailableLocales());
+        cAvailableLocaleList = Collections.unmodifiableList(list);
+    }
+
+    /**
+     * <p><code>LocaleUtils</code> instances should NOT be constructed in standard programming.
+     * Instead, the class should be used as <code>LocaleUtils.toLocale("en_GB");</code>.</p>
+     *
+     * <p>This constructor is public to permit tools that require a JavaBean instance
+     * to operate.</p>
+     */
+    public LocaleUtils() {
+      super();
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Converts a String to a Locale.</p>
+     *
+     * <p>This method takes the string format of a locale and creates the
+     * locale object from it.</p>
+     *
+     * <pre>
+     *   LocaleUtils.toLocale("en")         = new Locale("en", "")
+     *   LocaleUtils.toLocale("en_GB")      = new Locale("en", "GB")
+     *   LocaleUtils.toLocale("en_GB_xxx")  = new Locale("en", "GB", "xxx")   (#)
+     * </pre>
+     *
+     * <p>(#) The behaviour of the JDK variant constructor changed between JDK1.3 and JDK1.4.
+     * In JDK1.3, the constructor upper cases the variant, in JDK1.4, it doesn't.
+     * Thus, the result from getVariant() may vary depending on your JDK.</p>
+     *
+     * <p>This method validates the input strictly.
+     * The language code must be lowercase.
+     * The country code must be uppercase.
+     * The separator must be an underscore.
+     * The length must be correct.
+     * </p>
+     *
+     * @param str  the locale String to convert, null returns null
+     * @return a Locale, null if null input
+     * @throws IllegalArgumentException if the string is an invalid format
+     */
+    public static Locale toLocale(String str) {
+        if (str == null) {
+            return null;
+        }
+        int len = str.length();
+        if (len != 2 && len != 5 && len < 7) {
+            throw new IllegalArgumentException("Invalid locale format: " + str);
+        }
+        char ch0 = str.charAt(0);
+        char ch1 = str.charAt(1);
+        if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z') {
+            throw new IllegalArgumentException("Invalid locale format: " + str);
+        }
+        if (len == 2) {
+            return new Locale(str, "");
+        } else {
+            if (str.charAt(2) != '_') {
+                throw new IllegalArgumentException("Invalid locale format: " + str);
+            }
+            char ch3 = str.charAt(3);
+            char ch4 = str.charAt(4);
+            if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
+                throw new IllegalArgumentException("Invalid locale format: " + str);
+            }
+            if (len == 5) {
+                return new Locale(str.substring(0, 2), str.substring(3, 5));
+            } else {
+                if (str.charAt(5) != '_') {
+                    throw new IllegalArgumentException("Invalid locale format: " + str);
+                }
+                return new Locale(str.substring(0, 2), str.substring(3, 5), str.substring(6));
+            }
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of locales to search through when performing
+     * a locale search.</p>
+     *
+     * <pre>
+     * localeLookupList(Locale("fr","CA","xxx"))
+     *   = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr")]
+     * </pre>
+     *
+     * @param locale  the locale to start from
+     * @return the unmodifiable list of Locale objects, 0 being locale, never null
+     */
+    public static List localeLookupList(Locale locale) {
+        return localeLookupList(locale, locale);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of locales to search through when performing
+     * a locale search.</p>
+     *
+     * <pre>
+     * localeLookupList(Locale("fr", "CA", "xxx"), Locale("en"))
+     *   = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr"), Locale("en"]
+     * </pre>
+     *
+     * <p>The result list begins with the most specific locale, then the
+     * next more general and so on, finishing with the default locale.
+     * The list will never contain the same locale twice.</p>
+     *
+     * @param locale  the locale to start from, null returns empty list
+     * @param defaultLocale  the default locale to use if no other is found
+     * @return the unmodifiable list of Locale objects, 0 being locale, never null
+     */
+    public static List localeLookupList(Locale locale, Locale defaultLocale) {
+        List list = new ArrayList(4);
+        if (locale != null) {
+            list.add(locale);
+            if (locale.getVariant().length() > 0) {
+                list.add(new Locale(locale.getLanguage(), locale.getCountry()));
+            }
+            if (locale.getCountry().length() > 0) {
+                list.add(new Locale(locale.getLanguage(), ""));
+            }
+            if (list.contains(defaultLocale) == false) {
+                list.add(defaultLocale);
+            }
+        }
+        return Collections.unmodifiableList(list);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains an unmodifiable list of installed locales.</p>
+     * 
+     * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}.
+     * It is more efficient, as the JDK method must create a new array each
+     * time it is called.</p>
+     *
+     * @return the unmodifiable list of available locales
+     */
+    public static List availableLocaleList() {
+        return cAvailableLocaleList;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains an unmodifiable set of installed locales.</p>
+     * 
+     * <p>This method is a wrapper around {@link Locale#getAvailableLocales()}.
+     * It is more efficient, as the JDK method must create a new array each
+     * time it is called.</p>
+     *
+     * @return the unmodifiable set of available locales
+     */
+    public static Set availableLocaleSet() {
+        Set set = cAvailableLocaleSet;
+        if (set == null) {
+            set = new HashSet(availableLocaleList());
+            set = Collections.unmodifiableSet(set);
+            cAvailableLocaleSet = set;
+        }
+        return set;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Checks if the locale specified is in the list of available locales.</p>
+     *
+     * @param locale the Locale object to check if it is available
+     * @return true if the locale is a known locale
+     */
+    public static boolean isAvailableLocale(Locale locale) {
+        return availableLocaleList().contains(locale);
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of languages supported for a given country.</p>
+     *
+     * <p>This method takes a country code and searches to find the
+     * languages available for that country. Variant locales are removed.</p>
+     *
+     * @param countryCode  the 2 letter country code, null returns empty
+     * @return an unmodifiable List of Locale objects, never null
+     */
+    public static List languagesByCountry(String countryCode) {
+        List langs = (List) cLanguagesByCountry.get(countryCode);  //syncd
+        if (langs == null) {
+            if (countryCode != null) {
+                langs = new ArrayList();
+                List locales = availableLocaleList();
+                for (int i = 0; i < locales.size(); i++) {
+                    Locale locale = (Locale) locales.get(i);
+                    if (countryCode.equals(locale.getCountry()) &&
+                            locale.getVariant().length() == 0) {
+                        langs.add(locale);
+                    }
+                }
+                langs = Collections.unmodifiableList(langs);
+            } else {
+                langs = Collections.EMPTY_LIST;
+            }
+            cLanguagesByCountry.put(countryCode, langs);  //syncd
+        }
+        return langs;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
+     * <p>Obtains the list of countries supported for a given language.</p>
+     * 
+     * <p>This method takes a language code and searches to find the
+     * countries available for that language. Variant locales are removed.</p>
+     *
+     * @param languageCode  the 2 letter language code, null returns empty
+     * @return an unmodifiable List of Locale objects, never null
+     */
+    public static List countriesByLanguage(String languageCode) {
+        List countries = (List) cCountriesByLanguage.get(languageCode);  //syncd
+        if (countries == null) {
+            if (languageCode != null) {
+                countries = new ArrayList();
+                List locales = availableLocaleList();
+                for (int i = 0; i < locales.size(); i++) {
+                    Locale locale = (Locale) locales.get(i);
+                    if (languageCode.equals(locale.getLanguage()) &&
+                            locale.getCountry().length() != 0 &&
+                            locale.getVariant().length() == 0) {
+                        countries.add(locale);
+                    }
+                }
+                countries = Collections.unmodifiableList(countries);
+            } else {
+                countries = Collections.EMPTY_LIST;
+            }
+            cCountriesByLanguage.put(languageCode, countries);  //syncd
+        }
+        return countries;
+    }
+
+}
diff --git a/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_s.java b/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_s.java
new file mode 100644
index 0000000..1eb0053
--- /dev/null
+++ b/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_s.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math3.genetics;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.math3.exception.util.LocalizedFormats;
+import org.apache.commons.math3.exception.NotPositiveException;
+import org.apache.commons.math3.exception.NullArgumentException;
+import org.apache.commons.math3.exception.NumberIsTooLargeException;
+import org.apache.commons.math3.exception.NumberIsTooSmallException;
+
+/**
+ * Population of chromosomes represented by a {@link List}.
+ *
+ * @since 2.0
+ * @version $Id$
+ */
+public abstract class ListPopulation implements Population {
+
+    /** List of chromosomes */
+    private List<Chromosome> chromosomes;
+
+    /** maximal size of the population */
+    private int populationLimit;
+
+    /**
+     * Creates a new ListPopulation instance and initializes its inner chromosome list.
+     *
+     * @param populationLimit maximal size of the population
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     */
+    public ListPopulation(final int populationLimit) {
+        this(Collections.<Chromosome> emptyList(), populationLimit);
+    }
+
+    /**
+     * Creates a new ListPopulation instance.
+     * <p>Note: the chromosomes of the specified list are added to the population.</p>
+     * @param chromosomes list of chromosomes to be added to the population
+     * @param populationLimit maximal size of the population
+     * @throws NullArgumentException if the list of chromosomes is {@code null}
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     * @throws NumberIsTooLargeException if the list of chromosomes exceeds the population limit
+     */
+    public ListPopulation(final List<Chromosome> chromosomes, final int populationLimit) {
+        if (chromosomes == null) {
+            throw new NullArgumentException();
+        }
+        if (populationLimit <= 0) {
+            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
+        }
+        if (chromosomes.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.populationLimit = populationLimit;
+        this.chromosomes = new ArrayList<Chromosome>(populationLimit);
+        this.chromosomes.addAll(chromosomes);
+    }
+
+    /**
+     * Sets the list of chromosomes.
+     * <p>Note: this method removed all existing chromosomes in the population and adds all chromosomes
+     * of the specified list to the population.</p>
+     * @param chromosomes the list of chromosomes
+     * @throws NullArgumentException if the list of chromosomes is {@code null}
+     * @throws NumberIsTooLargeException if the list of chromosomes exceeds the population limit
+     * @deprecated use {@link #addChromosomes(Collection)} instead
+     */
+    public void setChromosomes(final List<Chromosome> chromosomes) {
+        if (chromosomes == null) {
+            throw new NullArgumentException();
+        }
+        if (chromosomes.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.clear();
+        this.chromosomes.addAll(chromosomes);
+    }
+
+    /**
+     * Add a {@link Collection} of chromosomes to this {@link Population}.
+     * @param chromosomeColl a {@link Collection} of chromosomes
+     * @throws NumberIsTooLargeException if the population would exceed the population limit when
+     * adding this chromosome
+     */
+    public void addChromosomes(final Collection<Chromosome> chromosomeColl) {
+        if (chromosomes.size() + chromosomeColl.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.addAll(chromosomeColl);
+    }
+
+    /**
+     * Returns an unmodifiable list of the chromosomes in this population.
+     * @return the unmodifiable list of chromosomes
+     */
+    public List<Chromosome> getChromosomes() {
+        return Collections.unmodifiableList(chromosomes);
+    }
+
+    /**
+     * Access the list of chromosomes.
+     * @return the list of chromosomes
+     */
+    protected List<Chromosome> getChromosomeList() {
+        return chromosomes;
+    }
+
+    /**
+     * Add the given chromosome to the population.
+     * @param chromosome the chromosome to add.
+     * @throws NumberIsTooLargeException if the population would exceed the {@code populationLimit} after
+     * adding this chromosome
+     */
+    public void addChromosome(final Chromosome chromosome) {
+        if (chromosomes.size() >= populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.add(chromosome);
+    }
+
+    /**
+     * Access the fittest chromosome in this population.
+     * @return the fittest chromosome.
+     */
+    public Chromosome getFittestChromosome() {
+        // best so far
+        Chromosome bestChromosome = this.chromosomes.get(0);
+        for (Chromosome chromosome : this.chromosomes) {
+            if (chromosome.compareTo(bestChromosome) > 0) {
+                // better chromosome found
+                bestChromosome = chromosome;
+            }
+        }
+        return bestChromosome;
+    }
+
+    /**
+     * Access the maximum population size.
+     * @return the maximum population size.
+     */
+    public int getPopulationLimit() {
+        return this.populationLimit;
+    }
+
+    /**
+     * Sets the maximal population size.
+     * @param populationLimit maximal population size.
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     * @throws NumberIsTooSmallException if the new population size is smaller than the current number
+     * of chromosomes in the population
+     */
+    public void setPopulationLimit(final int populationLimit) {
+        if (populationLimit <= 0) {
+            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
+        }
+        if (populationLimit < chromosomes.size()) {
+            throw new NumberIsTooSmallException(populationLimit, chromosomes.size(), true);
+        }
+        this.populationLimit = populationLimit;
+    }
+
+    /**
+     * Access the current population size.
+     * @return the current population size.
+     */
+    public int getPopulationSize() {
+        return this.chromosomes.size();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String toString() {
+        return this.chromosomes.toString();
+    }
+
+    /**
+     * Returns an iterator over the unmodifiable list of chromosomes.
+     * <p>Any call to {@link Iterator#remove()} will result in a {@link UnsupportedOperationException}.</p>
+     *
+     * @return chromosome iterator
+     */
+    public Iterator<Chromosome> iterator() {
+        return chromosomes.iterator();
+    }
+}
diff --git a/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_t.java b/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_t.java
new file mode 100644
index 0000000..3f3919c
--- /dev/null
+++ b/src/test/resources/examples/d4j/Math_34/ListPopulation/Math_34_ListPopulation_t.java
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math3.genetics;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.math3.exception.util.LocalizedFormats;
+import org.apache.commons.math3.exception.NotPositiveException;
+import org.apache.commons.math3.exception.NullArgumentException;
+import org.apache.commons.math3.exception.NumberIsTooLargeException;
+import org.apache.commons.math3.exception.NumberIsTooSmallException;
+
+/**
+ * Population of chromosomes represented by a {@link List}.
+ *
+ * @since 2.0
+ * @version $Id$
+ */
+public abstract class ListPopulation implements Population {
+
+    /** List of chromosomes */
+    private List<Chromosome> chromosomes;
+
+    /** maximal size of the population */
+    private int populationLimit;
+
+    /**
+     * Creates a new ListPopulation instance and initializes its inner chromosome list.
+     *
+     * @param populationLimit maximal size of the population
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     */
+    public ListPopulation(final int populationLimit) {
+        this(Collections.<Chromosome> emptyList(), populationLimit);
+    }
+
+    /**
+     * Creates a new ListPopulation instance.
+     * <p>Note: the chromosomes of the specified list are added to the population.</p>
+     * @param chromosomes list of chromosomes to be added to the population
+     * @param populationLimit maximal size of the population
+     * @throws NullArgumentException if the list of chromosomes is {@code null}
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     * @throws NumberIsTooLargeException if the list of chromosomes exceeds the population limit
+     */
+    public ListPopulation(final List<Chromosome> chromosomes, final int populationLimit) {
+        if (chromosomes == null) {
+            throw new NullArgumentException();
+        }
+        if (populationLimit <= 0) {
+            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
+        }
+        if (chromosomes.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.populationLimit = populationLimit;
+        this.chromosomes = new ArrayList<Chromosome>(populationLimit);
+        this.chromosomes.addAll(chromosomes);
+    }
+
+    /**
+     * Sets the list of chromosomes.
+     * <p>Note: this method removed all existing chromosomes in the population and adds all chromosomes
+     * of the specified list to the population.</p>
+     * @param chromosomes the list of chromosomes
+     * @throws NullArgumentException if the list of chromosomes is {@code null}
+     * @throws NumberIsTooLargeException if the list of chromosomes exceeds the population limit
+     * @deprecated use {@link #addChromosomes(Collection)} instead
+     */
+    public void setChromosomes(final List<Chromosome> chromosomes) {
+        if (chromosomes == null) {
+            throw new NullArgumentException();
+        }
+        if (chromosomes.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.clear();
+        this.chromosomes.addAll(chromosomes);
+    }
+
+    /**
+     * Add a {@link Collection} of chromosomes to this {@link Population}.
+     * @param chromosomeColl a {@link Collection} of chromosomes
+     * @throws NumberIsTooLargeException if the population would exceed the population limit when
+     * adding this chromosome
+     */
+    public void addChromosomes(final Collection<Chromosome> chromosomeColl) {
+        if (chromosomes.size() + chromosomeColl.size() > populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.addAll(chromosomeColl);
+    }
+
+    /**
+     * Returns an unmodifiable list of the chromosomes in this population.
+     * @return the unmodifiable list of chromosomes
+     */
+    public List<Chromosome> getChromosomes() {
+        return Collections.unmodifiableList(chromosomes);
+    }
+
+    /**
+     * Access the list of chromosomes.
+     * @return the list of chromosomes
+     */
+    protected List<Chromosome> getChromosomeList() {
+        return chromosomes;
+    }
+
+    /**
+     * Add the given chromosome to the population.
+     * @param chromosome the chromosome to add.
+     * @throws NumberIsTooLargeException if the population would exceed the {@code populationLimit} after
+     * adding this chromosome
+     */
+    public void addChromosome(final Chromosome chromosome) {
+        if (chromosomes.size() >= populationLimit) {
+            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
+                                                chromosomes.size(), populationLimit, false);
+        }
+        this.chromosomes.add(chromosome);
+    }
+
+    /**
+     * Access the fittest chromosome in this population.
+     * @return the fittest chromosome.
+     */
+    public Chromosome getFittestChromosome() {
+        // best so far
+        Chromosome bestChromosome = this.chromosomes.get(0);
+        for (Chromosome chromosome : this.chromosomes) {
+            if (chromosome.compareTo(bestChromosome) > 0) {
+                // better chromosome found
+                bestChromosome = chromosome;
+            }
+        }
+        return bestChromosome;
+    }
+
+    /**
+     * Access the maximum population size.
+     * @return the maximum population size.
+     */
+    public int getPopulationLimit() {
+        return this.populationLimit;
+    }
+
+    /**
+     * Sets the maximal population size.
+     * @param populationLimit maximal population size.
+     * @throws NotPositiveException if the population limit is not a positive number (&lt; 1)
+     * @throws NumberIsTooSmallException if the new population size is smaller than the current number
+     * of chromosomes in the population
+     */
+    public void setPopulationLimit(final int populationLimit) {
+        if (populationLimit <= 0) {
+            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
+        }
+        if (populationLimit < chromosomes.size()) {
+            throw new NumberIsTooSmallException(populationLimit, chromosomes.size(), true);
+        }
+        this.populationLimit = populationLimit;
+    }
+
+    /**
+     * Access the current population size.
+     * @return the current population size.
+     */
+    public int getPopulationSize() {
+        return this.chromosomes.size();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String toString() {
+        return this.chromosomes.toString();
+    }
+
+    /**
+     * Returns an iterator over the unmodifiable list of chromosomes.
+     * <p>Any call to {@link Iterator#remove()} will result in a {@link UnsupportedOperationException}.</p>
+     *
+     * @return chromosome iterator
+     */
+    public Iterator<Chromosome> iterator() {
+        return getChromosomes().iterator();
+    }
+}
diff --git a/src/test/resources/examples/spoon.json b/src/test/resources/examples/spoon.json
index 96d3492..6e26490 100644
--- a/src/test/resources/examples/spoon.json
+++ b/src/test/resources/examples/spoon.json
@@ -240,7 +240,7 @@
               ]
             },
             {
-              "label": "javax.swing.JPanel#javax.swing.JPanel(java.awt.LayoutManager)",
+              "label": "\u003cinit\u003e",
               "type": "Invocation",
               "children": [
                 {
@@ -300,7 +300,7 @@
                   ]
                 },
                 {
-                  "label": "java.lang.String#equals(java.lang.Object)",
+                  "label": "equals",
                   "type": "Invocation",
                   "children": [
                     {
@@ -326,7 +326,7 @@
                   "type": "BinaryOperator",
                   "children": [
                     {
-                      "label": "org.gjt.sp.jedit.jEdit#getSettingsDirectory()",
+                      "label": "getSettingsDirectory",
                       "type": "Invocation",
                       "children": [
                         {
@@ -369,7 +369,7 @@
                           ]
                         },
                         {
-                          "label": "org.gjt.sp.jedit.jEdit#getProperty()",
+                          "label": "getProperty",
                           "type": "Invocation",
                           "children": [
                             {
@@ -444,7 +444,7 @@
                               "type": "BinaryOperator",
                               "children": [
                                 {
-                                  "label": "java.lang.String#length()",
+                                  "label": "length",
                                   "type": "Invocation",
                                   "children": [
                                     {
@@ -513,7 +513,7 @@
                                           "type": "BinaryOperator",
                                           "children": [
                                             {
-                                              "label": "org.gjt.sp.jedit.jEdit#getSettingsDirectory()",
+                                              "label": "getSettingsDirectory",
                                               "type": "Invocation",
                                               "children": [
                                                 {
@@ -548,7 +548,7 @@
                               ]
                             },
                             {
-                              "label": "org.gjt.sp.jedit.jEdit#setProperty(java.lang.String)",
+                              "label": "setProperty",
                               "type": "Invocation",
                               "children": [
                                 {
@@ -686,7 +686,7 @@
               ]
             },
             {
-              "label": "java.awt.Container#add(java.lang.String,java.awt.Component)",
+              "label": "add",
               "type": "Invocation",
               "children": [
                 {
@@ -744,7 +744,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "javax.swing.JComponent#setPreferredSize(java.awt.Dimension)",
+                      "label": "setPreferredSize",
                       "type": "Invocation",
                       "children": [
                         {
@@ -803,7 +803,7 @@
               ]
             },
             {
-              "label": "QuickNotepadTextArea#setFont()",
+              "label": "setFont",
               "type": "Invocation",
               "children": [
                 {
@@ -818,7 +818,7 @@
                   ]
                 },
                 {
-                  "label": "QuickNotepadOptionPane#makeFont()",
+                  "label": "makeFont",
                   "type": "Invocation",
                   "children": [
                     {
@@ -844,7 +844,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "java.io.PrintStream#println(java.lang.String)",
+                      "label": "println",
                       "type": "Invocation",
                       "children": [
                         {
@@ -898,7 +898,7 @@
               ]
             },
             {
-              "label": "java.awt.Container#add(java.lang.String,java.awt.Component)",
+              "label": "add",
               "type": "Invocation",
               "children": [
                 {
@@ -925,7 +925,7 @@
               ]
             },
             {
-              "label": "QuickNotepad#readFile()",
+              "label": "readFile",
               "type": "Invocation",
               "children": [
                 {
@@ -984,7 +984,7 @@
               ]
             },
             {
-              "label": "QuickNotepadTextArea#requestFocus()",
+              "label": "requestFocus",
               "type": "Invocation",
               "children": [
                 {
@@ -1122,7 +1122,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "QuickNotepad#propertiesChanged()",
+                      "label": "propertiesChanged",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1183,7 +1183,7 @@
                   "children": []
                 },
                 {
-                  "label": "org.gjt.sp.jedit.jEdit#getProperty()",
+                  "label": "getProperty",
                   "type": "Invocation",
                   "children": [
                     {
@@ -1226,7 +1226,7 @@
                   "type": "UnaryOperator",
                   "children": [
                     {
-                      "label": "org.gjt.sp.jedit.MiscUtilities#objectsEqual(java.lang.String,java.lang.String)",
+                      "label": "objectsEqual",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1259,7 +1259,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "QuickNotepad#saveFile()",
+                      "label": "saveFile",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1270,7 +1270,7 @@
                       ]
                     },
                     {
-                      "label": "QuickNotepadToolPanel#propertiesChanged()",
+                      "label": "propertiesChanged",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1337,7 +1337,7 @@
                       ]
                     },
                     {
-                      "label": "QuickNotepad#readFile()",
+                      "label": "readFile",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1361,7 +1361,7 @@
                   "children": []
                 },
                 {
-                  "label": "QuickNotepadOptionPane#makeFont()",
+                  "label": "makeFont",
                   "type": "Invocation",
                   "children": [
                     {
@@ -1382,7 +1382,7 @@
                   "type": "UnaryOperator",
                   "children": [
                     {
-                      "label": "java.awt.Font#equals(java.lang.Object)",
+                      "label": "equals",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1391,7 +1391,7 @@
                           "children": []
                         },
                         {
-                          "label": "QuickNotepadTextArea#getFont()",
+                          "label": "getFont",
                           "type": "Invocation",
                           "children": [
                             {
@@ -1416,7 +1416,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "QuickNotepadTextArea#setFont(java.awt.Font)",
+                      "label": "setFont",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1474,7 +1474,7 @@
               ]
             },
             {
-              "label": "javax.swing.JComponent#addNotify()",
+              "label": "addNotify",
               "type": "Invocation",
               "children": [
                 {
@@ -1485,7 +1485,7 @@
               ]
             },
             {
-              "label": "org.gjt.sp.jedit.EditBus#addToBus(QuickNotepad)",
+              "label": "addToBus",
               "type": "Invocation",
               "children": [
                 {
@@ -1549,7 +1549,7 @@
               ]
             },
             {
-              "label": "QuickNotepad#saveFile()",
+              "label": "saveFile",
               "type": "Invocation",
               "children": [
                 {
@@ -1560,7 +1560,7 @@
               ]
             },
             {
-              "label": "javax.swing.JComponent#removeNotify()",
+              "label": "removeNotify",
               "type": "Invocation",
               "children": [
                 {
@@ -1571,7 +1571,7 @@
               ]
             },
             {
-              "label": "org.gjt.sp.jedit.EditBus#removeFromBus(QuickNotepad)",
+              "label": "removeFromBus",
               "type": "Invocation",
               "children": [
                 {
@@ -1659,7 +1659,7 @@
                       "type": "BinaryOperator",
                       "children": [
                         {
-                          "label": "java.lang.String#length()",
+                          "label": "length",
                           "type": "Invocation",
                           "children": [
                             {
@@ -1730,7 +1730,7 @@
                   ]
                 },
                 {
-                  "label": "java.io.Writer#write(char[])",
+                  "label": "write",
                   "type": "Invocation",
                   "children": [
                     {
@@ -1739,7 +1739,7 @@
                       "children": []
                     },
                     {
-                      "label": "QuickNotepadTextArea#getText()",
+                      "label": "getText",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1758,7 +1758,7 @@
                   ]
                 },
                 {
-                  "label": "java.io.OutputStreamWriter#close()",
+                  "label": "close",
                   "type": "Invocation",
                   "children": [
                     {
@@ -1784,7 +1784,7 @@
                       ]
                     },
                     {
-                      "label": "org.gjt.sp.util.Log#log(java.lang.Class,java.lang.String)",
+                      "label": "log",
                       "type": "Invocation",
                       "children": [
                         {
@@ -1883,7 +1883,7 @@
                   "children": []
                 },
                 {
-                  "label": "org.gjt.sp.jedit.GUIUtilities#showVFSFileDialog(org.gjt.sp.jedit.View,\u003cunknown\u003e,int,boolean)",
+                  "label": "showVFSFileDialog",
                   "type": "Invocation",
                   "children": [
                     {
@@ -1956,7 +1956,7 @@
                       "type": "UnaryOperator",
                       "children": [
                         {
-                          "label": "java.lang.String#equals(java.lang.Object)",
+                          "label": "equals",
                           "type": "Invocation",
                           "children": [
                             {
@@ -1997,7 +1997,7 @@
                   "type": "then",
                   "children": [
                     {
-                      "label": "QuickNotepad#saveFile()",
+                      "label": "saveFile",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2041,7 +2041,7 @@
                       ]
                     },
                     {
-                      "label": "QuickNotepadToolPanel#propertiesChanged()",
+                      "label": "propertiesChanged",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2058,7 +2058,7 @@
                       ]
                     },
                     {
-                      "label": "QuickNotepad#readFile()",
+                      "label": "readFile",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2105,7 +2105,7 @@
               ]
             },
             {
-              "label": "org.gjt.sp.jedit.jEdit#newFile(org.gjt.sp.jedit.View)",
+              "label": "newFile",
               "type": "Invocation",
               "children": [
                 {
@@ -2127,15 +2127,15 @@
               ]
             },
             {
-              "label": "#setText()",
+              "label": "setText",
               "type": "Invocation",
               "children": [
                 {
-                  "label": "#getTextArea()",
+                  "label": "getTextArea",
                   "type": "Invocation",
                   "children": [
                     {
-                      "label": "org.gjt.sp.jedit.View#getEditPane()",
+                      "label": "getEditPane",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2154,7 +2154,7 @@
                   ]
                 },
                 {
-                  "label": "QuickNotepadTextArea#getText()",
+                  "label": "getText",
                   "type": "Invocation",
                   "children": [
                     {
@@ -2239,7 +2239,7 @@
                       "type": "BinaryOperator",
                       "children": [
                         {
-                          "label": "java.lang.String#length()",
+                          "label": "length",
                           "type": "Invocation",
                           "children": [
                             {
@@ -2382,7 +2382,7 @@
                               "children": []
                             },
                             {
-                              "label": "java.io.BufferedReader#readLine()",
+                              "label": "readLine",
                               "type": "Invocation",
                               "children": [
                                 {
@@ -2402,11 +2402,11 @@
                       ]
                     },
                     {
-                      "label": "java.lang.StringBuffer#append(char)",
+                      "label": "append",
                       "type": "Invocation",
                       "children": [
                         {
-                          "label": "java.lang.StringBuffer#append(java.lang.String)",
+                          "label": "append",
                           "type": "Invocation",
                           "children": [
                             {
@@ -2431,7 +2431,7 @@
                   ]
                 },
                 {
-                  "label": "java.io.BufferedReader#close()",
+                  "label": "close",
                   "type": "Invocation",
                   "children": [
                     {
@@ -2442,7 +2442,7 @@
                   ]
                 },
                 {
-                  "label": "QuickNotepadTextArea#setText(java.lang.String)",
+                  "label": "setText",
                   "type": "Invocation",
                   "children": [
                     {
@@ -2457,7 +2457,7 @@
                       ]
                     },
                     {
-                      "label": "java.lang.StringBuffer#toString()",
+                      "label": "toString",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2485,7 +2485,7 @@
                       ]
                     },
                     {
-                      "label": "org.gjt.sp.util.Log#log(java.lang.Class,java.lang.String)",
+                      "label": "log",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2562,7 +2562,7 @@
                       ]
                     },
                     {
-                      "label": "org.gjt.sp.util.Log#log(java.lang.Class,java.lang.String)",
+                      "label": "log",
                       "type": "Invocation",
                       "children": [
                         {
@@ -2679,4 +2679,4 @@
       ]
     }
   ]
-}
+}
\ No newline at end of file