apache / apache/netbeans

ForwardingJavaPlatform is causing trouble

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

Description

As discovered in https://github.com/apache/netbeans/pull/6213#discussion_r1359320621, the proxy class delegates a subset of the methods to the wrapped `JavaPlatform` which creates a frankenstein platform.

https://github.com/apache/netbeans/blob/a9aeefafc04e2d79a4702be88d890324365989bd/java/java.platform/src/org/netbeans/spi/java/platform/support/ForwardingJavaPlatform.java#L36

https://github.com/apache/netbeans/blob/a9aeefafc04e2d79a4702be88d890324365989bd/java/java.platform/src/org/netbeans/api/java/platform/JavaPlatform.java#L41
has final methods and was not designed to be extended / delegated in that way.

It is possible that it was actually the intention of that class to leave some capabilities out, however it is passed to places which expect a working `JavaPlatform` object, with non-empty properties etc.

Lets try to figure out what `ForwardingJavaPlatform` was supposed to achieve (hide the event system?) and then fix it if possible.

Contributor guide

Open the contributing guide

Research direction

Read java/java.platform/src/org/netbeans/spi/java/platform/support/ForwardingJavaPlatform.java and the linked JavaPlatform.java definition, then review the discussion in PR #6213. Determine whether the proxy is intended to hide the event system or omit capabilities; done means resolving that behavior so callers receive a working JavaPlatform with the expected properties and capabilities.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.