Skip to content

8342868: Errors related to unused code on Windows after 8339120 in core libs #21654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/java.base/share/native/libzip/zip_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ readCEN(jzfile *zip, jint knownTotal)
jlong offset;
#endif
unsigned char endbuf[ENDHDR];
#ifdef USE_MMAP
jint endhdrlen = ENDHDR;
#endif
jzcell *entries;
jint *table;

Expand All @@ -606,7 +608,9 @@ readCEN(jzfile *zip, jint knownTotal)
cenoff = ZIP64_ENDOFF(end64buf);
total = (jint)ZIP64_ENDTOT(end64buf);
endpos = end64pos;
#ifdef USE_MMAP
endhdrlen = ZIP64_ENDHDR;
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,29 +965,34 @@ void getNumberPart(const jchar * langtag, const jint numberStyle, WCHAR * number
void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BOOL prefix, WCHAR * ret) {
DWORD pattern = 0;
int style = numberStyle;
int got = 0;
// int got = 0;

if (positive) {
if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_CURRENCY) {
got = getLocaleInfoWrapper(langtag,
// got =
getLocaleInfoWrapper(langtag,
LOCALE_ICURRENCY | LOCALE_RETURN_NUMBER,
(LPWSTR)&pattern, sizeof(pattern));
} else if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_PERCENT) {
got = getLocaleInfoWrapper(langtag,
// got =
getLocaleInfoWrapper(langtag,
LOCALE_IPOSITIVEPERCENT | LOCALE_RETURN_NUMBER,
(LPWSTR)&pattern, sizeof(pattern));
}
} else {
if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_CURRENCY) {
got = getLocaleInfoWrapper(langtag,
// got =
getLocaleInfoWrapper(langtag,
LOCALE_INEGCURR | LOCALE_RETURN_NUMBER,
(LPWSTR)&pattern, sizeof(pattern));
} else if (style == sun_util_locale_provider_HostLocaleProviderAdapterImpl_NF_PERCENT) {
got = getLocaleInfoWrapper(langtag,
// got =
getLocaleInfoWrapper(langtag,
LOCALE_INEGATIVEPERCENT | LOCALE_RETURN_NUMBER,
(LPWSTR)&pattern, sizeof(pattern));
} else {
got = getLocaleInfoWrapper(langtag,
// got =
getLocaleInfoWrapper(langtag,
LOCALE_INEGNUMBER | LOCALE_RETURN_NUMBER,
(LPWSTR)&pattern, sizeof(pattern));
}
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/windows/native/libjava/TimeZone_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
WCHAR stdNameInReg[MAX_ZONE_CHAR];
TziValue tempTzi;
WCHAR *stdNamePtr = tzi.StandardName;
int onlyMapID;
// int onlyMapID;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this became unused with JDK-8209167, so deleting it seems fine to me.


timeType = GetTimeZoneInformation(&tzi);
if (timeType == TIME_ZONE_ID_INVALID) {
Expand Down Expand Up @@ -304,7 +304,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
* Compare to the "Std" value of each subkey and find the entry that
* matches the current control panel setting.
*/
onlyMapID = 0;
// onlyMapID = 0;
for (i = 0; i < nSubKeys; ++i) {
DWORD size = sizeof(subKeyName);
ret = RegEnumKeyEx(hKey, i, subKeyName, &size, NULL, NULL, NULL, NULL);
Expand All @@ -325,7 +325,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
* entry in the Time Zones registry.
*/
RegCloseKey(hSubKey);
onlyMapID = 1;
// onlyMapID = 1;
ret = RegOpenKeyExW(hKey, stdNamePtr, 0, KEY_READ, (PHKEY)&hSubKey);
if (ret != ERROR_SUCCESS) {
goto err;
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/windows/native/libnet/NTLMAuthSequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static jfieldID ntlm_ctxHandleID;
static jfieldID ntlm_crdHandleID;
static jfieldID status_seqCompleteID;

static HINSTANCE lib = NULL;
// static HINSTANCE lib = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this became unused with JDK-7030256, so removal seems fine.


JNIEXPORT void JNICALL Java_sun_net_www_protocol_http_ntlm_NTLMAuthSequence_initFirst
(JNIEnv *env, jclass authseq_clazz, jclass status_clazz)
Expand Down