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

DefaultJws class doesn't propagate the generic B type to the interface #39

Closed
josebarrueta opened this issue Aug 26, 2015 · 1 comment
Closed
Milestone

Comments

@josebarrueta
Copy link
Contributor

By not propagating the generic type to specific generic to the interface, IDEs warn of not passing the specific type in the Jws.

For example:

 Jws<MyClaims> jws = Jwts.parser().setSigningKeyResolver(issuerSigningKeyResolver).parse(jwt, new JwtHandlerAdapter<Jws<MyClaims>>() {
                @Override
                public Jws<MyClaims> onClaimsJws(Jws<Claims> jws) {
                    MyClaims myClaims = ...;
                    return new DefaultJws<>(jws.getHeader(), myClaims, jws.getSignature());
                }
            });

The IDE complains the the returned type is not of Jws<MyClaims>.

Solution will be add the generic body to the signature of the class:

public class DefaultJws<B> implements Jws<B>

@lhazlewood lhazlewood added this to the 0.6 milestone Aug 27, 2015
@lhazlewood
Copy link
Contributor

Resolved by PR #40. Will be released in 0.6.

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

No branches or pull requests

2 participants