Skip to content

Conversation

@rawvoid
Copy link
Owner

@rawvoid rawvoid commented Jan 23, 2026

Summary

This PR fixes a null pointer exception issue that could occur during XmlSeeAlso parameter array initialization. The fix ensures proper null handling when processing XmlSeeAlso annotations in the ElementWrapperPlugin.

Problem Identified

  • Null Safety Issue: XmlSeeAlso parameter array initialization could encounter null values
  • Potential NPE: Null values in XmlSeeAlso processing could cause runtime exceptions
  • Edge Case Handling: Missing null checks for robust error handling

Technical Fix

  • Null Check Added: Implemented proper null validation before array initialization
  • Safe Processing: Enhanced XmlSeeAlso processing to handle null parameters gracefully
  • Minimal Change: Focused fix with 3 insertions and 1 deletion in ElementWrapperPlugin.java

Impact

  • Improved Reliability: Eliminates potential NPE during XmlSeeAlso processing
  • Better Error Handling: Graceful handling of edge cases without crashing
  • Production Stability: Reduces risk of runtime failures in production environments

Files Changed

  • plugins/src/main/java/io/github/rawvoid/jaxb/plugin/ElementWrapperPlugin.java

Improved detection of wrapper classes and added safeguards to prevent removal of classes with active references or nested classes.
…ped classes

Integrated SLF4J logging to record removed and skipped wrapper classes in `ElementWrapperPlugin`. Updated dependencies to include SLF4J.
…g methods

Enhanced `ElementWrapperPlugin` with extensive Javadoc comments, improving clarity for annotation migration, wrapper detection, and field handling logic.
- Fix incomplete removal of wrapper classes in ElementWrapperPlugin
- Improve reference checking logic in removeWrapperClass method to identify all usages
- Enhance debug output formatting for better readability
@github-actions github-actions bot added the bug Something isn't working label Jan 23, 2026
@sonarqubecloud
Copy link

@rawvoid rawvoid merged commit a39164d into main Jan 23, 2026
4 checks passed
@rawvoid rawvoid deleted the pr/wrapper-xmlseealso-fix branch January 31, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants