test_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SafeNumberOperationUtilsTest.java
test_class.identifier: SafeNumberOperationUtilsTest
test_case.body: @Test
      public void assertSafeIntersectionForBigDecimal() {
          Range<Comparable<?>> range = Range.upTo(new BigDecimal("2331.23211"), BoundType.CLOSED);
          Range<Comparable<?>> connectedRange = Range.open(135.13F, 45343.23F);
          Range<Comparable<?>> newRange = SafeNumberOperationUtils.safeIntersection(range, connectedRange);
          assertThat(newRange.lowerEndpoint(), is(new BigDecimal("135.13")));
          assertThat(newRange.lowerBoundType(), is(BoundType.OPEN));
          assertThat(newRange.upperEndpoint(), is(new BigDecimal("2331.23211")));
          assertThat(newRange.upperBoundType(), is(BoundType.CLOSED));
      }
test_case.class_method_signature: SafeNumberOperationUtilsTest.assertSafeIntersectionForBigDecimal()
test_case.full_signature: @Test public void assertSafeIntersectionForBigDecimal()
test_case.identifier: assertSafeIntersectionForBigDecimal
test_case.invocations: upTo open safeIntersection assertThat lowerEndpoint is assertThat lowerBoundType is assertThat upperEndpoint is assertThat upperBoundType is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSafeIntersectionForBigDecimal()
focal_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SafeNumberOperationUtils.java
focal_class.identifier: SafeNumberOperationUtils
focal_class.class_method_signature: SafeNumberOperationUtils.safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_class.full_signature: public static Range<Comparable<?>> safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_class.identifier: safeIntersection
focal_class.modifiers: public static
focal_class.parameters: (final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_class.return: Range<Comparable<?>>
focal_class.signature: Range<Comparable<?>> safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_class.class_method_signature: SafeNumberOperationUtils.safeClosed(final Comparable<?> lowerEndpoint, final Comparable<?> upperEndpoint)
focal_class.full_signature: public static Range<Comparable<?>> safeClosed(final Comparable<?> lowerEndpoint, final Comparable<?> upperEndpoint)
focal_class.identifier: safeClosed
focal_class.modifiers: public static
focal_class.parameters: (final Comparable<?> lowerEndpoint, final Comparable<?> upperEndpoint)
focal_class.return: Range<Comparable<?>>
focal_class.signature: Range<Comparable<?>> safeClosed(final Comparable<?> lowerEndpoint, final Comparable<?> upperEndpoint)
focal_class.class_method_signature: SafeNumberOperationUtils.safeContains(final Range<Comparable<?>> range, final Comparable<?> endpoint)
focal_class.full_signature: public static boolean safeContains(final Range<Comparable<?>> range, final Comparable<?> endpoint)
focal_class.identifier: safeContains
focal_class.modifiers: public static
focal_class.parameters: (final Range<Comparable<?>> range, final Comparable<?> endpoint)
focal_class.return: boolean
focal_class.signature: boolean safeContains(final Range<Comparable<?>> range, final Comparable<?> endpoint)
focal_class.class_method_signature: SafeNumberOperationUtils.safeEquals(final Collection<Comparable<?>> sourceCollection, final Collection<Comparable<?>> targetCollection)
focal_class.full_signature: public static boolean safeEquals(final Collection<Comparable<?>> sourceCollection, final Collection<Comparable<?>> targetCollection)
focal_class.identifier: safeEquals
focal_class.modifiers: public static
focal_class.parameters: (final Collection<Comparable<?>> sourceCollection, final Collection<Comparable<?>> targetCollection)
focal_class.return: boolean
focal_class.signature: boolean safeEquals(final Collection<Comparable<?>> sourceCollection, final Collection<Comparable<?>> targetCollection)
focal_class.class_method_signature: SafeNumberOperationUtils.createTargetNumericTypeRange(final Range<Comparable<?>> range, final Class<?> clazz)
focal_class.full_signature: private static Range<Comparable<?>> createTargetNumericTypeRange(final Range<Comparable<?>> range, final Class<?> clazz)
focal_class.identifier: createTargetNumericTypeRange
focal_class.modifiers: private static
focal_class.parameters: (final Range<Comparable<?>> range, final Class<?> clazz)
focal_class.return: Range<Comparable<?>>
focal_class.signature: Range<Comparable<?>> createTargetNumericTypeRange(final Range<Comparable<?>> range, final Class<?> clazz)
focal_class.class_method_signature: SafeNumberOperationUtils.getTargetNumericType(final List<Comparable<?>> endpoints)
focal_class.full_signature: private static Class<?> getTargetNumericType(final List<Comparable<?>> endpoints)
focal_class.identifier: getTargetNumericType
focal_class.modifiers: private static
focal_class.parameters: (final List<Comparable<?>> endpoints)
focal_class.return: Class<?>
focal_class.signature: Class<?> getTargetNumericType(final List<Comparable<?>> endpoints)
focal_class.class_method_signature: SafeNumberOperationUtils.parseNumberByClazz(final String number, final Class<?> clazz)
focal_class.full_signature: @SneakyThrows(ReflectiveOperationException.class) private static Comparable<?> parseNumberByClazz(final String number, final Class<?> clazz)
focal_class.identifier: parseNumberByClazz
focal_class.modifiers: @SneakyThrows(ReflectiveOperationException.class) private static
focal_class.parameters: (final String number, final Class<?> clazz)
focal_class.return: Comparable<?>
focal_class.signature: Comparable<?> parseNumberByClazz(final String number, final Class<?> clazz)
focal_method.body: public static Range<Comparable<?>> safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange) {
          try {
              return range.intersection(connectedRange);
          } catch (final ClassCastException ex) {
              Comparable<?> rangeLowerEndpoint = range.hasLowerBound() ? range.lowerEndpoint() : null;
              Comparable<?> rangeUpperEndpoint = range.hasUpperBound() ? range.upperEndpoint() : null;
              Comparable<?> connectedRangeLowerEndpoint = connectedRange.hasLowerBound() ? connectedRange.lowerEndpoint() : null;
              Comparable<?> connectedRangeUpperEndpoint = connectedRange.hasUpperBound() ? connectedRange.upperEndpoint() : null;
              Class<?> clazz = getTargetNumericType(Lists.newArrayList(rangeLowerEndpoint, rangeUpperEndpoint, connectedRangeLowerEndpoint, connectedRangeUpperEndpoint));
              if (clazz == null) {
                  throw ex;
              }
              Range<Comparable<?>> newRange = createTargetNumericTypeRange(range, clazz);
              Range<Comparable<?>> newConnectedRange = createTargetNumericTypeRange(connectedRange, clazz);
              return newRange.intersection(newConnectedRange);
          }
      }
focal_method.class_method_signature: SafeNumberOperationUtils.safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_method.full_signature: public static Range<Comparable<?>> safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_method.identifier: safeIntersection
focal_method.invocations: intersection hasLowerBound lowerEndpoint hasUpperBound upperEndpoint hasLowerBound lowerEndpoint hasUpperBound upperEndpoint getTargetNumericType newArrayList createTargetNumericTypeRange createTargetNumericTypeRange intersection
focal_method.modifiers: public static
focal_method.parameters: (final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)
focal_method.return: Range<Comparable<?>>
focal_method.signature: Range<Comparable<?>> safeIntersection(final Range<Comparable<?>> range, final Range<Comparable<?>> connectedRange)