Refine search
public HashSet<Statement> buildContinueSet() { continueSet.clear(); for (Statement st : stats) { continueSet.addAll(st.buildContinueSet()); if (st != first) { continueSet.remove(st.getBasichead()); } } for (StatEdge edge : getEdges(StatEdge.TYPE_CONTINUE, DIRECTION_FORWARD)) { continueSet.add(edge.getDestination().getBasichead()); } if (type == TYPE_DO) { continueSet.remove(first.getBasichead()); } return continueSet; }
private void onCheckAll() { boolean all = mCheckedCardPositions.size() < getCards().size(); if (all) { for (int i = 0; i < mCards.size(); i++) { mCheckedCardPositions.add(i); } } else { mCheckedCardPositions.clear(); } updateMultiselectMenu(); mActionBarTitle.setText(Integer.toString(mCheckedCardPositions.size())); mCardsAdapter.notifyDataSetChanged(); }
for (ResourceRoot resourceRoot : resourceRoots) { if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { jarsSet.add(resourceRoot.getRootName()); jarsSet.clear(); throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.invalidRelativeOrdering(), e); jarsSet.clear(); } else { jarsSet.clear(); warMetaData.setNoOrder(true);
/** * Web address consisting of webappURI and port of a web address */ public static class WebAddress { private String host; private int port; WebAddress(String host, String port) throws NumberFormatException { this.host = host; this.port = Integer.parseInt(port); } public String getHost() { return host; } public int getPort() { return port; } }
classNDexInfo.clear(); testInfo = info; } else if (isVmArt && ShareConstants.CLASS_N_PATTERN.matcher(info.realName).matches()) { classNDexInfo.add(info); } else { dexes.put(info.realName, getInfoMd5(info)); && (testInfo != null || !classNDexInfo.isEmpty())) { if (testInfo != null) { classNDexInfo.add(ShareTinkerInternals.changeTestDexToClassN(testInfo, classNDexInfo.size() + 1));
public Set<String> getSurroundingCaughtExceptions(int pc, int maxTryBlockSize) { HashSet<String> result = new HashSet<>(); if (code == null) { throw new IllegalStateException("Not visiting Code"); } int size = maxTryBlockSize; if (code.getExceptionTable() == null) { return result; } for (CodeException catchBlock : code.getExceptionTable()) { int startPC = catchBlock.getStartPC(); int endPC = catchBlock.getEndPC(); if (pc >= startPC && pc <= endPC) { int thisSize = endPC - startPC; if (size > thisSize) { result.clear(); size = thisSize; result.add("C" + catchBlock.getCatchType()); } else if (size == thisSize) { result.add("C" + catchBlock.getCatchType()); } } } return result; }
@Test public void testHashCode() { int max = 100; HashSet<Integer> codes = new HashSet<>(); for (int x = 1; x <= 100; x++) { codes.add(AspectRatio.of(x, 1).hashCode()); } assertThat(codes.size(), is(max)); codes.clear(); for (int y = 1; y <= 100; y++) { codes.add(AspectRatio.of(1, y).hashCode()); } assertThat(codes.size(), is(max)); }
@Test @SuppressWarnings("unchecked") public void testRankCachingTier() throws Exception { CompoundCachingTier.Provider provider = new CompoundCachingTier.Provider(); HashSet<ResourceType<?>> resourceTypes = new HashSet<>(EnumSet.of(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP)); assertThat(provider.rankCachingTier(resourceTypes, EMPTY_LIST), is(2)); resourceTypes.clear(); resourceTypes.add(new UnmatchedResourceType()); assertThat(provider.rankCachingTier(resourceTypes, EMPTY_LIST), is(0)); } }
@Override public void updateGlobalConfig(GlobalConfig oldConfig, GlobalConfig newConfig) { accountApiControl.clear(); if (newConfig.value().isEmpty()) { return; } String[] classNames = newConfig.value().split(","); for (String name : classNames) { try { name = name.trim(); Class clz = Class.forName(name); accountApiControl.add(clz); } catch (ClassNotFoundException e) { throw new CloudRuntimeException(e); } } } });
private int calculateRequiredChannels() { this.semiOpen.clear(); int depth = 0; for( final IGridNode nodes : this.requireChannels ) { if( !this.semiOpen.contains( nodes ) ) { final IGridBlock gb = nodes.getGridBlock(); final EnumSet<GridFlags> flags = gb.getFlags(); if( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !this.blockDense.isEmpty() ) { return 9; } depth++; if( flags.contains( GridFlags.MULTIBLOCK ) ) { final IGridMultiblock gmb = (IGridMultiblock) gb; final Iterator<IGridNode> i = gmb.getMultiblockNodes(); while( i.hasNext() ) { this.semiOpen.add( (IPathItem) i.next() ); } } } } return depth; }