Bug 293303 NPE when adding a Regular Expression with no matching string
I20091025-2000 Steps: 1. Open Resource Filters properties page for a folder 2. Add an Exclude filter of type Regular Expression 3. Do *not* enter a matching string and press OK => Take a look at the Error Log: java.lang.NullPointerException at org.eclipse.core.internal.resources.RegexFilterFactory$RegexFilterType.matches(RegexFilterFactory.java:36) at org.eclipse.core.internal.resources.Filter.match(Filter.java:57) at org.eclipse.core.internal.resources.Filter.filterExcludes(Filter.java:147) at org.eclipse.core.internal.resources.Filter.filter(Filter.java:100) at org.eclipse.core.internal.resources.Resource.filterChildren(Resource.java:2228) at org.eclipse.core.internal.localstore.UnifiedTree.getLocalList(UnifiedTree.java:344) at org.eclipse.core.internal.localstore.UnifiedTree.addChildren(UnifiedTree.java:137) at org.eclipse.core.internal.localstore.UnifiedTree.addNodeChildrenToQueue(UnifiedTree.java:243) at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:109) at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:790) at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:774) at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1779) at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:166) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/misc/StringMatcherFilter.java
/**
	 * Creates a new factory for this filter type.
	 */
	public StringMatcherFilter() {
	}
	class FilterType implements IFileInfoFilter {
		StringMatcher matcher;
		/**
		 * @param arguments
		 */
		public FilterType(String arguments) {
			matcher = new StringMatcher(arguments, true, false);
		}
		/*
		 * (non-Javadoc)
		 * 
		 * @seeorg.eclipse.core.resources.IFilterType#matches(org.eclipse.core.
		 * filesystem.IFileInfo)
		 */
		public boolean matches(IFileInfo fileInfo) {
			return matcher.match(fileInfo.getName());
		}
	}
	public IFileInfoFilter instantiate(IProject project, Object arguments) {
		return new FilterType((String)arguments);
	}
}