gnodet commented on code in PR #12695:
URL: https://github.com/apache/maven/pull/12695#discussion_r4059617217


##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -172,6 +175,15 @@ public int getDegreeOfConcurrency() {
         return getMavenSession().getRequest().getDegreeOfConcurrency();
     }
 
+    @Nonnull
+    @Override
+    public BuildEnvironment buildEnvironment() {
+        if (buildEnvironment == null) {

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -172,6 +175,15 @@ public int getDegreeOfConcurrency() {
         return getMavenSession().getRequest().getDegreeOfConcurrency();
     }
 
+    @Nonnull
+    @Override
+    public BuildEnvironment buildEnvironment() {
+        if (buildEnvironment == null) {

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -172,6 +175,15 @@ public int getDegreeOfConcurrency() {
         return getMavenSession().getRequest().getDegreeOfConcurrency();
     }
 
+    @Nonnull
+    @Override
+    public BuildEnvironment buildEnvironment() {
+        if (buildEnvironment == null) {
+            buildEnvironment = 
BuildReportCollector.buildEnvironment(getMavenSession());
+        }
+        return buildEnvironment;

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -63,6 +65,7 @@ public class DefaultSession extends AbstractSession 
implements InternalMavenSess
     private final MavenRepositorySystem mavenRepositorySystem;
     private final RuntimeInformation runtimeInformation;
     private final Map<String, Project> allProjects = new ConcurrentHashMap<>();
+    private BuildEnvironment buildEnvironment;

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -63,6 +65,7 @@ public class DefaultSession extends AbstractSession 
implements InternalMavenSess
     private final MavenRepositorySystem mavenRepositorySystem;
     private final RuntimeInformation runtimeInformation;
     private final Map<String, Project> allProjects = new ConcurrentHashMap<>();
+    private BuildEnvironment buildEnvironment;

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



##########
impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java:
##########
@@ -172,6 +175,15 @@ public int getDegreeOfConcurrency() {
         return getMavenSession().getRequest().getDegreeOfConcurrency();
     }
 
+    @Nonnull
+    @Override
+    public BuildEnvironment buildEnvironment() {
+        if (buildEnvironment == null) {
+            buildEnvironment = 
BuildReportCollector.buildEnvironment(getMavenSession());

Review Comment:
   Fixed in 5a244435c1 — added double-checked locking (`synchronized` inner 
block) to ensure atomic lazy initialization.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to