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
8238080: FXMLLoader: if script engines implement javax.script.Compilable compile scripts #192
8238080: FXMLLoader: if script engines implement javax.script.Compilable compile scripts #192
Conversation
…9: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
…59: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
…mpilable compile scripts
…ce error can be resolved (why would jcheck not do it automagically as well as expanding tabs?)
…scripts; PI data can be truei (default) or false
…ther ease spotting the location of script exceptions.
👋 Welcome back ronyfla! A progress list of the required criteria for merging this PR into |
============================ test units for: compile PI+fallback tests/system/src/testscriptapp2/java/mymod/myapp2/FXMLScriptDeployment2Compile_Off.java tests/system/src/testscriptapp2/resources/mymod/myapp2/demo_02_off.fxml tests/system/src/testscriptapp2/java/mymod/myapp2/FXMLScriptDeployment2Compile_Off_On.java tests/system/src/testscriptapp2/resources/mymod/myapp2/demo_02_off_on.fxml tests/system/src/testscriptapp2/java/mymod/myapp2/FXMLScriptDeployment2Compile_On.java tests/system/src/testscriptapp2/resources/mymod/myapp2/demo_02_on.fxml tests/system/src/testscriptapp2/java/mymod/myapp2/FXMLScriptDeployment2Compile_On_Off.java tests/system/src/testscriptapp2/resources/mymod/myapp2/demo_02_on_off.fxml tests/system/src/testscriptapp2/java/mymod/myapp2/FXMLScriptDeployment2Compile_Fail_Compilation.java tests/system/src/testscriptapp2/resources/mymod/myapp2/demo_03_fail_compile.fxml |
/reviewers 2 |
/csr |
I think the approach proposed in this PR is the best solution for this enhancement. Go ahead and remove the The interface and behavior change will need to be specified in the API docs. This can be done by modifying the Introduction to FXML document. I recommend documenting the new behavior and As discussed on the mailing list, this will need a CSR, which should include the changes to the docs. |
@kevinrushforth |
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the implementation, and I think this is close to being ready, but I have a couple questions. I also still need to review the test and run it, but that will be later.
I also noticed a few places with minor formatting issues -- mostly missing spaces and extra blank lines added to some files, but also else {
when it should be } else {
. I'll wait until the substantive part of the review is done to note them all (so if you can fix them ahead of time, that would be good).
…correct formatting).
@CSR-update: looks good! |
I have moved the CSR to the "proposed" state in preparation for formal review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API changes look good. Also, the CSR has been approved.
The code changes in FXMLLoader look good.
The newly added tests pass with your fix.
I also verified that at least some of the newly added tests fail without fix (good)
Most of the rest of the comments are on formatting and code style, so this looks about ready to go in.
modules/javafx.fxml/src/main/docs/javafx/fxml/doc-files/introduction_to_fxml.html
Outdated
Show resolved
Hide resolved
* Modular test application for testing FXML. | ||
* This is launched by ModuleLauncherTest. | ||
*/ | ||
public class FXMLScriptDeployment2Compile_Off extends Application { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the comments I made in the previous test class apply in this and the other tests, too.
tests/system/src/testscriptapp2/java/mymod/pseudoScriptEngineCompilable/InvocationInfos.java
Outdated
Show resolved
Hide resolved
...stem/src/testscriptapp2/java/mymod/pseudoScriptEngineCompilable/RgfPseudoCompiledScript.java
Outdated
Show resolved
Hide resolved
...stem/src/testscriptapp2/java/mymod/pseudoScriptEngineCompilable/RgfPseudoCompiledScript.java
Outdated
Show resolved
Hide resolved
.../testscriptapp2/java/mymod/pseudoScriptEngineCompilable/RgfPseudoScriptEngineCompilable.java
Outdated
Show resolved
Hide resolved
Kevin, thank you for your feedback and sponsorship! Hope that I have applied the changes to all affected files appropriately. (It is interesting for me that despite trying to adhere to the OpenJDK formatting, sometimes my own - decadelong trained :) - formattings slip thru without noticing it.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got most of them, but there are still a few code style issues. I marked the ones as resolved that were, so you should be able to look at the above comments for those that are stil ourstanding.
One of the comments is more than just code style. I think the following, which appears in a few test files (I noted it in FXMLScriptDeployment2Compile_Fail_Compilation.java
), should use an int
variable rather than an Integer
in the for loop:
for (Integer invocation = 1; invocation <= invocationList.size(); invocation++) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
It seems that there is a need of 2 reviewers though only one is defined (when clicking "Show all reviewers"). Is there anything I can/need to do to advance the state? |
@ronyfla This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type
Since the source branch of this PR was last updated there have been 15 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge As you are not a known OpenJDK Author, an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth, @aghaisas) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@ronyfla An error occurred during final integration jcheck. No push attempt will be made. |
@kevinrushforth, I see this is not integrated yet due to jcheck failure. No details about failure can be seen (At least I am unable to see any reported failures). Can you please have a look? |
Mailing list message from Rony G Flatscher on openjfx-dev: Hi Ajit, Kevin looked into it already yesterday. There was some problem at github at the time I submitted the /integrate comment, which merely needs to be reissued by me. Having been on the road I was not able to do it yesterday, will be first thing after arriving at the office today. Best regards ?-rony Rony G. Flatscher (mobil/e) |
/integrate |
/sponsor |
@kevinrushforth @ronyfla The following commits have been pushed to master since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit 45c9854. |
This PR adds a "compile" process instruction to FXML files with the optional PI data "true" (default) and "false". The PI data is turned into a boolean value using "Boolean.parseBoolean(String)".
This makes it possible to inject the compile PI everywhere in a FXML file and turn on and off compilation of scripts if the scripting engine implements the javax.script.Compilable interface.
The PR adds the ability for a fallback in case compilation of scripts fails, in which case a warning gets issued about this fact and evaluation of the script will be done without compilation. Because of the fallback scripts get compiled with this version by default.
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/jfx pull/192/head:pull/192
$ git checkout pull/192
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jfx pull/192/head:pull/192
$ git checkout pull/192