Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse objects to the recommended expect() methods. #3

Open
androidweasel opened this issue Dec 12, 2011 · 0 comments
Open

Eclipse objects to the recommended expect() methods. #3

androidweasel opened this issue Dec 12, 2011 · 0 comments

Comments

@androidweasel
Copy link

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 <T extends Long, M extends LongMatcher<T, M>> LongMatcher<T, ?> 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<Long,ObjectMatcher<Long,M>> is not a valid substitute for the bounded parameter <M extends ObjectMatcher<T,M>>
}

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

public static ComparableMatcher<T, ?> 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant