Skip to content

spotbugs: suppress 4 design-intentional findings#7633

Open
Vest wants to merge 1 commit into
PCGen:masterfrom
Vest:spotbugs-suppress-misc
Open

spotbugs: suppress 4 design-intentional findings#7633
Vest wants to merge 1 commit into
PCGen:masterfrom
Vest:spotbugs-suppress-misc

Conversation

@Vest

@Vest Vest commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Adds @SuppressFBWarnings with one-line rationale to four design-intentional findings:

  1. DCN_NULLPOINTER_EXCEPTION @ FormulaFactory.getNEPFormulaFor
    NPE is a deliberate signal that the expression is not a simple constant; control falls through to the slower parse path.
  2. DCN_NULLPOINTER_EXCEPTION @ StatValueFacet.getVarID
    NPE is caught to translate into an IllegalArgumentException with a clearer error message when a CHANNEL is undefined.
  3. SE_COMPARATOR_SHOULD_BE_SERIALIZABLE @ MovementResultFacet$MoveSorter
    Private inner Comparator is never serialized; pcgen does not serialize facet runtime constructs (see spotbugs_ignore.xml SE_BAD_FIELD rule).
  4. REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS @ TransparentFactory.<init>
    Reflection on refClass is the documented purpose of TransparentFactory: it builds references to CDOM types resolved by name from LST data.

SpotBugs delta verified:

  • DCN_NULLPOINTER_EXCEPTION: 2 -> 0 (drop 2)
  • SE_COMPARATOR_SHOULD_BE_SERIALIZABLE: 1 -> 0 (drop 1)
  • REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS: 2 -> 1 (drop 1)
  • No new findings introduced.

Scoped tests: ./gradlew :test --tests "pcgen.cdom.*" -> 2355 tests, 0 failures.

- DCN_NULLPOINTER_EXCEPTION @ FormulaFactory.getNEPFormulaFor:
  NPE is a deliberate signal that the expression is not a simple
  constant; control falls through to the slower parse path.
- DCN_NULLPOINTER_EXCEPTION @ StatValueFacet.getVarID:
  NPE is caught to translate into an IllegalArgumentException with
  a clearer error message when a CHANNEL is undefined.
- SE_COMPARATOR_SHOULD_BE_SERIALIZABLE @ MovementResultFacet$MoveSorter:
  Private inner Comparator is never serialized; pcgen does not
  serialize facet runtime constructs (see spotbugs_ignore.xml
  SE_BAD_FIELD rule).
- REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS @
  TransparentFactory.<init>: reflection on refClass is the documented
  purpose of TransparentFactory; it builds references to CDOM types
  resolved by name from LST data.
@Vest Vest marked this pull request as ready for review June 25, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant