private Integer parseIntWithSubstitute( String toParse ) { toParse = environmentSubstitute( toParse ); if ( !StringUtils.isEmpty( toParse ) ) { try { return Integer.parseInt( toParse ); } catch ( NumberFormatException e ) { log.logError( e.getLocalizedMessage() ); } } return null; }
magic[(i / 2) - 1] = (byte) Integer.parseInt(g, 16); } catch (NumberFormatException ex) { throw new IOException(ex.getLocalizedMessage());
throw new IOException( String.format("Unsupported type conversion from String to a number for name \"%s\" - %s.", fieldName, ex.getLocalizedMessage()), ex); } catch (IndexOutOfBoundsException ex) { throw new IOException(
private void okSelected(TableItem[] items, String key, Map<String, Double> values) { for (TableItem item : items) { if(item.getText(0).length() == 0 && item.getText(1).length() > 0) throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + item.getText(1)); if((item.getText(0).length() > 0)) try{ values.put(item.getText(1), Double.valueOf(item.getText(0))); }catch(NumberFormatException e){ throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + e.getLocalizedMessage()); } } setResult(new ZSetInfo(key, values, dataContent.getTTL())); shell.dispose(); }
private void add() { Map<String, Double> mapValues = new HashMap<String, Double>(); TableItem item = table.getItem(0); if(item.getText(0).length() == 0 && item.getText(1).length() > 0) throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + item.getText(1)); String member; try{ member = item.getText(1); mapValues.put(member, Double.valueOf(item.getText(0))); }catch(NumberFormatException e1){ throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + e1.getLocalizedMessage()); } service.addValues(id, db, key, mapValues); refresh(); gotoMember(member); status = Status.Normal; statusChanged(); } private void gotoMember(String member){
response.setFileInfos(fileInfos); } catch (NumberFormatException e) { response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage()); return response; } catch (ArithmeticException e) {
response.setFileInfos(fileInfos); } catch (NumberFormatException e) { response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage()); return response; } catch (ArithmeticException e) {
response.setFileInfos(fileInfos); } catch (NumberFormatException e) { response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage()); return response; } catch (ArithmeticException e) {
response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage()); } catch (ArithmeticException e) { response.setFatalError(
response.setFileInfos(fileInfos); } catch (NumberFormatException e) { response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage()); return response; } catch (ArithmeticException e) {
/** * Getting a specified geotiff geo key as a int. It is somehow tolerant in the sense that in * case such a key does not exist it retrieves 0. * * @param key we want to get the value for. * @param metadata containing the key we are looking for. * @return */ private static int getGeoKeyAsInt(final int key, final GeoTiffIIOMetadataDecoder metadata) { try { return Integer.parseInt(metadata.getGeoKey(key)); } catch (NumberFormatException ne) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, ne.getLocalizedMessage(), ne); return GeoTiffConstants.UNDEFINED; } }
Double getResolution() { // get the the match and convert it to double String resolutionStr = getMatches().size() > 0 ? getMatches().get(0) : null; if (resolutionStr != null) { try { return Double.parseDouble(resolutionStr); } catch (NumberFormatException e) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } } return null; }
/** * Getting a specified geotiff geo key as a double. It is somehow tolerant in the sense that in * case such a key does not exist it returns <code>Double.NaN</code>. * * @param key we want to get the value for. * @param metadata containing the key we are looking for. * @return the value for the provided key. * @throws IOException */ private static double getGeoKeyAsDouble( final int key, final GeoTiffIIOMetadataDecoder metadata) { try { final String geoKey = metadata.getGeoKey(key); if (geoKey != null) return Double.parseDouble(geoKey); else return Double.NaN; } catch (NumberFormatException ne) { if (LOGGER.isLoggable(Level.WARNING)) LOGGER.log(Level.WARNING, ne.getLocalizedMessage(), ne); return Double.NaN; } catch (Exception e) { LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e); return Double.NaN; } }
+ DEFAULT_EPSG_CODE + " due to : " + nfe.getLocalizedMessage());
} catch (NumberFormatException nfe) { final IOException ioe = new GeoTiffException(metadata, nfe.getLocalizedMessage(), nfe); throw ioe;
private static int computeIntValue(String parmContent) throws IllegalArgumentException { int val = 0; try { val = Integer.parseInt(parmContent); } catch (NumberFormatException e) { LOG.error("computeIntValue: parm value passed in the event isn't a valid number." ,e); throw new IllegalArgumentException(e.getLocalizedMessage()); } return val; }
public void apply(String field, CaptureSearchResult result) throws CDXFormatException { if (field.equals("-")) { return; } try { result.setCompressedLength(Long.parseLong(field)); } catch(NumberFormatException e) { throw new CDXFormatException(e.getLocalizedMessage()); } }
@SuppressWarnings("Duplicates") public Integer getFahrtwegFlughafen() { try { return Is24CsvFormat.parseInteger( this.get(FIELD_FAHRTWEG_FLUGHAFEN)); } catch (NumberFormatException ex) { LOGGER.warn("Can't read 'Fahrtweg zum Flughafen'!"); LOGGER.warn("> " + ex.getLocalizedMessage(), ex); return null; } }
@SuppressWarnings("Duplicates") public BigDecimal getKaufpreis() { try { return Is24CsvFormat.parseDecimal( this.get(FIELD_KAUFPREIS)); } catch (NumberFormatException ex) { LOGGER.warn("Can't read 'Kaufpreis'!"); LOGGER.warn("> " + ex.getLocalizedMessage(), ex); return null; } }
@Override public BigInteger getBigInteger() throws MALException { try { return new BigInteger(removeFirst()); } catch (NumberFormatException ex) { throw new MALException(ex.getLocalizedMessage(), ex); } }