Skip to content

Commit 449d8e3

Browse files
authored
refactor: Remove outdated comments, clean up code (gluonhq#613)
1 parent b878844 commit 449d8e3

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java

+6-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022, Gluon and/or its affiliates.
2+
* Copyright (c) 2016, 2023, Gluon and/or its affiliates.
33
* Copyright (c) 2012, 2014, Oracle and/or its affiliates.
44
* All rights reserved. Use is subject to license terms.
55
*
@@ -373,8 +373,7 @@ public void handleLaunch(List<String> files) {
373373
setApplicationUncaughtExceptionHandler();
374374

375375
startInBackground("Set up Scene Builder", () -> {
376-
backgroundStartPhase0();
377-
backgroundStartPhase1();
376+
backgroundStart();
378377
setUpUserLibrary(showWelcomeDialog);
379378
createEmptyDocumentWindow();
380379
});
@@ -843,34 +842,13 @@ private void performUseToolTheme(ToolTheme toolTheme) {
843842
private String getToolStylesheet() {
844843
return ResourceUtils.getToolStylesheet(toolTheme);
845844
}
846-
847-
/*
848-
* Background startup
849-
*
850-
* To speed SB startup, we create two threads which anticipate some
851-
* initialization tasks and offload the JFX thread:
852-
* - 'Phase 0' thread executes tasks that do not require JFX initialization
853-
* - 'Phase 1' thread executes tasks that requires JFX initialization
854-
*
855-
* Tasks executed here must be carefully chosen:
856-
* 1) they must be thread-safe
857-
* 2) they should be order-safe : whether they are executed in background
858-
* or by the JFX thread should make no difference.
859-
*
860-
* Currently we simply anticipate creation of big singleton instances
861-
* (like Metadata, Preferences...)
862-
*/
863-
864-
private void backgroundStartPhase0() {
865-
assert Platform.isFxApplicationThread() == false; // Warning
866845

846+
/**
847+
* This runs in a background thread to speed up SB startup.
848+
*/
849+
private void backgroundStart() {
867850
PreferencesController.getSingleton();
868851
Metadata.getMetadata();
869-
}
870-
871-
private void backgroundStartPhase1() {
872-
assert Platform.isFxApplicationThread() == false; // Warning
873-
874852
BuiltinLibrary.getLibrary();
875853
if (EditorPlatform.IS_MAC) {
876854
MenuBarController.getSystemMenuBarController();

0 commit comments

Comments
 (0)