-
Type:
Bug
-
Status: Done
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.6.11-sdk
-
Fix Version/s: 2.6.11-sdk
-
Component/s: core apis
-
Labels:
The safe check is not correct
Currently:
if (intValue >= 0 || intValue < ELEMENTS.length) {
should be:
if (intValue >= 0 && intValue < ELEMENTS.length) {
I like (0 <= intValue && intValue < ELEMENTS.length), I found it more readable
ResultCode.java
/** * Returns the result code having the specified integer value as defined in * RFC 4511 section 4.1.9. If there is no result code associated with the * specified integer value then a temporary result code is automatically * created in order to handle cases where unexpected result codes are * returned from the server. * * @param intValue * The integer value of the result code. * @return The result code. */ public static ResultCode valueOf(final int intValue) { ResultCode resultCode = null; if (intValue >= 0 || intValue < ELEMENTS.length) { resultCode = ELEMENTS[intValue]; } if (resultCode == null) { resultCode = new ResultCode(intValue, LocalizableMessage.raw("undefined(" + intValue + ")"), true); } return resultCode; }
- is required by
-
OPENAM-6867 changePassword REST endpoint is not returning LDAP issues that are related to a user mistake.
-
- Resolved
-