--- old/src/share/classes/javax/print/MimeType.java 2014-05-15 18:04:59.000000000 -0700 +++ new/src/share/classes/javax/print/MimeType.java 2014-05-15 18:04:59.000000000 -0700 @@ -117,18 +117,18 @@ /** * Parameter map entry. */ - private class ParameterMapEntry implements Map.Entry { + private class ParameterMapEntry implements Map.Entry { private int myIndex; public ParameterMapEntry(int theIndex) { myIndex = theIndex; } - public Object getKey(){ + public String getKey(){ return myPieces[myIndex]; } - public Object getValue(){ + public String getValue(){ return myPieces[myIndex+1]; } - public Object setValue (Object value) { + public String setValue (String value) { throw new UnsupportedOperationException(); } public boolean equals(Object o) { @@ -145,12 +145,12 @@ /** * Parameter map entry set iterator. */ - private class ParameterMapEntrySetIterator implements Iterator { + private class ParameterMapEntrySetIterator implements Iterator> { private int myIndex = 2; public boolean hasNext() { return myIndex < myPieces.length; } - public Object next() { + public Map.Entry next() { if (hasNext()) { ParameterMapEntry result = new ParameterMapEntry (myIndex); myIndex += 2; @@ -167,8 +167,8 @@ /** * Parameter map entry set. */ - private class ParameterMapEntrySet extends AbstractSet { - public Iterator iterator() { + private class ParameterMapEntrySet extends AbstractSet> { + public Iterator> iterator() { return new ParameterMapEntrySetIterator(); } public int size() { @@ -179,8 +179,8 @@ /** * Parameter map. */ - private class ParameterMap extends AbstractMap { - public Set entrySet() { + private class ParameterMap extends AbstractMap { + public Set> entrySet() { if (myEntrySet == null) { myEntrySet = new ParameterMapEntrySet(); } @@ -234,7 +234,7 @@ * * @return Parameter map for this MIME type object. */ - public Map getParameterMap() { + public Map getParameterMap() { if (myParameterMap == null) { myParameterMap = new ParameterMap(); } @@ -548,7 +548,7 @@ } LexicalAnalyzer theLexer = new LexicalAnalyzer (s); int theLexemeType; - Vector thePieces = new Vector(); + Vector thePieces = new Vector<>(); boolean mediaTypeIsText = false; boolean parameterNameIsCharset = false; @@ -623,7 +623,7 @@ // Save the pieces. Parameters are not in ascending order yet. int n = thePieces.size(); - myPieces = (String[]) thePieces.toArray (new String [n]); + myPieces = thePieces.toArray (new String [n]); // Sort the parameters into ascending order using an insertion sort. int i, j;