<p>Method jdk/internal/CodeImpl.inflateJumpTargets should also inflate switch instructions.</p><p> </p><p>Perhaps BranchInstruction, JsrInstruction, TableSwitchInstruction, LookupSwitchInstruction should implement an interface with method List<Label> targets().</p><p> </p><p>build test method<br>```<br>   private static void build(CodeBuilder cob) {<br>       Label L1 = cob.newLabel();<br>       Label L2 = cob.newLabel();<br>       SwitchCase sc1 = SwitchCase.of(0,L2);<br>       List<SwitchCase> cases = new ArrayList<>();<br>       cases.add(sc1);<br>       cob.iload(0)<br>          .lookupswitch(L1, cases)<br>          .labelBinding(L2)<br>          .iconst_1()<br>          .ireturn()<br>          .labelBinding(L1)<br>          .iconst_0()<br>          .ireturn();<br>   }</p><p>```</p><p>print of elements in CodeModel<br>```<br>Load[OP=ILOAD_0, slot=0]<br>LookupSwitch[OP=LOOKUPSWITCH]<br>UnboundIntrinsicConstantInstruction[op=ICONST_1]<br>Return[OP=IRETURN]<br>UnboundIntrinsicConstantInstruction[op=ICONST_0]<br>Return[OP=IRETURN]</p><p>```</p><p>test driver class<br>```<br>   public static void main(String[] args) throws IOException {<br>       byte[] bytes = ClassFile.of()<br>               .build(ClassDesc.of("TestSwitchInflate"),<br>                     clb -> clb.withFlags(ClassFile.ACC_PUBLIC  | ClassFile.ACC_SUPER)<br>               .withVersion(49,0)<br>               .withMethodBody("Table", MethodTypeDesc.ofDescriptor("(I)I"),<br>                    ClassFile.ACC_STATIC, SwitchInflate::build));<br>       ClassFile.of().parse(bytes)<br>           .methods().stream()<br>                .flatMap(m -> m.code().stream())<br>               .flatMap(c -> c.elementStream())<br>               .forEach(System.out::println);<br>   }</p><p>```<br> </p>