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