errael commented on code in PR #5309:
URL: https://github.com/apache/netbeans/pull/5309#discussion_r1096579702


##########
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/entitymanagergenerator/ApplicationManagedResourceTransactionNonInjectableInEJB.java:
##########
@@ -61,11 +61,6 @@ public ClassTree generate(){
                 Collections.<AnnotationTree>emptyList()
                 );
         
-        Set<Modifier> modifiers = new HashSet<Modifier>();
-        modifiers.add(Modifier.PRIVATE);
-        modifiers.add(Modifier.STATIC);
-        

Review Comment:
   That's weird, but I don't see it used either. 
   Wonder if it was part of an in progress change?



##########
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/PushDownTransformer.java:
##########
@@ -347,14 +347,16 @@ private ClassTree rewriteSuperClass(Element el, ClassTree 
tree, GeneratorUtiliti
                             
                             if (!classIsAbstract) {
                                 classIsAbstract = true;
-                                Set<Modifier> mod = new 
HashSet<>(njuClass.getModifiers().getFlags());
+                                Set<Modifier> mod = 
EnumSet.noneOf(Modifier.class);
+                                mod.addAll(njuClass.getModifiers().getFlags());
                                 mod.add(Modifier.ABSTRACT);
                                 ModifiersTree modifiers = make.Modifiers(mod);
                                 
translateQueue.getLast().put(njuClass.getModifiers(), modifiers);
                             }
                             
                             MethodTree method = (MethodTree) t;
-                            Set<Modifier> mod = new 
HashSet<>(method.getModifiers().getFlags());
+                            Set<Modifier> mod = EnumSet.noneOf(Modifier.class);
+                            mod.addAll(method.getModifiers().getFlags());
                             mod.add(Modifier.ABSTRACT);

Review Comment:
   How about create `Set` with (then remove the add)
   ```
   Set<Modifier> mod = EnumSet.of(Modifier.ABSTRACT)
   ```



##########
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/PushDownTransformer.java:
##########
@@ -347,14 +347,16 @@ private ClassTree rewriteSuperClass(Element el, ClassTree 
tree, GeneratorUtiliti
                             
                             if (!classIsAbstract) {
                                 classIsAbstract = true;
-                                Set<Modifier> mod = new 
HashSet<>(njuClass.getModifiers().getFlags());
+                                Set<Modifier> mod = 
EnumSet.noneOf(Modifier.class);
+                                mod.addAll(njuClass.getModifiers().getFlags());
                                 mod.add(Modifier.ABSTRACT);

Review Comment:
   How about create `Set` with (then remove the add)
   ```
   Set<Modifier> mod = EnumSet.of(Modifier.ABSTRACT)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to