View | Details | Raw Unified | Return to bug 306824 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/events/BuildManager.java (-1 / +7 lines)
Lines 991-996 Link Here
991
			if (project.isAccessible()) {
991
			if (project.isAccessible()) {
992
				Set rules = new HashSet();
992
				Set rules = new HashSet();
993
				commands = ((Project) project).internalGetDescription().getBuildSpec(false);
993
				commands = ((Project) project).internalGetDescription().getBuildSpec(false);
994
				boolean hasNullBuildRule = false;
994
				for (int i = 0; i < commands.length; i++) {
995
				for (int i = 0; i < commands.length; i++) {
995
					BuildCommand command = (BuildCommand) commands[i];
996
					BuildCommand command = (BuildCommand) commands[i];
996
					try {
997
					try {
Lines 999-1004 Link Here
999
							ISchedulingRule builderRule = builder.getRule();
1000
							ISchedulingRule builderRule = builder.getRule();
1000
							if (builderRule != null)
1001
							if (builderRule != null)
1001
								rules.add(builderRule);
1002
								rules.add(builderRule);
1003
							else 
1004
								hasNullBuildRule = true;
1002
						}
1005
						}
1003
					} catch (CoreException e) {
1006
					} catch (CoreException e) {
1004
						status.add(e.getStatus());
1007
						status.add(e.getStatus());
Lines 1006-1012 Link Here
1006
				}
1009
				}
1007
				if (rules.isEmpty())
1010
				if (rules.isEmpty())
1008
					return null;
1011
					return null;
1009
				return new MultiRule((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()]));
1012
				// Bug 306824 - Builders returning a null rule can't work safely if other builders require a non-null rule
1013
				// Be pessimistic and fall back to the default build rule (workspace root) in this case.
1014
				if (!hasNullBuildRule)
1015
					return new MultiRule((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()]));
1010
			}
1016
			}
1011
		} else {
1017
		} else {
1012
			// Returns the derived resources for the specified builderName
1018
			// Returns the derived resources for the specified builderName

Return to bug 306824