INRIA / INRIA/spoon

[Bug]: CtReferenceImpl.isSpecialType throws an exception

Open
#5,660 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

### 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

```Java
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.