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 2020/07/30 12:54:07 UTC

[GitHub] [netbeans] Akshay-Gupta-Oracle opened a new pull request #2282: [NETBEANS-3990] Sealed hint,color and formatting

Akshay-Gupta-Oracle opened a new pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282


   JDK-14 sealed support for IDE with hint to add sealed in a parent class with all the sub classes in permits clause, color for keyword sealed,non-sealed and permits, and auto formatting for classes with sealed.


----------------------------------------------------------------
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.

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] Akshay-Gupta-Oracle commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
Akshay-Gupta-Oracle commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-704730769


   @lkishalmi  I've resolve the conflict with master. But after resolving I had to merge master into this branch, so now I can't rebase my local branch and squash the commits. may need help there.


----------------------------------------------------------------
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.

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] arvindaprameya commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
arvindaprameya commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-704728744


   Thank you for addressing all the comments, approved. Please resolve the conflicts in master branch as pointed by @lkishalmi 


----------------------------------------------------------------
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.

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] arvindaprameya commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
arvindaprameya commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-668480878


   Planned for 12.1


----------------------------------------------------------------
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.

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] Akshay-Gupta-Oracle edited a comment on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
Akshay-Gupta-Oracle edited a comment on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-704730769


   @lkishalmi  I've resolve the conflict with master. But after resolving I had to merge master into this branch, so now I can't rebase my local branch and squash the commits.


----------------------------------------------------------------
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.

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] lkishalmi commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-695798809


   @lahodaj @jlahoda would any of you approve this change?


----------------------------------------------------------------
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.

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] neilcsmith-net commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-670843914


   @arvindaprameya yes, that's my understanding, and the first release to officially support JDK 15 is meant to be 12.2.  This missed freeze on July 15th and still has open reviews, so I'm inclined to bump this to 12.2.  In my opinion, we need to get language features, including the relevant nb-javac support, in much earlier in the release cycle and well before freeze to ensure it's adequately tested.


----------------------------------------------------------------
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.

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] lkishalmi merged pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lkishalmi merged pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282


   


----------------------------------------------------------------
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.

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] junichi11 commented on a change in pull request #2282: [NETBEANS-3990] Sealed hint,color and formatting

Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#discussion_r463318775



##########
File path: java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
##########
@@ -871,7 +871,18 @@ public Void visitClass(ClassTree tree, Void p) {
             }
             scan(tree.getExtendsClause(), null);
             scan(tree.getImplementsClause(), null);
-
+            try{
+            while(!tl.currentToken().text().toString().equals("{")) {

Review comment:
       Although I'm not an expert of this area, maybe, if you would like to check whether text of a token is the same as given one, should use `org.netbeans.api.lexer.TokenUtilities.textEquals()` instead of `toString().equals` (e.g. `!TokenUtilities.textEquals(tl.currentToken().text(), "{")`), then should add `// NOI18N` to strings.
   Please reformat your changes. (the changes below, too)
   
   




----------------------------------------------------------------
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.

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] lkishalmi commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-698412636


   @Akshay-Gupta-Oracle Could you update this PR to resolve the merge conflict?


----------------------------------------------------------------
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.

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] arvindaprameya commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
arvindaprameya commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-670818039


   This change will help the new feature "Sealed types" to work well when Open JDK 15 is released in Sep 2020


----------------------------------------------------------------
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.

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] junichi11 commented on a change in pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#discussion_r463867429



##########
File path: java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
##########
@@ -871,7 +871,18 @@ public Void visitClass(ClassTree tree, Void p) {
             }
             scan(tree.getExtendsClause(), null);
             scan(tree.getImplementsClause(), null);
-
+            try{
+            while(!tl.currentToken().text().toString().equals("{")) {

Review comment:
       It doesn't seem to be reformatted yet. Please add `// NOI18N` for strings that are not expected translation.




----------------------------------------------------------------
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.

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] lkishalmi commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-695798809


   @lahodaj @jlahoda would any of you approve this change?


----------------------------------------------------------------
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.

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] lkishalmi commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-698412636


   @Akshay-Gupta-Oracle Could you update this PR to resolve the merge conflict?


----------------------------------------------------------------
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.

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] lahodaj commented on a change in pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
lahodaj commented on a change in pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#discussion_r475705259



##########
File path: java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
##########
@@ -871,7 +872,18 @@ public Void visitClass(ClassTree tree, Void p) {
             }
             scan(tree.getExtendsClause(), null);
             scan(tree.getImplementsClause(), null);
