diff options
author | mmis <michael.morris@ericsson.com> | 2018-03-16 14:42:22 +0000 |
---|---|---|
committer | mmis <michael.morris@ericsson.com> | 2018-03-20 10:48:42 +0000 |
commit | 5492c1dd9d7052781ae5cab28bf5bcc829ae9c9e (patch) | |
tree | ec204aa0d662c87cdfc780b2c1a84ab40211a63c /common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java | |
parent | 7edd9111caddfed6867b7d5dca580c8eba34df44 (diff) |
Removed checkstyle warnings
Removed checkstyle warnings in policy/common/logging
Some warnings remain that required renaming of classes and public methods.
These will be taken separately
Issue-ID: POLICY-695
Change-Id: Id604c66708917de390c556b50f6266f929b09134
Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java')
-rw-r--r-- | common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java b/common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java index 17eee02a..94bfbb74 100644 --- a/common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java +++ b/common-logging/src/test/java/org/onap/policy/common/logging/util/TestUtils.java @@ -17,15 +17,27 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + + package org.onap.policy.common.logging.util; import static org.junit.Assert.fail; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; public class TestUtils { - - public static void overrideField(@SuppressWarnings("rawtypes") final Class clazz, final Object object, final String fieldName, final Object newValue) { + + /** + * Override a field. + * + * @param clazz the class the field belongs to + * @param object the instance of the class + * @param fieldName the name of the field + * @param newValue the value to set the field to + */ + public static void overrideField(@SuppressWarnings("rawtypes") final Class clazz, final Object object, + final String fieldName, final Object newValue) { try { final Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); @@ -38,8 +50,16 @@ public class TestUtils { fail(e.toString()); } } - - public static void overrideStaticField(@SuppressWarnings("rawtypes") final Class clazz, final String fieldName, final Object newValue) { + + /** + * Override a static field. + * + * @param clazz the class the field belongs to + * @param fieldName the name of the field + * @param newValue the value to set the field to + */ + public static void overrideStaticField(@SuppressWarnings("rawtypes") final Class clazz, final String fieldName, + final Object newValue) { try { final Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); |