|
|
Quick menus for source and refactoring actions |
The refactoring and source commands can be accessed via a quick menu. Select the element to be manipulated in the Java editor or in a Java view and press Alt+Shift+S for the quick source menu or Alt+Shift+T for the quick refactor menu. |
|
|
Refactorings update references in Javadocs | Rename, Move, and Change Method Signature refactorings now update
references in Javadoc comments too. This includes references in @see
and @link tags, as well as @param and @throws
clauses.
The Rename dialog has been simplified as a consequence: The old option Update references in Javadoc comments has been folded into Update references. The old options Update references in regular comments and Update references in string literals have been merged into Update textual matches in comments and strings. |
|
|
Generalize Type refactoring | Select a declaration of a variable, parameter, field, or method return
type in a Java editor and choose Refactoring > Generalize Type.
The wizard shows the supertype hierarchy for the variable. Selecting one of the available types updates the declaration. |
|
|
Introduce Factory refactoring | Select a constructor declaration or call in the Java editor and choose
Refactoring > Introduce Factory.
A static factory method is created that calls the now-private constructor, and all calls to the given constructor are replaced with calls to the new factory method. |
|
|
Introduce Parameter refactoring | Select an expression in a Java editor and choose Refactoring > Introduce Parameter. The containing method is given a new parameter and the selected expression is copied to the argument list of all the call sites. |
|
|
Improved Change Method Signature refactoring | In the Java editor, select a method and choose Refactoring >
Change Method Signature.
The refactoring now
Furthermore, editing in the parameters table has been streamlined such that you can use standard navigation keys (Tab, Shift+Tab, Arrow Up & Down). Editing can be started by clicking into a cell, or pressing F2 or Enter. |
|
|
Extract Method from inner types |
For Java code contained in an anonymous, local, or non-static member type, the Extract Method refactoring now allows the new method to be created in an outer type. |
|
|
Extract method finds duplicate code fragments |
Extract method now finds duplicate code fragments and helps extracting them into the new method as well. For example, when extracting the expression foo(a) + bar(b) from the snippet: the resulting code is: |
|