aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/lombok')
-rw-r--r--src/utils/lombok/eclipse/Eclipse.java7
-rw-r--r--src/utils/lombok/javac/TreeMirrorMaker.java17
-rw-r--r--src/utils/lombok/javac/java8/CommentCollectingScannerFactory.java3
3 files changed, 24 insertions, 3 deletions
diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java
index 8af481b9..0f42ddc6 100644
--- a/src/utils/lombok/eclipse/Eclipse.java
+++ b/src/utils/lombok/eclipse/Eclipse.java
@@ -224,8 +224,11 @@ public class Eclipse {
int highestVersionSoFar = 0;
for (Field f : ClassFileConstants.class.getDeclaredFields()) {
try {
- if (f.getName().startsWith("JDK1_")) {
- int thisVersion = Integer.parseInt(f.getName().substring("JDK1_".length()));
+ if (f.getName().startsWith("JDK")) {
+ String versionString = f.getName().substring("JDK".length());
+ if (versionString.startsWith("1_")) versionString = versionString.substring("1_".length());
+
+ int thisVersion = Integer.parseInt(versionString);
if (thisVersion > highestVersionSoFar) {
highestVersionSoFar = thisVersion;
latestEcjCompilerVersionConstantCached = (Long) f.get(null);
diff --git a/src/utils/lombok/javac/TreeMirrorMaker.java b/src/utils/lombok/javac/TreeMirrorMaker.java
index a67a4ec1..44e26ab6 100644
--- a/src/utils/lombok/javac/TreeMirrorMaker.java
+++ b/src/utils/lombok/javac/TreeMirrorMaker.java
@@ -32,8 +32,10 @@ import lombok.javac.JavacTreeMaker.TypeTag;
import com.sun.source.tree.LabeledStatementTree;
import com.sun.source.tree.VariableTree;
import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.tree.TreeCopier;
+import com.sun.tools.javac.tree.TreeScanner;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
@@ -109,6 +111,21 @@ public class TreeMirrorMaker extends TreeCopier<Void> {
if (wipeSymAndType) {
copy.sym = null;
copy.type = null;
+ } else {
+ if (original.vartype != null) {
+ copy.vartype.type = original.vartype.type;
+ original.vartype.accept(new TreeScanner() {
+ @Override public void scan(JCTree tree) {
+ super.scan(tree);
+ originalToCopy.get(tree).type = tree.type;
+ }
+
+ @Override public void visitSelect(JCFieldAccess tree) {
+ super.visitSelect(tree);
+ ((JCFieldAccess) originalToCopy.get(tree)).sym = tree.sym;
+ }
+ });
+ }
}
}
diff --git a/src/utils/lombok/javac/java8/CommentCollectingScannerFactory.java b/src/utils/lombok/javac/java8/CommentCollectingScannerFactory.java
index f29f501b..e625cd8d 100644
--- a/src/utils/lombok/javac/java8/CommentCollectingScannerFactory.java
+++ b/src/utils/lombok/javac/java8/CommentCollectingScannerFactory.java
@@ -21,6 +21,7 @@
*/
package lombok.javac.java8;
+import java.nio.Buffer;
import java.nio.CharBuffer;
import com.sun.tools.javac.parser.Scanner;
@@ -79,7 +80,7 @@ public class CommentCollectingScannerFactory extends ScannerFactory {
int limit;
if (input instanceof CharBuffer && ((CharBuffer) input).hasArray()) {
CharBuffer cb = (CharBuffer) input;
- cb.compact().flip();
+ ((Buffer)cb.compact()).flip();
array = cb.array();
limit = cb.limit();
} else {