Skip to content

Commit 5b5984c

Browse files
committed
repair branch after rewriting
1 parent a6849f9 commit 5b5984c

24 files changed

Lines changed: 47 additions & 486 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/control/KeYEnvironment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import de.uka.ilkd.key.proof.io.AbstractProblemLoader.ReplayResult;
2525
import de.uka.ilkd.key.proof.io.ProblemLoaderException;
2626
import de.uka.ilkd.key.proof.mgt.SpecificationRepository;
27+
import de.uka.ilkd.key.rule.Rule;
2728
import de.uka.ilkd.key.speclang.Contract;
2829
import de.uka.ilkd.key.util.KeYTypeUtil;
2930

key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
import de.uka.ilkd.key.proof.mgt.RuleJustification;
1717
import de.uka.ilkd.key.proof.proofevent.NodeChangeJournal;
1818
import de.uka.ilkd.key.proof.proofevent.RuleAppInfo;
19-
import de.uka.ilkd.key.rule.AbstractExternalSolverRuleApp;
20-
import de.uka.ilkd.key.rule.IBuiltInRuleApp;
21-
import de.uka.ilkd.key.rule.NoPosTacletApp;
22-
import de.uka.ilkd.key.rule.TacletApp;
19+
import de.uka.ilkd.key.rule.*;
2320
import de.uka.ilkd.key.rule.inst.SVInstantiations;
2421
import de.uka.ilkd.key.rule.merge.MergeRule;
2522
import de.uka.ilkd.key.strategy.QueueRuleApplicationManager;

key.ui/src/main/java/de/uka/ilkd/key/core/Main.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -464,25 +464,27 @@ private AbstractMediatorUserInterfaceControl createUserInterface(List<Path> file
464464
}
465465

