cleanup, Overrides

This commit is contained in:
Vladimir Krivosheev
2013-08-27 17:49:15 +02:00
parent 3dddec40b2
commit 0f0f39eae6
2 changed files with 9 additions and 2 deletions
@@ -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() {
@@ -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("");
}