Skip to content

Commit 22ef48b

Browse files
committed
Shorten constant names to BUILD and RUN (for consistent spelling)
See gh-30511
1 parent 4be813b commit 22ef48b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public abstract class AotDetector {
3939
*/
4040
public static final String AOT_ENABLED = "spring.aot.enabled";
4141

42-
private static final boolean inNativeImage = NativeDetector.inNativeImage(Context.RUNTIME, Context.BUILD_TIME);
42+
private static final boolean inNativeImage = NativeDetector.inNativeImage(Context.RUN, Context.BUILD);
43+
4344

4445
/**
4546
* Determine whether AOT optimizations must be considered at runtime. This

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public abstract class NativeDetector {
3232

3333
private static final boolean inNativeImage = (imageCode != null);
3434

35+
3536
/**
3637
* Returns {@code true} if running in a native image context (for example
3738
* {@code buildtime}, {@code runtime}, or {@code agent}) expressed by setting the
@@ -55,23 +56,23 @@ public static boolean inNativeImage(Context... contexts) {
5556
return false;
5657
}
5758

59+
5860
/**
5961
* Native image context as defined in GraalVM's
6062
* <a href="https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/ImageInfo.java">ImageInfo</a>.
61-
*
6263
* @since 6.0.10
6364
*/
6465
public enum Context {
6566

6667
/**
6768
* The code is executing in the context of image building.
6869
*/
69-
BUILD_TIME("buildtime"),
70+
BUILD("buildtime"),
7071

7172
/**
7273
* The code is executing at image runtime.
7374
*/
74-
RUNTIME("runtime");
75+
RUN("runtime");
7576

7677
private final String key;
7778

@@ -83,7 +84,6 @@ public enum Context {
8384
public String toString() {
8485
return this.key;
8586
}
86-
8787
}
8888

8989
}

0 commit comments

Comments
 (0)