fix two smaller issues (#1774)

This commit is contained in:
Pasqual Koschmieder 2022-07-26 19:20:07 +02:00 committed by GitHub
parent 84cb541866
commit c3dc00de05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -15,9 +15,9 @@
*/
package com.comphenix.protocol.utility;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
/**
* Represents a dynamic package and an arbitrary number of cached classes.
@ -39,7 +39,7 @@ final class CachedPackage {
public CachedPackage(String packageName, ClassSource source) {
this.source = source;
this.packageName = packageName;
this.cache = new HashMap<>();
this.cache = new ConcurrentHashMap<>();
}
/**

View File

@ -58,7 +58,7 @@ public final class MinecraftReflection {
/**
* Regular expression that matches a canonical Java class.
*/
private static final String CANONICAL_REGEX = "\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
private static final String CANONICAL_REGEX = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)+\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
private static final String MINECRAFT_CLASS_NAME_REGEX = "net\\.minecraft\\." + CANONICAL_REGEX;
/**