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 106887 - java.lang.UnsupportedOperationException when renaming VW Jsp page
Summary: java.lang.UnsupportedOperationException when renaming VW Jsp page
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 107085 107399 (view as bug list)
Depends on:
Blocks: 106361
  Show dependency tree
 
Reported: 2007-06-15 22:05 UTC by _ sandipchitale
Modified: 2007-06-26 16:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack Trace (1.31 KB, text/plain)
2007-06-22 14:36 UTC, Martin Schovanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ sandipchitale 2007-06-15 22:05:01 UTC
Keep getting the following exception while trying to Rename Refactor a VW JSP page:

java.lang.UnsupportedOperationException: Not supported yet.
	at org.netbeans.modules.web.core.syntax.JavaSourceProviderImpl$FilterImpl.filterReader
(JavaSourceProviderImpl.java:80)
	at org.netbeans.modules.java.source.parsing.SourceFileObject.openReader(SourceFileObject.java:145)
	at org.netbeans.modules.java.source.parsing.SourceFileObject.getCharContentImpl(SourceFileObject.java:343)
	at org.netbeans.modules.java.source.parsing.SourceFileObject.getCharContent(SourceFileObject.java:116)
	at org.netbeans.modules.java.source.parsing.SourceFileObject.getCharContent(SourceFileObject.java:59)
	at org.netbeans.api.java.source.CompilationInfo.getText(CompilationInfo.java:117)
	at org.netbeans.api.java.source.JavaSource.dumpSource(JavaSource.java:2233)
	at org.netbeans.api.java.source.JavaSource.moveToPhase(JavaSource.java:1190)
	at org.netbeans.api.java.source.CompilationController.toPhase(CompilationController.java:82)
	at org.netbeans.modules.web.refactoring.WebRefactoringFactory$1.run(WebRefactoringFactory.java:140)
	at org.netbeans.modules.web.refactoring.WebRefactoringFactory$1.run(WebRefactoringFactory.java:139)
	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:564)
	at org.netbeans.modules.web.refactoring.WebRefactoringFactory.resolveTreePathHandle
(WebRefactoringFactory.java:136)
	at org.netbeans.modules.web.refactoring.WebRefactoringFactory.createInstance(WebRefactoringFactory.java:63)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.getPlugins(AbstractRefactoring.java:107)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPreCheck(AbstractRefactoring.java:307)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.preCheck(AbstractRefactoring.java:156)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.fastCheckParameters(AbstractRefactoring.java:221)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.checkParameters(AbstractRefactoring.java:203)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:170)
	at org.netbeans.modules.visualweb.insync.faces.refactoring.FacesJavaFileRenameRefactoringPlugin.prepare
(FacesJavaFileRenameRefactoringPlugin.java:322)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:326)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:176)
	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:708)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Comment 1 _ sandipchitale 2007-06-15 22:06:05 UTC
Jan Lahoda seems to have checked in the code. CCing hin.
Comment 2 Jan Lahoda 2007-06-15 22:40:24 UTC
I will take a look at this on Monday. Sorry for any problems.
Comment 3 Petr Pisl 2007-06-18 09:46:58 UTC
This is not problem of jspparser, but in the syntax (the java part of jsp editor). Setting up the right component.
Comment 4 Jan Lahoda 2007-06-18 13:25:17 UTC
The immediate problem is IMO calling JavaSource.forFileObject for JSPs - before my Friday's commit, this returned null,
causing NPEs. After my commit, this returns a (read-only) JavaSource instance. 

In web/refactoring, this was (AFAIK) fixed as:
web/refactoring/src/org/netbeans/modules/web/refactoring/WebRefactoringFactory.java

Unfortunately, similar problem happens with web/jsf. JSFRenamePlugin:109 may call JS.forFileObject for a JSP file. Petr
could you please add there some check to ensure it will be called only for Java files? Thank you very much.
Comment 5 Petr Pisl 2007-06-20 11:13:26 UTC
*** Issue 107386 has been marked as a duplicate of this issue. ***
Comment 6 Petr Pisl 2007-06-20 11:26:54 UTC
*** Issue 107399 has been marked as a duplicate of this issue. ***
Comment 7 Petr Pisl 2007-06-20 18:18:04 UTC
Fixed in the trunk.

Checking in JSFMoveClassPlugin.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/refactoring/JSFMoveClassPlugin.java,v  <--  JSFMoveClassPlugin.java
new revision: 1.8; previous revision: 1.7
done
Checking in JSFRenamePlugin.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/refactoring/JSFRenamePlugin.java,v  <--  JSFRenamePlugin.java
new revision: 1.11; previous revision: 1.10
done
Checking in JSFRefactoringUtils.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/refactoring/JSFRefactoringUtils.java,v  <--  JSFRefactoringUtils.java
new revision: 1.3; previous revision: 1.2
done
Comment 8 Petr Pisl 2007-06-21 12:30:29 UTC
*** Issue 107085 has been marked as a duplicate of this issue. ***
Comment 9 Martin Schovanek 2007-06-22 14:33:33 UTC
Reproducible at #200706210000 by testJSPNavigator automated test.
Comment 10 Martin Schovanek 2007-06-22 14:36:25 UTC
Created attachment 44267 [details]
Stack Trace
Comment 11 Jan Lahoda 2007-06-22 14:50:02 UTC
I will take a look.
Comment 12 Petr Pisl 2007-06-25 13:15:33 UTC
The problem is that this exception can happen in many cases through whole IDE. Basically everywhere where is obtained
JavaSource from a FileObject. I think we should close this issue and for navigator case based new one, because there is
responsible another engineer.   
Comment 13 Petr Pisl 2007-06-25 16:56:29 UTC
I did an additional fix for this issue. 

Checking in JSFRenamePlugin.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/refactoring/JSFRenamePlugin.java,v  <--  JSFRenamePlugin.java
new revision: 1.12; previous revision: 1.11
done
Checking in JSFMoveClassPlugin.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/refactoring/JSFMoveClassPlugin.java,v  <--  JSFMoveClassPlugin.java
new revision: 1.9; previous revision: 1.8
done

Now it's committed into the trunk only. 
Comment 14 Petr Pisl 2007-06-25 17:38:14 UTC
I'm reassigning back to me. Because Martin is going to based new issue for the navigator case.
Comment 15 Petr Pisl 2007-06-25 17:45:12 UTC
The fix is now also in release60-m10 branch.
Comment 16 Martin Schovanek 2007-06-25 17:59:15 UTC
I filed separate issue #108058 against web/jsp editor so please ignore the stack-trace form testJSPNavigator automated test.
Comment 17 Peter Pis 2007-06-26 09:24:54 UTC
Could you please verify this issue for M10?
Comment 18 Joanne Lau 2007-06-26 16:40:18 UTC
Fix verified in M10 build 200706260050