Skip to content

Commit

Permalink
Remove deprecated methods,
Browse files Browse the repository at this point in the history
this breaks the dependency between core and oxm

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jan 24, 2024
1 parent 02b78ac commit ad16233
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 288 deletions.
9 changes: 1 addition & 8 deletions findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2014, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2024 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 @@ -188,10 +188,6 @@
<Class name="org.eclipse.persistence.expressions.ExpressionOperator"/>
<Field name="allOperators"/>
</And>
<And>
<Class name="org.eclipse.persistence.internal.core.helper.CoreHelper"/>
<Field name="CR"/>
</And>
<And>
<Class name="org.eclipse.persistence.internal.helper.ConcurrencyManager"/>
<Field name="shouldTrackStack"/>
Expand All @@ -203,9 +199,6 @@
<And>
<Class name="org.eclipse.persistence.internal.helper.Helper"/>
<Or>
<Field name="CR"/>
<Field name="PATH_SEPARATOR"/>
<Field name="FILE_SEPARATOR"/>
<Field name="CURRENT_WORKING_DIRECTORY"/>
<Field name="TEMP_DIRECTORY"/>
</Or>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 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 @@ -34,14 +34,6 @@ public void verify() {
throw new TestErrorException("System.lineSeparator() returns the incorrect value.");
}

if (!org.eclipse.persistence.internal.helper.Helper.pathSeparator().equals(File.pathSeparator)) {
throw new TestErrorException("Helper.pathSeparator() returns the incorrect value.");
}

if (!org.eclipse.persistence.internal.helper.Helper.fileSeparator().equals(File.separator)) {
throw new TestErrorException("Helper.fileSeparator() returns the incorrect value.");
}

