mthmulders commented on code in PR #816:
URL: https://github.com/apache/maven/pull/816#discussion_r1038025130


##########
maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileActivationContext.java:
##########
@@ -194,15 +162,30 @@ public Map<String, String> getProjectProperties() {
     }
 
     public DefaultProfileActivationContext setProjectProperties(Properties 
projectProperties) {
-        if (projectProperties != null) {
-            this.projectProperties = projectProperties.entrySet().stream()
-                    .collect(collectingAndThen(
-                            toMap(k -> String.valueOf(k.getKey()), v -> 
String.valueOf(v)),
-                            Collections::unmodifiableMap));
-        } else {
-            this.projectProperties = Collections.emptyMap();
-        }
+        return setProjectProperties(toMap(projectProperties));
+    }
+
+    public DefaultProfileActivationContext setProjectProperties(Map<String, 
String> projectProperties) {
+        this.projectProperties = unmodifiable(projectProperties);

Review Comment:
   Previously, a `null` for the `projectProperties` argument would result in 
`this.projectProperties` being an empty `Map`. With this patch, it would result 
in `this.projectProperties` being `null`. Are you sure that's an intended 
change?



##########
maven-model-builder/src/main/java/org/apache/maven/model/interpolation/BuildTimestampValueSource.java:
##########
@@ -23,17 +23,19 @@
 import org.codehaus.plexus.interpolation.AbstractValueSource;
 
 class BuildTimestampValueSource extends AbstractValueSource {
-    private final MavenBuildTimestamp mavenBuildTimestamp;
+    private final Date startTime;
+    private final Map<String, String> properties;
 
     BuildTimestampValueSource(Date startTime, Map<String, String> properties) {
         super(false);
-        this.mavenBuildTimestamp = new MavenBuildTimestamp(startTime, 
properties);
+        this.startTime = startTime;
+        this.properties = properties;

Review Comment:
   Would it make sense to default to an empty collection in case the 
constructor argument is empty?



##########
maven-model-builder/src/main/java/org/apache/maven/model/interpolation/BuildTimestampValueSource.java:
##########
@@ -23,17 +23,19 @@
 import org.codehaus.plexus.interpolation.AbstractValueSource;
 
 class BuildTimestampValueSource extends AbstractValueSource {
-    private final MavenBuildTimestamp mavenBuildTimestamp;
+    private final Date startTime;
+    private final Map<String, String> properties;
 
     BuildTimestampValueSource(Date startTime, Map<String, String> properties) {

Review Comment:
   Now that we've switched to Java 8, would it make sense to refactor `Date` to 
a JSR-310 type?



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to