AutoRefactor icon indicating copy to clipboard operation
AutoRefactor copied to clipboard

New refactoring - Remove unneeded type parameters

Open JnRouvignac opened this issue 9 years ago • 2 comments

Given

The following code:

    public String removeThisAndUselessTypeParameter() {
        return this.<Class> notGenericMethod();
    }

    private String notGenericMethod() {
        return null;
    }

When

...automated refactorings are applied...

Then

Code should be refactored to:

    public String removeThisAndUselessTypeParameter() {
        return this.notGenericMethod();
    }

    private String notGenericMethod() {
        return null;
    }

JnRouvignac avatar Mar 16 '16 13:03 JnRouvignac

This should work with one or several uneeded type parameters. This should also work with method invocation, super method invocation, ... (others?)

JnRouvignac avatar Mar 16 '16 13:03 JnRouvignac

See commit 1ec7b78850a9dc9213f539a69e497be1b273f5cb for an inspiration on the JDT APIs to use to solve this bug.

JnRouvignac avatar Mar 18 '16 22:03 JnRouvignac