Fixing the Java 1.5 build.

This commit is contained in:
Jesse Wilson 2010-09-02 09:29:26 +00:00
parent 747e3c3051
commit 202bbfeef0
3 changed files with 4 additions and 4 deletions

View File

@ -748,7 +748,7 @@ public final class JsonReader implements Closeable {
checkLenient();
pos--;
name = nextLiteral();
if (name.isEmpty()) {
if (name.length() == 0) {
throw syntaxError("Expected name");
}
}
@ -1071,7 +1071,7 @@ public final class JsonReader implements Closeable {
*/
private JsonToken readLiteral() throws IOException {
String literal = nextLiteral();
if (literal.isEmpty()) {
if (literal.length() == 0) {
throw syntaxError("Expected literal value");
}
value = literal;

View File

@ -165,7 +165,7 @@ public final class JsonWriter implements Closeable {
* @param indent a string containing only whitespace.
*/
public void setIndent(String indent) {
if (indent.isEmpty()) {
if (indent.length() == 0) {
this.indent = null;
this.separator = ":";
} else {

View File

@ -178,7 +178,7 @@ public final class JsonWriterTest extends TestCase {
jsonWriter.value(Double.MIN_VALUE);
jsonWriter.value(0.0);
jsonWriter.value(-0.5);
jsonWriter.value(Double.MIN_NORMAL);
jsonWriter.value(2.2250738585072014E-308);
jsonWriter.value(Math.PI);
jsonWriter.value(Math.E);
jsonWriter.endArray();