Skip to content

Commit

Permalink
Declare SuppressFBWarnings in imports
Browse files Browse the repository at this point in the history
Improve code readability

JIRA: TRNSPRTPCE-755
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: Ic2ff74f5b9948126a2be87764652f757871112cc
  • Loading branch information
gthouenon committed Oct 13, 2023
1 parent 593a68f commit eae8db3
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
*/
package org.opendaylight.transportpce.common.catalog;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.openroadm.operational.mode.catalog.rev211210.operational.mode.transponder.parameters.Penalties;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class PenaltiesComparator implements Comparator<Penalties>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opendaylight.transportpce.common.mapping;

import com.google.common.util.concurrent.FluentFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -421,7 +422,7 @@ private String createLogicalConnectionPort(Ports port, int index, int portIndex)
return null;
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SLF4J_UNKNOWN_ARRAY",
justification = "False positive")
private Map<Integer, Degree> getDegreesMap(String deviceId, Info ordmInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opendaylight.transportpce.common.mapping;

import com.google.common.util.concurrent.FluentFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -574,7 +575,7 @@ private String createLogicalConnectionPort(Ports port, int index, int portIndex)
return null;
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SLF4J_UNKNOWN_ARRAY",
justification = "False positive")
private Map<Integer, Degree> getDegreesMap(String deviceId, Info ordmInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opendaylight.transportpce.common.mapping;

import com.google.common.util.concurrent.FluentFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -654,7 +655,7 @@ private Map<McCapabilityProfileKey, McCapabilityProfile> getMcCapabilityProfiles
return mcCapabilityProfiles;
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SLF4J_UNKNOWN_ARRAY",
justification = "False positive")
private Map<Integer, Degree> getDegreesMap(String deviceId, Info ordmInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.opendaylight.transportpce.common.mapping;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
Expand All @@ -19,7 +20,7 @@
*
*/
@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPort121ByName implements Comparator<Port>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.opendaylight.transportpce.common.mapping;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.Port;
Expand All @@ -19,7 +20,7 @@
*
*/
@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPort221ByName implements Comparator<Port>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.opendaylight.transportpce.common.mapping;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.Port;
Expand All @@ -18,7 +19,7 @@
*
*/
@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPort710ByName implements Comparator<Port>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand All @@ -28,7 +29,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "UL_UNRELEASED_LOCK_EXCEPTION_PATH",
@SuppressFBWarnings(value = "UL_UNRELEASED_LOCK_EXCEPTION_PATH",
justification = "This appears to be doing exactly the right thing with the finally-clause to release the lock")
public class RequestProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

package org.opendaylight.transportpce.common.openroadminterfaces;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class OpenRoadmInterfaceException extends Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.opendaylight.transportpce.inventory;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Expand All @@ -16,7 +17,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification = "TODO review the SQL statement generation process")
public class INode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static org.opendaylight.transportpce.inventory.utils.StringUtils.prepareDashString;
import static org.opendaylight.transportpce.inventory.utils.StringUtils.prepareEmptyString;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Expand Down Expand Up @@ -83,7 +84,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification = "TODO review the SQL statement generation process")
public class INode121 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.opendaylight.transportpce.inventory.utils.StringUtils.prepareDashString;
import static org.opendaylight.transportpce.inventory.utils.StringUtils.prepareEmptyString;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Expand Down Expand Up @@ -79,7 +80,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification = "TODO review the SQL statement generation process")
public class INode221 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
*/
package io.lighty.controllers.tpce.exception;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class TechnicalException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.opendaylight.transportpce.pce;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;

Expand All @@ -17,7 +18,7 @@
*
*/
@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class SortPortsByName implements Comparator<String>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

package org.opendaylight.transportpce.pce.gnpy.utils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev210705.path.description.atoz.direction.AToZ;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class AToZComparator implements Comparator<AToZ>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

package org.opendaylight.transportpce.pce.gnpy.utils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Comparator;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev210705.path.description.ztoa.direction.ZToA;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class ZToAComparator implements Comparator<ZToA>, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
*/
package org.opendaylight.transportpce.pce.graph;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.opendaylight.transportpce.pce.networkanalyzer.PceLink;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class PceGraphEdge extends DefaultWeightedEdge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.opendaylight.transportpce.pce.networkanalyzer;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
Expand All @@ -32,7 +33,7 @@
import org.slf4j.LoggerFactory;

@SuppressWarnings("serial")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SE_NO_SERIALVERSIONID",
justification = "https://github.com/rzwitserloot/lombok/wiki/WHY-NOT:-serialVersionUID")
public class PceLink implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package org.opendaylight.transportpce.renderer;

import com.google.common.util.concurrent.ListenableFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
Expand Down Expand Up @@ -390,7 +391,7 @@ private static void populateTreeMap(Map<Integer, NodeIdPair> treeMap, Resource r
}
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = {"NP_LOAD_OF_KNOWN_NULL_VALUE","RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"},
justification = "loop when value is not always null - "
+ "TODO: check if something exists in Java lib")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.google.common.collect.Sets;
import com.google.common.util.concurrent.FluentFuture;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -640,7 +641,7 @@ private void setTopologyForService(String name, Topology topo)
}
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
@SuppressFBWarnings(
value = "SLF4J_FORMAT_SHOULD_BE_CONST",
justification = "Log messages content needs to be formatted before"
+ "since they are used in the returned object")
Expand Down
Loading

0 comments on commit eae8db3

Please sign in to comment.