Skip to content

gets Boolean valued data throws NumberFormatException #38

Closed
giridharkannan opened this Issue Feb 10, 2012 · 6 comments

2 participants

@giridharkannan

In gets method of AscIIClient.java
case 1:
break;
case 2:
flag = Byte.parseByte(sb.toString());
break;

sb is parsed as bytes instead of Integer so throwing NumberFormatException

@newroot
Collaborator
newroot commented May 29, 2012

flag is a byte acctually.

@newroot newroot closed this May 29, 2012
@giridharkannan

so is there a way to retrieve boolean data via gets

@newroot
Collaborator
newroot commented Jun 4, 2012

this client will serialize and deserialize the objects automatically, simply put the boolean data as Boolean, and get with a force (Boolean) conversion.

@giridharkannan

Sorry for confusing you by telling boolean, Instead I meant Boolean.
Am not sure whether you have tried it in your environment. If you have come across ASCIIClient code flow the set method will use NativeHandler.getMarkerFlag(Object value) to get the flag of an object in order to avoid serialization and de-serialization of known Data Types. So in case of Boolean (flag value 8192) and many other data types whose value is above byte range respective gets will result in NumberFormatException.

This will not happen in case of get as flag is of type int.

@newroot newroot added a commit that referenced this issue Jun 4, 2012
@newroot newroot resolve issue #38 c7d6c7f
@newroot
Collaborator
newroot commented Jun 4, 2012

Thanks for immediate information, I create a patch with 2.6.6

@giridharkannan

Thanks for the quick fix

@newroot newroot added a commit that referenced this issue Jun 4, 2012
@newroot newroot resolve issue #38 c5a8483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.