IProgramElement pkgNode = asm.getHierarchy().findElementForLabel(binaries, IProgramElement.Kind.PACKAGE, packagename);
// note packages themselves have no source location
if (pkgNode == null) {
pkgNode = new ProgramElement(asm, packagename, IProgramElement.Kind.PACKAGE, new ArrayList<IProgramElement>());
binaries.addChild(pkgNode);
pkgNode.addChild(classFileNode);
} else {
// need to add it first otherwise the handle for classFileNode
// may not be generated correctly if it uses information from
// it's parent node
pkgNode.addChild(classFileNode);