fix two smaller issues

This commit is contained in:
derklaro 2022-07-25 11:47:50 +02:00
parent 84cb541866
commit 357e5dd721
No known key found for this signature in database
GPG Key ID: 7CCE00A77D4A0A3E
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;
/**