mdarifmustafa / vt-middleware

Automatically exported from code.google.com/p/vt-middleware
0 stars 0 forks source link

ldaptive: Response.getResultCode() should not return null #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Open a connection without a ConnectionInitializer and the operation will return 
an empty Response:

Connection conn = DefaultConnectionFactory.getConnection(config);
Response<Void> response = conn.open();
ResultCode rc = response.getResultCode();
if (rc.compareTo(ResultCode.SUCCESS) != 0) {
    // incurs NPE because rc is null
}

What is the expected output? What do you see instead?
Response should return success rather than null... I don't want to have to add 
a null check.

What version of the product are you using? On what operating system?
1.0 on Windows

Original issue reported on code.google.com by ernie.ko...@gmail.com on 13 Jun 2013 at 10:05

GoogleCodeExporter commented 8 years ago
Result codes are associated with operations.
If no initialization operation is performed there is no result code to return.

Original comment by dfis...@gmail.com on 14 Jun 2013 at 3:08

GoogleCodeExporter commented 8 years ago
If your goal is to confirm that #open succeeded regardless of whether a 
ConnectionInitializer was configured, a try-catch block should suffice.
A failure in either should result in an LdapException.

Original comment by dfis...@gmail.com on 14 Jun 2013 at 2:44

GoogleCodeExporter commented 8 years ago
Marking this as won't fix for now.
Please comment if you have more to add to this issue.

Original comment by dfis...@gmail.com on 21 Jun 2013 at 2:27