Skip to content

[SwiftJava] Generalize conformances of Java collection types to Sequence (#96) - #926

Merged
ktoso merged 1 commit into
swiftlang:mainfrom
amanmaurya92:feature/issue-96-java-collections-sequence
Oct 5, 2026
Merged

ktoso merged 1 commit into
swiftlang:mainfrom
amanmaurya92:feature/issue-96-java-collections-sequence

Conversation

@amanmaurya92

@amanmaurya92 amanmaurya92 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #96

Problem

I noticed only List and Enumeration conformed to Swift's Sequence protocol, leaving other wrapped collection types (JavaCollection, JavaSet, iterators, and JavaUtil collections) unable to be iterated directly in Swift.

Solution

I introduced JavaCollectionProtocol in SwiftJava providing default Sequence conformance, conformed JavaCollection, JavaSet, List, JavaIterator, ListIterator, and JavaUtil collections to it, and added real-JVM runtime tests.


Formatted using Gemini

@amanmaurya92
amanmaurya92 requested a review from ktoso as a code owner October 4, 2026 23:41

@ktoso ktoso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, nice one!

@ktoso

ktoso commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Can't push to your branch, you can enable "maintainers can push", i'd resolve the formatting then.

So please resolve the formatting issue on your end

@amanmaurya92

Copy link
Copy Markdown
Contributor Author

Can't push to your branch, you can enable "maintainers can push", i'd resolve the formatting then.

So please resolve the formatting issue on your end

I have allowed edit access to maintainers :)
rest is in your hands

@amanmaurya92
amanmaurya92 requested a review from ktoso October 5, 2026 06:18
@amanmaurya92
amanmaurya92 force-pushed the feature/issue-96-java-collections-sequence branch from 69720de to d22152f Compare October 5, 2026 06:51
@amanmaurya92

Copy link
Copy Markdown
Contributor Author

i have ran the format check locally and it must pass now, after the latest commit

@ktoso
ktoso merged commit 8a86a20 into swiftlang:main Oct 5, 2026
@ktoso

ktoso commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks, merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java2Swift: Generalize conformances of Java collection types to Swift sequence protocols

2 participants