You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/06/05 15:26:01 UTC

[GitHub] [netbeans] jonathanpoulin9 opened a new issue, #4199: Terminal window, "Set Title" in problem

jonathanpoulin9 opened a new issue, #4199:
URL: https://github.com/apache/netbeans/issues/4199

   ### Apache NetBeans version
   
   Apache NetBeans 13
   
   ### What happened
   
   Setting the terminal title set the title of another tab instead of the selected one.
   
   ### How to reproduce
   
   1. Create a first terminal tab
   2. Create a second terminal tab and set its title to something else
   3. Create a third terminal tab and set its title to something else
   
   Result: The title of the second tab is changed instead of the selected one, the third.
   
   ### Did this work correctly in an earlier version?
   
   No
   
   ### Operating System
   
   Ubuntu 18.04.6 LTS
   
   ### JDK
   
   OpenJDK Runtime Environment (build 17.0.3+7-Ubuntu-0ubuntu0.18.04.1)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### Code of Conduct
   
   Yes


-- 
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] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "eirikbakke (via GitHub)" <gi...@apache.org>.
eirikbakke commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2148051170

   > I'm aware of that, but I'd take a theoretical 1 in 4294967296 chance of failure over 1 in 1!
   
   Poorly generated hash codes are fairly common, so in practice a collision is a very real possibility (way more likely than 1/2^32). And then anyone who investigates a rare bug has to think, "I wonder if it could be due to a hash code collision?"


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "eirikbakke (via GitHub)" <gi...@apache.org>.
eirikbakke commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2147801333

   Use of hashCode() would be another source of non-deterministic behavior, due to occasional hash collisions. (I know you're trying to avoid holding on to a reference to the actual list...)
   
   I don't have a quick way to reproduce this and test experimental patches at the moment, but if someone comes up with a more definitive solution, I am happy to include it in my next NetBeans build and run with it for a few weeks to verify.


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing closed issue #4199: Terminal window: "Set Title" sets title to wrong tab
URL: https://github.com/apache/netbeans/issues/4199


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2143964352

   @sdedic PR #652 was merged 6 years ago. We are still seeing the fallout of that as @troizet analysed. I noticed this because the terminal copy behavior of NetBeans is choppy and stumbled over this. I see copy/paste operations going to the wrong terminal and SetTitle going to the wrong terminal, matches that. @eirikbakke raised the problems in 2020 and got ignored. I'm inclined to see if reverting that change is feasible if no real fix can be found.
   
   @eirikbakke did you do futher work on the problem you noticed from #652?


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "eirikbakke (via GitHub)" <gi...@apache.org>.
eirikbakke commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2143981418

   @matthiasblaesing For my NetBeans Platform app and working IDE, I have a custom build of the NetBeans Platform that, for the last 4 years, has included the patch that was attached to https://issues.apache.org/jira/browse/NETBEANS-4754 ("netbeans-4754-eiriktest.patch"). This fixes NETBEANS-4754 but breaks some aspect of the feature from https://github.com/apache/netbeans/pull/652 (according to @sdedic's comment in the JIRA issue).
   
   > I'm inclined to see if reverting that change is feasible if no real fix can be found.
   
   I would probably recommend this, if no fix can be found to the underlying bug. I remember that the code was very hard to follow, and its interactions with the garbage collector makes its behavior non-deterministic.
   
   Though ActionState is now a public API, so removing it may not be possible. Perhaps only the _use_ of it could be reverted, and only be reintroduced if someone finds the time to fix the known bug.


-- 
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] lkishalmi commented on issue #4199: Terminal window, "Set Title" in problem

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-1149092804

   Just tested and can confirm. Checked the code, it seems some heuristics goes wrong when trying to detect the active terminal.


-- 
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] jonathanpoulin9 commented on issue #4199: Terminal window, "Set Title" in problem

