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


##########
impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java:
##########
@@ -420,17 +425,29 @@ public void addTestCompileSourceRoot(String path) {
     }
 
     /**
-     * {@return all sources that provide files in the given language for the 
given scope}.
-     * If the given scope is {@code null}, then this method returns the 
sources for all scopes.
-     * If the given language is {@code null}, then this method returns the 
sources for all languages.
+     * {@return all source root directories, including the disabled ones, for 
all languages and scopes}.
+     * The returned collection is unmodifiable.
+     *
+     * @see #addSourceRoot(SourceRoot)
+     */
+    public Collection<SourceRoot> getSourceRoots() {
+        return Collections.unmodifiableCollection(sources.values());
+    }
+
+    /**
+     * {@return all enabled sources that provide files in the given language 
for the given scope}.
+     * If the given scope is {@code null}, then this method returns the 
enabled sources for all scopes.
+     * If the given language is {@code null}, then this method returns the 
enabled sources for all languages.
      *
      * @param scope the scope of the sources to return, or {@code null} for 
all scopes
      * @param language the language of the sources to return, or {@code null} 
for all languages
      *
+     * @see #addSourceRoot(ProjectScope, Language, Path)
+     *
      * @since 4.0.0
      */
-    public Stream<SourceRoot> getSourceRoots(ProjectScope scope, Language 
language) {
-        Stream<SourceRoot> s = sources.values().stream();
+    public Stream<SourceRoot> getEnabledSourceRoots(ProjectScope scope, 
Language language) {

Review Comment:
   I don't think that works.  We can have multiple POMs or multiple JARs 
attached, so there's no one-to-one mapping between a jar and a pom.



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