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 152253 - Warning dialog should be opened just at trying to open the large file
Summary: Warning dialog should be opened just at trying to open the large file
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-04 01:21 UTC by Masaki Katakai
Modified: 2008-11-13 09:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
sample PHP project (115.87 KB, application/x-compressed)
2008-11-11 00:54 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2008-11-04 01:21:04 UTC
I was asked this question from project owner of nbopenlaszlosupport.dev.java.net.

When new project is created, warning dialog that 

 "The file xxxx seems to be too large (1 Mb) to safely open ...
 Opening the file could cause OutOfMemoryError, which
 would make the IDE unusable. Do you really want to open it?"

is invoked. Actually some JavaScript files in the project are large.
He wants to avoid the warning because users may not open
them because these files are used as just runtime library.
It seems that it's called at project scanning for task list at 6.5.

Is it possible to change the behavior that invoking the warning
just when users try to open it to NetBeans editor?
Comment 1 Jaroslav Tulach 2008-11-04 08:16:56 UTC
The dialog is shown only when someone opens the file.
Comment 2 Masaki Katakai 2008-11-11 00:52:57 UTC
Thank you Jaroslav for evaluation. Which build are you using? I'm trying 200811071401 trunk but it looks the warning is
invoked by just opening the project. I'll attach a sample project which contains a large JavaScript file. Could you
evaluate it and if there is a way to avoid such warning until opening the file, please let me know.
Comment 3 Masaki Katakai 2008-11-11 00:54:05 UTC
Created attachment 73605 [details]
sample PHP project
Comment 4 Jaroslav Tulach 2008-11-13 09:30:52 UTC
This is the stacktrace that leads to the document opening. Looks like the problem is in GSF:

org.openide.text.CloneableEditorSupport.prepareDocument(CloneableEditorSupport.java:582)
org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:792)
org.openide.text.CloneableEditorSupport.openDocumentCheckIOE(CloneableEditorSupport.java:774)
org.openide.text.CloneableEditorSupport.openDocument(CloneableEditorSupport.java:759)
org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:402)
org.netbeans.modules.gsf.spi.GsfUtilities.getDocument(GsfUtilities.java:203)
org.netbeans.napi.gsfret.source.ParserTaskImpl.parse(ParserTaskImpl.java:133)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater.batchCompile(RepositoryUpdater.java:2028)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.updateFolder(RepositoryUpdater.java:1404)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.scanRoots(RepositoryUpdater.java:1129)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.access$1900(RepositoryUpdater.java:651)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker$1.run(RepositoryUpdater.java:789)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker$1.run(RepositoryUpdater.java:676)
org.netbeans.modules.gsfret.source.usages.ClassIndexManager.writeLock(ClassIndexManager.java:107)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.run(RepositoryUpdater.java:676)
org.netbeans.modules.gsfret.source.usages.RepositoryUpdater$CompileWorker.run(RepositoryUpdater.java:651)
org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1347)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
java.lang.Thread.run(Thread.java:619)