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

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

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

IllegalStateException.getLocalizedMessage介绍

暂无

代码示例

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

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

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

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

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

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

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

public static void storeProfile(final ProfileData profile, Context ctx, ProfileData parentProfile) {
  try {
    FlowManager.getDatabase(ProfilesDatabase.class).beginTransactionAsync(new ITransaction() {
      @Override
      public void execute(DatabaseWrapper databaseWrapper) {
        profile.save(databaseWrapper);
      }
    }).build().execute();
  } catch (IllegalStateException e) {
    if (e.getMessage().contains("connection pool has been closed")) {
      //reconnect logic
      try {
        FlowManager.init(new FlowConfig.Builder(ctx).build());
      } catch (Exception de) {
        Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
      }
    }
    Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
  } catch (Exception e) {
    Log.i(TAG, "Exception while saving profile data:" + e.getLocalizedMessage());
  }
}

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

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

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

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

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

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

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

public Object translateValue( Value value ) throws SQLException {
  if (value == null) return null;
  try {
    return this.getTransform().transform(value);
  } catch (ValueFormatException ve) {
    throw new SQLException(ve.getLocalizedMessage(), ve);
  } catch (IllegalStateException ie) {
    throw new SQLException(ie.getLocalizedMessage(), ie);
  } catch (RepositoryException e) {
    throw new SQLException(e.getLocalizedMessage(), e);
  }
}

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

public Object translateValue( Value value ) throws SQLException {
  if (value == null) return null;
  try {
    return this.getTransform().transform(value);
  } catch (ValueFormatException ve) {
    throw new SQLException(ve.getLocalizedMessage(), ve);
  } catch (IllegalStateException ie) {
    throw new SQLException(ie.getLocalizedMessage(), ie);
  } catch (RepositoryException e) {
    throw new SQLException(e.getLocalizedMessage(), e);
  }
}

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

private void chainFailure() {
  try {
    transactionChain.close();
    transactionChain = dataBroker.createTransactionChain(this);
    clearQueue();
  } catch (IllegalStateException e) {
    LOG.warn(e.getLocalizedMessage());
  }
}

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

/**
 * Set the format to configure. The default implementation accept instance of
 * {@link DecimalFormat}, {@link SimpleDateFormat} or {@link AngleFormat}. If
 * more format class are wanted, methods {@link #getPattern} and {@link #setPattern}
 * should be overridden.
 *
 * @param  format The format to congifure.
 * @throws IllegalArgumentException if the format is invalid.
 */
public void setFormat(final Format format) throws IllegalArgumentException {
  final Format old = this.format;
  this.format = format;
  try {
    update();
  } catch (IllegalStateException exception) {
    this.format = old;
    /*
     * The format is not one of recognized type.  Since this format was given in argument
     * (rather then the internal format field), Change the exception type for consistency
     * with the usual specification.
     */
    final IllegalArgumentException e;
    e = new IllegalArgumentException(exception.getLocalizedMessage());
    e.initCause(exception);
    throw e;
  }
  firePropertyChange("format", old, format);
}

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

@Override
public String getLocalizedMessage() {		
  if(!MockFramework.isEnabled()){
    return super.getLocalizedMessage();
  }        
  return getDelegate().getLocalizedMessage();
}

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

public Boolean readBoolean(NodeData parentNode, InternalQName propertyName) throws RepositoryException,
 NodeTypeReadException
{
 List<ValueData> values = loadPropertyValues(parentNode, propertyName);
 if (values != null)
 {
   if (values.size() == 1)
   {
    try
    {
      return ValueDataUtil.getBoolean(values.get(0));
    }
    catch (IllegalStateException e)
    {
      throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
    }
   }
 }
 return new Boolean(false);
}

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

} catch (IllegalStateException ie) {
  error = true;
  throw new SQLException(ie.getLocalizedMessage(), ie);
} catch (RepositoryException e) {
  error = true;

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

private static Set<MessageDestination> readMessageDestinations(File xmlFile, String xPathPrefix, File resourcesDir) {
  Set<MessageDestination> msgDestinations = new HashSet<MessageDestination>();
  if(xmlFile.exists()) {
    Map<String, AdminObjectResource> aoResourceMap = new HashMap<String, AdminObjectResource>();
    List<TreeParser.Path> pathList = new ArrayList<TreeParser.Path>();
    pathList.add(new TreeParser.Path(xPathPrefix + "resources/admin-object-resource", new AdminObjectReader(aoResourceMap)));
    try {
      TreeParser.readXml(xmlFile, pathList);
    } catch(IllegalStateException ex) {
      Logger.getLogger("glassfish-javaee").log(Level.INFO, ex.getLocalizedMessage(), ex);
    }
    for(AdminObjectResource adminObj: aoResourceMap.values()) {
      String type = adminObj.getResType();
      if (type.equals(QUEUE)) {
        msgDestinations.add(new SunMessageDestination(adminObj.getJndiName(), MessageDestination.Type.QUEUE, resourcesDir));
      } else {
        msgDestinations.add(new SunMessageDestination(adminObj.getJndiName(), MessageDestination.Type.TOPIC, resourcesDir));
      }
    }
  }
  return msgDestinations;
}

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

public Long readLong(NodeData parentNode, InternalQName propertyName) throws RepositoryException,
 NodeTypeReadException
{
 List<ValueData> values = loadPropertyValues(parentNode, propertyName);
 if (values != null)
 {
   if (values.size() == 1)
   {
    try
    {
      return ValueDataUtil.getLong(values.get(0));
    }
    catch (NumberFormatException e)
    {
      throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
    }
    catch (IllegalStateException e)
    {
      throw new NodeTypeReadException(e.getLocalizedMessage(), e.getCause());
    }
   }
 }
 return null;
}

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

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

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

private Object getCellValue(Cell cell) {
  if (cell == null) {
    return null;
  }
  try {
    if (cell.getCellTypeEnum() == CellType.ERROR) {
      LOGGER.error("Cell content is error. Sheet: {}, row: {}, column: {}",
          new Object[] { cell.getSheet().getSheetName(), cell.getRowIndex(), cell.getColumnIndex() });
      return null;
    }
    if (cell.getCellTypeEnum() == CellType.BLANK) {
      return null;
    }
    if (cell.getCellTypeEnum() == CellType.BOOLEAN) {
      return cell.getBooleanCellValue();
    }
    if (cell.getCellTypeEnum() == CellType.NUMERIC) {
      return cell.getNumericCellValue();
    }
    if (cell.getCellTypeEnum() == CellType.STRING) {
      return cell.getStringCellValue();
    }
  } catch (IllegalStateException e) {
    LOGGER.error(e.getLocalizedMessage());
    LOGGER.error("Read cell error. Sheet: {}, row: {}, column: {}",
        new Object[] { cell.getSheet().getSheetName(), cell.getRowIndex(), cell.getColumnIndex() });
    throw new ExcelException(e);
  }
  return null;
}

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

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

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

@Test
  public void testValidLocaleSettingsPassthrough() throws IOException {
    try {
      EmbeddedPostgres.Builder builder = null;
      if (SystemUtils.IS_OS_WINDOWS) {
        builder = EmbeddedPostgres.builder()
            .setLocaleConfig("locale", "en-us")
            .setLocaleConfig("lc-messages", "en-us");
      } else if (SystemUtils.IS_OS_MAC) {
        builder = EmbeddedPostgres.builder()
            .setLocaleConfig("locale", "en_US")
            .setLocaleConfig("lc-messages", "en_US");
      } else if (SystemUtils.IS_OS_LINUX){
        builder = EmbeddedPostgres.builder()
            .setLocaleConfig("locale", "en_US.utf8")
            .setLocaleConfig("lc-messages", "en_US.utf8");
      } else {
        fail("System not detected!");
      }
      builder.start();
    } catch (IllegalStateException e){
      e.printStackTrace();
      fail("Failed to set locale settings: " + e.getLocalizedMessage());
    }
  }
}

相关文章