-
+            try {
+                while (!TokenUtilities.textEquals(tl.currentToken().text(), "{")) {// NOI18N

Review comment:
       My suggestion here would be to:
   1. read the Permitted subclasses
   2. if non-null/non-empty, do simply firstIdentifierToken("permits"), and add the token to contextKeywords
   3. run scan(<permitted>, null)
   (so that the classes inside the permits clause are highlighted).
   

##########
File path: java/java.lexer/src/org/netbeans/api/java/lexer/JavaTokenId.java
##########
@@ -133,6 +133,9 @@
     TRUE("true", "literal"),
     FALSE("false", "literal"),
     NULL("null", "literal"),
+    PERMITS("permits", "keyword"),

Review comment:
       These new constants do not seem to be really used, right? I.e. the lexer will never produce a token with this kind?

##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
##########
@@ -1585,7 +1591,7 @@ public Boolean visitModifiers(ModifiersTree node, Void p) {
                 int lblti = lastBlankLinesTokenIndex;
                 Diff lbld = lastBlankLinesDiff;
                 id = accept(PRIVATE, PROTECTED, PUBLIC, STATIC, DEFAULT, TRANSIENT, FINAL,
-                        ABSTRACT, NATIVE, VOLATILE, SYNCHRONIZED, STRICTFP, AT);
+                        ABSTRACT, NATIVE, VOLATILE, SYNCHRONIZED, STRICTFP, AT, SEALED, NONSEALED);

Review comment:
       I see the token ids are useful here - but I would suggest to add a way to do without them. Enhancing API just to simplify one place a little bit will hurt long-term maintenance.

##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
##########
@@ -954,6 +955,11 @@ public Boolean visitClass(ClassTree node, Void p) {
                         wrapToken(cs.wrapExtendsImplementsKeyword(), 1, id == INTERFACE ? EXTENDS : IMPLEMENTS);
                         wrapList(cs.wrapExtendsImplementsList(), cs.alignMultilineImplements(), true, COMMA, impls);
                     }
+                    List<? extends Tree> perms = TreeShims.getPermits(node);
+                    if (perms != null && !perms.isEmpty()) {
+                        wrapToken(cs.wrapExtendsImplementsKeyword(), 1, PERMITS);

Review comment:
       I think it is sensible to use the same settings as for wrapping extends/implements. We may consider tweaking the UI to also mention permits (this applies to both wrapExtendsImplementsKeyword and wrapExtendsImplementsList).

##########
File path: java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/ColoringAttributes.java
##########
@@ -30,7 +30,9 @@
 public enum ColoringAttributes {
 
     UNUSED,
-
+    SEALED,

Review comment:
       These new constants don't seem to be needed, right? The keywords should have attribute KEYWORD, I think, and that should be enough to make them highlighted as a keyword.

##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java
##########
@@ -3524,6 +3530,10 @@ private JavaTokenId accept(JavaTokenId first, JavaTokenId... rest) {
                             contains = true;
                             break;
                         }
+                        if (TokenUtilities.textEquals(tokens.token().text(), "non") && tokens.moveNext() && TokenUtilities.textEquals(tokens.token().text(), "-") && tokens.moveNext() && TokenUtilities.textEquals(tokens.token().text(), "sealed")) {// NOI18N

Review comment:
       What happens if "non" is not followed by "-sealed"?

##########
File path: java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/SemanticHighlighterBase.java
##########
@@ -953,6 +965,25 @@ public Void scan(Tree tree, Void p) {
                 handlePossibleIdentifier(tp, true, info.getTrees().getElement(tp));
                 tl.moveToOffset(sourcePositions.getEndPosition(getCurrentPath().getCompilationUnit(), TreeShims.getBindingPatternType(tree)));
                 firstIdentifier(tp, TreeShims.getBinding(tree).toString());
+            } else if (tree != null && tree.getKind().equals(Kind.MODIFIERS)) {

Review comment:
       Here, I would suggest to create a new method "visitModifiers", and put this code into it. Also, it will possibly be a little bit more complex to handle, as "sealed" and "non-sealed" may be intermixed in other modifiers and annotations. I guess I would suggest to avoid doing toString() on the tree - what will happen if the modifiers contain something like:
   @SuppressWarnings("non-sealed")
   ?




----------------------------------------------------------------
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.

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] neilcsmith-net commented on pull request #2282: [NETBEANS-3990] Sealed color and formatting

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #2282:
URL: https://github.com/apache/netbeans/pull/2282#issuecomment-668489179


   Is this JDK 14 not 15?!  I was just about to look at merging master to release branch for hopefully final beta.  What's the rush on this one?


----------------------------------------------------------------
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.

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