Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 669 Bytes

EXAMPLES.md

File metadata and controls

27 lines (24 loc) · 669 Bytes

Forbid all wildcard imports

<RestrictImports>
    <reason>Don't use wildcard imports</reason>
    <bannedImport>**.'*'</bannedImport>
</RestrictImports>

Note: '*' is a special literal which is treated specially. It is only allowed as the last part of a package pattern.

Forbid all static imports

<RestrictImports>
    <reason>Don't use static imports</reason>
    <bannedImport>static **</bannedImport>
</RestrictImports>

Unify logging frameworks

<RestrictImports>
    <reason>Use slf4j Logger</reason>
    <bannedImport>**.Logger</bannedImport>
    <allowedImport>org.slf4j.Logger</allowedImport>
</RestrictImports>