This is an automated email from the ASF dual-hosted git repository. kturner pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo-access.git
The following commit(s) were added to refs/heads/main by this push: new 0c65546 fixes build errors (#22) 0c65546 is described below commit 0c65546f86ded3c9f25d5e90c61dde053b145382 Author: Keith Turner <ktur...@apache.org> AuthorDate: Tue Oct 3 10:06:53 2023 -0400 fixes build errors (#22) --- .github/workflows/maven.yaml | 2 +- pom.xml | 1 + src/build/ci/find-unapproved-junit.sh | 6 +++-- src/build/ci/spotbugs-exclude.xml | 26 ++++++++++++++++++++++ .../java/org/apache/accumulo/access/AeNode.java | 17 ++++++++++++++ .../accumulo/access/AccessExpressionBenchmark.java | 4 ++++ 6 files changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 0458d77..0c00f85 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -70,7 +70,7 @@ jobs: profile: - {name: 'unit-tests', javaver: 11, args: 'verify -PskipQA'} - {name: 'qa-checks', javaver: 11, args: 'verify javadoc:jar -Psec-bugs,errorprone'} - - {name: 'jdk17', javaver: 17, args: 'verify javadoc:jar -Psec-bugs,errorprone'} + - {name: 'jdk17', javaver: 17, args: 'verify'} fail-fast: false runs-on: ubuntu-latest steps: diff --git a/pom.xml b/pom.xml index 59c9f6e..e0186d2 100644 --- a/pom.xml +++ b/pom.xml @@ -194,6 +194,7 @@ <artifactId>spotbugs-maven-plugin</artifactId> <version>4.7.3.6</version> <configuration> + <excludeFilterFile>src/build/ci/spotbugs-exclude.xml</excludeFilterFile> <xmlOutput>true</xmlOutput> <effort>Max</effort> <failOnError>true</failOnError> diff --git a/src/build/ci/find-unapproved-junit.sh b/src/build/ci/find-unapproved-junit.sh index c3a898a..e6c3bbe 100755 --- a/src/build/ci/find-unapproved-junit.sh +++ b/src/build/ci/find-unapproved-junit.sh @@ -35,8 +35,10 @@ function findalljunitproblems() { fi # find any new classes using something other than the jupiter API, except those allowed grep "$opts" --include='*.java' 'org[.]junit[.](?!jupiter)' | grep -Pv "^(${ALLOWED_PIPE_SEP//./[.]})\$" - # find any uses of the jupiter API in the allowed vintage classes - grep "$opts" 'org[.]junit[.]jupiter' "${ALLOWED[@]}" + if ((${#ALLOWED[@]} != 0)); then + # find any uses of the jupiter API in the allowed vintage classes + grep "$opts" 'org[.]junit[.]jupiter' "${ALLOWED[@]}" + fi } function comparecounts() { diff --git a/src/build/ci/spotbugs-exclude.xml b/src/build/ci/spotbugs-exclude.xml new file mode 100644 index 0000000..e363407 --- /dev/null +++ b/src/build/ci/spotbugs-exclude.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 + + https://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> + <Class name="~.*\.jmh_generated\..*" /> +</Match> +</FindBugsFilter> diff --git a/src/main/java/org/apache/accumulo/access/AeNode.java b/src/main/java/org/apache/accumulo/access/AeNode.java index b627367..f1e28d1 100644 --- a/src/main/java/org/apache/accumulo/access/AeNode.java +++ b/src/main/java/org/apache/accumulo/access/AeNode.java @@ -39,6 +39,21 @@ abstract class AeNode implements Comparable<AeNode> { abstract int ordinal(); + @Override + public boolean equals(Object o) { + if (o instanceof AeNode) { + return compareTo((AeNode) o) == 0; + } + + return false; + } + + @Override + public int hashCode() { + throw new UnsupportedOperationException(); + } + + @Override public int compareTo(AeNode o) { return ordinal() - o.ordinal(); } @@ -224,6 +239,7 @@ abstract class AeNode implements Comparable<AeNode> { } } + @Override int ordinal() { return 3; } @@ -272,6 +288,7 @@ abstract class AeNode implements Comparable<AeNode> { } } + @Override int ordinal() { return 2; } diff --git a/src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java b/src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java index 47a7baa..56927f6 100644 --- a/src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java +++ b/src/test/java/org/apache/accumulo/access/AccessExpressionBenchmark.java @@ -39,6 +39,8 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.TimeValue; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + /** * Benchmarks Access Expressions using JMH. To run, use the following commands. * @@ -69,6 +71,8 @@ public class AccessExpressionBenchmark { private ArrayList<EvaluatorTests> evaluatorTests; + @SuppressFBWarnings(value = {"UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD"}, + justification = "Field is written by Gson") @Setup public void loadData() throws IOException { List<AccessEvaluatorTest.TestDataSet> testData = AccessEvaluatorTest.readTestData();