Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to handle one case of ExplicitConversion #97

Open
jianguda opened this issue May 17, 2019 · 3 comments
Open

not able to handle one case of ExplicitConversion #97

jianguda opened this issue May 17, 2019 · 3 comments

Comments

@jianguda
Copy link

For example, run this

@Test
public void testExplicitConversion() throws Exception {
    AstComparator comparator = new AstComparator();
    String a = "class Foo{public void bar(){\ndouble b = 0;\n}}";
    String b = "class Foo{public void bar(){\ndouble b = (double) 0;\n}}";
    Diff diff = comparator.compare(a, b);
    List<Operation> operations = diff.getRootOperations();
    for (Operation operation : operations) {
        System.out.println(operation);
        System.out.println("================");
    }
    a = "class Foo{public void bar(){\nint a = 1;\ndouble b = a;\n}}";
    b = "class Foo{public void bar(){\nint a = 1;\ndouble b = (double) a;\n}}";
    diff = comparator.compare(a, b);
    operations = diff.getRootOperations();
    for (Operation operation : operations) {
        System.out.println(operation);
        System.out.println("================");
    }
}

and we only get

Update Literal at Foo:2
	0 to ((double) (0))

================

I also tried the webdiff tool from gumtree and did not meet this issue.

@jianguda jianguda changed the title gumtree-spoon can not handle one case of ExplicitConversion not able to handle one case of ExplicitConversion May 17, 2019
@monperrus
Copy link
Contributor

Thanks Jian for the bug report. Could you try to make a fix in a pull request?

@jianguda
Copy link
Author

I am going to handle this in Summer

@monperrus
Copy link
Contributor

great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants