Bug 55968 [misc] segmented view does not work with new methods
i2004-03-24+plugin export - add a new method into a class by typing: public void test() {[enter] - the closing bracket is made automatically and the cursor is placed in the method - press "show source of selected element only" - observed behavior: the selected segment is the whole class rather than the method in which the cursor was
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
Position position= fPositions[i];
					
					
					try {
						message= document.get(position.offset, position.length);
					} catch (BadLocationException ex) {
						
						continue;
					}
					annotationMap.put(
							new Annotation("org.eclipse.jdt.ui.occurrences", false, message), 
							position);
				}
				
				if (isCancelled())
					return Status.CANCEL_STATUS;
				
				synchronized (annotationModel) {
					if (annotationModel instanceof IAnnotationModelExtension) {
						((IAnnotationModelExtension)annotationModel).replaceAnnotations(fOccurrenceAnnotations, annotationMap);
					} else {
						removeOccurrenceAnnotations();
						Iterator iter= annotationMap.entrySet().iterator();
						while (iter.hasNext()) {
							Map.Entry mapEntry= (Map.Entry)iter.next(); 
							annotationModel.addAnnotation((Annotation)mapEntry.getKey(), (Position)mapEntry.getValue());
						}
					}
					fOccurrenceAnnotations= (Annotation[])annotationMap.keySet().toArray(new Annotation[annotationMap.keySet().size()]);
				}