equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
38 |
38 |
39 List<HeaderFilter> getFilterChain() { |
39 List<HeaderFilter> getFilterChain() { |
40 List<HeaderFilter> l = new LinkedList<>(); |
40 List<HeaderFilter> l = new LinkedList<>(); |
41 for (Class<? extends HeaderFilter> clazz : filterClasses) { |
41 for (Class<? extends HeaderFilter> clazz : filterClasses) { |
42 try { |
42 try { |
43 @SuppressWarnings("deprecation") |
43 // Requires a public no arg constructor. |
44 HeaderFilter headerFilter = clazz.newInstance(); |
44 HeaderFilter headerFilter = clazz.getConstructor().newInstance(); |
45 l.add(headerFilter); |
45 l.add(headerFilter); |
46 } catch (ReflectiveOperationException e) { |
46 } catch (ReflectiveOperationException e) { |
47 throw new InternalError(e); |
47 throw new InternalError(e); |
48 } |
48 } |
49 } |
49 } |