src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/FilterFactory.java
changeset 48083 b1c1b4ef4be2
parent 47216 71c04702a3d5
child 55973 4d9b002587db
equal deleted inserted replaced
48081:89829dd3cc54 48083:b1c1b4ef4be2
     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         }