Posted by GitBox <gi...@apache.org>.
jonathanpoulin9 commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-1149210973

   Thanks for the confirmation @lkishalmi.


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2144006714

   > Though ActionState is now a public API, so removing it may not be possible. Perhaps only the _use_ of it could be reverted, and only be reintroduced if someone finds the time to fix the known bug.
   
   Of course it is possible. It is painful, but we can bump major module version. I know that some hardliners see that as a no-no, but then these can come up with a compatible fix.
   


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2147907083

   > Use of hashCode() would be another source of non-deterministic behavior, due to occasional hash collisions. (I know you're trying to avoid holding on to a reference to the actual list...)
   
   I'm aware of that, but I'd take a theoretical 1 in 4294967296 chance of failure over 1 in 1! :wink:
   
   Holding on to the list, and even the delegate reference, might be the right way to handle this.  I got a bit lost trying to work out what having both `everything` and `data` is intended to achieve here. @sdedic ?
   
   I may at least roll the above as a draft PR and check all the relevant tests pass ...


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2148218792

   Currently just a gut feeling, but the separate `Performer` implementation makes no sense to me after the change from #652. Before #652 `Performer` could be shared between multiple `ContextAction`s, because it was stateless, that is not true after that.  Getting rid of that would eliminate one level of indirection. 
   
   What I'm missing is the big picture of ContextAction, i.e. how it should work.


-- 
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] troizet commented on issue #4199: Terminal window: "Set Title" sets title to wrong tab

Posted by GitBox <gi...@apache.org>.
troizet commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-1305105285

   This is a bug that appeared in version 10 of NetBeans in the Pull Request #652. The bug is described [here](https://github.com/apache/netbeans/pull/652#discussion_r479722069) and [here](https://issues.apache.org/jira/browse/NETBEANS-4754).


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2145368629

   I had a quick look at this.  Even I don't think reverting this is a feasible solution! :smile:
   
   Just null'ing the `instDelegate` in `delegate0` like @eirikbakke patch fails a bunch of tests. (I had to move the test file into the right folder too to check that).  Looking at @sdedic comments on that JIRA report, I tried adding an `int hash;` field to the `Performer` class and then doing -
   
   ```java
   private Object delegate0(Lookup.Provider everything, List<?> data, boolean getAction) {
               int dataHash = data.hashCode();
               if (hash != dataHash) {
                   hash = dataHash;
                   instDelegate = null;
               }
               Object d = instDelegate != null ? instDelegate.get() : null;
               ////
   ```
   
   That seems to (partially) fix the terminal tab title issue for me, and all the tests still pass.  Not sure if that works for @eirikbakke other cases.  The data list appears to be the key to invalidating things.  The idea of actions listening on the `everything` lookup appears to be a red herring, as that is recreated on every call with fixed contents from the data list.  Holding a strong reference to the data list might be a bad idea though.  I hate code that relies on weak references for "correct" behaviour.
   
   I say partially fix the title issue, as there seems to be a secondary issue with the context not changing to an unfocused tab when invoking the menu on 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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2149205399

   > Poorly generated hash codes are fairly common, so in practice a collision is a very real possibility (way more likely than 1/2^32). 
   
   Of course (and records are fun for that!).  The comment was partly facetious, certainly exaggerated,  Although if using identity hashcodes, which could be forced, it's still unlikely to collide.  And as a _mitigation_ and test, pending fixing properly, it's potentially useful.
   
   I only had a quick look at this, but the code that is meant to invalidate on lookup changes doesn't seem to fire.  Certainly breakpoints in certain locations were not hit.
   
   Thanks @matthiasblaesing and like your comment on the curious hard-weak reference :smile:  The other change would be to move the test into the right package - https://github.com/apache/netbeans/blob/master/platform/openide.awt/test/unit/src/org/netbeans/modules/openide/openide/awt/StatefulActionProcessorTest.java  Although curiously while the IDE won't run it directly, CI is doing, which is good.


-- 
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


Re: [I] Terminal window: "Set Title" sets title to wrong tab [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #4199:
URL: https://github.com/apache/netbeans/issues/4199#issuecomment-2148555105

   Update: I had a closer look at Performer and indeed it can be cleaned up - not a fix, but maybe helps other staring at this.
   
   https://github.com/apache/netbeans/compare/master...matthiasblaesing:netbeans:cleanup_context_action?expand=1


-- 
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