You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2023/02/05 20:10:50 UTC
[GitHub] [netbeans] mbien opened a new issue, #5440: remove finalizer usage
mbien opened a new issue, #5440:
URL: https://github.com/apache/netbeans/issues/5440
### Body
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.
JDP: 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.
```
### Committer
- [X] I acknowledge that I am a maintainer/committer in the Apache NetBeans project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] remove finalizer usage [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-2666862536
`-J-Xlog:finalizer:finalizer.log` this helps to find usage hotspots too. (will put the logfile in the current folder, might be home folder if opened via shortcut).
going to create a parent issue and add all JDK compatibility issues as sub-issues for better overview
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jtulach commented on issue #5440: remove finalizer usage
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1493334676
Yes, go on and replace `finalize` with (active) `ReferenceQueue`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on issue #5440: remove finalizer usage
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1620192152
@mbien agreed, and we're free to use `Cleaner` now. I assume we're going to punt this forward to at least NB20 though?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on issue #5440: remove finalizer usage
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1620249349
@mbien true, and the ultimate milestone is this being removed from the next JDK, which I haven't seen scheduled so far.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on issue #5440: remove finalizer usage
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1531216719
We should consider what is happening in #5878 should we decide to introduce more usage of active reference queue over cleaner API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on issue #5440: remove finalizer usage
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1620197868
@neilcsmith-net we could probably remove the milestone entirely. But having a milestone makes it probably also less likely that we forget about it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on issue #5440: remove finalizer usage
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1428077405
> 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.
We also already have a somewhat similar utilities API which might be of use for this? - https://bits.netbeans.org/17/javadoc/org-openide-util/org/openide/util/BaseUtilities.html#activeReferenceQueue--
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing commented on issue #5440: remove finalizer usage
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1426225332
And another query with `jackpot` (using the "finalize() declared" hint):
```
contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/design/SecurityConfiguration.java:233
contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/design/MtomConfiguration.java:184
contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/design/RMConfiguration.java:194
harness/jellytools.platform/src/org/netbeans/jellytools/MainWindowOperator.java:513
ide/versioning.util/src/org/netbeans/modules/turbo/Turbo.java:136
ide/o.apache.xml.resolver/build/external-patch/sources/org/apache/xml/resolver/readers/TextCatalogReader.java:184
ide/xml.retriever/src/org/netbeans/modules/xml/retriever/catalog/impl/CatalogFileWrapperDOMImpl.java:642
ide/db.dataview/src/org/netbeans/modules/db/dataview/util/FileBackedBlob.java:238
ide/db.dataview/src/org/netbeans/modules/db/dataview/util/FileBackedClob.java:263
ide/editor.lib/src/org/netbeans/editor/MarkBlock.java:555
ide/editor.lib/src/org/netbeans/editor/LeafElement.java:66
ide/editor/src/org/netbeans/modules/editor/NbEditorUI.java:820
ide/subversion/src/org/netbeans/modules/subversion/client/SvnClientInvocationHandler.java:478
ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/MyFontMetrics.java:149
ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/eval/CodeEvaluatorUI.java:391
java/performance.java/test/qa-functional/data/SystemProperties/src/org/myorg/systemproperties/OnePropNode.java:105
java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/ui/JAXBWizardIterator.java:87
java/refactoring.java/test/qa-functional/data/projects/RefactoringTest/src/inspectAndTransform/Class_A_E.java:8
java/refactoring.java/test/qa-functional/data/projects/RefactoringTest/src/inspectAndTransform/Class_A_B.java:5
java/refactoring.java/test/qa-functional/data/projects/RefactoringTest/src/inspectAndTransform/Class_A_A.java:5
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/actions/CheckDeadlocksAction.java:149
profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/NumberList.java:93
profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/AbstractLongMap.java:81
platform/openide.nodes/src/org/openide/util/actions/CookieAction.java:295
platform/openide.nodes/src/org/openide/util/actions/CookieAction.java:401
platform/openide.nodes/src/org/openide/nodes/FilterNode.java:1448
platform/openide.nodes/src/org/openide/nodes/EntrySupportLazy.java:908
platform/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java:915
platform/openide.explorer/src/org/openide/explorer/propertysheet/SheetTable.java:237
platform/o.n.bootstrap/src/org/netbeans/JarClassLoader.java:867
platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java:645
platform/openide.util/test/unit/src/org/openide/util/ReadWriteAccessTest.java:1045
platform/openide.filesystems/src/org/openide/filesystems/MIMESupport.java:660
platform/openide.filesystems/src/org/openide/filesystems/FileLock.java:112
platform/openide.filesystems/src/org/openide/filesystems/JarFileSystem.java:649
platform/openide.filesystems/src/org/openide/filesystems/DefaultAttributes.java:805
platform/openide.filesystems/test/unit/src/org/openide/filesystems/FileObjectTestHid.java:2877
platform/o.n.core/src/org/netbeans/core/NbStatusDisplayer.java:170
platform/openide.awt/src/org/openide/awt/StatusDisplayer.java:130
platform/openide.util.lookup/src/org/openide/util/lookup/ProxyLookup.java:427
platform/openide.util.ui/src/org/openide/util/actions/CallbackSystemAction.java:719
platform/openide.util.ui/src/org/openide/util/SharedClassObject.java:199
platform/openide.util.ui/test/unit/src/org/openide/util/MutexTest.java:1069
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on issue #5440: remove finalizer usage
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #5440:
URL: https://github.com/apache/netbeans/issues/5440#issuecomment-1531228490
IMO: JDK APIs should be always preferred over self written/third party implementations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists