if (decls.isEmpty()) {
return;
}
PackageEntry currPackage= null;
ImportDeclaration curr= (ImportDeclaration) decls.get(0);
int currOffset= curr.getStartPosition();
int currLength= curr.getLength();
int currEndLine= root.getLineNumber(currOffset + currLength);
for (int i= 1; i < decls.size(); i++) {
boolean isStatic= curr.isStatic();
String name= getFullName(curr);
String packName= getQualifier(curr);
if (currPackage == null || currPackage.compareTo(packName, isStatic) != 0) {
currPackage= new PackageEntry(packName, null, isStatic);
this.packageEntries.add(currPackage);
}
ImportDeclaration next= (ImportDeclaration) decls.get(i);
int nextOffset= next.getStartPosition();
int nextLength= next.getLength();
int nextOffsetLine= root.getLineNumber(nextOffset);
// if next import is on a different line, modify the end position to the next line begin offset
if (currEndLine < nextOffsetLine) {
currEndLine++;