diff options
author | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-08-30 07:31:31 -0700 |
---|---|---|
committer | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-08-30 07:31:31 -0700 |
commit | 81bcf96396d1903e0b7f4a55b2e4a9ed86b0f5d2 (patch) | |
tree | d839e9a6d740ce76e60e84698ab27a5fa5348d58 /src/main/java/org | |
parent | ac3c28f302fbad8af915e05a2c4d9157a15149ba (diff) |
Fix a blocker issue reported by SOnar
Add a test to return a value that could potentially be null
Change-Id: I092ba4f21775ae64aa86f8dbff8538e47ca16c43
Issue-Id: CLAMP-43
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/model/CldsModel.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java index a830f9380..7eac3d92a 100644 --- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java +++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java @@ -300,8 +300,9 @@ public class CldsModel { */ public static CldsModel createUsingControlName(String fullControlName) { if (fullControlName == null || fullControlName.length() < UUID_LENGTH) { - throw new BadRequestException("closed loop id / control name length, " + fullControlName.length() - + ", less than the minimum of: " + UUID_LENGTH); + throw new BadRequestException( + "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0) + + ", less than the minimum of: " + UUID_LENGTH); } CldsModel model = new CldsModel(); model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH)); |