Skip to content
Permalink
Browse files

[FIXED JENKINS-29934] Prevent UnsupportedOperationException with empt…

…y choice
  • Loading branch information
ikedam committed Aug 13, 2015
1 parent c798ede commit 667c2076c6e96a44d6d5613b625062bb21f20adf
@@ -295,29 +295,20 @@ public FilenameChoiceListProvider(String baseDirPath, String includePattern, Str
}
case Directory:
{
ret = Arrays.asList(ds.getIncludedDirectories());
ret = new ArrayList<String>(Arrays.asList(ds.getIncludedDirectories()));
break;
}
default:
{
// case File:
ret = Arrays.asList(ds.getIncludedFiles());
ret = new ArrayList<String>(Arrays.asList(ds.getIncludedFiles()));
break;
}
}

if(reverseOrder)
{
try
{
Collections.reverse(ret);
}
catch(UnsupportedOperationException _)
{
// ret is immutable.
ret = new ArrayList<String>(ret);
Collections.reverse(ret);
}
Collections.reverse(ret);
}

if(emptyChoiceType == null)

0 comments on commit 667c207

Please sign in to comment.
You can’t perform that action at this time.