RE: AutoText Completion Issue - ManagedBean

2022-11-28 Thread Richard Grin
Hello,

Which version of Jakarta EE and NetBeans ?

Richard



Envoyé depuis mon appareil Galaxy



 Message d'origine 
De : Mehmet Fatih ÇİN 
Date : 28/11/2022 20:24 (GMT+01:00)
À : NetBeans Mailing List 
Objet : AutoText Completion Issue - ManagedBean

Hello, I used  
component. but the instanceManagedBean value is not output on autocomplete. How 
should I go about this problem? Thank you for your interest.


Mehmet Fatih ÇİN




AutoText Completion Issue - ManagedBean

2022-11-28 Thread Mehmet Fatih ÇİN
Hello, I used  
component. but the instanceManagedBean value is not output on autocomplete. How 
should I go about this problem? Thank you for your interest.


Mehmet Fatih ÇİN




Re: NetBeans `Convert to for (Iterator...) {}' suggestion

2022-11-28 Thread Michael Bien

Hi John,

suggestions which are only active at the current line where your cursor 
is, don't necessary produce better code, they are just there to 
transform parts of it in case you want to change something. Internally 
they are hints of a kind called actions.


The doc describes it well:

"The hint (with kind ACTION) represents an offer to the user to 
automatically alter the code. The transformation is not intended to 
improve the code, only allow the user to do some kind of code 
transformation quickly. The only meaningful severity for suggestions if 
Severity.CURRENT_LINE_WARNING."


You should notice that if you change the loop to the iterator version, 
but not actually use the iterator except calling next() it will also add 
a hint called "convert to for-loop" which does the opposite. This hint 
will always appear, even if you move the cursor, since unless you 
actually need the iterator the simple for loop is more readable and 
should be preferred as you said.


the for-each loop uses a hidden iterator if it iterates over iterables 
anyway.


I don't know why you can't disable this particular suggestion via the 
context menu.


regards,
michael


On 28.11.22 15:00, John wrote:


Hi,

Quick one. I have just installed a vanilla Netbeans 15 and when I 
write a line such as


for (Word word : this.dictionary) {...}

Netbeans offers me a Warning / Recommendation

`Convert to for (Iterator...) {}'

That, if chosen, converts my syntax to

for (Iterator it = this.dictionary.iterator(); it.hasNext();) {...}

This is a lot less readable to me and I therefore wanted to turn off 
this hint.


However, The  doesn’t offer the option to disable this hint 
and I couldn’t find it in the Tools > Options > Editor > Hints (Java) 
list, although I found lots of other nice hints that I have turned on!


I found this on Stack Overflow

https://stackoverflow.com/questions/24263479/netbeans-convert-to-for-iterator-suggestion

But that was to do with which one is more efficient and I suspect that 
the warning is due to the fact that the more verbose version is 
quicker if the number of elements in the iterator is very large.


Am I stuck with this, or is it that I just overlooked where the hint 
is in the long list?


John

- 
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For 
additional commands, e-mail: users-h...@netbeans.apache.org For 
further information about the NetBeans mailing lists, visit: 
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists 




Re: NetBeans `Convert to for (Iterator...) {}' suggestion

2022-11-28 Thread Scott Palmer
I agree that this isn’t usually a good suggestion.  It is available as a 
refactoring for when you might need an iterator, but by no means should the IDE 
“warn” about it.  I think that is the current behaviour though.  The line is 
not marked with a hint lightbulb unless I put the cursor on that line. So it’s 
not like it shows in the gutter as a warning like you would get for an unused 
private function or similar.

It appears to be the hint “Expand Enhanced For Loop” that you will find under 
“Suggestions” in the editor Hints panel.

When I turn that off the”expand” hint, the suggestion changes to  “Can use 
functional operations” which coverts the loop to this.dictionart.forEach(word 
-> {...});

Scott

> On Nov 28, 2022, at 9:00 AM, John  wrote:
> 
> Hi,
>  
> Quick one. I have just installed a vanilla Netbeans 15 and when I write a 
> line such as
>  
> for (Word word : this.dictionary) {...}
>  
> Netbeans offers me a Warning / Recommendation 
>  
> `Convert to for (Iterator...) {}'
>  
> That, if chosen, converts my syntax to
>  
> for (Iterator it = this.dictionary.iterator(); it.hasNext();) {...}
>  
> This is a lot less readable to me and I therefore wanted to turn off this 
> hint. 
>  
> However, The  doesn’t offer the option to disable this hint and I 
> couldn’t find it in the Tools > Options > Editor > Hints (Java) list, 
> although I found lots of other nice hints that I have turned on!  
>  
> I found this on Stack Overflow
>  
> https://stackoverflow.com/questions/24263479/netbeans-convert-to-for-iterator-suggestion
>  
> But that was to do with which one is more efficient and I suspect that the 
> warning is due to the fact that the more verbose version is quicker if the 
> number of elements in the iterator is very large.
>  
> Am I stuck with this, or is it that I just overlooked where the hint is in 
> the long list?
>  
>  
> John


NetBeans `Convert to for (Iterator...) {}' suggestion

2022-11-28 Thread John
Hi, Quick one. I have just installed a vanilla Netbeans 15 and when I write a line such as for (Word word : this.dictionary) {...} Netbeans offers me a Warning / Recommendation  `Convert to for (Iterator...) {}' That, if chosen, converts my syntax to for (Iterator it = this.dictionary.iterator(); it.hasNext();) {...} This is a lot less readable to me and I therefore wanted to turn off this hint.  However, The  doesn’t offer the option to disable this hint and I couldn’t find it in the Tools > Options > Editor > Hints (Java) list, although I found lots of other nice hints that I have turned on!   I found this on Stack Overflow https://stackoverflow.com/questions/24263479/netbeans-convert-to-for-iterator-suggestion But that was to do with which one is more efficient and I suspect that the warning is due to the fact that the more verbose version is quicker if the number of elements in the iterator is very large. Am I stuck with this, or is it that I just overlooked where the hint is in the long list?  John 

-
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

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