Skip to content

Commit ca6d5c1

Browse files
fix warning problem in JShellState
1 parent 94ad880 commit ca6d5c1

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/main/java/driver/JShellState.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,28 @@
1111
*/
1212
public class JShellState implements IShellState {
1313
// this is the file system
14-
private FileSystem fs;
14+
private final FileSystem fs;
1515
// this is the current directory of JShell program
1616
private Directory currentDir;
1717
// this indicates if the program is running or not
1818
private boolean running;
1919
// a stack used for push and pop command
20-
private Stack<Directory> directoryStack;
21-
private ArrayList<String> commandsHistory;
22-
private ArrayList<String> correctCommandsHistory;
20+
private final Stack<Directory> directoryStack;
21+
private final ArrayList<String> commandsHistory;
22+
private final ArrayList<String> correctCommandsHistory;
2323

2424
/**
2525
* Constructs an object that holds JShell's important states including
2626
* the root directory, current directory, directory stack and a boolean that
2727
* indicates JShell is running
28-
* @param rootDir determines root and current directory of the program
2928
*/
3029
public JShellState() {
3130
this.running = true;
3231
this.fs = FileSystem.createFileSystemInstance();
3332
this.currentDir = fs.getRoot();
34-
this.commandsHistory = new ArrayList<String>();
33+
this.commandsHistory = new ArrayList<>();
3534
this.correctCommandsHistory = new ArrayList<>();
36-
this.directoryStack = new Stack<Directory>();
35+
this.directoryStack = new Stack<>();
3736
}
3837

3938
public boolean isRunning() {

0 commit comments

Comments
 (0)