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/actions/IndentAction.java
IRegion previousLine= document.getLineInformation(line - 1);
					start= previousLine.getOffset() + previousLine.getLength();
				}
				DocumentCommand command= new DocumentCommand() {};
				command.text= "\n"; 
				command.offset= start;
				new JavaDocAutoIndentStrategy(IJavaPartitions.JAVA_PARTITIONING).customizeDocumentCommand(document, command);
				int i= command.text.indexOf('*');
				if (i != -1)
					indent= command.text.substring(1, i);
				else
					indent= command.text.substring(1);
			}
		} 
		
		
		if (indent == null) {
			StringBuffer computed= indenter.computeIndentation(offset);
			if (computed != null)
				indent= computed.toString();
			else
				indent= new String();
		}
		
		
		
		int lineLength= currentLine.getLength();
		int end= scanner.findNonWhitespaceForwardInAnyPartition(offset, offset + lineLength);
		if (end == JavaHeuristicScanner.NOT_FOUND)
			end= offset + lineLength;