Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 233757 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/jira/core/service/JiraClient.java (-1 / +22 lines)
Lines 14-19 Link Here
14
14
15
import java.io.File;
15
import java.io.File;
16
import java.io.OutputStream;
16
import java.io.OutputStream;
17
import java.util.Arrays;
18
import java.util.Collections;
19
import java.util.Comparator;
20
import java.util.List;
17
21
18
import org.apache.commons.httpclient.methods.multipart.PartSource;
22
import org.apache.commons.httpclient.methods.multipart.PartSource;
19
import org.eclipse.core.runtime.Assert;
23
import org.eclipse.core.runtime.Assert;
Lines 389-396 Link Here
389
		return (credentials != null) ? credentials.getUserName() : ""; //$NON-NLS-1$
393
		return (credentials != null) ? credentials.getUserName() : ""; //$NON-NLS-1$
390
	}
394
	}
391
395
396
	/**
397
	 * Returns sorted list of versions in descended order (the same as JIRA presents)
398
	 * 
399
	 * @param key
400
	 * @param monitor
401
	 * @return
402
	 * @throws JiraException
403
	 */
392
	public Version[] getVersions(String key, IProgressMonitor monitor) throws JiraException {
404
	public Version[] getVersions(String key, IProgressMonitor monitor) throws JiraException {
393
		return soapClient.getVersions(key, monitor);
405
406
		List<Version> versions = Arrays.asList(soapClient.getVersions(key, monitor));
407
408
		Collections.sort(versions, new Comparator<Version>() {
409
			public int compare(Version o1, Version o2) {
410
				return o1.getSequence() > o2.getSequence() ? -1 : (o1.getSequence() == o2.getSequence() ? 0 : 1);
411
			}
412
		});
413
414
		return versions.toArray(new Version[0]);
394
	}
415
	}
395
416
396
	@Override
417
	@Override

Return to bug 233757