Skip to content

Commit 05814f7

Browse files
committed
Polishing contribution
Closes gh-35625
1 parent ba2bb08 commit 05814f7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferLimitException.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@
3131
public class DataBufferLimitException extends IllegalStateException {
3232

3333

34+
/**
35+
* Create an instance with the given message.
36+
*/
3437
public DataBufferLimitException(String message) {
3538
super(message);
3639
}
3740

41+
/**
42+
* Create an instance with a message and a cause, e.g. {@link OutOfMemoryError}.
43+
* @since 6.2.12
44+
*/
3845
public DataBufferLimitException(String message, Throwable cause) {
3946
super(message, cause);
4047
}

spring-core/src/main/java/org/springframework/core/io/buffer/NettyDataBuffer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ public String toString() {
383383
return this.byteBuf.toString();
384384
}
385385
catch (OutOfMemoryError ex) {
386-
throw new DataBufferLimitException("Failed to convert data buffer to string: " + ex.getMessage(), ex);
386+
throw new DataBufferLimitException(
387+
"Failed to convert data buffer to string: " + ex.getMessage(), ex);
387388
}
388389
}
389390

0 commit comments

Comments
 (0)