static final BranchHandle getBranchHandle(BranchInstruction i) { if(bh_list == null) return new BranchHandle(i); else { BranchHandle bh = bh_list; bh_list = (BranchHandle)bh.next; bh.setInstruction(i); return bh; } }
static BranchHandle getBranchHandle( final BranchInstruction i ) { if (bh_list == null) { return new BranchHandle(i); } final BranchHandle bh = bh_list; bh_list = (BranchHandle) bh.getNext(); bh.setInstruction(i); return bh; }
@Test(expected=ClassGenException.class) public void testsetInstructionNull() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(null); Assert.assertNotNull(bh); }
@Test(expected=ClassGenException.class) public void testsetInstructionnotBI() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(new NOP()); Assert.assertNotNull(bh); }
@Test public void testsetInstructionBI() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(new GOTO(null)); Assert.assertNotNull(bh); }