matthiasblaesing commented on code in PR #8886:
URL: https://github.com/apache/netbeans/pull/8886#discussion_r2402274493


##########
enterprise/javaee.beanvalidation/src/org/netbeans/modules/javaee/beanvalidation/ConstraintIterator.java:
##########
@@ -196,24 +203,48 @@ public void addChangeListener(ChangeListener l) {
     public void removeChangeListener(ChangeListener l) {
     }
 
-    private static DataObject createValidator(DataFolder df, FileObject 
template, String className, String type, String constraintClass) {
+    private static DataObject createValidator(DataFolder df, FileObject 
template, String className, String type, String constraintClass, boolean 
jakartaPackage) {
         try {
             DataObject dTemplate = DataObject.find(template);
-            HashMap<String, Object> templateProperties = new HashMap<String, 
Object>();
+            Map<String, Object> templateProperties = new HashMap<>();
             templateProperties.put(WizardProperties.VALIDATOR_TYPE, type);
             templateProperties.put(WizardProperties.CONSTRAINT_CLASS_NAME, 
constraintClass);
+            templateProperties.put(WizardProperties.JAKARTA_PACKAGE, 
jakartaPackage);
             return dTemplate.createFromTemplate(df, 
className,templateProperties);
 
         } catch (IOException ex) {
             Exceptions.printStackTrace(ex);
         }
         return null;
     }
+    
+    private static boolean isJakartaPackage(Project project) {
+        Profile profile = JavaEEProjectSettings.getProfile(project);
+        if (profile != null) {
+            return profile.isAtLeast(Profile.JAKARTA_EE_9_WEB);
+        }
+
+        Sources sources = ProjectUtils.getSources(project);
+        if (sources == null) {
+            return false;

Review Comment:
   I would default to Jakarta if we can't get evidence, that  the javax 
namespace is used.



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