>From f9ddb2e875355e882b14529979f6c9ae03cf720e Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Fri, 4 Nov 2016 04:54:02 +0100
Subject: [PATCH] Replaced deprecated ProxyParser.

The deprecated ProxyParser has been replaced with DefaultParser.

https://fedorahosted.org/pki/ticket/2535
---
 base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java  | 4 ++--
 .../src/com/netscape/cms/servlet/test/ConfigurationTest.java      | 8 ++++----
 base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java      | 4 ++--
 base/java-tools/src/com/netscape/cmstools/OCSPClient.java         | 4 ++--
 base/java-tools/src/com/netscape/cmstools/cli/CLI.java            | 4 ++--
 .../kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java | 4 ++--
 .../com/netscape/cms/servlet/test/GeneratePKIArchiveOptions.java  | 4 ++--
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
index 92c776d17a3993fdd50ecbdfd3e5e3b5692888f2..f036fc2be478be3f21a02f5013aa6a35dd6538bf 100644
--- a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
+++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
@@ -22,10 +22,10 @@ import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.crypto.AlreadyInitializedException;
 import org.mozilla.jss.crypto.CryptoToken;
@@ -76,7 +76,7 @@ public class CATest {
         options.addOption("c", true, "Optional SSL Client cert Nickname");
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             CommandLine cmd = parser.parse(options, args);
 
             if (cmd.hasOption("h")) {
diff --git a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
index 69994fa389d31f15e314feba6bfbd3d4803622ba..897c486fd935577860f0cfbe54165e501dca4b9b 100644
--- a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
+++ b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
@@ -28,14 +28,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import netscape.security.x509.X500Name;
-
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.asn1.ASN1Util;
 import org.mozilla.jss.asn1.BIT_STRING;
@@ -64,6 +62,8 @@ import com.netscape.certsrv.system.SystemCertData;
 import com.netscape.certsrv.system.SystemConfigClient;
 import com.netscape.cmsutil.util.Utils;
 
+import netscape.security.x509.X500Name;
+
 /**
  * @author alee
  *
@@ -101,7 +101,7 @@ public class ConfigurationTest {
         options.addOption("x", true, "Test number");
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             CommandLine cmd = parser.parse(options, args);
 
             if (cmd.hasOption("t")) {
diff --git a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
index 6044b7aacb29f9ab25b80a6e8f8ed580c1e4cc51..44e098f8ea1129f4895347b92966f816e348a539 100644
--- a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
+++ b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
@@ -31,9 +31,9 @@ import java.security.PublicKey;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
 import org.apache.commons.io.FileUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -270,7 +270,7 @@ public class CRMFPopClient {
         CommandLine cmd = null;
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             cmd = parser.parse(options, args);
 
         } catch (Exception e) {
diff --git a/base/java-tools/src/com/netscape/cmstools/OCSPClient.java b/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
index 67f7b6ef3e889d4bf8476225c58e258d916bda2d..07aed3a44afc8b7c87c999f179ca96d7d81eb0d9 100644
--- a/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
+++ b/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
@@ -27,9 +27,9 @@ import java.net.UnknownHostException;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
 import org.mozilla.jss.CryptoManager;
 
 import com.netscape.cmsutil.ocsp.BasicOCSPResponse;
@@ -127,7 +127,7 @@ public class OCSPClient {
         CommandLine cmd = null;
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             cmd = parser.parse(options, args);
 
         } catch (Exception e) {
diff --git a/base/java-tools/src/com/netscape/cmstools/cli/CLI.java b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
index 13387495b72afa71a85e9ce74157603b8bf54b68..52130a19b83b06bd8140026bdef1fd6902e1e415 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
@@ -25,9 +25,9 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
-import org.apache.commons.cli.PosixParser;
 import org.apache.commons.lang.StringUtils;
 
 import com.netscape.certsrv.client.PKIClient;
@@ -40,7 +40,7 @@ public class CLI {
 
     public static boolean verbose;
 
-    public static CommandLineParser parser = new PosixParser();
+    public static CommandLineParser parser = new DefaultParser();
     public static HelpFormatter formatter = new HelpFormatter();
 
     public String name;
diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
index 720bba2b9af71757c9ff3c77edeb235ace427af0..b2d45ea240811ccc4e32f6016a1c9070a1b65b46 100644
--- a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
+++ b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
@@ -36,10 +36,10 @@ import java.util.Random;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.crypto.AlreadyInitializedException;
 import org.mozilla.jss.crypto.IVParameterSpec;
@@ -97,7 +97,7 @@ public class DRMTest {
         options.addOption("c", true, "Optional SSL Client cert Nickname");
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             CommandLine cmd = parser.parse(options, args);
 
             if (cmd.hasOption("h")) {
diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/GeneratePKIArchiveOptions.java b/base/kra/functional/src/com/netscape/cms/servlet/test/GeneratePKIArchiveOptions.java
index 03a0729e756bcd2e96f19b1e27a24f580fd06448..c415f98d04184739b49fd655977d48a29fb4d540 100644
--- a/base/kra/functional/src/com/netscape/cms/servlet/test/GeneratePKIArchiveOptions.java
+++ b/base/kra/functional/src/com/netscape/cms/servlet/test/GeneratePKIArchiveOptions.java
@@ -18,10 +18,10 @@ import java.security.cert.CertificateEncodingException;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.asn1.InvalidBERException;
 import org.mozilla.jss.crypto.AlreadyInitializedException;
@@ -123,7 +123,7 @@ public class GeneratePKIArchiveOptions {
         options.addOption("k", true, "Key file");
 
         try {
-            CommandLineParser parser = new PosixParser();
+            CommandLineParser parser = new DefaultParser();
             CommandLine cmd = parser.parse(options, args);
 
             if (cmd.hasOption("p")) {
-- 
2.5.5

