HelenBlack / lambdaj

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

The method greaterThan(int) is undefined. #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi.

   When I import the lambdaj-2.3.3-with-dependencies.jar to Eclipse, and add the import static ch.lambdaj.Lambda.*; line, the project doesn't recognize the greaterThan method.

Example:
List<Integer> biggerThan3 = filter(greaterThan(3), asList(1, 2, 3, 4, 5));

In the example, the error appears in "asList" and "greaterThan". 'The method 
greaterThan(int) is undefined.'
The IDE (Eclipse Helios) recognize the import, and the filter...

Also, I used Maven, with the same error.

Sorry if it's a newbie problem :(.... and sorry for my bad english.

Thanks!

Original issue reported on code.google.com by cutri...@gmail.com on 16 Jul 2011 at 5:35

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Can you post a snippet of your code showing your problem?

Thanks,
Mario

Original comment by mario.fu...@gmail.com on 24 Aug 2011 at 7:16

GoogleCodeExporter commented 8 years ago
Hi,

I am having exactly the same problem:

I downloaded and added lambdaj-2.3.3-with-dependencies.jar to my build path.

import static ch.lambdaj.Lambda.filter;
import java.util.List;

public class Main
{
  public static void main(String[] args)
  {
     List<Integer> biggerThan3 = filter(greaterThan(3), asList(1, 2, 3, 4, 5));
  }
}

Eclipse complains with the following two errors:

1. the method asList(int,int,int,int) is undefined for the type Main
2. the method greaterThan(int) is undefined for the type Main

Any help would be appreciated.
Thanks
Sajid

Original comment by sajid.ha...@gmail.com on 15 Sep 2011 at 11:50

GoogleCodeExporter commented 8 years ago
One more point.

Eclipse replaces import static ch.lambdaj.Lambda.*; 
with import static ch.lambdaj.Lambda.filter;

since it cannot find asList and greaterThan

Thanks
Saj

Original comment by sajid.ha...@gmail.com on 15 Sep 2011 at 11:54

GoogleCodeExporter commented 8 years ago
By importing:
import static org.hamcrest.Matchers.*;
import static java.util.Arrays.*;

fixes the problem

Saj

Original comment by sajid.ha...@gmail.com on 15 Sep 2011 at 12:54

GoogleCodeExporter commented 8 years ago

Original comment by mario.fu...@gmail.com on 17 Sep 2011 at 8:28

GoogleCodeExporter commented 8 years ago
Thanks!

Original comment by cutri...@gmail.com on 20 Sep 2011 at 6:06

GoogleCodeExporter commented 8 years ago
Thanks man

Original comment by asadkhan.khan@gmail.com on 3 May 2012 at 1:16