elharo commented on code in PR #2180:
URL: https://github.com/apache/maven/pull/2180#discussion_r2011893372


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultSourceRoot.java:
##########
@@ -64,30 +64,38 @@ public final class DefaultSourceRoot implements SourceRoot {
      * @param baseDir the base directory for resolving relative paths
      * @param source a source element from the model
      */
+    @SuppressWarnings("checkstyle:AvoidNestedBlocks")
     public DefaultSourceRoot(final Session session, final Path baseDir, final 
Source source) {
-        String value = nonBlank(source.getDirectory());
-        if (value == null) {
-            throw new IllegalArgumentException("Source declaration without 
directory value.");
-        }
-        directory = baseDir.resolve(value);
-        FileSystem fs = directory.getFileSystem();
+        FileSystem fs = baseDir.getFileSystem();
         includes = matchers(fs, source.getIncludes());
         excludes = matchers(fs, source.getExcludes());
         stringFiltering = source.isStringFiltering();
         enabled = source.isEnabled();
         moduleName = nonBlank(source.getModule());
-
-        value = nonBlank(source.getScope());
-        scope = (value != null) ? session.requireProjectScope(value) : 
ProjectScope.MAIN;
-
-        value = nonBlank(source.getLang());
-        language = (value != null) ? session.requireLanguage(value) : 
Language.JAVA_FAMILY;
-
-        value = nonBlank(source.getTargetVersion());
-        targetVersion = (value != null) ? session.parseVersion(value) : null;
-
-        value = nonBlank(source.getTargetPath());
-        targetPath = (value != null) ? baseDir.resolve(value) : null;
+        {

Review Comment:
   No. I am going to -1 this. This is worse than what we had before. Just 
rename all the variables and don't use the word value, which was a 
non-descriptive name in the first place, even if it were only used in one 
place. 



-- 
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