apache / apache/netbeans

Not honoring containerDelegate in BeanInfo

Open
#5,774 6 comments 0 reactions 0 assignees View on GitHub
kind:bug
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 17

### What happened

Please find attached two minimum reproducible examples. One uses **maven** and the other one uses **ant**.

When creating a BeanInfo using netbeans, in the getBdescriptor() method, we can set the value "containerDelegate" using the following line of code to delegate to another container.

```java
beanDescriptor.setValue("containerDelegate", "getInnerPanel");
```

These examples work with all previous JDK versions, except for JDK 19
I also tested JDK 13, 14, 15, 16, 17 and 18 and they all work fine.

[DummyAnt.zip](https://github.com/apache/netbeans/files/11152746/DummyAnt.zip)
[DummyMaven.zip](https://github.com/apache/netbeans/files/11152747/DummyMaven.zip)

### How to reproduce

Using the Dummy Projects.

With any new JPanel, or using MainPanel:

- Drag or add a SectionPanel instance to MainPanel
- Then add any other widget (i.e. JLabel) from the palette in the SectionPanel instance

SectionPanel should be recognized as a Container, therefore the widget should get added into the SectionPanel instance

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

Did not test JDK19 with previous NetBeans versions

### Operating System

Windows 11

### JDK

19.0.2

### Apache NetBeans packaging

Apache NetBeans platform

### Anything else

- This problem occurs all the time under the aforementioned description

- **Here's a screenshot of how this example should look**

![image](https://user-images.githubusercontent.com/12089476/229913619-7e4de74c-394c-4293-a2e0-2ea9ddd3560a.png)

- And here's the Navigator screenshot showing that it works as expected

![image](https://user-images.githubusercontent.com/12089476/229913853-dc41aa6d-1a03-47a0-b2d4-1e73e4476fff.png)

- **Here's a screenshot after attempting to perform the same steps using JDK19**
![image](https://user-images.githubusercontent.com/12089476/229914445-f859e876-99b9-44ce-a083-870e21997b3d.png)

- Here's the Navigator screenshot showing that a widget cannot be added to the SectionPanel instance
![image](https://user-images.githubusercontent.com/12089476/229914830-84fde374-0b47-4c1f-8709-dd31ace8e812.png)

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

No

Contributor guide

Open the contributing guide

Research direction

Start with the attached DummyAnt.zip and DummyMaven.zip examples and trace how BeanInfo handles the containerDelegate value on JDK 19. Reproduce the palette operation with MainPanel and SectionPanel; the work is done when SectionPanel is recognized as a Container and widgets can be added inside it as in earlier JDK versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.