mirror of
https://github.com/corda/corda.git
synced 2024-12-19 21:17:58 +00:00
Minor: inspector fixes
This commit is contained in:
parent
c097229935
commit
4853e41a58
@ -6,6 +6,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class FlowLogicRefFromJavaTest {
|
public class FlowLogicRefFromJavaTest {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static class ParamType1 {
|
private static class ParamType1 {
|
||||||
final int value;
|
final int value;
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ public class FlowLogicRefFromJavaTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static class ParamType2 {
|
private static class ParamType2 {
|
||||||
final String value;
|
final String value;
|
||||||
|
|
||||||
@ -22,6 +24,7 @@ public class FlowLogicRefFromJavaTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static class JavaFlowLogic extends FlowLogic<Void> {
|
private static class JavaFlowLogic extends FlowLogic<Void> {
|
||||||
|
|
||||||
public JavaFlowLogic(ParamType1 A, ParamType2 b) {
|
public JavaFlowLogic(ParamType1 A, ParamType2 b) {
|
||||||
@ -33,6 +36,7 @@ public class FlowLogicRefFromJavaTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static class JavaNoArgFlowLogic extends FlowLogic<Void> {
|
private static class JavaNoArgFlowLogic extends FlowLogic<Void> {
|
||||||
|
|
||||||
public JavaNoArgFlowLogic() {
|
public JavaNoArgFlowLogic() {
|
||||||
|
@ -36,6 +36,7 @@ public class FlowsInJavaTest {
|
|||||||
assertThat(result.get()).isEqualTo("Hello");
|
assertThat(result.get()).isEqualTo("Hello");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static class SendInUnwrapFlow extends FlowLogic<String> {
|
private static class SendInUnwrapFlow extends FlowLogic<String> {
|
||||||
private final Party otherParty;
|
private final Party otherParty;
|
||||||
|
|
||||||
|
@ -8,8 +8,6 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import static net.corda.sandbox.CandidateMethod.State.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the status of the candidacy of a particular set of candidate methods, i.e. Their progress from
|
* Represents the status of the candidacy of a particular set of candidate methods, i.e. Their progress from
|
||||||
* being {@link CandidateMethod.State#UNDETERMINED} to {@link CandidateMethod.State#DETERMINISTIC}
|
* being {@link CandidateMethod.State#UNDETERMINED} to {@link CandidateMethod.State#DETERMINISTIC}
|
||||||
@ -49,8 +47,8 @@ public class CandidacyStatus {
|
|||||||
* @param signature
|
* @param signature
|
||||||
* @return true if the input was absent from the underlying map
|
* @return true if the input was absent from the underlying map
|
||||||
*/
|
*/
|
||||||
boolean putIfAbsent(final String signature, final CandidateMethod candidate) {
|
void putIfAbsent(final String signature, final CandidateMethod candidate) {
|
||||||
return null == candidateMethods.putIfAbsent(signature, candidate);
|
candidateMethods.putIfAbsent(signature, candidate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,7 +83,7 @@ public final class WhitelistClassLoader extends ClassLoader {
|
|||||||
return of(auxiliaryClassPath, false);
|
return of(auxiliaryClassPath, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WhitelistClassLoader of(final Path auxiliaryJar, final boolean stripNonDeterministic) throws URISyntaxException {
|
public static WhitelistClassLoader of(final Path auxiliaryJar, final boolean stripNonDeterministic) {
|
||||||
final WhitelistClassLoader out = new WhitelistClassLoader(stripNonDeterministic);
|
final WhitelistClassLoader out = new WhitelistClassLoader(stripNonDeterministic);
|
||||||
out.candidacyStatus.setContextLoader(out);
|
out.candidacyStatus.setContextLoader(out);
|
||||||
out.fileSystemSearchPath.add(auxiliaryJar);
|
out.fileSystemSearchPath.add(auxiliaryJar);
|
||||||
@ -305,7 +305,7 @@ public final class WhitelistClassLoader extends ClassLoader {
|
|||||||
* @throws java.io.IOException
|
* @throws java.io.IOException
|
||||||
* @throws java.net.URISyntaxException
|
* @throws java.net.URISyntaxException
|
||||||
*/
|
*/
|
||||||
public boolean createJar() throws IOException, URISyntaxException {
|
public void createJar() throws IOException, URISyntaxException {
|
||||||
final Map<String, String> env = new HashMap<>();
|
final Map<String, String> env = new HashMap<>();
|
||||||
env.put("create", String.valueOf(!outputJarPath.toFile().exists()));
|
env.put("create", String.valueOf(!outputJarPath.toFile().exists()));
|
||||||
|
|
||||||
@ -324,7 +324,6 @@ public final class WhitelistClassLoader extends ClassLoader {
|
|||||||
Files.write(outPath, newClassDef);
|
Files.write(outPath, newClassDef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,11 +150,6 @@ public final class WhitelistCheckingClassVisitor extends ClassVisitor {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the initial scan has produced a DISALLOWED code path
|
|
||||||
if (!candidacyStatus.isLoadable()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,8 +14,6 @@ import java.util.*;
|
|||||||
public interface ICommercialPaperState extends ContractState {
|
public interface ICommercialPaperState extends ContractState {
|
||||||
ICommercialPaperState withOwner(CompositeKey newOwner);
|
ICommercialPaperState withOwner(CompositeKey newOwner);
|
||||||
|
|
||||||
ICommercialPaperState withIssuance(PartyAndReference newIssuance);
|
|
||||||
|
|
||||||
ICommercialPaperState withFaceValue(Amount<Issued<Currency>> newFaceValue);
|
ICommercialPaperState withFaceValue(Amount<Issued<Currency>> newFaceValue);
|
||||||
|
|
||||||
ICommercialPaperState withMaturityDate(Instant newMaturityDate);
|
ICommercialPaperState withMaturityDate(Instant newMaturityDate);
|
||||||
|
@ -24,9 +24,11 @@ import static net.corda.core.contracts.ContractsDSL.*;
|
|||||||
* This is a Java version of the CommercialPaper contract (chosen because it's simple). This demonstrates how the
|
* This is a Java version of the CommercialPaper contract (chosen because it's simple). This demonstrates how the
|
||||||
* use of Kotlin for implementation of the framework does not impose the same language choice on contract developers.
|
* use of Kotlin for implementation of the framework does not impose the same language choice on contract developers.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class JavaCommercialPaper implements Contract {
|
public class JavaCommercialPaper implements Contract {
|
||||||
private static final Contract JCP_PROGRAM_ID = new JavaCommercialPaper();
|
private static final Contract JCP_PROGRAM_ID = new JavaCommercialPaper();
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public static class State implements OwnableState, ICommercialPaperState {
|
public static class State implements OwnableState, ICommercialPaperState {
|
||||||
private PartyAndReference issuance;
|
private PartyAndReference issuance;
|
||||||
private CompositeKey owner;
|
private CompositeKey owner;
|
||||||
@ -58,10 +60,6 @@ public class JavaCommercialPaper implements Contract {
|
|||||||
return new Pair<>(new Commands.Move(), new State(this.issuance, newOwner, this.faceValue, this.maturityDate));
|
return new Pair<>(new Commands.Move(), new State(this.issuance, newOwner, this.faceValue, this.maturityDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommercialPaperState withIssuance(PartyAndReference newIssuance) {
|
|
||||||
return new State(newIssuance, this.owner, this.faceValue, this.maturityDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommercialPaperState withFaceValue(Amount<Issued<Currency>> newFaceValue) {
|
public ICommercialPaperState withFaceValue(Amount<Issued<Currency>> newFaceValue) {
|
||||||
return new State(this.issuance, this.owner, newFaceValue, this.maturityDate);
|
return new State(this.issuance, this.owner, newFaceValue, this.maturityDate);
|
||||||
}
|
}
|
||||||
@ -127,6 +125,7 @@ public class JavaCommercialPaper implements Contract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface Clauses {
|
public interface Clauses {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
class Group extends GroupClauseVerifier<State, Commands, State> {
|
class Group extends GroupClauseVerifier<State, Commands, State> {
|
||||||
// This complains because we're passing generic types into a varargs, but it is valid so we suppress the
|
// This complains because we're passing generic types into a varargs, but it is valid so we suppress the
|
||||||
// warning.
|
// warning.
|
||||||
@ -146,6 +145,7 @@ public class JavaCommercialPaper implements Contract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
class Move extends Clause<State, Commands, State> {
|
class Move extends Clause<State, Commands, State> {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@ -177,6 +177,7 @@ public class JavaCommercialPaper implements Contract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
class Redeem extends Clause<State, Commands, State> {
|
class Redeem extends Clause<State, Commands, State> {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@ -219,6 +220,7 @@ public class JavaCommercialPaper implements Contract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
class Issue extends Clause<State, Commands, State> {
|
class Issue extends Clause<State, Commands, State> {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -76,7 +76,6 @@ class CommercialPaper : Contract {
|
|||||||
// Although kotlin is smart enough not to need these, as we are using the ICommercialPaperState, we need to declare them explicitly for use later,
|
// Although kotlin is smart enough not to need these, as we are using the ICommercialPaperState, we need to declare them explicitly for use later,
|
||||||
override fun withOwner(newOwner: CompositeKey): ICommercialPaperState = copy(owner = newOwner)
|
override fun withOwner(newOwner: CompositeKey): ICommercialPaperState = copy(owner = newOwner)
|
||||||
|
|
||||||
override fun withIssuance(newIssuance: PartyAndReference): ICommercialPaperState = copy(issuance = newIssuance)
|
|
||||||
override fun withFaceValue(newFaceValue: Amount<Issued<Currency>>): ICommercialPaperState = copy(faceValue = newFaceValue)
|
override fun withFaceValue(newFaceValue: Amount<Issued<Currency>>): ICommercialPaperState = copy(faceValue = newFaceValue)
|
||||||
override fun withMaturityDate(newMaturityDate: Instant): ICommercialPaperState = copy(maturityDate = newMaturityDate)
|
override fun withMaturityDate(newMaturityDate: Instant): ICommercialPaperState = copy(maturityDate = newMaturityDate)
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ class CommercialPaperLegacy : Contract {
|
|||||||
// Although kotlin is smart enough not to need these, as we are using the ICommercialPaperState, we need to declare them explicitly for use later,
|
// Although kotlin is smart enough not to need these, as we are using the ICommercialPaperState, we need to declare them explicitly for use later,
|
||||||
override fun withOwner(newOwner: CompositeKey): ICommercialPaperState = copy(owner = newOwner)
|
override fun withOwner(newOwner: CompositeKey): ICommercialPaperState = copy(owner = newOwner)
|
||||||
|
|
||||||
override fun withIssuance(newIssuance: PartyAndReference): ICommercialPaperState = copy(issuance = newIssuance)
|
|
||||||
override fun withFaceValue(newFaceValue: Amount<Issued<Currency>>): ICommercialPaperState = copy(faceValue = newFaceValue)
|
override fun withFaceValue(newFaceValue: Amount<Issued<Currency>>): ICommercialPaperState = copy(faceValue = newFaceValue)
|
||||||
override fun withMaturityDate(newMaturityDate: Instant): ICommercialPaperState = copy(maturityDate = newMaturityDate)
|
override fun withMaturityDate(newMaturityDate: Instant): ICommercialPaperState = copy(maturityDate = newMaturityDate)
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class ExplorerCaplet extends Capsule {
|
public class ExplorerCaplet extends Capsule {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
protected ExplorerCaplet(Capsule pred) {
|
protected ExplorerCaplet(Capsule pred) {
|
||||||
super(pred);
|
super(pred);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user