File tree 1 file changed +16
-6
lines changed
src/main/java/org/codehaus/plexus/util
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 18
18
19
19
20
20
import java .io .File ;
21
+ import java .util .ArrayList ;
22
+ import java .util .List ;
21
23
22
24
/**
23
25
* Scan a directory tree for files, with specified inclusions and exclusions.
@@ -262,11 +264,15 @@ public void setIncludes( String[] includes )
262
264
}
263
265
else
264
266
{
265
- this . includes = new String [ includes .length ] ;
266
- for ( int i = 0 ; i < includes . length ; i ++ )
267
+ final List < String > list = new ArrayList < String >( includes .length ) ;
268
+ for ( String include : includes )
267
269
{
268
- this .includes [i ] = normalizePattern ( includes [i ] );
270
+ if ( include != null )
271
+ {
272
+ list .add ( normalizePattern ( include ) );
273
+ }
269
274
}
275
+ this .includes = list .toArray ( new String [ list .size () ] );
270
276
}
271
277
}
272
278
@@ -290,11 +296,15 @@ public void setExcludes( String[] excludes )
290
296
}
291
297
else
292
298
{
293
- this . excludes = new String [ excludes .length ] ;
294
- for ( int i = 0 ; i < excludes . length ; i ++ )
299
+ final List < String > list = new ArrayList < String >( excludes .length ) ;
300
+ for ( String exclude : excludes )
295
301
{
296
- this .excludes [i ] = normalizePattern ( excludes [i ] );
302
+ if ( exclude != null )
303
+ {
304
+ list .add ( normalizePattern ( exclude ) );
305
+ }
297
306
}
307
+ this .excludes = list .toArray ( new String [ list .size () ] );
298
308
}
299
309
}
300
310
You can’t perform that action at this time.
0 commit comments