xian/great-expectations — Issue #3: Eclipse objects to the recommended expect() methods.
Author: androidweasel
Created: 2011-12-12 18:19:42+00:00
State: open

Hi.

I find Eclipse doesn't like the suggested Expect.java code with the 0.12 library.

This is Java 1.6, Eclipse 3.6's response to the suggested Long:

public static > LongMatcher expect(T actual) {
return wrapped(LongMatcher.class, actual);
}

Test.java:

@Test
public void trivial()
{
long ten = 10;
expect(ten).toBe(10L);
//Eclipse shows an error: Bound mismatch: The generic method expect(T) of type Expect is not applicable for the arguments (Long). The inferred type ObjectMatcher> is not a valid substitute for the bounded parameter >
}

Eclipse is only happy if have expect()s like this:

public static ComparableMatcher expect (T actual) {
return wrapped(ComparableMatcher.class, actual);
}

Boolean works happily from great-expectations 0.12 - already having this sort of expect() - but String fails in a similar way.

Am I using the wrong version of Java? Is this something else Eclipse is deficient in? I didn't see a set of minimum versions specified in the readme file.

I'm using Ubuntu Oneric, in case it's relevant.

Thanks.