int nextOffset= next.getSourceRange().getOffset(); int nextLine= buffer.getLineOfOffset(nextOffset);
sourceRange= next.getSourceRange(); int nextOffset= sourceRange.getOffset(); int nextLength= sourceRange.getLength(); int nextOffsetLine= buffer.getLineOfOffset(nextOffset);
	private void addExistingImports(TextBuffer buffer, IImportDeclaration[] decls) throws JavaModelException {		if (decls.length == 0) {			return;		}						PackageEntry currPackage= null;					IImportDeclaration curr= decls[0];		int currOffset= curr.getSourceRange().getOffset();		int currLine= buffer.getLineOfOffset(currOffset);					for (int i= 1; i < decls.length; i++) {			String name= curr.getElementName();							String packName= Signature.getQualifier(name);			if (currPackage == null || !packName.equals(currPackage.getName())) {				currPackage= new PackageEntry(packName, -1);				fPackageEntries.add(currPackage);			}			IImportDeclaration next= decls[i];			int nextOffset= next.getSourceRange().getOffset();			int nextLine= buffer.getLineOfOffset(nextOffset);			// if next import is on a different line, modify the end position to the next line begin offset			if (currLine < nextLine) {				currLine++;				nextOffset= buffer.getLineInformation(currLine).getOffset();			}			currPackage.add(new ImportDeclEntry(name, buffer.getContent(currOffset, nextOffset - currOffset)));			currOffset= nextOffset;			curr= next;							// add a comment entry for spacing between imports			if (currLine < nextLine) {				nextOffset= buffer.getLineInformation(nextLine).getOffset();								currPackage= new PackageEntry(); // create a comment package entry for this				fPackageEntries.add(currPackage);				currPackage.add(new ImportDeclEntry(null, buffer.getContent(currOffset, nextOffset - currOffset)));									currLine= nextLine;				currOffset= nextOffset;			}		}		String name= curr.getElementName();		String packName= Signature.getQualifier(name);		if (currPackage == null || !packName.equals(currPackage.getName())) {			currPackage= new PackageEntry(packName, -1);			fPackageEntries.add(currPackage);		}		ISourceRange range= curr.getSourceRange();					int endOffset= range.getOffset() + range.getLength();		String content= buffer.getContent(currOffset, endOffset - currOffset) + buffer.getLineDelimiter();		currPackage.add(new ImportDeclEntry(name, content));	}		