OpenJDK11: ECGenParameterSpec.

This is part of upgrading to OpenJDK 11.0.13, and this class will be
later extended by others and tested by KeyAgreement tests.

Bug: 214203951
Test: m
Change-Id: Ia3876c961437db13031521fdac1dd23ab76d8446
diff --git a/api/current.txt b/api/current.txt
index d062dcf..8587806 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -8842,9 +8842,8 @@
     method public java.math.BigInteger getP();
   }
 
-  public class ECGenParameterSpec implements java.security.spec.AlgorithmParameterSpec {
+  public class ECGenParameterSpec extends java.security.spec.NamedParameterSpec implements java.security.spec.AlgorithmParameterSpec {
     ctor public ECGenParameterSpec(String);
-    method public String getName();
   }
 
   public class ECParameterSpec implements java.security.spec.AlgorithmParameterSpec {
diff --git a/lint-baseline.xml b/lint-baseline.xml
index 662a95f..7153731 100644
--- a/lint-baseline.xml
+++ b/lint-baseline.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <issues format="6" by="lint 7.2.0-dev" type="baseline" client="" dependencies="true" name="" variant="all" version="7.2.0-dev">
+<!-- generated by libcore/tools/update-lint-baseline/update-lint-baseline.sh -->
 
     <issue
         id="NewApi"
@@ -124,6 +125,17 @@
 
     <issue
         id="NewApi"
+        message="Class requires API level 33 (current min is 31): `java.security.spec.NamedParameterSpec`"
+        errorLine1="public class ECGenParameterSpec extends NamedParameterSpec {"
+        errorLine2="                                        ~~~~~~~~~~~~~~~~~~">
+        <location
+            file="libcore/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java"
+            line="37"
+            column="41"/>
+    </issue>
+
+    <issue
+        id="NewApi"
         message="Class requires API level 33 (current min is 31): `java.lang.invoke.VarHandle`"
         errorLine1="class FieldVarHandle extends VarHandle {"
         errorLine2="                             ~~~~~~~~~">
@@ -339,6 +351,17 @@
 
     <issue
         id="NewApi"
+        message="Class requires API level 32 (current min is 31): `java.security.spec.NamedParameterSpec`"
+        errorLine1="public class ECGenParameterSpec extends NamedParameterSpec {"
+        errorLine2="                                        ~~~~~~~~~~~~~~~~~~">
+        <location
+            file="libcore/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java"
+            line="37"
+            column="41"/>
+    </issue>
+
+    <issue
+        id="NewApi"
         message="Class requires API level 32 (current min is 31): `java.lang.invoke.VarHandle`"
         errorLine1="class FieldVarHandle extends VarHandle {"
         errorLine2="                             ~~~~~~~~~">
diff --git a/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java b/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java
index 4f3f63b..ae9ed6b 100644
--- a/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java
+++ b/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -34,9 +34,8 @@
  *
  * @since 1.5
  */
-public class ECGenParameterSpec implements AlgorithmParameterSpec {
-
-    private String name;
+// Android-added: implements AlgorithmParameterSpec in order to maintain backwards compatibility.
+public class ECGenParameterSpec extends NamedParameterSpec implements AlgorithmParameterSpec {
 
     /**
      * Creates a parameter specification for EC parameter
@@ -44,25 +43,27 @@
      * {@code stdName} in order to generate the corresponding
      * (precomputed) elliptic curve domain parameters. For the
      * list of supported names, please consult the documentation
-     * of provider whose implementation will be used.
+     * of the provider whose implementation will be used.
+     *
      * @param stdName the standard name of the to-be-generated EC
-     * domain parameters.
-     * @exception NullPointerException if {@code stdName}
-     * is null.
+     *                domain parameters.
+     * @throws NullPointerException if {@code stdName}
+     *                              is null.
      */
     public ECGenParameterSpec(String stdName) {
-        if (stdName == null) {
-            throw new NullPointerException("stdName is null");
-        }
-        this.name = stdName;
+        super(stdName);
     }
 
+
     /**
      * Returns the standard or predefined name of the
      * to-be-generated EC domain parameters.
      * @return the standard or predefined name.
      */
+    // Android-added: function overridden in order to maintain backwards compatibility.
+    @Override
     public String getName() {
-        return name;
+      return super.getName();
     }
 }
+