Refine search
/** * Is this instruction a "beginning instruction". A beginning instruction is defined to be an instruction * that can be the first successfully executed instruction in the method. The first instruction is always a * beginning instruction. If the first instruction can throw an exception, and is covered by a try block, then * the first instruction of any exception handler for that try block is also a beginning instruction. And likewise, * if any of those instructions can throw an exception and are covered by try blocks, the first instruction of the * corresponding exception handler is a beginning instruction, etc. * * To determine this, we simply check if the first predecessor is the fake "StartOfMethod" instruction, which has * an instruction index of -1. * @return a boolean value indicating whether this instruction is a beginning instruction */ public boolean isBeginningInstruction() { //if this instruction has no predecessors, it is either the fake "StartOfMethod" instruction or it is an //unreachable instruction. if (predecessors.size() == 0) { return false; } if (predecessors.first().instructionIndex == -1) { return true; } return false; }
/** * Computes approximative types. The work list must be initialized with all constant type variables. */ public static void computeApprox(TreeSet<TypeVariableBV> workList) throws TypeException { while (workList.size() > 0) { TypeVariableBV var = workList.first(); workList.remove(var); var.fixApprox(workList); } }
/** * Computes approximative types. The work list must be initialized with all constant type variables. */ public static void computeApprox(TreeSet<TypeVariable> workList) throws TypeException { while (workList.size() > 0) { TypeVariable var = workList.first(); workList.remove(var); var.fixApprox(workList); } }
/** * Computes approximative types. The work list must be initialized with all constant type variables. */ public static void computeApprox(TreeSet<TypeVariable> workList) throws TypeException { while (workList.size() > 0) { TypeVariable var = workList.first(); workList.remove(var); var.fixApprox(workList); } }
@Override protected String getCompletedOffset() { String offset = null; if (pending.size() > 0) { //find the smallest offset in pending list offset = pending.keySet().iterator().next(); } if (toResend.size() > 0) { //find the smallest offset in toResend list String offset2 = toResend.first().getMessageId().getOffset(); if (offset == null || offset2.compareTo(offset) < 0) { offset = offset2; } } if (offset == null) { offset = lastOffset; } return offset; } }
public ReturnCode filterColumn(Cell cell) { byte [] qualifier = CellUtil.cloneQualifier(cell); TreeSet<byte []> lesserOrEqualPrefixes = (TreeSet<byte []>) sortedPrefixes.headSet(qualifier, true); if (lesserOrEqualPrefixes.size() != 0) { byte [] largestPrefixSmallerThanQualifier = lesserOrEqualPrefixes.last(); if (Bytes.startsWith(qualifier, largestPrefixSmallerThanQualifier)) { return ReturnCode.INCLUDE; } if (lesserOrEqualPrefixes.size() == sortedPrefixes.size()) { return ReturnCode.NEXT_ROW; } else { hint = sortedPrefixes.higher(largestPrefixSmallerThanQualifier); return ReturnCode.SEEK_NEXT_USING_HINT; } } else { hint = sortedPrefixes.first(); return ReturnCode.SEEK_NEXT_USING_HINT; } }
static TreeSet<UUID> add( TreeSet<UUID> a, UUID uuid, boolean reversed, int limit ) { if ( a == null ) { a = new TreeSet<UUID>( new UUIDComparator() ); } if ( uuid == null ) { return a; } // if we have less than the limit, just add it if ( a.size() < limit ) { a.add( uuid ); } else if ( reversed ) { // if reversed, we want to add more recent messages // and eject the oldest if ( UUIDComparator.staticCompare( uuid, a.first() ) > 0 ) { a.pollFirst(); a.add( uuid ); } } else { // add older messages and eject the newset if ( UUIDComparator.staticCompare( uuid, a.last() ) < 0 ) { a.pollLast(); a.add( uuid ); } } return a; }