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

Collapse All | Expand All

(-)validate/org/eclipse/wst/validation/internal/ValidatorMetaData.java (-10 / +8 lines)
Lines 297-304 Link Here
297
	 */
297
	 */
298
	public boolean isApplicableTo(IResource resource, int resourceDelta) {
298
	public boolean isApplicableTo(IResource resource, int resourceDelta) {
299
		// If no filters are specified, then every type of resource should be validated/trigger a
299
		// If no filters are specified, then every type of resource should be validated/trigger a
300
		// rebuild of the model cache
300
		// rebuild of the model cache.
301
		if (_filters == null)return true;
301
		// Also make sure no content type id is specified (BUG 193816)
302
		if (_filters == null  && getContentTypeIds() == null)return true;
302
303
303
		return isApplicableTo(resource, resourceDelta, _filters);
304
		return isApplicableTo(resource, resourceDelta, _filters);
304
	}
305
	}
Lines 308-322 Link Here
308
	 */
309
	 */
309
	boolean isApplicableTo(IResource resource, int resourceDelta, ValidatorFilter[] filters) {
310
	boolean isApplicableTo(IResource resource, int resourceDelta, ValidatorFilter[] filters) {
310
		// Are any of the filters satisfied? (i.e., OR them, not AND them.)
311
		// Are any of the filters satisfied? (i.e., OR them, not AND them.)
311
		if (checkIfValidSourceFile(resource)) {
312
		// make sure filters is not null (BUG 193816)
312
			for (int i = 0; i < filters.length; i++) {
313
		if (filters != null && checkIfValidSourceFile(resource)) {
313
				ValidatorFilter filter = filters[i];
314
			for (ValidatorFilter filter : filters) {
314
				if (filter.isApplicableType(resource)
315
				if (filter.isApplicableType(resource)
315
						&& filter.isApplicableName(resource)
316
						&& filter.isApplicableName(resource)
316
						&& filter.isApplicableAction(resourceDelta)) {
317
						&& filter.isApplicableAction(resourceDelta)) {
317
					return true;
318
					return true;
318
				}
319
				}
319
320
			}
320
			}
321
		}
321
		}
322
		if (getContentTypeIds() != null) {
322
		if (getContentTypeIds() != null) {
Lines 327-336 Link Here
327
			} catch (CoreException e) {
327
			} catch (CoreException e) {
328
				//Resource exceptions
328
				//Resource exceptions
329
			}
329
			}
330
			if (description == null)
330
			if (description == null)return false;
331
				return false;
331
			if (isApplicableContentType(description))return true;
332
			if (isApplicableContentType(description))
333
				return true;
334
		}
332
		}
335
		return false;
333
		return false;
336
	}
334
	}

Return to bug 193816