8075752: jdk.compiler dependency can be eliminated in MethodReferenceNullCheckTest.java
authoranazarov
Mon, 30 Mar 2015 16:38:59 +0100
changeset 29779 81572cfb60a0
parent 29778 872a728c8075
child 29780 8f8e54a1fa20
child 30407 74a552051c9f
8075752: jdk.compiler dependency can be eliminated in MethodReferenceNullCheckTest.java Reviewed-by: jjg
langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java	Thu Mar 26 17:39:04 2015 +0100
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceNullCheckTest.java	Mon Mar 30 16:38:59 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
 
 /**
  * @test
- * @bug 8024696
+ * @bug 8024696 8075752
  * @summary Missing null check in bound method reference capture
  */
 
-import com.sun.tools.javac.util.Assert;
-import java.util.function.*;
+import java.util.function.Supplier;
 
 public class MethodReferenceNullCheckTest {
     public static void main(String[] args) {
@@ -41,7 +40,8 @@
         } catch (NullPointerException npe) {
             npeFired = true;
         } finally {
-            Assert.check(npeFired, "NPE should have been thrown");
+            if (!npeFired)
+                throw new AssertionError("NPE should have been thrown");
         }
     }
 }