szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
213 stars 58 forks source link

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

Closed sinaneski closed 4 years ago

sinaneski commented 4 years ago
szpak commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 :-(.