java.lang.IllegalStateException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中java.lang.IllegalStateException.getLocalizedMessage()方法的一些代码示例,展示了IllegalStateException.getLocalizedMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IllegalStateException.getLocalizedMessage()方法的具体详情如下:
包路径:java.lang.IllegalStateException
类名称:IllegalStateException
方法名:getLocalizedMessage

IllegalStateException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: apache/kylin

  1. snapshotManager.buildSnapshot(mockTable, tableDesc, cubeConfig).getResourcePath();
  2. } catch (IllegalStateException ex) {
  3. Assert.assertTrue(ex.getLocalizedMessage().startsWith("Table snapshot should be no greater than 0 MB"));

代码示例来源:origin: geotools/geotools

  1. LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);

代码示例来源:origin: geotools/geotools

  1. LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);

代码示例来源:origin: ukanth/afwall

  1. public static void storeProfile(final ProfileData profile, Context ctx, ProfileData parentProfile) {
  2. try {
  3. FlowManager.getDatabase(ProfilesDatabase.class).beginTransactionAsync(new ITransaction() {
  4. @Override
  5. public void execute(DatabaseWrapper databaseWrapper) {
  6. profile.save(databaseWrapper);
  7. }
  8. }).build().execute();
  9. } catch (IllegalStateException e) {
  10. if (e.getMessage().contains("connection pool has been closed")) {
  11. //reconnect logic
  12. try {
  13. FlowManager.init(new FlowConfig.Builder(ctx).build());
  14. } catch (Exception de) {
  15. Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
  16. }
  17. }
  18. Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
  19. } catch (Exception e) {
  20. Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
  21. }
  22. }

代码示例来源:origin: geotools/geotools

  1. buffer.insert(stop, X364.BACKGROUND_DEFAULT).insert(start, ERROR_COLOR);
  2. warning = exception.getLocalizedMessage();
  3. value = Double.NaN;

代码示例来源:origin: geotools/geotools

  1. } catch (IllegalStateException e) {
  2. if (LOGGER.isLoggable(Level.WARNING)) {
  3. LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);

代码示例来源:origin: ukanth/afwall

  1. FlowManager.init(new FlowConfig.Builder(context).build());
  2. } catch (Exception de) {
  3. Log.i(TAG, "Exception while saving log data:" + e.getLocalizedMessage());
  4. Log.i(TAG, "Exception while saving log data:" + e.getLocalizedMessage());
  5. } catch (Exception e) {
  6. Log.i(TAG, "Exception while saving log data:" + e.getLocalizedMessage());

代码示例来源:origin: org.modeshape/modeshape-jdbc-local

  1. public Object translateValue( Value value ) throws SQLException {
  2. if (value == null) return null;
  3. try {
  4. return this.getTransform().transform(value);
  5. } catch (ValueFormatException ve) {
  6. throw new SQLException(ve.getLocalizedMessage(), ve);
  7. } catch (IllegalStateException ie) {
  8. throw new SQLException(ie.getLocalizedMessage(), ie);
  9. } catch (RepositoryException e) {
  10. throw new SQLException(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: ModeShape/modeshape

  1. public Object translateValue( Value value ) throws SQLException {
  2. if (value == null) return null;
  3. try {
  4. return this.getTransform().transform(value);
  5. } catch (ValueFormatException ve) {
  6. throw new SQLException(ve.getLocalizedMessage(), ve);
  7. } catch (IllegalStateException ie) {
  8. throw new SQLException(ie.getLocalizedMessage(), ie);
  9. } catch (RepositoryException e) {
  10. throw new SQLException(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: org.opendaylight.l2switch.hosttracker/hosttracker-impl

  1. private void chainFailure() {
  2. try {
  3. transactionChain.close();
  4. transactionChain = dataBroker.createTransactionChain(this);
  5. clearQueue();
  6. } catch (IllegalStateException e) {
  7. LOG.warn(e.getLocalizedMessage());
  8. }
  9. }

代码示例来源:origin: org.geotools/gt2-widgets-swing

  1. /**
  2. * Set the format to configure. The default implementation accept instance of
  3. * {@link DecimalFormat}, {@link SimpleDateFormat} or {@link AngleFormat}. If
  4. * more format class are wanted, methods {@link #getPattern} and {@link #setPattern}
  5. * should be overridden.
  6. *
  7. * @param format The format to congifure.
  8. * @throws IllegalArgumentException if the format is invalid.
  9. */
  10. public void setFormat(final Format format) throws IllegalArgumentException {
  11. final Format old = this.format;
  12. this.format = format;
  13. try {
  14. update();
  15. } catch (IllegalStateException exception) {
  16. this.format = old;
  17. /*
  18. * The format is not one of recognized type. Since this format was given in argument
  19. * (rather then the internal format field), Change the exception type for consistency
  20. * with the usual specification.
  21. */
  22. final IllegalArgumentException e;
  23. e = new IllegalArgumentException(exception.getLocalizedMessage());
  24. e.initCause(exception);
  25. throw e;
  26. }
  27. firePropertyChange("format", old, format);
  28. }

代码示例来源:origin: EvoSuite/evosuite

  1. @Override
  2. public String getLocalizedMessage() {
  3. if(!MockFramework.isEnabled()){
  4. return super.getLocalizedMessage();
  5. }
  6. return getDelegate().getLocalizedMessage();
  7. }

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

  1. public Boolean readBoolean(NodeData parentNode, InternalQName propertyName) throws RepositoryException,
  2. NodeTypeReadException
  3. {
  4. List<ValueData> values = loadPropertyValues(parentNode, propertyName);
  5. if (values != null)
  6. {
  7. if (values.size() == 1)
  8. {
  9. try
  10. {
  11. return ValueDataUtil.getBoolean(values.get(0));
  12. }
  13. catch (IllegalStateException e)
  14. {
  15. throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
  16. }
  17. }
  18. }
  19. return new Boolean(false);
  20. }

代码示例来源:origin: ModeShape/modeshape

  1. } catch (IllegalStateException ie) {
  2. error = true;
  3. throw new SQLException(ie.getLocalizedMessage(), ie);
  4. } catch (RepositoryException e) {
  5. error = true;

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-glassfish-javaee

  1. private static Set<MessageDestination> readMessageDestinations(File xmlFile, String xPathPrefix, File resourcesDir) {
  2. Set<MessageDestination> msgDestinations = new HashSet<MessageDestination>();
  3. if(xmlFile.exists()) {
  4. Map<String, AdminObjectResource> aoResourceMap = new HashMap<String, AdminObjectResource>();
  5. List<TreeParser.Path> pathList = new ArrayList<TreeParser.Path>();
  6. pathList.add(new TreeParser.Path(xPathPrefix + "resources/admin-object-resource", new AdminObjectReader(aoResourceMap)));
  7. try {
  8. TreeParser.readXml(xmlFile, pathList);
  9. } catch(IllegalStateException ex) {
  10. Logger.getLogger("glassfish-javaee").log(Level.INFO, ex.getLocalizedMessage(), ex);
  11. }
  12. for(AdminObjectResource adminObj: aoResourceMap.values()) {
  13. String type = adminObj.getResType();
  14. if (type.equals(QUEUE)) {
  15. msgDestinations.add(new SunMessageDestination(adminObj.getJndiName(), MessageDestination.Type.QUEUE, resourcesDir));
  16. } else {
  17. msgDestinations.add(new SunMessageDestination(adminObj.getJndiName(), MessageDestination.Type.TOPIC, resourcesDir));
  18. }
  19. }
  20. }
  21. return msgDestinations;
  22. }

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

  1. public Long readLong(NodeData parentNode, InternalQName propertyName) throws RepositoryException,
  2. NodeTypeReadException
  3. {
  4. List<ValueData> values = loadPropertyValues(parentNode, propertyName);
  5. if (values != null)
  6. {
  7. if (values.size() == 1)
  8. {
  9. try
  10. {
  11. return ValueDataUtil.getLong(values.get(0));
  12. }
  13. catch (NumberFormatException e)
  14. {
  15. throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
  16. }
  17. catch (IllegalStateException e)
  18. {
  19. throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
  20. }
  21. }
  22. }
  23. return null;
  24. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-glassfish-javaee

  1. TreeParser.readXml(sunResourcesXml, pathList);
  2. } catch (IllegalStateException ex) {
  3. Logger.getLogger("glassfish-javaee").log(Level.INFO, ex.getLocalizedMessage(), ex); // NOI18N

代码示例来源:origin: dayatang/dddlib

  1. private Object getCellValue(Cell cell) {
  2. if (cell == null) {
  3. return null;
  4. }
  5. try {
  6. if (cell.getCellTypeEnum() == CellType.ERROR) {
  7. LOGGER.error("Cell content is error. Sheet: {}, row: {}, column: {}",
  8. new Object[] { cell.getSheet().getSheetName(), cell.getRowIndex(), cell.getColumnIndex() });
  9. return null;
  10. }
  11. if (cell.getCellTypeEnum() == CellType.BLANK) {
  12. return null;
  13. }
  14. if (cell.getCellTypeEnum() == CellType.BOOLEAN) {
  15. return cell.getBooleanCellValue();
  16. }
  17. if (cell.getCellTypeEnum() == CellType.NUMERIC) {
  18. return cell.getNumericCellValue();
  19. }
  20. if (cell.getCellTypeEnum() == CellType.STRING) {
  21. return cell.getStringCellValue();
  22. }
  23. } catch (IllegalStateException e) {
  24. LOGGER.error(e.getLocalizedMessage());
  25. LOGGER.error("Read cell error. Sheet: {}, row: {}, column: {}",
  26. new Object[] { cell.getSheet().getSheetName(), cell.getRowIndex(), cell.getColumnIndex() });
  27. throw new ExcelException(e);
  28. }
  29. return null;
  30. }

代码示例来源:origin: com.auth0/auth0-spring-mvc

  1. throw new Auth0Exception("NoSuchAlgorithmException thrown while decoding JWT token " + e.getLocalizedMessage());
  2. } catch (IllegalStateException e) {
  3. throw new Auth0Exception("IllegalStateException thrown while decoding JWT token " + e.getLocalizedMessage());
  4. } catch (SignatureException e) {
  5. throw new Auth0Exception("SignatureException thrown while decoding JWT token " + e.getLocalizedMessage());

代码示例来源:origin: opentable/otj-pg-embedded

  1. @Test
  2. public void testValidLocaleSettingsPassthrough() throws IOException {
  3. try {
  4. EmbeddedPostgres.Builder builder = null;
  5. if (SystemUtils.IS_OS_WINDOWS) {
  6. builder = EmbeddedPostgres.builder()
  7. .setLocaleConfig("locale", "en-us")
  8. .setLocaleConfig("lc-messages", "en-us");
  9. } else if (SystemUtils.IS_OS_MAC) {
  10. builder = EmbeddedPostgres.builder()
  11. .setLocaleConfig("locale", "en_US")
  12. .setLocaleConfig("lc-messages", "en_US");
  13. } else if (SystemUtils.IS_OS_LINUX){
  14. builder = EmbeddedPostgres.builder()
  15. .setLocaleConfig("locale", "en_US.utf8")
  16. .setLocaleConfig("lc-messages", "en_US.utf8");
  17. } else {
  18. fail("System not detected!");
  19. }
  20. builder.start();
  21. } catch (IllegalStateException e){
  22. e.printStackTrace();
  23. fail("Failed to set locale settings: " + e.getLocalizedMessage());
  24. }
  25. }
  26. }

相关文章