Fix changelog
diff --git a/apache-rat-core/spotbugs_ignore.xml b/apache-rat-core/spotbugs_ignore.xml
new file mode 100644
index 0000000..abb5478
--- /dev/null
+++ b/apache-rat-core/spotbugs_ignore.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!--
+ Convenience constructors that allow setting a charset are not available in Java8 for PrintStream.
+ -->
+ <Class name="org.apache.rat.Report"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+ <Match>
+ <!--
+ Convenience constructors that allow setting a charset are not available in Java8 for FileWriter.
+ -->
+ <Class name="org.apache.rat.annotation.AbstractLicenseAppender"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+ <Match>
+ <!--
+ Convenience constructors that allow setting a charset are not available in Java8 for FileReader.
+ -->
+ <Class name="org.apache.rat.document.impl.FileDocument"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.rat.document.impl.MonolithicFileDocument"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+</FindBugsFilter>
diff --git a/apache-rat-core/src/main/java/org/apache/rat/ImplementationException.java b/apache-rat-core/src/main/java/org/apache/rat/ImplementationException.java
index ed8deaf..c443938 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/ImplementationException.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/ImplementationException.java
@@ -19,7 +19,7 @@
package org.apache.rat;
/**
- * An exception thrown when there is an issue with the Configuration.
+ * An exception thrown when there is an issue with the configuration.
*/
public class ImplementationException extends RuntimeException {
diff --git a/apache-rat-core/src/main/java/org/apache/rat/Report.java b/apache-rat-core/src/main/java/org/apache/rat/Report.java
index 74ba5d1..6a8ea88 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/Report.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/Report.java
@@ -277,7 +277,7 @@
if (url == null) {
ioSupplier = () -> Files.newInputStream(Paths.get(style[0]));
} else {
- ioSupplier = () -> url.openStream();
+ ioSupplier = url::openStream;
}
configuration.setStyleSheet(ioSupplier);
}
@@ -332,8 +332,7 @@
}
static Options buildOptions() {
- String licFilterValues = String.join(", ",
- Arrays.stream(LicenseFilter.values()).map(LicenseFilter::name).collect(Collectors.toList()));
+ String licFilterValues = Arrays.stream(LicenseFilter.values()).map(LicenseFilter::name).collect(Collectors.joining(", "));
Options opts = new Options()
.addOption(Option.builder().longOpt(DRY_RUN)
diff --git a/apache-rat-core/src/main/java/org/apache/rat/Reporter.java b/apache-rat-core/src/main/java/org/apache/rat/Reporter.java
index 69d93bb..cd42e46 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/Reporter.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/Reporter.java
@@ -26,6 +26,7 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
+import java.nio.charset.StandardCharsets;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
@@ -76,7 +77,7 @@
try {
if (configuration.getReportable() != null) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- Writer outputWriter = new OutputStreamWriter(outputStream);
+ Writer outputWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
try (IXmlWriter writer = new XmlWriter(outputWriter)) {
statistic = new ClaimStatistic();
RatReport report = XmlReportFactory.createStandardReport(writer, statistic, configuration);
diff --git a/apache-rat-core/src/main/java/org/apache/rat/annotation/AbstractLicenseAppender.java b/apache-rat-core/src/main/java/org/apache/rat/annotation/AbstractLicenseAppender.java
index c1c7af9..0d21264 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/annotation/AbstractLicenseAppender.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/annotation/AbstractLicenseAppender.java
@@ -30,6 +30,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
@@ -287,7 +288,7 @@
BufferedReader br = null;
try {
fis = new FileInputStream(document);
- br = new BufferedReader(new InputStreamReader(new BOMInputStream(fis)));
+ br = new BufferedReader(new InputStreamReader(new BOMInputStream(fis), StandardCharsets.UTF_8));
if (!expectsHashPling
&& !expectsAtEcho
diff --git a/apache-rat-core/src/main/java/org/apache/rat/api/ContentType.java b/apache-rat-core/src/main/java/org/apache/rat/api/ContentType.java
index d5a2a0c..d0e8991 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/api/ContentType.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/api/ContentType.java
@@ -18,6 +18,7 @@
*/
package org.apache.rat.api;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -72,6 +73,6 @@
* @return not null
*/
public Map<String, String> getParameters() {
- return parameters;
+ return Collections.unmodifiableMap(parameters);
}
}
diff --git a/apache-rat-core/src/main/java/org/apache/rat/config/parameters/ComponentType.java b/apache-rat-core/src/main/java/org/apache/rat/config/parameters/ComponentType.java
index bdddbb5..a619e6e 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/config/parameters/ComponentType.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/config/parameters/ComponentType.java
@@ -28,6 +28,6 @@
MATCHER,
/** A Parameter for example the "id" parameter found in every component */
PARAMETER,
- /** A parameter that is supplied by the environment. Currently systems using builders have to handle seting this. For example the list of matchers for the "MatcherRefBuilder" */
- BULID_PARAMETER
+ /** A parameter that is supplied by the environment. Currently systems using builders have to handle setting this. For example the list of matchers for the "MatcherRefBuilder" */
+ BUILD_PARAMETER
}
\ No newline at end of file
diff --git a/apache-rat-core/src/main/java/org/apache/rat/config/parameters/Description.java b/apache-rat-core/src/main/java/org/apache/rat/config/parameters/Description.java
index bbf01f3..0e2affe 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/config/parameters/Description.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/config/parameters/Description.java
@@ -80,7 +80,7 @@
this.desc = desc;
this.isCollection = isCollection;
this.required = required;
- if (type == ComponentType.BULID_PARAMETER) {
+ if (type == ComponentType.BUILD_PARAMETER) {
Method m;
try {
m = BuilderParams.class.getMethod(name);
@@ -275,7 +275,7 @@
case PARAMETER:
return clazz.getMethod(methodName,
IHeaderMatcher.class.isAssignableFrom(childClass) ? IHeaderMatcher.Builder.class : childClass);
- case BULID_PARAMETER:
+ case BUILD_PARAMETER:
return clazz.getMethod(methodName, childClass);
}
// should not happen
diff --git a/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationReader.java b/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationReader.java
index fdacc1a..728f858 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationReader.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationReader.java
@@ -231,12 +231,12 @@
}
private void processBuilderParams(Description description, IHeaderMatcher.Builder builder) {
- for (Description desc : description.childrenOfType(ComponentType.BULID_PARAMETER)) {
+ for (Description desc : description.childrenOfType(ComponentType.BUILD_PARAMETER)) {
Method m = builderParams.get(desc.getCommonName());
try {
callSetter(desc, builder, m.invoke(builderParams));
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- ImplementationException.makeInstance(e);
+ throw ImplementationException.makeInstance(e);
}
}
}
@@ -270,7 +270,7 @@
return (child, childDescription) -> {
switch (childDescription.getType()) {
case LICENSE:
- case BULID_PARAMETER:
+ case BUILD_PARAMETER:
throw new ConfigurationException(String.format(
"%s may not be used as an enclosed matcher. %s '%s' found in '%s'", childDescription.getType(),
childDescription.getType(), childDescription.getCommonName(), description.getCommonName()));
@@ -411,7 +411,7 @@
throw new ConfigurationException(String.format(
"%s may not be enclosed in another license. %s '%s' found in '%s'", childDescription.getType(),
childDescription.getType(), childDescription.getCommonName(), description.getCommonName()));
- case BULID_PARAMETER:
+ case BUILD_PARAMETER:
break;
case MATCHER:
AbstractBuilder b = parseMatcher(child);
diff --git a/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationWriter.java b/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationWriter.java
index 1beb45f..c049dc9 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationWriter.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/configuration/XMLConfigurationWriter.java
@@ -285,7 +285,7 @@
}
}
break;
- case BULID_PARAMETER:
+ case BUILD_PARAMETER:
// ignore;
break;
}
diff --git a/apache-rat-core/src/main/java/org/apache/rat/configuration/builders/MatcherRefBuilder.java b/apache-rat-core/src/main/java/org/apache/rat/configuration/builders/MatcherRefBuilder.java
index 06624ff..291c6f9 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/configuration/builders/MatcherRefBuilder.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/configuration/builders/MatcherRefBuilder.java
@@ -98,7 +98,7 @@
private final String proxyId;
private IHeaderMatcher wrapped;
- @ConfigComponent(type = ComponentType.BULID_PARAMETER, name = "matcherMap", desc = "Map of matcher names to matcher instances")
+ @ConfigComponent(type = ComponentType.BUILD_PARAMETER, name = "matcherMap", desc = "Map of matcher names to matcher instances")
private Map<String, IHeaderMatcher> matchers;
/**
diff --git a/apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java b/apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java
index f316fe6..f9b7f17 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java
@@ -25,6 +25,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.nio.charset.StandardCharsets;
import org.apache.rat.api.Document;
import org.apache.rat.api.MetaData;
@@ -60,7 +61,7 @@
}
public Reader reader() throws IOException {
- return new InputStreamReader(new ByteArrayInputStream(contents));
+ return new InputStreamReader(new ByteArrayInputStream(contents), StandardCharsets.UTF_8);
}
diff --git a/apache-rat-core/src/main/java/org/apache/rat/document/impl/FileDocument.java b/apache-rat-core/src/main/java/org/apache/rat/document/impl/FileDocument.java
index d8d3232..d6509bc 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/document/impl/FileDocument.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/document/impl/FileDocument.java
@@ -24,6 +24,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
import org.apache.rat.api.Document;
import org.apache.rat.api.MetaData;
@@ -61,7 +63,7 @@
}
public InputStream inputStream() throws IOException {
- return new FileInputStream(file);
+ return Files.newInputStream(file.toPath());
}
/**
diff --git a/apache-rat-core/src/main/java/org/apache/rat/document/impl/MonolithicFileDocument.java b/apache-rat-core/src/main/java/org/apache/rat/document/impl/MonolithicFileDocument.java
index dca7a53..e19c509 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/document/impl/MonolithicFileDocument.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/document/impl/MonolithicFileDocument.java
@@ -27,6 +27,7 @@
import java.io.Reader;
import java.net.URL;
import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
import org.apache.rat.api.Document;
@@ -67,6 +68,6 @@
}
public InputStream inputStream() throws IOException {
- return new FileInputStream(file);
+ return Files.newInputStream(file.toPath());
}
}
diff --git a/apache-rat-core/src/main/java/org/apache/rat/license/SimpleLicense.java b/apache-rat-core/src/main/java/org/apache/rat/license/SimpleLicense.java
index f8a3c7b..a956074 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/license/SimpleLicense.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/license/SimpleLicense.java
@@ -39,7 +39,7 @@
@ConfigComponent(type = ComponentType.LICENSE)
public class SimpleLicense implements ILicense {
- @ConfigComponent(type = ComponentType.BULID_PARAMETER, desc = "The defined license families.", name = "licenseFamilies")
+ @ConfigComponent(type = ComponentType.BUILD_PARAMETER, desc = "The defined license families.", name = "licenseFamilies")
private ILicenseFamily family;
@ConfigComponent(type = ComponentType.PARAMETER, desc = "The matcher for this license.", required = true)
diff --git a/apache-rat-plugin/spotbugs_ignore.xml b/apache-rat-plugin/spotbugs_ignore.xml
new file mode 100644
index 0000000..d2345cd
--- /dev/null
+++ b/apache-rat-plugin/spotbugs_ignore.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!--
+ Convenience constructors that allow setting a charset are not available in Java8 for FileReader.
+ -->
+ <Class name="org.apache.rat.mp.util.ignore.GlobIgnoreMatcher"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+</FindBugsFilter>
diff --git a/apache-rat-plugin/src/main/java/org/apache/rat/mp/util/ignore/GlobIgnoreMatcher.java b/apache-rat-plugin/src/main/java/org/apache/rat/mp/util/ignore/GlobIgnoreMatcher.java
index de9061b..63b2cad 100644
--- a/apache-rat-plugin/src/main/java/org/apache/rat/mp/util/ignore/GlobIgnoreMatcher.java
+++ b/apache-rat-plugin/src/main/java/org/apache/rat/mp/util/ignore/GlobIgnoreMatcher.java
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -115,7 +116,7 @@
}
public List<String> getExclusionLines() {
- return exclusionLines;
+ return Collections.unmodifiableList(exclusionLines);
}
@Override
diff --git a/apache-rat-tasks/spotbugs_ignore.xml b/apache-rat-tasks/spotbugs_ignore.xml
new file mode 100644
index 0000000..971c02a
--- /dev/null
+++ b/apache-rat-tasks/spotbugs_ignore.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!--
+ Convenience constructors that allow setting a charset are not available in Java8 for PrintStream.
+ -->
+ <Class name="org.apache.rat.anttasks.Report"/>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+</FindBugsFilter>
diff --git a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
index e7108dd..9ba88bc 100644
--- a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
+++ b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
@@ -18,11 +18,10 @@
*/
package org.apache.rat.anttasks;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.PrintWriter;
+import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -319,10 +318,9 @@
case ERROR:
write(Project.MSG_ERR, msg);
break;
- case OFF:
- break;
- default:
- break;
+ case OFF:
+ default:
+ break;
}
}
diff --git a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
index f487eb3..ca474b9 100644
--- a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
+++ b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/ResourceCollectionContainer.java
@@ -23,6 +23,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.nio.charset.StandardCharsets;
import org.apache.rat.api.Document;
import org.apache.rat.api.MetaData;
@@ -69,7 +70,7 @@
@Override
public Reader reader() throws IOException {
final InputStream in = resource.getInputStream();
- return new InputStreamReader(in);
+ return new InputStreamReader(in, StandardCharsets.UTF_8);
}
@Override
diff --git a/apache-rat-tools/spotbugs_ignore.xml b/apache-rat-tools/spotbugs_ignore.xml
new file mode 100644
index 0000000..8e4ed55
--- /dev/null
+++ b/apache-rat-tools/spotbugs_ignore.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!-- Uses tryWithResources, thus closes resource properly:
+ [ERROR] Medium: org.apache.rat.configuration.builders.ChildContainerBuilder.setResource(String) may fail to close stream
+ [org.apache.rat.configuration.builders.ChildContainerBuilder] At ChildContainerBuilder.java:[line 62] OS_OPEN_STREAM
+ <Class name="org.apache.rat.configuration.builders.ChildContainerBuilder"/>
+ <Bug pattern="OS_OPEN_STREAM"/-->
+ </Match>
+</FindBugsFilter>
diff --git a/apache-rat-tools/src/main/java/org/apache/rat/Documentation.java b/apache-rat-tools/src/main/java/org/apache/rat/Documentation.java
index 320289a..8dc5f36 100644
--- a/apache-rat-tools/src/main/java/org/apache/rat/Documentation.java
+++ b/apache-rat-tools/src/main/java/org/apache/rat/Documentation.java
@@ -103,7 +103,7 @@
writeIndent(indent, writer);
switch (d.getType()) {
case PARAMETER:
- case BULID_PARAMETER:
+ case BUILD_PARAMETER:
writer.write(String.format("'%s' %s (Datatype: %s%s)%n", d.getCommonName(), d.getDescription(),
d.isCollection() ? "Collection of " : "", d.getChildType().getSimpleName()));
break;
diff --git a/apache-rat/spotbugs_ignore.xml b/apache-rat/spotbugs_ignore.xml
new file mode 100644
index 0000000..f6a55af
--- /dev/null
+++ b/apache-rat/spotbugs_ignore.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!-- Uses tryWithResources, thus closes resource properly:
+ [ERROR] Medium: org.apache.rat.configuration.builders.ChildContainerBuilder.setResource(String) may fail to close stream
+ [org.apache.rat.configuration.builders.ChildContainerBuilder] At ChildContainerBuilder.java:[line 62] OS_OPEN_STREAM
+ -->
+ <Class name="org.apache.rat.configuration.builders.ChildContainerBuilder"/>
+ <Bug pattern="OS_OPEN_STREAM"/>
+ </Match>
+</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index e0e7857..5d69c39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -202,6 +202,10 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${mavenJavadocPluginVersion}</version>
<configuration>
@@ -285,6 +289,10 @@
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ </plugin>
</plugins>
</reporting>
<build>
@@ -299,6 +307,37 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>3.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>4.8.4.0</version>
+ <configuration>
+ <!-- TODO remove after RAT-369 is done -->
+ <failOnError>false</failOnError>
+ <!-- we only want to see our own problems and in all subpackages -->
+ <onlyAnalyze>org.apache.rat.-</onlyAnalyze>
+ <excludeFilterFile>${basedir}/spotbugs_ignore.xml</excludeFilterFile>
+ <plugins>
+ <plugin>
+ <groupId>com.h3xstream.findsecbugs</groupId>
+ <artifactId>findsecbugs-plugin</artifactId>
+ <version>1.13.0</version>
+ </plugin>
+ </plugins>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
@@ -442,6 +481,14 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
diff --git a/spotbugs_ignore.xml b/spotbugs_ignore.xml
new file mode 100644
index 0000000..8e4ed55
--- /dev/null
+++ b/spotbugs_ignore.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <!-- Uses tryWithResources, thus closes resource properly:
+ [ERROR] Medium: org.apache.rat.configuration.builders.ChildContainerBuilder.setResource(String) may fail to close stream
+ [org.apache.rat.configuration.builders.ChildContainerBuilder] At ChildContainerBuilder.java:[line 62] OS_OPEN_STREAM
+ <Class name="org.apache.rat.configuration.builders.ChildContainerBuilder"/>
+ <Bug pattern="OS_OPEN_STREAM"/-->
+ </Match>
+</FindBugsFilter>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d9e8f1c..25cc77e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -72,11 +72,14 @@
</release>
-->
<release version="0.17-SNAPSHOT" date="xxxx-yy-zz" description="Current SNAPSHOT - release to be done">
+ <action issue="RAT-366" type="add" dev="pottlinger">
+ Integrate checkstyle and spotbugs into the build and webpage generation. Most charset-related errors cannot be fixed until we break JDK8-compliance and move to newer versions.
+ </action>
<action issue="RAT-301" type="fix" dev="pottlinger" due-to="claudenw">
Chinese characters in comments are not classified as binary anymore (due to Tika integration).
</action>
- <action issue="RAT-54" type="fix" dev="claudenw">
- MIME Detection Using Tika
+ <action issue="RAT-54" type="add" dev="claudenw">
+ MIME Detection Using Apache Tika.
</action>
<action issue="RAT-20" type="fix" dev="claudenw">
Changed to detecting binary by content not name.
@@ -84,8 +87,8 @@
<action issue="RAT-147" type="fix" dev="claudenw">
Change to detect non UTF-8 text files as text not binary.
</action>
- <action issue="RAT-150" type="fix" dev="claudenw">
- Switch to Tika to detect file types.
+ <action issue="RAT-150" type="add" dev="claudenw">
+ Switch to Apache Tika to detect file types.
</action>
<action issue="RAT-211" type="fix" dev="claudenw">
Generated rat-output.xml is now well-formed, even if BinaryGuesser fails or there is XML content
@@ -117,13 +120,12 @@
<action issue="RAT-367" type="fix" dev="pottlinger" due-to="Niels Basjes">
Older jUnit3 tests were not run during the build after switching to jUnit5.
</action>
- <action issue="RAT-345" type="update" dev="pottlinger" due-to="dependabot">
- TODO: collect all dependabot updates for release 0.17.
- </action>
<action issue="RAT-77" type="add" dev="claudenw">
Adds another stylesheet to explicitly output files with missing-headers. Thus plain-rat (default), missing-headers, and unapproved-licenses can be used in all RAT clients. From the CLI the -s option allows to use a short name (e.g. -s missing-headers or -s unapproved-licenses).
</action>
-
+ <action issue="RAT-345" type="update" dev="pottlinger" due-to="dependabot">
+ TODO: collect all dependabot updates for release 0.17.
+ </action>
</release>
<release version="0.16.1" date="2024-01-24" description=
"As release 0.16 introduced breaking changes concerning the configurability of the Maven plugin, these configuration options are reintroduced albeit as deprecated elements.