Skip to content

EnforceBytecodeVersion: check if the package name is valid  #240

Open
@aalmiray

Description

Apply a regex such as "^[a-z]+(.[a-z][a-z0-9])$" to check if a given classfile entry has a valid package name. Actual regex may account for uppercase characters and _ which is also valid.

The gradle-api-* JARs do not follow the MR-JAR constraints and contain entries such as org/gradle/internal/impldep/META-INF/versions/9/org/junit/platform/commons/util/ModuleUtils.class which cannot be loaded as their package name is invalid. Entries like this should not be scanned.

This particular JAR has issues (see gradle/gradle#23002) yet the fact remains that other faulty JARs may exist out there with entries that could never be loaded (unless a weird force is attempted) and thus should not cause the rul to trigger.

Related to kordamp/enforcer-gradle-plugin#27

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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