Skip to content

Commit

Permalink
upgrade jar version
Browse files Browse the repository at this point in the history
  • Loading branch information
ponfee committed Feb 16, 2024
1 parent ae99e00 commit 933a445
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/
public class EscapeUtil
{
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";

private static final char[][] TEXT = new char[64][];

static
Expand Down Expand Up @@ -153,15 +151,4 @@ public static String decode(String content)
return tmp.toString();
}

public static void main(String[] args)
{
String html = "<script>alert(1);</script>";
String escape = EscapeUtil.escape(html);
// String html = "<scr<script>ipt>alert(\"XSS\")</scr<script>ipt>";
// String html = "<123";
// String html = "123>";
System.out.println("clean: " + EscapeUtil.clean(html));
System.out.println("escape: " + escape);
System.out.println("unescape: " + EscapeUtil.unescape(escape));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.lang3.time.StopWatch;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.ByteArrayOutputStream;
import java.io.File;
Expand All @@ -39,7 +41,9 @@
*/
public class MavenDependencyTest {

public static void main(String[] args) throws IOException {
@Disabled
@Test
public void testConflictedVersion() {
StopWatch stopWatch = StopWatch.createStarted();
String dependencyTree = dependencyTree();
stopWatch.stop();
Expand All @@ -61,12 +65,12 @@ public static void main(String[] args) throws IOException {
}

private static String dependencyTree() {
String path = new File(MavenProjects.getProjectBaseDir()).getParentFile().getAbsolutePath();
String path = new File(MavenProjects.getProjectBaseDir()).getParentFile().getAbsolutePath() + "/";
String installCmd = "bash " + path + "mvnw clean install -DskipTests -U -f " + path + "pom.xml";

// String treeCmd = "mvn dependency:tree -f " + path + "pom.xml";
// -B: Run in non-interactive (batch) mode (disables output color)
// -q: 安静模式,只输出ERROR
// -q: 安静模式只输出ERROR
String treeCmd = "bash " + path + "mvnw -B dependency:tree -f " + path + "pom.xml";
try {
execute(installCmd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testValue() throws ParseException {

@Test
public void testInt() {
// 30天的毫秒书转int会溢出,要使用long类型
// 30天的毫秒数转int会溢出,要使用long类型
int num = 30 * 86400 * 1000;
Assertions.assertTrue(num < 0);
Assertions.assertEquals(365, TimeUnit.DAYS.toMillis(365) / (1000 * 86400));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
import cn.ponfee.disjob.core.base.Supervisor;
import cn.ponfee.disjob.core.model.SchedJob;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
* @author Ponfee
Expand Down Expand Up @@ -71,30 +75,25 @@ public void testStaticField() throws ClassNotFoundException {
}

@Test
@Disabled
public void testStaticFinalMethod() {
findlStaticFinalMethod("cn.ponfee.disjob.common");
findlStaticFinalMethod("cn.ponfee.disjob.core");
//findlStaticFinalMethod("cn.ponfee.disjob.id");
findlStaticFinalMethod("cn.ponfee.disjob.worker");
findlStaticFinalMethod("cn.ponfee.disjob.dispatch");
findlStaticFinalMethod("cn.ponfee.disjob.registry");
findStaticFinalMethod("cn/ponfee/disjob/common/**/*.class");
findStaticFinalMethod("cn/ponfee/disjob/core/**/*.class");
findStaticFinalMethod("cn/ponfee/disjob/registry/**/*.class");
findStaticFinalMethod("cn/ponfee/disjob/dispatch/**/*.class");
findStaticFinalMethod("cn/ponfee/disjob/worker/**/*.class");
}

public void findlStaticFinalMethod(String packageName) {
private static void findStaticFinalMethod(String packageName) {
for (Class<?> clazz : new ResourceScanner(packageName).scan4class()) {
for (Method method : clazz.getDeclaredMethods()) {
Set<Method> methods = new HashSet<>();
methods.addAll(Arrays.asList(clazz.getDeclaredMethods()));
methods.addAll(Arrays.asList(clazz.getMethods()));
for (Method method : methods) {
if (Modifier.isStatic(method.getModifiers()) && Modifier.isFinal(method.getModifiers())) {
String cname = method.getDeclaringClass().getName();
if (!cname.contains("$") && cname.startsWith("cn.ponfee")) {
System.err.println(clazz+" "+method);
}
}
}
for (Method method : clazz.getMethods()) {
if (Modifier.isStatic(method.getModifiers()) && Modifier.isFinal(method.getModifiers())) {
String cname = method.getDeclaringClass().getName();
if (!cname.contains("$") && cname.startsWith("cn.ponfee")) {
System.err.println(clazz+" "+method);
System.err.println(clazz + " " + method);
}
}
}
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<springdoc-openapi-ui.version>1.7.0</springdoc-openapi-ui.version>
<mariaDB4j.version>2.5.3</mariaDB4j.version>
<embedded-redis.version>1.3</embedded-redis.version>
<embedded-redis.version>1.4</embedded-redis.version>
<graphviz-java.version>0.18.1</graphviz-java.version>
<testcontainers.version>1.19.4</testcontainers.version>

Expand Down

0 comments on commit 933a445

Please sign in to comment.