From 8433427527214c83f56c533259efd7f56a1863b3 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 03 Nov 2014 10:50:04 +0000
Subject: [PATCH] AutoRefactored: - work with null checked expressions first - revert conditions - collapse if statements - push negations down - invert equals()
---
opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java b/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java
index 599efec..7619d89 100644
--- a/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java
+++ b/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java
@@ -250,10 +250,8 @@
Reject.ifNull(value);
// Make sure that we correctly encode negative values as "unlimited".
- if (allowUnlimited) {
- if (value < 0) {
- return UNLIMITED;
- }
+ if (allowUnlimited && value < 0) {
+ return UNLIMITED;
}
return value.toString();
@@ -264,10 +262,8 @@
public Integer decodeValue(String value) {
Reject.ifNull(value);
- if (allowUnlimited) {
- if (value.trim().equalsIgnoreCase(UNLIMITED)) {
- return -1;
- }
+ if (allowUnlimited && UNLIMITED.equalsIgnoreCase(value.trim())) {
+ return -1;
}
Integer i;
--
Gitblit v1.10.0