LiteralExpression.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
7
package org.opensearch.sql.expression;
8
9
import lombok.EqualsAndHashCode;
10
import lombok.RequiredArgsConstructor;
11
import org.opensearch.sql.data.model.ExprValue;
12
import org.opensearch.sql.data.type.ExprType;
13
import org.opensearch.sql.expression.env.Environment;
14
15
/**
16
 * Literal Expression.
17
 */
18
@EqualsAndHashCode
19
@RequiredArgsConstructor
20
public class LiteralExpression implements Expression {
21
  private final ExprValue exprValue;
22
23
  @Override
24
  public ExprValue valueOf(Environment<Expression, ExprValue> env) {
25 1 1. valueOf : replaced return value with null for org/opensearch/sql/expression/LiteralExpression::valueOf → KILLED
    return exprValue;
26
  }
27
28
  @Override
29
  public ExprType type() {
30 1 1. type : replaced return value with null for org/opensearch/sql/expression/LiteralExpression::type → KILLED
    return exprValue.type();
31
  }
32
33
  @Override
34
  public <T, C> T accept(ExpressionNodeVisitor<T, C> visitor, C context) {
35 1 1. accept : replaced return value with null for org/opensearch/sql/expression/LiteralExpression::accept → KILLED
    return visitor.visitLiteral(this, context);
36
  }
37
38
  @Override
39
  public String toString() {
40 1 1. toString : replaced return value with "" for org/opensearch/sql/expression/LiteralExpression::toString → KILLED
    return exprValue.toString();
41
  }
42
}

Mutations

25

1.1
Location : valueOf
Killed by : org.opensearch.sql.expression.parse.RegexExpressionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.parse.RegexExpressionTest]/[method:resolve_type()]
replaced return value with null for org/opensearch/sql/expression/LiteralExpression::valueOf → KILLED

30

1.1
Location : type
Killed by : org.opensearch.sql.expression.conditional.cases.WhenClauseTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.conditional.cases.WhenClauseTest]/[method:should_use_result_expression_type()]
replaced return value with null for org/opensearch/sql/expression/LiteralExpression::type → KILLED

35

1.1
Location : accept
Killed by : org.opensearch.sql.analysis.ExpressionReferenceOptimizerTest.[engine:junit-jupiter]/[class:org.opensearch.sql.analysis.ExpressionReferenceOptimizerTest]/[method:expression_without_aggregation_should_not_be_replaced()]
replaced return value with null for org/opensearch/sql/expression/LiteralExpression::accept → KILLED

40

1.1
Location : toString
Killed by : org.opensearch.sql.storage.bindingtuple.BindingTupleTest.[engine:junit-jupiter]/[class:org.opensearch.sql.storage.bindingtuple.BindingTupleTest]/[method:resolve_literal_expression_throw_exception()]
replaced return value with "" for org/opensearch/sql/expression/LiteralExpression::toString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.9.0