1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.data.model; | |
8 | ||
9 | import java.util.Objects; | |
10 | import org.opensearch.sql.data.type.ExprCoreType; | |
11 | import org.opensearch.sql.data.type.ExprType; | |
12 | ||
13 | /** | |
14 | * Expression Missing Value. | |
15 | */ | |
16 | public class ExprMissingValue extends AbstractExprValue { | |
17 | private static final ExprMissingValue instance = new ExprMissingValue(); | |
18 | ||
19 | private ExprMissingValue() { | |
20 | } | |
21 | ||
22 | public static ExprMissingValue of() { | |
23 |
1
1. of : replaced return value with null for org/opensearch/sql/data/model/ExprMissingValue::of → KILLED |
return instance; |
24 | } | |
25 | ||
26 | @Override | |
27 | public Object value() { | |
28 | return null; | |
29 | } | |
30 | ||
31 | @Override | |
32 | public ExprType type() { | |
33 |
1
1. type : replaced return value with null for org/opensearch/sql/data/model/ExprMissingValue::type → KILLED |
return ExprCoreType.UNDEFINED; |
34 | } | |
35 | ||
36 | @Override | |
37 | public boolean isMissing() { | |
38 |
1
1. isMissing : replaced boolean return with false for org/opensearch/sql/data/model/ExprMissingValue::isMissing → KILLED |
return true; |
39 | } | |
40 | ||
41 | @Override | |
42 | public int compare(ExprValue other) { | |
43 | throw new IllegalStateException(String.format("[BUG] Unreachable, Comparing with MISSING is " | |
44 | + "undefined")); | |
45 | } | |
46 | ||
47 | /** | |
48 | * Missing value is equal to Missing value. | |
49 | * Notes, this function should only used for Java Object Compare. | |
50 | */ | |
51 | @Override | |
52 | public boolean equal(ExprValue other) { | |
53 |
2
1. equal : replaced boolean return with false for org/opensearch/sql/data/model/ExprMissingValue::equal → SURVIVED 2. equal : replaced boolean return with true for org/opensearch/sql/data/model/ExprMissingValue::equal → KILLED |
return other.isMissing(); |
54 | } | |
55 | ||
56 | @Override | |
57 | public int hashCode() { | |
58 |
1
1. hashCode : replaced int return with 0 for org/opensearch/sql/data/model/ExprMissingValue::hashCode → KILLED |
return Objects.hashCode("MISSING"); |
59 | } | |
60 | ||
61 | @Override | |
62 | public String toString() { | |
63 |
1
1. toString : replaced return value with "" for org/opensearch/sql/data/model/ExprMissingValue::toString → KILLED |
return "MISSING"; |
64 | } | |
65 | } | |
Mutations | ||
23 |
1.1 |
|
33 |
1.1 |
|
38 |
1.1 |
|
53 |
1.1 2.2 |
|
58 |
1.1 |
|
63 |
1.1 |