NoSuchFieldError: savedParameterNames
See original GitHub issueThere is a reference to com.sun.tools.javac.code.Symbol.MethodSymbol.savedParameterNames
in MethodExtractorUtils
:
That field is an internal implementation detail of javac and is not part of the supported API. It is being removed in JDK 10. See this change: http://hg.openjdk.java.net/jdk/jdk/rev/89f6aa26fd6c, which fixes JDK-8177486 and JDK-8007720.
The removal of the field causes DelegateMethodExtractor
to crash when running on a JDK 10 javac:
Caused by: java.lang.NoSuchFieldError: savedParameterNames
at com.facebook.litho.specmodels.processor.MethodExtractorUtils.getSavedParameterNames(MethodExtractorUtils.java:87)
at com.facebook.litho.specmodels.processor.MethodExtractorUtils.getMethodParams(MethodExtractorUtils.java:45)
at com.facebook.litho.specmodels.processor.DelegateMethodExtractor.getDelegateMethods(DelegateMethodExtractor.java:63)
at com.facebook.litho.specmodels.processor.LayoutSpecModelFactory.create(LayoutSpecModelFactory.java:79)
at com.facebook.litho.specmodels.processor.LayoutSpecModelFactory.create(LayoutSpecModelFactory.java:33)
at com.facebook.litho.specmodels.processor.AbstractComponentsProcessor.process(AbstractComponentsProcessor.java:66)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:969)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:9 (9 by maintainers)
Top Results From Across the Web
debugging - NoSuchFieldError Java - Stack Overflow
I am getting a NoSuchFieldError in my code, now oracle isn't very clear about why this error is thrown only saying: this error...
Read more >java.lang.NoSuchFieldError: INSTANCE - Hibernate Forums
Getting this error. ... Done some googling and found this error is usually caused by a conflict between jars in the classpath from...
Read more >Error when creating new AndroidDriver object: java.lang ...
Error when creating new AndroidDriver object: java.lang.NoSuchFieldError: INSTANCE org.apache.http.conn.ssl.SSLConnectionSocketFactory.
Read more >java.lang.NoSuchFieldError: firstLoad - Support & Bug ...
When I launch the FTB skyfactory 3 it saids "The game crashed whilst initializing gameError: java.lang.NoSuchFieldError: firstLoad" and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks - that achieves binary compatibility with JDK 10, but not source compatibility. WDYT about
Symbol.MethodSymbol.class.getField("savedParameterNames").get(methodSymbol)
?@pavlospt thanks for catching that. As I mentioned in the compiler-dev thread I think the patch is OK, and the index that isn’t incremented is effectively dead code.
For JDK 10 it should be sufficient to compile with
-parameters
and then use the names on the symbols returned bygetParameters()
. With JDK 8 and 9 some of the litho tests were running into JDK-8007720 - normallysavedParameterNames
should benull
by the time annotation processing happens.