@FunctionalInterface public interface StaticFinalFieldMatchProcessor
public static final int w = 5;
public static final String x = "a";
static final String y = "a" + "b"; // Referentially equal to the interned String object "ab"
private static final int z = 1; // Private field values are also returned
static final byte b = 0x7f; // Primitive constants are autoboxed, e.g. byte -> Byte
whereas the following fields are non-constant assignments, so these fields cannot be matched:
public static final Integer w = 5; // Non-constant due to autoboxing
static final String y = "a" + w; // Non-constant expression, because x is non-constant
static final int[] arr = {1, 2, 3}; // Arrays are non-constant
static int n = 100; // Non-final
final int N = 100; // Non-static
Modifier and Type | Method and Description |
---|---|
void |
processMatch(String className,
String fieldName,
Object fieldConstantValue) |
Copyright © 2016. All rights reserved.