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 196219 - allstubs.zip files have wrong encoding and breaks automatic tests
Summary: allstubs.zip files have wrong encoding and breaks automatic tests
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Solaris
: P1 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 195765 196252 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-03 10:17 UTC by soldatov
Modified: 2011-03-05 05:44 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2011-03-03 10:17:20 UTC
A lot of exceptions in messages.log breaks automatic tests

Standard test result:

Unexpected exceptions found in message.log ([at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)\nCaused: java.lang.Exception\n[catch] at org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:898), at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)\nCaused: java.lang.Exception\n[catch] at org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:898), at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 1 Vladimir Voskresensky 2011-03-03 10:18:11 UTC
I will investigate
Comment 2 Vladimir Voskresensky 2011-03-03 11:33:56 UTC
INFO [org.openide.text.CloneableEditorSupport]: Outer callstack
org.openide.text.DataEditorSupport$1: The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
        at org.openide.text.DataEditorSupport.loadFromStreamToKit(DataEditorSupport.java:434)
        at org.openide.text.CloneableEditorSupport.loadDocument(CloneableEditorSupport.java:2156)
        at org.openide.text.CloneableEditorSupport.access$2800(CloneableEditorSupport.java:133)
        at org.openide.text.CloneableEditorSupport$Listener.run(CloneableEditorSupport.java:2986)
Caused: org.openide.text.CloneableEditorSupport$DelegateIOExc: The file cannot be safely opened with encoding UTF-8. Do you want to continue opening it?
        at org.openide.text.CloneableEditorSupport$Listener.run(CloneableEditorSupport.java:2989)
        at org.openide.text.CloneableEditorSupport$3.doRun(CloneableEditorSupport.java:710)
        at org.openide.text.CloneableEditorSupport$3.run(CloneableEditorSupport.java:677)
        at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:314)
        at org.openide.text.NbDocument.runAtomic(NbDocument.java:422)
        at org.openide.text.CloneableEditorSupport$3.doRun(CloneableEditorSupport.java:687)
        at org.openide.text.CloneableEditorSupport$3.run(CloneableEditorSupport.java:677)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Caused: java.lang.Exception
[catch] at org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:898)
        at org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:880)
        at org.openide.text.CloneableEditorSupport.openDocumentCheckIOE(CloneableEditorSupport.java:860)
        at org.openide.text.CloneableEditorSupport.openDocument(CloneableEditorSupport.java:842)
        at org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:553)
        at org.netbeans.modules.parsing.api.Source.getDocument(Source.java:253)
        at org.netbeans.modules.csl.core.TLIndexerFactory$TLIndexer.index(TLIndexerFactory.java:253)
        at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor$3.run(Indexable.java:186)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runIndexer(RepositoryUpdater.java:256)
        at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:184)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$3.run(RepositoryUpdater.java:2064)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:138)
        at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:201)
        at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:198)
        at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:168)
        at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:356)
        at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:66)
        at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:198)
        at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.indexEmbedding(RepositoryUpdater.java:2032)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doIndex(RepositoryUpdater.java:1878)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.access$1400(RepositoryUpdater.java:1563)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$2.run(RepositoryUpdater.java:1744)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$2.run(RepositoryUpdater.java:1742)
        at org.netbeans.modules.parsing.impl.indexing.errors.TaskCache.refreshTransaction(TaskCache.java:460)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:1742)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSource(RepositoryUpdater.java:3435)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSources(RepositoryUpdater.java:3336)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:3079)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:2159)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:3830)
        at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:3769)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:610)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Comment 3 Vladimir Voskresensky 2011-03-03 11:34:38 UTC
*** Bug 195765 has been marked as a duplicate of this bug. ***
Comment 4 Vladimir Voskresensky 2011-03-03 12:21:53 UTC
investigation shows that this is caused by content of js files inside 
netbeans/ide/jsstubs/allstubs.zip
i.e. not in UTF-8 the file stub_dom_Stylesheet.js 
have a look at line 7 col 139 and a lot lines below as well

Who is responsible for creating this archive and why encoding query returns UTF-8 for them?
This file is in ISO-8859-15

Other known problematics files from this arhive (looks like all in ISO-8859-15)
stub_dom_Table.js
stub_dom_Screen.js
stub_core_DecodeURIComponent.js
stub_core_Function.js
stub_core_Number.js
stub_core_EncodeURI.js
stub_core_ParseInt.js
stub_core_String.js
stub_core_JavaObject.js
stub_dom2_Element.js
stub_core_Eval.js
stub_core_ParseFloat.js
stub_core_Error.js
stub_core_IsFinite.js
stub_core_DecodeURI.js
stub_core_Boolean.js
stub_core_EncodeURIComponent.js
stub_core_Date.js
stub_events_EventTarget.js
stub_core_IsNaN.js
stub_dom_TableRow.js
Comment 5 Vladimir Voskresensky 2011-03-03 12:24:12 UTC
could someone responsible/familiar with netbeans/ide/jsstubs/allstubs.zip fix it, please.
Comment 6 Vladimir Voskresensky 2011-03-03 19:21:34 UTC
*** Bug 196252 has been marked as a duplicate of this bug. ***
Comment 7 Vladimir Voskresensky 2011-03-03 19:23:59 UTC
Please, fix it asap. It blocks automatic testing and looks like a recent regression
Comment 8 Jan Lahoda 2011-03-03 20:13:27 UTC
UTF-8 is most likely your default encoding, used when no FileEncodingQueryImplementation has a better value. After:
http://hg.netbeans.org/main-silver?cmd=changeset;node=7b7239b0706b
document should not be opened anymore during scanning (AFAIK), and this problem should disappear, IMO.
Comment 9 Vladimir Voskresensky 2011-03-03 20:26:24 UTC
that's great if problem would disappear tomorrow, but may be it's worth to make all files inside allstubs.zip to be in one encoding (i.e. UTF-8)
Comment 10 Petr Pisl 2011-03-04 08:57:10 UTC
The files are there without a change from May 2008, when were committed by Tor. From this time no one change them. I'm going to fix the encoding.
Comment 11 Petr Pisl 2011-03-04 10:08:10 UTC
All files should have now UTF-8 encoding.
Comment 12 Jesse Glick 2011-03-04 14:22:35 UTC
No changeset number?

Rather than changing the actual files, shouldn't there be a FileEncodingQueryImplementation somewhere that specifies what their encoding should be? Otherwise we will just see a repeat of this bug by people whose default system encoding is _not_ UTF-8.
Comment 13 Petr Pisl 2011-03-04 16:57:13 UTC
There were probably 100 hundred files in UTF-8 and 21 files was not possible to open with UTF-8 encoding. I think that these file was generated with a bug that caused that the files looks like in different encoding than UTF-8, because contain a character that is not UTF-8.

The changeset is here: http://hg.netbeans.org/web-main/rev/c1e5d4b3d276 .
Comment 14 Quality Engineering 2011-03-05 05:44:50 UTC
Integrated into 'main-golden', will be available in build *201103050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c1e5d4b3d276
User: Petr Pisl <ppisl@netbeans.org>
Log: #196219 - allstubs.zip files have wrong encoding and breaks automatic tests