Compatible with 2024.1
This commit is contained in:
parent
8be6cfa8ae
commit
b0518db532
|
@ -2,12 +2,14 @@ package com.novitechie;
|
|||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class StackTraceRule {
|
||||
public static boolean check() {
|
||||
RuntimeException e = new RuntimeException();
|
||||
Pattern pattern = Pattern.compile("\\A\\p{ASCII}*\\z");
|
||||
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
||||
if (stackTraceElement.getFileName() == null) {
|
||||
if (!pattern.matcher(stackTraceElement.getMethodName()).matches()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +18,9 @@ public class StackTraceRule {
|
|||
|
||||
public static Date hook() {
|
||||
RuntimeException e = new RuntimeException();
|
||||
Pattern pattern = Pattern.compile("\\A\\p{ASCII}*\\z");
|
||||
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
||||
if (stackTraceElement.getFileName() == null) {
|
||||
if (!pattern.matcher(stackTraceElement.getMethodName()).matches()) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 180);
|
||||
return calendar.getTime();
|
||||
|
|
Loading…
Reference in New Issue