Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the way XStreamHandler logs warnings #28848

Closed
2 tasks
nollymar opened this issue Jun 11, 2024 · 1 comment · Fixed by #29268
Closed
2 tasks

Improve the way XStreamHandler logs warnings #28848

nollymar opened this issue Jun 11, 2024 · 1 comment · Fixed by #29268

Comments

@nollymar
Copy link
Contributor

Parent Issue

No response

Problem Statement

We recently made changes in the XStreamHandler class to support a new xstream version. However, there are some improvements we can make to the code:

  1. Extract the whitelist array to a constant https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/util/xstream/XStreamHandler.java#L36-L39

  2. Only log a warning when a package or class is not part of the whitelist. Currently, we are always logging which makes the warning a bit noisy

2024-06-11T03:53:37.1084938Z 03:53:37.023 f1 main WARN  lang.Boolean - java.lang.Boolean should be included in the xstream white list
2024-06-11T03:53:37.1086704Z 03:53:37.026 f1 main WARN  lang.Long - java.lang.Long should be included in the xstream white list
2024-06-11T03:53:37.1089097Z 03:53:37.027 f1 main WARN  collect.ImmutableList$SerializedForm - com.google.common.collect.ImmutableList.SerializedForm should be included in the xstream white list

Steps to Reproduce

The XStreamHandler is used each time you import/export a bundle

Acceptance Criteria

  • The code should be refactored to include the suggested changes
  • Our test suites should run green

dotCMS Version

Trunk

Proposed Objective

Code Maintenance

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@nollymar
Copy link
Contributor Author

Great job @fabrizzio-dotCMS . The refactoring was pretty neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants