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 12994 - Classes not loaded immediately after compilation using TopComponent.currentClassLoader() in multi-stage compiler
Summary: Classes not loaded immediately after compilation using TopComponent.currentCl...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-06-19 16:34 UTC by richard.everhart
Modified: 2008-12-22 23:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test module, readme and sample file for issue 12994 (33.20 KB, application/x-zip)
2001-07-20 20:30 UTC, richard.everhart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description richard.everhart 2001-06-19 16:34:41 UTC
Using a module that has a multi-stage compiler and an Executor, when executing a
file of the type associated with the module, the class file is reloaded by IDE
only every other time the file is executed.  

I've created a test module that illustrates this behavior but I originally
discovered it in the module I was working on; however, in the latter module
classes were never reloaded with calls to TopManager.currentClassLoader().

Steps:
1) Install such a module (soon to be posted).
2) Create an associated file (also soon to be posted).
3) Right-click on the file and choose TextExecutorType
4) The final .class file will be created and output from executing the class
will be displayed.
5) Open an editor (there's no editor for the file type in the module) and alter
the file in some way.
6) Repeat step 3
7) The output will be the same as before.
8) Repeat step 3
9a) The output will be correct 
   * or *
9b) The it will seem that the compilation stage is practically skipped and the
file is executed, showing no change in the output (This may also occur at step
7).
Comment 1 richard.everhart 2001-06-19 16:47:44 UTC
Created attachment 1640 [details]
Test module, readme and sample file for issue 12994
Comment 2 Jan Zajicek 2001-06-21 07:30:22 UTC
Confirmed. Yarda, what do you think about this?
Comment 3 Jaroslav Tulach 2001-06-26 08:14:32 UTC
Richard, I guess that if you changed line 29 of TestExecutor to new
NbClassLoader (); the reload started to work correctly?

I have noticed that you compile to different directory than the source files are
- StageTwoCompilerGroup.outputDir, is it true?

If so, than the code that could interest you is in ExternalCompilerGroup.start
() - lines 246 - 251 (// refresh folders)

The problem is likely that the refresh is done on the folders with source files
and not with the .class files. 

If you can override start () in your StageTwoCompilerGroup and call refresh on
all folders where you created a new .class file everything should be ok.

Please try this, reopen the bug and we can then try to work on some solution to
be added to APIs. 

Comment 4 richard.everhart 2001-06-26 14:06:40 UTC
Yarda,

Okay, I'll look into it and let you know.

Rich
Comment 5 Jaroslav Tulach 2002-02-15 14:01:05 UTC
Reopen to close.
Comment 6 Jaroslav Tulach 2002-02-15 14:02:14 UTC
Closing as fixed. No addition info sent.
Comment 7 pzajac 2002-10-21 14:52:10 UTC
closed