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
/*******************************************************************************
 * Copyright (c) 2008, 2009 Freescale Semiconductor and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Serge Beauchamp (Freescale Semiconductor) - [252996] initial API and implementation
 *     IBM Corporation - ongoing implementation
 *******************************************************************************/
package org.eclipse.ui.internal.ide.misc;
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileInfoFilter;
import org.eclipse.core.resources.IFileInfoFilterFactory;
import org.eclipse.core.resources.IProject;
import org.eclipse.ui.internal.ide.StringMatcher;
/**
 * A file info filter that uses a simple string matcher to match on file name.
 */
public class StringMatcherFilter implements IFileInfoFilterFactory {