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 (+22 lines)
Lines 30-37 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
	
34
	public boolean accept(IFeature match) {
35
		
36
			System.out.println(match.getVersionedIdentifier());
37
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
38
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
39
			if (installed.length==0) return true;
40
			
41
			for (int i=0; i<installed.length; i++) {
42
				PluginVersionIdentifier ivid = installed[i].getVersionedIdentifier().getVersion();
43
				if (matchVid.isGreaterThan(ivid))
44
					continue;
45
				// installed version is the same or newer than
46
				// the match - filter out
47
				return false;
48
			}
49
			return true;
50
		
51
	}
52
	
33
	public boolean accept(IFeatureReference match) {
53
	public boolean accept(IFeatureReference match) {
54
		
34
		try {
55
		try {
56
			System.out.println(match.getVersionedIdentifier());
35
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
57
			PluginVersionIdentifier matchVid = match.getVersionedIdentifier().getVersion();
36
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
58
			IFeature [] installed = UpdateUtils.getInstalledFeatures(match.getVersionedIdentifier(), false);
37
			if (installed.length==0) return true;
59
			if (installed.length==0) return true;
(-)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