user1209216
user1209216

Reputation: 7984

Android LambdaJ - unable to use, exception on every call

I'm using lambdaj 2.4 with dependencies. My code (very simple):

 List<Person> persons = Arrays.asList(
                    new Person(13,"Steve",22,"London, UK"),
                    new Person(25,"Greg",28,"New York, USA"),
                    new Person(5,"Emily",22,"Bali, Indonesia"),
                    new Person(9,"Malih",14,"Jakarta, Indonesia"));

            List<String> personNames = extract(persons, on(Person.class).getName());
            System.out.println("personNames: "+personNames);

But it does not work, exception is:

 java.lang.ExceptionInInitializerError
            at ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
            at ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
            at ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory.java:68)

Any ideas how to make it working on Android?

Upvotes: 2

Views: 564

Answers (1)

John McClean
John McClean

Reputation: 5313

If you have the choice, you should consider using Retro Lambda. It's a backport of the full Java 8 Lambda Expression syntax for JDK 6 & 7 - and offers full, real closures (LambdaJ was pretty good alternative in the absence of language level support).

Upvotes: 2

Related Questions