Skip to content

Commit 2086df5

Browse files
author
Vincent Potucek
committed
RemoveUnusedLocalVariables
1 parent 65c3101 commit 2086df5

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

framework-docs/src/main/java/org/springframework/docs/integration/cache/cachestoreconfigurationnoop/CacheConfiguration.java

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
@Configuration
2727
class CacheConfiguration {
2828

29+
private CacheManager jdkCache() {
30+
return null;
31+
}
32+
33+
private CacheManager gemfireCache() {
34+
return null;
35+
}
36+
2937
// tag::snippet[]
3038
@Bean
3139
CacheManager cacheManager(CacheManager jdkCache, CacheManager gemfireCache) {

framework-docs/src/main/java/org/springframework/docs/web/webmvc/mvcconfig/mvcconfigpathmatching/WebConfiguration.java

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.springframework.web.method.HandlerTypePredicate;
66
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
77
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
8+
import org.springframework.web.util.pattern.PathPatternParser;
89

910
// tag::snippet[]
1011
@Configuration
@@ -14,5 +15,11 @@ public class WebConfiguration implements WebMvcConfigurer {
1415
public void configurePathMatch(PathMatchConfigurer configurer) {
1516
configurer.addPathPrefix("/api", HandlerTypePredicate.forAnnotation(RestController.class));
1617
}
18+
19+
private PathPatternParser patternParser() {
20+
PathPatternParser pathPatternParser = new PathPatternParser();
21+
// ...
22+
return pathPatternParser;
23+
}
1724
}
1825
// end::snippet[]

init.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ rootProject {
1515
// activeRecipe("org.openrewrite.java.migrate.lang.var.UseVarForObject")
1616
// activeRecipe("org.openrewrite.java.migrate.lang.var.UseVarForPrimitive")
1717
// activeRecipe("org.openrewrite.staticanalysis.FinalizeLocalVariables")
18-
// activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedLocalVariables")
18+
activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedLocalVariables")
1919
// activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedPrivateFields")
20-
activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods")
20+
// activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods")
2121
setExportDatatables(true)
2222
}
2323
afterEvaluate {

spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java

+8
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ public DerivedConstructorDependenciesBean(TestBean spouse1, TestBean spouse2, In
215215
setAge(age);
216216
setName(name);
217217
}
218+
219+
private void init() {
220+
this.initialized = true;
221+
}
222+
223+
private void destroy() {
224+
this.destroyed = true;
225+
}
218226
}
219227

220228

0 commit comments

Comments
 (0)