Loading .gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ variables: pages: stage: deploy image: $CI_REGISTRY/sw4j-net/jdk8-maven3/master:latest image: $CI_REGISTRY/sw4j-net/jdk8-maven3:latest only: refs: - master Loading @@ -20,7 +20,7 @@ pages: jdk11: stage: deploy image: $CI_REGISTRY/sw4j-net/jdk11-maven3/master:latest image: $CI_REGISTRY/sw4j-net/jdk11-maven3:latest only: refs: - master Loading pom.xml +11 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,8 @@ <spotbugs-version>3.1.8</spotbugs-version> <spotbugs-plugin-version>3.1.7</spotbugs-plugin-version> <fluido.skin.version>1.7</fluido.skin.version> <jxr-plugin-version>3.0.0</jxr-plugin-version> <!-- No update to JXR plugin version 3.0.0 because this version has a bug that renders the classes incorrect --> <jxr-plugin-version>2.5</jxr-plugin-version> <site-plugin-version>3.7.1</site-plugin-version> <!-- Reporting Plugins --> Loading @@ -61,6 +62,10 @@ <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </dependency> <dependency> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> </dependency> </dependencies> <dependencyManagement> Loading @@ -70,6 +75,11 @@ <artifactId>jsr305</artifactId> <version>${jsr305-version}</version> </dependency> <dependency> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> <version>${spotbugs-version}</version> </dependency> </dependencies> </dependencyManagement> Loading src/main/java/org/sw4j/examples/bitoperation/CheckSign.java +15 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ */ package org.sw4j.examples.bitoperation; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "BIT: Check for sign of bitwise operation" {@code (BIT_SIGNED_CHECK)}. */ Loading @@ -23,9 +25,22 @@ public class CheckSign { private static final int FLAG = 0x40000000; private static final int HIGHEST_FLAG = 0x80000000; public boolean bug(int value) { boolean flagSet = ((value & FLAG) > 0); return flagSet; } public boolean highBitBug(int value) { boolean flagSet = ((value & HIGHEST_FLAG) > 0); return flagSet; } @SuppressFBWarnings(value="BIT_SIGNED_CHECK") public boolean suppressedBug(int value) { boolean flagSet = ((value & FLAG) > 0); return flagSet; } } src/main/java/org/sw4j/examples/clone/SuppressNoClone.java 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 Uwe Plonus * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.sw4j.examples.clone; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "CN: Class implements Cloneable but does not define or use clone method" {@code (CN_IDIOM)}. */ @SuppressFBWarnings(value="CN_IDIOM") public class SuppressNoClone implements Cloneable { } src/main/java/org/sw4j/examples/clone/SuppressNoCloneable.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 Uwe Plonus * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.sw4j.examples.clone; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "CN: Class defines clone() but doesn't implement Cloneable" {@code (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)}. */ @SuppressFBWarnings(value="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE") public class SuppressNoCloneable { @Override public Object clone() { return new SuppressNoCloneable(); } } Loading
.gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ variables: pages: stage: deploy image: $CI_REGISTRY/sw4j-net/jdk8-maven3/master:latest image: $CI_REGISTRY/sw4j-net/jdk8-maven3:latest only: refs: - master Loading @@ -20,7 +20,7 @@ pages: jdk11: stage: deploy image: $CI_REGISTRY/sw4j-net/jdk11-maven3/master:latest image: $CI_REGISTRY/sw4j-net/jdk11-maven3:latest only: refs: - master Loading
pom.xml +11 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,8 @@ <spotbugs-version>3.1.8</spotbugs-version> <spotbugs-plugin-version>3.1.7</spotbugs-plugin-version> <fluido.skin.version>1.7</fluido.skin.version> <jxr-plugin-version>3.0.0</jxr-plugin-version> <!-- No update to JXR plugin version 3.0.0 because this version has a bug that renders the classes incorrect --> <jxr-plugin-version>2.5</jxr-plugin-version> <site-plugin-version>3.7.1</site-plugin-version> <!-- Reporting Plugins --> Loading @@ -61,6 +62,10 @@ <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </dependency> <dependency> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> </dependency> </dependencies> <dependencyManagement> Loading @@ -70,6 +75,11 @@ <artifactId>jsr305</artifactId> <version>${jsr305-version}</version> </dependency> <dependency> <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> <version>${spotbugs-version}</version> </dependency> </dependencies> </dependencyManagement> Loading
src/main/java/org/sw4j/examples/bitoperation/CheckSign.java +15 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ */ package org.sw4j.examples.bitoperation; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "BIT: Check for sign of bitwise operation" {@code (BIT_SIGNED_CHECK)}. */ Loading @@ -23,9 +25,22 @@ public class CheckSign { private static final int FLAG = 0x40000000; private static final int HIGHEST_FLAG = 0x80000000; public boolean bug(int value) { boolean flagSet = ((value & FLAG) > 0); return flagSet; } public boolean highBitBug(int value) { boolean flagSet = ((value & HIGHEST_FLAG) > 0); return flagSet; } @SuppressFBWarnings(value="BIT_SIGNED_CHECK") public boolean suppressedBug(int value) { boolean flagSet = ((value & FLAG) > 0); return flagSet; } }
src/main/java/org/sw4j/examples/clone/SuppressNoClone.java 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 Uwe Plonus * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.sw4j.examples.clone; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "CN: Class implements Cloneable but does not define or use clone method" {@code (CN_IDIOM)}. */ @SuppressFBWarnings(value="CN_IDIOM") public class SuppressNoClone implements Cloneable { }
src/main/java/org/sw4j/examples/clone/SuppressNoCloneable.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 Uwe Plonus * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.sw4j.examples.clone; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Example for "CN: Class defines clone() but doesn't implement Cloneable" {@code (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)}. */ @SuppressFBWarnings(value="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE") public class SuppressNoCloneable { @Override public Object clone() { return new SuppressNoCloneable(); } }