mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8189272: CLDR and JRE LocaleProviderAdapters silently swallow exceptions
Reviewed-by: mchung
This commit is contained in:
parent
ab49e12b7f
commit
483595f375
3 changed files with 7 additions and 61 deletions
|
@ -27,6 +27,7 @@ package sun.util.cldr;
|
|||
|
||||
import java.security.AccessController;
|
||||
import java.security.AccessControlException;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.text.spi.BreakIteratorProvider;
|
||||
import java.text.spi.CollatorProvider;
|
||||
|
@ -83,11 +84,8 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter {
|
|||
return null;
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
// Catch any exception, and continue as if only CLDR's base locales exist.
|
||||
} catch (ServiceConfigurationError sce) {
|
||||
Throwable cause = sce.getCause();
|
||||
if (!(cause instanceof AccessControlException)) throw sce;
|
||||
} catch (PrivilegedActionException pae) {
|
||||
throw new InternalError(pae.getCause());
|
||||
}
|
||||
|
||||
nonBaseMetaInfo = nbmi;
|
||||
|
|
|
@ -28,6 +28,7 @@ package sun.util.locale.provider;
|
|||
import java.security.AccessController;
|
||||
import java.security.AccessControlException;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.text.spi.BreakIteratorProvider;
|
||||
import java.text.spi.CollatorProvider;
|
||||
|
@ -478,11 +479,8 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
|
|||
if (nonBaseTags != null) {
|
||||
supportedLocaleString += " " + nonBaseTags;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// catch any exception, and ignore them as if non-EN locales do not exist.
|
||||
} catch (ServiceConfigurationError sce) {
|
||||
Throwable cause = sce.getCause();
|
||||
if (!(cause instanceof AccessControlException)) throw sce;
|
||||
} catch (PrivilegedActionException pae) {
|
||||
throw new InternalError(pae.getCause());
|
||||
}
|
||||
|
||||
return supportedLocaleString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue