final PackageDescr packageDescr = parser.parse( reader );
if ( parser.hasErrors() ) {
fail( "Error messages in parser, need to sort this our (or else collect error messages)\n" + parser.getErrors() );
}
// pre build the package
JavaDialectConfiguration jconf = (JavaDialectConfiguration) conf.getDialectConfiguration( "java" );
// required because JANINO compiler fails for some java 5 code features
jconf.setCompiler( JavaDialectConfiguration.ECLIPSE );
final PackageBuilder builder = new PackageBuilder( conf );
builder.addPackage( packageDescr );
if ( builder.hasErrors() ) {
fail( builder.getErrors().toString() );
}