Skip to content

Commit d232cbd

Browse files
committed
fix(lombok): do some reviwes
1 parent 7147345 commit d232cbd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main/java/com/mycmd/ShellContext.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
import lombok.Getter;
44
import lombok.Setter;
55
import lombok.NonNull;
6+
import lombok.AccessLevel;
67
import java.io.*;
78
import java.util.*;
89
import java.time.Instant;
910

10-
@Getter
11+
@Getter(AccessLevel.PUBLIC)
1112
public class ShellContext {
1213

1314
@Setter
1415
@NonNull
1516
private File currentDir;
16-
@Getter(AccessLevel.NONE)
1717
private List<String> history;
18-
@Getter(AccessLevel.NONE)
1918
private Map<String, String> aliases;
19+
2020
private static final String ALIAS_FILE = ".mycmd_aliases";
2121
private static final int MAX_HISTORY = 100;
22+
2223
private final List<String> commandHistory;
23-
private final Instant startTime;
24+
private final Instant startTime;
2425

2526
private final Map<String, String> envVars = new HashMap<>();
2627

@@ -43,7 +44,7 @@ public void addToHistory(String command) {
4344
}
4445

4546

46-
/** * RETAINED FOR SAFETY: Returns a DEFENSIVE COPY instead of the raw Map. */
47+
/** RETAINED FOR SAFETY: Returns a DEFENSIVE COPY instead of the raw Map. */
4748
public List<String> getHistory() {
4849
return new ArrayList<>(history);
4950
}
@@ -87,10 +88,9 @@ public String getEnvVar(String key) {
8788
return envVars.get(key);
8889
}
8990

90-
91-
9291
private void loadAliases() {
9392
File aliasFile = new File(System.getProperty("user.home"), ALIAS_FILE);
93+
// ... (method body remains the same)
9494
if (!aliasFile.exists()) {
9595
return;
9696
}
@@ -116,6 +116,7 @@ private void loadAliases() {
116116

117117
private void saveAliases() {
118118
File aliasFile = new File(System.getProperty("user.home"), ALIAS_FILE);
119+
// ... (method body remains the same)
119120
try (BufferedWriter writer = new BufferedWriter(new FileWriter(aliasFile))) {
120121
writer.write("# MyCMD Aliases Configuration\n");
121122
writer.write("# Format: aliasName=command\n\n");

0 commit comments

Comments
 (0)