6363import java .time .OffsetDateTime ;
6464import java .time .OffsetTime ;
6565import java .time .Period ;
66- import java .time .temporal .ChronoUnit ;
67- import java .util .Arrays ;
6866import java .util .List ;
6967import java .util .Map ;
7068import java .util .NoSuchElementException ;
71- import java .util .Objects ;
7269import java .util .TreeMap ;
73- import java .util .concurrent .TimeUnit ;
7470import java .util .function .Function ;
7571import java .util .function .IntFunction ;
7672
@@ -125,7 +121,6 @@ class OracleReadableImpl implements io.r2dbc.spi.Readable {
125121 * {@code jdbcReadable}. Not null.
126122 * @param jdbcReadable Readable values from a JDBC Driver. Not null.
127123 * @param readablesMetadata Metadata of each value. Not null.
128- * @param adapter Adapts JDBC calls into reactive streams. Not null.
129124 */
130125 private OracleReadableImpl (
131126 OracleConnectionImpl r2dbcConnection , DependentCounter dependentCounter ,
@@ -144,13 +139,12 @@ private OracleReadableImpl(
144139 * provided {@code jdbcReadable} and {@code metadata}. The metadata
145140 * object is used to determine the default type mapping of column values.
146141 * </p>
147- * @param jdbcConnection JDBC connection that created the
142+ * @param r2dbcConnection R2DBC connection that created the
148143 * {@code jdbcReadable}. Not null.
149144 * @param dependentCounter Counter that is increased for each dependent
150145 * {@code Result} created by the returned {@code Row}
151146 * @param jdbcReadable Row data from the Oracle JDBC Driver. Not null.
152147 * @param metadata Meta-data for the specified row. Not null.
153- * @param adapter Adapts JDBC calls into reactive streams. Not null.
154148 * @return A {@code Row} backed by the {@code jdbcReadable} and
155149 * {@code metadata}. Not null.
156150 */
@@ -173,7 +167,6 @@ static Row createRow(
173167 * {@code Result} created by the returned {@code OutParameters}
174168 * @param jdbcReadable Row data from the Oracle JDBC Driver. Not null.
175169 * @param metadata Meta-data for the specified row. Not null.
176- * @param adapter Adapts JDBC calls into reactive streams. Not null.
177170 * @return An {@code OutParameters} backed by the {@code jdbcReadable} and
178171 * {@code metadata}. Not null.
179172 */
@@ -406,17 +399,6 @@ private Clob getClob(int index) {
406399 */
407400 private LocalDateTime getLocalDateTime (int index ) {
408401 return jdbcReadable .getObject (index , LocalDateTime .class );
409- /*
410- if (OracleR2dbcTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE
411- .equals(readablesMetadata.get(index).getType())) {
412- // TODO: Remove this when Oracle JDBC implements a correct conversion
413- Timestamp timestamp = jdbcReadable.getObject(index, Timestamp.class);
414- return timestamp == null ? null : timestamp.toLocalDateTime();
415- }
416- else {
417- return jdbcReadable.getObject(index, LocalDateTime.class);
418- }
419- */
420402 }
421403
422404 /**
@@ -741,7 +723,7 @@ private static Map<String, Object> toMap(OracleReadableImpl readable) {
741723 private <T ,U > Function <T ,U > getMappingFunction (
742724 Class <T > fromType , Class <U > toType ) {
743725
744- Function <? extends Object , Object > mappingFunction = null ;
726+ Function <?, Object > mappingFunction = null ;
745727
746728 if (toType .isAssignableFrom (fromType )) {
747729 return toType ::cast ;
@@ -857,20 +839,7 @@ else if (INTERVALYM.class.isAssignableFrom(fromType)
857839 }
858840 else if (INTERVALDS .class .isAssignableFrom (fromType )
859841 && toType .isAssignableFrom (Duration .class )) {
860- mappingFunction = (INTERVALDS intervalds ) -> {
861- // The binary representation is specified in the JavaDoc of
862- // oracle.sql.INTERVALDS. In 21.x, the JavaDoc has bug: It neglects
863- // to mention that the day and fractional second values are offset by
864- // 0x80000000
865- ByteBuffer byteBuffer = ByteBuffer .wrap (intervalds .shareBytes ());
866- return Duration .of (
867- TimeUnit .DAYS .toNanos (byteBuffer .getInt () - 0x80000000 )// 4 byte day
868- + TimeUnit .HOURS .toNanos (byteBuffer .get () - 60 ) // 1 byte hour
869- + TimeUnit .MINUTES .toNanos (byteBuffer .get () - 60 ) // 1 byte minute
870- + TimeUnit .SECONDS .toNanos (byteBuffer .get () - 60 ) // 1 byte second
871- + byteBuffer .getInt () - 0x80000000 , // 4 byte fractional second
872- ChronoUnit .NANOS );
873- };
842+ mappingFunction = (INTERVALDS intervalds ) -> intervalds .getDuration ();
874843 }
875844 else if (java .sql .Blob .class .isAssignableFrom (fromType )
876845 && byte [].class .equals (toType )) {
@@ -1008,7 +977,6 @@ private static final class RowImpl
1008977 * {@code jdbcReadable}. Not null.
1009978 * @param jdbcReadable Row data from the Oracle JDBC Driver. Not null.
1010979 * @param metadata Meta-data for the specified row. Not null.
1011- * @param adapter Adapts JDBC calls into reactive streams. Not null.
1012980 */
1013981 private RowImpl (
1014982 OracleConnectionImpl r2dbcConnection , DependentCounter dependentCounter ,
@@ -1046,11 +1014,10 @@ private static final class OutParametersImpl
10461014 * {@code jdbcReadable} and obtains metadata of the values from
10471015 * {@code outParametersMetaData}.
10481016 * </p>
1049- * @param jdbcConnection JDBC connection that created the
1017+ * @param r2dbcConnection R2DBC connection that created the
10501018 * {@code jdbcReadable}. Not null.
10511019 * @param jdbcReadable Readable values from a JDBC Driver. Not null.
10521020 * @param metadata Metadata of each value. Not null.
1053- * @param adapter Adapts JDBC calls into reactive streams. Not null.
10541021 */
10551022 private OutParametersImpl (
10561023 OracleConnectionImpl r2dbcConnection , DependentCounter dependentCounter ,
@@ -1080,7 +1047,6 @@ private final class OracleR2dbcObjectImpl
10801047 * {@code jdbcReadable}. Not null.
10811048 * @param structJdbcReadable Readable values from a JDBC Driver. Not null.
10821049 * @param metadata Metadata of each value. Not null.
1083- * @param adapter Adapts JDBC calls into reactive streams. Not null.
10841050 */
10851051 private OracleR2dbcObjectImpl (
10861052 OracleConnectionImpl r2dbcConnection ,
0 commit comments