@@ -415,10 +415,12 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
415
415
resultsPrinter .print (nToUseForStreams );
416
416
417
417
// #streams.
418
- resultsPrinter .print (processor .getStreamSet ().size ());
418
+ Set <Stream > streamSet = processor .getStreamSet ();
419
+ resultsPrinter .print (streamSet == null ? 0 : streamSet .size ());
419
420
420
421
// #optimization available streams. These are the "filtered" streams.
421
- Set <Stream > candidates = processor .getStreamSet ().parallelStream ().filter (s -> {
422
+ Set <Stream > candidates = streamSet == null ? Collections .emptySet ()
423
+ : streamSet .parallelStream ().filter (s -> {
422
424
String pluginId = FrameworkUtil .getBundle (Stream .class ).getSymbolicName ();
423
425
424
426
// error related to reachability.
@@ -444,7 +446,8 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
444
446
: stream .getEnclosingType ().getFullyQualifiedName ());
445
447
446
448
// stream attributes.
447
- for (Stream stream : processor .getStreamSet ()) {
449
+ if (streamSet != null )
450
+ for (Stream stream : streamSet ) {
448
451
streamAttributesPrinter .printRecord (javaProject .getElementName (), stream .getCreation (),
449
452
stream .getCreation ().getStartPosition (), stream .getCreation ().getLength (),
450
453
Util .getMethodIdentifier (stream .getEnclosingEclipseMethod ()),
@@ -463,8 +466,8 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
463
466
printStreamAttributesWithMultipleValues (stream .getPossibleExecutionModes (),
464
467
streamExecutionModePrinter , stream , method , javaProject );
465
468
466
- printStreamAttributesWithMultipleValues (stream .getPossibleOrderings (), streamOrderingPrinter ,
467
- stream , method , javaProject );
469
+ printStreamAttributesWithMultipleValues (stream .getPossibleOrderings (),
470
+ streamOrderingPrinter , stream , method , javaProject );
468
471
469
472
}
470
473
@@ -523,20 +526,22 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
523
526
524
527
// Refactoring type counts.
525
528
for (Refactoring refactoring : Refactoring .values ())
526
- resultsPrinter .print (processor .getStreamSet ().parallelStream ().map (Stream ::getRefactoring )
529
+ resultsPrinter .print (streamSet == null ? 0
530
+ : streamSet .parallelStream ().map (Stream ::getRefactoring )
527
531
.filter (r -> Objects .equals (r , refactoring )).count ());
528
532
529
533
// Precondition success counts.
530
534
for (PreconditionSuccess preconditionSuccess : PreconditionSuccess .values ())
531
- resultsPrinter
532
- . print ( processor . getStreamSet () .parallelStream ().map (Stream ::getPassingPrecondition )
535
+ resultsPrinter . print ( streamSet == null ? 0
536
+ : streamSet .parallelStream ().map (Stream ::getPassingPrecondition )
533
537
.filter (pp -> Objects .equals (pp , preconditionSuccess )).count ());
534
538
535
539
// Transformation counts.
536
540
for (TransformationAction action : TransformationAction .values ())
537
- resultsPrinter .print (processor .getStreamSet ().parallelStream ().map (Stream ::getActions )
538
- .filter (Objects ::nonNull ).flatMap (as -> as .parallelStream ())
539
- .filter (a -> Objects .equals (a , action )).count ());
541
+ resultsPrinter .print (streamSet == null ? 0
542
+ : streamSet .parallelStream ().map (Stream ::getActions ).filter (Objects ::nonNull )
543
+ .flatMap (as -> as .parallelStream ()).filter (a -> Objects .equals (a , action ))
544
+ .count ());
540
545
541
546
// actually perform the refactoring if there are no fatal
542
547
// errors.
0 commit comments