@@ -205,7 +205,8 @@ private <T> T singleHeader(String name, Class<T> valueType, Function<String, T>
205205 return convertNull ? converter .apply (null ) : null ;
206206 }
207207 if (values .size () > 1 ) {
208- throw new HeaderValueException (LocalizationMessages .TOO_MANY_HEADER_VALUES (name , values .toString ()),
208+ throw new HeaderValueException (
209+ LocalizationMessages .TOO_MANY_HEADER_VALUES (name , values .toString ()),
209210 HeaderValueException .Context .OUTBOUND );
210211 }
211212
@@ -356,7 +357,8 @@ public List<Locale> getAcceptableLanguages() {
356357 } else {
357358 conversionApplied = true ;
358359 try {
359- result .addAll (Lists .transform (HttpHeaderReader .readAcceptLanguage (HeaderUtils .asString (value , rd )),
360+ result .addAll (Lists .transform (
361+ HttpHeaderReader .readAcceptLanguage (HeaderUtils .asString (value , rd )),
360362 new Function <AcceptableLanguageTag , Locale >() {
361363
362364 @ Override
@@ -428,8 +430,8 @@ public Set<String> getAllowedMethods() {
428430 * should be preferred over this method, since it returns a {@code long}
429431 * instead and is therefore more portable.</P>
430432 *
431- * @return Content-Length as a postive integer if present and valid number. In other
432- * cases returns -1 .
433+ * @return Content-Length as a postive integer if present and valid number, {@code -1} if negative number.
434+ * @throws ProcessingException when {@link Integer#parseInt(String)} (String)} throws {@link NumberFormatException} .
433435 */
434436 public int getLength () {
435437 return singleHeader (HttpHeaders .CONTENT_LENGTH , Integer .class , new Function <String , Integer >() {
@@ -454,8 +456,8 @@ public Integer apply(String input) {
454456 /**
455457 * Get Content-Length value.
456458 *
457- * @return Content-Length as a positive long if present and valid number. In other
458- * cases returns -1 .
459+ * @return Content-Length as a positive long if present and valid number, {@code -1} if negative number.
460+ * @throws ProcessingException when {@link Long#parseLong(String)} throws {@link NumberFormatException} .
459461 */
460462 public long getLengthLong () {
461463 return singleHeader (HttpHeaders .CONTENT_LENGTH , Long .class , new Function <String , Long >() {
@@ -581,12 +583,13 @@ public Set<Link> getLinks() {
581583
582584 if (conversionApplied ) {
583585 // cache converted
584- headers .put (HttpHeaders .LINK , new ArrayList <Object >(Collections2 .transform (result , new Function <Link , Object >() {
585- @ Override
586- public Object apply (Link input ) {
587- return input ;
588- }
589- })));
586+ headers .put (HttpHeaders .LINK , new ArrayList <Object >(Collections2
587+ .transform (result , new Function <Link , Object >() {
588+ @ Override
589+ public Object apply (Link input ) {
590+ return input ;
591+ }
592+ })));
590593 }
591594
592595 return Collections .unmodifiableSet (result );
0 commit comments