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

Collapse All | Expand All

(-)vf2/org/eclipse/wst/validation/internal/MarkerManager.java (-1 / +5 lines)
Lines 106-112 Link Here
106
	 */
106
	 */
107
	public void deleteMarkers(IResource resource, long operationStartTime, int depth){
107
	public void deleteMarkers(IResource resource, long operationStartTime, int depth){
108
		try {
108
		try {
109
			hook(resource); 
109
			hook(resource);
110
111
			if(!resource.exists())
112
				return;
113
110
			IMarker[] markers = resource.findMarkers(null, true, depth);
114
			IMarker[] markers = resource.findMarkers(null, true, depth);
111
			String markerType;
115
			String markerType;
112
			for (IMarker marker : markers){
116
			for (IMarker marker : markers){
(-)vf2/org/eclipse/wst/validation/internal/ValBuilderJob.java (-9 / +17 lines)
Lines 320-331 Link Here
320
			// Check for file ADDED and REMOVED events, which means that the file may have moved to a new
320
			// Check for file ADDED and REMOVED events, which means that the file may have moved to a new
321
			// project. To be safe we clear it's cached list of validators.
321
			// project. To be safe we clear it's cached list of validators.
322
			if (((kind & (IResourceDelta.ADDED | IResourceDelta.REMOVED)) != 0)	&& resource.getType() == IResource.FILE) {
322
			if (((kind & (IResourceDelta.ADDED | IResourceDelta.REMOVED)) != 0)	&& resource.getType() == IResource.FILE) {
323
				ValManager.getDefault().clearValProperty(resource);
323
				ValManager.getDefault().clearValProperty(resource.getProject());
324
			}
324
			}
325
325
326
			if ((kind & (IResourceDelta.ADDED | IResourceDelta.CHANGED)) != 0){
326
			if ((kind & (IResourceDelta.ADDED | IResourceDelta.CHANGED)) != 0){
327
				ValManager.getDefault().validate(_request.getProject(), resource, delta.getKind(), ValType.Build, 
327
				ValManager.getDefault().validate(_request.getProject(), resource, delta.getKind(), ValType.Build,
328
					_request.getBuildKind(), _operation, _subMonitor.newChild(1));
328
						_request.getBuildKind(), _operation, _subMonitor.newChild(1));
329
			}
330
			
331
			if ((kind & (IResourceDelta.REMOVED)) != 0){
332
				
333
				IResource project = resource.getProject();
334
				if (!_operation.isValidatedProject(project))
335
				{
336
					ValManager.getDefault().validate(_request.getProject(), project, IResourceDelta.REMOVED, ValType.Build,
337
						_request.getBuildKind(), _operation, _subMonitor.newChild(1));
338
					_operation.addValidatedProject(project);
339
				}				
329
			}
340
			}
330
					
341
					
331
			IDependencyIndex index = ValidationFramework.getDefault().getDependencyIndex();
342
			IDependencyIndex index = ValidationFramework.getDefault().getDependencyIndex();
Lines 336-352 Link Here
336
					if (Friend.shouldValidate(val, dr.getResource(), ValType.Build, new ContentTypeWrapper())){
347
					if (Friend.shouldValidate(val, dr.getResource(), ValType.Build, new ContentTypeWrapper())){
337
						_operation.getState().put(ValidationState.TriggerResource, resource);
348
						_operation.getState().put(ValidationState.TriggerResource, resource);
338
						ValidationEvent event = new ValidationEvent(dr.getResource(), IResourceDelta.NO_CHANGE, delta);
349
						ValidationEvent event = new ValidationEvent(dr.getResource(), IResourceDelta.NO_CHANGE, delta);
339
						if (val.shouldClearMarkers(event))mm.clearMarker(dr.getResource(), val); 
350
						if (val.shouldClearMarkers(event))mm.clearMarker(dr.getResource(), val);
340
						ValManager.getDefault().validate(val, _operation, dr.getResource(), 
351
						ValManager.getDefault().validate(val, _operation, dr.getResource(),
341
							IResourceDelta.NO_CHANGE, _monitor, event);
352
							IResourceDelta.NO_CHANGE, _monitor, event);
342
					}
353
					}
343
				}
354
				}
344
			}
355
			}
345
					
356
			
346
			return true;
357
			return true;
347
		}
358
		}
348
349
		
350
	}
359
	}
351
352
}
360
}
(-)vf2/org/eclipse/wst/validation/internal/ValOperation.java (+27 lines)
Lines 62-67 Link Here
62
	 */
62
	 */
63
	private final Map<String, Set<IResource>> 	_validated = new HashMap<String, Set<IResource>>(20);
63
	private final Map<String, Set<IResource>> 	_validated = new HashMap<String, Set<IResource>>(20);
64
	
64
	
65
	private final Set<IResource>	_validatedProjects = new HashSet<IResource>(20);
66
	
65
	public ValOperation(){
67
	public ValOperation(){
66
		_multiProject = false;
68
		_multiProject = false;
67
	}
69
	}
Lines 116-121 Link Here
116
	}
118
	}
117
	
119
	
118
	/**
120
	/**
121
	 * Remember that this resource has been validated
122
	 *  
123
	 * @param resource resource that has been validated.
124
	 */
125
	
126
	public void addValidatedProject(IResource resource){
127
		synchronized(_validatedProjects){
128
			if (resource != null)
129
				_validatedProjects.add(resource);
130
		}
131
	}
132
	
133
	/**
119
	 * Answer if this resource has already been validated as a side-effect of some other validation by the
134
	 * Answer if this resource has already been validated as a side-effect of some other validation by the
120
	 * given validator.
135
	 * given validator.
121
	 * 
136
	 * 
Lines 130-135 Link Here
130
			return set.contains(resource);
145
			return set.contains(resource);
131
		}
146
		}
132
	}
147
	}
148
	
149
	/**
150
	 * Answer if this resource has been validated
151
	 * 
152
	 * @param resource
153
	 */
154
	
155
	public boolean isValidatedProject(IResource resource){
156
		synchronized(_validatedProjects){
157
			return _validatedProjects.contains(resource);
158
		}
159
	}
133
160
134
	/**
161
	/**
135
	 * Has this validator been suspended for the duration of this operation on this project?
162
	 * Has this validator been suspended for the duration of this operation on this project?

Return to bug 369587