This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 173008 - Don't load JavaFXPlatform when searching only for J2SE platform
Summary: Don't load JavaFXPlatform when searching only for J2SE platform
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Tomas Zezula
URL: http://wiki.netbeans.org/FitnessViaWh...
Keywords: PERFORMANCE, REGRESSION, TEST
Depends on:
Blocks:
 
Reported: 2009-09-24 13:08 UTC by Oleg Khokhlov
Modified: 2009-10-21 14:55 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktraces (25.02 KB, text/xml)
2009-09-24 13:17 UTC, Oleg Khokhlov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Khokhlov 2009-09-24 13:08:46 UTC
Performance test reports that the following classes loaded during startup:

>  org.netbeans.api.javafx.platform.JavaFXPlatform
>  org.netbeans.modules.javafx.platform.platformdefinition.DefaultPlatformImpl
>  org.netbeans.modules.javafx.platform.platformdefinition.JavaFXPlatformImpl
>  org.netbeans.modules.javafx.platform.platformdefinition.PlatformConvertor
>  org.netbeans.modules.javafx.platform.platformdefinition.PlatformConvertor$H
>  org.netbeans.modules.javafx.platform.platformdefinition.Util

Comment from jtulach: "P3 for java.j2seplatform module to not load JavaFXPlatform when searching only 
for J2SE platform. We will need Tomáš Zezula help to analyse what can be 
done. My raw guess is that replacing JavaPlatformProvider with @Registration 
could help. Probably nothing to be done for 6.8."

Build 20090922

test: ant in ide.kit/tests/whitelist
Comment 1 Oleg Khokhlov 2009-09-24 13:17:29 UTC
Created attachment 88283 [details]
stacktraces
Comment 2 Tomas Zezula 2009-09-24 13:38:10 UTC
I will take ac look at it.
Comment 3 Tomas Zezula 2009-10-08 10:51:08 UTC
I've fixed the JPM.getDefaultPlatform not to load the non needed platforms.
jet-main #ff6cdaaaed48
But the J2SEPlatform ModuleInstall needs to update platforms properties in the build.properties. It needs to list all j2se platforms (but it's impossible to 
distinguish them from jfx platforms). It will require incompatible SPI change. From my point of view it's a WONTFIX as the jfx platforms are created 
immediately by the similar code in javafx module.
But as far as I know Jarda is working on code allowing initialization in time when project is opened, this would be enough for J2SEPlatform ModuleInstall.
Reassigning to Jarda
Comment 4 Tomas Zezula 2009-10-08 10:54:07 UTC
BTW can anyone explain what does the PERFORMANCE, REGRESSION, TEST in context of this issue mean?
Comment 5 Tomas Pavek 2009-10-08 12:27:48 UTC
* PERFORMANCE - we watch the number of classes loaded during startup for performance reasons.
* REGRESSION - means that these classes were not loaded during startup before, they appeared there recently. We try to 
keep the number of loaded classes during startup not growing too much.
* TEST - the new classes were revealed by a test. You can read more about it on the page linked in the URL field.
Comment 6 Tomas Zezula 2009-10-08 12:44:07 UTC
PERFORMANCE - the classes are loaded by JXPlatform ModuleInstall
REGRESSION - the code is unchanged from 4.0
Comment 7 Jaroslav Tulach 2009-10-08 14:28:04 UTC
Tomáš and me identified that the latest possible moment for generating the user.build.properties file (and thus 
instantiating the platforms) is at the time Ant build is started. Tomáš will experiment with registering AntLogger and 
generating the file when the first build is about to start.

The JavaFXPlatform will probably still be loaded on start for other reasons - the issue shall be reassigned closer to 
such reason then.
Comment 8 Tomas Zezula 2009-10-09 16:39:07 UTC
I've rewritten the J2SEPlatformModule not to update the build.properties. The build.properties is updated when the Ant is started for the first time (using Ant 
logger). Seems to work fine, I will test it for a while and integrate.
Comment 9 Tomas Zezula 2009-10-13 16:43:23 UTC
Fixed in jet-main b994f731adf2
Comment 10 Quality Engineering 2009-10-14 10:54:40 UTC
Integrated into 'main-golden', will be available in build *200910140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ff6cdaaaed48
User: Tomas Zezula <tzezula@netbeans.org>
Log: #173008:Don't load JavaFXPlatform when searching only  for J2SE platform
Comment 11 Jesse Glick 2009-10-20 15:58:32 UTC
Looks good. BTW why does J2SEPlatformModule even still exist now? Seems to me that recoverDefaultPlatform could also be
run some other time, on demand if and when the list of platforms is requested.
Comment 12 Tomas Zezula 2009-10-20 16:15:44 UTC
OK, I will postpone the recoverDefaultPlatform.
Comment 13 Tomas Zezula 2009-10-21 14:55:19 UTC
I've filled enhancement 175111 to remove the J2SEPlatformModule class.
The restoreDefaultPlatform needs to be moved into the Java Platform module (JavaPlatformProvider).