Bug 85549 [projection] Incorrect folding in CU without terminating linebreak
I20050215-2300 - Have a CU with contents "package copying; public class Class { }" (no linebreak here) - collapse class folding -> a "}" remains on the last line. Expected: last line is empty - set caret to end of text and press Enter -> after reconciling, there are two boxes with dots. Expected: only one box. => Folding at the end of file is only correct if the file ends with at least two empty lines.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java
return null;
		int start= 0;
		int end= range.getOffset();
		
		if (fInput instanceof ISourceReference) {
			String content;
			try {
				content= fCachedDocument.get(start, end - start);
			} catch (BadLocationException e) {
				return null; 
			}
			
			/* code adapted from CommentFormattingStrategy:
			 * scan the header content up to the first type. Once a comment is
			 * found, accumulate any additional comments up to the stop condition.
			 * The stop condition is reaching a package declaration, import container,
			 * or the end of the input.
			 */
			IScanner scanner= ToolFactory.createScanner(true, false, false, false);
			scanner.setSource(content.toCharArray());
			int headerStart= -1;
			int headerEnd= -1;
			try {
				boolean foundComment= false;
				int terminal= scanner.getNextToken();
				while (terminal != ITerminalSymbols.TokenNameEOF && !(terminal == ITerminalSymbols.TokenNameclass || terminal == ITerminalSymbols.TokenNameinterface || terminal == ITerminalSymbols.TokenNameenum || (foundComment && (terminal == ITerminalSymbols.TokenNameimport || terminal == ITerminalSymbols.TokenNamepackage)))) {
					
					if (terminal == ITerminalSymbols.TokenNameCOMMENT_JAVADOC || terminal == ITerminalSymbols.TokenNameCOMMENT_BLOCK || terminal == ITerminalSymbols.TokenNameCOMMENT_LINE) {
						if (!foundComment)
							headerStart= scanner.getCurrentTokenStartPosition();