You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/03/31 13:57:24 UTC
(maven) branch master updated: Access static fields in a static way (#2209)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 3c6b91b883 Access static fields in a static way (#2209)
3c6b91b883 is described below
commit 3c6b91b88382fa7445a2b33b9966c2dc9445ae80
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Mon Mar 31 13:57:18 2025 +0000
Access static fields in a static way (#2209)
---
.../java/org/apache/maven/AbstractCoreMavenComponentTestCase.java | 2 +-
.../java/org/apache/maven/impl/model/DefaultInterpolatorTest.java | 5 ++---
.../java/org/apache/maven/api/di/testing/MavenDIExtension.java | 8 ++++----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/impl/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java b/impl/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java
index e5808efe9f..33e155a266 100644
--- a/impl/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java
+++ b/impl/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java
@@ -216,7 +216,7 @@ protected List<ArtifactRepository> getRemoteRepositories() throws InvalidReposit
repository.setReleases(policy);
repository.setSnapshots(policy);
- return Arrays.asList(mavenRepositorySystem.buildArtifactRepository(repository));
+ return Arrays.asList(MavenRepositorySystem.buildArtifactRepository(repository));
}
protected List<ArtifactRepository> getPluginArtifactRepositories() throws InvalidRepositoryException {
diff --git a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultInterpolatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultInterpolatorTest.java
index 867bd7decf..c0c06a271f 100644
--- a/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultInterpolatorTest.java
+++ b/impl/maven-impl/src/test/java/org/apache/maven/impl/model/DefaultInterpolatorTest.java
@@ -215,12 +215,11 @@ private String substVars(
Map<String, String> configProps,
UnaryOperator<String> callback,
boolean defaultsToEmptyString) {
- return new DefaultInterpolator()
- .substVars(val, currentKey, null, configProps, callback, null, defaultsToEmptyString);
+ return DefaultInterpolator.substVars(val, currentKey, null, configProps, callback, null, defaultsToEmptyString);
}
private String substVars(String val, String currentKey) {
- return new DefaultInterpolator().substVars(val, currentKey, null, null, null, null, true);
+ return DefaultInterpolator.substVars(val, currentKey, null, null, null, null, true);
}
private String substVars(String val, String currentKey, Map<String, String> configProps) {
diff --git a/impl/maven-testing/src/main/java/org/apache/maven/api/di/testing/MavenDIExtension.java b/impl/maven-testing/src/main/java/org/apache/maven/api/di/testing/MavenDIExtension.java
index 7d97c7628f..40603619e2 100644
--- a/impl/maven-testing/src/main/java/org/apache/maven/api/di/testing/MavenDIExtension.java
+++ b/impl/maven-testing/src/main/java/org/apache/maven/api/di/testing/MavenDIExtension.java
@@ -77,7 +77,7 @@ public void beforeEach(ExtensionContext context) throws Exception {
* @param context The extension context to store
*/
protected void setContext(ExtensionContext context) {
- this.context = context;
+ MavenDIExtension.context = context;
}
/**
@@ -90,10 +90,10 @@ protected void setContext(ExtensionContext context) {
protected void setupContainer() {
try {
injector = Injector.create();
- injector.bindInstance(ExtensionContext.class, this.context);
- injector.discover(this.context.getRequiredTestClass().getClassLoader());
+ injector.bindInstance(ExtensionContext.class, context);
+ injector.discover(context.getRequiredTestClass().getClassLoader());
injector.bindInstance(Injector.class, injector);
- injector.bindInstance((Class) this.context.getRequiredTestClass(), this.context.getRequiredTestInstance());
+ injector.bindInstance((Class) context.getRequiredTestClass(), context.getRequiredTestInstance());
} catch (Exception e) {
throw new IllegalArgumentException("Failed to create DI injector.", e);
}