A new SpotBug rule has been introduced in odlparent Aluminium and
suggests to explicit the serialVersionUID in serializable classes to
avoid compilers interoperability problems due to a Java implementation
design flaw.
If this is useful in a few situations (rare today), this also means that
theorically developers must maintain this field and increment it across
classes incompatible versions.
Practically, this step is often forgotten, paving the way to more
serious problems.
Since the situation here does not require it, it is healthier to simply
ignore this (soon obsolete?) recommendation.
For more details:
git log pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java
https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID
https://moi.vonos.net/java/serialization-synthetic/
https://rules.sonarsource.com/java/RSPEC-4926
https://www.vojtechruzicka.com/explicitly-declare-serialversionuid/
https://www.infoworld.com/article/
3275924/oracle-plans-to-dump-risky-java-serialization.html
JIRA: TRNSPRTPCE-292
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I4e36134061104d912a75f3a578d43ca0bc17ab1f
* @author Martial Coulibaly (martial.coulibaly@gfi.com) on behalf of Orange
*
*/
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPort121ByName implements Comparator<Port>, Serializable {
- private static final long serialVersionUID = 1L;
-
@Override
public int compare(Port port1, Port port2) {
return extractInt(port1) - extractInt(port2);
* @author Martial Coulibaly (martial.coulibaly@gfi.com) on behalf of Orange
*
*/
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPort221ByName implements Comparator<Port>, Serializable {
- private static final long serialVersionUID = 1L;
-
@Override
public int compare(Port port1, Port port2) {
return extractInt(port1) - extractInt(port2);
*/
package io.lighty.controllers.tpce.exception;
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class TechnicalException extends RuntimeException {
- /**
- * serial id.
- */
- private static final long serialVersionUID = 1359762809539335449L;
-
/**
* Default constructor.
*/
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPortsByName implements Comparator<String>, Serializable {
- private static final long serialVersionUID = 1L;
-
@Override
public int compare(String port1, String port2) {
int num = extractInt(port1) - extractInt(port2);
import org.jgrapht.graph.DefaultWeightedEdge;
import org.opendaylight.transportpce.pce.networkanalyzer.PceLink;
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class PceGraphEdge extends DefaultWeightedEdge {
- private static final long serialVersionUID = 1L;
private PceLink link;
public PceGraphEdge(PceLink link) {
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "SE_NO_SERIALVERSIONID",
+ justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class PceLink implements Serializable {
- private static final long serialVersionUID = 1L;
/* Logging. */
private static final Logger LOG = LoggerFactory.getLogger(PceLink.class);
///////////////////////// LINKS ////////////////////