Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6604322

Non-static constant values should be tracked by the sigtest

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • st2.2
    • st1.5.2
    • tools
    • b03
    • generic
    • generic
    • Verified

      The signature test can check constant values of the static final fields ("ST" field in the example below) but doesn't check the constant values of the non-static fields ("NST" field in the example below). Since the non-static constant values may effect the source code compatibility (see switch-case example below caused the "duplicate case label" compilation error), they should be tracked by the sigtest as well.

      ====
      class Test {
          public static final int ST = 1;
          public final int NST = 2;
         
      }

      class Test2 extends Test {
         {
              switch (0) {
                  case NST:
                  case 2:
              }
          }
      }
      > duplicate case label
      > case 2:
      > 1 error

            ersh Mikhail Ershov (Inactive)
            agavrilosunw Alexey Gavrilov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: