java.lang.IllegalArgumentException: Illegal group reference
at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)
at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:997)
at java.base/java.util.regex.Matcher.replaceFirst(Matcher.java:1407)
at java.base/java.lang.String.replaceFirst(String.java:2900)
at com.linkkou.mybatis.log.LogInterceptor.replaceFirst(LogInterceptor.java:152)
at com.linkkou.mybatis.log.LogInterceptor.getCompleteSql(LogInterceptor.java:123)
Occurs when storing encrypted data Error:
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
// password include:
return passwordEncoder.encode(password);
Will consider $ xxx $ to be regular
This method will be called automatically: at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)
Comment From: jzheaux
Hi, @itl-coder, thanks for reaching out. I'm going to need a bit more information in order to address your issue. Can you provide a sample unit test that causes BCryptPasswordEncoder to fail how you describe?
Comment From: itl-coder
You only need to customize a save(User user) in the SpringSecurity environment and encrypt the password field to trigger;
@Data class User{ private String username; private String password; }
public static String encodePassword(String password) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.encode(password);
}
User user = new User();
user.setUsername("zs");
// encrypt password
user.setPassword(encodePassword("12345678$"));
//
userMapper.save(user);
Comment From: itl-coder