jdk/src/share/classes/sun/security/x509/CRLDistributionPointsExtension.java
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2011, 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
   220     }
   220     }
   221 
   221 
   222     /**
   222     /**
   223      * Set the attribute value.
   223      * Set the attribute value.
   224      */
   224      */
       
   225     @SuppressWarnings("unchecked") // Checked with instanceof
   225     public void set(String name, Object obj) throws IOException {
   226     public void set(String name, Object obj) throws IOException {
   226         if (name.equalsIgnoreCase(POINTS)) {
   227         if (name.equalsIgnoreCase(POINTS)) {
   227             if (!(obj instanceof List)) {
   228             if (!(obj instanceof List)) {
   228                 throw new IOException("Attribute value should be of type List.");
   229                 throw new IOException("Attribute value should be of type List.");
   229             }
   230             }
   237     }
   238     }
   238 
   239 
   239     /**
   240     /**
   240      * Get the attribute value.
   241      * Get the attribute value.
   241      */
   242      */
   242     public Object get(String name) throws IOException {
   243     public List<DistributionPoint> get(String name) throws IOException {
   243         if (name.equalsIgnoreCase(POINTS)) {
   244         if (name.equalsIgnoreCase(POINTS)) {
   244             return distributionPoints;
   245             return distributionPoints;
   245         } else {
   246         } else {
   246             throw new IOException("Attribute name [" + name +
   247             throw new IOException("Attribute name [" + name +
   247                                 "] not recognized by " +
   248                                 "] not recognized by " +