commit | 17ee8026f64dd5b29e8ba00f36d4a579c2181d0d | [log] [tgz] |
---|---|---|
author | Milan Koníř <Konir.M@gmail.com> | Mon Feb 29 15:25:22 2016 +0100 |
committer | Milan Koníř <Konir.M@gmail.com> | Mon Feb 29 17:46:46 2016 +0100 |
tree | 81c09afbdfc0b6fff889c00f5c892d361a4c9196 | |
parent | 272fc16f60a794a83f2bac770d70e6f3de503002 [diff] |
GwtSpecificValidatorCreator generates wrong code for annotations with long value Bug-Link: https://github.com/gwtproject/gwt/issues/9288 Change-Id: Ib1c9956f51c4e4fdc601db7abb825b73c5b62ef9
diff --git a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java b/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java index 1350bb8..853a599 100644 --- a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java +++ b/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
@@ -184,7 +184,7 @@ } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource(); } else if (value instanceof Long) { - return JLongLiteral.get(((Long) value).intValue()).toSource(); + return JLongLiteral.get(((Long) value).longValue()).toSource(); } else if (value instanceof String) { return '"' + Generator.escape((String) value) + '"'; } else {
diff --git a/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java b/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java index ae62513..868b34a 100644 --- a/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java +++ b/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java
@@ -71,6 +71,10 @@ assertLiteral("1L", 1L); } + public void testAsLiteral_9999999999L() { + assertLiteral("9999999999L", 9999999999L); + } + public void testAsLiteral_a() { assertLiteral("'a'", 'a'); }