final Map globals = pkg.getGlobals();
final Set imports = pkg.getImports();
// First update the binary files
// @todo: this probably has issues if you add classes in the incorrect order - functions, rules, invokers.
final PackageCompilationData compilationData = pkg.getPackageCompilationData();
final PackageCompilationData newCompilationData = newPkg.getPackageCompilationData();
final String[] files = newCompilationData.list();
for ( int i = 0, length = files.length; i < length; i++ ) {
compilationData.write( files[i],
newCompilationData.read( files[i] ) );
}
// Merge imports
imports.addAll( newPkg.getImports() );
// Add invokers
compilationData.putAllInvokers( newCompilationData.getInvokers() );
if ( compilationData.isDirty() ) {
if ( this.reloadPackageCompilationData == null ) {
this.reloadPackageCompilationData = new ReloadPackageCompilationData();
}