8284071: Collapse identical catch branches in jdk.console

Reviewed-by: cjplummer
This commit is contained in:
Andrey Turbanov 2022-04-04 20:05:22 +00:00
parent 61d06c2d28
commit 732f7ae0aa
5 changed files with 12 additions and 40 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2022, 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
@ -483,9 +483,7 @@ public class JConsole extends JFrame
public void run() {
try {
addProxyClient(ProxyClient.getProxyClient(lvm), tile);
} catch (final SecurityException ex) {
failed(ex, null, null, null);
} catch (final IOException ex) {
} catch (final SecurityException | IOException ex) {
failed(ex, null, null, null);
}
}
@ -502,11 +500,7 @@ public class JConsole extends JFrame
try {
addProxyClient(ProxyClient.getProxyClient(url, userName, password),
tile);
} catch (final MalformedURLException ex) {
failed(ex, url, userName, password);
} catch (final SecurityException ex) {
failed(ex, url, userName, password);
} catch (final IOException ex) {
} catch (final IOException | SecurityException ex) {
failed(ex, url, userName, password);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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
@ -239,15 +239,7 @@ public class MaximizableInternalFrame extends JInternalFrame {
UIManager.put(key,
new MDIButtonIcon(UIManager.getIcon(key)));
}
} catch (ClassNotFoundException ex) {
if (JConsole.debug) {
ex.printStackTrace();
}
} catch (NoSuchFieldException ex) {
if (JConsole.debug) {
ex.printStackTrace();
}
} catch (IllegalAccessException ex) {
} catch (ClassNotFoundException | IllegalAccessException | NoSuchFieldException ex) {
if (JConsole.debug) {
ex.printStackTrace();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2022, 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
@ -608,11 +608,7 @@ public class ProxyClient implements JConsoleContext {
try {
MBeanInfo info = server.getMBeanInfo(o);
result.put(o, info);
} catch (IntrospectionException e) {
// TODO: should log the error
} catch (InstanceNotFoundException e) {
// TODO: should log the error
} catch (ReflectionException e) {
} catch (IntrospectionException | ReflectionException | InstanceNotFoundException e) {
// TODO: should log the error
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2022, 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
@ -302,13 +302,7 @@ class SummaryTab extends Tab {
4);
append(endTable);
}
} catch (IOException e) {
if (JConsole.isDebug()) {
e.printStackTrace();
}
proxyClient.markAsDead();
return null;
} catch (UndeclaredThrowableException e) {
} catch (IOException | UndeclaredThrowableException e) {
if (JConsole.isDebug()) {
e.printStackTrace();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2022, 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
@ -216,9 +216,7 @@ class ThreadTab extends Tab implements ActionListener, DocumentListener, ListSel
}
timeStamp = System.currentTimeMillis();
return true;
} catch (IOException e) {
return false;
} catch (UndeclaredThrowableException e) {
} catch (IOException | UndeclaredThrowableException e) {
return false;
}
}
@ -426,9 +424,7 @@ class ThreadTab extends Tab implements ActionListener, DocumentListener, ListSel
}
});
sleep(30 * 1000);
} catch (InterruptedException ex) {
// Ignore
} catch (InvocationTargetException ex) {
} catch (InterruptedException | InvocationTargetException ex) {
// Ignore
}
SwingUtilities.invokeLater(new Runnable() {