You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] PublicMemberInNonPublicType can only be suppressed on type and not member level #6461
classMyTest {
// @SuppressWarnings("PMD.PublicMemberInNonPublicType")publicstaticvoidmain(finalString... args) {
// main method that is invoked in IntelliJ
}
}
... does trigger a PublicMemberInNonPublicType violation in both 7.22.0 and 7.25.0. The violation goes away if I remove the // in line 2.
Activity
UncleOwen commentedon Jun 20, 2026
Cannot reproduce. This code ...
... does trigger a
PublicMemberInNonPublicTypeviolation in both 7.22.0 and 7.25.0. The violation goes away if I remove the//in line 2.@uhafner Could you please double-check?
adangel commentedon Jun 22, 2026
@UncleOwen In any case, I think it makes sense, to add such an example as a test case. To be sure, we can actually suppress the violation.
UncleOwen commentedon Jun 22, 2026
@adangel agreed.
[java] #6461: PublicMemberInNonPublicType: Verify that we can suppres…