8bitme / lambdaj

Automatically exported from code.google.com/p/lambdaj
Apache License 2.0
0 stars 0 forks source link

Simple extract causes “Unable to convert placeholder null” #85

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create SimplePojo with public fields
2. Call extract(listOfPojos, on(SimplePojo.class).myPublicField)
3. Get exception

What is the expected output? What do you see instead?

I'm expecting a list of strings extracted from my pojo list. Instead I get:

Exception in thread "main" 
ch.lambdaj.function.argument.ArgumentConversionException: Unable to convert the 
placeholder null in a valid argument
at 
ch.lambdaj.function.argument.ArgumentsFactory.actualArgument(ArgumentsFactory.ja
va:76)
at 
ch.lambdaj.function.convert.ArgumentConverter.<init>(ArgumentConverter.java:29)
at ch.lambdaj.Lambda.extract(Lambda.java:1035)
at UserIdTest.getSsnList(UserIdTest.java:23)
at UserIdTest.main(UserIdTest.java:20)

(in the above, UserIdTest is simple class that calls getSsnList on a list of 
UserId pojos that have a field ssn (String).

What version of the product are you using? On what operating system?

Lambdaj 2.3.3. Ubuntu 11.10.

Please provide any additional information below.

Complete code example here: 
http://stackoverflow.com/questions/9292051/simple-extract-with-lambdaj-causes-un
able-to-convert-placeholder-null

Original issue reported on code.google.com by janne.si...@gmail.com on 15 Feb 2012 at 11:12

GoogleCodeExporter commented 8 years ago
Lambdaj wraps your (non-final) classes with a Proxy and intercepts METHOD 
invocations on them. That means it cannot work on fields but only on methods

Original comment by mario.fu...@gmail.com on 15 Feb 2012 at 9:34