You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Patrik Karlström <pa...@trixon.se> on 2018/08/05 07:05:14 UTC

Cannot perform instant rename here

Hi,
I have been using NB 9 for a couple of days and I just noticed something
odd compared to NB8.2 when trying to rename a private function with
Refactor/ Ctrl-R.

In NB9 I can't rename it twice without saving the file first.
Is this as intended or should I file a bug?

And to be able to read the error message I actually have to press and hold
Ctrl-R.

Product Version: Apache NetBeans IDE 9.0 (Build
incubator-netbeans-release-334-on-20180708)
Java: 1.8.0_181; Java HotSpot(TM) 64-Bit Server VM 25.181-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_181-b13
System: Linux version 4.17.9-1-MANJARO running on amd64; UTF-8; sv_SE (nb)

/Patrik

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Maybe it would help if we’d take some time to Skype about it, because I’m
not able to reproduce the problem and it would help to see it and the
conditions under which it occurs (on Skype my name is ‘geertjanwielenga’)
or feel free to join the virtual meetup tomorrow at 12.00 CEST.

Gj


On Monday, August 6, 2018, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> If what you’re saying is that you have no problem when using nb-javac,
> while you do have a problem when not using nb-javac, then you’ve learned
> for yourself why it makes sense to use nb-javac.
>
> Gj
>
>
>
> On Monday, August 6, 2018, Patrik Karlström <pa...@trixon.se> wrote:
>
>> Den sön 5 aug. 2018 kl 20:45 skrev Geertjan Wielenga
>> <ge...@googlemail.com.invalid>:
>>
>> > For me that works fine too without a problem. If you provide step by
>> step
>> > instructions from beginning to end of what one must do to see the
>> problem
>> > you describe, that will help.
>> >
>> > Gj
>> >
>> >
>> Well, I followed your steps and it failed. :)
>>
>> That made me poking around a bit and it looks to me that it is related to
>> nbjavac.
>> The steps I take in order to reproduce it, or not, is to start netbeans
>> with java 10 and with/without a user profile containing nbjavac.
>> #Fails
>> /usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
>> --userdir /tmp/nb-with-nbjavac
>> #Is ok
>> /usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
>> --userdir /tmp/nb-without-nbjavac
>>
>> Since I'm normally on java 8 I also have nbjavac installed and therefor
>> always have this problem.
>>
>> public class FailingRenameWithNbJavac {
>>
>>     public static void main(String[] args) {
>>         new FailingRenameWithNbJavac();
>>     }
>>
>>     public FailingRenameWithNbJavac() {
>>         //The error does not happen without the line below being present.
>>         sayHello("world");
>>     }
>>
>>     private void sayHello(String name) {
>>         System.out.println("hello " + name);
>>     }
>> }
>>
>>
>> After the first rename from sayHello to sayBye there is an editor hint on
>> the calling line in the constructor saying:
>> cannot find symbol
>>   symbol:   method sayBye(String)
>>   location: class FailingRenameWithNbJavac
>> ----
>> (Alt-Enter shows hints)
>>
>> After the second attempt, renaming sayBye to sayWhat in the unsaved file I
>> get the message and the output below.
>>
>> On Java 10 however, the error message ("Cannot refactor this object") is
>> readable as a dialog, as opposed to the Java 8 unreadable message ("Cannot
>> perform instant rename here") in the status bar.
>>
>> INFO [org.netbeans.modules.bugtracking.BugtrackingManager]: Loading
>> stored
>> repositories took 178 millis.
>> INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null
>> for kind = CLASS
>> INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve:
>> ElementHandle[kind=CLASS; sigs=FailingRenameWithNbJavac$sayBye ]
>> INFO [org.netbeans.api.java.source.TreePathHandle]: Cannot resolve:
>> TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
>> enclosingElement:ElementHandle[kind=CONSTRUCTOR;
>> sigs=FailingRenameWithNbJavac <init> ()V ],
>> file:/home/pata/git/java/JavaApplication1/src/FailingRenameW
>> ithNbJavac.java@a9c89905
>> :6398fe27]]
>> INFO [org.netbeans.modules.refactoring.java.ui.RefactoringActions
>> Provider]:
>> doRename: TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
>> enclosingElement:ElementHandle[kind=CONSTRUCTOR;
>> sigs=FailingRenameWithNbJavac <init> ()V ],
>> file:/home/pata/git/java/JavaApplication1/src/FailingRenameW
>> ithNbJavac.java@a9c89905
>> :6398fe27]]
>> java.lang.NullPointerException: selected
>>         at
>> org.netbeans.modules.refactoring.java.ui.RenameRefactoringUI
>> $2.create(RenameRefactoringUI.java:424)
>>         at
>> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$1.c
>> reateRefactoringUI(ContextAnalyzer.java:94)
>>         at
>> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$Tex
>> tComponentTask.run(ContextAnalyzer.java:355)
>>         at
>> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$Tex
>> tComponentTask.run(ContextAnalyzer.java:280)
>>         at
>> org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSo
>> urce.java:501)
>>         at
>> org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask
>> (TaskProcessor.java:586)
>>         at
>> org.netbeans.modules.parsing.api.ParserManager$UserTaskActio
>> n.run(ParserManager.java:130)
>>         at
>> org.netbeans.modules.parsing.api.ParserManager$UserTaskActio
>> n.run(ParserManager.java:114)
>>         at
>> org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskP
>> rocessor.java:181)
>>         at
>> org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskP
>> rocessor.java:178)
>>         at
>> org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedM
>> anager.priorityIO(FileChangedManager.java:153)
>>         at
>> org.netbeans.modules.masterfs.providers.ProvidedExtensions.p
>> riorityIO(ProvidedExtensions.java:335)
>>         at
>> org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPrio
>> rityIO(DataObjectEnvFactory.java:118)
>>         at
>> org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Ut
>> ilities.java:67)
>>         at
>> org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(
>> TaskProcessor.java:178)
>>         at
>> org.netbeans.modules.parsing.api.ParserManager.parse(ParserM
>> anager.java:81)
>>         at
>> org.netbeans.api.java.source.JavaSource.runUserActionTaskImp
>> l(JavaSource.java:451)
>>         at
>> org.netbeans.api.java.source.JavaSource.runUserActionTask(Ja
>> vaSource.java:422)
>>         at
>> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$Tex
>> tComponentTask.run(ContextAnalyzer.java:362)
>>         at
>> org.netbeans.modules.refactoring.java.ui.UIUtilities.lambda$
>> runWhenScanFinished$0(UIUtilities.java:1186)
>>         at
>> org.netbeans.api.java.source.ui.ScanDialog.runWhenScanFinish
>> ed(ScanDialog.java:133)
>>         at
>> org.netbeans.modules.refactoring.java.ui.UIUtilities.runWhen
>> ScanFinished(UIUtilities.java:1181)
>>         at
>> org.netbeans.modules.refactoring.java.ui.RefactoringActionsP
>> rovider.doFullRename(RefactoringActionsProvider.java:128)
>>         at
>> org.netbeans.modules.refactoring.java.ui.RefactoringActionsP
>> rovider.doRename(RefactoringActionsProvider.java:75)
>>         at
>> org.netbeans.modules.refactoring.api.impl.ActionsImplementat
>> ionFactory.doRename(ActionsImplementationFactory.java:66)
>>         at
>> org.netbeans.modules.refactoring.spi.impl.RenameAction.
>> performAction(RenameAction.java:52)
>>         at
>> org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalA
>> ction$ContextAction.actionPerformed(RefactoringGlobalAction.java:172)
>>         at
>> org.netbeans.modules.java.editor.rename.InstantRenamePerform
>> er.doFullRename(InstantRenamePerformer.java:259)
>>         at
>> org.netbeans.modules.java.editor.rename.InstantRenamePerform
>> er.invokeInstantRename(InstantRenamePerformer.java:242)
>>         at
>> org.netbeans.modules.java.editor.rename.InstantRenameAction.
>> actionPerformed(InstantRenameAction.java:37)
>>         at
>> org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
>>         at
>> java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUt
>> ilities.java:1810)
>>         at
>> java.desktop/javax.swing.JComponent.processKeyBinding(JCompo
>> nent.java:2900)
>>         at
>> java.desktop/javax.swing.JComponent.processKeyBindings(JComp
>> onent.java:2948)
>>         at
>> java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2862)
>>         at java.desktop/java.awt.Component.processEvent(Component.java:
>> 6366)
>>         at java.desktop/java.awt.Container.processEvent(Container.java:
>> 2261)
>>         at
>> java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
>>         at
>> java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
>>         at
>> java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
>>         at
>> java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(K
>> eyboardFocusManager.java:1950)
>>         at
>> java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKe
>> yEvent(DefaultKeyboardFocusManager.java:871)
>>         at
>> java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatc
>> hKeyEvent(DefaultKeyboardFocusManager.java:1140)
>>         at
>> java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadA
>> ssertions(DefaultKeyboardFocusManager.java:1010)
>>         at
>> java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEv
>> ent(DefaultKeyboardFocusManager.java:836)
>>         at
>> java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4847)
>>         at
>> java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
>>         at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2
>> 772)
>>         at
>> java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
>>         at
>> java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
>>         at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:
>> 97)
>>         at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
>>         at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
>>         at java.base/java.security.AccessController.doPrivileged(Native
>> Method)
>>         at
>> java.base/java.security.ProtectionDomain$JavaSecurityAccessI
>> mpl.doIntersectionPrivilege(ProtectionDomain.java:87)
>>         at
>> java.base/java.security.ProtectionDomain$JavaSecurityAccessI
>> mpl.doIntersectionPrivilege(ProtectionDomain.java:97)
>>         at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
>>         at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
>>         at java.base/java.security.AccessController.doPrivileged(Native
>> Method)
>>         at
>> java.base/java.security.ProtectionDomain$JavaSecurityAccessI
>> mpl.doIntersectionPrivilege(ProtectionDomain.java:87)
>>         at
>> java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
>>         at
>> org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEve
>> ntQueue.java:136)
>>         at
>> java.desktop/java.awt.EventDispatchThread.pumpOneEventForFil
>> ters(EventDispatchThread.java:203)
>>         at
>> java.desktop/java.awt.EventDispatchThread.pumpEventsForFilte
>> r(EventDispatchThread.java:124)
>>         at
>> java.desktop/java.awt.EventDispatchThread.pumpEventsForHiera
>> rchy(EventDispatchThread.java:113)
>>         at
>> java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDi
>> spatchThread.java:109)
>>         at
>> java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDi
>> spatchThread.java:101)
>>         at
>> java.desktop/java.awt.EventDispatchThread.run(EventDispatchT
>> hread.java:90)
>>
>

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Great, Sarvesh, if you can identify where this problem is coming from and
can provide a PR to fix it, would be great.

