You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Richard Eckart de Castilho (Jira)" <ji...@apache.org> on 2023/03/20 17:06:00 UTC

[jira] [Created] (MSHARED-1212) Detection that class is required in compile scope not happening because class only used as generic type

Richard Eckart de Castilho created MSHARED-1212:
---------------------------------------------------

             Summary: Detection that class is required in compile scope not happening because class only used as generic type
                 Key: MSHARED-1212
                 URL: https://issues.apache.org/jira/browse/MSHARED-1212
             Project: Maven Shared Components
          Issue Type: Bug
          Components: maven-dependency-analyzer
    Affects Versions: maven-dependency-analyzer-1.13.0
            Reporter: Richard Eckart de Castilho


Let's say we have a class in module A which calls a method `List<MyObject> getList()` from module B. The class `MyObject` comes from module C.

Also, there is some test class in module A which uses `MyObject`.

Eclipse will fail to compile this unless MyObject is in the compile scope.

The dependency analyzer will, however, not detect that MyObject is required in the compile scope because the class file for A does not contain a reference to MyObject (due to generic type erasure) and will indicate that module C/MyObject should be in scope test.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)