Modify ByteArrayEncoder so that it works in Eclipse IDE

master
Sam Brannen 6 years ago
parent 898494a538
commit e4525cf4c1
  1. 5
      spring-core/src/main/java/org/springframework/core/codec/ByteArrayEncoder.java
  2. 1
      src/checkstyle/checkstyle-suppressions.xml

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,7 +52,8 @@ public class ByteArrayEncoder extends AbstractEncoder<byte[]> {
DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType,
@Nullable Map<String, Object> hints) { @Nullable Map<String, Object> hints) {
return Flux.from(inputStream).map(bytes -> { // The following (byte[] bytes) lambda signature declaration is necessary for Eclipse.
return Flux.from(inputStream).map((byte[] bytes) -> {
DataBuffer dataBuffer = bufferFactory.wrap(bytes); DataBuffer dataBuffer = bufferFactory.wrap(bytes);
if (logger.isDebugEnabled() && !Hints.isLoggingSuppressed(hints)) { if (logger.isDebugEnabled() && !Hints.isLoggingSuppressed(hints)) {
String logPrefix = Hints.getLogPrefix(hints); String logPrefix = Hints.getLogPrefix(hints);

@ -18,6 +18,7 @@
<!-- spring-core --> <!-- spring-core -->
<suppress files="[\\/]src[\\/]main[\\/]java[\\/]org[\\/]springframework[\\/]asm[\\/]" checks=".*" /> <suppress files="[\\/]src[\\/]main[\\/]java[\\/]org[\\/]springframework[\\/]asm[\\/]" checks=".*" />
<suppress files="[\\/]src[\\/]main[\\/]java[\\/]org[\\/]springframework[\\/]cglib[\\/]" checks=".*" /> <suppress files="[\\/]src[\\/]main[\\/]java[\\/]org[\\/]springframework[\\/]cglib[\\/]" checks=".*" />
<suppress files="ByteArrayEncoder" checks="SpringLambda" />
<suppress files="SocketUtils" checks="HideUtilityClassConstructor" /> <suppress files="SocketUtils" checks="HideUtilityClassConstructor" />
<suppress files="ResolvableType" checks="FinalClass" /> <suppress files="ResolvableType" checks="FinalClass" />

Loading…
Cancel
Save