// add type declarations
for ( TypeDeclaration newDecl : newPkg.getTypeDeclarations().values() ) {
lastType = newDecl.getTypeClassName();
TypeDeclaration typeDeclaration = this.classTypeDeclaration.get( newDecl.getTypeClassName() );
if ( typeDeclaration == null ) {
String className = newDecl.getTypeClassName();
byte [] def = ((JavaDialectRuntimeData) newPkg.getDialectRuntimeRegistry().getDialectData( "java" )).getClassDefinition(
JavaDialectRuntimeData.convertClassToResourcePath( className )
);
Class<?> definedKlass = registerAndLoadTypeDefinition( className, def );
if ( definedKlass == null && typeDeclaration.isNovel() ) {
throw new RuntimeException( "Registering null bytes for class " + className );
}
newDecl.getTypeClassDef().setDefinedClass( definedKlass );
newDecl.setTypeClass( definedKlass );
this.classTypeDeclaration.put( className, newDecl );
typeDeclaration = newDecl;
} else {
Class<?> definedKlass = typeDeclaration.getTypeClass();
newDecl.getTypeClassDef().setDefinedClass( definedKlass );
newDecl.setTypeClass( definedKlass );
mergeTypeDeclarations( typeDeclaration,