You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "AyushMhaisane (via GitHub)" <gi...@apache.org> on 2026/01/19 04:46:22 UTC
[PR] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
AyushMhaisane opened a new pull request, #2632:
URL: https://github.com/apache/pekko/pull/2632
This PR fixes compiler warnings related to "unchecked call to expectNext(I)" in SourceTest.java.
The issue was caused by TestSink.create(system) returning a raw type when not explicitly typed. This change adds the necessary type witnesses (e.g., <Integer>, <String>) to the TestSink.create calls to ensure type safety and eliminate the warnings.
Changes
Updated SourceTest.java to use explicit types in TestSink.create (e.g., TestSink.<Integer>create(system)).
Updated Source creation where necessary to match the Sink types (e.g., Source.<String>fromArray(...)).
Related Issue Fixes #2625
Verification
Ran Test/compile in stream-tests module: Success (Warnings related to SourceTest.java are gone).
Ran testOnly org.apache.pekko.stream.javadsl.SourceTest: All tests passed.
Checklist:
[x] The commit message follows the [contribution guidelines](https://github.com/apache/pekko/blob/main/CONTRIBUTING.md).
[x] Tests have been run and passed.
[x] No logic changes, only type safety improvements.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2704585501
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -27,9 +27,11 @@
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
Review Comment:
the changes look good now but the import changes seem unnecessary
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2704735594
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -30,6 +30,7 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
+import javax.xml.transform.Source;
Review Comment:
This is wrong too
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #2632:
URL: https://github.com/apache/pekko/pull/2632#issuecomment-3767393491
there are now no changes in the PR - everything including the code fixes have been removed
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #2632:
URL: https://github.com/apache/pekko/pull/2632#issuecomment-3882592772
Thanks, I think we should close this PR, which is not what the issue is. thanks @AyushMhaisane for the effects
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin closed pull request #2632: Fix unchecked call warnings in SourceTest.java (#2625)
URL: https://github.com/apache/pekko/pull/2632
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "AyushMhaisane (via GitHub)" <gi...@apache.org>.
AyushMhaisane commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2704695650
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -27,9 +27,11 @@
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
Review Comment:
Thanks @pjfanning. I have removed the unnecessary java.util.function.Function import and updated the commit. The diff should be cleaner now.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #2632:
URL: https://github.com/apache/pekko/pull/2632#issuecomment-3769805971
This doesn't compile and doesn't fix the compile warnings anyway.
This original issue is only a slight irritant so it might not be worth spending more time on it.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "AyushMhaisane (via GitHub)" <gi...@apache.org>.
AyushMhaisane commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703902246
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -2,7 +2,7 @@
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
Review Comment:
Done! I've reverted the indentation change in the license header.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703914707
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -64,16 +66,17 @@ public SourceTest() {
}
@ClassRule
- public static PekkoJUnitActorSystemResource actorSystemResource =
- new PekkoJUnitActorSystemResource("SourceTest", PekkoSpec.testConf());
+ public static PekkoJUnitActorSystemResource actorSystemResource = new PekkoJUnitActorSystemResource("SourceTest",
+ PekkoSpec.testConf());
- interface Fruit {}
Review Comment:
the last code commit includes lots of code formatting changes - can these be reverted?
the only change I asked for was to fix one line in the license
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703340289
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -123,16 +123,16 @@ public void mustBeAbleToUseSimpleOperators() {
@Test
public void mustBeAbleToCompleteWhenArrayIsEmpty() {
- Source.fromArray(new String[] {})
- .runWith(TestSink.create(system), system)
+ Source.<String>fromArray(new String[] {})
Review Comment:
I don't think we need this
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "AyushMhaisane (via GitHub)" <gi...@apache.org>.
AyushMhaisane commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703401034
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -123,16 +123,16 @@ public void mustBeAbleToUseSimpleOperators() {
@Test
public void mustBeAbleToCompleteWhenArrayIsEmpty() {
- Source.fromArray(new String[] {})
- .runWith(TestSink.create(system), system)
+ Source.<String>fromArray(new String[] {})
Review Comment:
Thanks @He-Pin, you were correct. I have removed the redundant <String> type witness from Source.fromArray and updated the PR.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "AyushMhaisane (via GitHub)" <gi...@apache.org>.
AyushMhaisane commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703962702
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -64,16 +66,17 @@ public SourceTest() {
}
@ClassRule
- public static PekkoJUnitActorSystemResource actorSystemResource =
- new PekkoJUnitActorSystemResource("SourceTest", PekkoSpec.testConf());
+ public static PekkoJUnitActorSystemResource actorSystemResource = new PekkoJUnitActorSystemResource("SourceTest",
+ PekkoSpec.testConf());
- interface Fruit {}
Review Comment:
Sorry about the formatting noise! I have reset the file and applied only the necessary type witness changes to TestSink. The diff should be clean now.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #2632:
URL: https://github.com/apache/pekko/pull/2632#issuecomment-3767514525
Now all the unnecessary format changes are back.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #2632:
URL: https://github.com/apache/pekko/pull/2632#issuecomment-3768307151
@AyushMhaisane Thanks, the origin problem is a type inferance problem, so the fix should add some type parameter.
--
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] Fix unchecked call warnings in SourceTest.java (#2625) [pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #2632:
URL: https://github.com/apache/pekko/pull/2632#discussion_r2703853239
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/SourceTest.java:
##########
@@ -2,7 +2,7 @@
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
Review Comment:
can you revert this change?
--
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