diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-01-24 19:45:25 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-01-24 19:45:25 +0100 |
commit | f3fcdcf65ce8c4140f1a3f4e6be18b87a053861b (patch) | |
tree | 1ac95c38c32f2705150b01ddec5286c8e59343eb | |
parent | 1bfe6ee1a54f225876afa7fb479a4f34ac338ade (diff) | |
download | lombok-f3fcdcf65ce8c4140f1a3f4e6be18b87a053861b.tar.gz lombok-f3fcdcf65ce8c4140f1a3f4e6be18b87a053861b.tar.bz2 lombok-f3fcdcf65ce8c4140f1a3f4e6be18b87a053861b.zip |
NPE fix
-rw-r--r-- | src/core/lombok/javac/TreeMirrorMaker.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/lombok/javac/TreeMirrorMaker.java b/src/core/lombok/javac/TreeMirrorMaker.java index 1c0b9311..d3f95b29 100644 --- a/src/core/lombok/javac/TreeMirrorMaker.java +++ b/src/core/lombok/javac/TreeMirrorMaker.java @@ -30,17 +30,21 @@ public class TreeMirrorMaker extends TreeCopier<Void> { @Override public <T extends JCTree> List<T> copy(List<T> originals) { List<T> copies = super.copy(originals); - Iterator<T> it1 = originals.iterator(); - Iterator<T> it2 = copies.iterator(); - while (it1.hasNext()) originalToCopy.put(it1.next(), it2.next()); + if (originals != null) { + Iterator<T> it1 = originals.iterator(); + Iterator<T> it2 = copies.iterator(); + while (it1.hasNext()) originalToCopy.put(it1.next(), it2.next()); + } return copies; } @Override public <T extends JCTree> List<T> copy(List<T> originals, Void p) { List<T> copies = super.copy(originals, p); - Iterator<T> it1 = originals.iterator(); - Iterator<T> it2 = copies.iterator(); - while (it1.hasNext()) originalToCopy.put(it1.next(), it2.next()); + if (originals != null) { + Iterator<T> it1 = originals.iterator(); + Iterator<T> it2 = copies.iterator(); + while (it1.hasNext()) originalToCopy.put(it1.next(), it2.next()); + } return copies; } |