Fix Java 5 source compatibility issue / Inspector warnings

This commit is contained in:
Trustin Lee 2014-01-09 15:16:30 +09:00
parent 8198f23dbb
commit 013b57f1c1
2 changed files with 3 additions and 8 deletions

View File

@ -333,7 +333,6 @@ public class DefaultHttpHeaders extends HttpHeaders {
return all; return all;
} }
@Override
public Iterator<Map.Entry<String, String>> iterator() { public Iterator<Map.Entry<String, String>> iterator() {
return new HeaderIterator(); return new HeaderIterator();
} }
@ -408,12 +407,10 @@ public class DefaultHttpHeaders extends HttpHeaders {
private HeaderEntry current = head; private HeaderEntry current = head;
@Override
public boolean hasNext() { public boolean hasNext() {
return current.after != head; return current.after != head;
} }
@Override
public Entry<String, String> next() { public Entry<String, String> next() {
current = current.after; current = current.after;
@ -424,7 +421,6 @@ public class DefaultHttpHeaders extends HttpHeaders {
return current; return current;
} }
@Override
public void remove() { public void remove() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -455,17 +451,14 @@ public class DefaultHttpHeaders extends HttpHeaders {
after.before = this; after.before = this;
} }
@Override
public String getKey() { public String getKey() {
return key; return key;
} }
@Override
public String getValue() { public String getValue() {
return value; return value;
} }
@Override
public String setValue(String value) { public String setValue(String value) {
if (value == null) { if (value == null) {
throw new NullPointerException("value"); throw new NullPointerException("value");

View File

@ -93,7 +93,6 @@ public abstract class HttpHeaders implements Iterable<Map.Entry<String, String>>
throw new UnsupportedOperationException("read only"); throw new UnsupportedOperationException("read only");
} }
@Override
public Iterator<Entry<String, String>> iterator() { public Iterator<Entry<String, String>> iterator() {
return entries().iterator(); return entries().iterator();
} }
@ -710,6 +709,7 @@ public abstract class HttpHeaders implements Iterable<Map.Entry<String, String>>
try { try {
return Integer.parseInt(value); return Integer.parseInt(value);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// Not an integer header - use the default.
return defaultValue; return defaultValue;
} }
} }
@ -771,6 +771,7 @@ public abstract class HttpHeaders implements Iterable<Map.Entry<String, String>>
try { try {
return HttpHeaderDateFormat.get().parse(value); return HttpHeaderDateFormat.get().parse(value);
} catch (ParseException e) { } catch (ParseException e) {
// Not a date header - use the default.
return defaultValue; return defaultValue;
} }
} }
@ -853,6 +854,7 @@ public abstract class HttpHeaders implements Iterable<Map.Entry<String, String>>
try { try {
return Long.parseLong(contentLength); return Long.parseLong(contentLength);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// Not a long integer header - use the default.
return defaultValue; return defaultValue;
} }
} }