From c0973813ff330a39c910ed47736d145af489dadb Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Tue, 15 Aug 2023 11:49:39 +0200 Subject: [PATCH] avoid using inefficient Helper.getShortClassName methods through the codebase Signed-off-by: Lukas Jungmann --- .../testing/models/collections/Location.java | 4 +-- .../testing/models/collections/Menu.java | 6 ++--- .../testing/models/collections/MenuItem.java | 4 +-- .../testing/models/collections/Person.java | 4 +-- .../models/collections/Restaurant.java | 12 ++++----- .../testing/models/inheritance/Vehicle.java | 4 +-- .../testing/models/insurance/Claim.java | 4 +-- .../testing/models/insurance/Policy.java | 4 +-- .../testing/models/orderedlist/Project.java | 4 +-- .../testing/models/readonly/Address.java | 4 +-- .../testing/models/readonly/Charity.java | 4 +-- .../testing/models/readonly/Country.java | 4 +-- .../models/readonly/HollywoodAgent.java | 4 +-- .../testing/models/readonly/Promoter.java | 4 +-- .../models/readonly/ReadOnlyCharity.java | 4 +-- .../readonly/ReadOnlyHollywoodAgent.java | 4 +-- .../relationshipmaintenance/Customer.java | 4 +-- .../FieldLocation.java | 4 +-- .../relationshipmaintenance/FieldManager.java | 4 +-- .../relationshipmaintenance/FieldOffice.java | 4 +-- .../relationshipmaintenance/Resource.java | 4 +-- .../relationshipmaintenance/SalesPerson.java | 4 +-- .../aggregate/AgentBuilderTablesTest.java | 4 +-- .../rcm/broadcast/BroadcastSetupHelper.java | 4 +-- .../tests/dynamic/QuerySQLTracker.java | 4 +-- .../tests/employee/AddDescriptorsTest.java | 4 +-- .../expressions/ExpressionTestSuite.java | 4 +-- .../tests/feature/AddDescriptorsTest.java | 4 +-- .../testing/tests/manual/CommitOrderTest.java | 8 +++--- .../multipletable/MultipleTableModel.java | 4 +-- .../multipletable/MultipleTableTest.java | 4 +-- ...SwitchableOptimisticLockingPolicyTest.java | 4 +-- .../tests/queries/CollectionReadAllTest.java | 4 +-- .../testing/tests/queries/MapReadAllTest.java | 4 +-- .../StoredProcedureGeneratorForAdapter.java | 4 +-- .../tests/returning/TestModelAdapted.java | 4 +-- .../tests/returning/TestSystemAdapted.java | 6 ++--- .../AddDescriptorsMultithreadedTest.java | 4 +-- .../NullDelegateInValueHolderTest.java | 4 +-- .../ServerSessionReadPoolTypeTest.java | 4 +-- .../testing/tests/corba/CorbaTestModel.java | 7 ++--- .../iiop/RMIRemoteCommandConnectionImpl.java | 6 ++--- .../corba/CORBATransportManager.java | 4 +-- .../framework/JoinedAttributeTestHelper.java | 7 +++-- .../framework/SessionEventTracker.java | 7 +++-- .../framework/ui/TestingBrowserPanel.java | 4 +-- .../testing/tests/TestRunModel.java | 9 +++---- .../tools/sessionconsole/ClassInfo.java | 5 ++-- .../sessionconsole/ProfileBrowserPanel.java | 7 +++-- .../descriptors/ClassDescriptor.java | 4 +-- .../descriptors/InheritancePolicy.java | 2 +- .../descriptors/ReturningPolicy.java | 5 ++-- .../descriptors/copying/CloneCopyPolicy.java | 2 +- .../copying/InstantiationCopyPolicy.java | 3 +-- .../copying/PersistenceEntityCopyPolicy.java | 3 +-- .../dynamic/DynamicClassWriter.java | 3 +-- .../persistence/eis/EISConnectionSpec.java | 5 ++-- .../persistence/eis/EISMappedRecord.java | 2 +- .../eis/interactions/EISInteraction.java | 2 +- .../exceptions/DescriptorException.java | 3 +-- .../i18n/ExceptionMessageGenerator.java | 3 +-- .../persistence/history/AsOfClause.java | 3 +-- .../persistence/indirection/IndirectList.java | 2 +- .../persistence/indirection/IndirectMap.java | 2 +- .../persistence/indirection/IndirectSet.java | 2 +- .../internal/databaseaccess/DatabaseCall.java | 2 +- .../databaseaccess/DatabasePlatform.java | 18 ++++++------- .../databaseaccess/DatasourcePlatform.java | 13 +++++----- .../databaseaccess/FieldTypeDefinition.java | 4 +-- .../descriptors/InstantiationPolicy.java | 2 +- .../internal/descriptors/ObjectBuilder.java | 2 +- .../internal/dynamic/DynamicEntityImpl.java | 4 +-- .../internal/expressions/SQLStatement.java | 3 +-- .../internal/helper/ConcurrencyManager.java | 2 +- .../internal/helper/IdentityHashSet.java | 2 +- .../internal/history/HistoricalSession.java | 9 +++---- .../identitymaps/AbstractIdentityMap.java | 3 +-- .../identitymaps/IdentityMapManager.java | 8 +++--- .../indirection/DatabaseValueHolder.java | 3 +-- .../TransparentIndirectionPolicy.java | 2 +- .../persistence/internal/oxm/XMLAccessor.java | 3 +-- .../internal/queries/ContainerPolicy.java | 2 +- .../queries/ExpressionQueryMechanism.java | 5 ++-- .../internal/sessions/AbstractRecord.java | 2 +- .../internal/sessions/AbstractSession.java | 2 +- .../internal/sessions/ArrayRecord.java | 2 +- .../internal/sessions/CommitManager.java | 2 +- .../broadcast/BroadcastRemoteConnection.java | 9 +++---- .../rmi/RMIRemoteCommandConnectionImpl.java | 4 +-- .../sessions/remote/RemoteUnitOfWork.java | 3 +-- .../internal/sessions/remote/Transporter.java | 3 +-- .../persistence/logging/SessionLogEntry.java | 4 +-- .../mappings/ForeignReferenceMapping.java | 2 +- .../mappings/querykeys/QueryKey.java | 2 +- .../org/eclipse/persistence/oxm/XMLLogin.java | 3 +-- .../persistence/oxm/record/DOMRecord.java | 3 +-- .../platform/database/PostgreSQLPlatform.java | 3 +-- .../oracle/plsql/PLSQLStoredFunctionCall.java | 3 +-- .../queries/ObjectLevelModifyQuery.java | 3 +-- .../queries/StoredFunctionCall.java | 6 ++--- .../queries/StoredProcedureCall.java | 2 +- .../persistence/services/RuntimeServices.java | 2 +- .../persistence/sessions/DatasourceLogin.java | 3 +-- .../sessions/DefaultConnector.java | 3 +-- .../persistence/sessions/JNDIConnector.java | 5 ++-- .../eclipse/persistence/sessions/Project.java | 3 +-- .../factories/ProjectClassGenerator.java | 8 +++--- .../factories/TableCreatorClassGenerator.java | 4 +-- .../sessions/remote/DistributedSession.java | 3 +-- .../sessions/server/ConnectionPolicy.java | 3 +-- .../sessions/server/ConnectionPool.java | 3 +-- .../persistence/tools/profiler/Profile.java | 2 +- .../DatabaseObjectDefinition.java | 3 +-- .../schemaframework/FieldDefinition.java | 3 +-- .../StoredFunctionDefinition.java | 5 ++-- .../StoredProcedureGenerator.java | 8 +++--- .../jgroups/JGroupsRemoteConnection.java | 3 +-- .../testing/tests/OracleTestModel.java | 9 ++++--- .../DbChangeNotificationAdapter.java | 6 ++--- .../tests/jpa/dynamic/QuerySQLTracker.java | 7 +++-- .../jpa/advanced/AdvancedJPAJunitTest.java | 6 ++--- .../advanced/EntityManagerJUnitTestSuite.java | 26 +++++++++---------- .../advanced/EntityManagerJUnitTest.java | 16 ++++++------ .../testing/tests/jpa/QuerySQLTracker.java | 6 ++--- .../jpa/fieldaccess/QuerySQLTracker.java | 6 ++--- .../advanced/EntityManagerJUnitTest.java | 14 +++++----- .../advanced/EntityManagerTLRJUnitTest.java | 14 +++++----- .../models/jpa/inheritance/Vehicle.java | 4 +-- .../JPAPerformanceComparisonModel.java | 6 ++--- .../XmlCompositeAdvancedJUnitTest.java | 4 +-- .../advanced/XmlExtendedAdvancedTest.java | 4 +-- .../models/jpa/xml/inheritance/Vehicle.java | 4 +-- .../org/eclipse/persistence/sdo/SDOType.java | 5 ++-- .../sdo/helper/SDOClassGenerator.java | 6 ++--- 134 files changed, 291 insertions(+), 336 deletions(-) diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Location.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Location.java index 5aeac4e5185..94a88132dc5 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Location.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Location.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -160,7 +160,7 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl */ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass())); + buf.append(getClass().getSimpleName()); buf.append("("); if (getArea() != null) { buf.append(getArea()); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Menu.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Menu.java index 52db6777352..5d1abeaef0d 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Menu.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Menu.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -223,10 +223,10 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl */ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": " + this.getType()); + buf.append(getClass().getSimpleName() + ": " + this.getType()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); if (getItems() != null) { - buf.append("MenuItems: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getItems().getClass())); + buf.append("MenuItems: " + getItems().getClass().getSimpleName()); buf.append(getItems().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/MenuItem.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/MenuItem.java index 57f9542709d..aa3d0179811 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/MenuItem.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/MenuItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -272,7 +272,7 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl */ public String toString() { StringBuffer buf = new StringBuffer(); - buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass())); + buf.append(getClass().getSimpleName()); buf.append("("); if (getName() != null) { buf.append(getName().substring(0, Math.min(10, getName().length()))); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Person.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Person.java index 15438c35bd9..28d0c7d29f5 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Person.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Person.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -115,6 +115,6 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl * @return a string representation of the receiver */ public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": " + this.getFirstName() + " " + this.getLastName(); + return getClass().getSimpleName() + ": " + this.getFirstName() + " " + this.getLastName(); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Restaurant.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Restaurant.java index e289f94d8d2..4f850f64af4 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Restaurant.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/collections/Restaurant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -121,27 +121,27 @@ public String allToString() { buf.append("Restaurant: " + this.getName()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); if (getMenus() != null) { - buf.append("Menus: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getMenus().getClass())); + buf.append("Menus: " + getMenus().getClass().getSimpleName()); buf.append(getMenus().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } if (getWaiters() != null) { - buf.append("Waiters: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getWaiters().getClass())); + buf.append("Waiters: " + getWaiters().getClass().getSimpleName()); buf.append(getWaiters().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } if (getPreferredCustomers() != null) { - buf.append("PreferredCustomers: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getPreferredCustomers().getClass())); + buf.append("PreferredCustomers: " + getPreferredCustomers().getClass().getSimpleName()); buf.append(getPreferredCustomers().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } if (getLocations() != null) { - buf.append("Locations: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getLocations().getClass())); + buf.append("Locations: " + getLocations().getClass().getSimpleName()); buf.append(getLocations().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } if (getSlogans() != null) { - buf.append("Slogan: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getSlogans().getClass())); + buf.append("Slogan: " + getSlogans().getClass().getSimpleName()); buf.append(getSlogans().toString()); buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/inheritance/Vehicle.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/inheritance/Vehicle.java index ddc907f7255..45818a35fca 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/inheritance/Vehicle.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/inheritance/Vehicle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -87,6 +87,6 @@ public static ViewDefinition mySQLView() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + id + ")"; + return getClass().getSimpleName() + "(" + id + ")"; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Claim.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Claim.java index 2348910d4cc..c549ae9e050 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Claim.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Claim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -56,6 +56,6 @@ public void setPolicy(Policy policy) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + ": " + getAmount(); + return getClass().getSimpleName() + ": " + getAmount(); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Policy.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Policy.java index 67b705b5fb2..b8a103ab071 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Policy.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/insurance/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -97,6 +97,6 @@ public void setPolicyNumber(long policyNumber) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + ": " + getPolicyNumber(); + return getClass().getSimpleName() + ": " + getPolicyNumber(); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/orderedlist/Project.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/orderedlist/Project.java index 32c0ab8178b..094125ac8c6 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/orderedlist/Project.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/orderedlist/Project.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -132,7 +132,7 @@ public void setEmployees(List employees) { public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(this) + ": "); + writer.write(getClass().getSimpleName() + ": "); writer.write(getName()); return writer.toString(); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Address.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Address.java index 4a8b2bdfd27..66080820e04 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Address.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Address.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -173,7 +173,7 @@ public static TableDefinition tableDefinition() { public String toString() { java.io.StringWriter stringWriter = new java.io.StringWriter(); java.io.PrintWriter writer = new java.io.PrintWriter(stringWriter); - writer.print(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass())); + writer.print(getClass().getSimpleName()); writer.print("("); if (streetAddress == null) { writer.print("null"); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Charity.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Charity.java index 8ad4811dfa4..73bf8a5acad 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Charity.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Charity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -111,6 +111,6 @@ public static TableDefinition tableDefinition() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Country.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Country.java index cb9426ff4ac..ec5f6a4ca45 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Country.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Country.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -114,7 +114,7 @@ public static TableDefinition tableDefinition() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/HollywoodAgent.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/HollywoodAgent.java index 924d8163dfe..4aea391294e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/HollywoodAgent.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/HollywoodAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -114,6 +114,6 @@ public static TableDefinition tableDefinition() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Promoter.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Promoter.java index 3d26bd8c7ed..d0e89d052f0 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Promoter.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/Promoter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -117,6 +117,6 @@ public static TableDefinition tableDefinition() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyCharity.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyCharity.java index 4cd891f290f..1e5a4865cae 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyCharity.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyCharity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -70,6 +70,6 @@ public void setName(String newValue) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyHollywoodAgent.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyHollywoodAgent.java index 1198b2c5454..3800b494583 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyHollywoodAgent.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/readonly/ReadOnlyHollywoodAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -72,6 +72,6 @@ public void setName(String newValue) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") "; + return getClass().getSimpleName() + "(" + getName() + ") "; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Customer.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Customer.java index 187c74de5cb..50b708e293b 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Customer.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -109,6 +109,6 @@ public void setSalespeople(Collection collection) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldLocation.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldLocation.java index 1158b7e23b4..2cbf34b375d 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldLocation.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldLocation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -74,6 +74,6 @@ public void setId(int newId) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldManager.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldManager.java index b89f445bcaf..d42190644e4 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldManager.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -67,6 +67,6 @@ public void setOffice(FieldOffice newOffice) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldOffice.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldOffice.java index 7a0fd5ca939..946e6bdc2f9 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldOffice.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/FieldOffice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -76,7 +76,7 @@ public void setSalespeople(Collection newSalespeople) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } /** diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Resource.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Resource.java index c2af76f75cd..72f9977ae4e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Resource.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/Resource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -70,7 +70,7 @@ public void setName(String newName) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } /** diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/SalesPerson.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/SalesPerson.java index 0a1aa2477fa..32366670b2b 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/SalesPerson.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/relationshipmaintenance/SalesPerson.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -116,6 +116,6 @@ public void setName(java.lang.String newName) { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")"; + return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")"; } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/aggregate/AgentBuilderTablesTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/aggregate/AgentBuilderTablesTest.java index 16110d0979d..31aad833a48 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/aggregate/AgentBuilderTablesTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/aggregate/AgentBuilderTablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -81,7 +81,7 @@ String verifyDescriptor(ClassDescriptor desc, boolean tableNameShouldStartWithBu } } if(localErrorMsg.length() > 0) { - localErrorMsg = "Ref.descriptor class: " + Helper.getShortClassName(desc.getJavaClass()) +"; mapping: "+ attributeName + ": " + localErrorMsg + "\n"; + localErrorMsg = "Ref.descriptor class: " + desc.getJavaClass().getSimpleName() +"; mapping: "+ attributeName + ": " + localErrorMsg + "\n"; } return localErrorMsg; } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/broadcast/BroadcastSetupHelper.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/broadcast/BroadcastSetupHelper.java index 419716790c0..f335ab9249f 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/broadcast/BroadcastSetupHelper.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/distributedservers/rcm/broadcast/BroadcastSetupHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -294,7 +294,7 @@ public static TestCase getTestCase(Object test, String testShortClassName, boole testToLookAt = ((TestWrapper)testToLookAt).getWrappedTest(); } } - if (Helper.getShortClassName(testToLookAt).equals(testShortClassName)) { + if (testToLookAt.getClass().getSimpleName().equals(testShortClassName)) { // return the wrapped test return (TestCase)test; } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/dynamic/QuerySQLTracker.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/dynamic/QuerySQLTracker.java index 3e9917bb8d3..0a13f05c7c6 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/dynamic/QuerySQLTracker.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/dynamic/QuerySQLTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -174,7 +174,7 @@ protected void setQuery(DatabaseQuery query) { @SuppressWarnings("unchecked") protected void setResult(Object queryResult) { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(query)); + writer.write(query.getClass().getSimpleName()); writer.write("[" + System.identityHashCode(query) + "]"); writer.write(" result = "); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/employee/AddDescriptorsTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/employee/AddDescriptorsTest.java index 62f8cd8da17..809ac1b8473 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/employee/AddDescriptorsTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/employee/AddDescriptorsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -42,7 +42,7 @@ public void reset() { Iterator> iterator = getSession().getDescriptors().keySet().iterator(); while (iterator.hasNext()) { Class cls = iterator.next(); - String packageName = Helper.getPackageName(cls); + String packageName = cls.getPackageName(); if (packageName.equals("org.eclipse.persistence.testing.models.employee.interfaces")) { getSession().getDescriptors().remove(cls); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/expressions/ExpressionTestSuite.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/expressions/ExpressionTestSuite.java index 2fe46cbe95d..8ed271e4a60 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/expressions/ExpressionTestSuite.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/expressions/ExpressionTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -219,7 +219,7 @@ private void addAggregeateCollectionJoinTest(Class cls) { ReadAllExpressionTest test = new ReadAllExpressionTest(cls, 1); test.setExpression(expression); - test.setName("Aggregate Colection Join Test " + Helper.getShortClassName(cls)); + test.setName("Aggregate Colection Join Test " + cls.getSimpleName()); test.setDescription("Test aggregate collection join with 2 anyOf clauses"); addTest(test); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/AddDescriptorsTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/AddDescriptorsTest.java index 1c136f4ece7..e9c9c4d29d4 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/AddDescriptorsTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/AddDescriptorsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -43,7 +43,7 @@ public void reset() { Iterator> iterator = getSession().getDescriptors().keySet().iterator(); while (iterator.hasNext()) { Class cls = iterator.next(); - String packageName = Helper.getPackageName(cls); + String packageName = cls.getPackageName(); if (packageName.equals("org.eclipse.persistence.testing.models.employee.interfaces")) { getSession().getDescriptors().remove(cls); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/manual/CommitOrderTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/manual/CommitOrderTest.java index e54570faea7..7114c6eac95 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/manual/CommitOrderTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/manual/CommitOrderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,9 +29,9 @@ public CommitOrderTest() { setDescription("Check that the commit order is consistent and order by 1-1 constraints."); } - public void printClasses(List classes) { - for (Iterator iterator = classes.iterator(); iterator.hasNext();) { - System.out.print(org.eclipse.persistence.internal.helper.Helper.getShortClassName((Class)iterator.next())); + public void printClasses(List> classes) { + for (Iterator> iterator = classes.iterator(); iterator.hasNext();) { + System.out.print(iterator.next().getSimpleName()); System.out.print(", "); } System.out.println(":"); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableModel.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableModel.java index 3890c987da2..92475cf1dbe 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableModel.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -143,7 +143,7 @@ public static class ReadAllTest extends TestCase { Class cls; public ReadAllTest(Class cls) { super(); - setName(Helper.getShortClassName(cls) + "ReadAllTest"); + setName(cls.getSimpleName() + "ReadAllTest"); this.cls = cls; } @Override diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableTest.java index 071626bac05..9f3bb45009f 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/multipletable/MultipleTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,7 +35,7 @@ public class MultipleTableTest extends AutoVerifyTestCase { public MultipleTableTest(Object testObject) { m_testObject = testObject; - setName("Multiple table test [" + Helper.getShortClassName(m_testObject) + "]"); + setName("Multiple table test [" + m_testObject.getClass().getSimpleName() + "]"); } @Override diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/optimisticlocking/SwitchableOptimisticLockingPolicyTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/optimisticlocking/SwitchableOptimisticLockingPolicyTest.java index 77d33c4ceb1..dd2cb659c60 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/optimisticlocking/SwitchableOptimisticLockingPolicyTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/optimisticlocking/SwitchableOptimisticLockingPolicyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -49,7 +49,7 @@ public class SwitchableOptimisticLockingPolicyTest extends TestCase { public SwitchableOptimisticLockingPolicyTest(Class optimisticLockingPolicyClass) { super(); - setName(getName() + " (" + Helper.getShortClassName(optimisticLockingPolicyClass) + ")"); + setName(getName() + " (" + optimisticLockingPolicyClass.getSimpleName() + ")"); this.optimisticLockingPolicyClass = optimisticLockingPolicyClass; this.oldOptimisticLockingPolicies = new HashMap(); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/CollectionReadAllTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/CollectionReadAllTest.java index 7ac9299c725..1ca50f5b9c7 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/CollectionReadAllTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/CollectionReadAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +29,7 @@ public class CollectionReadAllTest extends org.eclipse.persistence.testing.frame public CollectionReadAllTest(Class referenceClass, int originalObjectsSize, ReadAllQuery query) { super(referenceClass, originalObjectsSize); this.setQuery(query); - setName("CollectionReadAllTest(" + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getQuery().getContainerPolicy().getContainerClass()) + "," + org.eclipse.persistence.internal.helper.Helper.getShortClassName(referenceClass) + ")"); + setName("CollectionReadAllTest(" + getQuery().getContainerPolicy().getContainerClass().getSimpleName() + "," + referenceClass.getSimpleName() + ")"); } /** diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/MapReadAllTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/MapReadAllTest.java index c88e3b49a19..fa8478a065e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/MapReadAllTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/MapReadAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -29,7 +29,7 @@ public class MapReadAllTest extends ReadAllTest { public MapReadAllTest(Class referenceClass, int originalObjectsSize, ReadAllQuery query) { super(referenceClass, originalObjectsSize); this.setQuery(query); - setName("MapReadAllTest(" + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getQuery().getContainerPolicy().getContainerClass()) + "," + org.eclipse.persistence.internal.helper.Helper.getShortClassName(referenceClass) + ")"); + setName("MapReadAllTest(" + getQuery().getContainerPolicy().getContainerClass().getSimpleName() + "," + referenceClass.getSimpleName() + ")"); } /** diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/StoredProcedureGeneratorForAdapter.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/StoredProcedureGeneratorForAdapter.java index 536e9923412..a5e4e7d67c1 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/StoredProcedureGeneratorForAdapter.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/StoredProcedureGeneratorForAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -253,7 +253,7 @@ protected String shortClassName(String originalClassName, int numberOfPackagesTo protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, List fields, String namePrefix) { String namePrefixToUse = namePrefix; - String className = Helper.getShortClassName(query.getDescriptor().getJavaClass()); + String className = query.getDescriptor().getJavaClass().getSimpleName(); if (useTableNames) { String tableName = query.getDescriptor().getTableName(); if (!compareNames(className, tableName)) { diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestModelAdapted.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestModelAdapted.java index 06f69483608..e9eff231dab 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestModelAdapted.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestModelAdapted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,7 +35,7 @@ public TestModelAdapted(TestModel testModelToBeAdapted, ProjectAndDatabaseAdapte } getTestModel().getTests().clear(); setAdapter(adapter); - setName(getTestModel().getName() + " using " + Helper.getShortClassName(getAdapter())); + setName(getTestModel().getName() + " using " + getAdapter().getClass().getSimpleName()); } public TestModelAdapted(TestModel testModelToBeAdapted, ProjectAndDatabaseAdapter adapter, String[] testNamesToExclude) { diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestSystemAdapted.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestSystemAdapted.java index ea6cecfd475..3254b2fafd1 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestSystemAdapted.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/returning/TestSystemAdapted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -68,7 +68,7 @@ public void addDescriptors(DatabaseSession session) { try { tempTestSystem.createTables(session); } catch (Exception ex2) { - throw new TestProblemException("Exception thrown by " + Helper.getShortClassName(tempTestSystem) + ".createTables() ", ex2); + throw new TestProblemException("Exception thrown by " + tempTestSystem.getClass().getSimpleName() + ".createTables() ", ex2); } } catch (Exception ex1) { throw new TestProblemException("Failed to create an instance of " + getTestSystem().getClass() + " ", ex1); @@ -92,7 +92,7 @@ public void createTables(DatabaseSession session) throws Exception { } public String toString() { - return Helper.getShortClassName(getTestSystem()) + " using " + Helper.getShortClassName(getAdapter()); + return getTestSystem().getClass().getSimpleName() + " using " + getAdapter().getClass().getSimpleName(); } @Override diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/AddDescriptorsMultithreadedTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/AddDescriptorsMultithreadedTest.java index fe359007471..2582153cfd4 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/AddDescriptorsMultithreadedTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/AddDescriptorsMultithreadedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -163,7 +163,7 @@ public void test() { // if numberOfTests = 10 then the first test uses k = 0, 10, 20 etc; the second k = 1, 11, 21 etc. for (int k = testNumber; k < nSize; k = k + numberOfTests) { ClassDescriptor descriptor = project.getOrderedDescriptors().get(k); - getAbstractSession().log(SessionLog.FINEST, SessionLog.MISC, "AddDescriptorsTest adding descriptor for class = " + Helper.getShortClassName(descriptor.getJavaClass()), new Object[]{}, null, false); + getAbstractSession().log(SessionLog.FINEST, SessionLog.MISC, "AddDescriptorsTest adding descriptor for class = " + descriptor.getJavaClass().getSimpleName(), new Object[]{}, null, false); DatabaseField sequenceNumberField = descriptor.getMappingForAttributeName("id").getField(); descriptor.setSequenceNumberField(sequenceNumberField); String seqName = "SEQ_" + sequenceNumberField.getTableName(); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/transparentindirection/NullDelegateInValueHolderTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/transparentindirection/NullDelegateInValueHolderTest.java index 47f57f9e2b9..0bf1f746eba 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/transparentindirection/NullDelegateInValueHolderTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/transparentindirection/NullDelegateInValueHolderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -37,7 +37,7 @@ public class NullDelegateInValueHolderTest extends TestCase { public NullDelegateInValueHolderTest(Class indirectCollectionClass) { super(); this.indirectCollectionClass = indirectCollectionClass; - setDescription("NullDelegateInValueHolderTest: " + Helper.getShortClassName(this.indirectCollectionClass)); + setDescription("NullDelegateInValueHolderTest: " + this.indirectCollectionClass.getSimpleName()); } @Override diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ServerSessionReadPoolTypeTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ServerSessionReadPoolTypeTest.java index 61376b0294e..62b6965276d 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ServerSessionReadPoolTypeTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ServerSessionReadPoolTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -42,7 +42,7 @@ public void setup() { @Override public void verify() { Class readPoolClass = serverSession.getReadConnectionPool().getClass(); - String readPoolClassName = Helper.getShortClassName(readPoolClass); + String readPoolClassName = readPoolClass.getSimpleName(); if (serverSession.getLogin().shouldUseExternalConnectionPooling()) { if (!readPoolClass.equals(ExternalConnectionPool.class)) { throw new TestErrorException("In case external connection pooling is used, readConnectionPool by default should be an instance of ExternalConnectionPool class, not " + readPoolClassName); diff --git a/foundation/org.eclipse.persistence.corba/src/it/java/org/eclipse/persistence/testing/tests/corba/CorbaTestModel.java b/foundation/org.eclipse.persistence.corba/src/it/java/org/eclipse/persistence/testing/tests/corba/CorbaTestModel.java index 3a28a566970..746df19c37d 100644 --- a/foundation/org.eclipse.persistence.corba/src/it/java/org/eclipse/persistence/testing/tests/corba/CorbaTestModel.java +++ b/foundation/org.eclipse.persistence.corba/src/it/java/org/eclipse/persistence/testing/tests/corba/CorbaTestModel.java @@ -17,6 +17,7 @@ import java.util.Comparator; import java.util.List; +import junit.framework.Test; import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.testing.framework.TestModel; import org.eclipse.persistence.testing.framework.TestSuite; @@ -54,10 +55,10 @@ public void addTests() { } // Sort the tests alphabetically. - Collections.sort(this.getTests(), new Comparator() { + Collections.sort(this.getTests(), new Comparator() { @Override - public int compare(Object left, Object right) { - return Helper.getShortClassName(left.getClass()).compareTo(Helper.getShortClassName(right.getClass())); + public int compare(Test left, Test right) { + return left.getClass().getSimpleName().compareTo(right.getClass().getSimpleName()); } }); } diff --git a/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/iiop/RMIRemoteCommandConnectionImpl.java b/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/iiop/RMIRemoteCommandConnectionImpl.java index f4fe3cbcacc..a29ac0e7786 100644 --- a/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/iiop/RMIRemoteCommandConnectionImpl.java +++ b/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/iiop/RMIRemoteCommandConnectionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -56,7 +56,7 @@ public Object executeCommand(Command command) throws RemoteException { rcm.processCommandFromRemoteConnection(command); } catch (Exception e) { // Log the problem - Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) }; + Object[] args = { command.getClass().getSimpleName(), Helper.printStackTraceToString(e) }; rcm.logDebug("error_executing_remote_command", args); // Return the string in case the exception doesn't exist on the other side return e.toString(); @@ -79,7 +79,7 @@ public Object executeCommand(byte[] command) throws RemoteException { rcm.processCommandFromRemoteConnection(command); } catch (Exception e) { // Log the problem - Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) }; + Object[] args = { command.getClass().getSimpleName(), Helper.printStackTraceToString(e) }; rcm.logDebug("error_executing_remote_command", args); // Return the string in case the exception doesn't exist on the other side return e.toString(); diff --git a/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/sessions/coordination/corba/CORBATransportManager.java b/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/sessions/coordination/corba/CORBATransportManager.java index ba840f99196..760d622f6ad 100644 --- a/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/sessions/coordination/corba/CORBATransportManager.java +++ b/foundation/org.eclipse.persistence.corba/src/main/java/org/eclipse/persistence/sessions/coordination/corba/CORBATransportManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -156,7 +156,7 @@ public static byte[] processCommand(byte[] command, RemoteCommandManager rcm) { } } catch (Exception e) { // Log the problem encountered during deserialization or rcm processing command - Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) }; + Object[] args = { command.getClass().getSimpleName(), Helper.printStackTraceToString(e) }; rcm.logWarning("error_executing_remote_command", args); // Return the byte[] of exception String in case the exception doesn't exist on the other side diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/JoinedAttributeTestHelper.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/JoinedAttributeTestHelper.java index 14755af9bb2..578c3238648 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/JoinedAttributeTestHelper.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/JoinedAttributeTestHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -19,7 +19,6 @@ import org.eclipse.persistence.indirection.ValueHolder; import org.eclipse.persistence.internal.descriptors.ObjectBuilder; import org.eclipse.persistence.internal.expressions.QueryKeyExpression; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.identitymaps.CacheKey; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.mappings.DatabaseMapping; @@ -245,7 +244,7 @@ protected static String compareCollections(Collection col1, Collection col2, Cla Object obj2 = map2.get(pk); String objErrorMsg = compareObjects(obj1, obj2, session, processed); if(objErrorMsg.length() > 0) { - errorMsg += "PK = " + pk.toString() + ": " + Helper.getShortClassName(obj1.getClass()) + objErrorMsg + " "; + errorMsg += "PK = " + pk.toString() + ": " + obj1.getClass().getSimpleName() + objErrorMsg + " "; } } @@ -297,7 +296,7 @@ protected static String compareMaps(Map map1, Map map2, AbstractSession session, Object obj2 = map2.get(key); String objErrorMsg = compareObjects(obj1, obj2, session, processed); if(objErrorMsg.length() > 0) { - errorMsg += "Key = " + key.toString() + ": " + Helper.getShortClassName(obj1.getClass()) + objErrorMsg + " "; + errorMsg += "Key = " + key.toString() + ": " + obj1.getClass().getSimpleName() + objErrorMsg + " "; } } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/SessionEventTracker.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/SessionEventTracker.java index 30c576e8e19..7cf440db838 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/SessionEventTracker.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/SessionEventTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the @@ -16,7 +16,6 @@ package org.eclipse.persistence.testing.framework; import org.eclipse.persistence.descriptors.ClassDescriptor; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.SessionEvent; @@ -771,7 +770,7 @@ protected Handling log(SessionEvent event) { } public String toString() { - return Helper.getShortClassName(this) + "(" + (name != null ? name : "") + ")"; + return getClass().getSimpleName() + "(" + (name != null ? name : "") + ")"; } public static String eventToString(SessionEvent event) { @@ -788,6 +787,6 @@ public static String getEventName(int eventCode) { } public static String sessionToString(Session session) { - return Helper.getShortClassName(session) + "(" + session.getName() + ")"; + return session.getClass().getSimpleName() + "(" + session.getName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/ui/TestingBrowserPanel.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/ui/TestingBrowserPanel.java index 6d8d27ff0b0..ffe662847d1 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/ui/TestingBrowserPanel.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/ui/TestingBrowserPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -1460,7 +1460,7 @@ public void startTest(junit.framework.Test test) { } else if (test instanceof junit.framework.TestCase) { getCurrentTestTextField().setText(((junit.framework.TestCase)test).getName()); if (!(test instanceof TestEntity)) { - getCurrentSuiteTextField().setText(Helper.getShortClassName(test.getClass())); + getCurrentSuiteTextField().setText(test.getClass().getSimpleName()); } } } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/tests/TestRunModel.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/tests/TestRunModel.java index bdd390f5442..94be162ef2f 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/tests/TestRunModel.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/tests/TestRunModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -15,7 +15,6 @@ package org.eclipse.persistence.testing.tests; import junit.framework.Test; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.sessions.DatabaseLogin; import org.eclipse.persistence.testing.framework.TestModel; @@ -165,10 +164,10 @@ public void addTests() { } // Sort the tests alphabetically. - this.getTests().sort(new Comparator() { + this.getTests().sort(new Comparator() { @Override - public int compare(Object left, Object right) { - return Helper.getShortClassName(left.getClass()).compareTo(Helper.getShortClassName(right.getClass())); + public int compare(Test left, Test right) { + return left.getClass().getSimpleName().compareTo(right.getClass().getSimpleName()); } }); testList = tests; diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ClassInfo.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ClassInfo.java index 5de8cfa8d46..723052699ce 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ClassInfo.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ClassInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -15,7 +15,6 @@ package org.eclipse.persistence.tools.sessionconsole; import org.eclipse.persistence.descriptors.ClassDescriptor; -import org.eclipse.persistence.internal.helper.Helper; /** * Used in class list to show info on the class. @@ -35,7 +34,7 @@ public String toString() { } else if (this.shouldShowPackage) { return this.descriptor.getJavaClass().getName(); } else { - return Helper.getShortClassName(this.descriptor.getJavaClass()); + return this.descriptor.getJavaClass().getSimpleName(); } } } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ProfileBrowserPanel.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ProfileBrowserPanel.java index c551d722fc8..3131b7e4fb0 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ProfileBrowserPanel.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/ProfileBrowserPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -14,7 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.tools.sessionconsole; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.sessions.SessionProfiler; import org.eclipse.persistence.tools.beans.MessageDialog; import org.eclipse.persistence.tools.profiler.Profile; @@ -495,7 +494,7 @@ public void resetProfiles() { if (profile.getQueryClass() == null) { items[0] = ""; } else { - items[0] = Helper.getShortClassName(profile.getQueryClass()); + items[0] = profile.getQueryClass().getSimpleName(); } if (profile.getDomainClass() == null) { items[1] = ""; @@ -504,7 +503,7 @@ public void resetProfiles() { items[1] = profile.getDomainClass().getName(); } else { items[1] = - Helper.getShortClassName(profile.getDomainClass()); + profile.getDomainClass().getSimpleName(); } } items[2] = Long.valueOf(profile.getTotalTime()).toString(); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ClassDescriptor.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ClassDescriptor.java index ec30d2993a0..a1cd27b4097 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ClassDescriptor.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ClassDescriptor.java @@ -1868,7 +1868,7 @@ public String getAlias() { * Default alias to the Java class name if the alias is not set */ if ((alias == null) && (getJavaClassName() != null)) { - alias = org.eclipse.persistence.internal.helper.Helper.getShortClassName(getJavaClassName()); + alias = Helper.getShortClassName(getJavaClassName()); } return alias; } @@ -5672,7 +5672,7 @@ public boolean supportsChangeTracking(Project project){ */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getJavaClassName() + " --> " + getTables() + ")"; + return getClass().getSimpleName() + "(" + getJavaClassName() + " --> " + getTables() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/InheritancePolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/InheritancePolicy.java index 3e9e66a7724..38e5197a981 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/InheritancePolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/InheritancePolicy.java @@ -1860,7 +1860,7 @@ public boolean shouldUseClassNameAsIndicator() { */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getDescriptor() + ")"; + return getClass().getSimpleName() + "(" + getDescriptor() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ReturningPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ReturningPolicy.java index 1c29781922f..10cfc4bdc95 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ReturningPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/ReturningPolicy.java @@ -20,7 +20,6 @@ import org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.internal.helper.DatabaseTable; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.logging.SessionLog; @@ -858,7 +857,7 @@ protected static boolean verifyFieldAndMapping(AbstractSession session, Database verifyFieldAndMapping(session, field, referenceDescriptor, mapping); } if (!mapping.isDirectToFieldMapping() && !mapping.isTransformationMapping()) { - String mappingTypeName = Helper.getShortClassName(mapping); + String mappingTypeName = mapping.getClass().getSimpleName(); session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappingNotSupported(field.getName(), mappingTypeName, mapping)); return false; } else { @@ -928,7 +927,7 @@ public void validationAfterDescriptorInitialization(AbstractSession session) { // this operation requires some fields to be returned if ((query[operation] == null) || (query[operation].getDatasourceCall() == null)) { if (!session.getPlatform().canBuildCallWithReturning()) { - session.getIntegrityChecker().handleError(DescriptorException.noCustomQueryForReturningPolicy(queryTypeName[operation], Helper.getShortClassName(session.getPlatform()), getDescriptor())); + session.getIntegrityChecker().handleError(DescriptorException.noCustomQueryForReturningPolicy(queryTypeName[operation], session.getPlatform().getClass().getSimpleName(), getDescriptor())); } } else if (query[operation].getDatasourceCall() instanceof StoredProcedureCall) { // SQLCall with custom SQL calculates its outputRowFields later (in prepare() method) - diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/CloneCopyPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/CloneCopyPolicy.java index 72580c77687..31a6bbab1c6 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/CloneCopyPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/CloneCopyPolicy.java @@ -208,6 +208,6 @@ public boolean buildsNewInstance() { @Override public String toString() { - return Helper.getShortClassName(this) + "(" + this.getMethodName() + ")"; + return getClass().getSimpleName() + "(" + this.getMethodName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/InstantiationCopyPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/InstantiationCopyPolicy.java index 4d6394f0d0e..d016c31e00e 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/InstantiationCopyPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/InstantiationCopyPolicy.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.descriptors.copying; import org.eclipse.persistence.exceptions.DescriptorException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.sessions.Session; /** @@ -41,6 +40,6 @@ public boolean buildsNewInstance() { @Override public String toString() { - return Helper.getShortClassName(this) + "()"; + return getClass().getSimpleName() + "()"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/PersistenceEntityCopyPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/PersistenceEntityCopyPolicy.java index 361ce6cea53..5dfd99216c7 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/PersistenceEntityCopyPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/copying/PersistenceEntityCopyPolicy.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.exceptions.DescriptorException; import org.eclipse.persistence.internal.descriptors.PersistenceObject; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.sessions.Session; /** @@ -46,6 +45,6 @@ public boolean buildsNewInstance() { @Override public String toString() { - return Helper.getShortClassName(this) + "()"; + return getClass().getSimpleName() + "()"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/dynamic/DynamicClassWriter.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/dynamic/DynamicClassWriter.java index ddcf45f980c..41229c2fb23 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/dynamic/DynamicClassWriter.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/dynamic/DynamicClassWriter.java @@ -29,7 +29,6 @@ import org.eclipse.persistence.exceptions.DynamicException; import org.eclipse.persistence.internal.dynamic.DynamicEntityImpl; import org.eclipse.persistence.internal.dynamic.DynamicPropertiesManager; -import org.eclipse.persistence.internal.helper.Helper; import java.lang.reflect.Modifier; import java.util.ArrayList; @@ -379,6 +378,6 @@ public boolean isCompatible(EclipseLinkClassWriter writer) { @Override public String toString() { String parentName = getParentClass() == null ? getParentClassName() : getParentClass().getName(); - return Helper.getShortClassName(getClass()) + "(" + parentName + ")"; + return getClass().getSimpleName() + "(" + parentName + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISConnectionSpec.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISConnectionSpec.java index fd80d0d777e..82edb703e3d 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISConnectionSpec.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISConnectionSpec.java @@ -20,7 +20,6 @@ import jakarta.resource.cci.ConnectionSpec; import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.sessions.Connector; import org.eclipse.persistence.sessions.Session; @@ -309,9 +308,9 @@ public void setName(Name name) { @Override public String toString() { if (getName() != null) { - return Helper.getShortClassName(getClass()) + "(connection manager url => " + getName() + ")"; + return getClass().getSimpleName() + "(connection manager url => " + getName() + ")"; } else { - return Helper.getShortClassName(getClass()) + "()"; + return getClass().getSimpleName() + "()"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISMappedRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISMappedRecord.java index 206e6c9baab..739e4245dc4 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISMappedRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISMappedRecord.java @@ -198,7 +198,7 @@ public void setAccessor(EISAccessor accessor) { @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); for (Iterator keysIterator = keySet().iterator(); keysIterator.hasNext();) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/EISInteraction.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/EISInteraction.java index 162562c720c..978f2821ca2 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/EISInteraction.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/EISInteraction.java @@ -525,6 +525,6 @@ public void setInputRow(AbstractRecord inputRow) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getFunctionName() + ")"; + return getClass().getSimpleName() + "(" + getFunctionName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/DescriptorException.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/DescriptorException.java index 30b8fba63c5..7cd230d7208 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/DescriptorException.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/DescriptorException.java @@ -25,7 +25,6 @@ import org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.internal.helper.DatabaseTable; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.oxm.record.XMLRecord; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.mappings.CollectionMapping; @@ -376,7 +375,7 @@ public static DescriptorException classIndicatorFieldNotFound(ClassDescriptor pa } public static DescriptorException couldNotInstantiateIndirectContainerClass(Class containerClass, Exception exception) { - Object[] args = { containerClass, Helper.getShortClassName(containerClass) }; + Object[] args = { containerClass, containerClass.getSimpleName() }; DescriptorException descriptorException = new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class, COULD_NOT_INSTANTIATE_INDIRECT_CONTAINER_CLASS, args)); descriptorException.setErrorCode(COULD_NOT_INSTANTIATE_INDIRECT_CONTAINER_CLASS); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/i18n/ExceptionMessageGenerator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/i18n/ExceptionMessageGenerator.java index 74c9f1a5952..89a8b0b1eb0 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/i18n/ExceptionMessageGenerator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/i18n/ExceptionMessageGenerator.java @@ -18,7 +18,6 @@ package org.eclipse.persistence.exceptions.i18n; import org.eclipse.persistence.internal.helper.ConversionManager; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; import java.text.MessageFormat; @@ -57,7 +56,7 @@ public static ClassLoader getLoader() { * Return the message for the given exception class and error number. */ public static String buildMessage(Class exceptionClass, int errorNumber, Object[] arguments) { - String shortClassName = Helper.getShortClassName(exceptionClass); + String shortClassName = exceptionClass.getSimpleName(); String message = ""; ResourceBundle bundle = null; diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/history/AsOfClause.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/history/AsOfClause.java index 13169ed291f..6f58a0cad3e 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/history/AsOfClause.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/history/AsOfClause.java @@ -20,7 +20,6 @@ import org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter; import org.eclipse.persistence.internal.helper.ClassConstants; import org.eclipse.persistence.internal.helper.ConversionManager; -import org.eclipse.persistence.internal.helper.Helper; import java.io.Serializable; import java.io.StringWriter; @@ -155,7 +154,7 @@ public boolean isUniversal() { @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); writer.write(String.valueOf(getValue())); writer.write(")"); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectList.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectList.java index cb80e622c5a..e97d208ff02 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectList.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectList.java @@ -941,7 +941,7 @@ public String toString() { if (this.isInstantiated()) { return "{" + getDelegate().toString() + "}"; } else { - return "{" + org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": not instantiated}"; + return "{" + getClass().getSimpleName() + ": not instantiated}"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectMap.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectMap.java index 4ea6cb8ca6e..31a7fc25ef1 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectMap.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectMap.java @@ -1003,7 +1003,7 @@ public String toString() { if (this.isInstantiated()) { return "{" + this.getDelegate().toString() + "}"; } else { - return "{" + org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": not instantiated}"; + return "{" + getClass().getSimpleName() + ": not instantiated}"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectSet.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectSet.java index 92380efb511..65b950df28e 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectSet.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/indirection/IndirectSet.java @@ -640,7 +640,7 @@ public String toString() { if (this.isInstantiated()) { return "{" + this.getDelegate().toString() + "}"; } else { - return "{" + org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": " + ToStringLocalization.buildMessage("not_instantiated", null) + "}"; + return "{" + getClass().getSimpleName() + ": " + ToStringLocalization.buildMessage("not_instantiated", null) + "}"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseCall.java index 015f99e6318..d0bf25d74a2 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseCall.java @@ -1063,7 +1063,7 @@ public boolean shouldReturnGeneratedKeys() { */ @Override public String toString() { - String str = Helper.getShortClassName(getClass()); + String str = getClass().getSimpleName(); if (getSQLString() == null) { return str; } else { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java index e9bb70eeff0..357dcad7378 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabasePlatform.java @@ -476,7 +476,7 @@ public Expression buildBatchCriteriaForComplexId(ExpressionBuilder builder,List< * Returns null unless the platform supports call with returning */ public DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields) { - throw ValidationException.platformDoesNotSupportCallWithReturning(Helper.getShortClassName(this)); + throw ValidationException.platformDoesNotSupportCallWithReturning(getClass().getSimpleName()); } /** @@ -1307,7 +1307,7 @@ public String getQualifiedSequenceTableName() { if (getDefaultSequence().isTable()) { return getQualifiedName(((TableSequence)getDefaultSequence()).getTableName()); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getTableName"); } } @@ -1365,7 +1365,7 @@ public String getSequenceCounterFieldName() { if (getDefaultSequence().isTable()) { return ((TableSequence)getDefaultSequence()).getCounterFieldName(); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getCounterFieldName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getCounterFieldName"); } } @@ -1373,7 +1373,7 @@ public String getSequenceNameFieldName() { if (getDefaultSequence().isTable()) { return ((TableSequence)getDefaultSequence()).getNameFieldName(); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getNameFieldName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getNameFieldName"); } } @@ -1390,7 +1390,7 @@ public String getSequenceTableName() { } return tableName; } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getTableName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getTableName"); } } @@ -1747,7 +1747,7 @@ public void setSequenceCounterFieldName(String name) { ((TableSequence)getDefaultSequence()).setCounterFieldName(name); } else { if (!name.equals((new TableSequence()).getCounterFieldName())) { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setCounterFieldName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "setCounterFieldName"); } } } @@ -1757,7 +1757,7 @@ public void setSequenceNameFieldName(String name) { ((TableSequence)getDefaultSequence()).setNameFieldName(name); } else { if (!name.equals((new TableSequence()).getNameFieldName())) { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setNameFieldName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "setNameFieldName"); } } } @@ -1767,7 +1767,7 @@ public void setSequenceTableName(String name) { ((TableSequence)getDefaultSequence()).setTableName(name); } else { if (!name.equals((new TableSequence()).getTableName())) { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setTableName"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "setTableName"); } } } @@ -2961,7 +2961,7 @@ public boolean supportsGlobalTempTables() { * Don't forget to end it with a space. */ protected String getCreateTempTableSqlPrefix() { - throw ValidationException.platformDoesNotOverrideGetCreateTempTableSqlPrefix(Helper.getShortClassName(this)); + throw ValidationException.platformDoesNotOverrideGetCreateTempTableSqlPrefix(getClass().getSimpleName()); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java index 437c7818499..73b55bbb29a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java @@ -33,7 +33,6 @@ import org.eclipse.persistence.internal.helper.ClassConstants; import org.eclipse.persistence.internal.helper.ConversionManager; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.Call; import org.eclipse.persistence.queries.DataModifyQuery; @@ -354,7 +353,7 @@ public ValueReadQuery getSelectSequenceQuery() { if (getDefaultSequence() instanceof QuerySequence) { return ((QuerySequence)getDefaultSequence()).getSelectQuery(); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getSelectQuery"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getSelectQuery"); } } @@ -436,7 +435,7 @@ public DataModifyQuery getUpdateSequenceQuery() { if (getDefaultSequence() instanceof QuerySequence) { return ((QuerySequence)getDefaultSequence()).getUpdateQuery(); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "getUpdateQuery"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "getUpdateQuery"); } } @@ -762,7 +761,7 @@ public void setSelectSequenceNumberQuery(ValueReadQuery seqQuery) { if (getDefaultSequence() instanceof QuerySequence) { ((QuerySequence)getDefaultSequence()).setSelectQuery(seqQuery); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setSelectQuery"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "setSelectQuery"); } } @@ -808,13 +807,13 @@ public void setUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery) { if (getDefaultSequence() instanceof QuerySequence) { ((QuerySequence)getDefaultSequence()).setUpdateQuery(updateSequenceNumberQuery); } else { - throw ValidationException.wrongSequenceType(Helper.getShortClassName(getDefaultSequence()), "setUpdateQuery"); + throw ValidationException.wrongSequenceType(getDefaultSequence().getClass().getSimpleName(), "setUpdateQuery"); } } @Override public String toString() { - return Helper.getShortClassName(this.getClass()); + return getClass().getSimpleName(); } /** @@ -944,7 +943,7 @@ public Sequence getSequence(String seqName) { * Create platform-default Sequence */ protected Sequence createPlatformDefaultSequence() { - throw ValidationException.createPlatformDefaultSequenceUndefined(Helper.getShortClassName(this)); + throw ValidationException.createPlatformDefaultSequenceUndefined(getClass().getSimpleName()); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/FieldTypeDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/FieldTypeDefinition.java index 40302b803c8..10778aa0c49 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/FieldTypeDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/FieldTypeDefinition.java @@ -14,8 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.internal.databaseaccess; -import org.eclipse.persistence.internal.helper.Helper; - import java.io.Serializable; /** @@ -310,6 +308,6 @@ public void setSizeRequired() { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getName() + ")"; + return getClass().getSimpleName() + "(" + getName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/InstantiationPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/InstantiationPolicy.java index 6ab370d51ee..6d531f5b8b7 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/InstantiationPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/InstantiationPolicy.java @@ -430,7 +430,7 @@ public String toString() { } else { mName = this.getMethodName(); } - return Helper.getShortClassName(this) + "(" + mName + ")"; + return getClass().getSimpleName() + "(" + mName + ")"; } public void useDefaultConstructorInstantiationPolicy() { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java index ff8d2b84f4c..8355cf0e421 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/descriptors/ObjectBuilder.java @@ -4536,7 +4536,7 @@ protected void setPrimaryKeyMappings(List thePrimaryKeyMappings @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + this.descriptor.toString() + ")"; + return getClass().getSimpleName() + "(" + this.descriptor.toString() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/dynamic/DynamicEntityImpl.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/dynamic/DynamicEntityImpl.java index 312648bd4ae..8d3c82b614a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/dynamic/DynamicEntityImpl.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/dynamic/DynamicEntityImpl.java @@ -50,8 +50,6 @@ import java.util.HashMap; import java.util.Map; -import static org.eclipse.persistence.internal.helper.Helper.getShortClassName; - /** * This abstract class is used to represent an entity which typically is not * realized in Java code. In combination with the DynamicClassLoader ASM is used @@ -593,7 +591,7 @@ public String toString() { // this will print something like {Emp 10} or {Phone 234-5678 10} StringBuilder sb = new StringBuilder(20); sb.append('{'); - sb.append(getShortClassName(this.getClass())); + sb.append(getClass().getSimpleName()); if (primaryKey != null) { sb.append(' '); sb.append(primaryKey); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/expressions/SQLStatement.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/expressions/SQLStatement.java index 9e1dd0472ea..6f9c87670f7 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/expressions/SQLStatement.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/expressions/SQLStatement.java @@ -17,7 +17,6 @@ import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.internal.databaseaccess.DatabaseCall; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl; @@ -124,7 +123,7 @@ public void setWhereClause(Expression expression) { @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); try { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/ConcurrencyManager.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/ConcurrencyManager.java index 412360fce12..ead7df2a5c2 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/ConcurrencyManager.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/ConcurrencyManager.java @@ -821,7 +821,7 @@ protected static Map getReadLockManagers() { @Override public String toString() { Object[] args = {getDepth()}; - return Helper.getShortClassName(getClass()) + ToStringLocalization.buildMessage("nest_level", args); + return getClass().getSimpleName() + ToStringLocalization.buildMessage("nest_level", args); } public Exception getStack() { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/IdentityHashSet.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/IdentityHashSet.java index 104326f7f84..731627bc40d 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/IdentityHashSet.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/helper/IdentityHashSet.java @@ -27,7 +27,7 @@ * This class does not inherit from {@link java.util.AbstractSet} because the * method {@link java.util.AbstractSet#removeAll removeAll(Collection c)} does not work * correctly with reference equality testing (NB the Javadocs for - * {@link AbstractCollection} indicates that removeAll is an optional method). + * {@link java.util.AbstractCollection} indicates that removeAll is an optional method). * * @author Mike Norman (since TopLink 10.1.3) * diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/history/HistoricalSession.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/history/HistoricalSession.java index c4a325e71f3..e9fc5236c07 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/history/HistoricalSession.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/history/HistoricalSession.java @@ -19,7 +19,6 @@ import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.history.AsOfClause; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl; @@ -87,7 +86,7 @@ public org.eclipse.persistence.sessions.Session acquireHistoricalSession(org.ecl */ @Override public UnitOfWorkImpl acquireUnitOfWork() { - throw ValidationException.operationNotSupported(Helper.getShortClassName(getClass()) + ".acquireUnitOfWork"); + throw ValidationException.operationNotSupported(getClass().getSimpleName() + ".acquireUnitOfWork"); } /** @@ -96,7 +95,7 @@ public UnitOfWorkImpl acquireUnitOfWork() { */ @Override public void beginTransaction() throws DatabaseException, ConcurrencyException { - throw ValidationException.operationNotSupported(Helper.getShortClassName(getClass()) + ".beginTransaction"); + throw ValidationException.operationNotSupported(getClass().getSimpleName() + ".beginTransaction"); } /** @@ -105,7 +104,7 @@ public void beginTransaction() throws DatabaseException, ConcurrencyException { */ @Override public void commitTransaction() throws DatabaseException, ConcurrencyException { - throw ValidationException.operationNotSupported(Helper.getShortClassName(getClass()) + ".commitTransaction"); + throw ValidationException.operationNotSupported(getClass().getSimpleName() + ".commitTransaction"); } /** @@ -232,7 +231,7 @@ public DatabaseQuery prepareDatabaseQuery(DatabaseQuery query) { */ @Override public void rollbackTransaction() throws DatabaseException, ConcurrencyException { - throw ValidationException.operationNotSupported(Helper.getShortClassName(getClass()) + ".rollbackTransaction"); + throw ValidationException.operationNotSupported(getClass().getSimpleName() + ".rollbackTransaction"); } @Override diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/AbstractIdentityMap.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/AbstractIdentityMap.java index a11ee14ebfe..d4544c864a6 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/AbstractIdentityMap.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/AbstractIdentityMap.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.internal.helper.ClassConstants; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import java.io.Serializable; @@ -528,6 +527,6 @@ public void setWriteLockValue(Object primaryKey, Object writeLockValue) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "[" + getSize() + "]"; + return getClass().getSimpleName() + "[" + getSize() + "]"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/IdentityMapManager.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/IdentityMapManager.java index 20eb6e9c7df..97f4d04129a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/IdentityMapManager.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/identitymaps/IdentityMapManager.java @@ -1212,16 +1212,16 @@ public void printIdentityMap(Class businessClass) { if (map == null) { return; } - writer.write(LoggingLocalization.buildMessage("identitymap_for", new Object[] { cr, Helper.getShortClassName(map.getClass()), Helper.getShortClassName(businessClass) })); + writer.write(LoggingLocalization.buildMessage("identitymap_for", new Object[] { cr, map.getClass().getSimpleName(), businessClass.getSimpleName() })); if (descriptor.hasInheritance()) { if (descriptor.getInheritancePolicy().isRootParentDescriptor()) { writer.write(LoggingLocalization.buildMessage("includes")); List childDescriptors = descriptor.getInheritancePolicy().getChildDescriptors(); - if ((childDescriptors != null) && (childDescriptors.size() != 0)) {//Bug#2675242 + if ((childDescriptors != null) && (!childDescriptors.isEmpty())) {//Bug#2675242 Iterator iterator = childDescriptors.iterator(); - writer.write(Helper.getShortClassName(iterator.next().getJavaClass())); + writer.write(iterator.next().getJavaClass().getSimpleName()); while (iterator.hasNext()) { - writer.write(", " + Helper.getShortClassName(iterator.next().getJavaClass())); + writer.write(", " + iterator.next().getJavaClass().getSimpleName()); } } writer.write(")"); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/DatabaseValueHolder.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/DatabaseValueHolder.java index 470c544fbec..4ff6304e57a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/DatabaseValueHolder.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/DatabaseValueHolder.java @@ -17,7 +17,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.indirection.ValueHolderInterface; import org.eclipse.persistence.indirection.WeavedAttributeValueHolderInterface; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; @@ -325,7 +324,7 @@ public String toString() { if (isInstantiated()) { return "{" + getValue() + "}"; } else { - return "{" + Helper.getShortClassName(getClass()) + ": " + ToStringLocalization.buildMessage("not_instantiated", null) + "}"; + return "{" + getClass().getSimpleName() + ": " + ToStringLocalization.buildMessage("not_instantiated", null) + "}"; } } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/TransparentIndirectionPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/TransparentIndirectionPolicy.java index 8475233d97a..b9aa59ab7c7 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/TransparentIndirectionPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/indirection/TransparentIndirectionPolicy.java @@ -713,7 +713,7 @@ public void validateSetMethodParameterType(Class parameterType, IntegrityChec * Return the type that is appropriate for the indirection policy. */ protected String validTypeName() { - return Helper.getShortClassName(this.getContainerClass()); + return getContainerClass().getSimpleName(); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLAccessor.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLAccessor.java index ea3635f277c..3d7a7950da3 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLAccessor.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLAccessor.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.Call; @@ -123,7 +122,7 @@ protected AbstractRecord convert(AbstractRecord row, AbstractSession session) { public String toString() { StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); - writer.write(Helper.getShortClassName(this)); + writer.write(getClass().getSimpleName()); writer.write("("); this.toString(writer); writer.write(")"); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ContainerPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ContainerPolicy.java index 7951a23bffb..e78aeabb497 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ContainerPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ContainerPolicy.java @@ -1537,7 +1537,7 @@ public int sizeFor(Object container) { @Override public String toString() { - return Helper.getShortClassName(this.getClass()) + "(" + toStringInfo() + ")"; + return getClass().getSimpleName() + "(" + toStringInfo() + ")"; } protected Object toStringInfo() { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java index 26fca477c77..8af2e692cdb 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java @@ -54,7 +54,6 @@ import org.eclipse.persistence.internal.expressions.SQLUpdateStatement; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.internal.helper.DatabaseTable; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.InvalidObject; import org.eclipse.persistence.internal.helper.NonSynchronizedVector; import org.eclipse.persistence.internal.identitymaps.CacheKey; @@ -1562,7 +1561,7 @@ protected void prepareDeleteAllUsingTempStorage() { if(getExecutionSession().getPlatform().supportsTempTables()) { prepareDeleteAllUsingTempTables(); } else { - throw QueryException.tempTablesNotSupported(getQuery(), Helper.getShortClassName(getExecutionSession().getPlatform())); + throw QueryException.tempTablesNotSupported(getQuery(), getExecutionSession().getPlatform().getClass().getSimpleName()); } } @@ -2463,7 +2462,7 @@ protected void prepareUpdateAllUsingTempStorage(HashMap tables_databaseFieldsToV } else if(getExecutionSession().getPlatform().isOracle()) { prepareUpdateAllUsingOracleAnonymousBlock(tables_databaseFieldsToValues, tablesToPrimaryKeyFields); } else { - throw QueryException.tempTablesNotSupported(getQuery(), Helper.getShortClassName(getExecutionSession().getPlatform())); + throw QueryException.tempTablesNotSupported(getQuery(), getExecutionSession().getPlatform().getClass().getSimpleName()); } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractRecord.java index 2f6d749a6f9..e0349e702d4 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractRecord.java @@ -816,7 +816,7 @@ public int size() { @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); for (int index = 0; index < getFields().size(); index++) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractSession.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractSession.java index f44cf372f51..1a9e32f4667 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractSession.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/AbstractSession.java @@ -2673,7 +2673,7 @@ public String getLogSessionString() { * IsolatedClientSession. */ public String getSessionTypeString() { - return Helper.getShortClassName(getClass()); + return getClass().getSimpleName(); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/ArrayRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/ArrayRecord.java index 4e2357a4110..9ef3ca5510c 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/ArrayRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/ArrayRecord.java @@ -340,7 +340,7 @@ public int size() { public String toString() { if (this.valuesArray != null) { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); writer.write(toStringAditional()); for (int index = 0; index < this.fieldsArray.length; index++) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/CommitManager.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/CommitManager.java index ce7b24288a0..b4b4b65109a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/CommitManager.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/CommitManager.java @@ -678,6 +678,6 @@ protected void setShallowCommits(Map shallowCommits) { @Override public String toString() { Object[] args = {this.commitDepth}; - return Helper.getShortClassName(getClass()) + ToStringLocalization.buildMessage("commit_depth", args); + return getClass().getSimpleName() + ToStringLocalization.buildMessage("commit_depth", args); } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/broadcast/BroadcastRemoteConnection.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/broadcast/BroadcastRemoteConnection.java index 6a6cbd53c25..d8d85da4c0f 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/broadcast/BroadcastRemoteConnection.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/broadcast/BroadcastRemoteConnection.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.exceptions.CommunicationException; import org.eclipse.persistence.exceptions.RemoteCommandManagerException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.coordination.RemoteConnection; import org.eclipse.persistence.sessions.coordination.Command; import org.eclipse.persistence.sessions.coordination.RemoteCommandManager; @@ -199,19 +198,19 @@ protected void processReceivedObject(Object object, String messageId) { } if (remoteCommand.getServiceId().getChannel().equals(this.serviceId.getChannel())) { if(rcm.shouldLogDebugMessage()) { - Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand) }; + Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), remoteCommand.getClass().getSimpleName() }; rcm.logDebugWithoutLevelCheck("broadcast_processing_remote_command", args); } rcm.processCommandFromRemoteConnection(remoteCommand); } else { if(rcm.shouldLogWarningMessage()) { - Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand)}; + Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), remoteCommand.getClass().getSimpleName()}; rcm.logWarningWithoutLevelCheck("broadcast_ignore_remote_command_from_different_channel", args); } } } catch (RuntimeException e) { try { - rcm.handleException(RemoteCommandManagerException.errorProcessingRemoteCommand(toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand), e)); + rcm.handleException(RemoteCommandManagerException.errorProcessingRemoteCommand(toString(), messageId, remoteCommand.getServiceId().toString(), remoteCommand.getClass().getSimpleName(), e)); } catch (RuntimeException ex) { // User had a chance to handle the exception. // The method is called by a listener thread - no one could catch this exception. @@ -375,7 +374,7 @@ public String toString() { * INTERNAL: */ protected void createDisplayString() { - this.displayString = Helper.getShortClassName(this) + "[" + serviceId.toString() + ", topic " + topicName +"]"; + this.displayString = getClass().getSimpleName() + "[" + serviceId.toString() + ", topic " + topicName +"]"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/RMIRemoteCommandConnectionImpl.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/RMIRemoteCommandConnectionImpl.java index 882b67a392f..37041ff1197 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/RMIRemoteCommandConnectionImpl.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/coordination/rmi/RMIRemoteCommandConnectionImpl.java @@ -56,7 +56,7 @@ public Object executeCommand(Command command) throws RemoteException { rcm.processCommandFromRemoteConnection(command); } catch (Exception e) { // Log the problem - Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) }; + Object[] args = { command.getClass().getSimpleName(), Helper.printStackTraceToString(e) }; rcm.logWarning("error_executing_remote_command", args); // Return the string in case the exception doesn't exist on the other side return e.toString(); @@ -79,7 +79,7 @@ public Object executeCommand(byte[] command) throws RemoteException { this.rcm.processCommandFromRemoteConnection(command); } catch (Exception e) { // Log the problem - Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) }; + Object[] args = { command.getClass().getSimpleName(), Helper.printStackTraceToString(e) }; this.rcm.logWarning("error_executing_remote_command", args); // Return the string in case the exception doesn't exist on the other side return e.toString(); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/RemoteUnitOfWork.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/RemoteUnitOfWork.java index 1ebe5d6f09e..52e2339a58d 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/RemoteUnitOfWork.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/RemoteUnitOfWork.java @@ -24,7 +24,6 @@ import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.databaseaccess.Platform; import org.eclipse.persistence.internal.helper.ConcurrencyManager; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.InvalidObject; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; @@ -798,7 +797,7 @@ protected void setUnregisteredNewObjectsCache(List unregisteredNewObjectsCache) */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "()"; + return getClass().getSimpleName() + "()"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/Transporter.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/Transporter.java index e62f21c8eaa..134d03e4115 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/Transporter.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/remote/Transporter.java @@ -14,7 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.internal.sessions.remote; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.DatabaseQuery; @@ -135,7 +134,7 @@ public void setWasOperationSuccessful(boolean wasOperationSuccessful) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getObject() + ")"; + return getClass().getSimpleName() + "(" + getObject() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/logging/SessionLogEntry.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/logging/SessionLogEntry.java index 65ac1ece22d..5f284833786 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/logging/SessionLogEntry.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/logging/SessionLogEntry.java @@ -270,7 +270,7 @@ public boolean hasException() { * @return if the log entry has a message */ public boolean hasMessage() { - return getMessage() != null && !(getMessage().length() == 0); + return getMessage() != null && getMessage().length() != 0; } /** @@ -389,6 +389,6 @@ public void setSourceMethodName(String sourceMethodName) { @Override public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getMessage() + ")"; + return getClass().getSimpleName() + "(" + getMessage() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/ForeignReferenceMapping.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/ForeignReferenceMapping.java index 1ba8aeab95e..434bb1f5372 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/ForeignReferenceMapping.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/ForeignReferenceMapping.java @@ -2200,7 +2200,7 @@ protected boolean shouldUseValueFromRowWithJoin(JoinedAttributeManager joinManag * If isJoiningSupported()==true then this method must be overridden. */ protected Object valueFromRowInternalWithJoin(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey parentCacheKey, AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException { - throw ValidationException.mappingDoesNotOverrideValueFromRowInternalWithJoin(Helper.getShortClassName(this.getClass())); + throw ValidationException.mappingDoesNotOverrideValueFromRowInternalWithJoin(getClass().getSimpleName()); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/querykeys/QueryKey.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/querykeys/QueryKey.java index d0587890129..ba8fc34ab67 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/querykeys/QueryKey.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/mappings/querykeys/QueryKey.java @@ -187,6 +187,6 @@ public void setName(String name) { */ @Override public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + getName() + ")"; + return getClass().getSimpleName() + "(" + getName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/XMLLogin.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/XMLLogin.java index ee7648116a6..be4fbe4d50a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/XMLLogin.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/XMLLogin.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.databaseaccess.Platform; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.oxm.mappings.Login; import org.eclipse.persistence.oxm.documentpreservation.DocumentPreservationPolicy; import org.eclipse.persistence.oxm.platform.SAXPlatform; @@ -76,7 +75,7 @@ public Accessor buildAccessor() { */ @Override public String toString() { - return Helper.getShortClassName(this) + "(" + this.getUserName() + ")\n\t( " + this.getPlatformClassName() + ")"; + return getClass().getSimpleName() + "(" + this.getUserName() + ")\n\t( " + this.getPlatformClassName() + ")"; } @Override diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/DOMRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/DOMRecord.java index 921cc179aae..2549e03099a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/DOMRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/DOMRecord.java @@ -18,7 +18,6 @@ import org.eclipse.persistence.exceptions.XMLMarshalException; import org.eclipse.persistence.internal.core.sessions.CoreAbstractSession; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.oxm.ReferenceResolver; import org.eclipse.persistence.internal.oxm.UnmarshalXPathEngine; import org.eclipse.persistence.internal.oxm.XMLConversionManager; @@ -746,7 +745,7 @@ public void setDOM(Element element) { @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.write("("); transformToWriter(writer); writer.write(")"); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/PostgreSQLPlatform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/PostgreSQLPlatform.java index 9d3ec7369d5..3b556b2b113 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/PostgreSQLPlatform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/PostgreSQLPlatform.java @@ -36,7 +36,6 @@ import org.eclipse.persistence.internal.helper.ClassConstants; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.internal.helper.DatabaseTable; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField; @@ -559,7 +558,7 @@ public String buildProcedureCallString(StoredProcedureCall call, AbstractSession } else { if (outParameterFound) { //multiple outs found - throw ValidationException.multipleOutParamsNotSupported(Helper.getShortClassName(this), call.getProcedureName()); + throw ValidationException.multipleOutParamsNotSupported(getClass().getSimpleName(), call.getProcedureName()); } outParameterFound = true; //PostGreSQL uses a very different header to execute when there are out params } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredFunctionCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredFunctionCall.java index 334ef5181da..2bef2c8281c 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredFunctionCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredFunctionCall.java @@ -18,7 +18,6 @@ import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.internal.helper.ComplexDatabaseType; import org.eclipse.persistence.internal.helper.DatabaseType; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.platform.database.jdbc.JDBCTypes; @@ -101,7 +100,7 @@ public void prepareInternal(AbstractSession session) { if (session.getPlatform().supportsStoredFunctions()) { super.prepareInternal(session); } else { - throw ValidationException.platformDoesNotSupportStoredFunctions(Helper.getShortClassName(session.getPlatform())); + throw ValidationException.platformDoesNotSupportStoredFunctions(session.getPlatform().getClass().getSimpleName()); } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/ObjectLevelModifyQuery.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/ObjectLevelModifyQuery.java index c7f6f2559a0..3212904ddc2 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/ObjectLevelModifyQuery.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/ObjectLevelModifyQuery.java @@ -19,7 +19,6 @@ import org.eclipse.persistence.exceptions.OptimisticLockException; import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.internal.sessions.ObjectChangeSet; @@ -278,6 +277,6 @@ public void setPrimaryKey(Object primaryKey) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getObject() + ")"; + return getClass().getSimpleName() + "(" + getObject() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredFunctionCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredFunctionCall.java index ce808678754..13a327c605b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredFunctionCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredFunctionCall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2022 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the @@ -21,8 +21,6 @@ import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField; -import static org.eclipse.persistence.internal.helper.Helper.getShortClassName; - /** * Purpose: Used to define a platform independent function call. * Note that not all platforms support stored functions. @@ -94,7 +92,7 @@ public void prepareInternal(AbstractSession session) { if (session.getPlatform().supportsStoredFunctions()) { super.prepareInternal(session); } else { - throw ValidationException.platformDoesNotSupportStoredFunctions(getShortClassName(session.getPlatform())); + throw ValidationException.platformDoesNotSupportStoredFunctions(session.getPlatform().getClass().getSimpleName()); } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredProcedureCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredProcedureCall.java index 4a8dc70681a..cf64926b613 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredProcedureCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/queries/StoredProcedureCall.java @@ -923,7 +923,7 @@ public void setProcedureName(String procedureName) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getProcedureName() + ")"; + return getClass().getSimpleName() + "(" + getProcedureName() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/services/RuntimeServices.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/services/RuntimeServices.java index 14698bbf7e5..b384a911dfe 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/services/RuntimeServices.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/services/RuntimeServices.java @@ -708,7 +708,7 @@ public boolean isJPASession() { * Types include: "ServerSession", "DatabaseSession", "SessionBroker" */ public String getSessionType() { - return Helper.getShortClassName(getSession().getClass()); + return getSession().getClass().getSimpleName(); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DatasourceLogin.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DatasourceLogin.java index 82f81c1fbf9..f39e8c94509 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DatasourceLogin.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DatasourceLogin.java @@ -21,7 +21,6 @@ import org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform; import org.eclipse.persistence.internal.databaseaccess.Platform; import org.eclipse.persistence.internal.helper.ConversionManager; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.NonSynchronizedProperties; import org.eclipse.persistence.internal.localization.ToStringLocalization; import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; @@ -789,7 +788,7 @@ public void useExternalTransactionController() { public String toString() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); - writer.write(Helper.getShortClassName(getClass())); + writer.write(getClass().getSimpleName()); writer.println("("); writer.println("\t" + ToStringLocalization.buildMessage("platform", null) + "=> " + getDatasourcePlatform()); if (!shouldUseExternalConnectionPooling()) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DefaultConnector.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DefaultConnector.java index 24b49d68456..2141763ea3f 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DefaultConnector.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/DefaultConnector.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.internal.helper.ConversionManager; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; import org.eclipse.persistence.internal.security.PrivilegedClassForName; @@ -315,7 +314,7 @@ public void setDriverURLHeader(String driverURLHeader) { */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getConnectionString() + ")"; + return getClass().getSimpleName() + "(" + getConnectionString() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/JNDIConnector.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/JNDIConnector.java index 6fb0bac918b..2464c32f6f8 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/JNDIConnector.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/JNDIConnector.java @@ -19,7 +19,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import javax.naming.CompositeName; @@ -250,7 +249,7 @@ public int getLookupType() { */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + ToStringLocalization.buildMessage("datasource_name", null) + "=>" + getName(); + return getClass().getSimpleName() + ToStringLocalization.buildMessage("datasource_name", null) + "=>" + getName(); } /** @@ -259,7 +258,7 @@ public String toString() { */ @Override public void toString(java.io.PrintWriter writer) { - writer.print(ToStringLocalization.buildMessage("connector", null) + "=>" + Helper.getShortClassName(getClass())); + writer.print(ToStringLocalization.buildMessage("connector", null) + "=>" + getClass().getSimpleName()); writer.print(" "); writer.println(ToStringLocalization.buildMessage("datasource_name", null) + "=>" + getName()); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/Project.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/Project.java index 2085f7c22c1..3df544dedc6 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/Project.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/Project.java @@ -47,7 +47,6 @@ import org.eclipse.persistence.descriptors.MultitenantPolicy; import org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy; import org.eclipse.persistence.internal.helper.ConcurrentFixedCache; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.NonSynchronizedVector; import org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap; import org.eclipse.persistence.internal.identitymaps.IdentityMap; @@ -1129,7 +1128,7 @@ public void setName(String name) { */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getName() + ")"; + return getClass().getSimpleName() + "(" + getName() + ")"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/ProjectClassGenerator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/ProjectClassGenerator.java index ae04ab5edc9..510c9ca6b05 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/ProjectClassGenerator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/ProjectClassGenerator.java @@ -735,7 +735,7 @@ protected void addMappingLines(NonreflectiveMethodDefinition method, DatabaseMap String mappingClassName = mapping.getClass().getName(); String packageName = mappingClassName.substring(0, mappingClassName.lastIndexOf('.')); if (packageName.equals("org.eclipse.persistence.mappings")) { - mappingClassName = Helper.getShortClassName(mapping); + mappingClassName = mapping.getClass().getSimpleName(); } method.addLine(mappingClassName + " " + mappingName + " = new " + mappingClassName + "();"); if (!mapping.isWriteOnly()) { @@ -849,7 +849,7 @@ protected void addOptimisticLockingLines(NonreflectiveMethodDefinition method, O String policyClassName = policy.getClass().getName(); String packageName = policyClassName.substring(0, policyClassName.lastIndexOf('.')); if (packageName.equals("org.eclipse.persistence.descriptors")) { - policyClassName = Helper.getShortClassName(policy); + policyClassName = policy.getClass().getSimpleName(); } method.addLine(policyClassName + " lockingPolicy = new " + policyClassName + "();"); @@ -1636,7 +1636,7 @@ protected NonreflectiveMethodDefinition buildLoginMethod(Login datasourceLogin) String loginClassName = datasourceLogin.getClass().getName(); if (datasourceLogin.getClass().equals(DatabaseLogin.class)) { - loginClassName = Helper.getShortClassName(datasourceLogin); + loginClassName = datasourceLogin.getClass().getSimpleName(); } method.addLine(loginClassName + " login = new " + loginClassName + "();"); @@ -1744,7 +1744,7 @@ protected String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetD UnaryTableSequence uts = (UnaryTableSequence)sequence; str = "UnaryTableSequence(\"" + uts.getName() + "\", " + uts.getPreallocationSize() + ", \"" + uts.getCounterFieldName() + "\"));"; } else { - String typeName = Helper.getShortClassName(sequence); + String typeName = sequence.getClass().getSimpleName(); str = typeName + "(\"" + sequence.getName() + "\", " + sequence.getPreallocationSize() + "));"; } return prefix + str; diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/TableCreatorClassGenerator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/TableCreatorClassGenerator.java index 11ffb925611..f5f0860e15f 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/TableCreatorClassGenerator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/factories/TableCreatorClassGenerator.java @@ -146,7 +146,7 @@ protected NonreflectiveMethodDefinition buildLoginMethod(DatabaseLogin login) { String loginClassName = login.getClass().getName(); if (login.getClass().equals(DatabaseLogin.class)) { - loginClassName = Helper.getShortClassName(login); + loginClassName = login.getClass().getSimpleName(); } method.addLine(loginClassName + " login = new " + loginClassName + "();"); @@ -343,7 +343,7 @@ protected String printString(Object value) { } // This handles most cases. - return "new " + Helper.getShortClassName(value) + "(" + value + ")"; + return "new " + value.getClass().getSimpleName() + "(" + value + ")"; } protected String removeDots(String packageName) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/remote/DistributedSession.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/remote/DistributedSession.java index 312b8d40deb..73b360f3088 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/remote/DistributedSession.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/remote/DistributedSession.java @@ -17,7 +17,6 @@ import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.descriptors.DescriptorQueryManager; import org.eclipse.persistence.exceptions.DatabaseException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.identitymaps.IdentityMapManager; import org.eclipse.persistence.internal.queries.ContainerPolicy; import org.eclipse.persistence.internal.sessions.AbstractRecord; @@ -388,7 +387,7 @@ public void setRemoteConnection(RemoteConnection remoteConnection) { */ @Override public String toString() { - return Helper.getShortClassName(getClass()) + "()"; + return getClass().getSimpleName() + "()"; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPolicy.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPolicy.java index c8efc754a0e..b51a857c21c 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPolicy.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPolicy.java @@ -16,7 +16,6 @@ package org.eclipse.persistence.sessions.server; import org.eclipse.persistence.config.ExclusiveConnectionMode; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import org.eclipse.persistence.sessions.Login; @@ -342,7 +341,7 @@ public String toString() { type = type + "," + ToStringLocalization.buildMessage("non-lazy", null) + ")"; } - return Helper.getShortClassName(getClass()) + type; + return getClass().getSimpleName() + type; } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPool.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPool.java index cc9eafc9f50..9130a7af0d6 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPool.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/sessions/server/ConnectionPool.java @@ -18,7 +18,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.internal.databaseaccess.Accessor; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import org.eclipse.persistence.logging.SessionLog; import org.eclipse.persistence.sessions.Login; @@ -519,7 +518,7 @@ public synchronized void startUp() { @Override public String toString() { Object[] args = {getMinNumberOfConnections(), getMaxNumberOfConnections()}; - return Helper.getShortClassName(getClass()) + ToStringLocalization.buildMessage("min_max", args); + return getClass().getSimpleName() + ToStringLocalization.buildMessage("min_max", args); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/Profile.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/Profile.java index f1a952f1765..29ce4633dce 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/Profile.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/Profile.java @@ -166,7 +166,7 @@ public void write(Writer writer, PerformanceProfiler profiler) { try { writer.write(ToStringLocalization.buildMessage("profile", null) + "("); if (getQueryClass() != null) { - writer.write(Helper.getShortClassName(getQueryClass()) + "," + cr); + writer.write(getQueryClass().getSimpleName() + "," + cr); } else { writer.write(cr); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/DatabaseObjectDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/DatabaseObjectDefinition.java index 9fadaf24a66..daa2466652a 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/DatabaseObjectDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/DatabaseObjectDefinition.java @@ -24,7 +24,6 @@ import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.SQLCall; @@ -359,6 +358,6 @@ public void setQualifier(String qualifier) { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getFullName() + ")"; + return getClass().getSimpleName() + "(" + getFullName() + ")"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/FieldDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/FieldDefinition.java index 2be7080d30b..c7992fc5c19 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/FieldDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/FieldDefinition.java @@ -18,7 +18,6 @@ import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.logging.SessionLog; @@ -472,6 +471,6 @@ public boolean shouldAllowNull() { @Override public String toString() { - return Helper.getShortClassName(getClass()) + "(" + getName() + "(" + getType() + "))"; + return getClass().getSimpleName() + "(" + getName() + "(" + getType() + "))"; } } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredFunctionDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredFunctionDefinition.java index 04386d7e9a7..158acacf984 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredFunctionDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredFunctionDefinition.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.tools.schemaframework; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import java.io.IOException; @@ -42,7 +41,7 @@ public Writer buildCreationWriter(AbstractSession session, Writer writer) throws if (session.getPlatform().supportsStoredFunctions()) { super.buildCreationWriter(session, writer); } else { - throw ValidationException.platformDoesNotSupportStoredFunctions(Helper.getShortClassName(session.getPlatform())); + throw ValidationException.platformDoesNotSupportStoredFunctions(session.getPlatform().getClass().getSimpleName()); } return writer; } @@ -56,7 +55,7 @@ public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws if (session.getPlatform().supportsStoredFunctions()) { super.buildDeletionWriter(session, writer); } else { - throw ValidationException.platformDoesNotSupportStoredFunctions(Helper.getShortClassName(session.getPlatform())); + throw ValidationException.platformDoesNotSupportStoredFunctions(session.getPlatform().getClass().getSimpleName()); } return writer; } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredProcedureGenerator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredProcedureGenerator.java index 12d54da4d6d..4a2c65ef786 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredProcedureGenerator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/schemaframework/StoredProcedureGenerator.java @@ -176,7 +176,7 @@ public void generateAmendmentClass(Writer outputWriter, String packageName, Stri } outputWriter.write(methodComment); outputWriter.write("\npublic static void amend"); - outputWriter.write(Helper.getShortClassName(descriptor.getJavaClass())); + outputWriter.write(descriptor.getJavaClass().getSimpleName()); outputWriter.write("ClassDescriptor(ClassDescriptor descriptor){\n\t"); storedProcedureVector = this.storedProcedures.get(descriptor); mappingHashtable = this.mappingStoredProcedures.get(descriptor); @@ -355,7 +355,7 @@ public void generateAmendmentClass(Writer outputWriter, String packageName, Stri outputWriter.write("\n\tfor(Iterator enumtr = project.getDescriptors().values().iterator(); enumtr.hasNext();) {"); outputWriter.write("\n\t\tDescriptor descriptor = (ClassDescriptor)enumtr.next();"); outputWriter.write("\n\t\tif(!(descriptor.isAggregateDescriptor() || descriptor.isDescriptorForInterface())) {"); - outputWriter.write("\n\t\t\tMethod method = " + className + ".class.getMethod(\"amend\"+org.eclipse.persistence.internal.helper.Helper.getShortClassName(descriptor.getJavaClass())+\"ClassDescriptor\", new Class[] {ClassDescriptor.class});"); + outputWriter.write("\n\t\t\tMethod method = " + className + ".class.getMethod(\"amend\"+descriptor.getJavaClass().getSimpleName()+\"ClassDescriptor\", new Class[] {ClassDescriptor.class});"); outputWriter.write("\n\t\t\tmethod.invoke(null, new Object[] {descriptor});"); outputWriter.write("\n\t\t}"); outputWriter.write("\n\t}"); @@ -419,7 +419,7 @@ protected Hashtable> genera * INTERNAL: Generates the object level stored procedure based on the passed in query */ protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, List fields, String namePrefix) { - String className = Helper.getShortClassName(query.getDescriptor().getJavaClass()); + String className = query.getDescriptor().getJavaClass().getSimpleName(); return generateStoredProcedure(query, fields, getPrefix() + namePrefix + className); } @@ -440,7 +440,7 @@ protected StoredProcedureDefinition generateOneToManyMappingDeleteAllProcedure(O * INTERNAL: Generates all the stored procedures for this mapping */ protected StoredProcedureDefinition generateOneToManyMappingProcedures(OneToManyMapping mapping, DatabaseQuery query, Map fields, String namePrefix) { - String sourceClassName = Helper.getShortClassName(mapping.getDescriptor().getJavaClass()); + String sourceClassName = mapping.getDescriptor().getJavaClass().getSimpleName(); return generateStoredProcedure(query, new ArrayList<>(fields.values()), getPrefix() + namePrefix + sourceClassName + "_" + mapping.getAttributeName()); } diff --git a/foundation/org.eclipse.persistence.extension/src/main/java/org/eclipse/persistence/internal/sessions/coordination/jgroups/JGroupsRemoteConnection.java b/foundation/org.eclipse.persistence.extension/src/main/java/org/eclipse/persistence/internal/sessions/coordination/jgroups/JGroupsRemoteConnection.java index d7cbd803784..b6153d1d8c0 100644 --- a/foundation/org.eclipse.persistence.extension/src/main/java/org/eclipse/persistence/internal/sessions/coordination/jgroups/JGroupsRemoteConnection.java +++ b/foundation/org.eclipse.persistence.extension/src/main/java/org/eclipse/persistence/internal/sessions/coordination/jgroups/JGroupsRemoteConnection.java @@ -14,7 +14,6 @@ // Oracle - initial API and implementation package org.eclipse.persistence.internal.sessions.coordination.jgroups; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.internal.sessions.coordination.broadcast.BroadcastRemoteConnection; import org.eclipse.persistence.sessions.coordination.RemoteCommandManager; @@ -179,7 +178,7 @@ protected String logDebugMessage(Message message) { */ @Override protected void createDisplayString() { - this.displayString = Helper.getShortClassName(this) + "[" + serviceId.toString() + "]"; + this.displayString = getClass().getSimpleName() + "[" + serviceId.toString() + "]"; } /** diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/OracleTestModel.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/OracleTestModel.java index 5bda6145dca..25366bc53f6 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/OracleTestModel.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/OracleTestModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -14,6 +14,7 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests; +import junit.framework.Test; import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.testing.framework.TestModel; @@ -71,10 +72,10 @@ public void addTests() { } // Sort the tests alphabetically. - Collections.sort(this.getTests(), new Comparator() { + Collections.sort(this.getTests(), new Comparator() { @Override - public int compare(Object left, Object right) { - return Helper.getShortClassName(left.getClass()).compareTo(Helper.getShortClassName(right.getClass())); + public int compare(Test left, Test right) { + return left.getClass().getSimpleName().compareTo(right.getClass().getSimpleName()); } } ); diff --git a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/dbchangenotification/DbChangeNotificationAdapter.java b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/dbchangenotification/DbChangeNotificationAdapter.java index d1b08a817d6..33a71aeadd2 100644 --- a/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/dbchangenotification/DbChangeNotificationAdapter.java +++ b/foundation/org.eclipse.persistence.oracle.test/src/it/java/org/eclipse/persistence/testing/tests/dbchangenotification/DbChangeNotificationAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -176,9 +176,9 @@ protected String getPkFieldString(DatabaseField field) { } protected String getJmsPropertyTypeName(Class type) { - if (Helper.getShortClassName(type).equals("BigDecimal")) { + if ("BigDecimal".equals(type.getSimpleName())) { return "double"; - } else if (Helper.getShortClassName(type).equals("String")) { + } else if ("String".equals(type.getSimpleName())) { return "String"; } else { throw new TestProblemException("No JMS property type corresponds to the DatabaseField type " + type, null); diff --git a/jpa/eclipselink.jpa.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/dynamic/QuerySQLTracker.java b/jpa/eclipselink.jpa.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/dynamic/QuerySQLTracker.java index f9475adead2..2232bc251cd 100644 --- a/jpa/eclipselink.jpa.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/dynamic/QuerySQLTracker.java +++ b/jpa/eclipselink.jpa.test/src/it/java/org/eclipse/persistence/testing/tests/jpa/dynamic/QuerySQLTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,7 +23,6 @@ //javase imports -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.logging.DefaultSessionLog; import org.eclipse.persistence.logging.SessionLog; @@ -199,7 +198,7 @@ protected void setResult(Object queryResult) { @SuppressWarnings("unchecked") protected void setResult(Object queryResult, Session session) { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(query)); + writer.write(query.getClass().getSimpleName()); writer.write("[" + System.identityHashCode(query) + "]"); writer.write(" result = "); @@ -234,7 +233,7 @@ protected void setResult(Object queryResult, Session session) { } } if (writePkOnly) { - writer.write(Helper.getShortClassName(object) + "(" + writer.write(object.getClass().getSimpleName() + "(" + session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, (AbstractSession) session) + ")"); } else { writer.write(object + ""); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/AdvancedJPAJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/AdvancedJPAJunitTest.java index a480cecc957..9b7b6d59f96 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/AdvancedJPAJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/AdvancedJPAJunitTest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 1998, 2022 IBM Corporation. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -2182,7 +2182,7 @@ public void testProperty() { } } protected String verifyPropertyValue(ClassDescriptor descriptor, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { - return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, Helper.getShortClassName(descriptor.getJavaClass()) + " descriptor"); + return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, descriptor.getJavaClass().getSimpleName() + " descriptor"); } protected String verifyPropertyValue(DatabaseMapping mapping, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { return verifyPropertyValue(propertyName, mapping.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, mapping.getAttributeName() + " attribute"); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java index 337f7018f40..175eb4ec9ff 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 1998, 2022 IBM Corporation. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -5226,24 +5226,24 @@ public void testPersistenceProperties() { } Class defaultCacheType = ss.getDescriptor(Project.class).getIdentityMapClass(); - if(! Helper.getShortClassName(defaultCacheType).equals("FullIdentityMap")) { - fail("defaultCacheType is wrong: "+Helper.getShortClassName(defaultCacheType)); + if(! "FullIdentityMap".equals(defaultCacheType.getSimpleName())) { + fail("defaultCacheType is wrong: "+defaultCacheType.getSimpleName()); } Class employeeCacheType = ss.getDescriptor(Employee.class).getIdentityMapClass(); - if(! Helper.getShortClassName(employeeCacheType).equals("WeakIdentityMap")) { - fail("employeeCacheType is wrong: "+Helper.getShortClassName(employeeCacheType)); + if(! "WeakIdentityMap".equals(employeeCacheType.getSimpleName())) { + fail("employeeCacheType is wrong: "+employeeCacheType.getSimpleName()); } Class addressCacheType = ss.getDescriptor(Address.class).getIdentityMapClass(); - if(! Helper.getShortClassName(addressCacheType).equals("HardCacheWeakIdentityMap")) { - fail("addressCacheType is wrong: "+Helper.getShortClassName(addressCacheType)); + if(! "HardCacheWeakIdentityMap".equals(addressCacheType.getSimpleName())) { + fail("addressCacheType is wrong: "+addressCacheType.getSimpleName()); } // Department cache type specified in @Cache annotation - that should override default property Class departmentCacheType = ss.getDescriptor(Department.class).getIdentityMapClass(); - if(! Helper.getShortClassName(departmentCacheType).equals("SoftCacheWeakIdentityMap")) { - fail("departmentCacheType is wrong: "+Helper.getShortClassName(departmentCacheType)); + if(! "SoftCacheWeakIdentityMap".equals(departmentCacheType.getSimpleName())) { + fail("departmentCacheType is wrong: "+departmentCacheType.getSimpleName()); } int numSessionCalls = Customizer.getNumberOfCallsForSession(ss.getName()); @@ -7959,7 +7959,7 @@ protected void internalTestUpdateAllProjects(Class cls) { return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; HashMap map = null; @@ -8094,7 +8094,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; boolean ok = false; @@ -8201,7 +8201,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { getServerSession().logMessage("Test testUpdateAll*ProjectsWithNullTeamLeader skipped for this platform." ); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; Employee empTemp = null; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java index de368f33580..f2f9c60ac61 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 1998, 2022 IBM Corporation. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -6887,7 +6887,7 @@ protected void internalTestUpdateAllProjects(Class cls) { return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; HashMap map = null; @@ -6994,7 +6994,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; boolean ok = false; @@ -7076,7 +7076,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; Employee empTemp = null; @@ -10706,8 +10706,8 @@ public void testSessionEventListeners() { } else { // note that the order of listeners (session's before broker's) only guaranteed if listeners were set before ServerSession was created. // Listeners set after ServerSession has been created appear on the list in chronological order. - if( !(Helper.getShortClassName(clientSessionListeners.get(0)).equals("MemberEventListener")) || - !(Helper.getPackageName(clientSessionListeners.get(0).getClass()).equals(Helper.getPackageName(classes[i])))) { + if( !("MemberEventListener".equals(clientSessionListeners.get(0).getClass().getSimpleName())) || + !(clientSessionListeners.get(0).getClass().getPackageName().equals(classes[i].getPackageName()))) { fail ("the first clientSession's listener expected to be MemberEventListener from its package, found " + clientSessionListeners.get(0).getClass().getName()); } if( !(clientSessionListeners.get(1) instanceof CompositeEventListener)) { @@ -10731,7 +10731,7 @@ List getCompositeAndMemberListeners(AbstractSession sessio SessionEventListener listener = allListeners.get(i); if (listener instanceof CompositeEventListener) { list.add(listener); - } else if (Helper.getShortClassName(listener).equals("MemberEventListener")) { + } else if ("MemberEventListener".equals(listener.getClass().getSimpleName())) { list.add(listener); } } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fetchgroups/src/test/java/org/eclipse/persistence/testing/tests/jpa/QuerySQLTracker.java b/jpa/eclipselink.jpa.testapps/jpa.test.fetchgroups/src/test/java/org/eclipse/persistence/testing/tests/jpa/QuerySQLTracker.java index 2d643d0ed1b..c7bbf5ffd84 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fetchgroups/src/test/java/org/eclipse/persistence/testing/tests/jpa/QuerySQLTracker.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fetchgroups/src/test/java/org/eclipse/persistence/testing/tests/jpa/QuerySQLTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -199,7 +199,7 @@ protected void setResult(Object queryResult) { @SuppressWarnings("unchecked") protected void setResult(Object queryResult, Session session) { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(query)); + writer.write(query.getClass().getSimpleName()); writer.write("[" + System.identityHashCode(query) + "]"); writer.write(" result = "); @@ -234,7 +234,7 @@ protected void setResult(Object queryResult, Session session) { } } if (writePkOnly) { - writer.write(Helper.getShortClassName(object) + "(" + writer.write(object.getClass().getSimpleName() + "(" + session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, (AbstractSession) session) + ")"); } else { writer.write(object + ""); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java index 6f913737782..4c01d9aa026 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -199,7 +199,7 @@ protected void setResult(Object queryResult) { @SuppressWarnings("unchecked") protected void setResult(Object queryResult, Session session) { StringWriter writer = new StringWriter(); - writer.write(Helper.getShortClassName(query)); + writer.write(query.getClass().getSimpleName()); writer.write("[" + System.identityHashCode(query) + "]"); writer.write(" result = "); @@ -234,7 +234,7 @@ protected void setResult(Object queryResult, Session session) { } } if (writePkOnly) { - writer.write(Helper.getShortClassName(object) + "(" + writer.write(object.getClass().getSimpleName() + "(" + session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, (AbstractSession) session) + ")"); } else { writer.write(object + ""); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java index 4585ba7498c..bc920a9dc55 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the @@ -2405,17 +2405,17 @@ public void testPersistenceProperties() { } Class defaultCacheType = ss.getDescriptor(Project.class).getIdentityMapClass(); - if(! Helper.getShortClassName(defaultCacheType).equals("FullIdentityMap")) { + if(! defaultCacheType.getSimpleName().equals("FullIdentityMap")) { fail("defaultCacheType is wrong"); } Class employeeCacheType = ss.getDescriptor(Employee.class).getIdentityMapClass(); - if(! Helper.getShortClassName(employeeCacheType).equals("WeakIdentityMap")) { + if(! employeeCacheType.getSimpleName().equals("WeakIdentityMap")) { fail("employeeCacheType is wrong"); } Class addressCacheType = ss.getDescriptor(Address.class).getIdentityMapClass(); - if(! Helper.getShortClassName(addressCacheType).equals("HardCacheWeakIdentityMap")) { + if(! addressCacheType.getSimpleName().equals("HardCacheWeakIdentityMap")) { fail("addressCacheType is wrong"); } @@ -4056,7 +4056,7 @@ protected void internalTestUpdateAllProjects(Class cls) { return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; HashMap map = null; @@ -4163,7 +4163,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; boolean ok = false; @@ -4245,7 +4245,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; Employee empTemp = null; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java index 25e65df8cf4..ffeec558153 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -2300,17 +2300,17 @@ public void testPersistenceProperties() { } Class defaultCacheType = ss.getDescriptor(Project.class).getIdentityMapClass(); - if(! Helper.getShortClassName(defaultCacheType).equals("FullIdentityMap")) { + if(! "FullIdentityMap".equals(defaultCacheType.getSimpleName())) { fail("defaultCacheType is wrong"); } Class employeeCacheType = ss.getDescriptor(Employee.class).getIdentityMapClass(); - if(! Helper.getShortClassName(employeeCacheType).equals("WeakIdentityMap")) { + if(! "WeakIdentityMap".equals(employeeCacheType.getSimpleName())) { fail("employeeCacheType is wrong"); } Class addressCacheType = ss.getDescriptor(Address.class).getIdentityMapClass(); - if(! Helper.getShortClassName(addressCacheType).equals("HardCacheWeakIdentityMap")) { + if(! "HardCacheWeakIdentityMap".equals(addressCacheType.getSimpleName())) { fail("addressCacheType is wrong"); } @@ -3890,7 +3890,7 @@ protected void internalTestUpdateAllProjects(Class cls) { return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; HashMap map = null; @@ -3997,7 +3997,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; boolean ok = false; @@ -4078,7 +4078,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { getServerSession().logMessage("Test testUpdateAll*ProjectsWithNullTeamLeader skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); } - String className = Helper.getShortClassName(cls); + String className = cls.getSimpleName(); String name = "testUpdateAllProjects"; String newName = "testUpdateAllProjectsNEW"; Employee empTemp = null; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/inheritance/Vehicle.java b/jpa/eclipselink.jpa.testapps/jpa.test.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/inheritance/Vehicle.java index d7d047c18dc..3710d0b9060 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/inheritance/Vehicle.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/inheritance/Vehicle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -130,6 +130,6 @@ public static ViewDefinition sybaseView() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + id + ")"; + return getClass().getSimpleName() + "(" + id + ")"; } } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceComparisonModel.java b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceComparisonModel.java index 370253935fa..4ee24d69109 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceComparisonModel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceComparisonModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -426,7 +426,7 @@ public void test() { em.close(); } }; - test.setName("ReadAllVsReadAllResultSet(" + Helper.getShortClassName(targetClass) + ')'); + test.setName("ReadAllVsReadAllResultSet(" + targetClass.getSimpleName() + ')'); return test; } @@ -967,7 +967,7 @@ public ResultSetSideBySideTest(Class targetClass, boolean withCache) { super(); this.targetClass = targetClass; this.withCache = withCache; - setName("ResultSetOptimizationSideBySideTest(" + Helper.getShortClassName(targetClass) + ')' + (withCache ? " CACHE" : " NO CACHE")); + setName("ResultSetOptimizationSideBySideTest(" + targetClass.getSimpleName() + ')' + (withCache ? " CACHE" : " NO CACHE")); } @Override diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java index 86aef5d3d9a..19bf20b4736 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -1306,7 +1306,7 @@ public void testProperty() { } } protected String verifyPropertyValue(ClassDescriptor descriptor, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { - return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, Helper.getShortClassName(descriptor.getJavaClass()) + " descriptor"); + return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, descriptor.getJavaClass().getSimpleName() + " descriptor"); } protected String verifyPropertyValue(DatabaseMapping mapping, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { return verifyPropertyValue(propertyName, mapping.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, mapping.getAttributeName() + " attribute"); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.extended/jpa.test.xml.extended.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/extended/advanced/XmlExtendedAdvancedTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.extended/jpa.test.xml.extended.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/extended/advanced/XmlExtendedAdvancedTest.java index f1c097576a7..f47b998b215 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.extended/jpa.test.xml.extended.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/extended/advanced/XmlExtendedAdvancedTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.extended/jpa.test.xml.extended.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/extended/advanced/XmlExtendedAdvancedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -866,7 +866,7 @@ public void testProperty() { } } protected String verifyPropertyValue(ClassDescriptor descriptor, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { - return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, Helper.getShortClassName(descriptor.getJavaClass()) + " descriptor"); + return verifyPropertyValue(propertyName, descriptor.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, descriptor.getJavaClass().getSimpleName() + " descriptor"); } protected String verifyPropertyValue(DatabaseMapping mapping, String propertyName, Class expectedPropertyValueType, Object expectedPropertyValue) { return verifyPropertyValue(propertyName, mapping.getProperty(propertyName), expectedPropertyValueType, expectedPropertyValue, mapping.getAttributeName() + " attribute"); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.only/jpa.test.xml.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/inheritance/Vehicle.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.only/jpa.test.xml.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/inheritance/Vehicle.java index 358a2f717a4..715f54fd244 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.only/jpa.test.xml.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/inheritance/Vehicle.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.only/jpa.test.xml.inheritance/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/inheritance/Vehicle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -80,6 +80,6 @@ public static ViewDefinition sybaseView() { } public String toString() { - return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + id + ")"; + return getClass().getSimpleName() + "(" + id + ")"; } } diff --git a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/SDOType.java b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/SDOType.java index d877f38f996..c506e13a1f1 100644 --- a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/SDOType.java +++ b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/SDOType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -35,7 +35,6 @@ import org.eclipse.persistence.exceptions.DescriptorException; import org.eclipse.persistence.exceptions.SDOException; import org.eclipse.persistence.internal.descriptors.InstantiationPolicy; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.oxm.Namespace; import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; import org.eclipse.persistence.logging.AbstractSessionLog; @@ -860,7 +859,7 @@ public void preInitialize(String packageName, List namespaceResolvers) { } AbstractSessionLog.getLog().log(AbstractSessionLog.FINER,// "sdo_type_generation_processing_type", // - new Object[] { Helper.getShortClassName(getClass()), getInstanceClassName() }); + new Object[] { getClass().getSimpleName(), getInstanceClassName() }); initializeNamespaces(namespaceResolvers); getXmlDescriptor().setJavaClassName(getImplClassName()); diff --git a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOClassGenerator.java b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOClassGenerator.java index ec5b5631f99..bc169f1b704 100644 --- a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOClassGenerator.java +++ b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOClassGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -138,12 +138,12 @@ public static void main(String[] args) { */ private void printUsage(String messageID) { if (null != messageID) { - System.out.println(ToStringLocalization.buildMessage(messageID, new Object[] { Helper.getShortClassName(getClass()) })); + System.out.println(ToStringLocalization.buildMessage(messageID, new Object[] { getClass().getSimpleName() })); } // Because we can no longer use Helper.cr() inside of message bundles, we must break // up the message into separate lines and use Helper.cr() here instead. (bug6470503) - String messageString = ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_1of8", new Object[] { Helper.getShortClassName(getClass()) }); + String messageString = ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_1of8", new Object[] { getClass().getSimpleName() }); messageString += Helper.cr() + Helper.cr(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_2of8"); messageString += Helper.cr();