INRIA / spoon

Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.

Home Page:http://spoon.gforge.inria.fr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: CtReferenceImpl.isSpecialType throws an exception

aeromac opened this issue · comments

Describe the bug

Maybe a bug, or maybe more an opportunity to add some error reporting so that it's easier to debug issues:
boolean isSpecialType(String identifier) in CtReferenceImpl calls identifier.isEmpty() and will throw an exception if identifier is null.
An example of when this happens is setSimpleName(null) - maybe that method could have some error checking?

Source code you are trying to analyze/transform

setSimpleName(null)
I know I shouldn't pass a null - it wasn't deliberate but throws a confusing exception.

Source code for your Spoon processing

No response

Actual output

No response

Expected output

No response

Spoon Version

Latest

JVM Version

java version "17.0.7" 2023-04-18 LTS

What operating system are you using?

Windows 11