The JAR Exporter allows to export JAR files from a selection of resources in the workspace. The description for such an export can be saved in JAR description files (*.jardesc). From these descriptions, an export can be started:
The export allows to save the description file, e.g., at the original location to update it with a modified selection of elements to be exported into the JAR:
The generated *.jardesc file is an XML file containing the selected elements, e.g.:
These elements are in arbitrary order, which can change upon every export.
Expected Behavior
In order to ease merging of these *.jardesc files, the order of the selected elements should be deterministic, e.g., simply by their name.
Additional Information
The write functionality for the JAR description file is defined in xmlWriteSelectedElements of org.eclipse.jdt.internal.ui.jarpackager.JarPackageWriter using the org.eclipse.jdt.ui.jarpackager.JarPackageData, in particular its selectedElements.
These elements are initialized in the getSelectedElements method of the org.eclipse.jdt.internal.ui.jarpackager.JarPackageWizardPage, which, in turn, uses the getSelectedResources method of the WizardExportResourcesPage. The selected elements are extracted from values of a HashMap, which results in random orders. It should be sufficient to sort the elements either in the getSelectedResources method:
Current Behavior
The JAR Exporter allows to export JAR files from a selection of resources in the workspace. The description for such an export can be saved in JAR description files (*.jardesc). From these descriptions, an export can be started:
The export allows to save the description file, e.g., at the original location to update it with a modified selection of elements to be exported into the JAR:
The generated *.jardesc file is an XML file containing the selected elements, e.g.:
These elements are in arbitrary order, which can change upon every export.
Expected Behavior
In order to ease merging of these *.jardesc files, the order of the selected elements should be deterministic, e.g., simply by their name.
Additional Information
The write functionality for the JAR description file is defined in
xmlWriteSelectedElements
oforg.eclipse.jdt.internal.ui.jarpackager.JarPackageWriter
using theorg.eclipse.jdt.ui.jarpackager.JarPackageData
, in particular itsselectedElements
. These elements are initialized in thegetSelectedElements
method of theorg.eclipse.jdt.internal.ui.jarpackager.JarPackageWizardPage
, which, in turn, uses thegetSelectedResources
method of theWizardExportResourcesPage
. The selected elements are extracted from values of aHashMap
, which results in random orders. It should be sufficient to sort the elements either in thegetSelectedResources
method:or in the
getSelectedElements
method: