Bug 50194 Indenting Java breaks comments
When correcting indentation (ctrl-I in my configuration), java comments are not properly preserved. My original code [1] is 'indented' to code [2], which is unexpected and syntactically incorrect. thanks PhF .. [1] try{ /* for(int i=0; i<8; i++){ System.out.println("something");} */ somethingElse(); .. [2] try{ /* */ for(int i=0; i<8; i++){ System.out.println("something");} */ somethingElse();
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java
if (end < c.offset) {
					if (d.getChar(end) == '/') {
						
						buf.append(" * "); 
						if (JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS) && isNewComment(d, c.offset, fPartitioning)) {
							String lineDelimiter= getLineDelimiter(d);
							c.doit= false;
							d.replace(c.offset, 0, lineDelimiter + indentation + " */"); 
							
							
							ICompilationUnit unit= getCompilationUnit();
							if (JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS) &&
								unit != null)
							{
								try {
									synchronized (unit) {
										unit.reconcile();
									}
									String string= createJavaDocTags(d, c, indentation, lineDelimiter, unit);
									if (string != null)
										d.replace(c.offset, 0, string);						
								} catch (CoreException e) {
									
								}
							}
						}						
					}
				}			
			}