Skip to content

Commit c110291

Browse files
committed
Refactored output directory structure to use 'outputs' instead of 'execution'
1 parent efadadc commit c110291

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ local.properties
4646
.loadpath
4747
.recommenders
4848
.DS_Store
49-
execution/
49+
outputs/
5050
.env
5151

5252
# External tool builders

src/main/java/it/unipr/analysis/contract/SmartContract.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class SmartContract {
5454
private JSONArray _abi;
5555

5656
/** Base directory for storing contract analysis results. */
57-
private static Path _workingDirectory = Path.of("execution", "results");
57+
private static Path _workingDirectory = Path.of("outputs", MyTimestampUtil.getCurrentTimestamp());
5858

5959
/** Path to the contract's ABI file. */
6060
private Path _abiFilePath;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package it.unipr.utils;
2+
3+
import java.time.LocalDateTime;
4+
import java.time.format.DateTimeFormatter;
5+
6+
/**
7+
* Utility class for generating formatted timestamps.
8+
* <p>
9+
* This class provides static methods to retrieve the current timestamp in
10+
* various formats. All methods are thread-safe as they use immutable
11+
* {@link DateTimeFormatter} instances.
12+
*/
13+
public final class MyTimestampUtil {
14+
15+
/**
16+
* Date-time formatter for timestamp in the format: yyyyMMdd-HHmmss-SSS
17+
* (e.g., 20251015-143025-123)
18+
*/
19+
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd-HHmmss-SSS");
20+
21+
/**
22+
* Private constructor to prevent instantiation of this utility class.
23+
*/
24+
private MyTimestampUtil() {
25+
throw new AssertionError("Utility class should not be instantiated");
26+
}
27+
28+
/**
29+
* Returns the current timestamp as a formatted string.
30+
* <p>
31+
* The format is: yyyyMMdd-HHmmss-SSS
32+
* <ul>
33+
* <li>yyyyMMdd: Year, month, day (e.g., 20251015)</li>
34+
* <li>HHmmss: Hour, minutes, seconds in 24-hour format (e.g., 143025)</li>
35+
* <li>SSS: Milliseconds (e.g., 123)</li>
36+
* </ul>
37+
* Example output: "20251015-143025-123"
38+
*
39+
* @return the current timestamp as a formatted string
40+
*/
41+
public static String getCurrentTimestamp() {
42+
return LocalDateTime.now().format(FORMATTER);
43+
}
44+
}

src/test/java/it/unipr/analysis/cron/SmartaxeBenchmark.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import it.unipr.crosschain.xEVMLiSA;
77
import it.unipr.utils.EVMLiSAExecutor;
88
import it.unipr.utils.MyCache;
9+
import it.unipr.utils.MyTimestampUtil;
910
import java.io.IOException;
1011
import java.nio.file.Files;
1112
import java.nio.file.Path;
@@ -20,7 +21,8 @@
2021

2122
public class SmartaxeBenchmark {
2223
private static final Logger log = LogManager.getLogger(SmartaxeBenchmark.class);
23-
private static Path workingDirectory = Paths.get("execution", "smartaxe-benchmark");
24+
private static Path workingDirectory = Path.of("outputs", MyTimestampUtil.getCurrentTimestamp(),
25+
"smartaxe-benchmark");
2426

2527
public static void main(String[] args) {
2628
EVMLiSA.setWorkingDirectory(workingDirectory);

0 commit comments

Comments
 (0)