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

Support for running in Java 19 by upgrading ASM #1654

Closed
arlampin opened this issue Nov 3, 2022 · 2 comments
Closed

Support for running in Java 19 by upgrading ASM #1654

arlampin opened this issue Nov 3, 2022 · 2 comments

Comments

@arlampin
Copy link

arlampin commented Nov 3, 2022

The bundled ASM 9.2 doesn't support reading Java 19 class file version 63. While class generation works fine, the error reporting functionality throws the following error

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Unsupported class file major version 63
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3989)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4950)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4956)
        at com.google.inject.internal.util.StackTraceElements.forMember(StackTraceElements.java:67)
        at com.google.inject.internal.SourceFormatter.formatMember(SourceFormatter.java:91)
        at com.google.inject.internal.SourceFormatter.format(SourceFormatter.java:53)
        at com.google.inject.internal.GenericErrorDetail.formatDetail(GenericErrorDetail.java:26)
        at com.google.inject.spi.ErrorDetail.format(ErrorDetail.java:63)
        at com.google.inject.internal.Messages.formatMessages(Messages.java:90)
        at com.google.inject.CreationException.getMessage(CreationException.java:50)
....
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 63
        at com.google.inject.internal.asm.$ClassReader.<init>(ClassReader.java:199)
        at com.google.inject.internal.asm.$ClassReader.<init>(ClassReader.java:180)
        at com.google.inject.internal.asm.$ClassReader.<init>(ClassReader.java:166)
        at com.google.inject.internal.asm.$ClassReader.<init>(ClassReader.java:287)
        at com.google.inject.internal.util.LineNumbers.<init>(LineNumbers.java:69)
        at com.google.inject.internal.util.StackTraceElements$1.load(StackTraceElements.java:48)
        at com.google.inject.internal.util.StackTraceElements$1.load(StackTraceElements.java:44)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
        ... 44 more
jaroslawr added a commit to jaroslawr/guice that referenced this issue Nov 18, 2022
@jnehlmeier
Copy link

Any news here @cpovirk @sameb ?

@Nava2
Copy link

Nava2 commented Mar 19, 2023

Has there been any movement on this? It appears as though #1657 covers this issue.

Nava2 added a commit to kaff4/kaff4 that referenced this issue Mar 19, 2023
Due to google/guice#1654 Java 17 is the max version supported.
Nava2 added a commit to kaff4/kaff4 that referenced this issue Mar 19, 2023
Due to google/guice#1654 Java 17 is the max version supported.
Nava2 added a commit to kaff4/kaff4 that referenced this issue Mar 19, 2023
Due to google/guice#1654 Java 17 is the max version supported.
copybara-service bot pushed a commit that referenced this issue Apr 14, 2023
Fixes #1671
Fixes #1657
Fixes #1654
Fixes #1521
Fixes #1256

PiperOrigin-RevId: 524360975
copybara-service bot pushed a commit that referenced this issue Apr 14, 2023
…sses with ASM, so Guice is less finicky about the precise .class version & ASM version. A while ago I had tried to do this by ignoring UnsupportedOperationException, but per #1654, ASM doesn't always throw UOE.

This change will log a single failure when Guice encounters an exception while reading classfiles and warn that ASM may be out of date.

The consequences of this failing _all_ line number reading (due to, say, an accidental bug introduced while parsing classfiles) is that Guice won't emit line numbers for bind statements in modules (as binding source locations). A number of other tests would fail in that scenario, warning us that something is off.

PiperOrigin-RevId: 524365509
copybara-service bot pushed a commit that referenced this issue Apr 14, 2023
…sses with ASM, so Guice is less finicky about the precise .class version & ASM version. A while ago I had tried to do this by ignoring UnsupportedOperationException, but per #1654, ASM doesn't always throw UOE.

This change will log a single failure when Guice encounters an exception while reading classfiles and warn that ASM may be out of date.

The consequences of this failing _all_ line number reading (due to, say, an accidental bug introduced while parsing classfiles) is that Guice won't emit line numbers for bind statements in modules (as binding source locations). A number of other tests would fail in that scenario, warning us that something is off.

PiperOrigin-RevId: 524387180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants