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
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
28 changes: 9 additions & 19 deletions kernel/src/main/java/org/kframework/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
import java.util.ServiceLoader;
import java.util.concurrent.ExecutionException;

public class Main {
public record Main(
Provider<KExceptionManager> kem,
Provider<FrontEnd> frontEnd,
@Named("requestScope") SimpleScope requestScope
) {

/**
* @param args
Expand Down Expand Up @@ -91,19 +95,8 @@ public static void nailMain(NGContext context) {
invalidJarArguments();
}

private final Provider<KExceptionManager> kem;
private final Provider<FrontEnd> frontEnd;
private final SimpleScope requestScope;

@Inject
public Main(
Provider<KExceptionManager> kem,
Provider<FrontEnd> frontEnd,
@Named("requestScope") SimpleScope requestScope) {
this.kem = kem;
this.frontEnd = frontEnd;
this.requestScope = requestScope;
}
public Main {}

public SimpleScope getRequestScope() {
return requestScope;
Expand All @@ -123,14 +116,12 @@ public int runApplication() {
KExceptionManager kem = this.kem.get();
kem.installForUncaughtExceptions();
try {
int retval = frontEnd.get().main();
return retval;
return frontEnd.get().main();
} catch (ProvisionException e) {
for (Message m : e.getErrorMessages()) {
if (!(m.getCause() instanceof KEMException)) {
if (!(m.getCause() instanceof KEMException ex)) {
throw e;
} else {
KEMException ex = (KEMException) m.getCause();
Baltoli marked this conversation as resolved.
Show resolved Hide resolved
kem.registerThrown(ex);
}
}
Expand Down Expand Up @@ -208,8 +199,7 @@ public static Injector getInjector(String tool) {
//boot error, we should have printed it already
Main.exit(1);
}
Injector injector = Guice.createInjector(modules);
return injector;
return Guice.createInjector(modules);
}

private static void invalidJarArguments() {
Expand Down