-
Notifications
You must be signed in to change notification settings - Fork 221
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
NPE when URL value tag is used without java.net.* import #54
Comments
Original comment by Joeri Sykora (Bitbucket: tiainen, GitHub: tiainen): The thing is that loading the FXML file that is attached here, with FXMLLoader throws the following exception This is issue has a valid point though, namely the NullPointerException that is being thrown in SceneBuilder. The reason it doesn't fail with the same So, the thing I wanted to discuss is, what should SceneBuilder actually do:
The reason I wanted to discuss this is, is that we need to be a bit careful about just altering documents when loading them. |
Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause): Yeah that is a good point Joeri. The problem for me was, where the right point is to handle this npe, so that the user doesn't recognize it and still can use the SB as intended. So the only way was for me to change the fxml to a valid document. Because the LoadException with the invalid url is not thrown at instantiating the SB, so how could the user be informed that its fxml is invalid on startup? So if the FXMLLoader, that already does some sort of parsing the document, doesn't find all mistakes, should there be a seperate parsing in the SB itself? |
Original comment by Joeri Sykora (Bitbucket: tiainen, GitHub: tiainen): I suggest that instead of changing the actual contents of the FXML file, that we fix this issue by showing an nice informational dialog to the user to notify that the FXML file that is being opened is invalid. We can probably first try to load the FXML file with an FXMLLoader that doesn't have static loading enabled to verify that it is a valid file, or perhaps there's another way to detect that loading the FXML fails. We'll close the associated PR (pull request #31) now. |
Issue #131: Fix to add the required imports when using GlueElements Approved-by: gerardo balderas <[email protected]> Approved-by: Joeri Sykora <[email protected]>
@Oliver-Loeffler was this fixed in #403 ? If not, do we have an FXML that can reproduce this? |
Yes, #403 avoids this issue, SB remains usable and operational at attempts to load corrupted FXMLs loaded.
The broken FXML is not loaded at this moment, instead an error message occurs.
Loading of FXML with incomplete or unresolvable imports is implemented with PR #576 where PR #577 presents a list of unresolvable imports to the user including a proposal how to fix this.
Anyway, I'll try to figure out a FXML to reproduce the above description.
|
I really like the approach to first issue a notification. This means we will safely detect the issue. At the time when this works, we could think about implementing a quick fix option. Until then, I'll see that I can prepare a suitable FXML to reproduce the error. |
Originally reported by: Andre Krause (Bitbucket: akrause, GitHub: akrause)
If a tag is used within the fxml without importing the java.net.* package, a NPE is thrown if you want to open the Properties tab on the right side bar. The SB is not usable anymore after this exception.
The following NPE is thrown:
I tested it with the attached fxml.
From Saxonia Systems.
The text was updated successfully, but these errors were encountered: