Bug 84983 [typing] imports disappear
I20050209-0800 + JDT UI from HEAD 1. open a CU with several imports 2. enable folding (ensure imports are folded) 3. remove code so that first import is no longer needed 4. run Organize Imports ==> all imports are gone 5. close and re-open the editor ==> imports are back
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java
* @return the caption offset relative to the position offset
	 */
	private int computeCaptionOffset(Position position, IJavaElement element) {
		Assert.isNotNull(fCachedDocument); 
		if (element instanceof IMember) {
			try {
				ISourceRange nameRange= ((IMember) element).getNameRange();
				if (nameRange != null)
					return nameRange.getOffset() - position.getOffset();
			} catch (JavaModelException e) {
				
			}
		}
		
		return findFirstContent(new DocumentCharacterIterator(fCachedDocument, position.getOffset(), position.getOffset() + position.getLength()));
	}
	
	/**
	 * Finds the offset of the first identifier part within <code>content</code>.
	 * Returns 0 if none is found.
	 * 
	 * @param content the content to search
	 * @return the first index of a unicode identifier part, or zero if none can
	 *         be found
	 */
	private int findFirstContent(final CharSequence content) {
		int lenght= content.length();
		for (int i= 0; i < lenght; i++) {
			if (Character.isUnicodeIdentifierPart(content.charAt(i)))
				return i;