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 70941 - [50cat] On many occasions, the whole file becomes a guarded block.
Summary: [50cat] On many occasions, the whole file becomes a guarded block.
Status: RESOLVED WORKSFORME
Alias: None
Product: javame
Classification: Unclassified
Component: Visual Designer (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: David Kaspar
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2006-01-03 12:45 UTC by ieising
Modified: 2007-01-03 10:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The screenshots that go with this issue. (307.85 KB, application/x-compressed)
2006-01-07 20:31 UTC, ieising
Details
eising screenshot 1 (166.42 KB, image/jpeg)
2006-01-09 08:49 UTC, Lukas Hasik
Details
eising screenshot 2 (128.14 KB, image/jpeg)
2006-01-09 08:51 UTC, Lukas Hasik
Details
eising screenshot 3 (162.84 KB, image/jpeg)
2006-01-09 08:52 UTC, Lukas Hasik
Details
Editor Dumper module (4.97 KB, application/octet-stream)
2006-01-09 11:23 UTC, David Kaspar
Details
This is the MIDlet that has the problems (42.75 KB, text/plain)
2006-01-09 21:34 UTC, ieising
Details
This is the corresponding designer file (17.87 KB, text/xml)
2006-01-09 21:35 UTC, ieising
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ieising 2006-01-03 12:45:06 UTC
[ JDK VERSION : 1.6 ]

Hi,

It happens quite often that when I edit a VD-managed file from the code-editor. Then switch to the flow-designer or the form-designer and then back to the code-editor, the whole file is one big guarded block. I can't edit anything anymore but through the Form and Flow designers.

The resolution is to close the file and open it again, than it all seems to work.
I haven't been able to find the recipe to reproduce the problem, but it happens in about 80% of the times I do a lot of editing in a VD managed file.

Iwan
Comment 1 Lukas Hasik 2006-01-03 13:55:01 UTC
I'm not able to reproduce.

Iwan, could you please try these steps when it happens next time:
1, backup the affected file on disc
1.5 make a screenshot and attach it here
2, save the affected file
3, close the file
3.5 compare the saved and backup file - if they are different attach them here
or at least attach diff
4, reopen the file in IDE

thanks for report
Comment 2 Lukas Hasik 2006-01-06 10:16:06 UTC
decreasing priority to P3. This is random issue and seems that it can be even
editor issue.
More informations needed or reproducible testcase - reassigning
Comment 3 ieising 2006-01-07 20:28:32 UTC
Okay, I followed the provided steps right when I noticed the erroneous guarding
blocks. The file hadn't changed, so I couldn't safe it, and so there are no
differences. But here're some screenshots.
Comment 4 ieising 2006-01-07 20:31:13 UTC
Created attachment 28274 [details]
The screenshots that go with this issue.
Comment 5 Lukas Hasik 2006-01-09 08:49:06 UTC
Created attachment 28284 [details]
eising screenshot 1
Comment 6 Lukas Hasik 2006-01-09 08:51:53 UTC
Created attachment 28285 [details]
eising screenshot 2
Comment 7 Lukas Hasik 2006-01-09 08:52:16 UTC
Created attachment 28286 [details]
eising screenshot 3
Comment 8 Lukas Hasik 2006-01-09 09:05:33 UTC
I re-attachd iwan's pictures again. They were in one big zip/doc file. It was
too complicated download, unzip, open in OpenOffice and look at it. 

David, look at it please. I would like to know if it is issue of mobility pack
or editor or cvs etc. thanks
Note that the jdk is 6
Comment 9 ieising 2006-01-09 10:28:22 UTC
Over the weekend I tried with JDK 1.5_04 with the same results. I noticed that
quite often when NB is started and the MIDlet is opened in the editor (source
editor) but not the current tab, the code gets guarded when I make the file the
current tab.

Iwan
Comment 10 David Kaspar 2006-01-09 11:22:13 UTC
Hi Iwan,

Does this bug happening when you are switching to the Source tab for the first time?

I see that you are using preprocessor directives in the Designer file. Could you
try to reproduce this problem on a file without these directives?

I have attached a small module for dumping the internal document. I would like
find out whether the guarded-blocks markers are broken or not. Please, unzip the
file into NetBeansInstallDir/extra directory. When a problem happens again,
select an appropriate file in the Projects window and invoke "Main Menu | Tools
| Dump Editor Data" action. It writes debug messages into your messages.log
file. Could you send me that file or its latest part?

Also when the problem happens, could you try to do a small change in the
Flow/Screen Design, switch back to Source tab and save/dump the editor (of
course, backup your files on HDD). Check whether the newly-saved file is
corrupted when you open it again or not.

I am starting to think that the problem is a race-condition while a document is
loading into the memory and javaeditor creates guarded-blocks for it.

Thanks,
  David
Comment 11 David Kaspar 2006-01-09 11:23:09 UTC
Created attachment 28311 [details]
Editor Dumper module
Comment 12 ieising 2006-01-09 21:07:32 UTC
Hi David,

I'm not aware of any directives in the designer file, I didn't put them there. I
did create the directory <NETBEANS>/extra and unzipped your module into that.
Once I come across the problem again, I'll do as you asked. No problem. It will
be with the project I'm working on though, so if that means that its a design
file with directives, than I'm sorry, but at the moment I'm a bit tight in my
time due to some other projects.

Btw, it doesn't only happen the first time I switch to the source tab, sometimes
it just happens without any clear reason.

Iwan
Comment 13 ieising 2006-01-09 21:14:41 UTC
The new module doesn't seem to have installed correctly, maybe I did something
wrong?

Iwan
Comment 14 ieising 2006-01-09 21:34:56 UTC
Created attachment 28323 [details]
This is the MIDlet that has the problems
Comment 15 ieising 2006-01-09 21:35:29 UTC
Created attachment 28324 [details]
This is the corresponding designer file
Comment 16 ieising 2006-01-09 21:36:57 UTC
I just attached my sources so you can see that there's nothing weird in them.
With the 20060105 it happens less frequent, only once tonight. Closing the file
and opening it again solved the problem.

Your race-condition idea might be on the spot, at least sounds plausible.

Iwan
Comment 17 David Kaspar 2006-01-10 13:49:09 UTC
HI Iwan,

I saw the proprocessor directive at pic2.jpg screenshot.

Regarding the dump module: It should be working. Lukasi, could you try it. Maybe
I did compiled it again the 5.1 and it is not working in 5.0 because of
dependencies.

It is bad that it happens not only for the first time. Therefore the bug will be
somewhere else and I even do not know where.

Anyway let's dump the editor data first and then probably we would have to be
adding additional messages until we find it. Hope the bug is not in
Java-guarded-blocks implementation because it is not easy to trace it.
Comment 18 Lukas Hasik 2006-01-10 15:58:59 UTC
I unzipped the module to 'extra' directory in nb_instal_dir. When I restarted
NetBeans then the action "Tools | Dump Editor Data" is there and works when
there's opened a mvd file in editor.
There appeared something like bellow in <userdir>/var/log/messages.log

========== EDITOR TEXT DUMP END ==========
SECTION: MVDFields - class org.netbeans.modules.java.JavaEditor$SimpleSection
TEXT:     private Form helloForm;                     
    private StringItem helloStringItem;
    private Command exitCommand;                   

BEGIN: 351
    private Form helloForm;                     
    private StringItem helloStringItem;
    private
END: 492

Comment 19 Lukas Hasik 2006-01-10 16:07:08 UTC
there was issue 66744 fixed on Thursday. It is about similar problem in j2se
form editor. They verified that it shouldn't happen in build 200601052030... but
it happend. It might mean 1, it is mobility pack problem 2,their fix wasn't complex

Unfortunatelly, I'm still unable to reproduce
Comment 20 ieising 2006-01-10 19:06:15 UTC
Sorry, I looked at the Tools menu when rightclicking on the file, through the
menu it is there, next time it happens, I'll send the log.

I'm pretty sure that it happened on the 200601052030 build yesterday, but I'll
keep my eyes open, I just reinstalled it and deleted all other netbeans dirs and
userdirs.

Iwan
Comment 21 ieising 2006-01-16 13:41:50 UTC
This hasn't happened for me ever since I installed RC1. Although due to some
other project I had to work on (in WSAD) I haven't spend real much time with it.
I'll keep my eye open though.

Iwan
Comment 22 Lukas Hasik 2006-01-16 14:23:41 UTC
this is good news
Comment 23 Lukas Hasik 2006-06-23 14:42:54 UTC
moving to mobility component
Comment 24 Lukas Hasik 2006-07-20 13:43:57 UTC
Iwan, have it happend to you in last months? Otherwise I would close this bug. 
Comment 25 ieising 2006-07-20 21:41:27 UTC
As a matter of fact, since working with beta 1 of 5.5 it hasn't happened anymore.
Comment 26 Lukas Hasik 2006-07-21 09:19:41 UTC
thanks, Iwan.

I'm closing as works for me now. Feel free to reopen when it appears again