diff --git a/jmlparser-jml-pretty/pom.xml b/jmlparser-jml-pretty/pom.xml deleted file mode 100644 index 35a4cb6e60..0000000000 --- a/jmlparser-jml-pretty/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 4.0.0 - - - io.github.jmltoolkit - jmlparser-parent - 3.25.8-SNAPSHOT - - jmlparser-jml-pretty - - - - com.google.googlejavaformat - google-java-format - 1.16.0 - - - \ No newline at end of file diff --git a/jmlparser-jml-tools/pom.xml b/jmlparser-jml-tools/pom.xml deleted file mode 100644 index 269f795c62..0000000000 --- a/jmlparser-jml-tools/pom.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - 4.0.0 - - jmlparser-parent - io.github.jmltoolkit - 3.25.8-SNAPSHOT - - - jmlparser-jml-tools - jmlparser-jml-tools - - - UTF-8 - 1.4.6 - - - - - com.google.code.gson - gson - 2.9.1 - - - - io.github.jmltoolkit - jmlparser-core - ${project.version} - - - io.github.jmltoolkit - jmlparser-symbol-solver-core - ${project.version} - - - ch.qos.logback - logback-classic - ${logback_version} - - - - com.beust - jcommander - 1.82 - - - org.projectlombok - lombok - 1.18.30 - compile - - - - com.google.truth - truth - test - - - org.yaml - snakeyaml - 2.0 - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.jupiter - junit-jupiter-params - test - - - org.hamcrest - hamcrest-library - 2.2 - test - - - org.assertj - assertj-core - 3.20.2 - test - - - com.squareup.okhttp3 - okhttp - 4.9.1 - test - - - org.mockito - mockito-inline - test - - - diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/LineColumnIndex.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/LineColumnIndex.java deleted file mode 100644 index 717779779b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/LineColumnIndex.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.github.jmlparser; - -import com.github.javaparser.Position; -import com.github.javaparser.Range; -import org.jetbrains.annotations.NotNull; - -/** - * The index is 1-based. The first character also begins in line 1 and column 1. - * - * @author Alexander Weigl - * @version 1 (18.10.22) - */ -public class LineColumnIndex { - private final String content; - int[] lineOffsets; - - public LineColumnIndex(@NotNull String content) { - this.content = content; - lineOffsets = new int[1 + (int) content.chars().filter(it -> it == '\n').count()]; - int cur = 1; - final var chars = content.toCharArray(); - for (int i = 0; i < chars.length; i++) { - if (chars[i] == '\n') - lineOffsets[cur++] = i + 1; - } - } - - public String substring(Range range) { - return substring(range.begin, range.end); - } - - private String substring(Position begin, Position end) { - return substring(begin.line, begin.column, end.line, end.column); - } - - public String substring(int beginLine, int beginColumn, int endLine, int endColumn) { - var a = positionToOffset(beginLine, beginColumn); - var b = positionToOffset(endLine, endColumn); - return content.substring(a, b + 1); - } - - public int positionToOffset(Position p) { - return positionToOffset(p.line, p.column); - } - - public int positionToOffset(int line, int column) { - return lineOffsets[line - 1] + column - 1; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/Main.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/Main.java deleted file mode 100644 index f8b0189b34..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/Main.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.github.jmlparser; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.github.javaparser.JavaParser; -import com.github.javaparser.ParseResult; -import com.github.javaparser.ParserConfiguration; -import com.github.javaparser.Problem; -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Node; -import com.github.jmlparser.jml2java.J2JCommand; -import com.github.jmlparser.lint.JmlLintingConfig; -import com.github.jmlparser.lint.JmlLintingFacade; -import com.github.jmlparser.lint.LintCommand; -import com.github.jmlparser.lint.LintProblem; -import com.github.jmlparser.pp.PrettyPrintCommand; -import com.github.jmlparser.stat.StatCommand; -import com.github.jmlparser.wd.WdCommand; -import com.github.jmlparser.xpath.XPathCommand; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author Alexander Weigl - * @version 1 (12/31/21) - */ -public class Main { - private static final Args args = new Args(); - - public static void main(String[] argv) { - final var j2j = new J2JCommand(); - final var lint = new LintCommand(); - final var pp = new PrettyPrintCommand(); - final var stat = new StatCommand(); - final var xpath = new XPathCommand(); - final var wd = new WdCommand(); - var jc = JCommander.newBuilder() - .addCommand(j2j) - .addCommand(lint) - .addCommand(pp) - .addCommand(stat) - .addCommand(xpath) - .addCommand(wd) - .addObject(args) - .build(); - jc.parse(argv); - - ParserConfiguration config = createParserConfiguration(args); - //Collection nodes = parse(args.files, config); - - String parsedCmdStr = jc.getParsedCommand(); - if (parsedCmdStr == null) { - System.err.println("Invalid command: " + parsedCmdStr); - jc.usage(); - } else { - switch (parsedCmdStr) { - case "pp": - pp.run(); - break; - case "wd": - wd.run(); - break; - default: - System.err.println("Invalid command: " + parsedCmdStr); - jc.usage(); - } - } - } - - private static void lint(Collection nodes) { - JmlLintingConfig lconfig = createLinterConfiguration(args); - var problems = new JmlLintingFacade(lconfig).lint(nodes); - for (var problem : problems) { - report(problem); - } - } - - private static JmlLintingConfig createLinterConfiguration(Args args) { - return new JmlLintingConfig(); - } - - public static Collection parse(List files, ParserConfiguration config) { - List expanded = new ArrayList<>(files.size() * 10); - for (String file : files) { - File f = new File(file); - if (f.isDirectory()) { - expandDirectory(expanded, f); - } else { - expanded.add(f); - } - } - - return expanded.parallelStream() - .map(it -> parse(it, config)) - .map(Main::reportOnError) - .filter(Objects::nonNull) - .collect(Collectors.toList()); - } - - private static CompilationUnit reportOnError(ParseResult it) { - final Optional result = it.getResult(); - if (it.isSuccessful() && result.isPresent()) { - return result.get(); - } - for (Problem problem : it.getProblems()) { - report(problem); - } - return null; - } - - private static void report(Problem problem) { - System.out.println(problem.toString()); - } - - private static void report(LintProblem problem) { - System.out.println(problem.toString()); - } - - private static void expandDirectory(Collection target, File dir) { - File[] files = dir.listFiles(); - if (files != null) { - for (File file : files) { - if (file.isDirectory()) { - expandDirectory(target, file); - } else { - if (file.getName().endsWith(".java")) { - target.add(file); - } - } - } - } - } - - private static ParseResult - parse(File file, ParserConfiguration configuration) { - JavaParser p = new JavaParser(configuration); - try { - return p.parse(file); - } catch (FileNotFoundException e) { - report(new Problem("File not found", null, e)); - return null; - } - } - - private static ParserConfiguration createParserConfiguration(Args args) { - ParserConfiguration config = new ParserConfiguration(); - config.getJmlKeys().add(new ArrayList<>(args.activeJmlKeys)); - config.setProcessJml(!args.disableJml); - return config; - } - - static class Args { - @Parameter(names = {"--jml-keys"}) - private List activeJmlKeys = new ArrayList<>(); - - - @Parameter(names = {"-verbose"}, description = "Level of verbosity") - private Integer verbose = 1; - - @Parameter(names = {"--disable-jml"}) - private boolean disableJml = false; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/J2JCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/J2JCommand.java deleted file mode 100644 index 3b10f5716e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/J2JCommand.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"jml2java"}, - commandDescription = "Submit usage for a given customer and subscription, accepts one usage item") -public class J2JCommand { - @Parameter(names = {"-o", "--output"}, description = "Output folder of the Java Files") - private File outputFolder = new File("out"); - - @Parameter(names = {"--jbmc"}, description = "JBMC mode") - private boolean jjbmcMode = false; - @Parameter(description = "FILES") - private List files = new ArrayList<>(); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaFacade.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaFacade.java deleted file mode 100644 index 998695007a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaFacade.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.github.javaparser.ast.Jmlish; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.expr.BinaryExpr; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.ast.jml.clauses.JmlContract; -import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.ForStmt; -import com.github.javaparser.utils.Pair; - -import java.util.Stack; - -/** - * Transformation of JML expressions into equivalent Java code. - * - * @author Alexander Weigl - * @version 1 (04.10.22) - */ -public class Jml2JavaFacade { - public static Pair translate(Expression expression) { - Jml2JavaTranslator j2jt = new Jml2JavaTranslator(); - BlockStmt result = new BlockStmt(); - var e = j2jt.accept(expression, result); - return new Pair<>(result, e); - } - - public static BlockStmt embeddLoopInvariant(ForStmt stmt) { - return null; - } - - public static boolean containsJmlExpression(Expression expression) { - Stack search = new Stack<>(); - search.add(expression); - - while (!search.isEmpty()) { - Expression e = search.pop(); - if (e instanceof Jmlish) { - return true; - } - - if (e instanceof BinaryExpr be) { - if (be.getOperator() == BinaryExpr.Operator.IMPLICATION) - return true; - if (be.getOperator() == BinaryExpr.Operator.RIMPLICATION) - return true; - if (be.getOperator() == BinaryExpr.Operator.EQUIVALENCE) - return true; - if (be.getOperator() == BinaryExpr.Operator.SUB_LOCK) - return true; - if (be.getOperator() == BinaryExpr.Operator.SUB_LOCKE) - return true; - if (be.getOperator() == BinaryExpr.Operator.SUBTYPE) - return true; - if (be.getOperator() == BinaryExpr.Operator.RANGE) - return true; - } - - for (Node childNode : e.getChildNodes()) { - if (childNode instanceof Expression ex) - search.add(ex); - } - } - return false; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaTranslator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaTranslator.java deleted file mode 100644 index 7e3c4951bc..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/Jml2JavaTranslator.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.github.javaparser.ast.Modifier; -import com.github.javaparser.ast.body.VariableDeclarator; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.ast.jml.expr.JmlLetExpr; -import com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr; -import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr; -import com.github.javaparser.ast.stmt.*; -import com.github.javaparser.ast.type.PrimitiveType; -import com.github.javaparser.ast.type.VarType; -import com.github.javaparser.ast.visitor.GenericVisitorAdapter; -import com.github.jmlparser.utils.JMLUtils; -import com.github.jmlparser.utils.Pattern; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author Alexander Weigl - * @version 1 (04.10.22) - */ -public class Jml2JavaTranslator { - private final AtomicInteger counter = new AtomicInteger(); - - public Expression accept(Expression e, BlockStmt arg) { - if (Jml2JavaFacade.containsJmlExpression(e)) { - return e.accept(new Jml2JavaVisitor(), arg); - } - return e; // createAssignmentAndAdd(e, arg); - } - - private Expression createAssignmentAndAdd(Expression e, BlockStmt arg) { - arg.addAndGetStatement(createAssignmentFor(e)); - return new NameExpr(getTargetForAssignment()); - } - - private Statement createAssignmentFor(Expression e) { - var decl = new VariableDeclarationExpr( - new VariableDeclarator(new VarType(), - newTargetForAssignment(), e)); - decl.addModifier(Modifier.DefaultKeyword.FINAL); - return new ExpressionStmt(decl); - } - - private SimpleName getTargetForAssignment() { - return new SimpleName("_gen_" + counter.get()); - } - - private SimpleName newTargetForAssignment() { - counter.getAndIncrement(); - return getTargetForAssignment(); - } - - public Expression findPredicate(JmlQuantifiedExpr n) { - return n.getExpressions().get(n.getExpressions().size() - 1); - } - - public static Expression findBound(JmlQuantifiedExpr n) { - if (n.getExpressions().size() == 2) - return n.getExpressions().get(0); - else if (n.getExpressions().size() == 1) - if (n.getExpressions().get(0) instanceof BinaryExpr be) - return be.getLeft(); - throw new IllegalArgumentException("Could not determine bound."); - - } - - public static Expression findLowerBound(JmlQuantifiedExpr n, String variable) { - if (n.getExpressions().size() == 3) return n.getExpressions().get(0); - - var e = findBound(n); - - if (e instanceof JmlMultiCompareExpr mc) { - if (mc.getExpressions().size() == 3 && - mc.getExpressions().get(1) instanceof NameExpr v && - v.getNameAsString().equals(variable)) { - if (mc.getOperators().get(0) == BinaryExpr.Operator.LESS_EQUALS) - return mc.getExpressions().get(0); - if (mc.getOperators().get(0) == BinaryExpr.Operator.LESS) - return new BinaryExpr(mc.getExpressions().get(0), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - throw new IllegalStateException(); - } - } - - Expression ph = new NameExpr("_"); - { - var be = new BinaryExpr(new NameExpr(variable), ph, BinaryExpr.Operator.GREATER_EQUALS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return (Expression) result.get("min"); - } - - { - var be = new BinaryExpr(new NameExpr(variable), ph, BinaryExpr.Operator.GREATER); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return new BinaryExpr((Expression) result.get("min"), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - } - - { - var be = new BinaryExpr(ph, new NameExpr(variable), BinaryExpr.Operator.LESS_EQUALS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return (Expression) result.get("min"); - } - - { - var be = new BinaryExpr(ph, new NameExpr(variable), BinaryExpr.Operator.LESS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return new BinaryExpr((Expression) result.get("min"), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - } - - return null; - } - - public Expression findUpperBound(JmlQuantifiedExpr n, String variable) { - if (n.getExpressions().size() == 3) return n.getExpressions().get(1); - - var e = findBound(n); - - if (e instanceof JmlMultiCompareExpr mc) { - if (mc.getExpressions().size() == 3 && - mc.getExpressions().get(1) instanceof NameExpr v && - v.getNameAsString().equals(variable)) { - if (mc.getOperators().get(0) == BinaryExpr.Operator.LESS_EQUALS) - return mc.getExpressions().get(0); - if (mc.getOperators().get(0) == BinaryExpr.Operator.LESS) - return new BinaryExpr(mc.getExpressions().get(0), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - throw new IllegalStateException(); - } - } - - Expression ph = new NameExpr("_"); - { - var be = new BinaryExpr(new NameExpr(variable), ph, BinaryExpr.Operator.GREATER_EQUALS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return (Expression) result.get("min"); - } - - { - var be = new BinaryExpr(new NameExpr(variable), ph, BinaryExpr.Operator.GREATER); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return new BinaryExpr((Expression) result.get("min"), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - } - - { - var be = new BinaryExpr(ph, new NameExpr(variable), BinaryExpr.Operator.LESS_EQUALS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return (Expression) result.get("min"); - } - - { - var be = new BinaryExpr(ph, new NameExpr(variable), BinaryExpr.Operator.LESS); - var pattern = new Pattern<>(be); - pattern.addPlaceholder(ph, "min"); - var result = pattern.find(n); - if (result != null) - return new BinaryExpr((Expression) result.get("min"), new IntegerLiteralExpr(1), BinaryExpr.Operator.PLUS); - } - - return null; - } - - private final class Jml2JavaVisitor extends GenericVisitorAdapter { - @Override - public Expression visit(JmlQuantifiedExpr n, BlockStmt arg) { - if (n.getBinder() == JmlQuantifiedExpr.JmlDefaultBinder.FORALL) - return visitForall(n, arg); - if (n.getBinder() == JmlQuantifiedExpr.JmlDefaultBinder.EXISTS) - return visitExists(n, arg); - - throw new IllegalArgumentException("Unsupport quantifier " + n.getBinder()); - } - - private Expression visitForall(JmlQuantifiedExpr n, BlockStmt arg) { - assert n.getVariables().size() == 1; - var rvalue = newSymbol("result_"); - var highVar = newSymbol("high_"); - var predVar = newSymbol("pred_"); - - arg.addAndGetStatement( - new ExpressionStmt(new VariableDeclarationExpr( - new VariableDeclarator( - new PrimitiveType(PrimitiveType.Primitive.BOOLEAN), - rvalue, new BooleanLiteralExpr(true))))); - - var variable = n.getVariables().get(0); - var lowCode = Jml2JavaFacade.translate(findLowerBound(n, variable.getNameAsString())); - arg.addAndGetStatement( - new ExpressionStmt(new VariableDeclarationExpr( - new VariableDeclarator( - variable.getType().clone(), variable.getNameAsString())))); - lowCode.a.addAndGetStatement( - new ExpressionStmt( - new AssignExpr( - new NameExpr(variable.getNameAsString()), lowCode.b, - AssignExpr.Operator.ASSIGN))); - arg.addAndGetStatement(lowCode.a); - - var highCode = Jml2JavaFacade.translate(findUpperBound(n, variable.getNameAsString())); - arg.addAndGetStatement( - new ExpressionStmt(new VariableDeclarationExpr( - new VariableDeclarator( - variable.getType().clone(), highVar)))); - highCode.a.addAndGetStatement( - new ExpressionStmt( - new AssignExpr( - new NameExpr(highVar), highCode.b, - AssignExpr.Operator.ASSIGN))); - arg.addAndGetStatement(highCode.a.clone()); - - var predCode = Jml2JavaFacade.translate(findPredicate(n)); - - WhileStmt whileStmt = arg.addAndGetStatement(new WhileStmt()); - var lessThanExpr = new BinaryExpr(new NameExpr(variable.getNameAsString()), - new NameExpr(highVar), BinaryExpr.Operator.LESS); - whileStmt.setCondition( - new BinaryExpr(lessThanExpr, new NameExpr(rvalue), BinaryExpr.Operator.AND)); - var body = new BlockStmt(); - - body.addAndGetStatement( - new ExpressionStmt(new VariableDeclarationExpr( - new VariableDeclarator(new PrimitiveType(PrimitiveType.Primitive.BOOLEAN), predVar)))); - predCode.a.addAndGetStatement( - new ExpressionStmt( - new AssignExpr( - new NameExpr(predVar), predCode.b, - AssignExpr.Operator.ASSIGN))); - body.addAndGetStatement(predCode.a); - - final var assignPred = new ExpressionStmt(new AssignExpr(new NameExpr(rvalue), - new BooleanLiteralExpr(true), AssignExpr.Operator.ASSIGN)); - body.addAndGetStatement( - new IfStmt(new NameExpr(predVar), assignPred, null)); - body.addAndGetStatement(highCode.a.clone()); - - whileStmt.setBody(body); - return new NameExpr(rvalue); - } - - private String newSymbol(String prefix) { - return prefix + counter.getAndIncrement(); - } - - private Expression visitExists(JmlQuantifiedExpr n, BlockStmt arg) { - return new UnaryExpr(visitForall(n, arg), UnaryExpr.Operator.LOGICAL_COMPLEMENT); - } - - - @Override - public Expression visit(JmlLetExpr n, BlockStmt arg) { - var inner = new BlockStmt(); - SimpleName target = newTargetForAssignment(); - var type = n.getBody().calculateResolvedType(); - arg.addAndGetStatement( - new ExpressionStmt(new VariableDeclarationExpr(JMLUtils.resolvedType2Type(type), - target.asString()))); - inner.addAndGetStatement(new ExpressionStmt(n.getVariables())); - var e = accept(n.getBody(), inner); - arg.addAndGetStatement(inner); - inner.addAndGetStatement(new AssignExpr(new NameExpr(target.asString()), e, AssignExpr.Operator.ASSIGN)); - return new NameExpr(target.asString()); - } - - @Override - public Expression visit(BinaryExpr n, BlockStmt arg) { - var left = accept(n.getLeft(), arg); - var right = accept(n.getRight(), arg); - switch (n.getOperator()) { - case IMPLICATION: - return new BinaryExpr( - new UnaryExpr(new EnclosedExpr(left), UnaryExpr.Operator.LOGICAL_COMPLEMENT), - right, - BinaryExpr.Operator.OR); - case RIMPLICATION: - return - new BinaryExpr( - left, - new UnaryExpr(new EnclosedExpr(right), UnaryExpr.Operator.LOGICAL_COMPLEMENT), - BinaryExpr.Operator.OR); - case EQUIVALENCE: - return new BinaryExpr(left, right, BinaryExpr.Operator.EQUALS); - case SUBTYPE: - case SUB_LOCK: - case SUB_LOCKE: - throw new IllegalArgumentException("Unsupported operators."); - default: - return createAssignmentAndAdd( - new BinaryExpr(left, right, n.getOperator()), - arg); - } - } - - @Override - public Expression visit(ArrayAccessExpr n, BlockStmt arg) { - return super.visit(n, arg); - } - - @Override - public Expression visit(ArrayCreationExpr n, BlockStmt arg) { - return super.visit(n, arg); - } - - @Override - public Expression visit(ArrayInitializerExpr n, BlockStmt arg) { - return super.visit(n, arg); - } - - @Override - public Expression visit(AssignExpr n, BlockStmt arg) { - return super.visit(n, arg); - } - - - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/package-info.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/package-info.java deleted file mode 100644 index 52ea90b598..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/jml2java/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Transformation of JML expressions into equivalent Java code. - * - * @author Alexander Weigl - * @version 1 (04.10.22) - * @see com.github.jmlparser.jml2java.Jml2JavaTranslator - */ -package com.github.jmlparser.jml2java; \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingConfig.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingConfig.java deleted file mode 100644 index 4fbd216bed..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingConfig.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.jmlparser.lint; - -import lombok.Data; -import lombok.Getter; -import lombok.Setter; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -@Data -public class JmlLintingConfig { - private boolean checkNameClashes = true; - private boolean checkMissingNames = true; - - public JmlLintingConfig() { - } - - public boolean isDisabled(LintRule lintRule) { - return false; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingFacade.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingFacade.java deleted file mode 100644 index 3c719e9b3e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/JmlLintingFacade.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.github.jmlparser.lint; - -import com.github.javaparser.ast.Node; -import com.github.jmlparser.lint.sarif.*; -import lombok.Getter; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.Exception; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.*; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class JmlLintingFacade { - private static final Logger LOGGER = LoggerFactory.getLogger(JmlLintingFacade.class); - private static final String VERSION = JmlLintingFacade.class.getPackage().getImplementationVersion(); - private static final String NAME = "JML-lint"; - - @Getter - private final List linters; - private final JmlLintingConfig config; - - public JmlLintingFacade(JmlLintingConfig config) { - linters = getLinter(config); - this.config = config; - } - - private Tool getSarifTool() { - return new Tool( - new ToolComponent().withVersion(VERSION).withName(NAME) - .withShortDescription(new MultiformatMessageString().withText("Linting for the Java Modeling Language")), - linters.stream().map(it -> new ToolComponent().withFullName(it.getClass().getName())).collect(Collectors.toSet()), - new PropertyBag() - ); - } - - - private static List getLinter(JmlLintingConfig config) { - ServiceLoader loader = ServiceLoader.load(LintRule.class); - List validators = new ArrayList<>(64); - for (LintRule lintRule : loader) { - if (!config.isDisabled(lintRule)) { - validators.add(lintRule); - } - } - return validators; - } - - public void lint(LintProblemReporter reporter, Collection nodes) { - for (Node it : nodes) { - for (LintRule linter : linters) { - try { - linter.accept(it, reporter, config); - } catch (Exception e) { - LOGGER.error("Error in linter: {}", linter.getClass().getName(), e); - } - } - } - } - - public Collection lint(@NotNull Collection nodes) { - var problems = new ArrayList(1024); - Consumer collector = problems::add; - lint(new LintProblemReporter(collector), nodes); - problems.sort(Comparator.comparing(it -> it.location().toRange().get().begin)); - return problems; - } - - public SarifSchema asSarif(Collection problems) throws URISyntaxException { - List results = problems.stream().map(this::asSarif).toList(); - List runs = List.of(new Run().withTool(getSarifTool()).withResults(results)); - return new SarifSchema( - new URI("http://json.schemastore.org/sarif-2.1.0-rtm.4"), - "2.1.0", - runs, Set.of(), new PropertyBag()); - } - - private Result asSarif(LintProblem it) { - return new Result().withRuleId(it.ruleId()).withKind(it.category()).withLevel(it.level()) - .withLocations(List.of(new Location())).withMessage(new Message().withText(it.message())); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintCommand.java deleted file mode 100644 index 59421b72d9..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintCommand.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.jmlparser.lint; - -import com.beust.jcommander.Parameters; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"lint"}, - commandDescription = "Submit usage for a given customer and subscription, accepts one usage item") -public class LintCommand { -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblem.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblem.java deleted file mode 100644 index fdfa7f08c3..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblem.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.github.jmlparser.lint; - -import com.github.javaparser.TokenRange; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * @author Alexander Weigl - * @version 1 (13.10.22) - */ -public record LintProblem( - @NotNull - String level, - @NotNull - String message, - @Nullable - TokenRange location, - @Nullable - Throwable cause, - @Nullable - String category, - @NotNull - String ruleId) { - - public LintProblem(@NotNull String level, @NotNull String message, @Nullable TokenRange location, @NotNull String ruleId) { - this(level, message, location, null, null, ruleId); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblemReporter.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblemReporter.java deleted file mode 100644 index c4c7f28ad8..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintProblemReporter.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.jmlparser.lint; - -import com.github.javaparser.TokenRange; -import com.github.javaparser.ast.nodeTypes.NodeWithTokenRange; - -import java.util.function.Consumer; - -import static com.github.javaparser.utils.CodeGenerationUtils.f; - -/** - * @author Alexander Weigl - * @version 1 (13.10.22) - */ -public class LintProblemReporter { - private final Consumer problemConsumer; - - public LintProblemReporter(Consumer problemConsumer) { - this.problemConsumer = problemConsumer; - } - - public void warn(NodeWithTokenRange node, String category, String ruleId, String message, Object... args) { - report(LintRule.WARN, node.getTokenRange().orElse(null), category, ruleId, message, args); - } - - public void hint(NodeWithTokenRange node, String category, String ruleId, String message, Object... args) { - report(LintRule.HINT, node.getTokenRange().orElse(null), category, ruleId, message, args); - } - - public void error(NodeWithTokenRange node, String category, String ruleId, String message, Object... args) { - report(LintRule.ERROR, node.getTokenRange().orElse(null), category, ruleId, message, args); - } - - public void report(String level, TokenRange range, String category, String ruleId, String message, Object... args) { - problemConsumer.accept(new LintProblem(level, f(message, args), range, null, category, ruleId)); - } - - public void report(LintProblem lintProblem) { - problemConsumer.accept(lintProblem); - } -} - diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRule.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRule.java deleted file mode 100644 index 7637747a89..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRule.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.jmlparser.lint; - -import com.github.javaparser.ast.Node; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public interface LintRule { - String HINT = "HINT"; - String WARN = "WARN"; - String ERROR = "ERROR"; - - void accept(Node node, LintProblemReporter problemReporter, JmlLintingConfig config); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRuleVisitor.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRuleVisitor.java deleted file mode 100644 index fe297064ce..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/LintRuleVisitor.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.github.jmlparser.lint; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.visitor.VoidVisitorAdapter; - -/** - * @author Alexander Weigl - * @version 1 (13.10.22) - */ -public abstract class LintRuleVisitor extends VoidVisitorAdapter implements LintRule { - /** - * A validator that uses a visitor for validation. - * This class is the visitor too. - * Implement the "visit" methods you want to use for validation. - */ - @Override - public void accept(Node node, LintProblemReporter problemReporter, JmlLintingConfig config) { - reset(); - node.accept(this, problemReporter); - } - - protected void reset() { - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AllowedJmlClauses.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AllowedJmlClauses.java deleted file mode 100644 index bccddf2b0a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AllowedJmlClauses.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.jml.NodeWithContracts; -import com.github.javaparser.ast.jml.clauses.JmlClause; -import com.github.javaparser.ast.jml.clauses.JmlClauseKind; -import com.github.javaparser.ast.jml.clauses.JmlContract; -import com.github.javaparser.ast.stmt.*; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Optional; -import java.util.Set; - -import static com.github.javaparser.ast.jml.clauses.JmlClauseKind.*; - -/** - * @author Alexander Weigl - * @version 1 (13.10.22) - */ -public class AllowedJmlClauses extends LintRuleVisitor { - public static final EnumSet METHOD_CONTRACT_CLAUSES = EnumSet.of( - ENSURES, - ENSURES_FREE, - ENSURES_REDUNDANTLY, - REQUIRES, - REQUIRES_FREE, - REQUIRES_REDUNDANTLY, - DECREASES, - MODIFIES, - MODIFIABLE, - ASSIGNABLE, - ACCESSIBLE, - PRE, - POST, - PRE_REDUNDANTLY, - POST_REDUNDANTLY, - DECREASING, - DECREASES_REDUNDANTLY, - MEASURED_BY, - OLD, - FORALL, - SIGNALS, - SIGNALS_REDUNDANTLY, - SIGNALS_ONLY, - WHEN, - WORKING_SPACE, - WORKING_SPACE_REDUNDANTLY, - CAPTURES, - CAPTURES_REDUNDANTLY, - ASSIGNABLE_REDUNDANTLY, - MODIFIABLE_REDUNDANTLY, - MODIFIES_REDUNDANTLY, - CALLABLE, - CALLABLE_REDUNDANTLY, - DIVERGES, - DIVERGES_REDUNDANTLY, - DURATION, - DURATION_REDUNDANTLY - ); - - private EnumSet LOOP_INVARIANT_CLAUSES = EnumSet.of( - DECREASES, - MODIFIES, - MODIFIABLE, - ASSIGNABLE, - ACCESSIBLE, - MAINTAINING, - MAINTAINING_REDUNDANTLY, - DECREASING, - DECREASES_REDUNDANTLY, - LOOP_INVARIANT, - LOOP_INVARIANT_FREE, - LOOP_INVARIANT_REDUNDANTLY - ); - - private EnumSet LOOP_CONTRACT_CLAUSES = EnumSet.of( - ENSURES, - ENSURES_FREE, - ENSURES_REDUNDANTLY, - REQUIRES, - REQUIRES_FREE, - REQUIRES_REDUNDANTLY, - DECREASES, - MODIFIES, - MODIFIABLE, - ASSIGNABLE, - ACCESSIBLE, - PRE, - POST, - PRE_REDUNDANTLY, - POST_REDUNDANTLY, - MAINTAINING, - MAINTAINING_REDUNDANTLY, - DECREASING, - DECREASES_REDUNDANTLY, - LOOP_INVARIANT, - LOOP_INVARIANT_FREE, - LOOP_INVARIANT_REDUNDANTLY, - MEASURED_BY, - RETURNS, - RETURNS_REDUNDANTLY, - BREAKS, - BREAKS_REDUNDANTLY, - CONTINUES, - CONTINUES_REDUNDANTLY, - OLD, - FORALL, - SIGNALS, - SIGNALS_REDUNDANTLY, - SIGNALS_ONLY, - WHEN, - WORKING_SPACE, - WORKING_SPACE_REDUNDANTLY, - CAPTURES, - CAPTURES_REDUNDANTLY, - INITIALLY, - INVARIANT_REDUNDANTLY, - INVARIANT, - ASSIGNABLE_REDUNDANTLY, - MODIFIABLE_REDUNDANTLY, - MODIFIES_REDUNDANTLY, - CALLABLE, - CALLABLE_REDUNDANTLY, - DIVERGES, - DIVERGES_REDUNDANTLY, - DURATION, - DURATION_REDUNDANTLY - ); - - private EnumSet BLOCK_CONTRACT_CLAUSES = EnumSet.of( - ENSURES, - ENSURES_FREE, - ENSURES_REDUNDANTLY, - REQUIRES, - REQUIRES_FREE, - REQUIRES_REDUNDANTLY, - DECREASES, - MODIFIES, - MODIFIABLE, - ASSIGNABLE, - ACCESSIBLE, - PRE, - POST, - PRE_REDUNDANTLY, - POST_REDUNDANTLY, - MAINTAINING, - MAINTAINING_REDUNDANTLY, - DECREASING, - DECREASES_REDUNDANTLY, - LOOP_INVARIANT, - LOOP_INVARIANT_FREE, - LOOP_INVARIANT_REDUNDANTLY, - MEASURED_BY, - RETURNS, - RETURNS_REDUNDANTLY, - BREAKS, - BREAKS_REDUNDANTLY, - CONTINUES, - CONTINUES_REDUNDANTLY, - OLD, - FORALL, - SIGNALS, - SIGNALS_REDUNDANTLY, - SIGNALS_ONLY, - WHEN, - WORKING_SPACE, - WORKING_SPACE_REDUNDANTLY, - CAPTURES, - CAPTURES_REDUNDANTLY, - INITIALLY, - INVARIANT_REDUNDANTLY, - INVARIANT, - ASSIGNABLE_REDUNDANTLY, - MODIFIABLE_REDUNDANTLY, - MODIFIES_REDUNDANTLY, - CALLABLE, - CALLABLE_REDUNDANTLY, - DIVERGES, - DIVERGES_REDUNDANTLY, - DURATION, - DURATION_REDUNDANTLY - ); - - private Set currentlyAllowed = new HashSet<>(); - - @Override - public void visit(JmlContract n, LintProblemReporter arg) { - Optional a = n.findAncestor(NodeWithContracts.class); - if (a.isPresent()) { - var owner = a.get(); - if (owner instanceof ForEachStmt - || owner instanceof ForStmt - || owner instanceof WhileStmt - || owner instanceof DoStmt) { - if (n.getType() == JmlContract.Type.LOOP_INV) - checkClauses(arg, n.getClauses(), LOOP_INVARIANT_CLAUSES, "loop_invariant"); - else - checkClauses(arg, n.getClauses(), LOOP_CONTRACT_CLAUSES, "loop"); - } else if (owner instanceof MethodDeclaration) { - checkClauses(arg, n.getClauses(), METHOD_CONTRACT_CLAUSES, "method"); - } else if (owner instanceof BlockStmt) { - checkClauses(arg, n.getClauses(), BLOCK_CONTRACT_CLAUSES, "block"); - } - } - } - - private void checkClauses(LintProblemReporter arg, NodeList clauses, - EnumSet allowed, String type) { - for (JmlClause clause : clauses) { - if (!allowed.contains(clause.getKind())) { - arg.warn(clause, "", "", "%s clause not allowed in a %s contract", clause.getKind(), type); - } - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AssignableValidator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AssignableValidator.java deleted file mode 100644 index 1c3c6782a9..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/AssignableValidator.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.body.FieldDeclaration; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.ast.jml.clauses.JmlClauseKind; -import com.github.javaparser.ast.jml.clauses.JmlMultiExprClause; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class AssignableValidator extends LintRuleVisitor { - @Override - public void visit(JmlMultiExprClause n, LintProblemReporter arg) { - if (n.getKind() == JmlClauseKind.ASSIGNABLE || - n.getKind() == JmlClauseKind.ASSIGNABLE_REDUNDANTLY) { - checkFinalFieldsInAssignableClause(n, arg); - } - } - - private void checkFinalFieldsInAssignableClause(JmlMultiExprClause n, LintProblemReporter arg) { - for (Expression e : n.getExpression()) { - if (e.isNameExpr()) { - if (e.asNameExpr().getNameAsString().equals("this")) { - arg.error(e, "", "", "This reference is not re-assignable!"); - continue; - } - var value = e.asNameExpr().resolve(); - if (value.isEnumConstant()) { - arg.error(e, "", "", "Enum constants are not re-assignable!"); - } else if (value.isField()) { - var ast = value.asField().toAst(); - if (ast.isPresent() && ast.get() instanceof FieldDeclaration f && f.isFinal()) { - arg.error(e, "", "", "This variable is final, so cannot be assigned"); - } - } - } else if (e.isArrayAccessExpr()) { - //TODO weigl check for array-ness of name expr - var rtype = e.asArrayAccessExpr().getName().calculateResolvedType(); - if (!rtype.isArray()) { - arg.error(e, "", "", "Array access to non-array. Calculated type is %s", rtype.describe()); - } - } else { - arg.error(e, "", "", "Strange expression type found: %s", e.getMetaModel().getTypeName()); - } - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ContextSensitiveForbiddenFunctionsValidator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ContextSensitiveForbiddenFunctionsValidator.java deleted file mode 100644 index 6496aec6fb..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ContextSensitiveForbiddenFunctionsValidator.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.jml.clauses.JmlClause; -import com.github.javaparser.ast.jml.clauses.JmlClauseKind; -import com.github.javaparser.ast.jml.clauses.JmlContract; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class ContextSensitiveForbiddenFunctionsValidator extends LintRuleVisitor { - public static final String MULTIPLE_SIGNALS_ONLY = "Use a single signals_only clause to avoid confusion"; - public static final String NOT_SPECIFIED_REDUNDANT = "This clause containing \\not_specified is redundant because you already specified it"; - public static final String BACKSLASH_RESULT_NOT_ALLOWED = "You can only use \\result in an ensures clause"; - public static final String OLD_EXPR_NOT_ALLOWED = "You can only use an \\old() expressions in ensures and signals clauses, assert and assume statements, and in loop invariants"; - private int signalsOnlyCounter; - - @Override - public void visit(JmlContract n, LintProblemReporter arg) { - signalsOnlyCounter = 0; - reportMultipleSignalsOnlyClauses(n, arg); - } - - private void reportMultipleSignalsOnlyClauses(JmlContract n, LintProblemReporter arg) { - for (JmlClause clause : n.getClauses()) { - if (clause.getKind() == JmlClauseKind.SIGNALS_ONLY) - signalsOnlyCounter++; - - if (signalsOnlyCounter > 1) { - arg.warn(clause, "", "", MULTIPLE_SIGNALS_ONLY); - } - } - - for (JmlContract subContract : n.getSubContracts()) { - reportMultipleSignalsOnlyClauses(subContract, arg); - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JavaContainsJmlConstruct.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JavaContainsJmlConstruct.java deleted file mode 100644 index 71de888f11..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JavaContainsJmlConstruct.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.Jmlish; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.jml.body.JmlBodyDeclaration; -import com.github.javaparser.ast.jml.stmt.JmlStatement; -import com.github.javaparser.ast.validator.ProblemReporter; -import com.github.javaparser.ast.validator.Validator; - -import java.util.function.Predicate; - -/** - * @author Alexander Weigl - * @version 1 (19.02.22) - */ -public class JavaContainsJmlConstruct implements Validator { - @Override - public void accept(Node node, ProblemReporter problemReporter) { - accept(node, false, problemReporter); - } - - private void accept(Node current, Boolean inJml, ProblemReporter problemReporter) { - Predicate openJml = (Node it) -> - it instanceof JmlBodyDeclaration || - it instanceof JmlStatement; - - if (!inJml && (current instanceof Jmlish) && !openJml.test(current)) { - problemReporter.report(current, "Jml construct used in Java part"); - return; - } - - for (Node it : current.getChildNodes()) { - accept(it, inJml || openJml.test(current), problemReporter); - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlJavaNameClashes.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlJavaNameClashes.java deleted file mode 100644 index 6256c53e90..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlJavaNameClashes.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.jmlparser.lint.rules; - -/** - * @author Alexander Weigl - * @version 1 (19.02.22) - */ -public class JmlJavaNameClashes { -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlNameClashWithJava.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlNameClashWithJava.java deleted file mode 100644 index f215e18478..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/JmlNameClashWithJava.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.jml.clauses.JmlForallClause; -import com.github.javaparser.ast.jml.clauses.JmlSignalsClause; -import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause; -import com.github.javaparser.jml.JmlUtility; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRule; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class JmlNameClashWithJava extends LintRuleVisitor { - public static final LintProblemMeta NOT_AN_EXCEPTION_CLASS - = new LintProblemMeta("JML-1", "This is not an exception class", LintRule.ERROR); - - @Override - public void visit(JmlSignalsClause n, LintProblemReporter arg) { - var rtype = n.getParameter().getType().resolve(); - var exception = JmlUtility.resolveException(n); - if (exception.isAssignableBy(rtype)) { - arg.report(NOT_AN_EXCEPTION_CLASS.create(n)); - } - super.visit(n, arg); - } - - - public static final String PUT_IN_THROWS_CLAUSE = "This exception (or a superclass or subclass of it) should be mentioned in the throws clause of this method"; - - public static final String CLASS_REFERENCE_NOT_FOUND = "This class could not be resolved, did you forget to import it?"; - - - @Override - public void visit(JmlForallClause n, LintProblemReporter arg) { - super.visit(n, arg); - } - - public static final String NOT_A_TYPE_NAME = "This is not the name of a primitive type or a class"; - public static final String NO_ARRAY = "This is not an array"; - - - @Override - public void visit(JmlSimpleExprClause n, LintProblemReporter arg) { - super.visit(n, arg); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LintProblemMeta.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LintProblemMeta.java deleted file mode 100644 index 0ab6b4b613..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LintProblemMeta.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.nodeTypes.NodeWithTokenRange; -import com.github.jmlparser.lint.LintProblem; - -/** - * @author Alexander Weigl - * @version 1 (21.10.22) - */ -public record LintProblemMeta(String id, String message, String level) { - - public LintProblem create(NodeWithTokenRange n) { - return new LintProblem(level(), message(), n.getTokenRange().orElse(null), null, id, ""); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LocationSetValidator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LocationSetValidator.java deleted file mode 100644 index 858d28cac3..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/LocationSetValidator.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class LocationSetValidator extends LintRuleVisitor { - public static final String ASSIGNABLE_ARRAY_ONLY = "You can only use '[*]' on arrays"; - public static final String ASSIGNABLE_CLASS_ONLY = "You can only use '.*' on classes and interfaces"; -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/MethodBodyHasNoContract.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/MethodBodyHasNoContract.java deleted file mode 100644 index c547a04d20..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/MethodBodyHasNoContract.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.validator.ProblemReporter; -import com.github.javaparser.ast.validator.VisitorValidator; - -public class MethodBodyHasNoContract extends VisitorValidator { - @Override - public void visit(MethodDeclaration n, ProblemReporter arg) { - if (n.getBody().isPresent() && n.getBody().get().getContracts().isPresent() - && !n.getBody().get().getContracts().get().isEmpty() - ) { - arg.report(n, "Body of method has a block contract."); - } - super.visit(n, arg); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/OverridingLocalNamesInGhost.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/OverridingLocalNamesInGhost.java deleted file mode 100644 index 5b3aead037..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/OverridingLocalNamesInGhost.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.body.VariableDeclarator; -import com.github.javaparser.ast.expr.VariableDeclarationExpr; -import com.github.javaparser.ast.jml.stmt.JmlGhostStmt; -import com.github.javaparser.resolution.declarations.ResolvedValueDeclaration; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (14.10.22) - */ -public class OverridingLocalNamesInGhost extends LintRuleVisitor { - private boolean inGhost; - - @Override - protected void reset() { - inGhost = false; - } - - @Override - public void visit(JmlGhostStmt n, LintProblemReporter arg) { - inGhost = true; - super.visit(n, arg); - inGhost = false; - } - - @Override - public void visit(VariableDeclarationExpr n, LintProblemReporter arg) { - if (inGhost) { - JmlGhostStmt s = n.findAncestor(JmlGhostStmt.class).get(); - for (VariableDeclarator variable : n.getVariables()) { - var name = variable.getNameAsExpression(); - name.setParentNode(s); - var value = s.getSymbolResolver().resolveDeclaration(name, ResolvedValueDeclaration.class); - name.setParentNode(null); - if (value != null) { - arg.error(variable, "", "", "Variable %s already declared in Java.", variable.getNameAsString()); - } - } - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/PurityValidator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/PurityValidator.java deleted file mode 100644 index 632319e8ac..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/PurityValidator.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.Modifier; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.expr.AssignExpr; -import com.github.javaparser.ast.expr.MethodCallExpr; -import com.github.javaparser.ast.expr.UnaryExpr; -import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration; -import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause; -import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt; -import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; -import com.github.javaparser.ast.visitor.VoidVisitorAdapter; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class PurityValidator extends LintRuleVisitor { - public static final String METHOD_NOT_PURE = "JML expressions should be pure and this method might not be pure"; - public static final String ASSIGNMENT_NOT_PURE = "JML expressions should be pure and assignments are not pure"; - - @Override - public void visit(JmlSimpleExprClause n, LintProblemReporter arg) { - final var r = new PurityVisitor(); - n.getExpression().accept(r, null); - if (r.reason != null) { - arg.error(r.reason, "", "", "Expression in JML clause must be pure." + r.text); - } - } - - - @Override - public void visit(JmlClassExprDeclaration n, LintProblemReporter arg) { - final var r = new PurityVisitor(); - n.getInvariant().accept(r, null); - if (r.reason != null) { - arg.error(r.reason, "", "", "Expression in JML invariant clause must be pure." + r.text); - } - } - - @Override - public void visit(JmlExpressionStmt n, LintProblemReporter arg) { - final var r = new PurityVisitor(); - n.getExpression().accept(r, null); - if (r.reason != null) { - arg.error(r.reason, "", "", "Expression in JML statements must be pure." + r.text); - } - } - - - private static class PurityVisitor extends VoidVisitorAdapter { - private Node reason; - private String text; - - @Override - public void visit(AssignExpr n, Void arg) { - reason = n; - } - - @Override - public void visit(UnaryExpr n, Void arg) { - switch (n.getOperator()) { - case POSTFIX_DECREMENT: - case POSTFIX_INCREMENT: - reason = n; - text = "Postfix de-/increment operator found."; - break; - case PREFIX_INCREMENT: - case PREFIX_DECREMENT: - reason = n; - text = "Prefix de-/increment operator found"; - break; - default: - n.getExpression().accept(this, arg); - break; - } - } - - @Override - public void visit(MethodCallExpr n, Void arg) { - var r = n.resolve().toAst(); - if (r.isPresent() && r.get() instanceof NodeWithModifiers mods - && (mods.hasModifier(Modifier.DefaultKeyword.JML_PURE) - || mods.hasModifier(Modifier.DefaultKeyword.JML_STRICTLY_PURE))) { - super.visit(n, arg); - } else { - reason = n; - text = METHOD_NOT_PURE; - } - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ResultVarCheck.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ResultVarCheck.java deleted file mode 100644 index 36b0de5468..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/rules/ResultVarCheck.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.github.jmlparser.lint.rules; - -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.expr.NameExpr; -import com.github.javaparser.ast.jml.clauses.JmlClauseKind; -import com.github.javaparser.ast.jml.clauses.JmlSimpleExprClause; -import com.github.jmlparser.lint.LintProblemReporter; -import com.github.jmlparser.lint.LintRuleVisitor; - -/** - * @author Alexander Weigl - * @version 1 (14.10.22) - */ -public class ResultVarCheck extends LintRuleVisitor { - public static final String NO_METHOD_RESULT = "Cannot use \\result here, as this method / constructor does not return anything"; - private boolean inMethodWithNonVoidReturnType = false; - private boolean inPostCondition = false; - - @Override - protected void reset() { - inPostCondition = false; - } - - @Override - public void visit(MethodDeclaration n, LintProblemReporter arg) { - inMethodWithNonVoidReturnType = !n.getType().isVoidType(); - n.getContracts().ifPresent(l -> l.forEach(v -> v.accept(this, arg))); - inMethodWithNonVoidReturnType = false; - n.getBody().ifPresent(l -> l.accept(this, arg)); - } - - @Override - public void visit(JmlSimpleExprClause n, LintProblemReporter arg) { - inPostCondition = n.getKind() == JmlClauseKind.ENSURES - || n.getKind() == JmlClauseKind.ENSURES_FREE - || n.getKind() == JmlClauseKind.ENSURES_REDUNDANTLY - || n.getKind() == JmlClauseKind.POST - || n.getKind() == JmlClauseKind.POST_REDUNDANTLY; - super.visit(n, arg); - inPostCondition = false; - } - - @Override - public void visit(NameExpr n, LintProblemReporter arg) { - if (n.getNameAsString().equals("\\result")) { - if (!inPostCondition) - arg.error(n, "", "", "Use of \\result in non-post-conditional clause."); - if (!inMethodWithNonVoidReturnType) - arg.error(n, "", "", NO_METHOD_RESULT); - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Address.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Address.java deleted file mode 100644 index e83bb51826..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Address.java +++ /dev/null @@ -1,379 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). - */ -@Generated("jsonschema2pojo") -public class Address { - - /** - * The address expressed as a byte offset from the start of the addressable region. - */ - @SerializedName("absoluteAddress") - @Expose - private int absoluteAddress = -1; - /** - * The address expressed as a byte offset from the absolute address of the top-most parent object. - */ - @SerializedName("relativeAddress") - @Expose - private int relativeAddress; - /** - * The number of bytes in this range of addresses. - */ - @SerializedName("length") - @Expose - private int length; - /** - * An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values. - */ - @SerializedName("kind") - @Expose - private String kind; - /** - * A name that is associated with the address, e.g., '.text'. - */ - @SerializedName("name") - @Expose - private String name; - /** - * A human-readable fully qualified name that is associated with the address. - */ - @SerializedName("fullyQualifiedName") - @Expose - private String fullyQualifiedName; - /** - * The byte offset of this address from the absolute or relative address of the parent object. - */ - @SerializedName("offsetFromParent") - @Expose - private int offsetFromParent; - /** - * The index within run.addresses of the cached object for this address. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * The index within run.addresses of the parent object. - */ - @SerializedName("parentIndex") - @Expose - private int parentIndex = -1; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Address() { - } - - /** - * @param offsetFromParent - * @param parentIndex - * @param relativeAddress - * @param kind - * @param length - * @param name - * @param index - * @param fullyQualifiedName - * @param properties - * @param absoluteAddress - */ - public Address(int absoluteAddress, int relativeAddress, int length, String kind, String name, String fullyQualifiedName, int offsetFromParent, int index, int parentIndex, PropertyBag properties) { - super(); - this.absoluteAddress = absoluteAddress; - this.relativeAddress = relativeAddress; - this.length = length; - this.kind = kind; - this.name = name; - this.fullyQualifiedName = fullyQualifiedName; - this.offsetFromParent = offsetFromParent; - this.index = index; - this.parentIndex = parentIndex; - this.properties = properties; - } - - /** - * The address expressed as a byte offset from the start of the addressable region. - */ - public int getAbsoluteAddress() { - return absoluteAddress; - } - - /** - * The address expressed as a byte offset from the start of the addressable region. - */ - public void setAbsoluteAddress(int absoluteAddress) { - this.absoluteAddress = absoluteAddress; - } - - public Address withAbsoluteAddress(int absoluteAddress) { - this.absoluteAddress = absoluteAddress; - return this; - } - - /** - * The address expressed as a byte offset from the absolute address of the top-most parent object. - */ - public int getRelativeAddress() { - return relativeAddress; - } - - /** - * The address expressed as a byte offset from the absolute address of the top-most parent object. - */ - public void setRelativeAddress(int relativeAddress) { - this.relativeAddress = relativeAddress; - } - - public Address withRelativeAddress(int relativeAddress) { - this.relativeAddress = relativeAddress; - return this; - } - - /** - * The number of bytes in this range of addresses. - */ - public int getLength() { - return length; - } - - /** - * The number of bytes in this range of addresses. - */ - public void setLength(int length) { - this.length = length; - } - - public Address withLength(int length) { - this.length = length; - return this; - } - - /** - * An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values. - */ - public String getKind() { - return kind; - } - - /** - * An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values. - */ - public void setKind(String kind) { - this.kind = kind; - } - - public Address withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * A name that is associated with the address, e.g., '.text'. - */ - public String getName() { - return name; - } - - /** - * A name that is associated with the address, e.g., '.text'. - */ - public void setName(String name) { - this.name = name; - } - - public Address withName(String name) { - this.name = name; - return this; - } - - /** - * A human-readable fully qualified name that is associated with the address. - */ - public String getFullyQualifiedName() { - return fullyQualifiedName; - } - - /** - * A human-readable fully qualified name that is associated with the address. - */ - public void setFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - } - - public Address withFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - return this; - } - - /** - * The byte offset of this address from the absolute or relative address of the parent object. - */ - public int getOffsetFromParent() { - return offsetFromParent; - } - - /** - * The byte offset of this address from the absolute or relative address of the parent object. - */ - public void setOffsetFromParent(int offsetFromParent) { - this.offsetFromParent = offsetFromParent; - } - - public Address withOffsetFromParent(int offsetFromParent) { - this.offsetFromParent = offsetFromParent; - return this; - } - - /** - * The index within run.addresses of the cached object for this address. - */ - public int getIndex() { - return index; - } - - /** - * The index within run.addresses of the cached object for this address. - */ - public void setIndex(int index) { - this.index = index; - } - - public Address withIndex(int index) { - this.index = index; - return this; - } - - /** - * The index within run.addresses of the parent object. - */ - public int getParentIndex() { - return parentIndex; - } - - /** - * The index within run.addresses of the parent object. - */ - public void setParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - } - - public Address withParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Address withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Address.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("absoluteAddress"); - sb.append('='); - sb.append(this.absoluteAddress); - sb.append(','); - sb.append("relativeAddress"); - sb.append('='); - sb.append(this.relativeAddress); - sb.append(','); - sb.append("length"); - sb.append('='); - sb.append(this.length); - sb.append(','); - sb.append("kind"); - sb.append('='); - sb.append(((this.kind == null) ? "" : this.kind)); - sb.append(','); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("fullyQualifiedName"); - sb.append('='); - sb.append(((this.fullyQualifiedName == null) ? "" : this.fullyQualifiedName)); - sb.append(','); - sb.append("offsetFromParent"); - sb.append('='); - sb.append(this.offsetFromParent); - sb.append(','); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("parentIndex"); - sb.append('='); - sb.append(this.parentIndex); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.offsetFromParent); - result = ((result * 31) + this.parentIndex); - result = ((result * 31) + this.relativeAddress); - result = ((result * 31) + ((this.kind == null) ? 0 : this.kind.hashCode())); - result = ((result * 31) + this.length); - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.fullyQualifiedName == null) ? 0 : this.fullyQualifiedName.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + this.absoluteAddress); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Address) == false) { - return false; - } - Address rhs = ((Address) other); - return ((((((((((this.offsetFromParent == rhs.offsetFromParent) && (this.parentIndex == rhs.parentIndex)) && (this.relativeAddress == rhs.relativeAddress)) && ((this.kind == rhs.kind) || ((this.kind != null) && this.kind.equals(rhs.kind)))) && (this.length == rhs.length)) && ((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name)))) && (this.index == rhs.index)) && ((this.fullyQualifiedName == rhs.fullyQualifiedName) || ((this.fullyQualifiedName != null) && this.fullyQualifiedName.equals(rhs.fullyQualifiedName)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && (this.absoluteAddress == rhs.absoluteAddress)); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Artifact.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Artifact.java deleted file mode 100644 index ed9f206cb7..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Artifact.java +++ /dev/null @@ -1,478 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A single artifact. In some cases, this artifact might be nested within another artifact. - */ -@Generated("jsonschema2pojo") -public class Artifact { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Specifies the location of an artifact. - */ - @SerializedName("location") - @Expose - private ArtifactLocation location; - /** - * Identifies the index of the immediate parent of the artifact, if this artifact is nested. - */ - @SerializedName("parentIndex") - @Expose - private int parentIndex = -1; - /** - * The offset in bytes of the artifact within its containing artifact. - */ - @SerializedName("offset") - @Expose - private int offset; - /** - * The length of the artifact in bytes. - */ - @SerializedName("length") - @Expose - private int length = -1; - /** - * The role or roles played by the artifact in the analysis. - */ - @SerializedName("roles") - @Expose - private Set roles = new LinkedHashSet(); - /** - * The MIME type (RFC 2045) of the artifact. - */ - @SerializedName("mimeType") - @Expose - private String mimeType; - /** - * Represents the contents of an artifact. - */ - @SerializedName("contents") - @Expose - private ArtifactContent contents; - /** - * Specifies the encoding for an artifact object that refers to a text file. - */ - @SerializedName("encoding") - @Expose - private String encoding; - /** - * Specifies the source language for any artifact object that refers to a text file that contains source code. - */ - @SerializedName("sourceLanguage") - @Expose - private String sourceLanguage; - /** - * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function. - */ - @SerializedName("hashes") - @Expose - private Hashes hashes; - /** - * The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the SARIF spec for the required format. - */ - @SerializedName("lastModifiedTimeUtc") - @Expose - private Date lastModifiedTimeUtc; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Artifact() { - } - - /** - * @param parentIndex - * @param offset - * @param roles - * @param lastModifiedTimeUtc - * @param length - * @param description - * @param mimeType - * @param encoding - * @param contents - * @param hashes - * @param location - * @param sourceLanguage - * @param properties - */ - public Artifact(Message description, ArtifactLocation location, int parentIndex, int offset, int length, Set roles, String mimeType, ArtifactContent contents, String encoding, String sourceLanguage, Hashes hashes, Date lastModifiedTimeUtc, PropertyBag properties) { - super(); - this.description = description; - this.location = location; - this.parentIndex = parentIndex; - this.offset = offset; - this.length = length; - this.roles = roles; - this.mimeType = mimeType; - this.contents = contents; - this.encoding = encoding; - this.sourceLanguage = sourceLanguage; - this.hashes = hashes; - this.lastModifiedTimeUtc = lastModifiedTimeUtc; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public Artifact withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getLocation() { - return location; - } - - /** - * Specifies the location of an artifact. - */ - public void setLocation(ArtifactLocation location) { - this.location = location; - } - - public Artifact withLocation(ArtifactLocation location) { - this.location = location; - return this; - } - - /** - * Identifies the index of the immediate parent of the artifact, if this artifact is nested. - */ - public int getParentIndex() { - return parentIndex; - } - - /** - * Identifies the index of the immediate parent of the artifact, if this artifact is nested. - */ - public void setParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - } - - public Artifact withParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - return this; - } - - /** - * The offset in bytes of the artifact within its containing artifact. - */ - public int getOffset() { - return offset; - } - - /** - * The offset in bytes of the artifact within its containing artifact. - */ - public void setOffset(int offset) { - this.offset = offset; - } - - public Artifact withOffset(int offset) { - this.offset = offset; - return this; - } - - /** - * The length of the artifact in bytes. - */ - public int getLength() { - return length; - } - - /** - * The length of the artifact in bytes. - */ - public void setLength(int length) { - this.length = length; - } - - public Artifact withLength(int length) { - this.length = length; - return this; - } - - /** - * The role or roles played by the artifact in the analysis. - */ - public Set getRoles() { - return roles; - } - - /** - * The role or roles played by the artifact in the analysis. - */ - public void setRoles(Set roles) { - this.roles = roles; - } - - public Artifact withRoles(Set roles) { - this.roles = roles; - return this; - } - - /** - * The MIME type (RFC 2045) of the artifact. - */ - public String getMimeType() { - return mimeType; - } - - /** - * The MIME type (RFC 2045) of the artifact. - */ - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } - - public Artifact withMimeType(String mimeType) { - this.mimeType = mimeType; - return this; - } - - /** - * Represents the contents of an artifact. - */ - public ArtifactContent getContents() { - return contents; - } - - /** - * Represents the contents of an artifact. - */ - public void setContents(ArtifactContent contents) { - this.contents = contents; - } - - public Artifact withContents(ArtifactContent contents) { - this.contents = contents; - return this; - } - - /** - * Specifies the encoding for an artifact object that refers to a text file. - */ - public String getEncoding() { - return encoding; - } - - /** - * Specifies the encoding for an artifact object that refers to a text file. - */ - public void setEncoding(String encoding) { - this.encoding = encoding; - } - - public Artifact withEncoding(String encoding) { - this.encoding = encoding; - return this; - } - - /** - * Specifies the source language for any artifact object that refers to a text file that contains source code. - */ - public String getSourceLanguage() { - return sourceLanguage; - } - - /** - * Specifies the source language for any artifact object that refers to a text file that contains source code. - */ - public void setSourceLanguage(String sourceLanguage) { - this.sourceLanguage = sourceLanguage; - } - - public Artifact withSourceLanguage(String sourceLanguage) { - this.sourceLanguage = sourceLanguage; - return this; - } - - /** - * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function. - */ - public Hashes getHashes() { - return hashes; - } - - /** - * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function. - */ - public void setHashes(Hashes hashes) { - this.hashes = hashes; - } - - public Artifact withHashes(Hashes hashes) { - this.hashes = hashes; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the SARIF spec for the required format. - */ - public Date getLastModifiedTimeUtc() { - return lastModifiedTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the SARIF spec for the required format. - */ - public void setLastModifiedTimeUtc(Date lastModifiedTimeUtc) { - this.lastModifiedTimeUtc = lastModifiedTimeUtc; - } - - public Artifact withLastModifiedTimeUtc(Date lastModifiedTimeUtc) { - this.lastModifiedTimeUtc = lastModifiedTimeUtc; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Artifact withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Artifact.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("parentIndex"); - sb.append('='); - sb.append(this.parentIndex); - sb.append(','); - sb.append("offset"); - sb.append('='); - sb.append(this.offset); - sb.append(','); - sb.append("length"); - sb.append('='); - sb.append(this.length); - sb.append(','); - sb.append("roles"); - sb.append('='); - sb.append(((this.roles == null) ? "" : this.roles)); - sb.append(','); - sb.append("mimeType"); - sb.append('='); - sb.append(((this.mimeType == null) ? "" : this.mimeType)); - sb.append(','); - sb.append("contents"); - sb.append('='); - sb.append(((this.contents == null) ? "" : this.contents)); - sb.append(','); - sb.append("encoding"); - sb.append('='); - sb.append(((this.encoding == null) ? "" : this.encoding)); - sb.append(','); - sb.append("sourceLanguage"); - sb.append('='); - sb.append(((this.sourceLanguage == null) ? "" : this.sourceLanguage)); - sb.append(','); - sb.append("hashes"); - sb.append('='); - sb.append(((this.hashes == null) ? "" : this.hashes)); - sb.append(','); - sb.append("lastModifiedTimeUtc"); - sb.append('='); - sb.append(((this.lastModifiedTimeUtc == null) ? "" : this.lastModifiedTimeUtc)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.parentIndex); - result = ((result * 31) + this.offset); - result = ((result * 31) + ((this.roles == null) ? 0 : this.roles.hashCode())); - result = ((result * 31) + ((this.lastModifiedTimeUtc == null) ? 0 : this.lastModifiedTimeUtc.hashCode())); - result = ((result * 31) + this.length); - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.mimeType == null) ? 0 : this.mimeType.hashCode())); - result = ((result * 31) + ((this.encoding == null) ? 0 : this.encoding.hashCode())); - result = ((result * 31) + ((this.contents == null) ? 0 : this.contents.hashCode())); - result = ((result * 31) + ((this.hashes == null) ? 0 : this.hashes.hashCode())); - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.sourceLanguage == null) ? 0 : this.sourceLanguage.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Artifact) == false) { - return false; - } - Artifact rhs = ((Artifact) other); - return (((((((((((((this.parentIndex == rhs.parentIndex) && (this.offset == rhs.offset)) && ((this.roles == rhs.roles) || ((this.roles != null) && this.roles.equals(rhs.roles)))) && ((this.lastModifiedTimeUtc == rhs.lastModifiedTimeUtc) || ((this.lastModifiedTimeUtc != null) && this.lastModifiedTimeUtc.equals(rhs.lastModifiedTimeUtc)))) && (this.length == rhs.length)) && ((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description)))) && ((this.mimeType == rhs.mimeType) || ((this.mimeType != null) && this.mimeType.equals(rhs.mimeType)))) && ((this.encoding == rhs.encoding) || ((this.encoding != null) && this.encoding.equals(rhs.encoding)))) && ((this.contents == rhs.contents) || ((this.contents != null) && this.contents.equals(rhs.contents)))) && ((this.hashes == rhs.hashes) || ((this.hashes != null) && this.hashes.equals(rhs.hashes)))) && ((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location)))) && ((this.sourceLanguage == rhs.sourceLanguage) || ((this.sourceLanguage != null) && this.sourceLanguage.equals(rhs.sourceLanguage)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactChange.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactChange.java deleted file mode 100644 index bd8806c1f1..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactChange.java +++ /dev/null @@ -1,163 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A change to a single artifact. - */ -@Generated("jsonschema2pojo") -public class ArtifactChange { - - /** - * Specifies the location of an artifact. - * (Required) - */ - @SerializedName("artifactLocation") - @Expose - private ArtifactLocation artifactLocation; - /** - * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. - * (Required) - */ - @SerializedName("replacements") - @Expose - private List replacements = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ArtifactChange() { - } - - /** - * @param replacements - * @param artifactLocation - * @param properties - */ - public ArtifactChange(ArtifactLocation artifactLocation, List replacements, PropertyBag properties) { - super(); - this.artifactLocation = artifactLocation; - this.replacements = replacements; - this.properties = properties; - } - - /** - * Specifies the location of an artifact. - * (Required) - */ - public ArtifactLocation getArtifactLocation() { - return artifactLocation; - } - - /** - * Specifies the location of an artifact. - * (Required) - */ - public void setArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - } - - public ArtifactChange withArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - return this; - } - - /** - * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. - * (Required) - */ - public List getReplacements() { - return replacements; - } - - /** - * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. - * (Required) - */ - public void setReplacements(List replacements) { - this.replacements = replacements; - } - - public ArtifactChange withReplacements(List replacements) { - this.replacements = replacements; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ArtifactChange withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ArtifactChange.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("artifactLocation"); - sb.append('='); - sb.append(((this.artifactLocation == null) ? "" : this.artifactLocation)); - sb.append(','); - sb.append("replacements"); - sb.append('='); - sb.append(((this.replacements == null) ? "" : this.replacements)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.artifactLocation == null) ? 0 : this.artifactLocation.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.replacements == null) ? 0 : this.replacements.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ArtifactChange) == false) { - return false; - } - ArtifactChange rhs = ((ArtifactChange) other); - return ((((this.artifactLocation == rhs.artifactLocation) || ((this.artifactLocation != null) && this.artifactLocation.equals(rhs.artifactLocation))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.replacements == rhs.replacements) || ((this.replacements != null) && this.replacements.equals(rhs.replacements)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactContent.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactContent.java deleted file mode 100644 index a48a7435bd..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactContent.java +++ /dev/null @@ -1,187 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Represents the contents of an artifact. - */ -@Generated("jsonschema2pojo") -public class ArtifactContent { - - /** - * UTF-8-encoded content from a text artifact. - */ - @SerializedName("text") - @Expose - private String text; - /** - * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. - */ - @SerializedName("binary") - @Expose - private String binary; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("rendered") - @Expose - private MultiformatMessageString rendered; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ArtifactContent() { - } - - /** - * @param rendered - * @param binary - * @param text - * @param properties - */ - public ArtifactContent(String text, String binary, MultiformatMessageString rendered, PropertyBag properties) { - super(); - this.text = text; - this.binary = binary; - this.rendered = rendered; - this.properties = properties; - } - - /** - * UTF-8-encoded content from a text artifact. - */ - public String getText() { - return text; - } - - /** - * UTF-8-encoded content from a text artifact. - */ - public void setText(String text) { - this.text = text; - } - - public ArtifactContent withText(String text) { - this.text = text; - return this; - } - - /** - * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. - */ - public String getBinary() { - return binary; - } - - /** - * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. - */ - public void setBinary(String binary) { - this.binary = binary; - } - - public ArtifactContent withBinary(String binary) { - this.binary = binary; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getRendered() { - return rendered; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setRendered(MultiformatMessageString rendered) { - this.rendered = rendered; - } - - public ArtifactContent withRendered(MultiformatMessageString rendered) { - this.rendered = rendered; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ArtifactContent withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ArtifactContent.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("text"); - sb.append('='); - sb.append(((this.text == null) ? "" : this.text)); - sb.append(','); - sb.append("binary"); - sb.append('='); - sb.append(((this.binary == null) ? "" : this.binary)); - sb.append(','); - sb.append("rendered"); - sb.append('='); - sb.append(((this.rendered == null) ? "" : this.rendered)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.text == null) ? 0 : this.text.hashCode())); - result = ((result * 31) + ((this.rendered == null) ? 0 : this.rendered.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.binary == null) ? 0 : this.binary.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ArtifactContent) == false) { - return false; - } - ArtifactContent rhs = ((ArtifactContent) other); - return (((((this.text == rhs.text) || ((this.text != null) && this.text.equals(rhs.text))) && ((this.rendered == rhs.rendered) || ((this.rendered != null) && this.rendered.equals(rhs.rendered)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.binary == rhs.binary) || ((this.binary != null) && this.binary.equals(rhs.binary)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactLocation.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactLocation.java deleted file mode 100644 index e58b5e6cfc..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ArtifactLocation.java +++ /dev/null @@ -1,219 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Specifies the location of an artifact. - */ -@Generated("jsonschema2pojo") -public class ArtifactLocation { - - /** - * A string containing a valid relative or absolute URI. - */ - @SerializedName("uri") - @Expose - private String uri; - /** - * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. - */ - @SerializedName("uriBaseId") - @Expose - private String uriBaseId; - /** - * The index within the run artifacts array of the artifact object associated with the artifact location. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ArtifactLocation() { - } - - /** - * @param index - * @param description - * @param uri - * @param properties - * @param uriBaseId - */ - public ArtifactLocation(String uri, String uriBaseId, int index, Message description, PropertyBag properties) { - super(); - this.uri = uri; - this.uriBaseId = uriBaseId; - this.index = index; - this.description = description; - this.properties = properties; - } - - /** - * A string containing a valid relative or absolute URI. - */ - public String getUri() { - return uri; - } - - /** - * A string containing a valid relative or absolute URI. - */ - public void setUri(String uri) { - this.uri = uri; - } - - public ArtifactLocation withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. - */ - public String getUriBaseId() { - return uriBaseId; - } - - /** - * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. - */ - public void setUriBaseId(String uriBaseId) { - this.uriBaseId = uriBaseId; - } - - public ArtifactLocation withUriBaseId(String uriBaseId) { - this.uriBaseId = uriBaseId; - return this; - } - - /** - * The index within the run artifacts array of the artifact object associated with the artifact location. - */ - public int getIndex() { - return index; - } - - /** - * The index within the run artifacts array of the artifact object associated with the artifact location. - */ - public void setIndex(int index) { - this.index = index; - } - - public ArtifactLocation withIndex(int index) { - this.index = index; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public ArtifactLocation withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ArtifactLocation withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ArtifactLocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("uri"); - sb.append('='); - sb.append(((this.uri == null) ? "" : this.uri)); - sb.append(','); - sb.append("uriBaseId"); - sb.append('='); - sb.append(((this.uriBaseId == null) ? "" : this.uriBaseId)); - sb.append(','); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.uri == null) ? 0 : this.uri.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.uriBaseId == null) ? 0 : this.uriBaseId.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ArtifactLocation) == false) { - return false; - } - ArtifactLocation rhs = ((ArtifactLocation) other); - return (((((this.index == rhs.index) && ((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description)))) && ((this.uri == rhs.uri) || ((this.uri != null) && this.uri.equals(rhs.uri)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.uriBaseId == rhs.uriBaseId) || ((this.uriBaseId != null) && this.uriBaseId.equals(rhs.uriBaseId)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Attachment.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Attachment.java deleted file mode 100644 index d809d0d4a8..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Attachment.java +++ /dev/null @@ -1,224 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * An artifact relevant to a result. - */ -@Generated("jsonschema2pojo") -public class Attachment { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Specifies the location of an artifact. - * (Required) - */ - @SerializedName("artifactLocation") - @Expose - private ArtifactLocation artifactLocation; - /** - * An array of regions of interest within the attachment. - */ - @SerializedName("regions") - @Expose - private Set regions = new LinkedHashSet(); - /** - * An array of rectangles specifying areas of interest within the image. - */ - @SerializedName("rectangles") - @Expose - private Set rectangles = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Attachment() { - } - - /** - * @param regions - * @param rectangles - * @param description - * @param artifactLocation - * @param properties - */ - public Attachment(Message description, ArtifactLocation artifactLocation, Set regions, Set rectangles, PropertyBag properties) { - super(); - this.description = description; - this.artifactLocation = artifactLocation; - this.regions = regions; - this.rectangles = rectangles; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public Attachment withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Specifies the location of an artifact. - * (Required) - */ - public ArtifactLocation getArtifactLocation() { - return artifactLocation; - } - - /** - * Specifies the location of an artifact. - * (Required) - */ - public void setArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - } - - public Attachment withArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - return this; - } - - /** - * An array of regions of interest within the attachment. - */ - public Set getRegions() { - return regions; - } - - /** - * An array of regions of interest within the attachment. - */ - public void setRegions(Set regions) { - this.regions = regions; - } - - public Attachment withRegions(Set regions) { - this.regions = regions; - return this; - } - - /** - * An array of rectangles specifying areas of interest within the image. - */ - public Set getRectangles() { - return rectangles; - } - - /** - * An array of rectangles specifying areas of interest within the image. - */ - public void setRectangles(Set rectangles) { - this.rectangles = rectangles; - } - - public Attachment withRectangles(Set rectangles) { - this.rectangles = rectangles; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Attachment withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Attachment.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("artifactLocation"); - sb.append('='); - sb.append(((this.artifactLocation == null) ? "" : this.artifactLocation)); - sb.append(','); - sb.append("regions"); - sb.append('='); - sb.append(((this.regions == null) ? "" : this.regions)); - sb.append(','); - sb.append("rectangles"); - sb.append('='); - sb.append(((this.rectangles == null) ? "" : this.rectangles)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.regions == null) ? 0 : this.regions.hashCode())); - result = ((result * 31) + ((this.rectangles == null) ? 0 : this.rectangles.hashCode())); - result = ((result * 31) + ((this.artifactLocation == null) ? 0 : this.artifactLocation.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Attachment) == false) { - return false; - } - Attachment rhs = ((Attachment) other); - return ((((((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description))) && ((this.regions == rhs.regions) || ((this.regions != null) && this.regions.equals(rhs.regions)))) && ((this.rectangles == rhs.rectangles) || ((this.rectangles != null) && this.rectangles.equals(rhs.rectangles)))) && ((this.artifactLocation == rhs.artifactLocation) || ((this.artifactLocation != null) && this.artifactLocation.equals(rhs.artifactLocation)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/CodeFlow.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/CodeFlow.java deleted file mode 100644 index 802ecce57d..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/CodeFlow.java +++ /dev/null @@ -1,160 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A set of threadFlows which together describe a pattern of code execution relevant to detecting a result. - */ -@Generated("jsonschema2pojo") -public class CodeFlow { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. - * (Required) - */ - @SerializedName("threadFlows") - @Expose - private List threadFlows = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public CodeFlow() { - } - - /** - * @param message - * @param threadFlows - * @param properties - */ - public CodeFlow(Message message, List threadFlows, PropertyBag properties) { - super(); - this.message = message; - this.threadFlows = threadFlows; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public CodeFlow withMessage(Message message) { - this.message = message; - return this; - } - - /** - * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. - * (Required) - */ - public List getThreadFlows() { - return threadFlows; - } - - /** - * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. - * (Required) - */ - public void setThreadFlows(List threadFlows) { - this.threadFlows = threadFlows; - } - - public CodeFlow withThreadFlows(List threadFlows) { - this.threadFlows = threadFlows; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public CodeFlow withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(CodeFlow.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("threadFlows"); - sb.append('='); - sb.append(((this.threadFlows == null) ? "" : this.threadFlows)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.threadFlows == null) ? 0 : this.threadFlows.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof CodeFlow) == false) { - return false; - } - CodeFlow rhs = ((CodeFlow) other); - return ((((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message))) && ((this.threadFlows == rhs.threadFlows) || ((this.threadFlows != null) && this.threadFlows.equals(rhs.threadFlows)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ConfigurationOverride.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ConfigurationOverride.java deleted file mode 100644 index 5a155dea61..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ConfigurationOverride.java +++ /dev/null @@ -1,161 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information about how a specific rule or notification was reconfigured at runtime. - */ -@Generated("jsonschema2pojo") -public class ConfigurationOverride { - - /** - * Information about a rule or notification that can be configured at runtime. - * (Required) - */ - @SerializedName("configuration") - @Expose - private ReportingConfiguration configuration; - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - @SerializedName("descriptor") - @Expose - private ReportingDescriptorReference descriptor; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ConfigurationOverride() { - } - - /** - * @param configuration - * @param descriptor - * @param properties - */ - public ConfigurationOverride(ReportingConfiguration configuration, ReportingDescriptorReference descriptor, PropertyBag properties) { - super(); - this.configuration = configuration; - this.descriptor = descriptor; - this.properties = properties; - } - - /** - * Information about a rule or notification that can be configured at runtime. - * (Required) - */ - public ReportingConfiguration getConfiguration() { - return configuration; - } - - /** - * Information about a rule or notification that can be configured at runtime. - * (Required) - */ - public void setConfiguration(ReportingConfiguration configuration) { - this.configuration = configuration; - } - - public ConfigurationOverride withConfiguration(ReportingConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - public ReportingDescriptorReference getDescriptor() { - return descriptor; - } - - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - public void setDescriptor(ReportingDescriptorReference descriptor) { - this.descriptor = descriptor; - } - - public ConfigurationOverride withDescriptor(ReportingDescriptorReference descriptor) { - this.descriptor = descriptor; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ConfigurationOverride withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ConfigurationOverride.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("configuration"); - sb.append('='); - sb.append(((this.configuration == null) ? "" : this.configuration)); - sb.append(','); - sb.append("descriptor"); - sb.append('='); - sb.append(((this.descriptor == null) ? "" : this.descriptor)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.configuration == null) ? 0 : this.configuration.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.descriptor == null) ? 0 : this.descriptor.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ConfigurationOverride) == false) { - return false; - } - ConfigurationOverride rhs = ((ConfigurationOverride) other); - return ((((this.configuration == rhs.configuration) || ((this.configuration != null) && this.configuration.equals(rhs.configuration))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.descriptor == rhs.descriptor) || ((this.descriptor != null) && this.descriptor.equals(rhs.descriptor)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Conversion.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Conversion.java deleted file mode 100644 index d51cdfd2a9..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Conversion.java +++ /dev/null @@ -1,192 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ -@Generated("jsonschema2pojo") -public class Conversion { - - /** - * The analysis tool that was run. - * (Required) - */ - @SerializedName("tool") - @Expose - private Tool tool; - /** - * The runtime environment of the analysis tool run. - */ - @SerializedName("invocation") - @Expose - private Invocation invocation; - /** - * The locations of the analysis tool's per-run log files. - */ - @SerializedName("analysisToolLogFiles") - @Expose - private Set analysisToolLogFiles = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Conversion() { - } - - /** - * @param invocation - * @param analysisToolLogFiles - * @param tool - * @param properties - */ - public Conversion(Tool tool, Invocation invocation, Set analysisToolLogFiles, PropertyBag properties) { - super(); - this.tool = tool; - this.invocation = invocation; - this.analysisToolLogFiles = analysisToolLogFiles; - this.properties = properties; - } - - /** - * The analysis tool that was run. - * (Required) - */ - public Tool getTool() { - return tool; - } - - /** - * The analysis tool that was run. - * (Required) - */ - public void setTool(Tool tool) { - this.tool = tool; - } - - public Conversion withTool(Tool tool) { - this.tool = tool; - return this; - } - - /** - * The runtime environment of the analysis tool run. - */ - public Invocation getInvocation() { - return invocation; - } - - /** - * The runtime environment of the analysis tool run. - */ - public void setInvocation(Invocation invocation) { - this.invocation = invocation; - } - - public Conversion withInvocation(Invocation invocation) { - this.invocation = invocation; - return this; - } - - /** - * The locations of the analysis tool's per-run log files. - */ - public Set getAnalysisToolLogFiles() { - return analysisToolLogFiles; - } - - /** - * The locations of the analysis tool's per-run log files. - */ - public void setAnalysisToolLogFiles(Set analysisToolLogFiles) { - this.analysisToolLogFiles = analysisToolLogFiles; - } - - public Conversion withAnalysisToolLogFiles(Set analysisToolLogFiles) { - this.analysisToolLogFiles = analysisToolLogFiles; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Conversion withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Conversion.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("tool"); - sb.append('='); - sb.append(((this.tool == null) ? "" : this.tool)); - sb.append(','); - sb.append("invocation"); - sb.append('='); - sb.append(((this.invocation == null) ? "" : this.invocation)); - sb.append(','); - sb.append("analysisToolLogFiles"); - sb.append('='); - sb.append(((this.analysisToolLogFiles == null) ? "" : this.analysisToolLogFiles)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.invocation == null) ? 0 : this.invocation.hashCode())); - result = ((result * 31) + ((this.analysisToolLogFiles == null) ? 0 : this.analysisToolLogFiles.hashCode())); - result = ((result * 31) + ((this.tool == null) ? 0 : this.tool.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Conversion) == false) { - return false; - } - Conversion rhs = ((Conversion) other); - return (((((this.invocation == rhs.invocation) || ((this.invocation != null) && this.invocation.equals(rhs.invocation))) && ((this.analysisToolLogFiles == rhs.analysisToolLogFiles) || ((this.analysisToolLogFiles != null) && this.analysisToolLogFiles.equals(rhs.analysisToolLogFiles)))) && ((this.tool == rhs.tool) || ((this.tool != null) && this.tool.equals(rhs.tool)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Edge.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Edge.java deleted file mode 100644 index 6b6d9b9ee5..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Edge.java +++ /dev/null @@ -1,228 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Represents a directed edge in a graph. - */ -@Generated("jsonschema2pojo") -public class Edge { - - /** - * A string that uniquely identifies the edge within its graph. - * (Required) - */ - @SerializedName("id") - @Expose - private String id; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("label") - @Expose - private Message label; - /** - * Identifies the source node (the node at which the edge starts). - * (Required) - */ - @SerializedName("sourceNodeId") - @Expose - private String sourceNodeId; - /** - * Identifies the target node (the node at which the edge ends). - * (Required) - */ - @SerializedName("targetNodeId") - @Expose - private String targetNodeId; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Edge() { - } - - /** - * @param sourceNodeId - * @param id - * @param label - * @param targetNodeId - * @param properties - */ - public Edge(String id, Message label, String sourceNodeId, String targetNodeId, PropertyBag properties) { - super(); - this.id = id; - this.label = label; - this.sourceNodeId = sourceNodeId; - this.targetNodeId = targetNodeId; - this.properties = properties; - } - - /** - * A string that uniquely identifies the edge within its graph. - * (Required) - */ - public String getId() { - return id; - } - - /** - * A string that uniquely identifies the edge within its graph. - * (Required) - */ - public void setId(String id) { - this.id = id; - } - - public Edge withId(String id) { - this.id = id; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getLabel() { - return label; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setLabel(Message label) { - this.label = label; - } - - public Edge withLabel(Message label) { - this.label = label; - return this; - } - - /** - * Identifies the source node (the node at which the edge starts). - * (Required) - */ - public String getSourceNodeId() { - return sourceNodeId; - } - - /** - * Identifies the source node (the node at which the edge starts). - * (Required) - */ - public void setSourceNodeId(String sourceNodeId) { - this.sourceNodeId = sourceNodeId; - } - - public Edge withSourceNodeId(String sourceNodeId) { - this.sourceNodeId = sourceNodeId; - return this; - } - - /** - * Identifies the target node (the node at which the edge ends). - * (Required) - */ - public String getTargetNodeId() { - return targetNodeId; - } - - /** - * Identifies the target node (the node at which the edge ends). - * (Required) - */ - public void setTargetNodeId(String targetNodeId) { - this.targetNodeId = targetNodeId; - } - - public Edge withTargetNodeId(String targetNodeId) { - this.targetNodeId = targetNodeId; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Edge withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Edge.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("label"); - sb.append('='); - sb.append(((this.label == null) ? "" : this.label)); - sb.append(','); - sb.append("sourceNodeId"); - sb.append('='); - sb.append(((this.sourceNodeId == null) ? "" : this.sourceNodeId)); - sb.append(','); - sb.append("targetNodeId"); - sb.append('='); - sb.append(((this.targetNodeId == null) ? "" : this.targetNodeId)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.label == null) ? 0 : this.label.hashCode())); - result = ((result * 31) + ((this.targetNodeId == null) ? 0 : this.targetNodeId.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.sourceNodeId == null) ? 0 : this.sourceNodeId.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Edge) == false) { - return false; - } - Edge rhs = ((Edge) other); - return ((((((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id))) && ((this.label == rhs.label) || ((this.label != null) && this.label.equals(rhs.label)))) && ((this.targetNodeId == rhs.targetNodeId) || ((this.targetNodeId != null) && this.targetNodeId.equals(rhs.targetNodeId)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.sourceNodeId == rhs.sourceNodeId) || ((this.sourceNodeId != null) && this.sourceNodeId.equals(rhs.sourceNodeId)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EdgeTraversal.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EdgeTraversal.java deleted file mode 100644 index a37c951c8e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EdgeTraversal.java +++ /dev/null @@ -1,222 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Represents the traversal of a single edge during a graph traversal. - */ -@Generated("jsonschema2pojo") -public class EdgeTraversal { - - /** - * Identifies the edge being traversed. - * (Required) - */ - @SerializedName("edgeId") - @Expose - private String edgeId; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * The values of relevant expressions after the edge has been traversed. - */ - @SerializedName("finalState") - @Expose - private FinalState finalState; - /** - * The number of edge traversals necessary to return from a nested graph. - */ - @SerializedName("stepOverEdgeCount") - @Expose - private int stepOverEdgeCount; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public EdgeTraversal() { - } - - /** - * @param edgeId - * @param stepOverEdgeCount - * @param message - * @param finalState - * @param properties - */ - public EdgeTraversal(String edgeId, Message message, FinalState finalState, int stepOverEdgeCount, PropertyBag properties) { - super(); - this.edgeId = edgeId; - this.message = message; - this.finalState = finalState; - this.stepOverEdgeCount = stepOverEdgeCount; - this.properties = properties; - } - - /** - * Identifies the edge being traversed. - * (Required) - */ - public String getEdgeId() { - return edgeId; - } - - /** - * Identifies the edge being traversed. - * (Required) - */ - public void setEdgeId(String edgeId) { - this.edgeId = edgeId; - } - - public EdgeTraversal withEdgeId(String edgeId) { - this.edgeId = edgeId; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public EdgeTraversal withMessage(Message message) { - this.message = message; - return this; - } - - /** - * The values of relevant expressions after the edge has been traversed. - */ - public FinalState getFinalState() { - return finalState; - } - - /** - * The values of relevant expressions after the edge has been traversed. - */ - public void setFinalState(FinalState finalState) { - this.finalState = finalState; - } - - public EdgeTraversal withFinalState(FinalState finalState) { - this.finalState = finalState; - return this; - } - - /** - * The number of edge traversals necessary to return from a nested graph. - */ - public int getStepOverEdgeCount() { - return stepOverEdgeCount; - } - - /** - * The number of edge traversals necessary to return from a nested graph. - */ - public void setStepOverEdgeCount(int stepOverEdgeCount) { - this.stepOverEdgeCount = stepOverEdgeCount; - } - - public EdgeTraversal withStepOverEdgeCount(int stepOverEdgeCount) { - this.stepOverEdgeCount = stepOverEdgeCount; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public EdgeTraversal withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(EdgeTraversal.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("edgeId"); - sb.append('='); - sb.append(((this.edgeId == null) ? "" : this.edgeId)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("finalState"); - sb.append('='); - sb.append(((this.finalState == null) ? "" : this.finalState)); - sb.append(','); - sb.append("stepOverEdgeCount"); - sb.append('='); - sb.append(this.stepOverEdgeCount); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.edgeId == null) ? 0 : this.edgeId.hashCode())); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + this.stepOverEdgeCount); - result = ((result * 31) + ((this.finalState == null) ? 0 : this.finalState.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof EdgeTraversal) == false) { - return false; - } - EdgeTraversal rhs = ((EdgeTraversal) other); - return ((((((this.edgeId == rhs.edgeId) || ((this.edgeId != null) && this.edgeId.equals(rhs.edgeId))) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && (this.stepOverEdgeCount == rhs.stepOverEdgeCount)) && ((this.finalState == rhs.finalState) || ((this.finalState != null) && this.finalState.equals(rhs.finalState)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EnvironmentVariables.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EnvironmentVariables.java deleted file mode 100644 index 211cf622f5..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/EnvironmentVariables.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The environment variables associated with the analysis tool process, expressed as key/value pairs. - */ -@Generated("jsonschema2pojo") -public class EnvironmentVariables { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(EnvironmentVariables.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof EnvironmentVariables) == false) { - return false; - } - EnvironmentVariables rhs = ((EnvironmentVariables) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Exception.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Exception.java deleted file mode 100644 index ab7eebc803..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Exception.java +++ /dev/null @@ -1,221 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes a runtime exception encountered during the execution of an analysis tool. - */ -@Generated("jsonschema2pojo") -public class Exception { - - /** - * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. - */ - @SerializedName("kind") - @Expose - private String kind; - /** - * A message that describes the exception. - */ - @SerializedName("message") - @Expose - private String message; - /** - * A call stack that is relevant to a result. - */ - @SerializedName("stack") - @Expose - private Stack stack; - /** - * An array of exception objects each of which is considered a cause of this exception. - */ - @SerializedName("innerExceptions") - @Expose - private List innerExceptions = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Exception() { - } - - /** - * @param stack - * @param kind - * @param innerExceptions - * @param message - * @param properties - */ - public Exception(String kind, String message, Stack stack, List innerExceptions, PropertyBag properties) { - super(); - this.kind = kind; - this.message = message; - this.stack = stack; - this.innerExceptions = innerExceptions; - this.properties = properties; - } - - /** - * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. - */ - public String getKind() { - return kind; - } - - /** - * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. - */ - public void setKind(String kind) { - this.kind = kind; - } - - public Exception withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * A message that describes the exception. - */ - public String getMessage() { - return message; - } - - /** - * A message that describes the exception. - */ - public void setMessage(String message) { - this.message = message; - } - - public Exception withMessage(String message) { - this.message = message; - return this; - } - - /** - * A call stack that is relevant to a result. - */ - public Stack getStack() { - return stack; - } - - /** - * A call stack that is relevant to a result. - */ - public void setStack(Stack stack) { - this.stack = stack; - } - - public Exception withStack(Stack stack) { - this.stack = stack; - return this; - } - - /** - * An array of exception objects each of which is considered a cause of this exception. - */ - public List getInnerExceptions() { - return innerExceptions; - } - - /** - * An array of exception objects each of which is considered a cause of this exception. - */ - public void setInnerExceptions(List innerExceptions) { - this.innerExceptions = innerExceptions; - } - - public Exception withInnerExceptions(List innerExceptions) { - this.innerExceptions = innerExceptions; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Exception withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Exception.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("kind"); - sb.append('='); - sb.append(((this.kind == null) ? "" : this.kind)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("stack"); - sb.append('='); - sb.append(((this.stack == null) ? "" : this.stack)); - sb.append(','); - sb.append("innerExceptions"); - sb.append('='); - sb.append(((this.innerExceptions == null) ? "" : this.innerExceptions)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.stack == null) ? 0 : this.stack.hashCode())); - result = ((result * 31) + ((this.innerExceptions == null) ? 0 : this.innerExceptions.hashCode())); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.kind == null) ? 0 : this.kind.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Exception) == false) { - return false; - } - Exception rhs = ((Exception) other); - return ((((((this.stack == rhs.stack) || ((this.stack != null) && this.stack.equals(rhs.stack))) && ((this.innerExceptions == rhs.innerExceptions) || ((this.innerExceptions != null) && this.innerExceptions.equals(rhs.innerExceptions)))) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.kind == rhs.kind) || ((this.kind != null) && this.kind.equals(rhs.kind)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalProperties.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalProperties.java deleted file mode 100644 index 8af1758fd6..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalProperties.java +++ /dev/null @@ -1,780 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * The top-level element of an external property file. - */ -@Generated("jsonschema2pojo") -public class ExternalProperties { - - /** - * The URI of the JSON schema corresponding to the version of the external property file format. - */ - @SerializedName("schema") - @Expose - private URI schema; - /** - * The SARIF format version of this external properties object. - */ - @SerializedName("version") - @Expose - private ExternalProperties.Version version; - /** - * A stable, unique identifer for this external properties object, in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * A stable, unique identifer for the run associated with this external properties object, in the form of a GUID. - */ - @SerializedName("runGuid") - @Expose - private String runGuid; - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - @SerializedName("conversion") - @Expose - private Conversion conversion; - /** - * An array of graph objects that will be merged with a separate run. - */ - @SerializedName("graphs") - @Expose - private Set graphs = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("externalizedProperties") - @Expose - private PropertyBag externalizedProperties; - /** - * An array of artifact objects that will be merged with a separate run. - */ - @SerializedName("artifacts") - @Expose - private Set artifacts = new LinkedHashSet(); - /** - * Describes the invocation of the analysis tool that will be merged with a separate run. - */ - @SerializedName("invocations") - @Expose - private List invocations = new ArrayList(); - /** - * An array of logical locations such as namespaces, types or functions that will be merged with a separate run. - */ - @SerializedName("logicalLocations") - @Expose - private Set logicalLocations = new LinkedHashSet(); - /** - * An array of threadFlowLocation objects that will be merged with a separate run. - */ - @SerializedName("threadFlowLocations") - @Expose - private Set threadFlowLocations = new LinkedHashSet(); - /** - * An array of result objects that will be merged with a separate run. - */ - @SerializedName("results") - @Expose - private List results = new ArrayList(); - /** - * Tool taxonomies that will be merged with a separate run. - */ - @SerializedName("taxonomies") - @Expose - private Set taxonomies = new LinkedHashSet(); - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - */ - @SerializedName("driver") - @Expose - private ToolComponent driver; - /** - * Tool extensions that will be merged with a separate run. - */ - @SerializedName("extensions") - @Expose - private Set extensions = new LinkedHashSet(); - /** - * Tool policies that will be merged with a separate run. - */ - @SerializedName("policies") - @Expose - private Set policies = new LinkedHashSet(); - /** - * Tool translations that will be merged with a separate run. - */ - @SerializedName("translations") - @Expose - private Set translations = new LinkedHashSet(); - /** - * Addresses that will be merged with a separate run. - */ - @SerializedName("addresses") - @Expose - private List
addresses = new ArrayList
(); - /** - * Requests that will be merged with a separate run. - */ - @SerializedName("webRequests") - @Expose - private Set webRequests = new LinkedHashSet(); - /** - * Responses that will be merged with a separate run. - */ - @SerializedName("webResponses") - @Expose - private Set webResponses = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ExternalProperties() { - } - - /** - * @param schema - * @param addresses - * @param logicalLocations - * @param policies - * @param runGuid - * @param version - * @param externalizedProperties - * @param invocations - * @param graphs - * @param extensions - * @param driver - * @param taxonomies - * @param translations - * @param webResponses - * @param guid - * @param webRequests - * @param results - * @param threadFlowLocations - * @param properties - * @param conversion - * @param artifacts - */ - public ExternalProperties(URI schema, ExternalProperties.Version version, String guid, String runGuid, Conversion conversion, Set graphs, PropertyBag externalizedProperties, Set artifacts, List invocations, Set logicalLocations, Set threadFlowLocations, List results, Set taxonomies, ToolComponent driver, Set extensions, Set policies, Set translations, List
addresses, Set webRequests, Set webResponses, PropertyBag properties) { - super(); - this.schema = schema; - this.version = version; - this.guid = guid; - this.runGuid = runGuid; - this.conversion = conversion; - this.graphs = graphs; - this.externalizedProperties = externalizedProperties; - this.artifacts = artifacts; - this.invocations = invocations; - this.logicalLocations = logicalLocations; - this.threadFlowLocations = threadFlowLocations; - this.results = results; - this.taxonomies = taxonomies; - this.driver = driver; - this.extensions = extensions; - this.policies = policies; - this.translations = translations; - this.addresses = addresses; - this.webRequests = webRequests; - this.webResponses = webResponses; - this.properties = properties; - } - - /** - * The URI of the JSON schema corresponding to the version of the external property file format. - */ - public URI getSchema() { - return schema; - } - - /** - * The URI of the JSON schema corresponding to the version of the external property file format. - */ - public void setSchema(URI schema) { - this.schema = schema; - } - - public ExternalProperties withSchema(URI schema) { - this.schema = schema; - return this; - } - - /** - * The SARIF format version of this external properties object. - */ - public ExternalProperties.Version getVersion() { - return version; - } - - /** - * The SARIF format version of this external properties object. - */ - public void setVersion(ExternalProperties.Version version) { - this.version = version; - } - - public ExternalProperties withVersion(ExternalProperties.Version version) { - this.version = version; - return this; - } - - /** - * A stable, unique identifer for this external properties object, in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A stable, unique identifer for this external properties object, in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ExternalProperties withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * A stable, unique identifer for the run associated with this external properties object, in the form of a GUID. - */ - public String getRunGuid() { - return runGuid; - } - - /** - * A stable, unique identifer for the run associated with this external properties object, in the form of a GUID. - */ - public void setRunGuid(String runGuid) { - this.runGuid = runGuid; - } - - public ExternalProperties withRunGuid(String runGuid) { - this.runGuid = runGuid; - return this; - } - - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - public Conversion getConversion() { - return conversion; - } - - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - public void setConversion(Conversion conversion) { - this.conversion = conversion; - } - - public ExternalProperties withConversion(Conversion conversion) { - this.conversion = conversion; - return this; - } - - /** - * An array of graph objects that will be merged with a separate run. - */ - public Set getGraphs() { - return graphs; - } - - /** - * An array of graph objects that will be merged with a separate run. - */ - public void setGraphs(Set graphs) { - this.graphs = graphs; - } - - public ExternalProperties withGraphs(Set graphs) { - this.graphs = graphs; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getExternalizedProperties() { - return externalizedProperties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setExternalizedProperties(PropertyBag externalizedProperties) { - this.externalizedProperties = externalizedProperties; - } - - public ExternalProperties withExternalizedProperties(PropertyBag externalizedProperties) { - this.externalizedProperties = externalizedProperties; - return this; - } - - /** - * An array of artifact objects that will be merged with a separate run. - */ - public Set getArtifacts() { - return artifacts; - } - - /** - * An array of artifact objects that will be merged with a separate run. - */ - public void setArtifacts(Set artifacts) { - this.artifacts = artifacts; - } - - public ExternalProperties withArtifacts(Set artifacts) { - this.artifacts = artifacts; - return this; - } - - /** - * Describes the invocation of the analysis tool that will be merged with a separate run. - */ - public List getInvocations() { - return invocations; - } - - /** - * Describes the invocation of the analysis tool that will be merged with a separate run. - */ - public void setInvocations(List invocations) { - this.invocations = invocations; - } - - public ExternalProperties withInvocations(List invocations) { - this.invocations = invocations; - return this; - } - - /** - * An array of logical locations such as namespaces, types or functions that will be merged with a separate run. - */ - public Set getLogicalLocations() { - return logicalLocations; - } - - /** - * An array of logical locations such as namespaces, types or functions that will be merged with a separate run. - */ - public void setLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - } - - public ExternalProperties withLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - return this; - } - - /** - * An array of threadFlowLocation objects that will be merged with a separate run. - */ - public Set getThreadFlowLocations() { - return threadFlowLocations; - } - - /** - * An array of threadFlowLocation objects that will be merged with a separate run. - */ - public void setThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - } - - public ExternalProperties withThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - return this; - } - - /** - * An array of result objects that will be merged with a separate run. - */ - public List getResults() { - return results; - } - - /** - * An array of result objects that will be merged with a separate run. - */ - public void setResults(List results) { - this.results = results; - } - - public ExternalProperties withResults(List results) { - this.results = results; - return this; - } - - /** - * Tool taxonomies that will be merged with a separate run. - */ - public Set getTaxonomies() { - return taxonomies; - } - - /** - * Tool taxonomies that will be merged with a separate run. - */ - public void setTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - } - - public ExternalProperties withTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - return this; - } - - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - */ - public ToolComponent getDriver() { - return driver; - } - - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - */ - public void setDriver(ToolComponent driver) { - this.driver = driver; - } - - public ExternalProperties withDriver(ToolComponent driver) { - this.driver = driver; - return this; - } - - /** - * Tool extensions that will be merged with a separate run. - */ - public Set getExtensions() { - return extensions; - } - - /** - * Tool extensions that will be merged with a separate run. - */ - public void setExtensions(Set extensions) { - this.extensions = extensions; - } - - public ExternalProperties withExtensions(Set extensions) { - this.extensions = extensions; - return this; - } - - /** - * Tool policies that will be merged with a separate run. - */ - public Set getPolicies() { - return policies; - } - - /** - * Tool policies that will be merged with a separate run. - */ - public void setPolicies(Set policies) { - this.policies = policies; - } - - public ExternalProperties withPolicies(Set policies) { - this.policies = policies; - return this; - } - - /** - * Tool translations that will be merged with a separate run. - */ - public Set getTranslations() { - return translations; - } - - /** - * Tool translations that will be merged with a separate run. - */ - public void setTranslations(Set translations) { - this.translations = translations; - } - - public ExternalProperties withTranslations(Set translations) { - this.translations = translations; - return this; - } - - /** - * Addresses that will be merged with a separate run. - */ - public List
getAddresses() { - return addresses; - } - - /** - * Addresses that will be merged with a separate run. - */ - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - - public ExternalProperties withAddresses(List
addresses) { - this.addresses = addresses; - return this; - } - - /** - * Requests that will be merged with a separate run. - */ - public Set getWebRequests() { - return webRequests; - } - - /** - * Requests that will be merged with a separate run. - */ - public void setWebRequests(Set webRequests) { - this.webRequests = webRequests; - } - - public ExternalProperties withWebRequests(Set webRequests) { - this.webRequests = webRequests; - return this; - } - - /** - * Responses that will be merged with a separate run. - */ - public Set getWebResponses() { - return webResponses; - } - - /** - * Responses that will be merged with a separate run. - */ - public void setWebResponses(Set webResponses) { - this.webResponses = webResponses; - } - - public ExternalProperties withWebResponses(Set webResponses) { - this.webResponses = webResponses; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ExternalProperties withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ExternalProperties.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("schema"); - sb.append('='); - sb.append(((this.schema == null) ? "" : this.schema)); - sb.append(','); - sb.append("version"); - sb.append('='); - sb.append(((this.version == null) ? "" : this.version)); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("runGuid"); - sb.append('='); - sb.append(((this.runGuid == null) ? "" : this.runGuid)); - sb.append(','); - sb.append("conversion"); - sb.append('='); - sb.append(((this.conversion == null) ? "" : this.conversion)); - sb.append(','); - sb.append("graphs"); - sb.append('='); - sb.append(((this.graphs == null) ? "" : this.graphs)); - sb.append(','); - sb.append("externalizedProperties"); - sb.append('='); - sb.append(((this.externalizedProperties == null) ? "" : this.externalizedProperties)); - sb.append(','); - sb.append("artifacts"); - sb.append('='); - sb.append(((this.artifacts == null) ? "" : this.artifacts)); - sb.append(','); - sb.append("invocations"); - sb.append('='); - sb.append(((this.invocations == null) ? "" : this.invocations)); - sb.append(','); - sb.append("logicalLocations"); - sb.append('='); - sb.append(((this.logicalLocations == null) ? "" : this.logicalLocations)); - sb.append(','); - sb.append("threadFlowLocations"); - sb.append('='); - sb.append(((this.threadFlowLocations == null) ? "" : this.threadFlowLocations)); - sb.append(','); - sb.append("results"); - sb.append('='); - sb.append(((this.results == null) ? "" : this.results)); - sb.append(','); - sb.append("taxonomies"); - sb.append('='); - sb.append(((this.taxonomies == null) ? "" : this.taxonomies)); - sb.append(','); - sb.append("driver"); - sb.append('='); - sb.append(((this.driver == null) ? "" : this.driver)); - sb.append(','); - sb.append("extensions"); - sb.append('='); - sb.append(((this.extensions == null) ? "" : this.extensions)); - sb.append(','); - sb.append("policies"); - sb.append('='); - sb.append(((this.policies == null) ? "" : this.policies)); - sb.append(','); - sb.append("translations"); - sb.append('='); - sb.append(((this.translations == null) ? "" : this.translations)); - sb.append(','); - sb.append("addresses"); - sb.append('='); - sb.append(((this.addresses == null) ? "" : this.addresses)); - sb.append(','); - sb.append("webRequests"); - sb.append('='); - sb.append(((this.webRequests == null) ? "" : this.webRequests)); - sb.append(','); - sb.append("webResponses"); - sb.append('='); - sb.append(((this.webResponses == null) ? "" : this.webResponses)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.schema == null) ? 0 : this.schema.hashCode())); - result = ((result * 31) + ((this.addresses == null) ? 0 : this.addresses.hashCode())); - result = ((result * 31) + ((this.logicalLocations == null) ? 0 : this.logicalLocations.hashCode())); - result = ((result * 31) + ((this.policies == null) ? 0 : this.policies.hashCode())); - result = ((result * 31) + ((this.runGuid == null) ? 0 : this.runGuid.hashCode())); - result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); - result = ((result * 31) + ((this.externalizedProperties == null) ? 0 : this.externalizedProperties.hashCode())); - result = ((result * 31) + ((this.invocations == null) ? 0 : this.invocations.hashCode())); - result = ((result * 31) + ((this.graphs == null) ? 0 : this.graphs.hashCode())); - result = ((result * 31) + ((this.extensions == null) ? 0 : this.extensions.hashCode())); - result = ((result * 31) + ((this.driver == null) ? 0 : this.driver.hashCode())); - result = ((result * 31) + ((this.taxonomies == null) ? 0 : this.taxonomies.hashCode())); - result = ((result * 31) + ((this.translations == null) ? 0 : this.translations.hashCode())); - result = ((result * 31) + ((this.webResponses == null) ? 0 : this.webResponses.hashCode())); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.webRequests == null) ? 0 : this.webRequests.hashCode())); - result = ((result * 31) + ((this.results == null) ? 0 : this.results.hashCode())); - result = ((result * 31) + ((this.threadFlowLocations == null) ? 0 : this.threadFlowLocations.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.conversion == null) ? 0 : this.conversion.hashCode())); - result = ((result * 31) + ((this.artifacts == null) ? 0 : this.artifacts.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ExternalProperties) == false) { - return false; - } - ExternalProperties rhs = ((ExternalProperties) other); - return ((((((((((((((((((((((this.schema == rhs.schema) || ((this.schema != null) && this.schema.equals(rhs.schema))) && ((this.addresses == rhs.addresses) || ((this.addresses != null) && this.addresses.equals(rhs.addresses)))) && ((this.logicalLocations == rhs.logicalLocations) || ((this.logicalLocations != null) && this.logicalLocations.equals(rhs.logicalLocations)))) && ((this.policies == rhs.policies) || ((this.policies != null) && this.policies.equals(rhs.policies)))) && ((this.runGuid == rhs.runGuid) || ((this.runGuid != null) && this.runGuid.equals(rhs.runGuid)))) && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) && ((this.externalizedProperties == rhs.externalizedProperties) || ((this.externalizedProperties != null) && this.externalizedProperties.equals(rhs.externalizedProperties)))) && ((this.invocations == rhs.invocations) || ((this.invocations != null) && this.invocations.equals(rhs.invocations)))) && ((this.graphs == rhs.graphs) || ((this.graphs != null) && this.graphs.equals(rhs.graphs)))) && ((this.extensions == rhs.extensions) || ((this.extensions != null) && this.extensions.equals(rhs.extensions)))) && ((this.driver == rhs.driver) || ((this.driver != null) && this.driver.equals(rhs.driver)))) && ((this.taxonomies == rhs.taxonomies) || ((this.taxonomies != null) && this.taxonomies.equals(rhs.taxonomies)))) && ((this.translations == rhs.translations) || ((this.translations != null) && this.translations.equals(rhs.translations)))) && ((this.webResponses == rhs.webResponses) || ((this.webResponses != null) && this.webResponses.equals(rhs.webResponses)))) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.webRequests == rhs.webRequests) || ((this.webRequests != null) && this.webRequests.equals(rhs.webRequests)))) && ((this.results == rhs.results) || ((this.results != null) && this.results.equals(rhs.results)))) && ((this.threadFlowLocations == rhs.threadFlowLocations) || ((this.threadFlowLocations != null) && this.threadFlowLocations.equals(rhs.threadFlowLocations)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.conversion == rhs.conversion) || ((this.conversion != null) && this.conversion.equals(rhs.conversion)))) && ((this.artifacts == rhs.artifacts) || ((this.artifacts != null) && this.artifacts.equals(rhs.artifacts)))); - } - - - /** - * The SARIF format version of this external properties object. - */ - @Generated("jsonschema2pojo") - public enum Version { - - @SerializedName("2.1.0") - _2_1_0("2.1.0"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (ExternalProperties.Version c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Version(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static ExternalProperties.Version fromValue(String value) { - ExternalProperties.Version constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReference.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReference.java deleted file mode 100644 index 2e7298f0b2..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReference.java +++ /dev/null @@ -1,187 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ -@Generated("jsonschema2pojo") -public class ExternalPropertyFileReference { - - /** - * Specifies the location of an artifact. - */ - @SerializedName("location") - @Expose - private ArtifactLocation location; - /** - * A stable, unique identifer for the external property file in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * A non-negative integer specifying the number of items contained in the external property file. - */ - @SerializedName("itemCount") - @Expose - private int itemCount = -1; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ExternalPropertyFileReference() { - } - - /** - * @param guid - * @param location - * @param properties - * @param itemCount - */ - public ExternalPropertyFileReference(ArtifactLocation location, String guid, int itemCount, PropertyBag properties) { - super(); - this.location = location; - this.guid = guid; - this.itemCount = itemCount; - this.properties = properties; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getLocation() { - return location; - } - - /** - * Specifies the location of an artifact. - */ - public void setLocation(ArtifactLocation location) { - this.location = location; - } - - public ExternalPropertyFileReference withLocation(ArtifactLocation location) { - this.location = location; - return this; - } - - /** - * A stable, unique identifer for the external property file in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A stable, unique identifer for the external property file in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ExternalPropertyFileReference withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * A non-negative integer specifying the number of items contained in the external property file. - */ - public int getItemCount() { - return itemCount; - } - - /** - * A non-negative integer specifying the number of items contained in the external property file. - */ - public void setItemCount(int itemCount) { - this.itemCount = itemCount; - } - - public ExternalPropertyFileReference withItemCount(int itemCount) { - this.itemCount = itemCount; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ExternalPropertyFileReference withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ExternalPropertyFileReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("itemCount"); - sb.append('='); - sb.append(this.itemCount); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + this.itemCount); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ExternalPropertyFileReference) == false) { - return false; - } - ExternalPropertyFileReference rhs = ((ExternalPropertyFileReference) other); - return (((((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid))) && ((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && (this.itemCount == rhs.itemCount)); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReferences.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReferences.java deleted file mode 100644 index e8ecfe1667..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ExternalPropertyFileReferences.java +++ /dev/null @@ -1,605 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * References to external property files that should be inlined with the content of a root log file. - */ -@Generated("jsonschema2pojo") -public class ExternalPropertyFileReferences { - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - @SerializedName("conversion") - @Expose - private ExternalPropertyFileReference conversion; - /** - * An array of external property files containing a run.graphs object to be merged with the root log file. - */ - @SerializedName("graphs") - @Expose - private Set graphs = new LinkedHashSet(); - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - @SerializedName("externalizedProperties") - @Expose - private ExternalPropertyFileReference externalizedProperties; - /** - * An array of external property files containing run.artifacts arrays to be merged with the root log file. - */ - @SerializedName("artifacts") - @Expose - private Set artifacts = new LinkedHashSet(); - /** - * An array of external property files containing run.invocations arrays to be merged with the root log file. - */ - @SerializedName("invocations") - @Expose - private Set invocations = new LinkedHashSet(); - /** - * An array of external property files containing run.logicalLocations arrays to be merged with the root log file. - */ - @SerializedName("logicalLocations") - @Expose - private Set logicalLocations = new LinkedHashSet(); - /** - * An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. - */ - @SerializedName("threadFlowLocations") - @Expose - private Set threadFlowLocations = new LinkedHashSet(); - /** - * An array of external property files containing run.results arrays to be merged with the root log file. - */ - @SerializedName("results") - @Expose - private Set results = new LinkedHashSet(); - /** - * An array of external property files containing run.taxonomies arrays to be merged with the root log file. - */ - @SerializedName("taxonomies") - @Expose - private Set taxonomies = new LinkedHashSet(); - /** - * An array of external property files containing run.addresses arrays to be merged with the root log file. - */ - @SerializedName("addresses") - @Expose - private Set addresses = new LinkedHashSet(); - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - @SerializedName("driver") - @Expose - private ExternalPropertyFileReference driver; - /** - * An array of external property files containing run.extensions arrays to be merged with the root log file. - */ - @SerializedName("extensions") - @Expose - private Set extensions = new LinkedHashSet(); - /** - * An array of external property files containing run.policies arrays to be merged with the root log file. - */ - @SerializedName("policies") - @Expose - private Set policies = new LinkedHashSet(); - /** - * An array of external property files containing run.translations arrays to be merged with the root log file. - */ - @SerializedName("translations") - @Expose - private Set translations = new LinkedHashSet(); - /** - * An array of external property files containing run.requests arrays to be merged with the root log file. - */ - @SerializedName("webRequests") - @Expose - private Set webRequests = new LinkedHashSet(); - /** - * An array of external property files containing run.responses arrays to be merged with the root log file. - */ - @SerializedName("webResponses") - @Expose - private Set webResponses = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ExternalPropertyFileReferences() { - } - - /** - * @param addresses - * @param logicalLocations - * @param policies - * @param externalizedProperties - * @param invocations - * @param graphs - * @param extensions - * @param driver - * @param taxonomies - * @param translations - * @param webResponses - * @param webRequests - * @param results - * @param threadFlowLocations - * @param properties - * @param conversion - * @param artifacts - */ - public ExternalPropertyFileReferences(ExternalPropertyFileReference conversion, Set graphs, ExternalPropertyFileReference externalizedProperties, Set artifacts, Set invocations, Set logicalLocations, Set threadFlowLocations, Set results, Set taxonomies, Set addresses, ExternalPropertyFileReference driver, Set extensions, Set policies, Set translations, Set webRequests, Set webResponses, PropertyBag properties) { - super(); - this.conversion = conversion; - this.graphs = graphs; - this.externalizedProperties = externalizedProperties; - this.artifacts = artifacts; - this.invocations = invocations; - this.logicalLocations = logicalLocations; - this.threadFlowLocations = threadFlowLocations; - this.results = results; - this.taxonomies = taxonomies; - this.addresses = addresses; - this.driver = driver; - this.extensions = extensions; - this.policies = policies; - this.translations = translations; - this.webRequests = webRequests; - this.webResponses = webResponses; - this.properties = properties; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public ExternalPropertyFileReference getConversion() { - return conversion; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public void setConversion(ExternalPropertyFileReference conversion) { - this.conversion = conversion; - } - - public ExternalPropertyFileReferences withConversion(ExternalPropertyFileReference conversion) { - this.conversion = conversion; - return this; - } - - /** - * An array of external property files containing a run.graphs object to be merged with the root log file. - */ - public Set getGraphs() { - return graphs; - } - - /** - * An array of external property files containing a run.graphs object to be merged with the root log file. - */ - public void setGraphs(Set graphs) { - this.graphs = graphs; - } - - public ExternalPropertyFileReferences withGraphs(Set graphs) { - this.graphs = graphs; - return this; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public ExternalPropertyFileReference getExternalizedProperties() { - return externalizedProperties; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public void setExternalizedProperties(ExternalPropertyFileReference externalizedProperties) { - this.externalizedProperties = externalizedProperties; - } - - public ExternalPropertyFileReferences withExternalizedProperties(ExternalPropertyFileReference externalizedProperties) { - this.externalizedProperties = externalizedProperties; - return this; - } - - /** - * An array of external property files containing run.artifacts arrays to be merged with the root log file. - */ - public Set getArtifacts() { - return artifacts; - } - - /** - * An array of external property files containing run.artifacts arrays to be merged with the root log file. - */ - public void setArtifacts(Set artifacts) { - this.artifacts = artifacts; - } - - public ExternalPropertyFileReferences withArtifacts(Set artifacts) { - this.artifacts = artifacts; - return this; - } - - /** - * An array of external property files containing run.invocations arrays to be merged with the root log file. - */ - public Set getInvocations() { - return invocations; - } - - /** - * An array of external property files containing run.invocations arrays to be merged with the root log file. - */ - public void setInvocations(Set invocations) { - this.invocations = invocations; - } - - public ExternalPropertyFileReferences withInvocations(Set invocations) { - this.invocations = invocations; - return this; - } - - /** - * An array of external property files containing run.logicalLocations arrays to be merged with the root log file. - */ - public Set getLogicalLocations() { - return logicalLocations; - } - - /** - * An array of external property files containing run.logicalLocations arrays to be merged with the root log file. - */ - public void setLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - } - - public ExternalPropertyFileReferences withLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - return this; - } - - /** - * An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. - */ - public Set getThreadFlowLocations() { - return threadFlowLocations; - } - - /** - * An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. - */ - public void setThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - } - - public ExternalPropertyFileReferences withThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - return this; - } - - /** - * An array of external property files containing run.results arrays to be merged with the root log file. - */ - public Set getResults() { - return results; - } - - /** - * An array of external property files containing run.results arrays to be merged with the root log file. - */ - public void setResults(Set results) { - this.results = results; - } - - public ExternalPropertyFileReferences withResults(Set results) { - this.results = results; - return this; - } - - /** - * An array of external property files containing run.taxonomies arrays to be merged with the root log file. - */ - public Set getTaxonomies() { - return taxonomies; - } - - /** - * An array of external property files containing run.taxonomies arrays to be merged with the root log file. - */ - public void setTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - } - - public ExternalPropertyFileReferences withTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - return this; - } - - /** - * An array of external property files containing run.addresses arrays to be merged with the root log file. - */ - public Set getAddresses() { - return addresses; - } - - /** - * An array of external property files containing run.addresses arrays to be merged with the root log file. - */ - public void setAddresses(Set addresses) { - this.addresses = addresses; - } - - public ExternalPropertyFileReferences withAddresses(Set addresses) { - this.addresses = addresses; - return this; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public ExternalPropertyFileReference getDriver() { - return driver; - } - - /** - * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. - */ - public void setDriver(ExternalPropertyFileReference driver) { - this.driver = driver; - } - - public ExternalPropertyFileReferences withDriver(ExternalPropertyFileReference driver) { - this.driver = driver; - return this; - } - - /** - * An array of external property files containing run.extensions arrays to be merged with the root log file. - */ - public Set getExtensions() { - return extensions; - } - - /** - * An array of external property files containing run.extensions arrays to be merged with the root log file. - */ - public void setExtensions(Set extensions) { - this.extensions = extensions; - } - - public ExternalPropertyFileReferences withExtensions(Set extensions) { - this.extensions = extensions; - return this; - } - - /** - * An array of external property files containing run.policies arrays to be merged with the root log file. - */ - public Set getPolicies() { - return policies; - } - - /** - * An array of external property files containing run.policies arrays to be merged with the root log file. - */ - public void setPolicies(Set policies) { - this.policies = policies; - } - - public ExternalPropertyFileReferences withPolicies(Set policies) { - this.policies = policies; - return this; - } - - /** - * An array of external property files containing run.translations arrays to be merged with the root log file. - */ - public Set getTranslations() { - return translations; - } - - /** - * An array of external property files containing run.translations arrays to be merged with the root log file. - */ - public void setTranslations(Set translations) { - this.translations = translations; - } - - public ExternalPropertyFileReferences withTranslations(Set translations) { - this.translations = translations; - return this; - } - - /** - * An array of external property files containing run.requests arrays to be merged with the root log file. - */ - public Set getWebRequests() { - return webRequests; - } - - /** - * An array of external property files containing run.requests arrays to be merged with the root log file. - */ - public void setWebRequests(Set webRequests) { - this.webRequests = webRequests; - } - - public ExternalPropertyFileReferences withWebRequests(Set webRequests) { - this.webRequests = webRequests; - return this; - } - - /** - * An array of external property files containing run.responses arrays to be merged with the root log file. - */ - public Set getWebResponses() { - return webResponses; - } - - /** - * An array of external property files containing run.responses arrays to be merged with the root log file. - */ - public void setWebResponses(Set webResponses) { - this.webResponses = webResponses; - } - - public ExternalPropertyFileReferences withWebResponses(Set webResponses) { - this.webResponses = webResponses; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ExternalPropertyFileReferences withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ExternalPropertyFileReferences.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("conversion"); - sb.append('='); - sb.append(((this.conversion == null) ? "" : this.conversion)); - sb.append(','); - sb.append("graphs"); - sb.append('='); - sb.append(((this.graphs == null) ? "" : this.graphs)); - sb.append(','); - sb.append("externalizedProperties"); - sb.append('='); - sb.append(((this.externalizedProperties == null) ? "" : this.externalizedProperties)); - sb.append(','); - sb.append("artifacts"); - sb.append('='); - sb.append(((this.artifacts == null) ? "" : this.artifacts)); - sb.append(','); - sb.append("invocations"); - sb.append('='); - sb.append(((this.invocations == null) ? "" : this.invocations)); - sb.append(','); - sb.append("logicalLocations"); - sb.append('='); - sb.append(((this.logicalLocations == null) ? "" : this.logicalLocations)); - sb.append(','); - sb.append("threadFlowLocations"); - sb.append('='); - sb.append(((this.threadFlowLocations == null) ? "" : this.threadFlowLocations)); - sb.append(','); - sb.append("results"); - sb.append('='); - sb.append(((this.results == null) ? "" : this.results)); - sb.append(','); - sb.append("taxonomies"); - sb.append('='); - sb.append(((this.taxonomies == null) ? "" : this.taxonomies)); - sb.append(','); - sb.append("addresses"); - sb.append('='); - sb.append(((this.addresses == null) ? "" : this.addresses)); - sb.append(','); - sb.append("driver"); - sb.append('='); - sb.append(((this.driver == null) ? "" : this.driver)); - sb.append(','); - sb.append("extensions"); - sb.append('='); - sb.append(((this.extensions == null) ? "" : this.extensions)); - sb.append(','); - sb.append("policies"); - sb.append('='); - sb.append(((this.policies == null) ? "" : this.policies)); - sb.append(','); - sb.append("translations"); - sb.append('='); - sb.append(((this.translations == null) ? "" : this.translations)); - sb.append(','); - sb.append("webRequests"); - sb.append('='); - sb.append(((this.webRequests == null) ? "" : this.webRequests)); - sb.append(','); - sb.append("webResponses"); - sb.append('='); - sb.append(((this.webResponses == null) ? "" : this.webResponses)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.addresses == null) ? 0 : this.addresses.hashCode())); - result = ((result * 31) + ((this.logicalLocations == null) ? 0 : this.logicalLocations.hashCode())); - result = ((result * 31) + ((this.policies == null) ? 0 : this.policies.hashCode())); - result = ((result * 31) + ((this.externalizedProperties == null) ? 0 : this.externalizedProperties.hashCode())); - result = ((result * 31) + ((this.invocations == null) ? 0 : this.invocations.hashCode())); - result = ((result * 31) + ((this.graphs == null) ? 0 : this.graphs.hashCode())); - result = ((result * 31) + ((this.extensions == null) ? 0 : this.extensions.hashCode())); - result = ((result * 31) + ((this.driver == null) ? 0 : this.driver.hashCode())); - result = ((result * 31) + ((this.taxonomies == null) ? 0 : this.taxonomies.hashCode())); - result = ((result * 31) + ((this.translations == null) ? 0 : this.translations.hashCode())); - result = ((result * 31) + ((this.webResponses == null) ? 0 : this.webResponses.hashCode())); - result = ((result * 31) + ((this.webRequests == null) ? 0 : this.webRequests.hashCode())); - result = ((result * 31) + ((this.results == null) ? 0 : this.results.hashCode())); - result = ((result * 31) + ((this.threadFlowLocations == null) ? 0 : this.threadFlowLocations.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.conversion == null) ? 0 : this.conversion.hashCode())); - result = ((result * 31) + ((this.artifacts == null) ? 0 : this.artifacts.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ExternalPropertyFileReferences) == false) { - return false; - } - ExternalPropertyFileReferences rhs = ((ExternalPropertyFileReferences) other); - return ((((((((((((((((((this.addresses == rhs.addresses) || ((this.addresses != null) && this.addresses.equals(rhs.addresses))) && ((this.logicalLocations == rhs.logicalLocations) || ((this.logicalLocations != null) && this.logicalLocations.equals(rhs.logicalLocations)))) && ((this.policies == rhs.policies) || ((this.policies != null) && this.policies.equals(rhs.policies)))) && ((this.externalizedProperties == rhs.externalizedProperties) || ((this.externalizedProperties != null) && this.externalizedProperties.equals(rhs.externalizedProperties)))) && ((this.invocations == rhs.invocations) || ((this.invocations != null) && this.invocations.equals(rhs.invocations)))) && ((this.graphs == rhs.graphs) || ((this.graphs != null) && this.graphs.equals(rhs.graphs)))) && ((this.extensions == rhs.extensions) || ((this.extensions != null) && this.extensions.equals(rhs.extensions)))) && ((this.driver == rhs.driver) || ((this.driver != null) && this.driver.equals(rhs.driver)))) && ((this.taxonomies == rhs.taxonomies) || ((this.taxonomies != null) && this.taxonomies.equals(rhs.taxonomies)))) && ((this.translations == rhs.translations) || ((this.translations != null) && this.translations.equals(rhs.translations)))) && ((this.webResponses == rhs.webResponses) || ((this.webResponses != null) && this.webResponses.equals(rhs.webResponses)))) && ((this.webRequests == rhs.webRequests) || ((this.webRequests != null) && this.webRequests.equals(rhs.webRequests)))) && ((this.results == rhs.results) || ((this.results != null) && this.results.equals(rhs.results)))) && ((this.threadFlowLocations == rhs.threadFlowLocations) || ((this.threadFlowLocations != null) && this.threadFlowLocations.equals(rhs.threadFlowLocations)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.conversion == rhs.conversion) || ((this.conversion != null) && this.conversion.equals(rhs.conversion)))) && ((this.artifacts == rhs.artifacts) || ((this.artifacts != null) && this.artifacts.equals(rhs.artifacts)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/FinalState.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/FinalState.java deleted file mode 100644 index ad12c3753a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/FinalState.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The values of relevant expressions after the edge has been traversed. - */ -@Generated("jsonschema2pojo") -public class FinalState { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(FinalState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof FinalState) == false) { - return false; - } - FinalState rhs = ((FinalState) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fingerprints.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fingerprints.java deleted file mode 100644 index 79cf8e7193..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fingerprints.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A set of strings each of which individually defines a stable, unique identity for the result. - */ -@Generated("jsonschema2pojo") -public class Fingerprints { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Fingerprints.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Fingerprints) == false) { - return false; - } - Fingerprints rhs = ((Fingerprints) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fix.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fix.java deleted file mode 100644 index 57b23c286b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Fix.java +++ /dev/null @@ -1,160 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them. - */ -@Generated("jsonschema2pojo") -public class Fix { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * One or more artifact changes that comprise a fix for a result. - * (Required) - */ - @SerializedName("artifactChanges") - @Expose - private Set artifactChanges = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Fix() { - } - - /** - * @param artifactChanges - * @param description - * @param properties - */ - public Fix(Message description, Set artifactChanges, PropertyBag properties) { - super(); - this.description = description; - this.artifactChanges = artifactChanges; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public Fix withDescription(Message description) { - this.description = description; - return this; - } - - /** - * One or more artifact changes that comprise a fix for a result. - * (Required) - */ - public Set getArtifactChanges() { - return artifactChanges; - } - - /** - * One or more artifact changes that comprise a fix for a result. - * (Required) - */ - public void setArtifactChanges(Set artifactChanges) { - this.artifactChanges = artifactChanges; - } - - public Fix withArtifactChanges(Set artifactChanges) { - this.artifactChanges = artifactChanges; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Fix withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Fix.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("artifactChanges"); - sb.append('='); - sb.append(((this.artifactChanges == null) ? "" : this.artifactChanges)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.artifactChanges == null) ? 0 : this.artifactChanges.hashCode())); - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Fix) == false) { - return false; - } - Fix rhs = ((Fix) other); - return ((((this.artifactChanges == rhs.artifactChanges) || ((this.artifactChanges != null) && this.artifactChanges.equals(rhs.artifactChanges))) && ((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GlobalMessageStrings.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GlobalMessageStrings.java deleted file mode 100644 index cf4b7b4fce..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GlobalMessageStrings.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ -@Generated("jsonschema2pojo") -public class GlobalMessageStrings { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(GlobalMessageStrings.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof GlobalMessageStrings) == false) { - return false; - } - GlobalMessageStrings rhs = ((GlobalMessageStrings) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Graph.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Graph.java deleted file mode 100644 index ebfa0ec60c..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Graph.java +++ /dev/null @@ -1,189 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph). - */ -@Generated("jsonschema2pojo") -public class Graph { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * An array of node objects representing the nodes of the graph. - */ - @SerializedName("nodes") - @Expose - private Set nodes = new LinkedHashSet(); - /** - * An array of edge objects representing the edges of the graph. - */ - @SerializedName("edges") - @Expose - private Set edges = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Graph() { - } - - /** - * @param nodes - * @param edges - * @param description - * @param properties - */ - public Graph(Message description, Set nodes, Set edges, PropertyBag properties) { - super(); - this.description = description; - this.nodes = nodes; - this.edges = edges; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public Graph withDescription(Message description) { - this.description = description; - return this; - } - - /** - * An array of node objects representing the nodes of the graph. - */ - public Set getNodes() { - return nodes; - } - - /** - * An array of node objects representing the nodes of the graph. - */ - public void setNodes(Set nodes) { - this.nodes = nodes; - } - - public Graph withNodes(Set nodes) { - this.nodes = nodes; - return this; - } - - /** - * An array of edge objects representing the edges of the graph. - */ - public Set getEdges() { - return edges; - } - - /** - * An array of edge objects representing the edges of the graph. - */ - public void setEdges(Set edges) { - this.edges = edges; - } - - public Graph withEdges(Set edges) { - this.edges = edges; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Graph withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Graph.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("nodes"); - sb.append('='); - sb.append(((this.nodes == null) ? "" : this.nodes)); - sb.append(','); - sb.append("edges"); - sb.append('='); - sb.append(((this.edges == null) ? "" : this.edges)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.edges == null) ? 0 : this.edges.hashCode())); - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.nodes == null) ? 0 : this.nodes.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Graph) == false) { - return false; - } - Graph rhs = ((Graph) other); - return (((((this.edges == rhs.edges) || ((this.edges != null) && this.edges.equals(rhs.edges))) && ((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description)))) && ((this.nodes == rhs.nodes) || ((this.nodes != null) && this.nodes.equals(rhs.nodes)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GraphTraversal.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GraphTraversal.java deleted file mode 100644 index b8616e41f2..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/GraphTraversal.java +++ /dev/null @@ -1,285 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Represents a path through a graph. - */ -@Generated("jsonschema2pojo") -public class GraphTraversal { - - /** - * The index within the run.graphs to be associated with the result. - */ - @SerializedName("runGraphIndex") - @Expose - private int runGraphIndex = -1; - /** - * The index within the result.graphs to be associated with the result. - */ - @SerializedName("resultGraphIndex") - @Expose - private int resultGraphIndex = -1; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - */ - @SerializedName("initialState") - @Expose - private InitialState__1 initialState; - /** - * Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - */ - @SerializedName("immutableState") - @Expose - private ImmutableState__1 immutableState; - /** - * The sequences of edges traversed by this graph traversal. - */ - @SerializedName("edgeTraversals") - @Expose - private List edgeTraversals = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public GraphTraversal() { - } - - /** - * @param initialState - * @param description - * @param immutableState - * @param runGraphIndex - * @param resultGraphIndex - * @param edgeTraversals - * @param properties - */ - public GraphTraversal(int runGraphIndex, int resultGraphIndex, Message description, InitialState__1 initialState, ImmutableState__1 immutableState, List edgeTraversals, PropertyBag properties) { - super(); - this.runGraphIndex = runGraphIndex; - this.resultGraphIndex = resultGraphIndex; - this.description = description; - this.initialState = initialState; - this.immutableState = immutableState; - this.edgeTraversals = edgeTraversals; - this.properties = properties; - } - - /** - * The index within the run.graphs to be associated with the result. - */ - public int getRunGraphIndex() { - return runGraphIndex; - } - - /** - * The index within the run.graphs to be associated with the result. - */ - public void setRunGraphIndex(int runGraphIndex) { - this.runGraphIndex = runGraphIndex; - } - - public GraphTraversal withRunGraphIndex(int runGraphIndex) { - this.runGraphIndex = runGraphIndex; - return this; - } - - /** - * The index within the result.graphs to be associated with the result. - */ - public int getResultGraphIndex() { - return resultGraphIndex; - } - - /** - * The index within the result.graphs to be associated with the result. - */ - public void setResultGraphIndex(int resultGraphIndex) { - this.resultGraphIndex = resultGraphIndex; - } - - public GraphTraversal withResultGraphIndex(int resultGraphIndex) { - this.resultGraphIndex = resultGraphIndex; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public GraphTraversal withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - */ - public InitialState__1 getInitialState() { - return initialState; - } - - /** - * Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - */ - public void setInitialState(InitialState__1 initialState) { - this.initialState = initialState; - } - - public GraphTraversal withInitialState(InitialState__1 initialState) { - this.initialState = initialState; - return this; - } - - /** - * Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - */ - public ImmutableState__1 getImmutableState() { - return immutableState; - } - - /** - * Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - */ - public void setImmutableState(ImmutableState__1 immutableState) { - this.immutableState = immutableState; - } - - public GraphTraversal withImmutableState(ImmutableState__1 immutableState) { - this.immutableState = immutableState; - return this; - } - - /** - * The sequences of edges traversed by this graph traversal. - */ - public List getEdgeTraversals() { - return edgeTraversals; - } - - /** - * The sequences of edges traversed by this graph traversal. - */ - public void setEdgeTraversals(List edgeTraversals) { - this.edgeTraversals = edgeTraversals; - } - - public GraphTraversal withEdgeTraversals(List edgeTraversals) { - this.edgeTraversals = edgeTraversals; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public GraphTraversal withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(GraphTraversal.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("runGraphIndex"); - sb.append('='); - sb.append(this.runGraphIndex); - sb.append(','); - sb.append("resultGraphIndex"); - sb.append('='); - sb.append(this.resultGraphIndex); - sb.append(','); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("initialState"); - sb.append('='); - sb.append(((this.initialState == null) ? "" : this.initialState)); - sb.append(','); - sb.append("immutableState"); - sb.append('='); - sb.append(((this.immutableState == null) ? "" : this.immutableState)); - sb.append(','); - sb.append("edgeTraversals"); - sb.append('='); - sb.append(((this.edgeTraversals == null) ? "" : this.edgeTraversals)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.initialState == null) ? 0 : this.initialState.hashCode())); - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.immutableState == null) ? 0 : this.immutableState.hashCode())); - result = ((result * 31) + this.runGraphIndex); - result = ((result * 31) + this.resultGraphIndex); - result = ((result * 31) + ((this.edgeTraversals == null) ? 0 : this.edgeTraversals.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof GraphTraversal) == false) { - return false; - } - GraphTraversal rhs = ((GraphTraversal) other); - return ((((((((this.initialState == rhs.initialState) || ((this.initialState != null) && this.initialState.equals(rhs.initialState))) && ((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description)))) && ((this.immutableState == rhs.immutableState) || ((this.immutableState != null) && this.immutableState.equals(rhs.immutableState)))) && (this.runGraphIndex == rhs.runGraphIndex)) && (this.resultGraphIndex == rhs.resultGraphIndex)) && ((this.edgeTraversals == rhs.edgeTraversals) || ((this.edgeTraversals != null) && this.edgeTraversals.equals(rhs.edgeTraversals)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Hashes.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Hashes.java deleted file mode 100644 index 82a1a9f15e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Hashes.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function. - */ -@Generated("jsonschema2pojo") -public class Hashes { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Hashes.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Hashes) == false) { - return false; - } - Hashes rhs = ((Hashes) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers.java deleted file mode 100644 index b049dbde5c..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The request headers. - */ -@Generated("jsonschema2pojo") -public class Headers { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Headers.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Headers) == false) { - return false; - } - Headers rhs = ((Headers) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers__1.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers__1.java deleted file mode 100644 index 846efc0932..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Headers__1.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The response headers. - */ -@Generated("jsonschema2pojo") -public class Headers__1 { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Headers__1.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Headers__1) == false) { - return false; - } - Headers__1 rhs = ((Headers__1) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState.java deleted file mode 100644 index c6034752c7..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * Values of relevant expressions at the start of the thread flow that remain constant. - */ -@Generated("jsonschema2pojo") -public class ImmutableState { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ImmutableState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ImmutableState) == false) { - return false; - } - ImmutableState rhs = ((ImmutableState) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState__1.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState__1.java deleted file mode 100644 index 5632abb392..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ImmutableState__1.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - */ -@Generated("jsonschema2pojo") -public class ImmutableState__1 { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ImmutableState__1.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ImmutableState__1) == false) { - return false; - } - ImmutableState__1 rhs = ((ImmutableState__1) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState.java deleted file mode 100644 index 7efee8a81b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - */ -@Generated("jsonschema2pojo") -public class InitialState { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(InitialState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof InitialState) == false) { - return false; - } - InitialState rhs = ((InitialState) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState__1.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState__1.java deleted file mode 100644 index c2f4ecbe7f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/InitialState__1.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - */ -@Generated("jsonschema2pojo") -public class InitialState__1 { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(InitialState__1.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof InitialState__1) == false) { - return false; - } - InitialState__1 rhs = ((InitialState__1) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Invocation.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Invocation.java deleted file mode 100644 index f28879e1b3..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Invocation.java +++ /dev/null @@ -1,899 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * The runtime environment of the analysis tool run. - */ -@Generated("jsonschema2pojo") -public class Invocation { - - /** - * The command line used to invoke the tool. - */ - @SerializedName("commandLine") - @Expose - private String commandLine; - /** - * An array of strings, containing in order the command line arguments passed to the tool from the operating system. - */ - @SerializedName("arguments") - @Expose - private List arguments = new ArrayList(); - /** - * The locations of any response files specified on the tool's command line. - */ - @SerializedName("responseFiles") - @Expose - private Set responseFiles = new LinkedHashSet(); - /** - * The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format. - */ - @SerializedName("startTimeUtc") - @Expose - private Date startTimeUtc; - /** - * The Coordinated Universal Time (UTC) date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format. - */ - @SerializedName("endTimeUtc") - @Expose - private Date endTimeUtc; - /** - * The process exit code. - */ - @SerializedName("exitCode") - @Expose - private int exitCode; - /** - * An array of configurationOverride objects that describe rules related runtime overrides. - */ - @SerializedName("ruleConfigurationOverrides") - @Expose - private Set ruleConfigurationOverrides = new LinkedHashSet(); - /** - * An array of configurationOverride objects that describe notifications related runtime overrides. - */ - @SerializedName("notificationConfigurationOverrides") - @Expose - private Set notificationConfigurationOverrides = new LinkedHashSet(); - /** - * A list of runtime conditions detected by the tool during the analysis. - */ - @SerializedName("toolExecutionNotifications") - @Expose - private List toolExecutionNotifications = new ArrayList(); - /** - * A list of conditions detected by the tool that are relevant to the tool's configuration. - */ - @SerializedName("toolConfigurationNotifications") - @Expose - private List toolConfigurationNotifications = new ArrayList(); - /** - * The reason for the process exit. - */ - @SerializedName("exitCodeDescription") - @Expose - private String exitCodeDescription; - /** - * The name of the signal that caused the process to exit. - */ - @SerializedName("exitSignalName") - @Expose - private String exitSignalName; - /** - * The numeric value of the signal that caused the process to exit. - */ - @SerializedName("exitSignalNumber") - @Expose - private int exitSignalNumber; - /** - * The reason given by the operating system that the process failed to start. - */ - @SerializedName("processStartFailureMessage") - @Expose - private String processStartFailureMessage; - /** - * Specifies whether the tool's execution completed successfully. - * (Required) - */ - @SerializedName("executionSuccessful") - @Expose - private boolean executionSuccessful; - /** - * The machine that hosted the analysis tool run. - */ - @SerializedName("machine") - @Expose - private String machine; - /** - * The account that ran the analysis tool. - */ - @SerializedName("account") - @Expose - private String account; - /** - * The process id for the analysis tool run. - */ - @SerializedName("processId") - @Expose - private int processId; - /** - * Specifies the location of an artifact. - */ - @SerializedName("executableLocation") - @Expose - private ArtifactLocation executableLocation; - /** - * Specifies the location of an artifact. - */ - @SerializedName("workingDirectory") - @Expose - private ArtifactLocation workingDirectory; - /** - * The environment variables associated with the analysis tool process, expressed as key/value pairs. - */ - @SerializedName("environmentVariables") - @Expose - private EnvironmentVariables environmentVariables; - /** - * Specifies the location of an artifact. - */ - @SerializedName("stdin") - @Expose - private ArtifactLocation stdin; - /** - * Specifies the location of an artifact. - */ - @SerializedName("stdout") - @Expose - private ArtifactLocation stdout; - /** - * Specifies the location of an artifact. - */ - @SerializedName("stderr") - @Expose - private ArtifactLocation stderr; - /** - * Specifies the location of an artifact. - */ - @SerializedName("stdoutStderr") - @Expose - private ArtifactLocation stdoutStderr; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Invocation() { - } - - /** - * @param endTimeUtc - * @param stdin - * @param stdout - * @param workingDirectory - * @param exitSignalNumber - * @param exitCodeDescription - * @param executableLocation - * @param processId - * @param exitCode - * @param toolConfigurationNotifications - * @param notificationConfigurationOverrides - * @param processStartFailureMessage - * @param stderr - * @param ruleConfigurationOverrides - * @param toolExecutionNotifications - * @param machine - * @param environmentVariables - * @param stdoutStderr - * @param arguments - * @param responseFiles - * @param commandLine - * @param executionSuccessful - * @param startTimeUtc - * @param account - * @param properties - * @param exitSignalName - */ - public Invocation(String commandLine, List arguments, Set responseFiles, Date startTimeUtc, Date endTimeUtc, int exitCode, Set ruleConfigurationOverrides, Set notificationConfigurationOverrides, List toolExecutionNotifications, List toolConfigurationNotifications, String exitCodeDescription, String exitSignalName, int exitSignalNumber, String processStartFailureMessage, boolean executionSuccessful, String machine, String account, int processId, ArtifactLocation executableLocation, ArtifactLocation workingDirectory, EnvironmentVariables environmentVariables, ArtifactLocation stdin, ArtifactLocation stdout, ArtifactLocation stderr, ArtifactLocation stdoutStderr, PropertyBag properties) { - super(); - this.commandLine = commandLine; - this.arguments = arguments; - this.responseFiles = responseFiles; - this.startTimeUtc = startTimeUtc; - this.endTimeUtc = endTimeUtc; - this.exitCode = exitCode; - this.ruleConfigurationOverrides = ruleConfigurationOverrides; - this.notificationConfigurationOverrides = notificationConfigurationOverrides; - this.toolExecutionNotifications = toolExecutionNotifications; - this.toolConfigurationNotifications = toolConfigurationNotifications; - this.exitCodeDescription = exitCodeDescription; - this.exitSignalName = exitSignalName; - this.exitSignalNumber = exitSignalNumber; - this.processStartFailureMessage = processStartFailureMessage; - this.executionSuccessful = executionSuccessful; - this.machine = machine; - this.account = account; - this.processId = processId; - this.executableLocation = executableLocation; - this.workingDirectory = workingDirectory; - this.environmentVariables = environmentVariables; - this.stdin = stdin; - this.stdout = stdout; - this.stderr = stderr; - this.stdoutStderr = stdoutStderr; - this.properties = properties; - } - - /** - * The command line used to invoke the tool. - */ - public String getCommandLine() { - return commandLine; - } - - /** - * The command line used to invoke the tool. - */ - public void setCommandLine(String commandLine) { - this.commandLine = commandLine; - } - - public Invocation withCommandLine(String commandLine) { - this.commandLine = commandLine; - return this; - } - - /** - * An array of strings, containing in order the command line arguments passed to the tool from the operating system. - */ - public List getArguments() { - return arguments; - } - - /** - * An array of strings, containing in order the command line arguments passed to the tool from the operating system. - */ - public void setArguments(List arguments) { - this.arguments = arguments; - } - - public Invocation withArguments(List arguments) { - this.arguments = arguments; - return this; - } - - /** - * The locations of any response files specified on the tool's command line. - */ - public Set getResponseFiles() { - return responseFiles; - } - - /** - * The locations of any response files specified on the tool's command line. - */ - public void setResponseFiles(Set responseFiles) { - this.responseFiles = responseFiles; - } - - public Invocation withResponseFiles(Set responseFiles) { - this.responseFiles = responseFiles; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format. - */ - public Date getStartTimeUtc() { - return startTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the run started. See "Date/time properties" in the SARIF spec for the required format. - */ - public void setStartTimeUtc(Date startTimeUtc) { - this.startTimeUtc = startTimeUtc; - } - - public Invocation withStartTimeUtc(Date startTimeUtc) { - this.startTimeUtc = startTimeUtc; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format. - */ - public Date getEndTimeUtc() { - return endTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the run ended. See "Date/time properties" in the SARIF spec for the required format. - */ - public void setEndTimeUtc(Date endTimeUtc) { - this.endTimeUtc = endTimeUtc; - } - - public Invocation withEndTimeUtc(Date endTimeUtc) { - this.endTimeUtc = endTimeUtc; - return this; - } - - /** - * The process exit code. - */ - public int getExitCode() { - return exitCode; - } - - /** - * The process exit code. - */ - public void setExitCode(int exitCode) { - this.exitCode = exitCode; - } - - public Invocation withExitCode(int exitCode) { - this.exitCode = exitCode; - return this; - } - - /** - * An array of configurationOverride objects that describe rules related runtime overrides. - */ - public Set getRuleConfigurationOverrides() { - return ruleConfigurationOverrides; - } - - /** - * An array of configurationOverride objects that describe rules related runtime overrides. - */ - public void setRuleConfigurationOverrides(Set ruleConfigurationOverrides) { - this.ruleConfigurationOverrides = ruleConfigurationOverrides; - } - - public Invocation withRuleConfigurationOverrides(Set ruleConfigurationOverrides) { - this.ruleConfigurationOverrides = ruleConfigurationOverrides; - return this; - } - - /** - * An array of configurationOverride objects that describe notifications related runtime overrides. - */ - public Set getNotificationConfigurationOverrides() { - return notificationConfigurationOverrides; - } - - /** - * An array of configurationOverride objects that describe notifications related runtime overrides. - */ - public void setNotificationConfigurationOverrides(Set notificationConfigurationOverrides) { - this.notificationConfigurationOverrides = notificationConfigurationOverrides; - } - - public Invocation withNotificationConfigurationOverrides(Set notificationConfigurationOverrides) { - this.notificationConfigurationOverrides = notificationConfigurationOverrides; - return this; - } - - /** - * A list of runtime conditions detected by the tool during the analysis. - */ - public List getToolExecutionNotifications() { - return toolExecutionNotifications; - } - - /** - * A list of runtime conditions detected by the tool during the analysis. - */ - public void setToolExecutionNotifications(List toolExecutionNotifications) { - this.toolExecutionNotifications = toolExecutionNotifications; - } - - public Invocation withToolExecutionNotifications(List toolExecutionNotifications) { - this.toolExecutionNotifications = toolExecutionNotifications; - return this; - } - - /** - * A list of conditions detected by the tool that are relevant to the tool's configuration. - */ - public List getToolConfigurationNotifications() { - return toolConfigurationNotifications; - } - - /** - * A list of conditions detected by the tool that are relevant to the tool's configuration. - */ - public void setToolConfigurationNotifications(List toolConfigurationNotifications) { - this.toolConfigurationNotifications = toolConfigurationNotifications; - } - - public Invocation withToolConfigurationNotifications(List toolConfigurationNotifications) { - this.toolConfigurationNotifications = toolConfigurationNotifications; - return this; - } - - /** - * The reason for the process exit. - */ - public String getExitCodeDescription() { - return exitCodeDescription; - } - - /** - * The reason for the process exit. - */ - public void setExitCodeDescription(String exitCodeDescription) { - this.exitCodeDescription = exitCodeDescription; - } - - public Invocation withExitCodeDescription(String exitCodeDescription) { - this.exitCodeDescription = exitCodeDescription; - return this; - } - - /** - * The name of the signal that caused the process to exit. - */ - public String getExitSignalName() { - return exitSignalName; - } - - /** - * The name of the signal that caused the process to exit. - */ - public void setExitSignalName(String exitSignalName) { - this.exitSignalName = exitSignalName; - } - - public Invocation withExitSignalName(String exitSignalName) { - this.exitSignalName = exitSignalName; - return this; - } - - /** - * The numeric value of the signal that caused the process to exit. - */ - public int getExitSignalNumber() { - return exitSignalNumber; - } - - /** - * The numeric value of the signal that caused the process to exit. - */ - public void setExitSignalNumber(int exitSignalNumber) { - this.exitSignalNumber = exitSignalNumber; - } - - public Invocation withExitSignalNumber(int exitSignalNumber) { - this.exitSignalNumber = exitSignalNumber; - return this; - } - - /** - * The reason given by the operating system that the process failed to start. - */ - public String getProcessStartFailureMessage() { - return processStartFailureMessage; - } - - /** - * The reason given by the operating system that the process failed to start. - */ - public void setProcessStartFailureMessage(String processStartFailureMessage) { - this.processStartFailureMessage = processStartFailureMessage; - } - - public Invocation withProcessStartFailureMessage(String processStartFailureMessage) { - this.processStartFailureMessage = processStartFailureMessage; - return this; - } - - /** - * Specifies whether the tool's execution completed successfully. - * (Required) - */ - public boolean isExecutionSuccessful() { - return executionSuccessful; - } - - /** - * Specifies whether the tool's execution completed successfully. - * (Required) - */ - public void setExecutionSuccessful(boolean executionSuccessful) { - this.executionSuccessful = executionSuccessful; - } - - public Invocation withExecutionSuccessful(boolean executionSuccessful) { - this.executionSuccessful = executionSuccessful; - return this; - } - - /** - * The machine that hosted the analysis tool run. - */ - public String getMachine() { - return machine; - } - - /** - * The machine that hosted the analysis tool run. - */ - public void setMachine(String machine) { - this.machine = machine; - } - - public Invocation withMachine(String machine) { - this.machine = machine; - return this; - } - - /** - * The account that ran the analysis tool. - */ - public String getAccount() { - return account; - } - - /** - * The account that ran the analysis tool. - */ - public void setAccount(String account) { - this.account = account; - } - - public Invocation withAccount(String account) { - this.account = account; - return this; - } - - /** - * The process id for the analysis tool run. - */ - public int getProcessId() { - return processId; - } - - /** - * The process id for the analysis tool run. - */ - public void setProcessId(int processId) { - this.processId = processId; - } - - public Invocation withProcessId(int processId) { - this.processId = processId; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getExecutableLocation() { - return executableLocation; - } - - /** - * Specifies the location of an artifact. - */ - public void setExecutableLocation(ArtifactLocation executableLocation) { - this.executableLocation = executableLocation; - } - - public Invocation withExecutableLocation(ArtifactLocation executableLocation) { - this.executableLocation = executableLocation; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getWorkingDirectory() { - return workingDirectory; - } - - /** - * Specifies the location of an artifact. - */ - public void setWorkingDirectory(ArtifactLocation workingDirectory) { - this.workingDirectory = workingDirectory; - } - - public Invocation withWorkingDirectory(ArtifactLocation workingDirectory) { - this.workingDirectory = workingDirectory; - return this; - } - - /** - * The environment variables associated with the analysis tool process, expressed as key/value pairs. - */ - public EnvironmentVariables getEnvironmentVariables() { - return environmentVariables; - } - - /** - * The environment variables associated with the analysis tool process, expressed as key/value pairs. - */ - public void setEnvironmentVariables(EnvironmentVariables environmentVariables) { - this.environmentVariables = environmentVariables; - } - - public Invocation withEnvironmentVariables(EnvironmentVariables environmentVariables) { - this.environmentVariables = environmentVariables; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getStdin() { - return stdin; - } - - /** - * Specifies the location of an artifact. - */ - public void setStdin(ArtifactLocation stdin) { - this.stdin = stdin; - } - - public Invocation withStdin(ArtifactLocation stdin) { - this.stdin = stdin; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getStdout() { - return stdout; - } - - /** - * Specifies the location of an artifact. - */ - public void setStdout(ArtifactLocation stdout) { - this.stdout = stdout; - } - - public Invocation withStdout(ArtifactLocation stdout) { - this.stdout = stdout; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getStderr() { - return stderr; - } - - /** - * Specifies the location of an artifact. - */ - public void setStderr(ArtifactLocation stderr) { - this.stderr = stderr; - } - - public Invocation withStderr(ArtifactLocation stderr) { - this.stderr = stderr; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getStdoutStderr() { - return stdoutStderr; - } - - /** - * Specifies the location of an artifact. - */ - public void setStdoutStderr(ArtifactLocation stdoutStderr) { - this.stdoutStderr = stdoutStderr; - } - - public Invocation withStdoutStderr(ArtifactLocation stdoutStderr) { - this.stdoutStderr = stdoutStderr; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Invocation withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Invocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("commandLine"); - sb.append('='); - sb.append(((this.commandLine == null) ? "" : this.commandLine)); - sb.append(','); - sb.append("arguments"); - sb.append('='); - sb.append(((this.arguments == null) ? "" : this.arguments)); - sb.append(','); - sb.append("responseFiles"); - sb.append('='); - sb.append(((this.responseFiles == null) ? "" : this.responseFiles)); - sb.append(','); - sb.append("startTimeUtc"); - sb.append('='); - sb.append(((this.startTimeUtc == null) ? "" : this.startTimeUtc)); - sb.append(','); - sb.append("endTimeUtc"); - sb.append('='); - sb.append(((this.endTimeUtc == null) ? "" : this.endTimeUtc)); - sb.append(','); - sb.append("exitCode"); - sb.append('='); - sb.append(this.exitCode); - sb.append(','); - sb.append("ruleConfigurationOverrides"); - sb.append('='); - sb.append(((this.ruleConfigurationOverrides == null) ? "" : this.ruleConfigurationOverrides)); - sb.append(','); - sb.append("notificationConfigurationOverrides"); - sb.append('='); - sb.append(((this.notificationConfigurationOverrides == null) ? "" : this.notificationConfigurationOverrides)); - sb.append(','); - sb.append("toolExecutionNotifications"); - sb.append('='); - sb.append(((this.toolExecutionNotifications == null) ? "" : this.toolExecutionNotifications)); - sb.append(','); - sb.append("toolConfigurationNotifications"); - sb.append('='); - sb.append(((this.toolConfigurationNotifications == null) ? "" : this.toolConfigurationNotifications)); - sb.append(','); - sb.append("exitCodeDescription"); - sb.append('='); - sb.append(((this.exitCodeDescription == null) ? "" : this.exitCodeDescription)); - sb.append(','); - sb.append("exitSignalName"); - sb.append('='); - sb.append(((this.exitSignalName == null) ? "" : this.exitSignalName)); - sb.append(','); - sb.append("exitSignalNumber"); - sb.append('='); - sb.append(this.exitSignalNumber); - sb.append(','); - sb.append("processStartFailureMessage"); - sb.append('='); - sb.append(((this.processStartFailureMessage == null) ? "" : this.processStartFailureMessage)); - sb.append(','); - sb.append("executionSuccessful"); - sb.append('='); - sb.append(this.executionSuccessful); - sb.append(','); - sb.append("machine"); - sb.append('='); - sb.append(((this.machine == null) ? "" : this.machine)); - sb.append(','); - sb.append("account"); - sb.append('='); - sb.append(((this.account == null) ? "" : this.account)); - sb.append(','); - sb.append("processId"); - sb.append('='); - sb.append(this.processId); - sb.append(','); - sb.append("executableLocation"); - sb.append('='); - sb.append(((this.executableLocation == null) ? "" : this.executableLocation)); - sb.append(','); - sb.append("workingDirectory"); - sb.append('='); - sb.append(((this.workingDirectory == null) ? "" : this.workingDirectory)); - sb.append(','); - sb.append("environmentVariables"); - sb.append('='); - sb.append(((this.environmentVariables == null) ? "" : this.environmentVariables)); - sb.append(','); - sb.append("stdin"); - sb.append('='); - sb.append(((this.stdin == null) ? "" : this.stdin)); - sb.append(','); - sb.append("stdout"); - sb.append('='); - sb.append(((this.stdout == null) ? "" : this.stdout)); - sb.append(','); - sb.append("stderr"); - sb.append('='); - sb.append(((this.stderr == null) ? "" : this.stderr)); - sb.append(','); - sb.append("stdoutStderr"); - sb.append('='); - sb.append(((this.stdoutStderr == null) ? "" : this.stdoutStderr)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.endTimeUtc == null) ? 0 : this.endTimeUtc.hashCode())); - result = ((result * 31) + ((this.stdin == null) ? 0 : this.stdin.hashCode())); - result = ((result * 31) + ((this.stdout == null) ? 0 : this.stdout.hashCode())); - result = ((result * 31) + ((this.workingDirectory == null) ? 0 : this.workingDirectory.hashCode())); - result = ((result * 31) + this.exitSignalNumber); - result = ((result * 31) + ((this.exitCodeDescription == null) ? 0 : this.exitCodeDescription.hashCode())); - result = ((result * 31) + ((this.executableLocation == null) ? 0 : this.executableLocation.hashCode())); - result = ((result * 31) + this.processId); - result = ((result * 31) + this.exitCode); - result = ((result * 31) + ((this.toolConfigurationNotifications == null) ? 0 : this.toolConfigurationNotifications.hashCode())); - result = ((result * 31) + ((this.notificationConfigurationOverrides == null) ? 0 : this.notificationConfigurationOverrides.hashCode())); - result = ((result * 31) + ((this.processStartFailureMessage == null) ? 0 : this.processStartFailureMessage.hashCode())); - result = ((result * 31) + ((this.stderr == null) ? 0 : this.stderr.hashCode())); - result = ((result * 31) + ((this.ruleConfigurationOverrides == null) ? 0 : this.ruleConfigurationOverrides.hashCode())); - result = ((result * 31) + ((this.toolExecutionNotifications == null) ? 0 : this.toolExecutionNotifications.hashCode())); - result = ((result * 31) + ((this.machine == null) ? 0 : this.machine.hashCode())); - result = ((result * 31) + ((this.environmentVariables == null) ? 0 : this.environmentVariables.hashCode())); - result = ((result * 31) + ((this.stdoutStderr == null) ? 0 : this.stdoutStderr.hashCode())); - result = ((result * 31) + ((this.arguments == null) ? 0 : this.arguments.hashCode())); - result = ((result * 31) + ((this.responseFiles == null) ? 0 : this.responseFiles.hashCode())); - result = ((result * 31) + ((this.commandLine == null) ? 0 : this.commandLine.hashCode())); - result = ((result * 31) + (this.executionSuccessful ? 1 : 0)); - result = ((result * 31) + ((this.startTimeUtc == null) ? 0 : this.startTimeUtc.hashCode())); - result = ((result * 31) + ((this.account == null) ? 0 : this.account.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.exitSignalName == null) ? 0 : this.exitSignalName.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Invocation) == false) { - return false; - } - Invocation rhs = ((Invocation) other); - return (((((((((((((((((((((((((((this.endTimeUtc == rhs.endTimeUtc) || ((this.endTimeUtc != null) && this.endTimeUtc.equals(rhs.endTimeUtc))) && ((this.stdin == rhs.stdin) || ((this.stdin != null) && this.stdin.equals(rhs.stdin)))) && ((this.stdout == rhs.stdout) || ((this.stdout != null) && this.stdout.equals(rhs.stdout)))) && ((this.workingDirectory == rhs.workingDirectory) || ((this.workingDirectory != null) && this.workingDirectory.equals(rhs.workingDirectory)))) && (this.exitSignalNumber == rhs.exitSignalNumber)) && ((this.exitCodeDescription == rhs.exitCodeDescription) || ((this.exitCodeDescription != null) && this.exitCodeDescription.equals(rhs.exitCodeDescription)))) && ((this.executableLocation == rhs.executableLocation) || ((this.executableLocation != null) && this.executableLocation.equals(rhs.executableLocation)))) && (this.processId == rhs.processId)) && (this.exitCode == rhs.exitCode)) && ((this.toolConfigurationNotifications == rhs.toolConfigurationNotifications) || ((this.toolConfigurationNotifications != null) && this.toolConfigurationNotifications.equals(rhs.toolConfigurationNotifications)))) && ((this.notificationConfigurationOverrides == rhs.notificationConfigurationOverrides) || ((this.notificationConfigurationOverrides != null) && this.notificationConfigurationOverrides.equals(rhs.notificationConfigurationOverrides)))) && ((this.processStartFailureMessage == rhs.processStartFailureMessage) || ((this.processStartFailureMessage != null) && this.processStartFailureMessage.equals(rhs.processStartFailureMessage)))) && ((this.stderr == rhs.stderr) || ((this.stderr != null) && this.stderr.equals(rhs.stderr)))) && ((this.ruleConfigurationOverrides == rhs.ruleConfigurationOverrides) || ((this.ruleConfigurationOverrides != null) && this.ruleConfigurationOverrides.equals(rhs.ruleConfigurationOverrides)))) && ((this.toolExecutionNotifications == rhs.toolExecutionNotifications) || ((this.toolExecutionNotifications != null) && this.toolExecutionNotifications.equals(rhs.toolExecutionNotifications)))) && ((this.machine == rhs.machine) || ((this.machine != null) && this.machine.equals(rhs.machine)))) && ((this.environmentVariables == rhs.environmentVariables) || ((this.environmentVariables != null) && this.environmentVariables.equals(rhs.environmentVariables)))) && ((this.stdoutStderr == rhs.stdoutStderr) || ((this.stdoutStderr != null) && this.stdoutStderr.equals(rhs.stdoutStderr)))) && ((this.arguments == rhs.arguments) || ((this.arguments != null) && this.arguments.equals(rhs.arguments)))) && ((this.responseFiles == rhs.responseFiles) || ((this.responseFiles != null) && this.responseFiles.equals(rhs.responseFiles)))) && ((this.commandLine == rhs.commandLine) || ((this.commandLine != null) && this.commandLine.equals(rhs.commandLine)))) && (this.executionSuccessful == rhs.executionSuccessful)) && ((this.startTimeUtc == rhs.startTimeUtc) || ((this.startTimeUtc != null) && this.startTimeUtc.equals(rhs.startTimeUtc)))) && ((this.account == rhs.account) || ((this.account != null) && this.account.equals(rhs.account)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.exitSignalName == rhs.exitSignalName) || ((this.exitSignalName != null) && this.exitSignalName.equals(rhs.exitSignalName)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Location.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Location.java deleted file mode 100644 index 693cc0424e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Location.java +++ /dev/null @@ -1,285 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A location within a programming artifact. - */ -@Generated("jsonschema2pojo") -public class Location { - - /** - * Value that distinguishes this location from all other locations within a single result object. - */ - @SerializedName("id") - @Expose - private int id = -1; - /** - * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. - */ - @SerializedName("physicalLocation") - @Expose - private PhysicalLocation physicalLocation; - /** - * The logical locations associated with the result. - */ - @SerializedName("logicalLocations") - @Expose - private Set logicalLocations = new LinkedHashSet(); - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * A set of regions relevant to the location. - */ - @SerializedName("annotations") - @Expose - private Set annotations = new LinkedHashSet(); - /** - * An array of objects that describe relationships between this location and others. - */ - @SerializedName("relationships") - @Expose - private Set relationships = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Location() { - } - - /** - * @param relationships - * @param physicalLocation - * @param logicalLocations - * @param annotations - * @param id - * @param message - * @param properties - */ - public Location(int id, PhysicalLocation physicalLocation, Set logicalLocations, Message message, Set annotations, Set relationships, PropertyBag properties) { - super(); - this.id = id; - this.physicalLocation = physicalLocation; - this.logicalLocations = logicalLocations; - this.message = message; - this.annotations = annotations; - this.relationships = relationships; - this.properties = properties; - } - - /** - * Value that distinguishes this location from all other locations within a single result object. - */ - public int getId() { - return id; - } - - /** - * Value that distinguishes this location from all other locations within a single result object. - */ - public void setId(int id) { - this.id = id; - } - - public Location withId(int id) { - this.id = id; - return this; - } - - /** - * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. - */ - public PhysicalLocation getPhysicalLocation() { - return physicalLocation; - } - - /** - * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. - */ - public void setPhysicalLocation(PhysicalLocation physicalLocation) { - this.physicalLocation = physicalLocation; - } - - public Location withPhysicalLocation(PhysicalLocation physicalLocation) { - this.physicalLocation = physicalLocation; - return this; - } - - /** - * The logical locations associated with the result. - */ - public Set getLogicalLocations() { - return logicalLocations; - } - - /** - * The logical locations associated with the result. - */ - public void setLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - } - - public Location withLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public Location withMessage(Message message) { - this.message = message; - return this; - } - - /** - * A set of regions relevant to the location. - */ - public Set getAnnotations() { - return annotations; - } - - /** - * A set of regions relevant to the location. - */ - public void setAnnotations(Set annotations) { - this.annotations = annotations; - } - - public Location withAnnotations(Set annotations) { - this.annotations = annotations; - return this; - } - - /** - * An array of objects that describe relationships between this location and others. - */ - public Set getRelationships() { - return relationships; - } - - /** - * An array of objects that describe relationships between this location and others. - */ - public void setRelationships(Set relationships) { - this.relationships = relationships; - } - - public Location withRelationships(Set relationships) { - this.relationships = relationships; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Location withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Location.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(this.id); - sb.append(','); - sb.append("physicalLocation"); - sb.append('='); - sb.append(((this.physicalLocation == null) ? "" : this.physicalLocation)); - sb.append(','); - sb.append("logicalLocations"); - sb.append('='); - sb.append(((this.logicalLocations == null) ? "" : this.logicalLocations)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("annotations"); - sb.append('='); - sb.append(((this.annotations == null) ? "" : this.annotations)); - sb.append(','); - sb.append("relationships"); - sb.append('='); - sb.append(((this.relationships == null) ? "" : this.relationships)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.relationships == null) ? 0 : this.relationships.hashCode())); - result = ((result * 31) + ((this.physicalLocation == null) ? 0 : this.physicalLocation.hashCode())); - result = ((result * 31) + ((this.logicalLocations == null) ? 0 : this.logicalLocations.hashCode())); - result = ((result * 31) + ((this.annotations == null) ? 0 : this.annotations.hashCode())); - result = ((result * 31) + this.id); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Location) == false) { - return false; - } - Location rhs = ((Location) other); - return ((((((((this.relationships == rhs.relationships) || ((this.relationships != null) && this.relationships.equals(rhs.relationships))) && ((this.physicalLocation == rhs.physicalLocation) || ((this.physicalLocation != null) && this.physicalLocation.equals(rhs.physicalLocation)))) && ((this.logicalLocations == rhs.logicalLocations) || ((this.logicalLocations != null) && this.logicalLocations.equals(rhs.logicalLocations)))) && ((this.annotations == rhs.annotations) || ((this.annotations != null) && this.annotations.equals(rhs.annotations)))) && (this.id == rhs.id)) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LocationRelationship.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LocationRelationship.java deleted file mode 100644 index 4a52ecb2d4..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LocationRelationship.java +++ /dev/null @@ -1,193 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information about the relation of one location to another. - */ -@Generated("jsonschema2pojo") -public class LocationRelationship { - - /** - * A reference to the related location. - * (Required) - */ - @SerializedName("target") - @Expose - private int target; - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. - */ - @SerializedName("kinds") - @Expose - private Set kinds = new LinkedHashSet(Arrays.asList("relevant")); - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public LocationRelationship() { - } - - /** - * @param description - * @param kinds - * @param properties - * @param target - */ - public LocationRelationship(int target, Set kinds, Message description, PropertyBag properties) { - super(); - this.target = target; - this.kinds = kinds; - this.description = description; - this.properties = properties; - } - - /** - * A reference to the related location. - * (Required) - */ - public int getTarget() { - return target; - } - - /** - * A reference to the related location. - * (Required) - */ - public void setTarget(int target) { - this.target = target; - } - - public LocationRelationship withTarget(int target) { - this.target = target; - return this; - } - - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. - */ - public Set getKinds() { - return kinds; - } - - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. - */ - public void setKinds(Set kinds) { - this.kinds = kinds; - } - - public LocationRelationship withKinds(Set kinds) { - this.kinds = kinds; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public LocationRelationship withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public LocationRelationship withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(LocationRelationship.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("target"); - sb.append('='); - sb.append(this.target); - sb.append(','); - sb.append("kinds"); - sb.append('='); - sb.append(((this.kinds == null) ? "" : this.kinds)); - sb.append(','); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.kinds == null) ? 0 : this.kinds.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + this.target); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof LocationRelationship) == false) { - return false; - } - LocationRelationship rhs = ((LocationRelationship) other); - return (((((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description))) && ((this.kinds == rhs.kinds) || ((this.kinds != null) && this.kinds.equals(rhs.kinds)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && (this.target == rhs.target)); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LogicalLocation.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LogicalLocation.java deleted file mode 100644 index c05a6e26ba..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/LogicalLocation.java +++ /dev/null @@ -1,283 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A logical location of a construct that produced a result. - */ -@Generated("jsonschema2pojo") -public class LogicalLocation { - - /** - * Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. - */ - @SerializedName("name") - @Expose - private String name; - /** - * The index within the logical locations array. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * The human-readable fully qualified name of the logical location. - */ - @SerializedName("fullyQualifiedName") - @Expose - private String fullyQualifiedName; - /** - * The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. - */ - @SerializedName("decoratedName") - @Expose - private String decoratedName; - /** - * Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. - */ - @SerializedName("parentIndex") - @Expose - private int parentIndex = -1; - /** - * The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. - */ - @SerializedName("kind") - @Expose - private String kind; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public LogicalLocation() { - } - - /** - * @param parentIndex - * @param kind - * @param name - * @param index - * @param decoratedName - * @param fullyQualifiedName - * @param properties - */ - public LogicalLocation(String name, int index, String fullyQualifiedName, String decoratedName, int parentIndex, String kind, PropertyBag properties) { - super(); - this.name = name; - this.index = index; - this.fullyQualifiedName = fullyQualifiedName; - this.decoratedName = decoratedName; - this.parentIndex = parentIndex; - this.kind = kind; - this.properties = properties; - } - - /** - * Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. - */ - public String getName() { - return name; - } - - /** - * Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. - */ - public void setName(String name) { - this.name = name; - } - - public LogicalLocation withName(String name) { - this.name = name; - return this; - } - - /** - * The index within the logical locations array. - */ - public int getIndex() { - return index; - } - - /** - * The index within the logical locations array. - */ - public void setIndex(int index) { - this.index = index; - } - - public LogicalLocation withIndex(int index) { - this.index = index; - return this; - } - - /** - * The human-readable fully qualified name of the logical location. - */ - public String getFullyQualifiedName() { - return fullyQualifiedName; - } - - /** - * The human-readable fully qualified name of the logical location. - */ - public void setFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - } - - public LogicalLocation withFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - return this; - } - - /** - * The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. - */ - public String getDecoratedName() { - return decoratedName; - } - - /** - * The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. - */ - public void setDecoratedName(String decoratedName) { - this.decoratedName = decoratedName; - } - - public LogicalLocation withDecoratedName(String decoratedName) { - this.decoratedName = decoratedName; - return this; - } - - /** - * Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. - */ - public int getParentIndex() { - return parentIndex; - } - - /** - * Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. - */ - public void setParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - } - - public LogicalLocation withParentIndex(int parentIndex) { - this.parentIndex = parentIndex; - return this; - } - - /** - * The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. - */ - public String getKind() { - return kind; - } - - /** - * The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. - */ - public void setKind(String kind) { - this.kind = kind; - } - - public LogicalLocation withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public LogicalLocation withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(LogicalLocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("fullyQualifiedName"); - sb.append('='); - sb.append(((this.fullyQualifiedName == null) ? "" : this.fullyQualifiedName)); - sb.append(','); - sb.append("decoratedName"); - sb.append('='); - sb.append(((this.decoratedName == null) ? "" : this.decoratedName)); - sb.append(','); - sb.append("parentIndex"); - sb.append('='); - sb.append(this.parentIndex); - sb.append(','); - sb.append("kind"); - sb.append('='); - sb.append(((this.kind == null) ? "" : this.kind)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.parentIndex); - result = ((result * 31) + ((this.kind == null) ? 0 : this.kind.hashCode())); - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.decoratedName == null) ? 0 : this.decoratedName.hashCode())); - result = ((result * 31) + ((this.fullyQualifiedName == null) ? 0 : this.fullyQualifiedName.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof LogicalLocation) == false) { - return false; - } - LogicalLocation rhs = ((LogicalLocation) other); - return (((((((this.parentIndex == rhs.parentIndex) && ((this.kind == rhs.kind) || ((this.kind != null) && this.kind.equals(rhs.kind)))) && ((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name)))) && (this.index == rhs.index)) && ((this.decoratedName == rhs.decoratedName) || ((this.decoratedName != null) && this.decoratedName.equals(rhs.decoratedName)))) && ((this.fullyQualifiedName == rhs.fullyQualifiedName) || ((this.fullyQualifiedName != null) && this.fullyQualifiedName.equals(rhs.fullyQualifiedName)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Message.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Message.java deleted file mode 100644 index 89ee9f5c2b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Message.java +++ /dev/null @@ -1,221 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Encapsulates a message intended to be read by the end user. - */ -@Generated("jsonschema2pojo") -public class Message { - - /** - * A plain text message string. - */ - @SerializedName("text") - @Expose - private String text; - /** - * A Markdown message string. - */ - @SerializedName("markdown") - @Expose - private String markdown; - /** - * The identifier for this message. - */ - @SerializedName("id") - @Expose - private String id; - /** - * An array of strings to substitute into the message string. - */ - @SerializedName("arguments") - @Expose - private List arguments = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Message() { - } - - /** - * @param markdown - * @param arguments - * @param text - * @param id - * @param properties - */ - public Message(String text, String markdown, String id, List arguments, PropertyBag properties) { - super(); - this.text = text; - this.markdown = markdown; - this.id = id; - this.arguments = arguments; - this.properties = properties; - } - - /** - * A plain text message string. - */ - public String getText() { - return text; - } - - /** - * A plain text message string. - */ - public void setText(String text) { - this.text = text; - } - - public Message withText(String text) { - this.text = text; - return this; - } - - /** - * A Markdown message string. - */ - public String getMarkdown() { - return markdown; - } - - /** - * A Markdown message string. - */ - public void setMarkdown(String markdown) { - this.markdown = markdown; - } - - public Message withMarkdown(String markdown) { - this.markdown = markdown; - return this; - } - - /** - * The identifier for this message. - */ - public String getId() { - return id; - } - - /** - * The identifier for this message. - */ - public void setId(String id) { - this.id = id; - } - - public Message withId(String id) { - this.id = id; - return this; - } - - /** - * An array of strings to substitute into the message string. - */ - public List getArguments() { - return arguments; - } - - /** - * An array of strings to substitute into the message string. - */ - public void setArguments(List arguments) { - this.arguments = arguments; - } - - public Message withArguments(List arguments) { - this.arguments = arguments; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Message withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Message.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("text"); - sb.append('='); - sb.append(((this.text == null) ? "" : this.text)); - sb.append(','); - sb.append("markdown"); - sb.append('='); - sb.append(((this.markdown == null) ? "" : this.markdown)); - sb.append(','); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("arguments"); - sb.append('='); - sb.append(((this.arguments == null) ? "" : this.arguments)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.markdown == null) ? 0 : this.markdown.hashCode())); - result = ((result * 31) + ((this.arguments == null) ? 0 : this.arguments.hashCode())); - result = ((result * 31) + ((this.text == null) ? 0 : this.text.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Message) == false) { - return false; - } - Message rhs = ((Message) other); - return ((((((this.markdown == rhs.markdown) || ((this.markdown != null) && this.markdown.equals(rhs.markdown))) && ((this.arguments == rhs.arguments) || ((this.arguments != null) && this.arguments.equals(rhs.arguments)))) && ((this.text == rhs.text) || ((this.text != null) && this.text.equals(rhs.text)))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MessageStrings.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MessageStrings.java deleted file mode 100644 index ccfd645942..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MessageStrings.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ -@Generated("jsonschema2pojo") -public class MessageStrings { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(MessageStrings.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof MessageStrings) == false) { - return false; - } - MessageStrings rhs = ((MessageStrings) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MultiformatMessageString.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MultiformatMessageString.java deleted file mode 100644 index 3545dd5570..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/MultiformatMessageString.java +++ /dev/null @@ -1,158 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A message string or message format string rendered in multiple formats. - */ -@Generated("jsonschema2pojo") -public class MultiformatMessageString { - - /** - * A plain text message string or format string. - * (Required) - */ - @SerializedName("text") - @Expose - private String text; - /** - * A Markdown message string or format string. - */ - @SerializedName("markdown") - @Expose - private String markdown; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public MultiformatMessageString() { - } - - /** - * @param markdown - * @param text - * @param properties - */ - public MultiformatMessageString(String text, String markdown, PropertyBag properties) { - super(); - this.text = text; - this.markdown = markdown; - this.properties = properties; - } - - /** - * A plain text message string or format string. - * (Required) - */ - public String getText() { - return text; - } - - /** - * A plain text message string or format string. - * (Required) - */ - public void setText(String text) { - this.text = text; - } - - public MultiformatMessageString withText(String text) { - this.text = text; - return this; - } - - /** - * A Markdown message string or format string. - */ - public String getMarkdown() { - return markdown; - } - - /** - * A Markdown message string or format string. - */ - public void setMarkdown(String markdown) { - this.markdown = markdown; - } - - public MultiformatMessageString withMarkdown(String markdown) { - this.markdown = markdown; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public MultiformatMessageString withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(MultiformatMessageString.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("text"); - sb.append('='); - sb.append(((this.text == null) ? "" : this.text)); - sb.append(','); - sb.append("markdown"); - sb.append('='); - sb.append(((this.markdown == null) ? "" : this.markdown)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.markdown == null) ? 0 : this.markdown.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.text == null) ? 0 : this.text.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof MultiformatMessageString) == false) { - return false; - } - MultiformatMessageString rhs = ((MultiformatMessageString) other); - return ((((this.markdown == rhs.markdown) || ((this.markdown != null) && this.markdown.equals(rhs.markdown))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.text == rhs.text) || ((this.text != null) && this.text.equals(rhs.text)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Node.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Node.java deleted file mode 100644 index b8e8ed2607..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Node.java +++ /dev/null @@ -1,224 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Represents a node in a graph. - */ -@Generated("jsonschema2pojo") -public class Node { - - /** - * A string that uniquely identifies the node within its graph. - * (Required) - */ - @SerializedName("id") - @Expose - private String id; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("label") - @Expose - private Message label; - /** - * A location within a programming artifact. - */ - @SerializedName("location") - @Expose - private Location location; - /** - * Array of child nodes. - */ - @SerializedName("children") - @Expose - private Set children = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Node() { - } - - /** - * @param children - * @param location - * @param id - * @param label - * @param properties - */ - public Node(String id, Message label, Location location, Set children, PropertyBag properties) { - super(); - this.id = id; - this.label = label; - this.location = location; - this.children = children; - this.properties = properties; - } - - /** - * A string that uniquely identifies the node within its graph. - * (Required) - */ - public String getId() { - return id; - } - - /** - * A string that uniquely identifies the node within its graph. - * (Required) - */ - public void setId(String id) { - this.id = id; - } - - public Node withId(String id) { - this.id = id; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getLabel() { - return label; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setLabel(Message label) { - this.label = label; - } - - public Node withLabel(Message label) { - this.label = label; - return this; - } - - /** - * A location within a programming artifact. - */ - public Location getLocation() { - return location; - } - - /** - * A location within a programming artifact. - */ - public void setLocation(Location location) { - this.location = location; - } - - public Node withLocation(Location location) { - this.location = location; - return this; - } - - /** - * Array of child nodes. - */ - public Set getChildren() { - return children; - } - - /** - * Array of child nodes. - */ - public void setChildren(Set children) { - this.children = children; - } - - public Node withChildren(Set children) { - this.children = children; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Node withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Node.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("label"); - sb.append('='); - sb.append(((this.label == null) ? "" : this.label)); - sb.append(','); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("children"); - sb.append('='); - sb.append(((this.children == null) ? "" : this.children)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.label == null) ? 0 : this.label.hashCode())); - result = ((result * 31) + ((this.children == null) ? 0 : this.children.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Node) == false) { - return false; - } - Node rhs = ((Node) other); - return ((((((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.label == rhs.label) || ((this.label != null) && this.label.equals(rhs.label)))) && ((this.children == rhs.children) || ((this.children != null) && this.children.equals(rhs.children)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Notification.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Notification.java deleted file mode 100644 index be15932caf..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Notification.java +++ /dev/null @@ -1,403 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool. - */ -@Generated("jsonschema2pojo") -public class Notification { - - /** - * The locations relevant to this notification. - */ - @SerializedName("locations") - @Expose - private Set locations = new LinkedHashSet(); - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - @SerializedName("message") - @Expose - private Message message; - /** - * A value specifying the severity level of the notification. - */ - @SerializedName("level") - @Expose - private Notification.Level level = Notification.Level.fromValue("warning"); - /** - * The thread identifier of the code that generated the notification. - */ - @SerializedName("threadId") - @Expose - private int threadId; - /** - * The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. - */ - @SerializedName("timeUtc") - @Expose - private Date timeUtc; - /** - * Describes a runtime exception encountered during the execution of an analysis tool. - */ - @SerializedName("exception") - @Expose - private Exception exception; - /** - * Information about how to locate a relevant reporting descriptor. - */ - @SerializedName("descriptor") - @Expose - private ReportingDescriptorReference descriptor; - /** - * Information about how to locate a relevant reporting descriptor. - */ - @SerializedName("associatedRule") - @Expose - private ReportingDescriptorReference associatedRule; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Notification() { - } - - /** - * @param threadId - * @param exception - * @param level - * @param associatedRule - * @param timeUtc - * @param locations - * @param descriptor - * @param message - * @param properties - */ - public Notification(Set locations, Message message, Notification.Level level, int threadId, Date timeUtc, Exception exception, ReportingDescriptorReference descriptor, ReportingDescriptorReference associatedRule, PropertyBag properties) { - super(); - this.locations = locations; - this.message = message; - this.level = level; - this.threadId = threadId; - this.timeUtc = timeUtc; - this.exception = exception; - this.descriptor = descriptor; - this.associatedRule = associatedRule; - this.properties = properties; - } - - /** - * The locations relevant to this notification. - */ - public Set getLocations() { - return locations; - } - - /** - * The locations relevant to this notification. - */ - public void setLocations(Set locations) { - this.locations = locations; - } - - public Notification withLocations(Set locations) { - this.locations = locations; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - public void setMessage(Message message) { - this.message = message; - } - - public Notification withMessage(Message message) { - this.message = message; - return this; - } - - /** - * A value specifying the severity level of the notification. - */ - public Notification.Level getLevel() { - return level; - } - - /** - * A value specifying the severity level of the notification. - */ - public void setLevel(Notification.Level level) { - this.level = level; - } - - public Notification withLevel(Notification.Level level) { - this.level = level; - return this; - } - - /** - * The thread identifier of the code that generated the notification. - */ - public int getThreadId() { - return threadId; - } - - /** - * The thread identifier of the code that generated the notification. - */ - public void setThreadId(int threadId) { - this.threadId = threadId; - } - - public Notification withThreadId(int threadId) { - this.threadId = threadId; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. - */ - public Date getTimeUtc() { - return timeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. - */ - public void setTimeUtc(Date timeUtc) { - this.timeUtc = timeUtc; - } - - public Notification withTimeUtc(Date timeUtc) { - this.timeUtc = timeUtc; - return this; - } - - /** - * Describes a runtime exception encountered during the execution of an analysis tool. - */ - public Exception getException() { - return exception; - } - - /** - * Describes a runtime exception encountered during the execution of an analysis tool. - */ - public void setException(Exception exception) { - this.exception = exception; - } - - public Notification withException(Exception exception) { - this.exception = exception; - return this; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public ReportingDescriptorReference getDescriptor() { - return descriptor; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public void setDescriptor(ReportingDescriptorReference descriptor) { - this.descriptor = descriptor; - } - - public Notification withDescriptor(ReportingDescriptorReference descriptor) { - this.descriptor = descriptor; - return this; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public ReportingDescriptorReference getAssociatedRule() { - return associatedRule; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public void setAssociatedRule(ReportingDescriptorReference associatedRule) { - this.associatedRule = associatedRule; - } - - public Notification withAssociatedRule(ReportingDescriptorReference associatedRule) { - this.associatedRule = associatedRule; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Notification withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Notification.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("locations"); - sb.append('='); - sb.append(((this.locations == null) ? "" : this.locations)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("level"); - sb.append('='); - sb.append(((this.level == null) ? "" : this.level)); - sb.append(','); - sb.append("threadId"); - sb.append('='); - sb.append(this.threadId); - sb.append(','); - sb.append("timeUtc"); - sb.append('='); - sb.append(((this.timeUtc == null) ? "" : this.timeUtc)); - sb.append(','); - sb.append("exception"); - sb.append('='); - sb.append(((this.exception == null) ? "" : this.exception)); - sb.append(','); - sb.append("descriptor"); - sb.append('='); - sb.append(((this.descriptor == null) ? "" : this.descriptor)); - sb.append(','); - sb.append("associatedRule"); - sb.append('='); - sb.append(((this.associatedRule == null) ? "" : this.associatedRule)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.threadId); - result = ((result * 31) + ((this.exception == null) ? 0 : this.exception.hashCode())); - result = ((result * 31) + ((this.level == null) ? 0 : this.level.hashCode())); - result = ((result * 31) + ((this.associatedRule == null) ? 0 : this.associatedRule.hashCode())); - result = ((result * 31) + ((this.timeUtc == null) ? 0 : this.timeUtc.hashCode())); - result = ((result * 31) + ((this.locations == null) ? 0 : this.locations.hashCode())); - result = ((result * 31) + ((this.descriptor == null) ? 0 : this.descriptor.hashCode())); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Notification) == false) { - return false; - } - Notification rhs = ((Notification) other); - return (((((((((this.threadId == rhs.threadId) && ((this.exception == rhs.exception) || ((this.exception != null) && this.exception.equals(rhs.exception)))) && ((this.level == rhs.level) || ((this.level != null) && this.level.equals(rhs.level)))) && ((this.associatedRule == rhs.associatedRule) || ((this.associatedRule != null) && this.associatedRule.equals(rhs.associatedRule)))) && ((this.timeUtc == rhs.timeUtc) || ((this.timeUtc != null) && this.timeUtc.equals(rhs.timeUtc)))) && ((this.locations == rhs.locations) || ((this.locations != null) && this.locations.equals(rhs.locations)))) && ((this.descriptor == rhs.descriptor) || ((this.descriptor != null) && this.descriptor.equals(rhs.descriptor)))) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * A value specifying the severity level of the notification. - */ - @Generated("jsonschema2pojo") - public enum Level { - - @SerializedName("none") - NONE("none"), - @SerializedName("note") - NOTE("note"), - @SerializedName("warning") - WARNING("warning"), - @SerializedName("error") - ERROR("error"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Notification.Level c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Level(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Notification.Level fromValue(String value) { - Notification.Level constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/OriginalUriBaseIds.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/OriginalUriBaseIds.java deleted file mode 100644 index 45de94562b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/OriginalUriBaseIds.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - */ -@Generated("jsonschema2pojo") -public class OriginalUriBaseIds { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(OriginalUriBaseIds.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof OriginalUriBaseIds) == false) { - return false; - } - OriginalUriBaseIds rhs = ((OriginalUriBaseIds) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Parameters.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Parameters.java deleted file mode 100644 index 8c38a2272c..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Parameters.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * The request parameters. - */ -@Generated("jsonschema2pojo") -public class Parameters { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Parameters.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Parameters) == false) { - return false; - } - Parameters rhs = ((Parameters) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PartialFingerprints.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PartialFingerprints.java deleted file mode 100644 index 50820681a7..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PartialFingerprints.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A set of strings that contribute to the stable, unique identity of the result. - */ -@Generated("jsonschema2pojo") -public class PartialFingerprints { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(PartialFingerprints.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof PartialFingerprints) == false) { - return false; - } - PartialFingerprints rhs = ((PartialFingerprints) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PhysicalLocation.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PhysicalLocation.java deleted file mode 100644 index fa7647660d..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PhysicalLocation.java +++ /dev/null @@ -1,219 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. - */ -@Generated("jsonschema2pojo") -public class PhysicalLocation { - - /** - * A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). - */ - @SerializedName("address") - @Expose - private Address address; - /** - * Specifies the location of an artifact. - */ - @SerializedName("artifactLocation") - @Expose - private ArtifactLocation artifactLocation; - /** - * A region within an artifact where a result was detected. - */ - @SerializedName("region") - @Expose - private Region region; - /** - * A region within an artifact where a result was detected. - */ - @SerializedName("contextRegion") - @Expose - private Region contextRegion; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public PhysicalLocation() { - } - - /** - * @param address - * @param contextRegion - * @param region - * @param artifactLocation - * @param properties - */ - public PhysicalLocation(Address address, ArtifactLocation artifactLocation, Region region, Region contextRegion, PropertyBag properties) { - super(); - this.address = address; - this.artifactLocation = artifactLocation; - this.region = region; - this.contextRegion = contextRegion; - this.properties = properties; - } - - /** - * A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). - */ - public Address getAddress() { - return address; - } - - /** - * A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). - */ - public void setAddress(Address address) { - this.address = address; - } - - public PhysicalLocation withAddress(Address address) { - this.address = address; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getArtifactLocation() { - return artifactLocation; - } - - /** - * Specifies the location of an artifact. - */ - public void setArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - } - - public PhysicalLocation withArtifactLocation(ArtifactLocation artifactLocation) { - this.artifactLocation = artifactLocation; - return this; - } - - /** - * A region within an artifact where a result was detected. - */ - public Region getRegion() { - return region; - } - - /** - * A region within an artifact where a result was detected. - */ - public void setRegion(Region region) { - this.region = region; - } - - public PhysicalLocation withRegion(Region region) { - this.region = region; - return this; - } - - /** - * A region within an artifact where a result was detected. - */ - public Region getContextRegion() { - return contextRegion; - } - - /** - * A region within an artifact where a result was detected. - */ - public void setContextRegion(Region contextRegion) { - this.contextRegion = contextRegion; - } - - public PhysicalLocation withContextRegion(Region contextRegion) { - this.contextRegion = contextRegion; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public PhysicalLocation withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(PhysicalLocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("address"); - sb.append('='); - sb.append(((this.address == null) ? "" : this.address)); - sb.append(','); - sb.append("artifactLocation"); - sb.append('='); - sb.append(((this.artifactLocation == null) ? "" : this.artifactLocation)); - sb.append(','); - sb.append("region"); - sb.append('='); - sb.append(((this.region == null) ? "" : this.region)); - sb.append(','); - sb.append("contextRegion"); - sb.append('='); - sb.append(((this.contextRegion == null) ? "" : this.contextRegion)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.contextRegion == null) ? 0 : this.contextRegion.hashCode())); - result = ((result * 31) + ((this.address == null) ? 0 : this.address.hashCode())); - result = ((result * 31) + ((this.region == null) ? 0 : this.region.hashCode())); - result = ((result * 31) + ((this.artifactLocation == null) ? 0 : this.artifactLocation.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof PhysicalLocation) == false) { - return false; - } - PhysicalLocation rhs = ((PhysicalLocation) other); - return ((((((this.contextRegion == rhs.contextRegion) || ((this.contextRegion != null) && this.contextRegion.equals(rhs.contextRegion))) && ((this.address == rhs.address) || ((this.address != null) && this.address.equals(rhs.address)))) && ((this.region == rhs.region) || ((this.region != null) && this.region.equals(rhs.region)))) && ((this.artifactLocation == rhs.artifactLocation) || ((this.artifactLocation != null) && this.artifactLocation.equals(rhs.artifactLocation)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PropertyBag.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PropertyBag.java deleted file mode 100644 index 370c982bbe..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/PropertyBag.java +++ /dev/null @@ -1,125 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Key/value pairs that provide additional information about the object. - */ -@Generated("jsonschema2pojo") -public class PropertyBag { - - /** - * This is a modification, see: https://github.com/joelittlejohn/jsonschema2pojo/issues/186 - */ - @SerializedName("category") - @Expose - private String category; - /** - * A set of distinct strings that provide additional information. - */ - @SerializedName("tags") - @Expose - private Set tags = new LinkedHashSet(); - - /** - * No args constructor for use in serialization - */ - public PropertyBag() { - } - - /** - * @param category - * @param tags - */ - public PropertyBag(String category, Set tags) { - super(); - this.category = category; - this.tags = tags; - } - - /** - * This is a modification, see: https://github.com/joelittlejohn/jsonschema2pojo/issues/186 - */ - public String getCategory() { - return category; - } - - /** - * This is a modification, see: https://github.com/joelittlejohn/jsonschema2pojo/issues/186 - */ - public void setCategory(String category) { - this.category = category; - } - - public PropertyBag withCategory(String category) { - this.category = category; - return this; - } - - /** - * A set of distinct strings that provide additional information. - */ - public Set getTags() { - return tags; - } - - /** - * A set of distinct strings that provide additional information. - */ - public void setTags(Set tags) { - this.tags = tags; - } - - public PropertyBag withTags(Set tags) { - this.tags = tags; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(PropertyBag.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("category"); - sb.append('='); - sb.append(((this.category == null) ? "" : this.category)); - sb.append(','); - sb.append("tags"); - sb.append('='); - sb.append(((this.tags == null) ? "" : this.tags)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.category == null) ? 0 : this.category.hashCode())); - result = ((result * 31) + ((this.tags == null) ? 0 : this.tags.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof PropertyBag) == false) { - return false; - } - PropertyBag rhs = ((PropertyBag) other); - return (((this.category == rhs.category) || ((this.category != null) && this.category.equals(rhs.category))) && ((this.tags == rhs.tags) || ((this.tags != null) && this.tags.equals(rhs.tags)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Rectangle.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Rectangle.java deleted file mode 100644 index 228996feb1..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Rectangle.java +++ /dev/null @@ -1,251 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * An area within an image. - */ -@Generated("jsonschema2pojo") -public class Rectangle { - - /** - * The Y coordinate of the top edge of the rectangle, measured in the image's natural units. - */ - @SerializedName("top") - @Expose - private double top; - /** - * The X coordinate of the left edge of the rectangle, measured in the image's natural units. - */ - @SerializedName("left") - @Expose - private double left; - /** - * The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. - */ - @SerializedName("bottom") - @Expose - private double bottom; - /** - * The X coordinate of the right edge of the rectangle, measured in the image's natural units. - */ - @SerializedName("right") - @Expose - private double right; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Rectangle() { - } - - /** - * @param top - * @param left - * @param bottom - * @param right - * @param message - * @param properties - */ - public Rectangle(double top, double left, double bottom, double right, Message message, PropertyBag properties) { - super(); - this.top = top; - this.left = left; - this.bottom = bottom; - this.right = right; - this.message = message; - this.properties = properties; - } - - /** - * The Y coordinate of the top edge of the rectangle, measured in the image's natural units. - */ - public double getTop() { - return top; - } - - /** - * The Y coordinate of the top edge of the rectangle, measured in the image's natural units. - */ - public void setTop(double top) { - this.top = top; - } - - public Rectangle withTop(double top) { - this.top = top; - return this; - } - - /** - * The X coordinate of the left edge of the rectangle, measured in the image's natural units. - */ - public double getLeft() { - return left; - } - - /** - * The X coordinate of the left edge of the rectangle, measured in the image's natural units. - */ - public void setLeft(double left) { - this.left = left; - } - - public Rectangle withLeft(double left) { - this.left = left; - return this; - } - - /** - * The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. - */ - public double getBottom() { - return bottom; - } - - /** - * The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. - */ - public void setBottom(double bottom) { - this.bottom = bottom; - } - - public Rectangle withBottom(double bottom) { - this.bottom = bottom; - return this; - } - - /** - * The X coordinate of the right edge of the rectangle, measured in the image's natural units. - */ - public double getRight() { - return right; - } - - /** - * The X coordinate of the right edge of the rectangle, measured in the image's natural units. - */ - public void setRight(double right) { - this.right = right; - } - - public Rectangle withRight(double right) { - this.right = right; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public Rectangle withMessage(Message message) { - this.message = message; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Rectangle withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Rectangle.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("top"); - sb.append('='); - sb.append(this.top); - sb.append(','); - sb.append("left"); - sb.append('='); - sb.append(this.left); - sb.append(','); - sb.append("bottom"); - sb.append('='); - sb.append(this.bottom); - sb.append(','); - sb.append("right"); - sb.append('='); - sb.append(this.right); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.right) ^ (Double.doubleToLongBits(this.right) >>> 32)))); - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.top) ^ (Double.doubleToLongBits(this.top) >>> 32)))); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.left) ^ (Double.doubleToLongBits(this.left) >>> 32)))); - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.bottom) ^ (Double.doubleToLongBits(this.bottom) >>> 32)))); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Rectangle) == false) { - return false; - } - Rectangle rhs = ((Rectangle) other); - return ((((((Double.doubleToLongBits(this.right) == Double.doubleToLongBits(rhs.right)) && (Double.doubleToLongBits(this.top) == Double.doubleToLongBits(rhs.top))) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && (Double.doubleToLongBits(this.left) == Double.doubleToLongBits(rhs.left))) && (Double.doubleToLongBits(this.bottom) == Double.doubleToLongBits(rhs.bottom))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Region.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Region.java deleted file mode 100644 index 3debb4f37d..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Region.java +++ /dev/null @@ -1,443 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A region within an artifact where a result was detected. - */ -@Generated("jsonschema2pojo") -public class Region { - - /** - * The line number of the first character in the region. - */ - @SerializedName("startLine") - @Expose - private int startLine; - /** - * The column number of the first character in the region. - */ - @SerializedName("startColumn") - @Expose - private int startColumn; - /** - * The line number of the last character in the region. - */ - @SerializedName("endLine") - @Expose - private int endLine; - /** - * The column number of the character following the end of the region. - */ - @SerializedName("endColumn") - @Expose - private int endColumn; - /** - * The zero-based offset from the beginning of the artifact of the first character in the region. - */ - @SerializedName("charOffset") - @Expose - private int charOffset = -1; - /** - * The length of the region in characters. - */ - @SerializedName("charLength") - @Expose - private int charLength; - /** - * The zero-based offset from the beginning of the artifact of the first byte in the region. - */ - @SerializedName("byteOffset") - @Expose - private int byteOffset = -1; - /** - * The length of the region in bytes. - */ - @SerializedName("byteLength") - @Expose - private int byteLength; - /** - * Represents the contents of an artifact. - */ - @SerializedName("snippet") - @Expose - private ArtifactContent snippet; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * Specifies the source language, if any, of the portion of the artifact specified by the region object. - */ - @SerializedName("sourceLanguage") - @Expose - private String sourceLanguage; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Region() { - } - - /** - * @param endLine - * @param snippet - * @param charOffset - * @param endColumn - * @param charLength - * @param byteOffset - * @param startColumn - * @param startLine - * @param byteLength - * @param message - * @param sourceLanguage - * @param properties - */ - public Region(int startLine, int startColumn, int endLine, int endColumn, int charOffset, int charLength, int byteOffset, int byteLength, ArtifactContent snippet, Message message, String sourceLanguage, PropertyBag properties) { - super(); - this.startLine = startLine; - this.startColumn = startColumn; - this.endLine = endLine; - this.endColumn = endColumn; - this.charOffset = charOffset; - this.charLength = charLength; - this.byteOffset = byteOffset; - this.byteLength = byteLength; - this.snippet = snippet; - this.message = message; - this.sourceLanguage = sourceLanguage; - this.properties = properties; - } - - /** - * The line number of the first character in the region. - */ - public int getStartLine() { - return startLine; - } - - /** - * The line number of the first character in the region. - */ - public void setStartLine(int startLine) { - this.startLine = startLine; - } - - public Region withStartLine(int startLine) { - this.startLine = startLine; - return this; - } - - /** - * The column number of the first character in the region. - */ - public int getStartColumn() { - return startColumn; - } - - /** - * The column number of the first character in the region. - */ - public void setStartColumn(int startColumn) { - this.startColumn = startColumn; - } - - public Region withStartColumn(int startColumn) { - this.startColumn = startColumn; - return this; - } - - /** - * The line number of the last character in the region. - */ - public int getEndLine() { - return endLine; - } - - /** - * The line number of the last character in the region. - */ - public void setEndLine(int endLine) { - this.endLine = endLine; - } - - public Region withEndLine(int endLine) { - this.endLine = endLine; - return this; - } - - /** - * The column number of the character following the end of the region. - */ - public int getEndColumn() { - return endColumn; - } - - /** - * The column number of the character following the end of the region. - */ - public void setEndColumn(int endColumn) { - this.endColumn = endColumn; - } - - public Region withEndColumn(int endColumn) { - this.endColumn = endColumn; - return this; - } - - /** - * The zero-based offset from the beginning of the artifact of the first character in the region. - */ - public int getCharOffset() { - return charOffset; - } - - /** - * The zero-based offset from the beginning of the artifact of the first character in the region. - */ - public void setCharOffset(int charOffset) { - this.charOffset = charOffset; - } - - public Region withCharOffset(int charOffset) { - this.charOffset = charOffset; - return this; - } - - /** - * The length of the region in characters. - */ - public int getCharLength() { - return charLength; - } - - /** - * The length of the region in characters. - */ - public void setCharLength(int charLength) { - this.charLength = charLength; - } - - public Region withCharLength(int charLength) { - this.charLength = charLength; - return this; - } - - /** - * The zero-based offset from the beginning of the artifact of the first byte in the region. - */ - public int getByteOffset() { - return byteOffset; - } - - /** - * The zero-based offset from the beginning of the artifact of the first byte in the region. - */ - public void setByteOffset(int byteOffset) { - this.byteOffset = byteOffset; - } - - public Region withByteOffset(int byteOffset) { - this.byteOffset = byteOffset; - return this; - } - - /** - * The length of the region in bytes. - */ - public int getByteLength() { - return byteLength; - } - - /** - * The length of the region in bytes. - */ - public void setByteLength(int byteLength) { - this.byteLength = byteLength; - } - - public Region withByteLength(int byteLength) { - this.byteLength = byteLength; - return this; - } - - /** - * Represents the contents of an artifact. - */ - public ArtifactContent getSnippet() { - return snippet; - } - - /** - * Represents the contents of an artifact. - */ - public void setSnippet(ArtifactContent snippet) { - this.snippet = snippet; - } - - public Region withSnippet(ArtifactContent snippet) { - this.snippet = snippet; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public Region withMessage(Message message) { - this.message = message; - return this; - } - - /** - * Specifies the source language, if any, of the portion of the artifact specified by the region object. - */ - public String getSourceLanguage() { - return sourceLanguage; - } - - /** - * Specifies the source language, if any, of the portion of the artifact specified by the region object. - */ - public void setSourceLanguage(String sourceLanguage) { - this.sourceLanguage = sourceLanguage; - } - - public Region withSourceLanguage(String sourceLanguage) { - this.sourceLanguage = sourceLanguage; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Region withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Region.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("startLine"); - sb.append('='); - sb.append(this.startLine); - sb.append(','); - sb.append("startColumn"); - sb.append('='); - sb.append(this.startColumn); - sb.append(','); - sb.append("endLine"); - sb.append('='); - sb.append(this.endLine); - sb.append(','); - sb.append("endColumn"); - sb.append('='); - sb.append(this.endColumn); - sb.append(','); - sb.append("charOffset"); - sb.append('='); - sb.append(this.charOffset); - sb.append(','); - sb.append("charLength"); - sb.append('='); - sb.append(this.charLength); - sb.append(','); - sb.append("byteOffset"); - sb.append('='); - sb.append(this.byteOffset); - sb.append(','); - sb.append("byteLength"); - sb.append('='); - sb.append(this.byteLength); - sb.append(','); - sb.append("snippet"); - sb.append('='); - sb.append(((this.snippet == null) ? "" : this.snippet)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("sourceLanguage"); - sb.append('='); - sb.append(((this.sourceLanguage == null) ? "" : this.sourceLanguage)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.endLine); - result = ((result * 31) + ((this.snippet == null) ? 0 : this.snippet.hashCode())); - result = ((result * 31) + this.charOffset); - result = ((result * 31) + this.endColumn); - result = ((result * 31) + this.charLength); - result = ((result * 31) + this.byteOffset); - result = ((result * 31) + this.startColumn); - result = ((result * 31) + this.startLine); - result = ((result * 31) + this.byteLength); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.sourceLanguage == null) ? 0 : this.sourceLanguage.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Region) == false) { - return false; - } - Region rhs = ((Region) other); - return ((((((((((((this.endLine == rhs.endLine) && ((this.snippet == rhs.snippet) || ((this.snippet != null) && this.snippet.equals(rhs.snippet)))) && (this.charOffset == rhs.charOffset)) && (this.endColumn == rhs.endColumn)) && (this.charLength == rhs.charLength)) && (this.byteOffset == rhs.byteOffset)) && (this.startColumn == rhs.startColumn)) && (this.startLine == rhs.startLine)) && (this.byteLength == rhs.byteLength)) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.sourceLanguage == rhs.sourceLanguage) || ((this.sourceLanguage != null) && this.sourceLanguage.equals(rhs.sourceLanguage)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Replacement.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Replacement.java deleted file mode 100644 index 3fc377d3b3..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Replacement.java +++ /dev/null @@ -1,158 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * The replacement of a single region of an artifact. - */ -@Generated("jsonschema2pojo") -public class Replacement { - - /** - * A region within an artifact where a result was detected. - * (Required) - */ - @SerializedName("deletedRegion") - @Expose - private Region deletedRegion; - /** - * Represents the contents of an artifact. - */ - @SerializedName("insertedContent") - @Expose - private ArtifactContent insertedContent; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Replacement() { - } - - /** - * @param insertedContent - * @param deletedRegion - * @param properties - */ - public Replacement(Region deletedRegion, ArtifactContent insertedContent, PropertyBag properties) { - super(); - this.deletedRegion = deletedRegion; - this.insertedContent = insertedContent; - this.properties = properties; - } - - /** - * A region within an artifact where a result was detected. - * (Required) - */ - public Region getDeletedRegion() { - return deletedRegion; - } - - /** - * A region within an artifact where a result was detected. - * (Required) - */ - public void setDeletedRegion(Region deletedRegion) { - this.deletedRegion = deletedRegion; - } - - public Replacement withDeletedRegion(Region deletedRegion) { - this.deletedRegion = deletedRegion; - return this; - } - - /** - * Represents the contents of an artifact. - */ - public ArtifactContent getInsertedContent() { - return insertedContent; - } - - /** - * Represents the contents of an artifact. - */ - public void setInsertedContent(ArtifactContent insertedContent) { - this.insertedContent = insertedContent; - } - - public Replacement withInsertedContent(ArtifactContent insertedContent) { - this.insertedContent = insertedContent; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Replacement withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Replacement.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("deletedRegion"); - sb.append('='); - sb.append(((this.deletedRegion == null) ? "" : this.deletedRegion)); - sb.append(','); - sb.append("insertedContent"); - sb.append('='); - sb.append(((this.insertedContent == null) ? "" : this.insertedContent)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.insertedContent == null) ? 0 : this.insertedContent.hashCode())); - result = ((result * 31) + ((this.deletedRegion == null) ? 0 : this.deletedRegion.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Replacement) == false) { - return false; - } - Replacement rhs = ((Replacement) other); - return ((((this.insertedContent == rhs.insertedContent) || ((this.insertedContent != null) && this.insertedContent.equals(rhs.insertedContent))) && ((this.deletedRegion == rhs.deletedRegion) || ((this.deletedRegion != null) && this.deletedRegion.equals(rhs.deletedRegion)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingConfiguration.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingConfiguration.java deleted file mode 100644 index 99c6506046..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingConfiguration.java +++ /dev/null @@ -1,269 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information about a rule or notification that can be configured at runtime. - */ -@Generated("jsonschema2pojo") -public class ReportingConfiguration { - - /** - * Specifies whether the report may be produced during the scan. - */ - @SerializedName("enabled") - @Expose - private boolean enabled = true; - /** - * Specifies the failure level for the report. - */ - @SerializedName("level") - @Expose - private ReportingConfiguration.Level level = ReportingConfiguration.Level.fromValue("warning"); - /** - * Specifies the relative priority of the report. Used for analysis output only. - */ - @SerializedName("rank") - @Expose - private double rank = -1.0D; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("parameters") - @Expose - private PropertyBag parameters; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ReportingConfiguration() { - } - - /** - * @param level - * @param rank - * @param parameters - * @param enabled - * @param properties - */ - public ReportingConfiguration(boolean enabled, ReportingConfiguration.Level level, double rank, PropertyBag parameters, PropertyBag properties) { - super(); - this.enabled = enabled; - this.level = level; - this.rank = rank; - this.parameters = parameters; - this.properties = properties; - } - - /** - * Specifies whether the report may be produced during the scan. - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Specifies whether the report may be produced during the scan. - */ - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public ReportingConfiguration withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Specifies the failure level for the report. - */ - public ReportingConfiguration.Level getLevel() { - return level; - } - - /** - * Specifies the failure level for the report. - */ - public void setLevel(ReportingConfiguration.Level level) { - this.level = level; - } - - public ReportingConfiguration withLevel(ReportingConfiguration.Level level) { - this.level = level; - return this; - } - - /** - * Specifies the relative priority of the report. Used for analysis output only. - */ - public double getRank() { - return rank; - } - - /** - * Specifies the relative priority of the report. Used for analysis output only. - */ - public void setRank(double rank) { - this.rank = rank; - } - - public ReportingConfiguration withRank(double rank) { - this.rank = rank; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getParameters() { - return parameters; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setParameters(PropertyBag parameters) { - this.parameters = parameters; - } - - public ReportingConfiguration withParameters(PropertyBag parameters) { - this.parameters = parameters; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ReportingConfiguration withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ReportingConfiguration.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("enabled"); - sb.append('='); - sb.append(this.enabled); - sb.append(','); - sb.append("level"); - sb.append('='); - sb.append(((this.level == null) ? "" : this.level)); - sb.append(','); - sb.append("rank"); - sb.append('='); - sb.append(this.rank); - sb.append(','); - sb.append("parameters"); - sb.append('='); - sb.append(((this.parameters == null) ? "" : this.parameters)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.rank) ^ (Double.doubleToLongBits(this.rank) >>> 32)))); - result = ((result * 31) + ((this.level == null) ? 0 : this.level.hashCode())); - result = ((result * 31) + ((this.parameters == null) ? 0 : this.parameters.hashCode())); - result = ((result * 31) + (this.enabled ? 1 : 0)); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ReportingConfiguration) == false) { - return false; - } - ReportingConfiguration rhs = ((ReportingConfiguration) other); - return (((((Double.doubleToLongBits(this.rank) == Double.doubleToLongBits(rhs.rank)) && ((this.level == rhs.level) || ((this.level != null) && this.level.equals(rhs.level)))) && ((this.parameters == rhs.parameters) || ((this.parameters != null) && this.parameters.equals(rhs.parameters)))) && (this.enabled == rhs.enabled)) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * Specifies the failure level for the report. - */ - @Generated("jsonschema2pojo") - public enum Level { - - @SerializedName("none") - NONE("none"), - @SerializedName("note") - NOTE("note"), - @SerializedName("warning") - WARNING("warning"), - @SerializedName("error") - ERROR("error"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (ReportingConfiguration.Level c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Level(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static ReportingConfiguration.Level fromValue(String value) { - ReportingConfiguration.Level constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptor.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptor.java deleted file mode 100644 index 278245b028..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptor.java +++ /dev/null @@ -1,513 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting. - */ -@Generated("jsonschema2pojo") -public class ReportingDescriptor { - - /** - * A stable, opaque identifier for the report. - * (Required) - */ - @SerializedName("id") - @Expose - private String id; - /** - * An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. - */ - @SerializedName("deprecatedIds") - @Expose - private Set deprecatedIds = new LinkedHashSet(); - /** - * A unique identifer for the reporting descriptor in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. - */ - @SerializedName("deprecatedGuids") - @Expose - private Set deprecatedGuids = new LinkedHashSet(); - /** - * A report identifier that is understandable to an end user. - */ - @SerializedName("name") - @Expose - private String name; - /** - * An array of readable identifiers by which this report was known in some previous version of the analysis tool. - */ - @SerializedName("deprecatedNames") - @Expose - private Set deprecatedNames = new LinkedHashSet(); - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("shortDescription") - @Expose - private MultiformatMessageString shortDescription; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("fullDescription") - @Expose - private MultiformatMessageString fullDescription; - /** - * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - @SerializedName("messageStrings") - @Expose - private MessageStrings messageStrings; - /** - * Information about a rule or notification that can be configured at runtime. - */ - @SerializedName("defaultConfiguration") - @Expose - private ReportingConfiguration defaultConfiguration; - /** - * A URI where the primary documentation for the report can be found. - */ - @SerializedName("helpUri") - @Expose - private URI helpUri; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("help") - @Expose - private MultiformatMessageString help; - /** - * An array of objects that describe relationships between this reporting descriptor and others. - */ - @SerializedName("relationships") - @Expose - private Set relationships = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ReportingDescriptor() { - } - - /** - * @param deprecatedIds - * @param deprecatedGuids - * @param shortDescription - * @param fullDescription - * @param helpUri - * @param defaultConfiguration - * @param help - * @param relationships - * @param messageStrings - * @param name - * @param guid - * @param deprecatedNames - * @param id - * @param properties - */ - public ReportingDescriptor(String id, Set deprecatedIds, String guid, Set deprecatedGuids, String name, Set deprecatedNames, MultiformatMessageString shortDescription, MultiformatMessageString fullDescription, MessageStrings messageStrings, ReportingConfiguration defaultConfiguration, URI helpUri, MultiformatMessageString help, Set relationships, PropertyBag properties) { - super(); - this.id = id; - this.deprecatedIds = deprecatedIds; - this.guid = guid; - this.deprecatedGuids = deprecatedGuids; - this.name = name; - this.deprecatedNames = deprecatedNames; - this.shortDescription = shortDescription; - this.fullDescription = fullDescription; - this.messageStrings = messageStrings; - this.defaultConfiguration = defaultConfiguration; - this.helpUri = helpUri; - this.help = help; - this.relationships = relationships; - this.properties = properties; - } - - /** - * A stable, opaque identifier for the report. - * (Required) - */ - public String getId() { - return id; - } - - /** - * A stable, opaque identifier for the report. - * (Required) - */ - public void setId(String id) { - this.id = id; - } - - public ReportingDescriptor withId(String id) { - this.id = id; - return this; - } - - /** - * An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. - */ - public Set getDeprecatedIds() { - return deprecatedIds; - } - - /** - * An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. - */ - public void setDeprecatedIds(Set deprecatedIds) { - this.deprecatedIds = deprecatedIds; - } - - public ReportingDescriptor withDeprecatedIds(Set deprecatedIds) { - this.deprecatedIds = deprecatedIds; - return this; - } - - /** - * A unique identifer for the reporting descriptor in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A unique identifer for the reporting descriptor in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ReportingDescriptor withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. - */ - public Set getDeprecatedGuids() { - return deprecatedGuids; - } - - /** - * An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. - */ - public void setDeprecatedGuids(Set deprecatedGuids) { - this.deprecatedGuids = deprecatedGuids; - } - - public ReportingDescriptor withDeprecatedGuids(Set deprecatedGuids) { - this.deprecatedGuids = deprecatedGuids; - return this; - } - - /** - * A report identifier that is understandable to an end user. - */ - public String getName() { - return name; - } - - /** - * A report identifier that is understandable to an end user. - */ - public void setName(String name) { - this.name = name; - } - - public ReportingDescriptor withName(String name) { - this.name = name; - return this; - } - - /** - * An array of readable identifiers by which this report was known in some previous version of the analysis tool. - */ - public Set getDeprecatedNames() { - return deprecatedNames; - } - - /** - * An array of readable identifiers by which this report was known in some previous version of the analysis tool. - */ - public void setDeprecatedNames(Set deprecatedNames) { - this.deprecatedNames = deprecatedNames; - } - - public ReportingDescriptor withDeprecatedNames(Set deprecatedNames) { - this.deprecatedNames = deprecatedNames; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getShortDescription() { - return shortDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - } - - public ReportingDescriptor withShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getFullDescription() { - return fullDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - } - - public ReportingDescriptor withFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - return this; - } - - /** - * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - public MessageStrings getMessageStrings() { - return messageStrings; - } - - /** - * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - public void setMessageStrings(MessageStrings messageStrings) { - this.messageStrings = messageStrings; - } - - public ReportingDescriptor withMessageStrings(MessageStrings messageStrings) { - this.messageStrings = messageStrings; - return this; - } - - /** - * Information about a rule or notification that can be configured at runtime. - */ - public ReportingConfiguration getDefaultConfiguration() { - return defaultConfiguration; - } - - /** - * Information about a rule or notification that can be configured at runtime. - */ - public void setDefaultConfiguration(ReportingConfiguration defaultConfiguration) { - this.defaultConfiguration = defaultConfiguration; - } - - public ReportingDescriptor withDefaultConfiguration(ReportingConfiguration defaultConfiguration) { - this.defaultConfiguration = defaultConfiguration; - return this; - } - - /** - * A URI where the primary documentation for the report can be found. - */ - public URI getHelpUri() { - return helpUri; - } - - /** - * A URI where the primary documentation for the report can be found. - */ - public void setHelpUri(URI helpUri) { - this.helpUri = helpUri; - } - - public ReportingDescriptor withHelpUri(URI helpUri) { - this.helpUri = helpUri; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getHelp() { - return help; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setHelp(MultiformatMessageString help) { - this.help = help; - } - - public ReportingDescriptor withHelp(MultiformatMessageString help) { - this.help = help; - return this; - } - - /** - * An array of objects that describe relationships between this reporting descriptor and others. - */ - public Set getRelationships() { - return relationships; - } - - /** - * An array of objects that describe relationships between this reporting descriptor and others. - */ - public void setRelationships(Set relationships) { - this.relationships = relationships; - } - - public ReportingDescriptor withRelationships(Set relationships) { - this.relationships = relationships; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ReportingDescriptor withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ReportingDescriptor.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("deprecatedIds"); - sb.append('='); - sb.append(((this.deprecatedIds == null) ? "" : this.deprecatedIds)); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("deprecatedGuids"); - sb.append('='); - sb.append(((this.deprecatedGuids == null) ? "" : this.deprecatedGuids)); - sb.append(','); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("deprecatedNames"); - sb.append('='); - sb.append(((this.deprecatedNames == null) ? "" : this.deprecatedNames)); - sb.append(','); - sb.append("shortDescription"); - sb.append('='); - sb.append(((this.shortDescription == null) ? "" : this.shortDescription)); - sb.append(','); - sb.append("fullDescription"); - sb.append('='); - sb.append(((this.fullDescription == null) ? "" : this.fullDescription)); - sb.append(','); - sb.append("messageStrings"); - sb.append('='); - sb.append(((this.messageStrings == null) ? "" : this.messageStrings)); - sb.append(','); - sb.append("defaultConfiguration"); - sb.append('='); - sb.append(((this.defaultConfiguration == null) ? "" : this.defaultConfiguration)); - sb.append(','); - sb.append("helpUri"); - sb.append('='); - sb.append(((this.helpUri == null) ? "" : this.helpUri)); - sb.append(','); - sb.append("help"); - sb.append('='); - sb.append(((this.help == null) ? "" : this.help)); - sb.append(','); - sb.append("relationships"); - sb.append('='); - sb.append(((this.relationships == null) ? "" : this.relationships)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.deprecatedIds == null) ? 0 : this.deprecatedIds.hashCode())); - result = ((result * 31) + ((this.deprecatedGuids == null) ? 0 : this.deprecatedGuids.hashCode())); - result = ((result * 31) + ((this.shortDescription == null) ? 0 : this.shortDescription.hashCode())); - result = ((result * 31) + ((this.fullDescription == null) ? 0 : this.fullDescription.hashCode())); - result = ((result * 31) + ((this.helpUri == null) ? 0 : this.helpUri.hashCode())); - result = ((result * 31) + ((this.defaultConfiguration == null) ? 0 : this.defaultConfiguration.hashCode())); - result = ((result * 31) + ((this.help == null) ? 0 : this.help.hashCode())); - result = ((result * 31) + ((this.relationships == null) ? 0 : this.relationships.hashCode())); - result = ((result * 31) + ((this.messageStrings == null) ? 0 : this.messageStrings.hashCode())); - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.deprecatedNames == null) ? 0 : this.deprecatedNames.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ReportingDescriptor) == false) { - return false; - } - ReportingDescriptor rhs = ((ReportingDescriptor) other); - return (((((((((((((((this.deprecatedIds == rhs.deprecatedIds) || ((this.deprecatedIds != null) && this.deprecatedIds.equals(rhs.deprecatedIds))) && ((this.deprecatedGuids == rhs.deprecatedGuids) || ((this.deprecatedGuids != null) && this.deprecatedGuids.equals(rhs.deprecatedGuids)))) && ((this.shortDescription == rhs.shortDescription) || ((this.shortDescription != null) && this.shortDescription.equals(rhs.shortDescription)))) && ((this.fullDescription == rhs.fullDescription) || ((this.fullDescription != null) && this.fullDescription.equals(rhs.fullDescription)))) && ((this.helpUri == rhs.helpUri) || ((this.helpUri != null) && this.helpUri.equals(rhs.helpUri)))) && ((this.defaultConfiguration == rhs.defaultConfiguration) || ((this.defaultConfiguration != null) && this.defaultConfiguration.equals(rhs.defaultConfiguration)))) && ((this.help == rhs.help) || ((this.help != null) && this.help.equals(rhs.help)))) && ((this.relationships == rhs.relationships) || ((this.relationships != null) && this.relationships.equals(rhs.relationships)))) && ((this.messageStrings == rhs.messageStrings) || ((this.messageStrings != null) && this.messageStrings.equals(rhs.messageStrings)))) && ((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name)))) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.deprecatedNames == rhs.deprecatedNames) || ((this.deprecatedNames != null) && this.deprecatedNames.equals(rhs.deprecatedNames)))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorReference.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorReference.java deleted file mode 100644 index 9fd676b0fa..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorReference.java +++ /dev/null @@ -1,219 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information about how to locate a relevant reporting descriptor. - */ -@Generated("jsonschema2pojo") -public class ReportingDescriptorReference { - - /** - * The id of the descriptor. - */ - @SerializedName("id") - @Expose - private String id; - /** - * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * A guid that uniquely identifies the descriptor. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - @SerializedName("toolComponent") - @Expose - private ToolComponentReference toolComponent; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ReportingDescriptorReference() { - } - - /** - * @param index - * @param guid - * @param toolComponent - * @param id - * @param properties - */ - public ReportingDescriptorReference(String id, int index, String guid, ToolComponentReference toolComponent, PropertyBag properties) { - super(); - this.id = id; - this.index = index; - this.guid = guid; - this.toolComponent = toolComponent; - this.properties = properties; - } - - /** - * The id of the descriptor. - */ - public String getId() { - return id; - } - - /** - * The id of the descriptor. - */ - public void setId(String id) { - this.id = id; - } - - public ReportingDescriptorReference withId(String id) { - this.id = id; - return this; - } - - /** - * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. - */ - public int getIndex() { - return index; - } - - /** - * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. - */ - public void setIndex(int index) { - this.index = index; - } - - public ReportingDescriptorReference withIndex(int index) { - this.index = index; - return this; - } - - /** - * A guid that uniquely identifies the descriptor. - */ - public String getGuid() { - return guid; - } - - /** - * A guid that uniquely identifies the descriptor. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ReportingDescriptorReference withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - public ToolComponentReference getToolComponent() { - return toolComponent; - } - - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - public void setToolComponent(ToolComponentReference toolComponent) { - this.toolComponent = toolComponent; - } - - public ReportingDescriptorReference withToolComponent(ToolComponentReference toolComponent) { - this.toolComponent = toolComponent; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ReportingDescriptorReference withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ReportingDescriptorReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("toolComponent"); - sb.append('='); - sb.append(((this.toolComponent == null) ? "" : this.toolComponent)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.toolComponent == null) ? 0 : this.toolComponent.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ReportingDescriptorReference) == false) { - return false; - } - ReportingDescriptorReference rhs = ((ReportingDescriptorReference) other); - return (((((this.index == rhs.index) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.toolComponent == rhs.toolComponent) || ((this.toolComponent != null) && this.toolComponent.equals(rhs.toolComponent)))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorRelationship.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorRelationship.java deleted file mode 100644 index cdbae97adb..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ReportingDescriptorRelationship.java +++ /dev/null @@ -1,193 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information about the relation of one reporting descriptor to another. - */ -@Generated("jsonschema2pojo") -public class ReportingDescriptorRelationship { - - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - @SerializedName("target") - @Expose - private ReportingDescriptorReference target; - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. - */ - @SerializedName("kinds") - @Expose - private Set kinds = new LinkedHashSet(Arrays.asList("relevant")); - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ReportingDescriptorRelationship() { - } - - /** - * @param description - * @param kinds - * @param properties - * @param target - */ - public ReportingDescriptorRelationship(ReportingDescriptorReference target, Set kinds, Message description, PropertyBag properties) { - super(); - this.target = target; - this.kinds = kinds; - this.description = description; - this.properties = properties; - } - - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - public ReportingDescriptorReference getTarget() { - return target; - } - - /** - * Information about how to locate a relevant reporting descriptor. - * (Required) - */ - public void setTarget(ReportingDescriptorReference target) { - this.target = target; - } - - public ReportingDescriptorRelationship withTarget(ReportingDescriptorReference target) { - this.target = target; - return this; - } - - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. - */ - public Set getKinds() { - return kinds; - } - - /** - * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. - */ - public void setKinds(Set kinds) { - this.kinds = kinds; - } - - public ReportingDescriptorRelationship withKinds(Set kinds) { - this.kinds = kinds; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public ReportingDescriptorRelationship withDescription(Message description) { - this.description = description; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ReportingDescriptorRelationship withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ReportingDescriptorRelationship.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("target"); - sb.append('='); - sb.append(((this.target == null) ? "" : this.target)); - sb.append(','); - sb.append("kinds"); - sb.append('='); - sb.append(((this.kinds == null) ? "" : this.kinds)); - sb.append(','); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.kinds == null) ? 0 : this.kinds.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.target == null) ? 0 : this.target.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ReportingDescriptorRelationship) == false) { - return false; - } - ReportingDescriptorRelationship rhs = ((ReportingDescriptorRelationship) other); - return (((((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description))) && ((this.kinds == rhs.kinds) || ((this.kinds != null) && this.kinds.equals(rhs.kinds)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.target == rhs.target) || ((this.target != null) && this.target.equals(rhs.target)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Result.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Result.java deleted file mode 100644 index 853f8872af..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Result.java +++ /dev/null @@ -1,1077 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A result produced by an analysis tool. - */ -@Generated("jsonschema2pojo") -public class Result { - - /** - * The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists. - */ - @SerializedName("ruleId") - @Expose - private String ruleId; - /** - * The index within the tool component rules array of the rule object associated with this result. - */ - @SerializedName("ruleIndex") - @Expose - private int ruleIndex = -1; - /** - * Information about how to locate a relevant reporting descriptor. - */ - @SerializedName("rule") - @Expose - private ReportingDescriptorReference rule; - /** - * A value that categorizes results by evaluation state. - */ - @SerializedName("kind") - @Expose - private Object kind = null; - /** - * A value specifying the severity level of the result. - */ - @SerializedName("level") - @Expose - private Object level = null; - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - @SerializedName("message") - @Expose - private Message message; - /** - * Specifies the location of an artifact. - */ - @SerializedName("analysisTarget") - @Expose - private ArtifactLocation analysisTarget; - /** - * The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. - */ - @SerializedName("locations") - @Expose - private List locations = new ArrayList(); - /** - * A stable, unique identifer for the result in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. - */ - @SerializedName("correlationGuid") - @Expose - private String correlationGuid; - /** - * A positive integer specifying the number of times this logically unique result was observed in this run. - */ - @SerializedName("occurrenceCount") - @Expose - private int occurrenceCount; - /** - * A set of strings that contribute to the stable, unique identity of the result. - */ - @SerializedName("partialFingerprints") - @Expose - private PartialFingerprints partialFingerprints; - /** - * A set of strings each of which individually defines a stable, unique identity for the result. - */ - @SerializedName("fingerprints") - @Expose - private Fingerprints fingerprints; - /** - * An array of 'stack' objects relevant to the result. - */ - @SerializedName("stacks") - @Expose - private Set stacks = new LinkedHashSet(); - /** - * An array of 'codeFlow' objects relevant to the result. - */ - @SerializedName("codeFlows") - @Expose - private List codeFlows = new ArrayList(); - /** - * An array of zero or more unique graph objects associated with the result. - */ - @SerializedName("graphs") - @Expose - private Set graphs = new LinkedHashSet(); - /** - * An array of one or more unique 'graphTraversal' objects. - */ - @SerializedName("graphTraversals") - @Expose - private Set graphTraversals = new LinkedHashSet(); - /** - * A set of locations relevant to this result. - */ - @SerializedName("relatedLocations") - @Expose - private Set relatedLocations = new LinkedHashSet(); - /** - * A set of suppressions relevant to this result. - */ - @SerializedName("suppressions") - @Expose - private Set suppressions = new LinkedHashSet(); - /** - * The state of a result relative to a baseline of a previous run. - */ - @SerializedName("baselineState") - @Expose - private Result.BaselineState baselineState; - /** - * A number representing the priority or importance of the result. - */ - @SerializedName("rank") - @Expose - private double rank = -1.0D; - /** - * A set of artifacts relevant to the result. - */ - @SerializedName("attachments") - @Expose - private Set attachments = new LinkedHashSet(); - /** - * An absolute URI at which the result can be viewed. - */ - @SerializedName("hostedViewerUri") - @Expose - private URI hostedViewerUri; - /** - * The URIs of the work items associated with this result. - */ - @SerializedName("workItemUris") - @Expose - private Set workItemUris = new LinkedHashSet(); - /** - * Contains information about how and when a result was detected. - */ - @SerializedName("provenance") - @Expose - private ResultProvenance provenance; - /** - * An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. - */ - @SerializedName("fixes") - @Expose - private Set fixes = new LinkedHashSet(); - /** - * An array of references to taxonomy reporting descriptors that are applicable to the result. - */ - @SerializedName("taxa") - @Expose - private Set taxa = new LinkedHashSet(); - /** - * Describes an HTTP request. - */ - @SerializedName("webRequest") - @Expose - private WebRequest webRequest; - /** - * Describes the response to an HTTP request. - */ - @SerializedName("webResponse") - @Expose - private WebResponse webResponse; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Result() { - } - - /** - * @param attachments - * @param correlationGuid - * @param webRequest - * @param graphTraversals - * @param rule - * @param analysisTarget - * @param fixes - * @param relatedLocations - * @param graphs - * @param provenance - * @param rank - * @param ruleId - * @param taxa - * @param ruleIndex - * @param suppressions - * @param level - * @param hostedViewerUri - * @param kind - * @param stacks - * @param occurrenceCount - * @param message - * @param fingerprints - * @param codeFlows - * @param guid - * @param partialFingerprints - * @param webResponse - * @param locations - * @param baselineState - * @param workItemUris - * @param properties - */ - public Result(String ruleId, int ruleIndex, ReportingDescriptorReference rule, Object kind, Object level, Message message, ArtifactLocation analysisTarget, List locations, String guid, String correlationGuid, int occurrenceCount, PartialFingerprints partialFingerprints, Fingerprints fingerprints, Set stacks, List codeFlows, Set graphs, Set graphTraversals, Set relatedLocations, Set suppressions, Result.BaselineState baselineState, double rank, Set attachments, URI hostedViewerUri, Set workItemUris, ResultProvenance provenance, Set fixes, Set taxa, WebRequest webRequest, WebResponse webResponse, PropertyBag properties) { - super(); - this.ruleId = ruleId; - this.ruleIndex = ruleIndex; - this.rule = rule; - this.kind = kind; - this.level = level; - this.message = message; - this.analysisTarget = analysisTarget; - this.locations = locations; - this.guid = guid; - this.correlationGuid = correlationGuid; - this.occurrenceCount = occurrenceCount; - this.partialFingerprints = partialFingerprints; - this.fingerprints = fingerprints; - this.stacks = stacks; - this.codeFlows = codeFlows; - this.graphs = graphs; - this.graphTraversals = graphTraversals; - this.relatedLocations = relatedLocations; - this.suppressions = suppressions; - this.baselineState = baselineState; - this.rank = rank; - this.attachments = attachments; - this.hostedViewerUri = hostedViewerUri; - this.workItemUris = workItemUris; - this.provenance = provenance; - this.fixes = fixes; - this.taxa = taxa; - this.webRequest = webRequest; - this.webResponse = webResponse; - this.properties = properties; - } - - /** - * The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists. - */ - public String getRuleId() { - return ruleId; - } - - /** - * The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists. - */ - public void setRuleId(String ruleId) { - this.ruleId = ruleId; - } - - public Result withRuleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * The index within the tool component rules array of the rule object associated with this result. - */ - public int getRuleIndex() { - return ruleIndex; - } - - /** - * The index within the tool component rules array of the rule object associated with this result. - */ - public void setRuleIndex(int ruleIndex) { - this.ruleIndex = ruleIndex; - } - - public Result withRuleIndex(int ruleIndex) { - this.ruleIndex = ruleIndex; - return this; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public ReportingDescriptorReference getRule() { - return rule; - } - - /** - * Information about how to locate a relevant reporting descriptor. - */ - public void setRule(ReportingDescriptorReference rule) { - this.rule = rule; - } - - public Result withRule(ReportingDescriptorReference rule) { - this.rule = rule; - return this; - } - - /** - * A value that categorizes results by evaluation state. - */ - public Object getKind() { - return kind; - } - - /** - * A value that categorizes results by evaluation state. - */ - public void setKind(Object kind) { - this.kind = kind; - } - - public Result withKind(Object kind) { - this.kind = kind; - return this; - } - - /** - * A value specifying the severity level of the result. - */ - public Object getLevel() { - return level; - } - - /** - * A value specifying the severity level of the result. - */ - public void setLevel(Object level) { - this.level = level; - } - - public Result withLevel(Object level) { - this.level = level; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - * (Required) - */ - public void setMessage(Message message) { - this.message = message; - } - - public Result withMessage(Message message) { - this.message = message; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getAnalysisTarget() { - return analysisTarget; - } - - /** - * Specifies the location of an artifact. - */ - public void setAnalysisTarget(ArtifactLocation analysisTarget) { - this.analysisTarget = analysisTarget; - } - - public Result withAnalysisTarget(ArtifactLocation analysisTarget) { - this.analysisTarget = analysisTarget; - return this; - } - - /** - * The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. - */ - public List getLocations() { - return locations; - } - - /** - * The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. - */ - public void setLocations(List locations) { - this.locations = locations; - } - - public Result withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * A stable, unique identifer for the result in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A stable, unique identifer for the result in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public Result withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. - */ - public String getCorrelationGuid() { - return correlationGuid; - } - - /** - * A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. - */ - public void setCorrelationGuid(String correlationGuid) { - this.correlationGuid = correlationGuid; - } - - public Result withCorrelationGuid(String correlationGuid) { - this.correlationGuid = correlationGuid; - return this; - } - - /** - * A positive integer specifying the number of times this logically unique result was observed in this run. - */ - public int getOccurrenceCount() { - return occurrenceCount; - } - - /** - * A positive integer specifying the number of times this logically unique result was observed in this run. - */ - public void setOccurrenceCount(int occurrenceCount) { - this.occurrenceCount = occurrenceCount; - } - - public Result withOccurrenceCount(int occurrenceCount) { - this.occurrenceCount = occurrenceCount; - return this; - } - - /** - * A set of strings that contribute to the stable, unique identity of the result. - */ - public PartialFingerprints getPartialFingerprints() { - return partialFingerprints; - } - - /** - * A set of strings that contribute to the stable, unique identity of the result. - */ - public void setPartialFingerprints(PartialFingerprints partialFingerprints) { - this.partialFingerprints = partialFingerprints; - } - - public Result withPartialFingerprints(PartialFingerprints partialFingerprints) { - this.partialFingerprints = partialFingerprints; - return this; - } - - /** - * A set of strings each of which individually defines a stable, unique identity for the result. - */ - public Fingerprints getFingerprints() { - return fingerprints; - } - - /** - * A set of strings each of which individually defines a stable, unique identity for the result. - */ - public void setFingerprints(Fingerprints fingerprints) { - this.fingerprints = fingerprints; - } - - public Result withFingerprints(Fingerprints fingerprints) { - this.fingerprints = fingerprints; - return this; - } - - /** - * An array of 'stack' objects relevant to the result. - */ - public Set getStacks() { - return stacks; - } - - /** - * An array of 'stack' objects relevant to the result. - */ - public void setStacks(Set stacks) { - this.stacks = stacks; - } - - public Result withStacks(Set stacks) { - this.stacks = stacks; - return this; - } - - /** - * An array of 'codeFlow' objects relevant to the result. - */ - public List getCodeFlows() { - return codeFlows; - } - - /** - * An array of 'codeFlow' objects relevant to the result. - */ - public void setCodeFlows(List codeFlows) { - this.codeFlows = codeFlows; - } - - public Result withCodeFlows(List codeFlows) { - this.codeFlows = codeFlows; - return this; - } - - /** - * An array of zero or more unique graph objects associated with the result. - */ - public Set getGraphs() { - return graphs; - } - - /** - * An array of zero or more unique graph objects associated with the result. - */ - public void setGraphs(Set graphs) { - this.graphs = graphs; - } - - public Result withGraphs(Set graphs) { - this.graphs = graphs; - return this; - } - - /** - * An array of one or more unique 'graphTraversal' objects. - */ - public Set getGraphTraversals() { - return graphTraversals; - } - - /** - * An array of one or more unique 'graphTraversal' objects. - */ - public void setGraphTraversals(Set graphTraversals) { - this.graphTraversals = graphTraversals; - } - - public Result withGraphTraversals(Set graphTraversals) { - this.graphTraversals = graphTraversals; - return this; - } - - /** - * A set of locations relevant to this result. - */ - public Set getRelatedLocations() { - return relatedLocations; - } - - /** - * A set of locations relevant to this result. - */ - public void setRelatedLocations(Set relatedLocations) { - this.relatedLocations = relatedLocations; - } - - public Result withRelatedLocations(Set relatedLocations) { - this.relatedLocations = relatedLocations; - return this; - } - - /** - * A set of suppressions relevant to this result. - */ - public Set getSuppressions() { - return suppressions; - } - - /** - * A set of suppressions relevant to this result. - */ - public void setSuppressions(Set suppressions) { - this.suppressions = suppressions; - } - - public Result withSuppressions(Set suppressions) { - this.suppressions = suppressions; - return this; - } - - /** - * The state of a result relative to a baseline of a previous run. - */ - public Result.BaselineState getBaselineState() { - return baselineState; - } - - /** - * The state of a result relative to a baseline of a previous run. - */ - public void setBaselineState(Result.BaselineState baselineState) { - this.baselineState = baselineState; - } - - public Result withBaselineState(Result.BaselineState baselineState) { - this.baselineState = baselineState; - return this; - } - - /** - * A number representing the priority or importance of the result. - */ - public double getRank() { - return rank; - } - - /** - * A number representing the priority or importance of the result. - */ - public void setRank(double rank) { - this.rank = rank; - } - - public Result withRank(double rank) { - this.rank = rank; - return this; - } - - /** - * A set of artifacts relevant to the result. - */ - public Set getAttachments() { - return attachments; - } - - /** - * A set of artifacts relevant to the result. - */ - public void setAttachments(Set attachments) { - this.attachments = attachments; - } - - public Result withAttachments(Set attachments) { - this.attachments = attachments; - return this; - } - - /** - * An absolute URI at which the result can be viewed. - */ - public URI getHostedViewerUri() { - return hostedViewerUri; - } - - /** - * An absolute URI at which the result can be viewed. - */ - public void setHostedViewerUri(URI hostedViewerUri) { - this.hostedViewerUri = hostedViewerUri; - } - - public Result withHostedViewerUri(URI hostedViewerUri) { - this.hostedViewerUri = hostedViewerUri; - return this; - } - - /** - * The URIs of the work items associated with this result. - */ - public Set getWorkItemUris() { - return workItemUris; - } - - /** - * The URIs of the work items associated with this result. - */ - public void setWorkItemUris(Set workItemUris) { - this.workItemUris = workItemUris; - } - - public Result withWorkItemUris(Set workItemUris) { - this.workItemUris = workItemUris; - return this; - } - - /** - * Contains information about how and when a result was detected. - */ - public ResultProvenance getProvenance() { - return provenance; - } - - /** - * Contains information about how and when a result was detected. - */ - public void setProvenance(ResultProvenance provenance) { - this.provenance = provenance; - } - - public Result withProvenance(ResultProvenance provenance) { - this.provenance = provenance; - return this; - } - - /** - * An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. - */ - public Set getFixes() { - return fixes; - } - - /** - * An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. - */ - public void setFixes(Set fixes) { - this.fixes = fixes; - } - - public Result withFixes(Set fixes) { - this.fixes = fixes; - return this; - } - - /** - * An array of references to taxonomy reporting descriptors that are applicable to the result. - */ - public Set getTaxa() { - return taxa; - } - - /** - * An array of references to taxonomy reporting descriptors that are applicable to the result. - */ - public void setTaxa(Set taxa) { - this.taxa = taxa; - } - - public Result withTaxa(Set taxa) { - this.taxa = taxa; - return this; - } - - /** - * Describes an HTTP request. - */ - public WebRequest getWebRequest() { - return webRequest; - } - - /** - * Describes an HTTP request. - */ - public void setWebRequest(WebRequest webRequest) { - this.webRequest = webRequest; - } - - public Result withWebRequest(WebRequest webRequest) { - this.webRequest = webRequest; - return this; - } - - /** - * Describes the response to an HTTP request. - */ - public WebResponse getWebResponse() { - return webResponse; - } - - /** - * Describes the response to an HTTP request. - */ - public void setWebResponse(WebResponse webResponse) { - this.webResponse = webResponse; - } - - public Result withWebResponse(WebResponse webResponse) { - this.webResponse = webResponse; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Result withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Result.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("ruleId"); - sb.append('='); - sb.append(((this.ruleId == null) ? "" : this.ruleId)); - sb.append(','); - sb.append("ruleIndex"); - sb.append('='); - sb.append(this.ruleIndex); - sb.append(','); - sb.append("rule"); - sb.append('='); - sb.append(((this.rule == null) ? "" : this.rule)); - sb.append(','); - sb.append("kind"); - sb.append('='); - sb.append(((this.kind == null) ? "" : this.kind)); - sb.append(','); - sb.append("level"); - sb.append('='); - sb.append(((this.level == null) ? "" : this.level)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("analysisTarget"); - sb.append('='); - sb.append(((this.analysisTarget == null) ? "" : this.analysisTarget)); - sb.append(','); - sb.append("locations"); - sb.append('='); - sb.append(((this.locations == null) ? "" : this.locations)); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("correlationGuid"); - sb.append('='); - sb.append(((this.correlationGuid == null) ? "" : this.correlationGuid)); - sb.append(','); - sb.append("occurrenceCount"); - sb.append('='); - sb.append(this.occurrenceCount); - sb.append(','); - sb.append("partialFingerprints"); - sb.append('='); - sb.append(((this.partialFingerprints == null) ? "" : this.partialFingerprints)); - sb.append(','); - sb.append("fingerprints"); - sb.append('='); - sb.append(((this.fingerprints == null) ? "" : this.fingerprints)); - sb.append(','); - sb.append("stacks"); - sb.append('='); - sb.append(((this.stacks == null) ? "" : this.stacks)); - sb.append(','); - sb.append("codeFlows"); - sb.append('='); - sb.append(((this.codeFlows == null) ? "" : this.codeFlows)); - sb.append(','); - sb.append("graphs"); - sb.append('='); - sb.append(((this.graphs == null) ? "" : this.graphs)); - sb.append(','); - sb.append("graphTraversals"); - sb.append('='); - sb.append(((this.graphTraversals == null) ? "" : this.graphTraversals)); - sb.append(','); - sb.append("relatedLocations"); - sb.append('='); - sb.append(((this.relatedLocations == null) ? "" : this.relatedLocations)); - sb.append(','); - sb.append("suppressions"); - sb.append('='); - sb.append(((this.suppressions == null) ? "" : this.suppressions)); - sb.append(','); - sb.append("baselineState"); - sb.append('='); - sb.append(((this.baselineState == null) ? "" : this.baselineState)); - sb.append(','); - sb.append("rank"); - sb.append('='); - sb.append(this.rank); - sb.append(','); - sb.append("attachments"); - sb.append('='); - sb.append(((this.attachments == null) ? "" : this.attachments)); - sb.append(','); - sb.append("hostedViewerUri"); - sb.append('='); - sb.append(((this.hostedViewerUri == null) ? "" : this.hostedViewerUri)); - sb.append(','); - sb.append("workItemUris"); - sb.append('='); - sb.append(((this.workItemUris == null) ? "" : this.workItemUris)); - sb.append(','); - sb.append("provenance"); - sb.append('='); - sb.append(((this.provenance == null) ? "" : this.provenance)); - sb.append(','); - sb.append("fixes"); - sb.append('='); - sb.append(((this.fixes == null) ? "" : this.fixes)); - sb.append(','); - sb.append("taxa"); - sb.append('='); - sb.append(((this.taxa == null) ? "" : this.taxa)); - sb.append(','); - sb.append("webRequest"); - sb.append('='); - sb.append(((this.webRequest == null) ? "" : this.webRequest)); - sb.append(','); - sb.append("webResponse"); - sb.append('='); - sb.append(((this.webResponse == null) ? "" : this.webResponse)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.attachments == null) ? 0 : this.attachments.hashCode())); - result = ((result * 31) + ((this.correlationGuid == null) ? 0 : this.correlationGuid.hashCode())); - result = ((result * 31) + ((this.webRequest == null) ? 0 : this.webRequest.hashCode())); - result = ((result * 31) + ((this.graphTraversals == null) ? 0 : this.graphTraversals.hashCode())); - result = ((result * 31) + ((this.rule == null) ? 0 : this.rule.hashCode())); - result = ((result * 31) + ((this.analysisTarget == null) ? 0 : this.analysisTarget.hashCode())); - result = ((result * 31) + ((this.fixes == null) ? 0 : this.fixes.hashCode())); - result = ((result * 31) + ((this.relatedLocations == null) ? 0 : this.relatedLocations.hashCode())); - result = ((result * 31) + ((this.graphs == null) ? 0 : this.graphs.hashCode())); - result = ((result * 31) + ((this.provenance == null) ? 0 : this.provenance.hashCode())); - result = ((result * 31) + ((int) (Double.doubleToLongBits(this.rank) ^ (Double.doubleToLongBits(this.rank) >>> 32)))); - result = ((result * 31) + ((this.ruleId == null) ? 0 : this.ruleId.hashCode())); - result = ((result * 31) + ((this.taxa == null) ? 0 : this.taxa.hashCode())); - result = ((result * 31) + this.ruleIndex); - result = ((result * 31) + ((this.suppressions == null) ? 0 : this.suppressions.hashCode())); - result = ((result * 31) + ((this.level == null) ? 0 : this.level.hashCode())); - result = ((result * 31) + ((this.hostedViewerUri == null) ? 0 : this.hostedViewerUri.hashCode())); - result = ((result * 31) + ((this.kind == null) ? 0 : this.kind.hashCode())); - result = ((result * 31) + ((this.stacks == null) ? 0 : this.stacks.hashCode())); - result = ((result * 31) + this.occurrenceCount); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.fingerprints == null) ? 0 : this.fingerprints.hashCode())); - result = ((result * 31) + ((this.codeFlows == null) ? 0 : this.codeFlows.hashCode())); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.partialFingerprints == null) ? 0 : this.partialFingerprints.hashCode())); - result = ((result * 31) + ((this.webResponse == null) ? 0 : this.webResponse.hashCode())); - result = ((result * 31) + ((this.locations == null) ? 0 : this.locations.hashCode())); - result = ((result * 31) + ((this.baselineState == null) ? 0 : this.baselineState.hashCode())); - result = ((result * 31) + ((this.workItemUris == null) ? 0 : this.workItemUris.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Result) == false) { - return false; - } - Result rhs = ((Result) other); - return (((((((((((((((((((((((((((((((this.attachments == rhs.attachments) || ((this.attachments != null) && this.attachments.equals(rhs.attachments))) && ((this.correlationGuid == rhs.correlationGuid) || ((this.correlationGuid != null) && this.correlationGuid.equals(rhs.correlationGuid)))) && ((this.webRequest == rhs.webRequest) || ((this.webRequest != null) && this.webRequest.equals(rhs.webRequest)))) && ((this.graphTraversals == rhs.graphTraversals) || ((this.graphTraversals != null) && this.graphTraversals.equals(rhs.graphTraversals)))) && ((this.rule == rhs.rule) || ((this.rule != null) && this.rule.equals(rhs.rule)))) && ((this.analysisTarget == rhs.analysisTarget) || ((this.analysisTarget != null) && this.analysisTarget.equals(rhs.analysisTarget)))) && ((this.fixes == rhs.fixes) || ((this.fixes != null) && this.fixes.equals(rhs.fixes)))) && ((this.relatedLocations == rhs.relatedLocations) || ((this.relatedLocations != null) && this.relatedLocations.equals(rhs.relatedLocations)))) && ((this.graphs == rhs.graphs) || ((this.graphs != null) && this.graphs.equals(rhs.graphs)))) && ((this.provenance == rhs.provenance) || ((this.provenance != null) && this.provenance.equals(rhs.provenance)))) && (Double.doubleToLongBits(this.rank) == Double.doubleToLongBits(rhs.rank))) && ((this.ruleId == rhs.ruleId) || ((this.ruleId != null) && this.ruleId.equals(rhs.ruleId)))) && ((this.taxa == rhs.taxa) || ((this.taxa != null) && this.taxa.equals(rhs.taxa)))) && (this.ruleIndex == rhs.ruleIndex)) && ((this.suppressions == rhs.suppressions) || ((this.suppressions != null) && this.suppressions.equals(rhs.suppressions)))) && ((this.level == rhs.level) || ((this.level != null) && this.level.equals(rhs.level)))) && ((this.hostedViewerUri == rhs.hostedViewerUri) || ((this.hostedViewerUri != null) && this.hostedViewerUri.equals(rhs.hostedViewerUri)))) && ((this.kind == rhs.kind) || ((this.kind != null) && this.kind.equals(rhs.kind)))) && ((this.stacks == rhs.stacks) || ((this.stacks != null) && this.stacks.equals(rhs.stacks)))) && (this.occurrenceCount == rhs.occurrenceCount)) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.fingerprints == rhs.fingerprints) || ((this.fingerprints != null) && this.fingerprints.equals(rhs.fingerprints)))) && ((this.codeFlows == rhs.codeFlows) || ((this.codeFlows != null) && this.codeFlows.equals(rhs.codeFlows)))) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.partialFingerprints == rhs.partialFingerprints) || ((this.partialFingerprints != null) && this.partialFingerprints.equals(rhs.partialFingerprints)))) && ((this.webResponse == rhs.webResponse) || ((this.webResponse != null) && this.webResponse.equals(rhs.webResponse)))) && ((this.locations == rhs.locations) || ((this.locations != null) && this.locations.equals(rhs.locations)))) && ((this.baselineState == rhs.baselineState) || ((this.baselineState != null) && this.baselineState.equals(rhs.baselineState)))) && ((this.workItemUris == rhs.workItemUris) || ((this.workItemUris != null) && this.workItemUris.equals(rhs.workItemUris)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * The state of a result relative to a baseline of a previous run. - */ - @Generated("jsonschema2pojo") - public enum BaselineState { - - @SerializedName("new") - NEW("new"), - @SerializedName("unchanged") - UNCHANGED("unchanged"), - @SerializedName("updated") - UPDATED("updated"), - @SerializedName("absent") - ABSENT("absent"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Result.BaselineState c : values()) { - CONSTANTS.put(c.value, c); - } - } - - BaselineState(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Result.BaselineState fromValue(String value) { - Result.BaselineState constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ResultProvenance.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ResultProvenance.java deleted file mode 100644 index d251071cf4..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ResultProvenance.java +++ /dev/null @@ -1,286 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Contains information about how and when a result was detected. - */ -@Generated("jsonschema2pojo") -public class ResultProvenance { - - /** - * The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. - */ - @SerializedName("firstDetectionTimeUtc") - @Expose - private Date firstDetectionTimeUtc; - /** - * The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. - */ - @SerializedName("lastDetectionTimeUtc") - @Expose - private Date lastDetectionTimeUtc; - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. - */ - @SerializedName("firstDetectionRunGuid") - @Expose - private String firstDetectionRunGuid; - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. - */ - @SerializedName("lastDetectionRunGuid") - @Expose - private String lastDetectionRunGuid; - /** - * The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. - */ - @SerializedName("invocationIndex") - @Expose - private int invocationIndex = -1; - /** - * An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. - */ - @SerializedName("conversionSources") - @Expose - private Set conversionSources = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ResultProvenance() { - } - - /** - * @param firstDetectionRunGuid - * @param lastDetectionTimeUtc - * @param invocationIndex - * @param lastDetectionRunGuid - * @param conversionSources - * @param firstDetectionTimeUtc - * @param properties - */ - public ResultProvenance(Date firstDetectionTimeUtc, Date lastDetectionTimeUtc, String firstDetectionRunGuid, String lastDetectionRunGuid, int invocationIndex, Set conversionSources, PropertyBag properties) { - super(); - this.firstDetectionTimeUtc = firstDetectionTimeUtc; - this.lastDetectionTimeUtc = lastDetectionTimeUtc; - this.firstDetectionRunGuid = firstDetectionRunGuid; - this.lastDetectionRunGuid = lastDetectionRunGuid; - this.invocationIndex = invocationIndex; - this.conversionSources = conversionSources; - this.properties = properties; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. - */ - public Date getFirstDetectionTimeUtc() { - return firstDetectionTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. - */ - public void setFirstDetectionTimeUtc(Date firstDetectionTimeUtc) { - this.firstDetectionTimeUtc = firstDetectionTimeUtc; - } - - public ResultProvenance withFirstDetectionTimeUtc(Date firstDetectionTimeUtc) { - this.firstDetectionTimeUtc = firstDetectionTimeUtc; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. - */ - public Date getLastDetectionTimeUtc() { - return lastDetectionTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. - */ - public void setLastDetectionTimeUtc(Date lastDetectionTimeUtc) { - this.lastDetectionTimeUtc = lastDetectionTimeUtc; - } - - public ResultProvenance withLastDetectionTimeUtc(Date lastDetectionTimeUtc) { - this.lastDetectionTimeUtc = lastDetectionTimeUtc; - return this; - } - - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. - */ - public String getFirstDetectionRunGuid() { - return firstDetectionRunGuid; - } - - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. - */ - public void setFirstDetectionRunGuid(String firstDetectionRunGuid) { - this.firstDetectionRunGuid = firstDetectionRunGuid; - } - - public ResultProvenance withFirstDetectionRunGuid(String firstDetectionRunGuid) { - this.firstDetectionRunGuid = firstDetectionRunGuid; - return this; - } - - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. - */ - public String getLastDetectionRunGuid() { - return lastDetectionRunGuid; - } - - /** - * A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. - */ - public void setLastDetectionRunGuid(String lastDetectionRunGuid) { - this.lastDetectionRunGuid = lastDetectionRunGuid; - } - - public ResultProvenance withLastDetectionRunGuid(String lastDetectionRunGuid) { - this.lastDetectionRunGuid = lastDetectionRunGuid; - return this; - } - - /** - * The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. - */ - public int getInvocationIndex() { - return invocationIndex; - } - - /** - * The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. - */ - public void setInvocationIndex(int invocationIndex) { - this.invocationIndex = invocationIndex; - } - - public ResultProvenance withInvocationIndex(int invocationIndex) { - this.invocationIndex = invocationIndex; - return this; - } - - /** - * An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. - */ - public Set getConversionSources() { - return conversionSources; - } - - /** - * An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. - */ - public void setConversionSources(Set conversionSources) { - this.conversionSources = conversionSources; - } - - public ResultProvenance withConversionSources(Set conversionSources) { - this.conversionSources = conversionSources; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ResultProvenance withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ResultProvenance.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("firstDetectionTimeUtc"); - sb.append('='); - sb.append(((this.firstDetectionTimeUtc == null) ? "" : this.firstDetectionTimeUtc)); - sb.append(','); - sb.append("lastDetectionTimeUtc"); - sb.append('='); - sb.append(((this.lastDetectionTimeUtc == null) ? "" : this.lastDetectionTimeUtc)); - sb.append(','); - sb.append("firstDetectionRunGuid"); - sb.append('='); - sb.append(((this.firstDetectionRunGuid == null) ? "" : this.firstDetectionRunGuid)); - sb.append(','); - sb.append("lastDetectionRunGuid"); - sb.append('='); - sb.append(((this.lastDetectionRunGuid == null) ? "" : this.lastDetectionRunGuid)); - sb.append(','); - sb.append("invocationIndex"); - sb.append('='); - sb.append(this.invocationIndex); - sb.append(','); - sb.append("conversionSources"); - sb.append('='); - sb.append(((this.conversionSources == null) ? "" : this.conversionSources)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.firstDetectionRunGuid == null) ? 0 : this.firstDetectionRunGuid.hashCode())); - result = ((result * 31) + ((this.lastDetectionTimeUtc == null) ? 0 : this.lastDetectionTimeUtc.hashCode())); - result = ((result * 31) + this.invocationIndex); - result = ((result * 31) + ((this.lastDetectionRunGuid == null) ? 0 : this.lastDetectionRunGuid.hashCode())); - result = ((result * 31) + ((this.conversionSources == null) ? 0 : this.conversionSources.hashCode())); - result = ((result * 31) + ((this.firstDetectionTimeUtc == null) ? 0 : this.firstDetectionTimeUtc.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ResultProvenance) == false) { - return false; - } - ResultProvenance rhs = ((ResultProvenance) other); - return ((((((((this.firstDetectionRunGuid == rhs.firstDetectionRunGuid) || ((this.firstDetectionRunGuid != null) && this.firstDetectionRunGuid.equals(rhs.firstDetectionRunGuid))) && ((this.lastDetectionTimeUtc == rhs.lastDetectionTimeUtc) || ((this.lastDetectionTimeUtc != null) && this.lastDetectionTimeUtc.equals(rhs.lastDetectionTimeUtc)))) && (this.invocationIndex == rhs.invocationIndex)) && ((this.lastDetectionRunGuid == rhs.lastDetectionRunGuid) || ((this.lastDetectionRunGuid != null) && this.lastDetectionRunGuid.equals(rhs.lastDetectionRunGuid)))) && ((this.conversionSources == rhs.conversionSources) || ((this.conversionSources != null) && this.conversionSources.equals(rhs.conversionSources)))) && ((this.firstDetectionTimeUtc == rhs.firstDetectionTimeUtc) || ((this.firstDetectionTimeUtc != null) && this.firstDetectionTimeUtc.equals(rhs.firstDetectionTimeUtc)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Role.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Role.java deleted file mode 100644 index 047642473f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Role.java +++ /dev/null @@ -1,90 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.SerializedName; - -@Generated("jsonschema2pojo") -public enum Role { - - @SerializedName("analysisTarget") - ANALYSIS_TARGET("analysisTarget"), - @SerializedName("attachment") - ATTACHMENT("attachment"), - @SerializedName("responseFile") - RESPONSE_FILE("responseFile"), - @SerializedName("resultFile") - RESULT_FILE("resultFile"), - @SerializedName("standardStream") - STANDARD_STREAM("standardStream"), - @SerializedName("tracedFile") - TRACED_FILE("tracedFile"), - @SerializedName("unmodified") - UNMODIFIED("unmodified"), - @SerializedName("modified") - MODIFIED("modified"), - @SerializedName("added") - ADDED("added"), - @SerializedName("deleted") - DELETED("deleted"), - @SerializedName("renamed") - RENAMED("renamed"), - @SerializedName("uncontrolled") - UNCONTROLLED("uncontrolled"), - @SerializedName("driver") - DRIVER("driver"), - @SerializedName("extension") - EXTENSION("extension"), - @SerializedName("translation") - TRANSLATION("translation"), - @SerializedName("taxonomy") - TAXONOMY("taxonomy"), - @SerializedName("policy") - POLICY("policy"), - @SerializedName("referencedOnCommandLine") - REFERENCED_ON_COMMAND_LINE("referencedOnCommandLine"), - @SerializedName("memoryContents") - MEMORY_CONTENTS("memoryContents"), - @SerializedName("directory") - DIRECTORY("directory"), - @SerializedName("userSpecifiedConfiguration") - USER_SPECIFIED_CONFIGURATION("userSpecifiedConfiguration"), - @SerializedName("toolSpecifiedConfiguration") - TOOL_SPECIFIED_CONFIGURATION("toolSpecifiedConfiguration"), - @SerializedName("debugOutputFile") - DEBUG_OUTPUT_FILE("debugOutputFile"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Role c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Role(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Role fromValue(String value) { - Role constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Run.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Run.java deleted file mode 100644 index 179f9912b3..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Run.java +++ /dev/null @@ -1,1009 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes a single run of an analysis tool, and contains the reported output of that run. - */ -@Generated("jsonschema2pojo") -public class Run { - - /** - * The analysis tool that was run. - * (Required) - */ - @SerializedName("tool") - @Expose - private Tool tool; - /** - * Describes the invocation of the analysis tool. - */ - @SerializedName("invocations") - @Expose - private List invocations = new ArrayList(); - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - @SerializedName("conversion") - @Expose - private Conversion conversion; - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - @SerializedName("language") - @Expose - private String language = "en-US"; - /** - * Specifies the revision in version control of the artifacts that were scanned. - */ - @SerializedName("versionControlProvenance") - @Expose - private Set versionControlProvenance = new LinkedHashSet(); - /** - * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - */ - @SerializedName("originalUriBaseIds") - @Expose - private OriginalUriBaseIds originalUriBaseIds; - /** - * An array of artifact objects relevant to the run. - */ - @SerializedName("artifacts") - @Expose - private Set artifacts = new LinkedHashSet(); - /** - * An array of logical locations such as namespaces, types or functions. - */ - @SerializedName("logicalLocations") - @Expose - private Set logicalLocations = new LinkedHashSet(); - /** - * An array of zero or more unique graph objects associated with the run. - */ - @SerializedName("graphs") - @Expose - private Set graphs = new LinkedHashSet(); - /** - * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. - */ - @SerializedName("results") - @Expose - private List results = new ArrayList(); - /** - * Information that describes a run's identity and role within an engineering system process. - */ - @SerializedName("automationDetails") - @Expose - private RunAutomationDetails automationDetails; - /** - * Automation details that describe the aggregate of runs to which this run belongs. - */ - @SerializedName("runAggregates") - @Expose - private Set runAggregates = new LinkedHashSet(); - /** - * The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. - */ - @SerializedName("baselineGuid") - @Expose - private String baselineGuid; - /** - * An array of strings used to replace sensitive information in a redaction-aware property. - */ - @SerializedName("redactionTokens") - @Expose - private Set redactionTokens = new LinkedHashSet(); - /** - * Specifies the default encoding for any artifact object that refers to a text file. - */ - @SerializedName("defaultEncoding") - @Expose - private String defaultEncoding; - /** - * Specifies the default source language for any artifact object that refers to a text file that contains source code. - */ - @SerializedName("defaultSourceLanguage") - @Expose - private String defaultSourceLanguage; - /** - * An ordered list of character sequences that were treated as line breaks when computing region information for the run. - */ - @SerializedName("newlineSequences") - @Expose - private Set newlineSequences = new LinkedHashSet(Arrays.asList("\r\n", "\n")); - /** - * Specifies the unit in which the tool measures columns. - */ - @SerializedName("columnKind") - @Expose - private Run.ColumnKind columnKind; - /** - * References to external property files that should be inlined with the content of a root log file. - */ - @SerializedName("externalPropertyFileReferences") - @Expose - private ExternalPropertyFileReferences externalPropertyFileReferences; - /** - * An array of threadFlowLocation objects cached at run level. - */ - @SerializedName("threadFlowLocations") - @Expose - private Set threadFlowLocations = new LinkedHashSet(); - /** - * An array of toolComponent objects relevant to a taxonomy in which results are categorized. - */ - @SerializedName("taxonomies") - @Expose - private Set taxonomies = new LinkedHashSet(); - /** - * Addresses associated with this run instance, if any. - */ - @SerializedName("addresses") - @Expose - private List
addresses = new ArrayList
(); - /** - * The set of available translations of the localized data provided by the tool. - */ - @SerializedName("translations") - @Expose - private Set translations = new LinkedHashSet(); - /** - * Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). - */ - @SerializedName("policies") - @Expose - private Set policies = new LinkedHashSet(); - /** - * An array of request objects cached at run level. - */ - @SerializedName("webRequests") - @Expose - private Set webRequests = new LinkedHashSet(); - /** - * An array of response objects cached at run level. - */ - @SerializedName("webResponses") - @Expose - private Set webResponses = new LinkedHashSet(); - /** - * Defines locations of special significance to SARIF consumers. - */ - @SerializedName("specialLocations") - @Expose - private SpecialLocations specialLocations; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Run() { - } - - /** - * @param addresses - * @param logicalLocations - * @param policies - * @param language - * @param invocations - * @param graphs - * @param baselineGuid - * @param translations - * @param newlineSequences - * @param webResponses - * @param externalPropertyFileReferences - * @param defaultSourceLanguage - * @param webRequests - * @param results - * @param automationDetails - * @param conversion - * @param artifacts - * @param originalUriBaseIds - * @param specialLocations - * @param defaultEncoding - * @param tool - * @param versionControlProvenance - * @param runAggregates - * @param redactionTokens - * @param taxonomies - * @param columnKind - * @param threadFlowLocations - * @param properties - */ - public Run(Tool tool, List invocations, Conversion conversion, String language, Set versionControlProvenance, OriginalUriBaseIds originalUriBaseIds, Set artifacts, Set logicalLocations, Set graphs, List results, RunAutomationDetails automationDetails, Set runAggregates, String baselineGuid, Set redactionTokens, String defaultEncoding, String defaultSourceLanguage, Set newlineSequences, Run.ColumnKind columnKind, ExternalPropertyFileReferences externalPropertyFileReferences, Set threadFlowLocations, Set taxonomies, List
addresses, Set translations, Set policies, Set webRequests, Set webResponses, SpecialLocations specialLocations, PropertyBag properties) { - super(); - this.tool = tool; - this.invocations = invocations; - this.conversion = conversion; - this.language = language; - this.versionControlProvenance = versionControlProvenance; - this.originalUriBaseIds = originalUriBaseIds; - this.artifacts = artifacts; - this.logicalLocations = logicalLocations; - this.graphs = graphs; - this.results = results; - this.automationDetails = automationDetails; - this.runAggregates = runAggregates; - this.baselineGuid = baselineGuid; - this.redactionTokens = redactionTokens; - this.defaultEncoding = defaultEncoding; - this.defaultSourceLanguage = defaultSourceLanguage; - this.newlineSequences = newlineSequences; - this.columnKind = columnKind; - this.externalPropertyFileReferences = externalPropertyFileReferences; - this.threadFlowLocations = threadFlowLocations; - this.taxonomies = taxonomies; - this.addresses = addresses; - this.translations = translations; - this.policies = policies; - this.webRequests = webRequests; - this.webResponses = webResponses; - this.specialLocations = specialLocations; - this.properties = properties; - } - - /** - * The analysis tool that was run. - * (Required) - */ - public Tool getTool() { - return tool; - } - - /** - * The analysis tool that was run. - * (Required) - */ - public void setTool(Tool tool) { - this.tool = tool; - } - - public Run withTool(Tool tool) { - this.tool = tool; - return this; - } - - /** - * Describes the invocation of the analysis tool. - */ - public List getInvocations() { - return invocations; - } - - /** - * Describes the invocation of the analysis tool. - */ - public void setInvocations(List invocations) { - this.invocations = invocations; - } - - public Run withInvocations(List invocations) { - this.invocations = invocations; - return this; - } - - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - public Conversion getConversion() { - return conversion; - } - - /** - * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. - */ - public void setConversion(Conversion conversion) { - this.conversion = conversion; - } - - public Run withConversion(Conversion conversion) { - this.conversion = conversion; - return this; - } - - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - public String getLanguage() { - return language; - } - - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - public void setLanguage(String language) { - this.language = language; - } - - public Run withLanguage(String language) { - this.language = language; - return this; - } - - /** - * Specifies the revision in version control of the artifacts that were scanned. - */ - public Set getVersionControlProvenance() { - return versionControlProvenance; - } - - /** - * Specifies the revision in version control of the artifacts that were scanned. - */ - public void setVersionControlProvenance(Set versionControlProvenance) { - this.versionControlProvenance = versionControlProvenance; - } - - public Run withVersionControlProvenance(Set versionControlProvenance) { - this.versionControlProvenance = versionControlProvenance; - return this; - } - - /** - * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - */ - public OriginalUriBaseIds getOriginalUriBaseIds() { - return originalUriBaseIds; - } - - /** - * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - */ - public void setOriginalUriBaseIds(OriginalUriBaseIds originalUriBaseIds) { - this.originalUriBaseIds = originalUriBaseIds; - } - - public Run withOriginalUriBaseIds(OriginalUriBaseIds originalUriBaseIds) { - this.originalUriBaseIds = originalUriBaseIds; - return this; - } - - /** - * An array of artifact objects relevant to the run. - */ - public Set getArtifacts() { - return artifacts; - } - - /** - * An array of artifact objects relevant to the run. - */ - public void setArtifacts(Set artifacts) { - this.artifacts = artifacts; - } - - public Run withArtifacts(Set artifacts) { - this.artifacts = artifacts; - return this; - } - - /** - * An array of logical locations such as namespaces, types or functions. - */ - public Set getLogicalLocations() { - return logicalLocations; - } - - /** - * An array of logical locations such as namespaces, types or functions. - */ - public void setLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - } - - public Run withLogicalLocations(Set logicalLocations) { - this.logicalLocations = logicalLocations; - return this; - } - - /** - * An array of zero or more unique graph objects associated with the run. - */ - public Set getGraphs() { - return graphs; - } - - /** - * An array of zero or more unique graph objects associated with the run. - */ - public void setGraphs(Set graphs) { - this.graphs = graphs; - } - - public Run withGraphs(Set graphs) { - this.graphs = graphs; - return this; - } - - /** - * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. - */ - public List getResults() { - return results; - } - - /** - * The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. - */ - public void setResults(List results) { - this.results = results; - } - - public Run withResults(List results) { - this.results = results; - return this; - } - - /** - * Information that describes a run's identity and role within an engineering system process. - */ - public RunAutomationDetails getAutomationDetails() { - return automationDetails; - } - - /** - * Information that describes a run's identity and role within an engineering system process. - */ - public void setAutomationDetails(RunAutomationDetails automationDetails) { - this.automationDetails = automationDetails; - } - - public Run withAutomationDetails(RunAutomationDetails automationDetails) { - this.automationDetails = automationDetails; - return this; - } - - /** - * Automation details that describe the aggregate of runs to which this run belongs. - */ - public Set getRunAggregates() { - return runAggregates; - } - - /** - * Automation details that describe the aggregate of runs to which this run belongs. - */ - public void setRunAggregates(Set runAggregates) { - this.runAggregates = runAggregates; - } - - public Run withRunAggregates(Set runAggregates) { - this.runAggregates = runAggregates; - return this; - } - - /** - * The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. - */ - public String getBaselineGuid() { - return baselineGuid; - } - - /** - * The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. - */ - public void setBaselineGuid(String baselineGuid) { - this.baselineGuid = baselineGuid; - } - - public Run withBaselineGuid(String baselineGuid) { - this.baselineGuid = baselineGuid; - return this; - } - - /** - * An array of strings used to replace sensitive information in a redaction-aware property. - */ - public Set getRedactionTokens() { - return redactionTokens; - } - - /** - * An array of strings used to replace sensitive information in a redaction-aware property. - */ - public void setRedactionTokens(Set redactionTokens) { - this.redactionTokens = redactionTokens; - } - - public Run withRedactionTokens(Set redactionTokens) { - this.redactionTokens = redactionTokens; - return this; - } - - /** - * Specifies the default encoding for any artifact object that refers to a text file. - */ - public String getDefaultEncoding() { - return defaultEncoding; - } - - /** - * Specifies the default encoding for any artifact object that refers to a text file. - */ - public void setDefaultEncoding(String defaultEncoding) { - this.defaultEncoding = defaultEncoding; - } - - public Run withDefaultEncoding(String defaultEncoding) { - this.defaultEncoding = defaultEncoding; - return this; - } - - /** - * Specifies the default source language for any artifact object that refers to a text file that contains source code. - */ - public String getDefaultSourceLanguage() { - return defaultSourceLanguage; - } - - /** - * Specifies the default source language for any artifact object that refers to a text file that contains source code. - */ - public void setDefaultSourceLanguage(String defaultSourceLanguage) { - this.defaultSourceLanguage = defaultSourceLanguage; - } - - public Run withDefaultSourceLanguage(String defaultSourceLanguage) { - this.defaultSourceLanguage = defaultSourceLanguage; - return this; - } - - /** - * An ordered list of character sequences that were treated as line breaks when computing region information for the run. - */ - public Set getNewlineSequences() { - return newlineSequences; - } - - /** - * An ordered list of character sequences that were treated as line breaks when computing region information for the run. - */ - public void setNewlineSequences(Set newlineSequences) { - this.newlineSequences = newlineSequences; - } - - public Run withNewlineSequences(Set newlineSequences) { - this.newlineSequences = newlineSequences; - return this; - } - - /** - * Specifies the unit in which the tool measures columns. - */ - public Run.ColumnKind getColumnKind() { - return columnKind; - } - - /** - * Specifies the unit in which the tool measures columns. - */ - public void setColumnKind(Run.ColumnKind columnKind) { - this.columnKind = columnKind; - } - - public Run withColumnKind(Run.ColumnKind columnKind) { - this.columnKind = columnKind; - return this; - } - - /** - * References to external property files that should be inlined with the content of a root log file. - */ - public ExternalPropertyFileReferences getExternalPropertyFileReferences() { - return externalPropertyFileReferences; - } - - /** - * References to external property files that should be inlined with the content of a root log file. - */ - public void setExternalPropertyFileReferences(ExternalPropertyFileReferences externalPropertyFileReferences) { - this.externalPropertyFileReferences = externalPropertyFileReferences; - } - - public Run withExternalPropertyFileReferences(ExternalPropertyFileReferences externalPropertyFileReferences) { - this.externalPropertyFileReferences = externalPropertyFileReferences; - return this; - } - - /** - * An array of threadFlowLocation objects cached at run level. - */ - public Set getThreadFlowLocations() { - return threadFlowLocations; - } - - /** - * An array of threadFlowLocation objects cached at run level. - */ - public void setThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - } - - public Run withThreadFlowLocations(Set threadFlowLocations) { - this.threadFlowLocations = threadFlowLocations; - return this; - } - - /** - * An array of toolComponent objects relevant to a taxonomy in which results are categorized. - */ - public Set getTaxonomies() { - return taxonomies; - } - - /** - * An array of toolComponent objects relevant to a taxonomy in which results are categorized. - */ - public void setTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - } - - public Run withTaxonomies(Set taxonomies) { - this.taxonomies = taxonomies; - return this; - } - - /** - * Addresses associated with this run instance, if any. - */ - public List
getAddresses() { - return addresses; - } - - /** - * Addresses associated with this run instance, if any. - */ - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - - public Run withAddresses(List
addresses) { - this.addresses = addresses; - return this; - } - - /** - * The set of available translations of the localized data provided by the tool. - */ - public Set getTranslations() { - return translations; - } - - /** - * The set of available translations of the localized data provided by the tool. - */ - public void setTranslations(Set translations) { - this.translations = translations; - } - - public Run withTranslations(Set translations) { - this.translations = translations; - return this; - } - - /** - * Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). - */ - public Set getPolicies() { - return policies; - } - - /** - * Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). - */ - public void setPolicies(Set policies) { - this.policies = policies; - } - - public Run withPolicies(Set policies) { - this.policies = policies; - return this; - } - - /** - * An array of request objects cached at run level. - */ - public Set getWebRequests() { - return webRequests; - } - - /** - * An array of request objects cached at run level. - */ - public void setWebRequests(Set webRequests) { - this.webRequests = webRequests; - } - - public Run withWebRequests(Set webRequests) { - this.webRequests = webRequests; - return this; - } - - /** - * An array of response objects cached at run level. - */ - public Set getWebResponses() { - return webResponses; - } - - /** - * An array of response objects cached at run level. - */ - public void setWebResponses(Set webResponses) { - this.webResponses = webResponses; - } - - public Run withWebResponses(Set webResponses) { - this.webResponses = webResponses; - return this; - } - - /** - * Defines locations of special significance to SARIF consumers. - */ - public SpecialLocations getSpecialLocations() { - return specialLocations; - } - - /** - * Defines locations of special significance to SARIF consumers. - */ - public void setSpecialLocations(SpecialLocations specialLocations) { - this.specialLocations = specialLocations; - } - - public Run withSpecialLocations(SpecialLocations specialLocations) { - this.specialLocations = specialLocations; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Run withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Run.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("tool"); - sb.append('='); - sb.append(((this.tool == null) ? "" : this.tool)); - sb.append(','); - sb.append("invocations"); - sb.append('='); - sb.append(((this.invocations == null) ? "" : this.invocations)); - sb.append(','); - sb.append("conversion"); - sb.append('='); - sb.append(((this.conversion == null) ? "" : this.conversion)); - sb.append(','); - sb.append("language"); - sb.append('='); - sb.append(((this.language == null) ? "" : this.language)); - sb.append(','); - sb.append("versionControlProvenance"); - sb.append('='); - sb.append(((this.versionControlProvenance == null) ? "" : this.versionControlProvenance)); - sb.append(','); - sb.append("originalUriBaseIds"); - sb.append('='); - sb.append(((this.originalUriBaseIds == null) ? "" : this.originalUriBaseIds)); - sb.append(','); - sb.append("artifacts"); - sb.append('='); - sb.append(((this.artifacts == null) ? "" : this.artifacts)); - sb.append(','); - sb.append("logicalLocations"); - sb.append('='); - sb.append(((this.logicalLocations == null) ? "" : this.logicalLocations)); - sb.append(','); - sb.append("graphs"); - sb.append('='); - sb.append(((this.graphs == null) ? "" : this.graphs)); - sb.append(','); - sb.append("results"); - sb.append('='); - sb.append(((this.results == null) ? "" : this.results)); - sb.append(','); - sb.append("automationDetails"); - sb.append('='); - sb.append(((this.automationDetails == null) ? "" : this.automationDetails)); - sb.append(','); - sb.append("runAggregates"); - sb.append('='); - sb.append(((this.runAggregates == null) ? "" : this.runAggregates)); - sb.append(','); - sb.append("baselineGuid"); - sb.append('='); - sb.append(((this.baselineGuid == null) ? "" : this.baselineGuid)); - sb.append(','); - sb.append("redactionTokens"); - sb.append('='); - sb.append(((this.redactionTokens == null) ? "" : this.redactionTokens)); - sb.append(','); - sb.append("defaultEncoding"); - sb.append('='); - sb.append(((this.defaultEncoding == null) ? "" : this.defaultEncoding)); - sb.append(','); - sb.append("defaultSourceLanguage"); - sb.append('='); - sb.append(((this.defaultSourceLanguage == null) ? "" : this.defaultSourceLanguage)); - sb.append(','); - sb.append("newlineSequences"); - sb.append('='); - sb.append(((this.newlineSequences == null) ? "" : this.newlineSequences)); - sb.append(','); - sb.append("columnKind"); - sb.append('='); - sb.append(((this.columnKind == null) ? "" : this.columnKind)); - sb.append(','); - sb.append("externalPropertyFileReferences"); - sb.append('='); - sb.append(((this.externalPropertyFileReferences == null) ? "" : this.externalPropertyFileReferences)); - sb.append(','); - sb.append("threadFlowLocations"); - sb.append('='); - sb.append(((this.threadFlowLocations == null) ? "" : this.threadFlowLocations)); - sb.append(','); - sb.append("taxonomies"); - sb.append('='); - sb.append(((this.taxonomies == null) ? "" : this.taxonomies)); - sb.append(','); - sb.append("addresses"); - sb.append('='); - sb.append(((this.addresses == null) ? "" : this.addresses)); - sb.append(','); - sb.append("translations"); - sb.append('='); - sb.append(((this.translations == null) ? "" : this.translations)); - sb.append(','); - sb.append("policies"); - sb.append('='); - sb.append(((this.policies == null) ? "" : this.policies)); - sb.append(','); - sb.append("webRequests"); - sb.append('='); - sb.append(((this.webRequests == null) ? "" : this.webRequests)); - sb.append(','); - sb.append("webResponses"); - sb.append('='); - sb.append(((this.webResponses == null) ? "" : this.webResponses)); - sb.append(','); - sb.append("specialLocations"); - sb.append('='); - sb.append(((this.specialLocations == null) ? "" : this.specialLocations)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.addresses == null) ? 0 : this.addresses.hashCode())); - result = ((result * 31) + ((this.logicalLocations == null) ? 0 : this.logicalLocations.hashCode())); - result = ((result * 31) + ((this.policies == null) ? 0 : this.policies.hashCode())); - result = ((result * 31) + ((this.language == null) ? 0 : this.language.hashCode())); - result = ((result * 31) + ((this.invocations == null) ? 0 : this.invocations.hashCode())); - result = ((result * 31) + ((this.graphs == null) ? 0 : this.graphs.hashCode())); - result = ((result * 31) + ((this.baselineGuid == null) ? 0 : this.baselineGuid.hashCode())); - result = ((result * 31) + ((this.translations == null) ? 0 : this.translations.hashCode())); - result = ((result * 31) + ((this.newlineSequences == null) ? 0 : this.newlineSequences.hashCode())); - result = ((result * 31) + ((this.webResponses == null) ? 0 : this.webResponses.hashCode())); - result = ((result * 31) + ((this.externalPropertyFileReferences == null) ? 0 : this.externalPropertyFileReferences.hashCode())); - result = ((result * 31) + ((this.defaultSourceLanguage == null) ? 0 : this.defaultSourceLanguage.hashCode())); - result = ((result * 31) + ((this.webRequests == null) ? 0 : this.webRequests.hashCode())); - result = ((result * 31) + ((this.results == null) ? 0 : this.results.hashCode())); - result = ((result * 31) + ((this.automationDetails == null) ? 0 : this.automationDetails.hashCode())); - result = ((result * 31) + ((this.conversion == null) ? 0 : this.conversion.hashCode())); - result = ((result * 31) + ((this.artifacts == null) ? 0 : this.artifacts.hashCode())); - result = ((result * 31) + ((this.originalUriBaseIds == null) ? 0 : this.originalUriBaseIds.hashCode())); - result = ((result * 31) + ((this.specialLocations == null) ? 0 : this.specialLocations.hashCode())); - result = ((result * 31) + ((this.defaultEncoding == null) ? 0 : this.defaultEncoding.hashCode())); - result = ((result * 31) + ((this.tool == null) ? 0 : this.tool.hashCode())); - result = ((result * 31) + ((this.versionControlProvenance == null) ? 0 : this.versionControlProvenance.hashCode())); - result = ((result * 31) + ((this.runAggregates == null) ? 0 : this.runAggregates.hashCode())); - result = ((result * 31) + ((this.redactionTokens == null) ? 0 : this.redactionTokens.hashCode())); - result = ((result * 31) + ((this.taxonomies == null) ? 0 : this.taxonomies.hashCode())); - result = ((result * 31) + ((this.columnKind == null) ? 0 : this.columnKind.hashCode())); - result = ((result * 31) + ((this.threadFlowLocations == null) ? 0 : this.threadFlowLocations.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Run) == false) { - return false; - } - Run rhs = ((Run) other); - return (((((((((((((((((((((((((((((this.addresses == rhs.addresses) || ((this.addresses != null) && this.addresses.equals(rhs.addresses))) && ((this.logicalLocations == rhs.logicalLocations) || ((this.logicalLocations != null) && this.logicalLocations.equals(rhs.logicalLocations)))) && ((this.policies == rhs.policies) || ((this.policies != null) && this.policies.equals(rhs.policies)))) && ((this.language == rhs.language) || ((this.language != null) && this.language.equals(rhs.language)))) && ((this.invocations == rhs.invocations) || ((this.invocations != null) && this.invocations.equals(rhs.invocations)))) && ((this.graphs == rhs.graphs) || ((this.graphs != null) && this.graphs.equals(rhs.graphs)))) && ((this.baselineGuid == rhs.baselineGuid) || ((this.baselineGuid != null) && this.baselineGuid.equals(rhs.baselineGuid)))) && ((this.translations == rhs.translations) || ((this.translations != null) && this.translations.equals(rhs.translations)))) && ((this.newlineSequences == rhs.newlineSequences) || ((this.newlineSequences != null) && this.newlineSequences.equals(rhs.newlineSequences)))) && ((this.webResponses == rhs.webResponses) || ((this.webResponses != null) && this.webResponses.equals(rhs.webResponses)))) && ((this.externalPropertyFileReferences == rhs.externalPropertyFileReferences) || ((this.externalPropertyFileReferences != null) && this.externalPropertyFileReferences.equals(rhs.externalPropertyFileReferences)))) && ((this.defaultSourceLanguage == rhs.defaultSourceLanguage) || ((this.defaultSourceLanguage != null) && this.defaultSourceLanguage.equals(rhs.defaultSourceLanguage)))) && ((this.webRequests == rhs.webRequests) || ((this.webRequests != null) && this.webRequests.equals(rhs.webRequests)))) && ((this.results == rhs.results) || ((this.results != null) && this.results.equals(rhs.results)))) && ((this.automationDetails == rhs.automationDetails) || ((this.automationDetails != null) && this.automationDetails.equals(rhs.automationDetails)))) && ((this.conversion == rhs.conversion) || ((this.conversion != null) && this.conversion.equals(rhs.conversion)))) && ((this.artifacts == rhs.artifacts) || ((this.artifacts != null) && this.artifacts.equals(rhs.artifacts)))) && ((this.originalUriBaseIds == rhs.originalUriBaseIds) || ((this.originalUriBaseIds != null) && this.originalUriBaseIds.equals(rhs.originalUriBaseIds)))) && ((this.specialLocations == rhs.specialLocations) || ((this.specialLocations != null) && this.specialLocations.equals(rhs.specialLocations)))) && ((this.defaultEncoding == rhs.defaultEncoding) || ((this.defaultEncoding != null) && this.defaultEncoding.equals(rhs.defaultEncoding)))) && ((this.tool == rhs.tool) || ((this.tool != null) && this.tool.equals(rhs.tool)))) && ((this.versionControlProvenance == rhs.versionControlProvenance) || ((this.versionControlProvenance != null) && this.versionControlProvenance.equals(rhs.versionControlProvenance)))) && ((this.runAggregates == rhs.runAggregates) || ((this.runAggregates != null) && this.runAggregates.equals(rhs.runAggregates)))) && ((this.redactionTokens == rhs.redactionTokens) || ((this.redactionTokens != null) && this.redactionTokens.equals(rhs.redactionTokens)))) && ((this.taxonomies == rhs.taxonomies) || ((this.taxonomies != null) && this.taxonomies.equals(rhs.taxonomies)))) && ((this.columnKind == rhs.columnKind) || ((this.columnKind != null) && this.columnKind.equals(rhs.columnKind)))) && ((this.threadFlowLocations == rhs.threadFlowLocations) || ((this.threadFlowLocations != null) && this.threadFlowLocations.equals(rhs.threadFlowLocations)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * Specifies the unit in which the tool measures columns. - */ - @Generated("jsonschema2pojo") - public enum ColumnKind { - - @SerializedName("utf16CodeUnits") - UTF_16_CODE_UNITS("utf16CodeUnits"), - @SerializedName("unicodeCodePoints") - UNICODE_CODE_POINTS("unicodeCodePoints"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Run.ColumnKind c : values()) { - CONSTANTS.put(c.value, c); - } - } - - ColumnKind(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Run.ColumnKind fromValue(String value) { - Run.ColumnKind constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/RunAutomationDetails.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/RunAutomationDetails.java deleted file mode 100644 index c1cb662a28..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/RunAutomationDetails.java +++ /dev/null @@ -1,219 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Information that describes a run's identity and role within an engineering system process. - */ -@Generated("jsonschema2pojo") -public class RunAutomationDetails { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("description") - @Expose - private Message description; - /** - * A hierarchical string that uniquely identifies this object's containing run object. - */ - @SerializedName("id") - @Expose - private String id; - /** - * A stable, unique identifer for this object's containing run object in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. - */ - @SerializedName("correlationGuid") - @Expose - private String correlationGuid; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public RunAutomationDetails() { - } - - /** - * @param correlationGuid - * @param description - * @param guid - * @param id - * @param properties - */ - public RunAutomationDetails(Message description, String id, String guid, String correlationGuid, PropertyBag properties) { - super(); - this.description = description; - this.id = id; - this.guid = guid; - this.correlationGuid = correlationGuid; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getDescription() { - return description; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setDescription(Message description) { - this.description = description; - } - - public RunAutomationDetails withDescription(Message description) { - this.description = description; - return this; - } - - /** - * A hierarchical string that uniquely identifies this object's containing run object. - */ - public String getId() { - return id; - } - - /** - * A hierarchical string that uniquely identifies this object's containing run object. - */ - public void setId(String id) { - this.id = id; - } - - public RunAutomationDetails withId(String id) { - this.id = id; - return this; - } - - /** - * A stable, unique identifer for this object's containing run object in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A stable, unique identifer for this object's containing run object in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public RunAutomationDetails withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. - */ - public String getCorrelationGuid() { - return correlationGuid; - } - - /** - * A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. - */ - public void setCorrelationGuid(String correlationGuid) { - this.correlationGuid = correlationGuid; - } - - public RunAutomationDetails withCorrelationGuid(String correlationGuid) { - this.correlationGuid = correlationGuid; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public RunAutomationDetails withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(RunAutomationDetails.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("description"); - sb.append('='); - sb.append(((this.description == null) ? "" : this.description)); - sb.append(','); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("correlationGuid"); - sb.append('='); - sb.append(((this.correlationGuid == null) ? "" : this.correlationGuid)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.description == null) ? 0 : this.description.hashCode())); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.correlationGuid == null) ? 0 : this.correlationGuid.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof RunAutomationDetails) == false) { - return false; - } - RunAutomationDetails rhs = ((RunAutomationDetails) other); - return ((((((this.description == rhs.description) || ((this.description != null) && this.description.equals(rhs.description))) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.correlationGuid == rhs.correlationGuid) || ((this.correlationGuid != null) && this.correlationGuid.equals(rhs.correlationGuid)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SarifSchema.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SarifSchema.java deleted file mode 100644 index 5676d97ea6..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SarifSchema.java +++ /dev/null @@ -1,232 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema - *

- * Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools. - */ -@Generated("jsonschema2pojo") -public class SarifSchema { - - /** - * The URI of the JSON schema corresponding to the version. - */ - @SerializedName("$schema") - @Expose - private URI $schema; - /** - * The SARIF format version of this log file. - * (Required) - */ - @SerializedName("version") - @Expose - private Object version; - /** - * The set of runs contained in this log file. - * (Required) - */ - @SerializedName("runs") - @Expose - private List runs = new ArrayList(); - /** - * References to external property files that share data between runs. - */ - @SerializedName("inlineExternalProperties") - @Expose - private Set inlineExternalProperties = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public SarifSchema() { - } - - /** - * @param inlineExternalProperties - * @param $schema - * @param version - * @param runs - * @param properties - */ - public SarifSchema(URI $schema, Object version, List runs, Set inlineExternalProperties, PropertyBag properties) { - super(); - this.$schema = $schema; - this.version = version; - this.runs = runs; - this.inlineExternalProperties = inlineExternalProperties; - this.properties = properties; - } - - /** - * The URI of the JSON schema corresponding to the version. - */ - public URI get$schema() { - return $schema; - } - - /** - * The URI of the JSON schema corresponding to the version. - */ - public void set$schema(URI $schema) { - this.$schema = $schema; - } - - public SarifSchema with$schema(URI $schema) { - this.$schema = $schema; - return this; - } - - /** - * The SARIF format version of this log file. - * (Required) - */ - public Object getVersion() { - return version; - } - - /** - * The SARIF format version of this log file. - * (Required) - */ - public void setVersion(Object version) { - this.version = version; - } - - public SarifSchema withVersion(Object version) { - this.version = version; - return this; - } - - /** - * The set of runs contained in this log file. - * (Required) - */ - public List getRuns() { - return runs; - } - - /** - * The set of runs contained in this log file. - * (Required) - */ - public void setRuns(List runs) { - this.runs = runs; - } - - public SarifSchema withRuns(List runs) { - this.runs = runs; - return this; - } - - /** - * References to external property files that share data between runs. - */ - public Set getInlineExternalProperties() { - return inlineExternalProperties; - } - - /** - * References to external property files that share data between runs. - */ - public void setInlineExternalProperties(Set inlineExternalProperties) { - this.inlineExternalProperties = inlineExternalProperties; - } - - public SarifSchema withInlineExternalProperties(Set inlineExternalProperties) { - this.inlineExternalProperties = inlineExternalProperties; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public SarifSchema withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(SarifSchema.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("$schema"); - sb.append('='); - sb.append(((this.$schema == null) ? "" : this.$schema)); - sb.append(','); - sb.append("version"); - sb.append('='); - sb.append(((this.version == null) ? "" : this.version)); - sb.append(','); - sb.append("runs"); - sb.append('='); - sb.append(((this.runs == null) ? "" : this.runs)); - sb.append(','); - sb.append("inlineExternalProperties"); - sb.append('='); - sb.append(((this.inlineExternalProperties == null) ? "" : this.inlineExternalProperties)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.inlineExternalProperties == null) ? 0 : this.inlineExternalProperties.hashCode())); - result = ((result * 31) + ((this.$schema == null) ? 0 : this.$schema.hashCode())); - result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); - result = ((result * 31) + ((this.runs == null) ? 0 : this.runs.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof SarifSchema) == false) { - return false; - } - SarifSchema rhs = ((SarifSchema) other); - return ((((((this.inlineExternalProperties == rhs.inlineExternalProperties) || ((this.inlineExternalProperties != null) && this.inlineExternalProperties.equals(rhs.inlineExternalProperties))) && ((this.$schema == rhs.$schema) || ((this.$schema != null) && this.$schema.equals(rhs.$schema)))) && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) && ((this.runs == rhs.runs) || ((this.runs != null) && this.runs.equals(rhs.runs)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SpecialLocations.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SpecialLocations.java deleted file mode 100644 index 7c0cfcd924..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/SpecialLocations.java +++ /dev/null @@ -1,123 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Defines locations of special significance to SARIF consumers. - */ -@Generated("jsonschema2pojo") -public class SpecialLocations { - - /** - * Specifies the location of an artifact. - */ - @SerializedName("displayBase") - @Expose - private ArtifactLocation displayBase; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public SpecialLocations() { - } - - /** - * @param displayBase - * @param properties - */ - public SpecialLocations(ArtifactLocation displayBase, PropertyBag properties) { - super(); - this.displayBase = displayBase; - this.properties = properties; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getDisplayBase() { - return displayBase; - } - - /** - * Specifies the location of an artifact. - */ - public void setDisplayBase(ArtifactLocation displayBase) { - this.displayBase = displayBase; - } - - public SpecialLocations withDisplayBase(ArtifactLocation displayBase) { - this.displayBase = displayBase; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public SpecialLocations withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(SpecialLocations.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("displayBase"); - sb.append('='); - sb.append(((this.displayBase == null) ? "" : this.displayBase)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.displayBase == null) ? 0 : this.displayBase.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof SpecialLocations) == false) { - return false; - } - SpecialLocations rhs = ((SpecialLocations) other); - return (((this.displayBase == rhs.displayBase) || ((this.displayBase != null) && this.displayBase.equals(rhs.displayBase))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Stack.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Stack.java deleted file mode 100644 index c9a4732578..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Stack.java +++ /dev/null @@ -1,160 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A call stack that is relevant to a result. - */ -@Generated("jsonschema2pojo") -public class Stack { - - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. - * (Required) - */ - @SerializedName("frames") - @Expose - private List frames = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Stack() { - } - - /** - * @param frames - * @param message - * @param properties - */ - public Stack(Message message, List frames, PropertyBag properties) { - super(); - this.message = message; - this.frames = frames; - this.properties = properties; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public Stack withMessage(Message message) { - this.message = message; - return this; - } - - /** - * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. - * (Required) - */ - public List getFrames() { - return frames; - } - - /** - * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. - * (Required) - */ - public void setFrames(List frames) { - this.frames = frames; - } - - public Stack withFrames(List frames) { - this.frames = frames; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Stack withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Stack.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("frames"); - sb.append('='); - sb.append(((this.frames == null) ? "" : this.frames)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.frames == null) ? 0 : this.frames.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Stack) == false) { - return false; - } - Stack rhs = ((Stack) other); - return ((((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message))) && ((this.frames == rhs.frames) || ((this.frames != null) && this.frames.equals(rhs.frames)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/StackFrame.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/StackFrame.java deleted file mode 100644 index 17cc045342..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/StackFrame.java +++ /dev/null @@ -1,221 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A function call within a stack trace. - */ -@Generated("jsonschema2pojo") -public class StackFrame { - - /** - * A location within a programming artifact. - */ - @SerializedName("location") - @Expose - private Location location; - /** - * The name of the module that contains the code of this stack frame. - */ - @SerializedName("module") - @Expose - private String module; - /** - * The thread identifier of the stack frame. - */ - @SerializedName("threadId") - @Expose - private int threadId; - /** - * The parameters of the call that is executing. - */ - @SerializedName("parameters") - @Expose - private List parameters = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public StackFrame() { - } - - /** - * @param threadId - * @param module - * @param location - * @param parameters - * @param properties - */ - public StackFrame(Location location, String module, int threadId, List parameters, PropertyBag properties) { - super(); - this.location = location; - this.module = module; - this.threadId = threadId; - this.parameters = parameters; - this.properties = properties; - } - - /** - * A location within a programming artifact. - */ - public Location getLocation() { - return location; - } - - /** - * A location within a programming artifact. - */ - public void setLocation(Location location) { - this.location = location; - } - - public StackFrame withLocation(Location location) { - this.location = location; - return this; - } - - /** - * The name of the module that contains the code of this stack frame. - */ - public String getModule() { - return module; - } - - /** - * The name of the module that contains the code of this stack frame. - */ - public void setModule(String module) { - this.module = module; - } - - public StackFrame withModule(String module) { - this.module = module; - return this; - } - - /** - * The thread identifier of the stack frame. - */ - public int getThreadId() { - return threadId; - } - - /** - * The thread identifier of the stack frame. - */ - public void setThreadId(int threadId) { - this.threadId = threadId; - } - - public StackFrame withThreadId(int threadId) { - this.threadId = threadId; - return this; - } - - /** - * The parameters of the call that is executing. - */ - public List getParameters() { - return parameters; - } - - /** - * The parameters of the call that is executing. - */ - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public StackFrame withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public StackFrame withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(StackFrame.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("module"); - sb.append('='); - sb.append(((this.module == null) ? "" : this.module)); - sb.append(','); - sb.append("threadId"); - sb.append('='); - sb.append(this.threadId); - sb.append(','); - sb.append("parameters"); - sb.append('='); - sb.append(((this.parameters == null) ? "" : this.parameters)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + this.threadId); - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.parameters == null) ? 0 : this.parameters.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.module == null) ? 0 : this.module.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof StackFrame) == false) { - return false; - } - StackFrame rhs = ((StackFrame) other); - return (((((this.threadId == rhs.threadId) && ((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location)))) && ((this.parameters == rhs.parameters) || ((this.parameters != null) && this.parameters.equals(rhs.parameters)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.module == rhs.module) || ((this.module != null) && this.module.equals(rhs.module)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/State.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/State.java deleted file mode 100644 index c545cc7225..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/State.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - - -/** - * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - */ -@Generated("jsonschema2pojo") -public class State { - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(State.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof State) == false) { - return false; - } - State rhs = ((State) other); - return true; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Suppression.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Suppression.java deleted file mode 100644 index 9ef6e2bf4b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Suppression.java +++ /dev/null @@ -1,346 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A suppression that is relevant to a result. - */ -@Generated("jsonschema2pojo") -public class Suppression { - - /** - * A stable, unique identifer for the suprression in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * A string that indicates where the suppression is persisted. - * (Required) - */ - @SerializedName("kind") - @Expose - private Suppression.Kind kind; - /** - * A string that indicates the state of the suppression. - */ - @SerializedName("state") - @Expose - private Suppression.State state; - /** - * A string representing the justification for the suppression. - */ - @SerializedName("justification") - @Expose - private String justification; - /** - * A location within a programming artifact. - */ - @SerializedName("location") - @Expose - private Location location; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Suppression() { - } - - /** - * @param kind - * @param guid - * @param location - * @param state - * @param justification - * @param properties - */ - public Suppression(String guid, Suppression.Kind kind, Suppression.State state, String justification, Location location, PropertyBag properties) { - super(); - this.guid = guid; - this.kind = kind; - this.state = state; - this.justification = justification; - this.location = location; - this.properties = properties; - } - - /** - * A stable, unique identifer for the suprression in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A stable, unique identifer for the suprression in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public Suppression withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * A string that indicates where the suppression is persisted. - * (Required) - */ - public Suppression.Kind getKind() { - return kind; - } - - /** - * A string that indicates where the suppression is persisted. - * (Required) - */ - public void setKind(Suppression.Kind kind) { - this.kind = kind; - } - - public Suppression withKind(Suppression.Kind kind) { - this.kind = kind; - return this; - } - - /** - * A string that indicates the state of the suppression. - */ - public Suppression.State getState() { - return state; - } - - /** - * A string that indicates the state of the suppression. - */ - public void setState(Suppression.State state) { - this.state = state; - } - - public Suppression withState(Suppression.State state) { - this.state = state; - return this; - } - - /** - * A string representing the justification for the suppression. - */ - public String getJustification() { - return justification; - } - - /** - * A string representing the justification for the suppression. - */ - public void setJustification(String justification) { - this.justification = justification; - } - - public Suppression withJustification(String justification) { - this.justification = justification; - return this; - } - - /** - * A location within a programming artifact. - */ - public Location getLocation() { - return location; - } - - /** - * A location within a programming artifact. - */ - public void setLocation(Location location) { - this.location = location; - } - - public Suppression withLocation(Location location) { - this.location = location; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Suppression withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Suppression.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("kind"); - sb.append('='); - sb.append(((this.kind == null) ? "" : this.kind)); - sb.append(','); - sb.append("state"); - sb.append('='); - sb.append(((this.state == null) ? "" : this.state)); - sb.append(','); - sb.append("justification"); - sb.append('='); - sb.append(((this.justification == null) ? "" : this.justification)); - sb.append(','); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.state == null) ? 0 : this.state.hashCode())); - result = ((result * 31) + ((this.justification == null) ? 0 : this.justification.hashCode())); - result = ((result * 31) + ((this.kind == null) ? 0 : this.kind.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Suppression) == false) { - return false; - } - Suppression rhs = ((Suppression) other); - return (((((((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid))) && ((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location)))) && ((this.state == rhs.state) || ((this.state != null) && this.state.equals(rhs.state)))) && ((this.justification == rhs.justification) || ((this.justification != null) && this.justification.equals(rhs.justification)))) && ((this.kind == rhs.kind) || ((this.kind != null) && this.kind.equals(rhs.kind)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * A string that indicates where the suppression is persisted. - */ - @Generated("jsonschema2pojo") - public enum Kind { - - @SerializedName("inSource") - IN_SOURCE("inSource"), - @SerializedName("external") - EXTERNAL("external"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Suppression.Kind c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Kind(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Suppression.Kind fromValue(String value) { - Suppression.Kind constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - - - /** - * A string that indicates the state of the suppression. - */ - @Generated("jsonschema2pojo") - public enum State { - - @SerializedName("accepted") - ACCEPTED("accepted"), - @SerializedName("underReview") - UNDER_REVIEW("underReview"), - @SerializedName("rejected") - REJECTED("rejected"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Suppression.State c : values()) { - CONSTANTS.put(c.value, c); - } - } - - State(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static Suppression.State fromValue(String value) { - Suppression.State constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlow.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlow.java deleted file mode 100644 index f988782de2..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlow.java +++ /dev/null @@ -1,256 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.ArrayList; -import java.util.List; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber. - */ -@Generated("jsonschema2pojo") -public class ThreadFlow { - - /** - * An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. - */ - @SerializedName("id") - @Expose - private String id; - /** - * Encapsulates a message intended to be read by the end user. - */ - @SerializedName("message") - @Expose - private Message message; - /** - * Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - */ - @SerializedName("initialState") - @Expose - private InitialState initialState; - /** - * Values of relevant expressions at the start of the thread flow that remain constant. - */ - @SerializedName("immutableState") - @Expose - private ImmutableState immutableState; - /** - * A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. - * (Required) - */ - @SerializedName("locations") - @Expose - private List locations = new ArrayList(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ThreadFlow() { - } - - /** - * @param initialState - * @param immutableState - * @param locations - * @param id - * @param message - * @param properties - */ - public ThreadFlow(String id, Message message, InitialState initialState, ImmutableState immutableState, List locations, PropertyBag properties) { - super(); - this.id = id; - this.message = message; - this.initialState = initialState; - this.immutableState = immutableState; - this.locations = locations; - this.properties = properties; - } - - /** - * An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. - */ - public String getId() { - return id; - } - - /** - * An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. - */ - public void setId(String id) { - this.id = id; - } - - public ThreadFlow withId(String id) { - this.id = id; - return this; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public Message getMessage() { - return message; - } - - /** - * Encapsulates a message intended to be read by the end user. - */ - public void setMessage(Message message) { - this.message = message; - } - - public ThreadFlow withMessage(Message message) { - this.message = message; - return this; - } - - /** - * Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - */ - public InitialState getInitialState() { - return initialState; - } - - /** - * Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - */ - public void setInitialState(InitialState initialState) { - this.initialState = initialState; - } - - public ThreadFlow withInitialState(InitialState initialState) { - this.initialState = initialState; - return this; - } - - /** - * Values of relevant expressions at the start of the thread flow that remain constant. - */ - public ImmutableState getImmutableState() { - return immutableState; - } - - /** - * Values of relevant expressions at the start of the thread flow that remain constant. - */ - public void setImmutableState(ImmutableState immutableState) { - this.immutableState = immutableState; - } - - public ThreadFlow withImmutableState(ImmutableState immutableState) { - this.immutableState = immutableState; - return this; - } - - /** - * A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. - * (Required) - */ - public List getLocations() { - return locations; - } - - /** - * A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. - * (Required) - */ - public void setLocations(List locations) { - this.locations = locations; - } - - public ThreadFlow withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ThreadFlow withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ThreadFlow.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("id"); - sb.append('='); - sb.append(((this.id == null) ? "" : this.id)); - sb.append(','); - sb.append("message"); - sb.append('='); - sb.append(((this.message == null) ? "" : this.message)); - sb.append(','); - sb.append("initialState"); - sb.append('='); - sb.append(((this.initialState == null) ? "" : this.initialState)); - sb.append(','); - sb.append("immutableState"); - sb.append('='); - sb.append(((this.immutableState == null) ? "" : this.immutableState)); - sb.append(','); - sb.append("locations"); - sb.append('='); - sb.append(((this.locations == null) ? "" : this.locations)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.immutableState == null) ? 0 : this.immutableState.hashCode())); - result = ((result * 31) + ((this.locations == null) ? 0 : this.locations.hashCode())); - result = ((result * 31) + ((this.id == null) ? 0 : this.id.hashCode())); - result = ((result * 31) + ((this.initialState == null) ? 0 : this.initialState.hashCode())); - result = ((result * 31) + ((this.message == null) ? 0 : this.message.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ThreadFlow) == false) { - return false; - } - ThreadFlow rhs = ((ThreadFlow) other); - return (((((((this.immutableState == rhs.immutableState) || ((this.immutableState != null) && this.immutableState.equals(rhs.immutableState))) && ((this.locations == rhs.locations) || ((this.locations != null) && this.locations.equals(rhs.locations)))) && ((this.id == rhs.id) || ((this.id != null) && this.id.equals(rhs.id)))) && ((this.initialState == rhs.initialState) || ((this.initialState != null) && this.initialState.equals(rhs.initialState)))) && ((this.message == rhs.message) || ((this.message != null) && this.message.equals(rhs.message)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlowLocation.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlowLocation.java deleted file mode 100644 index adfff0c79f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ThreadFlowLocation.java +++ /dev/null @@ -1,558 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A location visited by an analysis tool while simulating or monitoring the execution of a program. - */ -@Generated("jsonschema2pojo") -public class ThreadFlowLocation { - - /** - * The index within the run threadFlowLocations array. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * A location within a programming artifact. - */ - @SerializedName("location") - @Expose - private Location location; - /** - * A call stack that is relevant to a result. - */ - @SerializedName("stack") - @Expose - private Stack stack; - /** - * A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. - */ - @SerializedName("kinds") - @Expose - private Set kinds = new LinkedHashSet(); - /** - * An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. - */ - @SerializedName("taxa") - @Expose - private Set taxa = new LinkedHashSet(); - /** - * The name of the module that contains the code that is executing. - */ - @SerializedName("module") - @Expose - private String module; - /** - * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - */ - @SerializedName("state") - @Expose - private State state; - /** - * An integer representing a containment hierarchy within the thread flow. - */ - @SerializedName("nestingLevel") - @Expose - private int nestingLevel; - /** - * An integer representing the temporal order in which execution reached this location. - */ - @SerializedName("executionOrder") - @Expose - private int executionOrder = -1; - /** - * The Coordinated Universal Time (UTC) date and time at which this location was executed. - */ - @SerializedName("executionTimeUtc") - @Expose - private Date executionTimeUtc; - /** - * Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - */ - @SerializedName("importance") - @Expose - private ThreadFlowLocation.Importance importance = ThreadFlowLocation.Importance.fromValue("important"); - /** - * Describes an HTTP request. - */ - @SerializedName("webRequest") - @Expose - private WebRequest webRequest; - /** - * Describes the response to an HTTP request. - */ - @SerializedName("webResponse") - @Expose - private WebResponse webResponse; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ThreadFlowLocation() { - } - - /** - * @param taxa - * @param nestingLevel - * @param stack - * @param webRequest - * @param importance - * @param module - * @param executionTimeUtc - * @param index - * @param kinds - * @param executionOrder - * @param webResponse - * @param location - * @param state - * @param properties - */ - public ThreadFlowLocation(int index, Location location, Stack stack, Set kinds, Set taxa, String module, State state, int nestingLevel, int executionOrder, Date executionTimeUtc, ThreadFlowLocation.Importance importance, WebRequest webRequest, WebResponse webResponse, PropertyBag properties) { - super(); - this.index = index; - this.location = location; - this.stack = stack; - this.kinds = kinds; - this.taxa = taxa; - this.module = module; - this.state = state; - this.nestingLevel = nestingLevel; - this.executionOrder = executionOrder; - this.executionTimeUtc = executionTimeUtc; - this.importance = importance; - this.webRequest = webRequest; - this.webResponse = webResponse; - this.properties = properties; - } - - /** - * The index within the run threadFlowLocations array. - */ - public int getIndex() { - return index; - } - - /** - * The index within the run threadFlowLocations array. - */ - public void setIndex(int index) { - this.index = index; - } - - public ThreadFlowLocation withIndex(int index) { - this.index = index; - return this; - } - - /** - * A location within a programming artifact. - */ - public Location getLocation() { - return location; - } - - /** - * A location within a programming artifact. - */ - public void setLocation(Location location) { - this.location = location; - } - - public ThreadFlowLocation withLocation(Location location) { - this.location = location; - return this; - } - - /** - * A call stack that is relevant to a result. - */ - public Stack getStack() { - return stack; - } - - /** - * A call stack that is relevant to a result. - */ - public void setStack(Stack stack) { - this.stack = stack; - } - - public ThreadFlowLocation withStack(Stack stack) { - this.stack = stack; - return this; - } - - /** - * A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. - */ - public Set getKinds() { - return kinds; - } - - /** - * A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. - */ - public void setKinds(Set kinds) { - this.kinds = kinds; - } - - public ThreadFlowLocation withKinds(Set kinds) { - this.kinds = kinds; - return this; - } - - /** - * An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. - */ - public Set getTaxa() { - return taxa; - } - - /** - * An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. - */ - public void setTaxa(Set taxa) { - this.taxa = taxa; - } - - public ThreadFlowLocation withTaxa(Set taxa) { - this.taxa = taxa; - return this; - } - - /** - * The name of the module that contains the code that is executing. - */ - public String getModule() { - return module; - } - - /** - * The name of the module that contains the code that is executing. - */ - public void setModule(String module) { - this.module = module; - } - - public ThreadFlowLocation withModule(String module) { - this.module = module; - return this; - } - - /** - * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - */ - public State getState() { - return state; - } - - /** - * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - */ - public void setState(State state) { - this.state = state; - } - - public ThreadFlowLocation withState(State state) { - this.state = state; - return this; - } - - /** - * An integer representing a containment hierarchy within the thread flow. - */ - public int getNestingLevel() { - return nestingLevel; - } - - /** - * An integer representing a containment hierarchy within the thread flow. - */ - public void setNestingLevel(int nestingLevel) { - this.nestingLevel = nestingLevel; - } - - public ThreadFlowLocation withNestingLevel(int nestingLevel) { - this.nestingLevel = nestingLevel; - return this; - } - - /** - * An integer representing the temporal order in which execution reached this location. - */ - public int getExecutionOrder() { - return executionOrder; - } - - /** - * An integer representing the temporal order in which execution reached this location. - */ - public void setExecutionOrder(int executionOrder) { - this.executionOrder = executionOrder; - } - - public ThreadFlowLocation withExecutionOrder(int executionOrder) { - this.executionOrder = executionOrder; - return this; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which this location was executed. - */ - public Date getExecutionTimeUtc() { - return executionTimeUtc; - } - - /** - * The Coordinated Universal Time (UTC) date and time at which this location was executed. - */ - public void setExecutionTimeUtc(Date executionTimeUtc) { - this.executionTimeUtc = executionTimeUtc; - } - - public ThreadFlowLocation withExecutionTimeUtc(Date executionTimeUtc) { - this.executionTimeUtc = executionTimeUtc; - return this; - } - - /** - * Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - */ - public ThreadFlowLocation.Importance getImportance() { - return importance; - } - - /** - * Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - */ - public void setImportance(ThreadFlowLocation.Importance importance) { - this.importance = importance; - } - - public ThreadFlowLocation withImportance(ThreadFlowLocation.Importance importance) { - this.importance = importance; - return this; - } - - /** - * Describes an HTTP request. - */ - public WebRequest getWebRequest() { - return webRequest; - } - - /** - * Describes an HTTP request. - */ - public void setWebRequest(WebRequest webRequest) { - this.webRequest = webRequest; - } - - public ThreadFlowLocation withWebRequest(WebRequest webRequest) { - this.webRequest = webRequest; - return this; - } - - /** - * Describes the response to an HTTP request. - */ - public WebResponse getWebResponse() { - return webResponse; - } - - /** - * Describes the response to an HTTP request. - */ - public void setWebResponse(WebResponse webResponse) { - this.webResponse = webResponse; - } - - public ThreadFlowLocation withWebResponse(WebResponse webResponse) { - this.webResponse = webResponse; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ThreadFlowLocation withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ThreadFlowLocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("location"); - sb.append('='); - sb.append(((this.location == null) ? "" : this.location)); - sb.append(','); - sb.append("stack"); - sb.append('='); - sb.append(((this.stack == null) ? "" : this.stack)); - sb.append(','); - sb.append("kinds"); - sb.append('='); - sb.append(((this.kinds == null) ? "" : this.kinds)); - sb.append(','); - sb.append("taxa"); - sb.append('='); - sb.append(((this.taxa == null) ? "" : this.taxa)); - sb.append(','); - sb.append("module"); - sb.append('='); - sb.append(((this.module == null) ? "" : this.module)); - sb.append(','); - sb.append("state"); - sb.append('='); - sb.append(((this.state == null) ? "" : this.state)); - sb.append(','); - sb.append("nestingLevel"); - sb.append('='); - sb.append(this.nestingLevel); - sb.append(','); - sb.append("executionOrder"); - sb.append('='); - sb.append(this.executionOrder); - sb.append(','); - sb.append("executionTimeUtc"); - sb.append('='); - sb.append(((this.executionTimeUtc == null) ? "" : this.executionTimeUtc)); - sb.append(','); - sb.append("importance"); - sb.append('='); - sb.append(((this.importance == null) ? "" : this.importance)); - sb.append(','); - sb.append("webRequest"); - sb.append('='); - sb.append(((this.webRequest == null) ? "" : this.webRequest)); - sb.append(','); - sb.append("webResponse"); - sb.append('='); - sb.append(((this.webResponse == null) ? "" : this.webResponse)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.taxa == null) ? 0 : this.taxa.hashCode())); - result = ((result * 31) + this.nestingLevel); - result = ((result * 31) + ((this.stack == null) ? 0 : this.stack.hashCode())); - result = ((result * 31) + ((this.webRequest == null) ? 0 : this.webRequest.hashCode())); - result = ((result * 31) + ((this.importance == null) ? 0 : this.importance.hashCode())); - result = ((result * 31) + ((this.module == null) ? 0 : this.module.hashCode())); - result = ((result * 31) + ((this.executionTimeUtc == null) ? 0 : this.executionTimeUtc.hashCode())); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.kinds == null) ? 0 : this.kinds.hashCode())); - result = ((result * 31) + this.executionOrder); - result = ((result * 31) + ((this.webResponse == null) ? 0 : this.webResponse.hashCode())); - result = ((result * 31) + ((this.location == null) ? 0 : this.location.hashCode())); - result = ((result * 31) + ((this.state == null) ? 0 : this.state.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ThreadFlowLocation) == false) { - return false; - } - ThreadFlowLocation rhs = ((ThreadFlowLocation) other); - return (((((((((((((((this.taxa == rhs.taxa) || ((this.taxa != null) && this.taxa.equals(rhs.taxa))) && (this.nestingLevel == rhs.nestingLevel)) && ((this.stack == rhs.stack) || ((this.stack != null) && this.stack.equals(rhs.stack)))) && ((this.webRequest == rhs.webRequest) || ((this.webRequest != null) && this.webRequest.equals(rhs.webRequest)))) && ((this.importance == rhs.importance) || ((this.importance != null) && this.importance.equals(rhs.importance)))) && ((this.module == rhs.module) || ((this.module != null) && this.module.equals(rhs.module)))) && ((this.executionTimeUtc == rhs.executionTimeUtc) || ((this.executionTimeUtc != null) && this.executionTimeUtc.equals(rhs.executionTimeUtc)))) && (this.index == rhs.index)) && ((this.kinds == rhs.kinds) || ((this.kinds != null) && this.kinds.equals(rhs.kinds)))) && (this.executionOrder == rhs.executionOrder)) && ((this.webResponse == rhs.webResponse) || ((this.webResponse != null) && this.webResponse.equals(rhs.webResponse)))) && ((this.location == rhs.location) || ((this.location != null) && this.location.equals(rhs.location)))) && ((this.state == rhs.state) || ((this.state != null) && this.state.equals(rhs.state)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - - - /** - * Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - */ - @Generated("jsonschema2pojo") - public enum Importance { - - @SerializedName("important") - IMPORTANT("important"), - @SerializedName("essential") - ESSENTIAL("essential"), - @SerializedName("unimportant") - UNIMPORTANT("unimportant"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (ThreadFlowLocation.Importance c : values()) { - CONSTANTS.put(c.value, c); - } - } - - Importance(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - public String value() { - return this.value; - } - - public static ThreadFlowLocation.Importance fromValue(String value) { - ThreadFlowLocation.Importance constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Tool.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Tool.java deleted file mode 100644 index 76feda4c56..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/Tool.java +++ /dev/null @@ -1,160 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.util.LinkedHashSet; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * The analysis tool that was run. - */ -@Generated("jsonschema2pojo") -public class Tool { - - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - * (Required) - */ - @SerializedName("driver") - @Expose - private ToolComponent driver; - /** - * Tool extensions that contributed to or reconfigured the analysis tool that was run. - */ - @SerializedName("extensions") - @Expose - private Set extensions = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public Tool() { - } - - /** - * @param extensions - * @param driver - * @param properties - */ - public Tool(ToolComponent driver, Set extensions, PropertyBag properties) { - super(); - this.driver = driver; - this.extensions = extensions; - this.properties = properties; - } - - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - * (Required) - */ - public ToolComponent getDriver() { - return driver; - } - - /** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - * (Required) - */ - public void setDriver(ToolComponent driver) { - this.driver = driver; - } - - public Tool withDriver(ToolComponent driver) { - this.driver = driver; - return this; - } - - /** - * Tool extensions that contributed to or reconfigured the analysis tool that was run. - */ - public Set getExtensions() { - return extensions; - } - - /** - * Tool extensions that contributed to or reconfigured the analysis tool that was run. - */ - public void setExtensions(Set extensions) { - this.extensions = extensions; - } - - public Tool withExtensions(Set extensions) { - this.extensions = extensions; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public Tool withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(Tool.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("driver"); - sb.append('='); - sb.append(((this.driver == null) ? "" : this.driver)); - sb.append(','); - sb.append("extensions"); - sb.append('='); - sb.append(((this.extensions == null) ? "" : this.extensions)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.driver == null) ? 0 : this.driver.hashCode())); - result = ((result * 31) + ((this.extensions == null) ? 0 : this.extensions.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Tool) == false) { - return false; - } - Tool rhs = ((Tool) other); - return ((((this.driver == rhs.driver) || ((this.driver != null) && this.driver.equals(rhs.driver))) && ((this.extensions == rhs.extensions) || ((this.extensions != null) && this.extensions.equals(rhs.extensions)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponent.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponent.java deleted file mode 100644 index 3da488b038..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponent.java +++ /dev/null @@ -1,964 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * A component, such as a plug-in or the driver, of the analysis tool that was run. - */ -@Generated("jsonschema2pojo") -public class ToolComponent { - - /** - * A unique identifer for the tool component in the form of a GUID. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * The name of the tool component. - * (Required) - */ - @SerializedName("name") - @Expose - private String name; - /** - * The organization or company that produced the tool component. - */ - @SerializedName("organization") - @Expose - private String organization; - /** - * A product suite to which the tool component belongs. - */ - @SerializedName("product") - @Expose - private String product; - /** - * A localizable string containing the name of the suite of products to which the tool component belongs. - */ - @SerializedName("productSuite") - @Expose - private String productSuite; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("shortDescription") - @Expose - private MultiformatMessageString shortDescription; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("fullDescription") - @Expose - private MultiformatMessageString fullDescription; - /** - * The name of the tool component along with its version and any other useful identifying information, such as its locale. - */ - @SerializedName("fullName") - @Expose - private String fullName; - /** - * The tool component version, in whatever format the component natively provides. - */ - @SerializedName("version") - @Expose - private String version; - /** - * The tool component version in the format specified by Semantic Versioning 2.0. - */ - @SerializedName("semanticVersion") - @Expose - private String semanticVersion; - /** - * The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). - */ - @SerializedName("dottedQuadFileVersion") - @Expose - private String dottedQuadFileVersion; - /** - * A string specifying the UTC date (and optionally, the time) of the component's release. - */ - @SerializedName("releaseDateUtc") - @Expose - private String releaseDateUtc; - /** - * The absolute URI from which the tool component can be downloaded. - */ - @SerializedName("downloadUri") - @Expose - private URI downloadUri; - /** - * The absolute URI at which information about this version of the tool component can be found. - */ - @SerializedName("informationUri") - @Expose - private URI informationUri; - /** - * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - @SerializedName("globalMessageStrings") - @Expose - private GlobalMessageStrings globalMessageStrings; - /** - * An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. - */ - @SerializedName("notifications") - @Expose - private Set notifications = new LinkedHashSet(); - /** - * An array of reportingDescriptor objects relevant to the analysis performed by the tool component. - */ - @SerializedName("rules") - @Expose - private Set rules = new LinkedHashSet(); - /** - * An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. - */ - @SerializedName("taxa") - @Expose - private Set taxa = new LinkedHashSet(); - /** - * An array of the artifactLocation objects associated with the tool component. - */ - @SerializedName("locations") - @Expose - private List locations = new ArrayList(); - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - @SerializedName("language") - @Expose - private String language = "en-US"; - /** - * The kinds of data contained in this object. - */ - @SerializedName("contents") - @Expose - private Set contents = new LinkedHashSet(Arrays.asList(null, null)); - /** - * Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. - */ - @SerializedName("isComprehensive") - @Expose - private boolean isComprehensive = false; - /** - * The semantic version of the localized strings defined in this component; maintained by components that provide translations. - */ - @SerializedName("localizedDataSemanticVersion") - @Expose - private String localizedDataSemanticVersion; - /** - * The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. - */ - @SerializedName("minimumRequiredLocalizedDataSemanticVersion") - @Expose - private String minimumRequiredLocalizedDataSemanticVersion; - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - @SerializedName("associatedComponent") - @Expose - private ToolComponentReference associatedComponent; - /** - * Provides additional metadata related to translation. - */ - @SerializedName("translationMetadata") - @Expose - private TranslationMetadata translationMetadata; - /** - * An array of toolComponentReference objects to declare the taxonomies supported by the tool component. - */ - @SerializedName("supportedTaxonomies") - @Expose - private Set supportedTaxonomies = new LinkedHashSet(); - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ToolComponent() { - } - - /** - * @param releaseDateUtc - * @param rules - * @param language - * @param downloadUri - * @param supportedTaxonomies - * @param fullDescription - * @param informationUri - * @param associatedComponent - * @param translationMetadata - * @param productSuite - * @param taxa - * @param product - * @param isComprehensive - * @param minimumRequiredLocalizedDataSemanticVersion - * @param fullName - * @param shortDescription - * @param version - * @param globalMessageStrings - * @param localizedDataSemanticVersion - * @param dottedQuadFileVersion - * @param contents - * @param organization - * @param name - * @param semanticVersion - * @param guid - * @param locations - * @param notifications - * @param properties - */ - public ToolComponent(String guid, String name, String organization, String product, String productSuite, MultiformatMessageString shortDescription, MultiformatMessageString fullDescription, String fullName, String version, String semanticVersion, String dottedQuadFileVersion, String releaseDateUtc, URI downloadUri, URI informationUri, GlobalMessageStrings globalMessageStrings, Set notifications, Set rules, Set taxa, List locations, String language, Set contents, boolean isComprehensive, String localizedDataSemanticVersion, String minimumRequiredLocalizedDataSemanticVersion, ToolComponentReference associatedComponent, TranslationMetadata translationMetadata, Set supportedTaxonomies, PropertyBag properties) { - super(); - this.guid = guid; - this.name = name; - this.organization = organization; - this.product = product; - this.productSuite = productSuite; - this.shortDescription = shortDescription; - this.fullDescription = fullDescription; - this.fullName = fullName; - this.version = version; - this.semanticVersion = semanticVersion; - this.dottedQuadFileVersion = dottedQuadFileVersion; - this.releaseDateUtc = releaseDateUtc; - this.downloadUri = downloadUri; - this.informationUri = informationUri; - this.globalMessageStrings = globalMessageStrings; - this.notifications = notifications; - this.rules = rules; - this.taxa = taxa; - this.locations = locations; - this.language = language; - this.contents = contents; - this.isComprehensive = isComprehensive; - this.localizedDataSemanticVersion = localizedDataSemanticVersion; - this.minimumRequiredLocalizedDataSemanticVersion = minimumRequiredLocalizedDataSemanticVersion; - this.associatedComponent = associatedComponent; - this.translationMetadata = translationMetadata; - this.supportedTaxonomies = supportedTaxonomies; - this.properties = properties; - } - - /** - * A unique identifer for the tool component in the form of a GUID. - */ - public String getGuid() { - return guid; - } - - /** - * A unique identifer for the tool component in the form of a GUID. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ToolComponent withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * The name of the tool component. - * (Required) - */ - public String getName() { - return name; - } - - /** - * The name of the tool component. - * (Required) - */ - public void setName(String name) { - this.name = name; - } - - public ToolComponent withName(String name) { - this.name = name; - return this; - } - - /** - * The organization or company that produced the tool component. - */ - public String getOrganization() { - return organization; - } - - /** - * The organization or company that produced the tool component. - */ - public void setOrganization(String organization) { - this.organization = organization; - } - - public ToolComponent withOrganization(String organization) { - this.organization = organization; - return this; - } - - /** - * A product suite to which the tool component belongs. - */ - public String getProduct() { - return product; - } - - /** - * A product suite to which the tool component belongs. - */ - public void setProduct(String product) { - this.product = product; - } - - public ToolComponent withProduct(String product) { - this.product = product; - return this; - } - - /** - * A localizable string containing the name of the suite of products to which the tool component belongs. - */ - public String getProductSuite() { - return productSuite; - } - - /** - * A localizable string containing the name of the suite of products to which the tool component belongs. - */ - public void setProductSuite(String productSuite) { - this.productSuite = productSuite; - } - - public ToolComponent withProductSuite(String productSuite) { - this.productSuite = productSuite; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getShortDescription() { - return shortDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - } - - public ToolComponent withShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getFullDescription() { - return fullDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - } - - public ToolComponent withFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - return this; - } - - /** - * The name of the tool component along with its version and any other useful identifying information, such as its locale. - */ - public String getFullName() { - return fullName; - } - - /** - * The name of the tool component along with its version and any other useful identifying information, such as its locale. - */ - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public ToolComponent withFullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * The tool component version, in whatever format the component natively provides. - */ - public String getVersion() { - return version; - } - - /** - * The tool component version, in whatever format the component natively provides. - */ - public void setVersion(String version) { - this.version = version; - } - - public ToolComponent withVersion(String version) { - this.version = version; - return this; - } - - /** - * The tool component version in the format specified by Semantic Versioning 2.0. - */ - public String getSemanticVersion() { - return semanticVersion; - } - - /** - * The tool component version in the format specified by Semantic Versioning 2.0. - */ - public void setSemanticVersion(String semanticVersion) { - this.semanticVersion = semanticVersion; - } - - public ToolComponent withSemanticVersion(String semanticVersion) { - this.semanticVersion = semanticVersion; - return this; - } - - /** - * The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). - */ - public String getDottedQuadFileVersion() { - return dottedQuadFileVersion; - } - - /** - * The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). - */ - public void setDottedQuadFileVersion(String dottedQuadFileVersion) { - this.dottedQuadFileVersion = dottedQuadFileVersion; - } - - public ToolComponent withDottedQuadFileVersion(String dottedQuadFileVersion) { - this.dottedQuadFileVersion = dottedQuadFileVersion; - return this; - } - - /** - * A string specifying the UTC date (and optionally, the time) of the component's release. - */ - public String getReleaseDateUtc() { - return releaseDateUtc; - } - - /** - * A string specifying the UTC date (and optionally, the time) of the component's release. - */ - public void setReleaseDateUtc(String releaseDateUtc) { - this.releaseDateUtc = releaseDateUtc; - } - - public ToolComponent withReleaseDateUtc(String releaseDateUtc) { - this.releaseDateUtc = releaseDateUtc; - return this; - } - - /** - * The absolute URI from which the tool component can be downloaded. - */ - public URI getDownloadUri() { - return downloadUri; - } - - /** - * The absolute URI from which the tool component can be downloaded. - */ - public void setDownloadUri(URI downloadUri) { - this.downloadUri = downloadUri; - } - - public ToolComponent withDownloadUri(URI downloadUri) { - this.downloadUri = downloadUri; - return this; - } - - /** - * The absolute URI at which information about this version of the tool component can be found. - */ - public URI getInformationUri() { - return informationUri; - } - - /** - * The absolute URI at which information about this version of the tool component can be found. - */ - public void setInformationUri(URI informationUri) { - this.informationUri = informationUri; - } - - public ToolComponent withInformationUri(URI informationUri) { - this.informationUri = informationUri; - return this; - } - - /** - * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - public GlobalMessageStrings getGlobalMessageStrings() { - return globalMessageStrings; - } - - /** - * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - */ - public void setGlobalMessageStrings(GlobalMessageStrings globalMessageStrings) { - this.globalMessageStrings = globalMessageStrings; - } - - public ToolComponent withGlobalMessageStrings(GlobalMessageStrings globalMessageStrings) { - this.globalMessageStrings = globalMessageStrings; - return this; - } - - /** - * An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. - */ - public Set getNotifications() { - return notifications; - } - - /** - * An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. - */ - public void setNotifications(Set notifications) { - this.notifications = notifications; - } - - public ToolComponent withNotifications(Set notifications) { - this.notifications = notifications; - return this; - } - - /** - * An array of reportingDescriptor objects relevant to the analysis performed by the tool component. - */ - public Set getRules() { - return rules; - } - - /** - * An array of reportingDescriptor objects relevant to the analysis performed by the tool component. - */ - public void setRules(Set rules) { - this.rules = rules; - } - - public ToolComponent withRules(Set rules) { - this.rules = rules; - return this; - } - - /** - * An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. - */ - public Set getTaxa() { - return taxa; - } - - /** - * An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. - */ - public void setTaxa(Set taxa) { - this.taxa = taxa; - } - - public ToolComponent withTaxa(Set taxa) { - this.taxa = taxa; - return this; - } - - /** - * An array of the artifactLocation objects associated with the tool component. - */ - public List getLocations() { - return locations; - } - - /** - * An array of the artifactLocation objects associated with the tool component. - */ - public void setLocations(List locations) { - this.locations = locations; - } - - public ToolComponent withLocations(List locations) { - this.locations = locations; - return this; - } - - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - public String getLanguage() { - return language; - } - - /** - * The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - */ - public void setLanguage(String language) { - this.language = language; - } - - public ToolComponent withLanguage(String language) { - this.language = language; - return this; - } - - /** - * The kinds of data contained in this object. - */ - public Set getContents() { - return contents; - } - - /** - * The kinds of data contained in this object. - */ - public void setContents(Set contents) { - this.contents = contents; - } - - public ToolComponent withContents(Set contents) { - this.contents = contents; - return this; - } - - /** - * Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. - */ - public boolean isIsComprehensive() { - return isComprehensive; - } - - /** - * Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. - */ - public void setIsComprehensive(boolean isComprehensive) { - this.isComprehensive = isComprehensive; - } - - public ToolComponent withIsComprehensive(boolean isComprehensive) { - this.isComprehensive = isComprehensive; - return this; - } - - /** - * The semantic version of the localized strings defined in this component; maintained by components that provide translations. - */ - public String getLocalizedDataSemanticVersion() { - return localizedDataSemanticVersion; - } - - /** - * The semantic version of the localized strings defined in this component; maintained by components that provide translations. - */ - public void setLocalizedDataSemanticVersion(String localizedDataSemanticVersion) { - this.localizedDataSemanticVersion = localizedDataSemanticVersion; - } - - public ToolComponent withLocalizedDataSemanticVersion(String localizedDataSemanticVersion) { - this.localizedDataSemanticVersion = localizedDataSemanticVersion; - return this; - } - - /** - * The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. - */ - public String getMinimumRequiredLocalizedDataSemanticVersion() { - return minimumRequiredLocalizedDataSemanticVersion; - } - - /** - * The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. - */ - public void setMinimumRequiredLocalizedDataSemanticVersion(String minimumRequiredLocalizedDataSemanticVersion) { - this.minimumRequiredLocalizedDataSemanticVersion = minimumRequiredLocalizedDataSemanticVersion; - } - - public ToolComponent withMinimumRequiredLocalizedDataSemanticVersion(String minimumRequiredLocalizedDataSemanticVersion) { - this.minimumRequiredLocalizedDataSemanticVersion = minimumRequiredLocalizedDataSemanticVersion; - return this; - } - - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - public ToolComponentReference getAssociatedComponent() { - return associatedComponent; - } - - /** - * Identifies a particular toolComponent object, either the driver or an extension. - */ - public void setAssociatedComponent(ToolComponentReference associatedComponent) { - this.associatedComponent = associatedComponent; - } - - public ToolComponent withAssociatedComponent(ToolComponentReference associatedComponent) { - this.associatedComponent = associatedComponent; - return this; - } - - /** - * Provides additional metadata related to translation. - */ - public TranslationMetadata getTranslationMetadata() { - return translationMetadata; - } - - /** - * Provides additional metadata related to translation. - */ - public void setTranslationMetadata(TranslationMetadata translationMetadata) { - this.translationMetadata = translationMetadata; - } - - public ToolComponent withTranslationMetadata(TranslationMetadata translationMetadata) { - this.translationMetadata = translationMetadata; - return this; - } - - /** - * An array of toolComponentReference objects to declare the taxonomies supported by the tool component. - */ - public Set getSupportedTaxonomies() { - return supportedTaxonomies; - } - - /** - * An array of toolComponentReference objects to declare the taxonomies supported by the tool component. - */ - public void setSupportedTaxonomies(Set supportedTaxonomies) { - this.supportedTaxonomies = supportedTaxonomies; - } - - public ToolComponent withSupportedTaxonomies(Set supportedTaxonomies) { - this.supportedTaxonomies = supportedTaxonomies; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ToolComponent withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ToolComponent.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("organization"); - sb.append('='); - sb.append(((this.organization == null) ? "" : this.organization)); - sb.append(','); - sb.append("product"); - sb.append('='); - sb.append(((this.product == null) ? "" : this.product)); - sb.append(','); - sb.append("productSuite"); - sb.append('='); - sb.append(((this.productSuite == null) ? "" : this.productSuite)); - sb.append(','); - sb.append("shortDescription"); - sb.append('='); - sb.append(((this.shortDescription == null) ? "" : this.shortDescription)); - sb.append(','); - sb.append("fullDescription"); - sb.append('='); - sb.append(((this.fullDescription == null) ? "" : this.fullDescription)); - sb.append(','); - sb.append("fullName"); - sb.append('='); - sb.append(((this.fullName == null) ? "" : this.fullName)); - sb.append(','); - sb.append("version"); - sb.append('='); - sb.append(((this.version == null) ? "" : this.version)); - sb.append(','); - sb.append("semanticVersion"); - sb.append('='); - sb.append(((this.semanticVersion == null) ? "" : this.semanticVersion)); - sb.append(','); - sb.append("dottedQuadFileVersion"); - sb.append('='); - sb.append(((this.dottedQuadFileVersion == null) ? "" : this.dottedQuadFileVersion)); - sb.append(','); - sb.append("releaseDateUtc"); - sb.append('='); - sb.append(((this.releaseDateUtc == null) ? "" : this.releaseDateUtc)); - sb.append(','); - sb.append("downloadUri"); - sb.append('='); - sb.append(((this.downloadUri == null) ? "" : this.downloadUri)); - sb.append(','); - sb.append("informationUri"); - sb.append('='); - sb.append(((this.informationUri == null) ? "" : this.informationUri)); - sb.append(','); - sb.append("globalMessageStrings"); - sb.append('='); - sb.append(((this.globalMessageStrings == null) ? "" : this.globalMessageStrings)); - sb.append(','); - sb.append("notifications"); - sb.append('='); - sb.append(((this.notifications == null) ? "" : this.notifications)); - sb.append(','); - sb.append("rules"); - sb.append('='); - sb.append(((this.rules == null) ? "" : this.rules)); - sb.append(','); - sb.append("taxa"); - sb.append('='); - sb.append(((this.taxa == null) ? "" : this.taxa)); - sb.append(','); - sb.append("locations"); - sb.append('='); - sb.append(((this.locations == null) ? "" : this.locations)); - sb.append(','); - sb.append("language"); - sb.append('='); - sb.append(((this.language == null) ? "" : this.language)); - sb.append(','); - sb.append("contents"); - sb.append('='); - sb.append(((this.contents == null) ? "" : this.contents)); - sb.append(','); - sb.append("isComprehensive"); - sb.append('='); - sb.append(this.isComprehensive); - sb.append(','); - sb.append("localizedDataSemanticVersion"); - sb.append('='); - sb.append(((this.localizedDataSemanticVersion == null) ? "" : this.localizedDataSemanticVersion)); - sb.append(','); - sb.append("minimumRequiredLocalizedDataSemanticVersion"); - sb.append('='); - sb.append(((this.minimumRequiredLocalizedDataSemanticVersion == null) ? "" : this.minimumRequiredLocalizedDataSemanticVersion)); - sb.append(','); - sb.append("associatedComponent"); - sb.append('='); - sb.append(((this.associatedComponent == null) ? "" : this.associatedComponent)); - sb.append(','); - sb.append("translationMetadata"); - sb.append('='); - sb.append(((this.translationMetadata == null) ? "" : this.translationMetadata)); - sb.append(','); - sb.append("supportedTaxonomies"); - sb.append('='); - sb.append(((this.supportedTaxonomies == null) ? "" : this.supportedTaxonomies)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.releaseDateUtc == null) ? 0 : this.releaseDateUtc.hashCode())); - result = ((result * 31) + ((this.rules == null) ? 0 : this.rules.hashCode())); - result = ((result * 31) + ((this.language == null) ? 0 : this.language.hashCode())); - result = ((result * 31) + ((this.downloadUri == null) ? 0 : this.downloadUri.hashCode())); - result = ((result * 31) + ((this.supportedTaxonomies == null) ? 0 : this.supportedTaxonomies.hashCode())); - result = ((result * 31) + ((this.fullDescription == null) ? 0 : this.fullDescription.hashCode())); - result = ((result * 31) + ((this.informationUri == null) ? 0 : this.informationUri.hashCode())); - result = ((result * 31) + ((this.associatedComponent == null) ? 0 : this.associatedComponent.hashCode())); - result = ((result * 31) + ((this.translationMetadata == null) ? 0 : this.translationMetadata.hashCode())); - result = ((result * 31) + ((this.productSuite == null) ? 0 : this.productSuite.hashCode())); - result = ((result * 31) + ((this.taxa == null) ? 0 : this.taxa.hashCode())); - result = ((result * 31) + ((this.product == null) ? 0 : this.product.hashCode())); - result = ((result * 31) + (this.isComprehensive ? 1 : 0)); - result = ((result * 31) + ((this.minimumRequiredLocalizedDataSemanticVersion == null) ? 0 : this.minimumRequiredLocalizedDataSemanticVersion.hashCode())); - result = ((result * 31) + ((this.fullName == null) ? 0 : this.fullName.hashCode())); - result = ((result * 31) + ((this.shortDescription == null) ? 0 : this.shortDescription.hashCode())); - result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); - result = ((result * 31) + ((this.globalMessageStrings == null) ? 0 : this.globalMessageStrings.hashCode())); - result = ((result * 31) + ((this.localizedDataSemanticVersion == null) ? 0 : this.localizedDataSemanticVersion.hashCode())); - result = ((result * 31) + ((this.dottedQuadFileVersion == null) ? 0 : this.dottedQuadFileVersion.hashCode())); - result = ((result * 31) + ((this.contents == null) ? 0 : this.contents.hashCode())); - result = ((result * 31) + ((this.organization == null) ? 0 : this.organization.hashCode())); - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + ((this.semanticVersion == null) ? 0 : this.semanticVersion.hashCode())); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.locations == null) ? 0 : this.locations.hashCode())); - result = ((result * 31) + ((this.notifications == null) ? 0 : this.notifications.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ToolComponent) == false) { - return false; - } - ToolComponent rhs = ((ToolComponent) other); - return (((((((((((((((((((((((((((((this.releaseDateUtc == rhs.releaseDateUtc) || ((this.releaseDateUtc != null) && this.releaseDateUtc.equals(rhs.releaseDateUtc))) && ((this.rules == rhs.rules) || ((this.rules != null) && this.rules.equals(rhs.rules)))) && ((this.language == rhs.language) || ((this.language != null) && this.language.equals(rhs.language)))) && ((this.downloadUri == rhs.downloadUri) || ((this.downloadUri != null) && this.downloadUri.equals(rhs.downloadUri)))) && ((this.supportedTaxonomies == rhs.supportedTaxonomies) || ((this.supportedTaxonomies != null) && this.supportedTaxonomies.equals(rhs.supportedTaxonomies)))) && ((this.fullDescription == rhs.fullDescription) || ((this.fullDescription != null) && this.fullDescription.equals(rhs.fullDescription)))) && ((this.informationUri == rhs.informationUri) || ((this.informationUri != null) && this.informationUri.equals(rhs.informationUri)))) && ((this.associatedComponent == rhs.associatedComponent) || ((this.associatedComponent != null) && this.associatedComponent.equals(rhs.associatedComponent)))) && ((this.translationMetadata == rhs.translationMetadata) || ((this.translationMetadata != null) && this.translationMetadata.equals(rhs.translationMetadata)))) && ((this.productSuite == rhs.productSuite) || ((this.productSuite != null) && this.productSuite.equals(rhs.productSuite)))) && ((this.taxa == rhs.taxa) || ((this.taxa != null) && this.taxa.equals(rhs.taxa)))) && ((this.product == rhs.product) || ((this.product != null) && this.product.equals(rhs.product)))) && (this.isComprehensive == rhs.isComprehensive)) && ((this.minimumRequiredLocalizedDataSemanticVersion == rhs.minimumRequiredLocalizedDataSemanticVersion) || ((this.minimumRequiredLocalizedDataSemanticVersion != null) && this.minimumRequiredLocalizedDataSemanticVersion.equals(rhs.minimumRequiredLocalizedDataSemanticVersion)))) && ((this.fullName == rhs.fullName) || ((this.fullName != null) && this.fullName.equals(rhs.fullName)))) && ((this.shortDescription == rhs.shortDescription) || ((this.shortDescription != null) && this.shortDescription.equals(rhs.shortDescription)))) && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) && ((this.globalMessageStrings == rhs.globalMessageStrings) || ((this.globalMessageStrings != null) && this.globalMessageStrings.equals(rhs.globalMessageStrings)))) && ((this.localizedDataSemanticVersion == rhs.localizedDataSemanticVersion) || ((this.localizedDataSemanticVersion != null) && this.localizedDataSemanticVersion.equals(rhs.localizedDataSemanticVersion)))) && ((this.dottedQuadFileVersion == rhs.dottedQuadFileVersion) || ((this.dottedQuadFileVersion != null) && this.dottedQuadFileVersion.equals(rhs.dottedQuadFileVersion)))) && ((this.contents == rhs.contents) || ((this.contents != null) && this.contents.equals(rhs.contents)))) && ((this.organization == rhs.organization) || ((this.organization != null) && this.organization.equals(rhs.organization)))) && ((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name)))) && ((this.semanticVersion == rhs.semanticVersion) || ((this.semanticVersion != null) && this.semanticVersion.equals(rhs.semanticVersion)))) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.locations == rhs.locations) || ((this.locations != null) && this.locations.equals(rhs.locations)))) && ((this.notifications == rhs.notifications) || ((this.notifications != null) && this.notifications.equals(rhs.notifications)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponentReference.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponentReference.java deleted file mode 100644 index bf2a2ea31f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/ToolComponentReference.java +++ /dev/null @@ -1,187 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Identifies a particular toolComponent object, either the driver or an extension. - */ -@Generated("jsonschema2pojo") -public class ToolComponentReference { - - /** - * The 'name' property of the referenced toolComponent. - */ - @SerializedName("name") - @Expose - private String name; - /** - * An index into the referenced toolComponent in tool.extensions. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * The 'guid' property of the referenced toolComponent. - */ - @SerializedName("guid") - @Expose - private String guid; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public ToolComponentReference() { - } - - /** - * @param name - * @param index - * @param guid - * @param properties - */ - public ToolComponentReference(String name, int index, String guid, PropertyBag properties) { - super(); - this.name = name; - this.index = index; - this.guid = guid; - this.properties = properties; - } - - /** - * The 'name' property of the referenced toolComponent. - */ - public String getName() { - return name; - } - - /** - * The 'name' property of the referenced toolComponent. - */ - public void setName(String name) { - this.name = name; - } - - public ToolComponentReference withName(String name) { - this.name = name; - return this; - } - - /** - * An index into the referenced toolComponent in tool.extensions. - */ - public int getIndex() { - return index; - } - - /** - * An index into the referenced toolComponent in tool.extensions. - */ - public void setIndex(int index) { - this.index = index; - } - - public ToolComponentReference withIndex(int index) { - this.index = index; - return this; - } - - /** - * The 'guid' property of the referenced toolComponent. - */ - public String getGuid() { - return guid; - } - - /** - * The 'guid' property of the referenced toolComponent. - */ - public void setGuid(String guid) { - this.guid = guid; - } - - public ToolComponentReference withGuid(String guid) { - this.guid = guid; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public ToolComponentReference withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(ToolComponentReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("guid"); - sb.append('='); - sb.append(((this.guid == null) ? "" : this.guid)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.guid == null) ? 0 : this.guid.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof ToolComponentReference) == false) { - return false; - } - ToolComponentReference rhs = ((ToolComponentReference) other); - return (((((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name))) && (this.index == rhs.index)) && ((this.guid == rhs.guid) || ((this.guid != null) && this.guid.equals(rhs.guid)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/TranslationMetadata.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/TranslationMetadata.java deleted file mode 100644 index 3bdad013e4..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/TranslationMetadata.java +++ /dev/null @@ -1,287 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Provides additional metadata related to translation. - */ -@Generated("jsonschema2pojo") -public class TranslationMetadata { - - /** - * The name associated with the translation metadata. - * (Required) - */ - @SerializedName("name") - @Expose - private String name; - /** - * The full name associated with the translation metadata. - */ - @SerializedName("fullName") - @Expose - private String fullName; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("shortDescription") - @Expose - private MultiformatMessageString shortDescription; - /** - * A message string or message format string rendered in multiple formats. - */ - @SerializedName("fullDescription") - @Expose - private MultiformatMessageString fullDescription; - /** - * The absolute URI from which the translation metadata can be downloaded. - */ - @SerializedName("downloadUri") - @Expose - private URI downloadUri; - /** - * The absolute URI from which information related to the translation metadata can be downloaded. - */ - @SerializedName("informationUri") - @Expose - private URI informationUri; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public TranslationMetadata() { - } - - /** - * @param name - * @param fullName - * @param shortDescription - * @param downloadUri - * @param fullDescription - * @param informationUri - * @param properties - */ - public TranslationMetadata(String name, String fullName, MultiformatMessageString shortDescription, MultiformatMessageString fullDescription, URI downloadUri, URI informationUri, PropertyBag properties) { - super(); - this.name = name; - this.fullName = fullName; - this.shortDescription = shortDescription; - this.fullDescription = fullDescription; - this.downloadUri = downloadUri; - this.informationUri = informationUri; - this.properties = properties; - } - - /** - * The name associated with the translation metadata. - * (Required) - */ - public String getName() { - return name; - } - - /** - * The name associated with the translation metadata. - * (Required) - */ - public void setName(String name) { - this.name = name; - } - - public TranslationMetadata withName(String name) { - this.name = name; - return this; - } - - /** - * The full name associated with the translation metadata. - */ - public String getFullName() { - return fullName; - } - - /** - * The full name associated with the translation metadata. - */ - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public TranslationMetadata withFullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getShortDescription() { - return shortDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - } - - public TranslationMetadata withShortDescription(MultiformatMessageString shortDescription) { - this.shortDescription = shortDescription; - return this; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public MultiformatMessageString getFullDescription() { - return fullDescription; - } - - /** - * A message string or message format string rendered in multiple formats. - */ - public void setFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - } - - public TranslationMetadata withFullDescription(MultiformatMessageString fullDescription) { - this.fullDescription = fullDescription; - return this; - } - - /** - * The absolute URI from which the translation metadata can be downloaded. - */ - public URI getDownloadUri() { - return downloadUri; - } - - /** - * The absolute URI from which the translation metadata can be downloaded. - */ - public void setDownloadUri(URI downloadUri) { - this.downloadUri = downloadUri; - } - - public TranslationMetadata withDownloadUri(URI downloadUri) { - this.downloadUri = downloadUri; - return this; - } - - /** - * The absolute URI from which information related to the translation metadata can be downloaded. - */ - public URI getInformationUri() { - return informationUri; - } - - /** - * The absolute URI from which information related to the translation metadata can be downloaded. - */ - public void setInformationUri(URI informationUri) { - this.informationUri = informationUri; - } - - public TranslationMetadata withInformationUri(URI informationUri) { - this.informationUri = informationUri; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public TranslationMetadata withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(TranslationMetadata.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("name"); - sb.append('='); - sb.append(((this.name == null) ? "" : this.name)); - sb.append(','); - sb.append("fullName"); - sb.append('='); - sb.append(((this.fullName == null) ? "" : this.fullName)); - sb.append(','); - sb.append("shortDescription"); - sb.append('='); - sb.append(((this.shortDescription == null) ? "" : this.shortDescription)); - sb.append(','); - sb.append("fullDescription"); - sb.append('='); - sb.append(((this.fullDescription == null) ? "" : this.fullDescription)); - sb.append(','); - sb.append("downloadUri"); - sb.append('='); - sb.append(((this.downloadUri == null) ? "" : this.downloadUri)); - sb.append(','); - sb.append("informationUri"); - sb.append('='); - sb.append(((this.informationUri == null) ? "" : this.informationUri)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.name == null) ? 0 : this.name.hashCode())); - result = ((result * 31) + ((this.fullName == null) ? 0 : this.fullName.hashCode())); - result = ((result * 31) + ((this.shortDescription == null) ? 0 : this.shortDescription.hashCode())); - result = ((result * 31) + ((this.downloadUri == null) ? 0 : this.downloadUri.hashCode())); - result = ((result * 31) + ((this.fullDescription == null) ? 0 : this.fullDescription.hashCode())); - result = ((result * 31) + ((this.informationUri == null) ? 0 : this.informationUri.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof TranslationMetadata) == false) { - return false; - } - TranslationMetadata rhs = ((TranslationMetadata) other); - return ((((((((this.name == rhs.name) || ((this.name != null) && this.name.equals(rhs.name))) && ((this.fullName == rhs.fullName) || ((this.fullName != null) && this.fullName.equals(rhs.fullName)))) && ((this.shortDescription == rhs.shortDescription) || ((this.shortDescription != null) && this.shortDescription.equals(rhs.shortDescription)))) && ((this.downloadUri == rhs.downloadUri) || ((this.downloadUri != null) && this.downloadUri.equals(rhs.downloadUri)))) && ((this.fullDescription == rhs.fullDescription) || ((this.fullDescription != null) && this.fullDescription.equals(rhs.fullDescription)))) && ((this.informationUri == rhs.informationUri) || ((this.informationUri != null) && this.informationUri.equals(rhs.informationUri)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/VersionControlDetails.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/VersionControlDetails.java deleted file mode 100644 index 23fabf604c..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/VersionControlDetails.java +++ /dev/null @@ -1,288 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import java.net.URI; -import java.util.Date; -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Specifies the information necessary to retrieve a desired revision from a version control system. - */ -@Generated("jsonschema2pojo") -public class VersionControlDetails { - - /** - * The absolute URI of the repository. - * (Required) - */ - @SerializedName("repositoryUri") - @Expose - private URI repositoryUri; - /** - * A string that uniquely and permanently identifies the revision within the repository. - */ - @SerializedName("revisionId") - @Expose - private String revisionId; - /** - * The name of a branch containing the revision. - */ - @SerializedName("branch") - @Expose - private String branch; - /** - * A tag that has been applied to the revision. - */ - @SerializedName("revisionTag") - @Expose - private String revisionTag; - /** - * A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. - */ - @SerializedName("asOfTimeUtc") - @Expose - private Date asOfTimeUtc; - /** - * Specifies the location of an artifact. - */ - @SerializedName("mappedTo") - @Expose - private ArtifactLocation mappedTo; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public VersionControlDetails() { - } - - /** - * @param revisionId - * @param repositoryUri - * @param mappedTo - * @param branch - * @param asOfTimeUtc - * @param properties - * @param revisionTag - */ - public VersionControlDetails(URI repositoryUri, String revisionId, String branch, String revisionTag, Date asOfTimeUtc, ArtifactLocation mappedTo, PropertyBag properties) { - super(); - this.repositoryUri = repositoryUri; - this.revisionId = revisionId; - this.branch = branch; - this.revisionTag = revisionTag; - this.asOfTimeUtc = asOfTimeUtc; - this.mappedTo = mappedTo; - this.properties = properties; - } - - /** - * The absolute URI of the repository. - * (Required) - */ - public URI getRepositoryUri() { - return repositoryUri; - } - - /** - * The absolute URI of the repository. - * (Required) - */ - public void setRepositoryUri(URI repositoryUri) { - this.repositoryUri = repositoryUri; - } - - public VersionControlDetails withRepositoryUri(URI repositoryUri) { - this.repositoryUri = repositoryUri; - return this; - } - - /** - * A string that uniquely and permanently identifies the revision within the repository. - */ - public String getRevisionId() { - return revisionId; - } - - /** - * A string that uniquely and permanently identifies the revision within the repository. - */ - public void setRevisionId(String revisionId) { - this.revisionId = revisionId; - } - - public VersionControlDetails withRevisionId(String revisionId) { - this.revisionId = revisionId; - return this; - } - - /** - * The name of a branch containing the revision. - */ - public String getBranch() { - return branch; - } - - /** - * The name of a branch containing the revision. - */ - public void setBranch(String branch) { - this.branch = branch; - } - - public VersionControlDetails withBranch(String branch) { - this.branch = branch; - return this; - } - - /** - * A tag that has been applied to the revision. - */ - public String getRevisionTag() { - return revisionTag; - } - - /** - * A tag that has been applied to the revision. - */ - public void setRevisionTag(String revisionTag) { - this.revisionTag = revisionTag; - } - - public VersionControlDetails withRevisionTag(String revisionTag) { - this.revisionTag = revisionTag; - return this; - } - - /** - * A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. - */ - public Date getAsOfTimeUtc() { - return asOfTimeUtc; - } - - /** - * A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. - */ - public void setAsOfTimeUtc(Date asOfTimeUtc) { - this.asOfTimeUtc = asOfTimeUtc; - } - - public VersionControlDetails withAsOfTimeUtc(Date asOfTimeUtc) { - this.asOfTimeUtc = asOfTimeUtc; - return this; - } - - /** - * Specifies the location of an artifact. - */ - public ArtifactLocation getMappedTo() { - return mappedTo; - } - - /** - * Specifies the location of an artifact. - */ - public void setMappedTo(ArtifactLocation mappedTo) { - this.mappedTo = mappedTo; - } - - public VersionControlDetails withMappedTo(ArtifactLocation mappedTo) { - this.mappedTo = mappedTo; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public VersionControlDetails withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(VersionControlDetails.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("repositoryUri"); - sb.append('='); - sb.append(((this.repositoryUri == null) ? "" : this.repositoryUri)); - sb.append(','); - sb.append("revisionId"); - sb.append('='); - sb.append(((this.revisionId == null) ? "" : this.revisionId)); - sb.append(','); - sb.append("branch"); - sb.append('='); - sb.append(((this.branch == null) ? "" : this.branch)); - sb.append(','); - sb.append("revisionTag"); - sb.append('='); - sb.append(((this.revisionTag == null) ? "" : this.revisionTag)); - sb.append(','); - sb.append("asOfTimeUtc"); - sb.append('='); - sb.append(((this.asOfTimeUtc == null) ? "" : this.asOfTimeUtc)); - sb.append(','); - sb.append("mappedTo"); - sb.append('='); - sb.append(((this.mappedTo == null) ? "" : this.mappedTo)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.revisionId == null) ? 0 : this.revisionId.hashCode())); - result = ((result * 31) + ((this.repositoryUri == null) ? 0 : this.repositoryUri.hashCode())); - result = ((result * 31) + ((this.mappedTo == null) ? 0 : this.mappedTo.hashCode())); - result = ((result * 31) + ((this.branch == null) ? 0 : this.branch.hashCode())); - result = ((result * 31) + ((this.asOfTimeUtc == null) ? 0 : this.asOfTimeUtc.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.revisionTag == null) ? 0 : this.revisionTag.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof VersionControlDetails) == false) { - return false; - } - VersionControlDetails rhs = ((VersionControlDetails) other); - return ((((((((this.revisionId == rhs.revisionId) || ((this.revisionId != null) && this.revisionId.equals(rhs.revisionId))) && ((this.repositoryUri == rhs.repositoryUri) || ((this.repositoryUri != null) && this.repositoryUri.equals(rhs.repositoryUri)))) && ((this.mappedTo == rhs.mappedTo) || ((this.mappedTo != null) && this.mappedTo.equals(rhs.mappedTo)))) && ((this.branch == rhs.branch) || ((this.branch != null) && this.branch.equals(rhs.branch)))) && ((this.asOfTimeUtc == rhs.asOfTimeUtc) || ((this.asOfTimeUtc != null) && this.asOfTimeUtc.equals(rhs.asOfTimeUtc)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.revisionTag == rhs.revisionTag) || ((this.revisionTag != null) && this.revisionTag.equals(rhs.revisionTag)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebRequest.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebRequest.java deleted file mode 100644 index c8ec24dc79..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebRequest.java +++ /dev/null @@ -1,347 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes an HTTP request. - */ -@Generated("jsonschema2pojo") -public class WebRequest { - - /** - * The index within the run.webRequests array of the request object associated with this result. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * The request protocol. Example: 'http'. - */ - @SerializedName("protocol") - @Expose - private String protocol; - /** - * The request version. Example: '1.1'. - */ - @SerializedName("version") - @Expose - private String version; - /** - * The target of the request. - */ - @SerializedName("target") - @Expose - private String target; - /** - * The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. - */ - @SerializedName("method") - @Expose - private String method; - /** - * The request headers. - */ - @SerializedName("headers") - @Expose - private Headers headers; - /** - * The request parameters. - */ - @SerializedName("parameters") - @Expose - private Parameters parameters; - /** - * Represents the contents of an artifact. - */ - @SerializedName("body") - @Expose - private ArtifactContent body; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public WebRequest() { - } - - /** - * @param headers - * @param protocol - * @param method - * @param index - * @param body - * @param version - * @param parameters - * @param properties - * @param target - */ - public WebRequest(int index, String protocol, String version, String target, String method, Headers headers, Parameters parameters, ArtifactContent body, PropertyBag properties) { - super(); - this.index = index; - this.protocol = protocol; - this.version = version; - this.target = target; - this.method = method; - this.headers = headers; - this.parameters = parameters; - this.body = body; - this.properties = properties; - } - - /** - * The index within the run.webRequests array of the request object associated with this result. - */ - public int getIndex() { - return index; - } - - /** - * The index within the run.webRequests array of the request object associated with this result. - */ - public void setIndex(int index) { - this.index = index; - } - - public WebRequest withIndex(int index) { - this.index = index; - return this; - } - - /** - * The request protocol. Example: 'http'. - */ - public String getProtocol() { - return protocol; - } - - /** - * The request protocol. Example: 'http'. - */ - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public WebRequest withProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * The request version. Example: '1.1'. - */ - public String getVersion() { - return version; - } - - /** - * The request version. Example: '1.1'. - */ - public void setVersion(String version) { - this.version = version; - } - - public WebRequest withVersion(String version) { - this.version = version; - return this; - } - - /** - * The target of the request. - */ - public String getTarget() { - return target; - } - - /** - * The target of the request. - */ - public void setTarget(String target) { - this.target = target; - } - - public WebRequest withTarget(String target) { - this.target = target; - return this; - } - - /** - * The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. - */ - public String getMethod() { - return method; - } - - /** - * The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. - */ - public void setMethod(String method) { - this.method = method; - } - - public WebRequest withMethod(String method) { - this.method = method; - return this; - } - - /** - * The request headers. - */ - public Headers getHeaders() { - return headers; - } - - /** - * The request headers. - */ - public void setHeaders(Headers headers) { - this.headers = headers; - } - - public WebRequest withHeaders(Headers headers) { - this.headers = headers; - return this; - } - - /** - * The request parameters. - */ - public Parameters getParameters() { - return parameters; - } - - /** - * The request parameters. - */ - public void setParameters(Parameters parameters) { - this.parameters = parameters; - } - - public WebRequest withParameters(Parameters parameters) { - this.parameters = parameters; - return this; - } - - /** - * Represents the contents of an artifact. - */ - public ArtifactContent getBody() { - return body; - } - - /** - * Represents the contents of an artifact. - */ - public void setBody(ArtifactContent body) { - this.body = body; - } - - public WebRequest withBody(ArtifactContent body) { - this.body = body; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public WebRequest withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(WebRequest.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("protocol"); - sb.append('='); - sb.append(((this.protocol == null) ? "" : this.protocol)); - sb.append(','); - sb.append("version"); - sb.append('='); - sb.append(((this.version == null) ? "" : this.version)); - sb.append(','); - sb.append("target"); - sb.append('='); - sb.append(((this.target == null) ? "" : this.target)); - sb.append(','); - sb.append("method"); - sb.append('='); - sb.append(((this.method == null) ? "" : this.method)); - sb.append(','); - sb.append("headers"); - sb.append('='); - sb.append(((this.headers == null) ? "" : this.headers)); - sb.append(','); - sb.append("parameters"); - sb.append('='); - sb.append(((this.parameters == null) ? "" : this.parameters)); - sb.append(','); - sb.append("body"); - sb.append('='); - sb.append(((this.body == null) ? "" : this.body)); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.headers == null) ? 0 : this.headers.hashCode())); - result = ((result * 31) + ((this.protocol == null) ? 0 : this.protocol.hashCode())); - result = ((result * 31) + ((this.method == null) ? 0 : this.method.hashCode())); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.body == null) ? 0 : this.body.hashCode())); - result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); - result = ((result * 31) + ((this.parameters == null) ? 0 : this.parameters.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + ((this.target == null) ? 0 : this.target.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof WebRequest) == false) { - return false; - } - WebRequest rhs = ((WebRequest) other); - return ((((((((((this.headers == rhs.headers) || ((this.headers != null) && this.headers.equals(rhs.headers))) && ((this.protocol == rhs.protocol) || ((this.protocol != null) && this.protocol.equals(rhs.protocol)))) && ((this.method == rhs.method) || ((this.method != null) && this.method.equals(rhs.method)))) && (this.index == rhs.index)) && ((this.body == rhs.body) || ((this.body != null) && this.body.equals(rhs.body)))) && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) && ((this.parameters == rhs.parameters) || ((this.parameters != null) && this.parameters.equals(rhs.parameters)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && ((this.target == rhs.target) || ((this.target != null) && this.target.equals(rhs.target)))); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebResponse.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebResponse.java deleted file mode 100644 index d924d60d02..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/WebResponse.java +++ /dev/null @@ -1,347 +0,0 @@ - -package com.github.jmlparser.lint.sarif; - -import javax.annotation.processing.Generated; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes the response to an HTTP request. - */ -@Generated("jsonschema2pojo") -public class WebResponse { - - /** - * The index within the run.webResponses array of the response object associated with this result. - */ - @SerializedName("index") - @Expose - private int index = -1; - /** - * The response protocol. Example: 'http'. - */ - @SerializedName("protocol") - @Expose - private String protocol; - /** - * The response version. Example: '1.1'. - */ - @SerializedName("version") - @Expose - private String version; - /** - * The response status code. Example: 451. - */ - @SerializedName("statusCode") - @Expose - private int statusCode; - /** - * The response reason. Example: 'Not found'. - */ - @SerializedName("reasonPhrase") - @Expose - private String reasonPhrase; - /** - * The response headers. - */ - @SerializedName("headers") - @Expose - private Headers__1 headers; - /** - * Represents the contents of an artifact. - */ - @SerializedName("body") - @Expose - private ArtifactContent body; - /** - * Specifies whether a response was received from the server. - */ - @SerializedName("noResponseReceived") - @Expose - private boolean noResponseReceived = false; - /** - * Key/value pairs that provide additional information about the object. - */ - @SerializedName("properties") - @Expose - private PropertyBag properties; - - /** - * No args constructor for use in serialization - */ - public WebResponse() { - } - - /** - * @param headers - * @param protocol - * @param reasonPhrase - * @param noResponseReceived - * @param index - * @param body - * @param version - * @param properties - * @param statusCode - */ - public WebResponse(int index, String protocol, String version, int statusCode, String reasonPhrase, Headers__1 headers, ArtifactContent body, boolean noResponseReceived, PropertyBag properties) { - super(); - this.index = index; - this.protocol = protocol; - this.version = version; - this.statusCode = statusCode; - this.reasonPhrase = reasonPhrase; - this.headers = headers; - this.body = body; - this.noResponseReceived = noResponseReceived; - this.properties = properties; - } - - /** - * The index within the run.webResponses array of the response object associated with this result. - */ - public int getIndex() { - return index; - } - - /** - * The index within the run.webResponses array of the response object associated with this result. - */ - public void setIndex(int index) { - this.index = index; - } - - public WebResponse withIndex(int index) { - this.index = index; - return this; - } - - /** - * The response protocol. Example: 'http'. - */ - public String getProtocol() { - return protocol; - } - - /** - * The response protocol. Example: 'http'. - */ - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public WebResponse withProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * The response version. Example: '1.1'. - */ - public String getVersion() { - return version; - } - - /** - * The response version. Example: '1.1'. - */ - public void setVersion(String version) { - this.version = version; - } - - public WebResponse withVersion(String version) { - this.version = version; - return this; - } - - /** - * The response status code. Example: 451. - */ - public int getStatusCode() { - return statusCode; - } - - /** - * The response status code. Example: 451. - */ - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public WebResponse withStatusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * The response reason. Example: 'Not found'. - */ - public String getReasonPhrase() { - return reasonPhrase; - } - - /** - * The response reason. Example: 'Not found'. - */ - public void setReasonPhrase(String reasonPhrase) { - this.reasonPhrase = reasonPhrase; - } - - public WebResponse withReasonPhrase(String reasonPhrase) { - this.reasonPhrase = reasonPhrase; - return this; - } - - /** - * The response headers. - */ - public Headers__1 getHeaders() { - return headers; - } - - /** - * The response headers. - */ - public void setHeaders(Headers__1 headers) { - this.headers = headers; - } - - public WebResponse withHeaders(Headers__1 headers) { - this.headers = headers; - return this; - } - - /** - * Represents the contents of an artifact. - */ - public ArtifactContent getBody() { - return body; - } - - /** - * Represents the contents of an artifact. - */ - public void setBody(ArtifactContent body) { - this.body = body; - } - - public WebResponse withBody(ArtifactContent body) { - this.body = body; - return this; - } - - /** - * Specifies whether a response was received from the server. - */ - public boolean isNoResponseReceived() { - return noResponseReceived; - } - - /** - * Specifies whether a response was received from the server. - */ - public void setNoResponseReceived(boolean noResponseReceived) { - this.noResponseReceived = noResponseReceived; - } - - public WebResponse withNoResponseReceived(boolean noResponseReceived) { - this.noResponseReceived = noResponseReceived; - return this; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public PropertyBag getProperties() { - return properties; - } - - /** - * Key/value pairs that provide additional information about the object. - */ - public void setProperties(PropertyBag properties) { - this.properties = properties; - } - - public WebResponse withProperties(PropertyBag properties) { - this.properties = properties; - return this; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(WebResponse.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("index"); - sb.append('='); - sb.append(this.index); - sb.append(','); - sb.append("protocol"); - sb.append('='); - sb.append(((this.protocol == null) ? "" : this.protocol)); - sb.append(','); - sb.append("version"); - sb.append('='); - sb.append(((this.version == null) ? "" : this.version)); - sb.append(','); - sb.append("statusCode"); - sb.append('='); - sb.append(this.statusCode); - sb.append(','); - sb.append("reasonPhrase"); - sb.append('='); - sb.append(((this.reasonPhrase == null) ? "" : this.reasonPhrase)); - sb.append(','); - sb.append("headers"); - sb.append('='); - sb.append(((this.headers == null) ? "" : this.headers)); - sb.append(','); - sb.append("body"); - sb.append('='); - sb.append(((this.body == null) ? "" : this.body)); - sb.append(','); - sb.append("noResponseReceived"); - sb.append('='); - sb.append(this.noResponseReceived); - sb.append(','); - sb.append("properties"); - sb.append('='); - sb.append(((this.properties == null) ? "" : this.properties)); - sb.append(','); - if (sb.charAt((sb.length() - 1)) == ',') { - sb.setCharAt((sb.length() - 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result * 31) + ((this.headers == null) ? 0 : this.headers.hashCode())); - result = ((result * 31) + ((this.protocol == null) ? 0 : this.protocol.hashCode())); - result = ((result * 31) + ((this.reasonPhrase == null) ? 0 : this.reasonPhrase.hashCode())); - result = ((result * 31) + (this.noResponseReceived ? 1 : 0)); - result = ((result * 31) + this.index); - result = ((result * 31) + ((this.body == null) ? 0 : this.body.hashCode())); - result = ((result * 31) + ((this.version == null) ? 0 : this.version.hashCode())); - result = ((result * 31) + ((this.properties == null) ? 0 : this.properties.hashCode())); - result = ((result * 31) + this.statusCode); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof WebResponse) == false) { - return false; - } - WebResponse rhs = ((WebResponse) other); - return ((((((((((this.headers == rhs.headers) || ((this.headers != null) && this.headers.equals(rhs.headers))) && ((this.protocol == rhs.protocol) || ((this.protocol != null) && this.protocol.equals(rhs.protocol)))) && ((this.reasonPhrase == rhs.reasonPhrase) || ((this.reasonPhrase != null) && this.reasonPhrase.equals(rhs.reasonPhrase)))) && (this.noResponseReceived == rhs.noResponseReceived)) && (this.index == rhs.index)) && ((this.body == rhs.body) || ((this.body != null) && this.body.equals(rhs.body)))) && ((this.version == rhs.version) || ((this.version != null) && this.version.equals(rhs.version)))) && ((this.properties == rhs.properties) || ((this.properties != null) && this.properties.equals(rhs.properties)))) && (this.statusCode == rhs.statusCode)); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/package-info.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/package-info.java deleted file mode 100644 index 68f4f8e1b0..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/lint/sarif/package-info.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Generated classes for SARIF 2.1. - *

- * Used command-line - *

- *     bin/jsonschema2pojo -p com.github.jmlparser.lint.sarif -P -t ~/work/javaparser/jmlparser-jml-tools/src/main/java/ -tv 17  -a gson -s sarif-schema.json -b -c
- * 
- * - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -package com.github.jmlparser.lint.sarif; \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/mlpp/FeatureExtractor.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/mlpp/FeatureExtractor.java deleted file mode 100644 index ead7d84443..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/mlpp/FeatureExtractor.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.github.jmlparser.mlpp; - -import com.github.javaparser.JavaParser; -import com.github.javaparser.JavaToken; -import com.github.javaparser.ParserConfiguration; -import com.github.javaparser.ast.Node; -import com.github.jmlparser.utils.Helper; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (07.04.23) - */ -public class FeatureExtractor { - private final JavaParser parser; - private final PrintWriter out = new PrintWriter("features.csv"); - - public FeatureExtractor() throws FileNotFoundException { - ParserConfiguration config = new ParserConfiguration(); - config.setProcessJml(true); - parser = new JavaParser(config); - } - - public void extract(Path path) throws IOException { - var cu = parser.parse(path); - if (cu.isSuccessful()) { - var nodes = Helper.findAllJmlContainers(cu.getResult().get()); - extractN(nodes); - } - } - - private void extractN(List nodes) { - for (Node node : nodes) { - final var tokenRange = node.getTokenRange(); - tokenRange.ifPresent(javaTokens -> extract(javaTokens.getBegin(), javaTokens.getEnd())); - } - } - - private void extract(JavaToken begin, JavaToken end) { - var cur = begin; - var seq = new ArrayList(1024); - while (cur != null && cur != end) { - if (!cur.getCategory().isWhitespaceOrComment()) { - seq.add(cur); - } - cur = cur.getNextToken().orElse(null); - } - extract(seq); - } - - private void extract(List seq) { - var iter = new FillNull(seq.iterator()); - JavaToken prev2 = null, prev1 = null, cur = iter.next(), next = iter.next(); - while (cur != null) { - var tokenid0 = getKind(cur); - var tokenid1 = getKind(prev1); - var tokenid2 = getKind(prev2); - var tokenidn = getKind(next); - - var widthleft = 120 - cur.getRange().get().end.column; - - var lineident = 0; - - var followed_by_newline = next != null && cur.getRange().get().end.line != next.getRange().get().begin.line; - var followed_by_indent = next != null ? next.getRange().get().begin.column : 0; - - - out.format("%d\t%d\t%d\t%d\t%d\t%d\t%s\t%d\n", - tokenid0, tokenid1, tokenid2, tokenidn, widthleft, lineident, followed_by_newline, followed_by_indent - ); - - prev2 = prev1; - prev1 = cur; - cur = next; - next = next == null ? null : iter.next(); - } - - } - - private int getCurrentLineIndent() { - return 0; - } - - private static int getKind(JavaToken cur) { - if (cur == null) return -1; - return cur.getKind(); - } - - public static void main(String[] args) throws IOException { - var e = new FeatureExtractor(); - e.printHead(); - for (String arg : args) { - Files.walk(Paths.get(arg)).forEach(it -> { - try { - e.extract(it); - } catch (IOException ex) { - ex.printStackTrace(); - } - }); - } - e.out.flush(); - } - - private void printHead() { - out.format("tokenid0\ttokenid1\ttokenid2\ttokenidn\twidthleft\tlineident\tfollowed_by_newline\tfollowed_by_indent\n"); - } - - private static class FillNull implements Iterator { - private final Iterator iter; - - public FillNull(Iterator iterator) { - this.iter = iterator; - } - - @Override - public boolean hasNext() { - return iter.hasNext(); - } - - @Override - public JavaToken next() { - if (iter.hasNext()) - return iter.next(); - return null; - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/pp/PrettyPrintCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/pp/PrettyPrintCommand.java deleted file mode 100644 index f026307f4d..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/pp/PrettyPrintCommand.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.jmlparser.pp; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"format"}, - commandDescription = "Format the JML comments inside Java files.") -public class PrettyPrintCommand { - @Parameter(description = "Files to check", required = true) - private List files = new ArrayList<>(); - - public void run() { - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/AddForeachCountVariable.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/AddForeachCountVariable.java deleted file mode 100644 index cc5b5a2caa..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/AddForeachCountVariable.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.github.jmlparser.redux; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.expr.NameExpr; -import com.github.javaparser.ast.expr.UnaryExpr; -import com.github.javaparser.ast.expr.VariableDeclarationExpr; -import com.github.javaparser.ast.jml.stmt.JmlGhostStmt; -import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.ExpressionStmt; -import com.github.javaparser.ast.stmt.ForEachStmt; -import com.github.javaparser.ast.stmt.Statement; -import com.github.javaparser.ast.type.PrimitiveType; -import com.github.jmlparser.utils.Helper; - -/** - * @author Alexander Weigl - * @version 1 (08.02.22) - */ -public class AddForeachCountVariable implements Transformer { - public static final String VARIABLE_NAME_COUNT = "\\count"; - - public static BlockStmt addCountVariableInForeach(ForEachStmt forEachStmt) { - BlockStmt stmt = new BlockStmt(); - forEachStmt.replace(stmt); - VariableDeclarationExpr vdecl = new VariableDeclarationExpr(PrimitiveType.intType(), VARIABLE_NAME_COUNT); - JmlGhostStmt decl = new JmlGhostStmt(new NodeList<>(), new ExpressionStmt(vdecl)); - stmt.addStatement(decl); - stmt.addStatement(forEachStmt); - Statement loopBody = forEachStmt.getBody(); - final UnaryExpr increment = new UnaryExpr(new NameExpr(VARIABLE_NAME_COUNT), UnaryExpr.Operator.PREFIX_INCREMENT); - if (loopBody.isBlockStmt()) { - ((BlockStmt) loopBody).addStatement(0, increment); - } else { - BlockStmt newLoopBody = new BlockStmt(); - loopBody.replace(newLoopBody); - newLoopBody.addStatement(increment); - newLoopBody.addStatement(loopBody); - } - return stmt; - } - - @Override - public Node apply(Node a) { - return Helper.findAndApply(ForEachStmt.class, a, AddForeachCountVariable::addCountVariableInForeach); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/LambdaReplacer.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/LambdaReplacer.java deleted file mode 100644 index ca0b4c8629..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/LambdaReplacer.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.github.jmlparser.redux; - -import com.github.javaparser.Position; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.ast.expr.LambdaExpr; -import com.github.javaparser.ast.expr.ObjectCreationExpr; -import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.ExpressionStmt; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.github.javaparser.utils.Pair; -import com.github.jmlparser.utils.Helper; -import org.jetbrains.annotations.Nullable; - -import java.util.HashSet; -import java.util.Set; - -/** - * Replaces lambda expression by an internal named class. - *

- * Code was donated by Carsten Czisky @ciskar - */ -public class LambdaReplacer implements Transformer { - private final NameGenerator nameGenerator; - - public LambdaReplacer(NameGenerator nameGenerator) { - this.nameGenerator = nameGenerator; - } - - - @Override - public Node apply(Node a) { - return Helper.findAndApply(LambdaExpr.class, a, this::rewriteLambda); - } - - private Node rewriteLambda(LambdaExpr expr) { - var enclosingType = expr.getParentNodeOfType(TypeDeclaration.class); - if (enclosingType.isEmpty()) - throw new IllegalStateException("LambdaExpr is not enclosed in a type declaration"); - ClassOrInterfaceDeclaration decl = liftToInnerClass(expr); - enclosingType.get().addMember(decl); - return instantiate(decl); - } - - - private ObjectCreationExpr instantiate(ClassOrInterfaceDeclaration decl) { - var type = new ClassOrInterfaceType(null, decl.getNameAsString()); - return new ObjectCreationExpr(null, type, new NodeList()); - } - - private ClassOrInterfaceDeclaration liftToInnerClass(LambdaExpr lambdaExpr) { - var sai = findSingleAbstractInterface(lambdaExpr); - var interfazeName = sai.a; - var method = sai.b; - var name = nameGenerator.generate("__GENERATED_", lambdaExpr.getRange().orElse(null).begin); - var it = new ClassOrInterfaceDeclaration(new NodeList(), false, name); - it.addImplementedType(interfazeName); - it.addMember(method); - return it; - } - - private Pair findSingleAbstractInterface(LambdaExpr lambdaExpr) { - @Nullable ClassOrInterfaceType type = assignToType(lambdaExpr); - if (type == null) { - return inferDefaultAbstractInterface(lambdaExpr); - } else { - return new Pair<>(type.getNameAsString(), new MethodDeclaration()); - } - } - - private Pair inferDefaultAbstractInterface(LambdaExpr lambdaExpr) { - var interfaze = ""; - var md = new MethodDeclaration(); - - var body = lambdaExpr.getBody(); - String returnType = null; - - if (body instanceof BlockStmt bs) { - var last = bs.getStatements().getLast(); - returnType = last.flatMap(it -> it.asReturnStmt().getExpression()) - .map(b -> b.calculateResolvedType().toString()).orElse(null); - } - - if (body instanceof ExpressionStmt es) { - returnType = es.getExpression().calculateResolvedType().toString(); - } - - - switch (lambdaExpr.getParameters().size()) { - case 0 -> { - if (returnType == null) { - interfaze = "Runnable"; - md.setName("run"); - } else { - interfaze = "java.util.function.Supplier<$returnType>"; - md.setName("accept"); - } - } - case 1 -> { - var firstParam = lambdaExpr.getParameters().getFirst().get().getTypeAsString(); - if (returnType == null) { - interfaze = "java.util.function.Consumer<" + firstParam + ">"; - md.setName("get"); - } else { - interfaze = "java.util.function.Function<" + firstParam + ", " + returnType + ">"; - md.setName("invoke"); - } - } - - case 2 -> { - var firstParam = lambdaExpr.getParameters().getFirst().map(Parameter::getTypeAsString).orElse(null); - var secondParam = lambdaExpr.getParameters().get(1).getTypeAsString(); - if (returnType == null) { - interfaze = "java.util.function.Consumer<" + firstParam + ">"; - md.setName("get"); - } else { - interfaze = "java.util.function.BiFunction<$firstParam, $secondParam, $returnType>"; - md.setName("invoke"); - } - } - default -> throw new IllegalStateException("ASM could not be infered"); - } - //TODO md.type = returnType - for (var parameter : lambdaExpr.getParameters()) { - md.addParameter(parameter.clone()); - } - return new Pair<>(interfaze, md); - } - - @Nullable - private ClassOrInterfaceType assignToType(LambdaExpr lambdaExpr) { - var type = lambdaExpr.calculateResolvedType(); - System.out.println("TEST: $type"); - return null; //TODO - } -} - -/** - * generates names guaranteeing uniqueness in generated names by onw instance of NameGenerator - */ -class NameGenerator { - private Set generatedNames = new HashSet<>(); - - public String generate(String prefix, @Nullable Position pos) { - return generate(prefix, pos, null); - } - - private String generate(String prefix, @Nullable Position pos, Integer counter) { - var line = pos != null ? pos.line : null; - var newName = prefix + "L" + line; - if (counter != null) { - newName += "_" + counter; - } - if (generatedNames.contains(newName)) { - return generate(prefix, pos, counter != null ? counter + 1 : 0); - } - generatedNames.add(newName); - return newName; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxConfig.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxConfig.java deleted file mode 100644 index caa74eb183..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.github.jmlparser.redux; - -import java.util.HashSet; -import java.util.Set; - -/** - * Configuration for the Redux transformation pipeline. - */ -public class ReduxConfig { - private Set disabled = new HashSet<>(); - - public void enable(Class clazz) { - disabled.remove(clazz.toString()); - } - - public void disable(Class clazz) { - disabled.add(clazz.toString()); - } - - public Set getDisabled() { - return disabled; - } - - public boolean isEnabled(String clazz) { - return !disabled.contains(clazz); - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxFacade.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxFacade.java deleted file mode 100644 index a399825e95..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/ReduxFacade.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.github.jmlparser.redux; - -import com.github.javaparser.ast.Node; - -import java.util.ArrayList; -import java.util.List; -import java.util.ServiceLoader; - -/** - * @author Alexander Weigl - * @version 1 (12/29/21) - */ -public class ReduxFacade { - private final List transformers = new ArrayList<>(); - private final ReduxConfig config; - - public ReduxFacade(ReduxConfig config) { - this.config = config; - } - - public ReduxFacade(ReduxConfig config, List transformers) { - this(config); - this.transformers.addAll(transformers); - } - - public static ReduxFacade create(ReduxConfig config) { - var sl = ServiceLoader.load(Transformer.class); - return new ReduxFacade(config, sl.stream() - .filter(it -> config.isEnabled(it.type().toString())) - .map(ServiceLoader.Provider::get).toList()); - } - - public List apply(List nodes) { - List n = new ArrayList<>(nodes.size()); - for (Node node : nodes) { - for (Transformer transformer : transformers) { - node = transformer.apply(node); - } - n.add(node); - } - return n; - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/Transformer.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/Transformer.java deleted file mode 100644 index 1f13558afd..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/redux/Transformer.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.github.jmlparser.redux; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.stmt.ForEachStmt; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public interface Transformer { - Node apply(Node a); - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/ArithmeticTranslator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/ArithmeticTranslator.java deleted file mode 100644 index b93eb47483..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/ArithmeticTranslator.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SmtType; - -import java.math.BigInteger; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @author Alexander Weigl - * @version 1 (01.07.22) - */ -public interface ArithmeticTranslator { - SExpr binary(BinaryExpr.Operator operator, SExpr left, SExpr right); - - SExpr makeChar(CharLiteralExpr n); - - SExpr unary(UnaryExpr.Operator operator, SExpr accept); - - SExpr makeLong(LongLiteralExpr n); - - SExpr makeInt(IntegerLiteralExpr n); - - SExpr makeInt(BigInteger i); - - SExpr makeIntVar(); - - default List getVariable(NodeList variables) { - return variables.stream().map(this::getVariable).collect(Collectors.toList()); - } - - SExpr getVariable(Parameter jmlBoundVariable); - - SExpr makeBoolean(boolean value); - - SmtType getType(ResolvedType asPrimitive); - - SExpr arrayLength(SExpr obj); - - SExpr makeInt(long i); - - SExpr makeVar(ResolvedType rtype); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/BitVectorArithmeticTranslator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/BitVectorArithmeticTranslator.java deleted file mode 100644 index 860a9a3d63..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/BitVectorArithmeticTranslator.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.resolution.types.ResolvedArrayType; -import com.github.javaparser.resolution.types.ResolvedPrimitiveType; -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SmtType; - -import java.math.BigInteger; - -/** - * @author Alexander Weigl - * @version 1 (01.07.22) - */ -public class BitVectorArithmeticTranslator implements ArithmeticTranslator { - int cnt = 0; - private static final SmtTermFactory term = SmtTermFactory.INSTANCE; - - final SmtQuery smtLog; - - public BitVectorArithmeticTranslator(SmtQuery smtLog) { - this.smtLog = smtLog; - } - - @Override - public SExpr binary(BinaryExpr.Operator operator, SExpr left, SExpr right) { - switch (operator) { - case IMPLICATION: - return term.impl(left, right); - case SUBTYPE: - break; - case RANGE: - break; - case SUB_LOCK: - break; - case SUB_LOCKE: - break; - case RIMPLICATION: - return term.impl(right, left); - case EQUIVALENCE: - return term.equiv(left, right); - case ANTIVALENCE: - return term.not(term.equiv(left, right)); - case OR: - return term.or(left, right); - case AND: - return term.and(left, right); - case BINARY_OR: - return term.bor(left, right); - case BINARY_AND: - return term.band(left, right); - case XOR: - return term.xor(left, right); - case EQUALS: - return term.equality(left, right); - case NOT_EQUALS: - return term.not(term.equality(left, right)); - case LESS: - return term.lessThan(left, right); - case GREATER: - return term.greaterThan(left, right); - case LESS_EQUALS: - return term.lessOrEquals(left, right, true); - case GREATER_EQUALS: - return term.greaterOrEquals(left, right, true); - case LEFT_SHIFT: - return term.shiftLeft(left, right); - case SIGNED_RIGHT_SHIFT: - return term.shiftRight(left, right, true); - case UNSIGNED_RIGHT_SHIFT: - return term.shiftRight(left, right, true); - case PLUS: - return term.add(left, right); - case MINUS: - return term.subtract(left, right); - case MULTIPLY: - return term.multiply(left, right); - case DIVIDE: - return term.divide(left, right, true); - case REMAINDER: - return term.modulo(left, right, true); - - } - return null; - } - - @Override - public SExpr makeChar(CharLiteralExpr n) { - return term.makeBitvector(16, n.getValue().charAt(0)); - } - - @Override - public SExpr unary(UnaryExpr.Operator operator, SExpr accept) { - switch (operator) { - case PLUS: - case POSTFIX_INCREMENT: - case POSTFIX_DECREMENT: - return accept; - case MINUS: - return term.negate(accept); - case PREFIX_INCREMENT: - return term.add(accept, term.makeBitvector(32, 1)); - case PREFIX_DECREMENT: - return term.subtract(accept, term.makeBitvector(32, 1)); - case LOGICAL_COMPLEMENT: - return term.not(accept); - case BITWISE_COMPLEMENT: - return term.not(accept); - } - return accept; - } - - @Override - public SExpr makeLong(LongLiteralExpr n) { - return term.makeBitvector(64, n.asLong()); - } - - @Override - public SExpr makeInt(IntegerLiteralExpr n) { - return term.makeBitvector(32, n.asInt()); - } - - @Override - public SExpr makeInt(BigInteger i) { - return term.makeBitvector(32, i); - } - - @Override - public SExpr makeIntVar() { - String name = "__RAND_" + (++cnt); - smtLog.declareConst(name, SmtType.BV32); - return term.symbol(name); - } - - @Override - public SExpr getVariable(Parameter jmlBoundVariable) { - ResolvedType rType = jmlBoundVariable.getType().resolve(); - return term.list(null, null, jmlBoundVariable.getNameAsString(), term.type(getType(rType))); - } - - @Override - public SExpr makeBoolean(boolean value) { - return term.makeBoolean(value); - } - - @Override - public SmtType getType(ResolvedType type) { - if (type.isPrimitive()) { - ResolvedPrimitiveType rType = type.asPrimitive(); - return getPrimitiveType(rType); - } - - if (type.isArray()) { - ResolvedArrayType aType = type.asArrayType(); - SmtType cType = getType(aType.getComponentType()); - SmtType intType = getType(ResolvedPrimitiveType.INT); - return new SmtType.Array(intType, cType); - } - - if (type.isReferenceType()) { - return SmtType.JAVA_OBJECT; - } - - throw new RuntimeException("Unsupported type"); - } - - @Override - public SExpr arrayLength(SExpr obj) { - return term.list(ResolvedPrimitiveType.INT, SmtType.BV32, term.symbol("bv$length"), obj); - } - - @Override - public SExpr makeInt(long i) { - return makeInt(BigInteger.valueOf(i)); - } - - @Override - public SExpr makeVar(ResolvedType rtype) { - return null; - } - - public SmtType getPrimitiveType(ResolvedPrimitiveType rType) { - switch (rType) { - case BOOLEAN: - return SmtType.BOOL; - case BYTE: - return SmtType.BV8; - case SHORT: - return SmtType.BV16; - case CHAR: - return SmtType.BV16; - case INT: - return SmtType.BV32; - case LONG: - return SmtType.BV64; - case FLOAT: - return SmtType.FP32; - case DOUBLE: - return SmtType.FP64; - } - return SmtType.BV8; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/IntArithmeticTranslator.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/IntArithmeticTranslator.java deleted file mode 100644 index fedfea59ba..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/IntArithmeticTranslator.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.ast.expr.CharLiteralExpr; -import com.github.javaparser.ast.expr.IntegerLiteralExpr; -import com.github.javaparser.ast.expr.LongLiteralExpr; -import com.github.javaparser.resolution.types.ResolvedPrimitiveType; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SmtType; - -import java.math.BigInteger; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class IntArithmeticTranslator extends BitVectorArithmeticTranslator { - private final SmtTermFactory term = SmtTermFactory.INSTANCE; - - public IntArithmeticTranslator(SmtQuery smtLog) { - super((smtLog)); - } - - @Override - public SExpr makeChar(CharLiteralExpr n) { - return term.makeInt("" + (int) n.asChar()); - } - - @Override - public SExpr makeLong(LongLiteralExpr n) { - return term.makeInt("" + n.getValue()); - - } - - @Override - public SExpr makeInt(IntegerLiteralExpr n) { - return term.makeInt("" + n.getValue()); - } - - @Override - public SExpr makeInt(BigInteger i) { - return term.makeInt(i.toString()); - } - - @Override - public SExpr makeIntVar() { - String name = "__RAND_" + (++cnt); - smtLog.declareConst(name, SmtType.BV32); - return term.symbol(name); - } - - @Override - public SmtType getPrimitiveType(ResolvedPrimitiveType rType) { - switch (rType) { - case FLOAT: - case DOUBLE: - return SmtType.REAL; - } - return SmtType.INT; - } - - @Override - public SExpr arrayLength(SExpr obj) { - return term.list(ResolvedPrimitiveType.INT, SmtType.INT, term.symbol("int$length"), obj); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/JmlExpr2Smt.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/JmlExpr2Smt.java deleted file mode 100644 index 6f3a3d2c44..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/JmlExpr2Smt.java +++ /dev/null @@ -1,388 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.ast.ArrayCreationLevel; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.body.VariableDeclarator; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.ast.jml.NodeWithContracts; -import com.github.javaparser.ast.jml.expr.*; -import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr.JmlDefaultBinder; -import com.github.javaparser.ast.visitor.GenericVisitorAdapter; -import com.github.javaparser.resolution.declarations.ResolvedValueDeclaration; -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.jmlparser.smt.model.SAtom; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SmtType; -import com.github.jmlparser.utils.JMLUtils; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (01.07.22) - */ -public class JmlExpr2Smt extends GenericVisitorAdapter { - private final ArithmeticTranslator translator; - private static final SmtTermFactory termFactory = SmtTermFactory.INSTANCE; - - private final SmtQuery smtLog; - private VariableStack boundedVars = new VariableStack(); - - public JmlExpr2Smt(SmtQuery smtLog, ArithmeticTranslator translator) { - this.smtLog = smtLog; - this.translator = translator; - } - - @Override - public SExpr visit(ArrayAccessExpr n, Object arg) { - SExpr array = n.getName().accept(this, arg); - SExpr index = n.getIndex().accept(this, arg); - ResolvedType rtype = n.calculateResolvedType(); - SmtType stype = translator.getType(rtype); - return termFactory.select(stype, rtype, array, index); - } - - @Override - public SExpr visit(ArrayCreationExpr n, Object arg) { - if (n.getInitializer().isPresent()) - return n.getInitializer().get().accept(this, arg); - - String name = "anon_array_" + (++anonCnt); - final ResolvedType rType = n.calculateResolvedType(); - SmtType type = translator.getType(rType); - smtLog.declareConst(name, type); - final SExpr var = termFactory.var(type, rType, name); - final SExpr zero = translator.makeInt(BigInteger.ZERO); - final SExpr arrayLength = translator.arrayLength(var); - - List boundedVars = new ArrayList<>(); - SExpr accessLevel = var; - for (int i = 0; i < n.getLevels().size(); i++) { - ArrayCreationLevel level = n.getLevels().get(i); - if (i == 0) { - if (level.getDimension().isPresent()) { - final SExpr length = level.getDimension().get().accept(this, arg); - smtLog.addAssert(termFactory.equality(arrayLength, length)); - } else { - smtLog.addAssert(termFactory.lessOrEquals(zero, arrayLength, true)); - } - } else { - if (level.getDimension().isPresent()) { - final SExpr length = level.getDimension().get().accept(this, arg); - smtLog.addAssert( - termFactory.forall(boundedVars, - termFactory.equality(translator.arrayLength(accessLevel), length))); - } else { - smtLog.addAssert( - termFactory.forall(boundedVars, - termFactory.lessOrEquals(zero, translator.arrayLength(accessLevel), true))); - } - } - boundedVars.add(termFactory.binder(SmtType.INT, "idx" + i)); - accessLevel = termFactory.select(null, null, accessLevel, - termFactory.var(SmtType.INT, null, "idx" + i)); - } - return var; - } - - @Override - public SExpr visit(ArrayInitializerExpr n, Object arg) { - String name = "anon_array_" + (++anonCnt); - List seq = n.getValues().stream().map(it -> it.accept(this, arg)).toList(); - SmtType.Array myType = new SmtType.Array(SmtType.INT, seq.get(0).getSmtType()); - smtLog.declareConst(name, myType); - SExpr var = termFactory.var(myType, null, name); - for (int i = 0; i < seq.size(); i++) { - smtLog.addAssert( - //(store ary idx sub) - termFactory.store(var, translator.makeInt(i), seq.get(i)) - ); - } - - SExpr zero = translator.makeInt(0); - final SExpr length = translator.arrayLength(var); - smtLog.addAssert(termFactory.equality(length, translator.makeInt(n.getValues().size()))); - return var; - } - - @Override - public SExpr visit(AssignExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(BinaryExpr n, Object arg) { - SExpr left = n.getLeft().accept(this, arg); - SExpr right = n.getRight().accept(this, arg); - return translator.binary(n.getOperator(), left, right); - } - - @Override - public SExpr visit(ThisExpr n, Object arg) { - return termFactory.makeThis(); - } - - @Override - public SExpr visit(SuperExpr n, Object arg) { - return termFactory.makeSuper(); - } - - @Override - public SExpr visit(NameExpr n, Object arg) { - ResolvedValueDeclaration resolved = n.resolve(); - ResolvedType rType = resolved.getType(); - final SmtType type = translator.getType(rType); - if (!isBound(n.getNameAsString())) { - smtLog.declareConst(n.getNameAsString(), type); - } - return termFactory.var(type, rType, n.getNameAsString()); - } - - private boolean isBound(String nameAsString) { - return boundedVars.contains(nameAsString); - } - - - @Override - public SExpr visit(NullLiteralExpr n, Object arg) { - return termFactory.makeNull(); - } - - @Override - public SExpr visit(BooleanLiteralExpr n, Object arg) { - return translator.makeBoolean(n.getValue()); - } - - @Override - public SExpr visit(CastExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(CharLiteralExpr n, Object arg) { - return translator.makeChar(n); - } - - @Override - public SExpr visit(ClassExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(ConditionalExpr n, Object arg) { - return termFactory.ite( - n.getCondition().accept(this, arg), - n.getThenExpr().accept(this, arg), - n.getElseExpr().accept(this, arg)); - } - - @Override - public SExpr visit(DoubleLiteralExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(FieldAccessExpr n, Object arg) { - ResolvedType scopeType = n.getScope().calculateResolvedType(); - ResolvedType javaType = n.calculateResolvedType(); - SmtType stype = translator.getType(javaType); - SExpr obj = n.getScope().accept(this, arg); - - if (n.getNameAsString().equals("length") && scopeType.isArray()) { - return translator.arrayLength(obj); - } - - return termFactory.fieldAccess(javaType, stype, n.getNameAsString(), obj); - } - - @Override - public SExpr visit(InstanceOfExpr n, Object arg) { - ResolvedType leftType = n.getExpression().calculateResolvedType(); - ResolvedType rightType = n.getType().resolve(); - - //TODO weigl return leftType.asReferenceType() - //Pattern matching - return termFactory.makeTrue(); - } - - @Override - public SExpr visit(IntegerLiteralExpr n, Object arg) { - return translator.makeInt(n); - } - - @Override - public SExpr visit(LongLiteralExpr n, Object arg) { - return translator.makeLong(n); - } - - @Override - public SExpr visit(MethodCallExpr n, Object arg) { - var method = n.resolve(); - var variable = translator.makeVar(method.getReturnType()); - final var ast = method.toAst(); - if (ast.isPresent() && ast.get() instanceof NodeWithContracts hasContracts) { - var contract = - JMLUtils.createJointContract(hasContracts.getContracts().get()); - //TODO weigl add assertion for the return variable - //TODO weigl add assertion for each parameter - // smtLog.addAssert(); - } - return variable; - } - - int anonCnt; - - @Override - public SExpr visit(ObjectCreationExpr n, Object arg) { - final String name = "anon" + (++anonCnt); - smtLog.declareConst(name, SmtType.JAVA_OBJECT); - SExpr var = termFactory.var(SmtType.JAVA_OBJECT, null, name); - smtLog.addAssert(termFactory.nonNull(var)); - return var; - } - - @Override - public SExpr visit(StringLiteralExpr n, Object arg) { - return new SAtom(SmtType.STRING, null, "\"" + n.asString() + "\""); - } - - @Override - public SExpr visit(UnaryExpr n, Object arg) { - return translator.unary(n.getOperator(), n.getExpression().accept(this, arg)); - } - - @Override - public SExpr visit(LambdaExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(TypeExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(SwitchExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(TextBlockLiteralExpr n, Object arg) { - return new SAtom(SmtType.STRING, null, "\"" + n.asString() + "\""); - } - - @Override - public SExpr visit(PatternExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(JmlQuantifiedExpr n, Object arg) { - try (TruncateStack ignored = boundedVars.bind(n.getVariables())) { - switch ((JmlDefaultBinder) n.getBinder()) { - case FORALL: - Expression e = - n.getExpressions().size() == 2 - ? new BinaryExpr(n.getExpressions().get(0), n.getExpressions().get(1), BinaryExpr.Operator.IMPLICATION) - : n.getExpressions().get(0); - e.setParentNode(n); - return termFactory.forall( - translator.getVariable(n.getVariables()), - e.accept(this, arg)); - case EXISTS: - Expression e1 = - n.getExpressions().size() == 2 - ? new BinaryExpr(n.getExpressions().get(0), n.getExpressions().get(1), BinaryExpr.Operator.AND) - : n.getExpressions().get(0); - e1.setParentNode(n); - return termFactory.forall( - translator.getVariable(n.getVariables()), - e1.accept(this, arg)); - case BSUM: - case MIN: - case MAX: - case PRODUCT: - return translator.makeIntVar(); - default: - return null; - } - } - } - - @Override - public SExpr visit(JmlLabelExpr n, Object arg) { - return n.getExpression().accept(this, arg); - } - - @Override - public SExpr visit(JmlLetExpr n, Object arg) { - try (TruncateStack ignored = boundedVars.bind(n.getVariables())) { - List vars = new ArrayList<>(); - for (VariableDeclarator variable : n.getVariables().getVariables()) { - vars.add(termFactory.list(null, null, variable.getNameAsString(), - variable.getInitializer().get().accept(this, arg))); - } - SExpr body = n.getBody().accept(this, arg); - return termFactory.let(vars, body); - } - } - - @Override - public SExpr visit(JmlMultiCompareExpr n, Object arg) { - return JMLUtils.unroll(n).accept(this, arg); - } - - @Override - public SExpr visit(JmlBinaryInfixExpr n, Object arg) { - SExpr left = n.getLeft().accept(this, arg); - SExpr right = n.getRight().accept(this, arg); - return termFactory.list(null, null, n.getOperator().getIdentifier(), left, right); - } - - @Override - public SExpr visit(JmlTypeExpr n, Object arg) { - return super.visit(n, arg); - } - - public ArithmeticTranslator getTranslator() { - return translator; - } -} - - -class VariableStack { - private final ArrayList seq = new ArrayList<>(16); - - public TruncateStack bind(VariableDeclarationExpr variables) { - int curPosition = seq.size(); - for (VariableDeclarator variable : variables.getVariables()) - seq.add(variable.getNameAsString()); - return () -> truncate(curPosition); - } - - public TruncateStack bind(NodeList variables) { - int curPosition = seq.size(); - for (Parameter variable : variables) - seq.add(variable.getNameAsString()); - return () -> truncate(curPosition); - } - - private void truncate(int curPosition) { - while (seq.size() > curPosition) { - seq.remove(seq.size() - 1); - } - } - - public boolean contains(String nameAsString) { - return seq.contains(nameAsString); - } - -} - -interface TruncateStack extends AutoCloseable { - @Override - void close(); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SMTFacade.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SMTFacade.java deleted file mode 100644 index 26d579b249..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SMTFacade.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.ast.expr.Expression; -import com.github.jmlparser.smt.model.SExpr; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class SMTFacade { - public static SExpr toSmt(Expression expr, SmtQuery smtLog, boolean useInt) { - JmlExpr2Smt visitor = new JmlExpr2Smt( - smtLog, useInt ? new IntArithmeticTranslator(smtLog) - : new BitVectorArithmeticTranslator(smtLog)); - return expr.accept(visitor, null); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtQuery.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtQuery.java deleted file mode 100644 index bf298fcf35..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtQuery.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SmtType; -import com.github.jmlparser.smt.solver.AppendableTo; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class SmtQuery implements AppendableTo { - private static final SmtTermFactory term = SmtTermFactory.INSTANCE; - - private final List commands = new ArrayList<>(1024); - - private final List> variableStack = new ArrayList<>(); - - public SmtQuery() { - variableStack.add(new HashMap<>()); - } - - public boolean declareConst(String name, SmtType type) { - if (!declared(name)) { - SExpr a = term.list(null, SmtType.COMMAND, - "declare-const", name, term.type(type)); - commands.add(a); - getCurrentFrame().put(name, type); - return true; - } - return false; - } - - public void push() { - variableStack.add(new HashMap<>()); - commands.add(term.command("push")); - } - - public void pop() { - variableStack.remove(getCurrentFrame()); - commands.add(term.command("pop")); - } - - private boolean declared(String name) { - return getCurrentFrame().containsKey(name); - } - - private Map getCurrentFrame() { - return variableStack.get(variableStack.size() - 1); - } - - @Override - public void appendTo(PrintWriter pw) { - for (SExpr command : commands) { - command.appendTo(pw); - pw.println(); - } - } - - - public void defineThis() { - declareConst("this", SmtType.JAVA_OBJECT); - addAssert(term.nonNull(term.var(SmtType.JAVA_OBJECT, null, "this"))); - } - - public void addAssert(SExpr nonNull) { - commands.add(term.command("assert", nonNull)); - } - - public void checkSat() { - commands.add(term.command("check-sat")); - } - - - @Override - public String toString() { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - commands.forEach(a -> { - a.appendTo(pw); - pw.println(); - }); - return sw.toString(); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtTermFactory.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtTermFactory.java deleted file mode 100644 index 187ac73d1a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/SmtTermFactory.java +++ /dev/null @@ -1,508 +0,0 @@ -package com.github.jmlparser.smt; - -import com.github.javaparser.resolution.types.ResolvedPrimitiveType; -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.jmlparser.smt.model.SAtom; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SList; -import com.github.jmlparser.smt.model.SmtType; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import lombok.SneakyThrows; - -import java.math.BigInteger; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class SmtTermFactory { - public static final SmtTermFactory INSTANCE = new SmtTermFactory(); - - private final Cache symbolAndValueCache = CacheBuilder.newBuilder().softValues().build(); - - //region boolean operators - public SExpr and(SExpr... terms) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "and", terms); - } - - public SExpr and(List seq) { - return and(seq.toArray(new SExpr[0])); - } - - public SExpr or(SExpr... terms) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "or", terms); - } - - public SExpr impl(SExpr premise, SExpr concl) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "=>", premise, concl); - - } - //endregion - - public SExpr ite(SExpr cond, SExpr then, SExpr otherwise) { - return fnApply(then.getJavaType(), then.getSmtType(), "ite", cond, then, otherwise); - } - - SExpr fnApply(ResolvedType javaType, SmtType smtType, String fn, SExpr arg) { - return new SList(smtType, javaType, symbol(fn), arg); - } - - private SExpr fnApply(ResolvedType javaType, SmtType smtType, String fn, SExpr arg1, SExpr arg2) { - return new SList(smtType, javaType, symbol(fn), arg1, arg2); - } - - private SExpr fnApply(ResolvedType javaType, SmtType smtType, String fn, SExpr arg1, SExpr arg2, SExpr arg3) { - return new SList(smtType, javaType, symbol(fn), arg1, arg2, arg3); - - } - - private SExpr fnApply(ResolvedType javaType, SmtType smtType, String fn, SExpr... args) { - return list(javaType, smtType, symbol(fn), args); - } - - - @SneakyThrows - SAtom symbol(String fn) { - return symbolAndValueCache.get(fn, () -> new SAtom(SmtType.SYMBOL, null, fn)); - } - - public SExpr forall(List variables, SExpr formula) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "forall", list(variables), formula); - } - - public SExpr exists(List variables, SExpr formula) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "exists", list(variables), formula); - } - - - SExpr list(ResolvedType javaType, SmtType smtType, SAtom symbol, SExpr[] args) { - SExpr[] nargs = new SExpr[args.length + 1]; - nargs[0] = symbol; - System.arraycopy(args, 0, nargs, 1, args.length); - return new SList(smtType, javaType, nargs); - } - - SExpr list(List variables) { - SExpr[] args = variables.toArray(new SExpr[0]); - return new SList(null, null, args); - } - - //region polymorphic operators - public SExpr bor(SExpr left, SExpr right) { - if (isBool(left, right)) return or(left, right); - if (isBv(left, right)) return bvor(left, right); - return typeException(); - } - - - public SExpr add(SExpr left, SExpr right) { - if (isInt(left, right)) return iadd(left, right); - if (isBv(left, right)) return bvadd(left, right); - return typeException(); - } - - public SExpr subtract(SExpr left, SExpr right) { - if (isInt(left, right)) return isubstract(left, right); - if (isBv(left, right)) return bvsubstract(left, right); - return typeException(); - } - - public SExpr modulo(SExpr left, SExpr right, boolean b) { - if (isInt(left, right)) return imodulo(left, right); - if (isBv(left, right)) return bvmodulo(left, right); - return typeException(); - } - - public SExpr shiftLeft(SExpr left, SExpr right) { - if (isBv(left, right)) return bvshiftLeft(left, right); - return typeException(); - } - - - public SExpr shiftRight(SExpr left, SExpr right, boolean sign) { - if (isBv(left, right)) return bvshiftRight(left, right, sign); - return typeException(); - } - - public SExpr lessOrEquals(SExpr left, SExpr right, boolean sign) { - if (isInt(left, right)) return ilessOrEquals(left, right); - if (isBv(left, right)) return bvlessOrEquals(left, right); - return typeException("Could not handle types '%s <= %s'", left.getSmtType(), right.getSmtType()); - } - - public SExpr greaterOrEquals(SExpr left, SExpr right, boolean b) { - if (isInt(left, right)) return igreaterOrEquals(left, right); - if (isBv(left, right)) return bvgreaterOrEquals(left, right); - return typeException(); - } - - public SExpr lessThan(SExpr left, SExpr right) { - if (isInt(left, right)) return ilessThan(left, right); - if (isBv(left, right)) return bvlessThan(left, right); - return typeException("Could not handle types '%s <%s'", left.getSmtType(), right.getSmtType()); - } - - public SExpr equiv(SExpr left, SExpr right) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "=", left, right); - } - - public SExpr not(SExpr expr) { - if (isBv(expr)) return bvnot(expr); - if (isBool(expr)) return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "not", expr); - return typeException(); - } - - - public SExpr xor(SExpr left, SExpr right) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "xor", left, right); - } - - public SExpr equality(SExpr left, SExpr right) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, "=", left, right); - } - - public SExpr band(SExpr left, SExpr right) { - if (isBool(left, right)) return and(left, right); - - if (isBv(left, right)) return bvand(left, right); - - return typeException(); - } - - - private SExpr fnApplyToBool(String symbol, SExpr left, SExpr right) { - return fnApply(ResolvedPrimitiveType.BOOLEAN, SmtType.BOOL, symbol, left, right); - } - - public SExpr greaterThan(SExpr left, SExpr right) { - if (isInt(left, right)) return igreaterThan(left, right); - if (isBv(left, right)) return bvgreaterThan(left, right); - return typeException("Could not handle types '%s > %s'", left.getSmtType(), right.getSmtType()); - } - - - public SExpr negate(SExpr sexpr) { - if (isBool(sexpr)) return not(sexpr); - if (isBv(sexpr)) return bvnegate(sexpr); - return typeException(); - } - - - public SExpr multiply(SExpr left, SExpr right) { - if (isInt(left, right)) return imultiply(left, right); - if (isBv(left, right)) return bvmultiply(left, right); - return typeException(); - } - - public SExpr divide(SExpr left, SExpr right, boolean b) { - if (isInt(left, right)) return idivide(left, right); - if (isBv(left, right)) return bvdivide(left, right); - return typeException(); - } - - - //endregion - - //region integer operations - - - @SneakyThrows - SAtom intValue(String svalue) { - return symbolAndValueCache.get(svalue, () -> new SAtom(SmtType.INT, ResolvedPrimitiveType.INT, svalue)); - } - - @SneakyThrows - SAtom intValue(long value) { - return intValue("" + value); - } - - @SneakyThrows - SAtom intValue(BigInteger value) { - return intValue("" + value); - } - - public SExpr iadd(SExpr left, SExpr right) { - return fnApplyToInt("+", left, right); - } - - public SExpr ilessThan(SExpr left, SExpr right) { - return fnApplyToBool("<", left, right); - } - - public SExpr ilessOrEquals(SExpr left, SExpr right) { - return fnApplyToBool("<=", left, right); - } - - public SExpr igreaterThan(SExpr left, SExpr right) { - return fnApplyToBool(">", left, right); - } - - public SExpr igreaterOrEquals(SExpr left, SExpr right) { - return fnApplyToBool(">=", left, right); - } - - public SExpr isubstract(SExpr left, SExpr right) { - return fnApplyToInt("-", left, right); - } - - public SExpr imultiply(SExpr left, SExpr right) { - return fnApplyToInt("*", left, right); - } - - public SExpr intType() { - return symbol("Int"); - } - - public SExpr imodulo(SExpr left, SExpr right) { - return fnApplyToInt("mod", left, right); - } - - public SExpr idivide(SExpr left, SExpr right) { - return fnApplyToInt("/", left, right); - } - - //endregion - - //region bit vectors - public SExpr bvor(SExpr left, SExpr right) { - return fnApplyToBV("bvor", left, right); - } - - public SExpr bvnot(SExpr expr) { - return fnApplyToBV("bvnot", expr); - } - - public SExpr bvnegate(SExpr sexpr) { - return fnApplyToBV("bvneg", sexpr); - } - - public SExpr bvlessThan(SExpr left, SExpr right) { - return fnApplyToBool("bvslt", left, right); - } - - public SExpr bvlessOrEquals(SExpr left, SExpr right) { - return fnApplyToBool("bvsle", left, right); - } - - public SExpr bvgreaterThan(SExpr left, SExpr right) { - return fnApplyToBool("bvsgt", left, right); - } - - public SExpr bvgreaterOrEquals(SExpr left, SExpr right) { - return fnApplyToBool("bvsge", left, right); - } - - public SExpr bvshiftRight(SExpr left, SExpr right, boolean sign) { - return fnApplyToBV(sign ? "bvashr" : "bvshr", left, right); - } - - public SExpr bvshiftLeft(SExpr left, SExpr right) { - return fnApplyToBV("bvshl", left, right); - } - - public SExpr bvand(SExpr left, SExpr right) { - return fnApplyToBV("bvand", left, right); - } - - public SExpr bvadd(SExpr left, SExpr right) { - return fnApplyToBV("bvadd", left, right); - - } - - private SExpr bvsubstract(SExpr left, SExpr right) { - return fnApplyToBV("bvsub", left, right); - } - - private SExpr bvmultiply(SExpr left, SExpr right) { - return fnApplyToBV("bvmul", left, right); - - } - - private SExpr bvdivide(SExpr left, SExpr right) { - return fnApplyToBV("bvsdiv", left, right); - } - - private SExpr bvmodulo(SExpr left, SExpr right) { - return fnApplyToBV("bvsrem", left, right); - } - - private SExpr fnApplyToBV(String symbol, SExpr left) { - return fnApply(null, left.getSmtType(), symbol, left); - } - - - public SExpr makeBitvector(int width, long value) { - return makeBitvector(width, BigInteger.valueOf(value)); - } - - - public SExpr makeBitvector(int width, BigInteger value) { - SmtType.BitVec type = SmtType.getBitVec(width); - return new SList(type, null, - new SList(null, null, symbol("_"), symbol("int2bv"), symbol("" + width)), - intValue(value)); - } - - - public SExpr bvType(int width) { - return new SList(SmtType.TYPE, null, symbol("_"), symbol("BitVec"), intValue(width)); - } - //endregion - - private boolean isBool(SExpr sexpr) { - return sexpr.getSmtType() == SmtType.BOOL; - } - - private boolean isBool(SExpr left, SExpr right) { - return left.getSmtType() == right.getSmtType() && isBool(left); - } - - private boolean isBv(SExpr left, SExpr right) { - return left.getSmtType() == right.getSmtType() && isBv(left); - } - - private boolean isBv(SExpr left) { - return left.getSmtType() instanceof SmtType.BitVec; - } - - private boolean isInt(SExpr left, SExpr right) { - return left.getSmtType() == right.getSmtType() && isInt(left); - } - - private boolean isInt(SExpr left) { - return left.getSmtType() == SmtType.INT; - } - - private SExpr typeException() { - throw new RuntimeException("Type mismatch!"); - } - - - private SExpr fnApplyToInt(String symbol, SExpr left, SExpr right) { - return fnApply(ResolvedPrimitiveType.INT, SmtType.INT, symbol, left, right); - } - - private SExpr fnApplyToBV(String symbol, SExpr left, SExpr right) { - return fnApply(null, left.getSmtType(), symbol, left, right); - } - - - public SExpr fpType(int width) { - return new SList(SmtType.TYPE, null, symbol("_"), symbol("FloatingPoint"), intValue(width)); - } - - public SExpr arrayType(SExpr from, SExpr to) { - return new SList(SmtType.TYPE, null, symbol("Array"), from, to); - } - - - public SExpr list(ResolvedType javaType, SmtType stype, Object... args) { - SExpr[] nargs = new SExpr[args.length]; - for (int i = 0; i < args.length; i++) { - Object arg = args[i]; - if (arg instanceof SExpr) nargs[i] = (SExpr) arg; - else if (arg instanceof String) nargs[i] = symbol((String) arg); - else typeException("Unhandled type %s", arg.getClass()); - } - return new SList(stype, javaType, nargs); - } - - public SExpr makeTrue() { - return makeBoolean(true); - } - - - public SExpr makeFalse() { - return makeBoolean(false); - } - - @SneakyThrows - public SExpr makeBoolean(boolean value) { - String v = value ? "true" : "false"; - return symbolAndValueCache.get(v, () -> new SAtom(SmtType.BOOL, ResolvedPrimitiveType.BOOLEAN, v)); - } - - public SExpr makeInt(String value) { - return intValue(value); - } - - public SExpr makeNull() { - return symbol("null"); - } - - public SExpr makeThis() { - return symbol("this"); - } - - public SExpr makeSuper() { - return symbol("super"); - } - - public SExpr boolType() { - return symbol("Bool"); - } - - public SExpr javaObjectType() { - return symbol("Object"); - } - - public SExpr type(SmtType type) { - if (type == SmtType.JAVA_OBJECT) return javaObjectType(); - if (type == SmtType.INT) return intType(); - if (type == SmtType.REAL) return realType(); - if (type == SmtType.FP32) return fpType(32); - if (type == SmtType.FP64) return fpType(64); - if (type == SmtType.BOOL) return boolType(); - if (type instanceof SmtType.Array) - return arrayType(type(((SmtType.Array) type).from), type(((SmtType.Array) type).to)); - if (type instanceof SmtType.BitVec) return bvType(((SmtType.BitVec) type).width); - - return typeException(); - } - - - private SExpr realType() { - return symbol("Int"); - } - - public SExpr var(SmtType type, ResolvedType javaType, String name) { - //nocache, conflict in type could be created - return new SAtom(type, javaType, name); - } - - @SneakyThrows - public SExpr command(String symbol, SExpr... args) { - return fnApply(null, SmtType.COMMAND, symbol, args); - } - - public SExpr select(SmtType stype, ResolvedType javaType, SExpr array, SExpr index) { - return list(javaType, stype, symbol("select"), array, index); - } - - public SExpr store(SExpr array, SExpr index, SExpr value) { - return list(array.getJavaType(), array.getSmtType(), symbol("store"), array, index, value); - } - - public SExpr fieldAccess(ResolvedType javaType, SmtType stype, String field, SExpr obj) { - return fnApply(javaType, stype, field, obj); - } - - private SExpr typeException(String fmt, Object... args) { - throw new RuntimeException(String.format(fmt, args)); - } - - public SExpr let(List vars, SExpr body) { - return list(body.getJavaType(), body.getSmtType(), "let", list(vars), body); - } - - public SExpr nonNull(SExpr expr) { - return not(equality(expr, makeNull())); - } - - public SExpr binder(SmtType type, String name) { - return list(null, null, name, type(type)); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SAtom.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SAtom.java deleted file mode 100644 index c0fd5d9cbf..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SAtom.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.github.jmlparser.smt.model; - -import com.github.javaparser.resolution.types.ResolvedType; - -import java.io.PrintWriter; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class SAtom extends SExpr { - private String value; - - public SAtom(SmtType stype, ResolvedType javaType, String value) { - this.smtType = stype; - this.javaType = javaType; - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public void appendTo(PrintWriter writer) { - writer.write(value); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SExpr.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SExpr.java deleted file mode 100644 index 4e597c94bf..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SExpr.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.github.jmlparser.smt.model; - -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.jmlparser.smt.solver.AppendableTo; -import org.jetbrains.annotations.Nullable; - -import java.io.PrintWriter; -import java.io.StringWriter; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public abstract class SExpr implements AppendableTo { - @Nullable - ResolvedType javaType; - @Nullable - SmtType smtType; - - @Nullable - public ResolvedType getJavaType() { - return javaType; - } - - @Nullable - public SmtType getSmtType() { - return smtType; - } - - public SList asList() { - return (SList) this; - } - - public String asSymbolValue() { - return ((SAtom) this).getValue(); - } - - @Override - public String toString() { - StringWriter sw = new StringWriter(); - appendTo(new PrintWriter(sw)); - return sw.toString(); - } - - /*public int asNumberValue() { - return ((com.github.jmlparser.smt.SExpr.SNumber) this).value; - }*/ -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SList.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SList.java deleted file mode 100644 index f24d266299..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SList.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.github.jmlparser.smt.model; - -import com.github.javaparser.resolution.types.ResolvedType; - -import java.io.PrintWriter; -import java.util.Objects; - -/** - * @author Alexander Weigl - * @version 1 (07.08.22) - */ -public class SList extends SExpr { - private SExpr[] value; - - public SList(SmtType stype, ResolvedType javaType, SExpr... args) { - this.smtType = stype; - this.javaType = javaType; - this.value = args; - for (SExpr arg : args) { - Objects.requireNonNull(arg); - } - } - - public SExpr[] getValue() { - return value; - } - - @Override - public void appendTo(PrintWriter writer) { - writer.write('('); - for (int i = 0; i < value.length; i++) { - value[i].appendTo(writer); - if (i < value.length - 1) - writer.write(' '); - } - writer.write(')'); - } - - public SExpr get(int i) { - return value[i]; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SmtType.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SmtType.java deleted file mode 100644 index e46bbde350..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/model/SmtType.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.github.jmlparser.smt.model; - -import javax.annotation.Nonnull; -import java.util.HashMap; -import java.util.Map; - -public class SmtType { - public static final SmtType FP32 = new SmtType("(_ FloatingPoint 32)"); - public static final SmtType FP64 = new SmtType("(_ FloatingPoint 64)"); - public static final SmtType STRING = new SmtType("String"); - - - public static class BitVec extends SmtType { - public final int width; - - BitVec(int width) { - super("(_ BitVec " + width + ")"); - this.width = width; - } - } - - - @Nonnull - private static final Map bvCache = new HashMap<>(8); - - public static final SmtType COMMAND = new SmtType("_COMMAND_"); - public static final SmtType INT = new SmtType("Int"); - public static final SmtType REAL = new SmtType("Real"); - public static final SmtType BOOL = new SmtType("Bool"); - public static final SmtType BV8 = getBitVec(8); - public static final SmtType BV16 = getBitVec(16); - public static final SmtType BV32 = getBitVec(32); - public static final SmtType BV64 = getBitVec(64); - public static final SmtType SYMBOL = new SmtType("_SYMBOL_"); - public static final SmtType TYPE = new SmtType("_TYPE_"); - - public static final SmtType JAVA_OBJECT = new SmtType("_TYPE_"); - - - private SmtType(String name) { - this.name = name; - } - - public static BitVec getBitVec(int width) { - return bvCache.computeIfAbsent(width, BitVec::new); - } - - private final String name; - - @Override - public String toString() { - return name; - } - - public static class Array extends SmtType { - public final SmtType from; - public final SmtType to; - - public Array(SmtType intType, SmtType cType) { - super("(Array " + intType.name + " " + cType.name + ")"); - this.from = intType; - this.to = cType; - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/AppendableTo.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/AppendableTo.java deleted file mode 100644 index b9f3abf4ea..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/AppendableTo.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.jmlparser.smt.solver; - -import java.io.PrintWriter; - -/** - * @author Alexander Weigl - * @version 1 (08.08.22) - */ -public interface AppendableTo { - void appendTo(PrintWriter writer); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SExprParser.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SExprParser.java deleted file mode 100644 index 3378f6efd4..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SExprParser.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.github.jmlparser.smt.solver; - -import com.github.jmlparser.smt.model.SAtom; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.model.SList; -import org.jetbrains.annotations.Nullable; - -import java.io.IOException; -import java.io.PushbackReader; -import java.io.Reader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Predicate; - -import static java.lang.String.format; - -public class SExprParser { - public static SExpr parse(String input) throws IOException { - return parse(new StringReader(input)); - } - - public static SExpr parse(Reader reader) throws IOException { - return parse(new PushbackReader(reader)); - } - - @Nullable - public static SExpr parse(PushbackReader reader) throws IOException { - int c = peekChar(reader); - if (c == (char) -1) // end of input - return null; - else if (c == '(') { - consumeChar(reader); // consume '(' - ArrayList seq = new ArrayList<>(); - do { - c = peekChar(reader); - if (c == ')') { - consumeChar(reader); - break; - } - SExpr child = parse(reader); - if (child == null) { - throw new IllegalArgumentException("List not closed."); - } - seq.add(child); - } while (true); - return new SList(null, null, seq.toArray(new SExpr[0])); - } else if (Character.isDigit(c) || c == '-') { - return parseNumber(reader); - } else if (Character.isAlphabetic(c) || c == ':') { - return parseSymbol(reader); - } else if (c == '"') { - return parseString(reader); - } else { - } - throw new IllegalStateException(format("Unexpected character: %c (%d)", c, c)); - } - - private static SExpr parseString(PushbackReader reader) throws IOException { - StringBuilder symbol = new StringBuilder("\""); - consumeChar(reader); - int c; - do { - c = reader.read(); - if (c == -1) - throw new RuntimeException("String literal early aborted"); - symbol.append((char) c); - } while (c != '"'); - return new SAtom(null, null, symbol.toString()); - } - - private static int consumeChar(PushbackReader reader) throws IOException { - return reader.read(); - } - - private static int peekChar(PushbackReader reader) throws IOException { - consumeEmptiness(reader); - int c = reader.read(); - reader.unread(c); - return c; - } - - private static void consumeEmptiness(PushbackReader reader) throws IOException { - int c; - do { - consumeWhitespace(reader); - consumeComment(reader); - c = reader.read(); - reader.unread(c); - } while (Character.isWhitespace(c) || c == ';'); - } - - private static void consumeWhitespace(PushbackReader reader) throws IOException { - consumeUntil(reader, (x) -> !Character.isWhitespace(x)); - } - - private static void consumeComment(PushbackReader reader) throws IOException { - int c = reader.read(); - if (c == ';') { - consumeUntil(reader, (x) -> x != '\n'); - } else { - reader.unread(c); - } - } - - private static int consumeUntil(PushbackReader reader, Predicate pred) throws IOException { - int c; - do { - c = reader.read(); - } while (!pred.test(c) && c != (char) -1); - reader.unread(c); - return c; - } - - private static SExpr parseNumber(PushbackReader reader) throws IOException { - int num = 0; - int factor = 1; - int c = reader.read(); - if (c == '-') { - factor = -1; - } else { - reader.unread(c); - } - - do { - c = reader.read(); - if (c == -1) break; - if (c == ')' || Character.isWhitespace(c) || c == ':') { - reader.unread(c); - break; - } - if (Character.isDigit(c)) { - num = (num * 10) + (c - '0'); - } else { - throw new IllegalStateException("Given number is invalid. Char " + (char) c + " found"); - } - } while (true); - return new SAtom(null, null, "" + (num * factor)); - } - - private static SExpr parseSymbol(PushbackReader reader) throws IOException { - StringBuilder symbol = new StringBuilder(); - do { - int c = reader.read(); - if (c == -1) break; - if (c == ')' || Character.isWhitespace(c)) { - reader.unread(c); - break; - } - symbol.append((char) c); - } while (true); - return new SAtom(null, null, symbol.toString()); - } - - public static List parseAll(Reader in) throws IOException { - PushbackReader r = new PushbackReader(in); - List exprs = new ArrayList<>(1024); - int c; - while ((c = r.read()) != -1) { - r.unread(c); - SExpr sexpr = SExprParser.parse(r); - if (sexpr == null) break; - exprs.add(sexpr); - } - return exprs; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/Solver.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/Solver.java deleted file mode 100644 index 65bc320a3f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/Solver.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.github.jmlparser.smt.solver; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.Reader; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.ForkJoinTask; - -/** - * @author Alexander Weigl - * @version 1 (08.08.22) - */ -public class Solver { - public ForkJoinTask runAsync(String input) { - return ForkJoinPool.commonPool().submit(() -> run(input)); - } - - public SolverAnswer run(String input) throws IOException { - return run(writer -> writer.println(input)); - } - - protected Process startSmtSolver() throws IOException { - ProcessBuilder pb = new ProcessBuilder("sh", "-c", "z3 -smt2 -in"); - return pb.start(); - } - - public SolverAnswer run(AppendableTo query) throws IOException { - Process p = startSmtSolver(); - try (PrintWriter out = new PrintWriter(p.getOutputStream()); - Reader in = new InputStreamReader(p.getInputStream())) { - query.appendTo(out); - out.close(); - return new SolverAnswer(SExprParser.parseAll(in)); - } finally { - p.destroyForcibly(); - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SolverAnswer.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SolverAnswer.java deleted file mode 100644 index f80e650af8..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/smt/solver/SolverAnswer.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.github.jmlparser.smt.solver; - -import com.github.jmlparser.smt.model.SAtom; -import com.github.jmlparser.smt.model.SExpr; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (08.08.22) - */ -public class SolverAnswer { - private final List answers; - private int currentPos = 0; - - public SolverAnswer(List answers) { - this.answers = answers; - } - - public List getAnswers() { - return answers; - } - - public SolverAnswer expectSat() { - return expectSymbol("sat"); - } - - public SolverAnswer expectUnsat() { - return expectSymbol("unsat"); - } - - public SolverAnswer expectUnknown() { - return expectSymbol("unknown"); - } - - public SolverAnswer expectSymbol(String symbol) { - if (!isSymbol(symbol)) { - throw new RuntimeException("Unexpected symbol"); - } - return this; - } - - public boolean isSymbol(String symbol) { - return symbol.equals(((SAtom) peek()).getValue()); - } - - public SExpr peek() { - return answers.get(currentPos); - } - - public void consume() { - currentPos++; - } - - public List consumeErrors() { - List seq = new ArrayList<>(); - while (currentPos < answers.size()) { - if (isError()) { - seq.add(getErrorMessage()); - consume(); - } else { - break; - } - } - return seq; - } - - private String getErrorMessage() { - return peek().asList().get(1).asSymbolValue(); - } - - private boolean isError() { - try { - return peek().asList().get(0).asSymbolValue().equals("error"); - } catch (ClassCastException e) { - return false; - } - } - - @Override - public String toString() { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - answers.forEach(a -> { - a.appendTo(pw); - pw.println(); - }); - return sw.toString(); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/ExpressionCosts.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/ExpressionCosts.java deleted file mode 100644 index 96f946b8fe..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/ExpressionCosts.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.github.jmlparser.stat; - -import lombok.Data; - -/** - * @author Alexander Weigl - * @version 1 (02.06.22) - */ -@Data -public class ExpressionCosts { - private int sum = 1; - private int minus = 1; - private int divide = 1; - private int mult = 1; - private int mod = 1; - private int land = 1; - private int lor = 1; - private int lnot = 1; - private int band = 1; - private int bor = 2; - private int bnot = 1; - private int quantor = 3; - private int binderCostsPerVariable = 1; - private int nullLiteral = 0; - private int charLiteral = 0; - private int stringLiteral = 0; - private int integerLiteral = 0; - private int longLiteral = 0; - private int name = 0; - private int methodCall = 2; - private int conditional = 2; - private int cast = 1; - private int assign = 1; - private int let = 1; - private int compare = 1; - private int _instanceof = 1; -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatCommand.java deleted file mode 100644 index 1ef37a7fc2..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatCommand.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.jmlparser.stat; - -import com.beust.jcommander.Parameters; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"stat"}, - commandDescription = "Print statistics on JML specification") -public class StatCommand { -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatMain.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatMain.java deleted file mode 100644 index ee9b438359..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatMain.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.github.jmlparser.stat; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.github.javaparser.ParserConfiguration; -import com.github.javaparser.ast.CompilationUnit; -import com.github.jmlparser.Main; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import java.io.StringWriter; -import java.util.*; - -/** - * @author Alexander Weigl - * @version 1 (24.05.22) - */ -public class StatMain { - private static final Args args = new Args(); - - public static void main(String[] argv) throws ParserConfigurationException, TransformerException { - JCommander cmd = JCommander.newBuilder() - .programName("jml-stat") - .addObject(args) - .build(); - cmd.parse(argv); - - if (args.help) { - cmd.usage(); - return; - } - - ParserConfiguration config = new ParserConfiguration(); - config.setProcessJml(true); - config.setKeepJmlDocs(true); - for (String activeJmlKey : args.activeJmlKeys) { - String[] activeJmlKeys = activeJmlKey.split(","); - config.getJmlKeys().add(Arrays.asList(activeJmlKeys)); - } - - if (args.activeJmlKeys.isEmpty()) { - //config.getJmlKeys().add(new ArrayList<>()); - config.getJmlKeys().add(Collections.singletonList("key")); - //config.getJmlKeys().add(Collections.singletonList("openjml")); - } - - - DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = builderFactory.newDocumentBuilder(); - Document xmlDocument = builder.newDocument(); - final Element xmlRoot = xmlDocument.createElement("statistics-model"); - - Collection nodes = Main.parse(args.files, config); - final ExpressionCosts costs = new ExpressionCosts(); - for (List key : config.getJmlKeys()) { - StatVisitor statVisitor = new StatVisitor(xmlDocument, key, costs); - Element e = xmlDocument.createElement("settings"); - e.setAttribute("keys", "" + key); - xmlRoot.appendChild(e); - for (CompilationUnit node : nodes) { - node.accept(statVisitor, e); - } - } - - //Gson gson = new GsonBuilder().setPrettyPrinting().create(); - //System.out.println(gson.toJson(statVisitor.getNewlines())); - - Transformer transformer = TransformerFactory.newInstance().newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); - StreamResult result = new StreamResult(new StringWriter()); - DOMSource source = new DOMSource(xmlRoot); - transformer.transform(source, result); - String xmlString = result.getWriter().toString(); - System.out.println(xmlString); - } - - private static class Args { - @Parameter - private List files = new ArrayList<>(); - - @Parameter(names = "-k") - private List activeJmlKeys = new ArrayList<>(); - - @Parameter(names = "-h") - private boolean help = false; - - - @Parameter(names = {"-verbose"}, description = "Level of verbosity") - private Integer verbose = 1; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatVisitor.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatVisitor.java deleted file mode 100644 index 1316531594..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/stat/StatVisitor.java +++ /dev/null @@ -1,553 +0,0 @@ -package com.github.jmlparser.stat; - -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Modifier; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.*; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.ast.jml.NodeWithJmlTags; -import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration; -import com.github.javaparser.ast.jml.body.JmlFieldDeclaration; -import com.github.javaparser.ast.jml.body.JmlMethodDeclaration; -import com.github.javaparser.ast.jml.body.JmlRepresentsDeclaration; -import com.github.javaparser.ast.jml.clauses.*; -import com.github.javaparser.ast.jml.doc.*; -import com.github.javaparser.ast.jml.expr.*; -import com.github.javaparser.ast.jml.stmt.*; -import com.github.javaparser.ast.modules.ModuleDeclaration; -import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; -import com.github.javaparser.ast.nodeTypes.NodeWithName; -import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName; -import com.github.javaparser.ast.stmt.LocalClassDeclarationStmt; -import com.github.javaparser.ast.visitor.GenericVisitorAdapter; -import com.github.javaparser.ast.visitor.VoidVisitorAdapter; -import com.github.javaparser.jml.JmlDocSanitizer; -import lombok.Getter; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import java.util.*; - - -/** - * @author Alexander Weigl - * @version 1 (24.05.22) - */ -public class StatVisitor extends VoidVisitorAdapter { - private final List keys; - @Getter - private final ExpressionCosts expressionCosts; - private final Document xmlDocument; - - public StatVisitor(Document xmlDocument, List keys, ExpressionCosts expressionCosts) { - this.keys = keys; - this.expressionCosts = expressionCosts; - this.xmlDocument = xmlDocument; - } - - //region Java Stuff - @Override - public void visit(CompilationUnit n, Element arg) { - super.visit(n, newJavaContext(arg, n.getClass().getSimpleName(), n.getStorage().get().getFileName())); - } - - @Override - public void visit(MethodDeclaration n, Element arg) { - arg = newJavaContext(arg, n.getClass().getSimpleName(), - n.getDeclarationAsString(false, false, true)); - super.visit(n, arg); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, Element arg) { - arg = newJavaContext(arg, n); - super.visit(n, arg); - } - - @Override - public void visit(ConstructorDeclaration n, Element arg) { - arg = newJavaContext(arg, n.getClass().getSimpleName(), - n.getDeclarationAsString(false, false, true)); - super.visit(n, arg); - } - - @Override - public void visit(AnnotationDeclaration n, Element arg) { - arg = newJavaContext(arg, n); - super.visit(n, arg); - } - - @Override - public void visit(AnnotationMemberDeclaration n, Element arg) { - super.visit(n, arg); - } - - @Override - public void visit(EnumDeclaration n, Element arg) { - super.visit(n, newJavaContext(arg, n)); - } - - @Override - public void visit(LocalClassDeclarationStmt n, Element arg) { - super.visit(n, arg); - } - - @Override - public void visit(ModuleDeclaration n, Element arg) { - super.visit(n, newJavaContext(arg, n)); - } - - private Element newJavaContext(Element parent, NodeWithName node) { - return newJavaContext(parent, node.getClass().getSimpleName(), node.getNameAsString()); - } - - private Element newJavaContext(Element parent, NodeWithSimpleName node) { - return newJavaContext(parent, node.getClass().getSimpleName(), node.getNameAsString()); - } - - private Element newJavaContext(Element parent, String simpleName, String name) { - Element e = xmlDocument.createElement(simpleName); - e.setAttribute("name", name); - parent.appendChild(e); - return e; - } - //endregion - - //region plain text reporting - @Override - public void visit(JmlDocDeclaration n, Element arg) { - reportPlainText(n, arg); - } - - @Override - public void visit(JmlDoc n, Element arg) { - } - - public void visit(JmlDocStmt n, Element arg) { - reportPlainText(n, arg); - } - - @Override - public void visit(JmlDocType n, Element arg) { - reportPlainText(n, arg); - } - - private void reportPlainText(JmlDocContainer n, Element arg) { - JmlDocSanitizer doc = new JmlDocSanitizer(new TreeSet<>(keys)); - String san = doc.asString(n.getJmlComments(), false); - int newlines = newlines(san); - Element e = xmlDocument.createElement("jml-comment"); - arg.appendChild(e); - e.setAttribute("newlines", "" + newlines); - e.setAttribute("type", n.getClass().getSimpleName()); - e.setAttribute("chars", "" + san.length()); - } - //endregion - - @Override - public void visit(JmlClassExprDeclaration n, Element arg) { - if (active(n)) { - Element e = newElement(arg, n.getKind().getIdentifier()); - Element expr = getExpressionStat(n.getInvariant()); - e.appendChild(expr); - if (n.getName().isPresent()) { - e.setAttribute("name", n.getName().get().asString()); - } - setModifierAsAttributes(n, e); - } - } - - private void setModifierAsAttributes(NodeWithModifiers n, Element e) { - for (Modifier modifier : n.getModifiers()) { - e.setAttribute("has" + modifier.getKeyword().asString(), "true"); - } - } - - private Element getExpressionStat(Expression expr) { - Element e = xmlDocument.createElement("expr"); - Integer costs = expr.accept(new ExpressionComplexity(), expressionCosts); - int numOfVariables = numberOfVariables(expr); - int length = lengthOf(expr); - e.setAttribute("complexity", "" + costs); - e.setAttribute("numOfVariables", "" + numOfVariables); - e.setAttribute("length", "" + length); - - Map, Integer> map = count(expr); - map.forEach((k, v) -> e.setAttribute(k.getSimpleName(), "" + v)); - return e; - } - - private int lengthOf(Expression expr) { - return expr.toString().length(); - } - - private int numberOfVariables(Expression expr) { - int sum = 0; - for (Node childNode : expr.getChildNodes()) { - if (childNode instanceof NameExpr) sum++; - else if (childNode instanceof Expression && !childNode.getChildNodes().isEmpty()) { - sum += numberOfVariables((Expression) childNode); - } - } - return sum; - } - - private Element newElement(Element parent, String tag) { - Element e = xmlDocument.createElement(tag); - parent.appendChild(e); - return e; - } - - private boolean active(NodeWithJmlTags n) { - return equal(keys, n.getJmlTags()); - } - - - @Override - public void visit(JmlRepresentsDeclaration n, Element arg) { - if (active(n)) { - Element a = newElement(arg, "represents"); - a.setAttribute("name", n.getNameAsString()); - setModifierAsAttributes(n, a); - } - } - - @Override - public void visit(JmlMethodDeclaration n, Element arg) { - if (active(n)) { - arg = newJavaContext(arg, n.getClass().getSimpleName(), n.getMethodDeclaration().getNameAsString()); - setModifierAsAttributes(n.getMethodDeclaration(), arg); - super.visit(n.getMethodDeclaration(), arg); - } - } - - - @Override - public void visit(JmlContract n, Element arg) { - if (active(n)) { - String name = "contract_" + n.getRange().get().begin.line; - if (n.getName().isPresent()) { - name = n.getName().get().getIdentifier(); - } - Element e = newJavaContext(arg, n.getClass().getSimpleName(), name); - e.setAttribute("type", n.getType().toString()); - setModifierAsAttributes(n, e); - e.setAttribute("behavior", "" + n.getBehavior()); - super.visit(n, e); - } - } - - @Override - public void visit(JmlExpressionStmt n, Element arg) { - if (active(n)) { - Element e = newElement(arg, n.getKind().jmlSymbol()); - e.appendChild(getExpressionStat(n.getExpression())); - } - } - - @Override - public void visit(JmlUnreachableStmt n, Element arg) { - if (active(n)) { - Element e = newElement(arg, "jml-unreachable"); - } - } - - @Override - public void visit(JmlBeginStmt n, Element arg) { - if (active(n)) { - newElement(arg, "jml-begin"); - } - } - - @Override - public void visit(JmlEndStmt n, Element arg) { - if (active(n)) { - newElement(arg, "jml-end"); - } - } - - @Override - public void visit(JmlGhostStmt n, Element arg) { - if (active(n)) { - Element e = newElement(arg, "jml-ghost"); - e.setAttribute("statements", ""); - super.visit(n, e); - } - } - - - @Override - public void visit(JmlLabelStmt n, Element arg) { - if (active(n)) { - newElement(arg, "jml-label"); - } - } - - @Override - public void visit(JmlSimpleExprClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - e.appendChild(getExpressionStat(n.getExpression())); - } - - @Override - public void visit(JmlSignalsClause n, Element arg) { - newElement(arg, n.getKind().jmlSymbol); - } - - @Override - public void visit(JmlSignalsOnlyClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - e.setAttribute("numOfTypes", "" + n.getTypes().size()); - } - - @Override - public void visit(JmlOldClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - e.setAttribute("numOfDecls", "" + n.getDeclarations().getVariables().size()); - } - - @Override - public void visit(JmlAccessibleClause n, Element arg) { - super.visit(n, arg); - } - - @Override - public void visit(JmlMultiExprClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - for (Expression expression : n.getExpressions()) { - e.appendChild(getExpressionStat(expression)); - } - } - - @Override - public void visit(JmlCallableClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - } - - @Override - public void visit(JmlCapturesClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - } - - @Override - public void visit(JmlForallClause n, Element arg) { - Element e = newElement(arg, n.getKind().jmlSymbol); - e.setAttribute("numVars", "" + n.getBoundedVariables().size()); - } - - @Override - public void visit(JmlRefiningStmt n, Element arg) { - if (active(n)) { - Element e = newElement(arg, "jml-refining"); - } - } - - @Override - public void visit(JmlClauseIf n, Element arg) { - super.visit(n, arg); - } - - private static int newlines(String text) { - char[] chars = text.toCharArray(); - int n = 0; - for (char aChar : chars) { - if (aChar == '\n') { - n++; - } - } - return n; - } - - - @Override - public void visit(JmlFieldDeclaration n, Element arg) { - update(n, this::update); - } - - interface Update { - void fn(Element parent, R node); - } - - public > void update(R n, Update update) { - } - - private static boolean equal(List keySet, NodeList jmlTags) { - if (keySet.size() != jmlTags.size()) { - return false; - } - - for (int i = 0; i < keySet.size(); i++) { - if (!keySet.get(i).equals(jmlTags.get(i).getIdentifier())) { - return false; - } - } - return true; - } - - private void update(Element parent, JmlFieldDeclaration n) { - /*if (n.getDecl().hasModifier(Modifier.DefaultKeyword.JML_GHOST)) { - getClassStat(stat, n).addNumOfGhostFields(1); - } else if (n.getDecl().hasModifier(Modifier.DefaultKeyword.JML_MODEL)) { - getClassStat(stat, n).addNumOfModelFields(1); - } - */ - } - - - private Map, Integer> count(Expression e) { - final Map, Integer> occCounter = new HashMap<>(); - ArrayDeque q = new ArrayDeque<>(); - q.add(e); - - while (!q.isEmpty()) { - Node n = q.pop(); - occCounter.compute(n.getClass(), (k, i) -> i == null ? 1 : i + 1); - for (Node childNode : n.getChildNodes()) { - if (childNode instanceof Expression) { - q.add(childNode); - } - } - } - return occCounter; - } - -} - -class ExpressionComplexity extends GenericVisitorAdapter { - @Override - public Integer visit(ArrayAccessExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(ArrayCreationExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(ArrayInitializerExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(AssignExpr n, ExpressionCosts arg) { - return arg.getAssign() + n.getTarget().accept(this, arg) + n.getValue().accept(this, arg); - } - - @Override - public Integer visit(BinaryExpr n, ExpressionCosts arg) { - //TODO distinguish by operator - return arg.getMinus() + n.getLeft().accept(this, arg) + n.getRight().accept(this, arg); - } - - @Override - public Integer visit(UnaryExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(LambdaExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(CastExpr n, ExpressionCosts arg) { - return arg.getCast() + n.getExpression().accept(this, arg); - } - - @Override - public Integer visit(CharLiteralExpr n, ExpressionCosts arg) { - return arg.getCharLiteral(); - } - - @Override - public Integer visit(ConditionalExpr n, ExpressionCosts arg) { - return arg.getConditional() + n.getCondition().accept(this, arg) + n.getThenExpr().accept(this, arg) + n.getElseExpr().accept(this, arg); - } - - @Override - public Integer visit(EnclosedExpr n, ExpressionCosts arg) { - return n.getInner().accept(this, arg); - } - - @Override - public Integer visit(IntegerLiteralExpr n, ExpressionCosts arg) { - return arg.getIntegerLiteral(); - } - - @Override - public Integer visit(LongLiteralExpr n, ExpressionCosts arg) { - return arg.getLongLiteral(); - } - - @Override - public Integer visit(MethodCallExpr n, ExpressionCosts arg) { - return arg.getMethodCall() + sum(n.getArguments(), arg); - } - - @Override - public Integer visit(NameExpr n, ExpressionCosts arg) { - return arg.getName(); - } - - @Override - public Integer visit(NullLiteralExpr n, ExpressionCosts arg) { - return arg.getNullLiteral(); - } - - @Override - public Integer visit(JmlQuantifiedExpr n, ExpressionCosts arg) { - return arg.getQuantor() + n.getVariables().size() * arg.getBinderCostsPerVariable() + sum(n.getExpressions(), arg); - } - - private int sum(NodeList n, ExpressionCosts arg) { - return n.stream().mapToInt(it -> - Objects.requireNonNull(it.accept(this, arg), it.getClass().getSimpleName())).sum(); - } - - @Override - public Integer visit(JmlTypeExpr n, ExpressionCosts arg) { - return 1; - } - - @Override - public Integer visit(SuperExpr n, ExpressionCosts arg) { - return 0; - } - - @Override - public Integer visit(SwitchExpr n, ExpressionCosts arg) { - return n.getSelector().accept(this, arg) + n.getEntries().stream().mapToInt(it -> sum(it.getLabels(), arg) + 1).sum(); - } - - @Override - public Integer visit(PatternExpr n, ExpressionCosts arg) { - return 0; - } - - @Override - public Integer visit(BooleanLiteralExpr n, ExpressionCosts arg) { - return 0; - } - - @Override - public Integer visit(InstanceOfExpr n, ExpressionCosts arg) { - return arg.get_instanceof() + n.getExpression().accept(this, arg); - } - - @Override - public Integer visit(JmlLabelExpr n, ExpressionCosts arg) { - return super.visit(n, arg); - } - - @Override - public Integer visit(JmlLetExpr n, ExpressionCosts arg) { - return arg.getLet() + arg.getBinderCostsPerVariable() * n.getVariables().getVariables().size(); - } - - @Override - public Integer visit(JmlMultiCompareExpr n, ExpressionCosts arg) { - return arg.getCompare() * n.getOperators().size(); - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Helper.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Helper.java deleted file mode 100644 index 847c7fda2e..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Helper.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.github.jmlparser.utils; - -import com.github.javaparser.ast.Jmlish; -import com.github.javaparser.ast.Node; - -import java.util.*; -import java.util.function.Function; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public class Helper { - public static Node findAndApply(Class clazz, Node node, Function fn) { - if (clazz.isAssignableFrom(node.getClass())) { - return fn.apply((T) node); - } - - Queue queue = new ArrayDeque<>(1024); - queue.add(node); - - while (!queue.isEmpty()) { - var n = queue.poll(); - if (clazz.isAssignableFrom(node.getClass())) { - var other = fn.apply((T) n); - if (other != n) { - n.replace(n, other); - } - } else { - //traverse - queue.addAll(node.getChildNodes()); - } - } - - return node; - } - - public static List findAllJmlContainers(Node cu) { - var queue = new LinkedList(); - queue.add(cu); - List res = new ArrayList<>(128); - while (!queue.isEmpty()) { - var n = queue.pollLast(); - if (n instanceof Jmlish) { - res.add(n); - } else { - queue.addAll(n.getChildNodes()); - } - } - return res; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JMLUtils.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JMLUtils.java deleted file mode 100644 index 841a9b5c11..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JMLUtils.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.github.jmlparser.utils; - -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.expr.BinaryExpr; -import com.github.javaparser.ast.expr.BooleanLiteralExpr; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.ast.expr.SimpleName; -import com.github.javaparser.ast.jml.clauses.JmlClause; -import com.github.javaparser.ast.jml.clauses.JmlContract; -import com.github.javaparser.ast.jml.expr.JmlMultiCompareExpr; -import com.github.javaparser.ast.type.ArrayType; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.github.javaparser.ast.type.PrimitiveType; -import com.github.javaparser.ast.type.Type; -import com.github.javaparser.resolution.types.ResolvedArrayType; -import com.github.javaparser.resolution.types.ResolvedPrimitiveType; -import com.github.javaparser.resolution.types.ResolvedType; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (02.07.22) - */ -public class JMLUtils { - - public static final String GENERATED_COMBINED = "_generated_combined_"; - - public static Expression unroll(JmlMultiCompareExpr n) { - Expression r; - if (n.getExpressions().isEmpty()) { - r = new BooleanLiteralExpr(true); - } else if (n.getExpressions().size() == 1) { - r = n.getExpressions().get(0); - } else { - Expression e = null; - for (int i = 0; i < n.getExpressions().size() - 1; i++) { - BinaryExpr cmp = new BinaryExpr( - n.getExpressions().get(i).clone(), - n.getExpressions().get(i + 1).clone(), - n.getOperators().get(i)); - e = e == null ? cmp : new BinaryExpr(e, cmp, BinaryExpr.Operator.AND); - } - r = e; - } - r.setParentNode(n.getParentNode().orElse(null)); - return r; - } - - public static void unroll(NodeList old) { - if (old.isEmpty()) return; - var target = new ArrayList(128); - for (JmlContract c : old) { - target.addAll(unroll(c)); - } - old.clear(); - old.addAll(target); - } - - private static List unroll(JmlContract c) { - if (c.getSubContracts().isEmpty()) - return Collections.singletonList(c); - var seq = c.getSubContracts().stream() - .flatMap(e -> unroll(e).stream()) - .toList(); - for (var sub : seq) { - for (JmlClause clause : c.getClauses()) { - sub.getClauses().add(clause.clone()); - } - } - return seq; - } - - public static JmlContract createJointContract(NodeList m) { - var find = m.stream() - .filter(name -> - name.getName().map(simpleName -> - simpleName.asString().equals(GENERATED_COMBINED)) - .orElse(false)).findFirst(); - if (find.isPresent()) - return find.get(); - - unroll(m); - - var contract = new JmlContract(); - contract.setName(new SimpleName(GENERATED_COMBINED)); - //TODO weigl combine all requires, ensures ... clauses - m.add(contract); - return contract; - } - - public static Type resolvedType2Type(ResolvedType type) { - if (type.isPrimitive()) { - ResolvedPrimitiveType rType = type.asPrimitive(); - return new PrimitiveType( - switch (rType) { - case BYTE -> PrimitiveType.Primitive.BYTE; - case SHORT -> PrimitiveType.Primitive.SHORT; - case CHAR -> PrimitiveType.Primitive.CHAR; - case INT -> PrimitiveType.Primitive.INT; - case LONG -> PrimitiveType.Primitive.LONG; - case BOOLEAN -> PrimitiveType.Primitive.BOOLEAN; - case FLOAT -> PrimitiveType.Primitive.FLOAT; - case DOUBLE -> PrimitiveType.Primitive.DOUBLE; - } - ); - } - - if (type.isArray()) { - ResolvedArrayType aType = type.asArrayType(); - return new ArrayType(resolvedType2Type(aType.getComponentType())); - } - - if (type.isReferenceType()) { - var rType = type.asReferenceType(); - return new ClassOrInterfaceType(rType.getQualifiedName()); - } - - throw new RuntimeException("Unsupported type"); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JavaTemplate.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JavaTemplate.java deleted file mode 100644 index c7576f2c28..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/JavaTemplate.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.github.jmlparser.utils; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.body.BodyDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.ast.expr.SimpleName; -import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.Statement; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Alexander Weigl - * @version 1 (10.10.22) - */ -public class JavaTemplate { - private final T template; - - public JavaTemplate(T template) { - this.template = template; - } - - public static JavaTemplate fromBlock(String javaCode) { - return new JavaTemplate<>(StaticJavaParser.parseBlock(javaCode)); - } - - public static JavaTemplate fromStatement(String javaCode) { - return new JavaTemplate<>(StaticJavaParser.parseStatement(javaCode)); - } - - public static JavaTemplate> fromType(String javaCode) { - return new JavaTemplate<>(StaticJavaParser.parseTypeDeclaration(javaCode)); - } - - public static JavaTemplate> fromBodyDecl(String javaCode) { - return new JavaTemplate<>(StaticJavaParser.parseBodyDeclaration(javaCode)); - } - - @SuppressWarnings("unchecked") - public T instantiate(SubstitutionFactory substitutionFactory) { - var copy = template.clone(); - replace(copy, substitutionFactory); - return (T) copy; - } - - private void replace(Node node, SubstitutionFactory factory) { - for (Node childNode : node.getChildNodes()) { - replace(childNode, factory); - if (factory.replacable(childNode)) { - node.replace(childNode, factory.substitutionOf(childNode)); - } - } - } - - interface SubstitutionFactory { - boolean replacable(Node node); - - Node substitutionOf(Node node); - } - - public static class IdentifierSubstitution implements SubstitutionFactory { - private final Map map; - - public IdentifierSubstitution() { - this(new HashMap<>()); - } - - public IdentifierSubstitution(Map map) { - this.map = map; - } - - public void add(String name, String newName) { - map.put(name, newName); - } - - @Override - public boolean replacable(Node node) { - return node instanceof SimpleName sn && map.containsKey(sn.asString()); - } - - @Override - public Node substitutionOf(Node node) { - if (node instanceof SimpleName sn) - sn.setIdentifier(map.get(sn.asString())); - return node; - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Pattern.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Pattern.java deleted file mode 100644 index 732ed3b99a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/utils/Pattern.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.github.jmlparser.utils; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.metamodel.PropertyMetaModel; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayDeque; -import java.util.HashMap; -import java.util.IdentityHashMap; -import java.util.Map; - -/** - * @author Alexander Weigl - * @version 1 (11.10.22) - */ -public class Pattern { - @Nonnull - private final T pattern; - @Nonnull - private final Map placeholders = new IdentityHashMap<>(); - - public Pattern(@NotNull T pattern) { - this.pattern = pattern; - } - - - @Nullable - public Map match(Node tree) { - return match(pattern, tree, new HashMap<>()); - } - - @Nullable - private Map match(Node pattern, Node tree, Map map) { - if (pattern == null && tree == null) return map; - if (pattern != null ^ tree != null) return null; - - if (placeholders.containsKey(pattern)) { - final var key = placeholders.get(pattern); - if (map.containsKey(key) && !map.get(key).equals(tree)) - return null; - else - map.put(key, tree); - return map; - } - - if (pattern.getClass() != tree.getClass()) return null; - - - for (PropertyMetaModel prop : pattern.getMetaModel().getAllPropertyMetaModels()) { - final var childPattern = prop.getValue(pattern); - final var childTree = prop.getValue(tree); - - if (prop.isNode()) { - map = match((Node) childPattern, (Node) childTree, map); - if (map == null) return null; - } else if (prop.isNodeList()) { - var a = (NodeList) childPattern; - var b = (NodeList) childTree; - if (a.size() != b.size()) return null; - - for (int i = 0; i < a.size(); i++) { - map = match(a.get(i), b.get(i), map); - if (map == null) return null; - } - } else { - if (!childPattern.equals(childTree)) - return null; - } - } - - return map; - } - - - public Map find(Node n) { - var queue = new ArrayDeque(); - queue.add(n); - while (!queue.isEmpty()) { - var e = queue.pop(); - var r = match(e); - if (r != null) return r; - queue.addAll(e.getChildNodes()); - } - return null; - } - - public void addPlaceholder(Node placeholder, String label) { - this.placeholders.put(placeholder, label); - } - -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WDVisitor.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WDVisitor.java deleted file mode 100644 index e11d40ac7a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WDVisitor.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.github.jmlparser.wd; - -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.ast.jml.body.JmlClassExprDeclaration; -import com.github.javaparser.ast.jml.clauses.JmlMultiExprClause; -import com.github.javaparser.ast.jml.expr.JmlLabelExpr; -import com.github.javaparser.ast.jml.expr.JmlLetExpr; -import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr; -import com.github.javaparser.ast.jml.expr.JmlTypeExpr; -import com.github.javaparser.ast.jml.stmt.JmlExpressionStmt; -import com.github.javaparser.ast.visitor.GenericVisitorAdapter; -import com.github.javaparser.ast.visitor.VoidVisitorAdapter; -import com.github.jmlparser.smt.ArithmeticTranslator; -import com.github.jmlparser.smt.JmlExpr2Smt; -import com.github.jmlparser.smt.SmtQuery; -import com.github.jmlparser.smt.SmtTermFactory; -import com.github.jmlparser.smt.model.SExpr; -import org.jetbrains.annotations.NotNull; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @author Alexander Weigl - * @version 1 (14.06.22) - */ -public class WDVisitor extends VoidVisitorAdapter { - public WDVisitor() { - } - - @Override - public void visit(JmlExpressionStmt n, Object arg) { - n.getExpression().accept(this, arg); - } -} - -class WDVisitorExpr extends GenericVisitorAdapter { - @NotNull - private final JmlExpr2Smt smtFormula; - private final ArithmeticTranslator translator; - - private static final SmtTermFactory term = SmtTermFactory.INSTANCE; - - WDVisitorExpr(SmtQuery smtLog, ArithmeticTranslator translator) { - smtFormula = new JmlExpr2Smt(smtLog, translator); - this.translator = translator; - } - - @Override - public SExpr visit(NameExpr n, Object arg) { - String name = n.getNameAsString(); - switch (name) { - case "\\result": - case "\\exception": - return term.makeTrue(); - default: - return term.makeTrue(); - } - } - - @Override - public SExpr visit(ArrayAccessExpr n, Object arg) { - return term.and( - n.getName().accept(this, arg), - n.getIndex().accept(this, arg)); - } - - @Override - public SExpr visit(ArrayCreationExpr n, Object arg) { - //TODO - return n.getInitializer().get().accept(this, arg); - } - - @Override - public SExpr visit(ArrayInitializerExpr n, Object arg) { - List seq = n.getValues().stream().map(it -> it.accept(this, arg)).collect(Collectors.toList()); - return term.and(seq); - } - - @Override - public SExpr visit(AssignExpr n, Object arg) { - return term.makeFalse(); - } - - @Override - public SExpr visit(BinaryExpr n, Object arg) { - switch (n.getOperator()) { - case IMPLICATION: - BinaryExpr be = new BinaryExpr( - new UnaryExpr(n.getLeft(), UnaryExpr.Operator.LOGICAL_COMPLEMENT), - n.getRight(), BinaryExpr.Operator.OR); - return be.accept(this, arg); - case DIVIDE: - case REMAINDER: - SExpr fml = n.getRight().accept(smtFormula, arg); - return term.and( - n.getRight().accept(this, arg), - n.getLeft().accept(this, arg), - term.not(translator.binary(BinaryExpr.Operator.EQUALS, - fml, smtFormula.getTranslator().makeInt(BigInteger.ZERO)))); - default: - return term.and( - n.getRight().accept(this, arg), - n.getLeft().accept(this, arg)); - } - } - - @Override - public SExpr visit(BooleanLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(CastExpr n, Object arg) { - //TODO Type-check? - return n.getExpression().accept(this, arg); - } - - @Override - public SExpr visit(CharLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(ClassExpr n, Object arg) { - return term.makeFalse(); - } - - @Override - public SExpr visit(DoubleLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(EnclosedExpr n, Object arg) { - return wd(n.getInner()); - } - - @Override - public SExpr visit(FieldAccessExpr n, Object arg) { - return wd(n.getScope()); - } - - @Override - public SExpr visit(InstanceOfExpr n, Object arg) { - return n.getExpression().accept(this, arg); - } - - @Override - public SExpr visit(IntegerLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(StringLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(SuperExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(ThisExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(UnaryExpr n, Object arg) { - return n.getExpression().accept(this, arg); - } - - @Override - public SExpr visit(LambdaExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(MethodReferenceExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(TypeExpr n, Object arg) { - return super.visit(n, arg); - } - - @Override - public SExpr visit(SwitchExpr n, Object arg) { - return term.and(wd(n.getSelector())); - } - - @Override - public SExpr visit(TextBlockLiteralExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(PatternExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(JmlQuantifiedExpr n, Object arg) { - /*The quantified-expression is well-defined iff the two sub-expressions are well-defined. For a quantifier Q*/ - List seq = n.getExpressions().stream() - .map(it -> it.accept(this, arg)) - .collect(Collectors.toList()); - - Expression r = n.getExpressions().get(0); - Expression v = n.getExpressions().get(0); - - List args = new ArrayList<>(); - - if (JmlQuantifiedExpr.JmlDefaultBinder.CHOOSE.equals(n.getBinder())) { - return term.and( - term.forall(args, wd(r)), - term.forall(args, term.impl(valueOf(r), wd(v))), - term.exists(args, term.and( - valueOf(r), - valueOf(v)))); - } - return term.and( - term.forall(args, wd(r)), - term.forall(args, term.impl(valueOf(r), wd(v)))); - } - - private SExpr valueOf(Expression e) { - return e.accept(smtFormula, null); - } - - private SExpr wd(Expression e) { - return e.accept(this, null); - } - - @Override - public SExpr visit(JmlExpressionStmt n, Object arg) { - return wd(n.getExpression()); - } - - @Override - public SExpr visit(JmlLabelExpr n, Object arg) { - return wd(n.getExpression()); - } - - @Override - public SExpr visit(JmlLetExpr n, Object arg) { - return term.and(wd(n.getBody()) /* TODO arguments */, term.makeTrue()); - } - - @Override - public SExpr visit(JmlClassExprDeclaration n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(JmlTypeExpr n, Object arg) { - return term.makeTrue(); - } - - @Override - public SExpr visit(JmlMultiExprClause n, Object arg) { - return term.and(n.getExpressions().stream().map(this::wd).collect(Collectors.toList())); - } - - @Override - public SExpr visit(MethodCallExpr n, Object arg) { - String name = n.getNameAsString(); - switch (name) { - case "\\old": - case "\\pre": - case "\\past": - /* Well-definedness: The expression is well-defined if the first argument is well-defined - and any label argument names either a built-in label (§11.611.6) or an in-scope Java or - JML ghost label (S11.511.5).*/ - return n.getArguments().get(0).accept(this, arg); - case "\\fresh": - /* Well-definedness: The argument must be well-defined and non-null. The second argument, - if present, must be the identifier corresponding to an in-scope label or a built-in label. */ - return n.getArguments().get(0).accept(this, arg); - //TODO valueOf(n.getArguments().get(0)) != null - } - - List seq = n.getArguments().stream() - .map(it -> it.accept(this, arg)) - .collect(Collectors.toList()); - return term.and(seq); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WdCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WdCommand.java deleted file mode 100644 index 4552cc30fb..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WdCommand.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.jmlparser.wd; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"wd"}, - commandDescription = "Well-definedness check for JML files.") -public class WdCommand { - @Parameter(description = "Files to check") - private List files = new ArrayList<>(); - - public void run() { - System.out.println(files); - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WellDefinednessMain.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WellDefinednessMain.java deleted file mode 100644 index fdba8532ba..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/wd/WellDefinednessMain.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.github.jmlparser.wd; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.github.javaparser.JavaParser; -import com.github.javaparser.ParseResult; -import com.github.javaparser.ParserConfiguration; -import com.github.javaparser.ast.expr.Expression; -import com.github.jmlparser.smt.ArithmeticTranslator; -import com.github.jmlparser.smt.BitVectorArithmeticTranslator; -import com.github.jmlparser.smt.SmtQuery; -import com.github.jmlparser.smt.SmtTermFactory; -import com.github.jmlparser.smt.model.SExpr; -import com.github.jmlparser.smt.solver.Solver; -import com.github.jmlparser.smt.solver.SolverAnswer; -import lombok.SneakyThrows; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * @author Alexander Weigl - * @version 1 (13.06.22) - */ -public class WellDefinednessMain { - private static final Args args = new Args(); - - public static void main(String[] argv) { - JCommander cmd = JCommander.newBuilder().programName("jml-wd").addObject(args).build(); - cmd.parse(argv); - - if (args.help) { - cmd.usage(); - return; - } - - ParserConfiguration config = new ParserConfiguration(); - config.setProcessJml(true); - config.setKeepJmlDocs(true); - for (String activeJmlKey : args.activeJmlKeys) { - String[] activeJmlKeys = activeJmlKey.split(","); - config.getJmlKeys().add(Arrays.asList(activeJmlKeys)); - } - - if (args.activeJmlKeys.isEmpty()) { - config.getJmlKeys().add(Collections.singletonList("key")); - } - - WDVisitor wd = new WDVisitor(); - } - - public static boolean isWelldefined(String expr) { - ParserConfiguration config = new ParserConfiguration(); - config.setProcessJml(false); - JavaParser parser = new JavaParser(config); - return isWelldefined(parser, expr); - } - - public static boolean isWelldefined(JavaParser parser, String expr) { - ParseResult e = parser.parseJmlExpression(expr); - if (e.isSuccessful() && e.getResult().isPresent()) { - return isWelldefined(e.getResult().get()); - } - return false; - } - - @SneakyThrows - private static boolean isWelldefined(Expression e) { - SmtQuery query = new SmtQuery(); - ArithmeticTranslator translator = new BitVectorArithmeticTranslator(query); - WDVisitorExpr visitor = new WDVisitorExpr(query, translator); - SExpr res = e.accept(visitor, null); - if ("true".equals(res.toString())) { - return true; - } - query.addAssert(SmtTermFactory.INSTANCE.not(res)); - query.checkSat(); - Solver solver = new Solver(); - SolverAnswer ans = solver.run(query); - System.out.println(query.toString()); - System.out.println(ans.toString()); - ans.consumeErrors(); - return ans.isSymbol("unsat"); - } - - private static class Args { - @Parameter - private List files = new ArrayList<>(); - - @Parameter(names = "-k") - private List activeJmlKeys = new ArrayList<>(); - - @Parameter(names = "-h") - private boolean help = false; - - - @Parameter(names = {"-verbose"}, description = "Level of verbosity") - private Integer verbose = 1; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribModifier.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribModifier.java deleted file mode 100644 index 45e1c63c52..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribModifier.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.Modifier; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Element; - -import java.util.Arrays; -import java.util.Collection; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public class AttribModifier implements PseudoAttributeProvider { - @Override - public @Nullable Collection attributeForNode(@NotNull Node node, @NotNull Element owner) { - if (node instanceof NodeWithModifiers m) { - return Arrays.stream(Modifier.DefaultKeyword.values()).map( - it -> new JPAttrPseudo(it.name(), () -> "" + m.hasModifier(it), owner)).toList(); - } - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribNodeWithName.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribNodeWithName.java deleted file mode 100644 index acf8102604..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/AttribNodeWithName.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.nodeTypes.NodeWithName; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Element; - -import java.util.Collection; -import java.util.Collections; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public class AttribNodeWithName implements PseudoAttributeProvider { - @Override - public @Nullable Collection attributeForNode(@NotNull Node node, @NotNull Element owner) { - if (node instanceof NodeWithName n) { - return Collections.singleton(new JPAttrPseudo("name", n::getNameAsString, owner)); - } - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/DocumentFactories.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/DocumentFactories.java deleted file mode 100644 index f1b09c8bb2..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/DocumentFactories.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.metamodel.PropertyMetaModel; -import org.w3c.dom.*; - -import java.util.List; -import java.util.ServiceLoader; - -/** - * @author Alexander Weigl - * @version 1 (30.11.22) - */ -public class DocumentFactories { - private static List providerList = null; - - public static List getAttributeProviders() { - if (providerList == null) { - var sl = ServiceLoader.load(PseudoAttributeProvider.class); - return providerList = sl.stream().map(ServiceLoader.Provider::get).toList(); - } - return providerList; - } - - public static boolean isNodeProperty(PropertyMetaModel mm) { - return mm.isNode() || mm.isNodeList(); - } - - public static Document getDocument(CompilationUnit node) { - return new JPDocument(node); - } - - public static JPElement getElement(com.github.javaparser.ast.Node it, Element parent) { - return new JPElement(it, parent); - } - - - public static NodeList wrap(List list) { - return new NodeList() { - @Override - public Node item(int index) { - return list.get(index); - } - - @Override - public int getLength() { - return list.size(); - } - }; - } - - public static NodeList wrap(Element... seq) { - return wrap(List.of(seq)); - } - - public static NamedNodeMap emptyNodeMap() { - return new NamedNodeMap() { - @Override - public Node getNamedItem(String name) { - return null; - } - - @Override - public Node setNamedItem(Node arg) throws DOMException { - return null; - } - - @Override - public Node removeNamedItem(String name) throws DOMException { - return null; - } - - @Override - public Node item(int index) { - return null; - } - - @Override - public int getLength() { - return 0; - } - - @Override - public Node getNamedItemNS(String namespaceURI, String localName) throws DOMException { - return null; - } - - @Override - public Node setNamedItemNS(Node arg) throws DOMException { - return null; - } - - @Override - public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { - return null; - } - }; - } - - public static Attr getAttribute(JPElement jpElement, PropertyMetaModel it) { - return new JPAttr(jpElement, it); - } - - public static NamedNodeMap nodeMap(JPElement jpElement) { - return new NamedNodeMap() { - @Override - public Node getNamedItem(String name) { - return jpElement.lazyAttributes().stream() - .filter(it -> it.getName().equals(name)) - .findFirst().orElse(null); - } - - @Override - public Node setNamedItem(Node arg) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node removeNamedItem(String name) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node item(int index) { - return jpElement.lazyAttributes().get(index); - } - - @Override - public int getLength() { - return jpElement.lazyAttributes().size(); - } - - @Override - public Node getNamedItemNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node setNamedItemNS(Node arg) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - }; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttr.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttr.java deleted file mode 100644 index 45441c059f..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttr.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.metamodel.PropertyMetaModel; -import org.jetbrains.annotations.NotNull; -import org.w3c.dom.*; - -/** - * Wraps a class attribute into the XML world. - * - * @author Alexander Weigl - * @version 1 (30.11.22) - */ -class JPAttr implements Attr { - final PropertyMetaModel attr; - final JPElement parent; - - public JPAttr(JPElement element, PropertyMetaModel metaModel) { - this.parent = element; - this.attr = metaModel; - } - - @Override - public String getName() { - return attr.getName(); - } - - @Override - public boolean getSpecified() { - return true; - } - - @Override - public String getValue() { - return attr.getValue(parent.astNode).toString(); - } - - @Override - public void setValue(String value) throws DOMException { - throw new DOMException((short) 0, "read-only"); - } - - @Override - public Element getOwnerElement() { - return parent; - } - - @Override - public TypeInfo getSchemaTypeInfo() { - return null; - } - - @Override - public boolean isId() { - return false; - } - - @NotNull - @Override - public String getNodeName() { - return getName(); - } - - @Override - public String getNodeValue() throws DOMException { - return attr.getValue(parent.astNode).toString(); - } - - @Override - public void setNodeValue(String nodeValue) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public short getNodeType() { - return 0; - } - - @Override - public Node getParentNode() { - return null; - } - - @NotNull - @Override - public NodeList getChildNodes() { - return DocumentFactories.wrap(); - } - - @Override - public Node getFirstChild() { - return null; - } - - @Override - public Node getLastChild() { - return null; - } - - @Override - public Node getPreviousSibling() { - return null; - } - - @Override - public Node getNextSibling() { - return null; - } - - @Override - public NamedNodeMap getAttributes() { - return null; - } - - @Override - public Document getOwnerDocument() { - return null; - } - - @Override - public Node insertBefore(Node newChild, Node refChild) throws DOMException { - return null; - } - - @Override - public Node replaceChild(Node newChild, Node oldChild) throws DOMException { - return null; - } - - @Override - public Node removeChild(Node oldChild) throws DOMException { - return null; - } - - @Override - public Node appendChild(Node newChild) throws DOMException { - return null; - } - - @Override - public boolean hasChildNodes() { - return false; - } - - @Override - public Node cloneNode(boolean deep) { - return null; - } - - @Override - public void normalize() { - - } - - @Override - public boolean isSupported(String feature, String version) { - return false; - } - - @Override - public String getNamespaceURI() { - return null; - } - - @Override - public String getPrefix() { - return null; - } - - @Override - public void setPrefix(String prefix) throws DOMException { - - } - - @Override - public String getLocalName() { - return null; - } - - @Override - public boolean hasAttributes() { - return false; - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public short compareDocumentPosition(Node other) throws DOMException { - return 0; - } - - @Override - public String getTextContent() throws DOMException { - return getValue(); - } - - @Override - public void setTextContent(String textContent) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public boolean isSameNode(Node other) { - return false; - } - - @Override - public String lookupPrefix(String namespaceURI) { - return null; - } - - @Override - public boolean isDefaultNamespace(String namespaceURI) { - return false; - } - - @Override - public String lookupNamespaceURI(String prefix) { - return null; - } - - @Override - public boolean isEqualNode(Node arg) { - return false; - } - - @Override - public Object getFeature(String feature, String version) { - return null; - } - - @Override - public Object setUserData(String key, Object data, UserDataHandler handler) { - return null; - } - - @Override - public Object getUserData(String key) { - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttrPseudo.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttrPseudo.java deleted file mode 100644 index b952220c05..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPAttrPseudo.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.github.jmlparser.xpath; - -import org.jetbrains.annotations.NotNull; -import org.w3c.dom.*; - -import java.util.function.Supplier; - -/** - * @author Alexander Weigl - * @version 1 (01.12.22) - */ -public class JPAttrPseudo implements org.w3c.dom.Attr { - final String name; - final Supplier supplier; - final Element owner; - - public JPAttrPseudo(String name, Supplier supplier, Element owner) { - this.name = name; - this.supplier = supplier; - this.owner = owner; - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean getSpecified() { - return true; - } - - @Override - public String getValue() { - return supplier.get(); - } - - @Override - public void setValue(String value) throws DOMException { - throw new IllegalStateException(); - } - - @Override - public Element getOwnerElement() { - return owner; - } - - @Override - public TypeInfo getSchemaTypeInfo() { - return null; - } - - @Override - public boolean isId() { - return false; - } - - @NotNull - @Override - public String getNodeName() { - return getName(); - } - - @Override - public String getNodeValue() throws DOMException { - return getValue(); - } - - @Override - public void setNodeValue(String nodeValue) throws DOMException { - throw new RuntimeException(); - } - - @Override - public short getNodeType() { - return ATTRIBUTE_NODE; - } - - @Override - public Node getParentNode() { - return getOwnerElement(); - } - - @NotNull - @Override - public NodeList getChildNodes() { - return DocumentFactories.wrap(); - } - - @Override - public Node getFirstChild() { - return null; - } - - @Override - public Node getLastChild() { - return null; - } - - @Override - public Node getPreviousSibling() { - return null; - } - - @Override - public Node getNextSibling() { - return null; - } - - @Override - public NamedNodeMap getAttributes() { - return null; - } - - @Override - public Document getOwnerDocument() { - return getParentNode().getOwnerDocument(); - } - - @Override - public Node insertBefore(Node newChild, Node refChild) throws DOMException { - return null; - } - - @Override - public Node replaceChild(Node newChild, Node oldChild) throws DOMException { - return null; - } - - @Override - public Node removeChild(Node oldChild) throws DOMException { - return null; - } - - @Override - public Node appendChild(Node newChild) throws DOMException { - return null; - } - - @Override - public boolean hasChildNodes() { - return false; - } - - @Override - public Node cloneNode(boolean deep) { - return null; - } - - @Override - public void normalize() { - - } - - @Override - public boolean isSupported(String feature, String version) { - return false; - } - - @Override - public String getNamespaceURI() { - return null; - } - - @Override - public String getPrefix() { - return null; - } - - @Override - public void setPrefix(String prefix) throws DOMException { - - } - - @Override - public String getLocalName() { - return null; - } - - @Override - public boolean hasAttributes() { - return false; - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public short compareDocumentPosition(Node other) throws DOMException { - return 0; - } - - @Override - public String getTextContent() throws DOMException { - return getValue(); - } - - @Override - public void setTextContent(String textContent) throws DOMException { - } - - @Override - public boolean isSameNode(Node other) { - return false; - } - - @Override - public String lookupPrefix(String namespaceURI) { - return null; - } - - @Override - public boolean isDefaultNamespace(String namespaceURI) { - return false; - } - - @Override - public String lookupNamespaceURI(String prefix) { - return null; - } - - @Override - public boolean isEqualNode(Node arg) { - return false; - } - - @Override - public Object getFeature(String feature, String version) { - return null; - } - - @Override - public Object setUserData(String key, Object data, UserDataHandler handler) { - return null; - } - - @Override - public Object getUserData(String key) { - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPDocument.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPDocument.java deleted file mode 100644 index a56ac4cd6b..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPDocument.java +++ /dev/null @@ -1,362 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.CompilationUnit; -import org.jetbrains.annotations.NotNull; -import org.w3c.dom.*; - -import java.util.List; - -import static org.w3c.dom.DOMException.NOT_SUPPORTED_ERR; - -public class JPDocument implements Document { - final JPRootElement root; - - public JPDocument(CompilationUnit node) { - root = new JPRootElement(List.of(node), this); - } - - @Override - public DocumentType getDoctype() { - return null; - } - - @Override - public DOMImplementation getImplementation() { - return null; - } - - @Override - public Element getDocumentElement() { - return root; - } - - @Override - public Element createElement(String tagName) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public DocumentFragment createDocumentFragment() { - return null; - } - - @Override - public Text createTextNode(String data) { - return null; - } - - @Override - public Comment createComment(String data) { - return null; - } - - @Override - public CDATASection createCDATASection(String data) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Attr createAttribute(String name) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public EntityReference createEntityReference(String name) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public NodeList getElementsByTagName(String tagname) { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node importNode(Node importedNode, boolean deep) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - - } - - @Override - public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public NodeList getElementsByTagNameNS(String namespaceURI, String localName) { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Element getElementById(String elementId) { - return null; - } - - @Override - public String getInputEncoding() { - return "utf-8"; - } - - @Override - public String getXmlEncoding() { - return "utf-8"; - } - - @Override - public boolean getXmlStandalone() { - return true; - } - - @Override - public void setXmlStandalone(boolean xmlStandalone) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public String getXmlVersion() { - return "1.0"; - } - - @Override - public void setXmlVersion(String xmlVersion) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - - } - - @Override - public boolean getStrictErrorChecking() { - return false; - } - - @Override - public void setStrictErrorChecking(boolean strictErrorChecking) { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - - } - - @Override - public String getDocumentURI() { - return null; - } - - @Override - public void setDocumentURI(String documentURI) { - - } - - @Override - public Node adoptNode(Node source) throws DOMException { - return null; - } - - @Override - public DOMConfiguration getDomConfig() { - return null; - } - - @Override - public void normalizeDocument() { - - } - - @Override - public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @NotNull - @Override - public String getNodeName() { - return "#document"; - } - - @Override - public String getNodeValue() throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void setNodeValue(String nodeValue) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public short getNodeType() { - return DOCUMENT_TYPE_NODE; - } - - @Override - public Node getParentNode() { - return null; - } - - @NotNull - @Override - public NodeList getChildNodes() { - return DocumentFactories.wrap(root); - } - - @Override - public Node getFirstChild() { - return root; - } - - @Override - public Node getLastChild() { - return root; - } - - @Override - public Node getPreviousSibling() { - return null; - } - - @Override - public Node getNextSibling() { - return null; - } - - @Override - public NamedNodeMap getAttributes() { - return null; - } - - @Override - public Document getOwnerDocument() { - return this; - } - - @Override - public Node insertBefore(Node newChild, Node refChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node replaceChild(Node newChild, Node oldChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node removeChild(Node oldChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node appendChild(Node newChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public boolean hasChildNodes() { - return root != null; - } - - @Override - public Node cloneNode(boolean deep) { - return null; - } - - @Override - public void normalize() { - - } - - @Override - public boolean isSupported(String feature, String version) { - return false; - } - - @Override - public String getNamespaceURI() { - return null; - } - - @Override - public String getPrefix() { - return null; - } - - @Override - public void setPrefix(String prefix) throws DOMException { - - } - - @Override - public String getLocalName() { - return null; - } - - @Override - public boolean hasAttributes() { - return false; - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public short compareDocumentPosition(Node other) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public String getTextContent() throws DOMException { - return null; - } - - @Override - public void setTextContent(String textContent) throws DOMException { - - } - - @Override - public boolean isSameNode(Node other) { - return false; - } - - @Override - public String lookupPrefix(String namespaceURI) { - return null; - } - - @Override - public boolean isDefaultNamespace(String namespaceURI) { - return false; - } - - @Override - public String lookupNamespaceURI(String prefix) { - return null; - } - - @Override - public boolean isEqualNode(Node arg) { - return false; - } - - @Override - public Object getFeature(String feature, String version) { - return null; - } - - @Override - public Object setUserData(String key, Object data, UserDataHandler handler) { - return null; - } - - @Override - public Object getUserData(String key) { - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPElement.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPElement.java deleted file mode 100644 index 49b7e8e6ca..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPElement.java +++ /dev/null @@ -1,399 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.metamodel.NodeMetaModel; -import com.github.javaparser.metamodel.PropertyMetaModel; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -/** - * @author Alexander Weigl - * @version 1 (30.11.22) - */ -class JPElement implements Element { - public com.github.javaparser.ast.Node getAstNode() { - return astNode; - } - - final com.github.javaparser.ast.Node astNode; - final NodeMetaModel meta; - - private final Element parent; - int posInParent; - - @Nullable - private List children = null; - - private List attributes = null; - - - JPElement(com.github.javaparser.ast.Node astNode, Element parent) { - this.parent = parent; - this.astNode = astNode; - meta = astNode.getMetaModel(); - } - - @Nullable - List lazyChildren() { - if (children == null) { - children = meta.getAllPropertyMetaModels() - .stream() - .filter(DocumentFactories::isNodeProperty) - .map(it -> it.getValue(this.astNode)) - .flatMap(it -> { - if (it instanceof com.github.javaparser.ast.NodeList seq) { - return seq.stream().map( - n -> DocumentFactories.getElement(n, this)); - } else if (it instanceof com.github.javaparser.ast.Node n) { - return Stream.of(DocumentFactories.getElement(n, this)); - } - return null; - }) - .map(JPElement.class::cast) - .toList(); - for (int i = 0; i < children.size(); i++) { - children.get(i).posInParent = i; - } - } - return children; - } - - @NotNull - List lazyAttributes() { - if (attributes == null) { - var attr = meta.getAllPropertyMetaModels() - .stream() - .filter(it -> !DocumentFactories.isNodeProperty(it)) - .map(it -> DocumentFactories.getAttribute(this, it)) - .map(Attr.class::cast) - .toList(); - attributes = new ArrayList<>(attr); - for (PseudoAttributeProvider provider : DocumentFactories.getAttributeProviders()) { - var seq = provider.attributeForNode(astNode, this); - if (seq != null) { - attributes.addAll(seq); - } - } - } - return attributes; - } - - @Override - public String getTagName() { - return meta.getTypeName(); - } - - @NotNull - @Override - public String getAttribute(String name) { - var prop = getProperty(name); - return prop.getValue(astNode).toString(); - } - - PropertyMetaModel getProperty(String name) { - return meta.getAllPropertyMetaModels().stream() - .filter(it -> it.getName().equals(name)) - .findFirst().orElse(null); - } - - @Override - public void setAttribute(String name, String value) throws DOMException { - throw new IllegalStateException(); - } - - @Override - public void removeAttribute(String name) throws DOMException { - throw new IllegalStateException(); - } - - @Override - public Attr getAttributeNode(String name) { - return lazyAttributes().stream() - .filter(it -> it.getName().equals(name)) - .findFirst().orElse(null); - } - - @Override - public Attr setAttributeNode(Attr newAttr) throws DOMException { - return null; - } - - @Override - public Attr removeAttributeNode(Attr oldAttr) throws DOMException { - return null; - } - - @NotNull - @Override - public NodeList getElementsByTagName(String name) { - throw new IllegalStateException(); - } - - @NotNull - @Override - public String getAttributeNS(String namespaceURI, String localName) throws DOMException { - throw new IllegalStateException(); - - } - - @Override - public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { - throw new IllegalStateException(); - - } - - @Override - public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { - throw new IllegalStateException(); - - } - - @Override - public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @NotNull - @Override - public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public boolean hasAttribute(String name) { - return !meta.getAllPropertyMetaModels().isEmpty(); - } - - @Override - public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public TypeInfo getSchemaTypeInfo() { - return null; - } - - @Override - public void setIdAttribute(String name, boolean isId) throws DOMException { - - } - - @Override - public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { - - } - - @Override - public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { - - } - - @NotNull - @Override - public String getNodeName() { - return getTagName(); - } - - @Override - public String getNodeValue() throws DOMException { - return ""; - } - - @Override - public void setNodeValue(String nodeValue) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public short getNodeType() { - return ELEMENT_NODE; - } - - @Override - public Node getParentNode() { - return parent; - } - - @NotNull - @Override - public NodeList getChildNodes() { - return DocumentFactories.wrap(lazyChildren()); - } - - @Override - public Node getFirstChild() { - if (hasChildNodes()) - return lazyChildren().get(0); - else - return null; - } - - @Override - public Node getLastChild() { - if (hasChildNodes()) - return lazyChildren().get(lazyChildren().size() - 1); - else - return null; - } - - @Override - public Node getPreviousSibling() { - if (parent != null && posInParent != 0) { - return parent.getChildNodes().item(posInParent - 1); - } - return null; - } - - @Override - public Node getNextSibling() { - if (parent != null && posInParent + 1 < parent.getChildNodes().getLength()) { - return parent.getChildNodes().item(posInParent + 1); - } - return null; - } - - @Override - public NamedNodeMap getAttributes() { - return DocumentFactories.nodeMap(this); - } - - @Override - public Document getOwnerDocument() { - return parent != null ? parent.getOwnerDocument() : null; - } - - @Override - public Node insertBefore(Node newChild, Node refChild) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node replaceChild(Node newChild, Node oldChild) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node removeChild(Node oldChild) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public Node appendChild(Node newChild) throws DOMException { - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - - @Override - public boolean hasChildNodes() { - return lazyChildren().size() != 0; - } - - @Override - public Node cloneNode(boolean deep) { - return null; - } - - @Override - public void normalize() { - - } - - @Override - public boolean isSupported(String feature, String version) { - return false; - } - - @Override - public String getNamespaceURI() { - return null; - } - - @Override - public String getPrefix() { - return null; - } - - @Override - public void setPrefix(String prefix) throws DOMException { - - } - - @Override - public String getLocalName() { - return null; - } - - @Override - public boolean hasAttributes() { - return false; - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public short compareDocumentPosition(Node other) throws DOMException { - return 0; - } - - @Override - public String getTextContent() throws DOMException { - return null; - } - - @Override - public void setTextContent(String textContent) throws DOMException { - - } - - @Override - public boolean isSameNode(Node other) { - return false; - } - - @Override - public String lookupPrefix(String namespaceURI) { - return null; - } - - @Override - public boolean isDefaultNamespace(String namespaceURI) { - return false; - } - - @Override - public String lookupNamespaceURI(String prefix) { - return null; - } - - @Override - public boolean isEqualNode(Node arg) { - return false; - } - - @Override - public Object getFeature(String feature, String version) { - return null; - } - - @Override - public Object setUserData(String key, Object data, UserDataHandler handler) { - return null; - } - - @Override - public Object getUserData(String key) { - return null; - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPRootElement.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPRootElement.java deleted file mode 100644 index 0e505afed4..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/JPRootElement.java +++ /dev/null @@ -1,325 +0,0 @@ -package com.github.jmlparser.xpath; - - -import com.github.javaparser.ast.CompilationUnit; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.*; - -import java.util.List; -import java.util.stream.Collectors; - -import static org.w3c.dom.DOMException.NOT_SUPPORTED_ERR; - -public class JPRootElement implements Element { - private final List nodes; - @Nullable - private List elements; - private final JPDocument document; - - public JPRootElement(List compilationUnits, JPDocument document) { - this.nodes = compilationUnits; - this.document = document; - } - - @NotNull - private List lazyElements() { - if (elements == null) { - elements = nodes.stream() - .map(it -> DocumentFactories.getElement(it, this)) - .collect(Collectors.toList()); - } - return elements; - } - - @Override - public String getTagName() { - return "project"; - } - - @NotNull - @Override - public String getAttribute(String name) { - return ""; - } - - @Override - public void setAttribute(String name, String value) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void removeAttribute(String name) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Attr getAttributeNode(String name) { - return null; - } - - @Override - public Attr setAttributeNode(Attr newAttr) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Attr removeAttributeNode(Attr oldAttr) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @NotNull - @Override - public NodeList getElementsByTagName(String name) { - throw new IllegalStateException(); - } - - @NotNull - @Override - public String getAttributeNS(String namespaceURI, String localName) throws DOMException { - return ""; - } - - @Override - public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException { - return null; - } - - @Override - public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @NotNull - @Override - public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException { - throw new IllegalStateException(); - } - - @Override - public boolean hasAttribute(String name) { - return false; - } - - @Override - public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException { - return false; - } - - @Override - public TypeInfo getSchemaTypeInfo() { - return null; - } - - @Override - public void setIdAttribute(String name, boolean isId) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @NotNull - @Override - public String getNodeName() { - return getTagName(); - } - - @Override - public String getNodeValue() throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public void setNodeValue(String nodeValue) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public short getNodeType() { - return ELEMENT_NODE; - } - - @Override - public Node getParentNode() { - return document; - } - - @NotNull - @Override - public NodeList getChildNodes() { - return DocumentFactories.wrap(lazyElements()); - } - - @Override - public Node getFirstChild() { - return lazyElements().get(0); - } - - @Override - public Node getLastChild() { - return lazyElements().get(lazyElements().size() - 1); - } - - @Override - public Node getPreviousSibling() { - return null; - } - - @Override - public Node getNextSibling() { - return null; - } - - @Override - public NamedNodeMap getAttributes() { - return DocumentFactories.emptyNodeMap(); - } - - @Override - public Document getOwnerDocument() { - return document; - } - - @Override - public Node insertBefore(Node newChild, Node refChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node replaceChild(Node newChild, Node oldChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node removeChild(Node oldChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public Node appendChild(Node newChild) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public boolean hasChildNodes() { - return !lazyElements().isEmpty(); - } - - @Override - public Node cloneNode(boolean deep) { - return null; - } - - @Override - public void normalize() { - } - - @Override - public boolean isSupported(String feature, String version) { - return false; - } - - @Override - public String getNamespaceURI() { - return null; - } - - @Override - public String getPrefix() { - return null; - } - - @Override - public void setPrefix(String prefix) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public String getLocalName() { - return null; - } - - @Override - public boolean hasAttributes() { - return false; - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public short compareDocumentPosition(Node other) throws DOMException { - return 0; - } - - @Override - public String getTextContent() throws DOMException { - return ""; - } - - @Override - public void setTextContent(String textContent) throws DOMException { - throw new DOMException(NOT_SUPPORTED_ERR, "Not Supported"); - } - - @Override - public boolean isSameNode(Node other) { - return other instanceof JPRootElement o && - this.document == o.document; - } - - @Override - public String lookupPrefix(String namespaceURI) { - return ""; - } - - @Override - public boolean isDefaultNamespace(String namespaceURI) { - return false; - } - - @Override - public String lookupNamespaceURI(String prefix) { - return null; - } - - @Override - public boolean isEqualNode(Node arg) { - return false; - } - - @Override - public Object getFeature(String feature, String version) { - return null; - } - - @Override - public Object setUserData(String key, Object data, UserDataHandler handler) { - return null; - } - - @Override - public Object getUserData(String key) { - return null; - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeHelper.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeHelper.java deleted file mode 100644 index c5e91a601c..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeHelper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.Node; -import org.jetbrains.annotations.NotNull; -import org.w3c.dom.Element; - -import java.util.Collection; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public abstract class PseudoAttributeHelper implements PseudoAttributeProvider { - private final Class clazz; - - protected PseudoAttributeHelper(Class clazz) { - this.clazz = clazz; - } - - @Override - public final Collection attributeForNode(@NotNull Node node, @NotNull Element owner) { - if (clazz == node.getClass()) { - return attributes((T) node, owner); - } - return null; - } - - protected abstract Collection attributes(@NotNull T node, Element owner); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeProvider.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeProvider.java deleted file mode 100644 index dd635ade79..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/PseudoAttributeProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.Node; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Element; - -import java.util.Collection; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public interface PseudoAttributeProvider { - @Nullable - Collection attributeForNode(@NotNull Node node, @NotNull Element owner); -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathCommand.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathCommand.java deleted file mode 100644 index e16610eef7..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathCommand.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.beust.jcommander.Parameters; - -/** - * @author Alexander Weigl - * @version 1 (09.04.23) - */ -@Parameters(commandNames = {"xpath"}, - commandDescription = "Evaluate XPath queries on a set of Java/JML files.") -public class XPathCommand { -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathFacade.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathFacade.java deleted file mode 100644 index 7f9312838a..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/XPathFacade.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.jmlparser.xpath; - -import com.github.javaparser.ast.CompilationUnit; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -import javax.xml.transform.*; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; -import java.io.StringWriter; - -/** - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -public class XPathFacade { - public static String printXml(CompilationUnit n) throws TransformerException { - Document xmlDocument = DocumentFactories.getDocument(n); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - Source source = new DOMSource(xmlDocument.getDocumentElement()); - var sw = new StringWriter(); - StreamResult result = new StreamResult(sw); - transformer.transform(source, result); - return sw.getBuffer().toString(); - } - - public static void query(CompilationUnit n, String query) throws XPathExpressionException { - Document xmlDocument = DocumentFactories.getDocument(n); - XPath xPath = XPathFactory.newInstance().newXPath(); - var res = (NodeList) xPath.compile(query).evaluate(xmlDocument, XPathConstants.NODESET); - for (int i = 0; i < res.getLength(); i++) { - System.out.println(((JPElement) res.item(i)).getAstNode()); - } - } -} diff --git a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/package-info.java b/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/package-info.java deleted file mode 100644 index f97f11f6ea..0000000000 --- a/jmlparser-jml-tools/src/main/java/com/github/jmlparser/xpath/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * XPath query on the AST. - *

- * This package provides the possibility to apply an XPath query on AST nodes. It wraps the existing classes - * into XML documents and elements of type {@code org.w3c.dom}. This allows you to also use them in nearly - * every system that expect a DOM, e.g., you can print AST as an XML document or xquery. - *

- * This DOM is immutable. - * - * @author Alexander Weigl - * @version 1 (11.02.23) - */ -package com.github.jmlparser.xpath; \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule b/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule deleted file mode 100644 index 603cad2d75..0000000000 --- a/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.lint.LintRule +++ /dev/null @@ -1,9 +0,0 @@ -com.github.jmlparser.lint.rules.JmlNameClashWithJava -com.github.jmlparser.lint.rules.AssignableValidator -com.github.jmlparser.lint.rules.ContextSensitiveForbiddenFunctionsValidator -com.github.jmlparser.lint.rules.JmlNameClashWithJava -com.github.jmlparser.lint.rules.LocationSetValidator -com.github.jmlparser.lint.rules.PurityValidator -com.github.jmlparser.lint.rules.OverridingLocalNamesInGhost -com.github.jmlparser.lint.rules.AllowedJmlClauses -com.github.jmlparser.lint.rules.ResultVarCheck diff --git a/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.xpath.PseudoAttributeProvider b/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.xpath.PseudoAttributeProvider deleted file mode 100644 index cd4f9c170e..0000000000 --- a/jmlparser-jml-tools/src/main/resources/META-INF/services/com.github.jmlparser.xpath.PseudoAttributeProvider +++ /dev/null @@ -1,2 +0,0 @@ -com.github.jmlparser.xpath.AttribNodeWithName -com.github.jmlparser.xpath.AttribModifier \ No newline at end of file diff --git a/jmlparser-jml-tools/src/main/resources/com.github.jmlparser.smt/preamble.smt2 b/jmlparser-jml-tools/src/main/resources/com.github.jmlparser.smt/preamble.smt2 deleted file mode 100644 index 910f44c356..0000000000 --- a/jmlparser-jml-tools/src/main/resources/com.github.jmlparser.smt/preamble.smt2 +++ /dev/null @@ -1,62 +0,0 @@ -(set-option :produce-unsat-cores true) -(set-option :produce-models true) -(set-logic ALL) - -(declare-sort T 0) -(declare-sort U 0) - -(declare-fun instanceof (U T) Bool) -(declare-fun exactinstanceof (U T) Bool) -(declare-fun subtype (T T) Bool) -(declare-fun typeof (U) T) - -(assert (forall ((t1 T)) (subtype t1 t1))) -(assert (forall ((t1 T) (t2 T)) (! (=> (and (subtype t1 t2) (subtype t2 t1)) (= t1 t2)) :pattern ((subtype t1 t2) (subtype t2 t1))))) -(assert (forall ((t1 T) (t2 T) (t3 T)) (! (=> (and (subtype t1 t2) (subtype t2 t3)) (subtype t1 t3)) :pattern ((subtype t1 t2) (subtype t2 t3))))) -(assert (forall ((u U) (t T)) (! (= (instanceof u t) (subtype (typeof u) t)) :pattern ((instanceof u t))))) -(assert (forall ((u U) (t T)) (! (= (exactinstanceof u t) (= (typeof u) t)) :pattern ((exactinstanceof u t))))) - -;; Integer -(declare-fun u2i (U) Int) -(declare-fun i2u (Int) U) -(declare-const sort_int T) - -(assert (forall ((i Int)) (= (u2i (i2u i)) i))) -(assert (forall ((x U)) (! (=> (= (typeof x) sort_int) (= (i2u (u2i x)) x)) :pattern ((typeof x))))) -(assert (forall ((t T)) (! (=> (subtype t sort_int) (= t sort_int)) :pattern ((subtype t sort_int))))) -; (assert (forall ((x U)) (! (=> (instanceof x sort_int) (= (typeof x ) sort_int)) :pattern ((instanceof x sort_int))))) -(assert (forall ((i Int)) (! (= (typeof (i2u i)) sort_int) :pattern ((i2u i))))) - -(declare-fun u2b (U) Bool) -(declare-fun b2u (Bool) U) -(declare-const sort_boolean T) - -(assert (instanceof (b2u true) sort_boolean)) -(assert (instanceof (b2u false) sort_boolean)) -(assert (forall ((b Bool)) (= (u2b (b2u b)) b))) -; This seems to improve Z3 performance: Needs investigation (probably triggers above) -(assert (not (u2b (b2u false)))) -(assert (forall ((u U)) (! (=> (= (typeof u) sort_boolean) (or (= u (b2u true)) (= u (b2u false)))) :pattern ((typeof u))))) -(assert (forall ((x U)) (! (=> (instanceof x sort_boolean) (= (typeof x ) sort_boolean)) :pattern ((instanceof x sort_boolean))))) - -(declare-fun cast (U T) U) -(assert (forall ((x U) (t T)) (! (subtype (typeof (cast x t)) t) :pattern ((cast x t))))) -(assert (forall ((x U) (t T)) (! (=> (subtype (typeof x) t) (= (cast x t) x)) :pattern ((cast x t))))) - - -(declare-fun u2f (U) Float32) -(declare-fun f2u (Float32) U) -;(declare-const sort_float T) - -(declare-fun u2d (U) Float64) -(declare-fun d2u (Float64) U) -;(declare-const sort_double T) -(assert (forall ((f Float32)) (= (u2f (f2u f)) f))) -(assert (forall ((x U)) (=> (= (typeof x) sort_float) (= (f2u (u2f x)) x)))) -(assert (forall ((x U)) (=> (instanceof x sort_float) (= (typeof x ) sort_float)))) -(assert (forall ((f Float32)) (= (typeof (f2u f)) sort_float))) - -(assert (forall ((d Float64)) (= (u2d (d2u d)) d))) -(assert (forall ((x U)) (=> (= (typeof x) sort_double) (= (d2u (u2d x)) x)))) -(assert (forall ((x U)) (=> (instanceof x sort_double) (= (typeof x ) sort_double)))) -(assert (forall ((d Float64)) (= (typeof (d2u d)) sort_double))) diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/SolverTest.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/SolverTest.java deleted file mode 100644 index f8f2aa7952..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/SolverTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.github.jmlparser; - -import com.github.jmlparser.smt.solver.Solver; -import com.github.jmlparser.smt.solver.SolverAnswer; -import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.Test; - -import java.io.IOException; - -/** - * @author Alexander Weigl - * @version 1 (08.08.22) - */ -public class SolverTest { - @Test - void startZ3Mini() throws IOException { - Assumptions.assumeTrue(z3Installed()); - Solver s = new Solver(); - SolverAnswer result = s.run("(assert (= (* 2 3) 6)) (check-sat) (get-model) (exit)"); - result.expectSat().consume(); - } - - private static Boolean z3Installed = null; - - public static boolean z3Installed() { - if (z3Installed != null) return z3Installed; - try { - return z3Installed = new ProcessBuilder("sh", "-c", "which z3").start().waitFor() == 0; - } catch (Exception e) { - } - return z3Installed = false; - } -} diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestTokenRangesPreciseness.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestTokenRangesPreciseness.java deleted file mode 100644 index aa682f8e98..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestTokenRangesPreciseness.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.github.jmlparser; - -import com.github.javaparser.GeneratedJavaParserConstants; -import com.github.javaparser.TokenRange; -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.jml.NodeWithJmlTags; -import com.github.javaparser.jml.JmlUtility; -import com.google.common.truth.Truth; -import org.assertj.core.util.Streams; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestFactory; - -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.stream.Stream; - -/** - * @author Alexander Weigl - * @version 1 (18.10.22) - */ -class TestTokenRangesPreciseness extends TestWithJavaParser { - - @Test - void lineColumnIndex() { - var lci = new LineColumnIndex(""" - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam - nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. - At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea - takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, - consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore - et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo - duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est - Lorem ipsum dolor sit amet. - """); - - - Truth.assertThat(lci.substring(1, 1, 1, 5)) - .isEqualTo("Lorem"); - - Truth.assertThat(lci.substring(2, 1, 2, 6)) - .isEqualTo("nonumy"); - - Truth.assertThat(lci.substring(6, 18, 6, 25)) - .isEqualTo("aliquyam"); - } - - @TestFactory - Stream ihm() throws Throwable { - final var content = - Files.readString( - Paths.get( - getClass().getResource("/ihm/VerifiedIdentityHashMap.java").getPath())); - var result = parser.parse(content); - Assertions.assertTrue(result.isSuccessful()); - return testTokenRanges(result.getResult().get(), content); - } - - - @TestFactory - Stream test() throws Throwable { - final var content = - Files.readString( - Paths.get( - getClass().getResource("/com/github/jmlparser/TokenTest.java").getPath())); - var result = parser.parse(content); - Assertions.assertTrue(result.isSuccessful()); - return testTokenRanges(result.getResult().get(), content); - } - - private Stream testTokenRanges(CompilationUnit node, String content) { - var lci = new LineColumnIndex(content); - return JmlUtility.getAllNodes(node) - .filter(it -> it instanceof NodeWithJmlTags) - .flatMap(it -> checkTokenRange(lci, it)); - //checkTokenRange(lci, node); - } - - private Stream checkTokenRange(LineColumnIndex lci, Node it) { - var tr = it.getTokenRange(); - return tr.map(javaTokens -> checkTokenRange(lci, javaTokens)).orElse(Stream.empty()); - } - - private Stream checkTokenRange(LineColumnIndex lci, TokenRange javaTokens) { - return Streams.stream(javaTokens) - .filter(it -> it.getKind() != GeneratedJavaParserConstants.EOF) - .map(javaToken -> DynamicTest.dynamicTest(javaToken.toString(), () -> { - final var substring = lci.substring(javaToken.getRange().get()); - final var text = javaToken.getText(); - if (!(substring.equals("@") && text.equals(" "))) { - Truth.assertThat(substring).isEqualTo(text); - } - })); - } -} diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestWithJavaParser.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestWithJavaParser.java deleted file mode 100644 index 294679002a..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/TestWithJavaParser.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.github.jmlparser; - -import com.github.javaparser.JavaParser; -import com.github.javaparser.ParseResult; -import com.github.javaparser.ParserConfiguration; -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.Node; -import com.github.javaparser.symbolsolver.JavaSymbolSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver; - -import static org.junit.jupiter.api.Assertions.fail; - -/** - * @author Alexander Weigl - * @version 1 (14.10.22) - */ -public class TestWithJavaParser { - protected final JavaParser parser; - protected final Node parent; - - { - ParserConfiguration config = new ParserConfiguration(); - config.setProcessJml(true); - config.setSymbolResolver(new JavaSymbolSolver(new ClassLoaderTypeSolver(ClassLoader.getSystemClassLoader()))); - parser = new JavaParser(config); - - final var resourceAsStream = getClass().getResourceAsStream("Test.java"); - if (resourceAsStream != null) { - ParseResult r = parser.parse(resourceAsStream); - if (!r.isSuccessful()) { - r.getProblems().forEach(System.err::println); - fail("Error during parsing"); - } - parent = r.getResult().get().getType(0); - } else { - parent = null; - } - } -} diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTests.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTests.java deleted file mode 100644 index 341b854b79..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTests.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.github.javaparser.ParseResult; -import com.github.javaparser.ast.expr.Expression; -import com.github.javaparser.printer.DefaultPrettyPrinter; -import com.github.jmlparser.TestWithJavaParser; -import com.google.common.truth.Truth; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; -import org.yaml.snakeyaml.Yaml; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.fail; - -/** - * @author Alexander Weigl - * @version 1 (04.10.22) - */ -public class Jml2JavaTests extends TestWithJavaParser { - @TestFactory - public Stream j2jTranslation() throws IOException { - try (InputStream inputStream = getClass().getResourceAsStream("expr.yaml")) { - Yaml yaml = new Yaml(); - List> obj = yaml.load(inputStream); - return obj.stream().map(m -> { - String a = (String) m.get("expr"); - String result = (String) m.get("result"); - return DynamicTest.dynamicTest(a, () -> { - if (result != null) - jml2JavaTranslation(a, result); - }); - }); - } - } - - void jml2JavaTranslation(String input, String expected) { - ParseResult e = parser.parseJmlExpression(input); - if (!e.isSuccessful()) { - e.getProblems().forEach(System.err::println); - fail("Error during parsing"); - } - Expression expr = e.getResult().get(); - expr.setParentNode(parent); - var actual = Jml2JavaFacade.translate(expr); - - DefaultPrettyPrinter dpp = new DefaultPrettyPrinter(); - var sblock = dpp.print(actual.a); - var sexpr = dpp.print(actual.b); - Truth.assertThat(trimAllWs(sblock + " " + sexpr)) - .isEqualTo(trimAllWs(expected)); - } - - private static String trimAllWs(String expected) { - return expected.replaceAll("\\s+", " ").trim(); - } -} diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTranslatorTest.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTranslatorTest.java deleted file mode 100644 index 7641195a8c..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/Jml2JavaTranslatorTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.jml.expr.JmlQuantifiedExpr; -import com.google.common.truth.Truth; -import org.junit.jupiter.api.Test; - -/** - * @author Alexander Weigl - * @version 1 (11.10.22) - */ -class Jml2JavaTranslatorTest { - @Test - void test() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int x; 0 <= x < a.length; x%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "x"); - Truth.assertThat(bound.toString()).isEqualTo("0"); - } - - @Test - void test2() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int x; 5 < x < a.length; x%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "x"); - Truth.assertThat(bound.toString()).isEqualTo("5 + 1"); - } - - @Test - void test3() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int x; 2+1 < x < a.length; x%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "x"); - Truth.assertThat(bound.toString()).isEqualTo("2 + 1 + 1"); - } - - @Test - void test6() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int y; 2+1 < y < a.length; y%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "y"); - Truth.assertThat(bound.toString()).isEqualTo("2 + 1 + 1"); - } - - @Test - void test4() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int x; 0 < x && x < a.length; x%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "x"); - Truth.assertThat(bound.toString()).isEqualTo("0 + 1"); - } - - @Test - void test5() { - JmlQuantifiedExpr n1 = StaticJavaParser.parseJmlExpression("(\\forall int x; 0 <= x && x < a.length; x%2==0)"); - var bound = Jml2JavaTranslator.findLowerBound(n1, "x"); - Truth.assertThat(bound.toString()).isEqualTo("0"); - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/PatternTest.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/PatternTest.java deleted file mode 100644 index 18572bb491..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/jml2java/PatternTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.jmlparser.jml2java; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.expr.NameExpr; -import com.github.javaparser.ast.stmt.ExpressionStmt; -import com.github.javaparser.ast.stmt.IfStmt; -import com.github.jmlparser.utils.Pattern; -import org.junit.jupiter.api.Test; - -/** - * @author Alexander Weigl - * @version 1 (11.10.22) - */ -class PatternTest { - - @Test - void matchIf() { - final var cond = new NameExpr("_"); - final var then = new ExpressionStmt(); - final var other = new ExpressionStmt(); - final var ifPattern = new Pattern<>(new IfStmt(cond, then, other)); - ifPattern.addPlaceholder(cond, "c"); - ifPattern.addPlaceholder(then, "t"); - ifPattern.addPlaceholder(other, "o"); - - var candidate = StaticJavaParser.parseStatement("if(a r = parser.parse(getClass().getResourceAsStream("Test.java")); - if (!r.isSuccessful()) { - r.getProblems().forEach(System.err::println); - fail("Error during parsing"); - } - parent = r.getResult().get().getType(0); - } - - @TestFactory - public Stream smtTranslation() throws IOException { - try (InputStream inputStream = getClass().getResourceAsStream("expr.yaml")) { - Yaml yaml = new Yaml(); - List> obj = yaml.load(inputStream); - return obj.stream().map(m -> { - String a = (String) m.get("expr"); - String result = (String) m.get("result"); - String resultInt = (String) m.get("resultInt"); - String resultBv = (String) m.get("resultBv"); - return DynamicTest.dynamicTest(a, () -> { - if (resultInt != null) - smtTranslation(a, resultInt, true); - if (resultBv != null) - smtTranslation(a, resultBv, false); - if (result != null) - smtTranslation(a, result, false); - }); - }); - } - } - - void smtTranslation(String input, String expected, boolean useInt) { - ParseResult e = parser.parseJmlExpression(input); - if (!e.isSuccessful()) { - e.getProblems().forEach(System.err::println); - fail("Error during parsing"); - } - Expression expr = e.getResult().get(); - expr.setParentNode(parent); - SmtQuery smtLog = new SmtQuery(); - SExpr actualExpr = SMTFacade.toSmt(expr, smtLog, useInt); - - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - smtLog.appendTo(pw); - actualExpr.appendTo(pw); - String actual = sw.toString(); - Truth.assertThat(actual.trim()).isEqualTo(expected.trim()); - } - -} diff --git a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/wd/WDVisitorExprTest.java b/jmlparser-jml-tools/src/test/java/com/github/jmlparser/wd/WDVisitorExprTest.java deleted file mode 100644 index 93b7054db0..0000000000 --- a/jmlparser-jml-tools/src/test/java/com/github/jmlparser/wd/WDVisitorExprTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.github.jmlparser.wd; - -import com.github.javaparser.JavaParser; -import com.github.jmlparser.SolverTest; -import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import static com.github.jmlparser.wd.WellDefinednessMain.isWelldefined; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * @author Alexander Weigl - * @version 1 (14.06.22) - */ -class WDVisitorExprTest { - private final JavaParser parser = new JavaParser(); - - @ParameterizedTest - @CsvFileSource(resources = "wd-expr.csv", delimiterString = "§") - void wdExpression(String expr) { - Assumptions.assumeTrue(SolverTest.z3Installed()); - assertTrue(isWelldefined(parser, expr)); - } - - @ParameterizedTest - @CsvFileSource(resources = "not-wd-expr.csv", delimiterString = "§") - void wdExpressionError(String expr) { - Assumptions.assumeTrue(SolverTest.z3Installed()); - assertFalse(isWelldefined(parser, expr)); - } -} diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/TokenTest.java b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/TokenTest.java deleted file mode 100644 index 504d94ec5a..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/TokenTest.java +++ /dev/null @@ -1,10 +0,0 @@ -class TokenTest { - //@ invariant test : x == x; - - /*@ private normal_behavior - @ ensures key == null ==> \result == NULL_KEY; - @ ensures key != null ==> \result == key; - @*/ - public void foo() { - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/Test.java b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/Test.java deleted file mode 100644 index 019b6b7d2e..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/Test.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Test { - Test self = new Test(); - Object a, b; - int[] ary; -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/expr.yaml b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/expr.yaml deleted file mode 100644 index 1467539a6b..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/jml2java/expr.yaml +++ /dev/null @@ -1,81 +0,0 @@ -- expr: | - true - result: | - { } true -- expr: | - 2 + 3 - result: | - { } 2 + 3 - - -- expr: | - !(a != null && b != null) ==> a == b - result: | - { } !(!(a != null && b != null)) || a == b - -- expr: | - a != null && b != null ==> a == b - result: | - { } !(a != null && b != null) || a == b - -- expr: | - ary[2] == 2 - result: | - { } ary[2] == 2 - -- expr: | - (\forall int i; 0<=i0; */ - public void bar(int x) { - } - - /*@ requires \result>0; */ - public int bar(int x) { - return 0; - } - - /*@ requires x++; ensures x=2; */ - public int baf(int x) { - return 0; - } - - public void bar(int x) { - /*@ ensures true; requires true; */ - while (true) ; - } - - public final int x; - - /*@ assignable x; */ - public void bear() { - } -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/lint/Test.java b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/lint/Test.java deleted file mode 100644 index 0b8bc08599..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/lint/Test.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Test { -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/Test.java b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/Test.java deleted file mode 100644 index 019b6b7d2e..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/Test.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Test { - Test self = new Test(); - Object a, b; - int[] ary; -} \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/expr.yaml b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/expr.yaml deleted file mode 100644 index a0ae652812..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/smt/expr.yaml +++ /dev/null @@ -1,91 +0,0 @@ -- expr: | - true - result: | - true -- expr: | - 2 + 3 - resultBv: | - (bvadd ((_ int2bv 32) 2) ((_ int2bv 32) 3)) - resultInt: | - (+ 2 3) -- expr: | - a != null && b != null ==> a == b - result: | - (declare-const a Object) - (declare-const b Object) - (=> (and (not (= a null)) (not (= b null))) (= a b)) - -- expr: | - ary[2] == 2 - resultInt: | - (declare-const ary (Array Int Int)) - (= (select ary 2) 2) - resultBv: | - (declare-const ary (Array (_ BitVec 32) (_ BitVec 32))) - (= (select ary ((_ int2bv 32) 2)) ((_ int2bv 32) 2)) - -- expr: | - (\forall int i; 0<=i (and (<= 0 i) (< i (int$length ary))) (= (select ary i) i))) - resultBv: | - (declare-const ary (Array (_ BitVec 32) (_ BitVec 32))) - (forall ((i (_ BitVec 32))) (=> (and (bvsle ((_ int2bv 32) 0) i) (bvslt i (bv$length ary))) (= (select ary i) i))) - -- expr: | - this.self.self.ary[0] == 1 - resultInt: | - (= (select (ary (self (self this))) 0) 1) - -- expr: | - this.self.self.ary[0] == 1 - resultInt: | - (= (select (ary (self (self this))) 0) 1) - -- expr: | - (new int[] {1,2,3}).length == 3 - resultInt: | - (declare-const anon_array_1 (Array Int Int)) - (assert (store anon_array_1 0 1)) - (assert (store anon_array_1 1 2)) - (assert (store anon_array_1 2 3)) - (assert (= (int$length anon_array_1) 3)) - (= (int$length anon_array_1) 3) - -- expr: | - (new int[3]).length == 3 - resultInt: | - (declare-const anon_array_1 (Array Int Int)) - (assert (= (int$length anon_array_1) 3)) - (= (int$length anon_array_1) 3) - -- expr: | - (new int[3][2]).length == 3 - resultInt: | - (declare-const anon_array_1 (Array Int (Array Int Int))) - (assert (= (int$length anon_array_1) 3)) - (assert (forall ((idx0 Int)) (= (int$length (select anon_array_1 idx0)) 2))) - (= (int$length anon_array_1) 3) - -- expr: | - (\let int[][] x = { {1}, {2} }; x.length ) == 2 - resultInt: | - (declare-const anon_array_2 (Array Int Int)) - (assert (store anon_array_2 0 1)) - (assert (= (int$length anon_array_2) 1)) - (declare-const anon_array_3 (Array Int Int)) - (assert (store anon_array_3 0 2)) - (assert (= (int$length anon_array_3) 1)) - (declare-const anon_array_1 (Array Int (Array Int Int))) - (assert (store anon_array_1 0 anon_array_2)) - (assert (store anon_array_1 1 anon_array_3)) - (assert (= (int$length anon_array_1) 2)) - (= (let ((x anon_array_1)) (int$length x)) 2) - - - -- expr: | - (\let int x = 5; x) - resultInt: | - (let ((x 5)) x) diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/not-wd-expr.csv b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/not-wd-expr.csv deleted file mode 100644 index d056a94578..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/not-wd-expr.csv +++ /dev/null @@ -1,2 +0,0 @@ -x / 0 -x / (1 - 1) \ No newline at end of file diff --git a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/wd-expr.csv b/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/wd-expr.csv deleted file mode 100644 index cf92a05bda..0000000000 --- a/jmlparser-jml-tools/src/test/resources/com/github/jmlparser/wd/wd-expr.csv +++ /dev/null @@ -1,12 +0,0 @@ -true -false -1 == 2 -5 * 2 == 2 -42 / 2 -"""a"" + 'c'" -x - 2 == 3 -'x' == 65 - - -'x' != 65 -'x' != 65 diff --git a/jmlparser-jml-tools/src/test/resources/ihm/VerifiedIdentityHashMap.java b/jmlparser-jml-tools/src/test/resources/ihm/VerifiedIdentityHashMap.java deleted file mode 100644 index 6a51dd614e..0000000000 --- a/jmlparser-jml-tools/src/test/resources/ihm/VerifiedIdentityHashMap.java +++ /dev/null @@ -1,2181 +0,0 @@ -/* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package ihm; - -//import sun.misc.SharedSecrets; - -/** - * This class implements the Map interface with a hash table, using - * reference-equality in place of object-equality when comparing keys (and - * values). In other words, in an VerifiedIdentityHashMap, two keys - * k1 and k2 are considered equal if and only if - * (k1==k2). (In normal Map implementations (like - * HashMap) two keys k1 and k2 are considered equal - * if and only if (k1==null ? k2==null : k1.equals(k2)).) - * - *

This class is not a general-purpose Map - * implementation! While this class implements the Map interface, it - * intentionally violates Map's general contract, which mandates the - * use of the equals method when comparing objects. This class is - * designed for use only in the rare cases wherein reference-equality - * semantics are required. - * - *

A typical use of this class is topology-preserving object graph - * transformations, such as serialization or deep-copying. To perform such - * a transformation, a program must maintain a "node table" that keeps track - * of all the object references that have already been processed. The node - * table must not equate distinct objects even if they happen to be equal. - * Another typical use of this class is to maintain proxy objects. For - * example, a debugging facility might wish to maintain a proxy object for - * each object in the program being debugged. - * - *

This class provides all of the optional map operations, and permits - * null values and the null key. This class makes no - * guarantees as to the order of the map; in particular, it does not guarantee - * that the order will remain constant over time. - * - *

This class provides constant-time performance for the basic - * operations (get and put), assuming the system - * identity hash function ({@link System#identityHashCode(Object)}) - * disperses elements properly among the buckets. - * - *

This class has one tuning parameter (which affects performance but not - * semantics): expected maximum size. This parameter is the maximum - * number of key-value mappings that the map is expected to hold. Internally, - * this parameter is used to determine the number of buckets initially - * comprising the hash table. The precise relationship between the expected - * maximum size and the number of buckets is unspecified. - * - *

If the size of the map (the number of key-value mappings) sufficiently - * exceeds the expected maximum size, the number of buckets is increased. - * Increasing the number of buckets ("rehashing") may be fairly expensive, so - * it pays to create identity hash maps with a sufficiently large expected - * maximum size. On the other hand, iteration over collection views requires - * time proportional to the number of buckets in the hash table, so it - * pays not to set the expected maximum size too high if you are especially - * concerned with iteration performance or memory usage. - * - *

Note that this implementation is not synchronized. - * If multiple threads access an identity hash map concurrently, and at - * least one of the threads modifies the map structurally, it must - * be synchronized externally. (A structural modification is any operation - * that adds or deletes one or more mappings; merely changing the value - * associated with a key that an instance already contains is not a - * structural modification.) This is typically accomplished by - * synchronizing on some object that naturally encapsulates the map. - *

- * If no such object exists, the map should be "wrapped" using the - * {@link Collections#synchronizedMap Collections.synchronizedMap} - * method. This is best done at creation time, to prevent accidental - * unsynchronized access to the map:

- *   Map m = Collections.synchronizedMap(new VerifiedIdentityHashMap(...));
- * - *

The iterators returned by the iterator method of the - * collections returned by all of this class's "collection view - * methods" are fail-fast: if the map is structurally modified - * at any time after the iterator is created, in any way except - * through the iterator's own remove method, the iterator - * will throw a {@link ConcurrentModificationException}. Thus, in the - * face of concurrent modification, the iterator fails quickly and - * cleanly, rather than risking arbitrary, non-deterministic behavior - * at an undetermined time in the future. - * - *

Note that the fail-fast behavior of an iterator cannot be guaranteed - * as it is, generally speaking, impossible to make any hard guarantees in the - * presence of unsynchronized concurrent modification. Fail-fast iterators - * throw ConcurrentModificationException on a best-effort basis. - * Therefore, it would be wrong to write a program that depended on this - * exception for its correctness: fail-fast iterators should be used only - * to detect bugs. - * - *

Implementation note: This is a simple linear-probe hash table, - * as described for example in texts by Sedgewick and Knuth. The array - * alternates holding keys and values. (This has better locality for large - * tables than does using separate arrays.) For many JRE implementations - * and operation mixes, this class will yield better performance than - * {@link HashMap} (which uses chaining rather than linear-probing). - * - *

This class is a member of the - * - * Java Collections Framework. - * - * @author Doug Lea and Josh Bloch - * @see System#identityHashCode(Object) - * @see Object#hashCode() - * @see Collection - * @see Map - * @see HashMap - * @see TreeMap - * @since 1.4 - */ - -public class VerifiedIdentityHashMap - extends AbstractMap - implements Map, java.io.Serializable, Cloneable { - - /*+KEY@ // JML specifically for KeY - @ public invariant - @ table != null && - @ MINIMUM_CAPACITY * (\bigint)2 <= table.length && - @ MAXIMUM_CAPACITY * (\bigint)2 >= table.length; - @ - @ // For all key-value pairs: if key == null, then value == null - @ public invariant - @ (\forall \bigint i; - @ 0 <= i && i < table.length / (\bigint)2; - @ (table[i * 2] == null ==> table[i * 2 + 1] == null)); - @ - @ // Non-empty keys are unique - @ public invariant - @ (\forall \bigint i; 0 <= i && i < table.length / (\bigint)2; - @ (\forall \bigint j; - @ i <= j && j < table.length / (\bigint)2; - @ (table[2 * i] != null && table[2 * i] == table[2 * j]) ==> i == j)); - @ - @ // Size equals the number of non-empty keys in the table - @ public invariant - @ size == (\num_of \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[2 * i] != null); - @ - @ // Table length is a power of two - @ public invariant - @ (\exists \bigint i; - @ 0 <= i < table.length; - @ \dl_pow(2,i) == table.length); - @ - @ // Table length is always an even number - @ public invariant - @ table.length % (\bigint)2 == 0; - @ - @ // Table must have at least one empty key-element to prevent - @ // infinite loops when a key is not present. - @ public invariant - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[2 * i] == null); - @ - @ // There are no gaps between a key's hashed index and its actual - @ // index (if the key is at a higher index than the hash code) - @ public invariant - @ (\forall \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[2 * i] != null && 2 * i > \dl_genHash(table[2 * i], table.length) ==> - @ (\forall \bigint j; - @ \dl_genHash(table[2 * i], table.length) / (\bigint)2 <= j < i; - @ table[2 * j] != null)); - @ - @ // There are no gaps between a key's hashed index and its actual - @ // index (if the key is at a lower index than the hash code) - @ public invariant - @ (\forall \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[2 * i] != null && 2 * i < \dl_genHash(table[2 * i], table.length) ==> - @ (\forall \bigint j; - @ \dl_genHash(table[2 * i], table.length) <= 2 * j < table.length || 0 <= 2 * j < 2 * i; - @ table[2 * j] != null)); - @ - @ // All keys and values are of type Object - @ public invariant - @ \typeof(table) == \type(Object[]); - @ - @ // Field modCount is of type integer (limits: - @ // Integer.MIN_VALUE and Integer.MAX_VALUE) - @ public invariant - @ \dl_inInt(modCount); - @ - @*/ - /*+OPENJML@ // JML for non-KeY tools, i.e. JJBMC - @ public invariant - @ table != null; // && - @ //MINIMUM_CAPACITY * 2 <= table.length && // is no longer valid as we set min and max to 4 - @ //MAXIMUM_CAPACITY * 2 >= table.length; - @ - @ // For all key-value pairs: if key == null, then value == null - @ public invariant - @ (\forall int i; - @ 0 <= i && i < table.length / 2; - @ (table[i * 2] == null ==> table[i * 2 + 1] == null)); - @ - @ // Non-empty keys are unique - @ public invariant - @ (\forall int i; 0 <= i && i < table.length / 2; - @ (\forall int j; - @ i <= j && j < table.length / 2; - @ (table[2*i] != null && table[2*i] == table[2*j]) ==> i == j)); - @ -// @ // Size equals the number of non-empty keys in the table -// @ public invariant -// @ size == (\num_of int i; -// @ 0 <= i < table.length / 2; -// @ table[2 * i] != null); -// @ - @ // Table length is a power of two - @ public invariant - @ (table.length & (table.length - 1)) == 0; - @ - @ // Table length is always an even number - @ public invariant - @ table.length % 2 == 0; - @ - @ // Table must have at least one empty key-element to prevent - @ // infinite loops when a key is not present. - @ public invariant - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[2*i] == null); - @ - @ // There are no gaps between a key's hashed index and its actual - @ // index (if the key is at a higher index than the hash code) - @ public invariant - @ (\forall int i; - @ 0 <= i < table.length / 2; - @ table[2*i] != null && 2*i > hash(table[2*i], table.length) ==> - @ (\forall int j; - @ hash(table[2*i], table.length) / 2 <= j < i; - @ table[2*j] != null)); - @ -// @ // There are no gaps between a key's hashed index and its actual -// @ // index (if the key is at a lower index than the hash code) -// @ public invariant -// @ (\forall int i; -// @ 0 <= i < table.length / 2; -// @ table[2*i] != null && 2*i < hash(table[2*i], table.length) ==> -// @ (\forall int j; -// @ hash(table[2*i], table.length) <= 2*j < table.length || 0 <= 2*j < hash(table[2*i], table.length); -// @ table[2*j] != null)); -// @ -// @ // All keys and values are of type Object -// @ public invariant -// @ \typeof(table) == \type(Object[]); -// @ -// @ // Field modCount is of type integer (limits: -// @ // Integer.MIN_VALUE and Integer.MAX_VALUE) -// @ public invariant -// @ \dl_inInt(modCount); - @*/ - - /** - * The initial capacity used by the no-args constructor. - * MUST be a power of two. The value 32 corresponds to the - * (specified) expected maximum size of 21, given a load factor - * of 2/3. - */ - private /*@ spec_public @*/ static final int DEFAULT_CAPACITY = 32; // Original code. Disable for JJBMC - // private /*@ spec_public @*/ static final int DEFAULT_CAPACITY = 4; // Enable for JJBMC - - /** - * The minimum capacity, used if a lower value is implicitly specified - * by either of the constructors with arguments. The value 4 corresponds - * to an expected maximum size of 2, given a load factor of 2/3. - * MUST be a power of two. - */ - private /*@ spec_public @*/ static final int MINIMUM_CAPACITY = 4; - - /** - * The maximum capacity, used if a higher value is implicitly specified - * by either of the constructors with arguments. - * MUST be a power of two <= 1<<29. - *

- * In fact, the map can hold no more than MAXIMUM_CAPACITY-1 items - * because it has to have at least one slot with the key == null - * in order to avoid infinite loops in get(), put(), remove() - */ - private /*@ spec_public @*/ static final int MAXIMUM_CAPACITY = 1 << 29; // Original code. Disable for JJBMC - // private /*@ spec_public @*/ static final int MAXIMUM_CAPACITY = 4; // Enable for JJBMC - - /** - * The table, resized as necessary. Length MUST always be a power of two. - */ - private /*@ spec_public nullable @*/ transient Object[] table; - - /** - * The number of key-value mappings contained in this identity hash map. - * - * @serial - */ - private /*@ spec_public @*/ int size; - - /** - * The number of modifications, to support fast-fail iterators - */ - private /*@ spec_public @*/ transient int modCount; - - /** - * Value representing null keys inside tables. - */ - private /*@ spec_public @*/ static final Object NULL_KEY = new Object(); - - /** - * Use NULL_KEY for key if it is null. - */ - /*@ private normal_behavior - @ ensures key == null ==> \result == NULL_KEY; - @ ensures key != null ==> \result == key; - @*/ - private /*@ spec_public @*/ static /*@ strictly_pure @*/ Object maskNull(/*@ nullable @*/ Object key) { - return (key == null ? NULL_KEY : key); - } - - /** - * Returns internal representation of null key back to caller as null. - */ - /*@ private normal_behavior - @ ensures key == NULL_KEY ==> \result == null; - @ ensures key != NULL_KEY ==> \result == key; - @*/ - private /*@ spec_public @*/ static /*@ strictly_pure nullable @*/ Object unmaskNull(Object key) { - return (key == NULL_KEY ? null : key); - } - - /** - * Constructs a new, empty identity hash map with a default expected - * maximum size (21). - */ - /*+KEY@ - @ private normal_behavior - @ ensures - @ table != null && - @ table.length == (\bigint)2 * DEFAULT_CAPACITY && - @ keySet == null && - @ values == null && - @ entrySet == null && - @ modCount == 0 && - @ size == 0 && - @ (\forall \bigint i; 0 <= i && i < table.length; table[i] == null); - @*/ - /*+OPENJML@ - @ private normal_behavior - @ ensures - @ table != null && - @ table.length == 2 * DEFAULT_CAPACITY && - @ keySet == null && - @ values == null && - @ entrySet == null && - @ modCount == 0 && - @ size == 0 && - @ (\forall int i; 0 <= i && i < table.length; table[i] == null); - @*/ - public VerifiedIdentityHashMap() { - init(DEFAULT_CAPACITY); - } - - /** - * Constructs a new, empty map with the specified expected maximum size. - * Putting more than the expected number of key-value mappings into - * the map may cause the internal data structure to grow, which may be - * somewhat time-consuming. - * - * @param expectedMaxSize the expected maximum size of the map - * @throws IllegalArgumentException if expectedMaxSize is negative - */ - public VerifiedIdentityHashMap(int expectedMaxSize) { - if (expectedMaxSize < 0) - throw new IllegalArgumentException("expectedMaxSize is negative: " - + expectedMaxSize); - init(capacity(expectedMaxSize)); - } - - /** - * Returns the appropriate capacity for the given expected maximum size. - * Returns the smallest power of two between MINIMUM_CAPACITY and - * MAXIMUM_CAPACITY, inclusive, that is greater than (3 * - * expectedMaxSize)/2, if such a number exists. Otherwise returns - * MAXIMUM_CAPACITY. - */ - /*+KEY@ - @ private normal_behavior - @ requires - @ expectedMaxSize > MAXIMUM_CAPACITY / (\bigint)3; - @ ensures - @ \result == MAXIMUM_CAPACITY; - @ - @ private normal_behavior - @ requires - @ expectedMaxSize <= MAXIMUM_CAPACITY / (\bigint)3 && - @ expectedMaxSize <= (\bigint)2 * MINIMUM_CAPACITY / 3; - @ ensures - @ \result == MINIMUM_CAPACITY; - @ - @ private normal_behavior - @ requires - @ expectedMaxSize <= MAXIMUM_CAPACITY / (\bigint)3 && - @ expectedMaxSize > (\bigint)2 * MINIMUM_CAPACITY / 3; - @ ensures - @ \result <= ((\bigint)3 * expectedMaxSize) && - @ (\bigint)2 * \result > ((\bigint)3 * expectedMaxSize); - @ ensures - @ (\exists \bigint i; - @ 0 <= i < \result; - @ \dl_pow(2,i) == \result); // result is a power of two - @*/ - /*+OPENJML@ - @ private normal_behavior - @ requires - @ expectedMaxSize > MAXIMUM_CAPACITY / 3; - @ ensures - @ \result == MAXIMUM_CAPACITY; - @ - @ private normal_behavior - @ requires - @ expectedMaxSize <= MAXIMUM_CAPACITY / 3 && - @ expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3; - @ ensures - @ \result == MINIMUM_CAPACITY; - @ - @ private normal_behavior - @ requires - @ expectedMaxSize <= MAXIMUM_CAPACITY / 3 && - @ expectedMaxSize > 2 * MINIMUM_CAPACITY / 3; - @ ensures - @ \result <= (3 * expectedMaxSize) && - @ 2 * \result > (3 * expectedMaxSize); - @ ensures - @ (\result & (\result - 1)) == 0; // result is a power of two - @*/ - private static /*@ strictly_pure @*/ int capacity(int expectedMaxSize) { - // assert expectedMaxSize >= 0; - return - (expectedMaxSize > MAXIMUM_CAPACITY / 3) ? MAXIMUM_CAPACITY : - (expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3) ? MINIMUM_CAPACITY : - Integer.highestOneBit(expectedMaxSize + (expectedMaxSize << 1)); - } - - /** - * Initializes object to be an empty map with the specified initial - * capacity, which is assumed to be a power of two between - * MINIMUM_CAPACITY and MAXIMUM_CAPACITY inclusive. - */ - /*+KEY@ - @ private normal_behavior - @ requires - @ (\exists \bigint i; 0 <= i < initCapacity; \dl_pow(2,i) == initCapacity) && - @ initCapacity >= MINIMUM_CAPACITY && - @ initCapacity <= MAXIMUM_CAPACITY && - @ \dl_inInt(modCount); - @ assignable - @ table; - @ ensures - @ table != null && - @ \typeof(table) == \type(Object[]) && - @ (\forall \bigint i; 0 <= i < table.length; table[i] == null) && - @ table.length == (\bigint)2 * initCapacity; - @*/ - /*+OPENJML@ - @ private normal_behavior - @ requires - @ (initCapacity & (initCapacity - 1)) == 0 && - @ initCapacity >= MINIMUM_CAPACITY && - @ initCapacity <= MAXIMUM_CAPACITY; - @ assignable - @ table; - @ ensures - @ table != null && - @ (\forall int i; 0 <= i < table.length; table[i] == null) && - @ table.length == 2 * initCapacity; - @*/ - private /*@ helper @*/ void init(int initCapacity) { - // assert (initCapacity & -initCapacity) == initCapacity; // power of 2 - // assert initCapacity >= MINIMUM_CAPACITY; - // assert initCapacity <= MAXIMUM_CAPACITY; - - table = new Object[2 * initCapacity]; - } - - /** - * Constructs a new identity hash map containing the keys-value mappings - * in the specified map. - * - * @param m the map whose mappings are to be placed into this map - * @throws NullPointerException if the specified map is null - */ - public VerifiedIdentityHashMap(Map m) { - // Allow for a bit of growth - this((int) ((1 + m.size()) * 1.1)); - putAll(m); - } - - /** - * Returns the number of key-value mappings in this identity hash map. - * - * @return the number of key-value mappings in this map - */ - /*@ also - @ public normal_behavior - @ ensures - @ \result == size; - @*/ - public /*@ strictly_pure @*/ int size() { - return size; - } - - /** - * Returns true if this identity hash map contains no key-value - * mappings. - * - * @return true if this identity hash map contains no key-value - * mappings - */ - /*@ also - @ public normal_behavior - @ ensures - @ \result <==> size == 0; - @*/ - public /*@ strictly_pure @*/ boolean isEmpty() { - return size == 0; - } - - /** - * Returns index for Object x. - */ - /*+KEY@ - @ private normal_behavior - @ ensures - @ (x == null ==> \result == 0) && - @ \result == \dl_genHash(x, length) && - @ \result % 2 == 0 && - @ \result < length && - @ \result >= 0; - @*/ - private /*@ spec_public @*/ static /*@ strictly_pure @*/ int hash(Object x, int length) { - int h = System.identityHashCode(x); - // Multiply by -127, and left-shift to use least bit as part of hash - return ((h << 1) - (h << 8)) & (length - 1); - } - - /** - * Circularly traverses table of size len. - */ - /*@ private normal_behavior - @ ensures - @ (i + 2 < len ==> \result == i + 2) && - @ (i + 2 >= len ==> \result == 0); - @*/ - private static /*@ strictly_pure @*/ int nextKeyIndex(int i, int len) { - return (i + 2 < len ? i + 2 : 0); - } - - /** - * Returns the value to which the specified key is mapped, - * or {@code null} if this map contains no mapping for the key. - * - *

More formally, if this map contains a mapping from a key - * {@code k} to a value {@code v} such that {@code (key == k)}, - * then this method returns {@code v}; otherwise it returns - * {@code null}. (There can be at most one such mapping.) - * - *

A return value of {@code null} does not necessarily - * indicate that the map contains no mapping for the key; it's also - * possible that the map explicitly maps the key to {@code null}. - * The {@link #containsKey containsKey} operation may be used to - * distinguish these two cases. - * - * @see #put(Object, Object) - */ - /*+KEY@ - @ // Key exists - @ also - @ public normal_behavior - @ requires - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key)); - @ ensures - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key) && \result == table[i * 2 + 1]); - @ - @ // Key does not exist - @ also - @ public normal_behavior - @ requires - @ !(\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key)); - @ ensures - @ \result == null; - @*/ - /*+OPENJML@ - @ // Key exists - @ also - @ public normal_behavior - @ requires - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key)); - @ ensures - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key) && \result == table[i * 2 + 1]); - @ - @ // Key does not exist - @ also - @ public normal_behavior - @ requires - @ !(\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key)); - @ ensures - @ \result == null; - @*/ - public /*@ pure nullable @*/ java.lang.Object get(/*@ nullable @*/ Object key) { - Object k = maskNull(key); - Object[] tab = table; - int len = tab.length; - int i = hash(k, len); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ // Index i is always an even value within the array bounds - @ maintaining - @ i >= 0 && i < len && i % (\bigint)2 == 0; - @ - @ // Suppose i > hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the interval [hash..i-2]. - @ maintaining - @ (i > hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); - @ - @ // Suppose i < hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. - @ maintaining - @ (i < hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && - @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); - @ - @ decreasing hash > i ? hash - i : hash + len - i; - @ - @ assignable \strictly_nothing; - @*/ - while (true) { - Object item = tab[i]; - if (item == k) - return (java.lang.Object) tab[i + 1]; - if (item == null) - return null; - i = nextKeyIndex(i, len); - } - } - - /** - * Tests whether the specified object reference is a key in this identity - * hash map. - * - * @param key possible key - * @return true if the specified object reference is a key - * in this map - * @see #containsValue(Object) - */ - /*+KEY@ - @ also - @ public normal_behavior - @ ensures - @ \result <==> (\exists \bigint j; - @ 0 <= j < (table.length / (\bigint)2); - @ table[j * 2] == maskNull(key)); - @*/ - /*+OPENJML@ - @ also - @ public normal_behavior - @ ensures - @ \result <==> (\exists int j; - @ 0 <= j < (table.length / 2); - @ table[j * 2] == maskNull(key)); - @*/ - public /*@ strictly_pure @*/ boolean containsKey(/*@ nullable @*/ Object key) { - Object k = maskNull(key); - Object[] tab = table; - int len = tab.length; - int i = hash(k, len); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ // Index i is always an even value within the array bounds - @ maintaining - @ i >= 0 && i < len && i % (\bigint)2 == 0; - @ - @ // Suppose i > hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the interval [hash..i-2]. - @ maintaining - @ (i > hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); - @ - @ // Suppose i < hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. - @ maintaining - @ (i < hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && - @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); - @ - @ decreasing hash > i ? hash - i : hash + len - i; - @ - @ assignable \strictly_nothing; - @*/ - while (true) { - Object item = tab[i]; - if (item == k) - return true; - if (item == null) - return false; - i = nextKeyIndex(i, len); - } - } - - /** - * Tests whether the specified object reference is a value in this identity - * hash map. - * - * @param value value whose presence in this map is to be tested - * @return true if this map maps one or more keys to the - * specified object reference - * @see #containsKey(Object) - */ - /*+KEY@ - @ also - @ public normal_behavior - @ ensures - @ \result <==> (\exists \bigint j; - @ 0 <= j < table.length / (\bigint)2; - @ table[j * (\bigint)2] != null && table[j * (\bigint)2 + 1] == value); - @*/ - /*+OPEN_JML@ - @ also - @ public normal_behavior - @ ensures - @ \result <==> (\exists int j; - @ 0 <= j < table.length / 2; - @ table[j * 2] != null && table[j * 2 + 1] == value); - @*/ - public /*@ strictly_pure @*/ boolean containsValue(/*@ nullable @*/ Object value) { - Object[] tab = table; - - /*+KEY@ - @ // Index i is always an odd value within the array bounds - @ maintaining - @ i >= 1 && i <= tab.length+1 && i % (\bigint)2 == 1; - @ - @ // There cannot be an odd index n < i containing the value we are looking for (unless - @ // the associated key is null, in which case the value is ignored). - @ maintaining - @ (\forall \bigint n; 1 <= n < i && n % 2 == 1; tab[n - 1] != null ==> tab[n] != value); - @ - @ decreasing tab.length + 1 - i; - @ - @ assignable \strictly_nothing; - @*/ - for (int i = 1; i < tab.length; i += 2) - if (tab[i] == value && tab[i - 1] != null) - return true; - - return false; - } - - /** - * Tests if the specified key-value mapping is in the map. - * - * @param key possible key - * @param value possible value - * @return true if and only if the specified key-value - * mapping is in the map - */ - /*+KEY@ - @ private normal_behavior - @ ensures - @ \result <==> (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); - @*/ - /*+OPENJML@ - @ private normal_behavior - @ ensures - @ \result <==> (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); - @*/ - private /*@ spec_public @*/ /*@ strictly_pure @*/ boolean containsMapping(Object key, Object value) { - Object k = maskNull(key); - Object[] tab = table; - int len = tab.length; - int i = hash(k, len); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ // Index i is always an even value within the array bounds - @ maintaining - @ i >= 0 && i < len && i % (\bigint)2 == 0; - @ - @ // Suppose i > hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the interval [hash..i-2]. - @ maintaining - @ (i > hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); - @ - @ // Suppose i < hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. - @ maintaining - @ (i < hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && - @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); - @ - @ decreasing hash > i ? hash - i : hash + len - i; - @ - @ assignable \strictly_nothing; - @*/ - while (true) { - Object item = tab[i]; - if (item == k) - return tab[i + 1] == value; - if (item == null) - return false; - i = nextKeyIndex(i, len); - } - } - - /** - * Associates the specified value with the specified key in this identity - * hash map. If the map previously contained a mapping for the key, the - * old value is replaced. - * - * @param key the key with which the specified value is to be associated - * @param value the value to be associated with the specified key - * @return the previous value associated with key, or - * null if there was no mapping for key. - * (A null return can also indicate that the map - * previously associated null with key.) - * @see Object#equals(Object) - * @see #get(Object) - * @see #containsKey(Object) - */ - /*+KEY@ - @ also - @ private exceptional_behavior - @ requires - @ size == MAXIMUM_CAPACITY - 1; - @ requires - @ // The key is not present in the table - @ !(\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key)); - @ assignable - @ \nothing; - @ signals_only - @ IllegalStateException; - @ signals - @ (IllegalStateException e) true; - @ also - @ public normal_behavior - @ requires - @ // The key is already present in the table - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i*2] == maskNull(key)); - @ assignable - @ table[*]; - @ ensures - @ // The new value is associated with key and - @ // the old value associated with key is returned - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i*2] == maskNull(key) && - @ \result == \old(table[i * 2 + 1]) && - @ table[i * 2 + 1] == value); - @ ensures - @ // After execution, all keys are unchanged and all old values are unchanged - @ // except the old value that was associated with key - @ (\forall \bigint i; - @ 0 <= i < \old(table.length) / (\bigint)2; - @ (\old(table[i * 2]) == table[i * 2]) && - @ (\old(table[i * 2]) != maskNull(key) ==> - @ \old(table[i * 2 + 1]) == table[i * 2 + 1])); - @ also - @ public normal_behavior - @ requires - @ size < MAXIMUM_CAPACITY - 1; - @ requires - @ // The key is not present in the table - @ !(\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key)); - @ assignable - @ size, table[*], modCount, table; - @ ensures - @ // size must be increased by 1, modCount must change, and null must be returned - @ size == \old(size) + 1 && modCount != \old(modCount) && \result == null; - @ ensures - @ // After execution, all old keys are still present and all old values are still present - @ (\forall \bigint i; - @ 0 <= i < \old(table.length) / (\bigint)2; - @ (\exists \bigint j; - @ 0 <= j < table.length / (\bigint)2; - @ (\old(table[i * 2]) == table[j * 2]) && - @ \old(table[i * 2 + 1]) == table[j * 2 + 1])); - @ ensures - @ // After execution, the table contains the new key associated with the new value - @ (\exists \bigint i; - @ 0 <= i < table.length / (\bigint)2; - @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); - @*/ - /*+OPENJML@ - @ also - @ public normal_behavior - @ requires - @ // The key is already present in the table - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i*2] == maskNull(key)); - @ assignable - @ table[*]; - @ ensures - @ // The new value is associated with key and - @ // the old value associated with key is returned - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i*2] == maskNull(key) && - @ \result == \old(table[i * 2 + 1]) && - @ table[i * 2 + 1] == value); - @ ensures - @ // After execution, all keys are unchanged and all old values are unchanged - @ // except the old value that was associated with key - @ (\forall int i; - @ 0 <= i < \old(table.length) / 2; - @ (\old(table[i * 2]) == table[i * 2]) && - @ (\old(table[i * 2]) != maskNull(key) ==> - @ \old(table[i * 2 + 1]) == table[i * 2 + 1])); - @ also - @ public normal_behavior - @ requires - @ size < MAXIMUM_CAPACITY - 1; - @ requires - @ // The key is not present in the table - @ !(\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key)); - @ assignable - @ size, table[*], modCount, table; - @ ensures - @ // size must be increased by 1, modCount must change, and null must be returned - @ size == \old(size) + 1 && modCount != \old(modCount) && \result == null; - @ ensures - @ // After execution, all old keys are still present and all old values are still present - @ (\forall int i; - @ 0 <= i < \old(table.length) / 2; - @ (\exists int j; - @ 0 <= j < table.length / 2; - @ (\old(table[i * 2]) == table[j * 2]) && - @ \old(table[i * 2 + 1]) == table[j * 2 + 1])); - @ ensures - @ // After execution, the table contains the new key associated with the new value - @ (\exists int i; - @ 0 <= i < table.length / 2; - @ table[i * 2] == maskNull(key) && table[i * 2 + 1] == value); - @*/ - public /*@ nullable @*/ java.lang.Object put(/*@ nullable @*/ java.lang.Object key, /*@ nullable @*/ java.lang.Object value) { - final Object k = maskNull(key); - - retryAfterResize: - for (; ; ) { - final Object[] tab = table; - final int len = tab.length; - int i = hash(k, len); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ // Index i is always an even value within the array bounds - @ maintaining - @ tab == table && len == tab.length && - @ i >= 0 && i < (len - (\bigint)1) && i % (\bigint)2 == 0; - @ - @ // Suppose i > hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the interval [hash..i-2]. - @ maintaining - @ (i > hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < i; tab[2 * n] != k && tab[2 * n] != null); - @ - @ // Suppose i < hash. This can only be the case when no key k and no null is present - @ // at an even index of tab in the intervals [0..i-2] and [hash..len-2]. - @ maintaining - @ (i < hash) ==> - @ (\forall \bigint n; hash <= (2 * n) < len; tab[2 * n] != k && tab[2 * n] != null) && - @ (\forall \bigint m; 0 <= (2 * m) < i; tab[2 * m] != k && tab[2 * m] != null); - @ - @ decreasing hash > i ? hash - i : len + hash - i; - @ - @ // if the loop iteration completes, the heap is unchanged - @ // in case key is present, table is updated but the loop iteration terminates without - @ // completing because the method returns, so the assignable clause need not hold - @ assignable \strictly_nothing; - @*/ - for (Object item; (item = tab[i]) != null; - i = nextKeyIndex(i, len)) { - if (item == k) { - java.lang.Object oldValue = (java.lang.Object) tab[i + 1]; - tab[i + 1] = value; - return oldValue; - } - } - - final int s = size + 1; - // Use optimized form of 3 * s. - // Next capacity is len, 2 * current capacity. - if (s + (s << 1) > len && resize(len)) - continue retryAfterResize; - - modCount++; - tab[i] = k; - tab[i + 1] = value; - size = s; - return null; - } - } - - /** - * Resizes the table if necessary to hold given capacity. - * - * @param newCapacity the new capacity, must be a power of two. - * @return whether a resize did in fact take place - */ - /*+KEY@ - @ // Throws an exception when table.length == 2 * MAXIMUM_CAPACITY && - @ // size == MAXIMUM_CAPACITY - 1. - @ private exceptional_behavior - @ requires - @ table.length == (\bigint)2 * MAXIMUM_CAPACITY && - @ size == MAXIMUM_CAPACITY - 1; - @ assignable - @ \nothing; - @ signals_only - @ IllegalStateException; - @ signals - @ (IllegalStateException e) true; - @ - @ // Nothing changes if table.length == 2 * MAXIMUM_CAPACITY && - @ // size < MAXIMUM_CAPACITY - 1. - @ private normal_behavior - @ requires - @ table.length == (\bigint)2 * MAXIMUM_CAPACITY && - @ size < MAXIMUM_CAPACITY - 1; - @ assignable - @ \strictly_nothing; - @ ensures - @ \result == false; - @ - @ // Nothing changes when table.length < 2 * MAXIMUM_CAPACITY && - @ // table.length >= 2 * newCapacity. - @ private normal_behavior - @ requires - @ table.length < (\bigint)2 * MAXIMUM_CAPACITY && - @ table.length >= (\bigint)2 * newCapacity && - @ newCapacity >= MINIMUM_CAPACITY && - @ newCapacity <= (\bigint)2 * MAXIMUM_CAPACITY; - @ - @ assignable - @ \strictly_nothing; - @ - @ ensures - @ // Map is unchanged, so return false - @ \result == false; - @ - @ - @ // If we actually resize (table.length < 2 * MAXIMUM_CAPACITY && table.length < 2 * newCapacity) - @ // then rehash the table with the new length to re-establish the class invariant. - @ private normal_behavior - @ requires - @ table.length < (\bigint)2 * newCapacity && - @ newCapacity <= MAXIMUM_CAPACITY && - @ newCapacity >= MINIMUM_CAPACITY && - @ (\exists \bigint i; - @ 0 <= i < newCapacity; - @ \dl_pow(2,i) == newCapacity); - @ - @ assignable - @ table, table[*]; - @ - @ ensures - @ table.length == (newCapacity * (\bigint)2); - @ - @ ensures - @ // After execution, all old entries are still present - @ (\forall \bigint i; - @ 0 <= i < \old(table.length) && i % 2 == 0; - @ (\exists \bigint j; - @ 0 <= j < table.length && j % 2 == 0; - @ \old(table[i]) == table[j] && \old(table[i + 1]) == table[j + 1])); - @ - @ ensures - @ // Map is changed, so return true - @ \result == true; - @ - @ ensures - @ \fresh(table); - @ - @ ensures - @ // All entries in the new table were also present in \old(table) - @ (\forall \bigint n; - @ 0 <= n < table.length / (\bigint)2; - @ (\exists \bigint m; - @ 0 <= m < \old(table.length) / (\bigint)2; - @ table[2*n] == \old(table[2*m]) && table[2*n + 1] == \old(table[2*m + 1]))); - @*/ - /*+OPENJML@ - @ // Nothing changes if table.length == 2 * MAXIMUM_CAPACITY && - @ // size < MAXIMUM_CAPACITY - 1. - @ private normal_behavior - @ requires - @ table.length == 2 * MAXIMUM_CAPACITY && - @ size < MAXIMUM_CAPACITY - 1; - @ assignable - @ \strictly_nothing; - @ ensures - @ \result == false; - @ - @ // Nothing changes when table.length < 2 * MAXIMUM_CAPACITY && - @ // table.length >= 2 * newCapacity. - @ private normal_behavior - @ requires - @ table.length < 2 * MAXIMUM_CAPACITY && - @ table.length >= 2 * newCapacity && - @ newCapacity >= MINIMUM_CAPACITY && - @ newCapacity <= 2 * MAXIMUM_CAPACITY; - @ - @ assignable - @ \strictly_nothing; - @ - @ ensures - @ // Map is unchanged, so return false - @ \result == false; - @ - @ - @ // If we actually resize (table.length < 2 * MAXIMUM_CAPACITY && table.length < 2 * newCapacity) - @ // then rehash the table with the new length to re-establish the class invariant. - @ private normal_behavior - @ requires - @ table.length < 2 * newCapacity && - @ newCapacity <= MAXIMUM_CAPACITY && - @ newCapacity >= MINIMUM_CAPACITY && - @ (\exists int i; - @ 0 <= i < newCapacity; - @ (newCapacity & (newCapacity - 1)) == 0); - @ - @ assignable - @ table, table[*]; - @ - @ ensures - @ table.length == (newCapacity * 2); - @ - @ ensures - @ // After execution, all old entries are still present - @ (\forall int i; - @ 0 <= i < \old(table.length) && i % 2 == 0; - @ (\exists int j; - @ 0 <= j < table.length && j % 2 == 0; - @ \old(table[i]) == table[j] && \old(table[i + 1]) == table[j + 1])); - @ - @ ensures - @ // Map is changed, so return true - @ \result == true; - @ - @ ensures - @ \fresh(table); - @ - @ ensures - @ // All entries in the new table were also present in \old(table) - @ (\forall int n; - @ 0 <= n < table.length / 2; - @ (\exists int m; - @ 0 <= m < \old(table.length) / 2; - @ table[2*n] == \old(table[2*m]) && table[2*n + 1] == \old(table[2*m + 1]))); - @*/ - private boolean resize(int newCapacity) - // assert (newCapacity & -newCapacity) == newCapacity; // power of 2 - { - int newLength = newCapacity * 2; - - Object[] oldTable = table; - int oldLength = oldTable.length; - if (oldLength == 2 * MAXIMUM_CAPACITY) { // can't expand any further - if (size == MAXIMUM_CAPACITY - 1) - throw new IllegalStateException("Capacity exhausted."); - return false; - } - if (oldLength >= newLength) - return false; - - Object[] newTable = new Object[newLength]; - - /*+KEY@ - @ // All processed entries are copied to newTable - @ maintaining - @ (\forall \bigint k; - @ 0 <= k < j && k % 2 == 0; - @ (\exists \bigint l; - @ 0 <= l < newTable.length && l % 2 == 0; - @ \old(table[k]) == newTable[l] && \old(table[k + 1]) == newTable[l + 1])); - @ - @ // All (non-null) entries in newTable are also present in \old(table) - @ maintaining - @ (\forall \bigint n; - @ 0 <= n < newTable.length && n % 2 == 0 && newTable[n] != null; - @ (\exists \bigint m; - @ 0 <= m < j && m % 2 == 0; - @ newTable[n] == \old(table[m]) && newTable[n + 1] == \old(table[m + 1]))); - @ - @ // All unprocessed entries are still untouched in old table - @ maintaining - @ (\forall \bigint k; - @ j <= k < \old(table.length); - @ \old(table[k]) == oldTable[k]); - @ - @ // The number of non-null keys in newTable equals the number of copied keys - @ maintaining - @ (\num_of \bigint i; 0 <= i < j / (\bigint)2; \old(table[2 * i]) != null) - @ == (\num_of \bigint i; 0 <= i < newTable.length / (\bigint)2; newTable[2 * i] != null); - @ - @ // For all key-value pairs: if key == null, then value == null - @ maintaining - @ (\forall \bigint i; - @ 0 <= i && i < newTable.length / (\bigint)2; - @ (newTable[i * (\bigint)2] == null ==> newTable[i * (\bigint)2 + 1] == null)); - @ - @ // Non-empty keys in newTable are unique - @ maintaining - @ (\forall \bigint p; 0 <= p && p < newTable.length / (\bigint)2; - @ (\forall \bigint q; - @ p <= q && q < newTable.length / (\bigint)2; - @ (newTable[2 * p] != null && newTable[2 * p] == newTable[2 * q]) ==> p == q)); - @ - @ // There are no gaps between a key's hashed index and its actual - @ // index (if the key is at a higher index than the hash code) - @ maintaining - @ (\forall \bigint g; - @ 0 <= g < newTable.length / (\bigint)2; - @ newTable[2 * g] != null && 2 * g > \dl_genHash(newTable[2 * g], newTable.length) ==> - @ (\forall \bigint h; - @ \dl_genHash(newTable[2 * g], newTable.length) / (\bigint)2 <= h < g; - @ newTable[2 * h] != null)); - @ - @ // There are no gaps between a key's hashed index and its actual - @ // index (if the key is at a lower index than the hash code) - @ maintaining - @ (\forall \bigint g; - @ 0 <= g < newTable.length / (\bigint)2; - @ newTable[2 * g] != null && 2 * g < \dl_genHash(newTable[2 * g], newTable.length) ==> - @ (\forall \bigint h; - @ \dl_genHash(newTable[2 * g], newTable.length) <= 2 * h < newTable.length || 0 <= 2 * h < 2 * g; - @ newTable[2 * h] != null)); - @ - @ // Table must have at least one empty key-element to prevent - @ // infinite loops when a key is not present. - @ maintaining - @ (\exists \bigint i; - @ 0 <= i < newTable.length / (\bigint)2; - @ newTable[2*i] == null); - @ - @ maintaining - @ j >= 0 && j <= oldLength && j % (\bigint)2 == 0; - @ - @ assignable - @ table[*], newTable[*]; - @ - @ decreasing - @ oldLength - j; - @*/ - for (int j = 0; j < oldLength; j += 2) { - Object key = oldTable[j]; - if (key != null) { - Object value = oldTable[j + 1]; - oldTable[j] = null; - oldTable[j + 1] = null; - int i = hash(key, newLength); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ // Index i is always an even value within the array bounds - @ maintaining - @ i >= 0 && i < newLength && i % (\bigint)2 == 0; - @ - @ // There are no gaps in the segment [hash .. i) - @ // (if the current index is higher than the hash) - @ maintaining - @ (\forall \bigint g; - @ hash <= 2 * g < i; - @ newTable[2 * g] != null); - @ - @ // There are no gaps in the segment [0 .. i) and [hash .. newLength) - @ // (if the current index is lower (wrap around) than the hash) - @ maintaining - @ (i < hash) ==> - @ (\forall \bigint g; - @ (0 <= 2 * g < i) || (hash <= 2 * g < newLength); - @ newTable[2 * g] != null); - @ - @ assignable - @ \strictly_nothing; - @ - @ decreasing - @ hash > i ? hash - i : newLength + hash - i; - @*/ - while (newTable[i] != null) - i = nextKeyIndex(i, newLength); - newTable[i] = key; - newTable[i + 1] = value; - } - } - table = newTable; - return true; - } - - /** - * Copies all of the mappings from the specified map to this map. - * These mappings will replace any mappings that this map had for - * any of the keys currently in the specified map. - * - * @param m mappings to be stored in this map - * @throws NullPointerException if the specified map is null - */ - public void putAll(Map m) { - int n = m.size(); - if (n == 0) - return; - if (n > size) - resize(capacity(n)); // conservatively pre-expand - - for (Object o : m.entrySet()) { - Entry e = (Entry) o; - put(e.getKey(), e.getValue()); - } - } - - /** - * Removes the mapping for this key from this map if present. - * - * @param key key whose mapping is to be removed from the map - * @return the previous value associated with key, or - * null if there was no mapping for key. - * (A null return can also indicate that the map - * previously associated null with key.) - */ - public java.lang.Object remove(Object key) { - Object k = maskNull(key); - Object[] tab = table; - int len = tab.length; - int i = hash(k, len); - - //+KEY@ ghost \bigint hash = i; - - /*+KEY@ - @ loop_invariant true; // TODO: see containsKey() - @ decreasing len - (len + i - hash) % len; - @ assignable i, modCount, size, tab[*]; - @*/ - while (true) { - Object item = tab[i]; - if (item == k) { - modCount++; - size--; - @SuppressWarnings("unchecked") java.lang.Object oldValue = (java.lang.Object) tab[i + 1]; - tab[i + 1] = null; - tab[i] = null; - closeDeletion(i); - return oldValue; - } - if (item == null) - return null; - i = nextKeyIndex(i, len); - } - } - - /** - * Removes the specified key-value mapping from the map if it is present. - * - * @param key possible key - * @param value possible value - * @return true if and only if the specified key-value - * mapping was in the map - */ - private boolean removeMapping(Object key, Object value) { - Object k = maskNull(key); - Object[] tab = table; - int len = tab.length; - int i = hash(k, len); - - while (true) { - Object item = tab[i]; - if (item == k) { - if (tab[i + 1] != value) - return false; - modCount++; - size--; - tab[i] = null; - tab[i + 1] = null; - closeDeletion(i); - return true; - } - if (item == null) - return false; - i = nextKeyIndex(i, len); - } - } - - /** - * Rehash all possibly-colliding entries following a - * deletion. This preserves the linear-probe - * collision properties required by get, put, etc. - * - * @param d the index of a newly empty deleted slot - */ - private void closeDeletion(int d) - // Adapted from Knuth Section 6.4 Algorithm R - { - Object[] tab = table; - int len = tab.length; - - // Look for items to swap into newly vacated slot - // starting at index immediately following deletion, - // and continuing until a null slot is seen, indicating - // the end of a run of possibly-colliding keys. - Object item; - for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; - i = nextKeyIndex(i, len)) - // The following test triggers if the item at slot i (which - // hashes to be at slot r) should take the spot vacated by d. - // If so, we swap it in, and then continue with d now at the - // newly vacated i. This process will terminate when we hit - // the null slot at the end of this run. - // The test is messy because we are using a circular table. - { - int r = hash(item, len); - if ((i < r && (r <= d || d <= i)) || (r <= d && d <= i)) { - tab[d] = item; - tab[d + 1] = tab[i + 1]; - tab[i] = null; - tab[i + 1] = null; - d = i; - } - } - } - - /** - * Removes all of the mappings from this map. - * The map will be empty after this call returns. - */ - /*+KEY@ - @ also - @ public normal_behavior - @ assignable - @ modCount, size, table[0 .. table.length - (\bigint)1]; - @ ensures - @ \old(modCount) != modCount && - @ \old(table.length) == table.length && - @ size == 0 && - @ (\forall \bigint i; - @ 0 <= i < table.length; - @ table[i] == null); - @*/ - /*+OPENJML@ - @ also - @ public normal_behavior - @ assignable - @ modCount, size, table[0 .. table.length - 1]; - @ ensures - @ \old(modCount) != modCount && - @ \old(table.length) == table.length && - @ size == 0 && - @ (\forall int i; - @ 0 <= i < table.length; - @ table[i] == null); - @*/ - public void clear() { - modCount++; - Object[] tab = table; - - /*+KEY@ - @ maintaining - @ 0 <= i && i <= tab.length; - @ maintaining - @ (\forall \bigint j; 0 <= j < i; tab[j] == null); - @ decreasing - @ tab.length - i; - @ assignable - @ tab[0 .. tab.length - (\bigint)1]; - @*/ - for (int i = 0; i < tab.length; i++) - tab[i] = null; - size = 0; - } - - /** - * Compares the specified object with this map for equality. Returns - * true if the given object is also a map and the two maps - * represent identical object-reference mappings. More formally, this - * map is equal to another map m if and only if - * this.entrySet().equals(m.entrySet()). - * - *

Owing to the reference-equality-based semantics of this map it is - * possible that the symmetry and transitivity requirements of the - * Object.equals contract may be violated if this map is compared - * to a normal map. However, the Object.equals contract is - * guaranteed to hold among VerifiedIdentityHashMap instances. - * - * @param o object to be compared for equality with this map - * @return true if the specified object is equal to this map - * @see Object#equals(Object) - */ - public boolean equals(Object o) { - if (o == this) { - return true; - } else if (o instanceof VerifiedIdentityHashMap) { - VerifiedIdentityHashMap m = (VerifiedIdentityHashMap) o; - if (m.size() != size) - return false; - - Object[] tab = m.table; - for (int i = 0; i < tab.length; i += 2) { - Object k = tab[i]; - if (k != null && !containsMapping(k, tab[i + 1])) - return false; - } - return true; - } else if (o instanceof Map) { - Map m = (Map) o; - return entrySet().equals(m.entrySet()); - } else { - return false; // o is not a Map - } - } - - /** - * Returns the hash code value for this map. The hash code of a map is - * defined to be the sum of the hash codes of each entry in the map's - * entrySet() view. This ensures that m1.equals(m2) - * implies that m1.hashCode()==m2.hashCode() for any two - * VerifiedIdentityHashMap instances m1 and m2, as - * required by the general contract of {@link Object#hashCode}. - * - *

Owing to the reference-equality-based semantics of the - * Map.Entry instances in the set returned by this map's - * entrySet method, it is possible that the contractual - * requirement of Object.hashCode mentioned in the previous - * paragraph will be violated if one of the two objects being compared is - * an VerifiedIdentityHashMap instance and the other is a normal map. - * - * @return the hash code value for this map - * @see Object#equals(Object) - * @see #equals(Object) - */ - public int hashCode() { - int result = 0; - Object[] tab = table; - for (int i = 0; i < tab.length; i += 2) { - Object key = tab[i]; - if (key != null) { - Object k = unmaskNull(key); - result += System.identityHashCode(k) ^ - System.identityHashCode(tab[i + 1]); - } - } - return result; - } - - /** - * Returns a shallow copy of this identity hash map: the keys and values - * themselves are not cloned. - * - * @return a shallow copy of this map - */ - public Object clone() { - try { - VerifiedIdentityHashMap m = (VerifiedIdentityHashMap) super.clone(); - m.entrySet = null; - m.table = table.clone(); - return m; - } catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - - private abstract class IdentityHashMapIterator implements Iterator { - int index = (size != 0 ? 0 : table.length); // current slot. - int expectedModCount = modCount; // to support fast-fail - int lastReturnedIndex = -1; // to allow remove() - boolean indexValid; // To avoid unnecessary next computation - Object[] traversalTable = table; // reference to main table or copy - - public boolean hasNext() { - Object[] tab = traversalTable; - for (int i = index; i < tab.length; i += 2) { - Object key = tab[i]; - if (key != null) { - index = i; - return indexValid = true; - } - } - index = tab.length; - return false; - } - - protected int nextIndex() { - if (modCount != expectedModCount) - throw new ConcurrentModificationException(); - if (!indexValid && !hasNext()) - throw new NoSuchElementException(); - - indexValid = false; - lastReturnedIndex = index; - index += 2; - return lastReturnedIndex; - } - - public void remove() { - if (lastReturnedIndex == -1) - throw new IllegalStateException(); - if (modCount != expectedModCount) - throw new ConcurrentModificationException(); - - expectedModCount = ++modCount; - int deletedSlot = lastReturnedIndex; - lastReturnedIndex = -1; - // back up index to revisit new contents after deletion - index = deletedSlot; - indexValid = false; - - // Removal code proceeds as in closeDeletion except that - // it must catch the rare case where an element already - // seen is swapped into a vacant slot that will be later - // traversed by this iterator. We cannot allow future - // next() calls to return it again. The likelihood of - // this occurring under 2/3 load factor is very slim, but - // when it does happen, we must make a copy of the rest of - // the table to use for the rest of the traversal. Since - // this can only happen when we are near the end of the table, - // even in these rare cases, this is not very expensive in - // time or space. - - Object[] tab = traversalTable; - int len = tab.length; - - int d = deletedSlot; - Object key = tab[d]; - tab[d] = null; // vacate the slot - tab[d + 1] = null; - - // If traversing a copy, remove in real table. - // We can skip gap-closure on copy. - if (tab != VerifiedIdentityHashMap.this.table) { - VerifiedIdentityHashMap.this.remove(key); - expectedModCount = modCount; - return; - } - - size--; - - Object item; - for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; - i = nextKeyIndex(i, len)) { - int r = hash(item, len); - // See closeDeletion for explanation of this conditional - if ((i < r && (r <= d || d <= i)) || - (r <= d && d <= i)) { - - // If we are about to swap an already-seen element - // into a slot that may later be returned by next(), - // then clone the rest of table for use in future - // next() calls. It is OK that our copy will have - // a gap in the "wrong" place, since it will never - // be used for searching anyway. - - if (i < deletedSlot && d >= deletedSlot && - traversalTable == VerifiedIdentityHashMap.this.table) { - int remaining = len - deletedSlot; - Object[] newTable = new Object[remaining]; - System.arraycopy(tab, deletedSlot, - newTable, 0, remaining); - traversalTable = newTable; - index = 0; - } - - tab[d] = item; - tab[d + 1] = tab[i + 1]; - tab[i] = null; - tab[i + 1] = null; - d = i; - } - } - } - } - - private class KeyIterator extends IdentityHashMapIterator { - @SuppressWarnings("unchecked") - public java.lang.Object next() { - return (java.lang.Object) unmaskNull(traversalTable[nextIndex()]); - } - } - - private class ValueIterator extends IdentityHashMapIterator { - @SuppressWarnings("unchecked") - public java.lang.Object next() { - return (java.lang.Object) traversalTable[nextIndex() + 1]; - } - } - - private class EntryIterator - extends IdentityHashMapIterator { - private Entry lastReturnedEntry = null; - - public Map.Entry next() { - lastReturnedEntry = new Entry(nextIndex()); - return lastReturnedEntry; - } - - public void remove() { - lastReturnedIndex = - ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index); - super.remove(); - lastReturnedEntry.index = lastReturnedIndex; - lastReturnedEntry = null; - } - - private class Entry implements Map.Entry { - private int index; - - private Entry(int index) { - this.index = index; - } - - @SuppressWarnings("unchecked") - public java.lang.Object getKey() { - checkIndexForEntryUse(); - return (java.lang.Object) unmaskNull(traversalTable[index]); - } - - @SuppressWarnings("unchecked") - public java.lang.Object getValue() { - checkIndexForEntryUse(); - return (java.lang.Object) traversalTable[index + 1]; - } - - @SuppressWarnings("unchecked") - public java.lang.Object setValue(java.lang.Object value) { - checkIndexForEntryUse(); - java.lang.Object oldValue = (java.lang.Object) traversalTable[index + 1]; - traversalTable[index + 1] = value; - // if shadowing, force into main table - if (traversalTable != VerifiedIdentityHashMap.this.table) - put((java.lang.Object) traversalTable[index], value); - return oldValue; - } - - public boolean equals(Object o) { - if (index < 0) - return super.equals(o); - - if (!(o instanceof Map.Entry)) - return false; - Map.Entry e = (Map.Entry) o; - return (e.getKey() == unmaskNull(traversalTable[index]) && - e.getValue() == traversalTable[index + 1]); - } - - public int hashCode() { - if (lastReturnedIndex < 0) - return super.hashCode(); - - return (System.identityHashCode(unmaskNull(traversalTable[index])) ^ - System.identityHashCode(traversalTable[index + 1])); - } - - public String toString() { - if (index < 0) - return super.toString(); - - return (unmaskNull(traversalTable[index]) + "=" - + traversalTable[index + 1]); - } - - private void checkIndexForEntryUse() { - if (index < 0) - throw new IllegalStateException("Entry was removed"); - } - } - } - - // Views - - /** - * This field is initialized to contain an instance of the entry set - * view the first time this view is requested. The view is stateless, - * so there's no reason to create more than one. - */ - private /*@ spec_public nullable @*/ transient Set entrySet = null; - - /** - * Returns an identity-based set view of the keys contained in this map. - * The set is backed by the map, so changes to the map are reflected in - * the set, and vice-versa. If the map is modified while an iteration - * over the set is in progress, the results of the iteration are - * undefined. The set supports element removal, which removes the - * corresponding mapping from the map, via the Iterator.remove, - * Set.remove, removeAll, retainAll, and - * clear methods. It does not support the add or - * addAll methods. - * - *

While the object returned by this method implements the - * Set interface, it does not obey Set's general - * contract. Like its backing map, the set returned by this method - * defines element equality as reference-equality rather than - * object-equality. This affects the behavior of its contains, - * remove, containsAll, equals, and - * hashCode methods. - * - *

The equals method of the returned set returns true - * only if the specified object is a set containing exactly the same - * object references as the returned set. The symmetry and transitivity - * requirements of the Object.equals contract may be violated if - * the set returned by this method is compared to a normal set. However, - * the Object.equals contract is guaranteed to hold among sets - * returned by this method. - * - *

The hashCode method of the returned set returns the sum of - * the identity hashcodes of the elements in the set, rather than - * the sum of their hashcodes. This is mandated by the change in the - * semantics of the equals method, in order to enforce the - * general contract of the Object.hashCode method among sets - * returned by this method. - * - * @return an identity-based set view of the keys contained in this map - * @see Object#equals(Object) - * @see System#identityHashCode(Object) - */ - public Set keySet() { - Set ks = keySet; - if (ks != null) - return ks; - else - return keySet = new KeySet(); - } - - private class KeySet extends AbstractSet { - public Iterator iterator() { - return new KeyIterator(); - } - - public int size() { - return size; - } - - public boolean contains(Object o) { - return containsKey(o); - } - - public boolean remove(Object o) { - int oldSize = size; - VerifiedIdentityHashMap.this.remove(o); - return size != oldSize; - } - - /* - * Must revert from AbstractSet's impl to AbstractCollection's, as - * the former contains an optimization that results in incorrect - * behavior when c is a smaller "normal" (non-identity-based) Set. - */ - public boolean removeAll(Collection c) { - boolean modified = false; - for (Iterator i = iterator(); i.hasNext(); ) { - if (c.contains(i.next())) { - i.remove(); - modified = true; - } - } - return modified; - } - - public void clear() { - VerifiedIdentityHashMap.this.clear(); - } - - public int hashCode() { - int result = 0; - for (java.lang.Object key : this) - result += System.identityHashCode(key); - return result; - } - } - - /** - * Returns a {@link Collection} view of the values contained in this map. - * The collection is backed by the map, so changes to the map are - * reflected in the collection, and vice-versa. If the map is - * modified while an iteration over the collection is in progress, - * the results of the iteration are undefined. The collection - * supports element removal, which removes the corresponding - * mapping from the map, via the Iterator.remove, - * Collection.remove, removeAll, - * retainAll and clear methods. It does not - * support the add or addAll methods. - * - *

While the object returned by this method implements the - * Collection interface, it does not obey - * Collection's general contract. Like its backing map, - * the collection returned by this method defines element equality as - * reference-equality rather than object-equality. This affects the - * behavior of its contains, remove and - * containsAll methods. - */ - public Collection values() { - Collection vs = values; - if (vs != null) - return vs; - else - return values = new Values(); - } - - private class Values extends AbstractCollection { - public Iterator iterator() { - return new ValueIterator(); - } - - public int size() { - return size; - } - - public boolean contains(Object o) { - return containsValue(o); - } - - public boolean remove(Object o) { - for (Iterator i = iterator(); i.hasNext(); ) { - if (i.next() == o) { - i.remove(); - return true; - } - } - return false; - } - - public void clear() { - VerifiedIdentityHashMap.this.clear(); - } - } - - /** - * Returns a {@link Set} view of the mappings contained in this map. - * Each element in the returned set is a reference-equality-based - * Map.Entry. The set is backed by the map, so changes - * to the map are reflected in the set, and vice-versa. If the - * map is modified while an iteration over the set is in progress, - * the results of the iteration are undefined. The set supports - * element removal, which removes the corresponding mapping from - * the map, via the Iterator.remove, Set.remove, - * removeAll, retainAll and clear - * methods. It does not support the add or - * addAll methods. - * - *

Like the backing map, the Map.Entry objects in the set - * returned by this method define key and value equality as - * reference-equality rather than object-equality. This affects the - * behavior of the equals and hashCode methods of these - * Map.Entry objects. A reference-equality based Map.Entry - * e is equal to an object o if and only if o is a - * Map.Entry and e.getKey()==o.getKey() && - * e.getValue()==o.getValue(). To accommodate these equals - * semantics, the hashCode method returns - * System.identityHashCode(e.getKey()) ^ - * System.identityHashCode(e.getValue()). - * - *

Owing to the reference-equality-based semantics of the - * Map.Entry instances in the set returned by this method, - * it is possible that the symmetry and transitivity requirements of - * the {@link Object#equals(Object)} contract may be violated if any of - * the entries in the set is compared to a normal map entry, or if - * the set returned by this method is compared to a set of normal map - * entries (such as would be returned by a call to this method on a normal - * map). However, the Object.equals contract is guaranteed to - * hold among identity-based map entries, and among sets of such entries. - * - * - * @return a set view of the identity-mappings contained in this map - */ - public Set entrySet() { - Set es = entrySet; - if (es != null) - return es; - else - return entrySet = new EntrySet(); - } - - private class EntrySet extends AbstractSet { - public Iterator iterator() { - return new EntryIterator(); - } - - public boolean contains(Object o) { - if (!(o instanceof Map.Entry)) - return false; - Map.Entry entry = (Map.Entry) o; - return containsMapping(entry.getKey(), entry.getValue()); - } - - public boolean remove(Object o) { - if (!(o instanceof Map.Entry)) - return false; - Map.Entry entry = (Map.Entry) o; - return removeMapping(entry.getKey(), entry.getValue()); - } - - public int size() { - return size; - } - - public void clear() { - VerifiedIdentityHashMap.this.clear(); - } - - /* - * Must revert from AbstractSet's impl to AbstractCollection's, as - * the former contains an optimization that results in incorrect - * behavior when c is a smaller "normal" (non-identity-based) Set. - */ - public boolean removeAll(Collection c) { - boolean modified = false; - for (Iterator i = iterator(); i.hasNext(); ) { - if (c.contains(i.next())) { - i.remove(); - modified = true; - } - } - return modified; - } - - public Object[] toArray() { - int size = size(); - Object[] result = new Object[size]; - Iterator it = iterator(); - for (int i = 0; i < size; i++) - result[i] = new AbstractMap.SimpleEntry(((java.util.Map.Entry) it.next())); - return result; - } - - @SuppressWarnings("unchecked") - public java.lang.Object[] toArray(java.lang.Object[] a) { - int size = size(); - if (a.length < size) - a = (java.lang.Object[]) java.lang.reflect - .Array.newInstance(a.getClass().getComponentType(), size); - Iterator it = iterator(); - for (int i = 0; i < size; i++) - a[i] = (java.lang.Object) new AbstractMap.SimpleEntry(((java.util.Map.Entry) it.next())); - if (a.length > size) - a[size] = null; - return a; - } - } - - -// private static final long serialVersionUID = 8188218128353913216L; -// -// /** -// * Saves the state of the VerifiedIdentityHashMap instance to a stream -// * (i.e., serializes it). -// * -// * @serialData The size of the HashMap (the number of key-value -// * mappings) (int), followed by the key (Object) and -// * value (Object) for each key-value mapping represented by the -// * VerifiedIdentityHashMap. The key-value mappings are emitted in no -// * particular order. -// */ -// private void writeObject(java.io.ObjectOutputStream s) -// throws java.io.IOException { -// // Write out and any hidden stuff -// s.defaultWriteObject(); -// -// // Write out size (number of Mappings) -// s.writeInt(size); -// -// // Write out keys and values (alternating) -// Object[] tab = table; -// for (int i = 0; i < tab.length; i += 2) { -// Object key = tab[i]; -// if (key != null) { -// s.writeObject(unmaskNull(key)); -// s.writeObject(tab[i + 1]); -// } -// } -// } - -// /** -// * Reconstitutes the VerifiedIdentityHashMap instance from a stream (i.e., -// * deserializes it). -// */ -// private void readObject(java.io.ObjectInputStream s) -// throws java.io.IOException, ClassNotFoundException { -// // Read in any hidden stuff -// s.defaultReadObject(); -// -// // Read in size (number of Mappings) -// int size = s.readInt(); -// if (size < 0) -// throw new java.io.StreamCorruptedException -// ("Illegal mappings count: " + size); -// int cap = capacity(size); -// SharedSecrets.getJavaOISAccess().checkArray(s, Object[].class, cap); -// init(cap); -// -// // Read the keys and values, and put the mappings in the table -// for (int i=0; i { - MyFunctionalInterface g = (x) -> test * 2 + x; - return test + g.apply(a) * 2; - }); - } - - void make(MyFunctionalInterface f) { - f.apply(10); - } - - @java.lang.FunctionalInterface - interface MyFunctionalInterface { - public int apply(int i); - } -} diff --git a/jmlparser-jml-tools/src/test/resources/lambda/TestGeneric.java b/jmlparser-jml-tools/src/test/resources/lambda/TestGeneric.java deleted file mode 100644 index bacbe73ace..0000000000 --- a/jmlparser-jml-tools/src/test/resources/lambda/TestGeneric.java +++ /dev/null @@ -1,26 +0,0 @@ -class A { - private final int test; - - public A() { - this.test = 1; - } - - void m(int i) { - int outer = 10; - make(a -> { - MyFunctionalInterface g = (x) -> (test * 2 + x) > 0; - - return g.apply(a) && a > 2; - }); - } - - void make(MyFunctionalInterface f) { - f.apply(10); - } - - @java.lang.FunctionalInterface - interface MyFunctionalInterface { - - public boolean apply(T i); - } -} diff --git a/jmlparser-jml-tools/src/test/resources/lambda/TestPredicateInline.java b/jmlparser-jml-tools/src/test/resources/lambda/TestPredicateInline.java deleted file mode 100644 index 86726069bc..0000000000 --- a/jmlparser-jml-tools/src/test/resources/lambda/TestPredicateInline.java +++ /dev/null @@ -1,49 +0,0 @@ -import java.util.Objects; - -class A { - private final int test; - - public A() { - this.test = 1; - } - - void m(int i) { - int outer = 10; - Predicate tester = (a) -> a > 10; - tester.test(outer); - } - - - @FunctionalInterface - public interface Predicate { - boolean test(T var1); - - default Predicate and(Predicate var1) { - Objects.requireNonNull(var1); - return (var2) -> { - return this.test(var2) && var1.test(var2); - }; - } - - default Predicate negate() { - return (var1) -> { - return !this.test(var1); - }; - } - - default Predicate or(Predicate var1) { - Objects.requireNonNull(var1); - return (var2) -> { - return this.test(var2) || var1.test(var2); - }; - } - - static Predicate isEqual(Object var0) { - return null == var0 ? Objects::isNull : (var1) -> { - return var0.equals(var1); - }; - } - - } - -} diff --git a/jmlparser-web/pom.xml b/jmlparser-web/pom.xml deleted file mode 100644 index 133302d52a..0000000000 --- a/jmlparser-web/pom.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - 4.0.0 - - jmlparser-parent - io.github.jmltoolkit - 3.24.9-SNAPSHOT - - - jmlparser-web - jmlparser-web - - - UTF-8 - official - 1.6.8 - 1.2.10 - 11 - 1.8.0 - - - - - io.github.jmltoolkit - jmlparser-core - ${project.version} - - - io.github.jmltoolkit - jmlparser-symbol-solver-core - ${project.version} - - - - io.github.jmltoolkit - jmlparser-jml-tools - ${project.version} - - - - io.ktor - ktor-server-core - ${ktor.version} - - - io.ktor - ktor-server-netty - ${ktor.version} - - - ch.qos.logback - logback-classic - ${logback_version} - - - - org.jetbrains.kotlin - kotlin-test-junit - 1.6.21 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - ${kotlin.version} - - - org.jetbrains.kotlin - kotlin-test-junit - ${kotlin.version} - test - - - - io.ktor - ktor-html-builder - ${ktor.version} - - - - - - - sonatype - https://oss.sonatype.org/content/repositories/snapshots - - - kotlinx-html - kotlinx-html - https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven - - - mavenCentral - https://repo1.maven.org/maven2/ - - - - - src/main/kotlin - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - compile - - compile - - - - test-compile - test-compile - - test-compile - - - - - ${java.version} - - - - org.apache.maven.plugins - maven-shade-plugin - 3.3.0 - - - package - - shade - - - - - MainKt - - - - - - - - - diff --git a/jmlparser-web/src/main/kotlin/main.kt b/jmlparser-web/src/main/kotlin/main.kt deleted file mode 100644 index ab8c844042..0000000000 --- a/jmlparser-web/src/main/kotlin/main.kt +++ /dev/null @@ -1,355 +0,0 @@ -import com.github.javaparser.JavaParser -import com.github.javaparser.JavaParserBuild -import com.github.javaparser.ParserConfiguration -import com.github.javaparser.Problem -import com.github.javaparser.ast.Jmlish -import com.github.javaparser.ast.Node -import com.github.javaparser.metamodel.NodeMetaModel -import com.github.javaparser.metamodel.PropertyMetaModel -import com.github.javaparser.printer.DefaultPrettyPrinter -import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration -import io.ktor.application.* -import io.ktor.features.* -import io.ktor.html.* -import io.ktor.http.* -import io.ktor.http.content.* -import io.ktor.request.* -import io.ktor.routing.* -import io.ktor.server.engine.* -import io.ktor.server.netty.* -import io.ktor.util.pipeline.* -import kotlinx.html.* -import java.io.StringReader -import java.util.* -import java.util.stream.Collectors - -const val version = "${JavaParserBuild.PROJECT_VERSION} (${JavaParserBuild.MAVEN_BUILD_TIMESTAMP})" - -fun main() { - embeddedServer(Netty, port = 8000, watchPaths = listOf("classes", "resources")) { - install(StatusPages) - routing { - get("/") { renderPage() } - post("parse") { - val params = call.receiveParameters() - renderPage(params) - } - - static("assets") { - resources("assets") - } - } - }.start(wait = true) -} - -private suspend fun PipelineContext.renderPage(params: Parameters? = null) { - val inputText = params?.get("input") - val keyKey = params?.get("keyKey") - val keyOpenJml = params?.get("keyOpenJml") - val keyESC = params?.get("keyESC") - val keyRAC = params?.get("keyRAC") - val doNotProcessJml = params?.get("doNotProcessJml") != null - - call.respondHtmlTemplate(DefaultPage()) { - body { - div("form-group") { - form(action = "/parse", method = FormMethod.post) { - div { - spectreCheckBox(name = "doNotProcessJml") { +"Do not process JML" } - span { +" Active keys: " } - spectreCheckBox(name = "keyKey") { +"KEY" } - spectreCheckBox(name = "keyOpenJml") { +"OpenJml" } - spectreCheckBox(name = "keyESC") { +"ESC" } - spectreCheckBox(name = "keyRAC") { +"RAC" } - submitInput(classes = "btn btn-primary") { } - } - textArea { - name = "input" - id = "input" - rows = "100" - cols = "120" - if (inputText != null) { - +inputText - } else { - +""" - public class JmlTest { - /*@ - requires true; - ensures true; - assignable \strictly_nothing; - */ - public void foo() { - - } - } - """.trimIndent() - } - } - } - } - } - right { - if (inputText != null) { - val config = ParserConfiguration() - - config.isProcessJml = !doNotProcessJml - - if (keyKey != null) { - config.jmlKeys.add(arrayListOf("key")) - } - if (keyESC != null) { - config.jmlKeys.add(arrayListOf("openjml")) - } - if (keyOpenJml != null) { - config.jmlKeys.add(arrayListOf("ESC")) - } - if (keyRAC != null) { - config.jmlKeys.add(arrayListOf("RAC")) - } - - val jpb = JavaParser(config) - - val startTime = System.nanoTime() - val result = jpb.parse(StringReader(inputText)) - val stopTime = System.nanoTime() - val durationNano = stopTime - startTime - - - - accordion("Processing Information") { - ul { - li { +"Activated keys: ${config.jmlKeys}" } - li { +"Parsing took: ${durationNano / 1000.0 / 1000.0} ms " } - li { if (result.isSuccessful) +"Parsing was successful" else +"Parsing has errors" } - } - } - - accordion("Parse Issues (${result.problems.size})", isOpen = result.problems.isNotEmpty()) { - if (!result.isSuccessful) { - code { - pre { - result.problems.forEach { - +it.toString() - } - } - } - } else { - +"No issues detected" - } - } - - val problems = Collections.emptyList() - /*if (result.isSuccessful) - //JmlLintingFacade.lint(JmlLintingConfig(), Collections.singleton(result.result.get())) - else - Collections.emptyList()*/ - - accordion("Linting Issues (${problems.size})", isOpen = problems.isNotEmpty()) { - if (result.isSuccessful) { - code { - pre { - problems.forEach { - +it.toString() - } - } - } - } else { - +"Linting issues skipped due to parsing errors." - } - } - - result.result.ifPresent { - val c = DefaultPrinterConfiguration() - val v = DefaultPrettyPrinter(c) - val pp = v.print(it) - accordion("Pretty Printed") { - code { pre { +pp } } - } - } - - accordion("AST", isOpen = true) { - val cu = result.result.get() - ul("ast") { - this.printNode(cu, "[0]") - } - } - - /*accordion("Original sources") { - textArea { - name = "input" - id = "input" - rows = "100" - cols = "120" - +inputText - } - //code { pre { +inputText } } - }*/ - } - } - } -} - - -@HtmlTagMarker -inline fun FlowContent.accordion( - title: String = "", icon: String = "", isOpen: Boolean = false, - crossinline block: DIV.() -> Unit -) { - details("accordion") { - open = isOpen - summary("accordion-header") { - i(classes = "icon icon-arrow-right mr-1 " + icon) {} - +title - } - div("accordion-body") { - block(this) - } - } -} - -@HtmlTagMarker -inline fun FlowOrInteractiveOrPhrasingContent.spectreCheckBox( - name: String? = null, label: String = "", crossinline block: INPUT.() -> Unit -) { - label("form-checkbox d-inline-block") { - input(type = InputType.checkBox, name = name) { block(this) } - i("form-icon") { +label } - } -} - - -open class DefaultPage : Template { - val body = Placeholder() - val right = Placeholder() - val top = Placeholder() - - override fun HTML.apply() { - head { - title("JmlParser -- Playground") - - styleLink("/assets/spectre.min.css") - //styleLink("/assets/spectre-exp.min.css") - styleLink("/assets/spectre-icons.min.css") - styleLink("/assets/style.css") - - script { src = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.js" } - script { src = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.0/mode/clike/clike.min.js" } - - link { - rel = "stylesheet" - href = "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.css" - } - } - - body { - div("content") - h1 { - +"JmlParser — Playground" - span("version label label-rounded label-secondary") { - +version - } - } - - div("inner") { - div("container") { - div("column col-12") { insert(top) } - } - div("container") { - div("columns") { - div("column col-5") { insert(body) } - div("divider-vert") { /*attributes["data-content"] = "|"*/ } - div("column col-5") { insert(right) } - } - - } - - } - script { - unsafe { - +""" - var editor = CodeMirror.fromTextArea(document.getElementById('input'), - { lineNumbers: true, mode: "text/x-java", matchBrackets: true }); - editor.setSize("100%", "90%"); - function select(l1, c1, l2, c2) { - editor.doc.setSelection({'line':l1-1, 'ch':c1-1}, {'line':l2-1, 'ch':c2}, {'scroll': true}); - } - """ - } - } - } - } -} - -private fun UL.printNode(n: Node, text: String = "") { - val isJml = n is Jmlish - val clazz = if (isJml) "jmlish" else "" - - li(clazz) { - span("attrib-name") { +text } - +": " - span("type-name") { +n.metaModel.typeName } - - n.range.ifPresent { - span("range label") { - a { - val l1 = it.begin.line - val c1 = it.begin.column - val l2 = it.end.line - val c2 = it.end.column - onClick = "javascript:select($l1,$c1, $l2, $c2);" - +"${l1}/${c1} - ${l2}/${c2}" - } - } - } - - ul { - val metaModel: NodeMetaModel = n.metaModel - val allPropertyMetaModels = metaModel.allPropertyMetaModels - val attributes = allPropertyMetaModels.stream().filter { obj: PropertyMetaModel -> obj.isAttribute } - .filter { obj: PropertyMetaModel -> obj.isSingular } - .collect(Collectors.toList()) - val subNodes = allPropertyMetaModels.stream().filter { obj: PropertyMetaModel -> obj.isNode } - .filter { obj: PropertyMetaModel -> obj.isSingular } - .collect(Collectors.toList()) - val subLists = allPropertyMetaModels.stream().filter { obj: PropertyMetaModel -> obj.isNodeList } - .collect(Collectors.toList()) - - for (attributeMetaModel in attributes) { - li { - span("attrib-name") { +attributeMetaModel.name } - +": " - span("type-name") { +attributeMetaModel.typeName } - +" = " - span("value") { - attributeMetaModel.getValue(n)?.let { +it.toString() } ?: +"value is null" - } - } - } - - for (subNodeMetaModel in subNodes) { - val value = subNodeMetaModel.getValue(n) as Node? - if (value != null) { - printNode(value, subNodeMetaModel.name) - } - } - - for (subListMetaModel in subLists) { - val subList = subListMetaModel.getValue(n) as com.github.javaparser.ast.NodeList - if (!subList.isEmpty()) { - val listName = subListMetaModel.name - li { - span("attrib-name") { +listName } - +": " - span("type-name") { +subListMetaModel.typeName } - ul { - subList.forEachIndexed { idx, it -> - printNode(it, "[$idx]") - } - } - } - - } - } - } - } -} diff --git a/jmlparser-web/src/main/resources/assets/spectre-exp.min.css b/jmlparser-web/src/main/resources/assets/spectre-exp.min.css deleted file mode 100644 index d3137743a6..0000000000 --- a/jmlparser-web/src/main/resources/assets/spectre-exp.min.css +++ /dev/null @@ -1 +0,0 @@ -/*! Spectre.css Experimentals v0.5.9 | MIT License | github.com/picturepan2/spectre */.form-autocomplete{position:relative}.form-autocomplete .form-autocomplete-input{align-content:flex-start;display:-ms-flexbox;display:flex;-ms-flex-line-pack:start;-ms-flex-wrap:wrap;flex-wrap:wrap;height:auto;min-height:1.6rem;padding:.1rem}.form-autocomplete .form-autocomplete-input.is-focused{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-autocomplete .form-autocomplete-input .form-input{border-color:transparent;box-shadow:none;display:inline-block;-ms-flex:1 0 auto;flex:1 0 auto;height:1.2rem;line-height:.8rem;margin:.1rem;width:auto}.form-autocomplete .menu{left:0;position:absolute;top:100%;width:100%}.form-autocomplete.autocomplete-oneline .form-autocomplete-input{-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto}.form-autocomplete.autocomplete-oneline .chip{-ms-flex:1 0 auto;flex:1 0 auto}.calendar{border:.05rem solid #dadee4;border-radius:.1rem;display:block;min-width:280px}.calendar .calendar-nav{align-items:center;background:#f7f8f9;border-top-left-radius:.1rem;border-top-right-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-align:center;font-size:.9rem;padding:.4rem}.calendar .calendar-body,.calendar .calendar-header{display:-ms-flexbox;display:flex;-ms-flex-pack:center;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:center;padding:.4rem 0}.calendar .calendar-body .calendar-date,.calendar .calendar-header .calendar-date{-ms-flex:0 0 14.28%;flex:0 0 14.28%;max-width:14.28%}.calendar .calendar-header{background:#f7f8f9;border-bottom:.05rem solid #dadee4;color:#bcc3ce;font-size:.7rem;text-align:center}.calendar .calendar-body{color:#66758c}.calendar .calendar-date{border:0;padding:.2rem}.calendar .calendar-date .date-item{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:.05rem solid transparent;border-radius:50%;color:#66758c;cursor:pointer;font-size:.7rem;height:1.4rem;line-height:1rem;outline:0;padding:.1rem;position:relative;text-align:center;text-decoration:none;transition:background .2s,border .2s,box-shadow .2s,color .2s;vertical-align:middle;white-space:nowrap;width:1.4rem}.calendar .calendar-date .date-item.date-today{border-color:#e5e5f9;color:#5755d9}.calendar .calendar-date .date-item:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.calendar .calendar-date .date-item:focus,.calendar .calendar-date .date-item:hover{background:#fefeff;border-color:#e5e5f9;color:#5755d9;text-decoration:none}.calendar .calendar-date .date-item.active,.calendar .calendar-date .date-item:active{background:#4b48d6;border-color:#3634d2;color:#fff}.calendar .calendar-date .date-item.badge::after{position:absolute;right:3px;top:3px;transform:translate(50%,-50%)}.calendar .calendar-date .calendar-event.disabled,.calendar .calendar-date .calendar-event:disabled,.calendar .calendar-date .date-item.disabled,.calendar .calendar-date .date-item:disabled{cursor:default;opacity:.25;pointer-events:none}.calendar .calendar-date.next-month .calendar-event,.calendar .calendar-date.next-month .date-item,.calendar .calendar-date.prev-month .calendar-event,.calendar .calendar-date.prev-month .date-item{opacity:.25}.calendar .calendar-range{position:relative}.calendar .calendar-range::before{background:#f1f1fc;content:"";height:1.4rem;left:0;position:absolute;right:0;top:50%;transform:translateY(-50%)}.calendar .calendar-range.range-start::before{left:50%}.calendar .calendar-range.range-end::before{right:50%}.calendar .calendar-range.range-end .date-item,.calendar .calendar-range.range-start .date-item{background:#4b48d6;border-color:#3634d2;color:#fff}.calendar .calendar-range .date-item{color:#5755d9}.calendar.calendar-lg .calendar-body{padding:0}.calendar.calendar-lg .calendar-body .calendar-date{border-bottom:.05rem solid #dadee4;border-right:.05rem solid #dadee4;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:5.5rem;padding:0}.calendar.calendar-lg .calendar-body .calendar-date:nth-child(7n){border-right:0}.calendar.calendar-lg .calendar-body .calendar-date:nth-last-child(-n+7){border-bottom:0}.calendar.calendar-lg .date-item{align-self:flex-end;-ms-flex-item-align:end;height:1.4rem;margin-right:.2rem;margin-top:.2rem}.calendar.calendar-lg .calendar-range::before{top:19px}.calendar.calendar-lg .calendar-range.range-start::before{left:auto;width:19px}.calendar.calendar-lg .calendar-range.range-end::before{right:19px}.calendar.calendar-lg .calendar-events{flex-grow:1;-ms-flex-positive:1;line-height:1;overflow-y:auto;padding:.2rem}.calendar.calendar-lg .calendar-event{border-radius:.1rem;display:block;font-size:.7rem;margin:.1rem auto;overflow:hidden;padding:3px 4px;text-overflow:ellipsis;white-space:nowrap}.carousel .carousel-locator:nth-of-type(1):checked~.carousel-container .carousel-item:nth-of-type(1),.carousel .carousel-locator:nth-of-type(2):checked~.carousel-container .carousel-item:nth-of-type(2),.carousel .carousel-locator:nth-of-type(3):checked~.carousel-container .carousel-item:nth-of-type(3),.carousel .carousel-locator:nth-of-type(4):checked~.carousel-container .carousel-item:nth-of-type(4),.carousel .carousel-locator:nth-of-type(5):checked~.carousel-container .carousel-item:nth-of-type(5),.carousel .carousel-locator:nth-of-type(6):checked~.carousel-container .carousel-item:nth-of-type(6),.carousel .carousel-locator:nth-of-type(7):checked~.carousel-container .carousel-item:nth-of-type(7),.carousel .carousel-locator:nth-of-type(8):checked~.carousel-container .carousel-item:nth-of-type(8){animation:carousel-slidein .75s ease-in-out 1;opacity:1;z-index:100}.carousel .carousel-locator:nth-of-type(1):checked~.carousel-nav .nav-item:nth-of-type(1),.carousel .carousel-locator:nth-of-type(2):checked~.carousel-nav .nav-item:nth-of-type(2),.carousel .carousel-locator:nth-of-type(3):checked~.carousel-nav .nav-item:nth-of-type(3),.carousel .carousel-locator:nth-of-type(4):checked~.carousel-nav .nav-item:nth-of-type(4),.carousel .carousel-locator:nth-of-type(5):checked~.carousel-nav .nav-item:nth-of-type(5),.carousel .carousel-locator:nth-of-type(6):checked~.carousel-nav .nav-item:nth-of-type(6),.carousel .carousel-locator:nth-of-type(7):checked~.carousel-nav .nav-item:nth-of-type(7),.carousel .carousel-locator:nth-of-type(8):checked~.carousel-nav .nav-item:nth-of-type(8){color:#f7f8f9}.carousel{background:#f7f8f9;display:block;overflow:hidden;-webkit-overflow-scrolling:touch;position:relative;width:100%;z-index:1}.carousel .carousel-container{height:100%;left:0;position:relative}.carousel .carousel-container::before{content:"";display:block;padding-bottom:56.25%}.carousel .carousel-container .carousel-item{animation:carousel-slideout 1s ease-in-out 1;height:100%;left:0;margin:0;opacity:0;position:absolute;top:0;width:100%}.carousel .carousel-container .carousel-item:hover .item-next,.carousel .carousel-container .carousel-item:hover .item-prev{opacity:1}.carousel .carousel-container .item-next,.carousel .carousel-container .item-prev{background:rgba(247,248,249,.25);border-color:rgba(247,248,249,.5);color:#f7f8f9;opacity:0;position:absolute;top:50%;transform:translateY(-50%);transition:all .4s;z-index:100}.carousel .carousel-container .item-prev{left:1rem}.carousel .carousel-container .item-next{right:1rem}.carousel .carousel-nav{bottom:.4rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:10rem;z-index:100}.carousel .carousel-nav .nav-item{color:rgba(247,248,249,.5);display:block;-ms-flex:1 0 auto;flex:1 0 auto;height:1.6rem;margin:.2rem;max-width:2.5rem;position:relative}.carousel .carousel-nav .nav-item::before{background:currentColor;content:"";display:block;height:.1rem;position:absolute;top:.5rem;width:100%}@keyframes carousel-slidein{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes carousel-slideout{0%{opacity:1;transform:translateX(0)}100%{opacity:1;transform:translateX(-50%)}}.comparison-slider{height:50vh;overflow:hidden;-webkit-overflow-scrolling:touch;position:relative;width:100%}.comparison-slider .comparison-after,.comparison-slider .comparison-before{height:100%;left:0;margin:0;overflow:hidden;position:absolute;top:0}.comparison-slider .comparison-after img,.comparison-slider .comparison-before img{height:100%;object-fit:cover;object-position:left center;position:absolute;width:100%}.comparison-slider .comparison-before{width:100%;z-index:1}.comparison-slider .comparison-before .comparison-label{right:.8rem}.comparison-slider .comparison-after{max-width:100%;min-width:0;z-index:2}.comparison-slider .comparison-after::before{background:0 0;content:"";cursor:default;height:100%;left:0;position:absolute;right:.8rem;top:0;z-index:1}.comparison-slider .comparison-after::after{background:currentColor;border-radius:50%;box-shadow:0 -5px,0 5px;color:#fff;content:"";height:3px;pointer-events:none;position:absolute;right:.4rem;top:50%;transform:translate(50%,-50%);width:3px}.comparison-slider .comparison-after .comparison-label{left:.8rem}.comparison-slider .comparison-resizer{animation:first-run 1.5s 1 ease-in-out;cursor:ew-resize;height:.8rem;left:0;max-width:100%;min-width:.8rem;opacity:0;outline:0;position:relative;resize:horizontal;top:50%;transform:translateY(-50%) scaleY(30);width:0}.comparison-slider .comparison-label{background:rgba(48,55,66,.5);bottom:.8rem;color:#fff;padding:.2rem .4rem;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@keyframes first-run{0%{width:0}25%{width:2.4rem}50%{width:.8rem}75%{width:1.2rem}100%{width:0}}.filter .filter-tag#tag-0:checked~.filter-nav .chip[for=tag-0],.filter .filter-tag#tag-1:checked~.filter-nav .chip[for=tag-1],.filter .filter-tag#tag-2:checked~.filter-nav .chip[for=tag-2],.filter .filter-tag#tag-3:checked~.filter-nav .chip[for=tag-3],.filter .filter-tag#tag-4:checked~.filter-nav .chip[for=tag-4],.filter .filter-tag#tag-5:checked~.filter-nav .chip[for=tag-5],.filter .filter-tag#tag-6:checked~.filter-nav .chip[for=tag-6],.filter .filter-tag#tag-7:checked~.filter-nav .chip[for=tag-7],.filter .filter-tag#tag-8:checked~.filter-nav .chip[for=tag-8]{background:#5755d9;color:#fff}.filter .filter-tag#tag-1:checked~.filter-body .filter-item:not([data-tag~=tag-1]),.filter .filter-tag#tag-2:checked~.filter-body .filter-item:not([data-tag~=tag-2]),.filter .filter-tag#tag-3:checked~.filter-body .filter-item:not([data-tag~=tag-3]),.filter .filter-tag#tag-4:checked~.filter-body .filter-item:not([data-tag~=tag-4]),.filter .filter-tag#tag-5:checked~.filter-body .filter-item:not([data-tag~=tag-5]),.filter .filter-tag#tag-6:checked~.filter-body .filter-item:not([data-tag~=tag-6]),.filter .filter-tag#tag-7:checked~.filter-body .filter-item:not([data-tag~=tag-7]),.filter .filter-tag#tag-8:checked~.filter-body .filter-item:not([data-tag~=tag-8]){display:none}.filter .filter-nav{margin:.4rem 0}.filter .filter-body{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.meter{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f7f8f9;border:0;border-radius:.1rem;display:block;height:.8rem;width:100%}.meter::-webkit-meter-inner-element{display:block}.meter::-webkit-meter-bar,.meter::-webkit-meter-even-less-good-value,.meter::-webkit-meter-optimum-value,.meter::-webkit-meter-suboptimum-value{border-radius:.1rem}.meter::-webkit-meter-bar{background:#f7f8f9}.meter::-webkit-meter-optimum-value{background:#32b643}.meter::-webkit-meter-suboptimum-value{background:#ffb700}.meter::-webkit-meter-even-less-good-value{background:#e85600}.meter:-moz-meter-optimum,.meter:-moz-meter-sub-optimum,.meter:-moz-meter-sub-sub-optimum,.meter::-moz-meter-bar{border-radius:.1rem}.meter:-moz-meter-optimum::-moz-meter-bar{background:#32b643}.meter:-moz-meter-sub-optimum::-moz-meter-bar{background:#ffb700}.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:#e85600}.off-canvas{display:-ms-flexbox;display:flex;-ms-flex-flow:nowrap;flex-flow:nowrap;height:100%;position:relative;width:100%}.off-canvas .off-canvas-toggle{display:block;left:.4rem;position:absolute;top:.4rem;transition:none;z-index:1}.off-canvas .off-canvas-sidebar{background:#f7f8f9;bottom:0;left:0;min-width:10rem;overflow-y:auto;position:fixed;top:0;transform:translateX(-100%);transition:transform .25s;z-index:200}.off-canvas .off-canvas-content{-ms-flex:1 1 auto;flex:1 1 auto;height:100%;padding:.4rem .4rem .4rem 4rem}.off-canvas .off-canvas-overlay{background:rgba(48,55,66,.1);border-color:transparent;border-radius:0;bottom:0;display:none;height:100%;left:0;position:fixed;right:0;top:0;width:100%}.off-canvas .off-canvas-sidebar.active,.off-canvas .off-canvas-sidebar:target{transform:translateX(0)}.off-canvas .off-canvas-sidebar.active~.off-canvas-overlay,.off-canvas .off-canvas-sidebar:target~.off-canvas-overlay{display:block;z-index:100}@media (min-width:960px){.off-canvas.off-canvas-sidebar-show .off-canvas-toggle{display:none}.off-canvas.off-canvas-sidebar-show .off-canvas-sidebar{-ms-flex:0 0 auto;flex:0 0 auto;position:relative;transform:none}.off-canvas.off-canvas-sidebar-show .off-canvas-overlay{display:none!important}}.parallax{display:block;height:auto;position:relative;width:auto}.parallax .parallax-content{box-shadow:0 1rem 2.1rem rgba(48,55,66,.3);height:auto;transform:perspective(1000px);transform-style:preserve-3d;transition:all .4s ease;width:100%}.parallax .parallax-content::before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.parallax .parallax-front{align-items:center;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;height:100%;justify-content:center;left:0;position:absolute;text-align:center;text-shadow:0 0 20px rgba(48,55,66,.75);top:0;transform:translateZ(50px) scale(.95);transition:transform .4s;width:100%;z-index:1}.parallax .parallax-top-left{height:50%;left:0;outline:0;position:absolute;top:0;width:50%;z-index:100}.parallax .parallax-top-left:focus~.parallax-content,.parallax .parallax-top-left:hover~.parallax-content{transform:perspective(1000px) rotateX(3deg) rotateY(-3deg)}.parallax .parallax-top-left:focus~.parallax-content::before,.parallax .parallax-top-left:hover~.parallax-content::before{background:linear-gradient(135deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-top-left:focus~.parallax-content .parallax-front,.parallax .parallax-top-left:hover~.parallax-content .parallax-front{transform:translate3d(4.5px,4.5px,50px) scale(.95)}.parallax .parallax-top-right{height:50%;outline:0;position:absolute;right:0;top:0;width:50%;z-index:100}.parallax .parallax-top-right:focus~.parallax-content,.parallax .parallax-top-right:hover~.parallax-content{transform:perspective(1000px) rotateX(3deg) rotateY(3deg)}.parallax .parallax-top-right:focus~.parallax-content::before,.parallax .parallax-top-right:hover~.parallax-content::before{background:linear-gradient(-135deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-top-right:focus~.parallax-content .parallax-front,.parallax .parallax-top-right:hover~.parallax-content .parallax-front{transform:translate3d(-4.5px,4.5px,50px) scale(.95)}.parallax .parallax-bottom-left{bottom:0;height:50%;left:0;outline:0;position:absolute;width:50%;z-index:100}.parallax .parallax-bottom-left:focus~.parallax-content,.parallax .parallax-bottom-left:hover~.parallax-content{transform:perspective(1000px) rotateX(-3deg) rotateY(-3deg)}.parallax .parallax-bottom-left:focus~.parallax-content::before,.parallax .parallax-bottom-left:hover~.parallax-content::before{background:linear-gradient(45deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-bottom-left:focus~.parallax-content .parallax-front,.parallax .parallax-bottom-left:hover~.parallax-content .parallax-front{transform:translate3d(4.5px,-4.5px,50px) scale(.95)}.parallax .parallax-bottom-right{bottom:0;height:50%;outline:0;position:absolute;right:0;width:50%;z-index:100}.parallax .parallax-bottom-right:focus~.parallax-content,.parallax .parallax-bottom-right:hover~.parallax-content{transform:perspective(1000px) rotateX(-3deg) rotateY(3deg)}.parallax .parallax-bottom-right:focus~.parallax-content::before,.parallax .parallax-bottom-right:hover~.parallax-content::before{background:linear-gradient(-45deg,rgba(255,255,255,.35) 0,transparent 50%)}.parallax .parallax-bottom-right:focus~.parallax-content .parallax-front,.parallax .parallax-bottom-right:hover~.parallax-content .parallax-front{transform:translate3d(-4.5px,-4.5px,50px) scale(.95)}.progress{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#eef0f3;border:0;border-radius:.1rem;color:#5755d9;height:.2rem;position:relative;width:100%}.progress::-webkit-progress-bar{background:0 0;border-radius:.1rem}.progress::-webkit-progress-value{background:#5755d9;border-radius:.1rem}.progress::-moz-progress-bar{background:#5755d9;border-radius:.1rem}.progress:indeterminate{animation:progress-indeterminate 1.5s linear infinite;background:#eef0f3 linear-gradient(to right,#5755d9 30%,#eef0f3 30%) top left/150% 150% no-repeat}.progress:indeterminate::-moz-progress-bar{background:0 0}@keyframes progress-indeterminate{0%{background-position:200% 0}100%{background-position:-200% 0}}.slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;display:block;height:1.2rem;width:100%}.slider:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2);outline:0}.slider.tooltip:not([data-tooltip])::after{content:attr(value)}.slider::-webkit-slider-thumb{-webkit-appearance:none;background:#5755d9;border:0;border-radius:50%;height:.6rem;margin-top:-.25rem;-webkit-transition:transform .2s;transition:transform .2s;width:.6rem}.slider::-moz-range-thumb{background:#5755d9;border:0;border-radius:50%;height:.6rem;-moz-transition:transform .2s;transition:transform .2s;width:.6rem}.slider::-ms-thumb{background:#5755d9;border:0;border-radius:50%;height:.6rem;-ms-transition:transform .2s;transition:transform .2s;width:.6rem}.slider:active::-webkit-slider-thumb{transform:scale(1.25)}.slider:active::-moz-range-thumb{transform:scale(1.25)}.slider:active::-ms-thumb{transform:scale(1.25)}.slider.disabled::-webkit-slider-thumb,.slider:disabled::-webkit-slider-thumb{background:#f7f8f9;transform:scale(1)}.slider.disabled::-moz-range-thumb,.slider:disabled::-moz-range-thumb{background:#f7f8f9;transform:scale(1)}.slider.disabled::-ms-thumb,.slider:disabled::-ms-thumb{background:#f7f8f9;transform:scale(1)}.slider::-webkit-slider-runnable-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-moz-range-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-ms-track{background:#eef0f3;border-radius:.1rem;height:.1rem;width:100%}.slider::-ms-fill-lower{background:#5755d9}.timeline .timeline-item{display:-ms-flexbox;display:flex;margin-bottom:1.2rem;position:relative}.timeline .timeline-item::before{background:#dadee4;content:"";height:100%;left:11px;position:absolute;top:1.2rem;width:2px}.timeline .timeline-item .timeline-left{-ms-flex:0 0 auto;flex:0 0 auto}.timeline .timeline-item .timeline-content{-ms-flex:1 1 auto;flex:1 1 auto;padding:2px 0 2px .8rem}.timeline .timeline-item .timeline-icon{align-items:center;border-radius:50%;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;height:1.2rem;justify-content:center;text-align:center;width:1.2rem}.timeline .timeline-item .timeline-icon::before{border:.1rem solid #5755d9;border-radius:50%;content:"";display:block;height:.4rem;left:.4rem;position:absolute;top:.4rem;width:.4rem}.timeline .timeline-item .timeline-icon.icon-lg{background:#5755d9;line-height:1.2rem}.timeline .timeline-item .timeline-icon.icon-lg::before{content:none}.viewer-360{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-direction:column;flex-direction:column}.viewer-360 .viewer-slider[max="36"][value="1"]+.viewer-image{background-position-y:0}.viewer-360 .viewer-slider[max="36"][value="2"]+.viewer-image{background-position-y:2.8571428571%}.viewer-360 .viewer-slider[max="36"][value="3"]+.viewer-image{background-position-y:5.7142857143%}.viewer-360 .viewer-slider[max="36"][value="4"]+.viewer-image{background-position-y:8.5714285714%}.viewer-360 .viewer-slider[max="36"][value="5"]+.viewer-image{background-position-y:11.4285714286%}.viewer-360 .viewer-slider[max="36"][value="6"]+.viewer-image{background-position-y:14.2857142857%}.viewer-360 .viewer-slider[max="36"][value="7"]+.viewer-image{background-position-y:17.1428571429%}.viewer-360 .viewer-slider[max="36"][value="8"]+.viewer-image{background-position-y:20%}.viewer-360 .viewer-slider[max="36"][value="9"]+.viewer-image{background-position-y:22.8571428571%}.viewer-360 .viewer-slider[max="36"][value="10"]+.viewer-image{background-position-y:25.7142857143%}.viewer-360 .viewer-slider[max="36"][value="11"]+.viewer-image{background-position-y:28.5714285714%}.viewer-360 .viewer-slider[max="36"][value="12"]+.viewer-image{background-position-y:31.4285714286%}.viewer-360 .viewer-slider[max="36"][value="13"]+.viewer-image{background-position-y:34.2857142857%}.viewer-360 .viewer-slider[max="36"][value="14"]+.viewer-image{background-position-y:37.1428571429%}.viewer-360 .viewer-slider[max="36"][value="15"]+.viewer-image{background-position-y:40%}.viewer-360 .viewer-slider[max="36"][value="16"]+.viewer-image{background-position-y:42.8571428571%}.viewer-360 .viewer-slider[max="36"][value="17"]+.viewer-image{background-position-y:45.7142857143%}.viewer-360 .viewer-slider[max="36"][value="18"]+.viewer-image{background-position-y:48.5714285714%}.viewer-360 .viewer-slider[max="36"][value="19"]+.viewer-image{background-position-y:51.4285714286%}.viewer-360 .viewer-slider[max="36"][value="20"]+.viewer-image{background-position-y:54.2857142857%}.viewer-360 .viewer-slider[max="36"][value="21"]+.viewer-image{background-position-y:57.1428571429%}.viewer-360 .viewer-slider[max="36"][value="22"]+.viewer-image{background-position-y:60%}.viewer-360 .viewer-slider[max="36"][value="23"]+.viewer-image{background-position-y:62.8571428571%}.viewer-360 .viewer-slider[max="36"][value="24"]+.viewer-image{background-position-y:65.7142857143%}.viewer-360 .viewer-slider[max="36"][value="25"]+.viewer-image{background-position-y:68.5714285714%}.viewer-360 .viewer-slider[max="36"][value="26"]+.viewer-image{background-position-y:71.4285714286%}.viewer-360 .viewer-slider[max="36"][value="27"]+.viewer-image{background-position-y:74.2857142857%}.viewer-360 .viewer-slider[max="36"][value="28"]+.viewer-image{background-position-y:77.1428571429%}.viewer-360 .viewer-slider[max="36"][value="29"]+.viewer-image{background-position-y:80%}.viewer-360 .viewer-slider[max="36"][value="30"]+.viewer-image{background-position-y:82.8571428571%}.viewer-360 .viewer-slider[max="36"][value="31"]+.viewer-image{background-position-y:85.7142857143%}.viewer-360 .viewer-slider[max="36"][value="32"]+.viewer-image{background-position-y:88.5714285714%}.viewer-360 .viewer-slider[max="36"][value="33"]+.viewer-image{background-position-y:91.4285714286%}.viewer-360 .viewer-slider[max="36"][value="34"]+.viewer-image{background-position-y:94.2857142857%}.viewer-360 .viewer-slider[max="36"][value="35"]+.viewer-image{background-position-y:97.1428571429%}.viewer-360 .viewer-slider[max="36"][value="36"]+.viewer-image{background-position-y:100%}.viewer-360 .viewer-slider{cursor:ew-resize;-ms-flex-order:2;margin:1rem;order:2;width:60%}.viewer-360 .viewer-image{background-position-y:0;background-repeat:no-repeat;background-size:100%;-ms-flex-order:1;max-width:100%;order:1} \ No newline at end of file diff --git a/jmlparser-web/src/main/resources/assets/spectre-icons.min.css b/jmlparser-web/src/main/resources/assets/spectre-icons.min.css deleted file mode 100644 index 0276f7b848..0000000000 --- a/jmlparser-web/src/main/resources/assets/spectre-icons.min.css +++ /dev/null @@ -1 +0,0 @@ -/*! Spectre.css Icons v0.5.9 | MIT License | github.com/picturepan2/spectre */.icon{box-sizing:border-box;display:inline-block;font-size:inherit;font-style:normal;height:1em;position:relative;text-indent:-9999px;vertical-align:middle;width:1em}.icon::after,.icon::before{content:"";display:block;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.icon.icon-2x{font-size:1.6rem}.icon.icon-3x{font-size:2.4rem}.icon.icon-4x{font-size:3.2rem}.accordion .icon,.btn .icon,.menu .icon,.toast .icon{vertical-align:-10%}.btn-lg .icon{vertical-align:-15%}.icon-arrow-down::before,.icon-arrow-left::before,.icon-arrow-right::before,.icon-arrow-up::before,.icon-back::before,.icon-downward::before,.icon-forward::before,.icon-upward::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.65em;width:.65em}.icon-arrow-down::before{transform:translate(-50%,-75%) rotate(225deg)}.icon-arrow-left::before{transform:translate(-25%,-50%) rotate(-45deg)}.icon-arrow-right::before{transform:translate(-75%,-50%) rotate(135deg)}.icon-arrow-up::before{transform:translate(-50%,-25%) rotate(45deg)}.icon-back::after,.icon-forward::after{background:currentColor;height:.1rem;width:.8em}.icon-downward::after,.icon-upward::after{background:currentColor;height:.8em;width:.1rem}.icon-back::after{left:55%}.icon-back::before{transform:translate(-50%,-50%) rotate(-45deg)}.icon-downward::after{top:45%}.icon-downward::before{transform:translate(-50%,-50%) rotate(-135deg)}.icon-forward::after{left:45%}.icon-forward::before{transform:translate(-50%,-50%) rotate(135deg)}.icon-upward::after{top:55%}.icon-upward::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-caret::before{border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid currentColor;height:0;transform:translate(-50%,-25%);width:0}.icon-menu::before{background:currentColor;box-shadow:0 -.35em,0 .35em;height:.1rem;width:100%}.icon-apps::before{background:currentColor;box-shadow:-.35em -.35em,-.35em 0,-.35em .35em,0 -.35em,0 .35em,.35em -.35em,.35em 0,.35em .35em;height:3px;width:3px}.icon-resize-horiz::after,.icon-resize-horiz::before,.icon-resize-vert::after,.icon-resize-vert::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.45em;width:.45em}.icon-resize-horiz::before,.icon-resize-vert::before{transform:translate(-50%,-90%) rotate(45deg)}.icon-resize-horiz::after,.icon-resize-vert::after{transform:translate(-50%,-10%) rotate(225deg)}.icon-resize-horiz::before{transform:translate(-90%,-50%) rotate(-45deg)}.icon-resize-horiz::after{transform:translate(-10%,-50%) rotate(135deg)}.icon-more-horiz::before,.icon-more-vert::before{background:currentColor;border-radius:50%;box-shadow:-.4em 0,.4em 0;height:3px;width:3px}.icon-more-vert::before{box-shadow:0 -.4em,0 .4em}.icon-cross::before,.icon-minus::before,.icon-plus::before{background:currentColor;height:.1rem;width:100%}.icon-cross::after,.icon-plus::after{background:currentColor;height:100%;width:.1rem}.icon-cross::before{width:100%}.icon-cross::after{height:100%}.icon-cross::after,.icon-cross::before{transform:translate(-50%,-50%) rotate(45deg)}.icon-check::before{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-75%) rotate(-45deg);width:.9em}.icon-stop{border:.1rem solid currentColor;border-radius:50%}.icon-stop::before{background:currentColor;height:.1rem;transform:translate(-50%,-50%) rotate(45deg);width:1em}.icon-shutdown{border:.1rem solid currentColor;border-radius:50%;border-top-color:transparent}.icon-shutdown::before{background:currentColor;content:"";height:.5em;top:.1em;width:.1rem}.icon-refresh::before{border:.1rem solid currentColor;border-radius:50%;border-right-color:transparent;height:1em;width:1em}.icon-refresh::after{border:.2em solid currentColor;border-left-color:transparent;border-top-color:transparent;height:0;left:80%;top:20%;width:0}.icon-search::before{border:.1rem solid currentColor;border-radius:50%;height:.75em;left:5%;top:5%;transform:translate(0,0) rotate(45deg);width:.75em}.icon-search::after{background:currentColor;height:.1rem;left:80%;top:80%;transform:translate(-50%,-50%) rotate(45deg);width:.4em}.icon-edit::before{border:.1rem solid currentColor;height:.4em;transform:translate(-40%,-60%) rotate(-45deg);width:.85em}.icon-edit::after{border:.15em solid currentColor;border-right-color:transparent;border-top-color:transparent;height:0;left:5%;top:95%;transform:translate(0,-100%);width:0}.icon-delete::before{border:.1rem solid currentColor;border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem;border-top:0;height:.75em;top:60%;width:.75em}.icon-delete::after{background:currentColor;box-shadow:-.25em .2em,.25em .2em;height:.1rem;top:.05rem;width:.5em}.icon-share{border:.1rem solid currentColor;border-radius:.1rem;border-right:0;border-top:0}.icon-share::before{border:.1rem solid currentColor;border-left:0;border-top:0;height:.4em;left:100%;top:.25em;transform:translate(-125%,-50%) rotate(-45deg);width:.4em}.icon-share::after{border:.1rem solid currentColor;border-bottom:0;border-radius:75% 0;border-right:0;height:.5em;width:.6em}.icon-flag::before{background:currentColor;height:1em;left:15%;width:.1rem}.icon-flag::after{border:.1rem solid currentColor;border-bottom-right-radius:.1rem;border-left:0;border-top-right-radius:.1rem;height:.65em;left:60%;top:35%;width:.8em}.icon-bookmark::before{border:.1rem solid currentColor;border-bottom:0;border-top-left-radius:.1rem;border-top-right-radius:.1rem;height:.9em;width:.8em}.icon-bookmark::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;border-radius:.1rem;height:.5em;transform:translate(-50%,35%) rotate(-45deg) skew(15deg,15deg);width:.5em}.icon-download,.icon-upload{border-bottom:.1rem solid currentColor}.icon-download::before,.icon-upload::before{border:.1rem solid currentColor;border-bottom:0;border-right:0;height:.5em;transform:translate(-50%,-60%) rotate(-135deg);width:.5em}.icon-download::after,.icon-upload::after{background:currentColor;height:.6em;top:40%;width:.1rem}.icon-upload::before{transform:translate(-50%,-60%) rotate(45deg)}.icon-upload::after{top:50%}.icon-copy::before{border:.1rem solid currentColor;border-bottom:0;border-radius:.1rem;border-right:0;height:.8em;left:40%;top:35%;width:.8em}.icon-copy::after{border:.1rem solid currentColor;border-radius:.1rem;height:.8em;left:60%;top:60%;width:.8em}.icon-time{border:.1rem solid currentColor;border-radius:50%}.icon-time::before{background:currentColor;height:.4em;transform:translate(-50%,-75%);width:.1rem}.icon-time::after{background:currentColor;height:.3em;transform:translate(-50%,-75%) rotate(90deg);transform-origin:50% 90%;width:.1rem}.icon-mail::before{border:.1rem solid currentColor;border-radius:.1rem;height:.8em;width:1em}.icon-mail::after{border:.1rem solid currentColor;border-right:0;border-top:0;height:.5em;transform:translate(-50%,-90%) rotate(-45deg) skew(10deg,10deg);width:.5em}.icon-people::before{border:.1rem solid currentColor;border-radius:50%;height:.45em;top:25%;width:.45em}.icon-people::after{border:.1rem solid currentColor;border-radius:50% 50% 0 0;height:.4em;top:75%;width:.9em}.icon-message{border:.1rem solid currentColor;border-bottom:0;border-radius:.1rem;border-right:0}.icon-message::before{border:.1rem solid currentColor;border-bottom-right-radius:.1rem;border-left:0;border-top:0;height:.8em;left:65%;top:40%;width:.7em}.icon-message::after{background:currentColor;border-radius:.1rem;height:.3em;left:10%;top:100%;transform:translate(0,-90%) rotate(45deg);width:.1rem}.icon-photo{border:.1rem solid currentColor;border-radius:.1rem}.icon-photo::before{border:.1rem solid currentColor;border-radius:50%;height:.25em;left:35%;top:35%;width:.25em}.icon-photo::after{border:.1rem solid currentColor;border-bottom:0;border-left:0;height:.5em;left:60%;transform:translate(-50%,25%) rotate(-45deg);width:.5em}.icon-link::after,.icon-link::before{border:.1rem solid currentColor;border-radius:5em 0 0 5em;border-right:0;height:.5em;width:.75em}.icon-link::before{transform:translate(-70%,-45%) rotate(-45deg)}.icon-link::after{transform:translate(-30%,-55%) rotate(135deg)}.icon-location::before{border:.1rem solid currentColor;border-radius:50% 50% 50% 0;height:.8em;transform:translate(-50%,-60%) rotate(-45deg);width:.8em}.icon-location::after{border:.1rem solid currentColor;border-radius:50%;height:.2em;transform:translate(-50%,-80%);width:.2em}.icon-emoji{border:.1rem solid currentColor;border-radius:50%}.icon-emoji::before{border-radius:50%;box-shadow:-.17em -.1em,.17em -.1em;height:.15em;width:.15em}.icon-emoji::after{border:.1rem solid currentColor;border-bottom-color:transparent;border-radius:50%;border-right-color:transparent;height:.5em;transform:translate(-50%,-40%) rotate(-135deg);width:.5em} \ No newline at end of file diff --git a/jmlparser-web/src/main/resources/assets/spectre.min.css b/jmlparser-web/src/main/resources/assets/spectre.min.css deleted file mode 100644 index 0fe23d9c09..0000000000 --- a/jmlparser-web/src/main/resources/assets/spectre.min.css +++ /dev/null @@ -1 +0,0 @@ -/*! Spectre.css v0.5.9 | MIT License | github.com/picturepan2/spectre */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}address{font-style:normal}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:"SF Mono","Segoe UI Mono","Roboto Mono",Menlo,Courier,monospace;font-size:1em}dfn{font-style:italic}small{font-size:80%;font-weight:400}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}fieldset{border:0;margin:0;padding:0}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item;outline:0}canvas{display:inline-block}template{display:none}[hidden]{display:none}*,::after,::before{box-sizing:inherit}html{box-sizing:border-box;font-size:20px;line-height:1.5;-webkit-tap-highlight-color:transparent}body{background:#fff;color:#3b4351;font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-size:.8rem;overflow-x:hidden;text-rendering:optimizeLegibility}a{color:#5755d9;outline:0;text-decoration:none}a:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}a.active,a:active,a:focus,a:hover{color:#302ecd;text-decoration:underline}a:visited{color:#807fe2}h1,h2,h3,h4,h5,h6{color:inherit;font-weight:500;line-height:1.2;margin-bottom:.5em;margin-top:0}.h1,.h2,.h3,.h4,.h5,.h6{font-weight:500}.h1,h1{font-size:2rem}.h2,h2{font-size:1.6rem}.h3,h3{font-size:1.4rem}.h4,h4{font-size:1.2rem}.h5,h5{font-size:1rem}.h6,h6{font-size:.8rem}p{margin:0 0 1.2rem}a,ins,u{-webkit-text-decoration-skip:ink edges;text-decoration-skip:ink edges}abbr[title]{border-bottom:.05rem dotted;cursor:help;text-decoration:none}kbd{background:#303742;border-radius:.1rem;color:#fff;font-size:.7rem;line-height:1.25;padding:.1rem .2rem}mark{background:#ffe9b3;border-bottom:.05rem solid #ffd367;border-radius:.1rem;color:#3b4351;padding:.05rem .1rem 0}blockquote{border-left:.1rem solid #dadee4;margin-left:0;padding:.4rem .8rem}blockquote p:last-child{margin-bottom:0}ol,ul{margin:.8rem 0 .8rem .8rem;padding:0}ol ol,ol ul,ul ol,ul ul{margin:.8rem 0 .8rem .8rem}ol li,ul li{margin-top:.4rem}ul{list-style:disc inside}ul ul{list-style-type:circle}ol{list-style:decimal inside}ol ol{list-style-type:lower-alpha}dl dt{font-weight:700}dl dd{margin:.4rem 0 .8rem 0}.lang-zh,.lang-zh-hans,html:lang(zh),html:lang(zh-Hans){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",sans-serif}.lang-zh-hant,html:lang(zh-Hant){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang TC","Hiragino Sans CNS","Microsoft JhengHei","Helvetica Neue",sans-serif}.lang-ja,html:lang(ja){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Hiragino Sans","Hiragino Kaku Gothic Pro","Yu Gothic",YuGothic,Meiryo,"Helvetica Neue",sans-serif}.lang-ko,html:lang(ko){font-family:-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Malgun Gothic","Helvetica Neue",sans-serif}.lang-cjk ins,.lang-cjk u,:lang(ja) ins,:lang(ja) u,:lang(zh) ins,:lang(zh) u{border-bottom:.05rem solid;text-decoration:none}.lang-cjk del+del,.lang-cjk del+s,.lang-cjk ins+ins,.lang-cjk ins+u,.lang-cjk s+del,.lang-cjk s+s,.lang-cjk u+ins,.lang-cjk u+u,:lang(ja) del+del,:lang(ja) del+s,:lang(ja) ins+ins,:lang(ja) ins+u,:lang(ja) s+del,:lang(ja) s+s,:lang(ja) u+ins,:lang(ja) u+u,:lang(zh) del+del,:lang(zh) del+s,:lang(zh) ins+ins,:lang(zh) ins+u,:lang(zh) s+del,:lang(zh) s+s,:lang(zh) u+ins,:lang(zh) u+u{margin-left:.125em}.table{border-collapse:collapse;border-spacing:0;text-align:left;width:100%}.table.table-striped tbody tr:nth-of-type(odd){background:#f7f8f9}.table tbody tr.active,.table.table-striped tbody tr.active{background:#eef0f3}.table.table-hover tbody tr:hover{background:#eef0f3}.table.table-scroll{display:block;overflow-x:auto;padding-bottom:.75rem;white-space:nowrap}.table td,.table th{border-bottom:.05rem solid #dadee4;padding:.6rem .4rem}.table th{border-bottom-width:.1rem}.btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:.05rem solid #5755d9;border-radius:.1rem;color:#5755d9;cursor:pointer;display:inline-block;font-size:.8rem;height:1.8rem;line-height:1.2rem;outline:0;padding:.25rem .4rem;text-align:center;text-decoration:none;transition:background .2s,border .2s,box-shadow .2s,color .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.btn:focus{box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.btn:focus,.btn:hover{background:#f1f1fc;border-color:#4b48d6;text-decoration:none}.btn.active,.btn:active{background:#4b48d6;border-color:#3634d2;color:#fff;text-decoration:none}.btn.active.loading::after,.btn:active.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.disabled,.btn:disabled,.btn[disabled]{cursor:default;opacity:.5;pointer-events:none}.btn.btn-primary{background:#5755d9;border-color:#4b48d6;color:#fff}.btn.btn-primary:focus,.btn.btn-primary:hover{background:#4240d4;border-color:#3634d2;color:#fff}.btn.btn-primary.active,.btn.btn-primary:active{background:#3a38d2;border-color:#302ecd;color:#fff}.btn.btn-primary.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-success{background:#32b643;border-color:#2faa3f;color:#fff}.btn.btn-success:focus{box-shadow:0 0 0 .1rem rgba(50,182,67,.2)}.btn.btn-success:focus,.btn.btn-success:hover{background:#30ae40;border-color:#2da23c;color:#fff}.btn.btn-success.active,.btn.btn-success:active{background:#2a9a39;border-color:#278e34;color:#fff}.btn.btn-success.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-error{background:#e85600;border-color:#d95000;color:#fff}.btn.btn-error:focus{box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.btn.btn-error:focus,.btn.btn-error:hover{background:#de5200;border-color:#cf4d00;color:#fff}.btn.btn-error.active,.btn.btn-error:active{background:#c44900;border-color:#b54300;color:#fff}.btn.btn-error.loading::after{border-bottom-color:#fff;border-left-color:#fff}.btn.btn-link{background:0 0;border-color:transparent;color:#5755d9}.btn.btn-link.active,.btn.btn-link:active,.btn.btn-link:focus,.btn.btn-link:hover{color:#302ecd}.btn.btn-sm{font-size:.7rem;height:1.4rem;padding:.05rem .3rem}.btn.btn-lg{font-size:.9rem;height:2rem;padding:.35rem .6rem}.btn.btn-block{display:block;width:100%}.btn.btn-action{padding-left:0;padding-right:0;width:1.8rem}.btn.btn-action.btn-sm{width:1.4rem}.btn.btn-action.btn-lg{width:2rem}.btn.btn-clear{background:0 0;border:0;color:currentColor;height:1rem;line-height:.8rem;margin-left:.2rem;margin-right:-2px;opacity:1;padding:.1rem;text-decoration:none;width:1rem}.btn.btn-clear:focus,.btn.btn-clear:hover{background:rgba(247,248,249,.5);opacity:.95}.btn.btn-clear::before{content:"\2715"}.btn-group{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.btn-group .btn{-ms-flex:1 0 auto;flex:1 0 auto}.btn-group .btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group .btn:not(:first-child):not(:last-child){border-radius:0;margin-left:-.05rem}.btn-group .btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-.05rem}.btn-group .btn.active,.btn-group .btn:active,.btn-group .btn:focus,.btn-group .btn:hover{z-index:1}.btn-group.btn-group-block{display:-ms-flexbox;display:flex}.btn-group.btn-group-block .btn{-ms-flex:1 0 0;flex:1 0 0}.form-group:not(:last-child){margin-bottom:.4rem}fieldset{margin-bottom:.8rem}legend{font-size:.9rem;font-weight:500;margin-bottom:.8rem}.form-label{display:block;line-height:1.2rem;padding:.3rem 0}.form-label.label-sm{font-size:.7rem;padding:.1rem 0}.form-label.label-lg{font-size:.9rem;padding:.4rem 0}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;background-image:none;border:.05rem solid #bcc3ce;border-radius:.1rem;color:#3b4351;display:block;font-size:.8rem;height:1.8rem;line-height:1.2rem;max-width:100%;outline:0;padding:.25rem .4rem;position:relative;transition:background .2s,border .2s,box-shadow .2s,color .2s;width:100%}.form-input:focus{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-input:-ms-input-placeholder{color:#bcc3ce}.form-input::-ms-input-placeholder{color:#bcc3ce}.form-input::placeholder{color:#bcc3ce}.form-input.input-sm{font-size:.7rem;height:1.4rem;padding:.05rem .3rem}.form-input.input-lg{font-size:.9rem;height:2rem;padding:.35rem .6rem}.form-input.input-inline{display:inline-block;vertical-align:middle;width:auto}.form-input[type=file]{height:auto}textarea.form-input,textarea.form-input.input-lg,textarea.form-input.input-sm{height:auto}.form-input-hint{color:#bcc3ce;font-size:.7rem;margin-top:.2rem}.has-success .form-input-hint,.is-success+.form-input-hint{color:#32b643}.has-error .form-input-hint,.is-error+.form-input-hint{color:#e85600}.form-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:.05rem solid #bcc3ce;border-radius:.1rem;color:inherit;font-size:.8rem;height:1.8rem;line-height:1.2rem;outline:0;padding:.25rem .4rem;vertical-align:middle;width:100%}.form-select:focus{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-select::-ms-expand{display:none}.form-select.select-sm{font-size:.7rem;height:1.4rem;padding:.05rem 1.1rem .05rem .3rem}.form-select.select-lg{font-size:.9rem;height:2rem;padding:.35rem 1.4rem .35rem .6rem}.form-select[multiple],.form-select[size]{height:auto;padding:.25rem .4rem}.form-select[multiple] option,.form-select[size] option{padding:.1rem .2rem}.form-select:not([multiple]):not([size]){background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%205'%3E%3Cpath%20fill='%23667189'%20d='M2%200L0%202h4zm0%205L0%203h4z'/%3E%3C/svg%3E") no-repeat right .35rem center/.4rem .5rem;padding-right:1.2rem}.has-icon-left,.has-icon-right{position:relative}.has-icon-left .form-icon,.has-icon-right .form-icon{height:.8rem;margin:0 .25rem;position:absolute;top:50%;transform:translateY(-50%);width:.8rem;z-index:2}.has-icon-left .form-icon{left:.05rem}.has-icon-left .form-input{padding-left:1.3rem}.has-icon-right .form-icon{right:.05rem}.has-icon-right .form-input{padding-right:1.3rem}.form-checkbox,.form-radio,.form-switch{display:block;line-height:1.2rem;margin:.2rem 0;min-height:1.4rem;padding:.1rem .4rem .1rem 1.2rem;position:relative}.form-checkbox input,.form-radio input,.form-switch input{clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;position:absolute;width:1px}.form-checkbox input:focus+.form-icon,.form-radio input:focus+.form-icon,.form-switch input:focus+.form-icon{border-color:#5755d9;box-shadow:0 0 0 .1rem rgba(87,85,217,.2)}.form-checkbox input:checked+.form-icon,.form-radio input:checked+.form-icon,.form-switch input:checked+.form-icon{background:#5755d9;border-color:#5755d9}.form-checkbox .form-icon,.form-radio .form-icon,.form-switch .form-icon{border:.05rem solid #bcc3ce;cursor:pointer;display:inline-block;position:absolute;transition:background .2s,border .2s,box-shadow .2s,color .2s}.form-checkbox.input-sm,.form-radio.input-sm,.form-switch.input-sm{font-size:.7rem;margin:0}.form-checkbox.input-lg,.form-radio.input-lg,.form-switch.input-lg{font-size:.9rem;margin:.3rem 0}.form-checkbox .form-icon,.form-radio .form-icon{background:#fff;height:.8rem;left:0;top:.3rem;width:.8rem}.form-checkbox input:active+.form-icon,.form-radio input:active+.form-icon{background:#eef0f3}.form-checkbox .form-icon{border-radius:.1rem}.form-checkbox input:checked+.form-icon::before{background-clip:padding-box;border:.1rem solid #fff;border-left-width:0;border-top-width:0;content:"";height:9px;left:50%;margin-left:-3px;margin-top:-6px;position:absolute;top:50%;transform:rotate(45deg);width:6px}.form-checkbox input:indeterminate+.form-icon{background:#5755d9;border-color:#5755d9}.form-checkbox input:indeterminate+.form-icon::before{background:#fff;content:"";height:2px;left:50%;margin-left:-5px;margin-top:-1px;position:absolute;top:50%;width:10px}.form-radio .form-icon{border-radius:50%}.form-radio input:checked+.form-icon::before{background:#fff;border-radius:50%;content:"";height:6px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:6px}.form-switch{padding-left:2rem}.form-switch .form-icon{background:#bcc3ce;background-clip:padding-box;border-radius:.45rem;height:.9rem;left:0;top:.25rem;width:1.6rem}.form-switch .form-icon::before{background:#fff;border-radius:50%;content:"";display:block;height:.8rem;left:0;position:absolute;top:0;transition:background .2s,border .2s,box-shadow .2s,color .2s,left .2s;width:.8rem}.form-switch input:checked+.form-icon::before{left:14px}.form-switch input:active+.form-icon::before{background:#f7f8f9}.input-group{display:-ms-flexbox;display:flex}.input-group .input-group-addon{background:#f7f8f9;border:.05rem solid #bcc3ce;border-radius:.1rem;line-height:1.2rem;padding:.25rem .4rem;white-space:nowrap}.input-group .input-group-addon.addon-sm{font-size:.7rem;padding:.05rem .3rem}.input-group .input-group-addon.addon-lg{font-size:.9rem;padding:.35rem .6rem}.input-group .form-input,.input-group .form-select{-ms-flex:1 1 auto;flex:1 1 auto;width:1%}.input-group .input-group-btn{z-index:1}.input-group .form-input:first-child:not(:last-child),.input-group .form-select:first-child:not(:last-child),.input-group .input-group-addon:first-child:not(:last-child),.input-group .input-group-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.input-group .form-input:not(:first-child):not(:last-child),.input-group .form-select:not(:first-child):not(:last-child),.input-group .input-group-addon:not(:first-child):not(:last-child),.input-group .input-group-btn:not(:first-child):not(:last-child){border-radius:0;margin-left:-.05rem}.input-group .form-input:last-child:not(:first-child),.input-group .form-select:last-child:not(:first-child),.input-group .input-group-addon:last-child:not(:first-child),.input-group .input-group-btn:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-.05rem}.input-group .form-input:focus,.input-group .form-select:focus,.input-group .input-group-addon:focus,.input-group .input-group-btn:focus{z-index:2}.input-group .form-select{width:auto}.input-group.input-inline{display:-ms-inline-flexbox;display:inline-flex}.form-input.is-success,.form-select.is-success,.has-success .form-input,.has-success .form-select{background:#f9fdfa;border-color:#32b643}.form-input.is-success:focus,.form-select.is-success:focus,.has-success .form-input:focus,.has-success .form-select:focus{box-shadow:0 0 0 .1rem rgba(50,182,67,.2)}.form-input.is-error,.form-select.is-error,.has-error .form-input,.has-error .form-select{background:#fffaf7;border-color:#e85600}.form-input.is-error:focus,.form-select.is-error:focus,.has-error .form-input:focus,.has-error .form-select:focus{box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-checkbox.is-error .form-icon,.form-radio.is-error .form-icon,.form-switch.is-error .form-icon,.has-error .form-checkbox .form-icon,.has-error .form-radio .form-icon,.has-error .form-switch .form-icon{border-color:#e85600}.form-checkbox.is-error input:checked+.form-icon,.form-radio.is-error input:checked+.form-icon,.form-switch.is-error input:checked+.form-icon,.has-error .form-checkbox input:checked+.form-icon,.has-error .form-radio input:checked+.form-icon,.has-error .form-switch input:checked+.form-icon{background:#e85600;border-color:#e85600}.form-checkbox.is-error input:focus+.form-icon,.form-radio.is-error input:focus+.form-icon,.form-switch.is-error input:focus+.form-icon,.has-error .form-checkbox input:focus+.form-icon,.has-error .form-radio input:focus+.form-icon,.has-error .form-switch input:focus+.form-icon{border-color:#e85600;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-checkbox.is-error input:indeterminate+.form-icon,.has-error .form-checkbox input:indeterminate+.form-icon{background:#e85600;border-color:#e85600}.form-input:not(:-ms-input-placeholder):invalid{border-color:#e85600}.form-input:not(:placeholder-shown):invalid{border-color:#e85600}.form-input:not(:-ms-input-placeholder):invalid:focus{background:#fffaf7;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-input:not(:placeholder-shown):invalid:focus{background:#fffaf7;box-shadow:0 0 0 .1rem rgba(232,86,0,.2)}.form-input:not(:-ms-input-placeholder):invalid+.form-input-hint{color:#e85600}.form-input:not(:placeholder-shown):invalid+.form-input-hint{color:#e85600}.form-input.disabled,.form-input:disabled,.form-select.disabled,.form-select:disabled{background-color:#eef0f3;cursor:not-allowed;opacity:.5}.form-input[readonly]{background-color:#f7f8f9}input.disabled+.form-icon,input:disabled+.form-icon{background:#eef0f3;cursor:not-allowed;opacity:.5}.form-switch input.disabled+.form-icon::before,.form-switch input:disabled+.form-icon::before{background:#fff}.form-horizontal{padding:.4rem 0}.form-horizontal .form-group{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.form-inline{display:inline-block}.label{background:#eef0f3;border-radius:.1rem;color:#455060;display:inline-block;line-height:1.25;padding:.1rem .2rem}.label.label-rounded{border-radius:5rem;padding-left:.4rem;padding-right:.4rem}.label.label-primary{background:#5755d9;color:#fff}.label.label-secondary{background:#f1f1fc;color:#5755d9}.label.label-success{background:#32b643;color:#fff}.label.label-warning{background:#ffb700;color:#fff}.label.label-error{background:#e85600;color:#fff}code{background:#fcf2f2;border-radius:.1rem;color:#d73e48;font-size:85%;line-height:1.25;padding:.1rem .2rem}.code{border-radius:.1rem;color:#3b4351;position:relative}.code::before{color:#bcc3ce;content:attr(data-lang);font-size:.7rem;position:absolute;right:.4rem;top:.1rem}.code code{background:#f7f8f9;color:inherit;display:block;line-height:1.5;overflow-x:auto;padding:1rem;width:100%}.img-responsive{display:block;height:auto;max-width:100%}.img-fit-cover{object-fit:cover}.img-fit-contain{object-fit:contain}.video-responsive{display:block;overflow:hidden;padding:0;position:relative;width:100%}.video-responsive::before{content:"";display:block;padding-bottom:56.25%}.video-responsive embed,.video-responsive iframe,.video-responsive object{border:0;bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}video.video-responsive{height:auto;max-width:100%}video.video-responsive::before{content:none}.video-responsive-4-3::before{padding-bottom:75%}.video-responsive-1-1::before{padding-bottom:100%}.figure{margin:0 0 .4rem 0}.figure .figure-caption{color:#66758c;margin-top:.4rem}.container{margin-left:auto;margin-right:auto;padding-left:.4rem;padding-right:.4rem;width:100%}.container.grid-xl{max-width:1296px}.container.grid-lg{max-width:976px}.container.grid-md{max-width:856px}.container.grid-sm{max-width:616px}.container.grid-xs{max-width:496px}.show-lg,.show-md,.show-sm,.show-xl,.show-xs{display:none!important}.cols,.columns{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:-.4rem;margin-right:-.4rem}.cols.col-gapless,.columns.col-gapless{margin-left:0;margin-right:0}.cols.col-gapless>.column,.columns.col-gapless>.column{padding-left:0;padding-right:0}.cols.col-oneline,.columns.col-oneline{-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto}.column,[class~=col-]{-ms-flex:1;flex:1;max-width:100%;padding-left:.4rem;padding-right:.4rem}.column.col-1,.column.col-10,.column.col-11,.column.col-12,.column.col-2,.column.col-3,.column.col-4,.column.col-5,.column.col-6,.column.col-7,.column.col-8,.column.col-9,.column.col-auto,[class~=col-].col-1,[class~=col-].col-10,[class~=col-].col-11,[class~=col-].col-12,[class~=col-].col-2,[class~=col-].col-3,[class~=col-].col-4,[class~=col-].col-5,[class~=col-].col-6,[class~=col-].col-7,[class~=col-].col-8,[class~=col-].col-9,[class~=col-].col-auto{-ms-flex:none;flex:none}.col-12{width:100%}.col-11{width:91.66666667%}.col-10{width:83.33333333%}.col-9{width:75%}.col-8{width:66.66666667%}.col-7{width:58.33333333%}.col-6{width:50%}.col-5{width:41.66666667%}.col-4{width:33.33333333%}.col-3{width:25%}.col-2{width:16.66666667%}.col-1{width:8.33333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;max-width:none;width:auto}.col-mx-auto{margin-left:auto;margin-right:auto}.col-ml-auto{margin-left:auto}.col-mr-auto{margin-right:auto}@media (max-width:1280px){.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{-ms-flex:none;flex:none}.col-xl-12{width:100%}.col-xl-11{width:91.66666667%}.col-xl-10{width:83.33333333%}.col-xl-9{width:75%}.col-xl-8{width:66.66666667%}.col-xl-7{width:58.33333333%}.col-xl-6{width:50%}.col-xl-5{width:41.66666667%}.col-xl-4{width:33.33333333%}.col-xl-3{width:25%}.col-xl-2{width:16.66666667%}.col-xl-1{width:8.33333333%}.col-xl-auto{width:auto}.hide-xl{display:none!important}.show-xl{display:block!important}}@media (max-width:960px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto{-ms-flex:none;flex:none}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-auto{width:auto}.hide-lg{display:none!important}.show-lg{display:block!important}}@media (max-width:840px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto{-ms-flex:none;flex:none}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-auto{width:auto}.hide-md{display:none!important}.show-md{display:block!important}}@media (max-width:600px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto{-ms-flex:none;flex:none}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-auto{width:auto}.hide-sm{display:none!important}.show-sm{display:block!important}}@media (max-width:480px){.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-auto{-ms-flex:none;flex:none}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-auto{width:auto}.hide-xs{display:none!important}.show-xs{display:block!important}}.hero{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:4rem;padding-top:4rem}.hero.hero-sm{padding-bottom:2rem;padding-top:2rem}.hero.hero-lg{padding-bottom:8rem;padding-top:8rem}.hero .hero-body{padding:.4rem}.navbar{align-items:stretch;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;-ms-flex-pack:justify;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:space-between}.navbar .navbar-section{align-items:center;display:-ms-flexbox;display:flex;-ms-flex:1 0 0;flex:1 0 0;-ms-flex-align:center}.navbar .navbar-section:not(:first-child):last-child{-ms-flex-pack:end;justify-content:flex-end}.navbar .navbar-center{align-items:center;display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-align:center}.navbar .navbar-brand{font-size:.9rem;text-decoration:none}.accordion input:checked~.accordion-header>.icon:first-child,.accordion[open] .accordion-header>.icon:first-child{transform:rotate(90deg)}.accordion input:checked~.accordion-body,.accordion[open] .accordion-body{max-height:50rem}.accordion .accordion-header{display:block;padding:.2rem .4rem}.accordion .accordion-header .icon{transition:transform .25s}.accordion .accordion-body{margin-bottom:.4rem;max-height:0;overflow:hidden;transition:max-height .25s}summary.accordion-header::-webkit-details-marker{display:none}.avatar{background:#5755d9;border-radius:50%;color:rgba(255,255,255,.85);display:inline-block;font-size:.8rem;font-weight:300;height:1.6rem;line-height:1.25;margin:0;position:relative;vertical-align:middle;width:1.6rem}.avatar.avatar-xs{font-size:.4rem;height:.8rem;width:.8rem}.avatar.avatar-sm{font-size:.6rem;height:1.2rem;width:1.2rem}.avatar.avatar-lg{font-size:1.2rem;height:2.4rem;width:2.4rem}.avatar.avatar-xl{font-size:1.6rem;height:3.2rem;width:3.2rem}.avatar img{border-radius:50%;height:100%;position:relative;width:100%;z-index:1}.avatar .avatar-icon,.avatar .avatar-presence{background:#fff;bottom:14.64%;height:50%;padding:.1rem;position:absolute;right:14.64%;transform:translate(50%,50%);width:50%;z-index:2}.avatar .avatar-presence{background:#bcc3ce;border-radius:50%;box-shadow:0 0 0 .1rem #fff;height:.5em;width:.5em}.avatar .avatar-presence.online{background:#32b643}.avatar .avatar-presence.busy{background:#e85600}.avatar .avatar-presence.away{background:#ffb700}.avatar[data-initial]::before{color:currentColor;content:attr(data-initial);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.badge{position:relative;white-space:nowrap}.badge:not([data-badge])::after,.badge[data-badge]::after{background:#5755d9;background-clip:padding-box;border-radius:.5rem;box-shadow:0 0 0 .1rem #fff;color:#fff;content:attr(data-badge);display:inline-block;transform:translate(-.05rem,-.5rem)}.badge[data-badge]::after{font-size:.7rem;height:.9rem;line-height:1;min-width:.9rem;padding:.1rem .2rem;text-align:center;white-space:nowrap}.badge:not([data-badge])::after,.badge[data-badge=""]::after{height:6px;min-width:6px;padding:0;width:6px}.badge.btn::after{position:absolute;right:0;top:0;transform:translate(50%,-50%)}.badge.avatar::after{position:absolute;right:14.64%;top:14.64%;transform:translate(50%,-50%);z-index:100}.breadcrumb{list-style:none;margin:.2rem 0;padding:.2rem 0}.breadcrumb .breadcrumb-item{color:#66758c;display:inline-block;margin:0;padding:.2rem 0}.breadcrumb .breadcrumb-item:not(:last-child){margin-right:.2rem}.breadcrumb .breadcrumb-item:not(:last-child) a{color:#66758c}.breadcrumb .breadcrumb-item:not(:first-child)::before{color:#66758c;content:"/";padding-right:.4rem}.bar{background:#eef0f3;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;height:.8rem;width:100%}.bar.bar-sm{height:.2rem}.bar .bar-item{background:#5755d9;color:#fff;display:block;-ms-flex-negative:0;flex-shrink:0;font-size:.7rem;height:100%;line-height:.8rem;position:relative;text-align:center;width:0}.bar .bar-item:first-child{border-bottom-left-radius:.1rem;border-top-left-radius:.1rem}.bar .bar-item:last-child{border-bottom-right-radius:.1rem;border-top-right-radius:.1rem;-ms-flex-negative:1;flex-shrink:1}.bar-slider{height:.1rem;margin:.4rem 0;position:relative}.bar-slider .bar-item{left:0;padding:0;position:absolute}.bar-slider .bar-item:not(:last-child):first-child{background:#eef0f3;z-index:1}.bar-slider .bar-slider-btn{background:#5755d9;border:0;border-radius:50%;height:.6rem;padding:0;position:absolute;right:0;top:50%;transform:translate(50%,-50%);width:.6rem}.bar-slider .bar-slider-btn:active{box-shadow:0 0 0 .1rem #5755d9}.card{background:#fff;border:.05rem solid #dadee4;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card .card-body,.card .card-footer,.card .card-header{padding:.8rem;padding-bottom:0}.card .card-body:last-child,.card .card-footer:last-child,.card .card-header:last-child{padding-bottom:.8rem}.card .card-body{-ms-flex:1 1 auto;flex:1 1 auto}.card .card-image{padding-top:.8rem}.card .card-image:first-child{padding-top:0}.card .card-image:first-child img{border-top-left-radius:.1rem;border-top-right-radius:.1rem}.card .card-image:last-child img{border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem}.chip{align-items:center;background:#eef0f3;border-radius:5rem;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;font-size:90%;height:1.2rem;line-height:.8rem;margin:.1rem;max-width:320px;overflow:hidden;padding:.2rem .4rem;text-decoration:none;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.chip.active{background:#5755d9;color:#fff}.chip .avatar{margin-left:-.4rem;margin-right:.2rem}.chip .btn-clear{border-radius:50%;transform:scale(.75)}.dropdown{display:inline-block;position:relative}.dropdown .menu{animation:slide-down .15s ease 1;display:none;left:0;max-height:50vh;overflow-y:auto;position:absolute;top:100%}.dropdown.dropdown-right .menu{left:auto;right:0}.dropdown .dropdown-toggle:focus+.menu,.dropdown .menu:hover,.dropdown.active .menu{display:block}.dropdown .btn-group .dropdown-toggle:nth-last-child(2){border-bottom-right-radius:.1rem;border-top-right-radius:.1rem}.empty{background:#f7f8f9;border-radius:.1rem;color:#66758c;padding:3.2rem 1.6rem;text-align:center}.empty .empty-icon{margin-bottom:.8rem}.empty .empty-subtitle,.empty .empty-title{margin:.4rem auto}.empty .empty-action{margin-top:.8rem}.menu{background:#fff;border-radius:.1rem;box-shadow:0 .05rem .2rem rgba(48,55,66,.3);list-style:none;margin:0;min-width:180px;padding:.4rem;transform:translateY(.2rem);z-index:300}.menu.menu-nav{background:0 0;box-shadow:none}.menu .menu-item{margin-top:0;padding:0 .4rem;position:relative;text-decoration:none}.menu .menu-item>a{border-radius:.1rem;color:inherit;display:block;margin:0 -.4rem;padding:.2rem .4rem;text-decoration:none}.menu .menu-item>a:focus,.menu .menu-item>a:hover{background:#f1f1fc;color:#5755d9}.menu .menu-item>a.active,.menu .menu-item>a:active{background:#f1f1fc;color:#5755d9}.menu .menu-item .form-checkbox,.menu .menu-item .form-radio,.menu .menu-item .form-switch{margin:.1rem 0}.menu .menu-item+.menu-item{margin-top:.2rem}.menu .menu-badge{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;height:100%;position:absolute;right:0;top:0}.menu .menu-badge .label{margin-right:.4rem}.modal{align-items:center;bottom:0;display:none;-ms-flex-align:center;-ms-flex-pack:center;justify-content:center;left:0;opacity:0;overflow:hidden;padding:.4rem;position:fixed;right:0;top:0}.modal.active,.modal:target{display:-ms-flexbox;display:flex;opacity:1;z-index:400}.modal.active .modal-overlay,.modal:target .modal-overlay{background:rgba(247,248,249,.75);bottom:0;cursor:default;display:block;left:0;position:absolute;right:0;top:0}.modal.active .modal-container,.modal:target .modal-container{animation:slide-down .2s ease 1;z-index:1}.modal.modal-sm .modal-container{max-width:320px;padding:0 .4rem}.modal.modal-lg .modal-overlay{background:#fff}.modal.modal-lg .modal-container{box-shadow:none;max-width:960px}.modal-container{background:#fff;border-radius:.1rem;box-shadow:0 .2rem .5rem rgba(48,55,66,.3);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:75vh;max-width:640px;padding:0 .8rem;width:100%}.modal-container.modal-fullheight{max-height:100vh}.modal-container .modal-header{color:#303742;padding:.8rem}.modal-container .modal-body{overflow-y:auto;padding:.8rem;position:relative}.modal-container .modal-footer{padding:.8rem;text-align:right}.nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;list-style:none;margin:.2rem 0}.nav .nav-item a{color:#66758c;padding:.2rem .4rem;text-decoration:none}.nav .nav-item a:focus,.nav .nav-item a:hover{color:#5755d9}.nav .nav-item.active>a{color:#505c6e;font-weight:700}.nav .nav-item.active>a:focus,.nav .nav-item.active>a:hover{color:#5755d9}.nav .nav{margin-bottom:.4rem;margin-left:.8rem}.pagination{display:-ms-flexbox;display:flex;list-style:none;margin:.2rem 0;padding:.2rem 0}.pagination .page-item{margin:.2rem .05rem}.pagination .page-item span{display:inline-block;padding:.2rem .2rem}.pagination .page-item a{border-radius:.1rem;display:inline-block;padding:.2rem .4rem;text-decoration:none}.pagination .page-item a:focus,.pagination .page-item a:hover{color:#5755d9}.pagination .page-item.disabled a{cursor:default;opacity:.5;pointer-events:none}.pagination .page-item.active a{background:#5755d9;color:#fff}.pagination .page-item.page-next,.pagination .page-item.page-prev{-ms-flex:1 0 50%;flex:1 0 50%}.pagination .page-item.page-next{text-align:right}.pagination .page-item .page-item-title{margin:0}.pagination .page-item .page-item-subtitle{margin:0;opacity:.5}.panel{border:.05rem solid #dadee4;border-radius:.1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.panel .panel-footer,.panel .panel-header{-ms-flex:0 0 auto;flex:0 0 auto;padding:.8rem}.panel .panel-nav{-ms-flex:0 0 auto;flex:0 0 auto}.panel .panel-body{-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:auto;padding:0 .8rem}.popover{display:inline-block;position:relative}.popover .popover-container{left:50%;opacity:0;padding:.4rem;position:absolute;top:0;transform:translate(-50%,-50%) scale(0);transition:transform .2s;width:320px;z-index:300}.popover :focus+.popover-container,.popover:hover .popover-container{display:block;opacity:1;transform:translate(-50%,-100%) scale(1)}.popover.popover-right .popover-container{left:100%;top:50%}.popover.popover-right :focus+.popover-container,.popover.popover-right:hover .popover-container{transform:translate(0,-50%) scale(1)}.popover.popover-bottom .popover-container{left:50%;top:100%}.popover.popover-bottom :focus+.popover-container,.popover.popover-bottom:hover .popover-container{transform:translate(-50%,0) scale(1)}.popover.popover-left .popover-container{left:0;top:50%}.popover.popover-left :focus+.popover-container,.popover.popover-left:hover .popover-container{transform:translate(-100%,-50%) scale(1)}.popover .card{border:0;box-shadow:0 .2rem .5rem rgba(48,55,66,.3)}.step{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;list-style:none;margin:.2rem 0;width:100%}.step .step-item{-ms-flex:1 1 0;flex:1 1 0;margin-top:0;min-height:1rem;position:relative;text-align:center}.step .step-item:not(:first-child)::before{background:#5755d9;content:"";height:2px;left:-50%;position:absolute;top:9px;width:100%}.step .step-item a{color:#5755d9;display:inline-block;padding:20px 10px 0;text-decoration:none}.step .step-item a::before{background:#5755d9;border:.1rem solid #fff;border-radius:50%;content:"";display:block;height:.6rem;left:50%;position:absolute;top:.2rem;transform:translateX(-50%);width:.6rem;z-index:1}.step .step-item.active a::before{background:#fff;border:.1rem solid #5755d9}.step .step-item.active~.step-item::before{background:#dadee4}.step .step-item.active~.step-item a{color:#bcc3ce}.step .step-item.active~.step-item a::before{background:#dadee4}.tab{align-items:center;border-bottom:.05rem solid #dadee4;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-wrap:wrap;flex-wrap:wrap;list-style:none;margin:.2rem 0 .15rem 0}.tab .tab-item{margin-top:0}.tab .tab-item a{border-bottom:.1rem solid transparent;color:inherit;display:block;margin:0 .4rem 0 0;padding:.4rem .2rem .3rem .2rem;text-decoration:none}.tab .tab-item a:focus,.tab .tab-item a:hover{color:#5755d9}.tab .tab-item a.active,.tab .tab-item.active a{border-bottom-color:#5755d9;color:#5755d9}.tab .tab-item.tab-action{-ms-flex:1 0 auto;flex:1 0 auto;text-align:right}.tab .tab-item .btn-clear{margin-top:-.2rem}.tab.tab-block .tab-item{-ms-flex:1 0 0;flex:1 0 0;text-align:center}.tab.tab-block .tab-item a{margin:0}.tab.tab-block .tab-item .badge[data-badge]::after{position:absolute;right:.1rem;top:.1rem;transform:translate(0,0)}.tab:not(.tab-block) .badge{padding-right:0}.tile{align-content:space-between;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-align:start;-ms-flex-line-pack:justify}.tile .tile-action,.tile .tile-icon{-ms-flex:0 0 auto;flex:0 0 auto}.tile .tile-content{-ms-flex:1 1 auto;flex:1 1 auto}.tile .tile-content:not(:first-child){padding-left:.4rem}.tile .tile-content:not(:last-child){padding-right:.4rem}.tile .tile-subtitle,.tile .tile-title{line-height:1.2rem}.tile.tile-centered{align-items:center;-ms-flex-align:center}.tile.tile-centered .tile-content{overflow:hidden}.tile.tile-centered .tile-subtitle,.tile.tile-centered .tile-title{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toast{background:rgba(48,55,66,.95);border:.05rem solid #303742;border-color:#303742;border-radius:.1rem;color:#fff;display:block;padding:.4rem;width:100%}.toast.toast-primary{background:rgba(87,85,217,.95);border-color:#5755d9}.toast.toast-success{background:rgba(50,182,67,.95);border-color:#32b643}.toast.toast-warning{background:rgba(255,183,0,.95);border-color:#ffb700}.toast.toast-error{background:rgba(232,86,0,.95);border-color:#e85600}.toast a{color:#fff;text-decoration:underline}.toast a.active,.toast a:active,.toast a:focus,.toast a:hover{opacity:.75}.toast .btn-clear{margin:.1rem}.toast p:last-child{margin-bottom:0}.tooltip{position:relative}.tooltip::after{background:rgba(48,55,66,.95);border-radius:.1rem;bottom:100%;color:#fff;content:attr(data-tooltip);display:block;font-size:.7rem;left:50%;max-width:320px;opacity:0;overflow:hidden;padding:.2rem .4rem;pointer-events:none;position:absolute;text-overflow:ellipsis;transform:translate(-50%,.4rem);transition:opacity .2s,transform .2s;white-space:pre;z-index:300}.tooltip:focus::after,.tooltip:hover::after{opacity:1;transform:translate(-50%,-.2rem)}.tooltip.disabled,.tooltip[disabled]{pointer-events:auto}.tooltip.tooltip-right::after{bottom:50%;left:100%;transform:translate(-.2rem,50%)}.tooltip.tooltip-right:focus::after,.tooltip.tooltip-right:hover::after{transform:translate(.2rem,50%)}.tooltip.tooltip-bottom::after{bottom:auto;top:100%;transform:translate(-50%,-.4rem)}.tooltip.tooltip-bottom:focus::after,.tooltip.tooltip-bottom:hover::after{transform:translate(-50%,.2rem)}.tooltip.tooltip-left::after{bottom:50%;left:auto;right:100%;transform:translate(.4rem,50%)}.tooltip.tooltip-left:focus::after,.tooltip.tooltip-left:hover::after{transform:translate(-.2rem,50%)}@keyframes loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes slide-down{0%{opacity:0;transform:translateY(-1.6rem)}100%{opacity:1;transform:translateY(0)}}.text-primary{color:#5755d9!important}a.text-primary:focus,a.text-primary:hover{color:#4240d4}a.text-primary:visited{color:#6c6ade}.text-secondary{color:#e5e5f9!important}a.text-secondary:focus,a.text-secondary:hover{color:#d1d0f4}a.text-secondary:visited{color:#fafafe}.text-gray{color:#bcc3ce!important}a.text-gray:focus,a.text-gray:hover{color:#adb6c4}a.text-gray:visited{color:#cbd0d9}.text-light{color:#fff!important}a.text-light:focus,a.text-light:hover{color:#f2f2f2}a.text-light:visited{color:#fff}.text-dark{color:#3b4351!important}a.text-dark:focus,a.text-dark:hover{color:#303742}a.text-dark:visited{color:#455060}.text-success{color:#32b643!important}a.text-success:focus,a.text-success:hover{color:#2da23c}a.text-success:visited{color:#39c94b}.text-warning{color:#ffb700!important}a.text-warning:focus,a.text-warning:hover{color:#e6a500}a.text-warning:visited{color:#ffbe1a}.text-error{color:#e85600!important}a.text-error:focus,a.text-error:hover{color:#cf4d00}a.text-error:visited{color:#ff6003}.bg-primary{background:#5755d9!important;color:#fff}.bg-secondary{background:#f1f1fc!important}.bg-dark{background:#303742!important;color:#fff}.bg-gray{background:#f7f8f9!important}.bg-success{background:#32b643!important;color:#fff}.bg-warning{background:#ffb700!important;color:#fff}.bg-error{background:#e85600!important;color:#fff}.c-hand{cursor:pointer}.c-move{cursor:move}.c-zoom-in{cursor:zoom-in}.c-zoom-out{cursor:zoom-out}.c-not-allowed{cursor:not-allowed}.c-auto{cursor:auto}.d-block{display:block}.d-inline{display:inline}.d-inline-block{display:inline-block}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.d-hide,.d-none{display:none!important}.d-visible{visibility:visible}.d-invisible{visibility:hidden}.text-hide{background:0 0;border:0;color:transparent;font-size:0;line-height:0;text-shadow:none}.text-assistive{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.divider,.divider-vert{display:block;position:relative}.divider-vert[data-content]::after,.divider[data-content]::after{background:#fff;color:#bcc3ce;content:attr(data-content);display:inline-block;font-size:.7rem;padding:0 .4rem;transform:translateY(-.65rem)}.divider{border-top:.05rem solid #f1f3f5;height:.05rem;margin:.4rem 0}.divider[data-content]{margin:.8rem 0}.divider-vert{display:block;padding:.8rem}.divider-vert::before{border-left:.05rem solid #dadee4;bottom:.4rem;content:"";display:block;left:50%;position:absolute;top:.4rem;transform:translateX(-50%)}.divider-vert[data-content]::after{left:50%;padding:.2rem 0;position:absolute;top:50%;transform:translate(-50%,-50%)}.loading{color:transparent!important;min-height:.8rem;pointer-events:none;position:relative}.loading::after{animation:loading .5s infinite linear;background:0 0;border:.1rem solid #5755d9;border-radius:50%;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:.8rem;left:50%;margin-left:-.4rem;margin-top:-.4rem;opacity:1;padding:0;position:absolute;top:50%;width:.8rem;z-index:1}.loading.loading-lg{min-height:2rem}.loading.loading-lg::after{height:1.6rem;margin-left:-.8rem;margin-top:-.8rem;width:1.6rem}.clearfix::after{clear:both;content:"";display:table}.float-left{float:left!important}.float-right{float:right!important}.p-relative{position:relative!important}.p-absolute{position:absolute!important}.p-fixed{position:fixed!important}.p-sticky{position:-webkit-sticky!important;position:sticky!important}.p-centered{display:block;float:none;margin-left:auto;margin-right:auto}.flex-centered{align-items:center;display:-ms-flexbox;display:flex;-ms-flex-align:center;-ms-flex-pack:center;justify-content:center}.m-0{margin:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mr-0{margin-right:0!important}.mt-0{margin-top:0!important}.mx-0{margin-left:0!important;margin-right:0!important}.my-0{margin-bottom:0!important;margin-top:0!important}.m-1{margin:.2rem!important}.mb-1{margin-bottom:.2rem!important}.ml-1{margin-left:.2rem!important}.mr-1{margin-right:.2rem!important}.mt-1{margin-top:.2rem!important}.mx-1{margin-left:.2rem!important;margin-right:.2rem!important}.my-1{margin-bottom:.2rem!important;margin-top:.2rem!important}.m-2{margin:.4rem!important}.mb-2{margin-bottom:.4rem!important}.ml-2{margin-left:.4rem!important}.mr-2{margin-right:.4rem!important}.mt-2{margin-top:.4rem!important}.mx-2{margin-left:.4rem!important;margin-right:.4rem!important}.my-2{margin-bottom:.4rem!important;margin-top:.4rem!important}.p-0{padding:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.pt-0{padding-top:0!important}.px-0{padding-left:0!important;padding-right:0!important}.py-0{padding-bottom:0!important;padding-top:0!important}.p-1{padding:.2rem!important}.pb-1{padding-bottom:.2rem!important}.pl-1{padding-left:.2rem!important}.pr-1{padding-right:.2rem!important}.pt-1{padding-top:.2rem!important}.px-1{padding-left:.2rem!important;padding-right:.2rem!important}.py-1{padding-bottom:.2rem!important;padding-top:.2rem!important}.p-2{padding:.4rem!important}.pb-2{padding-bottom:.4rem!important}.pl-2{padding-left:.4rem!important}.pr-2{padding-right:.4rem!important}.pt-2{padding-top:.4rem!important}.px-2{padding-left:.4rem!important;padding-right:.4rem!important}.py-2{padding-bottom:.4rem!important;padding-top:.4rem!important}.s-rounded{border-radius:.1rem}.s-circle{border-radius:50%}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-normal{font-weight:400}.text-bold{font-weight:700}.text-italic{font-style:italic}.text-large{font-size:1.2em}.text-small{font-size:.9em}.text-tiny{font-size:.8em}.text-muted{opacity:.8}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-clip{overflow:hidden;text-overflow:clip;white-space:nowrap}.text-break{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-break:break-word;word-wrap:break-word} \ No newline at end of file diff --git a/jmlparser-web/src/main/resources/assets/style.css b/jmlparser-web/src/main/resources/assets/style.css deleted file mode 100644 index b9ece19779..0000000000 --- a/jmlparser-web/src/main/resources/assets/style.css +++ /dev/null @@ -1,56 +0,0 @@ -.version { - font-size: 80%; - margin: 1em; -} - -.ast { - font-family: monospace; -} - -.code { - font-family: monospace; - white-space: pre; -} - -.ast li { - line-height: 180%; -} - -.value { - background: rgb(133 88 255 / 30%); - border: 1px solid rgb(133 88 255 / 80%); - border-radius: 2px; - padding: .1ex; -} - -.type-name { - background: rgb(109 248 46 / 30%); - border: 1px solid rgb(109 248 46 / 80%); - border-radius: 2px; - padding: .1ex; -} - -.attrib-name { - background: rgb(251 78 251 / 30%); - border: 1px solid rgb(251 78 251 / 80%); - border-radius: 2px; - padding: .1ex; -} - -.range { - background: #888; - color: white; - border-radius: 2px; - padding: .1ex; - margin-left: 2em; -} - -.jmlish { - background: rgba(100, 150, 250, .3); - margin: 1em; -} - - -.accordion input:checked ~ .accordion-body, .accordion[open] .accordion-body { - overflow: scroll; -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5768187466..5f2472af37 100644 --- a/pom.xml +++ b/pom.xml @@ -11,8 +11,6 @@ javaparser-symbol-solver-core javaparser-symbol-solver-testing jmlparser-jml-tests - jmlparser-jml-tools - jmlparser-jml-pretty io.github.jmltoolkit