From 1cdad9b78056103a4ca1d1b71d996489787ed702 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 18 Jun 2019 12:47:14 -0400 Subject: Change getCanonicalName to getName in models Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Note: this impacts the output from PfValidationMessage, as it will now list the names of embedded classes with a "$" separator instead of a ".". Change-Id: I2cd64bc0281dd324bf80eac57335a7299a516447 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn --- .../org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java | 2 +- .../onap/policy/models/pdp/persistence/provider/PdpProviderTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models-pdp') diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java index 1e77c099d..36d5cc18e 100644 --- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/concepts/JpaPdpGroup.java @@ -285,7 +285,7 @@ public class JpaPdpGroup extends PfConcept implements PfAuthorative { return 0; } if (getClass() != otherConcept.getClass()) { - return this.getClass().getCanonicalName().compareTo(otherConcept.getClass().getCanonicalName()); + return this.getClass().getName().compareTo(otherConcept.getClass().getName()); } final JpaPdpGroup other = (JpaPdpGroup) otherConcept; diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java index 5cbbaaa8f..824c0a4fe 100644 --- a/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java +++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/persistence/provider/PdpProviderTest.java @@ -76,7 +76,7 @@ public class PdpProviderTest { @Before public void setupDao() throws Exception { final DaoParameters daoParameters = new DaoParameters(); - daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName()); + daoParameters.setPluginClass(DefaultPfDao.class.getName()); daoParameters.setPersistenceUnit("ToscaConceptTest"); -- cgit 1.2.3-korg