Skip to content

Commit 0ab918e

Browse files
committed
Move OJMLTEST__getCustomer JML specs to JML file
Apparently, if a JML spec file exists, OpenJML ignores specs defined in the Java source file. In other words, any existing JML file supersedes Java files in terms of JML specs.
1 parent b3a74c0 commit 0ab918e

File tree

2 files changed

+5
-3
lines changed
  • smart-contract/hyperledger-fabric/v2/java
    • specs/hu/bme/mit/ftsrg/chaincode/tpcc
    • src/main/java/hu/bme/mit/ftsrg/chaincode/tpcc

2 files changed

+5
-3
lines changed

smart-contract/hyperledger-fabric/v2/java/specs/hu/bme/mit/ftsrg/chaincode/tpcc/TPCC.jml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ public final class TPCC implements ContractInterface {
5757
@*/
5858
private StockLevelOutput stockLevel(final TPCCContext ctx, final StockLevelInput input)
5959
throws EntityNotFoundException, NotFoundException;
60+
61+
/*@
62+
@ requires c_id < 2;
63+
@*/
64+
public String OJMLTEST__getCustomer(final TPCCContext ctx, final int c_w_id, final int c_d_id, final int c_id);
6065
}

smart-contract/hyperledger-fabric/v2/java/src/main/java/hu/bme/mit/ftsrg/chaincode/tpcc/TPCC.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ public String ping(final TPCCContext ctx) {
305305
* @return The customer with matching (C_W_ID, C_D_ID, C_ID), unless C_ID >= 2, in which case an
306306
* exception should be thrown by OpenJML
307307
*/
308-
// spotless:off
309-
//@ requires c_id < 2;
310-
// spotless:on
311308
@Transaction(intent = Transaction.TYPE.EVALUATE)
312309
public String OJMLTEST__getCustomer(
313310
final TPCCContext ctx, final int c_w_id, final int c_d_id, final int c_id) {

0 commit comments

Comments
 (0)