Gj

On Mon, Aug 6, 2018 at 10:11 AM, Sarvesh Kesharwani <
sarvesh.k.kesharwani@oracle.com> wrote:

> Hi Jan,
>
> I can reproduce the issue and would be happy to look into it, unless
> you've already started working on it.
>
> Thanks,
> Sarvesh
>
>
> On 8/6/2018 11:32 AM, Jan Lahoda wrote:
>
>> I think I was able to reproduce, using:
>> ---
>> package javaapplication1a;
>>
>> public class JavaApplication1a {
>>
>>      private void saySomething() {
>>          sayHello("world");
>>      }
>>
>>      private void sayHello(String name) {
>>          System.out.println("Hello " + name);
>>      }
>> }
>> ---
>>
>> Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello", press
>> right arrow (to cancel the selection), press 1, escape. Try to rename
>> again, this fails. The "sayHello1" is underlined as an error.
>>
>> Probably related to partial reparse. I'll take a look when I can, unless
>> someone else wants to.
>>
>> Jan
>>
>>
>> On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com.invalid> wrote:
>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.you
>>> tube.com_watch-3Fv-3DFoKZ551tr0A&d=DwIFaQ&c=RoP1YumCXCgaWHvl
>>> ZYR8PZh8Bv7qIrMUB65eapI_JnE&r=LPkzDRkae1ck5T1FOexha8uL94Q3GN
>>> 8Y_0gtNzRyCcw&m=nF1jnGdPHQIascRwb4m2RORx5WVOp0AycAaWUbJiIiI&
>>> s=7XpLsEuB1TdCymnRQ-ZuIA0d-F-6EKGtFZL85bxwpsY&e=
>>>
>>> Please tell me what I must do to see your problem, after watching the
>>> above, takes about 4 minutes.
>>>
>>> Gj
>>>
>>>
>>> On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
>>> geertjan.wielenga@googlemail.com> wrote:
>>>
>>> OK, I have recorded a clip that I am uploading to YouTube, where I use
>>>> NetBeans 9, with JDK 10, and nb-javac.
>>>>
>>>> I'll send a link here when it's up in a few minutes and then you tell me
>>>> what I should do differently to reproduce your problem.
>>>>
>>>> Gj
>>>>
>>>>
>>>> On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se>
>>>>
>>> wrote:
>>>
>>>> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
>>>>> <ge...@googlemail.com.invalid>:
>>>>>
>>>>> If what you’re saying is that you have no problem when using nb-javac,
>>>>>> while you do have a problem when not using nb-javac, then you’ve
>>>>>>
>>>>> learned
>>>
>>>> for yourself why it makes sense to use nb-javac.
>>>>>>
>>>>>> Gj
>>>>>>
>>>>>> I'm saying quite the opposite.
>>>>>>
>>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: Cannot perform instant rename here

Posted by Sarvesh Kesharwani <sa...@oracle.com>.
Hi Jan,

I can reproduce the issue and would be happy to look into it, unless 
you've already started working on it.

Thanks,
Sarvesh


On 8/6/2018 11:32 AM, Jan Lahoda wrote:
> I think I was able to reproduce, using:
> ---
> package javaapplication1a;
>
> public class JavaApplication1a {
>
>      private void saySomething() {
>          sayHello("world");
>      }
>
>      private void sayHello(String name) {
>          System.out.println("Hello " + name);
>      }
> }
> ---
>
> Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello", press
> right arrow (to cancel the selection), press 1, escape. Try to rename
> again, this fails. The "sayHello1" is underlined as an error.
>
> Probably related to partial reparse. I'll take a look when I can, unless
> someone else wants to.
>
> Jan
>
>
> On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com.invalid> wrote:
>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.youtube.com_watch-3Fv-3DFoKZ551tr0A&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=LPkzDRkae1ck5T1FOexha8uL94Q3GN8Y_0gtNzRyCcw&m=nF1jnGdPHQIascRwb4m2RORx5WVOp0AycAaWUbJiIiI&s=7XpLsEuB1TdCymnRQ-ZuIA0d-F-6EKGtFZL85bxwpsY&e=
>>
>> Please tell me what I must do to see your problem, after watching the
>> above, takes about 4 minutes.
>>
>> Gj
>>
>>
>> On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
>> geertjan.wielenga@googlemail.com> wrote:
>>
>>> OK, I have recorded a clip that I am uploading to YouTube, where I use
>>> NetBeans 9, with JDK 10, and nb-javac.
>>>
>>> I'll send a link here when it's up in a few minutes and then you tell me
>>> what I should do differently to reproduce your problem.
>>>
>>> Gj
>>>
>>>
>>> On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se>
>> wrote:
>>>> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
>>>> <ge...@googlemail.com.invalid>:
>>>>
>>>>> If what you’re saying is that you have no problem when using nb-javac,
>>>>> while you do have a problem when not using nb-javac, then you’ve
>> learned
>>>>> for yourself why it makes sense to use nb-javac.
>>>>>
>>>>> Gj
>>>>>
>>>>> I'm saying quite the opposite.
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Great, thanks.

Gj

On Mon, Aug 6, 2018 at 9:12 AM, Patrik Karlström <pa...@trixon.se> wrote:

> Posted an issue: https://issues.apache.org/jira/browse/NETBEANS-1115
>

Re: Cannot perform instant rename here

Posted by Patrik Karlström <pa...@trixon.se>.
Posted an issue: https://issues.apache.org/jira/browse/NETBEANS-1115

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
To be frank, I think this is the very best way to work on an issue -- first
discuss it on the mailing list so that the problem can be narrowed down and
so that someone who can fix it's interest is peaked (in this case Jan
Lahoda) and only then let's create an issue (rather than creating an issue
and then hoping someone will find it).

So at this point, would be great if you'd create an issue and reference
this thread.

Gj


On Mon, Aug 6, 2018 at 8:13 AM, Patrik Karlström <pa...@trixon.se> wrote:

> First of all, thank you for your commitment.
>
> Watched the video and tried following it.
> It failed for me, but just because I had the method in reversed order than
> you.
> Looks like Jan i s correct, it works if the method appears before the one
> calling it.
>
> Den mån 6 aug. 2018 kl 08:08 skrev Geertjan Wielenga
> <ge...@googlemail.com.invalid>:
>
> > I can reproduce with your code, and actually also with Patrik's code, but
> > for some reason not with mine (shown in the YouTube clip). What could be
> > the reason for that, any idea?
> >
> > Gj
> >
> > On Mon, Aug 6, 2018 at 8:02 AM, Jan Lahoda <la...@gmail.com> wrote:
> >
> > > I think I was able to reproduce, using:
> > > ---
> > > package javaapplication1a;
> > >
> > > public class JavaApplication1a {
> > >
> > >     private void saySomething() {
> > >         sayHello("world");
> > >     }
> > >
> > >     private void sayHello(String name) {
> > >         System.out.println("Hello " + name);
> > >     }
> > > }
> > > ---
> > >
> > > Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello",
> press
> > > right arrow (to cancel the selection), press 1, escape. Try to rename
> > > again, this fails. The "sayHello1" is underlined as an error.
> > >
> > > Probably related to partial reparse. I'll take a look when I can,
> unless
> > > someone else wants to.
> > >
> > > Jan
> > >
> > >
> > > On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
> > > geertjan.wielenga@googlemail.com.invalid> wrote:
> > >
> > > > https://www.youtube.com/watch?v=FoKZ551tr0A
> > > >
> > > > Please tell me what I must do to see your problem, after watching the
> > > > above, takes about 4 minutes.
> > > >
> > > > Gj
> > > >
> > > >
> > > > On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
> > > > geertjan.wielenga@googlemail.com> wrote:
> > > >
> > > > > OK, I have recorded a clip that I am uploading to YouTube, where I
> > use
> > > > > NetBeans 9, with JDK 10, and nb-javac.
> > > > >
> > > > > I'll send a link here when it's up in a few minutes and then you
> tell
> > > me
> > > > > what I should do differently to reproduce your problem.
> > > > >
> > > > > Gj
> > > > >
> > > > >
> > > > > On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <patrik@trixon.se
> >
> > > > wrote:
> > > > >
> > > > >> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
> > > > >> <ge...@googlemail.com.invalid>:
> > > > >>
> > > > >> > If what you’re saying is that you have no problem when using
> > > nb-javac,
> > > > >> > while you do have a problem when not using nb-javac, then you’ve
> > > > learned
> > > > >> > for yourself why it makes sense to use nb-javac.
> > > > >> >
> > > > >> > Gj
> > > > >> >
> > > > >> > I'm saying quite the opposite.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Cannot perform instant rename here

Posted by Patrik Karlström <pa...@trixon.se>.
First of all, thank you for your commitment.

Watched the video and tried following it.
It failed for me, but just because I had the method in reversed order than
you.
Looks like Jan i s correct, it works if the method appears before the one
calling it.

Den mån 6 aug. 2018 kl 08:08 skrev Geertjan Wielenga
<ge...@googlemail.com.invalid>:

> I can reproduce with your code, and actually also with Patrik's code, but
> for some reason not with mine (shown in the YouTube clip). What could be
> the reason for that, any idea?
>
> Gj
>
> On Mon, Aug 6, 2018 at 8:02 AM, Jan Lahoda <la...@gmail.com> wrote:
>
> > I think I was able to reproduce, using:
> > ---
> > package javaapplication1a;
> >
> > public class JavaApplication1a {
> >
> >     private void saySomething() {
> >         sayHello("world");
> >     }
> >
> >     private void sayHello(String name) {
> >         System.out.println("Hello " + name);
> >     }
> > }
> > ---
> >
> > Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello", press
> > right arrow (to cancel the selection), press 1, escape. Try to rename
> > again, this fails. The "sayHello1" is underlined as an error.
> >
> > Probably related to partial reparse. I'll take a look when I can, unless
> > someone else wants to.
> >
> > Jan
> >
> >
> > On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
> > geertjan.wielenga@googlemail.com.invalid> wrote:
> >
> > > https://www.youtube.com/watch?v=FoKZ551tr0A
> > >
> > > Please tell me what I must do to see your problem, after watching the
> > > above, takes about 4 minutes.
> > >
> > > Gj
> > >
> > >
> > > On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
> > > geertjan.wielenga@googlemail.com> wrote:
> > >
> > > > OK, I have recorded a clip that I am uploading to YouTube, where I
> use
> > > > NetBeans 9, with JDK 10, and nb-javac.
> > > >
> > > > I'll send a link here when it's up in a few minutes and then you tell
> > me
> > > > what I should do differently to reproduce your problem.
> > > >
> > > > Gj
> > > >
> > > >
> > > > On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se>
> > > wrote:
> > > >
> > > >> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
> > > >> <ge...@googlemail.com.invalid>:
> > > >>
> > > >> > If what you’re saying is that you have no problem when using
> > nb-javac,
> > > >> > while you do have a problem when not using nb-javac, then you’ve
> > > learned
> > > >> > for yourself why it makes sense to use nb-javac.
> > > >> >
> > > >> > Gj
> > > >> >
> > > >> > I'm saying quite the opposite.
> > > >>
> > > >
> > > >
> > >
> >
>

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
I can reproduce with your code, and actually also with Patrik's code, but
for some reason not with mine (shown in the YouTube clip). What could be
the reason for that, any idea?

Gj

On Mon, Aug 6, 2018 at 8:02 AM, Jan Lahoda <la...@gmail.com> wrote:

> I think I was able to reproduce, using:
> ---
> package javaapplication1a;
>
> public class JavaApplication1a {
>
>     private void saySomething() {
>         sayHello("world");
>     }
>
>     private void sayHello(String name) {
>         System.out.println("Hello " + name);
>     }
> }
> ---
>
> Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello", press
> right arrow (to cancel the selection), press 1, escape. Try to rename
> again, this fails. The "sayHello1" is underlined as an error.
>
> Probably related to partial reparse. I'll take a look when I can, unless
> someone else wants to.
>
> Jan
>
>
> On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com.invalid> wrote:
>
> > https://www.youtube.com/watch?v=FoKZ551tr0A
> >
> > Please tell me what I must do to see your problem, after watching the
> > above, takes about 4 minutes.
> >
> > Gj
> >
> >
> > On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
> > geertjan.wielenga@googlemail.com> wrote:
> >
> > > OK, I have recorded a clip that I am uploading to YouTube, where I use
> > > NetBeans 9, with JDK 10, and nb-javac.
> > >
> > > I'll send a link here when it's up in a few minutes and then you tell
> me
> > > what I should do differently to reproduce your problem.
> > >
> > > Gj
> > >
> > >
> > > On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se>
> > wrote:
> > >
> > >> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
> > >> <ge...@googlemail.com.invalid>:
> > >>
> > >> > If what you’re saying is that you have no problem when using
> nb-javac,
> > >> > while you do have a problem when not using nb-javac, then you’ve
> > learned
> > >> > for yourself why it makes sense to use nb-javac.
> > >> >
> > >> > Gj
> > >> >
> > >> > I'm saying quite the opposite.
> > >>
> > >
> > >
> >
>

Re: Cannot perform instant rename here

Posted by Jan Lahoda <la...@gmail.com>.
I think I was able to reproduce, using:
---
package javaapplication1a;

public class JavaApplication1a {

    private void saySomething() {
        sayHello("world");
    }

    private void sayHello(String name) {
        System.out.println("Hello " + name);
    }
}
---

Press Ctrl-R (or the equivalent on Mac) on the _first_ "sayHello", press
right arrow (to cancel the selection), press 1, escape. Try to rename
again, this fails. The "sayHello1" is underlined as an error.

Probably related to partial reparse. I'll take a look when I can, unless
someone else wants to.

Jan


On Mon, Aug 6, 2018 at 7:40 AM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com.invalid> wrote:

> https://www.youtube.com/watch?v=FoKZ551tr0A
>
> Please tell me what I must do to see your problem, after watching the
> above, takes about 4 minutes.
>
> Gj
>
>
> On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
> geertjan.wielenga@googlemail.com> wrote:
>
> > OK, I have recorded a clip that I am uploading to YouTube, where I use
> > NetBeans 9, with JDK 10, and nb-javac.
> >
> > I'll send a link here when it's up in a few minutes and then you tell me
> > what I should do differently to reproduce your problem.
> >
> > Gj
> >
> >
> > On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se>
> wrote:
> >
> >> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
> >> <ge...@googlemail.com.invalid>:
> >>
> >> > If what you’re saying is that you have no problem when using nb-javac,
> >> > while you do have a problem when not using nb-javac, then you’ve
> learned
> >> > for yourself why it makes sense to use nb-javac.
> >> >
> >> > Gj
> >> >
> >> > I'm saying quite the opposite.
> >>
> >
> >
>

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
https://www.youtube.com/watch?v=FoKZ551tr0A

Please tell me what I must do to see your problem, after watching the
above, takes about 4 minutes.

Gj


On Mon, Aug 6, 2018 at 7:36 AM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> OK, I have recorded a clip that I am uploading to YouTube, where I use
> NetBeans 9, with JDK 10, and nb-javac.
>
> I'll send a link here when it's up in a few minutes and then you tell me
> what I should do differently to reproduce your problem.
>
> Gj
>
>
> On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se> wrote:
>
>> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
>> <ge...@googlemail.com.invalid>:
>>
>> > If what you’re saying is that you have no problem when using nb-javac,
>> > while you do have a problem when not using nb-javac, then you’ve learned
>> > for yourself why it makes sense to use nb-javac.
>> >
>> > Gj
>> >
>> > I'm saying quite the opposite.
>>
>
>

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
OK, I have recorded a clip that I am uploading to YouTube, where I use
NetBeans 9, with JDK 10, and nb-javac.

I'll send a link here when it's up in a few minutes and then you tell me
what I should do differently to reproduce your problem.

Gj


On Mon, Aug 6, 2018 at 7:28 AM, Patrik Karlström <pa...@trixon.se> wrote:

> Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
> <ge...@googlemail.com.invalid>:
>
> > If what you’re saying is that you have no problem when using nb-javac,
> > while you do have a problem when not using nb-javac, then you’ve learned
> > for yourself why it makes sense to use nb-javac.
> >
> > Gj
> >
> > I'm saying quite the opposite.
>

Re: Cannot perform instant rename here

Posted by Patrik Karlström <pa...@trixon.se>.
Den mån 6 aug. 2018 kl 07:19 skrev Geertjan Wielenga
<ge...@googlemail.com.invalid>:

> If what you’re saying is that you have no problem when using nb-javac,
> while you do have a problem when not using nb-javac, then you’ve learned
> for yourself why it makes sense to use nb-javac.
>
> Gj
>
> I'm saying quite the opposite.

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
If what you’re saying is that you have no problem when using nb-javac,
while you do have a problem when not using nb-javac, then you’ve learned
for yourself why it makes sense to use nb-javac.

Gj



On Monday, August 6, 2018, Patrik Karlström <pa...@trixon.se> wrote:

> Den sön 5 aug. 2018 kl 20:45 skrev Geertjan Wielenga
> <ge...@googlemail.com.invalid>:
>
> > For me that works fine too without a problem. If you provide step by step
> > instructions from beginning to end of what one must do to see the problem
> > you describe, that will help.
> >
> > Gj
> >
> >
> Well, I followed your steps and it failed. :)
>
> That made me poking around a bit and it looks to me that it is related to
> nbjavac.
> The steps I take in order to reproduce it, or not, is to start netbeans
> with java 10 and with/without a user profile containing nbjavac.
> #Fails
> /usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
> --userdir /tmp/nb-with-nbjavac
> #Is ok
> /usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
> --userdir /tmp/nb-without-nbjavac
>
> Since I'm normally on java 8 I also have nbjavac installed and therefor
> always have this problem.
>
> public class FailingRenameWithNbJavac {
>
>     public static void main(String[] args) {
>         new FailingRenameWithNbJavac();
>     }
>
>     public FailingRenameWithNbJavac() {
>         //The error does not happen without the line below being present.
>         sayHello("world");
>     }
>
>     private void sayHello(String name) {
>         System.out.println("hello " + name);
>     }
> }
>
>
> After the first rename from sayHello to sayBye there is an editor hint on
> the calling line in the constructor saying:
> cannot find symbol
>   symbol:   method sayBye(String)
>   location: class FailingRenameWithNbJavac
> ----
> (Alt-Enter shows hints)
>
> After the second attempt, renaming sayBye to sayWhat in the unsaved file I
> get the message and the output below.
>
> On Java 10 however, the error message ("Cannot refactor this object") is
> readable as a dialog, as opposed to the Java 8 unreadable message ("Cannot
> perform instant rename here") in the status bar.
>
> INFO [org.netbeans.modules.bugtracking.BugtrackingManager]: Loading stored
> repositories took 178 millis.
> INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null
> for kind = CLASS
> INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve:
> ElementHandle[kind=CLASS; sigs=FailingRenameWithNbJavac$sayBye ]
> INFO [org.netbeans.api.java.source.TreePathHandle]: Cannot resolve:
> TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
> enclosingElement:ElementHandle[kind=CONSTRUCTOR;
> sigs=FailingRenameWithNbJavac <init> ()V ],
> file:/home/pata/git/java/JavaApplication1/src/
> FailingRenameWithNbJavac.java@a9c89905
> :6398fe27]]
> INFO [org.netbeans.modules.refactoring.java.ui.
> RefactoringActionsProvider]:
> doRename: TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
> enclosingElement:ElementHandle[kind=CONSTRUCTOR;
> sigs=FailingRenameWithNbJavac <init> ()V ],
> file:/home/pata/git/java/JavaApplication1/src/
> FailingRenameWithNbJavac.java@a9c89905
> :6398fe27]]
> java.lang.NullPointerException: selected
>         at
> org.netbeans.modules.refactoring.java.ui.RenameRefactoringUI$2.create(
> RenameRefactoringUI.java:424)
>         at
> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$1.
> createRefactoringUI(ContextAnalyzer.java:94)
>         at
> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$
> TextComponentTask.run(ContextAnalyzer.java:355)
>         at
> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$
> TextComponentTask.run(ContextAnalyzer.java:280)
>         at
> org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:501)
>         at
> org.netbeans.modules.parsing.impl.TaskProcessor.
> callUserTask(TaskProcessor.java:586)
>         at
> org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(
> ParserManager.java:130)
>         at
> org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(
> ParserManager.java:114)
>         at
> org.netbeans.modules.parsing.impl.TaskProcessor$2.call(
> TaskProcessor.java:181)
>         at
> org.netbeans.modules.parsing.impl.TaskProcessor$2.call(
> TaskProcessor.java:178)
>         at
> org.netbeans.modules.masterfs.filebasedfs.utils.
> FileChangedManager.priorityIO(FileChangedManager.java:153)
>         at
> org.netbeans.modules.masterfs.providers.ProvidedExtensions.
> priorityIO(ProvidedExtensions.java:335)
>         at
> org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(
> DataObjectEnvFactory.java:118)
>         at
> org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(
> Utilities.java:67)
>         at
> org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.
> java:178)
>         at
> org.netbeans.modules.parsing.api.ParserManager.parse(
> ParserManager.java:81)
>         at
> org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(
> JavaSource.java:451)
>         at
> org.netbeans.api.java.source.JavaSource.runUserActionTask(
> JavaSource.java:422)
>         at
> org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$
> TextComponentTask.run(ContextAnalyzer.java:362)
>         at
> org.netbeans.modules.refactoring.java.ui.UIUtilities.lambda$
> runWhenScanFinished$0(UIUtilities.java:1186)
>         at
> org.netbeans.api.java.source.ui.ScanDialog.runWhenScanFinished(
> ScanDialog.java:133)
>         at
> org.netbeans.modules.refactoring.java.ui.UIUtilities.runWhenScanFinished(
> UIUtilities.java:1181)
>         at
> org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider.
> doFullRename(RefactoringActionsProvider.java:128)
>         at
> org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider.
> doRename(RefactoringActionsProvider.java:75)
>         at
> org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.
> doRename(ActionsImplementationFactory.java:66)
>         at
> org.netbeans.modules.refactoring.spi.impl.RenameAction.performAction(
> RenameAction.java:52)
>         at
> org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction$
> ContextAction.actionPerformed(RefactoringGlobalAction.java:172)
>         at
> org.netbeans.modules.java.editor.rename.InstantRenamePerformer.
> doFullRename(InstantRenamePerformer.java:259)
>         at
> org.netbeans.modules.java.editor.rename.InstantRenamePerformer.
> invokeInstantRename(InstantRenamePerformer.java:242)
>         at
> org.netbeans.modules.java.editor.rename.InstantRenameAction.
> actionPerformed(InstantRenameAction.java:37)
>         at
> org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
>         at
> java.desktop/javax.swing.SwingUtilities.notifyAction(
> SwingUtilities.java:1810)
>         at
> java.desktop/javax.swing.JComponent.processKeyBinding(
> JComponent.java:2900)
>         at
> java.desktop/javax.swing.JComponent.processKeyBindings(
> JComponent.java:2948)
>         at
> java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2862)
>         at java.desktop/java.awt.Component.processEvent(
> Component.java:6366)
>         at java.desktop/java.awt.Container.processEvent(
> Container.java:2261)
>         at
> java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
>         at
> java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
>         at
> java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
>         at
> java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(
> KeyboardFocusManager.java:1950)
>         at
> java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(
> DefaultKeyboardFocusManager.java:871)
>         at
> java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(
> DefaultKeyboardFocusManager.java:1140)
>         at
> java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(
> DefaultKeyboardFocusManager.java:1010)
>         at
> java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(
> DefaultKeyboardFocusManager.java:836)
>         at
> java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4847)
>         at
> java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
>         at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:
> 2772)
>         at
> java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
>         at
> java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
>         at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
>         at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
>         at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
>         at java.base/java.security.AccessController.doPrivileged(Native
> Method)
>         at
> java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.
> doIntersectionPrivilege(ProtectionDomain.java:87)
>         at
> java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.
> doIntersectionPrivilege(ProtectionDomain.java:97)
>         at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
>         at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
>         at java.base/java.security.AccessController.doPrivileged(Native
> Method)
>         at
> java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.
> doIntersectionPrivilege(ProtectionDomain.java:87)
>         at
> java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
>         at
> org.netbeans.core.TimableEventQueue.dispatchEvent(
> TimableEventQueue.java:136)
>         at
> java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(
> EventDispatchThread.java:203)
>         at
> java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(
> EventDispatchThread.java:124)
>         at
> java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(
> EventDispatchThread.java:113)
>         at
> java.desktop/java.awt.EventDispatchThread.pumpEvents(
> EventDispatchThread.java:109)
>         at
> java.desktop/java.awt.EventDispatchThread.pumpEvents(
> EventDispatchThread.java:101)
>         at
> java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
>

Re: Cannot perform instant rename here

Posted by Patrik Karlström <pa...@trixon.se>.
Den sön 5 aug. 2018 kl 20:45 skrev Geertjan Wielenga
<ge...@googlemail.com.invalid>:

> For me that works fine too without a problem. If you provide step by step
> instructions from beginning to end of what one must do to see the problem
> you describe, that will help.
>
> Gj
>
>
Well, I followed your steps and it failed. :)

That made me poking around a bit and it looks to me that it is related to
nbjavac.
The steps I take in order to reproduce it, or not, is to start netbeans
with java 10 and with/without a user profile containing nbjavac.
#Fails
/usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
--userdir /tmp/nb-with-nbjavac
#Is ok
/usr/local/netbeans-9.0/bin/netbeans --jdkhome /usr/lib/jvm/java-10-jdk/
--userdir /tmp/nb-without-nbjavac

Since I'm normally on java 8 I also have nbjavac installed and therefor
always have this problem.

public class FailingRenameWithNbJavac {

    public static void main(String[] args) {
        new FailingRenameWithNbJavac();
    }

    public FailingRenameWithNbJavac() {
        //The error does not happen without the line below being present.
        sayHello("world");
    }

    private void sayHello(String name) {
        System.out.println("hello " + name);
    }
}


After the first rename from sayHello to sayBye there is an editor hint on
the calling line in the constructor saying:
cannot find symbol
  symbol:   method sayBye(String)
  location: class FailingRenameWithNbJavac
----
(Alt-Enter shows hints)

After the second attempt, renaming sayBye to sayWhat in the unsaved file I
get the message and the output below.

On Java 10 however, the error message ("Cannot refactor this object") is
readable as a dialog, as opposed to the Java 8 unreadable message ("Cannot
perform instant rename here") in the status bar.

INFO [org.netbeans.modules.bugtracking.BugtrackingManager]: Loading stored
repositories took 178 millis.
INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null
for kind = CLASS
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve:
ElementHandle[kind=CLASS; sigs=FailingRenameWithNbJavac$sayBye ]
INFO [org.netbeans.api.java.source.TreePathHandle]: Cannot resolve:
TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
enclosingElement:ElementHandle[kind=CONSTRUCTOR;
sigs=FailingRenameWithNbJavac <init> ()V ],
file:/home/pata/git/java/JavaApplication1/src/FailingRenameWithNbJavac.java@a9c89905
:6398fe27]]
INFO [org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider]:
doRename: TreePathHandle[delegate:TreeDelegate[kind:IDENTIFIER,
enclosingElement:ElementHandle[kind=CONSTRUCTOR;
sigs=FailingRenameWithNbJavac <init> ()V ],
file:/home/pata/git/java/JavaApplication1/src/FailingRenameWithNbJavac.java@a9c89905
:6398fe27]]
java.lang.NullPointerException: selected
        at
org.netbeans.modules.refactoring.java.ui.RenameRefactoringUI$2.create(RenameRefactoringUI.java:424)
        at
org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$1.createRefactoringUI(ContextAnalyzer.java:94)
        at
org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$TextComponentTask.run(ContextAnalyzer.java:355)
        at
org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$TextComponentTask.run(ContextAnalyzer.java:280)
        at
org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:501)
        at
org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
        at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130)
        at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
        at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
        at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
        at
org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
        at
org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
        at
org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
        at
org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
        at
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
        at
org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81)
        at
org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:451)
        at
org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:422)
        at
org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$TextComponentTask.run(ContextAnalyzer.java:362)
        at
