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 primitive classes to package java.lang #905

Merged

Commits on Jul 8, 2022

  1. fix redundant type information inspections

    After migrating to Java 8 there are now quite some places where type information can actually be inferred instead of having to be specified explicitly.
    
    Signed-off-by: Peter Gafert <[email protected]>
    codecholeric committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    0a90c1d View commit details
    Browse the repository at this point in the history
  2. add primitive classes to package java.lang

    So far primitive types like `int` have been in the default package `""`, since their `Package` object from the Reflection API is `null` and that seemed like the best matching ArchUnit version (since ArchUnit does not use `null` within the public API and the choice would then just have been to make the `JavaPackage` `Optional` just because of a couple of corner cases). Starting with Java 9 the Reflection API introduced a new method `Class.getPackageName()` though, which would return `java.lang` for primitives and the package of the component type for arrays. Luckily for arrays ArchUnit is already consistent, because we decided long ago that this behavior for the package name would make sense. This commit now makes the package of primitives again consistent with the Reflection API by putting primitive types into the package `java.lang`.
    
    Signed-off-by: Peter Gafert <[email protected]>
    codecholeric committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    ee90e38 View commit details
    Browse the repository at this point in the history