aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/eclipse/Eclipse.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-22 08:03:42 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-22 08:03:42 +0100
commitbcd05a01b14705678dfd280989fa5071b627a234 (patch)
tree55f5af9b2b158c37f9d04b7ec27aad048d4e1ffd /src/utils/lombok/eclipse/Eclipse.java
parentade900b82b8205bb439ac9d6d99dff0c3af6e10f (diff)
parentfa0b5249cf5fee28d9be13ecdf0225f651f686aa (diff)
downloadlombok-bcd05a01b14705678dfd280989fa5071b627a234.tar.gz
lombok-bcd05a01b14705678dfd280989fa5071b627a234.tar.bz2
lombok-bcd05a01b14705678dfd280989fa5071b627a234.zip
Merge branch 'records'
# Conflicts: # src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java # src/core/lombok/eclipse/handlers/HandleBuilder.java # src/core/lombok/eclipse/handlers/HandleData.java # src/core/lombok/eclipse/handlers/HandleNonNull.java # src/core/lombok/eclipse/handlers/HandleSuperBuilder.java # src/core/lombok/javac/handlers/HandleBuilder.java # src/core/lombok/javac/handlers/HandleNonNull.java # src/core/lombok/javac/handlers/HandleSuperBuilder.java # test/core/src/lombok/RunTestsViaEcj.java
Diffstat (limited to 'src/utils/lombok/eclipse/Eclipse.java')
-rw-r--r--src/utils/lombok/eclipse/Eclipse.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java
index 31979955..ac15f90b 100644
--- a/src/utils/lombok/eclipse/Eclipse.java
+++ b/src/utils/lombok/eclipse/Eclipse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2019 The Project Lombok Authors.
+ * Copyright (C) 2009-2021 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -60,6 +60,11 @@ public class Eclipse {
*/
public static final int ECLIPSE_DO_NOT_TOUCH_FLAG = ASTNode.Bit24;
+ /* This section includes flags that would ordinarily be in ClassFileConstants, but which are 'too new' (we don't compile against older versions of ecj/eclipse for compatibility). */
+ public static final int AccRecord = ASTNode.Bit25;
+ public static final int IsCanonicalConstructor = ASTNode.Bit10; // For record declarations, and presumably later on any constructor matching the destructor.
+ public static final int IsImplicit = ASTNode.Bit11; // the generated statements in the compact constructor of a record.
+
private static final Pattern SPLIT_AT_DOT = Pattern.compile("\\.");
private Eclipse() {
@@ -239,9 +244,14 @@ public class Eclipse {
for (Field f : CompilerOptions.class.getDeclaredFields()) {
try {
- if (f.getName().startsWith("VERSION_1_")) {
- ecjCompilerVersionCached = Math.max(ecjCompilerVersionCached, Integer.parseInt(f.getName().substring("VERSION_1_".length())));
- }
+ String fName = f.getName();
+ String versionNumber = null;
+ if (fName.startsWith("VERSION_1_")) {
+ versionNumber = fName.substring("VERSION_1_".length());
+ } else if (fName.startsWith("VERSION_")) {
+ versionNumber = fName.substring("VERSION_".length());
+ } else continue;
+ ecjCompilerVersionCached = Math.max(ecjCompilerVersionCached, Integer.parseInt(versionNumber));
} catch (Exception ignore) {}
}