diff --git a/jps/model-impl/src/com/intellij/openapi/fileTypes/WildcardFileNameMatcher.java b/jps/model-impl/src/com/intellij/openapi/fileTypes/WildcardFileNameMatcher.java index afbaaafbd292..8e22fe2cefa0 100644 --- a/jps/model-impl/src/com/intellij/openapi/fileTypes/WildcardFileNameMatcher.java +++ b/jps/model-impl/src/com/intellij/openapi/fileTypes/WildcardFileNameMatcher.java @@ -40,6 +40,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher { myMatcher = PatternUtil.fromMask(pattern).matcher(""); } + @Override public boolean matches(final String filename) { synchronized (myMatcher) { myMatcher.reset(filename); @@ -55,6 +56,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher { mySuffix = suffix; } + @Override public boolean matches(final String filename) { return filename.endsWith(mySuffix); } @@ -67,6 +69,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher { myPrefix = prefix; } + @Override public boolean matches(final String filename) { return filename.startsWith(myPrefix); } @@ -79,6 +82,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher { myInfix = infix; } + @Override public boolean matches(final String filename) { return filename.contains(myInfix); } @@ -108,10 +112,12 @@ public class WildcardFileNameMatcher implements FileNameMatcher { return new RegexpMatcher(pattern); } + @Override public boolean accept(@NotNull String fileName) { return myMatcher.matches(fileName); } + @Override @NonNls @NotNull public String getPresentableString() { diff --git a/platform/util/src/com/intellij/util/PatternUtil.java b/platform/util/src/com/intellij/util/PatternUtil.java index 8ef7e080c70a..7159a90d1601 100644 --- a/platform/util/src/com/intellij/util/PatternUtil.java +++ b/platform/util/src/com/intellij/util/PatternUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,8 @@ public class PatternUtil { // String pattern = mask.replaceAll("\\.", "\\.").replaceAll("\\*", ".*").replaceAll("\\?", "."); try { return Pattern.compile(convertToRegex(mask)); - } catch (PatternSyntaxException e) { + } + catch (PatternSyntaxException e) { LOG.error(mask, e); return Pattern.compile(""); }