Skip to content

Commit 4441a22

Browse files
authored
Mark some constants in decay functions final (#50569)
This marks a couple of constants in the `DecayFunctionBuilder` as final. They are written in CONSTANT_CASE and used as constants but not final which is a little confusing and might lead to sneaky bugs.
1 parent dd4ede5 commit 4441a22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public abstract class DecayFunctionBuilder<DFB extends DecayFunctionBuilder<DFB>
6565
protected static final String DECAY = "decay";
6666
protected static final String OFFSET = "offset";
6767

68-
public static double DEFAULT_DECAY = 0.5;
69-
public static MultiValueMode DEFAULT_MULTI_VALUE_MODE = MultiValueMode.MIN;
68+
public static final double DEFAULT_DECAY = 0.5;
69+
public static final MultiValueMode DEFAULT_MULTI_VALUE_MODE = MultiValueMode.MIN;
7070

7171
private final String fieldName;
7272
//parsing of origin, scale, offset and decay depends on the field type, delayed to the data node that has the mapping for it

0 commit comments

Comments
 (0)