StringUtils.delete goes into eternal loop [SPR-5227] #9901
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Mattias Hellborg Arthursson opened SPR-5227 and commented
Passing an empty String to StringUtils.delete causes an eternal loop. Sending an empty String as input doesn't really make sense, but there is a possibility it might happen accidentally (hey - it happened to me :))
Test case verifying the bug:
@Test
public void verfiyDeleteWithEmptyStringWillCauseEternalLoop(){
String result = StringUtils.delete("Some string", "");
// We never get here - stuck in eternal loop above.
assertEquals("Some string", result);
}
Affects: 2.0.8, 2.5.5
Backported to: 2.0.9
The text was updated successfully, but these errors were encountered: