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
additions.put(newAnnotation, newPosition);
					
				} else {
					Iterator x= annotations.iterator();
					boolean matched= false;
					while (x.hasNext()) {
						Tuple tuple= (Tuple) x.next();
						JavaProjectionAnnotation existingAnnotation= tuple.annotation;
						Position existingPosition= tuple.position;
						if (newAnnotation.isComment() == existingAnnotation.isComment()) {
							if (existingPosition != null && (!newPosition.equals(existingPosition) || existingAnnotation.getCaptionOffset() != newAnnotation.getCaptionOffset())) {
								existingPosition.setOffset(newPosition.getOffset());
								existingPosition.setLength(newPosition.getLength());
								existingAnnotation.setCaptionOffset(newAnnotation.getCaptionOffset());
								updates.add(existingAnnotation);
							}
							matched= true;
							x.remove();
							break;
						}
					}
					if (!matched)
						additions.put(newAnnotation, newPosition);
										
					if (annotations.isEmpty())
						previous.remove(element);
				}
			}
			
			e= previous.values().iterator();