Bug 85832 [projection] Folding: Select All doesn't correctly unfold header comment
Build I20050217-2000 (i.e. possible M5 candidate) To replicate: 1) make sure "code folding" preferences are at their default values (i.e. I am working in a fresh workspace with all preferences at defaults) 2) open a class, that has a header comment, in an editor (i.e. almost any eclipse class - make sure the header comment is folded) (the file I opened was PaintView in project org.eclipse.swt.examples.paint) 3) type ctrl+A to select all 4) type backspace to unfold the selection 5) notice that the topmost line in the file (the first header comment line) is not selected (in my file, this is the /********************** line) Another way to see this: - repeat steps 1 to 3 for another java file - now type ctrl+C to copy the selected text - paste it into a Windows Notepad or an email message, etc - notice that the first line of code is missing
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();