[JAVA-913] MongoClient throws NumberFormatException when parsing http:// address Created: 31/Jul/13 Updated: 30/Jan/15 Resolved: 12/Aug/14 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | 2.11.2 |
| Fix Version/s: | 2.13.0, 3.0.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Gavin Price | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
Expected behavior: throw a more relevant exception, or at least a MongoException. |
| Comments |
| Comment by Githook User [ 30/Jan/15 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Fixed NumberFormat Exception when uri is missing the port
|
| Comment by Githook User [ 12/Aug/14 ] |
|
Author: {u'username': u'neerajbhatt', u'name': u'neerajbhatt', u'email': u'neerajbhatt2000@gmail.com'}Message: Fixing NumberFormatException when parsing http:// address https://jira.mongodb.org/browse/JAVA-913 Fixed, When http:// address is Refs |
| Comment by Githook User [ 12/Aug/14 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Fixed NumberFormat Exception when uri is missing the port
|
| Comment by Githook User [ 12/Aug/14 ] |
|
Author: {u'username': u'neerajbhatt', u'name': u'neerajbhatt', u'email': u'neerajbhatt2000@gmail.com'}Message: Fixing NumberFormatException when parsing http:// address https://jira.mongodb.org/browse/JAVA-913 Fixed, When http:// address is Refs |
| Comment by Neeraj Bhatt [ 12/Jul/14 ] |
|
Should we comment out below code and just throw UnknownHostException or it is mandatory that constructor should be able to parse host:port format ? int idx = host.indexOf( ":" ); |
| Comment by Neeraj Bhatt [ 20/Jun/14 ] |
|
We need to change port = Integer.parseInt( host.substring( idx + 1 ) ); (line 70 of Server Addres) as you will always receive integer is not valid (host:port) |