466466
public static void ensureExamplesAvailable() {
467-
File examplesDir = getExamplesDir() == null ? ExampleChooser.lookForExamples()
468-
: new File(getExamplesDir());
469-
if (!examplesDir.exists()) {
467+
Path examplesDir =
468+
getExamplesDir() == null ? ExampleChooser.lookForExamples() : getExamplesDir();
469+
if (!Files.exists(examplesDir)) {
470470
examplesDir = setupExamples();
471471
}
472-
setExamplesDir(examplesDir.getAbsolutePath());
472+
if (examplesDir == null) {
473+
setExamplesDir(examplesDir.toAbsolutePath());
474+
}
473475
}
474476

475-
private static File setupExamples() {
477+
private static @Nullable Path setupExamples() {
476478
try {
477479
URL examplesURL = Main.class.getResource("/examples.zip");
478480
if (examplesURL == null) {
479481
throw new IOException("Missing examples.zip in resources");
480482
}
481483

482-
File tempDir = createTempDirectory();
484+
Path tempDir = Files.createTempDirectory("key-examples");
483485

484486
if (tempDir != null) {
485-
IOUtil.extractZip(examplesURL.openStream(), tempDir.toPath());
487+
IOUtil.extractZip(examplesURL.openStream(), tempDir);
486488
}
487489
return tempDir;
488490
} catch (IOException e) {
@@ -555,9 +557,9 @@ private void preProcessInput()
555557
}
556558
}
557559

558-
private static String EXAMPLE_DIR = null;
560+
private static Path EXAMPLE_DIR = null;
559561

560-
public static @Nullable String getExamplesDir() {
562+
public static @Nullable Path getExamplesDir() {
561563
return EXAMPLE_DIR;
562564
}
563565

@@ -568,7 +570,7 @@ private void preProcessInput()
568570
*
569571
* @param newExamplesDir The new examples directory to use.
570572
*/
571-
public static void setExamplesDir(String newExamplesDir) {
573+
public static void setExamplesDir(Path newExamplesDir) {
572574
EXAMPLE_DIR = newExamplesDir;
573575
}
574576
}

key.ui/src/main/java/de/uka/ilkd/key/gui/actions/OpenExampleAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package de.uka.ilkd.key.gui.actions;
55

66
import java.awt.event.ActionEvent;
7-
import java.io.File;
7+
import java.nio.file.Path;
88

99
import de.uka.ilkd.key.core.Main;
1010
import de.uka.ilkd.key.gui.ExampleChooser;
@@ -30,10 +30,10 @@ public OpenExampleAction(MainWindow mainWindow) {
3030
}
3131

3232
public void actionPerformed(ActionEvent e) {
33-
File file = ExampleChooser.showInstance(Main.getExamplesDir());
33+
Path file = ExampleChooser.showInstance(Main.getExamplesDir());
3434
if (file != null) {
35-
KeYFileChooser.getFileChooser("Select file to load").setSelectedFile(file);
36-
mainWindow.loadProblem(file.toPath());
35+
KeYFileChooser.getFileChooser("Select file to load").setSelectedFile(file.toFile());
36+
mainWindow.loadProblem(file);
3737
}
3838
}
3939
}

key.ui/src/main/java/de/uka/ilkd/key/gui/actions/RunAllProofsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public RunAllProofsAction(MainWindow mainWindow) {
100100
super(mainWindow);
101101

102102
Main.ensureExamplesAvailable();
103-
exampleDir = Paths.get(Main.getExamplesDir());
103+
exampleDir = Main.getExamplesDir();
104104

105105
try {
106106
files = loadFiles();

keyext.api.doc/src/main/java/PyGen.java

Lines changed: 0 additions & 145 deletions
This file was deleted.

keyext.api.doc/src/main/java/org/key_project/key/api/doc/ExtractMetaData.java

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@
3232
* @author Alexander Weigl
3333
* @version 1 (14.10.23)
3434
*/
35-
@NullMarked
36-
@CommandLine.Command(name = "gendoc",
37-
mixinStandardHelpOptions = true,
38-
version = "gendoc 1.0",
39-
description = "Generates the documentation for key.api")
40-
public class ExtractMetaData implements Callable<Integer> {
35+
36+
public class ExtractMetaData implements Runnable {
4137
private final List<Metamodel.Endpoint> endpoints = new LinkedList<>();
4238
private final Map<Class<?>, Metamodel.Type> types = new HashMap<>();
4339
private final Map<String, HelpText> segDocumentation = new TreeMap<>();
@@ -48,18 +44,7 @@ public ExtractMetaData() {
4844
}
4945

5046
@Override
51-
public Integer call() throws IOException {
52-
if (source != null) {
53-
ParserConfiguration config = new ParserConfiguration();
54-
config.setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_21);
55-
config.setAttributeComments(true);
56-
config.setLexicalPreservationEnabled(false);
57-
config.setStoreTokens(false);
58-
config.setIgnoreAnnotationsWhenAttributingComments(true);
59-
config.setDoNotAssignCommentsPrecedingEmptyLines(true);
60-
sourceRoot = new SourceRoot(source, config);
61-
}
62-
47+
public void run() {
6348
for (Method method : KeyApi.class.getMethods()) {
6449
addServerEndpoint(method);
6550
}
@@ -284,7 +269,7 @@ private static HelpText printFieldDocumentation(FieldJavadoc javadoc) {
284269

285270
private void addClientEndpoint(Method method) {
286271
var jsonSegment = method.getDeclaringClass().getAnnotation(JsonSegment.class);
287-
var segment = jsonSegment.value();
272+
var segment = jsonSegment == null ? "" : jsonSegment.value();
288273

289274
var req = method.getAnnotation(JsonRequest.class);
290275
var resp = method.getAnnotation(JsonNotification.class);
@@ -429,4 +414,8 @@ else if (type == CompletableFuture.class) {
429414

430415
return null;
431416
}
417+
418+
public Metamodel.KeyApi getApi() {
419+
return keyApi;
420+
}
432421
}

keyext.api.doc/src/main/java/org/key_project/key/api/doc/Metamodel.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/* This file is part of KeY - https://key-project.org
22
* KeY is licensed under the GNU General Public License Version 2
33
* SPDX-License-Identifier: GPL-2.0-only */
4-
package org.key_project.key.api.doc;/*
5-
* This file is part of KeY - https://key-project.org
6-
* KeY is licensed under the GNU General Public License Version
7-
* 2
8-
* SPDX-License-Identifier: GPL-2.0-only
9-
*/
4+
package org.key_project.key.api.doc;
105

116
import java.util.List;
127
import java.util.Map;
@@ -15,10 +10,11 @@
1510
import org.jspecify.annotations.Nullable;
1611
import org.keyproject.key.api.data.DataExamples;
1712

18-
/**
19-
* @author Alexander Weigl
20-
* @version 1 (29.10.23)
21-
*/
13+
/// Metamodel of the API. This class contains classes which represents the functionality and
14+
/// interfaces of the API.
15+
///
16+
/// @author Alexander Weigl
17+
/// @version 1 (29.10.23)
2218
@NullMarked
2319
public class Metamodel {
2420

@@ -51,9 +47,10 @@ public sealed interface Endpoint {
5147
HelpText documentation();
5248

5349
default String kind() {
54-
return getClass().getSimpleName();
50+
return getClass().getName();
5551
}
5652

53+
/// a list of its arguments
5754
List<Argument> args();
5855

5956
///
@@ -76,6 +73,10 @@ default boolean isAsync() {
7673
}
7774
}
7875

76+
/// A [Argument] of an endpoint
77+
///
78+
/// @param name the argument name
79+
/// @param type the argument type
7980
public record Argument(String name, String type) {
8081
}
8182

@@ -115,10 +116,8 @@ public record Field(String name, /* Type */ String type, @Nullable HelpText docu
115116
}
116117
}
117118

118-
public sealed
119-
120-
121-
interface Type {
119+
/// A data type
120+
public sealed interface Type {
122121
default String kind() {
123122
return getClass().getName();
124123
}
@@ -127,8 +126,10 @@ default String kind() {
127126
@Nullable
128127
HelpText documentation();
129128

129+
/// name of the data type
130130
String name();
131131

132+
///
132133
String identifier();
133134
}
134135

0 commit comments

Comments
 (0)