RFR (S): JDK-8039916: AnnotatedType.getType() of a Executable parameters may return wrong type (original) (raw)
Joel Borggrén-Franck joel.franck at oracle.com
Wed Jun 4 14:22:56 UTC 2014
- Previous message: RFR (S): JDK-8039916: AnnotatedType.getType() of a Executable parameters may return wrong type
- Next message: RFR (S): JDK-8039916: AnnotatedType.getType() of a Executable parameters may return wrong type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks for the review Paul!
I pushed the original, but I’ll experiment with your suggestion for the next set of tests.
cheers /Joel
On 4 jun 2014, at 12:34, Paul Sandoz <paul.sandoz at oracle.com> wrote:
On Jun 4, 2014, at 12:25 PM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
You might consider the following a more streamy way, not tested! up to you :-) private static Object[][] provider() { Stream<? extends Executable> s = filterData(Test.class.getMethods(), null); s = Stream.concat(s, filterData(Test.class.getConstructors(), null)); s = Stream.concat(s, filterData(Test.class.getConstructors(), null)); return streamToArray(s); } private static Stream filterData(Executable[] es, Class c) { return Stream.of(es).filter(m -> m.getDeclaringClass() == c); } Plus you can drop the "? extends" bit of "? extends Executable", that was a hangover from some other mini experiment. Paul.
- Previous message: RFR (S): JDK-8039916: AnnotatedType.getType() of a Executable parameters may return wrong type
- Next message: RFR (S): JDK-8039916: AnnotatedType.getType() of a Executable parameters may return wrong type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]