Skip to content

Commit 6274eef

Browse files
cstamasslawekjaranowski
authored andcommitted
Intern context strings
Everywhere, but the most burning one is DefDepNode. (cherry picked from commit d80b73f)
1 parent cb69b1d commit 6274eef

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public String getRequestContext() {
284284
* @return This request for chaining, never {@code null}.
285285
*/
286286
public CollectRequest setRequestContext(String context) {
287-
this.context = (context != null) ? context : "";
287+
this.context = (context != null) ? context.intern() : "";
288288
return this;
289289
}
290290

maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public String getRequestContext() {
251251
}
252252

253253
public void setRequestContext(String context) {
254-
this.context = (context != null) ? context : "";
254+
this.context = (context != null) ? context.intern() : "";
255255
}
256256

257257
public Map<Object, Object> getData() {

maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public String getContext() {
9393
* @return This query for chaining, never {@code null}.
9494
*/
9595
public LocalArtifactRequest setContext(String context) {
96-
this.context = (context != null) ? context : "";
96+
this.context = (context != null) ? context.intern() : "";
9797
return this;
9898
}
9999

maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public String getContext() {
8989
* @return This query for chaining, never {@code null}.
9090
*/
9191
public LocalMetadataRequest setContext(String context) {
92-
this.context = (context != null) ? context : "";
92+
this.context = (context != null) ? context.intern() : "";
9393
return this;
9494
}
9595

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public String getRequestContext() {
8585
* @return This request for chaining, never {@code null}.
8686
*/
8787
public ArtifactDescriptorPolicyRequest setRequestContext(String context) {
88-
this.context = (context != null) ? context : "";
88+
this.context = (context != null) ? context.intern() : "";
8989
return this;
9090
}
9191

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public String getRequestContext() {
138138
* @return This request for chaining, never {@code null}.
139139
*/
140140
public ArtifactDescriptorRequest setRequestContext(String context) {
141-
this.context = (context != null) ? context : "";
141+
this.context = (context != null) ? context.intern() : "";
142142
return this;
143143
}
144144

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public String getRequestContext() {
176176
* @return This request for chaining, never {@code null}.
177177
*/
178178
public ArtifactRequest setRequestContext(String context) {
179-
this.context = (context != null) ? context : "";
179+
this.context = (context != null) ? context.intern() : "";
180180
return this;
181181
}
182182

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public String getRequestContext() {
129129
* @return This request for chaining, never {@code null}.
130130
*/
131131
public MetadataRequest setRequestContext(String context) {
132-
this.context = (context != null) ? context : "";
132+
this.context = (context != null) ? context.intern() : "";
133133
return this;
134134
}
135135

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public String getRequestContext() {
138138
* @return This request for chaining, never {@code null}.
139139
*/
140140
public VersionRangeRequest setRequestContext(String context) {
141-
this.context = (context != null) ? context : "";
141+
this.context = (context != null) ? context.intern() : "";
142142
return this;
143143
}
144144

maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public String getRequestContext() {
138138
* @return This request for chaining, never {@code null}.
139139
*/
140140
public VersionRequest setRequestContext(String context) {
141-
this.context = (context != null) ? context : "";
141+
this.context = (context != null) ? context.intern() : "";
142142
return this;
143143
}
144144

0 commit comments

Comments
 (0)