[bugfix] building would fail

due to an invalid reference from src/utils to src/core.
This commit is contained in:
Reinier Zwitserloot committed 2020-06-25 23:31:22 +02:00
1 parent 0f1c950b77
commit 966852e410
4 files changed
+16 -12

No files matched your search

@@ -745,13 +745,6 @@ public class HandlerUtil {
return b.toString();
}
/** Matches any of the 8 primitive names, such as {@code boolean}. */
private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile("^(?:boolean|byte|short|int|long|float|double|char)$");
public static boolean isPrimitive(String typeName) {
return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches();
}
/** Matches any of the 8 primitive wrapper names, such as {@code Boolean}. */
private static final Pattern PRIMITIVE_WRAPPER_TYPE_NAME_PATTERN = Pattern.compile("^(?:java\\.lang\\.)?(?:Boolean|Byte|Short|Integer|Long|Float|Double|Character)$");
@@ -759,7 +752,7 @@ public class HandlerUtil {
// Modification in this code should be documented
// 1. In the changelog this should be marked as an INPROBABLE BREAKING CHANGE, since the hashcode will change
// 2. In the javadoc of EqualsAndHashcode.Include#rank
if (isPrimitive(typeName)) return 1000;
if (JavaIdentifiers.isPrimitive(typeName)) return 1000;
if (PRIMITIVE_WRAPPER_TYPE_NAME_PATTERN.matcher(typeName).matches()) return 800;
return 0;
}
@@ -21,6 +21,8 @@
*/
package lombok.core;
import java.util.regex.Pattern;
/**
* Utility functions for validating potential java verifiers.
*/
@@ -54,4 +56,13 @@ public class JavaIdentifiers {
public static boolean isKeyword(String keyword) {
return KEYWORDS.contains(keyword);
}
/** Matches any of the 8 primitive names, such as {@code boolean}. */
private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile("^(?:boolean|byte|short|int|long|float|double|char)$");
public static boolean isPrimitive(String typeName) {
return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches();
}
}
+2 -2
View File
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
import lombok.core.ClassLiteral;
import lombok.core.FieldSelect;
import lombok.core.handlers.HandlerUtil;
import lombok.core.JavaIdentifiers;
import lombok.permit.Permit;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
@@ -164,7 +164,7 @@ public class Eclipse {
*/
public static boolean isPrimitive(TypeReference ref) {
if (ref.dimensions() > 0) return false;
return HandlerUtil.isPrimitive(toQualifiedName(ref.getTypeName()));
return JavaIdentifiers.isPrimitive(toQualifiedName(ref.getTypeName()));
}
/**
+2 -2
View File
@@ -57,7 +57,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import lombok.core.ClassLiteral;
import lombok.core.FieldSelect;
import lombok.core.handlers.HandlerUtil;
import lombok.core.JavaIdentifiers;
import lombok.javac.JavacTreeMaker.TreeTag;
import lombok.javac.JavacTreeMaker.TypeTag;
import lombok.permit.Permit;
@@ -133,7 +133,7 @@ public class Javac {
* expression) represents a primitive type.
*/
public static boolean isPrimitive(JCExpression ref) {
return HandlerUtil.isPrimitive(ref.toString());
return JavaIdentifiers.isPrimitive(ref.toString());
}
/**