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 5d1abeaef0d..059ce2fb874 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 @@ -224,11 +224,11 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl public String toString() { StringBuffer buf = new StringBuffer(); buf.append(getClass().getSimpleName() + ": " + this.getType()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); if (getItems() != null) { buf.append("MenuItems: " + getItems().getClass().getSimpleName()); buf.append(getItems().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } return buf.toString(); } 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 4f850f64af4..84b478e5321 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 @@ -119,31 +119,31 @@ public void removeMenu(Menu aMenu) { public String allToString() { StringBuffer buf = new StringBuffer(); buf.append("Restaurant: " + this.getName()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); if (getMenus() != null) { buf.append("Menus: " + getMenus().getClass().getSimpleName()); buf.append(getMenus().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } if (getWaiters() != null) { buf.append("Waiters: " + getWaiters().getClass().getSimpleName()); buf.append(getWaiters().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } if (getPreferredCustomers() != null) { buf.append("PreferredCustomers: " + getPreferredCustomers().getClass().getSimpleName()); buf.append(getPreferredCustomers().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } if (getLocations() != null) { buf.append("Locations: " + getLocations().getClass().getSimpleName()); buf.append(getLocations().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } if (getSlogans() != null) { buf.append("Slogan: " + getSlogans().getClass().getSimpleName()); buf.append(getSlogans().toString()); - buf.append(org.eclipse.persistence.internal.helper.Helper.cr()); + buf.append(System.lineSeparator()); } return buf.toString(); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrder.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrder.java index 844c494eb9c..f4920e94068 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrder.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrder.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 @@ -229,7 +229,7 @@ public String toString() { return buffer.toString(); } - buffer.append(System.getProperty("line.separator")); + buffer.append(System.lineSeparator()); if ((container instanceof IndirectContainer) && (!((IndirectContainer)container).isInstantiated())) { buffer.append("\t"); buffer.append("uninstantiated order lines..."); @@ -237,7 +237,7 @@ public String toString() { for (Enumeration stream = getLineStream(); stream.hasMoreElements();) { buffer.append("\t"); buffer.append(stream.nextElement()); - buffer.append(System.getProperty("line.separator")); + buffer.append(System.lineSeparator()); } } return buffer.toString(); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrderLine.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrderLine.java index 22f09d3cb6e..db3168c107f 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrderLine.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/models/transparentindirection/AbstractOrderLine.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 @@ -94,6 +94,6 @@ public int hashCode() { } public String toString() { - return "OrderLine(" + id + ": " + itemName + " - " + quantity + ")" + org.eclipse.persistence.internal.helper.Helper.cr() + "\t" + System.identityHashCode(this); + return "OrderLine(" + id + ": " + itemName + " - " + quantity + ")" + System.lineSeparator() + "\t" + System.identityHashCode(this); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/clientserver/ClientServerTestModel.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/clientserver/ClientServerTestModel.java index e696dcfe4ee..f96b2e9e998 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/clientserver/ClientServerTestModel.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/clientserver/ClientServerTestModel.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,8 +35,8 @@ public ClientServerTestModel() { public void addRequiredSystems() { try { getSession().getLog().write("WARNING, some JDBC drivers may fail if they are not thread safe." + - Helper.cr() + "JDBC-ODBC will not be run for this test." + Helper.cr() + - "Oracle OCI may fail." + Helper.cr() + "DB2 IBM JDBC may fail." + Helper.cr()); + System.lineSeparator() + "JDBC-ODBC will not be run for this test." + System.lineSeparator() + + "Oracle OCI may fail." + System.lineSeparator() + "DB2 IBM JDBC may fail." + System.lineSeparator()); getSession().getLog().flush(); } catch (java.io.IOException e) { } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/collections/PerformDeletesFirstCollectionObjectRemovalTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/collections/PerformDeletesFirstCollectionObjectRemovalTest.java index 15cfbb5c514..43097818a54 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/collections/PerformDeletesFirstCollectionObjectRemovalTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/collections/PerformDeletesFirstCollectionObjectRemovalTest.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 @@ -90,7 +90,7 @@ protected void verify() { if (endSize != (startSize - 1)) { StringBuffer buffer = new StringBuffer(); buffer.append("Parent collection was not updated correctly."); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); buffer.append("Start size: "); buffer.append(startSize); buffer.append(" End size: "); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/HelperSystemPropertyTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/HelperSystemPropertyTest.java index 33107e46c7f..ac52d520478 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/HelperSystemPropertyTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/feature/HelperSystemPropertyTest.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 @@ -28,8 +28,8 @@ public HelperSystemPropertyTest() { @Override public void verify() { - if (!org.eclipse.persistence.internal.helper.Helper.cr().equals(System.getProperty("line.separator"))) { - throw new TestErrorException("Helper.cr() returns the incorrect value."); + if (!System.lineSeparator().equals(System.getProperty("line.separator"))) { + throw new TestErrorException("System.lineSeparator() returns the incorrect value."); } if (!org.eclipse.persistence.internal.helper.Helper.pathSeparator().equals(System.getProperty("path.separator"))) { diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/identitymaps/cacheinvalidation/UnitOfWorkRefreshAfterInvalidationTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/identitymaps/cacheinvalidation/UnitOfWorkRefreshAfterInvalidationTest.java index 37c5da1b0a1..fe330dfe356 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/identitymaps/cacheinvalidation/UnitOfWorkRefreshAfterInvalidationTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/identitymaps/cacheinvalidation/UnitOfWorkRefreshAfterInvalidationTest.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 @@ -93,10 +93,10 @@ public void verify() { if (!errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); buffer.append("Errors occurred with duplicate SQL being executed whilst building an object tree. The UnitOfWork cache should have been hit instead:"); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); for (int i = 0; i < errors.size(); i++) { buffer.append(errors.get(i)); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); } throw new TestErrorException(buffer.toString()); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/interfaces/UpdateObjectTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/interfaces/UpdateObjectTest.java index c8ad1fc1f64..81c16c603a0 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/interfaces/UpdateObjectTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/interfaces/UpdateObjectTest.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 @@ -33,7 +33,7 @@ public void test() { try { uow.commit(); } catch (org.eclipse.persistence.exceptions.DatabaseException ex) { - throw new TestErrorException("Inserted instead of updating" + org.eclipse.persistence.internal.helper.Helper.cr() + + throw new TestErrorException("Inserted instead of updating" + System.lineSeparator() + ex.toString()); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java index 615fb3b048e..820c452a35c 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/jpql/JPQLExceptionTest.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 @@ -187,7 +187,7 @@ public void test() { @Override public void verify() { if (caughtException == null) { - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "caught exception was null! \n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "caught exception was null! \n\n[EXPECTING] " + expectedException); } if (caughtException instanceof JPQLException) { @@ -206,7 +206,7 @@ public void verify() { } } } - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); } @Override diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/performance/PerformanceTestModel.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/performance/PerformanceTestModel.java index ed8637c43b7..215c46e2351 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/performance/PerformanceTestModel.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/performance/PerformanceTestModel.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 @@ -377,10 +377,10 @@ protected void logHeadNote(Writer log) { super.logHeadNote(log); try { if (!System.getProperties().containsKey("toplink.loadbuild.baseline-version")) { - log.write(getIndentationString() + "BASELINE VERSION: NONE SET" + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getIndentationString() + "BASELINE VERSION: NONE SET" + System.lineSeparator()); } else { String baselineVersion = System.getProperties().getProperty("toplink.loadbuild.baseline-version"); - log.write(getIndentationString() + "BASELINE VERSION: " + baselineVersion + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getIndentationString() + "BASELINE VERSION: " + baselineVersion + System.lineSeparator()); } } catch (IOException exception) { } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/Jdk12ScrollableCursorTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/Jdk12ScrollableCursorTest.java index e22b9c7b32c..811a27b85a1 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/Jdk12ScrollableCursorTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/Jdk12ScrollableCursorTest.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 @@ protected void setup() { throw new TestWarningException("ScrollableCursor is not supported on this platform"); } if (getSession().getPlatform().isDB2()) { - throw new TestWarningException("java.sql.SQLException: [IBM][JDBC Driver] CLI0626E" + Helper.cr() + + throw new TestWarningException("java.sql.SQLException: [IBM][JDBC Driver] CLI0626E" + System.lineSeparator() + "Updatable result set is not supported in this version of DB2 JDBC 2.0 driver."); } TYPE_SCROLL_INSENSITIVE_isSupported = true; diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoProjectXMLClientTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoProjectXMLClientTest.java index 2b5757b8c36..bda295261b7 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoProjectXMLClientTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoProjectXMLClientTest.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 SimplePojoProjectXMLClientTest() { public void setup() throws TestErrorException { simplePojoProjectXMLClient = new SimplePojoProjectXMLClientTest(); - System.out.println(System.getProperty("line.separator") + System.getProperty("line.separator") + "Now running Simple POJO test using Project Deployment XML file..."); + System.out.println(System.lineSeparator() + System.lineSeparator() + "Now running Simple POJO test using Project Deployment XML file..."); try { org.eclipse.persistence.sessions.Project project = XMLProjectReader.read("PojoEmployee.xml"); @@ -53,7 +53,7 @@ public void test() throws TestErrorException { for (Iterator itr = objects.iterator(); itr.hasNext(); ) { simplePojoProjectXMLClient.printObjectAttributes(itr.next()); } - System.out.println(System.getProperty("line.separator") + System.getProperty("line.separator") + "Test using Project Deployment XML file is complete" + System.getProperty("line.separator") + System.getProperty("line.separator")); + System.out.println(System.lineSeparator() + System.lineSeparator() + "Test using Project Deployment XML file is complete" + System.lineSeparator() + System.lineSeparator()); } catch (Exception e) { throw new TestErrorException("" + e); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoSessionsXMLClientTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoSessionsXMLClientTest.java index 2b30a0e7246..f1994d6c9ab 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoSessionsXMLClientTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simplepojoclient/SimplePojoSessionsXMLClientTest.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 @@ -36,7 +36,7 @@ public SimplePojoSessionsXMLClientTest() { public void setup() throws TestErrorException { simplePojoSessionsXMLClient = new SimplePojoSessionsXMLClientTest(); - System.out.println(System.getProperty("line.separator") + System.getProperty("line.separator") + "Now running Simple POJO test using Sessions XML file..."); + System.out.println(System.lineSeparator() + System.lineSeparator() + "Now running Simple POJO test using Sessions XML file..."); try { org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader xmlLoader = new org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader("SimplePojoClientSessions.xml"); @@ -54,7 +54,7 @@ public void test() throws TestErrorException { for (Iterator itr = objects.iterator(); itr.hasNext(); ) { simplePojoSessionsXMLClient.printObjectAttributes(itr.next()); } - System.out.println(System.getProperty("line.separator") + System.getProperty("line.separator") + "Test using Project Deployment XML file is complete" + System.getProperty("line.separator") + System.getProperty("line.separator")); + System.out.println(System.lineSeparator() + System.lineSeparator() + "Test using Project Deployment XML file is complete" + System.lineSeparator() + System.lineSeparator()); } catch (Exception e) { throw new TestErrorException("" + e); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/MultithreadTestCase.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/MultithreadTestCase.java index c2b5bd7102b..09d1175044a 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/MultithreadTestCase.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/simultaneous/MultithreadTestCase.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 @@ -341,7 +341,7 @@ public void logResult(Writer log) { for (int i = 0; i < numberOfTests; i++) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + Helper.getTabs(getNestedCounter() + 1) + "Test Thread " + i); + log.write(System.lineSeparator() + Helper.getTabs(getNestedCounter() + 1) + "Test Thread " + i); } catch (IOException exception) { } test[i].logResult(log); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/types/BLOBTester.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/types/BLOBTester.java index ffa7f0b3ff5..4697b34c593 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/types/BLOBTester.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/types/BLOBTester.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 @@ -112,7 +112,7 @@ protected void test(WriteTypeObjectTest testCase) throws TestWarningException { try { super.test(testCase); } catch (NullPointerException e) { - throw new TestWarningException("Blob value was returned as null, this means the drivers max size was exceeded." + org.eclipse.persistence.internal.helper.Helper.cr() + caughtException); + throw new TestWarningException("Blob value was returned as null, this means the drivers max size was exceeded." + System.lineSeparator() + caughtException); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/CloneAttributeIfMutableTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/CloneAttributeIfMutableTest.java index c1632797a3d..f8a2749f933 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/CloneAttributeIfMutableTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/CloneAttributeIfMutableTest.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 @@ -128,11 +128,11 @@ public void verify() { if (errors.isEmpty() == false) { StringBuffer buffer = new StringBuffer(); buffer.append("The following assertions failed:"); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); for (int i = 0; i < errors.size(); i++) { Throwable t = (Throwable)errors.get(i); buffer.append(t); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); } throw new TestErrorException(buffer.toString()); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/transactionisolation/TransactionIsolationBuildObjectCacheHitTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/transactionisolation/TransactionIsolationBuildObjectCacheHitTest.java index 40ec8e0085b..0183ad84a0a 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/transactionisolation/TransactionIsolationBuildObjectCacheHitTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/unitofwork/transactionisolation/TransactionIsolationBuildObjectCacheHitTest.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 @@ -94,10 +94,10 @@ public void verify() { if (!errors.isEmpty()) { StringBuffer buffer = new StringBuffer(); buffer.append("Errors occurred with duplicate SQL being executed whilst building an object tree. The UnitOfWork cache should have been hit instead:"); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); for (int i = 0; i < errors.size(); i++) { buffer.append(errors.get(i)); - buffer.append(Helper.cr()); + buffer.append(System.lineSeparator()); } throw new TestErrorException(buffer.toString()); } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructingDescriptorExceptionTests.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructingDescriptorExceptionTests.java index ce84bfbcd01..6453b86ec6e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructingDescriptorExceptionTests.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructingDescriptorExceptionTests.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 @@ -261,13 +261,13 @@ public void test() throws NoSuchMethodException { @Override protected void verify() { if (caughtException != null) { - throw new TestErrorException("An exception was thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "caught exception was not null! \n\n[EXPECTING] no Exceptions "); + throw new TestErrorException("An exception was thrown:" + System.lineSeparator() + "caught exception was not null! \n\n[EXPECTING] no Exceptions "); } Iterator iteratorResults = testResults.iterator(); while (iteratorResults.hasNext()) { String item = (String)iteratorResults.next(); if (!item.equalsIgnoreCase("passed")) { - throw new TestErrorException("The proper exception was not created:" + org.eclipse.persistence.internal.helper.Helper.cr() + "[Problem with METHOD] " + item); + throw new TestErrorException("The proper exception was not created:" + System.lineSeparator() + "[Problem with METHOD] " + item); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructorTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructorTest.java index 49e4fea822a..fc027ac7bae 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructorTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ConstructorTest.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 @@ -61,7 +61,7 @@ public void test() { @Override protected void verify() { if (caughtException == null) { - throwError("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "caught exception was null! " + org.eclipse.persistence.internal.helper.Helper.cr() + org.eclipse.persistence.internal.helper.Helper.cr() + "[EXPECTING] " + expectedException + " or " + secondExpectedException); + throwError("The proper exception was not thrown:" + System.lineSeparator() + "caught exception was null! " + System.lineSeparator() + System.lineSeparator() + "[EXPECTING] " + expectedException + " or " + secondExpectedException); } if (caughtException instanceof IntegrityException) { @@ -89,7 +89,7 @@ protected void verify() { } } - String cr = org.eclipse.persistence.internal.helper.Helper.cr(); + String cr = System.lineSeparator(); if (!illegalAccessConstructorInit && !noSuchMethodConstructorInit && !noSuchMethodInstantiationInit) { throw new org.eclipse.persistence.testing.framework.TestErrorException("The proper exception was not thrown:" + cr + "[CAUGHT] " + caughtException + cr + cr + "[EXPECTING] " + expectedException.getMessage() + cr + " or " + secondExpectedException.getMessage() + cr + " or " + thirdExpectedException.getMessage()); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ExceptionTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ExceptionTest.java index e049ab868be..e222314cf19 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ExceptionTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ExceptionTest.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 @@ -31,11 +31,11 @@ public void reset() { @Override protected void verify() { if (caughtException == null) { - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "caught exception was null! \n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "caught exception was null! \n\n[EXPECTING] " + expectedException); } if (caughtException.getErrorCode() != expectedException.getErrorCode()) { - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); } } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/InvalidContainerPolicyTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/InvalidContainerPolicyTest.java index fe8d2c04c6c..22a6ad7e01e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/InvalidContainerPolicyTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/InvalidContainerPolicyTest.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 @@ -64,10 +64,10 @@ public IndirectListContainerPolicy(Class containerClass) { @Override protected void verify() { if (caughtException != null) { - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] " + expectedException); } if ((147 != expectedException.getErrorCode()) || (!passed)) { - throw new TestErrorException("The proper exception was not thrown:" + org.eclipse.persistence.internal.helper.Helper.cr() + "caught exception was not null! \n\n[EXPECTING] " + expectedException); + throw new TestErrorException("The proper exception was not thrown:" + System.lineSeparator() + "caught exception was not null! \n\n[EXPECTING] " + expectedException); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ProxyIndirectionNotAvailableTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ProxyIndirectionNotAvailableTest.java index 452ccbb7ad5..9f6512e6e99 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ProxyIndirectionNotAvailableTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/validation/ProxyIndirectionNotAvailableTest.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 void test() { protected void verify() { if (caughtException != null) { throw new TestErrorException("The proper exception was not thrown:" - + org.eclipse.persistence.internal.helper.Helper.cr() + "[CAUGHT] " + + System.lineSeparator() + "[CAUGHT] " + caughtException + "\n\n[EXPECTING] no Exception"); } } diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/workbenchintegration/QueryOptions/ShouldPrepareTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/workbenchintegration/QueryOptions/ShouldPrepareTest.java index 56e53ea3eae..210eecd9cfd 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/workbenchintegration/QueryOptions/ShouldPrepareTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/workbenchintegration/QueryOptions/ShouldPrepareTest.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 @@ -44,9 +44,9 @@ public void reset() { public void setup() { if (getSession().getPlatform().isDB2()) { throw new TestWarningException("This test is not supposed to work with DB2. " + - org.eclipse.persistence.internal.helper.Helper.cr() + + System.lineSeparator() + "\t\tBecause as expected, sql string contains (t0.F_NAME = NULL) when the query is executed the second time with argument null, and '=NULL' is illegal syntax on DB2." + - org.eclipse.persistence.internal.helper.Helper.cr() + + System.lineSeparator() + "\t\tHence, executing the query would result in runtime exception."); } query = diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/writing/CommitOrderTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/writing/CommitOrderTest.java index 886b1d0aa1e..3d2992e2a74 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/writing/CommitOrderTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/writing/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 @@ -104,7 +104,7 @@ public void reset() { protected String getErrorMessage(String resultList) { StringBuilder sb = new StringBuilder(); - String cr = Helper.cr(); + String cr = System.lineSeparator(); sb.append("Error: An unexpected commit order was found."); sb.append(cr); sb.append("A possible cause of this problem may be additional mapped classes were added to test models used by the testcase "); @@ -126,7 +126,7 @@ protected String getErrorMessage(String resultList) { protected String getCommitOrderListAsString(List> classes) { StringBuilder sb = new StringBuilder(); - String cr = Helper.cr(); + String cr = System.lineSeparator(); for (Class clazz : classes) { sb.append(clazz.getName()); sb.append(cr); @@ -136,7 +136,7 @@ protected String getCommitOrderListAsString(List> classes) { protected static String initializeExpectedCommitOrder() { StringBuilder sb = new StringBuilder(); - String cr = Helper.cr(); + String cr = System.lineSeparator(); sb.append("org.eclipse.persistence.testing.models.aggregate.Address").append(cr); sb.append("org.eclipse.persistence.testing.models.aggregate.Address1").append(cr); sb.append("org.eclipse.persistence.testing.models.aggregate.AddressDescription").append(cr); diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.java index 267e1ffa278..fe26f0d5a72 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.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,8 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.framework; -import org.eclipse.persistence.internal.helper.Helper; - import java.io.IOException; import java.io.Writer; import java.util.ArrayList; @@ -235,56 +233,56 @@ public void logResult(Writer log) { String indentationString = getTestCase().getIndentationString(); try { if (hasError() || hasFatalError() || hasProblem()) { - log.write(indentationString + "##FAILURE##" + Helper.cr()); + log.write(indentationString + "##FAILURE##" + System.lineSeparator()); } if (!getTestCounts().isEmpty()) { - log.write(indentationString + "RUNS: " + getTestCounts().get(0).size() + Helper.cr()); + log.write(indentationString + "RUNS: " + getTestCounts().get(0).size() + System.lineSeparator()); } for (int index = 0; index < getTestCounts().size(); index++) { PerformanceComparisonTest test = (PerformanceComparisonTest)this.testCase; - log.write(Helper.cr()); + log.write(System.lineSeparator()); if (index == 0) { - log.write(indentationString + "BASE_LINE TEST" + Helper.cr()); + log.write(indentationString + "BASE_LINE TEST" + System.lineSeparator()); } else { test = (PerformanceComparisonTest)test.getTests().get(index - 1); } - log.write(indentationString + "TEST: " + test.getName() + Helper.cr()); + log.write(indentationString + "TEST: " + test.getName() + System.lineSeparator()); log.write(indentationString + "TEST RUN TIME: " + (test.getTestRunTime() / 1000) + " seconds" + - Helper.cr()); - log.write(indentationString + "MEAN TEST COUNT: " + this.testAverages.get(index) + Helper.cr()); - log.write(indentationString + "MAX TEST COUNT: " + this.testMaxs.get(index) + Helper.cr()); - log.write(indentationString + "MIN TEST COUNT: " + this.testMins.get(index) + Helper.cr()); + System.lineSeparator()); + log.write(indentationString + "MEAN TEST COUNT: " + this.testAverages.get(index) + System.lineSeparator()); + log.write(indentationString + "MAX TEST COUNT: " + this.testMaxs.get(index) + System.lineSeparator()); + log.write(indentationString + "MIN TEST COUNT: " + this.testMins.get(index) + System.lineSeparator()); log.write(indentationString + "TEST % STANDARD DEVIATION: " + this.testStandardDeviations.get(index) + - Helper.cr()); + System.lineSeparator()); if (index > 0) { log.write(indentationString + "% DIFFERENCE: " + this.percentageDifferences.get(index - 1) + - Helper.cr()); - log.write(indentationString + "% DIFFERENCE ALLOWABLE: " + test.getAllowableDecrease() + Helper.cr()); + System.lineSeparator()); + log.write(indentationString + "% DIFFERENCE ALLOWABLE: " + test.getAllowableDecrease() + System.lineSeparator()); } } if (getTestCase() instanceof PerformanceRegressionTest) { - log.write(indentationString + "BASELINE VERSION: " + getBaselineVersion() + Helper.cr()); - log.write(indentationString + "BASELINE VERSION RESULTS: " + getBaselineVersionResults() + Helper.cr()); + log.write(indentationString + "BASELINE VERSION: " + getBaselineVersion() + System.lineSeparator()); + log.write(indentationString + "BASELINE VERSION RESULTS: " + getBaselineVersionResults() + System.lineSeparator()); log.write(indentationString + "BASELINE VERSION % STANDARD DEVIATION: " + this.baselineStandardDeviation + - Helper.cr()); - log.write(indentationString + "CURRENT VERSION RESULTS: " + this.getCurrentVersionResults() + Helper.cr()); + System.lineSeparator()); + log.write(indentationString + "CURRENT VERSION RESULTS: " + this.getCurrentVersionResults() + System.lineSeparator()); log.write(indentationString + "CURRENT VERSION % STANDARD DEVIATION: " + this.currentStandardDeviation + - Helper.cr()); - log.write(indentationString + "% DIFFERENCE (last run): " + getPercentageDifferenceLastRun() + Helper.cr()); - log.write(indentationString + "% DIFFERENCE (average): " + getPercentageDifferenceAverage() + Helper.cr()); + System.lineSeparator()); + log.write(indentationString + "% DIFFERENCE (last run): " + getPercentageDifferenceLastRun() + System.lineSeparator()); + log.write(indentationString + "% DIFFERENCE (average): " + getPercentageDifferenceAverage() + System.lineSeparator()); } - log.write(Helper.cr() + indentationString + "RESULT: " + getOutcome() + Helper.cr()); + log.write(System.lineSeparator() + indentationString + "RESULT: " + getOutcome() + System.lineSeparator()); } catch (IOException | ArrayIndexOutOfBoundsException exception) { // Ignore. } try { if (getException() != null) { getException().setIndentationString(indentationString); - log.write(getException() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getException() + System.lineSeparator()); } log.flush(); } catch (IOException exception) { diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestCase.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestCase.java index aadd7165ba7..4dbcbdb7804 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestCase.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestCase.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 @@ -411,8 +411,8 @@ public void logRegressionResult(Writer log) { setIndentationString(Helper.getTabs(getNestedCounter())); try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "TEST DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "TEST NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "TEST DESCRIPTION: " + getDescription() + System.lineSeparator()); log.flush(); } catch (IOException exception) { } @@ -436,9 +436,9 @@ public void logResult(Writer log) { setIndentationString(Helper.getTabs(getNestedCounter())); try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "TEST DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); + log.write(System.lineSeparator() + getIndentationString() + "TEST NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "TEST DESCRIPTION: " + getDescription() + System.lineSeparator()); log.flush(); } catch (IOException exception) { } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestExecutor.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestExecutor.java index 82690f591ae..f8eb4805c9e 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestExecutor.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestExecutor.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 @@ -93,7 +93,7 @@ public class TestExecutor { /** Allow only errors to be logged. */ protected boolean shouldLogOnlyErrors = false; - public static String CR = org.eclipse.persistence.internal.helper.Helper.cr(); + public static String CR = System.lineSeparator(); /** * Return a default executor. Used as the executor for tests run in JUnit, or by themselves. diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestModel.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestModel.java index d4941773d91..6b3b3d7e1b3 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestModel.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestModel.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 @@ -264,7 +264,7 @@ public boolean isSetup() { @Override protected void logFootNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "RESULTS OF TEST MODEL: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "RESULTS OF TEST MODEL: " + getName() + System.lineSeparator()); } catch (IOException exception) { } } @@ -276,8 +276,8 @@ protected void logFootNote(Writer log) { @Override protected void logRegressionHeadNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST MODEL NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "MODEL DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "TEST MODEL NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "MODEL DESCRIPTION: " + getDescription() + System.lineSeparator()); } catch (IOException exception) { } } @@ -288,9 +288,9 @@ protected void logRegressionHeadNote(Writer log) { @Override protected void logHeadNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST MODEL NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "MODEL DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); + log.write(System.lineSeparator() + getIndentationString() + "TEST MODEL NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "MODEL DESCRIPTION: " + getDescription() + System.lineSeparator()); } catch (IOException exception) { } } diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResult.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResult.java index 9d25fd26787..446dd7b1551 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResult.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResult.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 @@ -251,7 +251,7 @@ public boolean hasFailed() { public void logRegressionResult(Writer log) { String indentationString = getTestCase().getIndentationString(); try { - log.write(indentationString + "RESULT: " + getOutcome() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "RESULT: " + getOutcome() + System.lineSeparator()); log.flush(); } catch (IOException exception) { } @@ -266,20 +266,20 @@ public void logResult(Writer log) { String indentationString = getTestCase().getIndentationString(); try { if (hasError() || hasFatalError() || hasProblem()) { - log.write(indentationString + "##FAILURE##" + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "##FAILURE##" + System.lineSeparator()); } - log.write(indentationString + "TEST TIME: " + getTestTime() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "TOTAL TIME: " + getTotalTime() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "RESULT: " + getOutcome() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "TEST TIME: " + getTestTime() + System.lineSeparator()); + log.write(indentationString + "TOTAL TIME: " + getTotalTime() + System.lineSeparator()); + log.write(indentationString + "RESULT: " + getOutcome() + System.lineSeparator()); if (getException() != null) { getException().setIndentationString(indentationString); // Do not print the stack for warnings, just the exception. if (hasWarning()) { - log.write(getException() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getException() + System.lineSeparator()); } else { log.write(indentationString); log.flush(); - log.write(getExceptionStackTrace() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getExceptionStackTrace() + System.lineSeparator()); } } log.flush(); diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResultsSummary.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResultsSummary.java index 3df38a52fdd..e2fe1ba18d8 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResultsSummary.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestResultsSummary.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 @@ -332,28 +332,28 @@ public void logResult(Writer log) { try { if (didSetupFail()) { - log.write(indentationString + org.eclipse.persistence.internal.helper.Helper.cr() + "## SETUP FAILURE: " + org.eclipse.persistence.internal.helper.Helper.cr() + getSetupException() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + System.lineSeparator() + "## SETUP FAILURE: " + System.lineSeparator() + getSetupException() + System.lineSeparator()); PrintWriter printWriter = new PrintWriter(log); getSetupException().printStackTrace(printWriter); log.flush(); } else if (didSetupWarn()) { - log.write(indentationString + "SETUP WARNING: " + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "SETUP WARNING: " + System.lineSeparator()); ((TestWarningException)getSetupException()).setIndentationString(indentationString); - log.write(getSetupException() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(getSetupException() + System.lineSeparator()); log.flush(); } else { if ((getErrors() > 0) || (getFatalErrors() > 0) || (getProblems() > 0)) { - log.write(indentationString + "###ERRORS###" + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "###ERRORS###" + System.lineSeparator()); } - log.write(indentationString + "Warnings: " + getWarnings() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Problems: " + getProblems() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Errors: " + getErrors() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Fatal Errors: " + getFatalErrors() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Passed: " + getPassed() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Setup Warnings: " + getSetupWarnings() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Setup Failures: " + getSetupFailures() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Total Time: " + getTotalTime() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Total Tests: " + getTotalTests() + org.eclipse.persistence.internal.helper.Helper.cr() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "Warnings: " + getWarnings() + System.lineSeparator()); + log.write(indentationString + "Problems: " + getProblems() + System.lineSeparator()); + log.write(indentationString + "Errors: " + getErrors() + System.lineSeparator()); + log.write(indentationString + "Fatal Errors: " + getFatalErrors() + System.lineSeparator()); + log.write(indentationString + "Passed: " + getPassed() + System.lineSeparator()); + log.write(indentationString + "Setup Warnings: " + getSetupWarnings() + System.lineSeparator()); + log.write(indentationString + "Setup Failures: " + getSetupFailures() + System.lineSeparator()); + log.write(indentationString + "Total Time: " + getTotalTime() + System.lineSeparator()); + log.write(indentationString + "Total Tests: " + getTotalTests() + System.lineSeparator() + System.lineSeparator()); log.flush(); } } catch (IOException exception) { @@ -370,24 +370,24 @@ public void logRegressionResult(Writer log) { try { if (didSetupFail()) { - log.write(indentationString + org.eclipse.persistence.internal.helper.Helper.cr() + "## SETUP FAILURE: " + org.eclipse.persistence.internal.helper.Helper.cr() + getSetupException() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + System.lineSeparator() + "## SETUP FAILURE: " + System.lineSeparator() + getSetupException() + System.lineSeparator()); PrintWriter printWriter = new PrintWriter(log); getSetupException().printStackTrace(printWriter); log.flush(); } else { if ((getErrors() > 0) || (getFatalErrors() > 0) || (getProblems() > 0)) { - log.write(indentationString + "###ERRORS###" + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(indentationString + "###ERRORS###" + System.lineSeparator()); } - //log.write(indentationString + "Warnings: " + getWarnings() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Problems: " + getProblems() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Errors: " + getErrors() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Fatal Errors: " + getFatalErrors() + org.eclipse.persistence.internal.helper.Helper.cr()); - //log.write(indentationString + "Passed: " + getPassed() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(indentationString + "Setup Failures: " + getSetupFailures() + org.eclipse.persistence.internal.helper.Helper.cr() + org.eclipse.persistence.internal.helper.Helper.cr()); + //log.write(indentationString + "Warnings: " + getWarnings() + System.lineSeparator()); + log.write(indentationString + "Problems: " + getProblems() + System.lineSeparator()); + log.write(indentationString + "Errors: " + getErrors() + System.lineSeparator()); + log.write(indentationString + "Fatal Errors: " + getFatalErrors() + System.lineSeparator()); + //log.write(indentationString + "Passed: " + getPassed() + System.lineSeparator()); + log.write(indentationString + "Setup Failures: " + getSetupFailures() + System.lineSeparator() + System.lineSeparator()); //log.write( - // indentationString + "Total Tests: " + getTotalTests() + org.eclipse.persistence.internal.helper.Helper.cr() - // + org.eclipse.persistence.internal.helper.Helper.cr()); + // indentationString + "Total Tests: " + getTotalTests() + System.lineSeparator() + // + System.lineSeparator()); log.flush(); } } catch (IOException exception) { diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestSuite.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestSuite.java index 0c9cb65a44e..f151e16d350 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestSuite.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TestSuite.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 @@ -110,7 +110,7 @@ public void execute(TestExecutor executor) throws Throwable { @Override protected void logFootNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "RESULTS OF TEST SUITE: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "RESULTS OF TEST SUITE: " + getName() + System.lineSeparator()); } catch (IOException exception) { } } @@ -122,8 +122,8 @@ protected void logFootNote(Writer log) { @Override protected void logRegressionHeadNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST SUITE NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "SUITE DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + getIndentationString() + "TEST SUITE NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "SUITE DESCRIPTION: " + getDescription() + System.lineSeparator()); } catch (IOException exception) { } } @@ -134,9 +134,9 @@ protected void logRegressionHeadNote(Writer log) { @Override protected void logHeadNote(Writer log) { try { - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); - log.write(org.eclipse.persistence.internal.helper.Helper.cr() + getIndentationString() + "TEST SUITE NAME: " + getName() + org.eclipse.persistence.internal.helper.Helper.cr()); - log.write(getIndentationString() + "SUITE DESCRIPTION: " + getDescription() + org.eclipse.persistence.internal.helper.Helper.cr()); + log.write(System.lineSeparator() + System.lineSeparator() + getIndentationString() + "VERSION: " + org.eclipse.persistence.sessions.DatabaseLogin.getVersion()); + log.write(System.lineSeparator() + getIndentationString() + "TEST SUITE NAME: " + getName() + System.lineSeparator()); + log.write(getIndentationString() + "SUITE DESCRIPTION: " + getDescription() + System.lineSeparator()); } catch (IOException exception) { } } 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 ffe662847d1..a12a5a3155d 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 @@ -879,7 +879,7 @@ public void logOnlyErrorsChanged() { private void handleException(Throwable exception) { try { getExecutor().getLog().write("--------- UNCAUGHT EXCEPTION ---------" + - org.eclipse.persistence.internal.helper.Helper.cr()); + System.lineSeparator()); exception.printStackTrace(new PrintWriter(getExecutor().getLog())); getExecutor().getLog().flush(); } catch (IOException e) { @@ -1075,7 +1075,7 @@ public void logTestResults() { public void notifyException(Throwable exception) { try { getExecutor().getLog().write("--------- UNCAUGHT EXCEPTION ---------" + - org.eclipse.persistence.internal.helper.Helper.cr()); + System.lineSeparator()); exception.printStackTrace(new PrintWriter(getExecutor().getLog())); getExecutor().getLog().flush(); } catch (IOException e) { diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/SessionConsolePanel.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/SessionConsolePanel.java index c1550933aad..a412481723f 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/SessionConsolePanel.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/tools/sessionconsole/SessionConsolePanel.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; import org.eclipse.persistence.internal.identitymaps.CacheKey; import org.eclipse.persistence.internal.identitymaps.IdentityMap; import org.eclipse.persistence.internal.sessions.AbstractSession; @@ -3094,7 +3093,7 @@ void initialize() { public void inspect(Object object) { getLogText().append(String.valueOf(object)); - getLogText().append(Helper.cr()); + getLogText().append(System.lineSeparator()); getLogBook().setSelectedComponent(getLogPage()); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISAccessor.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISAccessor.java index 5cd2c47ccf3..2ab71ddf7f0 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISAccessor.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/EISAccessor.java @@ -25,7 +25,6 @@ import org.eclipse.persistence.exceptions.DatabaseException; import org.eclipse.persistence.exceptions.QueryException; 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.logging.SessionLog; @@ -108,7 +107,7 @@ protected void buildConnectLog(AbstractSession session) { // Log connection information. if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. ConnectionMetaData metaData = getCCIConnection().getMetaData(); - Object[] args = { metaData.getUserName(), metaData.getEISProductName(), metaData.getEISProductVersion(), Helper.cr(), "\t" }; + Object[] args = { metaData.getUserName(), metaData.getEISProductName(), metaData.getEISProductVersion(), System.lineSeparator(), "\t" }; session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connected_user_database", args, this); } } catch (ResourceException exception) { 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 739e4245dc4..90ce3278f05 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 @@ -15,7 +15,6 @@ package org.eclipse.persistence.eis; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import java.io.StringWriter; @@ -203,7 +202,7 @@ public String toString() { for (Iterator keysIterator = keySet().iterator(); keysIterator.hasNext();) { Object key = keysIterator.next(); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\t"); writer.write(String.valueOf(key)); writer.write(" => "); 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 978f2821ca2..753968a10c8 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 @@ -26,7 +26,6 @@ import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.databaseaccess.DatasourceCall; import org.eclipse.persistence.internal.helper.DatabaseField; -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.DatabaseQuery; @@ -300,13 +299,13 @@ public String getLogString(Accessor accessor) { StringWriter writer = new StringWriter(); writer.write("Executing "); writer.write(toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tspec => "); writer.write(String.valueOf(getInteractionSpec())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tproperties => "); writer.write(String.valueOf(getProperties())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tinput => ["); if (!getParameters().isEmpty()) { for (Iterator iterator = getParameters().iterator(); iterator.hasNext();) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/QueryStringInteraction.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/QueryStringInteraction.java index b07d9208634..459ab8afc99 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/QueryStringInteraction.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/QueryStringInteraction.java @@ -16,7 +16,6 @@ import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.databaseaccess.QueryStringCall; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; @@ -98,13 +97,13 @@ public String getLogString(Accessor accessor) { StringWriter writer = new StringWriter(); writer.write("Executing "); writer.write(toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tspec => "); writer.write(String.valueOf(getInteractionSpec())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tquery => "); writer.write(getQueryString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tparameters => ["); if (hasParameters()) { for (Iterator iterator = getParameters().iterator(); iterator.hasNext();) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XMLInteraction.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XMLInteraction.java index cf5145e41ed..ea5d028382b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XMLInteraction.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XMLInteraction.java @@ -20,7 +20,6 @@ import org.eclipse.persistence.eis.EISDescriptor; import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.oxm.XMLObjectBuilder; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; @@ -235,13 +234,13 @@ public String getLogString(Accessor accessor) { StringWriter writer = new StringWriter(); writer.write("Executing "); writer.write(toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tspec => "); writer.write(String.valueOf(getInteractionSpec())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tproperties => "); writer.write(String.valueOf(getProperties())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\txml => "); Element dom = createInputDOM((EISAccessor)accessor); EISDOMRecord record = new EISDOMRecord(dom); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XQueryInteraction.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XQueryInteraction.java index 766d929db4a..16180eb321b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XQueryInteraction.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/eis/interactions/XQueryInteraction.java @@ -17,7 +17,6 @@ import org.eclipse.persistence.eis.EISAccessor; import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.databaseaccess.QueryStringCall; -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.EmptyRecord; @@ -145,13 +144,13 @@ public String getLogString(Accessor accessor) { StringWriter writer = new StringWriter(); writer.write("Executing "); writer.write(toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tspec => "); writer.write(String.valueOf(getInteractionSpec())); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\txQuery => "); writer.write(getXQueryString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\tinput => ["); if (hasParameters()) { for (Iterator iterator = getParameters().iterator(); iterator.hasNext();) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/EclipseLinkException.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/EclipseLinkException.java index fb30f4fbff3..319c57f0843 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/EclipseLinkException.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/EclipseLinkException.java @@ -17,7 +17,6 @@ package org.eclipse.persistence.exceptions; import org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator; -import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; import org.eclipse.persistence.internal.sessions.AbstractSession; import java.io.PrintStream; @@ -34,7 +33,7 @@ public abstract class EclipseLinkException extends RuntimeException { protected static Boolean shouldPrintInternalException = null; protected String indentationString; protected int errorCode; - protected static final String CR = PrivilegedAccessHelper.getSystemProperty("line.separator"); + protected static final String CR = System.lineSeparator(); //Bug#3559280 Added to avoid logging an exception twice protected boolean hasBeenLogged; @@ -70,7 +69,7 @@ protected EclipseLinkException(String message, Throwable internalException) { * Convenience method - return a platform-specific line-feed. */ protected static String cr() { - return org.eclipse.persistence.internal.helper.Helper.cr(); + return System.lineSeparator(); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/IntegrityException.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/IntegrityException.java index 8aae55a4ff8..69e4f72270f 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/IntegrityException.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/exceptions/IntegrityException.java @@ -58,7 +58,7 @@ public IntegrityChecker getIntegrityChecker() { */ @Override public String getMessage() { - String cr = org.eclipse.persistence.internal.helper.Helper.cr(); + String cr = System.lineSeparator(); java.io.StringWriter swriter = new java.io.StringWriter(); java.io.PrintWriter writer = new java.io.PrintWriter(swriter); writer.println(cr + ExceptionMessageGenerator.getHeader("DescriptorExceptionsHeader")); @@ -113,7 +113,7 @@ public void printStackTrace(PrintStream outStream) { @Override public void printStackTrace(PrintWriter writer) { super.printStackTrace(writer); - String cr = org.eclipse.persistence.internal.helper.Helper.cr(); + String cr = System.lineSeparator(); writer.println(cr + ExceptionMessageGenerator.getHeader("DescriptorExceptionsHeader")); writer.println("---------------------------------------------------------"); for (Enumeration enumtr = getIntegrityChecker().getCaughtExceptions().elements(); 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 89a8b0b1eb0..a70e8c72730 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.security.PrivilegedAccessHelper; import java.text.MessageFormat; import java.util.Locale; @@ -33,7 +32,7 @@ * @author Rick Barkhouse */ public final class ExceptionMessageGenerator { - private final static String CR = PrivilegedAccessHelper.getSystemProperty("line.separator"); + private final static String CR = System.lineSeparator(); private ExceptionMessageGenerator() { // for reflection diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/ClassDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/ClassDefinition.java index 67aa798c1b1..fad393c80b5 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/ClassDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/ClassDefinition.java @@ -266,7 +266,7 @@ public int compare(MethodDefinition first, MethodDefinition second) { */ @Override public void write(CodeGenerator generator) { - if (getPackageName().length() > 0) { + if (!getPackageName().isEmpty()) { generator.write("package "); generator.write(getPackageName()); generator.writeln(";"); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeDefinition.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeDefinition.java index f4ae7c24e1f..885cce95b11 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeDefinition.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeDefinition.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 @@ -212,10 +212,10 @@ public String toString() { * Write the code out to the generator's stream. */ public void write(CodeGenerator generator) { - if (getComment().length() > 0) { + if (!getComment().isEmpty()) { generator.writeln("/**"); String comment = getComment(); - String cr = org.eclipse.persistence.internal.helper.Helper.cr(); + String cr = System.lineSeparator(); int lastLineIndex = 0; int nextLineIndex = comment.indexOf(cr); while (nextLineIndex != -1) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeGenerator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeGenerator.java index 12c4707696d..77f37bb1c88 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeGenerator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/codegen/CodeGenerator.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.internal.codegen; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import java.io.IOException; import java.io.StringWriter; @@ -46,7 +45,7 @@ public CodeGenerator(boolean useUnicode) { } public void cr() { - write(Helper.cr()); + write(System.lineSeparator()); } public ClassDefinition getCurrentClass() { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseAccessor.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseAccessor.java index 62681038d74..f7757736a12 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseAccessor.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatabaseAccessor.java @@ -263,7 +263,7 @@ protected void buildConnectLog(AbstractSession session) { // Log connection information. if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. DatabaseMetaData metaData = getConnectionMetaData(); - Object[] args = { metaData.getURL(), metaData.getUserName(), metaData.getDatabaseProductName(), metaData.getDatabaseProductVersion(), metaData.getDriverName(), metaData.getDriverVersion(), Helper.cr() + "\t" }; + Object[] args = { metaData.getURL(), metaData.getUserName(), metaData.getDatabaseProductName(), metaData.getDatabaseProductVersion(), metaData.getDriverName(), metaData.getDriverVersion(), System.lineSeparator() + "\t" }; session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connected_user_database_driver", args, this); } } catch (Exception exception) { 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 d0bf25d74a2..2fbd6ec0d0f 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 @@ -32,7 +32,6 @@ import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.expressions.ParameterExpression; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.queries.CallQueryMechanism; import org.eclipse.persistence.internal.queries.DatabaseQueryMechanism; import org.eclipse.persistence.internal.sessions.AbstractRecord; @@ -409,7 +408,7 @@ public String getLogString(Accessor accessor) { if (hasParameters()) { StringWriter writer = new StringWriter(); writer.write(getSQLString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); if (hasParameters()) { AbstractSession session = null; if (getQuery() != null) { 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 97f4d04129a..1233b67e476 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 @@ -34,7 +34,6 @@ import org.eclipse.persistence.internal.helper.ClassConstants; import org.eclipse.persistence.internal.helper.ConcurrencyManager; import org.eclipse.persistence.internal.helper.DeferredLockManager; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.InvalidObject; import org.eclipse.persistence.internal.helper.WriteLockManager; import org.eclipse.persistence.internal.localization.LoggingLocalization; @@ -1200,7 +1199,7 @@ public void initializeIdentityMaps() { * The output of this method will be logged to this session's SessionLog at SEVERE level. */ public void printIdentityMap(Class businessClass) { - String cr = Helper.cr(); + String cr = System.lineSeparator(); ClassDescriptor descriptor = this.session.getDescriptor(businessClass); int cacheCounter = 0; StringWriter writer = new StringWriter(); @@ -1279,7 +1278,7 @@ public void printIdentityMaps() { public void printLocks() { StringWriter writer = new StringWriter(); HashMap threadCollection = new HashMap(); - writer.write(TraceLocalization.buildMessage("lock_writer_header", null) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("lock_writer_header", null) + System.lineSeparator()); Iterator idenityMapsIterator = this.session.getIdentityMapAccessorInstance().getIdentityMapManager().getIdentityMaps().values().iterator(); while (idenityMapsIterator.hasNext()) { IdentityMap idenityMap = idenityMapsIterator.next(); @@ -1289,23 +1288,23 @@ public void printLocks() { for (Iterator threads = threadCollection.keySet().iterator(); threads.hasNext();) { Thread activeThread = (Thread)threads.next(); parameters[0] = activeThread.getName(); - writer.write(TraceLocalization.buildMessage("active_thread", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("active_thread", parameters) + System.lineSeparator()); for (Iterator cacheKeys = ((HashSet)threadCollection.get(activeThread)).iterator(); cacheKeys.hasNext();) { CacheKey cacheKey = (CacheKey)cacheKeys.next(); if (cacheKey.isAcquired() && cacheKey.getActiveThread() == activeThread){ parameters[0] = cacheKey.getObject(); - writer.write(TraceLocalization.buildMessage("locked_object", parameters) + Helper.cr()); - writer.write("PK: " + cacheKey.getKey() + Helper.cr()); + writer.write(TraceLocalization.buildMessage("locked_object", parameters) + System.lineSeparator()); + writer.write("PK: " + cacheKey.getKey() + System.lineSeparator()); parameters[0] = cacheKey.getDepth(); - writer.write(TraceLocalization.buildMessage("depth", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("depth", parameters) + System.lineSeparator()); Exception stack = cacheKey.getStack(); if (stack != null) stack.printStackTrace(new PrintWriter(writer)); } else{ writer.write(TraceLocalization.buildMessage("cachekey_released", new Object[]{})); parameters[0] = cacheKey.getObject(); - writer.write(TraceLocalization.buildMessage("locked_object", parameters) + Helper.cr()); - writer.write("PK: " + cacheKey.getKey() + Helper.cr()); + writer.write(TraceLocalization.buildMessage("locked_object", parameters) + System.lineSeparator()); + writer.write("PK: " + cacheKey.getKey() + System.lineSeparator()); } } DeferredLockManager deferredLockManager = ConcurrencyManager.getDeferredLockManager(activeThread); @@ -1315,12 +1314,12 @@ public void printLocks() { ConcurrencyManager lock = (ConcurrencyManager)deferredLocks.next(); if (lock instanceof CacheKey){ parameters[0] = ((CacheKey)lock).getObject(); - writer.write(TraceLocalization.buildMessage("deferred_locks", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("deferred_locks", parameters) + System.lineSeparator()); } } } } - writer.write(Helper.cr() + TraceLocalization.buildMessage("lock_writer_footer", null) + Helper.cr()); + writer.write(System.lineSeparator() + TraceLocalization.buildMessage("lock_writer_footer", null) + System.lineSeparator()); this.session.log(SessionLog.SEVERE, SessionLog.CACHE, writer.toString(), null, null, false); } @@ -1332,7 +1331,7 @@ public void printLocks(Class theClass) { ClassDescriptor descriptor = this.session.getDescriptor(theClass); StringWriter writer = new StringWriter(); HashMap threadCollection = new HashMap(); - writer.write(TraceLocalization.buildMessage("lock_writer_header", null) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("lock_writer_header", null) + System.lineSeparator()); IdentityMap identityMap = getIdentityMap(descriptor, false); identityMap.collectLocks(threadCollection); @@ -1340,14 +1339,14 @@ public void printLocks(Class theClass) { for (Iterator threads = threadCollection.keySet().iterator(); threads.hasNext();) { Thread activeThread = (Thread)threads.next(); parameters[0] = activeThread.getName(); - writer.write(TraceLocalization.buildMessage("active_thread", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("active_thread", parameters) + System.lineSeparator()); for (Iterator cacheKeys = ((HashSet)threadCollection.get(activeThread)).iterator(); cacheKeys.hasNext();) { CacheKey cacheKey = (CacheKey)cacheKeys.next(); parameters[0] = cacheKey.getObject(); - writer.write(TraceLocalization.buildMessage("locked_object", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("locked_object", parameters) + System.lineSeparator()); parameters[0] = cacheKey.getDepth(); - writer.write(TraceLocalization.buildMessage("depth", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("depth", parameters) + System.lineSeparator()); } DeferredLockManager deferredLockManager = ConcurrencyManager.getDeferredLockManager(activeThread); if (deferredLockManager != null) { @@ -1356,12 +1355,12 @@ public void printLocks(Class theClass) { ConcurrencyManager lock = (ConcurrencyManager)deferredLocks.next(); if (lock instanceof CacheKey){ parameters[0] = ((CacheKey)lock).getObject(); - writer.write(TraceLocalization.buildMessage("deferred_locks", parameters) + Helper.cr()); + writer.write(TraceLocalization.buildMessage("deferred_locks", parameters) + System.lineSeparator()); } } } } - writer.write(Helper.cr() + TraceLocalization.buildMessage("lock_writer_footer", null) + Helper.cr()); + writer.write(System.lineSeparator() + TraceLocalization.buildMessage("lock_writer_footer", null) + System.lineSeparator()); this.session.log(SessionLog.SEVERE, SessionLog.CACHE, writer.toString(), null, null, false); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLBinaryDataHelper.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLBinaryDataHelper.java index f449b505ffc..1cb8ba32a9b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLBinaryDataHelper.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/oxm/XMLBinaryDataHelper.java @@ -149,7 +149,7 @@ public EncodedData getBytesFromMultipart(MimeMultipart value, Marshaller marshal ContentType contentType = new ContentType(value.getContentType()); String boundary = contentType.getParameter("boundary"); - output.write(Constants.cr().getBytes()); + output.write(System.lineSeparator().getBytes()); output.write(("Content-Type: " + contentType.getBaseType() + "; boundary=\"" + boundary + "\"\n").getBytes()); } catch (Exception ex) { throw ConversionException.couldNotBeConverted(value, byte[].class, ex); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/security/PrivilegedAccessHelper.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/security/PrivilegedAccessHelper.java index 781f30617bb..69ed72a862b 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/security/PrivilegedAccessHelper.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/security/PrivilegedAccessHelper.java @@ -65,7 +65,7 @@ public class PrivilegedAccessHelper { private static boolean shouldCheckPrivilegedAccess = true; private static boolean shouldUsePrivilegedAccess = false; - private final static String[] legalProperties = { "file.separator", "java.io.tmpdir", JavaVersion.VM_VERSION_PROPERTY, "line.separator", "path.separator", "user.dir", + private final static String[] legalProperties = { "file.separator", "java.io.tmpdir", JavaVersion.VM_VERSION_PROPERTY, "path.separator", "user.dir", "org.eclipse.persistence.fetchgroupmonitor", "org.eclipse.persistence.querymonitor", "SAP_J2EE_Engine_Version", PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML, PersistenceUnitProperties.JAVASE_DB_INTERACTION, PersistenceUnitProperties.LOGGING_FILE, PersistenceUnitProperties.LOGGING_LEVEL, @@ -79,8 +79,7 @@ public class PrivilegedAccessHelper { XMLPlatformFactory.XML_PLATFORM_PROPERTY}; private final static Set legalPropertiesSet = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(legalProperties))); - private final static String[] exemptedProperties = { "line.separator" }; - private final static Set exemptedPropertiesSet = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(exemptedProperties))); + private static final Set exemptedPropertiesSet = Collections.emptySet(); private static final Map> primitiveClasses; @@ -675,9 +674,10 @@ public static boolean getSystemPropertyBoolean(final String key, final boolean d * INTERNAL: * Get the line separator character. * @return The {@link String} containing the platform-appropriate characters for line separator. + * @deprecated Use {@link System#lineSeparator()} */ public static String getLineSeparator() { - return getSystemProperty("line.separator"); + return System.lineSeparator(); } /** 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 e0349e702d4..d9740d8a64b 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 @@ -17,7 +17,6 @@ import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.core.sessions.CoreAbstractRecord; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.NonSynchronizedVector; import org.eclipse.persistence.sessions.DataRecord; @@ -820,14 +819,14 @@ public String toString() { writer.write("("); for (int index = 0; index < getFields().size(); index++) { - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\t"); writer.write(String.valueOf((getFields().elementAt(index)))); writer.write(" => "); writer.write(String.valueOf((getValues().elementAt(index)))); } if (this.sopObject != null) { - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write(" sopObject = "); writer.write(this.sopObject.toString()); } 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 1a9e32f4667..8d88041daad 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 @@ -4240,7 +4240,7 @@ public void startOperationProfile(String operationName, DatabaseQuery query, int @Override public String toString() { StringWriter writer = new StringWriter(); - writer.write(getSessionTypeString() + "(" + Helper.cr() + "\t" + getAccessor() + Helper.cr() + "\t" + getDatasourcePlatform() + ")"); + writer.write(getSessionTypeString() + "(" + System.lineSeparator() + "\t" + getAccessor() + System.lineSeparator() + "\t" + getDatasourcePlatform() + ")"); return writer.toString(); } 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 9ef3ca5510c..06b04053003 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 @@ -15,7 +15,6 @@ package org.eclipse.persistence.internal.sessions; import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.NonSynchronizedVector; import org.eclipse.persistence.sessions.DatabaseRecord; @@ -344,14 +343,14 @@ public String toString() { writer.write("("); writer.write(toStringAditional()); for (int index = 0; index < this.fieldsArray.length; index++) { - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write("\t"); writer.write(String.valueOf(this.fieldsArray[index])); writer.write(" => "); writer.write(String.valueOf(this.valuesArray[index])); } if (this.sopObject != null) { - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.write(" sopObject = "); writer.write(this.sopObject.toString()); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/UnitOfWorkImpl.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/UnitOfWorkImpl.java index fb10b83e664..b680e8871f1 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/UnitOfWorkImpl.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/sessions/UnitOfWorkImpl.java @@ -63,7 +63,6 @@ import org.eclipse.persistence.internal.descriptors.PersistenceEntity; import org.eclipse.persistence.internal.helper.ConcurrencyManager; import org.eclipse.persistence.internal.helper.ConcurrencyUtil; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.helper.IdentityHashSet; import org.eclipse.persistence.internal.helper.IdentityWeakHashMap; import org.eclipse.persistence.internal.identitymaps.CacheId; @@ -3952,7 +3951,7 @@ public Object processDeleteObjectQuery(DeleteObjectQuery deleteQuery) { * Print the objects in the unit of work. */ protected void basicPrintRegisteredObjects() { - String cr = Helper.cr(); + String cr = System.lineSeparator(); StringWriter writer = new StringWriter(); writer.write(LoggingLocalization.buildMessage("unitofwork_identity_hashcode", new Object[] { cr, String.valueOf(System.identityHashCode(this)) })); if (hasDeletedObjects()) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedOutputStreamRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedOutputStreamRecord.java index 6e331b17a60..326497083cc 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedOutputStreamRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedOutputStreamRecord.java @@ -51,7 +51,7 @@ */ public class FormattedOutputStreamRecord extends OutputStreamRecord { - private byte[] cr = Constants.cr().getBytes(Constants.DEFAULT_CHARSET); + private byte[] cr = System.lineSeparator().getBytes(Constants.DEFAULT_CHARSET); private byte[] tab; private int numberOfTabs; private boolean complexType; diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedWriterRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedWriterRecord.java index 42c67e38aef..bdc565a4ed0 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedWriterRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/FormattedWriterRecord.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 @@ -51,7 +51,7 @@ public class FormattedWriterRecord extends WriterRecord { private int numberOfTabs; private boolean complexType; private boolean isLastEventText; - private final String cr = Constants.cr(); + private final String cr = System.lineSeparator(); private static final String DEFAULT_TAB = " ".intern(); @@ -139,7 +139,7 @@ public void element(XPathFragment frag) { builder.append('>'); isStartElementOpen = false; } - builder.append(Constants.cr()); + builder.append(System.lineSeparator()); for (int x = 0; x < numberOfTabs; x++) { builder.append(tab()); } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/JSONWriterRecord.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/JSONWriterRecord.java index 8f99b52a10a..f8454dc1447 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/JSONWriterRecord.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/oxm/record/JSONWriterRecord.java @@ -1024,7 +1024,7 @@ protected static class OutputStreamOutput implements Output { private byte[] buffer = new byte[BUFFER_SIZE]; private int bufferIndex = 0; private CharacterEscapeHandler characterEscapeHandler; - private byte[] cr = Constants.cr().getBytes(Constants.DEFAULT_CHARSET); + private byte[] cr = System.lineSeparator().getBytes(Constants.DEFAULT_CHARSET); private XMLMarshaller marshaller; private char namespaceSeparator; private OutputStream outputStream; @@ -1171,7 +1171,7 @@ private static class WriterOutput implements Output { private String attributePrefix; private CharacterEscapeHandler characterEscapeHandler; - private String cr = Constants.cr(); + private String cr = System.lineSeparator(); private XMLMarshaller marshaller; private char namespaceSeparator; private Writer writer; diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java index e16da449563..20062c1d16e 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java @@ -70,7 +70,7 @@ */ public class PLSQLStoredProcedureCall extends StoredProcedureCall { - // can't use Helper.cr(), Oracle PL/SQL parser only likes Unix-style newlines '\n' + // can't use System.lineSeparator(), Oracle PL/SQL parser only likes Unix-style newlines '\n' final static String BEGIN_DECLARE_BLOCK = NL + "DECLARE" + NL; final static String BEGIN_BEGIN_BLOCK = "BEGIN" + NL; final static String END_BEGIN_BLOCK = "END;"; @@ -1193,7 +1193,7 @@ public int compare(PLSQLargument o1, PLSQLargument o2) { public String getLogString(Accessor accessor) { StringBuilder sb = new StringBuilder(getSQLString()); - sb.append(Helper.cr()); + sb.append(System.lineSeparator()); sb.append(INDENT); sb.append("bind => ["); List specifiedArguments = this.arguments; diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/server/ServerLog.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/server/ServerLog.java index 9c4a3c82475..f90261cf551 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/server/ServerLog.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/server/ServerLog.java @@ -90,7 +90,7 @@ protected void basicLog(int level, String category, String message) { try { printPrefixString(level, null); getWriter().write(message); - getWriter().write(Helper.cr()); + getWriter().write(System.lineSeparator()); getWriter().flush(); } catch (IOException exception) { throw ValidationException.logIOError(exception); 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 cf64926b613..7dd87c52b46 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 @@ -24,7 +24,6 @@ import org.eclipse.persistence.internal.databaseaccess.DatabaseCall; import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.internal.helper.DatabaseField; -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; @@ -1092,7 +1091,7 @@ public String getLogString(Accessor accessor) { if (hasParameters()) { StringWriter writer = new StringWriter(); writer.write(getSQLString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); if (hasParameters()) { AbstractSession session = null; if (getQuery() != null) { 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 510c9ca6b05..d8017dbdb90 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 @@ -966,7 +966,7 @@ private String constructValidSQLorEJBQLLinesForJavaSource(String qlString){ //Bug2612384 Deals with the possibility of multi-line SQL statements. //Expects beginning and closing quotes to be in place if (qlString != null) { - String insertString = "\" " + Helper.cr() + '\t' + '\t' + "+ " + "\""; + String insertString = "\" " + System.lineSeparator() + '\t' + '\t' + "+ " + "\""; qlString = qlString.trim().replaceAll("\n", insertString); } return qlString; @@ -1833,7 +1833,7 @@ protected ClassDefinition generateProjectClass() { classDefinition.addImport("org.eclipse.persistence.history.HistoryPolicy"); classDefinition.addImport("org.eclipse.persistence.sequencing.*"); - classDefinition.setComment("This class was generated by the TopLink project class generator." + Helper.cr() + "It stores the meta-data (descriptors) that define the TopLink mappings." + Helper.cr() + "## " + DatabaseLogin.getVersion() + " ##" + Helper.cr() + "@see org.eclipse.persistence.sessions.factories.ProjectClassGenerator"); + classDefinition.setComment("This class was generated by the TopLink project class generator." + System.lineSeparator() + "It stores the meta-data (descriptors) that define the TopLink mappings." + System.lineSeparator() + "## " + DatabaseLogin.getVersion() + " ##" + System.lineSeparator() + "@see org.eclipse.persistence.sessions.factories.ProjectClassGenerator"); classDefinition.addMethod(buildConstructor()); 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 f5f0860e15f..9b8dbe37d4c 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 @@ -269,7 +269,7 @@ protected ClassDefinition generateCreatorClass() { classDefinition.addImport("org.eclipse.persistence.sessions.*"); classDefinition.addImport("org.eclipse.persistence.tools.schemaframework.*"); - classDefinition.setComment("This class was generated by the TopLink table creator generator." + Helper.cr() + "It stores the meta-data (tables) that define the database schema." + Helper.cr() + "@see org.eclipse.persistence.sessions.factories.TableCreatorClassGenerator"); + classDefinition.setComment("This class was generated by the TopLink table creator generator." + System.lineSeparator() + "It stores the meta-data (tables) that define the database schema." + System.lineSeparator() + "@see org.eclipse.persistence.sessions.factories.TableCreatorClassGenerator"); classDefinition.addMethod(buildConstructor()); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/PackageRenamer.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/PackageRenamer.java index 5ba09b8f3a6..2c8aa8adbf4 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/PackageRenamer.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/PackageRenamer.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 1998, 2018 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 @@ -86,14 +86,7 @@ public class PackageRenamer { static { // bug 2756643 - CR = PrivilegedAccessHelper.shouldUsePrivilegedAccess() ? - AccessController.doPrivileged(new PrivilegedAction<>() { - @Override - public String run() { - return System.getProperty("line.separator"); - } - }) - : System.getProperty("line.separator"); + CR = System.lineSeparator(); } /** diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/PerformanceProfiler.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/PerformanceProfiler.java index 8f6885bdd59..7a9dea9424e 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/PerformanceProfiler.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/tools/profiler/PerformanceProfiler.java @@ -14,7 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.tools.profiler; -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; @@ -245,7 +244,7 @@ public void endOperationProfile(String operationName) { Writer writer = getSession().getLog(); try { profile.write(writer, this); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.flush(); } catch (IOException ioe) { } @@ -333,7 +332,7 @@ public void logProfileSummary() { Writer writer = getSession().getLog(); try { writer.write(buildProfileSummary().toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); } catch (IOException ioe) { } } @@ -350,7 +349,7 @@ public void logProfileSummaryByClass() { Writer writer = getSession().getLog(); try { writer.write(summaries.get(domainClass).toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); } catch (IOException ioe) { } } @@ -368,7 +367,7 @@ public void logProfileSummaryByQuery() { Writer writer = getSession().getLog(); try { writer.write(summaries.get(queryType).toString()); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); } catch (IOException ioe) { } } @@ -396,7 +395,7 @@ public Object profileExecutionOfQuery(DatabaseQuery query, DataRecord row, Abstr try { if (shouldLogProfile()) { writeNestingTabs(writer); - writer.write(ToStringLocalization.buildMessage("begin_profile_of", null) + "{" + query + Helper.cr()); + writer.write(ToStringLocalization.buildMessage("begin_profile_of", null) + "{" + query + System.lineSeparator()); writer.flush(); } @@ -439,10 +438,10 @@ public Object profileExecutionOfQuery(DatabaseQuery query, DataRecord row, Abstr long totalTimeIncludingProfiling = profileEndTime - profileStartTime;// Try to remove the profiling time from the total time. profile.setProfileTime(totalTimeIncludingProfiling - profile.getTotalTime()); profile.write(writer, this); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writeNestingTabs(writer); writer.write("}" + ToStringLocalization.buildMessage("end_profile", null)); - writer.write(Helper.cr()); + writer.write(System.lineSeparator()); writer.flush(); } 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 29ce4633dce..d727a3e6b30 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 @@ -14,7 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.tools.profiler; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.ToStringLocalization; import java.io.IOException; @@ -162,7 +161,7 @@ public String toString() { } public void write(Writer writer, PerformanceProfiler profiler) { - String cr = Helper.cr(); + String cr = System.lineSeparator(); try { writer.write(ToStringLocalization.buildMessage("profile", null) + "("); if (getQueryClass() != null) { diff --git a/foundation/org.eclipse.persistence.core/src/test/java/org/eclipse/persistence/testing/oxm/OXTestCase.java b/foundation/org.eclipse.persistence.core/src/test/java/org/eclipse/persistence/testing/oxm/OXTestCase.java index ec850465a3b..89c7ffc926b 100644 --- a/foundation/org.eclipse.persistence.core/src/test/java/org/eclipse/persistence/testing/oxm/OXTestCase.java +++ b/foundation/org.eclipse.persistence.core/src/test/java/org/eclipse/persistence/testing/oxm/OXTestCase.java @@ -436,7 +436,7 @@ protected String loadFileToString(String fileName){ protected String loadInputStreamToString(InputStream inputStream){ StringBuilder sb = new StringBuilder(); - String lineSep = System.getProperty("line.separator"); + String lineSep = System.lineSeparator(); try { InputStreamReader inputStreamReader = new InputStreamReader(inputStream); diff --git a/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/oxm/OXTestCase.java b/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/oxm/OXTestCase.java index 67375b2000e..dec7c35b717 100644 --- a/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/oxm/OXTestCase.java +++ b/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/oxm/OXTestCase.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 @@ -343,7 +343,7 @@ public void write(Project project, Writer writer) { protected String loadFileToString(String fileName){ StringBuffer sb = new StringBuffer(); - String lineSep = System.getProperty("line.separator"); + String lineSep = System.lineSeparator(); try { InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); diff --git a/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/tests/eis/cobol/CobolTestModel.java b/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/tests/eis/cobol/CobolTestModel.java index 70d038edf34..821db5ed355 100644 --- a/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/tests/eis/cobol/CobolTestModel.java +++ b/foundation/org.eclipse.persistence.nosql/src/it/java/org/eclipse/persistence/testing/tests/eis/cobol/CobolTestModel.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 @@ -159,31 +159,31 @@ public static RecordMetaData getConversionRecord() { } public static String getSimpleCopyBookString() { - return "01 emp-record." + Helper.cr() + "04 emp-ssn pic 9(12) comp-3." + Helper.cr() + "04 emp-name." + Helper.cr() + "06 emp-name-last pic x(15)." + Helper.cr() + "06 emp-name-first pic x(15)." + Helper.cr() + "06 emp-name-mi pic x." + Helper.cr() + "04 emp-addr." + Helper.cr() + "06 emp-addr-street." + Helper.cr() + "08 emp-addr-street-no pic 9(5)." + Helper.cr() + "08 emp-addr-street-name pic x(15)." + Helper.cr() + "06 emp-addr-st pic x(2)." + Helper.cr() + "06 emp-addr-zip pic x(9)."; + return "01 emp-record." + System.lineSeparator() + "04 emp-ssn pic 9(12) comp-3." + System.lineSeparator() + "04 emp-name." + System.lineSeparator() + "06 emp-name-last pic x(15)." + System.lineSeparator() + "06 emp-name-first pic x(15)." + System.lineSeparator() + "06 emp-name-mi pic x." + System.lineSeparator() + "04 emp-addr." + System.lineSeparator() + "06 emp-addr-street." + System.lineSeparator() + "08 emp-addr-street-no pic 9(5)." + System.lineSeparator() + "08 emp-addr-street-name pic x(15)." + System.lineSeparator() + "06 emp-addr-st pic x(2)." + System.lineSeparator() + "06 emp-addr-zip pic x(9)."; } public static String getDeepNestedCopyBookString() { - return "01 everything-record." + Helper.cr() + "03 everything-universe." + Helper.cr() + "05 universe-galaxycluster." + Helper.cr() + "07 galaxycluster-galaxy." + Helper.cr() + "09 galaxy-solarsystem." + Helper.cr() + "11 solarsystem-planet." + Helper.cr() + "13 planet-continent." + Helper.cr() + "15 continent-country." + Helper.cr() + "17 country-region." + Helper.cr() + "19 region-state." + Helper.cr() + "21 state-county." + Helper.cr() + "23 county-city." + Helper.cr() + "25 city-neighborhood." + Helper.cr() + "27 neighborhood-block." + Helper.cr() + "29 block-house." + Helper.cr() + "31 house-person." + Helper.cr() + "33 person-organ." + Helper.cr() + "35 organ-tissue." + Helper.cr() + "37 tissue-cell." + Helper.cr() + "39 cell-molecule." + Helper.cr() + "41 molecule-atom." + Helper.cr() + "43 atom-nucleus." + Helper.cr() + "45 nucleus-nuetron." + Helper.cr() + "47 nuetron-quark." + Helper.cr() + "49 quark-infinity."; + return "01 everything-record." + System.lineSeparator() + "03 everything-universe." + System.lineSeparator() + "05 universe-galaxycluster." + System.lineSeparator() + "07 galaxycluster-galaxy." + System.lineSeparator() + "09 galaxy-solarsystem." + System.lineSeparator() + "11 solarsystem-planet." + System.lineSeparator() + "13 planet-continent." + System.lineSeparator() + "15 continent-country." + System.lineSeparator() + "17 country-region." + System.lineSeparator() + "19 region-state." + System.lineSeparator() + "21 state-county." + System.lineSeparator() + "23 county-city." + System.lineSeparator() + "25 city-neighborhood." + System.lineSeparator() + "27 neighborhood-block." + System.lineSeparator() + "29 block-house." + System.lineSeparator() + "31 house-person." + System.lineSeparator() + "33 person-organ." + System.lineSeparator() + "35 organ-tissue." + System.lineSeparator() + "37 tissue-cell." + System.lineSeparator() + "39 cell-molecule." + System.lineSeparator() + "41 molecule-atom." + System.lineSeparator() + "43 atom-nucleus." + System.lineSeparator() + "45 nucleus-nuetron." + System.lineSeparator() + "47 nuetron-quark." + System.lineSeparator() + "49 quark-infinity."; } public static String getMultipleRecordString() { - return Helper.cr() + Helper.cr() + Helper.cr() + Helper.cr() + Helper.cr() + " *sldkfjaweitwoieawoeirgfa;e" + Helper.cr() + " sherdfgkjhdsfglkjsdhfguheriuh" + Helper.cr() + Helper.cr() + "01 emp-time." + Helper.cr() + "05 time-hour pic 99." + Helper.cr() + "05 time-minute pic xx." + Helper.cr() + "05 time-second pic xx." + Helper.cr() + Helper.cr() + "*********************" + "**************************" + Helper.cr() + Helper.cr() + Helper.cr() + "01 MEMBER-TABLE." + Helper.cr() + Helper.cr() + "05 CLUB-NAME PIC X(20)." + Helper.cr() + Helper.cr() + "05 NUM-MEMBERS PIC 9(5)." + Helper.cr() + Helper.cr() + "05 MEMBERS." + Helper.cr() + Helper.cr() + "10 MEM-NAME PIC X(20)." + Helper.cr() + Helper.cr() + "10 MEM-NUM PIC 9(15)." + Helper.cr() + Helper.cr() + Helper.cr() + Helper.cr() + "PROCEDURE DIVISION." + Helper.cr() + getSimpleCopyBookString(); + return System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + " *sldkfjaweitwoieawoeirgfa;e" + System.lineSeparator() + " sherdfgkjhdsfglkjsdhfguheriuh" + System.lineSeparator() + System.lineSeparator() + "01 emp-time." + System.lineSeparator() + "05 time-hour pic 99." + System.lineSeparator() + "05 time-minute pic xx." + System.lineSeparator() + "05 time-second pic xx." + System.lineSeparator() + System.lineSeparator() + "*********************" + "**************************" + System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + "01 MEMBER-TABLE." + System.lineSeparator() + System.lineSeparator() + "05 CLUB-NAME PIC X(20)." + System.lineSeparator() + System.lineSeparator() + "05 NUM-MEMBERS PIC 9(5)." + System.lineSeparator() + System.lineSeparator() + "05 MEMBERS." + System.lineSeparator() + System.lineSeparator() + "10 MEM-NAME PIC X(20)." + System.lineSeparator() + System.lineSeparator() + "10 MEM-NUM PIC 9(15)." + System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + System.lineSeparator() + "PROCEDURE DIVISION." + System.lineSeparator() + getSimpleCopyBookString(); } public static String getOccursDependsCopyBookString() { - return "01 club-record." + Helper.cr() + "05 club-enrollment pic 9(5)." + Helper.cr() + "05 club-members " + Helper.cr() + "occurs 1 to 50 times" + Helper.cr() + " depending on club-enrollment." + Helper.cr() + "10 member-name pic x(20)." + Helper.cr() + "10 member-number pic x(5)."; + return "01 club-record." + System.lineSeparator() + "05 club-enrollment pic 9(5)." + System.lineSeparator() + "05 club-members " + System.lineSeparator() + "occurs 1 to 50 times" + System.lineSeparator() + " depending on club-enrollment." + System.lineSeparator() + "10 member-name pic x(20)." + System.lineSeparator() + "10 member-number pic x(5)."; } public static String getRedefinesCopyBookString() { - return "01 emp-record." + Helper.cr() + "04 emp-ssn pic 9(12) comp-3." + Helper.cr() + "04 emp-ssn-int redefines emp-ssn pic 9(12) comp." + Helper.cr() + "04 emp-addr." + Helper.cr() + "06 emp-addr-street." + Helper.cr() + "08 emp-addr-street-no pic 9(5)." + Helper.cr() + "08 emp-addr-street-name pic x(5)." + Helper.cr() + "06 emp-addr-rr redefines emp-addr-street." + Helper.cr() + "08 emp-addr-rr-no pic 9(15)." + Helper.cr() + "08 emp-addr-rr-box pic 9(5)." + Helper.cr() + "06 emp-addr-zip pic x(9)."; + return "01 emp-record." + System.lineSeparator() + "04 emp-ssn pic 9(12) comp-3." + System.lineSeparator() + "04 emp-ssn-int redefines emp-ssn pic 9(12) comp." + System.lineSeparator() + "04 emp-addr." + System.lineSeparator() + "06 emp-addr-street." + System.lineSeparator() + "08 emp-addr-street-no pic 9(5)." + System.lineSeparator() + "08 emp-addr-street-name pic x(5)." + System.lineSeparator() + "06 emp-addr-rr redefines emp-addr-street." + System.lineSeparator() + "08 emp-addr-rr-no pic 9(15)." + System.lineSeparator() + "08 emp-addr-rr-box pic 9(5)." + System.lineSeparator() + "06 emp-addr-zip pic x(9)."; } public static String getComplexPicStatementCopyBookString() { - return "01 emp-record." + Helper.cr() + "04 emp-salary pic S9(5)V99 sign leading seperate." + Helper.cr() + "04 emp-ex pic Z(5).ZZ." + Helper.cr() + "04 emp-ex2 pic -9(4).99." + Helper.cr() + "04 emp-ex3 pic +ZZ99.99." + Helper.cr() + "04 emp-ex4 pic ----9.99-." + Helper.cr() + "04 emp-ex5 pic S9(5).99."; + return "01 emp-record." + System.lineSeparator() + "04 emp-salary pic S9(5)V99 sign leading seperate." + System.lineSeparator() + "04 emp-ex pic Z(5).ZZ." + System.lineSeparator() + "04 emp-ex2 pic -9(4).99." + System.lineSeparator() + "04 emp-ex3 pic +ZZ99.99." + System.lineSeparator() + "04 emp-ex4 pic ----9.99-." + System.lineSeparator() + "04 emp-ex5 pic S9(5).99."; } public static String getFillerCopyBookString() { - return "01 emp-record." + Helper.cr() + "04 pic x(5)." + Helper.cr() + "04." + Helper.cr() + "07 pic xx." + Helper.cr() + "07 pic xx."; + return "01 emp-record." + System.lineSeparator() + "04 pic x(5)." + System.lineSeparator() + "04." + System.lineSeparator() + "07 pic xx." + System.lineSeparator() + "07 pic xx."; } public static RecordMetaData getFillerRecord() { diff --git a/foundation/org.eclipse.persistence.nosql/src/main/java/org/eclipse/persistence/internal/eis/cobol/CopyBookParser.java b/foundation/org.eclipse.persistence.nosql/src/main/java/org/eclipse/persistence/internal/eis/cobol/CopyBookParser.java index 8e305b3b1c7..0ccf582e8a4 100644 --- a/foundation/org.eclipse.persistence.nosql/src/main/java/org/eclipse/persistence/internal/eis/cobol/CopyBookParser.java +++ b/foundation/org.eclipse.persistence.nosql/src/main/java/org/eclipse/persistence/internal/eis/cobol/CopyBookParser.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 @@ -86,7 +86,7 @@ public Vector parse(InputStream stream) throws Exception { */ private Vector buildStructure(String fileString) throws Exception { Vector records = new Vector<>(); - StringTokenizer lineTokenizer = new StringTokenizer(fileString, System.getProperty("line.separator"), false); + StringTokenizer lineTokenizer = new StringTokenizer(fileString, System.lineSeparator(), false); RecordMetaData record = new RecordMetaData(); Vector recordLines = new Vector<>(); Vector lineNums = new Vector<>(); diff --git a/jpa/org.eclipse.persistence.jpa.jpql/src/main/java/org/eclipse/persistence/jpa/jpql/AbstractGrammarValidator.java b/jpa/org.eclipse.persistence.jpa.jpql/src/main/java/org/eclipse/persistence/jpa/jpql/AbstractGrammarValidator.java index b80a0c31862..b2cda973904 100644 --- a/jpa/org.eclipse.persistence.jpa.jpql/src/main/java/org/eclipse/persistence/jpa/jpql/AbstractGrammarValidator.java +++ b/jpa/org.eclipse.persistence.jpa.jpql/src/main/java/org/eclipse/persistence/jpa/jpql/AbstractGrammarValidator.java @@ -143,7 +143,6 @@ import org.eclipse.persistence.jpa.jpql.parser.WhereClause; import static org.eclipse.persistence.jpa.jpql.JPQLQueryProblemMessages.*; -import static org.eclipse.persistence.jpa.jpql.JPQLQueryProblemMessages.StringExpression_InvalidLeftExpression; import static org.eclipse.persistence.jpa.jpql.parser.Expression.*; /** diff --git a/jpa/org.eclipse.persistence.jpa.modelgen/src/main/java/org/eclipse/persistence/internal/jpa/modelgen/MessagerLog.java b/jpa/org.eclipse.persistence.jpa.modelgen/src/main/java/org/eclipse/persistence/internal/jpa/modelgen/MessagerLog.java index 92251a90274..426e6bc4b9a 100644 --- a/jpa/org.eclipse.persistence.jpa.modelgen/src/main/java/org/eclipse/persistence/internal/jpa/modelgen/MessagerLog.java +++ b/jpa/org.eclipse.persistence.jpa.modelgen/src/main/java/org/eclipse/persistence/internal/jpa/modelgen/MessagerLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -21,7 +21,6 @@ import javax.tools.Diagnostic; import org.eclipse.persistence.config.PersistenceUnitProperties; import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.localization.LoggingLocalization; import org.eclipse.persistence.logging.AbstractSessionLog; import org.eclipse.persistence.logging.SessionLog; @@ -123,19 +122,19 @@ public void log(SessionLogEntry entry) { if (entry.hasMessage()) { sb.append(formatMessage(entry)); - sb.append(Helper.cr()); + sb.append(System.lineSeparator()); } if (entry.hasException()) { if (shouldLogExceptionStackTrace()) { for (StackTraceElement stackTrace : entry.getException().getStackTrace()) { sb.append(stackTrace); - sb.append(Helper.cr()); + sb.append(System.lineSeparator()); } } else { sb.append(entry.getException().toString()); } - sb.append(Helper.cr()); + sb.append(System.lineSeparator()); } if (getWriter() == NULL_WRITER) { diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/EntityManagerSetupImpl.java b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/EntityManagerSetupImpl.java index 4f9d38b7db6..37c854d5308 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/EntityManagerSetupImpl.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/EntityManagerSetupImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 1998, 2022 IBM Corporation. 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 @@ -283,7 +283,6 @@ import org.eclipse.persistence.sessions.coordination.TransportManager; import org.eclipse.persistence.sessions.coordination.jms.JMSPublishingTransportManager; import org.eclipse.persistence.sessions.coordination.jms.JMSTopicTransportManager; -import org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager; import org.eclipse.persistence.sessions.factories.SessionManager; import org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader; import org.eclipse.persistence.sessions.remote.RemoteSession; @@ -2134,7 +2133,7 @@ public Void run() { String message = LoggingLocalization.buildMessage("predeploy_end", new Object[]{getPersistenceUnitInfo().getPersistenceUnitName(), "N/A", state, factoryCount}); try { logWriter.write(message); - logWriter.write(Helper.cr()); + logWriter.write(System.lineSeparator()); } catch (IOException ioex) { // Ignore IOException } diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/deployment/xml/parser/XMLException.java b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/deployment/xml/parser/XMLException.java index 1f991e2b4c8..3a492cc4e58 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/deployment/xml/parser/XMLException.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/deployment/xml/parser/XMLException.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 @@ -17,8 +17,6 @@ import java.util.ArrayList; import java.util.List; -import org.eclipse.persistence.internal.helper.Helper; - public class XMLException extends RuntimeException { private List m_nestedExceptions; @@ -37,7 +35,7 @@ public String getMessage() { Exception nestedException; for (int x=0; x"; private final static String XML_BODY = "123Bob123456789"; private final static String XML_BODY_FORMATTED = "" + CRLF + " 123" + CRLF + " Bob" + CRLF + " 123456789" + CRLF + "" + CRLF; diff --git a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/ClassBuffer.java b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/ClassBuffer.java index c868c655487..b3983c61b40 100644 --- a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/ClassBuffer.java +++ b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/ClassBuffer.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 @@ -25,7 +25,7 @@ * */ public class ClassBuffer { - private static final String lsep = System.getProperty("line.separator"); + private static final String lsep = System.lineSeparator(); private static final String lsep2 = lsep + lsep; private String indent = ""; private StringBuffer attributeBuffer; 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 bc169f1b704..adf0801bb38 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 @@ -44,7 +44,7 @@ public class SDOClassGenerator { // Source Gen Stuff private String indent = SDOConstants.EMPTY_STRING; private static int INDENT_TAB = 3; - private static final String lsep = System.getProperty("line.separator"); + private static final String lsep = System.lineSeparator(); private static final String lsep2 = lsep + lsep; private static final String START_PROPERTY_INDEX = "START_PROPERTY_INDEX"; private Map generatedBuffers; @@ -141,24 +141,24 @@ private void printUsage(String messageID) { 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) + // Because we can no longer use System.lineSeparator() inside of message bundles, we must break + // up the message into separate lines and use System.lineSeparator() here instead. (bug6470503) String messageString = ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_1of8", new Object[] { getClass().getSimpleName() }); - messageString += Helper.cr() + Helper.cr(); + messageString += System.lineSeparator() + System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_2of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_3of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_4of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_5of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_6of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_7of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); messageString += ToStringLocalization.buildMessage("sdo_classgenerator_usage_help_8of8"); - messageString += Helper.cr(); + messageString += System.lineSeparator(); System.out.println(messageString); } diff --git a/sdo/org.eclipse.persistence.sdo/src/test/java/org/eclipse/persistence/testing/sdo/helper/classgen/TestSDOClassGeneratorListener.java b/sdo/org.eclipse.persistence.sdo/src/test/java/org/eclipse/persistence/testing/sdo/helper/classgen/TestSDOClassGeneratorListener.java index 014f2c35739..0a37685e1f1 100644 --- a/sdo/org.eclipse.persistence.sdo/src/test/java/org/eclipse/persistence/testing/sdo/helper/classgen/TestSDOClassGeneratorListener.java +++ b/sdo/org.eclipse.persistence.sdo/src/test/java/org/eclipse/persistence/testing/sdo/helper/classgen/TestSDOClassGeneratorListener.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 @@ -19,7 +19,7 @@ public class TestSDOClassGeneratorListener implements SDOClassGeneratorListener { - private String cr = System.getProperty("line.separator"); + private String cr = System.lineSeparator(); public TestSDOClassGeneratorListener() { } diff --git a/utils/eclipselink.utils.sigcompare/src/main/java/eclipselink/utils/sigcompare/ClassSignature.java b/utils/eclipselink.utils.sigcompare/src/main/java/eclipselink/utils/sigcompare/ClassSignature.java index e64897f2c4f..85faf3b3139 100644 --- a/utils/eclipselink.utils.sigcompare/src/main/java/eclipselink/utils/sigcompare/ClassSignature.java +++ b/utils/eclipselink.utils.sigcompare/src/main/java/eclipselink/utils/sigcompare/ClassSignature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -105,7 +105,7 @@ public boolean containsMethod(String methodName, String desc) { return false; } - public static String newline = System.getProperty("line.separator"); + public static String newline = System.lineSeparator(); public void compare(ClassSignature targetSig, Writer writer, ExcludePatterns excludes, boolean printAlternatives) throws IOException {