mbien commented on code in PR #6061:
URL: https://github.com/apache/netbeans/pull/6061#discussion_r1233188131
##########
enterprise/j2ee.common/src/org/netbeans/modules/j2ee/common/dd/DDHelper.java:
##########
@@ -40,273 +43,164 @@
*/
public class DDHelper {
- private static final String RESOURCE_FOLDER =
"/org/netbeans/modules/j2ee/common/dd/resources/"; //NOI18N
+ static final String RESOURCE_FOLDER =
"/org/netbeans/modules/j2ee/common/dd/resources/"; //NOI18N
+
+ static Consumer<MakeFileCopy> atomicActionRunner =
FileUtil::runAtomicAction;
+
+ static MakeFileCopyFactory makeFileCopyFactory = MakeFileCopy::new;
+
+ private static final List <Profile>
WEBXML_REQUIREMENTS_INDEPENDANT_PROFILES = List.of(
+ Profile.JAVA_EE_5,
+ Profile.J2EE_14,
+ Profile.J2EE_13
+ );
Review Comment:
-> EnumSet or Set
Since you are only using `contains()`
##########
enterprise/j2ee.common/test/unit/src/org/netbeans/modules/j2ee/common/ClasspathUtilTest.java:
##########
@@ -27,13 +27,15 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
+import org.junit.Ignore;
import org.netbeans.junit.NbTestCase;
import org.openide.filesystems.FileUtil;
/**
*
* @author sherold
*/
+@Ignore("jar files which are base for this class are missing")
public class ClasspathUtilTest extends NbTestCase {
Review Comment:
does ignore work?
CI is testing `j2ee.core` but not `j2ee.common`:
https://github.com/apache/netbeans/blob/5af5f30e97c08222539b0c9ce79afc19e1a52b68/.github/workflows/main.yml#L1988-L1989
feel free to register it in the yaml.
##########
enterprise/j2ee.core/src/org/netbeans/api/j2ee/core/DeploymentDescriptors.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.api.j2ee.core;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import static java.util.Map.entry;
+import static org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.BEANS;
+import static org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.CONSTRAINT;
+import static org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.EAR;
+import static org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.VALIDATION;
+import static org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.WEB;
+import static
org.netbeans.api.j2ee.core.DeploymentDescriptors.Type.WEB_FRAGMENT;
+
+/**
+ * This class contains information about which schema version is used for a
+ * specific Java EE or Jakarta EE version.
+ *
+ * @author Benjamin Asbach
+ */
+public class DeploymentDescriptors {
Review Comment:
I would experiment with:
changing the maps to EnumMap which is very compact. You probably will need a
utility method which puts map entries into the EnumMap since the JDK doesn't
have an `ofEntries()` for that as far as I know.
And potentially making this whole class an enum. The maps would be a field
for each enum element.
--
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