From e98b93844ac0298779362510f493d198835a07cf Mon Sep 17 00:00:00 2001 From: igor-suhorukov Date: Wed, 14 Feb 2018 00:28:19 +0300 Subject: [PATCH] Polish static final usage for constants Closes gh-12032 --- .../springframework/boot/cli/command/status/ExitStatus.java | 6 +++--- .../env/SpringApplicationJsonEnvironmentPostProcessor.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/status/ExitStatus.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/status/ExitStatus.java index eca02b20a1b..871848616d8 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/status/ExitStatus.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/status/ExitStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,12 +29,12 @@ public final class ExitStatus { /** * Generic "OK" exit status with zero exit code and {@literal hangup=false}. */ - public static ExitStatus OK = new ExitStatus(0, "OK"); + public static final ExitStatus OK = new ExitStatus(0, "OK"); /** * Generic "not OK" exit status with non-zero exit code and {@literal hangup=true}. */ - public static ExitStatus ERROR = new ExitStatus(-1, "ERROR", true); + public static final ExitStatus ERROR = new ExitStatus(-1, "ERROR", true); private final int code; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java index 02f846b27c3..8cc4486ed17 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java @@ -59,12 +59,12 @@ public class SpringApplicationJsonEnvironmentPostProcessor /** * Name of the {@code spring.application.json} property. */ - public static String SPRING_APPLICATION_JSON_PROPERTY = "spring.application.json"; + public static final String SPRING_APPLICATION_JSON_PROPERTY = "spring.application.json"; /** * Name of the {@code SPRING_APPLICATION_JSON} environment variable. */ - public static String SPRING_APPLICATION_JSON_ENVIRONMENT_VARIABLE = "SPRING_APPLICATION_JSON"; + public static final String SPRING_APPLICATION_JSON_ENVIRONMENT_VARIABLE = "SPRING_APPLICATION_JSON"; private static final String SERVLET_ENVIRONMENT_CLASS = "org.springframework.web." + "context.support.StandardServletEnvironment"; @@ -176,7 +176,7 @@ public class SpringApplicationJsonEnvironmentPostProcessor private final JsonPropertyValue propertyValue; JsonPropertySource(JsonPropertyValue propertyValue, Map source) { - super("spring.application.json", source); + super(SPRING_APPLICATION_JSON_PROPERTY, source); this.propertyValue = propertyValue; }