diff options
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index eef6fd9a..14687e32 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -163,7 +163,7 @@ public class PatchFixes { } else return; try { - LocalDeclaration.class.getDeclaredField("$initCopy").set(variableDecl, init); + if (initCopyField != null) initCopyField.set(variableDecl, init); } catch (Exception e) { e.printStackTrace(System.out); // In ecj mode this field isn't there and we don't need the copy anyway, so, we ignore the exception. @@ -176,7 +176,7 @@ public class PatchFixes { try { initCopyField = LocalDeclaration.class.getDeclaredField("$initCopy"); } catch (Throwable t) { - //ignore - no $generatedBy exists when running in ecj. + //ignore - no $initCopy exists when running in ecj. } } @@ -191,7 +191,6 @@ public class PatchFixes { if (init == null && initCopyField != null) { try { init = (Expression) initCopyField.get(local); - System.out.println("copy = " + init); } catch (Exception e) { throw new RuntimeException(e); } |