Comments (3)
谢谢,我把shouldComplie参数设置为false,解决了我的问题
This is not really a bug in spoon. You ask spoon to please ensure the model should compile — but it is not proper java code. Lombok adds its own custom processing extending the java compiler and syntax. Supporting all transformations that Lombok does is out of scope for spoon, as the code is no longer Java.
If you disable "setShouldCompile", you should get a model though. As the code is not valid, some parts of it might be a bit surprising (e.g. what fields refer to if they do not exist in the source code).
You're welcome! I set the shouldCompile parameter to false and resolved my issue.
from spoon.
This is not really a bug in spoon. You ask spoon to please ensure the model should compile — but it is not proper java code. Lombok adds its own custom processing extending the java compiler and syntax. Supporting all transformations that Lombok does is out of scope for spoon, as the code is no longer Java.
If you disable "setShouldCompile", you should get a model though. As the code is not valid, some parts of it might be a bit surprising (e.g. what fields refer to if they do not exist in the source code).
from spoon.
You can also use https://projectlombok.org/features/delombok to pre-process your sources into a pure-Java form spoon can analyze.
from spoon.
Related Issues (20)
- Java Compatibility with Older Versions of Spoon HOT 1
- [Bug]: CtReferenceImpl.isSpecialType throws an exception
- [Bug]: Bug adding comment in AST of lambda HOT 2
- Update a method calls reference
- java 22 HOT 1
- [Bug]: Control Flow graph missing edge for implicit default case in switch
- [Bug]: Control Flow Graph doesn't handle cases with multiple expressions
- Spotless for imports HOT 2
- [Bug]: Spoon inserts incorrect break in enhanced switch block
- [Feature Request]: Minimize Parens in `DefaultJavaPrettyPrinter` should use operator precedence (`(a == b) || (b == c)` could be `a == b || b == c`) HOT 2
- [Bug]: Javadoc of class missing HOT 1
- improve reproducible build architecture for Spoon HOT 7
- Unable to start JavaFX UI
- How to Implement Angelic Value with Spoon for APR
- Processing import Statements HOT 2
- links to some of the transformation examples are broken
- [Bug]: Not allowed javaletter or keyword in identifier found. See JLS for correct identifier. Identifier: E' HOT 1
- How to create static call graph with only invocations within project?
- [Bug]: Inconsistent parent for `CtTypeReferenceImpl` in `CtRecordComponentImpl` which points to a `CtMethodImpl`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spoon.