jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java
changeset 23782 953bfc3fbe31
parent 20987 590251854a8d
equal deleted inserted replaced
23403:85dbdc227c5e 23782:953bfc3fbe31
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, 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
    37 import java.util.Collection;
    37 import java.util.Collection;
    38 import java.util.Comparator;
    38 import java.util.Comparator;
    39 import java.util.LinkedList;
    39 import java.util.LinkedList;
    40 import java.util.List;
    40 import java.util.List;
    41 import java.util.Queue;
    41 import java.util.Queue;
       
    42 import java.util.logging.Level;
    42 import javax.xml.namespace.QName;
    43 import javax.xml.namespace.QName;
    43 import javax.xml.stream.XMLStreamException;
    44 import javax.xml.stream.XMLStreamException;
    44 import javax.xml.stream.XMLStreamReader;
    45 import javax.xml.stream.XMLStreamReader;
    45 
    46 
    46 /**
    47 /**
   198             return ((s1 == null) ? ((s2 == null) ? 0 : -1) : ((s2 == null) ? 1 : s1.compareTo(s2)));
   199             return ((s1 == null) ? ((s2 == null) ? 0 : -1) : ((s2 == null) ? 1 : s1.compareTo(s2)));
   199         }
   200         }
   200     }
   201     }
   201 
   202 
   202     public static class Collections {
   203     public static class Collections {
       
   204         private static final PolicyLogger LOGGER = PolicyLogger.getLogger(PolicyUtils.Collections.class);
   203         /**
   205         /**
   204          * TODO javadocs
   206          * TODO javadocs
   205          *
   207          *
   206          * @param initialBase the combination base that will be present in each combination. May be {@code null} or empty.
   208          * @param initialBase the combination base that will be present in each combination. May be {@code null} or empty.
   207          * @param options options that should be combined. May be {@code null} or empty.
   209          * @param options options that should be combined. May be {@code null} or empty.
   243                         return null;
   245                         return null;
   244                     }
   246                     }
   245                 } else if (optionSize == 1) {
   247                 } else if (optionSize == 1) {
   246                     base.addAll(option);
   248                     base.addAll(option);
   247                 } else {
   249                 } else {
   248                     optionProcessingQueue.offer(option);
   250                     boolean entered = optionProcessingQueue.offer(option);
       
   251                     if (!entered) {
       
   252                         throw LOGGER.logException(new RuntimePolicyUtilsException(LocalizationMessages.WSP_0096_ERROR_WHILE_COMBINE(option)), false, Level.WARNING);
       
   253                     }
   249                     finalCombinationsSize *= optionSize;
   254                     finalCombinationsSize *= optionSize;
   250                 }
   255                 }
   251             }
   256             }
   252 
   257 
   253             // creating final combinations
   258             // creating final combinations