Terms of Service | Privacy Policy | Cookie Policy

Commit 71e94344 authored by Uwe Plonus's avatar Uwe Plonus

Merge branch 'master' into 'master'

Adjusted image to new infrastructure

See merge request !2
parents 4a7398ba 48d86a55
Pipeline #605 passed with stage
in 5 minutes and 53 seconds
......@@ -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
......@@ -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
......
......@@ -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 -->
......@@ -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>
......@@ -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>
......
......@@ -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)}.
*/
......@@ -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;
}
}
/*
* 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 {
}
/*
* 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();
}
}
/*
* 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: clone method does not call super.clone()" {@code (CN_IDIOM_NO_SUPER_CALL)}.
*/
public class SuppressNoSuperClone implements Cloneable {
@SuppressFBWarnings(value="CN_IDIOM_NO_SUPER_CALL")
@Override
public Object clone() throws CloneNotSupportedException {
SuppressNoSuperClone clone = new SuppressNoSuperClone();
return clone;
}
}
/*
* 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.compare;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Example for "Co: Abstract class defines covariant compareTo() method" {@code (CO_ABSTRACT_SELF)}.
*/
@SuppressFBWarnings(value="CO_ABSTRACT_SELF")
public abstract class SuppressCovariant implements Comparable<SuppressCovariant> {
@Override
public abstract int compareTo(SuppressCovariant o);
}
/*
* 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.equals;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Example for "BC: Equals method should not assume anything about the type of its argument"
* {@code (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS)}.
*/
public class SuppressEqualsAssume {
@SuppressFBWarnings(value="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS")
@Override
public boolean equals(Object obj) {
SuppressEqualsAssume toCompare = (SuppressEqualsAssume)obj;
return toCompare == this;
}
@Override
public int hashCode() {
return super.hashCode();
}
}
......@@ -16,6 +16,8 @@
*/
package org.sw4j.examples.nullpointer;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Example for "NP: Method with Boolean return type returns explicit null" {@code (NP_BOOLEAN_RETURN_NULL)}.
*/
......@@ -25,4 +27,14 @@ public class BooleanReturnsNull {
return null;
}
public Boolean variableBooleanMethod() {
Boolean result = null;
return result;
}
@SuppressFBWarnings(value="NP_BOOLEAN_RETURN_NULL")
public Boolean suppressedBooleanMethod() {
return null;
}
}
......@@ -16,6 +16,8 @@
*/
package org.sw4j.examples.numbers;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Example for "CNT: Rough value of known constant found" {@code (CNT_ROUGH_CONSTANT_VALUE)}.
*/
......@@ -25,4 +27,13 @@ public class KnownConstant {
return diameter * 3.141;
}
public static double approxCircumference(double diameter) {
return diameter * 3.1;
}
@SuppressFBWarnings(value="CNT_ROUGH_CONSTANT_VALUE")
public static double suppressedCircumference(double diameter) {
return diameter * 3.141;
}
}
/*
* Copyright (C) 2018 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.swing;
import javax.swing.JFrame;
/**
* Example for "SW: Certain swing methods needs to be invoked in Swing thread"
* {@code (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD)}.
*/
public class BugSwingThread {
public static void main(String... args) {
JFrame jFrame = new JFrame();
jFrame.setVisible(true);
}
public void init() {
JFrame jFrame = new JFrame();
jFrame.setVisible(true);
}
}
/*
* Copyright (C) 2018 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.swing;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
/**
* Example for "SW: Certain swing methods needs to be invoked in Swing thread"
* {@code (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD)}.
*/
public class FixedSwingThread {
public static void main(String... args) {
JFrame jFrame = new JFrame();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
jFrame.setVisible(true);
}
});
}
}
/*
* Copyright (C) 2018 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.swing;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.swing.JFrame;
/**
* Example for "SW: Certain swing methods needs to be invoked in Swing thread"
* {@code (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD)}.
*/
public class SuppressSwingThread {
@SuppressFBWarnings(value="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD")
public static void main(String... args) {
JFrame jFrame = new JFrame();
jFrame.setVisible(true);
}
}
This diff is collapsed.
......@@ -7,6 +7,9 @@
<Match>
<Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
</Match>
<Match>
<Bug pattern="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD"/>
</Match>
<Match>
<Bug pattern="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS"/>
</Match>
......@@ -978,9 +981,6 @@
<Bug pattern="STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE"/>
</Match>
<Match>
<Bug pattern="SW_SWING_METHODS_INVOKED_IN_SWING_THREAD"/>
</Match>
<Match>
<Bug pattern="VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG"/>
</Match>
<Match>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment