8321325: Remove unused Java_java_awt_MenuComponent_initIDs function

Reviewed-by: prr, aivanov
This commit is contained in:
Sergey Bylokhov 2023-12-06 00:19:28 +00:00
parent 905137d406
commit 3cd65ce2a4
6 changed files with 1 additions and 81 deletions

View File

@ -112,11 +112,6 @@ JNIEXPORT void JNICALL Java_java_awt_MenuBar_initIDs
{
}
JNIEXPORT void JNICALL Java_java_awt_MenuComponent_initIDs
(JNIEnv *env, jclass cls)
{
}
JNIEXPORT void JNICALL Java_java_awt_MenuItem_initIDs
(JNIEnv *env, jclass cls)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -59,14 +59,6 @@ import sun.awt.ComponentFactory;
*/
public abstract class MenuComponent implements java.io.Serializable {
static {
/* ensure that the necessary native libraries are loaded */
Toolkit.loadLibraries();
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
}
transient volatile MenuComponentPeer peer;
transient volatile MenuContainer parent;
@ -464,12 +456,6 @@ public abstract class MenuComponent implements java.io.Serializable {
appContext = AppContext.getAppContext();
}
/**
* Initialize JNI field and method IDs.
*/
private static native void initIDs();
/*
* --- Accessibility Support ---
*/

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifdef HEADLESS
#error This file should not be included in headless library
#endif
#include "jni_util.h"
struct MenuComponentIDs {
jfieldID font;
jfieldID appContext;
jmethodID getParent;
};

View File

@ -39,7 +39,6 @@
#include "awt_p.h"
#include "awt_Component.h"
#include "awt_MenuComponent.h"
#include "awt_util.h"
#include "sun_awt_X11_XToolkit.h"
@ -72,8 +71,6 @@ static int tracing = 0;
struct ComponentIDs componentIDs;
struct MenuComponentIDs menuComponentIDs;
extern Display* awt_init_Display(JNIEnv *env, jobject this);
extern void freeNativeStringArray(char **array, jsize length);
extern char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length);
@ -236,13 +233,6 @@ Java_java_awt_Frame_initIDs
}
JNIEXPORT void JNICALL
Java_java_awt_MenuComponent_initIDs(JNIEnv *env, jclass cls)
{
menuComponentIDs.appContext =
(*env)->GetFieldID(env, cls, "appContext", "Lsun/awt/AppContext;");
}
JNIEXPORT void JNICALL
Java_java_awt_Cursor_initIDs(JNIEnv *env, jclass cls)
{

View File

@ -892,20 +892,6 @@ BOOL AwtMenuItem::IsSeparator() {
return isSeparator;
}
/************************************************************************
* MenuComponent native methods
*/
extern "C" {
JNIEXPORT void JNICALL
Java_java_awt_MenuComponent_initIDs(JNIEnv *env, jclass cls)
{
}
} /* extern "C" */
/************************************************************************
* MenuItem native methods
*/

View File

@ -33,7 +33,6 @@
#include <sun_awt_windows_WMenuItemPeer.h>
#include <java_awt_Menu.h>
#include <sun_awt_windows_WMenuPeer.h>
#include <java_awt_MenuComponent.h>
#include <java_awt_FontMetrics.h>
class AwtMenu;