@@ -430,7 +430,7 @@ void invalidBound() {
430
430
"}" );
431
431
JavaFileObject javaFile = forSourceLines ("test.InvalidArguments" , sourceLines );
432
432
assertAbout (javaSources ()).that (singletonList (javaFile ))
433
- .processedWith (new Processor (true ))
433
+ .processedWith (new Processor ())
434
434
.failsToCompile ()
435
435
.withErrorContaining ("The collector should return Set<String> but returns Set<Long>" );
436
436
}
@@ -461,7 +461,7 @@ void validBothMapperAndCollectorHaveTypeargsHard() {
461
461
"}" );
462
462
JavaFileObject javaFile = forSourceLines ("test.ValidArguments" , sourceLines );
463
463
assertAbout (javaSources ()).that (singletonList (javaFile ))
464
- .processedWith (new Processor (true ))
464
+ .processedWith (new Processor ())
465
465
.compilesWithoutError ();
466
466
}
467
467
@@ -491,7 +491,7 @@ void invalidBothMapperAndCollectorHaveTypeargsBadCollectorBounds() {
491
491
"}" );
492
492
JavaFileObject javaFile = forSourceLines ("test.InvalidArguments" , sourceLines );
493
493
assertAbout (javaSources ()).that (singletonList (javaFile ))
494
- .processedWith (new Processor (true ))
494
+ .processedWith (new Processor ())
495
495
.failsToCompile ()
496
496
.withErrorContaining ("There is a problem with the collector class: invalid bounds." );
497
497
}
@@ -523,11 +523,43 @@ void invalidBothMapperAndCollectorHaveTypeargsUnresolvedCollectorTypearg() {
523
523
"}" );
524
524
JavaFileObject javaFile = forSourceLines ("test.InvalidArguments" , sourceLines );
525
525
assertAbout (javaSources ()).that (singletonList (javaFile ))
526
- .processedWith (new Processor (false ))
526
+ .processedWith (new Processor ())
527
527
.failsToCompile ()
528
528
.withErrorContaining ("There is a problem with the collector class: could not resolve all type parameters." );
529
529
}
530
530
531
+ @ Test
532
+ void validBothMapperCollectorAndResultTypeHaveTypeargs () {
533
+ List <String > sourceLines = withImports (
534
+ "@CommandLineArguments" ,
535
+ "abstract class ValidArguments {" ,
536
+ "" ,
537
+ " @Parameter(shortName = 'x'," ,
538
+ " repeatable = true," ,
539
+ " mappedBy = Map.class," ,
540
+ " collectedBy = Collect.class)" ,
541
+ " abstract List<List<Result<String>>> map();" ,
542
+ "" ,
543
+ " static class Map<E, F> implements Supplier<Function<E, F>> {" ,
544
+ " public Function<E, F> get() {" ,
545
+ " return null;" ,
546
+ " }" ,
547
+ " }" ,
548
+ "" ,
549
+ " static class Collect<E extends List> implements Supplier<Collector<E, ?, List<E>>> {" ,
550
+ " public Collector<E, ?, List<E>> get() {" ,
551
+ " return null;" ,
552
+ " }" ,
553
+ " }" ,
554
+ "" ,
555
+ " static class Result<E> {}" ,
556
+ "}" );
557
+ JavaFileObject javaFile = forSourceLines ("test.ValidArguments" , sourceLines );
558
+ assertAbout (javaSources ()).that (singletonList (javaFile ))
559
+ .processedWith (new Processor ())
560
+ .compilesWithoutError ();
561
+ }
562
+
531
563
@ Test
532
564
void bothMapperAndCollectorHaveTypeargsInvalidBoundsOnCollector () {
533
565
List <String > sourceLines = withImports (
0 commit comments