You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/10/09 00:04:29 UTC
[GitHub] [netbeans] mbien opened a new pull request #3228: fixed class modifier auto completion when sealed classes are involved.
mbien opened a new pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228
minor bugfix:
`contains(String)` was called on a `Set` containing `Modifier` enums - which is always false.
Although we can't use the two sealed enums directly since they are JDK 17+, they can be still queried via a little utility method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jlahoda commented on pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
jlahoda commented on pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#issuecomment-983010061
> @matthiasblaesing thanks. will do. Would be nice if @jlahoda could take a look. Because i have the suspicion that the golden files still have to be in the 1.8 folder but i am not 100% certain. It depends on whether NB 13 having JDK 17 compatible nb-javac installed by default or not I guess.
Yes, I think it would be preferrable to have the in the 1.8 folder. The folders represent the runtime platform, and are unrelated to the source level supported by the Java parser. (If the selected Java parser does not support the source level, the test will be skipped anyway, but I think we are heading to a place where this won't happen normally.) I realize this is fairly confusing.
Otherwise looks good!
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
mbien commented on pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#issuecomment-982992993
@matthiasblaesing thanks. will do. Would be nice if @jlahoda could take a look. Because i have the suspicion that the golden files still have to be in the 1.8 folder but i am not 100% certain. It depends on whether NB 13 having JDK 17 compatible nb-javac installed by default or not I guess.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a change in pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#discussion_r759620529
##########
File path: java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
##########
@@ -4880,6 +4886,14 @@ private void addClassModifiers(Env env, Set<Modifier> modifiers) {
}
}
+ private static boolean contains(Set<Modifier> modifiers, String modifier) {
+ try {
+ return modifiers.contains(Modifier.valueOf(modifier));
+ } catch (IllegalArgumentException ex) {
Review comment:
it shouldn't be a problem there since its called only a handful of times per completion. But i do agree in principle, exceptions should be avoided if possible.
Additionally: it won't throw with recent javacs, be it auto-javac or JDK's. If java 17 javac is standard we can remove all the workarounds and use the enum directly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jlahoda commented on pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
jlahoda commented on pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#issuecomment-983330785
Looks good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
mbien commented on pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#issuecomment-980817507
@Akshay-Gupta-Oracle @matthiasblaesing @jlahoda anyone interested to review this?
Had time to add some tests now. i give this a 75% chance that I did put the golden files into the wrong folder (again).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
mbien commented on pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#issuecomment-983134986
@jlahoda thanks jan! Moved them to the 1.8 folder.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jlahoda merged pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
jlahoda merged pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#discussion_r759605602
##########
File path: java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
##########
@@ -4880,6 +4886,14 @@ private void addClassModifiers(Env env, Set<Modifier> modifiers) {
}
}
+ private static boolean contains(Set<Modifier> modifiers, String modifier) {
+ try {
+ return modifiers.contains(Modifier.valueOf(modifier));
+ } catch (IllegalArgumentException ex) {
Review comment:
How performance critical is this? I read somewhere, that exception handling is not the fast path in the JVM, so if this is a problem we'd need to buffer that.
##########
File path: harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
##########
@@ -739,7 +739,7 @@ static public void assertFile(String message, File test, File pass, File diff, D
} else {
try {
if (diffImpl.diff(test, pass, diffFile)) {
- throw new AssertionFileFailedError(message, null == diffFile ? "" : diffFile.getAbsolutePath());
+ throw new AssertionFileFailedError(message+"\n diff: "+diffFile, null == diffFile ? "" : diffFile.getAbsolutePath());
Review comment:
How large are the files? I think the `diffFile` should lenght limited.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on a change in pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
mbien commented on a change in pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#discussion_r759613479
##########
File path: harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
##########
@@ -739,7 +739,7 @@ static public void assertFile(String message, File test, File pass, File diff, D
} else {
try {
if (diffImpl.diff(test, pass, diffFile)) {
- throw new AssertionFileFailedError(message, null == diffFile ? "" : diffFile.getAbsolutePath());
+ throw new AssertionFileFailedError(message+"\n diff: "+diffFile, null == diffFile ? "" : diffFile.getAbsolutePath());
Review comment:
it only prints the fileneme. so that you can quickly cat in bash to see what the problem is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#discussion_r759629398
##########
File path: harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
##########
@@ -739,7 +739,7 @@ static public void assertFile(String message, File test, File pass, File diff, D
} else {
try {
if (diffImpl.diff(test, pass, diffFile)) {
- throw new AssertionFileFailedError(message, null == diffFile ? "" : diffFile.getAbsolutePath());
+ throw new AssertionFileFailedError(message+"\n diff: "+diffFile, null == diffFile ? "" : diffFile.getAbsolutePath());
Review comment:
A should have been obvious - thx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3228: fixed class modifier auto completion for sealed classes.
Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #3228:
URL: https://github.com/apache/netbeans/pull/3228#discussion_r759629632
##########
File path: java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
##########
@@ -4880,6 +4886,14 @@ private void addClassModifiers(Env env, Set<Modifier> modifiers) {
}
}
+ private static boolean contains(Set<Modifier> modifiers, String modifier) {
+ try {
+ return modifiers.contains(Modifier.valueOf(modifier));
+ } catch (IllegalArgumentException ex) {
Review comment:
Thanks for confirming.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists