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.
Build: NetBeans IDE Dev (Build 20120118-ab16ccd545a5) VM: OpenJDK 64-Bit Server VM, 20.0-b11, OpenJDK Runtime Environment, 1.6.0_22-b22 OS: Linux User Comments: cyhelsky: refactoring - encapsulate fields Stacktrace: java.lang.IllegalStateException: getInputStream invoked in AWT at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:219) at org.netbeans.modules.j2ee.dd.impl.common.DDUtils.createWebApp(DDUtils.java:156) at org.netbeans.modules.j2ee.dd.api.web.DDProvider.getDDRoot(DDProvider.java:134) at org.netbeans.modules.web.refactoring.WebRefactoringFactory.getWebApp(WebRefactoringFactory.java:180) at org.netbeans.modules.web.refactoring.WebRefactoringFactory.createInstance(WebRefactoringFactory.java:111) at org.netbeans.modules.refactoring.api.AbstractRefactoring.getPlugins(AbstractRefactoring.java:142)
Created attachment 115041 [details] stacktrace
Increasing priority to P2 - after discussion with performance team and based on the goal for NB 7.2 (performance improvements) especially for remote filesystems.
I don't see any simple solution. WebApp is at the core of web.xml related refactorings and to get it you might need to load it from the disk.
The only thing I can think of is, could we construct the WebApp instance lazily and just pass the ddFile FileObject in the constructor? It looks like this stack trace is just about constructing the refactoring UI, no? And the refactorings will actually be called sometime later, presumably outside of the AWT thread (at which point we would actually create the WebApp instance), no? Cc'ing also Honza and Ralph so they can comment.
Don't know, what are you doing, but I guess, that cyhelsky did those tests on J2SE project and your plugins should not be active at all. Fact, that they are active for J2SE projects is performance issue itself, regardless of touching disk or not. For web projects you can try to put creation of WebApp instance into preCheck() method, which is called outside of AWT.
> I guess, that cyhelsky did those tests on J2SE project Well I don't think so, because in the case of J2SE project, the call of WebModule.getWebModule(sourceFO) in WebRefactoringFactory:106 would return null, and the getWebApp method would not be called. Petr C, can you please comment on how you did the test? Thanks.
AFAI remember the tests were run on multiple types of projects - when i look into ui gestures of this exception i see that org.netbeans.modules.web.project.WebProject project was open
(In reply to comment #4) > The only thing I can think of is, could we construct the WebApp instance lazily > and just pass the ddFile FileObject in the constructor? I was afraid of semantical change - valid descriptor versus existing FO. However it looks like WebApp object is constructed for invalid descriptor as well. I'll try to postpone WebApp construction to preCheck.
Fixed in web-main 21dbaa40488f.
Integrated into 'main-golden', will be available in build *201205050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/21dbaa40488f User: Petr Hejl <phejl@netbeans.org> Log: #207472 IllegalStateException: getInputStream invoked in AWT