Remove finalizer usage
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
the finalization mechanism is deprecated for removal. NetBeans is still using it occasionally.
Usage must be replaced with alternatives like for example the Java 9 [Cleaner API](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/Cleaner.html) where needed.
JEP: https://openjdk.org/jeps/421
there is a command line flag which simplifies testing during the transition period:
```
Finalization remains enabled by default in JDK 18.
A new command-line option --finalization=disabled disables finalization.
A JVM launched with --finalization=disabled will not run any finalizers — not even those declared within the JDK itself.
```
Contributor guide
Research direction
Start by searching the NetBeans sources for finalizer usage, then read JEP 421 and review the Java 9 Cleaner API as possible replacement guidance. Use --finalization=disabled to test the transition; done means the relevant usage has been replaced and NetBeans still works without finalization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100