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
indexBuffer= -1;
					}
					whiteSpaceBuffer.setLength(0);
				
				} else {
					lineBuffer.append(whiteSpaceBuffer.toString());
					lineBuffer.append(word);
					whiteSpaceBuffer.setLength(0);
				}
			}
			if (index >= start && index < end) {
				indexBuffer= paragraphBuffer.length() + lineBuffer.length() + (index - start);
				if (word.trim().length() != 0)
					indexBuffer -= word.length();
			}
		}
				
		paragraphBuffer.append(lineBuffer.toString());
		paragraphBuffer.append(lineDelimiter);
		
		if (indexBuffer != -1)	
			offset[0]= indexBuffer;
		
		else if (offset[0] == paragraph.length())
			offset[0]= paragraphBuffer.length() - lineDelimiter.length();
			
		return paragraphBuffer.toString();
	}
	private static IPreferenceStore getPreferenceStore() {
		return JavaPlugin.getDefault().getPreferenceStore();