-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NpeFix generates an impossible patch, return null
in a constructor
#8
Comments
it is probably an error in the patch generator. |
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. 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.The text was updated successfully, but these errors were encountered: