Skip to content

Commit 8648827

Browse files
author
Vincent Potucek
committed
Pull spring-projects#34809: RemoveUnusedPrivateFields
1 parent 838b4d6 commit 8648827

File tree

8 files changed

+33
-13
lines changed

8 files changed

+33
-13
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version=7.0.0-SNAPSHOT
22

33
org.gradle.caching=true
4-
org.gradle.jvmargs=-Xmx2048m
4+
org.gradle.jvmargs=-Xmx8g
55
org.gradle.parallel=true
66

77
kotlinVersion=2.1.20

import-into-eclipse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ _When instructed to execute `./gradlew` from the command line, be sure to execut
4848
1. While JUnit tests pass from the command line with Gradle, some may fail when run from
4949
the IDE.
5050
- Resolving this is a work in progress.
51-
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m`
51+
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2g -Xmx2g -XX:MaxHeapSize=2g`
5252

5353
## Tips
5454

import-into-idea.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IntelliJ IDEA. See https://youtrack.jetbrains.com/issue/IDEA-64446 for details.
1919
3. While JUnit tests pass from the command line with Gradle, some may fail when run from
2020
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
2121
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
22-
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
22+
-XX:MaxPermSize=2g -Xmx2g -XX:MaxHeapSize=2g
2323
4. If you invoke "Rebuild Project" in the IDE, you'll have to generate some test
2424
resources of the `spring-oxm` module again (`./gradlew :spring-oxm:compileTestJava`)
2525

init.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
initscript {
2+
repositories {
3+
maven { url "https://plugins.gradle.org/m2" }
4+
}
5+
dependencies { classpath("org.openrewrite:plugin:7.2.1") }
6+
}
7+
rootProject {
8+
plugins.apply(org.openrewrite.gradle.RewritePlugin)
9+
dependencies {
10+
rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0")
11+
}
12+
rewrite {
13+
// activeRecipe("org.openrewrite.java.migrate.UpgradeToJava17")
14+
// activeRecipe("org.openrewrite.java.migrate.UpgradeToJava21")
15+
// activeRecipe("org.openrewrite.java.migrate.lang.var.UseVarForObject")
16+
// activeRecipe("org.openrewrite.java.migrate.lang.var.UseVarForPrimitive")
17+
// activeRecipe("org.openrewrite.staticanalysis.FinalizeLocalVariables")
18+
// activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedLocalVariables")
19+
activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedPrivateFields")
20+
// activeRecipe("org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods")
21+
setExportDatatables(true)
22+
}
23+
afterEvaluate {
24+
if (repositories.isEmpty()) {
25+
repositories {
26+
mavenCentral()
27+
}
28+
}
29+
}
30+
}

spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,6 @@ public static class GenericBroadcasterImpl implements Broadcaster {
802802
public abstract static class GenericEventBroadcasterImpl<T extends Event>
803803
extends GenericBroadcasterImpl implements EventBroadcaster {
804804

805-
private Class<T>[] subscribingEvents;
806-
807805
private Channel<T> channel;
808806

809807
/**

spring-expression/src/test/java/org/springframework/expression/spel/testresources/Inventor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class Inventor {
3737
public String publicName;
3838
private PlaceOfBirth placeOfBirth;
3939
private Date birthdate;
40-
private int sinNumber;
4140
private String nationality;
4241
private String[] inventions;
4342
public String randomField;

spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,11 @@ public jakarta.xml.bind.Unmarshaller createUnmarshaller() {
377377
@XmlRootElement
378378
@SuppressWarnings("unused")
379379
public static class DummyRootElement {
380-
381-
private DummyType t = new DummyType();
382380
}
383381

384382
@XmlType
385383
@SuppressWarnings("unused")
386384
public static class DummyType {
387-
388-
private String s = "Hello";
389385
}
390386

391387
@SuppressWarnings("unused")

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import org.springframework.util.StringUtils;
5454
import org.springframework.util.StringValueResolver;
5555
import org.springframework.web.HttpRequestHandler;
56-
import org.springframework.web.accept.ContentNegotiationManager;
5756
import org.springframework.web.context.request.ServletWebRequest;
5857
import org.springframework.web.context.support.ServletContextResource;
5958
import org.springframework.web.cors.CorsConfiguration;
@@ -123,8 +122,6 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
123122

124123
private @Nullable ResourceRegionHttpMessageConverter resourceRegionHttpMessageConverter;
125124

126-
private @Nullable ContentNegotiationManager contentNegotiationManager;
127-
128125
private final Map<String, MediaType> mediaTypes = new HashMap<>(4);
129126

130127
private @Nullable CorsConfiguration corsConfiguration;

0 commit comments

Comments
 (0)