From c3dc00de0582f977b156722d77d813ae6b8bb30c Mon Sep 17 00:00:00 2001 From: Pasqual Koschmieder Date: Tue, 26 Jul 2022 19:20:07 +0200 Subject: [PATCH] fix two smaller issues (#1774) --- .../java/com/comphenix/protocol/utility/CachedPackage.java | 4 ++-- .../com/comphenix/protocol/utility/MinecraftReflection.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/comphenix/protocol/utility/CachedPackage.java b/src/main/java/com/comphenix/protocol/utility/CachedPackage.java index 8bd33ab2..23bbff2d 100644 --- a/src/main/java/com/comphenix/protocol/utility/CachedPackage.java +++ b/src/main/java/com/comphenix/protocol/utility/CachedPackage.java @@ -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<>(); } /** diff --git a/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java b/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java index 82187928..ef9a033b 100644 --- a/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java +++ b/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java @@ -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; /**