langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Code_attribute.java
changeset 42827 36468b5fa7f4
parent 30846 2b3f379840f0
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Code_attribute.java	Fri Dec 16 12:08:46 2016 +0100
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Code_attribute.java	Fri Dec 16 15:27:34 2016 +0000
@@ -103,34 +103,29 @@
     }
 
     public Iterable<Instruction> getInstructions() {
-        return new Iterable<Instruction>() {
-            public Iterator<Instruction> iterator() {
-                return new Iterator<Instruction>() {
+        return () -> new Iterator<Instruction>() {
 
-                    public boolean hasNext() {
-                        return (next != null);
-                    }
+            public boolean hasNext() {
+                return (next != null);
+            }
 
-                    public Instruction next() {
-                        if (next == null)
-                            throw new NoSuchElementException();
+            public Instruction next() {
+                if (next == null)
+                    throw new NoSuchElementException();
 
-                        current = next;
-                        pc += current.length();
-                        next = (pc < code.length ? new Instruction(code, pc) : null);
-                        return current;
-                    }
+                current = next;
+                pc += current.length();
+                next = (pc < code.length ? new Instruction(code, pc) : null);
+                return current;
+            }
 
-                    public void remove() {
-                        throw new UnsupportedOperationException("Not supported.");
-                    }
+            public void remove() {
+                throw new UnsupportedOperationException("Not supported.");
+            }
 
-                    Instruction current = null;
-                    int pc = 0;
-                    Instruction next = new Instruction(code, pc);
-
-                };
-            }
+            Instruction current = null;
+            int pc = 0;
+            Instruction next = new Instruction(code, pc);
 
         };
     }