Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integer.parseInt in Group.createGroupSettingsFromJsonResponse faulty #36

Closed
GoogleCodeExporter opened this issue May 6, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

This is something I ran into while unit testing, I used a json part from my own 
google-voice account (only the names were changed to protect the innocent) so I 
MAY have the input string wrong.

Location of failure - 
com.techventus.server.voice.datatypes.Group.createGroupSettingsFromJsonResponse(
String json) line 100.

Instead of just grabbing the digit after "greetings": it grabs the rest of the 
entire string(see below).

I was able to fix this in my local copy by adding .substring(0,1)); to the end 
of the line. This would only grab the first character, but it would only be 
viable for integer values of 0-9, 10 and higher would be cut off.

this could also be fixed by using the ParsingUtil.removeUninterestingParts 
method that the rest of the variables inside the method use (assuming that my 
input string is valid) and would be valid for any integer value.

appologies if I'm barking up the wrong tree.

What steps will reproduce the problem?
run Group.createGroupSettingsFromJsonResponse with json string 
"\"groups\":{\"testID\":{\"id\":\"testID\",\"name\":\"testName\",\"disabledForwa
rdingIds\":{},\"isCustomForwarding\":false,\"isCustomGreeting\":false,\"isCustom
DirectConnect\":false,\"directConnect\":false,\"greetingId\":0,\"isCircle\":true
,\"isCustomTranscriptionLanguage\":false,\"transcriptionLanguage\":\"\"},\"group
List\"";


What is the expected output? What do you see instead?

expected: no error

actual - (fail trace)
java.lang.NumberFormatException: For input string: 
"0,"isCircle":true,"isCustomTranscriptionLanguage":false,"transcriptionLanguage"
:""}"



Please use labels and text to provide additional information.

Original issue reported on code.google.com by Biodro...@gmail.com on 18 Apr 2012 at 8:56

@GoogleCodeExporter
Copy link
Author

note: I have made no commited changes to SVN only my local copy.

Original comment by Biodro...@gmail.com on 18 Apr 2012 at 8:57

@GoogleCodeExporter
Copy link
Author

OK, I will try to test later in the next few weeks.  It is not a feature I have 
used much.  Is it something you might be able to debug, BioDroid?

Original comment by malone.j...@gmail.com on 18 Apr 2012 at 9:18

@GoogleCodeExporter
Copy link
Author

Assuming my input string is valid, and I have every reason to believe it is, I 
can have it fixed next update.

Original comment by Biodro...@gmail.com on 18 Apr 2012 at 10:23

@GoogleCodeExporter
Copy link
Author

Assuming my input string is valid, and I have every reason to believe it is, I 
can have it fixed next commit.

Original comment by Biodro...@gmail.com on 18 Apr 2012 at 10:23

@GoogleCodeExporter
Copy link
Author

OK, it looks like you have privileges, so go for it.

Original comment by malone.j...@gmail.com on 19 Apr 2012 at 5:47

@GoogleCodeExporter
Copy link
Author

fixed 

Original comment by Biodro...@gmail.com on 19 Apr 2012 at 4:10

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant