< prev index next >

test/langtools/tools/javac/patterns/Unnamed.java

Print this page

 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */
 23 
 24 /*
 25  * @test
 26  * @bug 8304246
 27  * @summary Compiler Implementation for Unnamed patterns and variables
 28  * @compile Unnamed.java
 29  * @run main Unnamed

 30  */
 31 
 32 import java.util.Objects;
 33 import java.lang.annotation.ElementType;
 34 import java.lang.annotation.Retention;
 35 import java.lang.annotation.RetentionPolicy;
 36 import java.lang.annotation.Target;
 37 
 38 public class Unnamed {
 39     public static void main(String[] args) throws Throwable {
 40         new Unnamed().run();
 41     }
 42 
 43     public void run() {
 44         assertEquals(1, testMultiValuesTopLevel(new R1()));
 45         assertEquals(2, testMultiValuesTopLevel(new R3()));
 46         assertEquals(1, testMultiValuesTopLevel2(new R1()));
 47         assertEquals(2, testMultiValuesTopLevel2(new R2()));
 48         assertEquals(2, testMultiValuesTopLevel2(new R4()));
 49         assertEquals(1, testMultiValuesNested(new Box<>(new R1())));

 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */
 23 
 24 /*
 25  * @test
 26  * @bug 8304246
 27  * @summary Compiler Implementation for Unnamed patterns and variables
 28  * @compile Unnamed.java
 29  * @run main Unnamed
 30  * @ignore Verifier error
 31  */
 32 
 33 import java.util.Objects;
 34 import java.lang.annotation.ElementType;
 35 import java.lang.annotation.Retention;
 36 import java.lang.annotation.RetentionPolicy;
 37 import java.lang.annotation.Target;
 38 
 39 public class Unnamed {
 40     public static void main(String[] args) throws Throwable {
 41         new Unnamed().run();
 42     }
 43 
 44     public void run() {
 45         assertEquals(1, testMultiValuesTopLevel(new R1()));
 46         assertEquals(2, testMultiValuesTopLevel(new R3()));
 47         assertEquals(1, testMultiValuesTopLevel2(new R1()));
 48         assertEquals(2, testMultiValuesTopLevel2(new R2()));
 49         assertEquals(2, testMultiValuesTopLevel2(new R4()));
 50         assertEquals(1, testMultiValuesNested(new Box<>(new R1())));
< prev index next >