JetBrains/Grammar-Kit — pull request #23 by mdaniel (2014-01-29 05:19:00+00:00)
Title: Ensure JFlex resources are always returned in the correct order

If one does not have the JFlex.jar and the skeleton file, then the
plugin will download them. However, as a side effect of downloading them
it returns the `File` elements in the opposite order as the order they
are returned if they are found on disk.

To reproduce this:

1. Either install the production Grammar-Kit or run the Plugin configuration from 17af19bc (`master` as of right now)
1. Create (or open) a Java project
1. Create (or open) a `.flex` file
1. Ensure you **do not** have the `JFlex.jar` or the `idea-flex.skeleton` in your project directory
1. Right-click in the flex editor and choose "Run JFlex Generator"
1. Observe the `ClassNotFoundException` because the JFlex command line swapped the jar and skeleton file
1. Invoke "Run JFlex Generator" again
1. Observe that now the order of the command line is correct and the code is generated

This patch ensures that the downloaded resources are inserted into the result `List` in the same order as the urls, just like is done at the top of the method. There might be an opportunity for consolidating that logic, but it would have required restructuring the method a lot more. I figured the smaller the patch, the greater the likelihood of it landing.