All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codemodder.codemods.DefineConstantForLiteralCodemod.description.md Maven / Gradle / Ivy

There is a newer version: 0.97.3
Show newest version
This change defines a constant for duplicated literal expression values, simplifying the refactoring process and mitigating the risk of overlooking any values during updates.

Our changes look something like this:

```diff

+    private static final String EXCEPTION_AT = "Exception at";

-       LOG.error("Exception at", ex)
+       builder.add(EXCEPTION_AT)  

-       LOG.error("Exception at", ex)
+       builder.add(EXCEPTION_AT)  

-       LOG.error("Exception at", ex)
+       builder.add(EXCEPTION_AT)  
```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy