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 120837 - Initial scan does not follow project encoding
Summary: Initial scan does not follow project encoding
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2007-11-01 16:14 UTC by lclll
Modified: 2007-11-14 23:20 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
code for "project windows error" (167.45 KB, application/octet-stream)
2007-11-03 07:03 UTC, lclll
Details
Binary patch. (5.46 KB, application/octet-stream)
2007-11-11 14:19 UTC, Jan Lahoda
Details
Patch proposed for release60. (2.55 KB, patch)
2007-11-12 13:14 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lclll 2007-11-01 16:14:40 UTC
I found when i open my project or i changed Project Configuration, the project windows will show some class is error,
but i sure that are right, when i open the class and close again, the project windows will not show error.

From 6.0 beta1 to build 200710310000 all have this this.
Comment 1 Milan Kubec 2007-11-02 12:23:29 UTC
Please evaluate, probably wrong error badging.
Comment 2 Jan Lahoda 2007-11-02 13:17:03 UTC
Sorry, but we will need more exact steps to reproduce. Also, I did some fixes in related areas yesterday, so feel free
to test newer build.
Comment 3 lclll 2007-11-03 06:55:06 UTC
I attached some code, maybe there can help you.
Because the code is for commerce, so i confuse it, but the grammar is still right, and there can build too.
You can import this project, and you will found some error tip in project window, if you open some "error" class and
close again, the error will disappear. If you want see it again, you can change the project configuration to "Debug",
they will show again.

Also, i tested it in build 200711021200, it is same.
Comment 4 lclll 2007-11-03 07:03:28 UTC
Created attachment 52437 [details]
code for "project windows error"
Comment 5 lclll 2007-11-06 11:18:29 UTC
NetBeans IDE 6.0 Build 200711050000 is also have this.
Please correct it.
Comment 6 lclll 2007-11-09 09:31:33 UTC
??????

6.0 Build 200711081200 is too !!!!!!!!!
Comment 7 Jan Lahoda 2007-11-09 09:45:48 UTC
Sorry, but I still cannot reproduce:
-I have downloaded the attached project and unpacked it
-opened it in the IDE - the platform was not found, so the project is marked with red badges - this is OK, IMO
-I set a platform to the project, and all the error badges went away
-no error badges appeared for me after configuration change
-I have restarted the IDE and tried to switch the configurations - sorry - still no error badges
Comment 8 Marian Mirilovic 2007-11-09 10:32:08 UTC
Honza, please look at this again. 
There is a MIDP project attached. Unfortunately I was not able to reproduce the problem even after changing Project
Configuration. 
Comment 9 Lukas Hasik 2007-11-09 11:01:55 UTC
I tried with mobility distribution Product Version: NetBeans IDE Dev (Build 200711070000). All classes in the project
seem fine without error badges. When I introduce a error into a class then the class node is marked with the error
badge. The error badge disappears when I fix the error in the class source code. 
Sometimes it takes a little bit of time before the badge is updated...
Comment 10 lclll 2007-11-09 14:25:43 UTC
I wrote every step that what i do today.

1. install vista
2. install j2se 6 update 3
3. install netbeans 6.0-200711081200 with "Base IDE, Java SE, Web && Java EE, Mobility" this four component
4. download the attached, and decompression it, now the project directory is
"D:\netbeans\workspace\J2me\CrazyTank_sc\CrazyTank_prototype"
5. use netbeans to open the project, ok, it's fine now
6. change the project configuration to "Debug", oh ye, it is show error badge in project window

PS, the error badge is have no relation with "time", it will be disappear only when i open it and close.
Comment 11 Jan Lahoda 2007-11-11 14:18:27 UTC
Reporter, I will add a patch, could you please test whether it helps? Place the attached jar into
${netbeans_install}/java1/modules/patches/org-netbeans-modules-java-source
(${netbeans_install}/java1/modules should already exist, patches/org-netbeans-modules-java-source need to be created)
and restart the IDE and try to reproduce the problem. The patch will not heal already broken caches, so please do it
with a clear userdir. Thanks.
Comment 12 Jan Lahoda 2007-11-11 14:19:14 UTC
Created attachment 52848 [details]
Binary patch.
Comment 13 lclll 2007-11-12 02:44:19 UTC
Cool, it works good this time.
Thanks for you patch.

But, i found another "issue", when i input some bad grammar in class, the error badge isn't immediate show on project
windows, it will show only when i save the class, maybe the "issue" is for design, but i think it is not good to user.
Comment 14 Jan Lahoda 2007-11-12 13:13:34 UTC
Thanks for the test. It seems that the problem is caused by incorrect use of encoding: the project uses UTF-8, but the
parser uses the default (system) encoding. I have put a provisional fix (that was used to produce the binary patch) to
the trunk - see log below. It is not a full patch, as the caches are not corrected when project encoding changes. If the
encoding changes and the caches need to be updated, please restart the IDE and change the project classpath - this
should force rebuild of caches. I have created issue #121727 for the fact that the caches do not update automatically.

I would like to ask for review for inclusion of the provisional fix into NB6.0. The patch should be low risk. I think
that "full" patch (which would listen on the encoding change) would be too risky for NB6.0.

Checking in FolderArchive.java;
/cvs/java/source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java,v  <--  FolderArchive.java
new revision: 1.8; previous revision: 1.7
done
Comment 15 Jan Lahoda 2007-11-12 13:14:19 UTC
Created attachment 52877 [details]
Patch proposed for release60.
Comment 16 Tomas Zezula 2007-11-12 13:18:07 UTC
The patch is OK, feel free to integrate.
Comment 17 Jiri Prox 2007-11-13 08:40:03 UTC
verified by QE, the patch can go to 6.0
Comment 18 Jan Lahoda 2007-11-13 08:42:27 UTC
Fixed merged into release60 branch:
Checking in src/org/netbeans/modules/java/source/parsing/FolderArchive.java;
/cvs/java/source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java,v  <--  FolderArchive.java
new revision: 1.7.4.1; previous revision: 1.7
done
Comment 19 Jiri Prox 2007-11-14 08:11:33 UTC
verified in RC1