Skip to content

Commit b486d90

Browse files
committedNov 2, 2020
first exception when reading a class file should be a warning
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
1 parent 77d9c87 commit b486d90

File tree

1 file changed

+3
-2
lines changed
  • jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/objects

1 file changed

+3
-2
lines changed
 

‎jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public InputStream run() {
112112
// without class version check
113113
SessionLog log = getLogger().getSession() != null
114114
? getLogger().getSession().getSessionLog() : AbstractSessionLog.getLog();
115-
if (log.shouldLog(SessionLog.SEVERE, SessionLog.METADATA)) {
116-
SessionLogEntry entry = new SessionLogEntry(getLogger().getSession(), SessionLog.SEVERE, SessionLog.METADATA, iae);
115+
if (log.shouldLog(SessionLog.WARNING, SessionLog.METADATA)) {
116+
SessionLogEntry entry = new SessionLogEntry(getLogger().getSession(), SessionLog.WARNING, SessionLog.METADATA, iae);
117117
entry.setMessage(ExceptionLocalization.buildMessage("unsupported_classfile_version", new Object[] { className }));
118118
log.log(entry);
119119
}
@@ -123,6 +123,7 @@ public InputStream run() {
123123
Attribute[] attributes = new Attribute[0];
124124
reader.accept(visitor, attributes, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
125125
} catch (Exception e) {
126+
// our fall-back failed, this is severe
126127
if (log.shouldLog(SessionLog.SEVERE, SessionLog.METADATA)) {
127128
SessionLogEntry entry = new SessionLogEntry(getLogger().getSession(), SessionLog.SEVERE, SessionLog.METADATA, e);
128129
entry.setMessage(ExceptionLocalization.buildMessage("unsupported_classfile_version", new Object[] { className }));

0 commit comments

Comments
 (0)
Please sign in to comment.