If the in-memory limit is reached an IOException is thrown, rather than attempting to spool to local disk.
7879808182838485868788
blockName = input.substring(0, splitIndex); blockData = Integer.parseInt(input.substring(splitIndex + 1)); } // Get the material belonging to the block and data Block block = Block.b(blockName); if (block != null) { return BukkitMaterialData.ofMinecraftBlock(block, blockData); } DefaultMaterial defaultMaterial = DefaultMaterial.getMaterial(blockName);
201202203204205206207208209
private synchronized void nextBlockOutputStream() throws IOException { long blockId = r.nextLong(); while (store.blockExists(blockId)) { blockId = r.nextLong(); } nextBlock = new Block(blockId, bytesWrittenToBlock); blocks.add(nextBlock); bytesWrittenToBlock = 0; }
110111112113114115116117118119120
int numBlocks = dataIn.readInt(); Block[] blocks = new Block[numBlocks]; for (int i = 0; i < numBlocks; i++) { long id = dataIn.readLong(); long length = dataIn.readLong(); blocks[i] = new Block(id, length); } in.close(); return new INode(fileType, blocks); default: throw new IllegalArgumentException("Cannot deserialize inode.");
429430431432433434435436437438439
@Test public void object_methods_can_be_invoked() { PropertyConduit conduit = source.create(Block.class, "toString()"); Block b = new Block() { @Override public String toString() { return "Do You Grok Ze Block?";
8283848586878889909192
{ Page page = newPage(PAGE_NAME); Component component = mockComponent(); ComponentModel model = mockComponentModel(); TypeCoercer coercer = mockTypeCoercer(); Block block = mockBlock(); Logger logger = mockLogger(); Instantiator ins = newInstantiator(component, model); train_getLogger(model, logger);
144145146147148149150151152153154155
{ Page page = newPage(PAGE_NAME); Component component = mockComponent(); ComponentModel model = mockComponentModel(); TypeCoercer coercer = mockTypeCoercer(); Block block1 = mockBlock(); Block block2 = mockBlock(); Logger logger = mockLogger(); train_getLogger(model, logger); Instantiator ins = newInstantiator(component, model);
226227228229230231232233234235236
} public Block getBlockForColumn() { Block override = overrides.getOverrideBlock(columnModel.getId() + "Header"); if (override != null) return override; return standardHeader; }
7576777879808182838485
* Invoked from subclasses to do the rendering. The subclass controls the naming convention for locating an * overriding Block parameter (it is the name of the property possibly suffixed with a value). */ protected Object renderPropertyValue(MarkupWriter writer, String overrideBlockId) { Block override = overrides.getOverrideBlock(overrideBlockId); if (override != null) return override; String datatype = model.getDataType();
692693694695696697698699700701702
261262263264265266267268269270271
{ public void render(MarkupWriter writer, RenderQueue queue, DynamicDelegate delegate) { try { Block block = delegate.getBlock(blockId); queue.push((RenderCommand) block); } catch (Exception ex) { throw new TapestryException(String.format(