8289768: Clean up unused code

Reviewed-by: dfuchs, lancea, weijun, naoto, cjplummer, alanb, michaelm, chegar
This commit is contained in:
Daniel Jeliński 2022-07-12 11:30:17 +00:00
parent 3b9059a147
commit 04c47da118
46 changed files with 29 additions and 98 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2022, 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
@ -417,7 +417,6 @@ Java_java_lang_ProcessHandleImpl_00024Info_info0(JNIEnv *env,
jobject jinfo,
jlong jpid) {
DWORD pid = (DWORD)jpid;
int ret = 0;
HANDLE handle =
OpenProcess(THREAD_QUERY_INFORMATION | PROCESS_QUERY_LIMITED_INFORMATION,
FALSE, pid);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2022, 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
@ -406,7 +406,6 @@ static int getWinTimeZone(char *winZoneName)
static char *matchJavaTZ(const char *java_home_dir, char *tzName)
{
int line;
int IDmatched = 0;
FILE *fp;
char *javaTZName = NULL;
char *items[TZ_NITEMS];

View file

@ -100,7 +100,6 @@ currentDirLength(const WCHAR* ps, int pathlen) {
static int curDirLenCached = -1;
//relative to both drive and directory
if (curDirLenCached == -1) {
int dirlen = -1;
dir = _wgetcwd(NULL, MAX_PATH);
if (dir != NULL) {
curDirLenCached = (int)wcslen(dir);
@ -180,7 +179,6 @@ pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE) {
(therefore allocate the sufficient memory block) before calling
_wfullpath(), we have to get the length of "current" dir first.
*/
WCHAR *abpath = NULL;
int dirlen = currentDirLength(ps, pathlen);
if (dirlen + pathlen + 1 > max_path - 1) {
pathbuf = prefixAbpath(ps, pathlen, dirlen + pathlen);

View file

@ -546,8 +546,6 @@ static errno_t convert_to_unicode(const char* path, const wchar_t* prefix, wchar
*/
static wchar_t* create_unc_path(const char* path, errno_t* err) {
wchar_t* wpath = NULL;
size_t converted_chars = 0;
size_t path_len = strlen(path) + 1; /* includes the terminating NULL */
if (path[0] == '\\' && path[1] == '\\') {
if (path[2] == '?' && path[3] == '\\') {
/* if it already has a \\?\ don't do the prefix */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
@ -834,7 +834,6 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByIndex0
JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_boundInetAddress0
(JNIEnv *env, jclass cls, jobject iaObj)
{
jobject netifObj = NULL;
DWORD i;
int family = getInetAddress_family(env, iaObj);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, 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
@ -643,7 +643,6 @@ JNIEXPORT jint JNICALL
Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlong timeout)
{
int rv;
int revents = 0;
struct timeval t;
fd_set rd, wr, ex;
jint fd = fdval(env, fdo);

View file

@ -683,7 +683,6 @@ Java_sun_nio_fs_WindowsNativeDispatcher_SetFileSecurity0(JNIEnv* env, jclass thi
{
LPCWSTR lpFileName = jlong_to_ptr(pathAddress);
PSECURITY_DESCRIPTOR pSecurityDescriptor = jlong_to_ptr(descAddress);
DWORD lengthNeeded = 0;
BOOL res = SetFileSecurityW(lpFileName,
(SECURITY_INFORMATION)requestedInformation,
@ -1256,7 +1255,6 @@ Java_sun_nio_fs_WindowsNativeDispatcher_ReadDirectoryChangesW(JNIEnv* env, jclas
{
BOOL res;
BOOL subtree = (watchSubTree == JNI_TRUE) ? TRUE : FALSE;
LPOVERLAPPED ov = (LPOVERLAPPED)jlong_to_ptr(pOverlapped);
res = ReadDirectoryChangesW((HANDLE)jlong_to_ptr(hDirectory),
(LPVOID)jlong_to_ptr(bufferAddress),