mbien commented on code in PR #7958:
URL: https://github.com/apache/netbeans/pull/7958#discussion_r1865521612
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/DecoratorObjectProvider.java:
##########
@@ -30,7 +32,7 @@
class DecoratorObjectProvider extends AbstractObjectProvider<DecoratorObject> {
DecoratorObjectProvider( AnnotationModelHelper helper ) {
- super( EnableBeansFilter.DECORATOR, helper);
+ super( Arrays.asList(AnnotationUtil.DECORATOR_JAKARTA,
AnnotationUtil.DECORATOR), helper);
Review Comment:
List.of()?
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AbstractObjectProvider.java:
##########
@@ -41,10 +42,10 @@ abstract class AbstractObjectProvider<T extends
AbstractObjectProvider.Refreshab
implements ObjectProvider<T>
{
- AbstractObjectProvider(String annotation , AnnotationModelHelper helper)
+ AbstractObjectProvider(List<String> annotation , AnnotationModelHelper
helper)
{
myHelper = helper;
- myAnnotationName = annotation;
+ myAnnotationName = Collections.unmodifiableList(new
ArrayList<>(annotation));
Review Comment:
-> `List.copyOf()`
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorBindingChecker.java:
##########
@@ -30,15 +32,20 @@
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.InterceptorBindingVerifier;
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.TargetVerifier;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.INTERCEPTOR_BINDING_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.INTERCEPTOR_BINDING_FQN_JAKARTA;
+
/**
* @author ads
*
*/
class InterceptorBindingChecker extends RuntimeAnnotationChecker {
-
- static final String INTERCEPTOR_BINDING =
"javax.interceptor.InterceptorBinding"; // NOI18N
-
+
+ private static final List<String> ANNOTATIONS =
Collections.unmodifiableList(List.of(
+ INTERCEPTOR_BINDING_FQN, INTERCEPTOR_BINDING_FQN_JAKARTA
+ ));
Review Comment:
nitpick: List.of() is already immutable
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/AnnotationObjectProvider.java:
##########
@@ -63,15 +63,15 @@
*/
public class AnnotationObjectProvider implements
ObjectProvider<BindingQualifier> {
- private static final String SPECILIZES_ANNOTATION =
- "javax.enterprise.inject.Specializes"; // NOI18N
+ private static final String SPECILIZES_ANNOTATION =
"javax.enterprise.inject.Specializes"; // NOI18N
+ private static final String SPECILIZES_ANNOTATION_JAKARTA =
"jakarta.enterprise.inject.Specializes"; // NOI18N
static final Logger LOGGER = Logger.getLogger(
AnnotationObjectProvider.class.getName());
- AnnotationObjectProvider( AnnotationModelHelper helper , String
annotation) {
+ AnnotationObjectProvider( AnnotationModelHelper helper , List<String>
annotation) {
myHelper = helper;
- myAnnotationName = annotation;
+ myAnnotationNames = Collections.unmodifiableList(new
ArrayList<>(annotation));
Review Comment:
`Collections.unmodifiableList(new ArrayList<>(annotation));`
->
`List.copyOf(annotation));`
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/InterceptorObjectProvider.java:
##########
@@ -31,7 +33,7 @@ class InterceptorObjectProvider extends
AbstractObjectProvider<InterceptorObject
InterceptorObjectProvider( AnnotationModelHelper helper )
{
- super(InterceptorObject.INTERCEPTOR, helper);
+ super(Arrays.asList(AnnotationUtil.INTERCEPTOR,
AnnotationUtil.INTERCEPTOR_JAKARTA), helper);
Review Comment:
`List.of()`
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/QualifierChecker.java:
##########
@@ -29,16 +31,20 @@
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.QualifierVerifier;
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.TargetVerifier;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.QUALIFIER_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.QUALIFIER_FQN_JAKARTA;
+
/**
* @author ads
*
*/
class QualifierChecker extends RuntimeAnnotationChecker implements Checker {
-
- private static final String QUALIFIER_TYPE_ANNOTATION=
- "javax.inject.Qualifier"; // NOI18N
-
+
+ private static final List<String> ANNOTATIONS =
Collections.unmodifiableList(List.of(
+ QUALIFIER_FQN, QUALIFIER_FQN_JAKARTA
+ ));
Review Comment:
`unmodifiableList` redundant
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/NormalScopeChecker.java:
##########
@@ -18,15 +18,23 @@
*/
package org.netbeans.modules.web.beans.impl.model;
+import java.util.Collections;
+import java.util.List;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.NORMAL_SCOPE_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.NORMAL_SCOPE_FQN_JAKARTA;
/**
* @author ads
*
*/
class NormalScopeChecker extends ScopeChecker {
-
+
+ private static final List<String> ANNOTATIONS =
Collections.unmodifiableList(List.of(
+ NORMAL_SCOPE_FQN, NORMAL_SCOPE_FQN_JAKARTA
+ ));
Review Comment:
redundant `unmodifiableList` wrapper
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/NamedStereotypeObjectProvider.java:
##########
@@ -31,15 +32,18 @@
import
org.netbeans.modules.j2ee.metadata.model.api.support.annotation.AnnotationHandler;
import
org.netbeans.modules.j2ee.metadata.model.api.support.annotation.AnnotationModelHelper;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.STEREOTYPE_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.STEREOTYPE_FQN_JAKARTA;
+
/**
* @author ads
*
*/
class NamedStereotypeObjectProvider extends
AbstractObjectProvider<NamedStereotype> {
-
- NamedStereotypeObjectProvider(AnnotationModelHelper helper){
- super( StereotypeChecker.STEREOTYPE, helper );
+
+ NamedStereotypeObjectProvider(AnnotationModelHelper helper) {
+ super(Arrays.asList(STEREOTYPE_FQN, STEREOTYPE_FQN_JAKARTA), helper);
Review Comment:
`List.of()`
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypedObjectProvider.java:
##########
@@ -32,18 +33,23 @@
class StereotypedObjectProvider extends
AbstractObjectProvider<StereotypedObject>
{
- StereotypedObjectProvider( String stereotypeAnnotation ,
+ StereotypedObjectProvider( String stereotypeAnnotation ,
AnnotationModelHelper helper )
{
- super( stereotypeAnnotation, helper);
+ super(Arrays.asList(stereotypeAnnotation), helper);
Review Comment:
`List.of()`
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/ScopeChecker.java:
##########
@@ -28,17 +30,20 @@
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.ScopeVerifier;
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.TargetVerifier;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.SCOPE_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.SCOPE_FQN_JAKARTA;
+
/**
* @author ads
*
*/
class ScopeChecker extends RuntimeAnnotationChecker {
-
- static String SCOPE = "javax.inject.Scope"; //
NOI18N
-
- static String NORMAL_SCOPE = "javax.enterprise.context.NormalScope";//
NOI18N
-
+
+ private static final List<String> ANNOTATIONS =
Collections.unmodifiableList(List.of(
+ SCOPE_FQN, SCOPE_FQN_JAKARTA
+ ));
Review Comment:
`unmodifiableList` redundant
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/StereotypeChecker.java:
##########
@@ -30,14 +32,19 @@
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.StereotypeVerifier;
import
org.netbeans.modules.web.beans.analysis.analyzer.annotation.TargetVerifier;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.STEREOTYPE_FQN;
+import static
org.netbeans.modules.web.beans.analysis.analyzer.AnnotationUtil.STEREOTYPE_FQN_JAKARTA;
+
/**
* @author ads
*
*/
public class StereotypeChecker extends RuntimeAnnotationChecker {
- static final String STEREOTYPE = "javax.enterprise.inject.Stereotype";
//NOI18N
+ private static final List<String> ANNOTATIONS =
Collections.unmodifiableList(List.of(
+ STEREOTYPE_FQN, STEREOTYPE_FQN_JAKARTA
+ ));
Review Comment:
`unmodifiableList` redundant
--
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