-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
8u152
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 64bits 6.1.7601
Linux 16.04 64bits
A DESCRIPTION OF THE PROBLEM :
The following piece of code will loop indefinitely :
public static void main(String[] args){
String oldValue = "BIO GOURMETSUn échéancier signé , Une ouverture de compte ";
String newValue = oldValue.replaceAll("^(\\p{Z}|\\s)+", "");
newValue = newValue.replaceAll("(\\p{Z}|\\s)+$", "");
System.out.print("'"+newValue+"'");
}
If you duplicate the replaceAll to first replace \\p{Z} then \\s, it works...
With many other base value (tested on about 1 million values), the code works fine. This specific value is problematic.
REPRODUCIBILITY :
This bug can be reproduced rarely.
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 64bits 6.1.7601
Linux 16.04 64bits
A DESCRIPTION OF THE PROBLEM :
The following piece of code will loop indefinitely :
public static void main(String[] args){
String oldValue = "BIO GOURMETSUn échéancier signé , Une ouverture de compte ";
String newValue = oldValue.replaceAll("^(\\p{Z}|\\s)+", "");
newValue = newValue.replaceAll("(\\p{Z}|\\s)+$", "");
System.out.print("'"+newValue+"'");
}
If you duplicate the replaceAll to first replace \\p{Z} then \\s, it works...
With many other base value (tested on about 1 million values), the code works fine. This specific value is problematic.
REPRODUCIBILITY :
This bug can be reproduced rarely.