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.
Summary: | [regression] background scanning stops in PHP project when different encoding is included | ||
---|---|---|---|
Product: | javascript | Reporter: | Masaki Katakai <masaki> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | junichi11, obrejla |
Priority: | P2 | ||
Version: | 7.3 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
project file
Snapshot taken during scan |
Reassigning, please evaluate. Thanks. Imho it will not be an issue of PHP...I think that we don't care of encoding during scan (I think that we don't anyhow block the scanning). Tomasi, can you look at it please? Thanks a lot! Created attachment 132135 [details]
Snapshot taken during scan
Sorry, it's a JavaScript issue (probably Nashorn issue). Reassigning. Right, the problem is a livelock in the jdk.nashorn.internal.parser.AbstractParser. The problem is really in Nashorn parser. It tries to recover from error after reading the chars that are not compatible with the project ending in this case and the recovery never finished. The fix has to be done on the Nashorn site. Still it's not fixed in Nashorn. I have decide to create a patch for our patched version. One possible fix is in jdk.nashorn.internal.parser.AbstractParser: @@ -173,8 +173,12 @@ // do this before the start is changed below if (last != EOL) { - finish = start + Token.descLength(lastToken); + int lenght = Token.descLength(lastToken); + if (lenght == 0) { + return EOF; } + finish = start + lenght; + } if (type == EOL) { line = Token.descLength(token); But for applying the patch, we need to upgrade our libs.nashorn to use newer version of nashorn build infrastructure. Fixed in web-main, through patching nashorn http://hg.netbeans.org/web-main/rev/99a38803bc05 Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/99a38803bc05 User: Petr Pisl <ppisl@netbeans.org> Log: #226874 - [regression] background scanning stops in PHP project when different encoding is included |
Created attachment 132044 [details] project file I got a report from community member in Japan. Background scanning always stops when PHP project is opened on NetBeans 7.3. It seems that it's regression. This does not happen on NetBeans 7.2. PHP project is: - project encoding is UTF-8 - there is one php file but contains different encoding "EUC-JP" I got a zip file from the report and I could reproduce it quickly on my environment. 1. Unzip PHP project zip file 2. Start NetBeans 7.3 and open it progress bar for background scanning is always showing 100%, but never finished 3. Start NetBeans 7.2 and open it it can be finished without any problem. Here is my env: Product Version: NetBeans IDE 7.3 (Build 201302132200) Java: 1.7.0_11; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21 System: SunOS version 5.11 running on x86; ISO646-US; en (nb) This case that including EUC encoding in UTF-8 project should not happen often, however, actually happened in user side. A user is using the project and some old files are included in it. It should not stop at scanning in any cases. This is a regression from 7.2 So please evaluate and fix it.