org.netbeans.modules.refactoring.java.ui.UIUtilities.lambda$runWhenScanFinished$0(UIUtilities.java:1186)
        at
org.netbeans.api.java.source.ui.ScanDialog.runWhenScanFinished(ScanDialog.java:133)
        at
org.netbeans.modules.refactoring.java.ui.UIUtilities.runWhenScanFinished(UIUtilities.java:1181)
        at
org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider.doFullRename(RefactoringActionsProvider.java:128)
        at
org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider.doRename(RefactoringActionsProvider.java:75)
        at
org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.doRename(ActionsImplementationFactory.java:66)
        at
org.netbeans.modules.refactoring.spi.impl.RenameAction.performAction(RenameAction.java:52)
        at
org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction$ContextAction.actionPerformed(RefactoringGlobalAction.java:172)
        at
org.netbeans.modules.java.editor.rename.InstantRenamePerformer.doFullRename(InstantRenamePerformer.java:259)
        at
org.netbeans.modules.java.editor.rename.InstantRenamePerformer.invokeInstantRename(InstantRenamePerformer.java:242)
        at
org.netbeans.modules.java.editor.rename.InstantRenameAction.actionPerformed(InstantRenameAction.java:37)
        at
org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
        at
java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
        at
java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2900)
        at
java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:2948)
        at
java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2862)
        at java.desktop/java.awt.Component.processEvent(Component.java:6366)
        at java.desktop/java.awt.Container.processEvent(Container.java:2261)
        at
java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
        at
java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
        at
java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
        at
java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1950)
        at
java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:871)
        at
java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1140)
        at
java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1010)
        at
java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:836)
        at
java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4847)
        at
java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2319)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
        at
java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
        at
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native
Method)
        at
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(Native
Method)
        at
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
        at
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
For me that works fine too without a problem. If you provide step by step
instructions from beginning to end of what one must do to see the problem
you describe, that will help.

Gj

On Sun, Aug 5, 2018 at 4:15 PM, Patrik Karlström <pa...@trixon.se> wrote:

> Den sön 5 aug. 2018 kl 10:31 skrev Geertjan Wielenga
> <ge...@googlemail.com.invalid>:
>
> > I've tried this, didn't need to save between refactoring:
> >
> > 1. I have this private method (hope this is what you mean by 'private
> > function'):
> >
> > private void sayHello(String name) {
> >     System.out.println("Hello " + name);
> > }
> >
> > 2. I double-click on the word 'sayHello', press Ctrl-R, and type
> 'sayBye',
> > and now the method is named 'sayBye'. I immediately press Ctrl-R again,
> and
> > type 'saySomethingElse'.
> >
> > No problem, the above works, I have renamed a private method twice using
> > Ctrl-R without needing to save the file first or at any other point.
> >
> > If the above is not what you did, can you explain what you did in a
> similar
> > way so that it can be reproduced.
> >
> > Gj
> >
> >
> Following your steps works for me too, but it fails when I have a method
> calling the method being renamed:
>
> private void saySomething() {
>       sayHello("world");
> }
>
> private void sayHello(String name) {
>     System.out.println("Hello " + name);
> }
>

Re: Cannot perform instant rename here

Posted by Patrik Karlström <pa...@trixon.se>.
Den sön 5 aug. 2018 kl 10:31 skrev Geertjan Wielenga
<ge...@googlemail.com.invalid>:

> I've tried this, didn't need to save between refactoring:
>
> 1. I have this private method (hope this is what you mean by 'private
> function'):
>
> private void sayHello(String name) {
>     System.out.println("Hello " + name);
> }
>
> 2. I double-click on the word 'sayHello', press Ctrl-R, and type 'sayBye',
> and now the method is named 'sayBye'. I immediately press Ctrl-R again, and
> type 'saySomethingElse'.
>
> No problem, the above works, I have renamed a private method twice using
> Ctrl-R without needing to save the file first or at any other point.
>
> If the above is not what you did, can you explain what you did in a similar
> way so that it can be reproduced.
>
> Gj
>
>
Following your steps works for me too, but it fails when I have a method
calling the method being renamed:

private void saySomething() {
      sayHello("world");
}

private void sayHello(String name) {
    System.out.println("Hello " + name);
}

Re: Cannot perform instant rename here

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
I've tried this, didn't need to save between refactoring:

1. I have this private method (hope this is what you mean by 'private
function'):

private void sayHello(String name) {
    System.out.println("Hello " + name);
}

2. I double-click on the word 'sayHello', press Ctrl-R, and type 'sayBye',
and now the method is named 'sayBye'. I immediately press Ctrl-R again, and
type 'saySomethingElse'.

No problem, the above works, I have renamed a private method twice using
Ctrl-R without needing to save the file first or at any other point.

If the above is not what you did, can you explain what you did in a similar
way so that it can be reproduced.

Gj




On Sun, Aug 5, 2018 at 9:05 AM, Patrik Karlström <pa...@trixon.se> wrote:

> Hi,
> I have been using NB 9 for a couple of days and I just noticed something
> odd compared to NB8.2 when trying to rename a private function with
> Refactor/ Ctrl-R.
>
> In NB9 I can't rename it twice without saving the file first.
> Is this as intended or should I file a bug?
>
> And to be able to read the error message I actually have to press and hold
> Ctrl-R.
>
> Product Version: Apache NetBeans IDE 9.0 (Build
> incubator-netbeans-release-334-on-20180708)
> Java: 1.8.0_181; Java HotSpot(TM) 64-Bit Server VM 25.181-b13
> Runtime: Java(TM) SE Runtime Environment 1.8.0_181-b13
> System: Linux version 4.17.9-1-MANJARO running on amd64; UTF-8; sv_SE (nb)
>
> /Patrik
>