Skip to content

Commit

Permalink
Collapse catch blocks in JavaSoundAudioDeviceFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
bowbahdoe committed Oct 20, 2023
1 parent 9d099e2 commit 55c2757
Showing 1 changed file with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,26 @@ public synchronized AudioDevice createAudioDevice()
{
return createAudioDeviceImpl();
}
catch (Exception ex)
catch (Exception | LinkageError ex)
{
throw new JavaLayerException("unable to create JavaSound device: " + ex);
}
catch (LinkageError ex)
{
throw new JavaLayerException("unable to create JavaSound device: " + ex);
}
}
}

protected JavaSoundAudioDevice createAudioDeviceImpl()
throws JavaLayerException
{
ClassLoader loader = getClass().getClassLoader();
try
{
JavaSoundAudioDevice dev = (JavaSoundAudioDevice)instantiate(loader, DEVICE_CLASS_NAME);
return dev;
}
catch (Exception ex)
{
throw new JavaLayerException("Cannot create JavaSound device", ex);
return (JavaSoundAudioDevice)instantiate(loader, DEVICE_CLASS_NAME);
}
catch (LinkageError ex)
catch (Exception | LinkageError ex)
{
throw new JavaLayerException("Cannot create JavaSound device", ex);
}
}

}

public void testAudioDevice() throws JavaLayerException
{
Expand Down

0 comments on commit 55c2757

Please sign in to comment.