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 167016 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/update/internal/operations/UpdateUtils.java (+1 lines)
Lines 400-405 Link Here
400
			category.setFeatures(features);
400
			category.setFeatures(features);
401
		UpdateSearchRequest searchRequest = new UpdateSearchRequest(category, scope);
401
		UpdateSearchRequest searchRequest = new UpdateSearchRequest(category, scope);
402
		searchRequest.addFilter(new EnvironmentFilter());
402
		searchRequest.addFilter(new EnvironmentFilter());
403
		searchRequest.addFilter(new BackLevelFilter());
403
		return searchRequest;
404
		return searchRequest;
404
	}
405
	}
405
406
(-)src/org/eclipse/update/search/BackLevelFilter.java (-1 / +20 lines)
Lines 30-36 Link Here
30
 * @since 3.0
30
 * @since 3.0
31
 */
31
 */
32
public class BackLevelFilter extends BaseFilter {
32
public class BackLevelFilter extends BaseFilter {
33
	public boolean accept(IFeatureReference match) {
33
	
34
	public boolean accept(IFeature match) {
35
		
36
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
37
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
38
			if (installed.length==0) return true;
39
			
40
			for (int i=0; i<installed.length; i++) {
41
				PluginVersionIdentifier ivid = installed[i].getVersionedIdentifier().getVersion();
42
				if (matchVid.isGreaterThan(ivid))
43
					continue;
44
				// installed version is the same or newer than
45
				// the match - filter out
46
				return false;
47
			}
48
			return true;
49
		
50
	}
51
	
52
	public boolean accept(IFeatureReference match) {		
34
		try {
53
		try {
35
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
54
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
36
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
55
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
(-)src/org/eclipse/update/search/EnvironmentFilter.java (+5 lines)
Lines 29-34 Link Here
29
 * @since 3.0
29
 * @since 3.0
30
 */
30
 */
31
public class EnvironmentFilter extends BaseFilter {
31
public class EnvironmentFilter extends BaseFilter {
32
	
33
	public boolean accept(IFeature match) {
34
		return UpdateManagerUtils.isValidEnvironment(match);
35
	}
36
	
32
	public boolean accept(IFeatureReference match) {
37
	public boolean accept(IFeatureReference match) {
33
		return UpdateManagerUtils.isValidEnvironment(match);
38
		return UpdateManagerUtils.isValidEnvironment(match);
34
	}
39
	}

Return to bug 167016