jfinal 3.4

This commit is contained in:
James 2018-04-02 14:15:59 +08:00
parent ef7b0da917
commit d12d3d8abb

View File

@ -58,9 +58,13 @@ public class Text extends Stat implements IWritable {
} }
if (content != null) { if (content != null) {
bytes = content.toString().getBytes(charset); synchronized (this) {
content = null; if (content != null) {
return bytes; bytes = content.toString().getBytes(charset);
content = null;
return bytes;
}
}
} }
bytes = new String(chars).getBytes(charset); bytes = new String(chars).getBytes(charset);
@ -73,11 +77,15 @@ public class Text extends Stat implements IWritable {
} }
if (content != null) { if (content != null) {
char[] charsTemp = new char[content.length()]; synchronized (this) {
content.getChars(0, content.length(), charsTemp, 0); if (content != null) {
chars = charsTemp; char[] charsTemp = new char[content.length()];
content = null; content.getChars(0, content.length(), charsTemp, 0);
return chars; chars = charsTemp;
content = null;
return chars;
}
}
} }
String strTemp = new String(bytes, charset); String strTemp = new String(bytes, charset);