Commit 71ff4d73 authored by Mattias Ulbrich's avatar Mattias Ulbrich
Browse files

Merge branch 'weigl/jb2jsr305' into 'master'

change jetbrains annotation against jsr305 one.

See merge request key/key!359
parents d732f746 8e89372a
......@@ -80,7 +80,7 @@ subprojects {
}
dependencies {
compile 'org.jetbrains:annotations:20.1.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
testCompile 'junit:junit:4.12'
testCompile project(':key.util')
}
......
package de.uka.ilkd.key.settings;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.util.Collection;
......@@ -269,7 +269,7 @@ public class TestGenerationSettings implements Settings, Cloneable {
private static @Nullable TestGenerationSettings instance;
public static @NotNull TestGenerationSettings getInstance() {
public static @Nonnull TestGenerationSettings getInstance() {
if (instance == null) {
instance = new TestGenerationSettings();
ProofIndependentSettings.DEFAULT_INSTANCE.addSettings(instance);
......
......@@ -14,7 +14,7 @@
package de.uka.ilkd.key.logic;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Objects;
......@@ -29,8 +29,8 @@ import java.util.Objects;
* @see de.uka.ilkd.key.nparser.ParsingFacade#getChoices(List)
*/
public class Choice implements Named {
private final @NotNull Name name;
private final @NotNull String category;
private final @Nonnull Name name;
private final @Nonnull String category;
/**
* Creates a choice object with name <category&gt:<choice>.
......@@ -39,18 +39,18 @@ public class Choice implements Named {
this(new Name(category + ":" + choice), category);
}
public Choice(@NotNull Name name, @NotNull String category) {
public Choice(@Nonnull Name name, @Nonnull String category) {
this.name = name;
this.category = category;
}
@Override
public @NotNull Name name() {
public @Nonnull Name name() {
return name;
}
public @NotNull String category() {
public @Nonnull String category() {
return category;
}
......
......@@ -13,7 +13,7 @@
package de.uka.ilkd.key.logic;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableSet;
......
......@@ -17,7 +17,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import org.key_project.util.collection.ImmutableArray;
import de.uka.ilkd.key.logic.label.TermLabel;
......@@ -186,12 +186,12 @@ public final class TermFactory {
* @param junctor the left-associative operator to combine the terms together
* @param terms a list of non-null temrs
*/
public @NotNull Term createTerm(@NotNull Operator junctor, @NotNull List<@NotNull Term> terms) {
public @Nonnull Term createTerm(@Nonnull Operator junctor, @Nonnull List<Term> terms) {
if(terms.size()==1)
return terms.get(0);
else if (terms.size() == 2)
return createTerm(junctor, terms.get(0), terms.get(1));
final Optional<@NotNull Term> reduce = terms.stream()
final Optional<Term> reduce = terms.stream()
.reduce((a, b) -> createTerm(junctor, a, b));
if(reduce.isPresent())
return reduce.get();
......
......@@ -15,7 +15,7 @@ package de.uka.ilkd.key.logic;
import java.util.concurrent.atomic.AtomicInteger;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import org.key_project.util.collection.DefaultImmutableSet;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
......
......@@ -2,7 +2,7 @@ package de.uka.ilkd.key.nparser;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
public class BuildingIssue {
private final String message;
......
......@@ -2,7 +2,7 @@ package de.uka.ilkd.key.nparser;
import de.uka.ilkd.key.logic.Choice;
import de.uka.ilkd.key.logic.Namespace;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.*;
......@@ -19,7 +19,7 @@ public class ChoiceInformation {
/**
* A map from a found category to a set of possible (defined) options.
*/
private final Map<@NotNull String, @NotNull Set<String>> foundChoicesAndOptions = new HashMap<>();
private final Map<String, Set<String>> foundChoicesAndOptions = new HashMap<>();
/**
* This set contains categories were an options was activated.
......@@ -50,7 +50,7 @@ public class ChoiceInformation {
this.choices = choices;
}
public Map<@NotNull String, @NotNull Set<String>> getFoundChoicesAndOptions() {
public Map<String, Set<String>> getFoundChoicesAndOptions() {
return foundChoicesAndOptions;
}
......
......@@ -13,8 +13,8 @@ import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.misc.Interval;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.URL;
......@@ -31,10 +31,10 @@ import java.net.URL;
* @version 1 (5.12.19)
*/
public abstract class KeyAst<T extends ParserRuleContext> {
@NotNull
@Nonnull
final T ctx;
protected KeyAst(@NotNull T ctx) {
protected KeyAst(@Nonnull T ctx) {
this.ctx = ctx;
}
......
......@@ -13,8 +13,8 @@ import de.uka.ilkd.key.proof.init.ProblemInitializer;
import de.uka.ilkd.key.rule.Taclet;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.net.MalformedURLException;
......@@ -44,7 +44,7 @@ public class KeyIO {
private @Nullable List<BuildingIssue> warnings;
private AbbrevMap abbrevMap;
public KeyIO(@NotNull Services services, @NotNull NamespaceSet nss) {
public KeyIO(@Nonnull Services services, @Nonnull NamespaceSet nss) {
this.services = services;
this.nss = nss;
}
......@@ -65,7 +65,7 @@ public class KeyIO {
* @return a valid term
* @throws BuildingException if an unrecoverable error during construction or parsing happened
*/
public @NotNull Term parseExpression(@NotNull String expr) {
public @Nonnull Term parseExpression(@Nonnull String expr) {
return parseExpression(CharStreams.fromString(expr));
}
......@@ -76,7 +76,7 @@ public class KeyIO {
* @return a valid term
* @throws BuildingException if an unrecoverable error during construction or parsing happened
*/
public @NotNull Term parseExpression(@NotNull CharStream stream) {
public @Nonnull Term parseExpression(@Nonnull CharStream stream) {
KeyAst.Term ctx = ParsingFacade.parseExpression(stream);
ExpressionBuilder visitor = new ExpressionBuilder(services, nss);
visitor.setAbbrevMap(abbrevMap);
......@@ -95,7 +95,7 @@ public class KeyIO {
* @return a valid sequent
* @throws BuildingException if an unrecoverable error during construction or parsing happened
*/
public @NotNull Sequent parseSequence(@NotNull CharStream stream) {
public @Nonnull Sequent parseSequence(@Nonnull CharStream stream) {
KeyAst.Seq ctx = ParsingFacade.parseSequent(stream);
ExpressionBuilder visitor = new ExpressionBuilder(services, nss);
if (schemaNamespace != null)
......
......@@ -5,7 +5,7 @@ import de.uka.ilkd.key.proof.io.RuleSource;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.ATNConfigSet;
import org.antlr.v4.runtime.dfa.DFA;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.io.BufferedInputStream;
import java.io.File;
......@@ -35,7 +35,7 @@ public abstract class ParsingFacade {
* @param <T> parse tree type
* @return the {@link ParserRuleContext} inside the given ast object.
*/
public static <T extends ParserRuleContext> @NotNull T getParseRuleContext(@NotNull KeyAst<T> ast) {
public static <T extends ParserRuleContext> @Nonnull T getParseRuleContext(@Nonnull KeyAst<T> ast) {
return ast.ctx;
}
......@@ -66,7 +66,7 @@ public abstract class ParsingFacade {
* @param ctxs non-null list
* @return
*/
public static @NotNull ChoiceInformation getChoices(@NotNull List<KeyAst.File> ctxs) {
public static @Nonnull ChoiceInformation getChoices(@Nonnull List<KeyAst.File> ctxs) {
ChoiceInformation ci = new ChoiceInformation();
ChoiceFinder finder = new ChoiceFinder(ci);
ctxs.forEach(it -> it.accept(finder));
......@@ -142,7 +142,7 @@ public abstract class ParsingFacade {
* @param ctx non-null context
* @return non-null string
*/
public static @NotNull String getValue(@NotNull KeYParser.String_valueContext ctx) {
public static @Nonnull String getValue(@Nonnull KeYParser.String_valueContext ctx) {
return ctx.getText().substring(1, ctx.getText().length() - 1)
.replace("\\\"", "\"")
.replace("\\\\", "\\");
......
package de.uka.ilkd.key.nparser;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.LinkedList;
import java.util.List;
......@@ -23,7 +23,7 @@ public class ProblemInformation {
/**
* A list of class paths entries.
*/
private final @NotNull List<@NotNull String> classpath;
private final @Nonnull List<String> classpath;
/**
* Value of a "\chooseContract". If "\chooseContract" are mentioned in the file,
......@@ -121,7 +121,7 @@ public class ProblemInformation {
this.javaSource = javaSource;
}
@NotNull
@Nonnull
public List<String> getClasspath() {
return classpath;
}
......
......@@ -4,7 +4,7 @@ import de.uka.ilkd.key.proof.io.IProofFileParser;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.Token;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.LinkedHashMap;
import java.util.Map;
......@@ -42,7 +42,7 @@ public class ProofReplayer {
* @param prl the proof replayer instance
* @see #run(CharStream, IProofFileParser, int)
*/
public static void run(@NotNull Token token, CharStream input, IProofFileParser prl) {
public static void run(@Nonnull Token token, CharStream input, IProofFileParser prl) {
input.seek(1 + token.getStopIndex()); // ends now on \proof|
run(input, prl, token.getLine());
}
......
......@@ -4,7 +4,7 @@ import com.google.common.base.Strings;
import de.uka.ilkd.key.parser.Location;
import de.uka.ilkd.key.util.MiscTools;
import org.antlr.v4.runtime.*;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import java.net.MalformedURLException;
import java.net.URL;
......
......@@ -4,8 +4,8 @@ import de.uka.ilkd.key.nparser.BuildingIssue;
import de.uka.ilkd.key.nparser.KeYParserBaseVisitor;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.RuleContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.stream.Collectors;
......@@ -112,7 +112,7 @@ abstract class AbstractBuilder<T> extends KeYParserBaseVisitor<T> {
.collect(Collectors.toList());
}
public @NotNull List<BuildingIssue> getBuildingIssues() {
public @Nonnull List<BuildingIssue> getBuildingIssues() {
if (buildingIssues == null) buildingIssues = new LinkedList<>();
return buildingIssues;
}
......
......@@ -3,7 +3,7 @@ package de.uka.ilkd.key.nparser.builder;
import com.google.common.base.CharMatcher;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
/**
* @author Alexander Weigl
......
......@@ -5,7 +5,7 @@ import de.uka.ilkd.key.logic.Name;
import de.uka.ilkd.key.logic.Namespace;
import de.uka.ilkd.key.nparser.ChoiceInformation;
import de.uka.ilkd.key.nparser.KeYParser;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.*;
......@@ -18,14 +18,14 @@ import java.util.*;
* @see ChoiceInformation
*/
public class ChoiceFinder extends AbstractBuilder<Object> {
@NotNull
@Nonnull
private final ChoiceInformation choiceInformation;
public ChoiceFinder() {
choiceInformation = new ChoiceInformation();
}
public ChoiceFinder(@NotNull ChoiceInformation choiceInformation) {
public ChoiceFinder(@Nonnull ChoiceInformation choiceInformation) {
this.choiceInformation = choiceInformation;
}
......@@ -80,7 +80,7 @@ public class ChoiceFinder extends AbstractBuilder<Object> {
return c;
}
@NotNull
@Nonnull
public ChoiceInformation getChoiceInformation() {
return choiceInformation;
}
......
......@@ -14,7 +14,7 @@ import de.uka.ilkd.key.speclang.ClassInvariant;
import de.uka.ilkd.key.speclang.Contract;
import de.uka.ilkd.key.speclang.FunctionalOperationContract;
import de.uka.ilkd.key.speclang.dl.translation.DLSpecFactory;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
......@@ -27,8 +27,8 @@ import java.util.List;
*/
public class ContractsAndInvariantsFinder extends ExpressionBuilder {
private final DeclarationBuilder declarationBuilder;
private final List<@NotNull Contract> contracts = new ArrayList<>();
private final List<@NotNull ClassInvariant> invariants = new ArrayList<>();
private final List<Contract> contracts = new ArrayList<>();
private final List<ClassInvariant> invariants = new ArrayList<>();
private ParsableVariable selfVar;
......@@ -38,11 +38,11 @@ public class ContractsAndInvariantsFinder extends ExpressionBuilder {
declarationBuilder = new DeclarationBuilder(services, nss);
}
public @NotNull List<@NotNull Contract> getContracts() {
public @Nonnull List<Contract> getContracts() {
return contracts;
}
public @NotNull List<@NotNull ClassInvariant> getInvariants() {
public @Nonnull List<ClassInvariant> getInvariants() {
return invariants;
}
......
......@@ -17,7 +17,7 @@ import de.uka.ilkd.key.pp.AbbrevMap;
import de.uka.ilkd.key.util.Debug;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nullable;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSet;
......
......@@ -3,7 +3,7 @@ package de.uka.ilkd.key.nparser.builder;
import de.uka.ilkd.key.nparser.KeYParser;
import de.uka.ilkd.key.nparser.ParsingFacade;
import de.uka.ilkd.key.nparser.ProblemInformation;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Objects;
......@@ -17,7 +17,7 @@ import static de.uka.ilkd.key.nparser.builder.BuilderHelpers.trim;
* @see #getProblemInformation()
*/
public class FindProblemInformation extends AbstractBuilder<Object> {
private final @NotNull ProblemInformation information = new ProblemInformation();
private final @Nonnull ProblemInformation information = new ProblemInformation();
@Override
public Object visitFile(KeYParser.FileContext ctx) {
......@@ -94,7 +94,7 @@ public class FindProblemInformation extends AbstractBuilder<Object> {
/**
* The found problem information.
*/
public @NotNull ProblemInformation getProblemInformation() {
public @Nonnull ProblemInformation getProblemInformation() {
return information;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment