Package com.atlassian.bamboo.util
Class BambooConstantUtils
java.lang.Object
com.atlassian.bamboo.util.BambooConstantUtils
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:
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
preventInlining
(boolean value) Prevent inlining of aboolean
Bamboo constant by the Java compiler.static byte
preventInlining
(byte value) Prevent inlining of abyte
Bamboo constant by the Java compiler.static char
preventInlining
(char value) Prevent inlining of achar
Bamboo constant by the Java compiler.static double
preventInlining
(double value) Prevent inlining of adouble
Bamboo constant by the Java compiler.static float
preventInlining
(float value) Prevent inlining of afloat
Bamboo constant by the Java compiler.static int
preventInlining
(int value) Prevent inlining of aint
Bamboo constant by the Java compiler.static long
preventInlining
(long value) Prevent inlining of along
Bamboo constant by the Java compiler.static short
preventInlining
(short value) Prevent inlining of ashort
Bamboo constant by the Java compiler.static <T> T
preventInlining
(T value) Prevent inlining of any type Bamboo constant by the Java compiler.
-
Method Details
-
preventInlining
public static boolean preventInlining(boolean value) Prevent inlining of aboolean
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static byte preventInlining(byte value) Prevent inlining of abyte
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static short preventInlining(short value) Prevent inlining of ashort
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static int preventInlining(int value) Prevent inlining of aint
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static long preventInlining(long value) Prevent inlining of along
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static float preventInlining(float value) Prevent inlining of afloat
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static double preventInlining(double value) Prevent inlining of adouble
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static char preventInlining(char value) Prevent inlining of achar
Bamboo constant by the Java compiler.- See Also:
-
preventInlining
public static <T> T preventInlining(T value) Prevent inlining of any type Bamboo constant by the Java compiler.- See Also:
-