You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "wenshuai.zhang (Jira)" <ji...@apache.org> on 2020/07/08 03:36:00 UTC

[jira] [Created] (ZOOKEEPER-3883) new UncaughtExceptionHandler object with lambda

wenshuai.zhang created ZOOKEEPER-3883:
-----------------------------------------

             Summary: new UncaughtExceptionHandler object with lambda
                 Key: ZOOKEEPER-3883
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3883
             Project: ZooKeeper
          Issue Type: Improvement
          Components: server
            Reporter: wenshuai.zhang


 

old 
{code:java}
public class ZooKeeperThread extends Thread {

    private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperThread.class);

    private UncaughtExceptionHandler uncaughtExceptionalHandler = new UncaughtExceptionHandler() {

        @Override
        public void uncaughtException(Thread t, Throwable e) {
            handleException(t.getName(), e);
        }
    };
{code}
new
{code:java}
public class ZooKeeperThread extends Thread {

    private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperThread.class);

    private UncaughtExceptionHandler uncaughtExceptionalHandler = (t, e) -> handleException(t.getName(), e);

{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)