Convert Benchmark functions to public to avoid compilation errors
This commit is contained in:
parent
63d9335b09
commit
2f3fa76466
@ -35,7 +35,7 @@ public class LTrimRTrim {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Setup
|
@Setup
|
||||||
private void setup() {
|
public void setup() {
|
||||||
src = " White spaces left and right ";
|
src = " White spaces left and right ";
|
||||||
ltrimResult = "White spaces left and right ";
|
ltrimResult = "White spaces left and right ";
|
||||||
rtrimResult = " White spaces left and right";
|
rtrimResult = " White spaces left and right";
|
||||||
@ -68,7 +68,7 @@ public class LTrimRTrim {
|
|||||||
|
|
||||||
// Going through the String detecting Whitespaces
|
// Going through the String detecting Whitespaces
|
||||||
@Benchmark
|
@Benchmark
|
||||||
private boolean whileCharacters() {
|
public boolean whileCharacters() {
|
||||||
String ltrim = whileLtrim(src);
|
String ltrim = whileLtrim(src);
|
||||||
String rtrim = whileRtrim(src);
|
String rtrim = whileRtrim(src);
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ public class LTrimRTrim {
|
|||||||
|
|
||||||
// replaceAll() and Regular Expressions
|
// replaceAll() and Regular Expressions
|
||||||
@Benchmark
|
@Benchmark
|
||||||
private boolean replaceAllRegularExpression() {
|
public boolean replaceAllRegularExpression() {
|
||||||
String ltrim = src.replaceAll("^\\s+", "");
|
String ltrim = src.replaceAll("^\\s+", "");
|
||||||
String rtrim = src.replaceAll("\\s+$", "");
|
String rtrim = src.replaceAll("\\s+$", "");
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ public class LTrimRTrim {
|
|||||||
|
|
||||||
// Pattern matches() with replaceAll
|
// Pattern matches() with replaceAll
|
||||||
@Benchmark
|
@Benchmark
|
||||||
private boolean patternMatchesLTtrimRTrim() {
|
public boolean patternMatchesLTtrimRTrim() {
|
||||||
String ltrim = patternLtrim(src);
|
String ltrim = patternLtrim(src);
|
||||||
String rtrim = patternRtrim(src);
|
String rtrim = patternRtrim(src);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ public class LTrimRTrim {
|
|||||||
|
|
||||||
// Guava CharMatcher trimLeadingFrom / trimTrailingFrom
|
// Guava CharMatcher trimLeadingFrom / trimTrailingFrom
|
||||||
@Benchmark
|
@Benchmark
|
||||||
private boolean guavaCharMatcher() {
|
public boolean guavaCharMatcher() {
|
||||||
String ltrim = CharMatcher.whitespace().trimLeadingFrom(src);
|
String ltrim = CharMatcher.whitespace().trimLeadingFrom(src);
|
||||||
String rtrim = CharMatcher.whitespace().trimTrailingFrom(src);
|
String rtrim = CharMatcher.whitespace().trimTrailingFrom(src);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class LTrimRTrim {
|
|||||||
|
|
||||||
// Apache Commons StringUtils containsIgnoreCase
|
// Apache Commons StringUtils containsIgnoreCase
|
||||||
@Benchmark
|
@Benchmark
|
||||||
private boolean apacheCommonsStringUtils() {
|
public boolean apacheCommonsStringUtils() {
|
||||||
String ltrim = StringUtils.stripStart(src, null);
|
String ltrim = StringUtils.stripStart(src, null);
|
||||||
String rtrim = StringUtils.stripEnd(src, null);
|
String rtrim = StringUtils.stripEnd(src, null);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user