[slf4j-dev] svn commit: r963 - slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers
ceki at slf4j.org
ceki at slf4j.org
Tue Feb 5 16:12:42 CET 2008
Author: ceki
Date: Tue Feb 5 16:12:42 2008
New Revision: 963
Modified:
slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java
Log:
- refer to the escape char '\\' as a constant
Modified: slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java
==============================================================================
--- slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java (original)
+++ slf4j/trunk/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java Tue Feb 5 16:12:42 2008
@@ -59,7 +59,8 @@
public class MessageFormatter {
static final char DELIM_START = '{';
static final char DELIM_STOP = '}';
-
+ private static final char ESCAPE_CHAR = '\\';
+
/**
* Performs single argument substitution for the 'messagePattern' passed as
* parameter.
@@ -186,7 +187,7 @@
return false;
}
char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1);
- if (potentialEscape == '\\') {
+ if (potentialEscape == ESCAPE_CHAR) {
return true;
} else {
return false;
@@ -195,7 +196,7 @@
static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) {
if (delimeterStartIndex >= 2
- && messagePattern.charAt(delimeterStartIndex - 2) == '\\') {
+ && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
return true;
} else {
return false;
More information about the slf4j-dev
mailing list