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 2022/11/10 23:19:16 UTC

[GitHub] [netbeans] junichi11 commented on a diff in pull request #4955: PHP 8.2 Support: Readonly classes

junichi11 commented on code in PR #4955:
URL: https://github.com/apache/netbeans/pull/4955#discussion_r1019696323


##########
php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java:
##########
@@ -93,14 +94,24 @@ public Set<QualifiedName> getInterfaceNames() {
     }
 
     public PhpModifiers getAccessModifiers() {
-        Modifier modifier = getOriginalNode().getModifier();
-
-        if (modifier.equals(Modifier.ABSTRACT)) {
-            return PhpModifiers.fromBitMask(PhpModifiers.PUBLIC, PhpModifiers.ABSTRACT);
-        } else if (modifier.equals(Modifier.FINAL)) {
-            return PhpModifiers.fromBitMask(PhpModifiers.PUBLIC, PhpModifiers.FINAL);
+        List<Integer> phpModifiers = new ArrayList<>(getOriginalNode().getModifiers().keySet().size());
+        phpModifiers.add(PhpModifiers.PUBLIC);
+        for (Modifier modifier : getOriginalNode().getModifiers().keySet()) {
+            switch (modifier) {
+                case ABSTRACT:
+                    phpModifiers.add(PhpModifiers.ABSTRACT);
+                    break;
+                case FINAL:
+                    phpModifiers.add(PhpModifiers.FINAL);
+                    break;
+                case READONLY:
+                    phpModifiers.add(PhpModifiers.READONLY);
+                    break;
+                default:
+                    break;

Review Comment:
   Will add the following. Thanks!
   ```java
                   case NONE:
                       // no-op
                       break;
                   default:
                       assert false : "Handle " + modifier + " modifier";
                       break;
   ```



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