Skip to content

Commit

Permalink
remove the noisy entries from the logs - backport from the master (#1748
Browse files Browse the repository at this point in the history
)


Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
(cherry picked from commit e2da068)

GitHub Actions change JDK to Adopt JDK distribution due a issue with javadoc

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman committed Nov 30, 2022
1 parent 0d54d41 commit 099442d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
distribution: 'adopt'
java-version: ${{ matrix.java_version }}
- name: Verify
run: mvn -B -V -U -C -Pstaging,oss-release,test-lrg,mysql clean verify -Dgpg.skip=true -Dwarn.limit=15 -Dcomp.xlint=-Xlint:none
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

0 comments on commit 099442d

Please sign in to comment.