1 // ASM: a very small and fast Java bytecode manipulation framework 2 // Copyright (c) 2000-2011 INRIA, France Telecom 3 // All rights reserved. 4 // 5 // Redistribution and use in source and binary forms, with or without 6 // modification, are permitted provided that the following conditions 7 // are met: 8 // 1. Redistributions of source code must retain the above copyright 9 // notice, this list of conditions and the following disclaimer. 10 // 2. Redistributions in binary form must reproduce the above copyright 11 // notice, this list of conditions and the following disclaimer in the 12 // documentation and/or other materials provided with the distribution. 13 // 3. Neither the name of the copyright holders nor the names of its 14 // contributors may be used to endorse or promote products derived from 15 // this software without specific prior written permission. 16 // 17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 // THE POSSIBILITY OF SUCH DAMAGE. 28 package jdk8; 29 30 import annotations.ICA; 31 import annotations.IFA; 32 import annotations.IMA; 33 import annotations.IPA; 34 import annotations.ITA; 35 import annotations.ITPA; 36 import annotations.ITUA; 37 import annotations.IVA; 38 import annotations.VCA; 39 import annotations.VFA; 40 import annotations.VMA; 41 import annotations.VPA; 42 import annotations.VTA; 43 import annotations.VTPA; 44 import annotations.VTUA; 45 import annotations.VVA; 46 import java.lang.annotation.ElementType; 47 import java.lang.annotation.Retention; 48 import java.lang.annotation.RetentionPolicy; 49 import java.lang.annotation.Target; 50 import java.util.concurrent.Callable; 51 import java.util.concurrent.Future; 52 import java.util.ArrayList; 53 import java.util.Collection; 54 import java.util.HashMap; 55 import java.util.List; 56 import java.util.Map; 57 58 /** 59 * Class which, compiled with the JDK 1.8.0, produces the new class file structures from that 60 * version (compared to JDK 1.3.0). Must be compiled with "javac -g -parameters". 61 */ 62 @VTA(v = 0) 63 @ITA(v = 1) 64 public abstract class AllStructures< 65 @VTPA(v = 2) @ITPA(v = 3) U0, 66 @VTPA(v = 4) @ITPA(v = 5) U1 extends @VTUA(v = 6) @ITUA(v = 7) List<U0>, 67 @VTPA(v = 8) @ITPA(v = 9) 68 U2 extends @VTUA(v = 10) @ITUA(v = 11) Collection<@VTUA(v = 12) @ITUA(v = 13) U0>> 69 extends @VTUA(v = 14) @ITUA(v = 15) HashMap< 70 @VTUA(v = 16) @ITUA(v = 17) U0, @VTUA(v = 18) @ITUA(v = 19) U1> 71 implements @VTUA(v = 20) @ITUA(v = 21) Callable<@VTUA(v = 22) @ITUA(v = 23) U0>, 72 @VTUA(v = 24) @ITUA(v = 25) Future<@VTUA(v = 26) @ITUA(v = 27) U1> { 73 74 @VFA(v = 28) 75 @IFA(v = 29) 76 public HashMap<@VTUA(v = 30) @ITUA(v = 31) U0, @VTUA(v = 32) @ITUA(v = 33) U1> f; 77 78 @VCA(v = 34) 79 @ICA(v = 35) AllStructures()80 public AllStructures() {} 81 82 @VMA(v = 36) 83 @IMA(v = 37) 84 public < 85 @VTPA(v = 38) @ITPA(v = 39) V0 extends @VTUA(v = 40) @ITUA(v = 41) U0, 86 @VTUA(v = 42) @ITUA(v = 43) V1 extends @VTUA(v = 44) @ITUA(v = 45) U1> 87 @VTUA(v = 46) @ITUA(v = 47) 88 Map<@VTUA(v = 48) @ITUA(v = 49) ? extends V0, @VTUA(v = 50) @ITUA(v = 51) ? extends V1> m( 89 @VPA(v = 52) @IPA(v = 53) V0 p0, 90 @VPA(v = 54) @IPA(v = 55) V1 p1, 91 @VPA(v = 56) @IPA(v = 57) 92 Map< 93 @VTUA(v = 58) @ITUA(v = 59) ? extends V0, @VTUA(v = 60) @ITUA(v = 61) 94 ? extends V1> 95 p2) 96 throws @VTUA(v = 62) @ITUA(v = 63) IllegalStateException, @VTUA(v = 64) @ITUA(v = 65) 97 IllegalArgumentException { 98 @VVA(v = 66) 99 @IVA(v = 67) 100 V1 l1 = p1; 101 @VVA(v = 68) 102 @IVA(v = 69) 103 Map<@VTUA(v = 70) @ITUA(v = 71) ? extends V0, @VTUA(v = 72) @ITUA(v = 73) ? extends V1> l2 = p2; 104 @VVA(v = 74) 105 @IVA(v = 75) 106 ArrayList l3 = (@VTUA(v = 76) @ITUA(v = 77) ArrayList) l1; 107 try { m(p0, p1, p2)108 m(p0, p1, p2); 109 } catch (@VTUA(v = 78) @ITUA(v = 79) 110 IllegalStateException 111 | @VTUA(v = 80) @ITUA(v = 81) IllegalArgumentException e1) { 112 // empty catch block 113 } 114 if (l2 instanceof @VTUA(v = 82) @ITUA(v = 83) HashMap) { 115 return l2; 116 } m()117 AllStructures.<@VTUA(v = 84) V0, @ITUA(v = 85) V1>m(); 118 return new @VTUA(v = 86) @ITUA(v = 87) HashMap<@VTUA(v = 88) V0, @ITUA(v = 89) V1>(); 119 } 120 m()121 private static <U, V> void m() {} 122 123 private double g; 124 n()125 private double n() { 126 return g; 127 } 128 anonymousInnerClass()129 private Runnable anonymousInnerClass() throws Exception { 130 return new Runnable() { 131 public void run() { 132 @VTUA(v = 0) 133 @ITUA(v = 1) 134 double f = new InnerClass(g + n()).f; 135 new InnerClass(f); 136 } 137 }; 138 } 139 140 private class InnerClass { 141 142 @VTUA(v = 0) 143 @ITUA(v = 1) 144 private final double f; 145 146 private InnerClass(double f) { 147 this.f = f; 148 } 149 } 150 151 private class {} 152 } 153