Skip to content

Commit

Permalink
Issue checkstyle#12681: removes serializable from violation
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach committed Feb 3, 2023
1 parent a144e7f commit e7b3c92
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.puppycrawl.tools.checkstyle.api;

import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Locale;
Expand All @@ -32,16 +31,12 @@
* message.properties files. The underlying implementation uses
* java.text.MessageFormat.
*
* @noinspection SerializableHasSerializationMethods, ClassWithTooManyConstructors
* @noinspectionreason SerializableHasSerializationMethods - we do not serialize this class
* @noinspection ClassWithTooManyConstructors
* @noinspectionreason ClassWithTooManyConstructors - immutable nature of class requires a
* bunch of constructors
*/
public final class Violation
implements Comparable<Violation>, Serializable {

/** A unique serial version identifier. */
private static final long serialVersionUID = 5675176836184862150L;
implements Comparable<Violation> {

/** The default severity level if one is not specified. */
private static final SeverityLevel DEFAULT_SEVERITY = SeverityLevel.ERROR;
Expand All @@ -64,15 +59,7 @@ public final class Violation
/** Key for the violation format. **/
private final String key;

/**
* Arguments for MessageFormat.
*
* @noinspection NonSerializableFieldInSerializableClass
* @noinspectionreason NonSerializableFieldInSerializableClass - usage of
* 'Serializable' for this api class
* is considered as mistake now, but we do not break api without
* good reason
*/
/** Arguments for MessageFormat. */
private final Object[] args;

/** Name of the resource bundle to get violations from. **/
Expand Down

0 comments on commit e7b3c92

Please sign in to comment.