Bug 40476 - refactor change method signature reports erroneous non-constant case statements
Summary: refactor change method signature reports erroneous non-constant case statements
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 41516 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-18 11:45 EDT by Nikolay Metchev CLA
Modified: 2003-08-28 04:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Metchev CLA 2003-07-18 11:45:26 EDT
----------------------A.java--------------------------
package a;

import b.B;

public class A
{
   public static void method(final int a, final String b) //<--refactor change 
                                                          // method signature
   {
      switch(a)
      {
         case B.VALUE_ONE:
         {
            break;
         }
         case B.VALUE_TWO:
         {
            break;
         }
      }
   }
}
-----------------------------------------------------
-------------------------B.java----------------------
package b;

public class B
{
   public static final int VALUE_ONE = 1;
   public static final int VALUE_TWO = 2;
}
-------------------------------------------------------
use refactor change method signature to swap the two parameters of the 
method "method" around. You get an erroneous case expressions must be constant 
warning!
Comment 1 Adam Kiezun CLA 2003-07-21 05:36:22 EDT
will investigate - suspecting jcore problem
Comment 2 Dirk Baeumer CLA 2003-08-05 08:28:21 EDT
Asking JDT/Core for comments. We had scenarios in the past where the Java 
compiler didn't report an error, but the AST did. They where constant 
expressions as well.
Comment 3 Olivier Thomann CLA 2003-08-14 10:52:59 EDT
Fixed and released in HEAD.
Regression test added.
Comment 4 Olivier Thomann CLA 2003-08-14 10:55:13 EDT
*** Bug 41516 has been marked as a duplicate of this bug. ***
Comment 5 David Audel CLA 2003-08-28 04:48:55 EDT
Verified.