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
Remove Serializable interface from Violation class and EventObject extension from AuditEvent #12681
Labels
Milestone
Comments
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Jan 25, 2023
please assign me i can work on this issue |
@nitishmalang This is already taken and has a PR awaiting review. |
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Jan 27, 2023
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Feb 3, 2023
Should we title issue something as |
I am fine with that. |
romani
changed the title
Resolve Violation class has non-serializbale fields in class
Remove serializable interface from Violation class
Feb 18, 2023
romani
changed the title
Remove serializable interface from Violation class
Remove Serializable interface from Violation class and EventObject extension from AuditEvent
Feb 19, 2023
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Feb 19, 2023
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Feb 20, 2023
rnveach
added a commit
to rnveach/checkstyle
that referenced
this issue
Feb 21, 2023
nrmancuso
pushed a commit
that referenced
this issue
Feb 21, 2023
Closed via #12675 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since we don't use serialization, we will remove this class being serializable as it is not serializable due to
arg
field.Serialization was added at d2af4ac#diff-52efb9bb7c26b577e3885a9539eac7d5R42 titled Apply parts of patch #1952556 fixing some FindBugs bugs. Thanks to Travis Schneeberger.
http://git.net/ml/java.audit.checkstyle.devel/2008-04/msg00067.html
Findbugs does produce this error if I remove the serialization:
[INFO] Class com.puppycrawl.tools.checkstyle.api.AuditEvent defines non-transient non-serializable instance field localizedMessage [com.puppycrawl.tools.checkstyle.api.AuditEvent] In AuditEvent.java SE_BAD_FIELD
This is because AuditEvent is serialized through inheritance of EventObject.
Such inheritance also should be removed.
============
Now this is become why is
AuditEvent
serialized and needEventObject
.Second problem of serialization:
Detected by IDEA inspection and Sonar Inspection Make "args" transient or serializable.
https://sonarcloud.io/project/issues?id=org.checkstyle%3Acheckstyle&issues=AW9t2w2MYD2QG1pPXIUJ&open=AW9t2w2MYD2QG1pPXIUJ
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java
Lines 67 to 76 in 54616f6
Slightly related problem: #7488 (comment) but a different approach.
=====
PR Discussion resolution for second problem:
Changing
args
to something more serializable would be a huge break for whole Checkstyle. This would impact property files which use special properties ofMessageFormat
to format the argument into a meaningful display.The text was updated successfully, but these errors were encountered: