Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add method JavaClass.getTransitiveDependenciesFromSelf #401

Merged
merged 3 commits into from
Dec 16, 2020

Commits on Dec 16, 2020

  1. initialize non-imported JavaClass with empty dependencies

    So far, if a user would call `JavaClass.getDirectDependency{From/To}Self()` on a class that was not directly imported (e.g. a class that was not present in the original import, but accessed by a class from that import) it would cause a NPE. While we do want to cut the class graph at that point (i.e. not further track dependencies for classes that are not part of the import), we do not want this exceptional behavior. This change fixes the behavior and sets empty dependencies for all non-directly imported classes, be it classes that have been resolved from the classpath later on, or stub classes, because further resolution has been turned off.
    
    Resolves: #397
    
    Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
    hankem committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    66d97c5 View commit details
    Browse the repository at this point in the history
  2. add JavaClass.isFullyImported()

    This method reports whether the class is completed from the ImportContext.
    Take an import of package `com.foo`, where some class `com.foo.Foo` accesses another class `com.bar.Bar`, then `Foo` would be `isFullyImported() == true`, because it was explicitly covered by the package to be imported, but `Bar` would have `isFullyImported() == false`, because it was not covered by the original package. This method is useful, because it has strong implications, whether the class is fully imported or not. For example only a fully imported classes has its dependencies imported, a class that was just imported as a dependency of a fully imported class will have its dependencies cut off to avoid uncontrollably huge imports.
    
    Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
    hankem authored and codecholeric committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    66d8ac4 View commit details
    Browse the repository at this point in the history
  3. add method JavaClass.getTransitiveDependenciesFromSelf

    Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
    hankem authored and codecholeric committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    27dae94 View commit details
    Browse the repository at this point in the history