• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / ibatis-2 / 678

27 Dec 2025 01:13AM UTC coverage: 65.584% (+0.05%) from 65.532%
678

push

github

hazendaz
Merge remote-tracking branch 'upstream/master' into support-javax

1606 of 2810 branches covered (57.15%)

167 of 305 new or added lines in 90 files covered. (54.75%)

6 existing lines in 4 files now uncovered.

5067 of 7726 relevant lines covered (65.58%)

0.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.92
/src/main/java/com/ibatis/sqlmap/engine/mapping/sql/dynamic/elements/IsEmptyTagHandler.java
1
/*
2
 * Copyright 2004-2025 the original author or authors.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *    https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements;
17

18
import com.ibatis.common.beans.Probe;
19
import com.ibatis.common.beans.ProbeFactory;
20

21
import java.lang.reflect.Array;
22
import java.util.Collection;
23

24
/**
25
 * The Class IsEmptyTagHandler.
26
 */
27
public class IsEmptyTagHandler extends ConditionalTagHandler {
1✔
28

29
  /** The Constant PROBE. */
30
  private static final Probe PROBE = ProbeFactory.getProbe();
1✔
31

32
  @Override
33
  public boolean isCondition(SqlTagContext ctx, SqlTag tag, Object parameterObject) {
34
    if (parameterObject == null) {
1!
35
      return true;
×
36
    } else {
37
      String prop = getResolvedProperty(ctx, tag);
1✔
38
      Object value;
39
      if (prop != null) {
1✔
40
        value = PROBE.getObject(parameterObject, prop);
1✔
41
      } else {
42
        value = parameterObject;
1✔
43
      }
44
      if (value instanceof Collection) {
1!
NEW
45
        return ((Collection) value).isEmpty();
×
46
      } else if (value != null && value.getClass().isArray()) {
1!
47
        return Array.getLength(value) == 0;
×
48
      } else {
49
        return value == null || String.valueOf(value).equals("");
1✔
50
      }
51
    }
52
  }
53

54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc