Skip to content

Commit 9d102b5

Browse files
authored
replace JSR305 annotations with JSpecify (#3290)
This PR replaces the JSR305 annotations with the JSpecify annotations. In preparation to #3183.
2 parents 043c97c + adc7a24 commit 9d102b5

208 files changed

Lines changed: 782 additions & 678 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,17 @@ subprojects {
7171

7272
dependencies {
7373
implementation("org.slf4j:slf4j-api:2.0.9")
74-
testImplementation("ch.qos.logback:logback-classic:1.4.11")
75-
76-
//compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.12.0'
77-
//compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.12.0'
78-
implementation 'com.google.code.findbugs:jsr305:3.0.2'
7974

75+
testImplementation("ch.qos.logback:logback-classic:1.4.11")
8076
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
8177
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
78+
testImplementation project(':key.util')
79+
8280
testCompileOnly 'junit:junit:4.13.2'
8381
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.0'
8482
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
8583

86-
87-
testImplementation project(':key.util')
84+
implementation("org.jspecify:jspecify:0.3.0")
8885
}
8986

9087
tasks.withType(JavaCompile) {

key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/rule/ModalitySideProofRule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import org.key_project.util.collection.ImmutableArray;
3939
import org.key_project.util.collection.ImmutableList;
4040

41+
import org.jspecify.annotations.NonNull;
42+
4143
/**
4244
* <p>
4345
* A {@link BuiltInRule} which evaluates a modality in a side proof.
@@ -132,6 +134,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
132134
/**
133135
* {@inheritDoc}
134136
*/
137+
@NonNull
135138
@Override
136139
public ImmutableList<Goal> apply(Goal goal, Services services, RuleApp ruleApp)
137140
throws RuleAbortException {

key.core.testgen/src/main/java/de/uka/ilkd/key/settings/TestGenerationSettings.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
import java.io.File;
77
import java.util.Properties;
8-
import javax.annotation.Nonnull;
9-
import javax.annotation.Nullable;
8+
9+
import org.jspecify.annotations.NonNull;
10+
import org.jspecify.annotations.Nullable;
1011

1112
public class TestGenerationSettings extends AbstractSettings {
1213
// region Default Values for option fields
@@ -279,7 +280,7 @@ public void set(TestGenerationSettings settings) {
279280
@Nullable
280281
private static TestGenerationSettings instance;
281282

282-
public static @Nonnull TestGenerationSettings getInstance() {
283+
public static @NonNull TestGenerationSettings getInstance() {
283284
if (instance == null) {
284285
instance = new TestGenerationSettings();
285286
ProofIndependentSettings.DEFAULT_INSTANCE.addSettings(instance);

key.core/src/main/java/de/uka/ilkd/key/java/ParseExceptionInFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
package de.uka.ilkd.key.java;
55

66
import java.net.MalformedURLException;
7-
import javax.annotation.Nullable;
87

98
import de.uka.ilkd.key.parser.Location;
109
import de.uka.ilkd.key.util.ExceptionTools;
1110
import de.uka.ilkd.key.util.parsing.HasLocation;
1211

12+
import org.jspecify.annotations.Nullable;
1313
import recoder.parser.ParseException;
1414

1515
/**

key.core/src/main/java/de/uka/ilkd/key/java/PosConvertException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66

77
import java.net.MalformedURLException;
8-
import javax.annotation.Nullable;
98

109
import de.uka.ilkd.key.parser.Location;
1110
import de.uka.ilkd.key.util.parsing.HasLocation;
1211

12+
import org.jspecify.annotations.Nullable;
1313
import recoder.java.CompilationUnit;
1414
import recoder.kit.UnitKit;
1515
import recoder.service.UnresolvedReferenceException;

key.core/src/main/java/de/uka/ilkd/key/java/PositionInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import java.net.URL;
99
import java.nio.file.Paths;
1010
import java.util.Optional;
11-
import javax.annotation.Nullable;
1211

12+
import org.jspecify.annotations.Nullable;
1313
import recoder.java.SourceElement;
1414

1515
/**

key.core/src/main/java/de/uka/ilkd/key/java/Recoder2KeY.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.nio.charset.StandardCharsets;
99
import java.nio.file.Paths;
1010
import java.util.*;
11-
import javax.annotation.Nullable;
1211

1312
import de.uka.ilkd.key.java.abstraction.KeYJavaType;
1413
import de.uka.ilkd.key.java.abstraction.NullType;
@@ -29,6 +28,7 @@
2928
import org.key_project.util.collection.ImmutableList;
3029
import org.key_project.util.collection.ImmutableSLList;
3130

31+
import org.jspecify.annotations.Nullable;
3232
import org.slf4j.Logger;
3333
import org.slf4j.LoggerFactory;
3434
import recoder.ModelException;

key.core/src/main/java/de/uka/ilkd/key/java/recoderext/JMLTransformer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import java.net.URI;
77
import java.util.*;
8-
import javax.annotation.Nonnull;
98

109
import de.uka.ilkd.key.parser.Location;
1110
import de.uka.ilkd.key.settings.ProofIndependentSettings;
@@ -22,6 +21,7 @@
2221

2322
import org.antlr.v4.runtime.ParserRuleContext;
2423
import org.antlr.v4.runtime.misc.Interval;
24+
import org.jspecify.annotations.NonNull;
2525
import recoder.CrossReferenceServiceConfiguration;
2626
import recoder.abstraction.Constructor;
2727
import recoder.abstraction.Method;
@@ -732,7 +732,7 @@ private static class TypeDeclarationCollector extends SourceVisitor {
732732

733733
final HashSet<TypeDeclaration> result = new LinkedHashSet<>();
734734

735-
public void walk(@Nonnull SourceElement s) {
735+
public void walk(@NonNull SourceElement s) {
736736
s.accept(this);
737737
if (s instanceof NonTerminalProgramElement pe) {
738738
for (int i = 0; i < pe.getChildCount(); i++) {

key.core/src/main/java/de/uka/ilkd/key/ldt/CharListLDT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: GPL-2.0-only */
44
package de.uka.ilkd.key.ldt;
55

6-
import javax.annotation.Nullable;
7-
86
import de.uka.ilkd.key.java.ConvertException;
97
import de.uka.ilkd.key.java.Expression;
108
import de.uka.ilkd.key.java.Services;
@@ -21,6 +19,8 @@
2119

2220
import org.key_project.util.ExtList;
2321

22+
import org.jspecify.annotations.Nullable;
23+
2424

2525
public final class CharListLDT extends LDT {
2626

key.core/src/main/java/de/uka/ilkd/key/ldt/IntegerLDT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: GPL-2.0-only */
44
package de.uka.ilkd.key.ldt;
55

6-
import javax.annotation.Nullable;
7-
86
import de.uka.ilkd.key.java.Expression;
97
import de.uka.ilkd.key.java.Services;
108
import de.uka.ilkd.key.java.abstraction.PrimitiveType;
@@ -24,6 +22,7 @@
2422

2523
import org.key_project.util.ExtList;
2624

25+
import org.jspecify.annotations.Nullable;
2726
import org.slf4j.Logger;
2827
import org.slf4j.LoggerFactory;
2928

0 commit comments

Comments
 (0)