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

mybatis / ibatis-2 / 783

10 Jan 2026 08:35PM UTC coverage: 65.006% (-0.6%) from 65.569%
783

push

github

web-flow
Merge pull request #357 from hazendaz/master

Wire in support to allow javax or jakarta transaction support transparent to user

1599 of 2829 branches covered (56.52%)

8 of 81 new or added lines in 6 files covered. (9.88%)

5023 of 7727 relevant lines covered (65.01%)

0.65 hits per line

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

75.0
/src/main/java/com/ibatis/sqlmap/engine/transaction/jta/JTANamespace.java
1
/*
2
 * Copyright 2004-2026 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.transaction.jta;
17

18
/**
19
 * The Class JTANamespace.
20
 * <p>
21
 * Utility class for detecting presence of Jakarta and Javax Transaction API classes.
22
 */
23
public final class JTANamespace {
24

25
  /** The Constant classloader. */
26
  private static final ClassLoader classloader = JTANamespace.class.getClassLoader();
1✔
27

28
  /** The Constant JAKARTA_TRANSACTION_CLASS. */
29
  public static final Class<?> JAKARTA_TRANSACTION_CLASS = JTANamespace
1✔
30
      .searchTypeInClasspath("jakarta.transaction.Transaction");
1✔
31

32
  /** The Constant JAVAX_TRANSACTION_CLASS. */
33
  public static final Class<?> JAVAX_TRANSACTION_CLASS = JTANamespace
1✔
34
      .searchTypeInClasspath("javax.transaction.Transaction");
1✔
35

36
  /**
37
   * Private constructor to prevent instantiation.
38
   */
39
  private JTANamespace() {
40
    // Utility class
41
  }
42

43
  /**
44
   * Attempts to load the class with the given name using this class's classloader. Returns null if the class is not
45
   * found.
46
   *
47
   * @param <T>
48
   *          the generic type
49
   * @param typeName
50
   *          the type name
51
   *
52
   * @return the class if found, or null if not found
53
   */
54
  @SuppressWarnings("unchecked")
55
  private static <T> Class<? extends T> searchTypeInClasspath(final String typeName) {
56
    try {
57
      return (Class<? extends T>) Class.forName(typeName, false, JTANamespace.classloader);
1✔
NEW
58
    } catch (final ClassNotFoundException e) {
×
NEW
59
      return null;
×
60
    }
61
  }
62

63
}
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