18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2005, 2021 , Oracle and/or its affiliates. All rights reserved.
21
+ * Copyright (c) 2005, 2022 , Oracle and/or its affiliates. All rights reserved.
22
22
* Portions Copyright (c) 2011, Jens Elkner.
23
23
* Portions Copyright (c) 2017, 2020, Chris Fraire <[email protected] >.
24
24
*/
@@ -164,7 +164,7 @@ public static void main(String[] argv) {
164
164
165
165
Executor .registerErrorHandler ();
166
166
List <String > subFiles = RuntimeEnvironment .getInstance ().getSubFiles ();
167
- ArrayList <String > subFilesList = new ArrayList <>();
167
+ Set <String > subFilesArgs = new HashSet <>();
168
168
169
169
boolean createDict = false ;
170
170
@@ -242,10 +242,11 @@ public static void main(String[] argv) {
242
242
cfg .setCanonicalRoots (canonicalRoots );
243
243
244
244
// Assemble the unprocessed command line arguments (possibly a list of paths).
245
- // This will be used to perform more fine-grained checking in invalidateRepositories().
245
+ // This will be used to perform more fine-grained checking in invalidateRepositories()
246
+ // called from the setConfiguration() below.
246
247
for (String arg : argv ) {
247
248
String path = Paths .get (cfg .getSourceRoot (), arg ).toString ();
248
- subFilesList .add (path );
249
+ subFilesArgs .add (path );
249
250
}
250
251
251
252
// If a user used customizations for projects he perhaps just
@@ -266,10 +267,10 @@ public static void main(String[] argv) {
266
267
System .exit (1 );
267
268
}
268
269
269
- if (!IndexCheck .check (cfg , subFilesList )) {
270
+ if (!IndexCheck .check (cfg , subFilesArgs )) {
270
271
System .err .printf ("Index check failed%n" );
271
272
System .err .print ("You might want to remove " +
272
- (!subFilesList .isEmpty () ? "data for projects " + String .join ("," , subFilesList ) :
273
+ (!subFilesArgs .isEmpty () ? "data for projects " + String .join ("," , subFilesArgs ) :
273
274
"all data" ) + " under the data root and reindex\n " );
274
275
System .exit (1 );
275
276
}
@@ -278,7 +279,7 @@ public static void main(String[] argv) {
278
279
}
279
280
280
281
// Set updated configuration in RuntimeEnvironment.
281
- env .setConfiguration (cfg , subFilesList , CommandTimeoutType .INDEXER );
282
+ env .setConfiguration (cfg , subFilesArgs , CommandTimeoutType .INDEXER );
282
283
283
284
// Let repository types to add items to ignoredNames.
284
285
// This changes env so is called after the setConfiguration()
@@ -299,7 +300,7 @@ public static void main(String[] argv) {
299
300
* directory and not per project data root directory).
300
301
* For the check we need to have 'env' already set.
301
302
*/
302
- for (String path : subFilesList ) {
303
+ for (String path : subFilesArgs ) {
303
304
String srcPath = env .getSourceRootPath ();
304
305
if (srcPath == null ) {
305
306
System .err .println ("Error getting source root from environment. Exiting." );
@@ -326,7 +327,7 @@ public static void main(String[] argv) {
326
327
}
327
328
}
328
329
329
- if (!subFilesList .isEmpty () && subFiles .isEmpty ()) {
330
+ if (!subFilesArgs .isEmpty () && subFiles .isEmpty ()) {
330
331
System .err .println ("None of the paths were added, exiting" );
331
332
System .exit (1 );
332
333
}
0 commit comments