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 221878 - Performance problem in execution of HTML file
Summary: Performance problem in execution of HTML file
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 15:19 UTC by Jan Stola
Modified: 2012-11-13 02:43 UTC (History)
1 user (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 Jan Stola 2012-11-10 15:19:49 UTC
When an HTML file is executed in Chrome with NetBeans integration then a temporary page file:/C:/Users/jstola/AppData/Local/Temp/blank<numbers>.html is shown for more than 10 seconds (on my machine) before it is replaced by the correct URL.

The thread dump shows where the problem is:

"ExternalBrowserPlugin" java.lang.Thread.State: RUNNABLE
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
at java.io.File.getCanonicalPath(File.java:559)
at java.io.File.getCanonicalFile(File.java:583)
at org.openide.filesystems.FileUtil.normalizeFileOnWindows(FileUtil.java:1898)
at org.openide.filesystems.FileUtil.normalizeFileImpl(FileUtil.java:1789)
at org.openide.filesystems.FileUtil.normalizeFileCached(FileUtil.java:1770)
at org.openide.filesystems.FileUtil.normalizeFile(FileUtil.java:1752)
at org.netbeans.modules.web.common.api.ServerURLMapping.fromServer
   (ServerURLMapping.java:156)
at org.netbeans.modules.web.common.api.ServerURLMapping.fromServer
   (ServerURLMapping.java:132)
at org.netbeans.modules.html.navigator.HtmlNavigatorPanelUI.getInspectedFile
   (HtmlNavigatorPanelUI.java:277)
at org.netbeans.modules.html.navigator.HtmlNavigatorPanelUI.setPageModel
   (HtmlNavigatorPanelUI.java:222)
at org.netbeans.modules.html.navigator.HtmlNavigatorPanelUI.access$000
   (HtmlNavigatorPanelUI.java:117)
at org.netbeans.modules.html.navigator.HtmlNavigatorPanelUI$1.propertyChange
   (HtmlNavigatorPanelUI.java:156)
at java.beans.PropertyChangeSupport.firePropertyChange
   (PropertyChangeSupport.java:339)
at java.beans.PropertyChangeSupport.firePropertyChange
   (PropertyChangeSupport.java:276)
at org.netbeans.modules.web.inspect.PageInspectorImpl.firePropertyChange
   (PageInspectorImpl.java:329)
at org.netbeans.modules.web.inspect.PageInspectorImpl.inspectPage
   (PageInspectorImpl.java:180)
at o.n.m.extbrowser.plugins.ExternalBrowserPlugin$BrowserTabDescriptor.init
   (ExternalBrowserPlugin.java:715)
at o.n.m.extbrowser.plugins.ExternalBrowserPlugin$BrowserTabDescriptor
   .access$100(ExternalBrowserPlugin.java:605)
at o.n.m.extbrowser.plugins.ExternalBrowserPlugin$2.run
   (ExternalBrowserPlugin.java:143)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)

There even is a warning in the console saying:

WARNING [org.openide.filesystems.FileUtil]: FileUtil.normalizeFile(\\null\C:\Users\jstola\AppData\Local\Temp\blank<numbers>.html) took 11279 ms. Result is \\null\C:\Users\jstola\AppData\Local\Temp\blank<numbers>.html

Note the \\null at the begining.

The root of the problem seems to be in some suspicious magic in ServerURLMapping.fromServer():

serverURL = WebUtils.stringToUrl(WebUtils.urlToString(serverURL, true));

It replaces

"file:/C:/Users/jstola/AppData/Local/Temp/blank<numbers>.html"

by

"file://null/C:/Users/jstola/AppData/Local/Temp/blank<numbers>.html"
Comment 1 David Konecny 2012-11-12 01:12:00 UTC
4d6b7e56e9a1

FYI: this problem was introduced by my fix of issue 219339 on 2012-10-25 and is present in the Beta2.


(In reply to comment #0)
> The root of the problem seems to be in some suspicious magic in
> ServerURLMapping.fromServer():
> serverURL = WebUtils.stringToUrl(WebUtils.urlToString(serverURL, true));

There is a comment above that that line explaining why it is there:

  // #219339 - strip down query and/or fragment:
Comment 2 Quality Engineering 2012-11-13 02:43:03 UTC
Integrated into 'main-golden', will be available in build *201211130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4d6b7e56e9a1
User: David Konecny <dkonecny@netbeans.org>
Log: #221878 - Performance problem in execution of HTML file