Bug 5295 Segmented view misses field comment
Build 20011025 1. Create the following CU: X.java ------ public class X { String s1 = "s1"; //comment for s1 } 2. Make sure that 'Show Source of Selected Element Only' is selected 3. In the Outline, select field 's1' Observe: The comment doesn't appear near the field declaration.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaParseTreeBuilder.java
private JavaNode getCurrentContainer() {
		return (JavaNode) fStack.peek();
	}
	
	/**
	 * Adds a new JavaNode with the given type and name to the current container.
	 */
	private void push(int type, String name, int declarationStart) {
						
		while (declarationStart > 0) {
			char c= fBuffer[declarationStart-1];
			if (c != ' ' && c != '\t')
				break;
			declarationStart--;
		}
					
		fStack.push(new JavaNode(getCurrentContainer(), type, name, declarationStart, 0));
	}
	
	/**
	 * Closes the current Java node by setting its end position
	 * and pops it off the stack.
	 */
	private void pop(int declarationEnd) {
		
		JavaNode current= getCurrentContainer();
		if (current.getTypeCode() == JavaNode.CU)
			current.setAppendPosition(declarationEnd+1);
		else
			current.setAppendPosition(declarationEnd);