mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1218: Use diamond operator and multi-catch where possible.
This commit is contained in:
@@ -147,22 +147,12 @@ public class CryptoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rethrow all decryption failures identically
|
// Rethrow all decryption failures identically
|
||||||
catch (InvalidAlgorithmParameterException e) {
|
catch (InvalidAlgorithmParameterException
|
||||||
throw new GuacamoleServerException(e);
|
| NoSuchAlgorithmException
|
||||||
}
|
| NoSuchPaddingException
|
||||||
catch (NoSuchAlgorithmException e) {
|
| InvalidKeyException
|
||||||
throw new GuacamoleServerException(e);
|
| IllegalBlockSizeException
|
||||||
}
|
| BadPaddingException e) {
|
||||||
catch (NoSuchPaddingException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
|
||||||
}
|
|
||||||
catch (InvalidKeyException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
|
||||||
}
|
|
||||||
catch (IllegalBlockSizeException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
|
||||||
}
|
|
||||||
catch (BadPaddingException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
throw new GuacamoleServerException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,13 +190,7 @@ public class CryptoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rethrow all signature failures identically
|
// Rethrow all signature failures identically
|
||||||
catch (NoSuchAlgorithmException e) {
|
catch (NoSuchAlgorithmException | InvalidKeyException | IllegalStateException e) {
|
||||||
throw new GuacamoleServerException(e);
|
|
||||||
}
|
|
||||||
catch (InvalidKeyException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
|
||||||
}
|
|
||||||
catch (IllegalStateException e) {
|
|
||||||
throw new GuacamoleServerException(e);
|
throw new GuacamoleServerException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ public class RequestValidationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build matchers for each trusted network
|
// Build matchers for each trusted network
|
||||||
Collection<IpAddressMatcher> matchers = new ArrayList<IpAddressMatcher>(trustedNetworks.size());
|
Collection<IpAddressMatcher> matchers = new ArrayList<>(trustedNetworks.size());
|
||||||
for (String network : trustedNetworks)
|
for (String network : trustedNetworks)
|
||||||
matchers.add(new IpAddressMatcher(network));
|
matchers.add(new IpAddressMatcher(network));
|
||||||
|
|
||||||
|
@@ -342,7 +342,7 @@ public class UserData {
|
|||||||
* connection.
|
* connection.
|
||||||
*/
|
*/
|
||||||
public void setConnections(Map<String, Connection> connections) {
|
public void setConnections(Map<String, Connection> connections) {
|
||||||
this.connections = new ConcurrentHashMap<String, Connection>(connections);
|
this.connections = new ConcurrentHashMap<>(connections);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -46,8 +46,7 @@ public class UserDataDenylist {
|
|||||||
* string produced by encoding the binary signature using DatatypeConverter.
|
* string produced by encoding the binary signature using DatatypeConverter.
|
||||||
* A byte[] cannot be used directly.
|
* A byte[] cannot be used directly.
|
||||||
*/
|
*/
|
||||||
private final ConcurrentMap<String, UserData> denylist =
|
private final ConcurrentMap<String, UserData> denylist = new ConcurrentHashMap<>();
|
||||||
new ConcurrentHashMap<String, UserData>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all expired UserData objects from the denylist. This will
|
* Removes all expired UserData objects from the denylist. This will
|
||||||
|
Reference in New Issue
Block a user