diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessorAuditor.java b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessorAuditor.java index fb6a436c3f..c3c70c4780 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessorAuditor.java +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessorAuditor.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -41,7 +42,6 @@ import org.apache.nifi.user.NiFiUser; import org.apache.nifi.web.api.dto.ProcessorConfigDTO; import org.apache.nifi.web.api.dto.ProcessorDTO; import org.apache.nifi.web.dao.ProcessorDAO; - import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -357,7 +357,7 @@ public class ProcessorAuditor extends NiFiAuditor { } // sort them and include in the configuration - Collections.sort(autoTerminatedRelationshipNames, Collator.getInstance()); + Collections.sort(autoTerminatedRelationshipNames, Collator.getInstance(Locale.US)); values.put(AUTO_TERMINATED_RELATIONSHIPS, StringUtils.join(autoTerminatedRelationshipNames, ", ")); } if (newConfig.getProperties() != null) { diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index ef735b7617..9a2dc30adb 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -28,6 +28,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -133,7 +134,7 @@ public final class DtoFactory { private final static Comparator CLASS_NAME_COMPARATOR = new Comparator() { @Override public int compare(Class class1, Class class2) { - return Collator.getInstance().compare(class1.getSimpleName(), class2.getSimpleName()); + return Collator.getInstance(Locale.US).compare(class1.getSimpleName(), class2.getSimpleName()); } }; @@ -330,7 +331,7 @@ public final class DtoFactory { for (final Relationship selectedRelationship : connection.getRelationships()) { if (!Relationship.ANONYMOUS.equals(selectedRelationship)) { if (dto.getSelectedRelationships() == null) { - dto.setSelectedRelationships(new TreeSet(Collator.getInstance())); + dto.setSelectedRelationships(new TreeSet(Collator.getInstance(Locale.US))); } dto.getSelectedRelationships().add(selectedRelationship.getName()); @@ -341,7 +342,7 @@ public final class DtoFactory { for (final Relationship availableRelationship : connection.getSource().getRelationships()) { if (!Relationship.ANONYMOUS.equals(availableRelationship)) { if (dto.getAvailableRelationships() == null) { - dto.setAvailableRelationships(new TreeSet(Collator.getInstance())); + dto.setAvailableRelationships(new TreeSet(Collator.getInstance(Locale.US))); } dto.getAvailableRelationships().add(availableRelationship.getName()); @@ -1163,7 +1164,7 @@ public final class DtoFactory { Collections.sort(relationships, new Comparator() { @Override public int compare(RelationshipDTO r1, RelationshipDTO r2) { - return Collator.getInstance().compare(r1.getName(), r2.getName()); + return Collator.getInstance(Locale.US).compare(r1.getName(), r2.getName()); } }); @@ -1492,7 +1493,7 @@ public final class DtoFactory { final Map sortedProperties = new TreeMap<>(new Comparator() { @Override public int compare(PropertyDescriptor o1, PropertyDescriptor o2) { - return Collator.getInstance().compare(o1.getName(), o2.getName()); + return Collator.getInstance(Locale.US).compare(o1.getName(), o2.getName()); } }); sortedProperties.putAll(procNode.getProperties()); @@ -1989,7 +1990,7 @@ public final class DtoFactory { } else if (name1 == null) { return 1; } else { - int compareResult = Collator.getInstance().compare(name2, name2); + int compareResult = Collator.getInstance(Locale.US).compare(name2, name2); // if the names are same, use the id if (compareResult == 0) { diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java index 07e3150241..008295c2e6 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java @@ -27,6 +27,7 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.SortedSet; @@ -108,7 +109,6 @@ import org.apache.nifi.web.api.dto.status.ControllerStatusDTO; import org.apache.nifi.web.api.dto.status.ProcessGroupStatusDTO; import org.apache.nifi.web.api.dto.status.StatusHistoryDTO; import org.apache.nifi.web.util.DownloadableContent; - import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.admin.service.UserService; @@ -893,7 +893,7 @@ public class ControllerFacade implements ControllerServiceProvider { final Comparator attributeComparator = new Comparator() { @Override public int compare(AttributeDTO a1, AttributeDTO a2) { - return Collator.getInstance().compare(a1.getName(), a2.getName()); + return Collator.getInstance(Locale.US).compare(a1.getName(), a2.getName()); } }; @@ -987,12 +987,12 @@ public class ControllerFacade implements ControllerServiceProvider { // parent uuids final List parentUuids = new ArrayList<>(event.getParentUuids()); - Collections.sort(parentUuids, Collator.getInstance()); + Collections.sort(parentUuids, Collator.getInstance(Locale.US)); dto.setParentUuids(parentUuids); // child uuids final List childUuids = new ArrayList<>(event.getChildUuids()); - Collections.sort(childUuids, Collator.getInstance()); + Collections.sort(childUuids, Collator.getInstance(Locale.US)); dto.setChildUuids(childUuids); return dto; diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-docs/src/main/java/org/apache/nifi/web/docs/DocumentationController.java b/nar-bundles/framework-bundle/framework/web/nifi-web-docs/src/main/java/org/apache/nifi/web/docs/DocumentationController.java index 2aa64fe048..a5428cdba0 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-docs/src/main/java/org/apache/nifi/web/docs/DocumentationController.java +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-docs/src/main/java/org/apache/nifi/web/docs/DocumentationController.java @@ -18,8 +18,10 @@ package org.apache.nifi.web.docs; import java.io.IOException; import java.text.Collator; +import java.util.Locale; import java.util.Map; import java.util.TreeMap; + import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -27,6 +29,7 @@ import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.nifi.nar.ExtensionMapping; import org.apache.commons.lang3.StringUtils; @@ -55,7 +58,7 @@ public class DocumentationController extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final ExtensionMapping extensionMappings = (ExtensionMapping) servletContext.getAttribute("nifi-extension-mapping"); - final Collator collator = Collator.getInstance(); + final Collator collator = Collator.getInstance(Locale.US); // create the processors lookup final Map processors = new TreeMap<>(collator); diff --git a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java index cb978cc2ff..05ed0a1d4f 100644 --- a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java +++ b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/api/RuleResource.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.Set; import java.util.UUID; @@ -63,10 +64,10 @@ import org.apache.nifi.web.NiFiWebContext; import org.apache.nifi.web.NiFiWebContextConfig; import org.apache.nifi.web.ProcessorInfo; import org.apache.nifi.web.Revision; - import org.apache.commons.lang3.StringUtils; import com.sun.jersey.api.NotFoundException; + import org.apache.nifi.update.attributes.FlowFilePolicy; import org.apache.nifi.update.attributes.entity.EvaluationContextEntity; @@ -443,7 +444,7 @@ public class RuleResource { Collections.sort(ruleDtos, new Comparator() { @Override public int compare(RuleDTO r1, RuleDTO r2) { - final Collator collator = Collator.getInstance(); + final Collator collator = Collator.getInstance(Locale.US); return collator.compare(r1.getName(), r2.getName()); } }); diff --git a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ActionDTO.java b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ActionDTO.java index d950d26581..31b2d9151d 100644 --- a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ActionDTO.java +++ b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ActionDTO.java @@ -17,6 +17,8 @@ package org.apache.nifi.update.attributes.dto; import java.text.Collator; +import java.util.Locale; + import javax.xml.bind.annotation.XmlType; /** @@ -58,7 +60,7 @@ public class ActionDTO implements Comparable { // including the id in the comparison so that the TreeSet that this // is stored in does not discard any entries just because their attributes // or values are equal - final Collator collator = Collator.getInstance(); + final Collator collator = Collator.getInstance(Locale.US); final String thisCmpStr = getAttribute() + "_" + getValue() + "_" + getId(); final String thatCmpStr = that.getAttribute() + "_" + that.getValue() + "_" + that.getId(); return collator.compare(thisCmpStr, thatCmpStr); diff --git a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ConditionDTO.java b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ConditionDTO.java index 9fb5937a2b..3f3676bf7c 100644 --- a/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ConditionDTO.java +++ b/nar-bundles/update-attribute-bundle/ui/src/main/java/org/apache/nifi/update/attributes/dto/ConditionDTO.java @@ -17,6 +17,8 @@ package org.apache.nifi.update.attributes.dto; import java.text.Collator; +import java.util.Locale; + import javax.xml.bind.annotation.XmlType; /** @@ -49,7 +51,7 @@ public class ConditionDTO implements Comparable { // including the id in the comparison so that the TreeSet that this // is stored in does not discard any entries just because their expressions // are equal - final Collator collator = Collator.getInstance(); + final Collator collator = Collator.getInstance(Locale.US); final String thisCmpStr = getExpression() + "_" + getId(); final String thatCmpStr = that.getExpression() + "_" + that.getId(); return collator.compare(thisCmpStr, thatCmpStr);