How about a refactoring that replaces a string with a constant? It would not
only replace the currently hilighted string, but would replace all strings in
the class, package or project with the constant.

E.g.:

  print( "goodbye, worl|d" );
  assertEquals( output, "goodbye, world" );

--> menu:

  Refactor | Replace String With Constant

--> dialog:

  Constant name: [ GOODBYE      ]

  "goodbye, world" was found in 3 classes in 2 packages. Replace in:

  (o) Project (public constant)
  ( ) Package (package constant)
  ( ) Class and subclasses (protected constant)
  ( ) Class (private constant)

--> code:

  public static final String GOODBYE = "goodbye, world";
  ...
  print( GOODBYE );
  assertEquals( output, GOODBYE );


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to