Skip to content

Commit

Permalink
[FIXED JENKINS-29934] Prevent UnsupportedOperationException with empt…
Browse files Browse the repository at this point in the history
…y choice
  • Loading branch information
ikedam committed Aug 13, 2015
1 parent c798ede commit 667c207
Showing 1 changed file with 3 additions and 12 deletions.
Expand Up @@ -295,29 +295,20 @@ protected static List<String> getFileList(
}
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)
Expand Down

0 comments on commit 667c207

Please sign in to comment.