I set some annotations for the class and comments on the same line as the annotations, such as:
@SampleAnnotation
@AnotherAnnotation
public class SampleClass { }
However, every time I format a file, my comment on one line ends up moving to the next line . Not only is this undesirable because it moves my comment, but even worse it puts the comment in a confusing place. The above sample becomes:
@SampleAnnotation
@AnotherAnnotation
public class SampleClass { }
How to stop Eclipse from moving these comments after formatting? Or, how do I get Eclipse to move comments to the line above rather than the line below? Thanks.
source
share