When the resulting expression type is not a base class,
"Introduce variable" should allow us to choose one of its superclasses, or interfaces,
as the type of the
variable introduced.
example :
com.sun.javadoc.ClassDoc &
com.sun.javadoc.MethodDoc
both implements tags() from the interface Doc.
Refactor line 4 & 5 to extract a common method,
1: final ClassDoc aClass = allClasses[ classIdx ];
2: final MethodDoc aMethod = aClass.methods()[0];
3:
4: final boolean ctagRefa = (0!=aClass .tags("refactor").length) ;
5: final boolean tagRefa = (0!=aMethod.tags("refactor").length) ;
to obtain :
4: final boolean ctagRefa = tagDetected (aClass ) ;
5: final boolean tagRefa = tagDetected (aMethod) ;
Problem:
"Introduce variable" will produce
3: final ClassDoc v = aClass;
4: final boolean ctagRefa = (0!=v .tags("refactor").length) ;
while I need
3: final Doc v = aClass;
--Alain Ravet
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features