Skip to content

Commit

Permalink
Merge branch 'master' into env02
Browse files Browse the repository at this point in the history
# Conflicts:
#	spotbugs/etc/findbugs.xml
  • Loading branch information
JuditKnoll committed Oct 17, 2023
2 parents c7884ea + 0084a18 commit 595bb32
Show file tree
Hide file tree
Showing 248 changed files with 2,117 additions and 2,143 deletions.
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ sphinx:
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
python:
install:
- requirements: docs/requirements.txt
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ This is the changelog for SpotBugs. This follows [Keep a Changelog v1.0.0](http:

Currently the versioning policy of this project follows [Semantic Versioning v2.0.0](http://semver.org/spec/v2.0.0.html).

## Unreleased 4.8.0 - 2023-??-??
## Unreleased - 2022-??-??

### Fixed
- Fixed schema location for findbugsfilter.xsd ([[#1416](https://github.com/spotbugs/spotbugs/issues/1416)])
- Fixed missing null checks ([[#2629](https://github.com/spotbugs/spotbugs/issues/2629)])
- Disabled DontReusePublicIdentifiers due to the high false positives rate ([[#2627](https://github.com/spotbugs/spotbugs/issues/2627)])
- Removed signature of methods using UTF-8 in DefaultEncodingDetector ([[#2634](https://github.com/spotbugs/spotbugs/issues/2634)])

## 4.8.0 - 2023-10-11

### Changed
- Bump up Apache Commons BCEL to the version 6.6.1 ([#2223](https://github.com/spotbugs/spotbugs/pull/2223))
Expand Down Expand Up @@ -74,6 +82,13 @@ Currently the versioning policy of this project follows [Semantic Versioning v2.
- Delete checked in j2ee jar and instead use servlet/ejb apis from jakarta (javax standard) ([#2585](https://github.com/spotbugs/spotbugs/pull/2585))
- Bump Eclipse from 4.14 to 4.29 (latest) ([#2589](https://github.com/spotbugs/spotbugs/pull/2589))
- Cleanup hamcrest imports / used library ([#2600](https://github.com/spotbugs/spotbugs/pull/2600))
- Migrate entirely to junit 5 ([#2605](https://github.com/spotbugs/spotbugs/pull/2605))
- Some parts of codebase were junit 3
- Delete the SpotbugsRule
- Replace custom java determination on build with Junit 5 usage
- Various 'public' methods in tests fixed to 'private'
- Junit 5 styling applied throughout
- Add missing code to the SpotBugsRunner and now use the Extension as replacement of SpotbugsRule

## 4.7.3 - 2022-10-15
### Fixed
Expand Down
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id "org.sonarqube" version "4.4.1.3373"
id "org.gradle.crypto.checksum" version "1.4.0"
id "com.github.spotbugs" version "6.0.0-beta.3"
id "com.github.spotbugs" version "6.0.0-beta.5"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
}

group = 'com.github.spotbugs'
version = '4.8.0-SNAPSHOT'
version = '4.8.1-SNAPSHOT'

apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
Expand Down Expand Up @@ -71,7 +71,7 @@ def publishTask = tasks.findByName("publish")
if (publishTask == null) {
publishTask = tasks.findByName("publishToMavenLocal")
}
def outputFile = file("$buildDir/release.md")
def outputFile = layout.buildDirectory.file("release.md")
def inputFile = subprojects.collect {
it.hasProperty('publishing') ? it.publishing.publications.maven.artifacts : []
}.flatten().collect {
Expand Down Expand Up @@ -103,15 +103,16 @@ createChecksums.configure {
dependsOn(":spotbugs:distTar")
}
createReleaseBody.configure {
inputs.files fileTree("$buildDir/checksums").matching {
inputs.files fileTree(layout.buildDirectory.dir("checksums")).matching {
include "*.sha256"
}
outputs.file outputFile
dependsOn createChecksums

doLast {
outputFile.delete()
outputFile << """SpotBugs ${project.version}
File outputAsFile = outputFile.get().asFile
outputAsFile.delete()
outputAsFile << """SpotBugs ${project.version}
### CHANGELOG
- https://github.com/spotbugs/spotbugs/blob/${project.version}/CHANGELOG.md
Expand All @@ -120,14 +121,14 @@ createReleaseBody.configure {
| file | checksum (sha256) |
| ---- | ----------------- |
"""
fileTree("$buildDir/checksums").matching {
fileTree(layout.buildDirectory.dir("checksums")).matching {
include "*.sha256"
}.sort {
it.name
}.forEach {
def name = it.name.replace(".sha256", "")
def hash = it as String[]
outputFile << "| ${ name } | ${hash[0]} |\n"
outputFile.get().asFile << "| ${ name } | ${hash[0]} |\n"
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/eclipse-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ val pdeTool by configurations.creating {
}

eclipseMavenCentral {
release("4.14.0") {
release("4.29.0") {
compileOnly("org.eclipse.ant.core")
compileOnly("org.eclipse.core.resources")
compileOnly("org.eclipse.core.runtime")
Expand All @@ -34,13 +34,14 @@ eclipseMavenCentral {
/**
* Unzip "org.eclipse.pde.build" package into the outputDir.
*/
val pdeToolDir = layout.buildDirectory.dir("pdeTool")
val unzipPdeTool = tasks.register<Copy>("unzipPdeTool") {
from(zipTree(pdeTool.singleFile))
into("$buildDir/pdeTool")
into(pdeToolDir)
}

dependencies {
compileOnly(files("$buildDir/pdeTool/pdebuild.jar"){
compileOnly(files(pdeToolDir.map { it.file("pdebuild.jar") }){
builtBy(unzipPdeTool)
})
}
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import os

html_context = {
'version' : '4.7',
'full_version' : '4.7.3',
'maven_plugin_version' : '4.7.2.1',
'gradle_plugin_version' : '5.0.12',
'version' : '4.8',
'full_version' : '4.8.0',
'maven_plugin_version' : '4.8.0.0',
'gradle_plugin_version' : '6.0.0-beta.5',
'archetype_version' : '0.2.3'
}

Expand Down
4 changes: 2 additions & 2 deletions eclipsePlugin-junit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ tasks.named('compileJava', JavaCompile).configure {

dependencies {
implementation project(':eclipsePlugin')
testImplementation 'org.junit.vintage:junit-vintage-engine:5.10.0'
testImplementation 'org.mockito:mockito-core:5.5.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
testImplementation 'org.mockito:mockito-core:5.6.0'
}

tasks.named('jacocoTestReport', JacocoReport).configure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import static org.mockito.Mockito.verify;

import org.eclipse.core.runtime.IProgressMonitor;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ThrottledProgressMonitorTest {
class ThrottledProgressMonitorTest {
@Test
public void testSetTaskName() {
void testSetTaskName() {
Clock clock = new Clock();
IProgressMonitor delegate = spy(IProgressMonitor.class);
ThrottledProgressMonitor throttled = new ThrottledProgressMonitor(delegate, clock::getCurrentTime);
Expand All @@ -26,7 +26,7 @@ public void testSetTaskName() {
}

@Test
public void testWorked() {
void testWorked() {
Clock clock = new Clock();
IProgressMonitor delegate = spy(IProgressMonitor.class);
ThrottledProgressMonitor throttled = new ThrottledProgressMonitor(delegate, clock::getCurrentTime);
Expand Down
1 change: 1 addition & 0 deletions eclipsePlugin-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
}

implementation project(':test-harness')
implementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
implementation 'org.apache.ant:ant:1.10.14'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import junit.framework.TestCase;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

public abstract class AbstractCreateSuperCallResolutionExample extends TestCase {
@Override
public abstract class AbstractCreateSuperCallResolutionExample {
@AfterAll
protected void finalize() throws Throwable {
this.toString();
}

@Override
@BeforeEach
protected void setUp() throws Exception {
this.toString();
}

@Override
@AfterEach
protected void tearDown() throws Exception {
this.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
*/
package de.tobject.findbugs.actions.test;

import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IActionDelegate;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import de.tobject.findbugs.FindbugsPlugin;
import de.tobject.findbugs.actions.ClearMarkersAction;
Expand All @@ -40,14 +40,14 @@
*
* @author Tomás Pollak
*/
public class ContextMenuActionsTest extends AbstractFindBugsTest {
@BeforeClass
public static void setUpClass() throws Exception {
class ContextMenuActionsTest extends AbstractFindBugsTest {
@BeforeAll
static void setUpClass() throws Exception {
setUpTestProject(TestScenario.DEFAULT);
}

@AfterClass
public static void tearDownClass() throws CoreException {
@AfterAll
static void tearDownClass() throws CoreException {
tearDownTestProject();
}

Expand All @@ -67,7 +67,7 @@ public void tearDown() throws CoreException {
}

@Test
public void testClearFindBugs() throws CoreException {
void testClearFindBugs() throws CoreException {
assertNoBugs();

StructuredSelection selection = new StructuredSelection(getProject());
Expand All @@ -89,7 +89,7 @@ public void testClearFindBugs() throws CoreException {
}

@Test
public void testLoadXML() throws CoreException {
void testLoadXML() throws CoreException {
assertNoBugs();

StructuredSelection selection = new StructuredSelection(getProject());
Expand All @@ -103,7 +103,7 @@ public void testLoadXML() throws CoreException {
}

@Test
public void testRunFindBugs() throws CoreException {
void testRunFindBugs() throws CoreException {
assertNoBugs();

StructuredSelection selection = new StructuredSelection(getProject());
Expand All @@ -117,7 +117,7 @@ public void testRunFindBugs() throws CoreException {
}

@Test
public void testSaveXML() throws CoreException {
void testSaveXML() throws CoreException {
assertNoBugs();
work(createFindBugsWorker());
assertExpectedBugs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package de.tobject.findbugs.actions.test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Arrays;
import java.util.List;
Expand All @@ -27,9 +27,9 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.ui.PartInitException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import de.tobject.findbugs.actions.GroupByAction;
import de.tobject.findbugs.test.AbstractFindBugsTest;
Expand All @@ -41,14 +41,14 @@
*
* @author Tomás Pollak
*/
public class GroupByActionTest extends AbstractFindBugsTest {
@BeforeClass
public static void setUpClass() throws Exception {
class GroupByActionTest extends AbstractFindBugsTest {
@BeforeAll
static void setUpClass() throws Exception {
setUpTestProject(TestScenario.DEFAULT);
}

@AfterClass
public static void tearDownClass() throws CoreException {
@AfterAll
static void tearDownClass() throws CoreException {
tearDownTestProject();
}

Expand Down Expand Up @@ -85,45 +85,45 @@ public void tearDown() throws CoreException {
}

@Test
public void testAction_Priority_Category_Project_Package_Class_PatternType_Pattern_Marker() throws PartInitException {
void testAction_Priority_Category_Project_Package_Class_PatternType_Pattern_Marker() throws PartInitException {
runAction(PRIORITY_CATEGORY_PROJECT_PACKAGE_CLASS_PATTERN_TYPE_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Confidence, GroupType.Category, GroupType.Project, GroupType.Package, GroupType.Class,
GroupType.PatternType, GroupType.Pattern, GroupType.Marker);
}

@Test
public void testAction_Priority_Category_Project_PatternType_Pattern_Marker() throws PartInitException {
void testAction_Priority_Category_Project_PatternType_Pattern_Marker() throws PartInitException {
runAction(PRIORITY_CATEGORY_PROJECT_PATTERN_TYPE_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Confidence, GroupType.Category, GroupType.Project, GroupType.PatternType,
GroupType.Pattern, GroupType.Marker);
}

@Test
public void testAction_Priority_Project_Pattern_Marker() throws PartInitException {
void testAction_Priority_Project_Pattern_Marker() throws PartInitException {
runAction(PRIORITY_PROJECT_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Confidence, GroupType.Project, GroupType.Pattern, GroupType.Marker);
}

@Test
public void testAction_Project_Pattern_Marker() throws PartInitException {
void testAction_Project_Pattern_Marker() throws PartInitException {
runAction(PROJECT_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Project, GroupType.Pattern, GroupType.Marker);
}

@Test
public void testAction_Project_Priority_Category_PatternType_Pattern_Marker() throws PartInitException {
void testAction_Project_Priority_Category_PatternType_Pattern_Marker() throws PartInitException {
runAction(PROJECT_PRIORITY_CATEGORY_PATTERN_TYPE_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Project, GroupType.Confidence, GroupType.Category, GroupType.PatternType,
GroupType.Pattern, GroupType.Marker);
}

@Test
public void testAction_Project_Priority_Pattern_Marker() throws PartInitException {
void testAction_Project_Priority_Pattern_Marker() throws PartInitException {
runAction(PROJECT_PRIORITY_PATTERN_MARKER_ID);

assertExpectedGroupTypes(GroupType.Project, GroupType.Confidence, GroupType.Pattern, GroupType.Marker);
Expand Down
Loading

0 comments on commit 595bb32

Please sign in to comment.