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
} catch (BadLocationException excp) {
			
		}
	}
	/**
	 * Guesses if the command operates within a newly created javadoc comment or not.
	 * If in doubt, it will assume that the javadoc is new.
	 */
	private static boolean isNewComment(IDocument document, int commandOffset, String partitioning) {
		try {
			int lineIndex= document.getLineOfOffset(commandOffset) + 1;
			if (lineIndex >= document.getNumberOfLines())
				return true;
			IRegion line= document.getLineInformation(lineIndex);
			ITypedRegion partition= TextUtilities.getPartition(document, partitioning, commandOffset);
			if (document.getLineOffset(lineIndex) >= partition.getOffset() + partition.getLength())
				return false;
			String string= document.get(line.getOffset(), line.getLength());				
			if (!string.trim().startsWith("*")) 
				return true;
			
			return false;
			
		} catch (BadLocationException e) {
			return false;
		}			
	}
	
	private boolean isSmartMode() {
		IWorkbenchPage page= JavaPlugin.getActivePage();