diff --git a/HEADER b/HEADER
new file mode 100644
index 000000000..a25b87c9c
--- /dev/null
+++ b/HEADER
@@ -0,0 +1,14 @@
+This file is part of GumTree.
+
+GumTree is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GumTree is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with GumTree. If not, see .
diff --git a/client.diff/pom.xml b/client.diff/pom.xml
index def130a63..cfcc10d2e 100644
--- a/client.diff/pom.xml
+++ b/client.diff/pom.xml
@@ -1,4 +1,23 @@
+
gumtree
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/AbstractDiffClient.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/AbstractDiffClient.java
index 90c3100ad..d22a896ec 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/AbstractDiffClient.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/AbstractDiffClient.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff;
import com.github.gumtreediff.client.Option;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/AnnotatedXmlDiff.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/AnnotatedXmlDiff.java
index 2bbccdb7f..e9b4f914a 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/AnnotatedXmlDiff.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/AnnotatedXmlDiff.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff;
import com.github.gumtreediff.client.Option;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/SwingDiff.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/SwingDiff.java
index 5e16a122c..fa172d2be 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/SwingDiff.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/SwingDiff.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff;
import com.github.gumtreediff.client.Register;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/WebDiff.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/WebDiff.java
index 550bbbf3b..9df2095fa 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/WebDiff.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/WebDiff.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff;
import com.github.gumtreediff.client.Option;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/MappingsPanel.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/MappingsPanel.java
index cd0c048f7..f0d0658c1 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/MappingsPanel.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/MappingsPanel.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.swing;
import java.awt.Color;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/SwingTree.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/SwingTree.java
index 2a1c92192..ad9781b6e 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/SwingTree.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/SwingTree.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.swing;
import com.github.gumtreediff.gen.Generators;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/TreePanel.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/TreePanel.java
index a26b718c8..effe903d3 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/TreePanel.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/swing/TreePanel.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.swing;
import com.github.gumtreediff.tree.ITree;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/DiffServer.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/DiffServer.java
index 204f763ad..ebf401b4a 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/DiffServer.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/DiffServer.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web;
import com.github.gumtreediff.tree.Pair;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/HtmlDiffs.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/HtmlDiffs.java
index d17d993f8..34c8695a1 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/HtmlDiffs.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/HtmlDiffs.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web;
import com.github.gumtreediff.actions.RootAndLeavesClassifier;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/TagIndex.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/TagIndex.java
index e4d5478d1..6bb20ec0a 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/TagIndex.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/TagIndex.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web;
import java.util.ArrayList;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/BootstrapHeader.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/BootstrapHeader.java
index ae97c9dc6..9a90227a3 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/BootstrapHeader.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/BootstrapHeader.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web.views;
import static org.rendersnake.HtmlAttributesFactory.*;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DiffView.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DiffView.java
index 599862312..e5099a9d2 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DiffView.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DiffView.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web.views;
import com.github.gumtreediff.client.diff.ui.web.HtmlDiffs;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DirectoryComparatorView.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DirectoryComparatorView.java
index 1d6927966..34ef3f166 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DirectoryComparatorView.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/DirectoryComparatorView.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web.views;
import com.github.gumtreediff.tree.Pair;
diff --git a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/ScriptView.java b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/ScriptView.java
index 94a780411..c4c0352b7 100644
--- a/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/ScriptView.java
+++ b/client.diff/src/main/java/com/github/gumtreediff/client/diff/ui/web/views/ScriptView.java
@@ -1,9 +1,30 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client.diff.ui.web.views;
import com.github.gumtreediff.actions.ActionGenerator;
import com.github.gumtreediff.actions.model.Action;
import com.github.gumtreediff.gen.Generators;
import com.github.gumtreediff.io.ActionsIoUtils;
+import com.github.gumtreediff.matchers.MappingStore;
import com.github.gumtreediff.matchers.Matcher;
import com.github.gumtreediff.matchers.Matchers;
import com.github.gumtreediff.tree.TreeContext;
@@ -20,6 +41,12 @@
public class ScriptView implements Renderable {
+ private final MappingStore mappings;
+
+ private final TreeContext src;
+
+ private final TreeContext dst;
+
private File fSrc;
private File fDst;
@@ -29,11 +56,12 @@ public class ScriptView implements Renderable {
public ScriptView(File fSrc, File fDst) throws IOException {
this.fSrc = fSrc;
this.fDst = fDst;
- TreeContext src = Generators.getInstance().getTree(fSrc.getAbsolutePath());
- TreeContext dst = Generators.getInstance().getTree(fDst.getAbsolutePath());
+ src = Generators.getInstance().getTree(fSrc.getAbsolutePath());
+ dst = Generators.getInstance().getTree(fDst.getAbsolutePath());
Matcher matcher = Matchers.getInstance().getMatcher(src.getRoot(), dst.getRoot());
matcher.match();
- ActionGenerator g = new ActionGenerator(src.getRoot(), dst.getRoot(), matcher.getMappings());
+ mappings = matcher.getMappings();
+ ActionGenerator g = new ActionGenerator(src.getRoot(), dst.getRoot(), mappings);
g.generate();
this.script = g.getActions();
}
@@ -52,7 +80,7 @@ public void renderOn(HtmlCanvas html) throws IOException {
.write("Script ")
.small().content(String.format("%s -> %s", fSrc.getName(), fDst.getName()))
._h3()
- .pre().content(ActionsIoUtils.toText(this.script))
+ .pre().content(ActionsIoUtils.toText(src, this.script, mappings).toString())
._div()
._div()
._div()
diff --git a/client.diff/src/main/resources/res/web/diff.js b/client.diff/src/main/resources/res/web/diff.js
index 1f787409b..90730d63b 100644
--- a/client.diff/src/main/resources/res/web/diff.js
+++ b/client.diff/src/main/resources/res/web/diff.js
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
currentMapping = 0;
if (typeof String.prototype.startsWith != 'function') {
diff --git a/client.diff/src/main/resources/res/web/gumtree.css b/client.diff/src/main/resources/res/web/gumtree.css
index 72896d211..00952047e 100644
--- a/client.diff/src/main/resources/res/web/gumtree.css
+++ b/client.diff/src/main/resources/res/web/gumtree.css
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
.add {
border: 1px solid black;
background-color: greenyellow;
diff --git a/client.diff/src/main/resources/res/web/list.js b/client.diff/src/main/resources/res/web/list.js
index 90da0998f..9b264f116 100644
--- a/client.diff/src/main/resources/res/web/list.js
+++ b/client.diff/src/main/resources/res/web/list.js
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str){
return this.slice(0, str.length) == str;
diff --git a/client.diff/src/main/resources/res/web/script.js b/client.diff/src/main/resources/res/web/script.js
index 0141c128f..a75c1ec23 100644
--- a/client.diff/src/main/resources/res/web/script.js
+++ b/client.diff/src/main/resources/res/web/script.js
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str){
return this.slice(0, str.length) == str;
diff --git a/client/pom.xml b/client/pom.xml
index 05255f47a..81ad7c942 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -21,5 +40,4 @@
compile
-
-
+
\ No newline at end of file
diff --git a/client/src/main/java/com/github/gumtreediff/client/Client.java b/client/src/main/java/com/github/gumtreediff/client/Client.java
index e2433f0a8..0d9a5b652 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Client.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Client.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import java.io.IOException;
diff --git a/client/src/main/java/com/github/gumtreediff/client/Clients.java b/client/src/main/java/com/github/gumtreediff/client/Clients.java
index 11f3914e9..997b95670 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Clients.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Clients.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import com.github.gumtreediff.gen.Registry;
diff --git a/client/src/main/java/com/github/gumtreediff/client/List.java b/client/src/main/java/com/github/gumtreediff/client/List.java
index 57e53c94f..e94bdb70b 100644
--- a/client/src/main/java/com/github/gumtreediff/client/List.java
+++ b/client/src/main/java/com/github/gumtreediff/client/List.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import java.io.IOException;
diff --git a/client/src/main/java/com/github/gumtreediff/client/Option.java b/client/src/main/java/com/github/gumtreediff/client/Option.java
index 1548a656f..e584e1f69 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Option.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Option.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import java.io.PrintStream;
diff --git a/client/src/main/java/com/github/gumtreediff/client/Register.java b/client/src/main/java/com/github/gumtreediff/client/Register.java
index 1d48a714d..455523233 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Register.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Register.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import java.lang.annotation.ElementType;
diff --git a/client/src/main/java/com/github/gumtreediff/client/Run.java b/client/src/main/java/com/github/gumtreediff/client/Run.java
index d000ff858..7fbabb08d 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Run.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Run.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import com.github.gumtreediff.gen.Generators;
diff --git a/client/src/main/java/com/github/gumtreediff/client/Serializer.java b/client/src/main/java/com/github/gumtreediff/client/Serializer.java
index ed83776b4..183280287 100644
--- a/client/src/main/java/com/github/gumtreediff/client/Serializer.java
+++ b/client/src/main/java/com/github/gumtreediff/client/Serializer.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.client;
import com.github.gumtreediff.io.TreeIoUtils;
diff --git a/client/src/main/java/res/r/list_properties.sh b/client/src/main/java/res/r/list_properties.sh
index a4d39c8b9..24aa0b759 100644
--- a/client/src/main/java/res/r/list_properties.sh
+++ b/client/src/main/java/res/r/list_properties.sh
@@ -1,4 +1,23 @@
#!/bin/sh
+#
+# This file is part of GumTree.
+#
+# GumTree is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GumTree is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GumTree. If not, see .
+#
+# Copyright 2011-2015 Jean-Rémy Falleri
+# Copyright 2011-2015 Floréal Morandat
+#
find . -name '*.java' | xargs grep -o 'System.getProperty.*'|
grep -v '^./samples' | grep -o 'fr/labri.gumtree.*'|
diff --git a/core/pom.xml b/core/pom.xml
index beb421930..47819baac 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -24,4 +43,4 @@
2.3
-
+
\ No newline at end of file
diff --git a/core/src/main/java/com/github/gumtreediff/actions/ActionGenerator.java b/core/src/main/java/com/github/gumtreediff/actions/ActionGenerator.java
index c716405fb..da0b6038c 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/ActionGenerator.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/ActionGenerator.java
@@ -1,18 +1,26 @@
-package com.github.gumtreediff.actions;
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+package com.github.gumtreediff.actions;
-import com.github.gumtreediff.actions.model.Delete;
-import com.github.gumtreediff.actions.model.Update;
-import com.github.gumtreediff.tree.AbstractTree;
-import com.github.gumtreediff.actions.model.Action;
-import com.github.gumtreediff.actions.model.Delete;
-import com.github.gumtreediff.actions.model.Insert;
-import com.github.gumtreediff.actions.model.Move;
-import com.github.gumtreediff.actions.model.Update;
+import com.github.gumtreediff.actions.model.*;
import com.github.gumtreediff.matchers.Mapping;
import com.github.gumtreediff.matchers.MappingStore;
import com.github.gumtreediff.tree.AbstractTree;
@@ -21,6 +29,11 @@
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.TIntObjectHashMap;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
public class ActionGenerator {
private ITree origSrc;
@@ -67,7 +80,7 @@ public List getActions() {
return actions;
}
- public void generate() {
+ public List generate() {
ITree srcFakeRoot = new AbstractTree.FakeTree(newSrc);
ITree dstFakeRoot = new AbstractTree.FakeTree(origDst);
newSrc.setParent(srcFakeRoot);
@@ -136,8 +149,8 @@ public void generate() {
}
}
-
//FIXME should ensure isomorphism.
+ return actions;
}
private void alignChildren(ITree w, ITree x) {
diff --git a/core/src/main/java/com/github/gumtreediff/actions/LeavesClassifier.java b/core/src/main/java/com/github/gumtreediff/actions/LeavesClassifier.java
index f88f07978..dcf7f1e2c 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/LeavesClassifier.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/LeavesClassifier.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions;
import java.util.List;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/RootAndLeavesClassifier.java b/core/src/main/java/com/github/gumtreediff/actions/RootAndLeavesClassifier.java
index d6e1b14b1..846807eb2 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/RootAndLeavesClassifier.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/RootAndLeavesClassifier.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions;
import java.util.HashSet;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/RootsClassifier.java b/core/src/main/java/com/github/gumtreediff/actions/RootsClassifier.java
index 1d5626ea4..e32b3e61f 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/RootsClassifier.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/RootsClassifier.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions;
import java.util.List;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/TreeClassifier.java b/core/src/main/java/com/github/gumtreediff/actions/TreeClassifier.java
index 37c94feae..0529d00ce 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/TreeClassifier.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/TreeClassifier.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions;
import java.util.HashSet;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Action.java b/core/src/main/java/com/github/gumtreediff/actions/model/Action.java
index 66ef2c395..8f74e78bc 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Action.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Action.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Addition.java b/core/src/main/java/com/github/gumtreediff/actions/model/Addition.java
index 9464cb444..4bc1fd208 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Addition.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Addition.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Delete.java b/core/src/main/java/com/github/gumtreediff/actions/model/Delete.java
index ed8fcac25..34d26bd16 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Delete.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Delete.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Insert.java b/core/src/main/java/com/github/gumtreediff/actions/model/Insert.java
index 56ccd08b3..fde7ee186 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Insert.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Insert.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Move.java b/core/src/main/java/com/github/gumtreediff/actions/model/Move.java
index ff601cff3..887422965 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Move.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Move.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/actions/model/Update.java b/core/src/main/java/com/github/gumtreediff/actions/model/Update.java
index f6ded51c2..89f2ba386 100644
--- a/core/src/main/java/com/github/gumtreediff/actions/model/Update.java
+++ b/core/src/main/java/com/github/gumtreediff/actions/model/Update.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.actions.model;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/algo/StringAlgorithms.java b/core/src/main/java/com/github/gumtreediff/algo/StringAlgorithms.java
index 72271f2de..0fcb26f70 100644
--- a/core/src/main/java/com/github/gumtreediff/algo/StringAlgorithms.java
+++ b/core/src/main/java/com/github/gumtreediff/algo/StringAlgorithms.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.algo;
import java.util.ArrayList;
diff --git a/core/src/main/java/com/github/gumtreediff/gen/Generators.java b/core/src/main/java/com/github/gumtreediff/gen/Generators.java
index 85834696b..0960f9575 100644
--- a/core/src/main/java/com/github/gumtreediff/gen/Generators.java
+++ b/core/src/main/java/com/github/gumtreediff/gen/Generators.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen;
import com.github.gumtreediff.tree.TreeContext;
diff --git a/core/src/main/java/com/github/gumtreediff/gen/Register.java b/core/src/main/java/com/github/gumtreediff/gen/Register.java
index a0f3964c5..25b76a2de 100644
--- a/core/src/main/java/com/github/gumtreediff/gen/Register.java
+++ b/core/src/main/java/com/github/gumtreediff/gen/Register.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen;
import java.lang.annotation.ElementType;
diff --git a/core/src/main/java/com/github/gumtreediff/gen/Registry.java b/core/src/main/java/com/github/gumtreediff/gen/Registry.java
index 5be1e4fe2..1b9d90db6 100644
--- a/core/src/main/java/com/github/gumtreediff/gen/Registry.java
+++ b/core/src/main/java/com/github/gumtreediff/gen/Registry.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen;
diff --git a/core/src/main/java/com/github/gumtreediff/gen/TreeGenerator.java b/core/src/main/java/com/github/gumtreediff/gen/TreeGenerator.java
index ba2ddc8d1..3e7870d3a 100644
--- a/core/src/main/java/com/github/gumtreediff/gen/TreeGenerator.java
+++ b/core/src/main/java/com/github/gumtreediff/gen/TreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen;
import com.github.gumtreediff.tree.TreeContext;
diff --git a/core/src/main/java/com/github/gumtreediff/io/ActionsIoUtils.java b/core/src/main/java/com/github/gumtreediff/io/ActionsIoUtils.java
index 552742868..8705fc310 100644
--- a/core/src/main/java/com/github/gumtreediff/io/ActionsIoUtils.java
+++ b/core/src/main/java/com/github/gumtreediff/io/ActionsIoUtils.java
@@ -1,143 +1,230 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.io;
-import com.github.gumtreediff.actions.model.Action;
+import com.github.gumtreediff.actions.model.*;
+import com.github.gumtreediff.io.TreeIoUtils.AbstractSerializer;
import com.github.gumtreediff.matchers.MappingStore;
+import com.github.gumtreediff.tree.ITree;
import com.github.gumtreediff.tree.TreeContext;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-import java.io.FileWriter;
import java.io.IOException;
-import java.io.StringWriter;
import java.io.Writer;
import java.util.List;
public final class ActionsIoUtils {
- private ActionsIoUtils() {
+ private ActionsIoUtils() { }
+
+ public static ActionSerializer toText(TreeContext sctx, List actions,
+ MappingStore mappings) throws IOException {
+ return new ActionSerializer(sctx, mappings, actions) {
+
+ @Override
+ protected ActionFormatter newFormatter(TreeContext ctx, Writer writer) throws Exception {
+ return new TextFormatter(ctx, writer);
+ }
+ };
}
- public static String toText(List script) {
- StringWriter w = new StringWriter();
- for (Action a: script) w.append(a.toString() + "\n");
- String result = w.toString();
- try {
- w.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return result;
+ public static ActionSerializer toXml(TreeContext sctx, List actions,
+ MappingStore mappings) throws IOException {
+ return new ActionSerializer(sctx, mappings, actions) {
+
+ @Override
+ protected ActionFormatter newFormatter(TreeContext ctx, Writer writer) throws Exception {
+ return new XMLFormatter(ctx, writer);
+ }
+ };
}
- public static void toText(List script, String file) {
- try {
- FileWriter w = new FileWriter(file);
- for (Action a : script) w.append(a.toString() + "\n");
- w.close();
- } catch (IOException e) {
- e.printStackTrace();
+ public abstract static class ActionSerializer extends AbstractSerializer {
+ final TreeContext context;
+ final MappingStore mappings;
+ final List actions;
+
+ ActionSerializer(TreeContext context, MappingStore mappings, List actions) {
+ this.context = context;
+ this.mappings = mappings;
+ this.actions = actions;
}
- }
- public static void toXml(TreeContext sctx, List actions,
- MappingStore mappings, String file) throws IOException {
- FileWriter f = new FileWriter(file);
- try {
- toXml(sctx, f, actions, mappings);
- } finally {
- try {
- f.close();
- } catch (IOException e) {
- e.printStackTrace();
+ protected abstract ActionFormatter newFormatter(TreeContext ctx, Writer writer) throws Exception;
+
+ @Override
+ public void writeTo(Writer writer) throws Exception {
+ ActionFormatter fmt = newFormatter(context, writer);
+ fmt.startActions();
+ for (Action a : actions) {
+ ITree src = a.getNode();
+ if (a instanceof Move) {
+ ITree dst = mappings.getDst(src);
+ fmt.moveAction(src, dst);
+ break;
+ } else if (a instanceof Update) {
+ ITree dst = mappings.getDst(src);
+ fmt.updateAction(src, dst);
+ break;
+ } else if (a instanceof Insert) {
+ ITree dst = a.getNode();
+ if (dst.isRoot())
+ fmt.insertRoot(src);
+ else
+ fmt.insertAction(src, dst.getParent(), dst.getParent().getChildPosition(dst));
+ } else if (a instanceof Delete) {
+ fmt.deleteAction(src);
+ }
}
+ fmt.endActions();
}
}
- public static String toXml(TreeContext sctx, List actions, MappingStore mappings) {
- StringWriter s = new StringWriter();
- try {
- toXml(sctx, s, actions, mappings);
- return s.toString();
- } finally {
- try {
- s.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
+ interface ActionFormatter {
+ void startActions() throws Exception;
+ void insertRoot(ITree node) throws Exception;
+ void insertAction(ITree node, ITree parent, int index) throws Exception;
+ void moveAction(ITree src, ITree dst) throws Exception;
+ void updateAction(ITree src, ITree dst) throws Exception;
+ void deleteAction(ITree node) throws Exception;
+ void endActions() throws Exception;
}
- public static void toXml(TreeContext sctx, Writer writer, List actions, MappingStore mappings) {
- XMLOutputFactory f = XMLOutputFactory.newInstance();
- try {
- XMLStreamWriter w = new IndentingXMLStreamWriter(f.createXMLStreamWriter(writer));
- w.writeStartDocument();
- w.writeStartElement("actions");
-// writeActions(sctx, actions, mappings, w);
- // TODO rewrite ActionsIO like TreeIO and handle metadata
- w.writeEndElement();
- w.writeEndDocument();
- w.close();
- } catch (Exception e) {
- e.printStackTrace();
+ static class XMLFormatter implements ActionFormatter {
+ final TreeContext context;
+ final XMLStreamWriter writer;
+
+ XMLFormatter(TreeContext context, Writer w) throws XMLStreamException {
+ XMLOutputFactory f = XMLOutputFactory.newInstance();
+ writer = new IndentingXMLStreamWriter(f.createXMLStreamWriter(w));
+ this.context = context;
+ }
+
+
+ @Override
+ public void startActions() throws XMLStreamException {
+ writer.writeStartDocument();
+ writer.writeStartElement("actions");
+ }
+
+ @Override
+ public void insertRoot(ITree node) throws Exception {
+ start(Insert.class, node);
+ end(node);
+ }
+
+ @Override
+ public void insertAction(ITree node, ITree parent, int index) throws Exception {
+ start(Insert.class, node);
+ writer.writeAttribute("parent", Integer.toString(parent.getId()));
+ writer.writeAttribute("at", Integer.toString(index));
+ end(node);
+ }
+
+ @Override
+ public void moveAction(ITree src, ITree dst) throws XMLStreamException {
+ start(Move.class, src);
+ writer.writeAttribute("to", Integer.toString(dst.getId()));
+ end(src);
+ }
+
+ @Override
+ public void updateAction(ITree src, ITree dst) throws XMLStreamException {
+ start(Update.class, src);
+ writer.writeAttribute("to", Integer.toString(dst.getId()));
+ end(src);
+ }
+
+ @Override
+ public void deleteAction(ITree node) throws Exception {
+ start(Delete.class, node);
+ end(node);
+ }
+
+
+ @Override
+ public void endActions() throws XMLStreamException {
+ writer.writeEndElement();
+ writer.writeEndDocument();
}
- }
-// private static void writeActions(TreeContext sctx, List actions,
-// MappingStore mappings, XMLStreamWriter w) throws XMLStreamException {
-// for (Action a : actions) {
-// w.writeStartElement("action");
-// w.writeAttribute("type", a.getClass().getSimpleName());
-// w.writeAttribute("tree", sctx.getTypeLabel(a.getNode()));
-// if (a instanceof Move || a instanceof Update) {
-// ITree src = a.getNode();
-// ITree dst = mappings.getDst(src);
-// writeTreePos(w, true, src);
-// writeTreePos(w, false, dst);
-// } else if (a instanceof Insert) {
-// ITree dst = a.getNode();
-// if (dst.isRoot()) writeInsertPos(w, true, new int[] {0, 0});
-// else {
-// int[] pos;
-// int idx = dst.getParent().getChildPosition(dst);
-//
-// if (idx == 0) pos = dst.getParent().getLcPosStart();
-// else pos = dst.getParent().getChildren().get(idx - 1).getLcPosEnd();
-//
-// writeInsertPos(w, true,pos);
-// }
-// writeTreePos(w, false, dst);
-// } else if (a instanceof Delete) {
-// ITree src = a.getNode();
-// writeTreePos(w, true, src);
-// }
-// w.writeEndElement();
-// }
-// }
-
-// private static void writeTreePos(XMLStreamWriter w, boolean isBefore, ITree tree) throws XMLStreamException {
-// if (isBefore)
-// w.writeEmptyElement("before");
-// else
-// w.writeEmptyElement("after");
-// if (tree.getLcPosStart() != null) {
-// w.writeAttribute("begin_line", Integer.toString(tree.getLcPosStart()[0]));
-// w.writeAttribute("begin_col", Integer.toString(tree.getLcPosStart()[1]));
-// w.writeAttribute("end_line", Integer.toString(tree.getLcPosEnd()[0]));
-// w.writeAttribute("end_col", Integer.toString(tree.getLcPosEnd()[1]));
-// }
-// }
-
- private static void writeInsertPos(XMLStreamWriter w, boolean isBefore, int[] pos) throws XMLStreamException {
- if (isBefore)
- w.writeEmptyElement("before");
- else
- w.writeEmptyElement("after");
- w.writeAttribute("begin_line", Integer.toString(pos[0]));
- w.writeAttribute("begin_col", Integer.toString(pos[1]));
- w.writeAttribute("end_line", Integer.toString(pos[0]));
- w.writeAttribute("end_col", Integer.toString(pos[1]));
+ private void start(Class extends Action> name, ITree src) throws XMLStreamException {
+ writer.writeEmptyElement(name.getSimpleName().toLowerCase());
+ writer.writeAttribute("tree", Integer.toString(src.getId()));
+ }
+
+ private void end(ITree node) throws XMLStreamException {
+// writer.writeEndElement();
+ }
}
+ static class TextFormatter implements ActionFormatter {
+ final Writer writer;
+ final TreeContext context;
+ public TextFormatter(TreeContext ctx, Writer writer) {
+ this.context = ctx;
+ this.writer = writer;
+ }
+
+
+ @Override
+ public void startActions() throws Exception { }
+
+ @Override
+ public void insertRoot(ITree node) throws Exception {
+ write("Insert root %s", _(node));
+ }
+
+ @Override
+ public void insertAction(ITree node, ITree parent, int index) throws Exception {
+ write("Insert %s -> %d %s", _(node), index, _(parent));
+ }
+
+ @Override
+ public void moveAction(ITree src, ITree dst) throws Exception {
+ write("Move %s -> %s", _(src), _(dst));
+ }
+
+ @Override
+ public void updateAction(ITree src, ITree dst) throws Exception {
+ write("Move %s -> %s", _(src), _(dst));
+ }
+
+ @Override
+ public void deleteAction(ITree node) throws Exception {
+ write("Delete %s", _(node));
+ }
+
+ @Override
+ public void endActions() throws Exception { }
+
+ private void write(String fmt, Object... objs) throws IOException {
+ writer.append(String.format(fmt, objs));
+ writer.append("\n");
+ }
+
+ private String _(ITree node) {
+ return String.format("%s(%d)", node.toPrettyString(context), node.getId());
+ }
+ }
}
diff --git a/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java b/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java
index d0e196470..b5d3c3dc9 100644
--- a/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java
+++ b/core/src/main/java/com/github/gumtreediff/io/DirectoryComparator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.io;
import com.github.gumtreediff.tree.Pair;
diff --git a/core/src/main/java/com/github/gumtreediff/io/LineReader.java b/core/src/main/java/com/github/gumtreediff/io/LineReader.java
index 9c74204ed..d0499031e 100644
--- a/core/src/main/java/com/github/gumtreediff/io/LineReader.java
+++ b/core/src/main/java/com/github/gumtreediff/io/LineReader.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.io;
import java.io.IOException;
diff --git a/core/src/main/java/com/github/gumtreediff/io/MatrixDebugger.java b/core/src/main/java/com/github/gumtreediff/io/MatrixDebugger.java
index 0dc0caf23..293ca5288 100644
--- a/core/src/main/java/com/github/gumtreediff/io/MatrixDebugger.java
+++ b/core/src/main/java/com/github/gumtreediff/io/MatrixDebugger.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.io;
public final class MatrixDebugger {
diff --git a/core/src/main/java/com/github/gumtreediff/io/TreeIoUtils.java b/core/src/main/java/com/github/gumtreediff/io/TreeIoUtils.java
index afb491127..d9f5298a1 100644
--- a/core/src/main/java/com/github/gumtreediff/io/TreeIoUtils.java
+++ b/core/src/main/java/com/github/gumtreediff/io/TreeIoUtils.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.io;
import com.github.gumtreediff.gen.Register;
@@ -90,25 +110,9 @@ protected TreeFormatter newFormatter(TreeContext ctx, MetadataSerializers serial
};
}
- public abstract static class TreeSerializer {
- final TreeContext context;
- final MetadataSerializers serializers = new MetadataSerializers();
-
- public TreeSerializer(TreeContext ctx) {
- context = ctx;
- serializers.addAll(ctx.getSerializers());
- }
-
- protected abstract TreeFormatter newFormatter(TreeContext ctx, MetadataSerializers serializers, Writer writer) throws Exception;
-
- public void writeTo(Writer writer) throws Exception {
- TreeFormatter formatter = newFormatter(context, serializers, writer);
- try {
- writeTree(formatter, context.getRoot());
- } finally {
- formatter.close();
- }
- }
+ public abstract static class AbstractSerializer {
+ // This has to be a class a not an interface/mixin because of the toString method
+ public abstract void writeTo(Writer writer) throws Exception;
public void writeTo(OutputStream writer) throws Exception {
OutputStreamWriter os = new OutputStreamWriter(writer);
@@ -148,6 +152,27 @@ public void writeTo(File file) throws Exception {
w.close();
}
}
+ }
+
+ public abstract static class TreeSerializer extends AbstractSerializer {
+ final TreeContext context;
+ final MetadataSerializers serializers = new MetadataSerializers();
+
+ public TreeSerializer(TreeContext ctx) {
+ context = ctx;
+ serializers.addAll(ctx.getSerializers());
+ }
+
+ protected abstract TreeFormatter newFormatter(TreeContext ctx, MetadataSerializers serializers, Writer writer) throws Exception;
+
+ public void writeTo(Writer writer) throws Exception {
+ TreeFormatter formatter = newFormatter(context, serializers, writer);
+ try {
+ writeTree(formatter, context.getRoot());
+ } finally {
+ formatter.close();
+ }
+ }
private void forwardException(Exception e) {
throw new FormatException(e);
@@ -188,6 +213,14 @@ public void endTree(ITree tree) {
formatter.stopSerialization();
}
+ protected void writeAttributes(TreeFormatter formatter, Iterator> it) throws Exception {
+ while (it.hasNext()) {
+ Entry entry = it.next();
+ String k = entry.getKey();
+ serializers.serialize(formatter, entry.getKey(), entry.getValue());
+ }
+ }
+
public TreeSerializer export(String name, MetadataSerializer serializer) {
serializers.add(name, serializer);
return this;
@@ -198,14 +231,6 @@ public TreeSerializer export(String... name) {
serializers.add(n, x -> x.toString());
return this;
}
-
- protected void writeAttributes(TreeFormatter formatter, Iterator> it) throws Exception {
- while (it.hasNext()) {
- Entry entry = it.next();
- String k = entry.getKey();
- serializers.serialize(formatter, entry.getKey(), entry.getValue());
- }
- }
}
public interface TreeFormatter {
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatcher.java
index 3363ae17a..2f8303878 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatchers.java b/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatchers.java
index d370e2ade..0234f9881 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatchers.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/CompositeMatchers.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import com.github.gumtreediff.matchers.heuristic.cd.ChangeDistillerBottomUpMatcher;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/Mapping.java b/core/src/main/java/com/github/gumtreediff/matchers/Mapping.java
index 862e72401..cac585003 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/Mapping.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/Mapping.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/MappingStore.java b/core/src/main/java/com/github/gumtreediff/matchers/MappingStore.java
index ca85030db..52ef56492 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/MappingStore.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/MappingStore.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import java.util.HashMap;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/Matcher.java b/core/src/main/java/com/github/gumtreediff/matchers/Matcher.java
index f38997678..76dc47e0a 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/Matcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/Matcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/Matchers.java b/core/src/main/java/com/github/gumtreediff/matchers/Matchers.java
index 946908100..b99749e75 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/Matchers.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/Matchers.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import com.github.gumtreediff.gen.Registry;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/MultiMappingStore.java b/core/src/main/java/com/github/gumtreediff/matchers/MultiMappingStore.java
index a80e837c1..69cb699db 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/MultiMappingStore.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/MultiMappingStore.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import java.util.HashMap;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/Register.java b/core/src/main/java/com/github/gumtreediff/matchers/Register.java
index 6f828ef5e..bfc5e55f5 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/Register.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/Register.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers;
import java.lang.annotation.ElementType;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/LcsMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/LcsMatcher.java
index 01c26061e..2955830c5 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/LcsMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/LcsMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic;
import com.github.gumtreediff.algo.StringAlgorithms;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/XyBottomUpMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/XyBottomUpMatcher.java
index d4b08f330..12e18798f 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/XyBottomUpMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/XyBottomUpMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerBottomUpMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerBottomUpMatcher.java
index 95476cd09..11996fdc5 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerBottomUpMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerBottomUpMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.cd;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerLeavesMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerLeavesMatcher.java
index 6d33bf8f6..e7c0a9e21 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerLeavesMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/cd/ChangeDistillerLeavesMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.cd;
import com.github.gumtreediff.matchers.Mapping;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CliqueSubtreeMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CliqueSubtreeMatcher.java
index c5f50dbda..dd561d9e7 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CliqueSubtreeMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CliqueSubtreeMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CompleteBottomUpMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CompleteBottomUpMatcher.java
index 317cd780a..127ec882c 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CompleteBottomUpMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/CompleteBottomUpMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.Mapping;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/FirstMatchBottomUpMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/FirstMatchBottomUpMatcher.java
index 712c977e9..87f23533f 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/FirstMatchBottomUpMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/FirstMatchBottomUpMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedyBottomUpMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedyBottomUpMatcher.java
index 814d4e43d..955db36e4 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedyBottomUpMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedyBottomUpMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.Mapping;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedySubtreeMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedySubtreeMatcher.java
index b9ac9d7fd..2b5d3081a 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedySubtreeMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/GreedySubtreeMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.Mapping;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/HungarianSubtreeMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/HungarianSubtreeMatcher.java
index 52acdf1fa..22022cc1f 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/HungarianSubtreeMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/HungarianSubtreeMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.algo.HungarianAlgorithm;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/SubtreeMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/SubtreeMatcher.java
index a23265106..2cf32813f 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/SubtreeMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/heuristic/gt/SubtreeMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.heuristic.gt;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedMatcher.java
index 96f57d334..218381105 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.optimal.rted;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/matchers/optimal/zs/ZsMatcher.java b/core/src/main/java/com/github/gumtreediff/matchers/optimal/zs/ZsMatcher.java
index d24dbd0b2..5c29b5559 100644
--- a/core/src/main/java/com/github/gumtreediff/matchers/optimal/zs/ZsMatcher.java
+++ b/core/src/main/java/com/github/gumtreediff/matchers/optimal/zs/ZsMatcher.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.matchers.optimal.zs;
import com.github.gumtreediff.matchers.MappingStore;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/AbstractTree.java b/core/src/main/java/com/github/gumtreediff/tree/AbstractTree.java
index ab2b3a26f..b3cf4f434 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/AbstractTree.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/AbstractTree.java
@@ -1,13 +1,28 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import com.github.gumtreediff.tree.hash.HashUtils;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
+import java.util.*;
public abstract class AbstractTree implements ITree {
@@ -288,7 +303,7 @@ public String toPrettyString(TreeContext ctx) {
public static class FakeTree extends AbstractTree {
public FakeTree(ITree... trees) {
- children = new ArrayList(trees.length);
+ children = new ArrayList<>(trees.length);
children.addAll(Arrays.asList(trees));
}
@@ -311,24 +326,22 @@ public List getChildren() {
return children;
}
- @Override
- public int getEndPos() {
- throw unsupportedOperation();
- }
-
@Override
public String getLabel() {
return NO_LABEL;
}
@Override
- public int getLength() {
- throw unsupportedOperation();
- }
+ public int getLength() { return getEndPos() - getPos(); }
@Override
public int getPos() {
- throw unsupportedOperation();
+ return Collections.min(children, (t1, t2) -> t2.getPos() - t1.getPos()).getPos();
+ }
+
+ @Override
+ public int getEndPos() {
+ return Collections.max(children, (t1, t2) -> t2.getPos() - t1.getPos()).getEndPos();
}
@Override
diff --git a/core/src/main/java/com/github/gumtreediff/tree/ITree.java b/core/src/main/java/com/github/gumtreediff/tree/ITree.java
index 4f4ce05db..2bf358196 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/ITree.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/ITree.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import java.util.Iterator;
@@ -52,7 +72,9 @@ public interface ITree {
public abstract int getHash();
- public abstract int getEndPos();
+ default int getEndPos() {
+ return getPos() + getLength();
+ }
public abstract int getHeight();
diff --git a/core/src/main/java/com/github/gumtreediff/tree/IterableEnumeration.java b/core/src/main/java/com/github/gumtreediff/tree/IterableEnumeration.java
index e96f1488c..66f01ee3e 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/IterableEnumeration.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/IterableEnumeration.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import java.util.Enumeration;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/Pair.java b/core/src/main/java/com/github/gumtreediff/tree/Pair.java
index 435f6f226..820822f57 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/Pair.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/Pair.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
public class Pair {
diff --git a/core/src/main/java/com/github/gumtreediff/tree/Tree.java b/core/src/main/java/com/github/gumtreediff/tree/Tree.java
index 5794d63ea..64ee59559 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/Tree.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/Tree.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import java.util.ArrayList;
@@ -72,11 +92,6 @@ public List getChildren() {
return children;
}
- @Override
- public int getEndPos() {
- return pos + length;
- }
-
@Override
public String getLabel() {
return label;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/TreeContext.java b/core/src/main/java/com/github/gumtreediff/tree/TreeContext.java
index e36c6ad42..45d3078d2 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/TreeContext.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/TreeContext.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import com.github.gumtreediff.io.TreeIoUtils;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/TreeMap.java b/core/src/main/java/com/github/gumtreediff/tree/TreeMap.java
index bd5b9f8cf..be6f7aa7f 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/TreeMap.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/TreeMap.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import gnu.trove.map.TIntObjectMap;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/TreeUtils.java b/core/src/main/java/com/github/gumtreediff/tree/TreeUtils.java
index 043f8a684..0d7b92cbf 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/TreeUtils.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/TreeUtils.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree;
import java.util.ArrayDeque;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/hash/HashGenerator.java b/core/src/main/java/com/github/gumtreediff/tree/hash/HashGenerator.java
index c03d26bc2..b618757cb 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/hash/HashGenerator.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/hash/HashGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree.hash;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/hash/HashUtils.java b/core/src/main/java/com/github/gumtreediff/tree/hash/HashUtils.java
index 28e005fe7..9b8fe0a14 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/hash/HashUtils.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/hash/HashUtils.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree.hash;
import java.security.MessageDigest;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/hash/RollingHashGenerator.java b/core/src/main/java/com/github/gumtreediff/tree/hash/RollingHashGenerator.java
index b54d799ee..34dee74b0 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/hash/RollingHashGenerator.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/hash/RollingHashGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree.hash;
import java.util.HashMap;
diff --git a/core/src/main/java/com/github/gumtreediff/tree/hash/StaticHashGenerator.java b/core/src/main/java/com/github/gumtreediff/tree/hash/StaticHashGenerator.java
index d6daec09c..3b738ffe8 100644
--- a/core/src/main/java/com/github/gumtreediff/tree/hash/StaticHashGenerator.java
+++ b/core/src/main/java/com/github/gumtreediff/tree/hash/StaticHashGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.tree.hash;
import com.github.gumtreediff.tree.ITree;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestActionGenerator.java b/core/src/test/java/com/github/gumtreediff/test/TestActionGenerator.java
index 6a75e3867..db6936dee 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestActionGenerator.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestActionGenerator.java
@@ -1,34 +1,45 @@
-package com.github.gumtreediff.test;
-
-import java.util.List;
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
-import static org.junit.Assert.*;
+package com.github.gumtreediff.test;
import com.github.gumtreediff.actions.ActionGenerator;
-import com.github.gumtreediff.actions.model.Delete;
-import com.github.gumtreediff.actions.model.Move;
-import com.github.gumtreediff.actions.model.Update;
+import com.github.gumtreediff.actions.model.*;
import com.github.gumtreediff.matchers.MappingStore;
+import com.github.gumtreediff.tree.ITree;
import com.github.gumtreediff.tree.Pair;
+import com.github.gumtreediff.tree.TreeContext;
import org.junit.Test;
-import com.github.gumtreediff.actions.ActionGenerator;
-import com.github.gumtreediff.actions.model.Action;
-import com.github.gumtreediff.actions.model.Delete;
-import com.github.gumtreediff.actions.model.Insert;
-import com.github.gumtreediff.actions.model.Move;
-import com.github.gumtreediff.actions.model.Update;
-import com.github.gumtreediff.matchers.MappingStore;
-import com.github.gumtreediff.tree.ITree;
-import com.github.gumtreediff.tree.Pair;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class TestActionGenerator {
@Test
public void testWithActionExample() {
- Pair trees = TreeLoader.getActionPair();
- ITree src = trees.getFirst();
- ITree dst = trees.getSecond();
+ Pair trees = TreeLoader.getActionPair();
+ ITree src = trees.getFirst().getRoot();
+ ITree dst = trees.getSecond().getRoot();
MappingStore ms = new MappingStore();
ms.link(src, dst);
ms.link(src.getChild(1), dst.getChild(0));
@@ -66,9 +77,9 @@ public void testWithActionExample() {
@Test
public void testWithZsCustomExample() {
- Pair trees = TreeLoader.getZsCustomPair();
- ITree src = trees.getFirst();
- ITree dst = trees.getSecond();
+ Pair trees = TreeLoader.getZsCustomPair();
+ ITree src = trees.getFirst().getRoot();
+ ITree dst = trees.getSecond().getRoot();
MappingStore ms = new MappingStore();
ms.link(src, dst.getChild(0));
ms.link(src.getChild(0), dst.getChild(0).getChild(0));
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestActionIO.java b/core/src/test/java/com/github/gumtreediff/test/TestActionIO.java
new file mode 100644
index 000000000..7f1e41d50
--- /dev/null
+++ b/core/src/test/java/com/github/gumtreediff/test/TestActionIO.java
@@ -0,0 +1,48 @@
+package com.github.gumtreediff.test;
+
+import com.github.gumtreediff.actions.ActionGenerator;
+import com.github.gumtreediff.actions.model.Action;
+import com.github.gumtreediff.io.ActionsIoUtils;
+import com.github.gumtreediff.matchers.MappingStore;
+import com.github.gumtreediff.matchers.Matcher;
+import com.github.gumtreediff.matchers.Matchers;
+import com.github.gumtreediff.tree.Pair;
+import com.github.gumtreediff.tree.TreeContext;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.List;
+
+public class TestActionIO {
+ private TreeContext src;
+ private TreeContext dst;
+ private MappingStore mappings;
+ private List actions;
+
+ @Before
+ public void setUp() throws Exception {
+ Pair p = TreeLoader.getActionPair();
+ src = p.getFirst();
+ dst = p.getSecond();
+ Matcher m = Matchers.getInstance().getMatcher(src.getRoot(), dst.getRoot());
+ mappings = m.getMappings();
+ actions = new ActionGenerator(src.getRoot(), dst.getRoot(), mappings).generate();
+ }
+
+ @Test
+ public void testPos() throws Exception {
+ src.getRoot().breadthFirst().forEach(x -> System.out.printf("%d) %s [%d:%d]:%d\n", x.getType(), x.getLabel(), x.getPos(), x.getEndPos(), x.getLength()));
+ }
+
+ @Test
+ public void testBasicXMLActions() throws IOException {
+ System.out.println(ActionsIoUtils.toXml(src, actions, mappings));
+ }
+
+
+ @Test
+ public void testBasicTextActions() throws IOException {
+ System.out.println(ActionsIoUtils.toText(src, actions, mappings));
+ }
+}
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestCoreSuite.java b/core/src/test/java/com/github/gumtreediff/test/TestCoreSuite.java
index adbc22e9e..b490cd1b0 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestCoreSuite.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestCoreSuite.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestHash.java b/core/src/test/java/com/github/gumtreediff/test/TestHash.java
index 428957e10..2e1d11292 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestHash.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestHash.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import static org.junit.Assert.assertEquals;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestRtedMatcher.java b/core/src/test/java/com/github/gumtreediff/test/TestRtedMatcher.java
index 3ef484948..7d3c6f1d8 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestRtedMatcher.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestRtedMatcher.java
@@ -1,13 +1,31 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
-import com.github.gumtreediff.matchers.MappingStore;
-import com.github.gumtreediff.matchers.optimal.rted.RtedMatcher;
-import com.github.gumtreediff.tree.Pair;
import com.github.gumtreediff.matchers.MappingStore;
import com.github.gumtreediff.matchers.Matcher;
import com.github.gumtreediff.matchers.optimal.rted.RtedMatcher;
import com.github.gumtreediff.tree.ITree;
import com.github.gumtreediff.tree.Pair;
+import com.github.gumtreediff.tree.TreeContext;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -17,9 +35,9 @@ public class TestRtedMatcher {
@Test
public void testRtedMatcher() {
- Pair trees = TreeLoader.getZsSlidePair();
- ITree src = trees.getFirst();
- ITree dst = trees.getSecond();
+ Pair trees = TreeLoader.getZsSlidePair();
+ ITree src = trees.getFirst().getRoot();
+ ITree dst = trees.getSecond().getRoot();
Matcher matcher = new RtedMatcher(src, dst, new MappingStore());
matcher.match();
assertEquals(5, matcher.getMappingSet().size());
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestTree.java b/core/src/test/java/com/github/gumtreediff/test/TestTree.java
index 0c7a32090..a76374dbd 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestTree.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestTree.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import static org.junit.Assert.assertTrue;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestTreeIoUtils.java b/core/src/test/java/com/github/gumtreediff/test/TestTreeIoUtils.java
index 11e591171..76267f770 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestTreeIoUtils.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestTreeIoUtils.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import com.github.gumtreediff.io.TreeIoUtils;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestTreeUtils.java b/core/src/test/java/com/github/gumtreediff/test/TestTreeUtils.java
index 9b7b38cca..9b1076fee 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestTreeUtils.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestTreeUtils.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import static org.junit.Assert.*;
diff --git a/core/src/test/java/com/github/gumtreediff/test/TestZsMatcher.java b/core/src/test/java/com/github/gumtreediff/test/TestZsMatcher.java
index c130cd2bc..1ef131747 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TestZsMatcher.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TestZsMatcher.java
@@ -1,12 +1,31 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
-import com.github.gumtreediff.matchers.MappingStore;
-import com.github.gumtreediff.tree.Pair;
import com.github.gumtreediff.matchers.MappingStore;
import com.github.gumtreediff.matchers.Matcher;
import com.github.gumtreediff.matchers.optimal.zs.ZsMatcher;
import com.github.gumtreediff.tree.ITree;
import com.github.gumtreediff.tree.Pair;
+import com.github.gumtreediff.tree.TreeContext;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -16,9 +35,9 @@ public class TestZsMatcher {
@Test
public void testWithCustomExample() {
- Pair trees = TreeLoader.getZsCustomPair();
- ITree src = trees.getFirst();
- ITree dst = trees.getSecond();
+ Pair trees = TreeLoader.getZsCustomPair();
+ ITree src = trees.getFirst().getRoot();
+ ITree dst = trees.getSecond().getRoot();
Matcher matcher = new ZsMatcher(src, dst, new MappingStore());
matcher.match();
assertEquals(5, matcher.getMappingSet().size());
@@ -31,9 +50,9 @@ public void testWithCustomExample() {
@Test
public void testWithSlideExample() {
- Pair trees = TreeLoader.getZsSlidePair();
- ITree src = trees.getFirst();
- ITree dst = trees.getSecond();
+ Pair trees = TreeLoader.getZsSlidePair();
+ ITree src = trees.getFirst().getRoot();
+ ITree dst = trees.getSecond().getRoot();
Matcher matcher = new ZsMatcher(src, dst, new MappingStore());
matcher.match();
assertEquals(5, matcher.getMappingSet().size());
diff --git a/core/src/test/java/com/github/gumtreediff/test/TreeLoader.java b/core/src/test/java/com/github/gumtreediff/test/TreeLoader.java
index f68065d51..9bc72d7c5 100644
--- a/core/src/test/java/com/github/gumtreediff/test/TreeLoader.java
+++ b/core/src/test/java/com/github/gumtreediff/test/TreeLoader.java
@@ -1,8 +1,29 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.test;
import com.github.gumtreediff.io.TreeIoUtils;
import com.github.gumtreediff.tree.ITree;
import com.github.gumtreediff.tree.Pair;
+import com.github.gumtreediff.tree.TreeContext;
import java.io.IOException;
@@ -10,37 +31,37 @@ public class TreeLoader {
private TreeLoader() {}
- public static Pair getActionPair() {
+ public static Pair getActionPair() {
return new Pair<>(load("/action_v0.xml"), load("/action_v1.xml"));
}
- public static Pair getZsCustomPair() {
+ public static Pair getZsCustomPair() {
return new Pair<>(load("/zs_v0.xml"), load("/zs_v1.xml"));
}
- public static Pair getZsSlidePair() {
+ public static Pair getZsSlidePair() {
return new Pair<>(load("/zs_slide_v0.xml"), load("/zs_slide_v1.xml"));
}
- public static Pair getDummyPair() {
+ public static Pair getDummyPair() {
return new Pair<>(load("/Dummy_v0.xml"), load("/Dummy_v1.xml"));
}
public static ITree getDummySrc() {
- return load("/Dummy_v0.xml");
+ return load("/Dummy_v0.xml").getRoot();
}
public static ITree getDummyDst() {
- return load("/Dummy_v1.xml");
+ return load("/Dummy_v1.xml").getRoot();
}
public static ITree getDummyBig() {
- return load("/Dummy_big.xml");
+ return load("/Dummy_big.xml").getRoot();
}
- public static ITree load(String name) {
+ public static TreeContext load(String name) {
try {
- return TreeIoUtils.fromXml().generateFromStream(System.class.getResourceAsStream(name)).getRoot();
+ return TreeIoUtils.fromXml().generateFromStream(System.class.getResourceAsStream(name));
} catch (IOException e) {
throw new RuntimeException(String.format("Unable to load test ressorce: %s", name), e);
}
diff --git a/core/src/test/resources/Dummy_big.xml b/core/src/test/resources/Dummy_big.xml
index 9f31fe7c4..f920353e9 100644
--- a/core/src/test/resources/Dummy_big.xml
+++ b/core/src/test/resources/Dummy_big.xml
@@ -1,3 +1,22 @@
+
@@ -16,4 +35,4 @@
-
+
\ No newline at end of file
diff --git a/core/src/test/resources/Dummy_v0.xml b/core/src/test/resources/Dummy_v0.xml
index 7384ef51a..5678f6959 100644
--- a/core/src/test/resources/Dummy_v0.xml
+++ b/core/src/test/resources/Dummy_v0.xml
@@ -1,7 +1,26 @@
+
-
\ No newline at end of file
+
diff --git a/core/src/test/resources/Dummy_v1.xml b/core/src/test/resources/Dummy_v1.xml
index 24ea1a00b..d84034a30 100644
--- a/core/src/test/resources/Dummy_v1.xml
+++ b/core/src/test/resources/Dummy_v1.xml
@@ -1,3 +1,22 @@
+
diff --git a/core/src/test/resources/action_v0.xml b/core/src/test/resources/action_v0.xml
index e5d79cdd1..3095a2b64 100644
--- a/core/src/test/resources/action_v0.xml
+++ b/core/src/test/resources/action_v0.xml
@@ -1,3 +1,22 @@
+
@@ -7,4 +26,4 @@
-
\ No newline at end of file
+
diff --git a/core/src/test/resources/action_v1.xml b/core/src/test/resources/action_v1.xml
index 623e1d0ce..6402e44a5 100644
--- a/core/src/test/resources/action_v1.xml
+++ b/core/src/test/resources/action_v1.xml
@@ -1,3 +1,22 @@
+
diff --git a/core/src/test/resources/zs_slide_v0.xml b/core/src/test/resources/zs_slide_v0.xml
index af3f04b7a..a2849834c 100644
--- a/core/src/test/resources/zs_slide_v0.xml
+++ b/core/src/test/resources/zs_slide_v0.xml
@@ -1,3 +1,22 @@
+
@@ -6,4 +25,4 @@
-
\ No newline at end of file
+
diff --git a/core/src/test/resources/zs_slide_v1.xml b/core/src/test/resources/zs_slide_v1.xml
index d9607b863..4058d14fd 100644
--- a/core/src/test/resources/zs_slide_v1.xml
+++ b/core/src/test/resources/zs_slide_v1.xml
@@ -1,3 +1,22 @@
+
@@ -6,4 +25,4 @@
-
\ No newline at end of file
+
diff --git a/core/src/test/resources/zs_v0.xml b/core/src/test/resources/zs_v0.xml
index 8f5b91b0d..67bc8292c 100644
--- a/core/src/test/resources/zs_v0.xml
+++ b/core/src/test/resources/zs_v0.xml
@@ -1,3 +1,22 @@
+
@@ -5,4 +24,4 @@
-
\ No newline at end of file
+
diff --git a/core/src/test/resources/zs_v1.xml b/core/src/test/resources/zs_v1.xml
index 98c8badc7..c952f87ac 100644
--- a/core/src/test/resources/zs_v1.xml
+++ b/core/src/test/resources/zs_v1.xml
@@ -1,3 +1,22 @@
+
@@ -7,4 +26,4 @@
-
\ No newline at end of file
+
diff --git a/gen.antlr-antlr/pom.xml b/gen.antlr-antlr/pom.xml
index 7104ed0c3..5fa9f8da3 100644
--- a/gen.antlr-antlr/pom.xml
+++ b/gen.antlr-antlr/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-antlr/src/main/java/com/github/gumtreediff/gen/antlrantlr/AntlrGrammarTreeGenerator.java b/gen.antlr-antlr/src/main/java/com/github/gumtreediff/gen/antlrantlr/AntlrGrammarTreeGenerator.java
index 86b560431..14a68cea3 100644
--- a/gen.antlr-antlr/src/main/java/com/github/gumtreediff/gen/antlrantlr/AntlrGrammarTreeGenerator.java
+++ b/gen.antlr-antlr/src/main/java/com/github/gumtreediff/gen/antlrantlr/AntlrGrammarTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.antlrantlr;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
diff --git a/gen.antlr-css/pom.xml b/gen.antlr-css/pom.xml
index 9b47493b1..c65e70498 100644
--- a/gen.antlr-css/pom.xml
+++ b/gen.antlr-css/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-css/src/main/java/com/github/gumtreediff/gen/antlrcss/CssGrammarTreeGenerator.java b/gen.antlr-css/src/main/java/com/github/gumtreediff/gen/antlrcss/CssGrammarTreeGenerator.java
index 879999dd6..38a058bec 100644
--- a/gen.antlr-css/src/main/java/com/github/gumtreediff/gen/antlrcss/CssGrammarTreeGenerator.java
+++ b/gen.antlr-css/src/main/java/com/github/gumtreediff/gen/antlrcss/CssGrammarTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.antlrcss;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
diff --git a/gen.antlr-css/src/test/java/BasicTestCss.java b/gen.antlr-css/src/test/java/BasicTestCss.java
index e7145603a..77a2f4d8b 100644
--- a/gen.antlr-css/src/test/java/BasicTestCss.java
+++ b/gen.antlr-css/src/test/java/BasicTestCss.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
import com.github.gumtreediff.gen.antlrcss.CssGrammarTreeGenerator;
import com.github.gumtreediff.tree.TreeContext;
import org.junit.Test;
diff --git a/gen.antlr-css/src/test/resources/simple.css b/gen.antlr-css/src/test/resources/simple.css
index 46ecfb3e0..7a97924a7 100644
--- a/gen.antlr-css/src/test/resources/simple.css
+++ b/gen.antlr-css/src/test/resources/simple.css
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
* {
font-family: Arial, Verdana, sans-serif;}
h1 {
diff --git a/gen.antlr-css/src/test/resources/trivial.css b/gen.antlr-css/src/test/resources/trivial.css
index 7ef9a0a99..1874a4f27 100644
--- a/gen.antlr-css/src/test/resources/trivial.css
+++ b/gen.antlr-css/src/test/resources/trivial.css
@@ -1 +1,21 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
h1 { color: red; }
\ No newline at end of file
diff --git a/gen.antlr-json/pom.xml b/gen.antlr-json/pom.xml
index 15b86d32c..829da50a7 100644
--- a/gen.antlr-json/pom.xml
+++ b/gen.antlr-json/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-json/src/main/java/com/github/gumtreediff/gen/antlrjson/AntlrJsonTreeGenerator.java b/gen.antlr-json/src/main/java/com/github/gumtreediff/gen/antlrjson/AntlrJsonTreeGenerator.java
index 19765ab31..0c15a3365 100644
--- a/gen.antlr-json/src/main/java/com/github/gumtreediff/gen/antlrjson/AntlrJsonTreeGenerator.java
+++ b/gen.antlr-json/src/main/java/com/github/gumtreediff/gen/antlrjson/AntlrJsonTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.antlrjson;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
diff --git a/gen.antlr-json/src/test/java/com/github/gumtreediff/gen/antlrjson/TestJsonParsing.java b/gen.antlr-json/src/test/java/com/github/gumtreediff/gen/antlrjson/TestJsonParsing.java
index 97fd9f92a..aa0b52b24 100644
--- a/gen.antlr-json/src/test/java/com/github/gumtreediff/gen/antlrjson/TestJsonParsing.java
+++ b/gen.antlr-json/src/test/java/com/github/gumtreediff/gen/antlrjson/TestJsonParsing.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.antlrjson;
import static org.junit.Assert.*;
diff --git a/gen.antlr-php/pom.xml b/gen.antlr-php/pom.xml
index 6829e7538..b0ca872e6 100644
--- a/gen.antlr-php/pom.xml
+++ b/gen.antlr-php/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-php/src/main/java/com/github/gumtreediff/gen/php/PhpTreeGenerator.java b/gen.antlr-php/src/main/java/com/github/gumtreediff/gen/php/PhpTreeGenerator.java
index d7600a3e4..bae7621b4 100644
--- a/gen.antlr-php/src/main/java/com/github/gumtreediff/gen/php/PhpTreeGenerator.java
+++ b/gen.antlr-php/src/main/java/com/github/gumtreediff/gen/php/PhpTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.php;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
diff --git a/gen.antlr-r/pom.xml b/gen.antlr-r/pom.xml
index 85adf5433..b50d8f4da 100644
--- a/gen.antlr-r/pom.xml
+++ b/gen.antlr-r/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-r/src/main/java/com/github/gumtreediff/gen/r/RTreeGenerator.java b/gen.antlr-r/src/main/java/com/github/gumtreediff/gen/r/RTreeGenerator.java
index 6028b6e68..1e915cafa 100644
--- a/gen.antlr-r/src/main/java/com/github/gumtreediff/gen/r/RTreeGenerator.java
+++ b/gen.antlr-r/src/main/java/com/github/gumtreediff/gen/r/RTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.r;
import com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator;
diff --git a/gen.antlr-r/src/test/java/com/github/gumtreediff/gen/r/TestRGenerator.java b/gen.antlr-r/src/test/java/com/github/gumtreediff/gen/r/TestRGenerator.java
index c72fd3b94..34cb1c217 100644
--- a/gen.antlr-r/src/test/java/com/github/gumtreediff/gen/r/TestRGenerator.java
+++ b/gen.antlr-r/src/test/java/com/github/gumtreediff/gen/r/TestRGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.r;
import java.io.IOException;
diff --git a/gen.antlr-xml/pom.xml b/gen.antlr-xml/pom.xml
index 91c598c70..2bce33229 100644
--- a/gen.antlr-xml/pom.xml
+++ b/gen.antlr-xml/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -30,4 +49,4 @@
-
+
\ No newline at end of file
diff --git a/gen.antlr-xml/src/main/java/com/github/gumtreediff/gen/xml/XmlTreeGenerator.java b/gen.antlr-xml/src/main/java/com/github/gumtreediff/gen/xml/XmlTreeGenerator.java
index c9587f76f..b57c20abd 100644
--- a/gen.antlr-xml/src/main/java/com/github/gumtreediff/gen/xml/XmlTreeGenerator.java
+++ b/gen.antlr-xml/src/main/java/com/github/gumtreediff/gen/xml/XmlTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.xml;
import com.github.gumtreediff.gen.Register;
diff --git a/gen.antlr/pom.xml b/gen.antlr/pom.xml
index 6d95564af..e98f45ac7 100644
--- a/gen.antlr/pom.xml
+++ b/gen.antlr/pom.xml
@@ -1,3 +1,22 @@
+
gumtree
@@ -19,4 +38,4 @@
3.5.2
-
+
\ No newline at end of file
diff --git a/gen.antlr/src/main/java/com/github/gumtreediff/gen/antlr/AbstractAntlrTreeGenerator.java b/gen.antlr/src/main/java/com/github/gumtreediff/gen/antlr/AbstractAntlrTreeGenerator.java
index a9560d493..4b894e8f0 100644
--- a/gen.antlr/src/main/java/com/github/gumtreediff/gen/antlr/AbstractAntlrTreeGenerator.java
+++ b/gen.antlr/src/main/java/com/github/gumtreediff/gen/antlr/AbstractAntlrTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.antlr;
import java.io.IOException;
diff --git a/gen.c/pom.xml b/gen.c/pom.xml
index af3b5840f..4035b54a3 100644
--- a/gen.c/pom.xml
+++ b/gen.c/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -16,5 +35,4 @@
compile
-
-
+
\ No newline at end of file
diff --git a/gen.c/src/main/java/com/github/gumtreediff/gen/c/CTreeGenerator.java b/gen.c/src/main/java/com/github/gumtreediff/gen/c/CTreeGenerator.java
index 8dd3a596d..33fab0ff5 100644
--- a/gen.c/src/main/java/com/github/gumtreediff/gen/c/CTreeGenerator.java
+++ b/gen.c/src/main/java/com/github/gumtreediff/gen/c/CTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.c;
import com.github.gumtreediff.gen.Register;
diff --git a/gen.c/src/test/java/com/github/gumtreediff/gen/c/TestCGenerator.java b/gen.c/src/test/java/com/github/gumtreediff/gen/c/TestCGenerator.java
index 0d219e746..4a7ac8765 100644
--- a/gen.c/src/test/java/com/github/gumtreediff/gen/c/TestCGenerator.java
+++ b/gen.c/src/test/java/com/github/gumtreediff/gen/c/TestCGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.c;
import java.io.IOException;
diff --git a/gen.jdt/pom.xml b/gen.jdt/pom.xml
index 02f8963b4..0f6880ae2 100644
--- a/gen.jdt/pom.xml
+++ b/gen.jdt/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -31,5 +50,4 @@
3.9.1.v20140825-1431
-
-
+
\ No newline at end of file
diff --git a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtTreeGenerator.java b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtTreeGenerator.java
index 5e54fe607..53ad81c92 100644
--- a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtTreeGenerator.java
+++ b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.jdt;
import com.github.gumtreediff.gen.TreeGenerator;
diff --git a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtVisitor.java b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtVisitor.java
index 3513943af..0bac2ef65 100644
--- a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtVisitor.java
+++ b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/AbstractJdtVisitor.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.jdt;
import java.util.ArrayDeque;
diff --git a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtTreeGenerator.java b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtTreeGenerator.java
index c1d8a46b4..ee9634412 100644
--- a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtTreeGenerator.java
+++ b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.jdt.cd;
import com.github.gumtreediff.gen.Register;
diff --git a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtVisitor.java b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtVisitor.java
index 94ea7af42..70d6ddd3d 100644
--- a/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtVisitor.java
+++ b/gen.jdt/src/main/java/com/github/gumtreediff/gen/jdt/cd/CdJdtVisitor.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.jdt.cd;
import java.util.List;
diff --git a/gen.jdt/src/test/java/com/github/gumtreediff/gen/jdt/TestJdtGenerator.java b/gen.jdt/src/test/java/com/github/gumtreediff/gen/jdt/TestJdtGenerator.java
index 5d685b70c..b372dc854 100644
--- a/gen.jdt/src/test/java/com/github/gumtreediff/gen/jdt/TestJdtGenerator.java
+++ b/gen.jdt/src/test/java/com/github/gumtreediff/gen/jdt/TestJdtGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.jdt;
import java.io.IOException;
diff --git a/gen.js/pom.xml b/gen.js/pom.xml
index 5fd5a5eb2..f10f11bc6 100644
--- a/gen.js/pom.xml
+++ b/gen.js/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -21,5 +40,4 @@
1.7R4
-
-
+
\ No newline at end of file
diff --git a/gen.js/src/main/java/com/github/gumtreediff/gen/js/RhinoTreeVisitor.java b/gen.js/src/main/java/com/github/gumtreediff/gen/js/RhinoTreeVisitor.java
index b9f302c88..21f74cf0c 100644
--- a/gen.js/src/main/java/com/github/gumtreediff/gen/js/RhinoTreeVisitor.java
+++ b/gen.js/src/main/java/com/github/gumtreediff/gen/js/RhinoTreeVisitor.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.js;
import java.util.HashMap;
diff --git a/gen.js/src/test/java/com/github/gumtreediff/gen/js/TestJsGenerator.java b/gen.js/src/test/java/com/github/gumtreediff/gen/js/TestJsGenerator.java
index 525e4b1b4..ea2fb7994 100644
--- a/gen.js/src/test/java/com/github/gumtreediff/gen/js/TestJsGenerator.java
+++ b/gen.js/src/test/java/com/github/gumtreediff/gen/js/TestJsGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.js;
import static org.junit.Assert.assertEquals;
diff --git a/gen.js/src/test/resources/sample.js b/gen.js/src/test/resources/sample.js
index e34f63b3a..05eccc917 100644
--- a/gen.js/src/test/resources/sample.js
+++ b/gen.js/src/test/resources/sample.js
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
currentMapping = 0;
if (typeof String.prototype.startsWith != 'function') {
diff --git a/gen.ruby/pom.xml b/gen.ruby/pom.xml
index c7bc82459..208390c9a 100644
--- a/gen.ruby/pom.xml
+++ b/gen.ruby/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -21,5 +40,4 @@
0.5.3
-
-
+
\ No newline at end of file
diff --git a/gen.ruby/src/test/java/com/github/gumtreediff/gen/ruby/TestRubyGenerator.java b/gen.ruby/src/test/java/com/github/gumtreediff/gen/ruby/TestRubyGenerator.java
index 35c7789c5..b081f822b 100644
--- a/gen.ruby/src/test/java/com/github/gumtreediff/gen/ruby/TestRubyGenerator.java
+++ b/gen.ruby/src/test/java/com/github/gumtreediff/gen/ruby/TestRubyGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.ruby;
import java.io.IOException;
diff --git a/gen.ruby/src/test/resources/sample.rb b/gen.ruby/src/test/resources/sample.rb
index d8d904e83..fb78c23a1 100644
--- a/gen.ruby/src/test/resources/sample.rb
+++ b/gen.ruby/src/test/resources/sample.rb
@@ -1,3 +1,22 @@
+#
+# This file is part of GumTree.
+#
+# GumTree is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GumTree is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with GumTree. If not, see .
+#
+# Copyright 2011-2015 Jean-Rémy Falleri
+# Copyright 2011-2015 Floréal Morandat
+#
require 'thor'
require 'fileutils'
@@ -324,4 +343,4 @@ def status
end
-end
+end
\ No newline at end of file
diff --git a/gen.sax/pom.xml b/gen.sax/pom.xml
index 7975e9ef1..4fa195438 100644
--- a/gen.sax/pom.xml
+++ b/gen.sax/pom.xml
@@ -1,3 +1,22 @@
+
4.0.0
@@ -20,5 +39,4 @@
2.4.0
-
-
+
\ No newline at end of file
diff --git a/gen.sax/src/main/java/com/github/gumtreediff/gen/sax/SaxTreeGenerator.java b/gen.sax/src/main/java/com/github/gumtreediff/gen/sax/SaxTreeGenerator.java
index 909b5ef70..6e9f58a73 100644
--- a/gen.sax/src/main/java/com/github/gumtreediff/gen/sax/SaxTreeGenerator.java
+++ b/gen.sax/src/main/java/com/github/gumtreediff/gen/sax/SaxTreeGenerator.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.sax;
import com.github.gumtreediff.gen.Register;
diff --git a/gen.sax/src/test/java/com/github/gumtreediff/gen/sax/TestParsing.java b/gen.sax/src/test/java/com/github/gumtreediff/gen/sax/TestParsing.java
index e0a967bf0..3b7955cdb 100644
--- a/gen.sax/src/test/java/com/github/gumtreediff/gen/sax/TestParsing.java
+++ b/gen.sax/src/test/java/com/github/gumtreediff/gen/sax/TestParsing.java
@@ -1,3 +1,23 @@
+/*
+ * This file is part of GumTree.
+ *
+ * GumTree is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GumTree is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with GumTree. If not, see .
+ *
+ * Copyright 2011-2015 Jean-Rémy Falleri
+ * Copyright 2011-2015 Floréal Morandat
+ */
+
package com.github.gumtreediff.gen.sax;
import com.github.gumtreediff.io.TreeIoUtils;
diff --git a/gen.sax/src/test/resources/Dummy_big.xml b/gen.sax/src/test/resources/Dummy_big.xml
index 9f31fe7c4..f920353e9 100644
--- a/gen.sax/src/test/resources/Dummy_big.xml
+++ b/gen.sax/src/test/resources/Dummy_big.xml
@@ -1,3 +1,22 @@
+
@@ -16,4 +35,4 @@
-
+
\ No newline at end of file
diff --git a/gen.sax/src/test/resources/Dummy_v0.xml b/gen.sax/src/test/resources/Dummy_v0.xml
index 7384ef51a..5678f6959 100644
--- a/gen.sax/src/test/resources/Dummy_v0.xml
+++ b/gen.sax/src/test/resources/Dummy_v0.xml
@@ -1,7 +1,26 @@
+
-
\ No newline at end of file
+
diff --git a/gen.sax/src/test/resources/Dummy_v1.xml b/gen.sax/src/test/resources/Dummy_v1.xml
index 24ea1a00b..d84034a30 100644
--- a/gen.sax/src/test/resources/Dummy_v1.xml
+++ b/gen.sax/src/test/resources/Dummy_v1.xml
@@ -1,3 +1,22 @@
+
diff --git a/gen.sax/src/test/resources/action_v0.xml b/gen.sax/src/test/resources/action_v0.xml
index e5d79cdd1..3095a2b64 100644
--- a/gen.sax/src/test/resources/action_v0.xml
+++ b/gen.sax/src/test/resources/action_v0.xml
@@ -1,3 +1,22 @@
+
@@ -7,4 +26,4 @@
-
\ No newline at end of file
+
diff --git a/gen.sax/src/test/resources/action_v1.xml b/gen.sax/src/test/resources/action_v1.xml
index 257d550ca..ef2e5e6eb 100644
--- a/gen.sax/src/test/resources/action_v1.xml
+++ b/gen.sax/src/test/resources/action_v1.xml
@@ -1,3 +1,22 @@
+