< prev index next >
src/share/classes/sun/net/www/HeaderParser.java
Print this page
rev 1564 : 7090158: Networking Libraries don't build with javac -Werror
7125055: ContentHandler.getContent API changed in error
Summary: Minor changes to networking java files to remove warnings
Reviewed-by: chegar, weijun, hawtin, alanb
Contributed-by: kurchi.subhra.hazra@oracle.com, sasha_bu@hotmail.com
*** 1,7 ****
/*
! * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 190,231 ****
}
}
return Default;
}
! class ParserIterator implements Iterator {
int index;
boolean returnsValue; // or key
ParserIterator (boolean returnValue) {
returnsValue = returnValue;
}
public boolean hasNext () {
return index<nkeys;
}
! public Object next () {
return tab[index++][returnsValue?1:0];
}
public void remove () {
throw new UnsupportedOperationException ("remove not supported");
}
}
! public Iterator keys () {
return new ParserIterator (false);
}
! public Iterator values () {
return new ParserIterator (true);
}
public String toString () {
! Iterator k = keys();
StringBuffer sbuf = new StringBuffer();
sbuf.append ("{size="+asize+" nkeys="+nkeys+" ");
for (int i=0; k.hasNext(); i++) {
! String key = (String)k.next();
String val = findValue (i);
if (val != null && "".equals (val)) {
val = null;
}
sbuf.append (" {"+key+(val==null?"":","+val)+"}");
--- 190,231 ----
}
}
return Default;
}
! class ParserIterator implements Iterator<String> {
int index;
boolean returnsValue; // or key
ParserIterator (boolean returnValue) {
returnsValue = returnValue;
}
public boolean hasNext () {
return index<nkeys;
}
! public String next () {
return tab[index++][returnsValue?1:0];
}
public void remove () {
throw new UnsupportedOperationException ("remove not supported");
}
}
! public Iterator<String> keys () {
return new ParserIterator (false);
}
! public Iterator<String> values () {
return new ParserIterator (true);
}
public String toString () {
! Iterator<String> k = keys();
StringBuffer sbuf = new StringBuffer();
sbuf.append ("{size="+asize+" nkeys="+nkeys+" ");
for (int i=0; k.hasNext(); i++) {
! String key = k.next();
String val = findValue (i);
if (val != null && "".equals (val)) {
val = null;
}
sbuf.append (" {"+key+(val==null?"":","+val)+"}");
< prev index next >