[jira] [Updated] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Bresie updated NETBEANS-5831:
--
Description: 
Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the 
connection", it was found when connectionless case occurs, this prevented auto 
completion because it relies on connection (DB metadata) based class to return 
back identifiers which may require further "quoting" to accomidate different DB 
vendor quotring behavior.  When connection is not available, the db metadata 
based class does not provide back any usable token for use in auto completion 
and more specifically when quoting these identifier tokens.  

Initial changes in PR-2820 handle specific cases to handled null quoter (due to 
lack of a connection) where applicable to allow autocompletion without 
connection to occur.  As part of the review of PR, It was suggested to refactor 
some of this code to develop "ConnectionLess" functionality to better isolate 
the connection vs connectionless functionality.  This may involve development 
of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on 
a connection (and metadata based identifiers).  

>From NETBEANS-189 comments:

{code:java}
(6) Potentially larger architectural change may be needed to allow for 
Connection or Connectionless cases involving changes (rather than case by case 
changes in a number of places), which may involve introducing a new "Standard 
SQL Quoter" class for use when connection is not available instead of the 
Metadata (from the connection based handling of identifiers) which I suggest 
needs a separate ticket to create a Standard SQL Quoter class and retrofit the 
code as part of that work.
The Standard SQl Quoter may involve standardized quoting of identifiers similar 
to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF 
). For this, would need to better understand what the expected input/outputs 
are for this and what kind of tests would be needed to confirm this does as 
expected beyond the existing sql tests.
(7) There may be another SQL improvements ticket to raise to account for 
additional possible missing autocomplete tokens like what is listed in the w3 
reference above which mentions after "SELECT" there can be optionally "DISTINCT 
| ALL" and either a wildcard ("*"). This is different from selection list of 
possible connection based identifiers.
{code}


Reference:
# https://issues.apache.org/jira/browse/NETBEANS-189
# https://github.com/apache/netbeans/pull/2820


  was:
Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the 
connection", it was found when connectionless case occurs, this prevented auto 
completion because it relies on connection (DB metadata) based class to return 
back identifiers which may require further "quoting" to accomidate different DB 
vendor quotring behavior.  When connection is not available, the db metadata 
based class does not provide back any usable token for use in auto completion 
and more specifically when quoting these identifier tokens.  

Initial changes in PR-2820 handle specific cases to handled null quoter (due to 
lack of a connection) where applicable to allow autocompletion without 
connection to occur.  As part of the review of PR, It was suggested to refactor 
some of this code to develop "ConnectionLess" functionality to better isolate 
the connection vs connectionless functionality.  This may involve development 
of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on 
a connection (and metadata based identifiers).  

>From NETBEANS-189 comments:
??(6) Potentially larger architectural change may be needed to allow for 
Connection or Connectionless cases involving changes (rather than case by case 
changes in a number of places), which may involve introducing a new "Standard 
SQL Quoter" class for use when connection is not available instead of the 
Metadata (from the connection based handling of identifiers) which I suggest 
needs a separate ticket to create a Standard SQL Quoter class and retrofit the 
code as part of that work.
The Standard SQl Quoter may involve standardized quoting of identifiers similar 
to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF 
). For this, would need to better understand what the expected input/outputs 
are for this and what kind of tests would be needed to confirm this does as 
expected beyond the existing sql tests.
(7) There may be another SQL improvements ticket to raise to account for 
additional possible missing autocomplete tokens like what is listed in the w3 
reference above which mentions after "SELECT" there can be optionally "DISTINCT 
| ALL" and either a wildcard ("*"). This is different from selection list of 
possible connection based identifiers.??

Reference:
# https://issues.apache.org/jira/browse/NETBEANS-189
# 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:13 PM:


Key points from PR-2820 comments:


{code:java}
matthiasblaesing on Mar 21
You could create an SQL Standard Quoter

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] [addressing different 
identifiers for different DB systems] does look more complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change 

[jira] [Updated] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Bresie updated NETBEANS-5831:
--
Description: 
Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the 
connection", it was found when connectionless case occurs, this prevented auto 
completion because it relies on connection (DB metadata) based class to return 
back identifiers which may require further "quoting" to accomidate different DB 
vendor quotring behavior.  When connection is not available, the db metadata 
based class does not provide back any usable token for use in auto completion 
and more specifically when quoting these identifier tokens.  

