@@ -89,27 +89,27 @@ private static String formatDirectoryList(Set<String> sourceDirectories) {
89
89
}
90
90
91
91
private AgentSourceFilesList buildSourceFilesList (String workspacePath , Set <String > sourceDirectories ) {
92
- // Populate search stack with source directories
93
- final Stack <File > stack = new Stack <>();
92
+ // Populate search directory stack with source directories
93
+ final Stack <File > directoryStack = new Stack <>();
94
94
sourceDirectories .stream ()
95
95
.map (File ::new )
96
96
.filter (f -> f .exists () && f .isDirectory ())
97
- .forEach (stack ::push );
97
+ .forEach (directoryStack ::push );
98
98
99
99
// If no source directories are found in the workspace, use workspace root as search starting point
100
- if (stack .isEmpty ()) {
101
- stack .push (new File (workspacePath ));
100
+ if (directoryStack .isEmpty ()) {
101
+ directoryStack .push (new File (workspacePath ));
102
102
}
103
103
104
104
// Walk all directories and subdirectories and create a mapping for each file found
105
105
ArrayList <String > sourceFilesList = new ArrayList <>();
106
- while (!stack .empty () && stack .peek () != null ) {
107
- File f = stack .pop ();
106
+ while (!directoryStack .empty () && directoryStack .peek () != null ) {
107
+ File f = directoryStack .pop ();
108
108
File [] fileList = f .listFiles ();
109
109
if (fileList == null ) continue ;
110
- for (File child : Objects . requireNonNull ( f . listFiles ()) ) {
110
+ for (File child : fileList ) {
111
111
if (child .isDirectory ()) {
112
- stack .push (child );
112
+ directoryStack .push (child );
113
113
} else { // child.isFile()
114
114
sourceFilesList .add (child .getAbsolutePath ());
115
115
}
0 commit comments