hello.
I'm using uimafit and lamdaj to update annotations:

                Iterable<Token> tokens = JCasUtil.select(jCas, Token.class);

                forEach(select(tokens, having(on(Token.class).getNormalForm(),
startsWith("#")))).setKind("HashTag");


This code trhows a runtine excpetion, because TOP has this deafult constructor:

        // This constructor is never called .
        // Have to set "final" values to avoid compile errors
        protected TOP() {
                jcasType = null;
                addr = 0;
                throw new RuntimeException("Internal Error: TOP() constructor 
should
never be called.");
        }


Lambdaj creates a dinamic proxy via reflection, so it calls TOP()  to
build the proxy for Token:

on(Token.class).


I can do the same thing in different ways, using plain java for each
or google collection/guava.
But lambdaj is very cool :)

Is it possible to avoid to throw the runtime exception?
Cheers,
RF
-- 
Roberto Franchini
L'impossibile รจ inevitabile.
http://www.celi.it
http://www.blogmeter.it
Tel +39.011.562.71.15
jabber:[email protected] skype:ro.franchini

Reply via email to