Skip to content

JavaPackage#getPackageDependenciesFromSelf returns dependencies from both self AND subpackages #919

Closed
@grimsa

Description

In JavaPacakge:

  • getPackageDependenciesFromSelf collects packages of classes returned by getClassDependenciesFromSelf
  • getClassDependenciesFromSelf collects dependencies originating from classes returned by getAllClasses
  • getAllClasses collects classes from both the current package AND all subpackages (descendants)

This caught me by surprise - I expected getPackageDependenciesFromSelf to only return the package dependencies originating from classes in the current package (i.e. excluding any subpackages).

At first glance it would seem that just replacing getAllClasses with getClasses in getClassDependenciesFrom/ToSelf would make it match my expectation.

If this is a bug, I'd be happy to open a PR with a fix.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions