From e47ade73422ae15c605b6ec2db4c785be88943a5 Mon Sep 17 00:00:00 2001
From: Christian Kaltepoth <christian@kaltepoth.de>
Date: Thu, 14 Sep 2017 08:11:14 +0200
Subject: [PATCH] ParamConverterFactory should use LinkedHashSet to preserve
 provider ordering

---
 .../jersey/server/internal/inject/ParamConverterFactory.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java
index 5157d3c1e7..82881f72c4 100644
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamConverterFactory.java
@@ -43,7 +43,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -73,7 +73,7 @@ public class ParamConverterFactory implements ParamConverterProvider {
 
     ParamConverterFactory(Set<ParamConverterProvider> providers, Set<ParamConverterProvider> customProviders) {
 
-        Set<ParamConverterProvider> copyProviders = new HashSet<>(providers);
+        Set<ParamConverterProvider> copyProviders = new LinkedHashSet<>(providers);
         converterProviders = new ArrayList<>();
         converterProviders.addAll(customProviders);
         copyProviders.removeAll(customProviders);