google / j2cl

Java to Closure JavaScript transpiler
Apache License 2.0
1.22k stars 143 forks source link

Add Java 10 Collections APIs #242

Closed treblereel closed 1 month ago

treblereel commented 1 month ago

Java 10 added copyOf static factory methods to produce immutable List/Set/Map instances that contain no nulls.

treblereel commented 1 month ago

@gkdn I added tests to the Java9 package, mainly because it looks more suitable than the Java8 package. Wdyt?

gkdn commented 1 month ago

Is this ready for another round?

treblereel commented 1 month ago

Is this ready for another round?

yeap, i think so

gkdn commented 1 month ago

Thanks. Doing some refactoring, will submit soon.

treblereel commented 1 month ago

Thanks. Doing some refactoring, will submit soon.

What I don't like is Collections.internalSetOf((E[]) new HashSet<>(coll).toArray()) but we need to have no nulls and it looks like it's the easiest way to achieve it