Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfaller committed Oct 4, 2017
1 parent ecb9b66 commit 25ffa28
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 24 deletions.
2 changes: 1 addition & 1 deletion client.diff/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description = 'GumTree diff client'

dependencies {
compile project(':client')
compile 'com.sparkjava:spark-core:2.5.2'
compile 'com.sparkjava:spark-core:2.6.0'
// exclude servlet-api 2.0 because it causes a bug with spark-core
compile('org.rendersnake:rendersnake:1.9.0') {
exclude group: 'javax.servlet', module: 'servlet-api'
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*
* Copyright 2017 Jean-Rémy Falleri <jr.falleri@gmail.com>
*/

package com.github.gumtreediff.client.diff;

import com.github.gumtreediff.actions.ActionClusterFinder;
Expand Down Expand Up @@ -25,7 +44,7 @@ public void run() {
g.generate();
List<Action> actions = g.getActions();
ActionClusterFinder f = new ActionClusterFinder(getSrcTreeContext(), getDstTreeContext(), actions);
for(Set<Action> cluster: f.getClusters()) {
for (Set<Action> cluster: f.getClusters()) {
System.out.println("New cluster:");
System.out.println(f.getClusterLabel(cluster));
System.out.println("------------");
Expand Down
2 changes: 1 addition & 1 deletion client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description = 'GumTree abstract client module.'

dependencies {
compile 'org.reflections:reflections:0.9.10'
compile 'org.reflections:reflections:0.9.11'
}
5 changes: 3 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ description = 'GumTree core module.'
dependencies {
compile 'com.github.mpkorstanje:simmetrics-core:3.2.3'
compile 'net.sf.trove4j:trove4j:3.0.3'
compile 'com.google.code.gson:gson:2.4'
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '1.0.1'
compile 'com.google.code.gson:gson:2.8.2'
compile 'org.jgrapht:jgrapht-core:1.0.1'
}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*
* Copyright 2017 Jean-Rémy Falleri <jr.falleri@gmail.com>
*/

package com.github.gumtreediff.actions;

import com.github.gumtreediff.actions.model.*;
Expand Down Expand Up @@ -37,8 +56,8 @@ public ActionClusterFinder(TreeContext src, TreeContext dst, List<Action> action
for (Action a1: actions) {
for (Action a2: actions) {
if (a1 != a2) {
if (embeddedInserts(a1, a2) || sameValueUpdates(a1, a2) ||
sameParentMoves(a1, a2) || embeddedDeletes(a1, a2))
if (embeddedInserts(a1, a2) || sameValueUpdates(a1, a2)
|| sameParentMoves(a1, a2) || embeddedDeletes(a1, a2))
graph.addEdge(a1, a2);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public boolean hasChanged(String s1, String s2) throws IOException {
if (l1 != l2) return true;
else {
try (DataInputStream dis1 = new DataInputStream(new FileInputStream(f1));
DataInputStream dis2 = new DataInputStream(new FileInputStream(f2))) {
DataInputStream dis2 = new DataInputStream(new FileInputStream(f2))) {
int c1, c2;
while ((c1 = dis1.read()) != -1) {
c2 = dis2.read();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ private void lastChanceMatch(ITree src, ITree dst) {
}

for (int t: srcKinds.keySet())
if (dstKinds.get(t) != null && srcKinds.get(t).size() == dstKinds.get(t).size() && srcKinds.get(t).size() == 1)
if (dstKinds.get(t) != null && srcKinds.get(t).size() == dstKinds.get(t).size()
&& srcKinds.get(t).size() == 1)
addMapping(srcKinds.get(t).get(0), dstKinds.get(t).get(0));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public void match() {
for (ITree currentSrcTree: this.src.postOrder()) {
int numberOfLeaves = numberOfLeaves(currentSrcTree);
for (ITree currentDstTree: dstTrees) {
if (isMappingAllowed(currentSrcTree, currentDstTree) && !(currentSrcTree.isLeaf() || currentDstTree.isLeaf())) {
if (isMappingAllowed(currentSrcTree, currentDstTree)
&& !(currentSrcTree.isLeaf() || currentDstTree.isLeaf())) {
double similarity = chawatheSimilarity(currentSrcTree, currentDstTree);
if ((numberOfLeaves > 4 && similarity >= STRUCT_SIM_THRESHOLD_1) || (numberOfLeaves <= 4 && similarity >= STRUCT_SIM_THRESHOLD_2)) {
if ((numberOfLeaves > 4 && similarity >= STRUCT_SIM_THRESHOLD_1)
|| (numberOfLeaves <= 4 && similarity >= STRUCT_SIM_THRESHOLD_2)) {
addMapping(currentSrcTree, currentDstTree);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public void match() {
Collections.sort(leavesMappings, new LeafMappingComparator());
while (leavesMappings.size() > 0) {
Mapping bestMapping = leavesMappings.remove(0);
if (!(ignoredSrcTrees.contains(bestMapping.getFirst()) || ignoredDstTrees.contains(bestMapping.getSecond()))) {
if (!(ignoredSrcTrees.contains(bestMapping.getFirst())
|| ignoredDstTrees.contains(bestMapping.getSecond()))) {
addMapping(bestMapping.getFirst(),bestMapping.getSecond());
ignoredSrcTrees.add(bestMapping.getFirst());
ignoredDstTrees.add(bestMapping.getSecond());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.github.gumtreediff.gen.antlr3.AbstractAntlr3TreeGenerator;
import org.antlr.runtime.*;


@Register(id = "json-antlr", accept = "\\.json$")
public class AntlrJsonTreeGenerator extends AbstractAntlr3TreeGenerator<JSONLexer, JSONParser> {

Expand Down
3 changes: 1 addition & 2 deletions gen.css/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
description = 'GumTree tree generator for CSS code based on ph-css.'

dependencies {
compile 'org.jruby:jrubyparser:0.5.3'
compile 'com.helger:ph-css:5.0.1'
compile 'com.helger:ph-css:6.0.0-b1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public TreeContext generate(Reader r) throws IOException {
p.setCustomErrorHandler(null);
p.setBrowserCompliantMode(false);
try {
CascadingStyleSheet sheet = CSSHandler.readCascadingStyleSheetFromNode(ECSSVersion.LATEST, p.styleSheet());
CascadingStyleSheet sheet = CSSHandler.readCascadingStyleSheetFromNode(ECSSVersion.LATEST,
p.styleSheet(), CSSReader.getDefaultInterpretErrorHandler());
GtCssVisitor v = new GtCssVisitor(sheet, lr);
CSSVisitor.visitCSS(sheet, v);
return v.getTreeContext();
Expand Down
6 changes: 3 additions & 3 deletions gen.jdt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description = 'GumTree tree generator for Java code (Eclipse JDT based).'

dependencies {
compile 'org.eclipse.tycho:org.eclipse.jdt.core:3.11.0.v20150602-1242'
compile 'org.eclipse.core:runtime:3.10.0-v20140318-2214'
compile 'org.eclipse.birt.runtime:org.eclipse.core.resources:3.10.0.v20150423-0755'
compile group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.12.3'
// compile 'org.eclipse.core:runtime:3.10.0-v20140318-2214'
// compile 'org.eclipse.birt.runtime:org.eclipse.core.resources:3.10.0.v20150423-0755'
}
2 changes: 1 addition & 1 deletion gen.js/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description = 'GumTree tree generator for JavaScript code (Rhino based).'

dependencies {
compile 'org.mozilla:rhino:1.7.7'
compile 'org.mozilla:rhino:1.7.7.2'
}
4 changes: 0 additions & 4 deletions gumtree_checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="LeftCurly">
<property name="maxLineLength" value="100"/>
</module>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
Expand Down

0 comments on commit 25ffa28

Please sign in to comment.