aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/MatcherWrapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/utils/MatcherWrapper.java')
-rw-r--r--main/src/cgeo/geocaching/utils/MatcherWrapper.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/utils/MatcherWrapper.java b/main/src/cgeo/geocaching/utils/MatcherWrapper.java
index c99d3c4..733a18e 100644
--- a/main/src/cgeo/geocaching/utils/MatcherWrapper.java
+++ b/main/src/cgeo/geocaching/utils/MatcherWrapper.java
@@ -2,6 +2,8 @@ package cgeo.geocaching.utils;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.eclipse.jdt.annotation.NonNull;
+
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -13,7 +15,7 @@ import java.util.regex.Pattern;
public class MatcherWrapper {
private final Matcher matcher;
- public MatcherWrapper(Pattern pattern, String input) {
+ public MatcherWrapper(@NonNull final Pattern pattern, @NonNull final String input) {
this.matcher = pattern.matcher(input);
}
@@ -24,14 +26,14 @@ public class MatcherWrapper {
return matcher.find();
}
- public boolean find(int start) {
+ public boolean find(final int start) {
return matcher.find(start);
}
/**
* see {@link Matcher#group(int)}
*/
- public String group(int index) {
+ public String group(final int index) {
return newString(matcher.group(index));
}
@@ -43,11 +45,9 @@ public class MatcherWrapper {
* <p>
* Do not change this method, even if Findbugs and other tools will report a violation for that line!
*
- * @param input
- * @return
*/
@SuppressFBWarnings("DM_STRING_CTOR")
- private static String newString(String input) {
+ private static String newString(final String input) {
if (input == null) {
return null;
}
@@ -78,7 +78,7 @@ public class MatcherWrapper {
/**
* see {@link Matcher#replaceAll(String)}
*/
- public String replaceAll(String replacement) {
+ public String replaceAll(final String replacement) {
return newString(matcher.replaceAll(replacement));
}
@@ -92,7 +92,7 @@ public class MatcherWrapper {
/**
* see {@link Matcher#replaceFirst(String)}
*/
- public String replaceFirst(String replacement) {
+ public String replaceFirst(final String replacement) {
return newString(matcher.replaceFirst(replacement));
}
}