Browse Source

Merge branch 'master' into jfinal-java8

James 7 years ago
parent
commit
7851a88c3f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/main/java/com/jfinal/template/stat/ast/Text.java

+ 8 - 0
src/main/java/com/jfinal/template/stat/ast/Text.java

@@ -67,6 +67,10 @@ public class Text extends Stat implements IWritable {
 			}
 			}
 		}
 		}
 		
 		
+		if (bytes != null) {
+			return bytes;
+		}
+		
 		bytes = new String(chars).getBytes(charset);
 		bytes = new String(chars).getBytes(charset);
 		return bytes;
 		return bytes;
 	}
 	}
@@ -88,6 +92,10 @@ public class Text extends Stat implements IWritable {
 			}
 			}
 		}
 		}
 		
 		
+		if (chars != null) {
+			return chars;
+		}
+		
 		String strTemp = new String(bytes, charset);
 		String strTemp = new String(bytes, charset);
 		char[] charsTemp = new char[strTemp.length()];
 		char[] charsTemp = new char[strTemp.length()];
 		strTemp.getChars(0, strTemp.length(), charsTemp, 0);
 		strTemp.getChars(0, strTemp.length(), charsTemp, 0);