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