2

I'm working on some Java code in Eclipse which has comment style as follows:

//-------------------------------------------------------------
// Useful method
//-------------------------------------------------------------
public void usefulMethod()

I want to convert the comments to Javadoc, e.g.

/**
 * Useful method
 */
public void usefulMethod()

What's the best way to do this? Does Eclipse have some auto-magic to help? Since I use the same comment style inside methods (and want to keep it that way), naive find-replace won't work here.

Tim Bellis
  • 1,607
  • 3
  • 14
  • 24

1 Answers1

0

Mark the whole // commented lines. Then press [strg]+[F] and use "replace all" // with * . It will only be done in the marked sequence of code. Then change the first lint to /** and last line to */

this is just a work around, but very easy and save to use.

Simulant
  • 19,190
  • 8
  • 63
  • 98
  • Thanks, but I don't think that will work: 1) As I said above, I use the same comment style within methods, and don't want those comments changed. 2) I have 100s of these comments; so it would be tedious to do the manual change at the end. – Tim Bellis Jul 12 '12 at 16:03