You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "istinnstudio (via GitHub)" <gi...@apache.org> on 2023/07/03 19:50:38 UTC

[GitHub] [netbeans] istinnstudio commented on issue #6146: Inline hints do not show if math operators are being used in parameters (java)

istinnstudio commented on issue #6146:
URL: https://github.com/apache/netbeans/issues/6146#issuecomment-1619065622

   ok. it is more than this, in this test  class with lots of cases we can trigger the issue, 1, for parameters with the same name or same name and a negative operator in front, 2. with parameters that have a casting, 3. parameters with functions like 1/2 or num/2, maybe more that this, a screenshot attached.
   ```
   
   public class Addition {
   
      public static int addThreeNumbers(int num1, int num2, double num3) {
   
         return (int) (num1 + num2 + num3);
      }
   
      public static void main(String[] args) {
         int num1 = 2;
         float num2 = 5;
         int num3 = 8;
   
         int sum = addThreeNumbers(num1, (int) num2, num3);
         int sum2 = addThreeNumbers(num1, (int) -2.7, 4);
         int sum3 = addThreeNumbers(num1, -3, -4d);
         System.out.println("Sum: " + sum);
      }
   
      public static void m0(String[] args) {
         int num1 = 2;
         int num10 = 2;
         float num2 = 5;
         int num3 = 8;
         int num30 = 8;
         int sum = addThreeNumbers(num10, (int) num2, num30); // different name
         int sum0 = addThreeNumbers(num10, (int) num2, num3);
         int sum2 = addThreeNumbers(num1, 2, 4);
         int sum3 = addThreeNumbers(num1, -3, -4f); // a valid float number but ...
         System.out.println("Sum: " + sum);
      }
   
      public static int addThreeNumbers2(int num1, float num2, double num3, double num4) {
         return (int) (num1 + num2 + num3);
      }
   
      public static void m2(String[] args) {
         int num1 = 2;
         int num2 = 5;
         int num3 = 8;
         double num4 = 8.0;
         int sum = addThreeNumbers2(num1, num2, -num3, -1 / 2); // function
         int sum0 = addThreeNumbers2(num1, num2, num3, -0.5); // foating point
   
         int sum2 = addThreeNumbers2(num1, 2, 4, 0.5d);
         int sum3 = addThreeNumbers2(num1, -3, 4d, num4); // sane name
         System.out.println("Sum: " + sum);
      }
   }
   ```
   ![2023-07-03 22_45_00- Apache NetBeans IDE 17](https://github.com/apache/netbeans/assets/36081997/ee871855-7d00-4579-8cb5-61978bcdc10a)
   
   
   
   
   


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