You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2023/01/26 04:30:21 UTC

[GitHub] [netbeans] mbien opened a new pull request, #5365: builk added some missing ElementKind.RECORD enums.

mbien opened a new pull request, #5365:
URL: https://github.com/apache/netbeans/pull/5365

   #5339 had the bits which were easily verifiable as bugs.
   
   This PR is the bulk version of it. I searched for `ElementKind.CLASS` usage and tried to find out on a case by case basis if `RECORD` was missing based on what the code does. I didn't actually try to reproduce issues in the IDE for most of this since this would be too time consuming for all changes.
   
   I am not sure if this is the right approach of doing this, but most changes here seemed fairly obvious/trivial so I hope this doesn't break anything.
   
   This doesn't investigate missing `RECORD_COMPONENT` enums or add the record token to the lexer.


-- 
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 merged pull request #5365: Bulk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien merged PR #5365:
URL: https://github.com/apache/netbeans/pull/5365


-- 
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 #5365: bulk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#issuecomment-1454937696

   merging. Btw I can't reproduce the [formatter issues](https://github.com/apache/netbeans/pull/5365#issuecomment-1405999583) anymore. I probably didn't do a full rebuild while working on #5374 in parallel and got confused.


-- 
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 #5365: bulk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#issuecomment-1454081721

   rebased to latest master
   
   


-- 
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] lkishalmi commented on a diff in pull request #5365: builk added some missing ElementKind.RECORD enums.

Posted by "lkishalmi (via GitHub)" <gi...@apache.org>.
lkishalmi commented on code in PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#discussion_r1103674348


##########
platform/openide.util/src/org/netbeans/modules/openide/util/NbBundleProcessor.java:
##########
@@ -309,8 +311,12 @@ private String findCompilationUnitName(Element e) {
         case INTERFACE:
         case ENUM:
         case ANNOTATION_TYPE:
-            switch (e.getEnclosingElement().getKind()) {
-            case PACKAGE:
+            if (e.getEnclosingElement().getKind() == PACKAGE) {
+                return e.getSimpleName().toString();
+            }
+        }
+        if ("RECORD".equals(e.getKind().name())) {

Review Comment:
   I guess the string matching is due to future compatibility, is it?
   The indentation of the switch case block is bad, but I guess that how it was before this change, might fix that for the readability.



-- 
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 diff in pull request #5365: bulk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#discussion_r1124964558


##########
platform/openide.util/src/org/netbeans/modules/openide/util/NbBundleProcessor.java:
##########
@@ -309,8 +311,12 @@ private String findCompilationUnitName(Element e) {
         case INTERFACE:
         case ENUM:
         case ANNOTATION_TYPE:
-            switch (e.getEnclosingElement().getKind()) {
-            case PACKAGE:
+            if (e.getEnclosingElement().getKind() == PACKAGE) {
+                return e.getSimpleName().toString();
+            }
+        }
+        if ("RECORD".equals(e.getKind().name())) {

Review Comment:
   updated the formatting of the switch - I agree that this was confusing. Also added a comment.



-- 
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 #5365: builk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#issuecomment-1405999583

   this seems to cause some issues with the reformatter, haven't investigated any further yet.


-- 
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 diff in pull request #5365: builk added some missing ElementKind.RECORD enums.

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #5365:
URL: https://github.com/apache/netbeans/pull/5365#discussion_r1103722162


##########
platform/openide.util/src/org/netbeans/modules/openide/util/NbBundleProcessor.java:
##########
@@ -309,8 +311,12 @@ private String findCompilationUnitName(Element e) {
         case INTERFACE:
         case ENUM:
         case ANNOTATION_TYPE:
-            switch (e.getEnclosingElement().getKind()) {
-            case PACKAGE:
+            if (e.getEnclosingElement().getKind() == PACKAGE) {
+                return e.getSimpleName().toString();
+            }
+        }
+        if ("RECORD".equals(e.getKind().name())) {

Review Comment:
   The build fails without it since platform builds against 8 without nb-javac in the classpath.
   
   Java modules can "cheat" and use the RECORD enum directly since nb-javac adds it to the classpath due to the fact that it is currently based on javac of JDK 19.
   
   So its technically about backwards compatibility with JDK 8.



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