Created
February 11, 2011 11:49
-
-
Save jlg/822241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/py4j-java/src/py4j/Protocol.java b/py4j-java/src/py4j/Protocol.java | |
| index 03be9d6..2e0113a 100644 | |
| --- a/py4j-java/src/py4j/Protocol.java | |
| +++ b/py4j-java/src/py4j/Protocol.java | |
| @@ -164,6 +164,10 @@ public class Protocol { | |
| return Integer.parseInt(commandPart.substring(1, commandPart.length())); | |
| } | |
| + public final static long getLong(String commandPart) { | |
| + return Long.parseLong(commandPart.substring(1, commandPart.length())); | |
| + } | |
| + | |
| public final static String getMemberOutputCommand(char memberType) { | |
| StringBuilder builder = new StringBuilder(); | |
| @@ -212,7 +216,10 @@ public class Protocol { | |
| case DOUBLE_TYPE: | |
| return getDouble(commandPart); | |
| case INTEGER_TYPE: | |
| - return getInteger(commandPart); | |
| + try { // try to fit it in Integer | |
| + return getInteger(commandPart); | |
| + } catch (NumberFormatException e) {} | |
| + return getLong(commandPart); | |
| case NULL_TYPE: | |
| return getNull(commandPart); | |
| case VOID: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment