How to change Java comments template?

10,717

Solution 1

This has been pissing me off for some time until I finally found the solution. He mentions this is work around, it does not matter for me - it works like a charm. Don't forget to plus him, he is life savior!

Solution 2

I have option Blank line before Javadoc tags in preference->Java->Code style->Formater, click on Edit button, open Comments tab and look at Javadoc comment settings. May be it helps you.

Share:
10,717
WoooHaaaa
Author by

WoooHaaaa

Updated on June 04, 2022

Comments

  • WoooHaaaa
    WoooHaaaa almost 2 years

    I use /** + ENTER to generate javadoc, but i found there's a whitespace before line 3:

    1 /**
    2 * Test.
    3 * 
    4 * @author xxx
    5 */
    

    Every time i try "source - format" in eclipse,the white space comes out. How can i remove this whitespace in the comments template somewhere ?

    • Yahor10
      Yahor10 about 12 years
      Did you try preference->java->Code Style->Code Templates.And edit your template?
    • WoooHaaaa
      WoooHaaaa about 12 years
      I have tried it already, but i didn't find any thing can solve the problem since there's no option about whitespace in comment settings.
    • mgibsonbr
      mgibsonbr over 11 years
  • WoooHaaaa
    WoooHaaaa about 12 years
    Thanks,but i need the blank line without a whitespace before it(Check my code you will find a whitespace after * in line 3).
  • Manoj Govindan
    Manoj Govindan about 12 years
    The work around mentioned in stackoverflow.com/a/7727232/1108032 doesn't work if you right click on a package and execute the Format action.
  • F.O.O
    F.O.O over 8 years
    Include answer in case link is broken.
  • Boris Strandjev
    Boris Strandjev over 8 years
    @F.O.O This is link directlly to Stackoverflow - chances are that my answer will get deleted before the one i link to. Furthermore I deliberately link without including the answer contents - thus the updates there will immediately be reflected in my answer too, you see :)
  • F.O.O
    F.O.O over 8 years
    I did think this was to an external site :D. sorry.
  • Sam Ginrich
    Sam Ginrich almost 3 years
    Which is the actual solution. @stackoverflow: Plz provide concepts against voting mobs.