mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -226,15 +226,13 @@ class LinuxWatchService
|
|||
}
|
||||
|
||||
// no modifiers supported at this time
|
||||
if (modifiers.length > 0) {
|
||||
for (WatchEvent.Modifier modifier: modifiers) {
|
||||
if (modifier == null)
|
||||
return new NullPointerException();
|
||||
if (!ExtendedOptions.SENSITIVITY_HIGH.matches(modifier) &&
|
||||
!ExtendedOptions.SENSITIVITY_MEDIUM.matches(modifier) &&
|
||||
!ExtendedOptions.SENSITIVITY_LOW.matches(modifier)) {
|
||||
return new UnsupportedOperationException("Modifier not supported");
|
||||
}
|
||||
for (WatchEvent.Modifier modifier : modifiers) {
|
||||
if (modifier == null)
|
||||
return new NullPointerException();
|
||||
if (!ExtendedOptions.SENSITIVITY_HIGH.matches(modifier) &&
|
||||
!ExtendedOptions.SENSITIVITY_MEDIUM.matches(modifier) &&
|
||||
!ExtendedOptions.SENSITIVITY_LOW.matches(modifier)) {
|
||||
return new UnsupportedOperationException("Modifier not supported");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue