Fixing CorsConfigTest failure under Java 8.

Motivation:
When running the build with Java 8 the following error occurred:

java: reference to preflightResponseHeader is ambiguous
  both method
  <T>preflightResponseHeader(java.lang.CharSequence,java.lang.Iterable<T>)
  in io.netty.handler.codec.http.cors.CorsConfig.Builder and method
  <T>preflightResponseHeader(java.lang.String,java.util.concurrent.Callable<T>)
  in io.netty.handler.codec.http.cors.CorsConfig.Builder match

The offending class was CorsConfigTest and its shouldThrowIfValueIsNull
which contained the following line:
withOrigin("*").preflightResponseHeader("HeaderName", null).build();

Modifications:
Updated the offending method with to supply a type, and object array, to
avoid the error.

Result:
After this I was able to build with Java 7 and Java 8
This commit is contained in:
Daniel Bevenius 2014-03-22 07:20:10 +01:00
parent 8d8bbec274
commit 7c4aea4bc3

View File

@ -101,7 +101,7 @@ public class CorsConfigTest {
@Test (expected = IllegalArgumentException.class)
public void shouldThrowIfValueIsNull() {
withOrigin("*").preflightResponseHeader("HeaderName", null).build();
withOrigin("*").preflightResponseHeader("HeaderName", new Object[]{null}).build();
}
}