mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8298380: Clean up redundant array length checks in JDK code base
Reviewed-by: dholmes, amenkov, serb, vtewari
This commit is contained in:
parent
33d955ad6e
commit
e3c6cf8eaf
8 changed files with 37 additions and 51 deletions
|
@ -119,20 +119,18 @@ class PollingWatchService
|
|||
|
||||
// Extended modifiers may be used to specify the sensitivity level
|
||||
int sensitivity = DEFAULT_POLLING_INTERVAL;
|
||||
if (modifiers.length > 0) {
|
||||
for (WatchEvent.Modifier modifier: modifiers) {
|
||||
if (modifier == null)
|
||||
throw new NullPointerException();
|
||||
for (WatchEvent.Modifier modifier : modifiers) {
|
||||
if (modifier == null)
|
||||
throw new NullPointerException();
|
||||
|
||||
if (ExtendedOptions.SENSITIVITY_HIGH.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_HIGH.parameter();
|
||||
} else if (ExtendedOptions.SENSITIVITY_MEDIUM.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_MEDIUM.parameter();
|
||||
} else if (ExtendedOptions.SENSITIVITY_LOW.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_LOW.parameter();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Modifier not supported");
|
||||
}
|
||||
if (ExtendedOptions.SENSITIVITY_HIGH.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_HIGH.parameter();
|
||||
} else if (ExtendedOptions.SENSITIVITY_MEDIUM.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_MEDIUM.parameter();
|
||||
} else if (ExtendedOptions.SENSITIVITY_LOW.matches(modifier)) {
|
||||
sensitivity = ExtendedOptions.SENSITIVITY_LOW.parameter();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Modifier not supported");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue