From aecbc1cba6e862c3d842012ce54d121764f78cb0 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 14 Jun 2019 10:58:51 -0400 Subject: 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 --- .../java/org/onap/policy/common/utils/validation/Assertions.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'utils/src/main/java/org/onap/policy/common/utils/validation/Assertions.java') 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 void instanceOf(final Object objectInstance, final Class 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 void assignableFrom(final Class checkClass, final Class 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()); } } } -- cgit 1.2.3-korg