Initial changes in PR-2820 handle specific cases to handled null quoter (due to 
lack of a connection) where applicable to allow autocompletion without 
connection to occur.  As part of the review of PR, It was suggested to refactor 
some of this code to develop "ConnectionLess" functionality to better isolate 
the connection vs connectionless functionality.  This may involve development 
of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on 
a connection (and metadata based identifiers).  

>From NETBEANS-189 comments:
??(6) Potentially larger architectural change may be needed to allow for 
Connection or Connectionless cases involving changes (rather than case by case 
changes in a number of places), which may involve introducing a new "Standard 
SQL Quoter" class for use when connection is not available instead of the 
Metadata (from the connection based handling of identifiers) which I suggest 
needs a separate ticket to create a Standard SQL Quoter class and retrofit the 
code as part of that work.
The Standard SQl Quoter may involve standardized quoting of identifiers similar 
to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF 
). For this, would need to better understand what the expected input/outputs 
are for this and what kind of tests would be needed to confirm this does as 
expected beyond the existing sql tests.
(7) There may be another SQL improvements ticket to raise to account for 
additional possible missing autocomplete tokens like what is listed in the w3 
reference above which mentions after "SELECT" there can be optionally "DISTINCT 
| ALL" and either a wildcard ("*"). This is different from selection list of 
possible connection based identifiers.??

Reference:
# https://issues.apache.org/jira/browse/NETBEANS-189
# https://github.com/apache/netbeans/pull/2820


  was:
Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the 
connection", it was found when connectionless case occurs, this prevented auto 
completion because it relies on connection (DB metadata) based class to return 
back identifiers which may require further "quoting" to accomidate different DB 
vendor quotring behavior.  When connection is not available, the db metadata 
based class does not provide back any usable token for use in auto completion 
and more specifically when quoting these identifier tokens.  

Initial changes in PR-2820 handle specific cases to handled null quoter (due to 
lack of a connection) where applicable to allow autocompletion without 
connection to occur.  As part of the review of PR, It was suggested to refactor 
some of this code to develop "ConnectionLess" functionality to better isolate 
the connection vs connectionless functionality.  This may involve development 
of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on 
a connection (and metadata based identifiers).  


>From NETBEANS-189 comments:
??(6) Potentially larger architectural change may be needed to allow for 
Connection or Connectionless cases involving changes (rather than case by case 
changes in a number of places), which may involve introducing a new "Standard 
SQL Quoter" class for use when connection is not available instead of the 
Metadata (from the connection based handling of identifiers) which I suggest 
needs a separate ticket to create a Standard SQL Quoter class and retrofit the 
code as part of that work.
The Standard SQl Quoter may involve standardized quoting of identifiers similar 
to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF 
). For this, would need to better understand what the expected input/outputs 
are for this and what kind of tests would be needed to confirm this does as 
expected beyond the existing sql tests.
(7) There may be another SQL improvements ticket to raise to account for 
additional possible missing autocomplete tokens like what is listed in the w3 
reference above which mentions after "SELECT" there can be optionally "DISTINCT 
| ALL" and either a wildcard ("*"). This is different from selection list of 
possible connection based identifiers.??

Reference:
# https://issues.apache.org/jira/browse/NETBEANS-189
# 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:10 PM:


Key points from PR-2820 comments:

matthiasblaesing on Mar 21
You could create an SQL Standard Quoter

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] [addressing different 
identifiers for different DB systems] does look more complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:07 PM:


Key points from PR-2820 comments:

matthiasblaesing on Mar 21
You could create an SQL Standard Quoter, but returning the empty string here 
looks strange.

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] it does look more 
complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:07 PM:


Key points from PR-2820 comments:

??matthiasblaesing on Mar 21
You could create an SQL Standard Quoter, but returning the empty string here 
looks strange.
??
ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] it does look more 
complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:07 PM:


Key points from PR-2820 comments:

{{matthiasblaesing on Mar 21
You could create an SQL Standard Quoter, but returning the empty string here 
looks strange.

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] it does look more 
complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to 

[jira] [Commented] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie commented on NETBEANS-5831:
---

Key points from PR-2820 comments:

matthiasblaesing on Mar 21
You could create an SQL Standard Quoter, but returning the empty string here 
looks strange.

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] it does look more 
complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to implement a new ConnectionLessQuoter or 
BasicQuoter 

