aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-04-02 01:20:01 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-04-02 01:20:01 +0200
commit6afa3d2ec9ec18ed8ae5f6c5217b9fb1710c69c7 (patch)
treee435f98b96cdac3525a57ec923049ec5669248ba
parente0c5f3001276b94fd14e7e81e38f72070bda0c4d (diff)
downloadlombok-6afa3d2ec9ec18ed8ae5f6c5217b9fb1710c69c7.tar.gz
lombok-6afa3d2ec9ec18ed8ae5f6c5217b9fb1710c69c7.tar.bz2
lombok-6afa3d2ec9ec18ed8ae5f6c5217b9fb1710c69c7.zip
[#655] Switched to ASM5 to support -target 1.8 classes.
-rw-r--r--buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.13.xml (renamed from buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.12.xml)4
-rw-r--r--buildScripts/ivy.xml2
-rw-r--r--doc/changelog.markdown1
-rw-r--r--src/core/lombok/bytecode/AsmUtil.java4
-rw-r--r--src/core/lombok/bytecode/PreventNullAnalysisRemover.java12
-rw-r--r--src/core/lombok/bytecode/SneakyThrowsRemover.java14
6 files changed, 19 insertions, 18 deletions
diff --git a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.12.xml b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.13.xml
index f402dcc9..0d223e38 100644
--- a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.12.xml
+++ b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.13.xml
@@ -1,5 +1,5 @@
<ivy-module version="2.0">
- <info organisation="org.projectlombok" module="lombok.patcher" revision="0.12" publication="20140301023600">
+ <info organisation="org.projectlombok" module="lombok.patcher" revision="0.13" publication="20140402011000">
<license name="MIT License" url="http://www.opensource.org/licenses/mit-license.php" />
<ivyauthor name="rzwitserloot" url="http://zwitserloot.com/" />
<ivyauthor name="rspilker" url="http://github.com/rspilker" />
@@ -9,6 +9,6 @@
<conf name="default" />
</configurations>
<publications>
- <artifact conf="default" url="http://projectlombok.org/downloads/lombok.patcher-0.12.jar" />
+ <artifact conf="default" url="http://projectlombok.org/downloads/lombok.patcher-0.13.jar" />
</publications>
</ivy-module>
diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml
index b2d3ab21..d7977101 100644
--- a/buildScripts/ivy.xml
+++ b/buildScripts/ivy.xml
@@ -14,7 +14,7 @@
<conf name="javac7" />
</configurations>
<dependencies>
- <dependency org="org.projectlombok" name="lombok.patcher" rev="0.12" conf="buildBase->default; runtime->default" />
+ <dependency org="org.projectlombok" name="lombok.patcher" rev="0.13" conf="buildBase->default; runtime->default" />
<dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="buildBase->runtime; runtime" />
<dependency org="junit" name="junit" rev="4.8.2" conf="test->default; contrib->sources" />
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index dfb9781a..21475d79 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -5,6 +5,7 @@ Lombok Changelog
* CHANGE: suppressConstructorProperties should now be configured via lombok configuration. [Issue #659](https://code.google.com/p/projectlombok/issues/detail?id=659)
* CHANGE: The `canEqual` method generated by `@EqualsAndHashCode`, `@Value` and `@Data` is now `protected` instead of `public`. [Issue #660](https://code.google.com/p/projectlombok/issues/detail?id=660)
* BUGFIX: Deadlocks would occasionally occur in eclipse when using lazy getters [Issue #590](https://code.google.com/p/projectlombok/issues/detail?id=590)
+* BUGFIX: Usage of `@SneakyThrows` with a javac from JDK8 with `-target 1.8` would result in a post compiler error. [Issue #655](https://code.google.com/p/projectlombok/issues/detail?id=655)
### v1.12.6 (March 6th, 2014)
* BUGFIX: Deadlocks would occasionally occur in eclipse during project builds, especially if using the gradle plugin. [Issue #645](https://code.google.com/p/projectlombok/issues/detail?id=645)
diff --git a/src/core/lombok/bytecode/AsmUtil.java b/src/core/lombok/bytecode/AsmUtil.java
index b0606a18..6ac1dac4 100644
--- a/src/core/lombok/bytecode/AsmUtil.java
+++ b/src/core/lombok/bytecode/AsmUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 The Project Lombok Authors.
+ * Copyright (C) 2010-2014 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
@@ -38,7 +38,7 @@ class AsmUtil {
ClassReader reader = new ClassReader(byteCode);
ClassWriter writer = new FixedClassWriter(reader, 0);
- ClassVisitor visitor = new ClassVisitor(Opcodes.ASM4, writer) {
+ ClassVisitor visitor = new ClassVisitor(Opcodes.ASM5, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);
}
diff --git a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
index 751e691f..5f2f5f18 100644
--- a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
+++ b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 The Project Lombok Authors.
+ * Copyright (C) 2010-2014 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
@@ -50,10 +50,10 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation {
class PreventNullAnalysisVisitor extends MethodVisitor {
PreventNullAnalysisVisitor(MethodVisitor mv) {
- super(Opcodes.ASM4, mv);
+ super(Opcodes.ASM5, mv);
}
- @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+ @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
boolean hit = true;
if (hit && opcode != Opcodes.INVOKESTATIC) hit = false;
if (hit && !"preventNullAnalysis".equals(name)) hit = false;
@@ -61,14 +61,14 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation {
if (hit && !"(Ljava/lang/Object;)Ljava/lang/Object;".equals(desc)) hit = false;
if (hit) {
changesMade.set(true);
- if (System.getProperty("lombok.debugAsmOnly", null) != null) super.visitMethodInsn(opcode, owner, name, desc); // DEBUG for issue 470!
+ if (System.getProperty("lombok.debugAsmOnly", null) != null) super.visitMethodInsn(opcode, owner, name, desc, itf); // DEBUG for issue 470!
} else {
- super.visitMethodInsn(opcode, owner, name, desc);
+ super.visitMethodInsn(opcode, owner, name, desc, itf);
}
}
}
- reader.accept(new ClassVisitor(Opcodes.ASM4, writer) {
+ reader.accept(new ClassVisitor(Opcodes.ASM5, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new PreventNullAnalysisVisitor(super.visitMethod(access, name, desc, signature, exceptions));
}
diff --git a/src/core/lombok/bytecode/SneakyThrowsRemover.java b/src/core/lombok/bytecode/SneakyThrowsRemover.java
index 914c313a..8ef64e59 100644
--- a/src/core/lombok/bytecode/SneakyThrowsRemover.java
+++ b/src/core/lombok/bytecode/SneakyThrowsRemover.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2013 The Project Lombok Authors.
+ * Copyright (C) 2010-2014 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
@@ -52,12 +52,12 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
class SneakyThrowsRemoverVisitor extends MethodVisitor {
SneakyThrowsRemoverVisitor(MethodVisitor mv) {
- super(Opcodes.ASM4, mv);
+ super(Opcodes.ASM5, mv);
}
private boolean methodInsnQueued = false;
- @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+ @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
if (
opcode == Opcodes.INVOKESTATIC &&
"sneakyThrow".equals(name) &&
@@ -65,18 +65,18 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
"(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;".equals(desc)) {
if (System.getProperty("lombok.debugAsmOnly", null) != null) {
- super.visitMethodInsn(opcode, owner, name, desc); // DEBUG for issue 470!
+ super.visitMethodInsn(opcode, owner, name, desc, itf); // DEBUG for issue 470!
} else {
methodInsnQueued = true;
}
} else {
- super.visitMethodInsn(opcode, owner, name, desc);
+ super.visitMethodInsn(opcode, owner, name, desc, itf);
}
}
private void handleQueue() {
if (!methodInsnQueued) return;
- super.visitMethodInsn(Opcodes.INVOKESTATIC, "lombok/Lombok", "sneakyThrow", "(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;");
+ super.visitMethodInsn(Opcodes.INVOKESTATIC, "lombok/Lombok", "sneakyThrow", "(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;", false);
methodInsnQueued = false;
diagnostics.addWarning("Proper usage is: throw lombok.Lombok.sneakyThrow(someException);. You did not 'throw' it. Because of this, the call to sneakyThrow " +
"remains in your classfile and you will need lombok.jar on the classpath at runtime.");
@@ -177,7 +177,7 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
}
}
- reader.accept(new ClassVisitor(Opcodes.ASM4, writer) {
+ reader.accept(new ClassVisitor(Opcodes.ASM5, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new SneakyThrowsRemoverVisitor(super.visitMethod(access, name, desc, signature, exceptions));
}