Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make implementation of java.util.Properties based on j.u.c.ConcurrentHashMap #3580

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WojciechMazur
Copy link
Contributor

Make implementation of java.util.Properties based on j.u.c.ConcurrentHashMap instead of Hashtable.
When refering to methods of j.u.Properties from within it's subclass when using JDK 9 or higher the linker complained about missing methods. This suggests that these methods are overriden in the JDK and are missing in our implementation of j.u.Properties
We take the oportunity here to remove dependency of Scala stdlib in j.u.Properties
Override the java.util.Properties methods to allow for their static usage in subclasses of j.u.Properties

…current.ConcurrentHashMap` instead of hashtable. Override the `java.util.Properties` methods to allow for their static usage in subclasses of `j.u.Properties`
@WojciechMazur WojciechMazur marked this pull request as ready for review October 22, 2023 14:33
@ekrich
Copy link
Member

ekrich commented Oct 22, 2023

Looking at the code makes me think we should fix the ju.Hashtable to not use Scala mutable.HashMap like they did in Scala.js. I don't think it is a good idea to pull concurrent sub package into the mix and follow Java as much as possible. Delegating ju.Hashtable to ju.HashMap like they did in Scala.js adding synchronized as appropriate should be fine. ScalaOps has been updated so using that should be fine rather than using the function sub package for the forEach stuff.

Honestly, I am not seeing all the additional missing methods unless they are in ju.Dictionary or other super classes.

@ekrich
Copy link
Member

ekrich commented Oct 23, 2023

Just as an FYI, I don't think the Map side of Java collections got updated and synced where possible with Scala.js as the Collection side did. I did notice that the Map interface does introduce the Java functional stuff as of Java 8 and are in https://github.com/scala-js/scala-js/blob/main/javalib/src/main/scala/java/util/Map.scala Of course Scala.js doesn't deal with ConcurrentModificationException

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.

None yet

2 participants