code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { @Override public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { String[] factoryPids = getServicePid(reference); if (factoryPids == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "removedService(): Invalid service.pid type: " + reference); } return; } synchronized (caFactory.getConfigurationStore()) { for (String pid : factoryPids) { remove(reference, pid); } } context.ungetService(reference); } }
public class class_name { @Override public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { String[] factoryPids = getServicePid(reference); if (factoryPids == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "removedService(): Invalid service.pid type: " + reference); // depends on control dependency: [if], data = [none] } return; // depends on control dependency: [if], data = [none] } synchronized (caFactory.getConfigurationStore()) { for (String pid : factoryPids) { remove(reference, pid); // depends on control dependency: [for], data = [pid] } } context.ungetService(reference); } }
public class class_name { public static String decode(String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (UnsupportedEncodingException e) { //should never happen throw new RuntimeException(e); } } }
public class class_name { public static String decode(String str) { try { return URLDecoder.decode(str, "UTF-8"); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { //should never happen throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> wrap(SingleSource<T> source) { ObjectHelper.requireNonNull(source, "source is null"); if (source instanceof Single) { return RxJavaPlugins.onAssembly((Single<T>)source); } return RxJavaPlugins.onAssembly(new SingleFromUnsafeSource<T>(source)); } }
public class class_name { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Single<T> wrap(SingleSource<T> source) { ObjectHelper.requireNonNull(source, "source is null"); if (source instanceof Single) { return RxJavaPlugins.onAssembly((Single<T>)source); // depends on control dependency: [if], data = [none] } return RxJavaPlugins.onAssembly(new SingleFromUnsafeSource<T>(source)); } }
public class class_name { private void readTasks(Integer id) { Integer currentID = id; Table table = getTable("WBSTAB"); while (currentID.intValue() != 0) { MapRow row = table.find(currentID); Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID")); readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID")); Integer childID = row.getInteger("CHILD_ID"); if (childID.intValue() != 0) { readTasks(childID); } currentID = row.getInteger("NEXT_ID"); } } }
public class class_name { private void readTasks(Integer id) { Integer currentID = id; Table table = getTable("WBSTAB"); while (currentID.intValue() != 0) { MapRow row = table.find(currentID); Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID")); readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID")); // depends on control dependency: [while], data = [none] Integer childID = row.getInteger("CHILD_ID"); if (childID.intValue() != 0) { readTasks(childID); // depends on control dependency: [if], data = [none] } currentID = row.getInteger("NEXT_ID"); // depends on control dependency: [while], data = [none] } } }
public class class_name { public static <T> void putAt(List<T> self, int idx, T value) { int size = self.size(); idx = normaliseIndex(idx, size); if (idx < size) { self.set(idx, value); } else { while (size < idx) { self.add(size++, null); } self.add(idx, value); } } }
public class class_name { public static <T> void putAt(List<T> self, int idx, T value) { int size = self.size(); idx = normaliseIndex(idx, size); if (idx < size) { self.set(idx, value); // depends on control dependency: [if], data = [(idx] } else { while (size < idx) { self.add(size++, null); // depends on control dependency: [while], data = [(size] } self.add(idx, value); // depends on control dependency: [if], data = [(idx] } } }
public class class_name { @Pure public IntegerProperty x2Property() { if (this.p2.x == null) { this.p2.x = new SimpleIntegerProperty(this, MathFXAttributeNames.X2); } return this.p2.x; } }
public class class_name { @Pure public IntegerProperty x2Property() { if (this.p2.x == null) { this.p2.x = new SimpleIntegerProperty(this, MathFXAttributeNames.X2); // depends on control dependency: [if], data = [none] } return this.p2.x; } }
public class class_name { private void normalizeBlocks(Node n) { if (NodeUtil.isControlStructure(n) && !n.isLabel() && !n.isSwitch()) { for (Node c = n.getFirstChild(); c != null; c = c.getNext()) { if (NodeUtil.isControlStructureCodeBlock(n, c) && !c.isBlock()) { Node newBlock = IR.block().srcref(n); n.replaceChild(c, newBlock); newBlock.setIsAddedBlock(true); if (!c.isEmpty()) { newBlock.addChildrenToFront(c); } c = newBlock; reportChange(); } } } } }
public class class_name { private void normalizeBlocks(Node n) { if (NodeUtil.isControlStructure(n) && !n.isLabel() && !n.isSwitch()) { for (Node c = n.getFirstChild(); c != null; c = c.getNext()) { if (NodeUtil.isControlStructureCodeBlock(n, c) && !c.isBlock()) { Node newBlock = IR.block().srcref(n); n.replaceChild(c, newBlock); // depends on control dependency: [if], data = [none] newBlock.setIsAddedBlock(true); // depends on control dependency: [if], data = [none] if (!c.isEmpty()) { newBlock.addChildrenToFront(c); // depends on control dependency: [if], data = [none] } c = newBlock; // depends on control dependency: [if], data = [none] reportChange(); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { @Override public InstallPolicy getInstallPolicy() { if (_asset.getWlpInformation() == null) { return null; } return _asset.getWlpInformation().getInstallPolicy(); } }
public class class_name { @Override public InstallPolicy getInstallPolicy() { if (_asset.getWlpInformation() == null) { return null; // depends on control dependency: [if], data = [none] } return _asset.getWlpInformation().getInstallPolicy(); } }
public class class_name { protected boolean removeRecursive(final K key, final int nodeid) { if (nodeid == Node.NULL_ID) { return false; // NOT FOUND } Node<K, V> nodeDelete = getNode(nodeid); if (log.isDebugEnabled()) { log.debug("trying removeRecursive nodeDelete=" + nodeDelete + " key=" + key); } int slot = nodeDelete.findSlotByKey(key); if (nodeDelete.isLeaf()) { if (slot < 0) { if (log.isDebugEnabled()) { log.debug("NOT FOUND nodeDelete=" + nodeDelete + " key=" + key); } return false; // NOT FOUND } nodeDelete.remove(slot); putNode(nodeDelete); return true; } slot = ((slot < 0) ? (-slot) - 1 : slot + 1); final InternalNode<K, V> nodeDeleteInternal = (InternalNode<K, V>) nodeDelete; if (removeRecursive(key, nodeDeleteInternal.childs[slot])) { nodeDeleteInternal.checkUnderflow(slot); return true; } return false; } }
public class class_name { protected boolean removeRecursive(final K key, final int nodeid) { if (nodeid == Node.NULL_ID) { return false; // NOT FOUND // depends on control dependency: [if], data = [none] } Node<K, V> nodeDelete = getNode(nodeid); if (log.isDebugEnabled()) { log.debug("trying removeRecursive nodeDelete=" + nodeDelete + " key=" + key); // depends on control dependency: [if], data = [none] } int slot = nodeDelete.findSlotByKey(key); if (nodeDelete.isLeaf()) { if (slot < 0) { if (log.isDebugEnabled()) { log.debug("NOT FOUND nodeDelete=" + nodeDelete + " key=" + key); // depends on control dependency: [if], data = [none] } return false; // NOT FOUND // depends on control dependency: [if], data = [none] } nodeDelete.remove(slot); // depends on control dependency: [if], data = [none] putNode(nodeDelete); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } slot = ((slot < 0) ? (-slot) - 1 : slot + 1); final InternalNode<K, V> nodeDeleteInternal = (InternalNode<K, V>) nodeDelete; if (removeRecursive(key, nodeDeleteInternal.childs[slot])) { nodeDeleteInternal.checkUnderflow(slot); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public void cleanDatabase() { lockingMechanism.writeLock().lock(); try { for (ODocument edge : graph.browseEdges()) { edge.delete(); } for (ODocument node : graph.browseVertices()) { node.delete(); } } finally { lockingMechanism.writeLock().unlock(); } } }
public class class_name { public void cleanDatabase() { lockingMechanism.writeLock().lock(); try { for (ODocument edge : graph.browseEdges()) { edge.delete(); // depends on control dependency: [for], data = [edge] } for (ODocument node : graph.browseVertices()) { node.delete(); // depends on control dependency: [for], data = [node] } } finally { lockingMechanism.writeLock().unlock(); } } }
public class class_name { private Map<ConfigurationKey, Object> getObsoleteSystemProperties() { Map<ConfigurationKey, Object> found = new EnumMap<ConfigurationKey, Object>(ConfigurationKey.class); String concurrentDeployment = getSystemProperty("org.jboss.weld.bootstrap.properties.concurrentDeployment"); if (concurrentDeployment != null) { processKeyValue(found, ConfigurationKey.CONCURRENT_DEPLOYMENT, concurrentDeployment); found.put(ConfigurationKey.CONCURRENT_DEPLOYMENT, ConfigurationKey.CONCURRENT_DEPLOYMENT.convertValue(concurrentDeployment)); } String preloaderThreadPoolSize = getSystemProperty("org.jboss.weld.bootstrap.properties.preloaderThreadPoolSize"); if (preloaderThreadPoolSize != null) { found.put(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE, ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.convertValue(preloaderThreadPoolSize)); } return found; } }
public class class_name { private Map<ConfigurationKey, Object> getObsoleteSystemProperties() { Map<ConfigurationKey, Object> found = new EnumMap<ConfigurationKey, Object>(ConfigurationKey.class); String concurrentDeployment = getSystemProperty("org.jboss.weld.bootstrap.properties.concurrentDeployment"); if (concurrentDeployment != null) { processKeyValue(found, ConfigurationKey.CONCURRENT_DEPLOYMENT, concurrentDeployment); // depends on control dependency: [if], data = [none] found.put(ConfigurationKey.CONCURRENT_DEPLOYMENT, ConfigurationKey.CONCURRENT_DEPLOYMENT.convertValue(concurrentDeployment)); // depends on control dependency: [if], data = [(concurrentDeployment] } String preloaderThreadPoolSize = getSystemProperty("org.jboss.weld.bootstrap.properties.preloaderThreadPoolSize"); if (preloaderThreadPoolSize != null) { found.put(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE, ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.convertValue(preloaderThreadPoolSize)); // depends on control dependency: [if], data = [(preloaderThreadPoolSize] } return found; } }
public class class_name { public List<NodeDataIndexing> next() throws RepositoryException { if (!hasNext()) { // avoid unnecessary request to database return new ArrayList<NodeDataIndexing>(); } JDBCStorageConnection conn = (JDBCStorageConnection)connFactory.openConnection(); final boolean isOffsetSupported = connFactory.isOffsetSupported(); try { if (!isOffsetSupported) { // The offset is not supported so we need to synchronize the access lock.lock(); } int currentOffset; String currentLastNodeId; int currentPage; synchronized (this) { currentOffset = offset.getAndAdd(pageSize); currentLastNodeId = lastNodeId.get(); currentPage = page.incrementAndGet(); } if (!hasNext()) { // avoid unnecessary request to database return new ArrayList<NodeDataIndexing>(); } long time = 0; if (PropertyManager.isDevelopping()) { time = System.currentTimeMillis(); } List<NodeDataIndexing> result = conn.getNodesAndProperties(currentLastNodeId, currentOffset, pageSize); if (PropertyManager.isDevelopping()) { LOG.info("Page = " + currentPage + " Offset = " + currentOffset + " LastNodeId = '" + currentLastNodeId + "', query time = " + (System.currentTimeMillis() - time) + " ms, from '" + (result.isEmpty() ? "unknown" : result.get(0).getIdentifier()) + "' to '" + (result.isEmpty() ? "unknown" : result.get(result.size() - 1).getIdentifier()) + "'"); } hasNext.compareAndSet(true, result.size() == pageSize); if (hasNext() && connFactory.isIDNeededForPaging()) { synchronized (this) { lastNodeId.set(result.get(result.size() - 1).getIdentifier()); offset.set((page.get() - currentPage) * pageSize); } } return result; } finally { if (!isOffsetSupported) { // The offset is not supported so we need to synchronize the access lock.unlock(); } conn.close(); } } }
public class class_name { public List<NodeDataIndexing> next() throws RepositoryException { if (!hasNext()) { // avoid unnecessary request to database return new ArrayList<NodeDataIndexing>(); } JDBCStorageConnection conn = (JDBCStorageConnection)connFactory.openConnection(); final boolean isOffsetSupported = connFactory.isOffsetSupported(); try { if (!isOffsetSupported) { // The offset is not supported so we need to synchronize the access lock.lock(); // depends on control dependency: [if], data = [none] } int currentOffset; String currentLastNodeId; int currentPage; synchronized (this) { currentOffset = offset.getAndAdd(pageSize); currentLastNodeId = lastNodeId.get(); currentPage = page.incrementAndGet(); } if (!hasNext()) { // avoid unnecessary request to database return new ArrayList<NodeDataIndexing>(); // depends on control dependency: [if], data = [none] } long time = 0; if (PropertyManager.isDevelopping()) { time = System.currentTimeMillis(); // depends on control dependency: [if], data = [none] } List<NodeDataIndexing> result = conn.getNodesAndProperties(currentLastNodeId, currentOffset, pageSize); if (PropertyManager.isDevelopping()) { LOG.info("Page = " + currentPage + " Offset = " + currentOffset + " LastNodeId = '" + currentLastNodeId + "', query time = " + (System.currentTimeMillis() - time) + " ms, from '" + (result.isEmpty() ? "unknown" : result.get(0).getIdentifier()) + "' to '" + (result.isEmpty() ? "unknown" : result.get(result.size() - 1).getIdentifier()) + "'"); // depends on control dependency: [if], data = [none] } hasNext.compareAndSet(true, result.size() == pageSize); if (hasNext() && connFactory.isIDNeededForPaging()) { synchronized (this) // depends on control dependency: [if], data = [none] { lastNodeId.set(result.get(result.size() - 1).getIdentifier()); offset.set((page.get() - currentPage) * pageSize); } } return result; } finally { if (!isOffsetSupported) { // The offset is not supported so we need to synchronize the access lock.unlock(); // depends on control dependency: [if], data = [none] } conn.close(); } } }
public class class_name { public void marshall(StepScalingPolicyConfiguration stepScalingPolicyConfiguration, ProtocolMarshaller protocolMarshaller) { if (stepScalingPolicyConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stepScalingPolicyConfiguration.getAdjustmentType(), ADJUSTMENTTYPE_BINDING); protocolMarshaller.marshall(stepScalingPolicyConfiguration.getStepAdjustments(), STEPADJUSTMENTS_BINDING); protocolMarshaller.marshall(stepScalingPolicyConfiguration.getMinAdjustmentMagnitude(), MINADJUSTMENTMAGNITUDE_BINDING); protocolMarshaller.marshall(stepScalingPolicyConfiguration.getCooldown(), COOLDOWN_BINDING); protocolMarshaller.marshall(stepScalingPolicyConfiguration.getMetricAggregationType(), METRICAGGREGATIONTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(StepScalingPolicyConfiguration stepScalingPolicyConfiguration, ProtocolMarshaller protocolMarshaller) { if (stepScalingPolicyConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stepScalingPolicyConfiguration.getAdjustmentType(), ADJUSTMENTTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(stepScalingPolicyConfiguration.getStepAdjustments(), STEPADJUSTMENTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(stepScalingPolicyConfiguration.getMinAdjustmentMagnitude(), MINADJUSTMENTMAGNITUDE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(stepScalingPolicyConfiguration.getCooldown(), COOLDOWN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(stepScalingPolicyConfiguration.getMetricAggregationType(), METRICAGGREGATIONTYPE_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static final Bytes of(byte[] data, int offset, int length) { Objects.requireNonNull(data); if (length == 0) { return EMPTY; } byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return new Bytes(copy); } }
public class class_name { public static final Bytes of(byte[] data, int offset, int length) { Objects.requireNonNull(data); if (length == 0) { return EMPTY; // depends on control dependency: [if], data = [none] } byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return new Bytes(copy); } }
public class class_name { private static AbstractPlanNode getIndexAccessPlanForTable( StmtTableScan tableScan, AccessPath path) { // now assume this will be an index scan and get the relevant index Index index = path.index; IndexScanPlanNode scanNode = new IndexScanPlanNode(tableScan, index); AbstractPlanNode resultNode = scanNode; // set sortDirection here because it might be used for IN list scanNode.setSortDirection(path.sortDirection); // Build the list of search-keys for the index in question // They are the rhs expressions of normalized indexExpr comparisons // except for geo indexes. For geo indexes, the search key is directly // the one element of indexExprs. for (AbstractExpression expr : path.indexExprs) { if (path.lookupType == IndexLookupType.GEO_CONTAINS) { scanNode.addSearchKeyExpression(expr); scanNode.addCompareNotDistinctFlag(false); continue; } AbstractExpression exprRightChild = expr.getRight(); assert(exprRightChild != null); if (expr.getExpressionType() == ExpressionType.COMPARE_IN) { // Replace this method's result with an injected NLIJ. resultNode = injectIndexedJoinWithMaterializedScan(exprRightChild, scanNode); // Extract a TVE from the LHS MaterializedScan for use by the IndexScan in its new role. MaterializedScanPlanNode matscan = (MaterializedScanPlanNode)resultNode.getChild(0); AbstractExpression elemExpr = matscan.getOutputExpression(); assert(elemExpr != null); // Replace the IN LIST condition in the end expression referencing all the list elements // with a more efficient equality filter referencing the TVE for each element in turn. replaceInListFilterWithEqualityFilter(path.endExprs, exprRightChild, elemExpr); // Set up the similar VectorValue --> TVE replacement of the search key expression. exprRightChild = elemExpr; } if (exprRightChild instanceof AbstractSubqueryExpression) { // The AbstractSubqueryExpression must be wrapped up into a // ScalarValueExpression which extracts the actual row/column from // the subquery // ENG-8175: this part of code seems not working for float/varchar type index ?! // DEAD CODE with the guards on index: ENG-8203 assert(false); } scanNode.addSearchKeyExpression(exprRightChild); // If the index expression is an "IS NOT DISTINCT FROM" comparison, let the NULL values go through. (ENG-11096) scanNode.addCompareNotDistinctFlag(expr.getExpressionType() == ExpressionType.COMPARE_NOTDISTINCT); } // create the IndexScanNode with all its metadata scanNode.setLookupType(path.lookupType); scanNode.setBindings(path.bindings); scanNode.setEndExpression(ExpressionUtil.combinePredicates(path.endExprs)); if (! path.index.getPredicatejson().isEmpty()) { try { scanNode.setPartialIndexPredicate( AbstractExpression.fromJSONString(path.index.getPredicatejson(), tableScan)); } catch (JSONException e) { throw new PlanningErrorException(e.getMessage(), 0); } } scanNode.setPredicate(path.otherExprs); // Propagate the sorting information // into the scan node from the access path. // The initial expression is needed to control a (short?) forward scan to adjust the start of a reverse // iteration after it had to initially settle for starting at "greater than a prefix key". scanNode.setInitialExpression(ExpressionUtil.combinePredicates(path.initialExpr)); scanNode.setSkipNullPredicate(); scanNode.setEliminatedPostFilters(path.eliminatedPostExprs); final IndexUseForOrderBy indexUse = scanNode.indexUse(); indexUse.setWindowFunctionUsesIndex(path.m_windowFunctionUsesIndex); indexUse.setSortOrderFromIndexScan(path.sortDirection); indexUse.setWindowFunctionIsCompatibleWithOrderBy(path.m_stmtOrderByIsCompatible); indexUse.setFinalExpressionOrderFromIndexScan(path.m_finalExpressionOrder); return resultNode; } }
public class class_name { private static AbstractPlanNode getIndexAccessPlanForTable( StmtTableScan tableScan, AccessPath path) { // now assume this will be an index scan and get the relevant index Index index = path.index; IndexScanPlanNode scanNode = new IndexScanPlanNode(tableScan, index); AbstractPlanNode resultNode = scanNode; // set sortDirection here because it might be used for IN list scanNode.setSortDirection(path.sortDirection); // Build the list of search-keys for the index in question // They are the rhs expressions of normalized indexExpr comparisons // except for geo indexes. For geo indexes, the search key is directly // the one element of indexExprs. for (AbstractExpression expr : path.indexExprs) { if (path.lookupType == IndexLookupType.GEO_CONTAINS) { scanNode.addSearchKeyExpression(expr); // depends on control dependency: [if], data = [none] scanNode.addCompareNotDistinctFlag(false); // depends on control dependency: [if], data = [none] continue; } AbstractExpression exprRightChild = expr.getRight(); assert(exprRightChild != null); // depends on control dependency: [for], data = [expr] if (expr.getExpressionType() == ExpressionType.COMPARE_IN) { // Replace this method's result with an injected NLIJ. resultNode = injectIndexedJoinWithMaterializedScan(exprRightChild, scanNode); // depends on control dependency: [if], data = [none] // Extract a TVE from the LHS MaterializedScan for use by the IndexScan in its new role. MaterializedScanPlanNode matscan = (MaterializedScanPlanNode)resultNode.getChild(0); AbstractExpression elemExpr = matscan.getOutputExpression(); assert(elemExpr != null); // depends on control dependency: [if], data = [none] // Replace the IN LIST condition in the end expression referencing all the list elements // with a more efficient equality filter referencing the TVE for each element in turn. replaceInListFilterWithEqualityFilter(path.endExprs, exprRightChild, elemExpr); // depends on control dependency: [if], data = [none] // Set up the similar VectorValue --> TVE replacement of the search key expression. exprRightChild = elemExpr; // depends on control dependency: [if], data = [none] } if (exprRightChild instanceof AbstractSubqueryExpression) { // The AbstractSubqueryExpression must be wrapped up into a // ScalarValueExpression which extracts the actual row/column from // the subquery // ENG-8175: this part of code seems not working for float/varchar type index ?! // DEAD CODE with the guards on index: ENG-8203 assert(false); // depends on control dependency: [if], data = [none] } scanNode.addSearchKeyExpression(exprRightChild); // depends on control dependency: [for], data = [expr] // If the index expression is an "IS NOT DISTINCT FROM" comparison, let the NULL values go through. (ENG-11096) scanNode.addCompareNotDistinctFlag(expr.getExpressionType() == ExpressionType.COMPARE_NOTDISTINCT); // depends on control dependency: [for], data = [expr] } // create the IndexScanNode with all its metadata scanNode.setLookupType(path.lookupType); scanNode.setBindings(path.bindings); scanNode.setEndExpression(ExpressionUtil.combinePredicates(path.endExprs)); if (! path.index.getPredicatejson().isEmpty()) { try { scanNode.setPartialIndexPredicate( AbstractExpression.fromJSONString(path.index.getPredicatejson(), tableScan)); // depends on control dependency: [try], data = [none] } catch (JSONException e) { throw new PlanningErrorException(e.getMessage(), 0); } // depends on control dependency: [catch], data = [none] } scanNode.setPredicate(path.otherExprs); // Propagate the sorting information // into the scan node from the access path. // The initial expression is needed to control a (short?) forward scan to adjust the start of a reverse // iteration after it had to initially settle for starting at "greater than a prefix key". scanNode.setInitialExpression(ExpressionUtil.combinePredicates(path.initialExpr)); scanNode.setSkipNullPredicate(); scanNode.setEliminatedPostFilters(path.eliminatedPostExprs); final IndexUseForOrderBy indexUse = scanNode.indexUse(); indexUse.setWindowFunctionUsesIndex(path.m_windowFunctionUsesIndex); indexUse.setSortOrderFromIndexScan(path.sortDirection); indexUse.setWindowFunctionIsCompatibleWithOrderBy(path.m_stmtOrderByIsCompatible); indexUse.setFinalExpressionOrderFromIndexScan(path.m_finalExpressionOrder); return resultNode; } }
public class class_name { public static final void checkTxAttrs(TransactionAttribute[] txAttrs, String[] methodNames, String[] methodSignatures,//PQ63130 String[] checkedNames, String[] checkedSignatures,//PQ63130 TransactionAttribute prescribedAttr) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "checkTxAttrs"); for (int i = 0; i < methodNames.length; ++i) { for (int j = 0; j < checkedNames.length; ++j) { //PQ63130 added check of method signature if (((methodNames[i].equals(checkedNames[j])) && (methodSignatures[i].equals(checkedSignatures[j]))) | checkedNames[j].equals("*")) { txAttrs[i] = prescribedAttr; break; } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "checkTxAttrs"); } }
public class class_name { public static final void checkTxAttrs(TransactionAttribute[] txAttrs, String[] methodNames, String[] methodSignatures,//PQ63130 String[] checkedNames, String[] checkedSignatures,//PQ63130 TransactionAttribute prescribedAttr) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "checkTxAttrs"); for (int i = 0; i < methodNames.length; ++i) { for (int j = 0; j < checkedNames.length; ++j) { //PQ63130 added check of method signature if (((methodNames[i].equals(checkedNames[j])) && (methodSignatures[i].equals(checkedSignatures[j]))) | checkedNames[j].equals("*")) { txAttrs[i] = prescribedAttr; // depends on control dependency: [if], data = [none] break; } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "checkTxAttrs"); } }
public class class_name { private static DataNormalization restoreNormalizerFromFileDeprecated(File file) { try (ZipFile zipFile = new ZipFile(file)) { ZipEntry norm = zipFile.getEntry(NORMALIZER_BIN); // checking for file existence if (norm == null) return null; InputStream stream = zipFile.getInputStream(norm); ObjectInputStream ois = new ObjectInputStream(stream); try { DataNormalization normalizer = (DataNormalization) ois.readObject(); return normalizer; } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } catch (Exception e) { throw new RuntimeException(e); } } }
public class class_name { private static DataNormalization restoreNormalizerFromFileDeprecated(File file) { try (ZipFile zipFile = new ZipFile(file)) { ZipEntry norm = zipFile.getEntry(NORMALIZER_BIN); // checking for file existence if (norm == null) return null; InputStream stream = zipFile.getInputStream(norm); ObjectInputStream ois = new ObjectInputStream(stream); try { DataNormalization normalizer = (DataNormalization) ois.readObject(); return normalizer; // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } catch (Exception e) { throw new RuntimeException(e); } } }
public class class_name { private ArrayList makeShapes(Iterator featList) { Shape shape; ArrayList shapeList = new ArrayList(); ProjectionImpl dataProject = getDataProjection(); if (Debug.isSet("GisFeature/MapDraw")) { System.out.println("GisFeature/MapDraw: makeShapes with "+displayProject); } /* if (Debug.isSet("bug.drawShapes")) { int count =0; // make each GisPart a seperate shape for debugging feats:while (featList.hasNext()) { AbstractGisFeature feature = (AbstractGisFeature) featList.next(); java.util.Iterator pi = feature.getGisParts(); while (pi.hasNext()) { GisPart gp = (GisPart) pi.next(); int np = gp.getNumPoints(); GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, np); double[] xx = gp.getX(); double[] yy = gp.getY(); path.moveTo((float) xx[0], (float) yy[0]); if (count == 63) System.out.println("moveTo x ="+xx[0]+" y= "+yy[0]); for(int i = 1; i < np; i++) { path.lineTo((float) xx[i], (float) yy[i]); if (count == 63) System.out.println("lineTo x ="+xx[i]+" y= "+yy[i]); } shapeList.add(path); if (count == 63) break feats; count++; } } System.out.println("bug.drawShapes: #shapes =" +shapeList.size()); return shapeList; } */ while (featList.hasNext()) { AbstractGisFeature feature = (AbstractGisFeature) featList.next(); if (dataProject.isLatLon()) // always got to run it through if its lat/lon shape = feature.getProjectedShape(displayProject); else if (dataProject == displayProject) shape = feature.getShape(); else shape = feature.getProjectedShape(dataProject, displayProject); shapeList.add(shape); } return shapeList; } }
public class class_name { private ArrayList makeShapes(Iterator featList) { Shape shape; ArrayList shapeList = new ArrayList(); ProjectionImpl dataProject = getDataProjection(); if (Debug.isSet("GisFeature/MapDraw")) { System.out.println("GisFeature/MapDraw: makeShapes with "+displayProject); // depends on control dependency: [if], data = [none] } /* if (Debug.isSet("bug.drawShapes")) { int count =0; // make each GisPart a seperate shape for debugging feats:while (featList.hasNext()) { AbstractGisFeature feature = (AbstractGisFeature) featList.next(); java.util.Iterator pi = feature.getGisParts(); while (pi.hasNext()) { GisPart gp = (GisPart) pi.next(); int np = gp.getNumPoints(); GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, np); double[] xx = gp.getX(); double[] yy = gp.getY(); path.moveTo((float) xx[0], (float) yy[0]); if (count == 63) System.out.println("moveTo x ="+xx[0]+" y= "+yy[0]); for(int i = 1; i < np; i++) { path.lineTo((float) xx[i], (float) yy[i]); if (count == 63) System.out.println("lineTo x ="+xx[i]+" y= "+yy[i]); } shapeList.add(path); if (count == 63) break feats; count++; } } System.out.println("bug.drawShapes: #shapes =" +shapeList.size()); return shapeList; } */ while (featList.hasNext()) { AbstractGisFeature feature = (AbstractGisFeature) featList.next(); if (dataProject.isLatLon()) // always got to run it through if its lat/lon shape = feature.getProjectedShape(displayProject); else if (dataProject == displayProject) shape = feature.getShape(); else shape = feature.getProjectedShape(dataProject, displayProject); shapeList.add(shape); // depends on control dependency: [while], data = [none] } return shapeList; } }
public class class_name { public void bindRoot(HibernatePersistentEntity entity, InFlightMetadataCollector mappings, String sessionFactoryBeanName) { if (mappings.getEntityBinding(entity.getName()) != null) { LOG.info("[GrailsDomainBinder] Class [" + entity.getName() + "] is already mapped, skipping.. "); return; } RootClass root = new RootClass(this.metadataBuildingContext); root.setAbstract(entity.isAbstract()); final MappingContext mappingContext = entity.getMappingContext(); final java.util.Collection<PersistentEntity> children = mappingContext.getDirectChildEntities(entity); if (children.isEmpty()) { root.setPolymorphic(false); } bindClass(entity, root, mappings); Mapping m = getMapping(entity); bindRootPersistentClassCommonValues(entity, root, mappings, sessionFactoryBeanName); if (!children.isEmpty()) { boolean tablePerSubclass = m != null && !m.getTablePerHierarchy(); if (!tablePerSubclass) { // if the root class has children create a discriminator property bindDiscriminatorProperty(root.getTable(), root, mappings); } // bind the sub classes bindSubClasses(entity, root, mappings, sessionFactoryBeanName); } addMultiTenantFilterIfNecessary(entity, root, mappings, sessionFactoryBeanName); mappings.addEntityBinding(root); } }
public class class_name { public void bindRoot(HibernatePersistentEntity entity, InFlightMetadataCollector mappings, String sessionFactoryBeanName) { if (mappings.getEntityBinding(entity.getName()) != null) { LOG.info("[GrailsDomainBinder] Class [" + entity.getName() + "] is already mapped, skipping.. "); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } RootClass root = new RootClass(this.metadataBuildingContext); root.setAbstract(entity.isAbstract()); final MappingContext mappingContext = entity.getMappingContext(); final java.util.Collection<PersistentEntity> children = mappingContext.getDirectChildEntities(entity); if (children.isEmpty()) { root.setPolymorphic(false); // depends on control dependency: [if], data = [none] } bindClass(entity, root, mappings); Mapping m = getMapping(entity); bindRootPersistentClassCommonValues(entity, root, mappings, sessionFactoryBeanName); if (!children.isEmpty()) { boolean tablePerSubclass = m != null && !m.getTablePerHierarchy(); if (!tablePerSubclass) { // if the root class has children create a discriminator property bindDiscriminatorProperty(root.getTable(), root, mappings); // depends on control dependency: [if], data = [none] } // bind the sub classes bindSubClasses(entity, root, mappings, sessionFactoryBeanName); // depends on control dependency: [if], data = [none] } addMultiTenantFilterIfNecessary(entity, root, mappings, sessionFactoryBeanName); mappings.addEntityBinding(root); } }
public class class_name { void setNewNodes() { int index = tTable.getIndexCount(); nPrimaryNode = new NodeAVLMemoryPointer(this); NodeAVL n = nPrimaryNode; for (int i = 1; i < index; i++) { n.nNext = new NodeAVLMemoryPointer(this); n = n.nNext; } } }
public class class_name { void setNewNodes() { int index = tTable.getIndexCount(); nPrimaryNode = new NodeAVLMemoryPointer(this); NodeAVL n = nPrimaryNode; for (int i = 1; i < index; i++) { n.nNext = new NodeAVLMemoryPointer(this); // depends on control dependency: [for], data = [none] n = n.nNext; // depends on control dependency: [for], data = [none] } } }
public class class_name { public void registerMetrics() { if (metricsAreRegistered) { return; } getMetricRegistry().register("jvm.attribute", new JvmAttributeGaugeSet()); getMetricRegistry().register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory .getPlatformMBeanServer())); getMetricRegistry().register("jvm.classloader", new ClassLoadingGaugeSet()); getMetricRegistry().register("jvm.filedescriptor", new FileDescriptorRatioGauge()); getMetricRegistry().register("jvm.gc", new GarbageCollectorMetricSet()); getMetricRegistry().register("jvm.memory", new MemoryUsageGaugeSet()); getMetricRegistry().register("jvm.threads", new ThreadStatesGaugeSet()); JmxReporter.forRegistry(metricRegistry).build().start(); metricsAreRegistered = true; } }
public class class_name { public void registerMetrics() { if (metricsAreRegistered) { return; // depends on control dependency: [if], data = [none] } getMetricRegistry().register("jvm.attribute", new JvmAttributeGaugeSet()); getMetricRegistry().register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory .getPlatformMBeanServer())); getMetricRegistry().register("jvm.classloader", new ClassLoadingGaugeSet()); getMetricRegistry().register("jvm.filedescriptor", new FileDescriptorRatioGauge()); getMetricRegistry().register("jvm.gc", new GarbageCollectorMetricSet()); getMetricRegistry().register("jvm.memory", new MemoryUsageGaugeSet()); getMetricRegistry().register("jvm.threads", new ThreadStatesGaugeSet()); JmxReporter.forRegistry(metricRegistry).build().start(); metricsAreRegistered = true; } }
public class class_name { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); // first check primary type for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; } } // now check mixins if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; } } } } return false; } }
public class class_name { public boolean isDerivedFrom( String[] testTypeNames, String primaryTypeName, String[] mixinNames ) throws RepositoryException { CheckArg.isNotEmpty(testTypeNames, "testTypeNames"); CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"); NameFactory nameFactory = context().getValueFactories().getNameFactory(); Name[] typeNames = nameFactory.create(testTypeNames); // first check primary type for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(primaryTypeName)) { return true; // depends on control dependency: [if], data = [none] } } // now check mixins if (mixinNames != null) { for (String mixin : mixinNames) { for (Name typeName : typeNames) { JcrNodeType nodeType = getNodeType(typeName); if ((nodeType != null) && nodeType.isNodeType(mixin)) { return true; // depends on control dependency: [if], data = [none] } } } } return false; } }
public class class_name { public void marshall(TableVersion tableVersion, ProtocolMarshaller protocolMarshaller) { if (tableVersion == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tableVersion.getTable(), TABLE_BINDING); protocolMarshaller.marshall(tableVersion.getVersionId(), VERSIONID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(TableVersion tableVersion, ProtocolMarshaller protocolMarshaller) { if (tableVersion == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tableVersion.getTable(), TABLE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(tableVersion.getVersionId(), VERSIONID_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected void addOnDone() { for (Addon addon : addons) { try { addon.done(this); } catch (Exception e) { logger.error(Messages.get("info.addon.error", addon.getClass().getName()), e); } } } }
public class class_name { protected void addOnDone() { for (Addon addon : addons) { try { addon.done(this); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.error(Messages.get("info.addon.error", addon.getClass().getName()), e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) { List<List<T>> ngrams = new ArrayList<List<T>>(); int listSize = items.size(); for (int i = 0; i < listSize; ++i) { for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) { if (i + ngramSize <= listSize) { List<T> ngram = new ArrayList<T>(); for (int j = i; j < i + ngramSize; ++j) { ngram.add(items.get(j)); } ngrams.add(ngram); } } } return ngrams; } }
public class class_name { public static <T> List<List<T>> getNGrams(List<T> items, int minSize, int maxSize) { List<List<T>> ngrams = new ArrayList<List<T>>(); int listSize = items.size(); for (int i = 0; i < listSize; ++i) { for (int ngramSize = minSize; ngramSize <= maxSize; ++ngramSize) { if (i + ngramSize <= listSize) { List<T> ngram = new ArrayList<T>(); for (int j = i; j < i + ngramSize; ++j) { ngram.add(items.get(j)); // depends on control dependency: [for], data = [j] } ngrams.add(ngram); // depends on control dependency: [if], data = [none] } } } return ngrams; } }
public class class_name { public void addEnvelope(Envelope2D envSrc, boolean bReverse) { boolean bWasEmpty = m_pointCount == 0; startPath(envSrc.xmin, envSrc.ymin); if (bReverse) { lineTo(envSrc.xmax, envSrc.ymin); lineTo(envSrc.xmax, envSrc.ymax); lineTo(envSrc.xmin, envSrc.ymax); } else { lineTo(envSrc.xmin, envSrc.ymax); lineTo(envSrc.xmax, envSrc.ymax); lineTo(envSrc.xmax, envSrc.ymin); } closePathWithLine(); m_bPathStarted = false; if (bWasEmpty && !bReverse) { _setDirtyFlag(DirtyFlags.DirtyIsEnvelope, false);// now we no(sic?) // the polypath // is envelope } } }
public class class_name { public void addEnvelope(Envelope2D envSrc, boolean bReverse) { boolean bWasEmpty = m_pointCount == 0; startPath(envSrc.xmin, envSrc.ymin); if (bReverse) { lineTo(envSrc.xmax, envSrc.ymin); // depends on control dependency: [if], data = [none] lineTo(envSrc.xmax, envSrc.ymax); // depends on control dependency: [if], data = [none] lineTo(envSrc.xmin, envSrc.ymax); // depends on control dependency: [if], data = [none] } else { lineTo(envSrc.xmin, envSrc.ymax); // depends on control dependency: [if], data = [none] lineTo(envSrc.xmax, envSrc.ymax); // depends on control dependency: [if], data = [none] lineTo(envSrc.xmax, envSrc.ymin); // depends on control dependency: [if], data = [none] } closePathWithLine(); m_bPathStarted = false; if (bWasEmpty && !bReverse) { _setDirtyFlag(DirtyFlags.DirtyIsEnvelope, false);// now we no(sic?) // depends on control dependency: [if], data = [none] // the polypath // is envelope } } }
public class class_name { public boolean showTheDocument(App app, String strURL, int iOptions) { BaseAppletReference applet = this; boolean bIsHelpScreen = false; if ((strURL.indexOf("JHelp") != -1) || (strURL.indexOf(Params.HELP + "=")) != -1) bIsHelpScreen = true; if (bIsHelpScreen) if ((iOptions & ThinMenuConstants.HELP_WINDOW_CHANGE) != 0) { // Special case - if help is currently displayed, display this new help screen if (this.getHelpView().getHelpPane().isVisible()) iOptions = ThinMenuConstants.HELP_PANE_OPTION | ThinMenuConstants.HELP_WINDOW_CHANGE; else return false; // Don't refresh help if no current pane } boolean bSuccess = false; URL url = null; String strProtocol = null; if (strURL != null) if (strURL.indexOf(':') != -1) { strURL.substring(strURL.indexOf(':') + 1); strProtocol = strURL.substring(0, strURL.indexOf(':')); } if ((Params.FAX.equalsIgnoreCase(strProtocol)) || (Params.PHONE.equalsIgnoreCase(strProtocol))) url = null; else { strProtocol = null; url = app.getResourceURL(strURL, applet); } if ((url != null) || (strProtocol != null)) { if ((applet != null) && (((BaseApplet)applet).getHelpView() != null) && (((iOptions & 1) == 0) && ((iOptions & Constants.USE_NEW_WINDOW) == 0) && ((iOptions & ThinMenuConstants.HELP_WEB_OPTION) == 0) // Use same window && ((iOptions & ThinMenuConstants.EXTERNAL_LINK) == 0) // Change browser window || (bIsHelpScreen))) { if (((applet != null) && (((BaseApplet)applet).getHelpView().getHelpPane().isVisible())) || ((ThinMenuConstants.HELP_PANE_OPTION & iOptions) == ThinMenuConstants.HELP_PANE_OPTION)) { ((BaseApplet)applet).getHelpView().linkActivated(url, (BaseApplet)applet, Constants.DONT_PUSH_HISTORY); // For now } bSuccess = true; // Even if the help didn't display } if (!bSuccess) if ((applet != null) && (url != null) && (applet.getApplet() != null)) { applet = applet.getApplet(); // Get the JApplet if not standalone. ((BaseApplet)applet).getAppletContext().showDocument(url, "_blank"); bSuccess = true; } if (!bSuccess) { if (!bSuccess) if ((iOptions & ThinMenuConstants.CHANGE_BROWSER_SCREEN) != 0) if (this.getBrowserManager() != null) bSuccess = this.getBrowserManager().doLink(strURL); if (!bSuccess) if ((((Application)app).getMuffinManager() != null) && (url != null)) if (((Application)app).getMuffinManager().isServiceAvailable()) bSuccess = ((Application)app).getMuffinManager().showTheDocument(url); if (!bSuccess) { Map<String,Object> properties = new Hashtable<String,Object>(); properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.html.JHelpView"); if (url != null) strProtocol = url.getProtocol(); if (Application.MAIL_TO.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JMailView"); else if (Params.FAX.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JFaxView"); else if (Params.PHONE.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JPhoneView"); if (url != null) properties.put(Params.URL, url.toString()); else properties.put(Params.URL, strURL); this.makeHelpScreen(app, applet, properties); return true; // Success } } } return false; // failure } }
public class class_name { public boolean showTheDocument(App app, String strURL, int iOptions) { BaseAppletReference applet = this; boolean bIsHelpScreen = false; if ((strURL.indexOf("JHelp") != -1) || (strURL.indexOf(Params.HELP + "=")) != -1) bIsHelpScreen = true; if (bIsHelpScreen) if ((iOptions & ThinMenuConstants.HELP_WINDOW_CHANGE) != 0) { // Special case - if help is currently displayed, display this new help screen if (this.getHelpView().getHelpPane().isVisible()) iOptions = ThinMenuConstants.HELP_PANE_OPTION | ThinMenuConstants.HELP_WINDOW_CHANGE; else return false; // Don't refresh help if no current pane } boolean bSuccess = false; URL url = null; String strProtocol = null; if (strURL != null) if (strURL.indexOf(':') != -1) { strURL.substring(strURL.indexOf(':') + 1); // depends on control dependency: [if], data = [(strURL.indexOf(':')] strProtocol = strURL.substring(0, strURL.indexOf(':')); // depends on control dependency: [if], data = [none] } if ((Params.FAX.equalsIgnoreCase(strProtocol)) || (Params.PHONE.equalsIgnoreCase(strProtocol))) url = null; else { strProtocol = null; // depends on control dependency: [if], data = [none] url = app.getResourceURL(strURL, applet); // depends on control dependency: [if], data = [none] } if ((url != null) || (strProtocol != null)) { if ((applet != null) && (((BaseApplet)applet).getHelpView() != null) && (((iOptions & 1) == 0) && ((iOptions & Constants.USE_NEW_WINDOW) == 0) && ((iOptions & ThinMenuConstants.HELP_WEB_OPTION) == 0) // Use same window && ((iOptions & ThinMenuConstants.EXTERNAL_LINK) == 0) // Change browser window || (bIsHelpScreen))) { if (((applet != null) && (((BaseApplet)applet).getHelpView().getHelpPane().isVisible())) || ((ThinMenuConstants.HELP_PANE_OPTION & iOptions) == ThinMenuConstants.HELP_PANE_OPTION)) { ((BaseApplet)applet).getHelpView().linkActivated(url, (BaseApplet)applet, Constants.DONT_PUSH_HISTORY); // For now // depends on control dependency: [if], data = [none] } bSuccess = true; // Even if the help didn't display // depends on control dependency: [if], data = [none] } if (!bSuccess) if ((applet != null) && (url != null) && (applet.getApplet() != null)) { applet = applet.getApplet(); // Get the JApplet if not standalone. // depends on control dependency: [if], data = [none] ((BaseApplet)applet).getAppletContext().showDocument(url, "_blank"); // depends on control dependency: [if], data = [none] bSuccess = true; // depends on control dependency: [if], data = [none] } if (!bSuccess) { if (!bSuccess) if ((iOptions & ThinMenuConstants.CHANGE_BROWSER_SCREEN) != 0) if (this.getBrowserManager() != null) bSuccess = this.getBrowserManager().doLink(strURL); if (!bSuccess) if ((((Application)app).getMuffinManager() != null) && (url != null)) if (((Application)app).getMuffinManager().isServiceAvailable()) bSuccess = ((Application)app).getMuffinManager().showTheDocument(url); if (!bSuccess) { Map<String,Object> properties = new Hashtable<String,Object>(); properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.html.JHelpView"); if (url != null) strProtocol = url.getProtocol(); // depends on control dependency: [if], data = [none] if (Application.MAIL_TO.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JMailView"); else if (Params.FAX.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JFaxView"); else if (Params.PHONE.equalsIgnoreCase(strProtocol)) properties.put(Params.SCREEN, "org.jbundle.thin.base.screen.util.mail.JPhoneView"); if (url != null) properties.put(Params.URL, url.toString()); else properties.put(Params.URL, strURL); this.makeHelpScreen(app, applet, properties); // depends on control dependency: [if], data = [none] return true; // Success // depends on control dependency: [if], data = [none] } } } return false; // failure } }
public class class_name { public static WebSocketClientHandshaker newHandshaker( URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis) { if (version == V13) { return new WebSocketClientHandshaker13( webSocketURL, V13, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); } if (version == V08) { return new WebSocketClientHandshaker08( webSocketURL, V08, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); } if (version == V07) { return new WebSocketClientHandshaker07( webSocketURL, V07, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); } if (version == V00) { return new WebSocketClientHandshaker00( webSocketURL, V00, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis); } throw new WebSocketHandshakeException("Protocol version " + version + " not supported."); } }
public class class_name { public static WebSocketClientHandshaker newHandshaker( URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis) { if (version == V13) { return new WebSocketClientHandshaker13( webSocketURL, V13, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); // depends on control dependency: [if], data = [none] } if (version == V08) { return new WebSocketClientHandshaker08( webSocketURL, V08, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); // depends on control dependency: [if], data = [none] } if (version == V07) { return new WebSocketClientHandshaker07( webSocketURL, V07, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, allowMaskMismatch, forceCloseTimeoutMillis); // depends on control dependency: [if], data = [none] } if (version == V00) { return new WebSocketClientHandshaker00( webSocketURL, V00, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis); // depends on control dependency: [if], data = [none] } throw new WebSocketHandshakeException("Protocol version " + version + " not supported."); } }
public class class_name { public void marshall(CreateIpGroupRequest createIpGroupRequest, ProtocolMarshaller protocolMarshaller) { if (createIpGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createIpGroupRequest.getGroupName(), GROUPNAME_BINDING); protocolMarshaller.marshall(createIpGroupRequest.getGroupDesc(), GROUPDESC_BINDING); protocolMarshaller.marshall(createIpGroupRequest.getUserRules(), USERRULES_BINDING); protocolMarshaller.marshall(createIpGroupRequest.getTags(), TAGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CreateIpGroupRequest createIpGroupRequest, ProtocolMarshaller protocolMarshaller) { if (createIpGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createIpGroupRequest.getGroupName(), GROUPNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createIpGroupRequest.getGroupDesc(), GROUPDESC_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createIpGroupRequest.getUserRules(), USERRULES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createIpGroupRequest.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Nullable public static ResourceName createFromFullName(PathTemplate template, String path) { ImmutableMap<String, String> values = template.matchFromFullName(path); if (values == null) { return null; } return new ResourceName(template, values, null); } }
public class class_name { @Nullable public static ResourceName createFromFullName(PathTemplate template, String path) { ImmutableMap<String, String> values = template.matchFromFullName(path); if (values == null) { return null; // depends on control dependency: [if], data = [none] } return new ResourceName(template, values, null); } }
public class class_name { @Override public Expression visitCreator(CreatorContext ctx) { ClassNode classNode = this.visitCreatedName(ctx.createdName()); if (asBoolean(ctx.arguments())) { // create instance of class Expression arguments = this.visitArguments(ctx.arguments()); Expression enclosingInstanceExpression = ctx.getNodeMetaData(ENCLOSING_INSTANCE_EXPRESSION); if (null != enclosingInstanceExpression) { if (arguments instanceof ArgumentListExpression) { ((ArgumentListExpression) arguments).getExpressions().add(0, enclosingInstanceExpression); } else if (arguments instanceof TupleExpression) { throw createParsingFailedException("Creating instance of non-static class does not support named parameters", arguments); } else if (arguments instanceof NamedArgumentListExpression) { throw createParsingFailedException("Unexpected arguments", arguments); } else { throw createParsingFailedException("Unsupported arguments", arguments); // should never reach here } } if (asBoolean(ctx.anonymousInnerClassDeclaration())) { ctx.anonymousInnerClassDeclaration().putNodeMetaData(ANONYMOUS_INNER_CLASS_SUPER_CLASS, classNode); InnerClassNode anonymousInnerClassNode = this.visitAnonymousInnerClassDeclaration(ctx.anonymousInnerClassDeclaration()); List<InnerClassNode> anonymousInnerClassList = anonymousInnerClassesDefinedInMethodStack.peek(); if (null != anonymousInnerClassList) { // if the anonymous class is created in a script, no anonymousInnerClassList is available. anonymousInnerClassList.add(anonymousInnerClassNode); } ConstructorCallExpression constructorCallExpression = new ConstructorCallExpression(anonymousInnerClassNode, arguments); constructorCallExpression.setUsingAnonymousInnerClass(true); return configureAST(constructorCallExpression, ctx); } return configureAST( new ConstructorCallExpression(classNode, arguments), ctx); } if (asBoolean(ctx.LBRACK()) || asBoolean(ctx.dims())) { // create array ArrayExpression arrayExpression; List<List<AnnotationNode>> allDimList; if (asBoolean(ctx.arrayInitializer())) { ClassNode elementType = classNode; allDimList = this.visitDims(ctx.dims()); for (int i = 0, n = allDimList.size() - 1; i < n; i++) { elementType = elementType.makeArray(); } arrayExpression = new ArrayExpression( elementType, this.visitArrayInitializer(ctx.arrayInitializer())); } else { Expression[] empties; List<List<AnnotationNode>> emptyDimList = this.visitDimsOpt(ctx.dimsOpt()); if (asBoolean(emptyDimList)) { empties = new Expression[emptyDimList.size()]; Arrays.fill(empties, ConstantExpression.EMPTY_EXPRESSION); } else { empties = Expression.EMPTY_ARRAY; } arrayExpression = new ArrayExpression( classNode, null, Stream.concat( ctx.expression().stream() .map(e -> (Expression) this.visit(e)), Arrays.stream(empties) ).collect(Collectors.toList())); List<List<AnnotationNode>> exprDimList = ctx.annotationsOpt().stream().map(this::visitAnnotationsOpt).collect(Collectors.toList()); allDimList = new ArrayList<>(exprDimList); Collections.reverse(emptyDimList); allDimList.addAll(emptyDimList); Collections.reverse(allDimList); } arrayExpression.setType(createArrayType(classNode, allDimList)); return configureAST(arrayExpression, ctx); } throw createParsingFailedException("Unsupported creator: " + ctx.getText(), ctx); } }
public class class_name { @Override public Expression visitCreator(CreatorContext ctx) { ClassNode classNode = this.visitCreatedName(ctx.createdName()); if (asBoolean(ctx.arguments())) { // create instance of class Expression arguments = this.visitArguments(ctx.arguments()); Expression enclosingInstanceExpression = ctx.getNodeMetaData(ENCLOSING_INSTANCE_EXPRESSION); if (null != enclosingInstanceExpression) { if (arguments instanceof ArgumentListExpression) { ((ArgumentListExpression) arguments).getExpressions().add(0, enclosingInstanceExpression); // depends on control dependency: [if], data = [none] } else if (arguments instanceof TupleExpression) { throw createParsingFailedException("Creating instance of non-static class does not support named parameters", arguments); } else if (arguments instanceof NamedArgumentListExpression) { throw createParsingFailedException("Unexpected arguments", arguments); } else { throw createParsingFailedException("Unsupported arguments", arguments); // should never reach here } } if (asBoolean(ctx.anonymousInnerClassDeclaration())) { ctx.anonymousInnerClassDeclaration().putNodeMetaData(ANONYMOUS_INNER_CLASS_SUPER_CLASS, classNode); // depends on control dependency: [if], data = [none] InnerClassNode anonymousInnerClassNode = this.visitAnonymousInnerClassDeclaration(ctx.anonymousInnerClassDeclaration()); List<InnerClassNode> anonymousInnerClassList = anonymousInnerClassesDefinedInMethodStack.peek(); if (null != anonymousInnerClassList) { // if the anonymous class is created in a script, no anonymousInnerClassList is available. anonymousInnerClassList.add(anonymousInnerClassNode); // depends on control dependency: [if], data = [none] } ConstructorCallExpression constructorCallExpression = new ConstructorCallExpression(anonymousInnerClassNode, arguments); constructorCallExpression.setUsingAnonymousInnerClass(true); // depends on control dependency: [if], data = [none] return configureAST(constructorCallExpression, ctx); // depends on control dependency: [if], data = [none] } return configureAST( new ConstructorCallExpression(classNode, arguments), ctx); // depends on control dependency: [if], data = [none] } if (asBoolean(ctx.LBRACK()) || asBoolean(ctx.dims())) { // create array ArrayExpression arrayExpression; List<List<AnnotationNode>> allDimList; if (asBoolean(ctx.arrayInitializer())) { ClassNode elementType = classNode; allDimList = this.visitDims(ctx.dims()); // depends on control dependency: [if], data = [none] for (int i = 0, n = allDimList.size() - 1; i < n; i++) { elementType = elementType.makeArray(); // depends on control dependency: [for], data = [none] } arrayExpression = new ArrayExpression( elementType, this.visitArrayInitializer(ctx.arrayInitializer())); // depends on control dependency: [if], data = [none] } else { Expression[] empties; List<List<AnnotationNode>> emptyDimList = this.visitDimsOpt(ctx.dimsOpt()); if (asBoolean(emptyDimList)) { empties = new Expression[emptyDimList.size()]; // depends on control dependency: [if], data = [none] Arrays.fill(empties, ConstantExpression.EMPTY_EXPRESSION); // depends on control dependency: [if], data = [none] } else { empties = Expression.EMPTY_ARRAY; // depends on control dependency: [if], data = [none] } arrayExpression = new ArrayExpression( classNode, null, Stream.concat( ctx.expression().stream() .map(e -> (Expression) this.visit(e)), Arrays.stream(empties) ).collect(Collectors.toList())); // depends on control dependency: [if], data = [none] List<List<AnnotationNode>> exprDimList = ctx.annotationsOpt().stream().map(this::visitAnnotationsOpt).collect(Collectors.toList()); allDimList = new ArrayList<>(exprDimList); // depends on control dependency: [if], data = [none] Collections.reverse(emptyDimList); // depends on control dependency: [if], data = [none] allDimList.addAll(emptyDimList); // depends on control dependency: [if], data = [none] Collections.reverse(allDimList); // depends on control dependency: [if], data = [none] } arrayExpression.setType(createArrayType(classNode, allDimList)); // depends on control dependency: [if], data = [none] return configureAST(arrayExpression, ctx); // depends on control dependency: [if], data = [none] } throw createParsingFailedException("Unsupported creator: " + ctx.getText(), ctx); } }
public class class_name { private void twoWayMergeInternalStandard(final ReservoirItemsSketch<T> source) { assert (source.getN() <= source.getK()); final int numInputSamples = source.getNumSamples(); for (int i = 0; i < numInputSamples; ++i) { gadget_.update(source.getValueAtPosition(i)); } } }
public class class_name { private void twoWayMergeInternalStandard(final ReservoirItemsSketch<T> source) { assert (source.getN() <= source.getK()); final int numInputSamples = source.getNumSamples(); for (int i = 0; i < numInputSamples; ++i) { gadget_.update(source.getValueAtPosition(i)); // depends on control dependency: [for], data = [i] } } }
public class class_name { public void updateText(Dim.SourceInfo sourceInfo) { this.sourceInfo = sourceInfo; String newText = sourceInfo.source(); if (!textArea.getText().equals(newText)) { textArea.setText(newText); int pos = 0; if (currentPos != -1) { pos = currentPos; } textArea.select(pos); } fileHeader.update(); fileHeader.repaint(); } }
public class class_name { public void updateText(Dim.SourceInfo sourceInfo) { this.sourceInfo = sourceInfo; String newText = sourceInfo.source(); if (!textArea.getText().equals(newText)) { textArea.setText(newText); // depends on control dependency: [if], data = [none] int pos = 0; if (currentPos != -1) { pos = currentPos; // depends on control dependency: [if], data = [none] } textArea.select(pos); // depends on control dependency: [if], data = [none] } fileHeader.update(); fileHeader.repaint(); } }
public class class_name { public static ProducerTemplate generateTemplete(String contextUri) throws Exception { String initKey = contextUri.intern(); synchronized (initKey) { ProducerTemplate template = templates.get(initKey); // 初期化済みの場合は、初期化済みのProducerTemplateを返す。 if (template != null) { return template; } // 初期化を行う Main main = new Main(); main.setApplicationContextUri(contextUri); main.enableHangupSupport(); // run Camel CamelInitializeThread initializeThread = new CamelInitializeThread(main); initializeThread.start(); int timeCounter = 0; // keep ProducerTemplate while (!main.isStarted()) { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException ex) { if (logger.isDebugEnabled()) { logger.debug("Occur interrupt. Ignore interrupt.", ex); } } timeCounter++; if (INITIALIZE_TIMEOUT < timeCounter) { logger.error("Timed out to camel initialization. Stop to application start."); throw new Exception("Camel initialization time out."); } } // ProducerTemplateを取得する template = main.getCamelTemplate(); // 初期化済みのProducerTemplateを保持する templates.put(initKey, template); return template; } } }
public class class_name { public static ProducerTemplate generateTemplete(String contextUri) throws Exception { String initKey = contextUri.intern(); synchronized (initKey) { ProducerTemplate template = templates.get(initKey); // 初期化済みの場合は、初期化済みのProducerTemplateを返す。 if (template != null) { return template; // depends on control dependency: [if], data = [none] } // 初期化を行う Main main = new Main(); main.setApplicationContextUri(contextUri); main.enableHangupSupport(); // run Camel CamelInitializeThread initializeThread = new CamelInitializeThread(main); initializeThread.start(); int timeCounter = 0; // keep ProducerTemplate while (!main.isStarted()) { try { TimeUnit.SECONDS.sleep(1); // depends on control dependency: [try], data = [none] } catch (InterruptedException ex) { if (logger.isDebugEnabled()) { logger.debug("Occur interrupt. Ignore interrupt.", ex); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] timeCounter++; // depends on control dependency: [while], data = [none] if (INITIALIZE_TIMEOUT < timeCounter) { logger.error("Timed out to camel initialization. Stop to application start."); // depends on control dependency: [if], data = [none] throw new Exception("Camel initialization time out."); } } // ProducerTemplateを取得する template = main.getCamelTemplate(); // 初期化済みのProducerTemplateを保持する templates.put(initKey, template); return template; } } }
public class class_name { @Override public boolean loadListeners(String[] listeners, ClassLoader classLoader) { // Instantiate all the listeners for (String className : listeners) { try { Class listenerClass = Class.forName(className, false, classLoader); EventListener listener = (EventListener) listenerClass.newInstance(); // FIXME !!! SipInstanceManager sipInstanceManager = ((CatalinaSipContext)sipContext).getSipInstanceManager(); // FIXME !! sipInstanceManager.processAnnotations(listener, sipInstanceManager.getInjectionMap(listenerClass.getName())); MobicentsSipServlet sipServletImpl = (MobicentsSipServlet)sipContext.findSipServletByClassName(className); if(sipServletImpl != null) { listener = (EventListener) sipServletImpl.allocate(); listenerServlets.put(listener, sipServletImpl); } else { SipServlet servlet = (SipServlet) listenerClass.getAnnotation(SipServlet.class); if (servlet != null) { sipServletImpl = (MobicentsSipServlet)sipContext.findSipServletByName(servlet.name()); if(sipServletImpl != null) { listener = (EventListener) sipServletImpl.allocate(); listenerServlets.put(listener, sipServletImpl); } } } addListenerToBunch(listener); } catch (Exception e) { logger.fatal("Cannot instantiate listener class " + className, e); return false; } } return true; } }
public class class_name { @Override public boolean loadListeners(String[] listeners, ClassLoader classLoader) { // Instantiate all the listeners for (String className : listeners) { try { Class listenerClass = Class.forName(className, false, classLoader); EventListener listener = (EventListener) listenerClass.newInstance(); // FIXME !!! SipInstanceManager sipInstanceManager = ((CatalinaSipContext)sipContext).getSipInstanceManager(); // FIXME !! sipInstanceManager.processAnnotations(listener, sipInstanceManager.getInjectionMap(listenerClass.getName())); MobicentsSipServlet sipServletImpl = (MobicentsSipServlet)sipContext.findSipServletByClassName(className); if(sipServletImpl != null) { listener = (EventListener) sipServletImpl.allocate(); // depends on control dependency: [if], data = [none] listenerServlets.put(listener, sipServletImpl); // depends on control dependency: [if], data = [none] } else { SipServlet servlet = (SipServlet) listenerClass.getAnnotation(SipServlet.class); if (servlet != null) { sipServletImpl = (MobicentsSipServlet)sipContext.findSipServletByName(servlet.name()); // depends on control dependency: [if], data = [(servlet] if(sipServletImpl != null) { listener = (EventListener) sipServletImpl.allocate(); // depends on control dependency: [if], data = [none] listenerServlets.put(listener, sipServletImpl); // depends on control dependency: [if], data = [none] } } } addListenerToBunch(listener); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.fatal("Cannot instantiate listener class " + className, e); return false; } // depends on control dependency: [catch], data = [none] } return true; } }
public class class_name { public UicomponentAttributeType<UicomponentAttributeType<T>> getOrCreateAttribute() { List<Node> nodeList = childNode.get("attribute"); if (nodeList != null && nodeList.size() > 0) { return new UicomponentAttributeTypeImpl<UicomponentAttributeType<T>>(this, "attribute", childNode, nodeList.get(0)); } return createAttribute(); } }
public class class_name { public UicomponentAttributeType<UicomponentAttributeType<T>> getOrCreateAttribute() { List<Node> nodeList = childNode.get("attribute"); if (nodeList != null && nodeList.size() > 0) { return new UicomponentAttributeTypeImpl<UicomponentAttributeType<T>>(this, "attribute", childNode, nodeList.get(0)); // depends on control dependency: [if], data = [none] } return createAttribute(); } }
public class class_name { @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); String[] data = getHeaderValues(header); if (data.length == 1) { sequence.setAccession(new AccessionID(data[0])); } else { throw new RuntimeException( "No header or Some Error Occurred while reading header"); } } }
public class class_name { @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); String[] data = getHeaderValues(header); if (data.length == 1) { sequence.setAccession(new AccessionID(data[0])); // depends on control dependency: [if], data = [none] } else { throw new RuntimeException( "No header or Some Error Occurred while reading header"); } } }
public class class_name { @Override public EClass getIfcSurfaceStyleRendering() { if (ifcSurfaceStyleRenderingEClass == null) { ifcSurfaceStyleRenderingEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(681); } return ifcSurfaceStyleRenderingEClass; } }
public class class_name { @Override public EClass getIfcSurfaceStyleRendering() { if (ifcSurfaceStyleRenderingEClass == null) { ifcSurfaceStyleRenderingEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(681); // depends on control dependency: [if], data = [none] } return ifcSurfaceStyleRenderingEClass; } }
public class class_name { static ColorStateList bootstrapButtonText(Context context, boolean outline, BootstrapBrand brand) { int defaultColor = outline ? brand.defaultFill(context) : brand.defaultTextColor(context); int activeColor = outline ? ColorUtils.resolveColor(android.R.color.white, context) : brand.activeTextColor(context); int disabledColor = outline ? brand.disabledFill(context) : brand.disabledTextColor(context); if (outline && brand instanceof DefaultBootstrapBrand) { // special case DefaultBootstrapBrand db = (DefaultBootstrapBrand) brand; if (db == DefaultBootstrapBrand.SECONDARY) { defaultColor = ColorUtils.resolveColor(R.color.bootstrap_brand_secondary_border, context); disabledColor = defaultColor; } } return new ColorStateList(getStateList(), getColorList(defaultColor, activeColor, disabledColor)); } }
public class class_name { static ColorStateList bootstrapButtonText(Context context, boolean outline, BootstrapBrand brand) { int defaultColor = outline ? brand.defaultFill(context) : brand.defaultTextColor(context); int activeColor = outline ? ColorUtils.resolveColor(android.R.color.white, context) : brand.activeTextColor(context); int disabledColor = outline ? brand.disabledFill(context) : brand.disabledTextColor(context); if (outline && brand instanceof DefaultBootstrapBrand) { // special case DefaultBootstrapBrand db = (DefaultBootstrapBrand) brand; if (db == DefaultBootstrapBrand.SECONDARY) { defaultColor = ColorUtils.resolveColor(R.color.bootstrap_brand_secondary_border, context); // depends on control dependency: [if], data = [none] disabledColor = defaultColor; // depends on control dependency: [if], data = [none] } } return new ColorStateList(getStateList(), getColorList(defaultColor, activeColor, disabledColor)); } }
public class class_name { public static <T extends Comparable<? super T>> int[] sort(T[] arr) { int[] order = new int[arr.length]; for (int i = 0; i < order.length; i++) { order[i] = i; } sort(arr, order); return order; } }
public class class_name { public static <T extends Comparable<? super T>> int[] sort(T[] arr) { int[] order = new int[arr.length]; for (int i = 0; i < order.length; i++) { order[i] = i; // depends on control dependency: [for], data = [i] } sort(arr, order); return order; } }
public class class_name { private static String validIdentifier( String string) { try { DefUtils.assertIdentifier( string); } catch( Exception e) { throw new GeneratorSetException( e.getMessage()); } return string; } }
public class class_name { private static String validIdentifier( String string) { try { DefUtils.assertIdentifier( string); // depends on control dependency: [try], data = [none] } catch( Exception e) { throw new GeneratorSetException( e.getMessage()); } // depends on control dependency: [catch], data = [none] return string; } }
public class class_name { @Programmatic public String getId() { Object objectId = JDOHelper.getObjectId(this); if (objectId == null) { return ""; } String objectIdStr = objectId.toString(); final String id = objectIdStr.split("\\[OID\\]")[0]; return id; } }
public class class_name { @Programmatic public String getId() { Object objectId = JDOHelper.getObjectId(this); if (objectId == null) { return ""; // depends on control dependency: [if], data = [none] } String objectIdStr = objectId.toString(); final String id = objectIdStr.split("\\[OID\\]")[0]; return id; } }
public class class_name { public boolean putIfAbsent(KType key, VType value) { int keyIndex = indexOf(key); if (!indexExists(keyIndex)) { indexInsert(keyIndex, key, value); return true; } else { return false; } } }
public class class_name { public boolean putIfAbsent(KType key, VType value) { int keyIndex = indexOf(key); if (!indexExists(keyIndex)) { indexInsert(keyIndex, key, value); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public EClass getIfcEvaporativeCooler() { if (ifcEvaporativeCoolerEClass == null) { ifcEvaporativeCoolerEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(235); } return ifcEvaporativeCoolerEClass; } }
public class class_name { @Override public EClass getIfcEvaporativeCooler() { if (ifcEvaporativeCoolerEClass == null) { ifcEvaporativeCoolerEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(235); // depends on control dependency: [if], data = [none] } return ifcEvaporativeCoolerEClass; } }
public class class_name { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof IdleStateEvent) { IdleStateEvent e = (IdleStateEvent) evt; if (e.state() == IdleState.READER_IDLE) { LOGGER.warn("Closing dead connection."); ctx.close(); return; } } super.userEventTriggered(ctx, evt); } }
public class class_name { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof IdleStateEvent) { IdleStateEvent e = (IdleStateEvent) evt; if (e.state() == IdleState.READER_IDLE) { LOGGER.warn("Closing dead connection."); // depends on control dependency: [if], data = [none] ctx.close(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } } super.userEventTriggered(ctx, evt); } }
public class class_name { public BundleLinkComponent getLink(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } return null; } }
public class class_name { public BundleLinkComponent getLink(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public void write() throws IOException { SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { // do not write if not dirty if (!dirty) { return null; } OutputStream out = new IndexOutputStream(dir.createOutput(name + ".new")); DataOutputStream dataOut = null; try { dataOut = new DataOutputStream(out); dataOut.writeInt(counter); dataOut.writeInt(indexes.size()); for (int i = 0; i < indexes.size(); i++) { dataOut.writeUTF(getName(i)); } } finally { if (dataOut != null) dataOut.close(); out.close(); } // delete old if (dir.fileExists(name)) { dir.deleteFile(name); } rename(name + ".new", name); dirty = false; return null; } }); } }
public class class_name { public void write() throws IOException { SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { // do not write if not dirty if (!dirty) { return null; // depends on control dependency: [if], data = [none] } OutputStream out = new IndexOutputStream(dir.createOutput(name + ".new")); DataOutputStream dataOut = null; try { dataOut = new DataOutputStream(out); // depends on control dependency: [try], data = [none] dataOut.writeInt(counter); // depends on control dependency: [try], data = [none] dataOut.writeInt(indexes.size()); // depends on control dependency: [try], data = [none] for (int i = 0; i < indexes.size(); i++) { dataOut.writeUTF(getName(i)); // depends on control dependency: [for], data = [i] } } finally { if (dataOut != null) dataOut.close(); out.close(); } // delete old if (dir.fileExists(name)) { dir.deleteFile(name); // depends on control dependency: [if], data = [none] } rename(name + ".new", name); dirty = false; return null; } }); } }
public class class_name { public List<String> getSupportedProperties(String inEntityTypes, List<String> propNames) throws EntityTypeNotSupportedException { List<String> prop = null; Set<String> s = null; if (propNames != null && propNames.size() > 0) { if (inEntityTypes == null) { return propNames; } prop = new ArrayList<String>(); if (inEntityTypes.equals(SchemaConstants.DO_ENTITY)) { s = new HashSet<String>(); List<LdapEntity> ldapEntities = getAllLdapEntities(inEntityTypes); List<String> tmpProp = null; for (int i = 0; i < ldapEntities.size(); i++) { tmpProp = getSupportedProperties(ldapEntities.get(i), propNames); s.addAll(tmpProp); } prop.addAll(s); } else { LdapEntity ldapEntity = getLdapEntity(inEntityTypes); if (ldapEntity == null) { throw new EntityTypeNotSupportedException(WIMMessageKey.ENTITY_TYPE_NOT_SUPPORTED, Tr.formatMessage(tc, WIMMessageKey.ENTITY_TYPE_NOT_SUPPORTED, WIMMessageHelper.generateMsgParms(inEntityTypes))); } prop = getSupportedProperties(ldapEntity, propNames); } } return prop; } }
public class class_name { public List<String> getSupportedProperties(String inEntityTypes, List<String> propNames) throws EntityTypeNotSupportedException { List<String> prop = null; Set<String> s = null; if (propNames != null && propNames.size() > 0) { if (inEntityTypes == null) { return propNames; // depends on control dependency: [if], data = [none] } prop = new ArrayList<String>(); if (inEntityTypes.equals(SchemaConstants.DO_ENTITY)) { s = new HashSet<String>(); // depends on control dependency: [if], data = [none] List<LdapEntity> ldapEntities = getAllLdapEntities(inEntityTypes); List<String> tmpProp = null; for (int i = 0; i < ldapEntities.size(); i++) { tmpProp = getSupportedProperties(ldapEntities.get(i), propNames); // depends on control dependency: [for], data = [i] s.addAll(tmpProp); // depends on control dependency: [for], data = [none] } prop.addAll(s); // depends on control dependency: [if], data = [none] } else { LdapEntity ldapEntity = getLdapEntity(inEntityTypes); if (ldapEntity == null) { throw new EntityTypeNotSupportedException(WIMMessageKey.ENTITY_TYPE_NOT_SUPPORTED, Tr.formatMessage(tc, WIMMessageKey.ENTITY_TYPE_NOT_SUPPORTED, WIMMessageHelper.generateMsgParms(inEntityTypes))); } prop = getSupportedProperties(ldapEntity, propNames); // depends on control dependency: [if], data = [none] } } return prop; } }
public class class_name { public void moveSourceToDest(LineNumberReader reader, PrintWriter dataOut) { try { String string; while ((string = reader.readLine()) != null) { string = this.convertString(string); if (string != null) { dataOut.write(string); dataOut.println(); } } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } }
public class class_name { public void moveSourceToDest(LineNumberReader reader, PrintWriter dataOut) { try { String string; while ((string = reader.readLine()) != null) { string = this.convertString(string); // depends on control dependency: [while], data = [none] if (string != null) { dataOut.write(string); // depends on control dependency: [if], data = [(string] dataOut.println(); // depends on control dependency: [if], data = [none] } } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { // depends on control dependency: [catch], data = [none] ex.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private String getNamespace() { String namespace = getConfig(Config.namespace); if (StringUtils.isNotBlank(namespace)){ return namespace; } namespace = getContext().getConfiguration().getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; } namespace = System.getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; } return KubernetesHelper.getDefaultNamespace(); } }
public class class_name { private String getNamespace() { String namespace = getConfig(Config.namespace); if (StringUtils.isNotBlank(namespace)){ return namespace; // depends on control dependency: [if], data = [none] } namespace = getContext().getConfiguration().getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; // depends on control dependency: [if], data = [none] } namespace = System.getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; // depends on control dependency: [if], data = [none] } return KubernetesHelper.getDefaultNamespace(); } }
public class class_name { public void updateDistanceWith(RouteProgress routeProgress) { if (routeProgress != null && !isRerouting) { InstructionModel model = new InstructionModel(distanceFormatter, routeProgress); updateDataFromInstruction(model); } } }
public class class_name { public void updateDistanceWith(RouteProgress routeProgress) { if (routeProgress != null && !isRerouting) { InstructionModel model = new InstructionModel(distanceFormatter, routeProgress); updateDataFromInstruction(model); // depends on control dependency: [if], data = [none] } } }
public class class_name { private int renderUnorderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; for (Object option : options) { if (option instanceof OptionGroup) { xml.appendTagOpen("ui:optgroup"); xml.appendAttribute("label", ((OptionGroup) option).getDesc()); xml.appendClose(); // Recurse to render options inside option groups. List<?> nestedOptions = ((OptionGroup) option).getOptions(); optionIndex += renderUnorderedOptions(multiSelectPair, nestedOptions, optionIndex, xml, renderSelectionsOnly); xml.appendEndTag("ui:optgroup"); } else { renderOption(multiSelectPair, option, optionIndex++, xml, selections, renderSelectionsOnly); } } return optionIndex - startIndex; } }
public class class_name { private int renderUnorderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; for (Object option : options) { if (option instanceof OptionGroup) { xml.appendTagOpen("ui:optgroup"); // depends on control dependency: [if], data = [none] xml.appendAttribute("label", ((OptionGroup) option).getDesc()); // depends on control dependency: [if], data = [none] xml.appendClose(); // depends on control dependency: [if], data = [none] // Recurse to render options inside option groups. List<?> nestedOptions = ((OptionGroup) option).getOptions(); optionIndex += renderUnorderedOptions(multiSelectPair, nestedOptions, optionIndex, xml, renderSelectionsOnly); // depends on control dependency: [if], data = [none] xml.appendEndTag("ui:optgroup"); // depends on control dependency: [if], data = [none] } else { renderOption(multiSelectPair, option, optionIndex++, xml, selections, renderSelectionsOnly); // depends on control dependency: [if], data = [none] } } return optionIndex - startIndex; } }
public class class_name { public void deleteFileDelayed(final String fname) { _aggregator.getExecutors().getFileDeleteExecutor().schedule(new Runnable() { public void run() { File file = new File(_directory, fname); try { if (!file.delete()) { if (log.isLoggable(Level.WARNING)) { log.warning(MessageFormat.format( Messages.CacheManagerImpl_8, new Object[]{file.getAbsolutePath()} )); } } } catch (Exception e) { if (log.isLoggable(Level.WARNING)) { log.log(Level.WARNING, e.getMessage(), e); } } } }, _aggregator.getOptions().getDeleteDelay(), TimeUnit.SECONDS); } }
public class class_name { public void deleteFileDelayed(final String fname) { _aggregator.getExecutors().getFileDeleteExecutor().schedule(new Runnable() { public void run() { File file = new File(_directory, fname); try { if (!file.delete()) { if (log.isLoggable(Level.WARNING)) { log.warning(MessageFormat.format( Messages.CacheManagerImpl_8, new Object[]{file.getAbsolutePath()} )); // depends on control dependency: [if], data = [none] } } } catch (Exception e) { if (log.isLoggable(Level.WARNING)) { log.log(Level.WARNING, e.getMessage(), e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } }, _aggregator.getOptions().getDeleteDelay(), TimeUnit.SECONDS); } }
public class class_name { public static boolean checkPosition(Event event, LogPosition logPosition) { EntryPosition position = logPosition.getPostion(); boolean result = position.getTimestamp().equals(event.getExecuteTime()); boolean exactely = (StringUtils.isBlank(position.getJournalName()) && position.getPosition() == null); if (!exactely) {// 精确匹配 result &= position.getPosition().equals(event.getPosition()); if (result) {// short path result &= StringUtils.equals(event.getJournalName(), position.getJournalName()); } } return result; } }
public class class_name { public static boolean checkPosition(Event event, LogPosition logPosition) { EntryPosition position = logPosition.getPostion(); boolean result = position.getTimestamp().equals(event.getExecuteTime()); boolean exactely = (StringUtils.isBlank(position.getJournalName()) && position.getPosition() == null); if (!exactely) {// 精确匹配 result &= position.getPosition().equals(event.getPosition()); // depends on control dependency: [if], data = [none] if (result) {// short path result &= StringUtils.equals(event.getJournalName(), position.getJournalName()); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public FormAuthConfig withAdditionalFields(String firstFieldName, String secondFieldName, String... additionalFieldNames) { notNull(firstFieldName, "First additional field name"); notNull(secondFieldName, "Second additional field name"); List<String> list = new ArrayList<String>(additionalInputFieldNames); list.add(firstFieldName); list.add(secondFieldName); if (additionalFieldNames != null && additionalFieldNames.length > 0) { list.addAll(Arrays.asList(additionalFieldNames)); } return new FormAuthConfig(formAction, userInputTagName, passwordInputTagName, logDetail, logConfig, csrfFieldName, autoDetectCsrfFieldName, sendCsrfTokenAsFormParam, list); } }
public class class_name { public FormAuthConfig withAdditionalFields(String firstFieldName, String secondFieldName, String... additionalFieldNames) { notNull(firstFieldName, "First additional field name"); notNull(secondFieldName, "Second additional field name"); List<String> list = new ArrayList<String>(additionalInputFieldNames); list.add(firstFieldName); list.add(secondFieldName); if (additionalFieldNames != null && additionalFieldNames.length > 0) { list.addAll(Arrays.asList(additionalFieldNames)); // depends on control dependency: [if], data = [(additionalFieldNames] } return new FormAuthConfig(formAction, userInputTagName, passwordInputTagName, logDetail, logConfig, csrfFieldName, autoDetectCsrfFieldName, sendCsrfTokenAsFormParam, list); } }
public class class_name { public double getDefaultImageQuality(String mimeType) { if (StringUtils.isNotEmpty(mimeType)) { String format = StringUtils.substringAfter(mimeType.toLowerCase(), "image/"); if (StringUtils.equals(format, "jpg") || StringUtils.equals(format, "jpeg")) { return DEFAULT_JPEG_QUALITY; } else if (StringUtils.equals(format, "gif")) { return 256d; // 256 colors } } // return quality "1" for all other mime types return 1d; } }
public class class_name { public double getDefaultImageQuality(String mimeType) { if (StringUtils.isNotEmpty(mimeType)) { String format = StringUtils.substringAfter(mimeType.toLowerCase(), "image/"); if (StringUtils.equals(format, "jpg") || StringUtils.equals(format, "jpeg")) { return DEFAULT_JPEG_QUALITY; // depends on control dependency: [if], data = [none] } else if (StringUtils.equals(format, "gif")) { return 256d; // 256 colors // depends on control dependency: [if], data = [none] } } // return quality "1" for all other mime types return 1d; } }
public class class_name { @Override public CommerceWarehouse fetchByG_A_C_Last(long groupId, boolean active, long commerceCountryId, OrderByComparator<CommerceWarehouse> orderByComparator) { int count = countByG_A_C(groupId, active, commerceCountryId); if (count == 0) { return null; } List<CommerceWarehouse> list = findByG_A_C(groupId, active, commerceCountryId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } }
public class class_name { @Override public CommerceWarehouse fetchByG_A_C_Last(long groupId, boolean active, long commerceCountryId, OrderByComparator<CommerceWarehouse> orderByComparator) { int count = countByG_A_C(groupId, active, commerceCountryId); if (count == 0) { return null; // depends on control dependency: [if], data = [none] } List<CommerceWarehouse> list = findByG_A_C(groupId, active, commerceCountryId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); circle = circlePaths.get(0); circle.center[0] = maxLength * mInterpolatedTime; RectF ball1 = new RectF(); ball1.left = circle.center[0] - circle.radius; ball1.top = circle.center[1] - circle.radius; ball1.right = ball1.left + circle.radius * 2; ball1.bottom = ball1.top + circle.radius * 2; canvas.drawCircle(ball1.centerX(), ball1.centerY(), circle.radius, paint); for (int i = 1, l = circlePaths.size(); i < l; i++) { metaball(canvas, i, 0, 0.6f, handle_len_rate, radius * 4f); } } }
public class class_name { @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); circle = circlePaths.get(0); circle.center[0] = maxLength * mInterpolatedTime; RectF ball1 = new RectF(); ball1.left = circle.center[0] - circle.radius; ball1.top = circle.center[1] - circle.radius; ball1.right = ball1.left + circle.radius * 2; ball1.bottom = ball1.top + circle.radius * 2; canvas.drawCircle(ball1.centerX(), ball1.centerY(), circle.radius, paint); for (int i = 1, l = circlePaths.size(); i < l; i++) { metaball(canvas, i, 0, 0.6f, handle_len_rate, radius * 4f); // depends on control dependency: [for], data = [i] } } }
public class class_name { public synchronized ReentrantLock requestAccess(AuthenticationData authenticationData) { ReentrantLock currentLock = null; currentLock = authenticationDataLocks.get(authenticationData); if (currentLock == null) { currentLock = new ReentrantLock(); authenticationDataLocks.put(authenticationData, currentLock); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The size of the authenticationDataLocks is ", authenticationDataLocks.size()); } return currentLock; } }
public class class_name { public synchronized ReentrantLock requestAccess(AuthenticationData authenticationData) { ReentrantLock currentLock = null; currentLock = authenticationDataLocks.get(authenticationData); if (currentLock == null) { currentLock = new ReentrantLock(); // depends on control dependency: [if], data = [none] authenticationDataLocks.put(authenticationData, currentLock); // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The size of the authenticationDataLocks is ", authenticationDataLocks.size()); // depends on control dependency: [if], data = [none] } return currentLock; } }
public class class_name { public boolean scopeAllowed(String scope, String allowedScopes) { String[] allScopes = allowedScopes.split(SPACE); List<String> allowedList = Arrays.asList(allScopes); String[] scopes = scope.split(SPACE); int allowedCount = 0; for (String s : scopes) { if (allowedList.contains(s)) { allowedCount++; } } return (allowedCount == scopes.length); } }
public class class_name { public boolean scopeAllowed(String scope, String allowedScopes) { String[] allScopes = allowedScopes.split(SPACE); List<String> allowedList = Arrays.asList(allScopes); String[] scopes = scope.split(SPACE); int allowedCount = 0; for (String s : scopes) { if (allowedList.contains(s)) { allowedCount++; // depends on control dependency: [if], data = [none] } } return (allowedCount == scopes.length); } }
public class class_name { public static Attribute cloneAttribute(String newAttrName, Attribute attr) throws WIMSystemException { Attribute newAttr = new BasicAttribute(newAttrName); try { for (NamingEnumeration<?> neu = attr.getAll(); neu.hasMoreElements();) { newAttr.add(neu.nextElement()); } } catch (NamingException e) { throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)))); } return newAttr; } }
public class class_name { public static Attribute cloneAttribute(String newAttrName, Attribute attr) throws WIMSystemException { Attribute newAttr = new BasicAttribute(newAttrName); try { for (NamingEnumeration<?> neu = attr.getAll(); neu.hasMoreElements();) { newAttr.add(neu.nextElement()); // depends on control dependency: [for], data = [neu] } } catch (NamingException e) { throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)))); } return newAttr; } }
public class class_name { protected void bulkInsertWithComparator() { if (insertionBufferSize == 0) { return; } int right = size + insertionBufferSize - 2; int left = Math.max(size, right / 2); while (insertionBufferSize > 0) { --insertionBufferSize; array[size] = insertionBuffer[insertionBufferSize]; insertionBuffer[insertionBufferSize] = null; reverse.clear(size); ++size; } while (right > left + 1) { left = left / 2; right = right / 2; for (int j = left; j <= right; j++) { fixdownWithComparator(j); } } if (left != 0) { int i = dancestor(left); fixdownWithComparator(i); fixupWithComparator(i); } if (right != 0) { int i = dancestor(right); fixdownWithComparator(i); fixupWithComparator(i); } insertionBufferMinPos = 0; } }
public class class_name { protected void bulkInsertWithComparator() { if (insertionBufferSize == 0) { return; // depends on control dependency: [if], data = [none] } int right = size + insertionBufferSize - 2; int left = Math.max(size, right / 2); while (insertionBufferSize > 0) { --insertionBufferSize; // depends on control dependency: [while], data = [none] array[size] = insertionBuffer[insertionBufferSize]; // depends on control dependency: [while], data = [none] insertionBuffer[insertionBufferSize] = null; // depends on control dependency: [while], data = [none] reverse.clear(size); // depends on control dependency: [while], data = [none] ++size; // depends on control dependency: [while], data = [none] } while (right > left + 1) { left = left / 2; // depends on control dependency: [while], data = [none] right = right / 2; // depends on control dependency: [while], data = [none] for (int j = left; j <= right; j++) { fixdownWithComparator(j); // depends on control dependency: [for], data = [j] } } if (left != 0) { int i = dancestor(left); fixdownWithComparator(i); // depends on control dependency: [if], data = [none] fixupWithComparator(i); // depends on control dependency: [if], data = [none] } if (right != 0) { int i = dancestor(right); fixdownWithComparator(i); // depends on control dependency: [if], data = [none] fixupWithComparator(i); // depends on control dependency: [if], data = [none] } insertionBufferMinPos = 0; } }
public class class_name { private static Calendar parseExpectedXsdDateTimeValue(final RDFNode node) { final Object value = node.asLiteral().getValue(); if (value instanceof XSDDateTime) { return ((XSDDateTime) value).asCalendar(); } else { throw new IllegalArgumentException("Expected an xsd:dateTime!"); } } }
public class class_name { private static Calendar parseExpectedXsdDateTimeValue(final RDFNode node) { final Object value = node.asLiteral().getValue(); if (value instanceof XSDDateTime) { return ((XSDDateTime) value).asCalendar(); // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("Expected an xsd:dateTime!"); } } }
public class class_name { private static String escapeString(String s, char quote, String doublequoteEscape, String singlequoteEscape, String backslashEscape) { StringBuilder sb = new StringBuilder(s.length() + 2); sb.append(quote); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); switch (c) { case '\n': sb.append("\\n"); break; case '\r': sb.append("\\r"); break; case '\t': sb.append("\\t"); break; case '\\': sb.append(backslashEscape); break; case '\"': sb.append(doublequoteEscape); break; case '\'': sb.append(singlequoteEscape); break; case '>': // Unicode-escape the '>' in '-->' and ']]>' if (i >= 2 && ((s.charAt(i - 1) == '-' && s.charAt(i - 2) == '-') || (s.charAt(i - 1) == ']' && s.charAt(i - 2) == ']'))) { sb.append("\\u003e"); } else { sb.append(c); } break; case '<': // Unicode-escape the '<' in '</script' and '<!--' final String END_SCRIPT = "/script"; final String START_COMMENT = "!--"; if (s.regionMatches(true, i + 1, END_SCRIPT, 0, END_SCRIPT.length())) { sb.append("\\u003c"); } else if (s.regionMatches(false, i + 1, START_COMMENT, 0, START_COMMENT.length())) { sb.append("\\u003c"); } else { sb.append(c); } break; default: // No charsetEncoder provided - pass straight Latin characters // through, and escape the rest. Doing the explicit character // check is measurably faster than using the CharsetEncoder. if (c > 0x1f && c <= 0x7f) { sb.append(c); } else { // Other characters can be misinterpreted by some JS parsers, // or perhaps mangled by proxies along the way, // so we play it safe and Unicode escape them. appendHexJavaScriptRepresentation(sb, c); } } } sb.append(quote); return sb.toString(); } }
public class class_name { private static String escapeString(String s, char quote, String doublequoteEscape, String singlequoteEscape, String backslashEscape) { StringBuilder sb = new StringBuilder(s.length() + 2); sb.append(quote); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); switch (c) { case '\n': sb.append("\\n"); break; case '\r': sb.append("\\r"); break; case '\t': sb.append("\\t"); break; case '\\': sb.append(backslashEscape); break; case '\"': sb.append(doublequoteEscape); break; case '\'': sb.append(singlequoteEscape); break; case '>': // Unicode-escape the '>' in '-->' and ']]>' if (i >= 2 && ((s.charAt(i - 1) == '-' && s.charAt(i - 2) == '-') || (s.charAt(i - 1) == ']' && s.charAt(i - 2) == ']'))) { sb.append("\\u003e"); // depends on control dependency: [if], data = [none] } else { sb.append(c); // depends on control dependency: [if], data = [none] } break; case '<': // Unicode-escape the '<' in '</script' and '<!--' final String END_SCRIPT = "/script"; final String START_COMMENT = "!--"; if (s.regionMatches(true, i + 1, END_SCRIPT, 0, END_SCRIPT.length())) { sb.append("\\u003c"); // depends on control dependency: [if], data = [none] } else if (s.regionMatches(false, i + 1, START_COMMENT, 0, START_COMMENT.length())) { sb.append("\\u003c"); // depends on control dependency: [if], data = [none] } else { sb.append(c); // depends on control dependency: [if], data = [none] } break; default: // No charsetEncoder provided - pass straight Latin characters // through, and escape the rest. Doing the explicit character // check is measurably faster than using the CharsetEncoder. if (c > 0x1f && c <= 0x7f) { sb.append(c); // depends on control dependency: [if], data = [(c] } else { // Other characters can be misinterpreted by some JS parsers, // or perhaps mangled by proxies along the way, // so we play it safe and Unicode escape them. appendHexJavaScriptRepresentation(sb, c); // depends on control dependency: [if], data = [none] } } } sb.append(quote); return sb.toString(); } }
public class class_name { protected void generateTapPerClass(Result result) { Map<String, List<JUnitTestData>> testsByClass = new HashMap<>(); for (JUnitTestData testMethod : testMethodsList) { String className = TapJUnitUtil.extractClassName(testMethod .getDescription()); testsByClass.computeIfAbsent(className, k -> new ArrayList<>()) .add(testMethod); } testsByClass.forEach((className, testMethods) -> { final TestSet testSet = new TestSet(); testSet.setPlan(new Plan(testMethods.size())); testMethods.forEach(testMethod -> { TestResult tapTestResult = TapJUnitUtil.generateTAPTestResult( testMethod, 1, isYaml()); testSet.addTestResult(tapTestResult); }); File output = new File(System.getProperty("tap.junit.results", "target/"), className + ".tap"); tapProducer.dump(testSet, output); }); } }
public class class_name { protected void generateTapPerClass(Result result) { Map<String, List<JUnitTestData>> testsByClass = new HashMap<>(); for (JUnitTestData testMethod : testMethodsList) { String className = TapJUnitUtil.extractClassName(testMethod .getDescription()); testsByClass.computeIfAbsent(className, k -> new ArrayList<>()) .add(testMethod); // depends on control dependency: [for], data = [none] } testsByClass.forEach((className, testMethods) -> { final TestSet testSet = new TestSet(); testSet.setPlan(new Plan(testMethods.size())); testMethods.forEach(testMethod -> { TestResult tapTestResult = TapJUnitUtil.generateTAPTestResult( testMethod, 1, isYaml()); testSet.addTestResult(tapTestResult); }); File output = new File(System.getProperty("tap.junit.results", "target/"), className + ".tap"); tapProducer.dump(testSet, output); }); } }
public class class_name { public static base_responses update(nitro_service client, pqpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { pqpolicy updateresources[] = new pqpolicy[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new pqpolicy(); updateresources[i].policyname = resources[i].policyname; updateresources[i].weight = resources[i].weight; updateresources[i].qdepth = resources[i].qdepth; updateresources[i].polqdepth = resources[i].polqdepth; } result = update_bulk_request(client, updateresources); } return result; } }
public class class_name { public static base_responses update(nitro_service client, pqpolicy resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { pqpolicy updateresources[] = new pqpolicy[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new pqpolicy(); // depends on control dependency: [for], data = [i] updateresources[i].policyname = resources[i].policyname; // depends on control dependency: [for], data = [i] updateresources[i].weight = resources[i].weight; // depends on control dependency: [for], data = [i] updateresources[i].qdepth = resources[i].qdepth; // depends on control dependency: [for], data = [i] updateresources[i].polqdepth = resources[i].polqdepth; // depends on control dependency: [for], data = [i] } result = update_bulk_request(client, updateresources); } return result; } }
public class class_name { public static long[] parseContentRange(String value) { if (!value.startsWith("bytes ")) return null; int s = "bytes ".length(); while (s < value.length() && value.charAt(s) == ' ') s++; int pslash = value.indexOf('/', s); if (pslash < 0) return null; final String rangeSpec = value.substring(s, pslash).trim(); long start, stop; if (rangeSpec.equals("*")) start = stop = -1; else { long[] range = parseRange(rangeSpec); if (range == null) return null; if (range[0] < 0 || range[1] < 0) return null; start = range[0]; stop = range[1]; } final String instanceLength = value.substring(pslash + 1).trim(); long length; if (instanceLength.equals("*")) length = -1; else { try { length = Long.parseLong(instanceLength); } catch (NumberFormatException ex) { return null; } } return new long[] { start, stop, length }; } }
public class class_name { public static long[] parseContentRange(String value) { if (!value.startsWith("bytes ")) return null; int s = "bytes ".length(); while (s < value.length() && value.charAt(s) == ' ') s++; int pslash = value.indexOf('/', s); if (pslash < 0) return null; final String rangeSpec = value.substring(s, pslash).trim(); long start, stop; if (rangeSpec.equals("*")) start = stop = -1; else { long[] range = parseRange(rangeSpec); if (range == null) return null; if (range[0] < 0 || range[1] < 0) return null; start = range[0]; // depends on control dependency: [if], data = [none] stop = range[1]; // depends on control dependency: [if], data = [none] } final String instanceLength = value.substring(pslash + 1).trim(); long length; if (instanceLength.equals("*")) length = -1; else { try { length = Long.parseLong(instanceLength); // depends on control dependency: [try], data = [none] } catch (NumberFormatException ex) { return null; } // depends on control dependency: [catch], data = [none] } return new long[] { start, stop, length }; } }
public class class_name { public static Term create(String term) { Term res = createStringCache.get(term); if (res == null) { if (term != null && term.length() >= 2 && term.charAt(0) == '{' && term.charAt(term.length() - 1) == '}') { term = EscapeUtils.escape(term.substring(1, term.length() - 1)); } long[] value = checkStringIndex(term); if (value[1] < 0L) { res = (Term) StringProperty.getInstance(term); } else { res = (Term) create(value[0]); } createStringCache.put(term, res); } // no clone/copy needed for cached result return res; } }
public class class_name { public static Term create(String term) { Term res = createStringCache.get(term); if (res == null) { if (term != null && term.length() >= 2 && term.charAt(0) == '{' && term.charAt(term.length() - 1) == '}') { term = EscapeUtils.escape(term.substring(1, term.length() - 1)); // depends on control dependency: [if], data = [(term] } long[] value = checkStringIndex(term); if (value[1] < 0L) { res = (Term) StringProperty.getInstance(term); // depends on control dependency: [if], data = [none] } else { res = (Term) create(value[0]); // depends on control dependency: [if], data = [none] } createStringCache.put(term, res); // depends on control dependency: [if], data = [none] } // no clone/copy needed for cached result return res; } }
public class class_name { private static void injectComponent(final Component<?> component, final boolean inner) { // Retrieve all fields annotated with Link for (final Field field : ClassUtility.getAnnotatedFields(component.getClass(), Link.class)) { final String keyPart = field.getAnnotation(Link.class).value(); if (inner) { if (InnerComponent.class.isAssignableFrom(field.getType())) { if (keyPart.isEmpty()) { injectInnerComponent(component, field); } else { injectInnerComponent(component, field, keyPart); } } } else { if (Component.class.isAssignableFrom(field.getType())) { if (keyPart.isEmpty()) { injectComponent(component, field); } else { injectComponent(component, field, keyPart); } } } } } }
public class class_name { private static void injectComponent(final Component<?> component, final boolean inner) { // Retrieve all fields annotated with Link for (final Field field : ClassUtility.getAnnotatedFields(component.getClass(), Link.class)) { final String keyPart = field.getAnnotation(Link.class).value(); if (inner) { if (InnerComponent.class.isAssignableFrom(field.getType())) { if (keyPart.isEmpty()) { injectInnerComponent(component, field); // depends on control dependency: [if], data = [none] } else { injectInnerComponent(component, field, keyPart); // depends on control dependency: [if], data = [none] } } } else { if (Component.class.isAssignableFrom(field.getType())) { if (keyPart.isEmpty()) { injectComponent(component, field); // depends on control dependency: [if], data = [none] } else { injectComponent(component, field, keyPart); // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { public Observable<ServiceResponse<Void>> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (streamingEndpointName == null) { throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final Integer scaleUnit = null; StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); parameters.withScaleUnit(null); return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginScaleDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<Void>> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (streamingEndpointName == null) { throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final Integer scaleUnit = null; StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); parameters.withScaleUnit(null); return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginScaleDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { @Override protected void perform(final Wave wave) { if (getModel(SlideStackModel.class).isReadyForSlideUpdate(true)) { getModel(SlideStackModel.class).previous(wave.get(PrezWaves.SKIP_SLIDE_STEP)); } } }
public class class_name { @Override protected void perform(final Wave wave) { if (getModel(SlideStackModel.class).isReadyForSlideUpdate(true)) { getModel(SlideStackModel.class).previous(wave.get(PrezWaves.SKIP_SLIDE_STEP)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public final BidRequest.Builder readBidRequest(JsonParser par) throws IOException { if (emptyToNull(par)) { return null; } BidRequest.Builder req = BidRequest.newBuilder(); for (startObject(par); endObject(par); par.nextToken()) { String fieldName = getCurrentName(par); if (par.nextToken() != JsonToken.VALUE_NULL) { readBidRequestField(par, req, fieldName); } } return req; } }
public class class_name { public final BidRequest.Builder readBidRequest(JsonParser par) throws IOException { if (emptyToNull(par)) { return null; } BidRequest.Builder req = BidRequest.newBuilder(); for (startObject(par); endObject(par); par.nextToken()) { String fieldName = getCurrentName(par); if (par.nextToken() != JsonToken.VALUE_NULL) { readBidRequestField(par, req, fieldName); // depends on control dependency: [if], data = [none] } } return req; } }
public class class_name { private void addPostParams(final Request request) { if (enabled != null) { request.addPostParam("Enabled", enabled.toString()); } if (webhookUrl != null) { request.addPostParam("WebhookUrl", webhookUrl.toString()); } if (webhookMethod != null) { request.addPostParam("WebhookMethod", webhookMethod); } } }
public class class_name { private void addPostParams(final Request request) { if (enabled != null) { request.addPostParam("Enabled", enabled.toString()); // depends on control dependency: [if], data = [none] } if (webhookUrl != null) { request.addPostParam("WebhookUrl", webhookUrl.toString()); // depends on control dependency: [if], data = [none] } if (webhookMethod != null) { request.addPostParam("WebhookMethod", webhookMethod); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void removedLastSubscriber (DObject obj, boolean deathWish) { // if this object has a registered flush delay, don't can it just yet, just slip it onto // the flush queue Class<?> oclass = obj.getClass(); for (Class<?> dclass : _delays.keySet()) { if (dclass.isAssignableFrom(oclass)) { long expire = System.currentTimeMillis() + _delays.get(dclass).longValue(); _flushes.put(obj.getOid(), new FlushRecord(obj, expire)); // Log.info("Flushing " + obj.getOid() + " at " + new java.util.Date(expire)); return; } } // if we didn't find a delay registration, flush immediately flushObject(obj); } }
public class class_name { public void removedLastSubscriber (DObject obj, boolean deathWish) { // if this object has a registered flush delay, don't can it just yet, just slip it onto // the flush queue Class<?> oclass = obj.getClass(); for (Class<?> dclass : _delays.keySet()) { if (dclass.isAssignableFrom(oclass)) { long expire = System.currentTimeMillis() + _delays.get(dclass).longValue(); _flushes.put(obj.getOid(), new FlushRecord(obj, expire)); // depends on control dependency: [if], data = [none] // Log.info("Flushing " + obj.getOid() + " at " + new java.util.Date(expire)); return; // depends on control dependency: [if], data = [none] } } // if we didn't find a delay registration, flush immediately flushObject(obj); } }
public class class_name { public static void slice(Image srcImage, File descDir, int destWidth, int destHeight) { if (destWidth <= 0) { destWidth = 200; // 切片宽度 } if (destHeight <= 0) { destHeight = 150; // 切片高度 } int srcWidth = srcImage.getHeight(null); // 源图宽度 int srcHeight = srcImage.getWidth(null); // 源图高度 try { if (srcWidth > destWidth && srcHeight > destHeight) { int cols = 0; // 切片横向数量 int rows = 0; // 切片纵向数量 // 计算切片的横向和纵向数量 if (srcWidth % destWidth == 0) { cols = srcWidth / destWidth; } else { cols = (int) Math.floor(srcWidth / destWidth) + 1; } if (srcHeight % destHeight == 0) { rows = srcHeight / destHeight; } else { rows = (int) Math.floor(srcHeight / destHeight) + 1; } // 循环建立切片 BufferedImage tag; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { // 四个参数分别为图像起点坐标和宽高 // 即: CropImageFilter(int x,int y,int width,int height) tag = cut(srcImage, new Rectangle(j * destWidth, i * destHeight, destWidth, destHeight)); // 输出为文件 ImageIO.write(tag, IMAGE_TYPE_JPEG, new File(descDir, "_r" + i + "_c" + j + ".jpg")); } } } } catch (IOException e) { throw new IORuntimeException(e); } } }
public class class_name { public static void slice(Image srcImage, File descDir, int destWidth, int destHeight) { if (destWidth <= 0) { destWidth = 200; // 切片宽度 // depends on control dependency: [if], data = [none] } if (destHeight <= 0) { destHeight = 150; // 切片高度 // depends on control dependency: [if], data = [none] } int srcWidth = srcImage.getHeight(null); // 源图宽度 int srcHeight = srcImage.getWidth(null); // 源图高度 try { if (srcWidth > destWidth && srcHeight > destHeight) { int cols = 0; // 切片横向数量 int rows = 0; // 切片纵向数量 // 计算切片的横向和纵向数量 if (srcWidth % destWidth == 0) { cols = srcWidth / destWidth; // depends on control dependency: [if], data = [none] } else { cols = (int) Math.floor(srcWidth / destWidth) + 1; // depends on control dependency: [if], data = [none] } if (srcHeight % destHeight == 0) { rows = srcHeight / destHeight; // depends on control dependency: [if], data = [none] } else { rows = (int) Math.floor(srcHeight / destHeight) + 1; // depends on control dependency: [if], data = [none] } // 循环建立切片 BufferedImage tag; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { // 四个参数分别为图像起点坐标和宽高 // 即: CropImageFilter(int x,int y,int width,int height) tag = cut(srcImage, new Rectangle(j * destWidth, i * destHeight, destWidth, destHeight)); // depends on control dependency: [for], data = [j] // 输出为文件 ImageIO.write(tag, IMAGE_TYPE_JPEG, new File(descDir, "_r" + i + "_c" + j + ".jpg")); // depends on control dependency: [for], data = [j] } } } } catch (IOException e) { throw new IORuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String revisePath(String path) { if (!path.trim().equals("")) { // path = path.replaceAll("/", File.separator); File f = new File(path); if (f != null && !f.exists()) { f.mkdirs(); } if (!f.isDirectory()) { f = f.getParentFile(); path = f.getPath(); } if (!path.endsWith(File.separator)) { path += File.separator; } } return path; } }
public class class_name { public static String revisePath(String path) { if (!path.trim().equals("")) { // path = path.replaceAll("/", File.separator); File f = new File(path); if (f != null && !f.exists()) { f.mkdirs(); // depends on control dependency: [if], data = [none] } if (!f.isDirectory()) { f = f.getParentFile(); // depends on control dependency: [if], data = [none] path = f.getPath(); // depends on control dependency: [if], data = [none] } if (!path.endsWith(File.separator)) { path += File.separator; // depends on control dependency: [if], data = [none] } } return path; } }
public class class_name { private void finishPacket(Packet p) { if (p.watcherRegistration != null) { if(ErrorCode.OK.equals(p.respHeader.getErr())){ this.watcherManager.register(p.watcherRegistration); } } synchronized (p) { p.finished = true; PacketLatency.finishPacket(p); if (p.cb == null && p.future == null) { p.notifyAll(); } } eventThread.queuePacket(p); } }
public class class_name { private void finishPacket(Packet p) { if (p.watcherRegistration != null) { if(ErrorCode.OK.equals(p.respHeader.getErr())){ this.watcherManager.register(p.watcherRegistration); // depends on control dependency: [if], data = [none] } } synchronized (p) { p.finished = true; PacketLatency.finishPacket(p); if (p.cb == null && p.future == null) { p.notifyAll(); // depends on control dependency: [if], data = [none] } } eventThread.queuePacket(p); } }
public class class_name { private void buildGui() { left = toInteger(getElement().getStyle().getLeft()); top = toInteger(getElement().getStyle().getTop()); zoomInElement.getElement().setInnerText("+"); zoomOutElement.getElement().setInnerText("-"); StopPropagationHandler preventWeirdBehaviourHandler = new StopPropagationHandler(); // Calculate height: int y = 0; for (int i = 0; i < viewPort.getResolutionCount(); i++) { final int count = i; SimplePanel zoomStep = new SimplePanel(); zoomStep.setSize(ZOOMBUTTON_SIZE + "px", (ZOOMSTEP_HEIGHT + 1) + "px"); zoomStep.setStyleName(resource.css().zoomStepControlStep()); zoomStep.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { double scale = viewPort.getResolution(viewPort.getResolutionCount() - count - 1); viewPort.applyResolution(scale); event.stopPropagation(); } }, ClickEvent.getType()); zoomStep.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); zoomStep.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); zoomStep.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); zoomStep.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); zoomStepsPanel.add(zoomStep, 0, y); y += ZOOMSTEP_HEIGHT; } zoomStepsPanel.setSize(ZOOMBUTTON_SIZE + "px", (y + 1) + "px"); setSize(ZOOMBUTTON_SIZE + "px", (y + (ZOOMBUTTON_SIZE * 2) + 1) + "px"); // Zoom in button: zoomInElement.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { int index = viewPort.getResolutionIndex(viewPort.getResolution()); if (index < viewPort.getResolutionCount() - 1) { viewPort.registerAnimation(NavigationAnimationFactory.createZoomIn(mapPresenter)); } event.stopPropagation(); } }, ClickEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); // Zoom out button: zoomOutElement.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { int index = viewPort.getResolutionIndex(viewPort.getResolution()); if (index > 0) { viewPort.registerAnimation(NavigationAnimationFactory.createZoomOut(mapPresenter)); } event.stopPropagation(); } }, ClickEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); // Add the zoom handle: ZoomStephandler zoomStepHandler = new ZoomStephandler(); zoomStepHandler.setMinY(top + ZOOMBUTTON_SIZE); zoomStepHandler.setMaxY(top + ZOOMBUTTON_SIZE + (viewPort.getResolutionCount() - 1) * ZOOMSTEP_HEIGHT); zoomHandle.addDomHandler(zoomStepHandler, MouseDownEvent.getType()); addDomHandler(zoomStepHandler, MouseUpEvent.getType()); addDomHandler(zoomStepHandler, MouseMoveEvent.getType()); addDomHandler(zoomStepHandler, MouseOutEvent.getType()); // Apply correct positions for all widgets: applyPositions(); } }
public class class_name { private void buildGui() { left = toInteger(getElement().getStyle().getLeft()); top = toInteger(getElement().getStyle().getTop()); zoomInElement.getElement().setInnerText("+"); zoomOutElement.getElement().setInnerText("-"); StopPropagationHandler preventWeirdBehaviourHandler = new StopPropagationHandler(); // Calculate height: int y = 0; for (int i = 0; i < viewPort.getResolutionCount(); i++) { final int count = i; SimplePanel zoomStep = new SimplePanel(); zoomStep.setSize(ZOOMBUTTON_SIZE + "px", (ZOOMSTEP_HEIGHT + 1) + "px"); // depends on control dependency: [for], data = [none] zoomStep.setStyleName(resource.css().zoomStepControlStep()); // depends on control dependency: [for], data = [none] zoomStep.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { double scale = viewPort.getResolution(viewPort.getResolutionCount() - count - 1); viewPort.applyResolution(scale); event.stopPropagation(); } }, ClickEvent.getType()); // depends on control dependency: [for], data = [none] zoomStep.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); // depends on control dependency: [for], data = [none] zoomStep.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); // depends on control dependency: [for], data = [none] zoomStep.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); // depends on control dependency: [for], data = [none] zoomStep.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); // depends on control dependency: [for], data = [none] zoomStepsPanel.add(zoomStep, 0, y); // depends on control dependency: [for], data = [none] y += ZOOMSTEP_HEIGHT; // depends on control dependency: [for], data = [none] } zoomStepsPanel.setSize(ZOOMBUTTON_SIZE + "px", (y + 1) + "px"); setSize(ZOOMBUTTON_SIZE + "px", (y + (ZOOMBUTTON_SIZE * 2) + 1) + "px"); // Zoom in button: zoomInElement.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { int index = viewPort.getResolutionIndex(viewPort.getResolution()); if (index < viewPort.getResolutionCount() - 1) { viewPort.registerAnimation(NavigationAnimationFactory.createZoomIn(mapPresenter)); // depends on control dependency: [if], data = [none] } event.stopPropagation(); } }, ClickEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); zoomInElement.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); // Zoom out button: zoomOutElement.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { int index = viewPort.getResolutionIndex(viewPort.getResolution()); if (index > 0) { viewPort.registerAnimation(NavigationAnimationFactory.createZoomOut(mapPresenter)); // depends on control dependency: [if], data = [none] } event.stopPropagation(); } }, ClickEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, MouseDownEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, MouseUpEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, ClickEvent.getType()); zoomOutElement.addDomHandler(preventWeirdBehaviourHandler, DoubleClickEvent.getType()); // Add the zoom handle: ZoomStephandler zoomStepHandler = new ZoomStephandler(); zoomStepHandler.setMinY(top + ZOOMBUTTON_SIZE); zoomStepHandler.setMaxY(top + ZOOMBUTTON_SIZE + (viewPort.getResolutionCount() - 1) * ZOOMSTEP_HEIGHT); zoomHandle.addDomHandler(zoomStepHandler, MouseDownEvent.getType()); addDomHandler(zoomStepHandler, MouseUpEvent.getType()); addDomHandler(zoomStepHandler, MouseMoveEvent.getType()); addDomHandler(zoomStepHandler, MouseOutEvent.getType()); // Apply correct positions for all widgets: applyPositions(); } }
public class class_name { public int getMaximalColumnWidth(int col) { int ret = 0; int r = 0; while (r < getRowCount()) { TableCellBox cell = cells[col][r]; if (cell != null) { int max = cell.getMaximalWidth() / cell.getColspan(); if (max > ret) ret = max; r += cell.getRowspan(); } else r++; } return ret; } }
public class class_name { public int getMaximalColumnWidth(int col) { int ret = 0; int r = 0; while (r < getRowCount()) { TableCellBox cell = cells[col][r]; if (cell != null) { int max = cell.getMaximalWidth() / cell.getColspan(); if (max > ret) ret = max; r += cell.getRowspan(); // depends on control dependency: [if], data = [none] } else r++; } return ret; } }
public class class_name { protected void calculate(Variant variant, StudyEntry studyEntry, int numAllele, String reference, String[] alternateAlleles, Map<String, String> attributes, VariantStats variantStats) { if (attributes.containsKey("AN") && attributes.containsKey("AC")) { int total = Integer.parseInt(attributes.get("AN")); String[] alleleCountString = attributes.get("AC").split(COMMA); if (alleleCountString.length != alternateAlleles.length) { return; } int[] alleleCount = new int[alleleCountString.length]; String mafAllele = variant.getReference(); int referenceCount = total; for (int i = 0; i < alleleCountString.length; i++) { alleleCount[i] = Integer.parseInt(alleleCountString[i]); if (i == numAllele) { variantStats.setAltAlleleCount(alleleCount[i]); } referenceCount -= alleleCount[i]; } variantStats.setRefAlleleCount(referenceCount); float maf = (float) referenceCount / total; for (int i = 0; i < alleleCount.length; i++) { float auxMaf = (float) alleleCount[i] / total; if (auxMaf < maf) { maf = auxMaf; mafAllele = alternateAlleles[i]; } } variantStats.setMaf(maf); variantStats.setMafAllele(mafAllele); } if (attributes.containsKey("AF")) { String[] afs = attributes.get("AF").split(COMMA); if (afs.length == alternateAlleles.length) { float value = parseFloat(afs[numAllele], -1); variantStats.setAltAlleleFreq(value); if (variantStats.getMaf() == -1) { // in case that we receive AFs but no ACs if (variantStats.getRefAlleleFreq() < 0) { variantStats.setRefAlleleFreq(1 - variantStats.getAltAlleleFreq()); } float sumFreq = 0; for (String af : afs) { sumFreq += parseFloat(af, -1); } float maf = 1 - sumFreq; String mafAllele = variant.getReference(); for (int i = 0; i < afs.length; i++) { float auxMaf = parseFloat(afs[i], -1); if (auxMaf < maf) { maf = auxMaf; mafAllele = alternateAlleles[i]; } } variantStats.setMaf(maf); variantStats.setMafAllele(mafAllele); } } } if (attributes.containsKey("MAF")) { String[] mafs = attributes.get("MAF").split(COMMA); if (mafs.length == alternateAlleles.length) { float maf = parseFloat(mafs[numAllele], -1); variantStats.setMaf(maf); if (attributes.containsKey("MA")) { // Get the minor allele String ma = attributes.get("MA"); if (ma.equals("-")) { ma = ""; } variantStats.setMafAllele(ma); if (variantStats.getAltAlleleFreq() < 0 || variantStats.getRefAlleleFreq() < 0) { if (ma.equals(variant.getReference())) { variantStats.setRefAlleleFreq(maf); variantStats.setAltAlleleFreq(1 - maf); } else if (ma.equals(variant.getAlternate())) { variantStats.setRefAlleleFreq(1 - maf); variantStats.setAltAlleleFreq(maf); } // It may happen that the MA is none of the variant alleles. Just skip } } } } if (attributes.containsKey("GTC")) { String[] gtcs = attributes.get("GTC").split(COMMA); if (attributes.containsKey("GTS")) { // GTS contains the format like: GTS=GG,GT,TT or GTS=A1A1,A1R,RR addGenotypeWithGTS(attributes, gtcs, reference, alternateAlleles, numAllele, variantStats); } else { // Het count is a non standard field that can not be rearranged when decomposing multi-allelic variants. // Get the original variant call to parse this field FileEntry fileEntry = studyEntry.getFiles().get(0); int numAlleleOri; String[] alternateAllelesOri; if (fileEntry.getCall() != null && !fileEntry.getCall().isEmpty()) { String[] ori = fileEntry.getCall().split(":"); numAlleleOri = Integer.parseInt(ori[3]); alternateAllelesOri = ori[2].split(","); } else { numAlleleOri = numAllele; alternateAllelesOri = alternateAlleles; } for (int i = 0; i < gtcs.length; i++) { String[] gtcSplit = gtcs[i].split(":"); Integer alleles[] = new Integer[2]; Integer gtc = 0; String gt = null; boolean parseable = true; if (gtcSplit.length == 1) { // GTC=0,5,8 getGenotype(i, alleles); gtc = Integer.parseInt(gtcs[i]); gt = VariantVcfFactory.mapToMultiallelicIndex(alleles[0], numAlleleOri) + "/" + VariantVcfFactory.mapToMultiallelicIndex(alleles[1], numAlleleOri); } else { // GTC=0/0:0,0/1:5,1/1:8 Matcher matcher = numNum.matcher(gtcSplit[0]); if (matcher.matches()) { // number/number:number alleles[0] = Integer.parseInt(matcher.group(1)); alleles[1] = Integer.parseInt(matcher.group(2)); gtc = Integer.parseInt(gtcSplit[1]); gt = VariantVcfFactory.mapToMultiallelicIndex(alleles[0], numAlleleOri) + "/" + VariantVcfFactory.mapToMultiallelicIndex(alleles[1], numAlleleOri); } else { if (gtcSplit[0].equals("./.")) { // ./.:number alleles[0] = -1; alleles[1] = -1; gtc = Integer.parseInt(gtcSplit[1]); gt = "./."; } else { parseable = false; } } } if (parseable) { Genotype genotype = new Genotype(gt, variant.getReference(), alternateAlleles[numAlleleOri]); variantStats.addGenotype(genotype, gtc); } } } } } }
public class class_name { protected void calculate(Variant variant, StudyEntry studyEntry, int numAllele, String reference, String[] alternateAlleles, Map<String, String> attributes, VariantStats variantStats) { if (attributes.containsKey("AN") && attributes.containsKey("AC")) { int total = Integer.parseInt(attributes.get("AN")); String[] alleleCountString = attributes.get("AC").split(COMMA); if (alleleCountString.length != alternateAlleles.length) { return; // depends on control dependency: [if], data = [none] } int[] alleleCount = new int[alleleCountString.length]; String mafAllele = variant.getReference(); int referenceCount = total; for (int i = 0; i < alleleCountString.length; i++) { alleleCount[i] = Integer.parseInt(alleleCountString[i]); // depends on control dependency: [for], data = [i] if (i == numAllele) { variantStats.setAltAlleleCount(alleleCount[i]); // depends on control dependency: [if], data = [none] } referenceCount -= alleleCount[i]; // depends on control dependency: [for], data = [i] } variantStats.setRefAlleleCount(referenceCount); // depends on control dependency: [if], data = [none] float maf = (float) referenceCount / total; for (int i = 0; i < alleleCount.length; i++) { float auxMaf = (float) alleleCount[i] / total; if (auxMaf < maf) { maf = auxMaf; // depends on control dependency: [if], data = [none] mafAllele = alternateAlleles[i]; // depends on control dependency: [if], data = [none] } } variantStats.setMaf(maf); // depends on control dependency: [if], data = [none] variantStats.setMafAllele(mafAllele); // depends on control dependency: [if], data = [none] } if (attributes.containsKey("AF")) { String[] afs = attributes.get("AF").split(COMMA); if (afs.length == alternateAlleles.length) { float value = parseFloat(afs[numAllele], -1); variantStats.setAltAlleleFreq(value); // depends on control dependency: [if], data = [none] if (variantStats.getMaf() == -1) { // in case that we receive AFs but no ACs if (variantStats.getRefAlleleFreq() < 0) { variantStats.setRefAlleleFreq(1 - variantStats.getAltAlleleFreq()); // depends on control dependency: [if], data = [none] } float sumFreq = 0; for (String af : afs) { sumFreq += parseFloat(af, -1); // depends on control dependency: [for], data = [af] } float maf = 1 - sumFreq; String mafAllele = variant.getReference(); for (int i = 0; i < afs.length; i++) { float auxMaf = parseFloat(afs[i], -1); if (auxMaf < maf) { maf = auxMaf; // depends on control dependency: [if], data = [none] mafAllele = alternateAlleles[i]; // depends on control dependency: [if], data = [none] } } variantStats.setMaf(maf); // depends on control dependency: [if], data = [none] variantStats.setMafAllele(mafAllele); // depends on control dependency: [if], data = [none] } } } if (attributes.containsKey("MAF")) { String[] mafs = attributes.get("MAF").split(COMMA); if (mafs.length == alternateAlleles.length) { float maf = parseFloat(mafs[numAllele], -1); variantStats.setMaf(maf); // depends on control dependency: [if], data = [none] if (attributes.containsKey("MA")) { // Get the minor allele String ma = attributes.get("MA"); if (ma.equals("-")) { ma = ""; // depends on control dependency: [if], data = [none] } variantStats.setMafAllele(ma); // depends on control dependency: [if], data = [none] if (variantStats.getAltAlleleFreq() < 0 || variantStats.getRefAlleleFreq() < 0) { if (ma.equals(variant.getReference())) { variantStats.setRefAlleleFreq(maf); // depends on control dependency: [if], data = [none] variantStats.setAltAlleleFreq(1 - maf); // depends on control dependency: [if], data = [none] } else if (ma.equals(variant.getAlternate())) { variantStats.setRefAlleleFreq(1 - maf); // depends on control dependency: [if], data = [none] variantStats.setAltAlleleFreq(maf); // depends on control dependency: [if], data = [none] } // It may happen that the MA is none of the variant alleles. Just skip } } } } if (attributes.containsKey("GTC")) { String[] gtcs = attributes.get("GTC").split(COMMA); if (attributes.containsKey("GTS")) { // GTS contains the format like: GTS=GG,GT,TT or GTS=A1A1,A1R,RR addGenotypeWithGTS(attributes, gtcs, reference, alternateAlleles, numAllele, variantStats); // depends on control dependency: [if], data = [none] } else { // Het count is a non standard field that can not be rearranged when decomposing multi-allelic variants. // Get the original variant call to parse this field FileEntry fileEntry = studyEntry.getFiles().get(0); int numAlleleOri; String[] alternateAllelesOri; if (fileEntry.getCall() != null && !fileEntry.getCall().isEmpty()) { String[] ori = fileEntry.getCall().split(":"); numAlleleOri = Integer.parseInt(ori[3]); // depends on control dependency: [if], data = [none] alternateAllelesOri = ori[2].split(","); // depends on control dependency: [if], data = [none] } else { numAlleleOri = numAllele; // depends on control dependency: [if], data = [none] alternateAllelesOri = alternateAlleles; // depends on control dependency: [if], data = [none] } for (int i = 0; i < gtcs.length; i++) { String[] gtcSplit = gtcs[i].split(":"); Integer alleles[] = new Integer[2]; Integer gtc = 0; String gt = null; boolean parseable = true; if (gtcSplit.length == 1) { // GTC=0,5,8 getGenotype(i, alleles); // depends on control dependency: [if], data = [none] gtc = Integer.parseInt(gtcs[i]); // depends on control dependency: [if], data = [none] gt = VariantVcfFactory.mapToMultiallelicIndex(alleles[0], numAlleleOri) + "/" + VariantVcfFactory.mapToMultiallelicIndex(alleles[1], numAlleleOri); // depends on control dependency: [if], data = [none] } else { // GTC=0/0:0,0/1:5,1/1:8 Matcher matcher = numNum.matcher(gtcSplit[0]); if (matcher.matches()) { // number/number:number alleles[0] = Integer.parseInt(matcher.group(1)); // depends on control dependency: [if], data = [none] alleles[1] = Integer.parseInt(matcher.group(2)); // depends on control dependency: [if], data = [none] gtc = Integer.parseInt(gtcSplit[1]); // depends on control dependency: [if], data = [none] gt = VariantVcfFactory.mapToMultiallelicIndex(alleles[0], numAlleleOri) + "/" + VariantVcfFactory.mapToMultiallelicIndex(alleles[1], numAlleleOri); // depends on control dependency: [if], data = [none] } else { if (gtcSplit[0].equals("./.")) { // ./.:number alleles[0] = -1; // depends on control dependency: [if], data = [none] alleles[1] = -1; // depends on control dependency: [if], data = [none] gtc = Integer.parseInt(gtcSplit[1]); // depends on control dependency: [if], data = [none] gt = "./."; // depends on control dependency: [if], data = [none] } else { parseable = false; // depends on control dependency: [if], data = [none] } } } if (parseable) { Genotype genotype = new Genotype(gt, variant.getReference(), alternateAlleles[numAlleleOri]); variantStats.addGenotype(genotype, gtc); // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { public void marshall(DeleteDeploymentGroupRequest deleteDeploymentGroupRequest, ProtocolMarshaller protocolMarshaller) { if (deleteDeploymentGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteDeploymentGroupRequest.getApplicationName(), APPLICATIONNAME_BINDING); protocolMarshaller.marshall(deleteDeploymentGroupRequest.getDeploymentGroupName(), DEPLOYMENTGROUPNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DeleteDeploymentGroupRequest deleteDeploymentGroupRequest, ProtocolMarshaller protocolMarshaller) { if (deleteDeploymentGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteDeploymentGroupRequest.getApplicationName(), APPLICATIONNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(deleteDeploymentGroupRequest.getDeploymentGroupName(), DEPLOYMENTGROUPNAME_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setMusicPitch(float pitch) { if (soundWorks) { AL10.alSourcef(sources.get(0), AL10.AL_PITCH, pitch); } } }
public class class_name { public void setMusicPitch(float pitch) { if (soundWorks) { AL10.alSourcef(sources.get(0), AL10.AL_PITCH, pitch); // depends on control dependency: [if], data = [none] } } }
public class class_name { private Where addWhereClauseForRowRange(String keyAlias, Select select, RowRange<?> rowRange) { Where where = null; boolean keyIsPresent = false; boolean tokenIsPresent = false; if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) { keyIsPresent = true; } if (rowRange.getStartToken() != null || rowRange.getEndToken() != null) { tokenIsPresent = true; } if (keyIsPresent && tokenIsPresent) { throw new RuntimeException("Cannot provide both token and keys for range query"); } if (keyIsPresent) { if (rowRange.getStartKey() != null && rowRange.getEndKey() != null) { where = select.where(gte(keyAlias, BIND_MARKER)) .and(lte(keyAlias, BIND_MARKER)); } else if (rowRange.getStartKey() != null) { where = select.where(gte(keyAlias, BIND_MARKER)); } else if (rowRange.getEndKey() != null) { where = select.where(lte(keyAlias, BIND_MARKER)); } } else if (tokenIsPresent) { String tokenOfKey ="token(" + keyAlias + ")"; if (rowRange.getStartToken() != null && rowRange.getEndToken() != null) { where = select.where(gte(tokenOfKey, BIND_MARKER)) .and(lte(tokenOfKey, BIND_MARKER)); } else if (rowRange.getStartToken() != null) { where = select.where(gte(tokenOfKey, BIND_MARKER)); } else if (rowRange.getEndToken() != null) { where = select.where(lte(tokenOfKey, BIND_MARKER)); } } else { where = select.where(); } if (rowRange.getCount() > 0) { // TODO: fix this //where.limit(rowRange.getCount()); } return where; } }
public class class_name { private Where addWhereClauseForRowRange(String keyAlias, Select select, RowRange<?> rowRange) { Where where = null; boolean keyIsPresent = false; boolean tokenIsPresent = false; if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) { keyIsPresent = true; // depends on control dependency: [if], data = [none] } if (rowRange.getStartToken() != null || rowRange.getEndToken() != null) { tokenIsPresent = true; // depends on control dependency: [if], data = [none] } if (keyIsPresent && tokenIsPresent) { throw new RuntimeException("Cannot provide both token and keys for range query"); } if (keyIsPresent) { if (rowRange.getStartKey() != null && rowRange.getEndKey() != null) { where = select.where(gte(keyAlias, BIND_MARKER)) .and(lte(keyAlias, BIND_MARKER)); // depends on control dependency: [if], data = [none] } else if (rowRange.getStartKey() != null) { where = select.where(gte(keyAlias, BIND_MARKER)); // depends on control dependency: [if], data = [none] } else if (rowRange.getEndKey() != null) { where = select.where(lte(keyAlias, BIND_MARKER)); // depends on control dependency: [if], data = [none] } } else if (tokenIsPresent) { String tokenOfKey ="token(" + keyAlias + ")"; if (rowRange.getStartToken() != null && rowRange.getEndToken() != null) { where = select.where(gte(tokenOfKey, BIND_MARKER)) .and(lte(tokenOfKey, BIND_MARKER)); // depends on control dependency: [if], data = [none] } else if (rowRange.getStartToken() != null) { where = select.where(gte(tokenOfKey, BIND_MARKER)); // depends on control dependency: [if], data = [none] } else if (rowRange.getEndToken() != null) { where = select.where(lte(tokenOfKey, BIND_MARKER)); // depends on control dependency: [if], data = [none] } } else { where = select.where(); // depends on control dependency: [if], data = [none] } if (rowRange.getCount() > 0) { // TODO: fix this //where.limit(rowRange.getCount()); } return where; } }
public class class_name { private void writeGnuplotScript(final String basepath, final String[] datafiles) throws IOException { final String script_path = basepath + ".gnuplot"; final PrintWriter gp = new PrintWriter(script_path); try { // XXX don't hardcode all those settings. At least not like that. gp.append("set term png small size ") // Why the fuck didn't they also add methods for numbers? .append(Short.toString(width)).append(",") .append(Short.toString(height)); final String smooth = params.remove("smooth"); final String fgcolor = params.remove("fgcolor"); final String style = params.remove("style"); String bgcolor = params.remove("bgcolor"); if (fgcolor != null && bgcolor == null) { // We can't specify a fgcolor without specifying a bgcolor. bgcolor = "xFFFFFF"; // So use a default. } if (bgcolor != null) { if (fgcolor != null && "transparent".equals(bgcolor)) { // In case we need to specify a fgcolor but we wanted a transparent // background, we also need to pass a bgcolor otherwise the first // hex color will be mistakenly taken as a bgcolor by Gnuplot. bgcolor = "transparent xFFFFFF"; } gp.append(' ').append(bgcolor); } if (fgcolor != null) { gp.append(' ').append(fgcolor); } gp.append("\n" + "set xdata time\n" + "set timefmt \"%s\"\n" + "if (GPVAL_VERSION < 4.6) set xtics rotate; else set xtics rotate right\n" + "set output \"").append(basepath + ".png").append("\"\n" + "set xrange [\"") .append(String.valueOf((start_time & UNSIGNED) + utc_offset)) .append("\":\"") .append(String.valueOf((end_time & UNSIGNED) + utc_offset)) .append("\"]\n"); if (!params.containsKey("format x")) { gp.append("set format x \"").append(xFormat()).append("\"\n"); } final int nseries = datapoints.size(); if (nseries > 0) { gp.write("set grid\n" + "set style data "); gp.append(style != null? style : "linespoint").append("\n"); if (!params.containsKey("key")) { gp.write("set key right box\n"); } } else { gp.write("unset key\n"); if (params == null || !params.containsKey("label")) { gp.write("set label \"No data\" at graph 0.5,0.9 center\n"); } } if (params != null) { for (final Map.Entry<String, String> entry : params.entrySet()) { final String key = entry.getKey(); final String value = entry.getValue(); if (value != null) { gp.append("set ").append(key) .append(' ').append(value).write('\n'); } else { gp.append("unset ").append(key).write('\n'); } } } for (final String opts : options) { if (opts.contains("x1y2")) { // Create a second scale for the y-axis on the right-hand side. gp.write("set y2tics border\n"); break; } } // compile annotations to determine if we have any to graph final List<Annotation> notes = new ArrayList<Annotation>(); for (int i = 0; i < nseries; i++) { final DataPoints dp = datapoints.get(i); final List<Annotation> series_notes = dp.getAnnotations(); if (series_notes != null && !series_notes.isEmpty()) { notes.addAll(series_notes); } } if (globals != null) { notes.addAll(globals); } if (notes.size() > 0) { Collections.sort(notes); for(Annotation note : notes) { String ts = Long.toString(note.getStartTime()); String value = new String(note.getDescription()); gp.append("set arrow from \"").append(ts).append("\", graph 0 to \""); gp.append(ts).append("\", graph 1 nohead ls 3\n"); gp.append("set object rectangle at \"").append(ts); gp.append("\", graph 0 size char (strlen(\"").append(value); gp.append("\")), char 1 front fc rgbcolor \"white\"\n"); gp.append("set label \"").append(value).append("\" at \""); gp.append(ts).append("\", graph 0 front center\n"); } } gp.write("plot "); for (int i = 0; i < nseries; i++) { final DataPoints dp = datapoints.get(i); final String title = dp.metricName() + dp.getTags(); gp.append(" \"").append(datafiles[i]).append("\" using 1:2"); if (smooth != null) { gp.append(" smooth ").append(smooth); } // TODO(tsuna): Escape double quotes in title. gp.append(" title \"").append(title).write('"'); final String opts = options.get(i); if (!opts.isEmpty()) { gp.append(' ').write(opts); } if (i != nseries - 1) { gp.print(", \\"); } gp.write('\n'); } if (nseries == 0) { gp.write('0'); } } finally { gp.close(); LOG.info("Wrote Gnuplot script to " + script_path); } } }
public class class_name { private void writeGnuplotScript(final String basepath, final String[] datafiles) throws IOException { final String script_path = basepath + ".gnuplot"; final PrintWriter gp = new PrintWriter(script_path); try { // XXX don't hardcode all those settings. At least not like that. gp.append("set term png small size ") // Why the fuck didn't they also add methods for numbers? .append(Short.toString(width)).append(",") .append(Short.toString(height)); final String smooth = params.remove("smooth"); final String fgcolor = params.remove("fgcolor"); final String style = params.remove("style"); String bgcolor = params.remove("bgcolor"); if (fgcolor != null && bgcolor == null) { // We can't specify a fgcolor without specifying a bgcolor. bgcolor = "xFFFFFF"; // So use a default. // depends on control dependency: [if], data = [none] } if (bgcolor != null) { if (fgcolor != null && "transparent".equals(bgcolor)) { // In case we need to specify a fgcolor but we wanted a transparent // background, we also need to pass a bgcolor otherwise the first // hex color will be mistakenly taken as a bgcolor by Gnuplot. bgcolor = "transparent xFFFFFF"; // depends on control dependency: [if], data = [none] } gp.append(' ').append(bgcolor); // depends on control dependency: [if], data = [(bgcolor] } if (fgcolor != null) { gp.append(' ').append(fgcolor); // depends on control dependency: [if], data = [(fgcolor] } gp.append("\n" + "set xdata time\n" + "set timefmt \"%s\"\n" + "if (GPVAL_VERSION < 4.6) set xtics rotate; else set xtics rotate right\n" + "set output \"").append(basepath + ".png").append("\"\n" + "set xrange [\"") .append(String.valueOf((start_time & UNSIGNED) + utc_offset)) .append("\":\"") .append(String.valueOf((end_time & UNSIGNED) + utc_offset)) .append("\"]\n"); if (!params.containsKey("format x")) { gp.append("set format x \"").append(xFormat()).append("\"\n"); // depends on control dependency: [if], data = [none] } final int nseries = datapoints.size(); if (nseries > 0) { gp.write("set grid\n" + "set style data "); // depends on control dependency: [if], data = [none] gp.append(style != null? style : "linespoint").append("\n"); // depends on control dependency: [if], data = [none] if (!params.containsKey("key")) { gp.write("set key right box\n"); // depends on control dependency: [if], data = [none] } } else { gp.write("unset key\n"); // depends on control dependency: [if], data = [none] if (params == null || !params.containsKey("label")) { gp.write("set label \"No data\" at graph 0.5,0.9 center\n"); // depends on control dependency: [if], data = [none] } } if (params != null) { for (final Map.Entry<String, String> entry : params.entrySet()) { final String key = entry.getKey(); final String value = entry.getValue(); if (value != null) { gp.append("set ").append(key) .append(' ').append(value).write('\n'); // depends on control dependency: [if], data = [none] } else { gp.append("unset ").append(key).write('\n'); // depends on control dependency: [if], data = [none] } } } for (final String opts : options) { if (opts.contains("x1y2")) { // Create a second scale for the y-axis on the right-hand side. gp.write("set y2tics border\n"); // depends on control dependency: [if], data = [none] break; } } // compile annotations to determine if we have any to graph final List<Annotation> notes = new ArrayList<Annotation>(); for (int i = 0; i < nseries; i++) { final DataPoints dp = datapoints.get(i); final List<Annotation> series_notes = dp.getAnnotations(); if (series_notes != null && !series_notes.isEmpty()) { notes.addAll(series_notes); // depends on control dependency: [if], data = [(series_notes] } } if (globals != null) { notes.addAll(globals); // depends on control dependency: [if], data = [(globals] } if (notes.size() > 0) { Collections.sort(notes); // depends on control dependency: [if], data = [none] for(Annotation note : notes) { String ts = Long.toString(note.getStartTime()); String value = new String(note.getDescription()); gp.append("set arrow from \"").append(ts).append("\", graph 0 to \""); // depends on control dependency: [for], data = [none] gp.append(ts).append("\", graph 1 nohead ls 3\n"); // depends on control dependency: [for], data = [none] gp.append("set object rectangle at \"").append(ts); // depends on control dependency: [for], data = [none] gp.append("\", graph 0 size char (strlen(\"").append(value); gp.append("\")), char 1 front fc rgbcolor \"white\"\n"); // depends on control dependency: [for], data = [none] gp.append("set label \"").append(value).append("\" at \""); // depends on control dependency: [for], data = [none] gp.append(ts).append("\", graph 0 front center\n"); // depends on control dependency: [for], data = [none] } } gp.write("plot "); for (int i = 0; i < nseries; i++) { final DataPoints dp = datapoints.get(i); final String title = dp.metricName() + dp.getTags(); gp.append(" \"").append(datafiles[i]).append("\" using 1:2"); // depends on control dependency: [for], data = [i] if (smooth != null) { gp.append(" smooth ").append(smooth); // depends on control dependency: [if], data = [(smooth] } // TODO(tsuna): Escape double quotes in title. gp.append(" title \"").append(title).write('"'); // depends on control dependency: [for], data = [none] final String opts = options.get(i); if (!opts.isEmpty()) { gp.append(' ').write(opts); // depends on control dependency: [if], data = [none] } if (i != nseries - 1) { gp.print(", \\"); // depends on control dependency: [if], data = [none] } gp.write('\n'); // depends on control dependency: [for], data = [none] } if (nseries == 0) { gp.write('0'); // depends on control dependency: [if], data = [none] } } finally { gp.close(); LOG.info("Wrote Gnuplot script to " + script_path); } } }
public class class_name { public AllocateHostsResult withHostIds(String... hostIds) { if (this.hostIds == null) { setHostIds(new com.amazonaws.internal.SdkInternalList<String>(hostIds.length)); } for (String ele : hostIds) { this.hostIds.add(ele); } return this; } }
public class class_name { public AllocateHostsResult withHostIds(String... hostIds) { if (this.hostIds == null) { setHostIds(new com.amazonaws.internal.SdkInternalList<String>(hostIds.length)); // depends on control dependency: [if], data = [none] } for (String ele : hostIds) { this.hostIds.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public SSLEngine newEngine() { if (nextProtocols.isEmpty()) { return new OpenSslEngine(ctx, bufferPool, null); } else { return new OpenSslEngine( ctx, bufferPool, nextProtocols.get(nextProtocols.size() - 1)); } } }
public class class_name { public SSLEngine newEngine() { if (nextProtocols.isEmpty()) { return new OpenSslEngine(ctx, bufferPool, null); // depends on control dependency: [if], data = [none] } else { return new OpenSslEngine( ctx, bufferPool, nextProtocols.get(nextProtocols.size() - 1)); // depends on control dependency: [if], data = [none] } } }
public class class_name { private int mapDevChars(StringBuilder dest, int labelStart, int mappingStart) { int length=dest.length(); boolean didMapDevChars=false; for(int i=mappingStart; i<length;) { char c=dest.charAt(i); switch(c) { case 0xdf: // Map sharp s to ss. didMapDevChars=true; dest.setCharAt(i++, 's'); dest.insert(i++, 's'); ++length; break; case 0x3c2: // Map final sigma to nonfinal sigma. didMapDevChars=true; dest.setCharAt(i++, '\u03c3'); break; case 0x200c: // Ignore/remove ZWNJ. case 0x200d: // Ignore/remove ZWJ. didMapDevChars=true; dest.delete(i, i+1); --length; break; default: ++i; break; } } if(didMapDevChars) { // Mapping deviation characters might have resulted in an un-NFC string. // We could use either the NFC or the UTS #46 normalizer. // By using the UTS #46 normalizer again, we avoid having to load a second .nrm data file. String normalized=uts46Norm2.normalize(dest.subSequence(labelStart, dest.length())); dest.replace(labelStart, 0x7fffffff, normalized); return dest.length(); } return length; } }
public class class_name { private int mapDevChars(StringBuilder dest, int labelStart, int mappingStart) { int length=dest.length(); boolean didMapDevChars=false; for(int i=mappingStart; i<length;) { char c=dest.charAt(i); switch(c) { case 0xdf: // Map sharp s to ss. didMapDevChars=true; dest.setCharAt(i++, 's'); dest.insert(i++, 's'); ++length; break; case 0x3c2: // Map final sigma to nonfinal sigma. didMapDevChars=true; dest.setCharAt(i++, '\u03c3'); break; case 0x200c: // Ignore/remove ZWNJ. case 0x200d: // Ignore/remove ZWJ. didMapDevChars=true; dest.delete(i, i+1); --length; break; default: ++i; break; } } if(didMapDevChars) { // Mapping deviation characters might have resulted in an un-NFC string. // We could use either the NFC or the UTS #46 normalizer. // By using the UTS #46 normalizer again, we avoid having to load a second .nrm data file. String normalized=uts46Norm2.normalize(dest.subSequence(labelStart, dest.length())); dest.replace(labelStart, 0x7fffffff, normalized); // depends on control dependency: [if], data = [none] return dest.length(); // depends on control dependency: [if], data = [none] } return length; } }
public class class_name { public void marshall(CreatePatchBaselineRequest createPatchBaselineRequest, ProtocolMarshaller protocolMarshaller) { if (createPatchBaselineRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createPatchBaselineRequest.getOperatingSystem(), OPERATINGSYSTEM_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getGlobalFilters(), GLOBALFILTERS_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getApprovalRules(), APPROVALRULES_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatches(), APPROVEDPATCHES_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatchesComplianceLevel(), APPROVEDPATCHESCOMPLIANCELEVEL_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatchesEnableNonSecurity(), APPROVEDPATCHESENABLENONSECURITY_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getRejectedPatches(), REJECTEDPATCHES_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getRejectedPatchesAction(), REJECTEDPATCHESACTION_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getSources(), SOURCES_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getClientToken(), CLIENTTOKEN_BINDING); protocolMarshaller.marshall(createPatchBaselineRequest.getTags(), TAGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CreatePatchBaselineRequest createPatchBaselineRequest, ProtocolMarshaller protocolMarshaller) { if (createPatchBaselineRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createPatchBaselineRequest.getOperatingSystem(), OPERATINGSYSTEM_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getGlobalFilters(), GLOBALFILTERS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getApprovalRules(), APPROVALRULES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatches(), APPROVEDPATCHES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatchesComplianceLevel(), APPROVEDPATCHESCOMPLIANCELEVEL_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getApprovedPatchesEnableNonSecurity(), APPROVEDPATCHESENABLENONSECURITY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getRejectedPatches(), REJECTEDPATCHES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getRejectedPatchesAction(), REJECTEDPATCHESACTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getSources(), SOURCES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getClientToken(), CLIENTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createPatchBaselineRequest.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void handleSetProperties(Object obj, Class<?> clazz, Entity entity, List<ReflectedInfo> fieldInfo) throws Siren4JConversionException { if (!MapUtils.isEmpty(entity.getProperties())) { for (String key : entity.getProperties().keySet()) { if (key.startsWith(Siren4J.CLASS_RESERVED_PROPERTY)) { continue; } ReflectedInfo info = ReflectionUtils.getFieldInfoByEffectiveName(fieldInfo, key); if (info == null) { info = ReflectionUtils.getFieldInfoByName(fieldInfo, key); } if (info != null) { Object val = entity.getProperties().get(key); try { ReflectionUtils.setFieldValue(obj, info, val); } catch (Siren4JException e) { throw new Siren4JConversionException(e); } } else if (isErrorOnMissingProperty() && !(obj instanceof Collection && key.equals("size"))) { //Houston we have a problem!! throw new Siren4JConversionException( "Unable to find field: " + key + " for class: " + clazz.getName()); } } } } }
public class class_name { private void handleSetProperties(Object obj, Class<?> clazz, Entity entity, List<ReflectedInfo> fieldInfo) throws Siren4JConversionException { if (!MapUtils.isEmpty(entity.getProperties())) { for (String key : entity.getProperties().keySet()) { if (key.startsWith(Siren4J.CLASS_RESERVED_PROPERTY)) { continue; } ReflectedInfo info = ReflectionUtils.getFieldInfoByEffectiveName(fieldInfo, key); if (info == null) { info = ReflectionUtils.getFieldInfoByName(fieldInfo, key); // depends on control dependency: [if], data = [none] } if (info != null) { Object val = entity.getProperties().get(key); try { ReflectionUtils.setFieldValue(obj, info, val); // depends on control dependency: [try], data = [none] } catch (Siren4JException e) { throw new Siren4JConversionException(e); } // depends on control dependency: [catch], data = [none] } else if (isErrorOnMissingProperty() && !(obj instanceof Collection && key.equals("size"))) { //Houston we have a problem!! throw new Siren4JConversionException( "Unable to find field: " + key + " for class: " + clazz.getName()); } } } } }
public class class_name { public void setFormat(final String format) { if (format == null && this.format == null) { return; } else if (format == null) { removeChild(this.format); this.format = null; } else if (this.format == null) { this.format = new KeyValueNode<String>(CommonConstants.CS_FORMAT_TITLE, format); appendChild(this.format, false); } else { this.format.setValue(format); } } }
public class class_name { public void setFormat(final String format) { if (format == null && this.format == null) { return; // depends on control dependency: [if], data = [none] } else if (format == null) { removeChild(this.format); // depends on control dependency: [if], data = [none] this.format = null; // depends on control dependency: [if], data = [none] } else if (this.format == null) { this.format = new KeyValueNode<String>(CommonConstants.CS_FORMAT_TITLE, format); // depends on control dependency: [if], data = [none] appendChild(this.format, false); // depends on control dependency: [if], data = [(this.format] } else { this.format.setValue(format); // depends on control dependency: [if], data = [none] } } }
public class class_name { public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) { A annotation; Map<AnnotatedElement, Annotation> cacheMap = cache.get(annotationClass); if (cacheMap == null) { cacheMap = new HashMap<AnnotatedElement, Annotation>(); cache.put(annotationClass, cacheMap); } if (cacheMap.containsKey(element)) { annotation = (A) cacheMap.get(element); } else { annotation = element.getAnnotation(annotationClass); if (annotation == null && element instanceof Method) { annotation = getOverriddenAnnotation(annotationClass, (Method) element); } cacheMap.put(element, annotation); } return annotation; } }
public class class_name { public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) { A annotation; Map<AnnotatedElement, Annotation> cacheMap = cache.get(annotationClass); if (cacheMap == null) { cacheMap = new HashMap<AnnotatedElement, Annotation>(); // depends on control dependency: [if], data = [none] cache.put(annotationClass, cacheMap); // depends on control dependency: [if], data = [none] } if (cacheMap.containsKey(element)) { annotation = (A) cacheMap.get(element); // depends on control dependency: [if], data = [none] } else { annotation = element.getAnnotation(annotationClass); // depends on control dependency: [if], data = [none] if (annotation == null && element instanceof Method) { annotation = getOverriddenAnnotation(annotationClass, (Method) element); // depends on control dependency: [if], data = [(annotation] } cacheMap.put(element, annotation); // depends on control dependency: [if], data = [none] } return annotation; } }
public class class_name { @Override public void sendMsg(String msg) { DbConn cnx = Helpers.getNewDbSession(); try { Message.create(cnx, msg, ji.getId()); cnx.commit(); } finally { Helpers.closeQuietly(cnx); } } }
public class class_name { @Override public void sendMsg(String msg) { DbConn cnx = Helpers.getNewDbSession(); try { Message.create(cnx, msg, ji.getId()); // depends on control dependency: [try], data = [none] cnx.commit(); // depends on control dependency: [try], data = [none] } finally { Helpers.closeQuietly(cnx); } } }
public class class_name { public static MutableRoaringBitmap naive_or(@SuppressWarnings("rawtypes") Iterator bitmaps) { MutableRoaringBitmap answer = new MutableRoaringBitmap(); while (bitmaps.hasNext()) { answer.naivelazyor((ImmutableRoaringBitmap) bitmaps.next()); } answer.repairAfterLazy(); return answer; } }
public class class_name { public static MutableRoaringBitmap naive_or(@SuppressWarnings("rawtypes") Iterator bitmaps) { MutableRoaringBitmap answer = new MutableRoaringBitmap(); while (bitmaps.hasNext()) { answer.naivelazyor((ImmutableRoaringBitmap) bitmaps.next()); // depends on control dependency: [while], data = [none] } answer.repairAfterLazy(); return answer; } }
public class class_name { public com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata getImageSegmentationDetails() { if (detailsCase_ == 15) { return (com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata) details_; } return com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata .getDefaultInstance(); } }
public class class_name { public com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata getImageSegmentationDetails() { if (detailsCase_ == 15) { return (com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata) details_; // depends on control dependency: [if], data = [none] } return com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata .getDefaultInstance(); } }
public class class_name { private TreeBuilder<ResourceMeta> baseConverter(TreeBuilder<ResourceMeta> builder) { if(null!=defaultConverters && defaultConverters.contains("StorageTimestamperConverter")) { logger.debug("Configuring base converter: StorageTimestamperConverter" ); builder=builder.convert( new StorageConverterPluginAdapter( "builtin:timestamp", new StorageTimestamperConverter() ) ); } if(null!=defaultConverters && defaultConverters.contains("KeyStorageLayer")){ logger.debug("Configuring base converter: KeyStorageLayer" ); builder=builder.convert( new StorageConverterPluginAdapter( "builtin:ssh-storage", new KeyStorageLayer() ), PathUtil.asPath("/keys") ); } return builder; } }
public class class_name { private TreeBuilder<ResourceMeta> baseConverter(TreeBuilder<ResourceMeta> builder) { if(null!=defaultConverters && defaultConverters.contains("StorageTimestamperConverter")) { logger.debug("Configuring base converter: StorageTimestamperConverter" ); // depends on control dependency: [if], data = [none] builder=builder.convert( new StorageConverterPluginAdapter( "builtin:timestamp", new StorageTimestamperConverter() ) ); // depends on control dependency: [if], data = [none] } if(null!=defaultConverters && defaultConverters.contains("KeyStorageLayer")){ logger.debug("Configuring base converter: KeyStorageLayer" ); // depends on control dependency: [if], data = [none] builder=builder.convert( new StorageConverterPluginAdapter( "builtin:ssh-storage", new KeyStorageLayer() ), PathUtil.asPath("/keys") ); // depends on control dependency: [if], data = [none] } return builder; } }
public class class_name { public MultiFormatter remove(Formatter<?>... formatters) { if (formatter != null) { MultiFormatter copy = new MultiFormatter(); copy.formatters.putAll(this.formatters); if (formatters != null && formatters.length > 0) { for (Formatter<?> formatter : formatters) { if (formatter != null) { Class<?> type = ClassUtils.getGenericClass(formatter.getClass()); if (type != null) { this.formatters.remove(type); } } } } return copy; } return this; } }
public class class_name { public MultiFormatter remove(Formatter<?>... formatters) { if (formatter != null) { MultiFormatter copy = new MultiFormatter(); copy.formatters.putAll(this.formatters); // depends on control dependency: [if], data = [none] if (formatters != null && formatters.length > 0) { for (Formatter<?> formatter : formatters) { if (formatter != null) { Class<?> type = ClassUtils.getGenericClass(formatter.getClass()); if (type != null) { this.formatters.remove(type); // depends on control dependency: [if], data = [(type] } } } } return copy; // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { private void jButtonAceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptActionPerformed int algCount = this.jTableAlgoritms.getRowCount(); int streamCount = this.jTableStreams.getRowCount(); chart = new ImageChart[streamCount]; for (int i = 0; i < streamCount; i++) { String streamName = this.jTableStreams.getModel().getValueAt(i, 0).toString(); String streamID = this.jTableStreams.getModel().getValueAt(i, 1).toString(); XYSeriesCollection dataset = new XYSeriesCollection(); for (int j = 0; j < algCount; j++) { try { String algName = this.jTableAlgoritms.getModel().getValueAt(j, 0).toString(); String algID = this.jTableAlgoritms.getModel().getValueAt(j, 1).toString(); String algPath = FilenameUtils.separatorsToSystem( this.path + "\\" + streamName + "\\" + algName); File inputFile = new File(algPath); if (!inputFile.exists()) { JOptionPane.showMessageDialog(this, "File not found: " + inputFile.getAbsolutePath(), "Error", JOptionPane.ERROR_MESSAGE); return; } /*Preparing the graph*/ ArrayList<String[]> data = readCSV(algPath); XYSeries series = new XYSeries(algID); int x = ReadFile.getMeasureIndex(algPath,this.jComboBoxXColumn.getSelectedItem().toString()); int y = ReadFile.getMeasureIndex(algPath,this.jComboBoxYColumn.getSelectedItem().toString()); for (String[] s : data) { series.add(Double.parseDouble(s[x]), Double.parseDouble(s[y])); } dataset.addSeries(series); } catch (FileNotFoundException ex) { Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex); } }//end for /*Create chart*/ JFreeChart imgChart = ChartFactory.createXYLineChart( this.jTextFieldTitle.getText(), // Title this.jTextFieldxTitle.getText(), // x-axis Label this.jTextFieldyTitle.getText(), // y-axis Label dataset, // Dataset PlotOrientation.VERTICAL, // Plot Orientation true, // Show Legend true, // Use tooltips false // Configure chart to generate URLs? ); final XYPlot plot = imgChart.getXYPlot(); switch (this.jComboBoxGrid.getSelectedItem().toString()) { case "White": plot.setBackgroundPaint(Color.white); break; case "Default": plot.setBackgroundPaint(Color.lightGray); } if (this.jCheckBoxShape.isSelected()) { final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, true); renderer.setSeriesShapesVisible(1, false); for (int k = 0; k < algCount; k++) { renderer.setSeriesPaint(k, Color.black); } plot.setRenderer(renderer); } this.chart[i] = new ImageChart(streamID, imgChart, (int) this.jSpinnerWidth.getValue(), (int) this.jSpinnerHeight.getValue()); } this.imgPanel = new ImageTreePanel(chart); new ImageViewer(imgPanel, path); } }
public class class_name { private void jButtonAceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptActionPerformed int algCount = this.jTableAlgoritms.getRowCount(); int streamCount = this.jTableStreams.getRowCount(); chart = new ImageChart[streamCount]; for (int i = 0; i < streamCount; i++) { String streamName = this.jTableStreams.getModel().getValueAt(i, 0).toString(); String streamID = this.jTableStreams.getModel().getValueAt(i, 1).toString(); XYSeriesCollection dataset = new XYSeriesCollection(); for (int j = 0; j < algCount; j++) { try { String algName = this.jTableAlgoritms.getModel().getValueAt(j, 0).toString(); String algID = this.jTableAlgoritms.getModel().getValueAt(j, 1).toString(); String algPath = FilenameUtils.separatorsToSystem( this.path + "\\" + streamName + "\\" + algName); File inputFile = new File(algPath); if (!inputFile.exists()) { JOptionPane.showMessageDialog(this, "File not found: " + inputFile.getAbsolutePath(), "Error", JOptionPane.ERROR_MESSAGE); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } /*Preparing the graph*/ ArrayList<String[]> data = readCSV(algPath); XYSeries series = new XYSeries(algID); int x = ReadFile.getMeasureIndex(algPath,this.jComboBoxXColumn.getSelectedItem().toString()); int y = ReadFile.getMeasureIndex(algPath,this.jComboBoxYColumn.getSelectedItem().toString()); for (String[] s : data) { series.add(Double.parseDouble(s[x]), Double.parseDouble(s[y])); // depends on control dependency: [for], data = [s] } dataset.addSeries(series); // depends on control dependency: [try], data = [none] } catch (FileNotFoundException ex) { Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { // depends on control dependency: [catch], data = [none] Logger.getLogger(PlotTab.class.getName()).log(Level.SEVERE, null, ex); } // depends on control dependency: [catch], data = [none] }//end for /*Create chart*/ JFreeChart imgChart = ChartFactory.createXYLineChart( this.jTextFieldTitle.getText(), // Title this.jTextFieldxTitle.getText(), // x-axis Label this.jTextFieldyTitle.getText(), // y-axis Label dataset, // Dataset PlotOrientation.VERTICAL, // Plot Orientation true, // Show Legend true, // Use tooltips false // Configure chart to generate URLs? ); final XYPlot plot = imgChart.getXYPlot(); switch (this.jComboBoxGrid.getSelectedItem().toString()) { case "White": plot.setBackgroundPaint(Color.white); // depends on control dependency: [for], data = [none] break; case "Default": plot.setBackgroundPaint(Color.lightGray); // depends on control dependency: [for], data = [none] } if (this.jCheckBoxShape.isSelected()) { final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, true); // depends on control dependency: [if], data = [none] renderer.setSeriesShapesVisible(1, false); // depends on control dependency: [if], data = [none] for (int k = 0; k < algCount; k++) { renderer.setSeriesPaint(k, Color.black); // depends on control dependency: [for], data = [k] } plot.setRenderer(renderer); // depends on control dependency: [if], data = [none] } this.chart[i] = new ImageChart(streamID, imgChart, (int) this.jSpinnerWidth.getValue(), (int) this.jSpinnerHeight.getValue()); } this.imgPanel = new ImageTreePanel(chart); new ImageViewer(imgPanel, path); } }
public class class_name { @Override public INDArray ones(int[] shape) { //ensure shapes that wind up being scalar end up with the write shape if (shape.length == 1 && shape[0] == 0) { shape = new int[] {1, 1}; } INDArray ret = create(shape); ret.assign(1); return ret; } }
public class class_name { @Override public INDArray ones(int[] shape) { //ensure shapes that wind up being scalar end up with the write shape if (shape.length == 1 && shape[0] == 0) { shape = new int[] {1, 1}; // depends on control dependency: [if], data = [none] } INDArray ret = create(shape); ret.assign(1); return ret; } }
public class class_name { public static String buildStackTrace(StackTraceElement[] stackTraceElements) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < stackTraceElements.length; i++) { StackTraceElement stackTraceElement = stackTraceElements[i]; builder.append(" at "); builder.append(stackTraceElement.getClassName()); builder.append("."); builder.append(stackTraceElement.getMethodName()); builder.append("("); builder.append(stackTraceElement.getFileName()); builder.append(":"); builder.append(stackTraceElement.getLineNumber()); builder.append(")"); builder.append(StringHelper.line()); } return builder.toString(); } }
public class class_name { public static String buildStackTrace(StackTraceElement[] stackTraceElements) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < stackTraceElements.length; i++) { StackTraceElement stackTraceElement = stackTraceElements[i]; builder.append(" at "); // depends on control dependency: [for], data = [none] builder.append(stackTraceElement.getClassName()); // depends on control dependency: [for], data = [none] builder.append("."); // depends on control dependency: [for], data = [none] builder.append(stackTraceElement.getMethodName()); // depends on control dependency: [for], data = [none] builder.append("("); // depends on control dependency: [for], data = [none] builder.append(stackTraceElement.getFileName()); // depends on control dependency: [for], data = [none] builder.append(":"); // depends on control dependency: [for], data = [none] builder.append(stackTraceElement.getLineNumber()); // depends on control dependency: [for], data = [none] builder.append(")"); // depends on control dependency: [for], data = [none] builder.append(StringHelper.line()); // depends on control dependency: [for], data = [none] } return builder.toString(); } }
public class class_name { public Observable<ServiceResponse<Page<RecordSetInner>>> listAllByDnsZoneSinglePageAsync(final String resourceGroupName, final String zoneName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (zoneName == null) { throw new IllegalArgumentException("Parameter zoneName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final Integer top = null; final String recordSetNameSuffix = null; return service.listAllByDnsZone(resourceGroupName, zoneName, this.client.subscriptionId(), top, recordSetNameSuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RecordSetInner>>>>() { @Override public Observable<ServiceResponse<Page<RecordSetInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<RecordSetInner>> result = listAllByDnsZoneDelegate(response); return Observable.just(new ServiceResponse<Page<RecordSetInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<Page<RecordSetInner>>> listAllByDnsZoneSinglePageAsync(final String resourceGroupName, final String zoneName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (zoneName == null) { throw new IllegalArgumentException("Parameter zoneName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final Integer top = null; final String recordSetNameSuffix = null; return service.listAllByDnsZone(resourceGroupName, zoneName, this.client.subscriptionId(), top, recordSetNameSuffix, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RecordSetInner>>>>() { @Override public Observable<ServiceResponse<Page<RecordSetInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<RecordSetInner>> result = listAllByDnsZoneDelegate(response); return Observable.just(new ServiceResponse<Page<RecordSetInner>>(result.body(), result.response())); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }