apache / apache/netbeans

Convert to text block hint does not work inside Annotations

Open
#7,643 1 comment 0 reactions 0 assignees View on GitHub
hints Java kind:bug nb-javac
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 22

### What happened

Clicking this code hint:
![image](https://github.com/user-attachments/assets/12ae7f30-5b88-464c-9743-7ce09cc9bf7b)

Does not change anything in the editor. This hint does not work when the string is the **Annotation default value.**

### Language / Project Type / NetBeans Component

_No response_

### How to reproduce

Use this (nonsense) code and click the convert to text block hint:

```java
@SuppressWarnings("This is an example\n"
+ "that does not work\n"
+ "converting to a text block")
public static void main(String[] args) {

}
```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Fedora Core 40

### JDK

21

### Apache NetBeans packaging

Apache NetBeans Snap Package

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce in the Java editor with the provided @SuppressWarnings example and invoke the “convert to text block” hint on the annotation default value. Trace the hint from the editor action or hint entry point, then verify that the annotation string is converted and the resulting code remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.