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 2026/06/22 21:58:11 UTC

[PR] Fixed more ternary concatenation bugs [netbeans]

mbien opened a new pull request, #9462:
URL: https://github.com/apache/netbeans/pull/9462

   inspired by https://github.com/apache/netbeans/pull/9459
   
   I ran:
   ```java
   "possible bug: ambiguous ternary concatenation":
   $pre + $nullable != null ? $a : $b =>
   $pre + ($nullable != null ? $a : $b)
   ;;
   
   "possible bug: ambiguous ternary concatenation":
   $pre + $nullable == null ? $a : $b =>
   $pre + ($nullable == null ? $a : $b)
   ;;
   ```
   
   Eval order is from left to right which can lead to undesired effects when the right side has a ternary operator.
   
   This puts the ternary operation in braces (or avoids the situation by other means)
   
   


-- 
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: [PR] Fixed more ternary concatenation bugs [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #9462:
URL: https://github.com/apache/netbeans/pull/9462#issuecomment-4782716469

   > Side question: Would you mind elaborating how "I ran" works in practice?
   
   of course!
   
   easiest way is to create a hint file (e.g `manual.hint`) in `[nb_config]/config/rules` for global hints. There is also UI for that but it is a bit hidden. ([example hint files](https://github.com/mbien/jackpot-inspections))
   
   Put some rules into it, e.g by pasting the two rules mentioned above into it and save it.
   
   Hint files can be run using the regular run action (https://github.com/apache/netbeans/pull/3171), e.g right click -> run file. This should open the "inspect and transform" refactoring dialog and ask you about the scope. I have a project group with all NB modules, so i selected "all opened projects" and ran it. (warning: can take little while since its a lot of modules)


-- 
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: [PR] Fixed more ternary concatenation bugs [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien merged PR #9462:
URL: https://github.com/apache/netbeans/pull/9462


-- 
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: [PR] Fixed more ternary concatenation bugs [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #9462:
URL: https://github.com/apache/netbeans/pull/9462#issuecomment-4825889143

   @mbien thanks


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