[JAVA-2271] ConnectionString.getCredentialList should return immutable List Created: 02/Aug/16 Updated: 19/Oct/16 Resolved: 22/Sep/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API, Configuration |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.4.0-rc1, 3.4.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
It's a potential source of bugs for applications who write code like:
thinking that a credential is added to the list. But ConnectionString is actually immutable, and getCredentialList returns a new ArrayList each time it's called, making that call a no-op. The getCredentialList implementation should be updated to return an immutable list so that the above code results in a runtime exception, and the documentation should be updated to reflect that. The ConnectionString class should also be annotated with @Immutable. |
| Comments |
| Comment by Githook User [ 22/Sep/16 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |