diff options
author | Krishnajinka <kris.jinka@samsung.com> | 2018-07-26 20:58:24 +0900 |
---|---|---|
committer | krishnajinka <kris.jinka@samsung.com> | 2018-07-28 11:47:46 +0900 |
commit | 1ecf9de8c889adb2dbc9ddd9a79d28e1da89d87b (patch) | |
tree | a946699b1ffec4845315e7e92e08d01b4ce927f7 /ONAP-PDP | |
parent | 1df87df1af0d215b9ff908dd15089393b9be270b (diff) |
Fix Sonar issues in utils PDP ParseLog rework
Fix Major Sonar issues in ParseLog BackupMonitor and ONAP-PDP component.
Issues related to nested control statements. Rework2 based on review comments
Issue-ID: POLICY-1013
Change-Id: I10edb242b45a649df902a4e7c1aba0a285b8b7fb
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
Diffstat (limited to 'ONAP-PDP')
-rw-r--r-- | ONAP-PDP/src/main/java/org/onap/policy/xacml/custom/OnapFunctionDefinitionFactory.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/ONAP-PDP/src/main/java/org/onap/policy/xacml/custom/OnapFunctionDefinitionFactory.java b/ONAP-PDP/src/main/java/org/onap/policy/xacml/custom/OnapFunctionDefinitionFactory.java index 35080d396..b69141f48 100644 --- a/ONAP-PDP/src/main/java/org/onap/policy/xacml/custom/OnapFunctionDefinitionFactory.java +++ b/ONAP-PDP/src/main/java/org/onap/policy/xacml/custom/OnapFunctionDefinitionFactory.java @@ -3,6 +3,7 @@ * ONAP-PDP * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,25 +59,25 @@ public class OnapFunctionDefinitionFactory extends FunctionDefinitionFactory { needMapInit = false; final Field[] declaredFields = StdFunctions.class.getDeclaredFields(); for (final Field field : declaredFields) { - if (Modifier.isStatic(field.getModifiers()) && field.getName().startsWith(StdFunctions.FD_PREFIX) - && FunctionDefinition.class.isAssignableFrom(field.getType()) - && Modifier.isPublic(field.getModifiers())) { - try { - register((FunctionDefinition) (field.get(null))); - } catch (final IllegalAccessException ex) { - logger.error(ex.getMessage() + ex); - } - } + registerFunctionDefinition(field); } - // - // Our custom function - // - // register(FunctionDefinitionCustomRegexpMatch); register(FD_CUSTOM_REGEXP_MATCH); } } } + private static void registerFunctionDefinition(Field field) { + if (Modifier.isStatic(field.getModifiers()) && field.getName().startsWith(StdFunctions.FD_PREFIX) + && FunctionDefinition.class.isAssignableFrom(field.getType()) + && Modifier.isPublic(field.getModifiers())) { + try { + register((FunctionDefinition) (field.get(null))); + } catch (final IllegalAccessException ex) { + logger.error(ex.getMessage() + ex); + } + } + } + public OnapFunctionDefinitionFactory() { initMap(); } |