Skip to content

Commit

Permalink
Merge pull request #7 from Netflix/feature/UpgradeFindBugsLibrary
Browse files Browse the repository at this point in the history
Removing usage of FindBugs annotation and updating the find bugs filt…
  • Loading branch information
schakrovorthy committed Dec 15, 2015
2 parents 8867ea3 + e133a1a commit f50a2ff
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 63 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ javadoc {
}

dependencies {
compile "com.google.code.findbugs:annotations:3.+"
//compile "com.google.code.findbugs:annotations:3.+"
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile "log4j:log4j:1.2+"
compile "org.slf4j:slf4j-api:1.7+"
compile "org.slf4j:slf4j-log4j12:1.7+"
Expand Down
34 changes: 11 additions & 23 deletions config/findbugs-excludeFilter-GeneratedCode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,38 @@

<!-- Returning a reference to a mutable object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.cpl" />
<Package name="org.smpte_ra.schemas" />
<Bug pattern="EI_EXPOSE_REP" />
</Match>

<!-- Storing a reference to an externally mutable object into the internal representation of the object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.cpl" />
<Package name="org.smpte_ra.schemas" />
<Bug pattern="EI_EXPOSE_REP2" />
</Match>

<!-- Returning a reference to a mutable object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.coreconstraints" />
<Bug pattern="EI_EXPOSE_REP" />
</Match>

<!-- Storing a reference to an externally mutable object into the internal representation of the object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.coreconstraints" />
<Bug pattern="EI_EXPOSE_REP2" />
</Match>

<!-- Returning a reference to a mutable object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.dsig" />
<Bug pattern="EI_EXPOSE_REP" />
<Class name="com.netflix.imflibrary.st0377.RandomIndexPack" />
<Bug pattern="NP_ALWAYS_NULL" />
</Match>

<!-- Storing a reference to an externally mutable object into the internal representation of the object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.dsig" />
<Bug pattern="EI_EXPOSE_REP2" />
<Class name="com.netflix.imflibrary.st0377.PartitionPack" />
<Bug pattern="NP_ALWAYS_NULL" />
</Match>

<!-- Returning a reference to a mutable object. -->
<!-- Storing a reference to an externally mutable object into the internal representation of the object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.dcml" />
<Bug pattern="EI_EXPOSE_REP" />
<Source name="Sequence.java" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" />
</Match>

<!-- Storing a reference to an externally mutable object into the internal representation of the object. -->
<Match>
<Package name="com.netflix.imflibrary.imf.dcml" />
<Bug pattern="EI_EXPOSE_REP2" />
<Source name="ContentStorage.java" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" />
</Match>

</FindBugsFilter>
3 changes: 0 additions & 3 deletions generated/org/smpte_ra/schemas/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2000/09/xmldsig#", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
@SuppressFBWarnings(value={"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
package org.smpte_ra.schemas;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
25 changes: 0 additions & 25 deletions src/main/java/com/netflix/imflibrary/st0377/HeaderPartition.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import com.netflix.imflibrary.st0377.header.StructuralMetadata;
import com.netflix.imflibrary.st0377.header.TimelineTrack;
import com.netflix.imflibrary.st0377.header.WaveAudioEssenceDescriptor;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
Expand Down Expand Up @@ -953,28 +952,4 @@ else if(!entry.getKey().equals(Preface.class.getSimpleName())){
}
return sb.toString();
}

/**
* The entry point of application.
*
* @param args the input arguments
*/
@SuppressFBWarnings({"DLS_DEAD_LOCAL_STORE"})
public static void main(String[] args)
{
Node nodeA = new Node(new MXFUid(new byte[0]));
Node nodeB = new Node(new MXFUid(new byte[0]));
Node nodeC = new Node(new MXFUid(new byte[0]));
Node nodeD = new Node(new MXFUid(new byte[0]));
nodeA.depends.add(nodeB);
nodeB.depends.add(nodeC);
nodeB.depends.add(nodeD);
nodeC.depends.add(nodeD);
List<Node> adjacencyList = new ArrayList<>();
adjacencyList.add(nodeD);
adjacencyList.add(nodeC);
adjacencyList.add(nodeB);
adjacencyList.add(nodeA);
List<Node> sortedList = resolve(adjacencyList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.netflix.imflibrary.annotations.MXFField;
import com.netflix.imflibrary.MXFFieldPopulator;
import com.netflix.imflibrary.MXFKLVPacket;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
Expand Down Expand Up @@ -185,9 +184,8 @@ public PartitionPack(ByteProvider byteProvider, Long byteOffset, boolean checkFo
* @param byteOffset the byteOffset from the HeaderPartition of this partition pack
* @param checkForSucceedingKLVFillItem the check for succeeding kLV fill item
* @param imfErrorLogger the imf error logger
* @throws IOException the iO exception
* @throws IOException - any I/O related error will be exposed through an IOException
*/
@SuppressFBWarnings({"NP_ALWAYS_NULL"})
public PartitionPack(ByteProvider byteProvider, Long byteOffset, boolean checkForSucceedingKLVFillItem, @Nullable IMFErrorLogger imfErrorLogger)
throws IOException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.netflix.imflibrary.annotations.MXFField;
import com.netflix.imflibrary.MXFFieldPopulator;
import com.netflix.imflibrary.MXFKLVPacket;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.concurrent.Immutable;
import java.io.IOException;
Expand Down Expand Up @@ -58,7 +57,6 @@ public final class RandomIndexPack
* @param fullPackLength the full pack length
* @throws IOException the iO exception
*/
@SuppressFBWarnings({"NP_ALWAYS_NULL"})
public RandomIndexPack(ByteProvider byteProvider, long byteOffset, long fullPackLength) throws IOException
{
this.header = new MXFKLVPacket.Header(byteProvider, byteOffset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.netflix.imflibrary.MXFKLVPacket;
import com.netflix.imflibrary.MXFUid;
import com.netflix.imflibrary.st0377.CompoundDataTypes;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.concurrent.Immutable;
import java.io.IOException;
Expand Down Expand Up @@ -122,7 +121,7 @@ public String toString()
* Object corresponding to parsed ContentStorage structural metadata set defined in st377-1:2011
*/
@Immutable
@SuppressWarnings({"PMD.FinalFieldCouldBeStatic"}) @SuppressFBWarnings({"RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"})
@SuppressWarnings({"PMD.FinalFieldCouldBeStatic"})
public static final class ContentStorageBO extends InterchangeObjectBO
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.netflix.imflibrary.MXFKLVPacket;
import com.netflix.imflibrary.MXFUid;
import com.netflix.imflibrary.st0377.CompoundDataTypes;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import javax.annotation.concurrent.Immutable;
import java.io.IOException;
Expand Down Expand Up @@ -146,7 +145,7 @@ public String toString()
* Object corresponding to a parsed Sequence descriptive metadata set defined in st377-1:2011
*/
@Immutable
@SuppressWarnings({"PMD.FinalFieldCouldBeStatic"}) @SuppressFBWarnings({"RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"})
@SuppressWarnings({"PMD.FinalFieldCouldBeStatic"})
public static final class SequenceBO extends StructuralComponentBO
{

Expand Down
2 changes: 0 additions & 2 deletions src/test/java/testUtils/ExceptionTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package testUtils;

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

import com.netflix.imflibrary.exceptions.TestException;
import java.lang.reflect.Constructor;
Expand All @@ -27,7 +26,6 @@
import static org.testng.Assert.assertSame;
import static org.testng.Assert.fail;

@SuppressFBWarnings("REC_CATCH_EXCEPTION")
public class ExceptionTester<T extends Throwable> {

public ExceptionTester(Class<T> clazz) {
Expand Down

0 comments on commit f50a2ff

Please sign in to comment.