Skip to content

Commit

Permalink
avoid using inefficient Helper.getShortClassName methods through the …
Browse files Browse the repository at this point in the history
…codebase

Signed-off-by: Lukas Jungmann <[email protected]>
  • Loading branch information
lukasj committed Aug 15, 2023
1 parent 4cef62e commit 35f6ba4
Show file tree
Hide file tree
Showing 134 changed files with 293 additions and 338 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -160,7 +160,7 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()));
buf.append(getClass().getSimpleName());
buf.append("(");
if (getArea() != null) {
buf.append(getArea());
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -223,10 +223,10 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": " + this.getType());
buf.append(getClass().getSimpleName() + ": " + this.getType());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
if (getItems() != null) {
buf.append("MenuItems: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getItems().getClass()));
buf.append("MenuItems: " + getItems().getClass().getSimpleName());
buf.append(getItems().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -272,7 +272,7 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()));
buf.append(getClass().getSimpleName());
buf.append("(");
if (getName() != null) {
buf.append(getName().substring(0, Math.min(10, getName().length())));
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -115,6 +115,6 @@ public static org.eclipse.persistence.tools.schemaframework.TableDefinition tabl
* @return a string representation of the receiver
*/
public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this.getClass()) + ": " + this.getFirstName() + " " + this.getLastName();
return getClass().getSimpleName() + ": " + this.getFirstName() + " " + this.getLastName();
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -121,27 +121,27 @@ public String allToString() {
buf.append("Restaurant: " + this.getName());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
if (getMenus() != null) {
buf.append("Menus: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getMenus().getClass()));
buf.append("Menus: " + getMenus().getClass().getSimpleName());
buf.append(getMenus().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
if (getWaiters() != null) {
buf.append("Waiters: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getWaiters().getClass()));
buf.append("Waiters: " + getWaiters().getClass().getSimpleName());
buf.append(getWaiters().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
if (getPreferredCustomers() != null) {
buf.append("PreferredCustomers: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getPreferredCustomers().getClass()));
buf.append("PreferredCustomers: " + getPreferredCustomers().getClass().getSimpleName());
buf.append(getPreferredCustomers().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
if (getLocations() != null) {
buf.append("Locations: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getLocations().getClass()));
buf.append("Locations: " + getLocations().getClass().getSimpleName());
buf.append(getLocations().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
if (getSlogans() != null) {
buf.append("Slogan: " + org.eclipse.persistence.internal.helper.Helper.getShortClassName(getSlogans().getClass()));
buf.append("Slogan: " + getSlogans().getClass().getSimpleName());
buf.append(getSlogans().toString());
buf.append(org.eclipse.persistence.internal.helper.Helper.cr());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -87,6 +87,6 @@ public static ViewDefinition mySQLView() {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + id + ")";
return getClass().getSimpleName() + "(" + id + ")";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -56,6 +56,6 @@ public void setPolicy(Policy policy) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + ": " + getAmount();
return getClass().getSimpleName() + ": " + getAmount();
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -97,6 +97,6 @@ public void setPolicyNumber(long policyNumber) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + ": " + getPolicyNumber();
return getClass().getSimpleName() + ": " + getPolicyNumber();
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -132,7 +132,7 @@ public void setEmployees(List<Employee> employees) {
public String toString() {
StringWriter writer = new StringWriter();

writer.write(Helper.getShortClassName(this) + ": ");
writer.write(getClass().getSimpleName() + ": ");
writer.write(getName());
return writer.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -173,7 +173,7 @@ public static TableDefinition tableDefinition() {
public String toString() {
java.io.StringWriter stringWriter = new java.io.StringWriter();
java.io.PrintWriter writer = new java.io.PrintWriter(stringWriter);
writer.print(org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()));
writer.print(getClass().getSimpleName());
writer.print("(");
if (streetAddress == null) {
writer.print("null");
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -111,6 +111,6 @@ public static TableDefinition tableDefinition() {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -114,7 +114,7 @@ public static TableDefinition tableDefinition() {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";

}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -114,6 +114,6 @@ public static TableDefinition tableDefinition() {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -117,6 +117,6 @@ public static TableDefinition tableDefinition() {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -70,6 +70,6 @@ public void setName(String newValue) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -72,6 +72,6 @@ public void setName(String newValue) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(getClass()) + "(" + getName() + ") ";
return getClass().getSimpleName() + "(" + getName() + ") ";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -109,6 +109,6 @@ public void setSalespeople(Collection collection) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -74,6 +74,6 @@ public void setId(int newId) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -67,6 +67,6 @@ public void setOffice(FieldOffice newOffice) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -76,7 +76,7 @@ public void setSalespeople(Collection newSalespeople) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -70,7 +70,7 @@ public void setName(String newName) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -116,6 +116,6 @@ public void setName(java.lang.String newName) {
}

public String toString() {
return org.eclipse.persistence.internal.helper.Helper.getShortClassName(this) + "(" + id + ", " + System.identityHashCode(this) + ")";
return getClass().getSimpleName() + "(" + id + ", " + System.identityHashCode(this) + ")";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -81,7 +81,7 @@ String verifyDescriptor(ClassDescriptor desc, boolean tableNameShouldStartWithBu
}
}
if(localErrorMsg.length() > 0) {
localErrorMsg = "Ref.descriptor class: " + Helper.getShortClassName(desc.getJavaClass()) +"; mapping: "+ attributeName + ": " + localErrorMsg + "\n";
localErrorMsg = "Ref.descriptor class: " + desc.getJavaClass().getSimpleName() +"; mapping: "+ attributeName + ": " + localErrorMsg + "\n";
}
return localErrorMsg;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -294,7 +294,7 @@ public static TestCase getTestCase(Object test, String testShortClassName, boole
testToLookAt = ((TestWrapper)testToLookAt).getWrappedTest();
}
}
if (Helper.getShortClassName(testToLookAt).equals(testShortClassName)) {
if (testToLookAt.getClass().getSimpleName().equals(testShortClassName)) {
// return the wrapped test
return (TestCase)test;
}
Expand Down
Loading

0 comments on commit 35f6ba4

Please sign in to comment.