Skip to content
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

Change mutators and use set in config for Gradle 5 #170

Closed
wants to merge 1 commit into from

Conversation

sinaneski
Copy link

  • Add how to change mutators in pitest gradle.build config
  • Use set() method to prevent Gradle warnings like 'cannot assing a value to final field'

- Add how to change mutators in pitest gradle.build config
- Use set() method to prevent Gradle warnings like 'cannot assing a value to final field'
@szpak
Copy link
Owner

szpak commented Feb 26, 2020

@sinaneski Thanks for your report. I've just started working on deprecation warnings (#155), but I hasn't encountered those mentioned by you.

Could you paste sample configuration which triggers the aforementioned warnings (and Gradle version that you use)?

@sinaneski
Copy link
Author

Hi,

I'm using Gradle 5.6.3 version.

However, I got this warning from IntelliJ inspection.

Cannot assign a value to final field 'outputFormats' 
 Inspection info: Reports invalid assignments to final variables, parameters and fields and not initialized final fields.

pitest-assigning-warning

The inspection is OK after changing the assignment using the set operation.

pitest-using-set

@szpak szpak added this to the 1.4.8 milestone Mar 26, 2020
@szpak
Copy link
Owner

szpak commented Mar 27, 2020

It is a limitation of Idea. Gradle do some magic to keep the old syntax with = work with final fields (using the setters internally). I will add a point in README that the alternative syntax exists. Unfortunately it is more verbose and less readable :-(.

@sinaneski sinaneski closed this Mar 29, 2020
szpak added a commit that referenced this pull request Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants