Package com.atlassian.bamboo.util
Class BambooConstantUtils
- java.lang.Object
-
- com.atlassian.bamboo.util.BambooConstantUtils
-
public class BambooConstantUtils extends Object
A collection of utility methods to prevent inlining of Bamboo constants by the Java compiler.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); }- See Also:
- Quiz, what's wrong with this?
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanpreventInlining(boolean value)Prevent inlining of abooleanBamboo constant by the Java compiler.static bytepreventInlining(byte value)Prevent inlining of abyteBamboo constant by the Java compiler.static charpreventInlining(char value)Prevent inlining of acharBamboo constant by the Java compiler.static doublepreventInlining(double value)Prevent inlining of adoubleBamboo constant by the Java compiler.static floatpreventInlining(float value)Prevent inlining of afloatBamboo constant by the Java compiler.static intpreventInlining(int value)Prevent inlining of aintBamboo constant by the Java compiler.static longpreventInlining(long value)Prevent inlining of alongBamboo constant by the Java compiler.static shortpreventInlining(short value)Prevent inlining of ashortBamboo constant by the Java compiler.static <T> TpreventInlining(T value)Prevent inlining of any type Bamboo constant by the Java compiler.
-
-
-
Method Detail
-
preventInlining
public static boolean preventInlining(boolean value)
Prevent inlining of abooleanBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static byte preventInlining(byte value)
Prevent inlining of abyteBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static short preventInlining(short value)
Prevent inlining of ashortBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static int preventInlining(int value)
Prevent inlining of aintBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static long preventInlining(long value)
Prevent inlining of alongBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static float preventInlining(float value)
Prevent inlining of afloatBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static double preventInlining(double value)
Prevent inlining of adoubleBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static char preventInlining(char value)
Prevent inlining of acharBamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
preventInlining
public static <T> T preventInlining(T value)
Prevent inlining of any type Bamboo constant by the Java compiler.- See Also:
BambooConstantUtils
-
-