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

bug getExecutable() in noclasspath #405

Closed
monperrus opened this issue Nov 11, 2015 · 2 comments
Closed

bug getExecutable() in noclasspath #405

monperrus opened this issue Nov 11, 2015 · 2 comments

Comments

@monperrus
Copy link
Collaborator

The following processor run on the attached file highlights two bugs in getExecutable() of constructor calls.

    @Test
    public void test() {
        Launcher l = new Launcher();
        l.getEnvironment().setNoClasspath(true);
        l.addInputResource("/tmp/CmiContext_1.2.java");
        l.addProcessor(new AbstractProcessor<CtConstructorCall>() {

            @Override
            public void process(CtConstructorCall arg0) {
                if (arg0.getExecutable() == null) {
                    System.err.println("null bug "+arg0.toString());
                } else  if (!arg0.getExecutable().getType().getSimpleName().equals(arg0.getType().getSimpleName())) {
                    System.err.println("inconsistency bug "+arg0.toString());
                    System.err.println("-- "+arg0.getType().getSimpleName()+ " "+arg0.getExecutable().getType().getSimpleName());
                }
            }
        });
        l.run();
    }

Output:

inconsistency bug new UnicastJNDIReferenceWrapper(((javax.naming.Referenceable)(o)).getReference() , getObjectPort())
-- UnicastJNDIReferenceWrapper Object

inconsistency bug new UnicastJNDIReferenceWrapper(((javax.naming.Reference)(o)) , getObjectPort())
-- UnicastJNDIReferenceWrapper Object

[CmiContext_1.2.java.txt](https://github.com/INRIA/spoon/files/32087/CmiContext_1.2.java.txt)
null bug new JNDIResourceWrapper(((java.io.Serializable)(o)))
@GerardPaligot
Copy link
Contributor

Where can we find the "attached file"?

@monperrus
Copy link
Collaborator Author

Here it is.
CmiContext_1.2.java.txt

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