apache / apache/netbeans

Generate @see... javadoc when generating delegate methods

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

Description

### Description

When generating a delegate method by menu ` Source > Insert Code... (Alt + Ins) > Delegate Method...`
I whish that in the Generate Delegate Methods window there was an optional checkbox which, if checked, generates the `@see ...` javadoc of the method being delegated.

For example, given:
```java
package org.business.automotive.cars;
public class Car {
/**
* Brum brum bruuuuuum.
*/
public void go() {
System.out.println("Brum brum bruuuuuum");
}
}

package org.business.automotive.cars.wrapped;
public class WrappedCar {
private Car car;
}
```
running the current "Generate Delegate" NetBeans feature on the WrappedCar class will generate:
```java
package org.business.automotive.cars.wrapped;
public class WrappedCar {
private Car car;

public void go() {
car.go();
}
}
```
while with the checkbox checked, NetBeans should generate:
```java
package org.business.automotive.cars.wrapped;
public class WrappedCar {
private Car car;

/**
* @see org.business.automotive.cars.Car#go()
*/
public void go() {
car.go();
}
}
```

### Use case/motivation

I find very boring writing the `@see ...` javadoc, especially when generating lots of delegate methods.

### Related issues

_No response_

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

No

Contributor guide

Open the contributing guide

Research direction

Start at the Source > Insert Code... > Delegate Method... entry point and trace the Generate Delegate Methods window and its generated output. Add an optional checkbox whose enabled behavior produces an @see reference to each delegated method, then verify the generated method and Javadoc against the Car/WrappedCar example; no files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.