if (!org.eclipse.persistence.internal.helper.Helper.currentWorkingDirectory().equals(System.getProperty("user.dir"))) {
throw new TestErrorException("Helper.currentWorkingDirectory() returns the incorrect value.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 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 @@ -166,7 +166,7 @@ public void testDoPrivileged() {
} catch (Exception e) {
}

String lineSeparator = PrivilegedAccessHelper.getLineSeparator();
String lineSeparator = System.lineSeparator();

method = AccessController.doPrivileged(new PrivilegedGetMethod(clazz, methodName, methodParameterTypes, true));
AccessController.doPrivileged(new PrivilegedGetMethodParameterTypes(method));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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 @@ -28,8 +28,6 @@
*/
public class ParserType {
public static final String Hermes = "Hermes";
@Deprecated
public static final String ANTLR = "ANTLR";

public static final String DEFAULT = Hermes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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 @@ -43,13 +43,6 @@ protected CoreObjectBuilder() {
*/
public abstract ABSTRACT_RECORD createRecord(ABSTRACT_SESSION session);

/**
* Create a new row/record from XMLContext.
* @deprecated Use {@link #createRecord(CoreAbstractSession)}.
*/
@Deprecated(forRemoval = true)
public abstract ABSTRACT_RECORD createRecordFromXMLContext(XMLContext context);

/**
* Extract primary key attribute values from the domainObject.
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 IBM Corporation. All rights reserved.
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 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
Expand Down Expand Up @@ -4713,8 +4713,4 @@ public boolean hasCacheIndexesInSopObject() {
return this.hasCacheIndexesInSopObject;
}

@Override
public AbstractRecord createRecordFromXMLContext(XMLContext context) {
return createRecord((AbstractSession)context.getSession());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 IBM Corporation. All rights reserved.
* Copyright (c) 1998, 2024 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
Expand All @@ -25,7 +25,6 @@
import org.eclipse.persistence.config.SystemProperties;
import org.eclipse.persistence.exceptions.ConversionException;
import org.eclipse.persistence.exceptions.ValidationException;
import org.eclipse.persistence.internal.core.helper.CoreHelper;
import org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor;
import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
import org.eclipse.persistence.logging.AbstractSessionLog;
Expand Down Expand Up @@ -71,7 +70,7 @@
* <p>
* <b>Purpose</b>: Define any useful methods that are missing from the base Java.
*/
public class Helper extends CoreHelper implements Serializable {
public class Helper implements Serializable {

/** Used to configure JDBC level date optimization. */
public static boolean shouldOptimizeDates = false;
Expand All @@ -92,28 +91,13 @@ public class Helper extends CoreHelper implements Serializable {

// Changed static initialization to lazy initialization for bug 2756643

/** Store CR string, for some reason \n is not platform independent.
* @deprecated Use {@link System#lineSeparator()}. */
@Deprecated(forRemoval = true)
protected static String CR;

/** formatting strings for indenting */
public static final String SPACE = " ";
public static final String INDENT = " ";

/** Store newline string */
public static final String NL = "\n";

/** Prime the platform-dependent path separator
* @deprecated Use {@link File#pathSeparator}. */
@Deprecated(forRemoval = true)
protected static String PATH_SEPARATOR = null;

/** Prime the platform-dependent file separator
* @deprecated Use {@link File#separator}. */
@Deprecated(forRemoval = true)
protected static String FILE_SEPARATOR = null;

/** Prime the platform-dependent current working directory */
protected static String CURRENT_WORKING_DIRECTORY = null;

Expand Down Expand Up @@ -830,19 +814,6 @@ public static boolean[] copyBooleanArray(boolean[] original){
return copy;
}

/**
* Return a string containing the platform-appropriate
* characters for carriage return.
* @deprecated Use {@link System#lineSeparator()}.
*/
@Deprecated(forRemoval = true)
public static String cr() {
if (CR == null) {
CR = System.lineSeparator();
}
return CR;
}

/**
* Return the name of the "current working directory".
*/
Expand Down Expand Up @@ -985,20 +956,6 @@ public static String extractJarNameFromURL(java.net.URL url) {
return tempName.substring(start, end);
}

/**
* Return a string containing the platform-appropriate
* characters for separating directory and file names.
* @deprecated Use {@link File#separator}.
*/
@Deprecated(forRemoval = true)
public static String fileSeparator() {
//Bug 2756643
if (FILE_SEPARATOR == null) {
FILE_SEPARATOR = File.separator;
}
return FILE_SEPARATOR;
}

/**
* INTERNAL:
* Returns a Field for the specified Class and field name.
Expand Down Expand Up @@ -1077,37 +1034,13 @@ public static Class<?> getObjectClass(Class<?> javaClass) {
return ConversionManager.getObjectClass(javaClass);
}

/**
* Answers the unqualified class name for the provided class.
*/
@Deprecated(forRemoval = true)
public static String getShortClassName(Class<?> javaClass) {
return javaClass.getSimpleName();
}

/**
* Answers the unqualified class name from the specified String.
*/
public static String getShortClassName(String javaClassName) {
return javaClassName.substring(javaClassName.lastIndexOf('.') + 1);
}

/**
* Answers the unqualified class name for the specified object.
*/
@Deprecated(forRemoval = true)
public static String getShortClassName(Object object) {
return getShortClassName(object.getClass());
}

/**
* return a package name for the specified class.
*/
@Deprecated(forRemoval = true)
public static String getPackageName(Class<?> javaClass) {
return javaClass.getPackageName();
}

/**
* Return a string containing the specified number of tabs.
*/
Expand Down Expand Up @@ -1255,20 +1188,6 @@ public static void outputClassFile(String className, byte[] classBytes,
}
}

/**
* Return a string containing the platform-appropriate
* characters for separating entries in a path (e.g. the classpath)
* @deprecated Use {@link File#pathSeparator}.
*/
@Deprecated(forRemoval = true)
public static String pathSeparator() {
// Bug 2756643
if (PATH_SEPARATOR == null) {
PATH_SEPARATOR = File.pathSeparator;
}
return PATH_SEPARATOR;
}

/**
* Return a String containing the printed stacktrace of an exception.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 IBM Corporation. All rights reserved.
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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
Expand Down Expand Up @@ -180,14 +180,4 @@ public boolean isApplicationXML() {

};

/**
* Return a string containing the platform-appropriate
* characters for carriage return.
* @deprecated Use {@link System#lineSeparator()}.
*/
@Deprecated(forRemoval = true)
public static String cr() {
return System.lineSeparator();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024 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 @@ -607,9 +607,4 @@ public boolean marshalAttributes(MarshalRecord marshalRecord, Object object, Cor
return hasValue;
}

@Override
public CoreAbstractRecord createRecordFromXMLContext(XMLContext context) {
return createRecord((AbstractSession)context.getSession());
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 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 @@ -670,16 +670,6 @@ public static boolean getSystemPropertyBoolean(final String key, final boolean d
getSystemProperty(key, def ? TRUE_STRING : ""));
}

/**
* 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 System.lineSeparator();
}

/**
* Get the list of parameter types for a given method. Wrap the call in doPrivileged if necessary.
* @param method The method to get the parameter types of
Expand Down

0 comments on commit ad16233

Please sign in to comment.