public class BambooConstantUtils extends Object
Use these methods when defining constants which may be used by external code. Using them guarantees that the Java compiler does not inline the values of the constants in the compiled classes.
Changing constants not wrapped by such utility methods (and not protected in any other way) may lead to plugin compatibility issues.
Example:
import static com.atlassian.bamboo.util.BambooConstantUtils.preventInlining;
public class BambooConstants {
public static final String BAMBOO_VERSION = preventInlining("6.0.0");
public static final int BAMBOO_BUILD_NUMBER = preventInlining(60000);
public static final boolean BAMBOO_DEV_MODE = preventInlining(false);
}
Modifier and Type | Method and Description |
---|---|
static boolean |
preventInlining(boolean value)
Prevent inlining of a
boolean Bamboo constant by the Java compiler. |
static byte |
preventInlining(byte value)
Prevent inlining of a
byte Bamboo constant by the Java compiler. |
static char |
preventInlining(char value)
Prevent inlining of a
char Bamboo constant by the Java compiler. |
static double |
preventInlining(double value)
Prevent inlining of a
double Bamboo constant by the Java compiler. |
static float |
preventInlining(float value)
Prevent inlining of a
float Bamboo constant by the Java compiler. |
static int |
preventInlining(int value)
Prevent inlining of a
int Bamboo constant by the Java compiler. |
static long |
preventInlining(long value)
Prevent inlining of a
long Bamboo constant by the Java compiler. |
static short |
preventInlining(short value)
Prevent inlining of a
short Bamboo constant by the Java compiler. |
static <T> T |
preventInlining(T value)
Prevent inlining of any type Bamboo constant by the Java compiler.
|
public static boolean preventInlining(boolean value)
boolean
Bamboo constant by the Java compiler.BambooConstantUtils
public static byte preventInlining(byte value)
byte
Bamboo constant by the Java compiler.BambooConstantUtils
public static short preventInlining(short value)
short
Bamboo constant by the Java compiler.BambooConstantUtils
public static int preventInlining(int value)
int
Bamboo constant by the Java compiler.BambooConstantUtils
public static long preventInlining(long value)
long
Bamboo constant by the Java compiler.BambooConstantUtils
public static float preventInlining(float value)
float
Bamboo constant by the Java compiler.BambooConstantUtils
public static double preventInlining(double value)
double
Bamboo constant by the Java compiler.BambooConstantUtils
public static char preventInlining(char value)
char
Bamboo constant by the Java compiler.BambooConstantUtils
public static <T> T preventInlining(T value)
BambooConstantUtils
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.