Map<String, Declaration> decls = context.getDeclarationResolver().getDeclarations(context.getRule());
MVELAnalysisResult analysis = ( MVELAnalysisResult) dialect.analyzeExpression( context,
context.getRuleDescr(),
(String) context.getRuleDescr().getSalience(),
new BoundIdentifiers(context.getDeclarationResolver().getDeclarationClasses( decls ),
context.getPackageBuilder().getGlobals() ) );
context.setTypesafe( analysis.isTypesafe() );
final BoundIdentifiers usedIdentifiers = analysis.getBoundIdentifiers();
int i = usedIdentifiers.getDeclrClasses().keySet().size();
Declaration[] previousDeclarations = new Declaration[i];
i = 0;
for ( String id : usedIdentifiers.getDeclrClasses().keySet() ) {
previousDeclarations[i++] = decls.get( id );
}
Arrays.sort( previousDeclarations, SortDeclarations.instance );
MVELCompilationUnit unit = dialect.getMVELCompilationUnit( (String) context.getRuleDescr().getSalience(),