diff options
author | Jim Hahn <jrh3@att.com> | 2019-06-14 10:58:51 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-06-14 10:58:51 -0400 |
commit | aecbc1cba6e862c3d842012ce54d121764f78cb0 (patch) | |
tree | 3e96270fcc43b0c2198e8468f8c644204bd42dc8 /utils/src | |
parent | fe5d78724f723a451ddc0d7cc41d6fc60092b314 (diff) |
Change getCanonicalName() to getName() in common
Per javadocs, getName() should generally be used instead of
Class.getCanonicalName().
This change only applies to classes; it does not apply to File
objects.
Change-Id: Iea0995d1167f4837607f194d35f0193eeedeacd7
Issue-ID: POLICY-1646
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils/src')
-rw-r--r-- | utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java b/utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java index 19a25295..047989e7 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java +++ b/utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -167,8 +168,8 @@ public final class Assertions { */ public static <T> void instanceOf(final Object objectInstance, final Class<T> requiredClass) { if (!requiredClass.isAssignableFrom(objectInstance.getClass())) { - throw new IllegalArgumentException(objectInstance.getClass().getCanonicalName() + " is not an instance of " - + requiredClass.getCanonicalName()); + throw new IllegalArgumentException(objectInstance.getClass().getName() + " is not an instance of " + + requiredClass.getName()); } } @@ -183,8 +184,8 @@ public final class Assertions { */ public static <T> void assignableFrom(final Class<?> checkClass, final Class<T> requiredClass) { if (!requiredClass.isAssignableFrom(checkClass)) { - throw new IllegalArgumentException(checkClass.getCanonicalName() + " is not an instance of " - + requiredClass.getCanonicalName()); + throw new IllegalArgumentException(checkClass.getName() + " is not an instance of " + + requiredClass.getName()); } } } |