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

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

There is a newer version: 0.97.3
Show newest version
This change removes intermediate variables who are only created to be thrown or returned in the next statement. This makes the code more readable, which makes reviewing the code for issues easier.

Our changes look something like this:

```diff
    public LocaleResolver localeResolver() { 
-       SessionLocaleResolver localeResolver = new SessionLocaleResolver();
-       return localeResolver;
+       return new SessionLocaleResolver();
    }
```

```diff
    public void process() { 
-       Exception ex = new Exception();
-       throw ex;
+       throw new Exception();
    }
```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy