Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sfPlayer1 committed Nov 10, 2021
1 parent 88b0631 commit 8918abd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static boolean isClassDesc(String text) {
}

private static final Pattern FIELD_DESC_PATTERN = Pattern.compile("\\[*(" + CLASS_DESC_PATTERN +"|[BCDFIJSZ])");
private static final Pattern METHOD_DESC_PATTERN = Pattern.compile("\\(" + FIELD_DESC_PATTERN + "*\\)(" + FIELD_DESC_PATTERN + "|V)");
private static final Pattern METHOD_DESC_PATTERN = Pattern.compile("\\((" + FIELD_DESC_PATTERN + ")*\\)(" + FIELD_DESC_PATTERN + "|V)");

public static boolean isFieldDesc(String text) {
return FIELD_DESC_PATTERN.matcher(text).matches();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void isClassName() {
assertTrue(StringUtility.isClassName("com/github/logicf/$$__cl_a_ss"));
assertTrue(StringUtility.isClassName("com/gith$$ub/log$$icf/cla$$ss"));
assertTrue(StringUtility.isClassName("$$/__"));
assertFalse(StringUtility.isClassName("abc"));
assertTrue(StringUtility.isClassName("abc"));
assertFalse(StringUtility.isClassName("com/github/logicf/"));
assertFalse(StringUtility.isClassName("com//github/logicf"));
assertFalse(StringUtility.isClassName("com.github.logicf.class"));
Expand All @@ -75,7 +75,7 @@ void isClassDesc() {
assertTrue(StringUtility.isClassDesc("Lcom/github/logicf/$$__cl_a_ss;"));
assertTrue(StringUtility.isClassDesc("Lcom/gith$$ub/log$$icf/cla$$ss;"));
assertTrue(StringUtility.isClassDesc("L$$/__;"));
assertFalse(StringUtility.isClassDesc("Labc;"));
assertTrue(StringUtility.isClassDesc("Labc;"));
assertFalse(StringUtility.isClassDesc("Lcom/github/logicf/;"));
assertFalse(StringUtility.isClassDesc("Lcom//github/logicf;"));
assertFalse(StringUtility.isClassDesc("Lcom.github.logicf.class;"));
Expand Down Expand Up @@ -134,6 +134,6 @@ void isInternalClassName() {
assertTrue(StringUtility.isInternalClassName("java/lang/Boolean"));
assertTrue(StringUtility.isInternalClassName("javax/crypto/Cipher"));
assertFalse(StringUtility.isInternalClassName("net/minecraft/bla"));
assertThrows(RuntimeException.class, () -> StringUtility.isInternalClassName("bla"));
assertThrows(RuntimeException.class, () -> StringUtility.isInternalClassName("()bla"));
}
}

0 comments on commit 8918abd

Please sign in to comment.