Browse Source

Shorten constant names to BUILD and RUN (for consistent spelling)

See gh-30511
pull/30619/head
Juergen Hoeller 2 years ago
parent
commit
22ef48bec2
  1. 3
      spring-core/src/main/java/org/springframework/aot/AotDetector.java
  2. 8
      spring-core/src/main/java/org/springframework/core/NativeDetector.java

3
spring-core/src/main/java/org/springframework/aot/AotDetector.java

@ -39,7 +39,8 @@ public abstract class AotDetector {
*/ */
public static final String AOT_ENABLED = "spring.aot.enabled"; public static final String AOT_ENABLED = "spring.aot.enabled";
private static final boolean inNativeImage = NativeDetector.inNativeImage(Context.RUNTIME, Context.BUILD_TIME); private static final boolean inNativeImage = NativeDetector.inNativeImage(Context.RUN, Context.BUILD);
/** /**
* Determine whether AOT optimizations must be considered at runtime. This * Determine whether AOT optimizations must be considered at runtime. This

8
spring-core/src/main/java/org/springframework/core/NativeDetector.java

@ -32,6 +32,7 @@ public abstract class NativeDetector {
private static final boolean inNativeImage = (imageCode != null); private static final boolean inNativeImage = (imageCode != null);
/** /**
* Returns {@code true} if running in a native image context (for example * Returns {@code true} if running in a native image context (for example
* {@code buildtime}, {@code runtime}, or {@code agent}) expressed by setting the * {@code buildtime}, {@code runtime}, or {@code agent}) expressed by setting the
@ -55,10 +56,10 @@ public abstract class NativeDetector {
return false; return false;
} }
/** /**
* Native image context as defined in GraalVM's * Native image context as defined in GraalVM's
* <a href="https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/ImageInfo.java">ImageInfo</a>. * <a href="https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/ImageInfo.java">ImageInfo</a>.
*
* @since 6.0.10 * @since 6.0.10
*/ */
public enum Context { public enum Context {
@ -66,12 +67,12 @@ public abstract class NativeDetector {
/** /**
* The code is executing in the context of image building. * The code is executing in the context of image building.
*/ */
BUILD_TIME("buildtime"), BUILD("buildtime"),
/** /**
* The code is executing at image runtime. * The code is executing at image runtime.
*/ */
RUNTIME("runtime"); RUN("runtime");
private final String key; private final String key;
@ -83,7 +84,6 @@ public abstract class NativeDetector {
public String toString() { public String toString() {
return this.key; return this.key;
} }
} }
} }

Loading…
Cancel
Save