You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/06/26 11:15:56 UTC
[PR] refactor: migrate .toArray() to .toArray(T[]::new) (Java 11+) [pekko-connectors]
He-Pin opened a new pull request, #1724:
URL: https://github.com/apache/pekko-connectors/pull/1724
## Summary
- Migrate `.toArray()` → `.toArray(Character[]::new)` in `HdfsReaderTest.java` (4 occurrences)
- Replace `assertArrayEquals(readData.toArray(), content.toArray())` with `assertEquals(readData, content)` in `HdfsReaderTest.java` (avoids generic array creation)
- Migrate `.toArray()` → `.toArray(Integer[]::new)` in `CassandraSourceTest.java` (2 occurrences) and `CassandraFlowTest.java` (1 occurrence)
- Migrate `.toArray()` → `.toArray(Person[]::new)` in `CassandraFlowTest.java` (2 occurrences)
Java 11 added `Collection.toArray(IntFunction<T[]>)` and `Stream.toArray(IntFunction<T[]>)` which produce type-safe arrays instead of `Object[]`.
## Test plan
- [x] `sbt javafmtAll` — formatted
- [x] Both `hdfs` and `cassandra` modules compile successfully
- [ ] CI validates full test suite
Part of the Java 17 modernization effort.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] refactor: migrate .toArray() to .toArray(T[]::new) (Java 11+) [pekko-connectors]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #1724:
URL: https://github.com/apache/pekko-connectors/pull/1724#discussion_r3481200957
##########
cassandra/src/test/java/docs/javadsl/CassandraFlowTest.java:
##########
@@ -95,7 +95,7 @@ public void simpleUpdate() throws InterruptedException, ExecutionException, Time
.map(row -> row.getInt("id"))
.runWith(Sink.seq(), system);
List<Integer> rows = await(select);
- assertThat(new ArrayList<>(rows), hasItems(data.toArray()));
+ assertThat(new ArrayList<>(rows), hasItems(data.toArray(Integer[]::new)));
Review Comment:
these are tests - I don't see why they need to move away from simple .toArray
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] refactor: migrate .toArray() to .toArray(T[]::new) (Java 11+) [pekko-connectors]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1724:
URL: https://github.com/apache/pekko-connectors/pull/1724#issuecomment-4809944564
Closing per reviewer feedback: toArray() in test code doesn't need migration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] refactor: migrate .toArray() to .toArray(T[]::new) (Java 11+) [pekko-connectors]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #1724: refactor: migrate .toArray() to .toArray(T[]::new) (Java 11+)
URL: https://github.com/apache/pekko-connectors/pull/1724
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org