diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index a3bd4d9a1b2..c3aecbc0256 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -9,6 +9,22 @@ on: - 'KeY-*' jobs: + checkerFramework: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: 'corretto' + cache: 'gradle' + - name: Build with Gradle + uses: gradle/gradle-build-action@v2.4.2 + with: + arguments: -DENABLE_NULLNESS=true compileTest + + qodana: runs-on: ubuntu-latest steps: diff --git a/build.gradle b/build.gradle index 7858cbf268d..f29672c05f7 100644 --- a/build.gradle +++ b/build.gradle @@ -83,8 +83,8 @@ subprojects { compileOnly 'org.jspecify:jspecify:0.3.0' compileOnly 'io.github.eisop:checker-qual:3.34.0-eisop1' compileOnly 'io.github.eisop:checker-util:3.34.0-eisop1' - testCompileOnly 'io.github.eisop:checker-qual:3.34.0-eisop1' - checkerFramework 'io.github.eisop:checker:3.34.0-eisop1' + testCompileOnly 'io.github.eisop:checker-qual:3.34.0-eisop2' + checkerFramework 'io.github.eisop:checker:3.34.0-eisop2' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3' diff --git a/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java b/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java index 70c0580ae60..ba1af27f3c9 100644 --- a/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java +++ b/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java @@ -3,9 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-only */ package org.key_project.util.collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; +import java.util.*; import java.util.function.Predicate; import java.util.stream.Stream; import java.util.stream.StreamSupport; @@ -64,6 +62,10 @@ private DefaultImmutableSet(ImmutableList elementList) { this.elementList = elementList; } + public static ImmutableSet fromCollection(Collection seq) { + return new DefaultImmutableSet<>(ImmutableList.fromList(seq)); + } + // private static HashSet previousComplains = new HashSet<>(); private void complainAboutSize() { // // Immutable linear sets are very expensive with O(n) addition diff --git a/settings.gradle b/settings.gradle index b6b30a65546..fd11d70f3d6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,4 +16,5 @@ include 'keyext.slicing' include 'keyext.caching' // ENABLE NULLNESS here or on the CLI +// This flag is activated to enable the checker framework. // System.setProperty("ENABLE_NULLNESS", "true") \ No newline at end of file