Changeset ad3342a
- Timestamp:
- Feb 8, 2011 2:26:46 PM (10 years ago)
- Branches:
- master
- Children:
- 258c260
- Parents:
- 54fdfd8
- Location:
- core/java/src/net
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/client/naming/BlockfileNamingService.java
r54fdfd8 rad3342a 203 203 _log.error("Warning - initialized database with zero entries"); 204 204 return rv; 205 } catch (IOException e) { 206 throw e; 207 } catch (Error e) { 208 // blockfile noxiously converts IOEs to Errors with no message 205 } catch (RuntimeException e) { 209 206 throw new IOException(e.toString()); 210 207 } … … 248 245 _log.error("DB init took " + DataHelper.formatDuration(_context.clock().now() - start)); 249 246 return bf; 250 } catch (IOException e) { 251 throw e; 252 } catch (Error e) { 253 // blockfile noxiously converts IOEs to Errors with no message 247 } catch (RuntimeException e) { 254 248 throw new IOException(e.toString()); 255 249 } … … 273 267 // delete index?? 274 268 throw ioe; 275 } catch (Error e) { 276 // blockfile noxiously converts IOEs to Errors with no message 269 } catch (RuntimeException e) { 277 270 _log.error("DB Lookup error", e); 278 271 throw new IOException(e.toString()); … … 303 296 // delete index?? 304 297 throw ioe; 305 } catch (Error e) { 306 // blockfile noxiously converts IOEs to Errors with no message 298 } catch (RuntimeException e) { 307 299 _log.error("DB add error", e); 308 300 throw new IOException(e.toString()); … … 313 305 * Caller must synchronize 314 306 * @param source may be null 315 * @throws Error307 * @throws RuntimeException 316 308 */ 317 309 private void addEntry(SkipList sl, String key, Destination dest, String source) { … … 326 318 * Caller must synchronize 327 319 * @param props may be null 328 * @throws Error320 * @throws RuntimeException 329 321 */ 330 322 private static void addEntry(SkipList sl, String key, Destination dest, Properties props) { … … 375 367 _bf.close(); 376 368 } catch (IOException ioe) { 377 } catch ( Errore) {369 } catch (RuntimeException e) { 378 370 } 379 371 try { … … 489 481 public static void main(String[] args) { 490 482 BlockfileNamingService bns = new BlockfileNamingService(I2PAppContext.getGlobalContext()); 491 System.out.println("zzz.i2p: " + bns.lookup("zzz.i2p"));483 //System.out.println("zzz.i2p: " + bns.lookup("zzz.i2p")); 492 484 List<String> names = null; 493 485 try { -
core/java/src/net/metanotion/README-I2P.txt
r54fdfd8 rad3342a 26 26 - Commented out some System.out.println() 27 27 28 - Convert Errors without message or cause to RuntimeExceptions with a message and cause 29 30 28 31 TODO: 29 32 -
core/java/src/net/metanotion/io/block/index/BSkipLevels.java
r54fdfd8 rad3342a 92 92 bf.file.writeInt(((BSkipLevels) levels[i]).levelPage); 93 93 } 94 } catch (IOException ioe) { throw new Error(); }94 } catch (IOException ioe) { throw new RuntimeException("Error writing to database", ioe); } 95 95 } 96 96 … … 98 98 try { 99 99 bf.freePage(levelPage); 100 } catch (IOException ioe) { throw new Error(); }100 } catch (IOException ioe) { throw new RuntimeException("Error freeing database page", ioe); } 101 101 } 102 102 … … 108 108 BSkipLevels.init(bf, page, bss.page, levels); 109 109 return new BSkipLevels(bf, page, bsl); 110 } catch (IOException ioe) { throw new Error(); }110 } catch (IOException ioe) { throw new RuntimeException("Error creating database page", ioe); } 111 111 } 112 112 } -
core/java/src/net/metanotion/io/block/index/BSkipList.java
r54fdfd8 rad3342a 54 54 55 55 public BSkipList(int spanSize, BlockFile bf, int skipPage, Serializer key, Serializer val, boolean fileOnly) throws IOException { 56 if(spanSize < 1) { throw new Error("Span size too small"); }56 if(spanSize < 1) { throw new RuntimeException("Span size too small"); } 57 57 58 58 this.skipPage = skipPage; … … 89 89 bf.file.writeInt(spans); 90 90 91 } catch (IOException ioe) { throw new Error(); }91 } catch (IOException ioe) { throw new RuntimeException("Error writing to database", ioe); } 92 92 } 93 93 -
core/java/src/net/metanotion/io/block/index/BSkipSpan.java
r54fdfd8 rad3342a 66 66 init(bf, newPage, bf.spanSize); 67 67 return new BSkipSpan(bf, (BSkipList) sl, newPage, keySer, valSer); 68 } catch (IOException ioe) { throw new Error(); }68 } catch (IOException ioe) { throw new RuntimeException("Error creating database page", ioe); } 69 69 } 70 70 … … 80 80 } 81 81 bf.freePage(page); 82 } catch (IOException ioe) { throw new Error(); }82 } catch (IOException ioe) { throw new RuntimeException("Error freeing database page", ioe); } 83 83 } 84 84 … … 125 125 BlockFile.pageSeek(bf.file, this.page); 126 126 this.overflowPage = bf.file.readInt(); 127 } catch (IOException ioe) { throw new Error(); }127 } catch (IOException ioe) { throw new RuntimeException("Error writing to database", ioe); } 128 128 } 129 129 -
core/java/src/net/metanotion/io/block/index/IBSkipSpan.java
r54fdfd8 rad3342a 70 70 rv.vals = new Object[bf.spanSize]; 71 71 return rv; 72 } catch (IOException ioe) { throw new Error(ioe); }72 } catch (IOException ioe) { throw new RuntimeException("Error creating database page", ioe); } 73 73 } 74 74 … … 248 248 seekAndLoadData(); 249 249 } catch (IOException ioe) { 250 throw new Error(ioe);250 throw new RuntimeException("Error reading database", ioe); 251 251 } 252 252 SkipSpan rv = super.getSpan(key, search); … … 267 267 return getData(key); 268 268 } catch (IOException ioe) { 269 throw new Error(ioe);269 throw new RuntimeException("Error reading database", ioe); 270 270 } 271 271 } … … 279 279 seekAndLoadData(); 280 280 } catch (IOException ioe) { 281 throw new Error(ioe);281 throw new RuntimeException("Error reading database", ioe); 282 282 } 283 283 SkipSpan rv = super.put(key, val, sl); … … 294 294 seekAndLoadData(); 295 295 } catch (IOException ioe) { 296 throw new Error(ioe);296 throw new RuntimeException("Error reading database", ioe); 297 297 } 298 298 Object[] rv = super.remove(key, sl);
Note: See TracChangeset
for help on using the changeset viewer.