Closed GoogleCodeExporter closed 9 years ago
I didn't realize that being a project member meant my issues were marked as accepted by default.
Original comment by boppenh...@google.com
on 1 Oct 2010 at 1:05
Your test should be taking Function<? super T, String>, right? Or are you
saying that you need to conform to some code that isn't doing proper PECS
generics?
You could always cast it with a @SuppressWarnings...
@SuppressWarnings("unchecked")
public static <T> Function<T, String> convert (Function<Object, String> func)
{
return (Function<T, String>)func;
}
Then you can pass
YourClass.<MySpecificDataClass>convert(Functions.toStringFunction());
Original comment by ray.j.gr...@gmail.com
on 1 Oct 2010 at 2:21
Yes, but that turns out to be just as many lines/effort as providing my own
toString function implementation inline.
Original comment by boppenh...@google.com
on 1 Oct 2010 at 3:30
You're probably right, I'll see about modifying the code that I'm working with
to use proper generics.
Original comment by boppenh...@google.com
on 1 Oct 2010 at 3:42
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:09
Original issue reported on code.google.com by
boppenh...@google.com
on 1 Oct 2010 at 1:04