Skip to content

forbid wildcard imports in combination with toggleOffOn #2895

@JoranVanBelle

Description

@JoranVanBelle

I am looking into the feature forbidWildcardImports, which seems not to be working as I expected. After some debugging and trial-and-error I found out that the issue is the toggleOffOn.

When it is removed from the plugin, the build fails due to a wildcard import being present.
When it's added again, the build succeeds eventhough the wildcard import is still present.
Switching the order around while keeping toggleOffOn did not fix it.

                    <java>
                        <toggleOffOn/>
                        <eclipse>
                            <version>4.35</version>
                            <file>${project.parent.basedir}/eclipse-formatter.xml</file>
                        </eclipse>
                        <importOrder>
                            <file>${project.parent.basedir}/import-order.txt</file>
                        </importOrder>
                        <removeUnusedImports/>
                        <forbidWildcardImports/>
                    </java>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions