how can I remove generic type from class using refactoring

oshai :

I have this class:

public class TimeIntCo<T> extends TimeValueCo<Integer>
{

}

I decided that the T type is not needed anymore, and it is not used in the class (I know it is always Integer).
However, I have a lot of references for the class that looks like TimeIntCo<Integer>.
Is there a way using Eclipse refactoring to remove the T type without causing any error in references?
I mean to do it in one step and not find&replace.

EDIT: to be more clear - if I just remove T from class I have about 10,000 errors, I don't want to do it manually, and I prefer not to use find&replace because I consider refactor safer.

Stephen C :

I doubt that there is a refactor for this. Just delete the <T>, save the file, and go through and fix any compilation errors that might result. (If the T type parameter is not used, there shouldn't be any compilation errors to correct ...)


@ohadshai comments:

then I have about 10,000 errors in eclipse...

I bet that most of them can be fixed by changing a small number of subclass declarations.

Do you know any other IDE that does that? IDEA?

No I don't. Refactors are generally used for simple transformations that preserve the meaning of the original source code. This transformation is unlikely to do that.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I use "typeof" to get the type from a generic class?

How can I remove a list from another list using a field value of the element's type if i can't modify the class directly?

How can I construct a generic type using properties from another type

can I get .class from generic type argument?

How can I obtain the type parameter of a generic interface from an implementing class?

How can I remove a class using jQuery

How can I add/remove class using $this

How can I know both class are from same Generic class

How can I learn actual type argument of an generic class?

Java: how do I get a class literal from a generic type?

How do I get the `.class` attribute from a generic type parameter?

How do I get the `.class` attribute from a generic type parameter?

How can I return a class instance with a generic type as an interface with a generic type?

Can I return a different type from a function in a generic class depending on if the generic type used for the class is a value or a reference type?

How can I register a nested generic type using Simple Injector?

How can I return a generic type from a member function in Rust

How can i pass generic type from view to controller

How can I access a method of a class from a generic method

How can I return a generic class from a method?

How can I use the same generic type in multiple methods in a non-generic static class

Can't access properties of the base class of the class I am using as the type argument in a generic method

How can I remove the Class Label from the detected object using TensorFlow

How can I remove a class from the span nearest span using jQuery?

How can i remove a class from div using click events on specific elements?

Can I use type as value (or correctly infer generic class type from constructor parameter)?

How can I properly type a subclass of class which sub-types a Generic base class?

How to infer class from generic type in Java?

How to get (generic) type from class object

How can I remove the event listener from a class method