jdk/src/share/classes/java/util/EnumSet.java
changeset 7803 56bc97d69d93
parent 5506 202f599c92aa
child 8151 88b01a6d5f51
equal deleted inserted replaced
7802:74f2ee2b62ba 7803:56bc97d69d93
   108         Enum[] universe = getUniverse(elementType);
   108         Enum[] universe = getUniverse(elementType);
   109         if (universe == null)
   109         if (universe == null)
   110             throw new ClassCastException(elementType + " not an enum");
   110             throw new ClassCastException(elementType + " not an enum");
   111 
   111 
   112         if (universe.length <= 64)
   112         if (universe.length <= 64)
   113             return new RegularEnumSet<E>(elementType, universe);
   113             return new RegularEnumSet<>(elementType, universe);
   114         else
   114         else
   115             return new JumboEnumSet<E>(elementType, universe);
   115             return new JumboEnumSet<>(elementType, universe);
   116     }
   116     }
   117 
   117 
   118     /**
   118     /**
   119      * Creates an enum set containing all of the elements in the specified
   119      * Creates an enum set containing all of the elements in the specified
   120      * element type.
   120      * element type.
   428 
   428 
   429         private static final long serialVersionUID = 362491234563181265L;
   429         private static final long serialVersionUID = 362491234563181265L;
   430     }
   430     }
   431 
   431 
   432     Object writeReplace() {
   432     Object writeReplace() {
   433         return new SerializationProxy<E>(this);
   433         return new SerializationProxy<>(this);
   434     }
   434     }
   435 
   435 
   436     // readObject method for the serialization proxy pattern
   436     // readObject method for the serialization proxy pattern
   437     // See Effective Java, Second Ed., Item 78.
   437     // See Effective Java, Second Ed., Item 78.
   438     private void readObject(java.io.ObjectInputStream stream)
   438     private void readObject(java.io.ObjectInputStream stream)