ExprShortValue.java

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 org.opensearch.sql.data.type.ExprCoreType;
10
import org.opensearch.sql.data.type.ExprType;
11
12
/**
13
 * Expression Short Value.
14
 */
15
public class ExprShortValue extends AbstractExprNumberValue {
16
17
  public ExprShortValue(Number value) {
18
    super(value);
19
  }
20
21
  @Override
22
  public Object value() {
23 1 1. value : replaced return value with null for org/opensearch/sql/data/model/ExprShortValue::value → KILLED
    return shortValue();
24
  }
25
26
  @Override
27
  public ExprType type() {
28 1 1. type : replaced return value with null for org/opensearch/sql/data/model/ExprShortValue::type → KILLED
    return ExprCoreType.SHORT;
29
  }
30
31
  @Override
32
  public String toString() {
33 1 1. toString : replaced return value with "" for org/opensearch/sql/data/model/ExprShortValue::toString → KILLED
    return shortValue().toString();
34
  }
35
36
  @Override
37
  public int compare(ExprValue other) {
38 1 1. compare : replaced int return with 0 for org/opensearch/sql/data/model/ExprShortValue::compare → KILLED
    return Short.compare(shortValue(), other.shortValue());
39
  }
40
41
  @Override
42
  public boolean equal(ExprValue other) {
43 2 1. equal : replaced boolean return with true for org/opensearch/sql/data/model/ExprShortValue::equal → SURVIVED
2. equal : replaced boolean return with false for org/opensearch/sql/data/model/ExprShortValue::equal → KILLED
    return shortValue().equals(other.shortValue());
44
  }
45
}

Mutations

23

1.1
Location : value
Killed by : org.opensearch.sql.expression.operator.arthmetic.MathematicalFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.operator.arthmetic.MathematicalFunctionTest]/[test-template:abs_short_value(java.lang.Short)]/[test-template-invocation:#2]
replaced return value with null for org/opensearch/sql/data/model/ExprShortValue::value → KILLED

28

1.1
Location : type
Killed by : org.opensearch.sql.data.model.ExprValueUtilsTest.[engine:junit-jupiter]/[class:org.opensearch.sql.data.model.ExprValueUtilsTest]/[test-template:getType(org.opensearch.sql.data.model.ExprValue, org.opensearch.sql.data.type.ExprCoreType)]/[test-template-invocation:#2]
replaced return value with null for org/opensearch/sql/data/model/ExprShortValue::type → KILLED

33

1.1
Location : toString
Killed by : org.opensearch.sql.expression.operator.arthmetic.MathematicalFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.operator.arthmetic.MathematicalFunctionTest]/[test-template:abs_short_value(java.lang.Short)]/[test-template-invocation:#2]
replaced return value with "" for org/opensearch/sql/data/model/ExprShortValue::toString → KILLED

38

1.1
Location : compare
Killed by : org.opensearch.sql.expression.operator.predicate.BinaryPredicateOperatorTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.operator.predicate.BinaryPredicateOperatorTest]/[test-template:test_less(org.opensearch.sql.data.model.ExprValue, org.opensearch.sql.data.model.ExprValue)]/[test-template-invocation:#17]
replaced int return with 0 for org/opensearch/sql/data/model/ExprShortValue::compare → KILLED

43

1.1
Location : equal
Killed by : org.opensearch.sql.expression.operator.predicate.BinaryPredicateOperatorTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.operator.predicate.BinaryPredicateOperatorTest]/[test-template:test_equal(org.opensearch.sql.data.model.ExprValue, org.opensearch.sql.data.model.ExprValue)]/[test-template-invocation:#2]
replaced boolean return with false for org/opensearch/sql/data/model/ExprShortValue::equal → KILLED

2.2
Location : equal
Killed by : none
replaced boolean return with true for org/opensearch/sql/data/model/ExprShortValue::equal → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.9.0