diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2020-08-31 09:57:29 +0200 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2020-08-31 09:57:29 +0200 |
commit | 82ac8aad1d0e3e152db4ce328184c40c73700cee (patch) | |
tree | 3d5abb9072d43b87f19e5faf88a3d09b6c6da8e4 /src/utils/lombok/javac/Javac.java | |
parent | 3d90a51163354930eeea0e26c2b0a567af8e96be (diff) | |
parent | 9148294f78a8e646ee131ca182a9b692bc028fdb (diff) | |
download | lombok-82ac8aad1d0e3e152db4ce328184c40c73700cee.tar.gz lombok-82ac8aad1d0e3e152db4ce328184c40c73700cee.tar.bz2 lombok-82ac8aad1d0e3e152db4ce328184c40c73700cee.zip |
Merge branch 'master' into extensionmethod
Conflicts:
build.xml
Diffstat (limited to 'src/utils/lombok/javac/Javac.java')
-rw-r--r-- | src/utils/lombok/javac/Javac.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index 3cc72f4e..cec43705 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -37,12 +37,6 @@ import javax.lang.model.type.NoType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeVisitor; -import lombok.core.ClassLiteral; -import lombok.core.FieldSelect; -import lombok.javac.JavacTreeMaker.TreeTag; -import lombok.javac.JavacTreeMaker.TypeTag; -import lombok.permit.Permit; - import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.Source; import com.sun.tools.javac.code.Symtab; @@ -61,6 +55,13 @@ import com.sun.tools.javac.tree.JCTree.JCLiteral; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; +import lombok.core.ClassLiteral; +import lombok.core.FieldSelect; +import lombok.core.JavaIdentifiers; +import lombok.javac.JavacTreeMaker.TreeTag; +import lombok.javac.JavacTreeMaker.TypeTag; +import lombok.permit.Permit; + /** * Container for static utility methods relevant to lombok's operation on javac. */ @@ -69,9 +70,6 @@ public class Javac { // prevent instantiation } - /** 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)$"); - private static final Pattern VERSION_PARSER = Pattern.compile("^(\\d{1,6})\\.?(\\d{1,6})?.*$"); private static final Pattern SOURCE_PARSER = Pattern.compile("^JDK(\\d{1,6})_?(\\d{1,6})?.*$"); @@ -135,8 +133,7 @@ public class Javac { * expression) represents a primitive type. */ public static boolean isPrimitive(JCExpression ref) { - String typeName = ref.toString(); - return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches(); + return JavaIdentifiers.isPrimitive(ref.toString()); } /** |