[JAVA-1056] Exception when creating my own ObjectId using a mac address Created: 03/Dec/13 Updated: 04/Dec/13 Resolved: 04/Dec/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steven Whyte | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
When creating my own ObjectId using a mac address "2e:20:8b:40:4e:01", the Java Driver throws IllegalArgumentException because of the ":" in the mac address and the length of the mac address. It looks like this should be ok according to the BSON spec? |
| Comments |
| Comment by Jeffrey Yemin [ 04/Dec/13 ] |
|
Yeah, that is not a valid string representation of an ObjectId. The MAC address is just one piece of it. |
| Comment by Steven Whyte [ 04/Dec/13 ] |
|
Jeff, I was getting the error when programmatically creating the ObjectId() as a new ObjectId("2e:20:8b:40:4e:01"), I have changed it to do it as part of persisting the document, and that work fine. Unless you see a problem with creating an new ObjectId using that constructor, then you might as well close this issue. Thanks |
| Comment by Jeffrey Yemin [ 03/Dec/13 ] |
|
Can you attach a test program please? |