From 8bbc2600dcad8cc7537031a33a0f59457452b623 Mon Sep 17 00:00:00 2001 From: jizhuozhi Date: Sun, 27 Feb 2022 04:14:56 +0800 Subject: [PATCH] fix: field of enum must be final (#1577) --- core/src/main/java/feign/Request.java | 2 +- core/src/main/java/feign/template/Template.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/feign/Request.java b/core/src/main/java/feign/Request.java index a56f453b..c9987d10 100644 --- a/core/src/main/java/feign/Request.java +++ b/core/src/main/java/feign/Request.java @@ -36,7 +36,7 @@ public final class Request implements Serializable { public enum ProtocolVersion { HTTP_1_0("HTTP/1.0"), HTTP_1_1("HTTP/1.1"), HTTP_2("HTTP/2.0"), MOCK; - String protocolVersion; + final String protocolVersion; ProtocolVersion() { protocolVersion = name(); diff --git a/core/src/main/java/feign/template/Template.java b/core/src/main/java/feign/template/Template.java index 23889c06..1d5e84bf 100644 --- a/core/src/main/java/feign/template/Template.java +++ b/core/src/main/java/feign/template/Template.java @@ -329,7 +329,7 @@ public class Template { public enum EncodingOptions { REQUIRED(true), NOT_REQUIRED(false); - private boolean shouldEncode; + private final boolean shouldEncode; EncodingOptions(boolean shouldEncode) { this.shouldEncode = shouldEncode;