[jira] [Comment Edited] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373630#comment-17373630
 ] 

Eric Bresie edited comment on NETBEANS-5831 at 7/2/21, 4:06 PM:


Key points from PR-2820 comments:

??matthiasblaesing on Mar 21
You could create an SQL Standard Quoter, but returning the empty string here 
looks strange.

ebresie on Mar 21
how should that "Quoter" be created?

I see a case like the below using SQLIdentifer to created it, but in this case 
since there is no conn available, using the meta data I don't believe would be 
possible.

DatabaseMetaData dmd = conn.getMetaData();
quoter = SQLIdentifiers.createQuoter(dmd)

I see a constructor for NonASCIIQuoter(String quoteString) which extends from 
Quoter, however the NonASCIIQuoter is a test class so assume that isn't usable 
in this case.

 matthiasblaesing on Mar 22 
It depends. I was the one, that pointed out, that it is highly problematic to 
try to create a completion without a corresponding connection. There is 
Standard SQL, so you can build a quoter based on that, but then you also need 
to guess what is considered a keyword and what not.

Maybe there is a different approach possible: Don't try to be clever and use a 
parser, but use keyword based completion. You could have a look at phpmyadmin 
completion how it is handled there. I doubt, that they went the way of a full 
parser in JS, but most probably complete based on keyword prefix matching.

ebresie on Apr 6
Just for clarification, what is meant by "Standard SQL" in this context? Are 
you talking about a specific class, a "new class", or referring to "standard 
SQL syntax"?

Presently the constructor/creators of Quoters that I found was mainly the 
"SqlIdentifiers.createQuoter which requires a DatabaseMetadata parameter; if 
the connection is not available, then assume getting the DatabaseMetaData is 
not possible. There is the "NonASCIIQuoter" but this is a test class and not in 
the main codebase.

As an alternative, in that code it uses the quoter to "unquote" stuff, but if a 
quoter is not available (due to lack of connection), could it just return the 
text as is with something like?

if (quoter == null)
return seq.token().text().toString();

ebresie on Apr 9
Looking at one of the [w3 resources SQL syntax page in identifier section 
|https://www.w3resource.com/sql/sql-syntax.php#IDENTIF] it does look more 
complicated.

The w3 reference mentions after "SELECT" there can be optionally "DISTINCT | 
ALL" and either a wildcard ("*") or select List (i.e. identifiers). Unless I've 
missed it, I'm not sure these cases are handled. Is a new issue for adding that 
worth wild?

@ebresie ebresie on Apr 11
When using another tool for SQL it allows user to write without a connection 
but cannot execute sql or do autocomplete without it.
 
@ebresie ebresie on Apr 15
Unless I'm assuming incorrectly, when no connection is active, then assume no 
real need to quote/unquote any table/column would be necessary, so is going 
with the below reasonable?

if (quoter == null)
return seq.token().text().toString();
 
@matthiasblaesing matthiasblaesing on Apr 15
My pain point: Instead of trying to fix logic, that relies hard on a 
connection, why not refactor this to split connection less and connction 
required codepaths, then it would be clear and you'd not need to unquote.

@ebresie ebresie on Apr 16 Author Contributor
Matthias, I appreciate the feedback. As a new commiter, I know I;m not there 
yet but will get there with help.

The original scope of this ticket was...if no connection, allow some form of 
auto completion without connection based details and avoid the connection 
dialog from preventing futher autocompletion. As it is now I think it does this.

The remaining concenrs is how getUnquotedIdentifier behaves when no connection 
is available. Initial changes was to returned "", which I realize is wrong, 
risking the loss of given seq.token.txt details. Next change was to return the 
results without being "unquoted" with given "return 
seq.token().text().toString();"; whether it needed or not was dependent on the 
database in use which if not available is where problems may occur. When quoter 
is not available or used avoids risk of a null pointers and return the sequence 
of text in the given context without being concerned without being "unquoted" 
independent of whether a "quoter" was available or not.

When quoter is available and calls the "unquote" method found in the 
SQLIdentifer.Quoter abstract class which is implemented/extended in the 
DatabaseMetaDataQuoter implementation; if quoter was set correctly previously 
(when DB is available) then instance of quoter should be available and all is 
right with the world. However, when quoter is unavailable (not connection and 
not setup earlier) then something different is needed.

So is the change suggetion to 

[jira] [Commented] (NETBEANS-189) SQL editor, shouldn't ask evertime to set the connection

2021-07-02 Thread Eric Bresie (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373620#comment-17373620
 ] 

Eric Bresie commented on NETBEANS-189:
--

I have created "NETBEANS-5831 Create a SQL Standard Quoter for Use with 
Connectionless Cases" to accomidate items (6) and (7) listed above on SQL 
Standard Quoter and additional optional identifiers.

> SQL editor, shouldn't ask evertime to set the connection
> 
>
> Key: NETBEANS-189
> URL: https://issues.apache.org/jira/browse/NETBEANS-189
> Project: NetBeans
>  Issue Type: Improvement
>  Components: db - SQL Editor
>Affects Versions: Next
>Reporter: Christian Lenz
>Assignee: Eric Bresie
>Priority: Major
>  Labels: pull-request-available
> Attachments: SQL Notification.png, required-connection.gif
>
>  Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> Of course, the SQL editor doesn't make sense, if you don't set a connection 
> to see databases, tables and columns, but sometimes or often, you only want 
> to scratch a SQL query and you want the code completion for the SQL stuff, 
> like the keywords (SELECT, FROM, WHERE) or aggregate functions (COUNT, AVG, 
> etc.) So this is not possible, without setting a connection. But when I don't 
> have a connection, I can't use the code completion, becauses it will ends up 
> in a loop. See my little screen capture for what I mean.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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



[jira] [Created] (NETBEANS-5831) Create a SQL Standard Quoter for Use with Connectionless Cases

2021-07-02 Thread Eric Bresie (Jira)
Eric Bresie created NETBEANS-5831:
-

 Summary: Create a SQL Standard Quoter for Use with Connectionless 
Cases
 Key: NETBEANS-5831
 URL: https://issues.apache.org/jira/browse/NETBEANS-5831
 Project: NetBeans
  Issue Type: Improvement
  Components: db - SQL Editor
Affects Versions: 12.4
Reporter: Eric Bresie


Based on "NETBEANS-189 SQL editor, shouldn't ask evertime to set the 
connection", it was found when connectionless case occurs, this prevented auto 
completion because it relies on connection (DB metadata) based class to return 
back identifiers which may require further "quoting" to accomidate different DB 
vendor quotring behavior.  When connection is not available, the db metadata 
based class does not provide back any usable token for use in auto completion 
and more specifically when quoting these identifier tokens.  

Initial changes in PR-2820 handle specific cases to handled null quoter (due to 
lack of a connection) where applicable to allow autocompletion without 
connection to occur.  As part of the review of PR, It was suggested to refactor 
some of this code to develop "ConnectionLess" functionality to better isolate 
the connection vs connectionless functionality.  This may involve development 
of a Standard SQL Quoter to accomidate basic SQL quoter logic not dependent on 
a connection (and metadata based identifiers).  


>From NETBEANS-189 comments:
??(6) Potentially larger architectural change may be needed to allow for 
Connection or Connectionless cases involving changes (rather than case by case 
changes in a number of places), which may involve introducing a new "Standard 
SQL Quoter" class for use when connection is not available instead of the 
Metadata (from the connection based handling of identifiers) which I suggest 
needs a separate ticket to create a Standard SQL Quoter class and retrofit the 
code as part of that work.
The Standard SQl Quoter may involve standardized quoting of identifiers similar 
to what is discussed here https://www.w3resource.com/sql/sql-syntax.php#IDENTIF 
). For this, would need to better understand what the expected input/outputs 
are for this and what kind of tests would be needed to confirm this does as 
expected beyond the existing sql tests.
(7) There may be another SQL improvements ticket to raise to account for 
additional possible missing autocomplete tokens like what is listed in the w3 
reference above which mentions after "SELECT" there can be optionally "DISTINCT 
| ALL" and either a wildcard ("*"). This is different from selection list of 
possible connection based identifiers.??

Reference:
# https://issues.apache.org/jira/browse/NETBEANS-189
# https://github.com/apache/netbeans/pull/2820




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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



[jira] [Created] (NETBEANS-5830) Various Errors When Trying to Refactor Code

2021-07-02 Thread Marvin Warble (Jira)
Marvin Warble created NETBEANS-5830:
---

 Summary: Various Errors When Trying to Refactor Code
 Key: NETBEANS-5830
 URL: https://issues.apache.org/jira/browse/NETBEANS-5830
 Project: NetBeans
  Issue Type: Bug
  Components: java - Source
Affects Versions: 12.2, 12.1, 12.3, 12.4
 Environment: Windows 10

JDK 15
Reporter: Marvin Warble


In all versions of NB > 12.0, I regularly experience problems / exceptions when 
trying to refactor classes.  In some cases, when moving a class to a new 
package, NB will scramble the import statements contained in classes that 
depend on the moved class.  In other cases, when trying to rename a class, NB 
will rename the file, but fail to rename the class.  And in other cases, when 
trying to move a class to a new package, NB will generate an exception:

 

- Classpath: -- Classpath: 
-bootPath: 
nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.base/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.compiler/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.datatransfer/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.desktop/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.management/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.naming/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.prefs/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.security.jgss/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/java.xml/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.accessibility/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.attach/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.compiler/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.dynalink/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.httpserver/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jartool/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.javadoc/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jconsole/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jdi/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jfr/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jshell/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.jsobject/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.management/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.management.jfr/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.net/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.nio.mapmode/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.sctp/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.security.auth/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.security.jgss/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.unsupported/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.unsupported.desktop/;nbjrt:file:/C:/Program%20Files/AdoptOpenJDK/jdk-15.0.2.7-hotspot/!/modules/jdk.xml.dom/classPath:
 

[jira] [Commented] (NETBEANS-5368) Deadlock while performing build with ant

2021-07-02 Thread Eric D. (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-5368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17373487#comment-17373487
 ] 

Eric D. commented on NETBEANS-5368:
---

I reported this bug to ANT: see 
[https://bz.apache.org/bugzilla/show_bug.cgi?id=65424]

 

> Deadlock while performing build with ant
> 
>
> Key: NETBEANS-5368
> URL: https://issues.apache.org/jira/browse/NETBEANS-5368
> Project: NetBeans
>  Issue Type: Bug
>  Components: projects - Ant
>Affects Versions: 12.2, 12.4
>Reporter: Georg Lodde
>Priority: Major
> Attachments: deadlock-nb12-ant-contrib.log
>
>
> DeadLockWatchDog::Info 16.02.2021 13:47:30,920 - parallel-Timer-0-521
> Dump Of All Stack Traces
> 
> "Thread-316"-742 BLOCKED 3eb00055
>  waiting on org.apache.tools.ant.AntClassLoader@208b152f locked by 
> "Thread-312-738"
>  at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1083)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
>  at 
> de.materna.view.build.ant.taskdefs.SignedForClient.setPermissions(SignedForClient.java:41)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at 
> org.apache.tools.ant.IntrospectionHelper$AttributeSetter.setObject(IntrospectionHelper.java:1488)
>  at 
> org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:406)
>  - locked  at 
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:527)
>  at 
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:463)
>  at org.apache.tools.ant.Task.maybeConfigure(Task.java:203)
>  at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:201)
>  at 
> org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:165)
>  at org.apache.tools.ant.Task.perform(Task.java:349)
>  at 
> org.apache.tools.ant.taskdefs.Sequential$$Lambda$287/1616945790.accept(Unknown
>  Source)
>  - locked  at 
> java.util.Vector.forEach(Vector.java:1277)
>  at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
>  at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
>  at sun.reflect.GeneratedMethodAccessor431.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>  at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:155)
>  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>  at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>  at org.apache.tools.ant.Task.perform(Task.java:350)
>  at 
> org.apache.tools.ant.taskdefs.Sequential$$Lambda$287/1616945790.accept(Unknown
>  Source)
>  - locked  at 
> java.util.Vector.forEach(Vector.java:1277)
>  at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
>  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>  at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>  at org.apache.tools.ant.Task.perform(Task.java:350)
>  at 
> org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
>  at sun.reflect.GeneratedMethodAccessor453.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>  at org.apache.tools.ant.Task.perform(Task.java:350)
>  at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:454)
>  at java.lang.Thread.run(Thread.java:748)
> "Thread-315"-741 BLOCKED 7f8d0a6e
>  waiting on org.apache.tools.ant.AntClassLoader@208b152f locked by 
> "Thread-312-738"
>  at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1083)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
>  at 
> de.materna.view.build.ant.taskdefs.SignedForClient.setPermissions(SignedForClient.java:41)
>  at 

svn commit: r48626 - /dev/netbeans/native/netbeans-launchers/12.5/ /release/netbeans/native/ /release/netbeans/native/netbeans-launchers/ /release/netbeans/native/netbeans-launchers/12.5/

2021-07-02 Thread skygo
Author: skygo
Date: Fri Jul  2 12:19:05 2021
New Revision: 48626

Log:
add Apache NetBeans 12.5 native launchers

Added:
release/netbeans/native/
release/netbeans/native/netbeans-launchers/
release/netbeans/native/netbeans-launchers/12.5/
  - copied from r48625, dev/netbeans/native/netbeans-launchers/12.5/
Removed:
dev/netbeans/native/netbeans-launchers/12.5/


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

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



[netbeans] branch master updated: Completion provider for VS Code's launch.json.

2021-07-02 Thread entl
This is an automated email from the ASF dual-hosted git repository.

entl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 2ae14c0  Completion provider for VS Code's launch.json.
2ae14c0 is described below

commit 2ae14c0fb2e09816cb2fb9c1ef9aa18b98d3f446
Author: Martin Entlicher 
AuthorDate: Tue Jun 29 20:30:45 2021 +0200

Completion provider for VS Code's launch.json.
---
 .../netbeans/modules/java/lsp/server/Utils.java|  55 
 .../attach/AttachConfigurationCompletion.java  | 141 +++
 .../debugging/attach/AttachConfigurations.java | 119 +++-
 .../debugging/attach/ConfigurationAttribute.java   |  50 +++
 .../debugging/attach/ConfigurationAttributes.java  | 141 +++
 .../debugging/attach/NbAttachRequestHandler.java   | 107 +--
 .../protocol/LaunchConfigurationCompletion.java|  68 ++
 .../protocol/ProjectConfigurationCompletion.java   | 137 +++
 .../modules/java/lsp/server/protocol/Server.java   |   5 +
 .../lsp/server/protocol/WorkspaceServiceImpl.java  |  61 +
 .../modules/java/lsp/server/UtilsTest.java |  53 
 java/java.lsp.server/vscode/package-lock.json  |   5 +
 java/java.lsp.server/vscode/package.json   |   1 +
 java/java.lsp.server/vscode/src/extension.ts   |  22 +--
 .../vscode/src/launchConfigurations.ts | 150 +
 15 files changed, 962 insertions(+), 153 deletions(-)

diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
index 849c26f..248f642 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java
@@ -18,6 +18,7 @@
  */
 package org.netbeans.modules.java.lsp.server;
 
+import com.google.gson.stream.JsonWriter;
 import com.sun.source.tree.CompilationUnitTree;
 import com.sun.source.tree.LineMap;
 import com.sun.source.tree.Tree;
@@ -27,6 +28,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.StringWriter;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -223,4 +225,57 @@ public class Utils {
 private static File getCacheDir() {
 return Places.getCacheSubfile("java-server");
 }
+
+private static final char[] SNIPPET_ESCAPE_CHARS = new char[] { '\\', '$', 
'}' };
+/**
+ * Escape special characters in a completion snippet. Characters '$' and 
'}'
+ * are escaped via backslash.
+ */
+public static String escapeCompletionSnippetSpecialChars(String text) {
+if (text.isEmpty()) {
+return text;
+}
+for (char c : SNIPPET_ESCAPE_CHARS) {
+StringBuilder replaced = null;
+int lastPos = 0;
+int i = 0;
+while ((i = text.indexOf(c, i)) >= 0) {
+if (replaced == null) {
+replaced = new StringBuilder(text.length() + 5); // Text 
length + some escapes
+}
+replaced.append(text.substring(lastPos, i));
+replaced.append('\\');
+lastPos = i;
+i += 1;
+}
+if (replaced != null) {
+replaced.append(text.substring(lastPos, text.length()));
+text = replaced.toString();
+}
+replaced = null;
+}
+return text;
+}
+
+/**
+ * Encode a String value to a valid JSON value. Enclose into quotes 
explicitly when needed.
+ */
+public static String encode2JSON(String value) {
+if (value.isEmpty()) {
+return value;
+}
+StringWriter sw = new StringWriter();
+try (JsonWriter w = new JsonWriter(sw)) {
+w.beginArray();
+w.value(value);
+w.endArray();
+w.flush();
+} catch (IOException ex) {
+Exceptions.printStackTrace(ex);
+}
+String encoded = sw.toString();
+// We have ["value"], remove the array and quotes
+return encoded.substring(2, encoded.length() - 2);
+}
+
 }
