Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Java 17 automatic migration: records #3746

Merged
merged 35 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d0799cc
Clean up AddBrackets
Baltoli Oct 24, 2023
ba9c5a2
Clean up AddCoolLikeAtt
Baltoli Oct 24, 2023
b6b2d96
Clean up AddImplicitComputationCell
Baltoli Oct 24, 2023
29c22a3
Clean up AddTopCellToRules
Baltoli Oct 24, 2023
4c18ed0
Clean up CheckAssoc
Baltoli Oct 24, 2023
6b51cfc
Clean up CheckFunctions
Baltoli Oct 24, 2023
ab599b3
Clean up CheckHOLE
Baltoli Oct 24, 2023
8f5b263
Clean up CheckK
Baltoli Oct 24, 2023
7f1b40e
Clean up CheckRewrite
Baltoli Oct 24, 2023
2f6e90b
Clean up CheckSmtLemmas
Baltoli Oct 24, 2023
9914662
Clean up CheckTopSortUniqueness
Baltoli Oct 24, 2023
0621866
Clean up CheckStreams
Baltoli Oct 24, 2023
bf4d638
Clean up CheckSyntaxGroups
Baltoli Oct 24, 2023
8b63525
Clean up CheckTokens
Baltoli Oct 24, 2023
11d1ae9
Clean up ConcretizationInfo
Baltoli Oct 24, 2023
33c1ac3
Clean up EarleyParser
Baltoli Oct 24, 2023
8f78c92
Clean up GenerateCoverage
Baltoli Oct 24, 2023
8360923
Clean up HaskellRewriter
Baltoli Oct 24, 2023
a060781
Clean up InterruperRunnable
Baltoli Oct 24, 2023
d262ca9
Clean up KProve
Baltoli Oct 24, 2023
48851e0
Clean up KRead
Baltoli Oct 24, 2023
1f90710
Clean up Main
Baltoli Oct 24, 2023
fa7a585
Clean up ParseCache
Baltoli Oct 24, 2023
6c6ffcb
Clean up ProofDefinitionBuilder
Baltoli Oct 24, 2023
e06f381
Clean up PropagateMacro
Baltoli Oct 24, 2023
60a7a74
Clean up RemoveOverloads
Baltoli Oct 24, 2023
c822f6b
Clean up ResolveComm
Baltoli Oct 24, 2023
597e593
Clean up ResolveHeatCoolAttribute
Baltoli Oct 24, 2023
f0ef07e
Clean up ResolveIOStreams
Baltoli Oct 24, 2023
611ee38
Clean up RuleGrammarGenerator
Baltoli Oct 24, 2023
4601992
Clean up RunProcess
Baltoli Oct 24, 2023
cac9021
Clean up TTYInfo
Baltoli Oct 24, 2023
49d18e3
Merge branch 'develop' into java-records
Baltoli Oct 24, 2023
75d5737
Merge branch 'develop' into java-records
Baltoli Oct 25, 2023
48a6b18
Fix errors from merge resolution
Baltoli Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kernel/src/main/java/org/kframework/kompile/Kompile.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ private Definition postProcessJSON(Definition defn, String postProcess) {
command.add(compiledJson.getAbsolutePath());
RunProcess.ProcessOutput output = RunProcess.execute(environment, files.getProcessBuilder(), command.toArray(new String[command.size()]));
sw.printIntermediate("Post process JSON: " + String.join(" ", command));
if (output.exitCode != 0) {
if (output.exitCode() != 0) {
throw KEMException.criticalError("Post-processing returned a non-zero exit code: "
+ output.exitCode + "\nStdout:\n" + new String(output.stdout) + "\nStderr:\n" + new String(output.stderr));
+ output.exitCode() + "\nStdout:\n" + new String(output.stdout()) + "\nStderr:\n" + new String(output.stderr()));
}
return JsonParser.parseDefinition(new String(output.stdout));
return JsonParser.parseDefinition(new String(output.stdout()));
}

private static String ruleSourceMap(Definition def) {
Expand Down
16 changes: 2 additions & 14 deletions kernel/src/main/java/org/kframework/utils/RunProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Map;
import java.util.Scanner;
import java.util.function.Supplier;

// instantiate processes
Expand All @@ -26,27 +25,16 @@ public static Thread getOutputStreamThread(Supplier<InputStream> in, PrintStream
return new Thread(() -> {
try {
IOUtils.copy(in.get(), out);
} catch (IOException e) {}
} catch (IOException ignored) {}
});
}

public static class ProcessOutput {
public final byte[] stdout;
public final byte[] stderr;
public final int exitCode;

public ProcessOutput(byte[] stdout, byte[] stderr, int exitCode) {
this.stdout = stdout;
this.stderr = stderr;
this.exitCode = exitCode;
}
public record ProcessOutput(byte[] stdout, byte[] stderr, int exitCode) {
Baltoli marked this conversation as resolved.
Show resolved Hide resolved
}

private RunProcess() {}

public static ProcessOutput execute(Map<String, String> environment, ProcessBuilder pb, String... commands) {


try {
if (commands.length <= 0) {
throw KEMException.criticalError("Need command options to run");
Expand Down