computerluca / lambdaj

Automatically exported from code.google.com/p/lambdaj
1 stars 0 forks source link

Unable to convert the placeholder false #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
run:
System.out.println(
select(
  Arrays.asList("Test", "this", "bug"),
  having(Boolean.valueOf(on(String.class).startsWith("Te")))));

What is the expected output? What do you see instead?
("Test")

Exception in thread "main" java.lang.RuntimeException: Unable to convert
the placeholder false in a valid argument
    at
ch.lambdaj.function.argument.ArgumentsFactory.actualArgument(ArgumentsFactory.ja
va:78)

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

Please provide any additional information below.

ArgumentsFactory$LimitedValuesArgumentHolder:
        private final Argument<?>[] booleanArguments = new Argument[2];

both array entries are null at runtime

Original issue reported on code.google.com by tibokr...@googlemail.com on 20 Feb 2010 at 3:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This one is neater and works, of course.

System.out.println(
  select(Arrays.asList("Test", "this", "bug"),
    startsWith("Tes")));

Original comment by tibokr...@googlemail.com on 20 Feb 2010 at 4:11

GoogleCodeExporter commented 9 years ago
The code in your first example cannot work for the simple reason that the class
String is final and then non-proxable. This is a well known limitation of 
lambdaj and
I suppose it has been already clearly underlined. If you need more 
clarifications
about it please let me know.

Anyway you already found the right (and best) way to achieve what you wanted.

Original comment by mario.fu...@gmail.com on 20 Feb 2010 at 5:03