diff --git 
a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
new file mode 100644
index 000..e17c152
--- /dev/null
+++ 
b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/attach/AttachConfigurationCompletion.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor 

[netbeans] branch master updated: Prefer .class execution over .java if the class already exists

2021-07-02 Thread jtulach
This is an automated email from the ASF dual-hosted git repository.

jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 8d822bf  Prefer .class execution over .java if the class already exists
 new bd41d87  Merge pull request #3036 from 
JaroslavTulach/jtulach/SingleExecPreferClass
8d822bf is described below

commit 8d822bfce59b269ca6ea2b7c8848e2aff358ee0d
Author: Jaroslav Tulach 
AuthorDate: Fri Jul 2 07:38:18 2021 +0200

Prefer .class execution over .java if the class already exists
---
 .../java/api/common/singlesourcefile/LaunchProcess.java  |  2 +-
 .../api/common/singlesourcefile/SingleSourceFileUtil.java|  4 
 .../common/singlesourcefile/SingleSourceFileUtilTest.java| 12 +++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git 
a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/LaunchProcess.java
 
b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/LaunchProcess.java
index 6902319..0421828 100644
--- 
a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/LaunchProcess.java
+++ 
b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/LaunchProcess.java
@@ -53,7 +53,7 @@ final class LaunchProcess implements Callable {
 
 private Process setupProcess(String port) throws InterruptedException {
 try {
-boolean compile = SingleSourceFileUtil.findJavaVersion() < 11;
+boolean compile = SingleSourceFileUtil.findJavaVersion() < 11 || 
SingleSourceFileUtil.hasClassSibling(fileObject);
 
 if (compile) {
 Process p = SingleSourceFileUtil.compileJavaSource(fileObject);
diff --git 
a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtil.java
 
b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtil.java
index 3a76836..2914ee0 100644
--- 
a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtil.java
+++ 
b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtil.java
@@ -101,4 +101,8 @@ final class SingleSourceFileUtil {
 return null;
 }
 
+static boolean hasClassSibling(FileObject fo) {
+return fo.getParent().getFileObject(fo.getName(), "class") != null;
+}
+
 }
diff --git 
a/java/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtilTest.java
 
b/java/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtilTest.java
index a380a05..016eab8 100644
--- 
a/java/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtilTest.java
+++ 
b/java/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/singlesourcefile/SingleSourceFileUtilTest.java
@@ -40,5 +40,15 @@ public class SingleSourceFileUtilTest {
 assertEquals("Java FileObject found in the lookup", java, result);
 }
 
-
+@Test
+public void testCanFindSiblingClass() throws IOException {
+final FileObject folder = 
FileUtil.createMemoryFileSystem().getRoot().createFolder("dir");
+FileObject java = folder.createData("Ahoj.java");
+assertFalse("No sibling found", 
SingleSourceFileUtil.hasClassSibling(java));
+
+FileObject clazz = folder.createData("Ahoj.class");
+assertNotNull("class created", clazz);
+
+assertTrue("Sibling found", 
SingleSourceFileUtil.hasClassSibling(java));
+}
 }

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

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



[jira] [Updated] (NETBEANS-5829) Incorrect "Text blocks aren't supported"

2021-07-02 Thread Jaroslav Tulach (Jira)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-5829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jaroslav Tulach updated NETBEANS-5829:
--
Description: 
Get 
[https://github.com/apache/netbeans-html4j/blob/release-1.7.2/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaScriptAction.java#L36],
 open it in most recent NetBeans IDE running on JDK8 (with nbjavac@16.0.0.0 
installed) and try to convince the editor to not show errors about text blocks:

!image-2021-07-02-08-47-25-560.png!

Is there some way to do so? It is very annoying to have the source tree full of 
useless errors related to text blocks, when everything compiles and runs fine. 
The project's source level is set to 15 and Maven support shall report that to 
{{java.source}}. Any help welcomed.

  was:
Get 
[https://github.com/apache/netbeans-html4j/blob/release-1.7.2/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaScriptAction.java#L36],
 open it in most recent NetBeans IDE running on JDK8 (with nbjavac@16.0.0.0 
installed) and try to convince the editor to not show errors about text blocks:

!image-2021-07-02-08-47-25-560.png!

Is there some way to do so? It is very annoying to have the source tree full of 
useless errors related to text blocks, when everything compiles and runs fine. 
Any help welcomed.


> Incorrect "Text blocks aren't supported"
> 
>
> Key: NETBEANS-5829
> URL: https://issues.apache.org/jira/browse/NETBEANS-5829
> Project: NetBeans
>  Issue Type: Bug
>  Components: java - Source
>Reporter: Jaroslav Tulach
>Assignee: Jan Lahoda
>Priority: Major
> Attachments: image-2021-07-02-08-47-25-560.png
>
>
> Get 
> [https://github.com/apache/netbeans-html4j/blob/release-1.7.2/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaScriptAction.java#L36],
>  open it in most recent NetBeans IDE running on JDK8 (with nbjavac@16.0.0.0 
> installed) and try to convince the editor to not show errors about text 
> blocks:
> !image-2021-07-02-08-47-25-560.png!
> Is there some way to do so? It is very annoying to have the source tree full 
> of useless errors related to text blocks, when everything compiles and runs 
> fine. The project's source level is set to 15 and Maven support shall report 
> that to {{java.source}}. Any help welcomed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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



[jira] [Created] (NETBEANS-5829) Incorrect "Text blocks aren't supported"

2021-07-02 Thread Jaroslav Tulach (Jira)
Jaroslav Tulach created NETBEANS-5829:
-

 Summary: Incorrect "Text blocks aren't supported"
 Key: NETBEANS-5829
 URL: https://issues.apache.org/jira/browse/NETBEANS-5829
 Project: NetBeans
  Issue Type: Bug
  Components: java - Source
Reporter: Jaroslav Tulach
Assignee: Jan Lahoda
 Attachments: image-2021-07-02-08-47-25-560.png

Get 
[https://github.com/apache/netbeans-html4j/blob/release-1.7.2/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaScriptAction.java#L36],
 open it in most recent NetBeans IDE running on JDK8 (with nbjavac@16.0.0.0 
installed) and try to convince the editor to not show errors about text blocks:

!image-2021-07-02-08-47-25-560.png!

Is there some way to do so? It is very annoying to have the source tree full of 
useless errors related to text blocks, when everything compiles and runs fine. 
Any help welcomed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

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



[netbeans] branch master updated (9557ac0 -> 4cd73b1)

2021-07-02 Thread dbalek
This is an automated email from the ASF dual-hosted git repository.

dbalek pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git.


from 9557ac0  Merge pull request #3034 from sdedic/groovy/parser-fixes
 add 4cd73b1  Groovy: Go to declaration should work for annotations. (#3035)

No new revisions were added by this update.

Summary of changes:
 .../modules/groovy/editor/api/FindTypeUtils.java   | 33 --
 .../groovy/editor/api/PathFinderVisitor.java   | 12 
 .../editor/language/GroovyDeclarationFinder.java   |  6 +++-
 .../testfiles/declarationfinder/Annotations.groovy | 12 
 .../testfiles/declarationfinder/a/Annotation.java  |  5 
 .../editor/api/GroovyDeclarationFinderTest.java| 25 
 6 files changed, 65 insertions(+), 28 deletions(-)
 create mode 100644 
groovy/groovy.editor/test/unit/data/testfiles/declarationfinder/Annotations.groovy
 create mode 100644 
groovy/groovy.editor/test/unit/data/testfiles/declarationfinder/a/Annotation.java

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

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