matthiasblaesing commented on code in PR #7451:
URL: https://github.com/apache/netbeans/pull/7451#discussion_r1635347007
##########
platform/openide.awt/src/org/openide/awt/ContextAction.java:
##########
@@ -366,36 +363,10 @@ private Object delegate0(Lookup.Provider everything,
List<?> data, boolean getAc
}
instDelegate = new WeakReference<>(d);
} else {
- instDelegate = NONE;
+ instDelegate = null;
}
return d;
}
-
- void stopListeners() {
Review Comment:
The same reasoning as for the
> Question: why not start/stop listening on action own Performer (Enabler) ?
I'm still feel the `ContextAction` and its associated classes feel like an
incarnation of a god object. They do to much and so I started by ripping out
things, that by analysis don't do anything. I tried to make this minimally
invasive, while fixing the problem.
This PR is the cleanup and continuation from
https://github.com/matthiasblaesing/netbeans/commits/cleanup_context_action/
The first commit "General cleanup (unused code/warning) in ContextAction"
(e1dd39de3a236df5cb11152371e284769f54c3a5) is the result of squashing:
- [Performer#attach is never called -> owner is never set -> remove
it](https://github.com/matthiasblaesing/netbeans/commit/a17631b1a49a7ef19103ebacf2e3f3731dc9266e)
- [Performer#enabler is never set -> stopListeners and startListeners are
no-ops ->
remove](https://github.com/matthiasblaesing/netbeans/commit/7ab98e8752941136b7de0e68e37556f9988e5118)
- [weakEnableListener + weakActionListener are never set -> remove usages ->
detach becomes noop ->
remove](https://github.com/matthiasblaesing/netbeans/commit/82d15ba4408c30e5ef10c22c683dbf52639f76f2)
- [General warning
cleanup](https://github.com/matthiasblaesing/netbeans/commit/5125203cd479346eacbeea66606edbc60345c2b1)
- [Strange pseudo hard reference built from
WeakReference](https://github.com/matthiasblaesing/netbeans/commit/38a86a836e305cb4c304d1bf75991636fb00290e)
- [Remove unnecessary NONE reference, instDelegate is already null guarded
so use that as
sentinal](https://github.com/matthiasblaesing/netbeans/commit/453e4e5b05d0972991f21668f19fbe8fd9a76a43)
- [Some more
cleanup](https://github.com/matthiasblaesing/netbeans/commit/9437968e01ec38f594ba098bc7efa005b7094ecc)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists