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
fEnd= fIterator.next();
			if (fEnd == BreakIterator.DONE)
				return fEnd;
			final String string= fString.substring(fStart, fEnd);
			
			if (string.trim().length() == 0)
				return fEnd;
			final String word= string.trim();
			if (word.length() == string.length())
				return fEnd;
			
			
			fBufferedEnd= fEnd;
			return fStart + word.length();
		}	
	}
	
	/**
	 * Formats a paragraph, using break iterator.  
	 * 
	 * @param offset an offset within the paragraph, which will be updated with respect to formatting.
	 */
	private static String formatParagraph(String paragraph, int[] offset, String prefix, String lineDelimiter, int margin) {
		LineBreakIterator iterator= new LineBreakIterator(paragraph);
		StringBuffer paragraphBuffer= new StringBuffer();
		StringBuffer lineBuffer= new StringBuffer();
		StringBuffer whiteSpaceBuffer= new StringBuffer();
		
		int index= offset[0];
		int indexBuffer= -1;