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
lineContents= lineContents.substring(1).trim().toLowerCase();
		
		if (lineContents.length() == 0)
			return false;
		
		if (lineContents.startsWith("@")) 
			return false;
		
		if (lineContents.startsWith("<") && !isInlineTag(lineContents)) 
			return false;
		return true;
	}
	protected void jdocHandleBackspaceDelete(IDocument document, DocumentCommand c) {
		
		if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_FORMAT_JAVADOCS))
			return;
			
		try {
			String text= document.get(c.offset, c.length);
			int line= document.getLineOfOffset(c.offset);
			int lineOffset= document.getLineOffset(line);
			
			String lineDelimiter= document.getLineDelimiter(line);
			if (lineDelimiter != null && lineDelimiter.equals(text)) {
				
				String prefix= jdocExtractLinePrefix(document, line + 1);
				
				if (prefix.length() > 0) {
					int length= document.getLineDelimiter(line).length() + prefix.length();