RFR: 8264326: Modernize javax.script.ScriptEngineManager and related classes' implementation [v2]

Attila Szegedi attila at openjdk.java.net
Sun Mar 28 13:38:51 UTC 2021


> I noticed that `javax.script.ScriptEngineManager` `getEngineByXxx` methods had a lot of code duplication among themselves, and even within each method. I refactored them into a modern unified implementation. While there I also took the opportunity to introduce `Objects.requireNonNull` in place of null checks followed by NPE throws, mark private fields final where possible, use lambdas for `doPrivileged` block, use `List.of` and `List.copyOf` where possible, and generally sanitize/deduplicate.

Attila Szegedi has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains 13 new commits since the last revision:

 - Tidy
 - require non null in SimpleBindings
 - Simplify SimpleScriptContext.scopes
 - Mark fields final where possible
 - Deduplicate registerEngineXxx methods
 - Misc tidying
 - Deduplicate exception reporting
 - Lambdify
 - Mark fields as final; eliminate now unnecessary init() method.
 - Deduplicate engine creation and setup code
 - ... and 3 more: https://git.openjdk.java.net/jdk/compare/f378f350...56d89eb2

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3229/files
  - new: https://git.openjdk.java.net/jdk/pull/3229/files/f378f350..56d89eb2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3229&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3229&range=00-01

  Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3229.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3229/head:pull/3229

PR: https://git.openjdk.java.net/jdk/pull/3229


More information about the core-libs-dev mailing list