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.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class StackTraceRule {
|
public class StackTraceRule {
|
||||||
public static boolean check() {
|
public static boolean check() {
|
||||||
RuntimeException e = new RuntimeException();
|
RuntimeException e = new RuntimeException();
|
||||||
|
Pattern pattern = Pattern.compile("\\A\\p{ASCII}*\\z");
|
||||||
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
||||||
if (stackTraceElement.getFileName() == null) {
|
if (!pattern.matcher(stackTraceElement.getMethodName()).matches()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +18,9 @@ public class StackTraceRule {
|
||||||
|
|
||||||
public static Date hook() {
|
public static Date hook() {
|
||||||
RuntimeException e = new RuntimeException();
|
RuntimeException e = new RuntimeException();
|
||||||
|
Pattern pattern = Pattern.compile("\\A\\p{ASCII}*\\z");
|
||||||
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
|
||||||
if (stackTraceElement.getFileName() == null) {
|
if (!pattern.matcher(stackTraceElement.getMethodName()).matches()) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.add(Calendar.DAY_OF_MONTH, 180);
|
calendar.add(Calendar.DAY_OF_MONTH, 180);
|
||||||
return calendar.getTime();
|
return calendar.getTime();
|
||||||
|
|
Loading…
Reference in New Issue