Skip to content
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

remove the noisy entries from the logs #1664

Merged
merged 1 commit into from
Aug 19, 2022
Merged
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
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, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018 Hans Harz, Andrew Rustleund, IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -112,19 +112,14 @@ public InputStream run() {
// supported and tested JDK
// in such case log a warning and try to re-read the class
// without class version check
SessionLog log = getLogger().getSession() != null
? getLogger().getSession().getSessionLog() : AbstractSessionLog.getLog();
if (log.shouldLog(SessionLog.WARNING, SessionLog.METADATA)) {
SessionLogEntry entry = new SessionLogEntry(getLogger().getSession(), SessionLog.WARNING, SessionLog.METADATA, iae);
entry.setMessage(ExceptionLocalization.buildMessage("unsupported_classfile_version", new Object[] { className }));
log.log(entry);
}
if (stream != null) {
try {
ClassReader reader = new EclipseLinkClassReader(stream);
Attribute[] attributes = new Attribute[0];
reader.accept(visitor, attributes, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
} catch (Exception e) {
SessionLog log = getLogger().getSession() != null
? getLogger().getSession().getSessionLog() : AbstractSessionLog.getLog();
// our fall-back failed, this is severe
if (log.shouldLog(SessionLog.SEVERE, SessionLog.METADATA)) {
SessionLogEntry entry = new SessionLogEntry(getLogger().getSession(), SessionLog.SEVERE, SessionLog.METADATA, e);
Expand All @@ -137,11 +132,6 @@ public InputStream run() {
addMetadataClass(getVirtualMetadataClass(className));
}
} catch (Exception exception) {
SessionLog log = getLogger().getSession() != null
? getLogger().getSession().getSessionLog() : AbstractSessionLog.getLog();
if (log.shouldLog(SessionLog.FINEST, SessionLog.METADATA)) {
log.logThrowable(SessionLog.FINEST, SessionLog.METADATA, exception);
}
addMetadataClass(getVirtualMetadataClass(className));
} finally {
try {
Expand Down Expand Up @@ -559,11 +549,7 @@ private MetadataClass getVirtualMetadataClass(String className) {
metadataClass.addInterface(reflectInterface.getName());
}
} catch (Exception failed) {
SessionLog log = getLogger().getSession() != null
? getLogger().getSession().getSessionLog() : AbstractSessionLog.getLog();
if (log.shouldLog(SessionLog.FINE, SessionLog.METADATA)) {
log.logThrowable(SessionLog.FINE, SessionLog.METADATA, failed);
}
//ignore
metadataClass.setIsAccessible(false);
}
} else {
Expand Down