# HG changeset patch
# User xyin
# Date 1557123812 -28800
# Node ID b9e5f809068877eee3605d5a53ae262abca950fb
# Parent  3efc6cb7ffdb2ab2cf3f2619e4d7be32c9fc8a8d
JDK-8210696-branch: fix loadCaptureFile exception swallowing

diff -r 3efc6cb7ffdb -r b9e5f8090688 test/jdk/com/sun/jndi/ldap/lib/BaseLdapServer.java
--- a/test/jdk/com/sun/jndi/ldap/lib/BaseLdapServer.java	Wed May 01 15:10:09 2019 +0100
+++ b/test/jdk/com/sun/jndi/ldap/lib/BaseLdapServer.java	Mon May 06 14:23:32 2019 +0800
@@ -161,8 +161,8 @@
      */
     @Override
     public synchronized void start() {
+        isRunning = true;
         super.start();
-        isRunning = true;
     }
 
     /**
diff -r 3efc6cb7ffdb -r b9e5f8090688 test/jdk/com/sun/jndi/ldap/lib/LdapPlaybackServer.java
--- a/test/jdk/com/sun/jndi/ldap/lib/LdapPlaybackServer.java	Wed May 01 15:10:09 2019 +0100
+++ b/test/jdk/com/sun/jndi/ldap/lib/LdapPlaybackServer.java	Mon May 06 14:23:32 2019 +0800
@@ -60,13 +60,16 @@
      */
     private final Map<Integer, List<byte[]>> cache = new HashMap<>();
 
-    private String fileName;
-
     public LdapPlaybackServer(ServerSocket serverSocket, String fileName) {
         super(serverSocket);
-        this.fileName = fileName;
         setDebugLevel(DebugLevel.CUSTOMIZE, this.getClass());
         setCommonRequestHandler(this::handleRequest);
+        try {
+            debug("Loading LDAP cache from: " + fileName);
+            loadCaptureFile(fileName);
+        } catch (IOException e) {
+            throw new RuntimeException("ERROR: failed to load LDAP cache", e);
+        }
     }
 
     /*
@@ -167,10 +170,7 @@
     @Override
     public void run() {
         try {
-            debug("Loading LDAP cache from: " + fileName);
-            loadCaptureFile(fileName);
             debug("listening on port " + getPort());
-
             super.run();
         } catch (Exception e) {
             debug("ERROR: " + e);