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

Java Modules default to stdlib namespace #111

Open
moehajj opened this issue May 5, 2021 · 0 comments
Open

Java Modules default to stdlib namespace #111

moehajj opened this issue May 5, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@moehajj
Copy link
Contributor

moehajj commented May 5, 2021

Problem or feature statement

Currently the LarkyEvaluator loads Java modules that are hardcoded in the ModuleSupplier without checking / forcing the intended namespace. It does, however, enforce that a VALID namespace is given. This may cause breaking changes in the future.

For example,
The following are currently valid:

load("@stdlib//re2j", "re2j") # expected (intended namespace given)
load("@vendor//re2j", "re2j") # unexpected (existing, yet unintended namespace given)

The following are currently invalid:

load("re2j", "re2j") # expected (namespace not given)    
load("@bla//re2j", "re2j") # expected (namespace does not exist)

Advised solution

Add namespace bins and getModules(namespace) capability to ModuleSupplier.

Testing scenarios

Only the following intended import should valid:

load("@stdlib//re2j", "re2j") # expected (intended namespace given)

The following should be invalid:

load("re2j", "re2j") # expected (namespace not given)    
load("@bla//re2j", "re2j") # expected (namespace does not exist)
load("@vendor//re2j", "re2j") # expected (existing, yet unintended namespace given
@mahmoudimus mahmoudimus added the bug Something isn't working label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants