Open monperrus opened 6 years ago
it is probably an error in the patch generator. I need more info, the complete json result will be useful
It's not formatted at all, but here it is: https://github.com/Spirals-Team/librepair-experiments/blob/spring-cloud-spring-cloud-dataflow-284933348-20171008-064257_bugonly/repairnator.npefix.results
NPEFix does not generate correctly the patch. The strategy is a return VOID in a constructor, it means that it has to wrap with an if not null the end of the constructor.
Like this:
+++ /StreamDefinitionController.java
@@ -379,2 +379,5 @@
+ if (StreamDefinitionController.this.streamService != null) {
+ streamDeploymentStates = StreamDefinitionController.this.streamService
+ }
- streamDeploymentStates = StreamDefinitionController.this.streamService
This is impossible in this case, the compiler complains because because the field streamDeploymentStates may be uninitialized.
True, I forgot that we remove final modifier...
+++ /StreamDefinitionController.java
@@ -379,2 +379,5 @@
+ if (StreamDefinitionController.this.streamService != null) {
+ streamDeploymentStates = StreamDefinitionController.this.streamService
+ } else {
+ streamDeploymentStates = null;
+ }
- streamDeploymentStates = StreamDefinitionController.this.streamService
Good news, we have a patch in repairnator!
But this patch is impossible, because it is in a constructor, and
return null
is impossible in a constructor.