idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,391,038
public CloseableImage decode(EncodedImage encodedImage, int length, QualityInfo qualityInfo, ImageDecodeOptions options) {<NEW_LINE>Rect regionToDecode = computeRegionToDecode(encodedImage, options);<NEW_LINE>CloseableReference<Bitmap> decodedBitmapReference = mPlatformDecoder.decodeJPEGFromEncodedImageWithColorSpace(encodedImage, options.bitmapConfig, regionToDecode, length, options.colorSpace);<NEW_LINE>try {<NEW_LINE>boolean didApplyTransformation = TransformationUtils.maybeApplyTransformation(options.bitmapTransformation, decodedBitmapReference);<NEW_LINE>CloseableStaticBitmap closeableStaticBitmap = new CloseableStaticBitmap(decodedBitmapReference, ImmutableQualityInfo.FULL_QUALITY, encodedImage.getRotationAngle(), encodedImage.getExifOrientation());<NEW_LINE>closeableStaticBitmap.setImageExtra("is_rounded", <MASK><NEW_LINE>return closeableStaticBitmap;<NEW_LINE>} finally {<NEW_LINE>CloseableReference.closeSafely(decodedBitmapReference);<NEW_LINE>}<NEW_LINE>}
didApplyTransformation && options.bitmapTransformation instanceof CircularTransformation);
1,395,848
private void parseRouteStrategies(ClusterConfigImpl clusterConfig, Node routeStrategiesNode) {<NEW_LINE>List<Node> routeStrategyNodes = getRouteStrategyNodes(routeStrategiesNode);<NEW_LINE>if (routeStrategyNodes.size() > 1)<NEW_LINE>throw new ClusterRuntimeException("multiple routeStrategies configured");<NEW_LINE>if (routeStrategyNodes.size() == 1) {<NEW_LINE>Node routeStrategyNode = routeStrategyNodes.get(0);<NEW_LINE>DefaultClusterRouteStrategyConfig routeStrategyConfig = new DefaultClusterRouteStrategyConfig(routeStrategyNode.getNodeName());<NEW_LINE>List<Node> propertyNodes = getChildNodes(routeStrategyNode, PROPERTY);<NEW_LINE>propertyNodes.forEach(node -> {<NEW_LINE>String propertyName = getAttribute(node, NAME);<NEW_LINE>String <MASK><NEW_LINE>if (propertyName != null && propertyValue != null)<NEW_LINE>routeStrategyConfig.setProperty(propertyName, propertyValue);<NEW_LINE>});<NEW_LINE>clusterConfig.setRouteStrategyConfig(routeStrategyConfig);<NEW_LINE>}<NEW_LINE>}
propertyValue = getAttribute(node, VALUE);
413,476
final DeleteBGPPeerResult executeDeleteBGPPeer(DeleteBGPPeerRequest deleteBGPPeerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBGPPeerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBGPPeerRequest> request = null;<NEW_LINE>Response<DeleteBGPPeerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBGPPeerRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBGPPeer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBGPPeerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBGPPeerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(deleteBGPPeerRequest));
968,968
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String accountName = Utils.getValueFromIdByName(id, "netAppAccounts");<NEW_LINE>if (accountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id)));<NEW_LINE>}<NEW_LINE>String poolName = Utils.getValueFromIdByName(id, "capacityPools");<NEW_LINE>if (poolName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id)));<NEW_LINE>}<NEW_LINE>String volumeName = Utils.getValueFromIdByName(id, "volumes");<NEW_LINE>if (volumeName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String backupName = Utils.getValueFromIdByName(id, "backups");<NEW_LINE>if (backupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backups'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, accountName, poolName, volumeName, backupName, Context.NONE);<NEW_LINE>}
format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id)));
238,840
public void run() {<NEW_LINE>LOGGER.info("begin to read dump file.");<NEW_LINE>TraceManager.TraceObject traceObject = TraceManager.threadTrace("dump-file-read");<NEW_LINE>try {<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(fileConfig.getBufferSize());<NEW_LINE>int byteRead = fileChannel.read(buffer);<NEW_LINE>while (byteRead != -1) {<NEW_LINE>readLength += byteRead;<NEW_LINE>float percent = ((float) readLength <MASK><NEW_LINE>if (((int) percent) - readPercent > 5 || (int) percent == 100) {<NEW_LINE>readPercent = (int) percent;<NEW_LINE>LOGGER.info("dump file has bean read " + readPercent + "%");<NEW_LINE>}<NEW_LINE>String stmts = new String(buffer.array(), 0, byteRead, StandardCharsets.UTF_8);<NEW_LINE>this.handleQueue.put(stmts);<NEW_LINE>buffer.clear();<NEW_LINE>byteRead = fileChannel.read(buffer);<NEW_LINE>}<NEW_LINE>this.handleQueue.put(EOF);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("dump file exception", e);<NEW_LINE>errorFlag.compareAndSet(false, true);<NEW_LINE>errorMap.putIfAbsent("file reader exception", "reader exception,because:" + e.getMessage());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.debug("dump file reader is interrupted.");<NEW_LINE>} catch (Error e) {<NEW_LINE>LOGGER.warn("dump file error", e);<NEW_LINE>errorFlag.compareAndSet(false, true);<NEW_LINE>errorMap.putIfAbsent("file reader error", "reader error,because:" + e.getMessage());<NEW_LINE>} finally {<NEW_LINE>TraceManager.finishSpan(traceObject);<NEW_LINE>try {<NEW_LINE>if (fileChannel != null) {<NEW_LINE>fileChannel.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>LOGGER.warn("close dump file error:" + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
/ (float) fileLength) * 100;
1,820,850
public com.amazonaws.services.codecommit.model.InvalidRevisionIdException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.InvalidRevisionIdException invalidRevisionIdException = new com.amazonaws.services.codecommit.model.InvalidRevisionIdException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidRevisionIdException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
514,745
public void enterCip_transform_set(Cip_transform_setContext ctx) {<NEW_LINE>if (_currentIpsecTransformSet != null) {<NEW_LINE>throw new BatfishException("IpsecTransformSet should be null!");<NEW_LINE>}<NEW_LINE>_currentIpsecTransformSet = new IpsecTransformSet(<MASK><NEW_LINE>_configuration.defineStructure(IPSEC_TRANSFORM_SET, ctx.name.getText(), ctx);<NEW_LINE>if (ctx.ipsec_encryption() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm(ctx.ipsec_encryption()));<NEW_LINE>} else if (ctx.ipsec_encryption_aruba() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm(ctx.ipsec_encryption_aruba()));<NEW_LINE>}<NEW_LINE>// If any encryption algorithm was set then ESP protocol is used<NEW_LINE>if (_currentIpsecTransformSet.getEncryptionAlgorithm() != null) {<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(IpsecProtocol.ESP);<NEW_LINE>}<NEW_LINE>if (ctx.ipsec_authentication() != null) {<NEW_LINE>_currentIpsecTransformSet.setAuthenticationAlgorithm(toIpsecAuthenticationAlgorithm(ctx.ipsec_authentication()));<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(toProtocol(ctx.ipsec_authentication()));<NEW_LINE>}<NEW_LINE>}
ctx.name.getText());
1,480,091
private HttpResponse reindex(String tenantName, String applicationName, String instanceName, String environment, String region, HttpRequest request) {<NEW_LINE>ApplicationId id = ApplicationId.from(tenantName, applicationName, instanceName);<NEW_LINE>ZoneId zone = requireZone(environment, region);<NEW_LINE>List<String> clusterNames = Optional.ofNullable(request.getProperty("clusterId")).stream().flatMap(clusters -> Stream.of(clusters.split(","))).filter(cluster -> !cluster.isBlank()).collect(toUnmodifiableList());<NEW_LINE>List<String> documentTypes = Optional.ofNullable(request.getProperty("documentType")).stream().flatMap(types -> Stream.of(types.split(","))).filter(type -> !type.isBlank()).collect(toUnmodifiableList());<NEW_LINE>Double speed = request.hasProperty("speed") ? Double.parseDouble(request.getProperty("speed")) : null;<NEW_LINE>boolean <MASK><NEW_LINE>controller.applications().reindex(id, zone, clusterNames, documentTypes, indexedOnly, speed);<NEW_LINE>return new MessageResponse("Requested reindexing of " + id + " in " + zone + (clusterNames.isEmpty() ? "" : ", on clusters " + String.join(", ", clusterNames)) + (documentTypes.isEmpty() ? "" : ", for types " + String.join(", ", documentTypes)) + (indexedOnly ? ", for indexed types" : "") + (speed != null ? ", with speed " + speed : ""));<NEW_LINE>}
indexedOnly = request.getBooleanProperty("indexedOnly");
1,474,826
public static SqlParameterized parameterize(ByteString sql, SQLStatement statement, Map<Integer, ParameterContext> parameters, ExecutionContext executionContext, boolean forPrepare) {<NEW_LINE>// prepare mode<NEW_LINE>if (parameters != null && parameters.size() > 0) {<NEW_LINE>List<Object> <MASK><NEW_LINE>ParamCountVisitor paramCountVisitor = new ParamCountVisitor();<NEW_LINE>statement.accept(paramCountVisitor);<NEW_LINE>int parameterCount = paramCountVisitor.getParameterCount();<NEW_LINE>for (int i = 0; i < parameterCount; i++) {<NEW_LINE>tmpParameters.add(parameters.get(i + 1).getValue());<NEW_LINE>}<NEW_LINE>// by hongxi.chx<NEW_LINE>// Use the original sql instead of parameterized sql. Because<NEW_LINE>// the order of parameters corresponds to the original sql. For<NEW_LINE>// example, originalSql = 'select * from tb limit ? offset ?',<NEW_LINE>// params = '10, 20', parameterizedSql = 'select * from tb limit ?, ?'.<NEW_LINE>return SqlParameterizeUtils.parameterizeStmt(statement, sql, executionContext, tmpParameters);<NEW_LINE>} else {<NEW_LINE>// Executing prepare statement should use the same parameterization as common queries<NEW_LINE>// Use the original sql in prepare phase<NEW_LINE>// so that it can hit cache with the same cache key in execute phase<NEW_LINE>return SqlParameterizeUtils.parameterizeStmt(statement, sql, executionContext);<NEW_LINE>}<NEW_LINE>}
tmpParameters = new ArrayList<>();
124,208
public void marshall(GetTableObjectsRequest getTableObjectsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getTableObjectsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getDatabaseName(), DATABASENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getTransactionId(), TRANSACTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getQueryAsOfTime(), QUERYASOFTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getPartitionPredicate(), PARTITIONPREDICATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTableObjectsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getTableObjectsRequest.getCatalogId(), CATALOGID_BINDING);
1,455,401
private static void printClassBinding(PrintStream stream, Map<String, String> javaNamesToDisplayNames, PainlessContextClassBindingInfo classBindingInfo) {<NEW_LINE>stream.print("* " + ContextGeneratorCommon.getType(javaNamesToDisplayNames, classBindingInfo.getRtn()) + " " + <MASK><NEW_LINE>for (int parameterIndex = 0; parameterIndex < classBindingInfo.getParameters().size(); ++parameterIndex) {<NEW_LINE>// temporary fix to not print org.elasticsearch.script.ScoreScript parameter until<NEW_LINE>// class instance bindings are created and the information is appropriately added to the context info classes<NEW_LINE>if ("org.elasticsearch.script.ScoreScript".equals(ContextGeneratorCommon.getType(javaNamesToDisplayNames, classBindingInfo.getParameters().get(parameterIndex)))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>stream.print(ContextGeneratorCommon.getType(javaNamesToDisplayNames, classBindingInfo.getParameters().get(parameterIndex)));<NEW_LINE>if (parameterIndex < classBindingInfo.getReadOnly()) {<NEW_LINE>stream.print(" *");<NEW_LINE>}<NEW_LINE>if (parameterIndex + 1 < classBindingInfo.getParameters().size()) {<NEW_LINE>stream.print(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stream.println(")");<NEW_LINE>}
classBindingInfo.getName() + "(");
1,566,167
private static OspfInterAreaRoute jsonCreator(@Nullable @JsonProperty(PROP_NETWORK) Prefix network, @Nullable @JsonProperty(PROP_NEXT_HOP_IP) Ip nextHopIp, @Nullable @JsonProperty(PROP_NEXT_HOP_INTERFACE) String nextHopInterface, @Nullable @JsonProperty(PROP_ADMINISTRATIVE_COST) Integer admin, @Nullable @JsonProperty(PROP_METRIC) Long metric, @Nullable @JsonProperty(PROP_AREA) Long area, @JsonProperty(PROP_TAG) long tag) {<NEW_LINE>checkArgument(network != null, "%s must be specified", PROP_NETWORK);<NEW_LINE>checkArgument(nextHopIp != null, "%s must be specified", PROP_NEXT_HOP_IP);<NEW_LINE>checkArgument(admin != null, "%s must be specified", PROP_ADMINISTRATIVE_COST);<NEW_LINE>checkArgument(metric != null, "%s must be specified", PROP_METRIC);<NEW_LINE>checkArgument(area != null, "%s must be specified", PROP_AREA);<NEW_LINE>return new OspfInterAreaRoute(network, NextHop.legacyConverter(nextHopInterface, nextHopIp), admin, metric, <MASK><NEW_LINE>}
area, tag, false, false);
153,887
public List<Reader> split(JobProfile jobConf) {<NEW_LINE>String inlongGroupId = jobConf.get(PROXY_INLONG_GROUP_ID, DEFAULT_PROXY_INLONG_GROUP_ID);<NEW_LINE>String inlongStreamId = jobConf.get(PROXY_INLONG_STREAM_ID, DEFAULT_PROXY_INLONG_STREAM_ID);<NEW_LINE>String metricTagName = TEXT_FILE_SOURCE_TAG_NAME + "_" + inlongGroupId + "_" + inlongStreamId;<NEW_LINE>Collection<File> <MASK><NEW_LINE>List<Reader> result = new ArrayList<>();<NEW_LINE>String filterPattern = jobConf.get(JOB_LINE_FILTER_PATTERN, DEFAULT_JOB_LINE_FILTER);<NEW_LINE>for (File file : allFiles) {<NEW_LINE>int startPosition = getStartPosition(jobConf, file);<NEW_LINE>LOGGER.info("read from history position {} with job profile {}, file absolute path: {}", startPosition, jobConf.getInstanceId(), file.getAbsolutePath());<NEW_LINE>TextFileReader textFileReader = new TextFileReader(file, startPosition);<NEW_LINE>long waitTimeout = jobConf.getLong(JOB_READ_WAIT_TIMEOUT, DEFAULT_JOB_READ_WAIT_TIMEOUT);<NEW_LINE>textFileReader.setWaitMillisecond(waitTimeout);<NEW_LINE>addValidator(filterPattern, textFileReader);<NEW_LINE>result.add(textFileReader);<NEW_LINE>}<NEW_LINE>// increment the count of successful sources<NEW_LINE>GLOBAL_METRICS.incSourceSuccessCount(metricTagName);<NEW_LINE>return result;<NEW_LINE>}
allFiles = PluginUtils.findSuitFiles(jobConf);
7,457
public void testSimpleQueryWhenUnableToSerializeEntity(HttpServletRequest req, HttpServletResponse resp) throws Exception {<NEW_LINE>QueryClient client = builder.build(QueryClient.class);<NEW_LINE>Query query = new Query();<NEW_LINE>query.setOperationName("allWidgetsUnableToSerialize");<NEW_LINE>query.setQuery("query allWidgetsUnableToSerialize {" + System.lineSeparator() + " allWidgetsUnableToSerialize {" + System.lineSeparator() + " name," + System.lineSeparator() + " quantity" + System.lineSeparator() + " }" + System.lineSeparator() + "}");<NEW_LINE>WidgetQueryResponse response = client.allWidgets(query);<NEW_LINE>System.out.println("Response: " + response);<NEW_LINE>// check partial (null) results:<NEW_LINE>List<Widget> widgets = response<MASK><NEW_LINE>assertEquals(1, widgets.size());<NEW_LINE>assertNull(widgets.get(0));<NEW_LINE>// check error message<NEW_LINE>List<Error> errors = response.getErrors();<NEW_LINE>assertEquals(1, errors.size());<NEW_LINE>Error e = errors.get(0);<NEW_LINE>assertTrue(e.getMessage().contains("Server Error"));<NEW_LINE>}
.getData().getAllWidgets();
1,036,836
public void keyIds(PrfSetKeyIdsRequest request, StreamObserver<PrfSetKeyIdsResponse> responseObserver) {<NEW_LINE>PrfSetKeyIdsResponse response;<NEW_LINE>try {<NEW_LINE>KeysetHandle keysetHandle = CleartextKeysetHandle.read(BinaryKeysetReader.withBytes(request.getKeyset().toByteArray()));<NEW_LINE>PrfSet prfSet = keysetHandle.getPrimitive(PrfSet.class);<NEW_LINE>PrfSetKeyIdsResponse.Output output = PrfSetKeyIdsResponse.Output.newBuilder().setPrimaryKeyId(prfSet.getPrimaryId()).addAllKeyId(prfSet.getPrfs().keySet()).build();<NEW_LINE>response = PrfSetKeyIdsResponse.newBuilder().setOutput(output).build();<NEW_LINE>} catch (GeneralSecurityException | InvalidProtocolBufferException e) {<NEW_LINE>response = PrfSetKeyIdsResponse.newBuilder().setErr(e.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>responseObserver.onError(Status.UNKNOWN.withDescription(e.getMessage()).asException());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseObserver.onNext(response);<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}
toString()).build();
649,647
public Answer cloneVolumeFromBaseTemplate(final CopyCommand cmd) {<NEW_LINE>final Connection conn = hypervisorResource.getConnection();<NEW_LINE>final DataTO srcData = cmd.getSrcTO();<NEW_LINE>final DataTO destData = cmd.getDestTO();<NEW_LINE>final VolumeObjectTO volume = (VolumeObjectTO) destData;<NEW_LINE>VDI vdi = null;<NEW_LINE>try {<NEW_LINE>VDI tmpltvdi = null;<NEW_LINE>tmpltvdi = getVDIbyUuid(conn, srcData.getPath());<NEW_LINE>vdi = tmpltvdi.createClone(conn, new HashMap<String, String>());<NEW_LINE>Long virtualSize = vdi.getVirtualSize(conn);<NEW_LINE>if (volume.getSize() > virtualSize) {<NEW_LINE>s_logger.debug("Overriding provided template's size with new size " + toHumanReadableSize(volume.getSize()) + " for volume: " + volume.getName());<NEW_LINE>vdi.resize(conn, volume.getSize());<NEW_LINE>} else {<NEW_LINE>s_logger.debug("Using templates disk size of " + toHumanReadableSize(virtualSize) + " for volume: " + volume.getName() + " since size passed was " + toHumanReadableSize(volume.getSize()));<NEW_LINE>}<NEW_LINE>vdi.setNameLabel(conn, volume.getName());<NEW_LINE>VDI.Record vdir;<NEW_LINE>vdir = vdi.getRecord(conn);<NEW_LINE>s_logger.debug("Successfully created VDI: Uuid = " + vdir.uuid);<NEW_LINE>final VolumeObjectTO newVol = new VolumeObjectTO();<NEW_LINE>newVol.setName(vdir.nameLabel);<NEW_LINE>newVol.setSize(vdir.virtualSize);<NEW_LINE>newVol.setPath(vdir.uuid);<NEW_LINE>return new CopyCmdAnswer(newVol);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.warn("Unable to create volume; Pool=" + destData + "; Disk: ", e);<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>}
CopyCmdAnswer(e.toString());
1,485,082
protected void compute() {<NEW_LINE>if (endPos <= startPos) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (endPos - startPos <= 1) {<NEW_LINE>try {<NEW_LINE>convertPartitions(modelPath, modelFs, convertedModelPath, convertedModelFs, lineConvert, groupByParts.get(startPos), meta);<NEW_LINE>} catch (Throwable x) {<NEW_LINE>LOG.error("convert model partitions failed.", x);<NEW_LINE>errorMsgs.add("convert model partitions failed." + x.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int middle = (startPos + endPos) / 2;<NEW_LINE>ConvertOp opLeft = new ConvertOp(modelPath, modelFs, convertedModelPath, convertedModelFs, lineConvert, groupByParts, meta, errorMsgs, startPos, middle);<NEW_LINE>ConvertOp opRight = new ConvertOp(modelPath, modelFs, convertedModelPath, convertedModelFs, lineConvert, groupByParts, <MASK><NEW_LINE>invokeAll(opLeft, opRight);<NEW_LINE>}<NEW_LINE>}
meta, errorMsgs, middle, endPos);
828,644
public Object importMoveLine(Object bean, Map<String, Object> values) throws AxelorException {<NEW_LINE>assert bean instanceof MoveLine;<NEW_LINE>MoveLine moveLine = (MoveLine) bean;<NEW_LINE>String accountId = (String) values.get("account_importId");<NEW_LINE>Account account = getAccount(accountId);<NEW_LINE>if (account != null) {<NEW_LINE>moveLine.setAccountCode(account.getCode());<NEW_LINE>moveLine.setAccountName(account.getName());<NEW_LINE>} else {<NEW_LINE>moveLine.setAccountCode((String) values.get("accountCode"));<NEW_LINE>moveLine.setAccountName((String) values.get("accountName"));<NEW_LINE>}<NEW_LINE>String taxLineId = (String) values.get("taxLine_importId");<NEW_LINE>TaxLine taxLine = getTaxLine(taxLineId);<NEW_LINE>if (taxLine != null) {<NEW_LINE>moveLine.setTaxCode(taxLine.getTax().getCode());<NEW_LINE>moveLine.setTaxRate(taxLine.getValue());<NEW_LINE>} else {<NEW_LINE>moveLine.setTaxCode((String) values.get("taxCode"));<NEW_LINE>moveLine.setTaxRate(new BigDecimal((String) values.get("taxRate")));<NEW_LINE>}<NEW_LINE>String partnerId = (String) values.get("partner_importId");<NEW_LINE>Partner partner = getPartner(partnerId);<NEW_LINE>if (partner != null) {<NEW_LINE>moveLine.setPartnerSeq(partner.getPartnerSeq());<NEW_LINE>moveLine.setPartnerFullName(partner.getFullName());<NEW_LINE>} else {<NEW_LINE>moveLine.setPartnerSeq((String) values.get("partnerSeq"));<NEW_LINE>moveLine.setPartnerFullName((String<MASK><NEW_LINE>}<NEW_LINE>moveLineRepository.save(moveLine);<NEW_LINE>return moveLine;<NEW_LINE>}
) values.get("partnerFullName"));
724,592
public Dimension render(Graphics2D graphics) {<NEW_LINE>ClueScroll clue = plugin.getClue();<NEW_LINE>if (clue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>clue.makeOverlayHint(panelComponent, plugin);<NEW_LINE>final Item[] inventoryItems = plugin.getInventoryItems();<NEW_LINE>final Item[] equippedItems = plugin.getEquippedItems();<NEW_LINE>if (clue.isRequiresSpade() && inventoryItems != null) {<NEW_LINE>if (!HAS_SPADE.fulfilledBy(inventoryItems)) {<NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left("").build());<NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clue.isRequiresLight() && ((clue.getHasFirePit() == null || client.getVar(clue.getHasFirePit()) != 1) && (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems)) && (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems)))) {<NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left("").build());<NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left("Requires Light Source!").leftColor(Color.RED).build());<NEW_LINE>}<NEW_LINE>if (clue.getEnemy() != null) {<NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left<MASK><NEW_LINE>panelComponent.getChildren().add(LineComponent.builder().left(clue.getEnemy().getText()).leftColor(Color.YELLOW).build());<NEW_LINE>}<NEW_LINE>return super.render(graphics);<NEW_LINE>}
("").build());
328,220
public UDSize calculateSize(float mw) {<NEW_LINE>int maxWidth = DimenUtil.dpiToPx(mw);<NEW_LINE>if (maxWidth < 0) {<NEW_LINE>if (MLSEngine.DEBUG) {<NEW_LINE>IllegalArgumentException e = new IllegalArgumentException("max width must be more than 0");<NEW_LINE>if (!Environment.hook(e, getGlobals())) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastSize == null) {<NEW_LINE>lastSize = new UDSize(globals, new Size());<NEW_LINE>lastSize.onJavaRef();<NEW_LINE>}<NEW_LINE>return lastSize;<NEW_LINE>}<NEW_LINE>if (layout != null && lastMaxWidth == maxWidth && !changeText && !changeSizePan) {<NEW_LINE>return lastSize;<NEW_LINE>}<NEW_LINE>if (lastSize == null) {<NEW_LINE>lastSize = new UDSize(globals, new Size());<NEW_LINE>lastSize.onJavaRef();<NEW_LINE>}<NEW_LINE>lastMaxWidth = maxWidth;<NEW_LINE>changeText = false;<NEW_LINE>changeSizePan = false;<NEW_LINE>if (sizeSpan != null) {<NEW_LINE>caculatePaint.setTextSize(sizeSpan.getSize());<NEW_LINE>}<NEW_LINE>layout = new StaticLayout(text, caculatePaint, maxWidth, Layout.Alignment.<MASK><NEW_LINE>int size = layout.getLineCount();<NEW_LINE>float r = 0;<NEW_LINE>float temp;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (r < (temp = layout.getLineWidth(i))) {<NEW_LINE>r = temp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>float dp = DimenUtil.pxToDpi(r);<NEW_LINE>int w = (int) Math.ceil(dp);<NEW_LINE>int h = (int) Math.ceil(DimenUtil.pxToDpi(layout.getHeight()));<NEW_LINE>lastSize.setWidth(w);<NEW_LINE>lastSize.setHeight(h);<NEW_LINE>return lastSize;<NEW_LINE>}
ALIGN_NORMAL, 1, 0, true);
568,597
public void unregisterQuery(TUniqueId queryId) {<NEW_LINE>QueryInfo <MASK><NEW_LINE>if (queryInfo != null) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("deregister query id {}", DebugUtil.printId(queryId));<NEW_LINE>}<NEW_LINE>if (queryInfo.getConnectContext() != null && !Strings.isNullOrEmpty(queryInfo.getConnectContext().getQualifiedUser())) {<NEW_LINE>Integer num = queryToInstancesNum.remove(queryId);<NEW_LINE>if (num != null) {<NEW_LINE>String user = queryInfo.getConnectContext().getQualifiedUser();<NEW_LINE>AtomicInteger instancesNum = userToInstancesCount.get(user);<NEW_LINE>if (instancesNum == null) {<NEW_LINE>LOG.warn("WTF?? query {} in queryToInstancesNum but not in userToInstancesCount", DebugUtil.printId(queryId));<NEW_LINE>} else {<NEW_LINE>instancesNum.addAndGet(-num);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn("not found query {} when unregisterQuery", DebugUtil.printId(queryId));<NEW_LINE>}<NEW_LINE>}
queryInfo = coordinatorMap.remove(queryId);
1,102,145
protected void processProgramVars() {<NEW_LINE>if (program.getLanguage().getProcessor() == Processor.findOrPossiblyCreateProcessor("PowerPC")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SymbolTable symbolTable = program.getSymbolTable();<NEW_LINE>int defaultPointerSize = program.getDefaultPointerSize();<NEW_LINE>DataType intDataType = (defaultPointerSize == 8) ? new QWordDataType() : new DWordDataType();<NEW_LINE>// int *<NEW_LINE>DataType intPointerDataType = PointerDataType.getPointer(intDataType, defaultPointerSize);<NEW_LINE>// void *<NEW_LINE>DataType // void *<NEW_LINE>voidPointerDatatype = PointerDataType.getPointer(new VoidDataType(), defaultPointerSize);<NEW_LINE>// char *<NEW_LINE>DataType // char *<NEW_LINE>charPointerX1DataType = PointerDataType.getPointer(new CharDataType(), defaultPointerSize);<NEW_LINE>// char **<NEW_LINE>DataType // char **<NEW_LINE>charPointerX2DataType = PointerDataType.getPointer(charPointerX1DataType, defaultPointerSize);<NEW_LINE>// char ***<NEW_LINE>DataType // char ***<NEW_LINE>charPointerX3DataType = <MASK><NEW_LINE>Structure structure = new StructureDataType(SectionNames.PROGRAM_VARS, 0);<NEW_LINE>structure.add(voidPointerDatatype, "mh", "pointer to __mh_execute_header");<NEW_LINE>structure.add(intPointerDataType, "NXArgcPtr", "pointer to argc");<NEW_LINE>structure.add(charPointerX3DataType, "NXArgvPtr", "pointer to argv");<NEW_LINE>structure.add(charPointerX3DataType, "environPtr", "pointer to environment");<NEW_LINE>structure.add(charPointerX2DataType, "__prognamePtr", "pointer to program name");<NEW_LINE>Namespace namespace = createNamespace(SectionNames.PROGRAM_VARS);<NEW_LINE>List<Section> sections = machoHeader.getAllSections();<NEW_LINE>for (Section section : sections) {<NEW_LINE>if (section.getSectionName().equals(SectionNames.PROGRAM_VARS)) {<NEW_LINE>MemoryBlock memoryBlock = getMemoryBlock(section);<NEW_LINE>try {<NEW_LINE>listing.createData(memoryBlock.getStart(), structure);<NEW_LINE>Data data = listing.getDataAt(memoryBlock.getStart());<NEW_LINE>Data mhData = data.getComponent(0);<NEW_LINE>if (symbolTable.getSymbol("__mh_execute_header", mhData.getAddress(0), namespace) == null) {<NEW_LINE>symbolTable.createLabel(mhData.getAddress(0), "__mh_execute_header", namespace, SourceType.IMPORTED);<NEW_LINE>}<NEW_LINE>Data argcData = data.getComponent(1);<NEW_LINE>symbolTable.createLabel(argcData.getAddress(0), "NXArgc", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(argcData.getAddress(0), intDataType);<NEW_LINE>Data argvData = data.getComponent(2);<NEW_LINE>symbolTable.createLabel(argvData.getAddress(0), "NXArgv", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(argvData.getAddress(0), charPointerX2DataType);<NEW_LINE>Data environData = data.getComponent(3);<NEW_LINE>symbolTable.createLabel(environData.getAddress(0), "environ", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(environData.getAddress(0), charPointerX2DataType);<NEW_LINE>Data prognameData = data.getComponent(4);<NEW_LINE>symbolTable.createLabel(prognameData.getAddress(0), "__progname", namespace, SourceType.IMPORTED);<NEW_LINE>listing.createData(prognameData.getAddress(0), charPointerX1DataType);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendException(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PointerDataType.getPointer(charPointerX2DataType, defaultPointerSize);
739,601
private IExtractor<ResourceIndexedSearchParamString> createStringExtractor(IBaseResource theResource) {<NEW_LINE>return (params, searchParam, value, path, theWantLocalReferences) -> {<NEW_LINE>String resourceType = toRootTypeName(theResource);<NEW_LINE>if (value instanceof IPrimitiveType) {<NEW_LINE>IPrimitiveType<?> nextValue = (IPrimitiveType<?>) value;<NEW_LINE>String valueAsString = nextValue.getValueAsString();<NEW_LINE>createStringIndexIfNotBlank(resourceType, params, searchParam, valueAsString);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String nextType = toRootTypeName(value);<NEW_LINE>switch(nextType) {<NEW_LINE>case "HumanName":<NEW_LINE>addString_HumanName(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Address":<NEW_LINE>addString_Address(<MASK><NEW_LINE>break;<NEW_LINE>case "ContactPoint":<NEW_LINE>addString_ContactPoint(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Quantity":<NEW_LINE>addString_Quantity(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>case "Range":<NEW_LINE>addString_Range(resourceType, params, searchParam, value);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>addUnexpectedDatatypeWarning(params, searchParam, value);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
resourceType, params, searchParam, value);
1,742,449
private T waitUntilScaled(final int count) {<NEW_LINE>final AtomicReference<Integer> replicasRef = new AtomicReference<>(0);<NEW_LINE>final String name = checkName(getItem());<NEW_LINE>final String namespace = checkNamespace(getItem());<NEW_LINE>try {<NEW_LINE>return waitUntilCondition(t -> {<NEW_LINE>// If the resource is gone, we shouldn't wait.<NEW_LINE>if (t == null) {<NEW_LINE>if (count == 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Can't wait for " + getType().getSimpleName() + ": " + name + " in namespace: " + namespace + " to scale. Resource is no longer available.");<NEW_LINE>}<NEW_LINE>int currentReplicas = getCurrentReplicas(t);<NEW_LINE>int desiredReplicas = getDesiredReplicas(t);<NEW_LINE>replicasRef.set(currentReplicas);<NEW_LINE>long generation = t.getMetadata().getGeneration() != null ? t.getMetadata(<MASK><NEW_LINE>long observedGeneration = getObservedGeneration(t);<NEW_LINE>if (observedGeneration >= generation && Objects.equals(desiredReplicas, currentReplicas)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Log.debug("Only {}/{} replicas scheduled for {}: {} in namespace: {} seconds so waiting...", currentReplicas, desiredReplicas, t.getKind(), t.getMetadata().getName(), namespace);<NEW_LINE>return false;<NEW_LINE>}, getConfig().getScaleTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>} catch (KubernetesClientTimeoutException e) {<NEW_LINE>Log.error("{}/{} pod(s) ready for {}: {} in namespace: {} after waiting for {} seconds so giving up", replicasRef.get(), count, getType().getSimpleName(), name, namespace, TimeUnit.MILLISECONDS.toSeconds(getConfig().getScaleTimeout()));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
).getGeneration() : -1;
688,555
private boolean handleEvict(HasMetadata eviction) {<NEW_LINE>try {<NEW_LINE>if (Utils.isNullOrEmpty(eviction.getMetadata().getNamespace())) {<NEW_LINE>throw new KubernetesClientException("Namespace not specified, but operation requires it.");<NEW_LINE>}<NEW_LINE>if (Utils.isNullOrEmpty(eviction.getMetadata().getName())) {<NEW_LINE>throw new KubernetesClientException("Name not specified, but operation requires it.");<NEW_LINE>}<NEW_LINE>URL requestUrl = new URL(URLUtils.join(getResourceUrl().toString(), "eviction"));<NEW_LINE>HttpRequest.Builder requestBuilder = httpClient.newHttpRequestBuilder().post(JSON, JSON_MAPPER.writeValueAsString(eviction)).url(requestUrl);<NEW_LINE>handleResponse(requestBuilder, null);<NEW_LINE>return true;<NEW_LINE>} catch (KubernetesClientException e) {<NEW_LINE>if (e.getCode() != HTTP_TOO_MANY_REQUESTS) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (IOException exception) {<NEW_LINE>throw KubernetesClientException.launderThrowable(forOperationType("evict"), exception);<NEW_LINE>} catch (InterruptedException interruptedException) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw KubernetesClientException.launderThrowable<MASK><NEW_LINE>}<NEW_LINE>}
(forOperationType("evict"), interruptedException);
49,030
private JComponent createToolbar() {<NEW_LINE>JPanel toolBarPanel = new JPanel(new GridLayout());<NEW_LINE>DefaultActionGroup leftGroup = new DefaultActionGroup();<NEW_LINE>leftGroup.add(ActionManager.getInstance().getAction(RUN_DASHBOARD_TOOLBAR));<NEW_LINE>// TODO [konstantin.aleev] provide context help ID<NEW_LINE>// leftGroup.add(new Separator());<NEW_LINE>// leftGroup.add(new ContextHelpAction(HELP_ID));<NEW_LINE>ActionToolbar leftActionToolBar = ActionManager.getInstance().createActionToolbar(PLACE_TOOLBAR, leftGroup, false);<NEW_LINE>toolBarPanel.add(leftActionToolBar.getComponent());<NEW_LINE>myTree.putClientProperty(DataManager.CLIENT_PROPERTY_DATA_PROVIDER, new DataProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getData(@Nonnull @NonNls Key dataId) {<NEW_LINE>if (KEY == dataId) {<NEW_LINE>return RunDashboardContent.this;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>leftActionToolBar.setTargetComponent(myTree);<NEW_LINE>DefaultActionGroup rightGroup = new DefaultActionGroup();<NEW_LINE>TreeExpander treeExpander = new DefaultTreeExpander(myTree);<NEW_LINE>AnAction expandAllAction = CommonActionsManager.getInstance().createExpandAllAction(treeExpander, this);<NEW_LINE>rightGroup.add(expandAllAction);<NEW_LINE>AnAction collapseAllAction = CommonActionsManager.getInstance().createCollapseAllAction(treeExpander, this);<NEW_LINE>rightGroup.add(collapseAllAction);<NEW_LINE>rightGroup.add(new AnSeparator());<NEW_LINE>myGroupers.stream().filter(grouper -> !grouper.getRule().isAlwaysEnabled()).forEach(grouper -> rightGroup.add(new GroupAction(grouper)));<NEW_LINE>ActionToolbar rightActionToolBar = ActionManager.getInstance().createActionToolbar(PLACE_TOOLBAR, rightGroup, false);<NEW_LINE>toolBarPanel.<MASK><NEW_LINE>rightActionToolBar.setTargetComponent(myTree);<NEW_LINE>return toolBarPanel;<NEW_LINE>}
add(rightActionToolBar.getComponent());
1,256,381
public void explain(int p, ExplanationForSignedClause explanation) {<NEW_LINE>IntIterableRangeSet set;<NEW_LINE>int m;<NEW_LINE>if (explanation.readVar(p) == vars[0]) {<NEW_LINE>// case a. (see javadoc)<NEW_LINE>m = explanation.readDom(vars[1]).min();<NEW_LINE>set = explanation.complement(vars[1]);<NEW_LINE>set.retainBetween(IntIterableRangeSet.MIN, m - 1);<NEW_LINE>vars[0].intersectLit(IntIterableRangeSet.MIN, cste - m, explanation);<NEW_LINE>vars[1].unionLit(set, explanation);<NEW_LINE>} else {<NEW_LINE>// case b. (see javadoc)<NEW_LINE>assert explanation.readVar(p) == vars[1];<NEW_LINE>m = explanation.readDom(vars<MASK><NEW_LINE>set = explanation.complement(vars[0]);<NEW_LINE>set.retainBetween(IntIterableRangeSet.MIN, m - 1);<NEW_LINE>vars[0].unionLit(set, explanation);<NEW_LINE>vars[1].intersectLit(IntIterableRangeSet.MIN, cste - m, explanation);<NEW_LINE>}<NEW_LINE>}
[0]).min();
1,395,489
static MethodDeclaration createSetter(TypeDeclaration parent, boolean deprecate, EclipseNode fieldNode, String name, char[] paramName, char[] booleanFieldToSet, boolean shouldReturnThis, int modifier, EclipseNode sourceNode, List<Annotation> onMethod, List<Annotation> onParam) {<NEW_LINE>ASTNode source = sourceNode.get();<NEW_LINE>int pS = source<MASK><NEW_LINE>TypeReference returnType = null;<NEW_LINE>ReturnStatement returnThis = null;<NEW_LINE>if (shouldReturnThis) {<NEW_LINE>returnType = cloneSelfType(fieldNode, source);<NEW_LINE>addCheckerFrameworkReturnsReceiver(returnType, source, getCheckerFrameworkVersion(sourceNode));<NEW_LINE>ThisReference thisRef = new ThisReference(pS, pE);<NEW_LINE>returnThis = new ReturnStatement(thisRef, pS, pE);<NEW_LINE>}<NEW_LINE>MethodDeclaration d = createSetter(parent, deprecate, fieldNode, name, paramName, booleanFieldToSet, returnType, returnThis, modifier, sourceNode, onMethod, onParam);<NEW_LINE>return d;<NEW_LINE>}
.sourceStart, pE = source.sourceEnd;
1,719,730
public UpdateGatewayInformationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateGatewayInformationResult updateGatewayInformationResult = new UpdateGatewayInformationResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateGatewayInformationResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("GatewayArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateGatewayInformationResult.setGatewayArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateGatewayInformationResult;<NEW_LINE>}
class).unmarshall(context));
1,015,445
private List<JsonNode> followRefsIfAny(JsonNode referencableNode) {<NEW_LINE>List<JsonNode> results = new ArrayList<>();<NEW_LINE>if (referencableNode.has("$ref")) {<NEW_LINE>// Extract single reference.<NEW_LINE>String ref = referencableNode.path("$ref").asText();<NEW_LINE>results.add(spec.at(<MASK><NEW_LINE>} else {<NEW_LINE>// Check for multi-structures.<NEW_LINE>for (String structure : MULTI_STRUCTURES) {<NEW_LINE>if (referencableNode.has(structure) && referencableNode.path(structure).isArray()) {<NEW_LINE>ArrayNode arrayNode = (ArrayNode) referencableNode.path(structure);<NEW_LINE>for (int i = 0; i < arrayNode.size(); i++) {<NEW_LINE>JsonNode structureNode = arrayNode.get(i);<NEW_LINE>results.add(followRefIfAny(structureNode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If no reference found, put the node itself.<NEW_LINE>if (results.isEmpty()) {<NEW_LINE>results.add(referencableNode);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
ref.substring(1)));
974,987
public void removeTag(View view, final int position) {<NEW_LINE>LinearLayout rowFound = null;<NEW_LINE>for (int i = 0; i < getChildCount(); i++) {<NEW_LINE>final LinearLayout row = (LinearLayout) getChildAt(i);<NEW_LINE>if (row.findViewWithTag(getViewTag(mTagList.get(position).mTagId)) != null) {<NEW_LINE>rowFound = row;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final View v = rowFound.findViewWithTag(getViewTag(mTagList.<MASK><NEW_LINE>rowFound.removeView(v);<NEW_LINE>if (rowFound.getChildCount() > 0) {<NEW_LINE>animateScaleDownAndFadeOut(v, position);<NEW_LINE>rowFound.removeView(rowFound.findViewWithTag(getViewTag(mTagList.get(position).mTagId)));<NEW_LINE>} else {<NEW_LINE>removeView(rowFound);<NEW_LINE>}<NEW_LINE>}
get(position).mTagId));
1,708,071
private List<EmailWrapper> generateFeedbackSessionOpeningOrClosingEmails(FeedbackSessionAttributes session, EmailType emailType) {<NEW_LINE>CourseAttributes course = coursesLogic.getCourse(session.getCourseId());<NEW_LINE>boolean isEmailNeededForStudents = fsLogic.isFeedbackSessionForUserTypeToAnswer(session, false);<NEW_LINE>boolean isEmailNeededForInstructors = fsLogic.isFeedbackSessionForUserTypeToAnswer(session, true);<NEW_LINE>List<InstructorAttributes> instructorsToNotify = isEmailNeededForStudents ? instructorsLogic.getCoOwnersForCourse(session.getCourseId()) : new ArrayList<>();<NEW_LINE>List<StudentAttributes> students = isEmailNeededForStudents ? studentsLogic.getStudentsForCourse(session.getCourseId()<MASK><NEW_LINE>List<InstructorAttributes> instructors = isEmailNeededForInstructors ? instructorsLogic.getInstructorsForCourse(session.getCourseId()) : new ArrayList<>();<NEW_LINE>String status = emailType == EmailType.FEEDBACK_OPENING ? FEEDBACK_STATUS_SESSION_OPENING : FEEDBACK_STATUS_SESSION_CLOSING;<NEW_LINE>String template = EmailTemplates.USER_FEEDBACK_SESSION.replace("${status}", status);<NEW_LINE>return generateFeedbackSessionEmailBases(course, session, students, instructors, instructorsToNotify, template, emailType, FEEDBACK_ACTION_SUBMIT_EDIT_OR_VIEW);<NEW_LINE>}
) : new ArrayList<>();
1,064,166
private void jbInit() throws Exception {<NEW_LINE>this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);<NEW_LINE>this.setResizable(false);<NEW_LINE>this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>this.getContentPane().add(Box.createVerticalStrut(8), BorderLayout.NORTH);<NEW_LINE>this.getContentPane().add(Box.createHorizontalStrut(8), BorderLayout.WEST);<NEW_LINE>this.getContentPane().add(Box.createVerticalStrut(8), BorderLayout.SOUTH);<NEW_LINE>this.getContentPane().add(Box.createHorizontalStrut(8), BorderLayout.EAST);<NEW_LINE>mainPanel.setLayout(new BorderLayout(5, 5));<NEW_LINE>this.getContentPane().add(mainPanel, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>infoLabel.setFont(UIManager.getFont(MetasFreshTheme.KEY_Logo_TextFont));<NEW_LINE>infoLabel.setForeground(UIManager.getColor(MetasFreshTheme.KEY_Logo_TextColor));<NEW_LINE>infoLabel.setHorizontalAlignment(JLabel.CENTER);<NEW_LINE>infoLabel.setHorizontalTextPosition(JLabel.CENTER);<NEW_LINE>infoLabel.setVerticalTextPosition(JLabel.BOTTOM);<NEW_LINE>final <MASK><NEW_LINE>if (productLogoImage != null) {<NEW_LINE>infoLabel.setIcon(new ImageIcon(productLogoImage));<NEW_LINE>}<NEW_LINE>infoLabel.setIconTextGap(10);<NEW_LINE>mainPanel.add(infoLabel, BorderLayout.NORTH);<NEW_LINE>mainPanel.add(progressBar, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>// bDoNotWait.setText(Msg.getMsg(Env.getCtx(), "DoNotWait"));<NEW_LINE>// bDoNotWait.setToolTipText(Msg.getMsg(Env.getCtx(), "DoNotWaitInfo"));<NEW_LINE>// bDoNotWait.addActionListener(this);<NEW_LINE>// southPanel.setLayout(southLayout);<NEW_LINE>// southPanel.add(bDoNotWait, null);<NEW_LINE>// mainPanel.add(southPanel, BorderLayout.SOUTH);<NEW_LINE>}
Image productLogoImage = Adempiere.getProductLogoLarge();
240,182
private void decodeEscapes(BitReader _in, ICStream ics, int[][] scaleFactors) throws AACException {<NEW_LINE>final ICSInfo info = ics.getInfo();<NEW_LINE>final int windowGroupCount = info.getWindowGroupCount();<NEW_LINE>final int maxSFB = info.getMaxSFB();<NEW_LINE>// ics.getSectionData().getSfbCB();<NEW_LINE>final int[][] sfbCB = { {} };<NEW_LINE>final int <MASK><NEW_LINE>boolean noiseUsed = false;<NEW_LINE>int sfb, val;<NEW_LINE>for (int g = 0; g < windowGroupCount; g++) {<NEW_LINE>for (sfb = 0; sfb < maxSFB; sfb++) {<NEW_LINE>if (sfbCB[g][sfb] == HCB.NOISE_HCB && !noiseUsed)<NEW_LINE>noiseUsed = true;<NEW_LINE>else if (Math.abs(sfbCB[g][sfb]) == ESCAPE_FLAG) {<NEW_LINE>val = decodeHuffmanEscape(_in);<NEW_LINE>if (sfbCB[g][sfb] == -ESCAPE_FLAG)<NEW_LINE>scaleFactors[g][sfb] -= val;<NEW_LINE>else<NEW_LINE>scaleFactors[g][sfb] += val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
escapesLen = _in.readNBit(8);
1,190,052
protected int validate(FacesContext context, UIComponent source, UIComponent last, String expression) {<NEW_LINE>if (!(last instanceof UIData)) {<NEW_LINE>throw new FacesException("The last resolved component must be instance of UIData to support @row. Expression: \"" + expression + "\" referenced from \"" + last.getClientId(context) + "\".");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>int row = Integer.parseInt(matcher.group(1));<NEW_LINE>if (row < 0) {<NEW_LINE>throw new FacesException("Row number must be greater than 0. Expression: \"" + expression + "\"");<NEW_LINE>}<NEW_LINE>UIData data = (UIData) last;<NEW_LINE>if (data.getRowCount() < row + 1) {<NEW_LINE>throw new FacesException("The row count of the target is lesser than the row number. Expression: \"" + expression + "\"");<NEW_LINE>}<NEW_LINE>return row;<NEW_LINE>} else {<NEW_LINE>throw new FacesException("Expression does not match following pattern @row(n). Expression: \"" + expression + "\"");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new FacesException("Expression does not match following pattern @row(n). Expression: \"" + expression + "\"", e);<NEW_LINE>}<NEW_LINE>}
matcher = PATTERN.matcher(expression);
1,555,896
public void marshall(UpdateAnswerRequest updateAnswerRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateAnswerRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getWorkloadId(), WORKLOADID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getLensAlias(), LENSALIAS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getSelectedChoices(), SELECTEDCHOICES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getChoiceUpdates(), CHOICEUPDATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getNotes(), NOTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getIsApplicable(), ISAPPLICABLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAnswerRequest.getReason(), REASON_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateAnswerRequest.getQuestionId(), QUESTIONID_BINDING);
1,414,969
protected OJwtPayload deserializeWebPayload(final String type, final byte[] decodedPayload) {<NEW_LINE>if (!"OrientDB".equals(type)) {<NEW_LINE>throw new OSystemException("Payload class not registered:" + type);<NEW_LINE>}<NEW_LINE>final ODocument doc = new ODocument();<NEW_LINE>try {<NEW_LINE>doc.fromJSON(<MASK><NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw OException.wrapException(new OSystemException("Payload encoding format differs from UTF-8"), e);<NEW_LINE>}<NEW_LINE>final OrientJwtPayload payload = new OrientJwtPayload();<NEW_LINE>payload.setUserName((String) doc.field("username"));<NEW_LINE>payload.setIssuer((String) doc.field("iss"));<NEW_LINE>payload.setExpiry((Long) doc.field("exp"));<NEW_LINE>payload.setIssuedAt((Long) doc.field("iat"));<NEW_LINE>payload.setNotBefore((Long) doc.field("nbf"));<NEW_LINE>payload.setDatabase((String) doc.field("sub"));<NEW_LINE>payload.setAudience((String) doc.field("aud"));<NEW_LINE>payload.setTokenId((String) doc.field("jti"));<NEW_LINE>final int cluster = (Integer) doc.field("uidc");<NEW_LINE>final long pos = (Long) doc.field("uidp");<NEW_LINE>payload.setUserRid(new ORecordId(cluster, pos));<NEW_LINE>payload.setDatabaseType((String) doc.field("bdtyp"));<NEW_LINE>return payload;<NEW_LINE>}
new String(decodedPayload, "UTF-8"));
827,349
void modifyNodeOfAttributeOfElement(CtElement element, CtRole role, ConflictResolutionMode conflictMode, Function<RootNode, RootNode> elementNodeChanger) {<NEW_LINE>modifyNodeOfElement(element, conflictMode, node -> {<NEW_LINE>if (node instanceof ElementNode) {<NEW_LINE>ElementNode elementNode = (ElementNode) node;<NEW_LINE>RootNode oldAttrNode = elementNode.getNodeOfRole(role);<NEW_LINE>RootNode <MASK><NEW_LINE>if (newAttrNode == null) {<NEW_LINE>throw new SpoonException("Removing of Node is not supported");<NEW_LINE>}<NEW_LINE>handleConflict(conflictMode, oldAttrNode, newAttrNode, (tobeUsedNode) -> {<NEW_LINE>elementNode.setNodeOfRole(role, tobeUsedNode);<NEW_LINE>});<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>if (conflictMode == ConflictResolutionMode.KEEP_OLD_NODE) {<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>throw new SpoonException("The Node of atttribute of element cannot be set because element has a Node of class: " + node.getClass().getName());<NEW_LINE>});<NEW_LINE>}
newAttrNode = elementNodeChanger.apply(oldAttrNode);
1,604,688
// TODO: implementation copied from espresso's UIControllerImpl. Refactor code into common<NEW_LINE>// location<NEW_LINE>@Override<NEW_LINE>public boolean injectString(String str) throws InjectEventSecurityException {<NEW_LINE>checkNotNull(str);<NEW_LINE>checkState(Looper.myLooper() == Looper.getMainLooper(), "Expecting to be on main thread!");<NEW_LINE>// No-op if string is empty.<NEW_LINE>if (str.isEmpty()) {<NEW_LINE>Log.w(TAG, "Supplied string is empty resulting in no-op (nothing is typed).");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean eventInjected = false;<NEW_LINE>KeyCharacterMap keyCharacterMap = getKeyCharacterMap();<NEW_LINE>// TODO: Investigate why not use (as suggested in javadoc of keyCharacterMap.getEvents):<NEW_LINE>// http://developer.android.com/reference/android/view/KeyEvent.html#KeyEvent(long,<NEW_LINE>// java.lang.String, int, int)<NEW_LINE>KeyEvent[] events = keyCharacterMap.getEvents(str.toCharArray());<NEW_LINE>if (events == null) {<NEW_LINE>throw new RuntimeException(String.format("Failed to get key events for string %s (i.e. current IME does not understand how to" + " translate the string into key events). As a workaround, you can use" + " replaceText action to set the text directly in the EditText field.", str));<NEW_LINE>}<NEW_LINE>Log.d(TAG, String.format("Injecting string: \"%s\"", str));<NEW_LINE>for (KeyEvent event : events) {<NEW_LINE>checkNotNull(event, String.format("Failed to get event for character (%c) with key code (%s)", event.getKeyCode(), event.getUnicodeChar()));<NEW_LINE>eventInjected = false;<NEW_LINE>for (int attempts = 0; !eventInjected && attempts < 4; attempts++) {<NEW_LINE>// We have to change the time of an event before injecting it because<NEW_LINE>// all KeyEvents returned by KeyCharacterMap.getEvents() have the same<NEW_LINE>// time stamp and the system rejects too old events. Hence, it is<NEW_LINE>// possible for an event to become stale before it is injected if it<NEW_LINE>// takes too long to inject the preceding ones.<NEW_LINE>event = KeyEvent.changeTimeRepeat(event, <MASK><NEW_LINE>eventInjected = injectKeyEvent(event);<NEW_LINE>}<NEW_LINE>if (!eventInjected) {<NEW_LINE>Log.e(TAG, String.format("Failed to inject event for character (%c) with key code (%s)", event.getUnicodeChar(), event.getKeyCode()));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eventInjected;<NEW_LINE>}
SystemClock.uptimeMillis(), 0);
650,813
public static DescribeSimilarSecurityEventsResponse unmarshall(DescribeSimilarSecurityEventsResponse describeSimilarSecurityEventsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSimilarSecurityEventsResponse.setRequestId(_ctx.stringValue("DescribeSimilarSecurityEventsResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount(_ctx.integerValue("DescribeSimilarSecurityEventsResponse.PageInfo.Count"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribeSimilarSecurityEventsResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribeSimilarSecurityEventsResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribeSimilarSecurityEventsResponse.PageInfo.CurrentPage"));<NEW_LINE>describeSimilarSecurityEventsResponse.setPageInfo(pageInfo);<NEW_LINE>List<SimpleSecurityEvent> securityEventsResponse = new ArrayList<SimpleSecurityEvent>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse.Length"); i++) {<NEW_LINE>SimpleSecurityEvent simpleSecurityEvent = new SimpleSecurityEvent();<NEW_LINE>simpleSecurityEvent.setSecurityEventId(_ctx.longValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].SecurityEventId"));<NEW_LINE>simpleSecurityEvent.setUuid(_ctx.stringValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].Uuid"));<NEW_LINE>simpleSecurityEvent.setEventType(_ctx.stringValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].EventType"));<NEW_LINE>simpleSecurityEvent.setEventName(_ctx.stringValue<MASK><NEW_LINE>simpleSecurityEvent.setOccurrenceTime(_ctx.longValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].OccurrenceTime"));<NEW_LINE>simpleSecurityEvent.setLastTime(_ctx.longValue("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].LastTime"));<NEW_LINE>securityEventsResponse.add(simpleSecurityEvent);<NEW_LINE>}<NEW_LINE>describeSimilarSecurityEventsResponse.setSecurityEventsResponse(securityEventsResponse);<NEW_LINE>return describeSimilarSecurityEventsResponse;<NEW_LINE>}
("DescribeSimilarSecurityEventsResponse.SecurityEventsResponse[" + i + "].EventName"));
1,369,863
public void accept(final String bucketId, final RateBucketPeriod period, final long limit, final long increment, final IAsyncResultHandler<RateLimitResponse> handler) {<NEW_LINE>final String id = id(bucketId);<NEW_LINE>try {<NEW_LINE>GetResponse response = getClient().get(new GetRequest(getFullIndexName()).id(id), RequestOptions.DEFAULT);<NEW_LINE>RateLimiterBucket bucket;<NEW_LINE>long version;<NEW_LINE>if (response.isExists()) {<NEW_LINE>// use the existing bucket<NEW_LINE>version = response.getVersion();<NEW_LINE>String sourceAsString = response.getSourceAsString();<NEW_LINE>bucket = JSON_MAPPER.readValue(sourceAsString, RateLimiterBucket.class);<NEW_LINE>} else {<NEW_LINE>// make a new bucket<NEW_LINE>version = 0;<NEW_LINE>bucket = new RateLimiterBucket();<NEW_LINE>}<NEW_LINE>bucket.resetIfNecessary(period);<NEW_LINE>final RateLimitResponse rlr = new RateLimitResponse();<NEW_LINE>if (bucket.getCount() > limit) {<NEW_LINE>rlr.setAccepted(false);<NEW_LINE>} else {<NEW_LINE>rlr.setAccepted(bucket.getCount() < limit);<NEW_LINE>bucket.setCount(bucket.getCount() + increment);<NEW_LINE>bucket.setLast(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>int reset = (int) (bucket.getResetMillis(period) / 1000L);<NEW_LINE>rlr.setReset(reset);<NEW_LINE>rlr.setRemaining(limit - bucket.getCount());<NEW_LINE>updateBucketAndReturn(id, bucket, rlr, version, bucketId, period, limit, increment, handler);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>handler.handle(AsyncResultImpl.create<MASK><NEW_LINE>}<NEW_LINE>}
(e, RateLimitResponse.class));
1,506,694
private Optional<Integer> toInteger(ParserRuleContext messageCtx, Named_icmp_typeContext ctx) {<NEW_LINE>if (ctx.DESTINATION_UNREACHABLE() != null) {<NEW_LINE>return Optional.of(IcmpType.DESTINATION_UNREACHABLE);<NEW_LINE>} else if (ctx.ECHO_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.ECHO_REPLY);<NEW_LINE>} else if (ctx.ECHO_REQUEST() != null) {<NEW_LINE>return Optional.of(IcmpType.ECHO_REQUEST);<NEW_LINE>} else if (ctx.INFO_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.INFO_REPLY);<NEW_LINE>} else if (ctx.INFO_REQUEST() != null) {<NEW_LINE>return Optional.of(IcmpType.INFO_REQUEST);<NEW_LINE>} else if (ctx.PARAMETER_PROBLEM() != null) {<NEW_LINE>return Optional.of(IcmpType.PARAMETER_PROBLEM);<NEW_LINE>} else if (ctx.REDIRECT() != null) {<NEW_LINE>return <MASK><NEW_LINE>} else if (ctx.ROUTER_ADVERTISEMENT() != null) {<NEW_LINE>return Optional.of(IcmpType.ROUTER_ADVERTISEMENT);<NEW_LINE>} else if (ctx.ROUTER_SOLICIT() != null) {<NEW_LINE>return Optional.of(IcmpType.ROUTER_SOLICITATION);<NEW_LINE>} else if (ctx.SOURCE_QUENCH() != null) {<NEW_LINE>return Optional.of(IcmpType.SOURCE_QUENCH);<NEW_LINE>} else if (ctx.TIME_EXCEEDED() != null) {<NEW_LINE>return Optional.of(IcmpType.TIME_EXCEEDED);<NEW_LINE>} else if (ctx.TIMESTAMP() != null) {<NEW_LINE>return Optional.of(IcmpType.TIMESTAMP_REQUEST);<NEW_LINE>} else if (ctx.TIMESTAMP_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.TIMESTAMP_REPLY);<NEW_LINE>} else if (ctx.UNREACHABLE() != null) {<NEW_LINE>return Optional.of(IcmpType.DESTINATION_UNREACHABLE);<NEW_LINE>} else {<NEW_LINE>warn(messageCtx, String.format("Missing mapping for icmp-type: '%s'", ctx.getText()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
Optional.of(IcmpType.REDIRECT_MESSAGE);
653,610
public boolean dropTable(TableIdentifier identifier, boolean purge) {<NEW_LINE>if (!isValidIdentifier(identifier)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String database = identifier.<MASK><NEW_LINE>TableOperations ops = newTableOps(identifier);<NEW_LINE>TableMetadata lastMetadata;<NEW_LINE>if (purge && ops.current() != null) {<NEW_LINE>lastMetadata = ops.current();<NEW_LINE>} else {<NEW_LINE>lastMetadata = null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>clients.run(client -> {<NEW_LINE>client.dropTable(database, identifier.name(), false, /* do not delete data */<NEW_LINE>false);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>if (purge && lastMetadata != null) {<NEW_LINE>CatalogUtil.dropTableData(ops.io(), lastMetadata);<NEW_LINE>}<NEW_LINE>LOG.info("Dropped table: {}", identifier);<NEW_LINE>return true;<NEW_LINE>} catch (NoSuchTableException | NoSuchObjectException e) {<NEW_LINE>LOG.info("Skipping drop, table does not exist: {}", identifier, e);<NEW_LINE>return false;<NEW_LINE>} catch (TException e) {<NEW_LINE>throw new RuntimeException("Failed to drop " + identifier, e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException("Interrupted in call to dropTable", e);<NEW_LINE>}<NEW_LINE>}
namespace().level(0);
518,674
public static void testEnvAnnPrimInjection(String className, String key, char tChar, byte tByte, short tShort, int tInt, long tLong, boolean tBool, double tDouble, float tFloat, String[] names) {<NEW_LINE>// Start of Method<NEW_LINE>try {<NEW_LINE>initCtx = new InitialContext();<NEW_LINE>} catch (NamingException e) {<NEW_LINE>svLogger.info("Error setting up the context");<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>String event = "";<NEW_LINE>try {<NEW_LINE>event = testEnvAnnPrimChar(className, names[0], tChar);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimByte(className, names[1], tByte);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimShort(className, names[2], tShort);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimInt(className, names[3], tInt);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimLong(className, names[4], tLong);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimBool(className, names[5], tBool);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimDouble(className<MASK><NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>event = testEnvAnnPrimFloat(className, names[7], tFloat);<NEW_LINE>WCEventTracker.addEvent(key, event);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (t instanceof AssertionFailedError) {<NEW_LINE>WCEventTracker.addEvent(key, "FAIL:" + t.getMessage());<NEW_LINE>}<NEW_LINE>throw new RuntimeException("The was an error while testing the injected environment objects", t);<NEW_LINE>}<NEW_LINE>}
, names[6], tDouble);
1,366,374
public AcceleratorAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AcceleratorAttributes acceleratorAttributes = new AcceleratorAttributes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("FlowLogsEnabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acceleratorAttributes.setFlowLogsEnabled(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("FlowLogsS3Bucket", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acceleratorAttributes.setFlowLogsS3Bucket(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FlowLogsS3Prefix", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acceleratorAttributes.setFlowLogsS3Prefix(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return acceleratorAttributes;<NEW_LINE>}
class).unmarshall(context));
1,353,168
private void addObservableTransformers() {<NEW_LINE>// Observable<NEW_LINE>transform("rx.Observable", ObservableTransformCallback.<MASK><NEW_LINE>transform("rx.observables.BlockingObservable", ObservableTransformCallback.class, "first", "firstOrDefault", "mostRecent", "last", "lastOrDefault", "latest", "single", "singleOrDefault", "next", "forEach", "getIterator", "toFuture", "toIterable", "blockForSingle");<NEW_LINE>transform("rx.observables.ConnectableObservable", ObservableTransformCallback.class, "connect", "autoConnect", "refCount");<NEW_LINE>transform("rx.Single", RxSingleNestedScheduledActionTransformer.class, "toBlocking");<NEW_LINE>transform("rx.singles.BlockingSingle", ObservableTransformCallback.class, "value", "toFuture");<NEW_LINE>transform("rx.Completable", RxCompletableNestedScheduledActionTransformer.class, "await", "get");<NEW_LINE>}
class, "toBlocking", "publish", "groupBy");
727,108
protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) {<NEW_LINE>// actually Name or Type form.<NEW_LINE>// ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew<NEW_LINE>// ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew<NEW_LINE>ReferenceExpression referenceExpression = newReferenceExpression();<NEW_LINE>TypeReference[] typeArguments = null;<NEW_LINE>char[] selector;<NEW_LINE>int sourceEnd;<NEW_LINE>sourceEnd = (int) <MASK><NEW_LINE>referenceExpression.nameSourceStart = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);<NEW_LINE>selector = this.identifierStack[this.identifierPtr--];<NEW_LINE>this.identifierLengthPtr--;<NEW_LINE>int length = this.genericsLengthStack[this.genericsLengthPtr--];<NEW_LINE>if (length > 0) {<NEW_LINE>this.genericsPtr -= length;<NEW_LINE>System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);<NEW_LINE>// pop type arguments source start.<NEW_LINE>this.intPtr--;<NEW_LINE>}<NEW_LINE>int dimension = this.intStack[this.intPtr--];<NEW_LINE>boolean typeAnnotatedName = false;<NEW_LINE>for (int i = this.identifierLengthStack[this.identifierLengthPtr], j = 0; i > 0 && this.typeAnnotationLengthPtr >= 0; --i, j++) {<NEW_LINE>length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - j];<NEW_LINE>if (length != 0) {<NEW_LINE>typeAnnotatedName = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dimension > 0 || typeAnnotatedName) {<NEW_LINE>if (!isPrimitive) {<NEW_LINE>pushOnGenericsLengthStack(0);<NEW_LINE>pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);<NEW_LINE>}<NEW_LINE>referenceExpression.initialize(this.compilationUnit.compilationResult, getTypeReference(dimension), typeArguments, selector, sourceEnd);<NEW_LINE>} else {<NEW_LINE>referenceExpression.initialize(this.compilationUnit.compilationResult, getUnspecifiedReference(), typeArguments, selector, sourceEnd);<NEW_LINE>}<NEW_LINE>if (CharOperation.equals(selector, TypeConstants.INIT) && referenceExpression.lhs instanceof NameReference) {<NEW_LINE>referenceExpression.lhs.bits &= ~Binding.VARIABLE;<NEW_LINE>}<NEW_LINE>consumeReferenceExpression(referenceExpression);<NEW_LINE>}
this.identifierPositionStack[this.identifierPtr];
1,127,128
private HashMap<Integer, List<Register>> buildOffsetMap(List<Register> registers) {<NEW_LINE>HashMap<Integer, List<Register>> offsetMap = new HashMap<Integer, List<Register>>();<NEW_LINE>for (Register register : registers) {<NEW_LINE>Address addr = register.getAddress();<NEW_LINE>// Must disregard registers which are not in the "register" anmed space<NEW_LINE>// since these would never have been encoded/decoded properly by the addressMap<NEW_LINE>if (!addr.isRegisterAddress() || !register.getAddressSpace().getName().equalsIgnoreCase("register")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Integer offset = (int) addr.getOffset();<NEW_LINE>List<Register> registerList = offsetMap.get(offset);<NEW_LINE>if (registerList == null) {<NEW_LINE>registerList = new ArrayList<Register>();<NEW_LINE>offsetMap.put(offset, registerList);<NEW_LINE>}<NEW_LINE>registerList.add(register);<NEW_LINE>}<NEW_LINE>for (List<Register> registerList : offsetMap.values()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return offsetMap;<NEW_LINE>}
Collections.sort(registerList, registerSizeComparator);
1,468,473
public <OUT> Collection<OUT> findNodePatterns(Function<NodePattern<T>, OUT> filter, boolean allowOptional, boolean allowBranching) {<NEW_LINE>List<OUT> outList = new ArrayList<>();<NEW_LINE>Queue<State> todo = new LinkedList<>();<NEW_LINE>Set<State> seen = new HashSet<>();<NEW_LINE>todo.add(root);<NEW_LINE>seen.add(root);<NEW_LINE>while (!todo.isEmpty()) {<NEW_LINE>State state = todo.poll();<NEW_LINE>if ((allowOptional || !state.isOptional) && (state instanceof NodePatternState)) {<NEW_LINE>NodePattern<T> pattern = ((NodePatternState) state).pattern;<NEW_LINE>OUT res = filter.apply(pattern);<NEW_LINE>if (res != null) {<NEW_LINE>outList.add(res);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state.next != null) {<NEW_LINE>boolean addNext = allowBranching || state<MASK><NEW_LINE>if (addNext) {<NEW_LINE>for (State s : state.next) {<NEW_LINE>if (!seen.contains(s)) {<NEW_LINE>seen.add(s);<NEW_LINE>todo.add(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return outList;<NEW_LINE>}
.next.size() == 1;
1,698,654
public void undeploy(String appName, ExtendedDeploymentContext context) {<NEW_LINE>ActionReport report = context.getActionReport();<NEW_LINE>UndeployCommandParameters params = context.getCommandParameters(UndeployCommandParameters.class);<NEW_LINE>ApplicationInfo info = appRegistry.get(appName);<NEW_LINE>if (info == null) {<NEW_LINE>report.failure(context.getLogger(), <MASK><NEW_LINE>events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>events.send(new Event(Deployment.UNDEPLOYMENT_START, info));<NEW_LINE>// we unconditionally unload the application, even if it is not loaded, because we must clean the<NEW_LINE>// application, especially the classloaders need to be closed to release file handles<NEW_LINE>unload(info, context);<NEW_LINE>if (report != null && report.getActionExitCode().equals(ActionReport.ExitCode.SUCCESS)) {<NEW_LINE>events.send(new Event(Deployment.UNDEPLOYMENT_SUCCESS, context));<NEW_LINE>deploymentLifecycleProbeProvider.applicationUndeployedEvent(appName, getApplicationType(info));<NEW_LINE>} else {<NEW_LINE>events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context));<NEW_LINE>}<NEW_LINE>appRegistry.remove(appName);<NEW_LINE>}
"Application " + appName + " not registered", null);
1,621,751
private boolean rightClickBlockLegit(BlockPos pos) {<NEW_LINE>Vec3d eyesPos = RotationUtils.getEyesPos();<NEW_LINE>Vec3d <MASK><NEW_LINE>double distanceSqPosVec = eyesPos.squaredDistanceTo(posVec);<NEW_LINE>double rangeSq = Math.pow(range.getValue(), 2);<NEW_LINE>for (Direction side : Direction.values()) {<NEW_LINE>Vec3d hitVec = posVec.add(Vec3d.of(side.getVector()).multiply(0.5));<NEW_LINE>double distanceSqHitVec = eyesPos.squaredDistanceTo(hitVec);<NEW_LINE>// check if hitVec is within range<NEW_LINE>if (distanceSqHitVec > rangeSq)<NEW_LINE>continue;<NEW_LINE>// check if side is facing towards player<NEW_LINE>if (distanceSqHitVec >= distanceSqPosVec)<NEW_LINE>continue;<NEW_LINE>if (checkLOS.isChecked() && !hasLineOfSight(eyesPos, hitVec))<NEW_LINE>continue;<NEW_LINE>// face block<NEW_LINE>WURST.getRotationFaker().faceVectorPacket(hitVec);<NEW_LINE>// right click block<NEW_LINE>IMC.getInteractionManager().rightClickBlock(pos, side, hitVec);<NEW_LINE>MC.player.swingHand(Hand.MAIN_HAND);<NEW_LINE>IMC.setItemUseCooldown(4);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
posVec = Vec3d.ofCenter(pos);
450,240
public static APICreateDataVolumeEvent __example__() {<NEW_LINE>APICreateDataVolumeEvent event = new APICreateDataVolumeEvent();<NEW_LINE>String volumeUuid = uuid();<NEW_LINE>VolumeInventory vol = new VolumeInventory();<NEW_LINE>vol.setName("test-volume");<NEW_LINE>vol.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setType(VolumeType.Root.toString());<NEW_LINE>vol.setUuid(volumeUuid);<NEW_LINE>vol.setSize(SizeUnit.GIGABYTE.toByte(100));<NEW_LINE>vol.setActualSize(SizeUnit.GIGABYTE.toByte(20));<NEW_LINE>vol.setDeviceId(0);<NEW_LINE>vol.setState(VolumeState.Enabled.toString());<NEW_LINE>vol.setFormat("qcow2");<NEW_LINE>vol.setDiskOfferingUuid(uuid());<NEW_LINE>vol.setInstallPath(String.format("/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-%s/%s.qcow2", volumeUuid, volumeUuid));<NEW_LINE>vol.setStatus(VolumeStatus.Ready.toString());<NEW_LINE>vol.setPrimaryStorageUuid(uuid());<NEW_LINE>vol.setVmInstanceUuid(uuid());<NEW_LINE><MASK><NEW_LINE>event.setInventory(vol);<NEW_LINE>return event;<NEW_LINE>}
vol.setRootImageUuid(uuid());
812,556
private static void drawSelectionBox(WorldRenderer worldRenderer, IRenderTypeBuffer renderTypeBuffers, MatrixStack matrixStack, BlockPos blockPos, ActiveRenderInfo activeRenderInfo, VoxelShape shape, Color color) {<NEW_LINE><MASK><NEW_LINE>IVertexBuilder vertexBuilder = renderTypeBuffers.getBuffer(renderType);<NEW_LINE>double eyeX = activeRenderInfo.getProjectedView().getX();<NEW_LINE>double eyeY = activeRenderInfo.getProjectedView().getY();<NEW_LINE>double eyeZ = activeRenderInfo.getProjectedView().getZ();<NEW_LINE>final float ALPHA = 0.5f;<NEW_LINE>drawShapeOutline(matrixStack, vertexBuilder, shape, blockPos.getX() - eyeX, blockPos.getY() - eyeY, blockPos.getZ() - eyeZ, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, ALPHA);<NEW_LINE>}
RenderType renderType = RenderType.getLines();
31,819
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.field("node", taskId.getNodeId());<NEW_LINE>builder.field("id", taskId.getId());<NEW_LINE>builder.field("type", type);<NEW_LINE><MASK><NEW_LINE>if (status != null) {<NEW_LINE>builder.field("status", status, params);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>builder.field("description", description);<NEW_LINE>}<NEW_LINE>builder.timeField("start_time_in_millis", "start_time", startTime);<NEW_LINE>if (builder.humanReadable()) {<NEW_LINE>builder.field("running_time", new TimeValue(runningTimeNanos, TimeUnit.NANOSECONDS).toString());<NEW_LINE>}<NEW_LINE>builder.field("running_time_in_nanos", runningTimeNanos);<NEW_LINE>builder.field("cancellable", cancellable);<NEW_LINE>builder.field("cancelled", cancelled);<NEW_LINE>if (parentTaskId.isSet()) {<NEW_LINE>builder.field("parent_task_id", parentTaskId.toString());<NEW_LINE>}<NEW_LINE>builder.startObject("headers");<NEW_LINE>for (Map.Entry<String, String> attribute : headers.entrySet()) {<NEW_LINE>builder.field(attribute.getKey(), attribute.getValue());<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>if (resourceStats != null) {<NEW_LINE>builder.startObject("resource_stats");<NEW_LINE>resourceStats.toXContent(builder, params);<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
builder.field("action", action);
1,675,300
private static ConstantLookupResult lookupConstant(RubyContext context, RubyModule module, String name, ArrayList<Assumption> assumptions) {<NEW_LINE>// Look in the current module<NEW_LINE>ModuleFields fields = module.fields;<NEW_LINE>ConstantEntry constantEntry = fields.getOrComputeConstantEntry(name);<NEW_LINE>assumptions.<MASK><NEW_LINE>if (constantExists(constantEntry, assumptions)) {<NEW_LINE>return new ConstantLookupResult(constantEntry.getConstant(), toArray(assumptions));<NEW_LINE>}<NEW_LINE>// Look in ancestors<NEW_LINE>for (RubyModule ancestor : module.fields.ancestors()) {<NEW_LINE>if (ancestor == module) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>fields = ancestor.fields;<NEW_LINE>constantEntry = fields.getOrComputeConstantEntry(name);<NEW_LINE>assumptions.add(constantEntry.getAssumption());<NEW_LINE>if (constantExists(constantEntry, assumptions)) {<NEW_LINE>return new ConstantLookupResult(constantEntry.getConstant(), toArray(assumptions));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Nothing found<NEW_LINE>return new ConstantLookupResult(null, toArray(assumptions));<NEW_LINE>}
add(constantEntry.getAssumption());
503,271
public static long EuclideanModulus(long a, long b) {<NEW_LINE>assert b != 0 : "Precondition Failure";<NEW_LINE>if (0 <= a) {<NEW_LINE>// +a: a % b'<NEW_LINE>if (b == Long.MIN_VALUE)<NEW_LINE>return Long.remainderUnsigned(a, b);<NEW_LINE>else if (b < 0)<NEW_LINE>return a % -b;<NEW_LINE>else<NEW_LINE>return a % b;<NEW_LINE>} else {<NEW_LINE>// c = ((-a) % b')<NEW_LINE>// -a: b' - c if c > 0<NEW_LINE>// -a: 0 if c == 0<NEW_LINE>if (a == Long.MIN_VALUE || b == Long.MIN_VALUE) {<NEW_LINE>if (a == b)<NEW_LINE>return 0;<NEW_LINE>else if (b == Long.MIN_VALUE) {<NEW_LINE>return b - Long.remainderUnsigned(-a, b);<NEW_LINE>} else {<NEW_LINE>long bp = b < 0 ? -b : b;<NEW_LINE>return bp - <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long bp = b < 0 ? -b : b;<NEW_LINE>long c = ((-a) % bp);<NEW_LINE>return c == 0 ? c : bp - c;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Long.remainderUnsigned(a, bp);
1,195,261
public List<Record> generateDSRecords(final Name name, final long maxTTL) throws NoSuchAlgorithmException, IOException {<NEW_LINE>final List<Record> records = new ArrayList<Record>();<NEW_LINE>if (isDnssecEnabled() && name.subdomain(ZoneManager.getTopLevelDomain())) {<NEW_LINE>final JsonNode config = getCacheRegister().getConfig();<NEW_LINE>final List<DnsSecKeyPair> kskPairs = getKSKPairs(name, maxTTL);<NEW_LINE>final List<DnsSecKeyPair> zskPairs = getZSKPairs(name, maxTTL);<NEW_LINE>if (kskPairs != null && zskPairs != null && !kskPairs.isEmpty() && !zskPairs.isEmpty()) {<NEW_LINE>// these records go into the CDN TLD, so don't use the DS' TTLs; use the CDN's.<NEW_LINE>final Long dsTtl = ZoneUtils.getLong(config.get("ttls"), "DS", 60);<NEW_LINE>for (final DnsSecKeyPair kp : kskPairs) {<NEW_LINE>final ZoneSigner zoneSigner = new ZoneSignerImpl();<NEW_LINE>final DSRecord dsRecord = zoneSigner.calculateDSRecord(kp.getDNSKEYRecord(<MASK><NEW_LINE>LOGGER.debug(name + ": adding DS record " + dsRecord);<NEW_LINE>records.add(dsRecord);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return records;<NEW_LINE>}
), DSRecord.SHA256_DIGEST_ID, dsTtl);
1,189,632
private void reviseV1() throws ContradictionException {<NEW_LINE>vrms.clear();<NEW_LINE>vrms.setOffset(vars[1].getLB());<NEW_LINE>int ub1 = vars[1].getUB();<NEW_LINE>for (int val1 = vars[1].getLB(); val1 <= ub1; val1 = vars[1].nextValue(val1)) {<NEW_LINE>if (!vars[0].contains(currentSupport1[val1 - offset1].get())) {<NEW_LINE>boolean found = false;<NEW_LINE>int support = currentSupport1[val1 - offset1].get();<NEW_LINE>int max1 = vars[0].getUB();<NEW_LINE>while (!found && support < max1) {<NEW_LINE>support = vars<MASK><NEW_LINE>if (relation.isConsistent(support, val1))<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>if (found) {<NEW_LINE>currentSupport1[val1 - offset1].set(support);<NEW_LINE>} else {<NEW_LINE>vrms.add(val1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>vars[1].removeValues(vrms, this);<NEW_LINE>}
[0].nextValue(support);
1,144,115
private boolean findShardColumnMatch(RelNode root, RelNode join, List<Integer> lShardColumnRef, List<Integer> rShardColumnRefForJoin) {<NEW_LINE>if (lShardColumnRef.size() == 0 || lShardColumnRef.size() != rShardColumnRefForJoin.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final ExtractionResult er = ConditionExtractor.<MASK><NEW_LINE>Map<Integer, BitSet> connectionMap = er.conditionOf(join).toColumnEquality();<NEW_LINE>for (int i = 0; i < lShardColumnRef.size(); i++) {<NEW_LINE>Integer lShard = lShardColumnRef.get(i);<NEW_LINE>Integer targetShard = rShardColumnRefForJoin.get(i);<NEW_LINE>BitSet b = connectionMap.get(lShard);<NEW_LINE>if (b.get(targetShard)) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
columnEquivalenceFrom(root).extract();
2,961
final DescribeAdjustmentTypesResult executeDescribeAdjustmentTypes(DescribeAdjustmentTypesRequest describeAdjustmentTypesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAdjustmentTypesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAdjustmentTypesRequest> request = null;<NEW_LINE>Response<DescribeAdjustmentTypesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAdjustmentTypesRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAdjustmentTypes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAdjustmentTypesResult> responseHandler = new StaxResponseHandler<DescribeAdjustmentTypesResult>(new DescribeAdjustmentTypesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(describeAdjustmentTypesRequest));
1,818,777
public static boolean scrollToVisible(JViewport viewport, Rectangle fieldArea) {<NEW_LINE>Rectangle viewArea = viewport.getViewRect();<NEW_LINE>if (viewArea.contains(fieldArea)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Point pos = new Point();<NEW_LINE>pos.x = viewArea.x;<NEW_LINE>if (fieldArea.x + fieldArea.width > viewArea.x + viewArea.width) {<NEW_LINE>pos.x = fieldArea.x + fieldArea<MASK><NEW_LINE>}<NEW_LINE>pos.x = pos.x > fieldArea.x ? fieldArea.x - 5 : pos.x;<NEW_LINE>if (pos.x + viewArea.width > viewport.getView().getWidth()) {<NEW_LINE>pos.x = viewport.getView().getWidth() - viewArea.width;<NEW_LINE>}<NEW_LINE>pos.y = viewArea.y;<NEW_LINE>if (fieldArea.y + fieldArea.height > viewArea.y + viewArea.height) {<NEW_LINE>pos.y = fieldArea.y + fieldArea.height - viewArea.height + 5;<NEW_LINE>}<NEW_LINE>pos.y = pos.y > fieldArea.y ? fieldArea.y - 5 : pos.y;<NEW_LINE>if (pos.y + viewArea.height > viewport.getView().getHeight()) {<NEW_LINE>pos.y = viewport.getView().getHeight() - viewArea.height;<NEW_LINE>}<NEW_LINE>viewport.setViewPosition(pos);<NEW_LINE>return true;<NEW_LINE>}
.width - viewArea.width + 5;
1,681,829
protected void packageDocker(Distribution distribution, Map<String, Object> props, Path packageDirectory, DockerConfiguration docker, List<Artifact> artifacts) throws PackagerProcessingException {<NEW_LINE>super.<MASK><NEW_LINE>try {<NEW_LINE>// copy files<NEW_LINE>Path workingDirectory = prepareAssembly(distribution, props, packageDirectory, artifacts);<NEW_LINE>for (String imageName : docker.getImageNames()) {<NEW_LINE>imageName = resolveTemplate(imageName, props);<NEW_LINE>// command line<NEW_LINE>Command cmd = createBuildCommand(props, docker);<NEW_LINE>if (!cmd.hasArg("-q") && !cmd.hasArg("--quiet")) {<NEW_LINE>cmd.arg("-q");<NEW_LINE>}<NEW_LINE>cmd.arg("-f");<NEW_LINE>cmd.arg(workingDirectory.resolve("Dockerfile").toAbsolutePath().toString());<NEW_LINE>cmd.arg("-t");<NEW_LINE>cmd.arg(imageName);<NEW_LINE>cmd.arg(workingDirectory.toAbsolutePath().toString());<NEW_LINE>context.getLogger().debug(String.join(" ", cmd.getArgs()));<NEW_LINE>context.getLogger().info(" - {}", imageName);<NEW_LINE>// execute<NEW_LINE>executeCommand(cmd);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PackagerProcessingException(e);<NEW_LINE>}<NEW_LINE>}
doPackageDistribution(distribution, props, packageDirectory);
600,441
protected // @Deactivate<NEW_LINE>void stop() {<NEW_LINE>final String methodName = "stop()";<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, methodName);<NEW_LINE>ServerCache.objectCacheEnabled = false;<NEW_LINE>CacheService cacheService = getCacheService();<NEW_LINE>if (null == cacheService)<NEW_LINE>return;<NEW_LINE>unInitializeConfigPropertiesFiles(getClass().getClassLoader(), DISTRIBUTED_MAP_PROPERTIES);<NEW_LINE>unInitializeConfigPropertiesFiles(getClass().getClassLoader(), CACHE_INSTANCES_PROPERTIES);<NEW_LINE>Collection<DistributedObjectCache> distributedMaps = DistributedObjectCacheFactory.distributedMaps.values();<NEW_LINE>for (DistributedObjectCache distributedObjectCache : distributedMaps) {<NEW_LINE>DCache cache = ((DistributedObjectCacheAdapter) distributedObjectCache).getCache();<NEW_LINE>ServerCache.<MASK><NEW_LINE>cache.stop();<NEW_LINE>}<NEW_LINE>DistributedObjectCacheFactory.distributedMaps.clear();<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, methodName);<NEW_LINE>}
getCacheInstances().remove(cache);
1,849,142
public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {<NEW_LINE>final OsmandSettings settings = mapActivity.getMyApplication().getSettings();<NEW_LINE>final PoiFiltersHelper poiFiltersHelper = mapActivity.getMyApplication().getPoiFilters();<NEW_LINE>final ContextMenuItem item = menuAdapter.getItem(pos);<NEW_LINE>if (item.getSelected() != null) {<NEW_LINE>item.setColor(mapActivity, isChecked ? R.color.osmand_orange : ContextMenuItem.INVALID_ID);<NEW_LINE>}<NEW_LINE>if (itemId == R.string.layer_poi) {<NEW_LINE>PoiUIFilter wiki = poiFiltersHelper.getTopWikiPoiFilter();<NEW_LINE>poiFiltersHelper.clearSelectedPoiFilters(wiki);<NEW_LINE>if (isChecked) {<NEW_LINE>showPoiFilterDialog(adapter, adapter.getItem(pos));<NEW_LINE>} else {<NEW_LINE>adapter.getItem(pos).setDescription(poiFiltersHelper.getSelectedPoiFiltersName(wiki));<NEW_LINE>}<NEW_LINE>} else if (itemId == R.string.layer_amenity_label) {<NEW_LINE>settings.SHOW_POI_LABEL.set(isChecked);<NEW_LINE>} else if (itemId == R.string.shared_string_favorites) {<NEW_LINE>settings.SHOW_FAVORITES.set(isChecked);<NEW_LINE>} else if (itemId == R.string.layer_gpx_layer) {<NEW_LINE>final GpxSelectionHelper selectedGpxHelper = mapActivity.getMyApplication().getSelectedGpxHelper();<NEW_LINE>if (selectedGpxHelper.isShowingAnyGpxFiles()) {<NEW_LINE>selectedGpxHelper.clearAllGpxFilesToShow(true);<NEW_LINE>adapter.getItem(pos).setDescription(selectedGpxHelper.getGpxDescription());<NEW_LINE>} else {<NEW_LINE>showGpxSelectionDialog(adapter, adapter.getItem(pos));<NEW_LINE>}<NEW_LINE>} else if (itemId == R.string.rendering_category_transport) {<NEW_LINE>boolean selected = TransportLinesMenu.isShowLines(mapActivity.getMyApplication());<NEW_LINE>TransportLinesMenu.toggleTransportLines(mapActivity, !selected, result -> {<NEW_LINE>item.setSelected(result);<NEW_LINE>item.setColor(mapActivity, result ? R.<MASK><NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} else if (itemId == R.string.map_markers) {<NEW_LINE>settings.SHOW_MAP_MARKERS.set(isChecked);<NEW_LINE>} else if (itemId == R.string.layer_map) {<NEW_LINE>if (!OsmandPlugin.isActive(OsmandRasterMapsPlugin.class)) {<NEW_LINE>PluginsFragment.showInstance(mapActivity.getSupportFragmentManager());<NEW_LINE>} else {<NEW_LINE>ContextMenuItem it = adapter.getItem(pos);<NEW_LINE>mapActivity.getMapLayers().selectMapLayer(mapActivity, it, adapter);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>mapActivity.updateLayers();<NEW_LINE>mapActivity.refreshMap();<NEW_LINE>return false;<NEW_LINE>}
color.osmand_orange : ContextMenuItem.INVALID_ID);
864,093
private void pingDcomConnection(Node node) throws CommandValidationException {<NEW_LINE>try {<NEW_LINE>SshConnector connector = node.getSshConnector();<NEW_LINE>SshAuth auth = connector.getSshAuth();<NEW_LINE>String host = connector.getSshHost();<NEW_LINE>if (!StringUtils.ok(host)) {<NEW_LINE>host = node.getNodeHost();<NEW_LINE>}<NEW_LINE>String username = auth.getUserName();<NEW_LINE>String password = resolvePassword(auth.getPassword());<NEW_LINE>String installdir = node.getInstallDirUnixStyle();<NEW_LINE>String domain = node.getWindowsDomain();<NEW_LINE>if (!StringUtils.ok(domain)) {<NEW_LINE>domain = host;<NEW_LINE>}<NEW_LINE>if (!StringUtils.ok(installdir)) {<NEW_LINE>throw new CommandValidationException<MASK><NEW_LINE>}<NEW_LINE>pingDcomConnection(host, domain, username, password, getInstallRoot(installdir));<NEW_LINE>}// very complicated catch copied from pingssh above...<NEW_LINE>catch (CommandValidationException cve) {<NEW_LINE>throw cve;<NEW_LINE>} catch (Exception e) {<NEW_LINE>String m1 = e.getMessage();<NEW_LINE>String m2 = "";<NEW_LINE>Throwable e2 = e.getCause();<NEW_LINE>if (e2 != null) {<NEW_LINE>m2 = e2.getMessage();<NEW_LINE>}<NEW_LINE>String msg = Strings.get("ssh.bad.connect", node.getNodeHost(), "DCOM");<NEW_LINE>logger.warning(StringUtils.cat(": ", msg, m1, m2));<NEW_LINE>throw new CommandValidationException(StringUtils.cat(NL, msg, m1, m2));<NEW_LINE>}<NEW_LINE>}
(Strings.get("dcom.no.installdir"));
999,493
final DeletePackagingConfigurationResult executeDeletePackagingConfiguration(DeletePackagingConfigurationRequest deletePackagingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePackagingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePackagingConfigurationRequest> request = null;<NEW_LINE>Response<DeletePackagingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePackagingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePackagingConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaPackage Vod");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePackagingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePackagingConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePackagingConfiguration");
1,788,265
private final DDLQuery parseCreateDomain() {<NEW_LINE>boolean ifNotExists = parseKeywordIf("IF NOT EXISTS");<NEW_LINE>Domain<?> domainName = parseDomainName();<NEW_LINE>parseKeyword("AS");<NEW_LINE>DataType<?> dataType = parseDataType();<NEW_LINE>CreateDomainDefaultStep<?> s1 = ifNotExists ? dsl.createDomainIfNotExists(domainName).as(dataType) : dsl.createDomain(domainName).as(dataType);<NEW_LINE>CreateDomainConstraintStep s2 = parseKeywordIf("DEFAULT") ? s1.default_((Field) parseField()) : s1;<NEW_LINE>List<Constraint> <MASK><NEW_LINE>constraintLoop: for (; ; ) {<NEW_LINE>ConstraintTypeStep constraint = parseConstraintNameSpecification();<NEW_LINE>// TODO: NOT NULL constraints<NEW_LINE>if (parseKeywordIf("CHECK")) {<NEW_LINE>constraints.add(parseCheckSpecification(constraint));<NEW_LINE>continue constraintLoop;<NEW_LINE>} else if (constraint != null)<NEW_LINE>throw expected("CHECK", "CONSTRAINT");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!constraints.isEmpty())<NEW_LINE>s2 = s2.constraints(constraints);<NEW_LINE>return s2;<NEW_LINE>}
constraints = new ArrayList<>();
32,320
public void init(int maxCapacity, Properties props) throws Exception {<NEW_LINE>super.init(maxCapacity, props);<NEW_LINE>currentSize = 0;<NEW_LINE>if (props != null) {<NEW_LINE>String strMaxSize = props.getProperty("MaxSize");<NEW_LINE>int multiplier = 1;<NEW_LINE>long size = -1;<NEW_LINE>String prop = strMaxSize;<NEW_LINE>if (prop != null) {<NEW_LINE>int index;<NEW_LINE>// upper case the string<NEW_LINE>prop = prop.toUpperCase(Locale.ENGLISH);<NEW_LINE>// look for 200KB or 80Kb or 1MB or 2Mb like suffixes<NEW_LINE>if ((index = prop.indexOf("KB")) != -1) {<NEW_LINE>multiplier = Constants.KB;<NEW_LINE>prop = prop.substring(0, index);<NEW_LINE>} else if ((index = prop.indexOf("MB")) != -1) {<NEW_LINE>multiplier = Constants.MB;<NEW_LINE>prop = <MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>size = Long.parseLong(prop.trim());<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// sanity check and convert<NEW_LINE>if (size > 0)<NEW_LINE>maxSize = (size * multiplier);<NEW_LINE>else {<NEW_LINE>String msg = CULoggerInfo.getString(CULoggerInfo.boundedMultiLruCacheIllegalMaxSize);<NEW_LINE>Object[] params = { strMaxSize };<NEW_LINE>msg = MessageFormat.format(msg, params);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
prop.substring(0, index);
1,614,934
final DescribeAccountLimitsResult executeDescribeAccountLimits(DescribeAccountLimitsRequest describeAccountLimitsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAccountLimitsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAccountLimitsRequest> request = null;<NEW_LINE>Response<DescribeAccountLimitsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAccountLimitsRequestMarshaller().marshall(super.beforeMarshalling(describeAccountLimitsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAccountLimits");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAccountLimitsResult> responseHandler = new StaxResponseHandler<DescribeAccountLimitsResult>(new DescribeAccountLimitsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
644,580
public int compare(ClusterModelStats stats1, ClusterModelStats stats2) {<NEW_LINE>double meanPreLeaderBytesIn = stats1.resourceUtilizationStats().get(Statistic.AVG).get(Resource.NW_IN);<NEW_LINE>double threshold = meanPreLeaderBytesIn * _balancingConstraint.resourceBalancePercentage(Resource.NW_IN);<NEW_LINE>if (stats1.resourceUtilizationStats().get(Statistic.MAX).get(Resource.NW_IN) <= threshold) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>// If there are brokers with inbound network load over the threshold, the standard deviation of utilization<NEW_LINE>// must not increase compared the initial stats. Otherwise, the goal is producing a worse cluster state.<NEW_LINE>double variance1 = stats1.resourceUtilizationStats().get(Statistic.ST_DEV).get(Resource.NW_IN);<NEW_LINE>double variance2 = stats2.resourceUtilizationStats().get(Statistic.ST_DEV).get(Resource.NW_IN);<NEW_LINE>int result = AnalyzerUtils.compare(Math.sqrt(variance2), Math.sqrt<MASK><NEW_LINE>if (result < 0) {<NEW_LINE>_reasonForLastNegativeResult = String.format("Violated leader bytes in balancing. preVariance: %.3f " + "postVariance: %.3f.", variance2, variance1);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(variance1), Resource.NW_IN);
778,544
public static void saveLandmarksCsv(String inputFile, String detector, CalibrationObservation landmarks, OutputStream outputStream) {<NEW_LINE>var out = new PrintWriter(new OutputStreamWriter(outputStream, UTF_8));<NEW_LINE>out.println("# Landmarks detected on a calibration target");<NEW_LINE>out.println("# " + inputFile);<NEW_LINE>out.println("# Image Shape: " + landmarks.getWidth() + " x " + landmarks.getHeight());<NEW_LINE>out.println("# " + detector);<NEW_LINE>out.<MASK><NEW_LINE>out.println("# BoofCV GITSHA: " + BoofVersion.GIT_SHA);<NEW_LINE>out.println("# (landmark id), pixel-x, pixel-y");<NEW_LINE>for (int i = 0; i < landmarks.size(); i++) {<NEW_LINE>PointIndex2D_F64 p = landmarks.get(i);<NEW_LINE>out.println(p.index + "," + p.p.x + "," + p.p.y);<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>}
println("# BoofCV Version: " + BoofVersion.VERSION);
357,600
public Response testSubscription(@PathParam("checkId") String checkId, @PathParam("subscriptionId") final String subscriptionId) {<NEW_LINE>Check <MASK><NEW_LINE>if (check == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).build();<NEW_LINE>}<NEW_LINE>Collection<Subscription> subscriptions = Collections2.filter(check.getSubscriptions(), new Predicate<Subscription>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(Subscription subscription) {<NEW_LINE>return subscription.getId().equals(subscriptionId);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (subscriptions.size() != 1) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).build();<NEW_LINE>}<NEW_LINE>check.setState(AlertType.ERROR);<NEW_LINE>Subscription subscription = subscriptions.iterator().next();<NEW_LINE>List<Alert> interestingAlerts = new ArrayList<Alert>();<NEW_LINE>Alert alert = new Alert().withTarget(check.getTarget()).withValue(BigDecimal.valueOf(0.0)).withWarn(check.getWarn()).withError(check.getError()).withFromType(AlertType.OK).withToType(AlertType.ERROR).withTimestamp(new DateTime());<NEW_LINE>interestingAlerts.add(alert);<NEW_LINE>for (NotificationService notificationService : notificationServices) {<NEW_LINE>if (notificationService.canHandle(subscription.getType())) {<NEW_LINE>try {<NEW_LINE>notificationService.sendNotification(check, subscription, interestingAlerts);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Notifying {} by {} failed.", subscription.getTarget(), subscription.getType(), e);<NEW_LINE>return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(String.format("Notifying failed '%s'", e.getMessage())).type(MediaType.TEXT_PLAIN).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Response.noContent().build();<NEW_LINE>}
check = checksStore.getCheck(checkId);
1,266,523
private void createAndLinkWorkflowNodesForDocumentWorkflow(@NonNull I_AD_Workflow documentWorkflow) {<NEW_LINE>// Create start Workflow Node<NEW_LINE>final I_AD_WF_Node startWorkflowNode = createWorkflowNode(documentWorkflow, ADWorkflowConstants.WF_NODE_Start_Name, X_AD_WF_Node.ACTION_WaitSleep, null);<NEW_LINE>// set this node as the start node in the workflow<NEW_LINE>documentWorkflow.setAD_WF_Node_ID(startWorkflowNode.getAD_WF_Node_ID());<NEW_LINE>InterfaceWrapperHelper.save(documentWorkflow);<NEW_LINE>// Create DocAuto Workflow Node<NEW_LINE>final I_AD_WF_Node docAutoWorkflowNode = createWorkflowNode(documentWorkflow, ADWorkflowConstants.WF_NODE_DocAuto_Name, X_AD_WF_Node.ACTION_DocumentAction, X_AD_WF_Node.DOCACTION_None);<NEW_LINE>// Create DocPrepare Workflow Node<NEW_LINE>final I_AD_WF_Node docPrepareWorkflowNode = createWorkflowNode(documentWorkflow, ADWorkflowConstants.WF_NODE_DocPrepare_Name, X_AD_WF_Node.ACTION_DocumentAction, X_AD_WF_Node.DOCACTION_Prepare);<NEW_LINE>// Create DocComplete Workflow Node<NEW_LINE>final I_AD_WF_Node docCompleteWorkflowNode = createWorkflowNode(documentWorkflow, ADWorkflowConstants.WF_NODE_DocComplete_Name, <MASK><NEW_LINE>// Link workflow nodes Start and DocPrepare<NEW_LINE>final I_AD_WF_NodeNext startToDocPrepare = linkNextNode(startWorkflowNode, docPrepareWorkflowNode, 10);<NEW_LINE>startToDocPrepare.setDescription("(Standard Approval)");<NEW_LINE>startToDocPrepare.setIsStdUserWorkflow(true);<NEW_LINE>InterfaceWrapperHelper.save(startToDocPrepare);<NEW_LINE>// Link workflow nodes Start and DocAuto<NEW_LINE>linkNextNode(startWorkflowNode, docAutoWorkflowNode, 100);<NEW_LINE>// Link workflos nodes Prepare and Complete<NEW_LINE>linkNextNode(docPrepareWorkflowNode, docCompleteWorkflowNode, 100);<NEW_LINE>}
X_AD_WF_Node.ACTION_DocumentAction, X_AD_WF_Node.DOCACTION_Complete);
1,118,596
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String domainName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (domainName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, domainName, this.client.getApiVersion(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter domainName is required and cannot be null."));
414,951
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode mode, boolean ignorePassableBlocks) {<NEW_LINE>Validate.notNull(start, "Start location equals null");<NEW_LINE>Validate.isTrue(this.equals(start.getWorld()), "Start location a different world");<NEW_LINE>start.checkFinite();<NEW_LINE>Validate.notNull(direction, "Direction equals null");<NEW_LINE>direction.checkFinite();<NEW_LINE>Validate.isTrue(direction.lengthSquared() > 0, "Direction's magnitude is 0");<NEW_LINE>Validate.notNull(mode, "mode equals null");<NEW_LINE>if (maxDistance < 0.0D)<NEW_LINE>return null;<NEW_LINE>Vector dir = direction.clone().normalize().multiply(maxDistance);<NEW_LINE>Vec3d startPos = new Vec3d(start.getX(), start.getY(<MASK><NEW_LINE>Vec3d endPos = new Vec3d(start.getX() + dir.getX(), start.getY() + dir.getY(), start.getZ() + dir.getZ());<NEW_LINE>HitResult nmsHitResult = this.getHandle().raycast(new RaycastContext(startPos, endPos, ignorePassableBlocks ? RaycastContext.ShapeType.COLLIDER : RaycastContext.ShapeType.OUTLINE, CardboardFluidRaytraceMode.toMc(mode), null));<NEW_LINE>return CardboardRayTraceResult.fromNMS(this, nmsHitResult);<NEW_LINE>}
), start.getZ());
1,635,382
private BytesStore map(long mapSize, final long mappingOffsetInFile) throws IOException {<NEW_LINE>mapSize = pageAlign(mapSize);<NEW_LINE>final long minFileSize = mappingOffsetInFile + mapSize;<NEW_LINE>final FileChannel fileChannel = raf.getChannel();<NEW_LINE>if (fileChannel.size() < minFileSize) {<NEW_LINE>// In MappedFile#acquireByteStore(), this is wrapped with fileLock(), to avoid race<NEW_LINE>// condition between processes. This map() method is called either when a new tier is<NEW_LINE>// allocated (in this case concurrent access is mutually excluded by<NEW_LINE>// globalMutableStateLock), or on map creation, when race condition should be excluded<NEW_LINE>// by self-bootstrapping header spec<NEW_LINE>raf.setLength(minFileSize);<NEW_LINE>// RandomAccessFile#setLength() only calls ftruncate,<NEW_LINE>// which will not preallocate space on XFS filesystem of Linux.<NEW_LINE>// And writing that file will create a sparse file with a large number of extents.<NEW_LINE>// This kind of fragmented file may hang the program and cause dmesg reports<NEW_LINE>// "XFS: ... possible memory allocation deadlock size ... in kmem_alloc (mode:0x250)".<NEW_LINE>// We can fix this by trying calling posix_fallocate to preallocate the space.<NEW_LINE>if (OS.isLinux() && !sparseFile) {<NEW_LINE>fallocate(mappingOffsetInFile, minFileSize - mappingOffsetInFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final long address = OS.map(fileChannel, READ_WRITE, mappingOffsetInFile, mapSize);<NEW_LINE>resources.addMemoryResource(address, mapSize);<NEW_LINE>return <MASK><NEW_LINE>}
BytesStore.wrap(address, mapSize);
1,760,123
public void customise(OpenAPI openAPI, ResourceMappings mappings, PersistentEntities persistentEntities) {<NEW_LINE>persistentEntities.getManagedTypes().stream().forEach(typeInformation -> {<NEW_LINE>Class domainType = typeInformation.getType();<NEW_LINE>ResourceMetadata resourceMetadata = mappings.getMetadataFor(domainType);<NEW_LINE>final PersistentEntity<?, ?> entity = persistentEntities.getRequiredPersistentEntity(domainType);<NEW_LINE>EntityInfo entityInfo = new EntityInfo();<NEW_LINE>entityInfo.setDomainType(domainType);<NEW_LINE>List<String> <MASK><NEW_LINE>if (!repositoryRestConfiguration.isIdExposedFor(entity.getType()))<NEW_LINE>entityInfo.setIgnoredFields(ignoredFields);<NEW_LINE>List<String> associationsFields = getAssociationsFields(resourceMetadata, entity);<NEW_LINE>entityInfo.setAssociationsFields(associationsFields);<NEW_LINE>entityInoMap.put(domainType.getSimpleName(), entityInfo);<NEW_LINE>});<NEW_LINE>openAPI.getPaths().entrySet().stream().forEach(stringPathItemEntry -> {<NEW_LINE>PathItem pathItem = stringPathItemEntry.getValue();<NEW_LINE>pathItem.readOperations().forEach(operation -> {<NEW_LINE>RequestBody requestBody = operation.getRequestBody();<NEW_LINE>updateRequestBody(openAPI, requestBody);<NEW_LINE>ApiResponses apiResponses = operation.getResponses();<NEW_LINE>apiResponses.forEach((code, apiResponse) -> updateApiResponse(openAPI, openAPI.getComponents(), apiResponse));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
ignoredFields = getIgnoredFields(resourceMetadata, entity);
1,813,479
private ClusteringAlgorithm parseAlgorithm(ClusterRequest template, ClusterRequest clusteringRequest) throws TerminateRequestException {<NEW_LINE>String algorithmName = firstNotNull(<MASK><NEW_LINE>if (algorithmName == null) {<NEW_LINE>throw new TerminateRequestException(ErrorResponseType.BAD_REQUEST, "Algorithm must not be empty.");<NEW_LINE>}<NEW_LINE>ClusteringAlgorithmProvider supplier = dcsContext.algorithmSuppliers.get(algorithmName);<NEW_LINE>if (supplier == null) {<NEW_LINE>throw new TerminateRequestException(ErrorResponseType.BAD_REQUEST, "Algorithm not available: " + algorithmName);<NEW_LINE>}<NEW_LINE>Function<String, Object> classFromName = AliasMapper.SPI_DEFAULTS::fromName;<NEW_LINE>ClusteringAlgorithm algorithm = supplier.get();<NEW_LINE>try {<NEW_LINE>if (template.parameters != null) {<NEW_LINE>Attrs.populate(algorithm, template.parameters, classFromName);<NEW_LINE>}<NEW_LINE>if (clusteringRequest.parameters != null) {<NEW_LINE>Attrs.populate(algorithm, clusteringRequest.parameters, classFromName);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new TerminateRequestException(ErrorResponseType.BAD_REQUEST, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return algorithm;<NEW_LINE>}
clusteringRequest.algorithm, template.algorithm);
1,153,959
private Map<PendingTx, Transaction> createTransactions(Block parent) {<NEW_LINE>Map<PendingTx, Transaction> txes = new LinkedHashMap<>();<NEW_LINE>Map<ByteArrayWrapper, Long> nonces = new HashMap<>();<NEW_LINE>Repository repoSnapshot = getBlockchain().getRepository().<MASK><NEW_LINE>for (PendingTx tx : submittedTxes) {<NEW_LINE>Transaction transaction;<NEW_LINE>if (tx.customTx == null) {<NEW_LINE>ByteArrayWrapper senderW = new ByteArrayWrapper(tx.sender.getAddress());<NEW_LINE>Long nonce = nonces.get(senderW);<NEW_LINE>if (nonce == null) {<NEW_LINE>BigInteger bcNonce = repoSnapshot.getNonce(tx.sender.getAddress());<NEW_LINE>nonce = bcNonce.longValue();<NEW_LINE>}<NEW_LINE>nonces.put(senderW, nonce + 1);<NEW_LINE>byte[] toAddress = tx.targetContract != null ? tx.targetContract.getAddress() : tx.toAddress;<NEW_LINE>transaction = createTransaction(tx.sender, nonce, toAddress, tx.value, tx.data);<NEW_LINE>if (tx.createdContract != null) {<NEW_LINE>tx.createdContract.setAddress(transaction.getContractAddress());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>transaction = tx.customTx;<NEW_LINE>}<NEW_LINE>txes.put(tx, transaction);<NEW_LINE>}<NEW_LINE>return txes;<NEW_LINE>}
getSnapshotTo(parent.getStateRoot());
602,095
protected void runInContext() {<NEW_LINE>try {<NEW_LINE>final List<DomainRouterVO> routers = _routerDao.listIsolatedByHostId(null);<NEW_LINE>s_logger.debug("Found " + routers.size() + " routers to update status. ");<NEW_LINE>updateSite2SiteVpnConnectionState(routers);<NEW_LINE>List<NetworkVO> networks = new ArrayList<>();<NEW_LINE>for (Vpc vpc : _vpcDao.listAll()) {<NEW_LINE>List<NetworkVO> vpcNetworks = _networkDao.listByVpc(vpc.getId());<NEW_LINE>if (vpcNetworks.size() > 0) {<NEW_LINE>networks.add(vpcNetworks.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>s_logger.debug("Found " + <MASK><NEW_LINE>pushToUpdateQueue(networks);<NEW_LINE>networks = _networkDao.listRedundantNetworks();<NEW_LINE>s_logger.debug("Found " + networks.size() + " networks to update RvR status. ");<NEW_LINE>pushToUpdateQueue(networks);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>s_logger.error("Fail to complete the CheckRouterTask! ", ex);<NEW_LINE>}<NEW_LINE>}
networks.size() + " VPC's to update Redundant State. ");
335,355
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>for (int i = 0; i < accessModes_.size(); i++) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessModes_.getRaw(i));<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeMessage(2, getResources());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeMessage(4, getSelector());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, storageClassName_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, volumeMode_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeMessage(7, getDataSource());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>output.writeMessage(8, getDataSourceRef());<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
writeString(output, 3, volumeName_);
165,896
public static void loadSchedulerInfo(AppResult result, HadoopApplicationData data, Scheduler scheduler) {<NEW_LINE>String appId = data.getAppId();<NEW_LINE>result.scheduler = Utils.truncateField(scheduler.getSchedulerName(), AppResult.SCHEDULER_LIMIT, appId);<NEW_LINE>result.workflowDepth = scheduler.getWorkflowDepth();<NEW_LINE>result.jobName = scheduler.getJobName() != null ? Utils.truncateField(scheduler.getJobName(), AppResult.JOB_NAME_LIMIT, appId) : "";<NEW_LINE>result.jobDefId = Utils.truncateField(scheduler.getJobDefId(), AppResult.URL_LEN_LIMIT, appId);<NEW_LINE>result.jobDefUrl = scheduler.getJobDefUrl() != null ? Utils.truncateField(scheduler.getJobDefUrl(), AppResult.URL_LEN_LIMIT, appId) : "";<NEW_LINE>result.jobExecId = Utils.truncateField(scheduler.getJobExecId(), AppResult.URL_LEN_LIMIT, appId);<NEW_LINE>result.jobExecUrl = scheduler.getJobExecUrl() != null ? Utils.truncateField(scheduler.getJobExecUrl(), <MASK><NEW_LINE>result.flowDefId = Utils.truncateField(scheduler.getFlowDefId(), AppResult.URL_LEN_LIMIT, appId);<NEW_LINE>result.flowDefUrl = scheduler.getFlowDefUrl() != null ? Utils.truncateField(scheduler.getFlowDefUrl(), AppResult.URL_LEN_LIMIT, appId) : "";<NEW_LINE>result.flowExecId = Utils.truncateField(scheduler.getFlowExecId(), AppResult.FLOW_EXEC_ID_LIMIT, appId);<NEW_LINE>result.flowExecUrl = scheduler.getFlowExecUrl() != null ? Utils.truncateField(scheduler.getFlowExecUrl(), AppResult.URL_LEN_LIMIT, appId) : "";<NEW_LINE>}
AppResult.URL_LEN_LIMIT, appId) : "";
248,688
protected Map<String, ShardingSphereAlgorithmConfiguration> createShadowAlgorithmConfigurations() {<NEW_LINE>Map<String, ShardingSphereAlgorithmConfiguration> result = new LinkedHashMap<>();<NEW_LINE>Properties userIdInsertProps = new Properties();<NEW_LINE>userIdInsertProps.setProperty("operation", "insert");<NEW_LINE>userIdInsertProps.setProperty("column", "user_type");<NEW_LINE>userIdInsertProps.setProperty("value", "1");<NEW_LINE>result.put("user-id-insert-match-algorithm", new ShardingSphereAlgorithmConfiguration("VALUE_MATCH", userIdInsertProps));<NEW_LINE>Properties userIdDeleteProps = new Properties();<NEW_LINE>userIdDeleteProps.setProperty("operation", "delete");<NEW_LINE><MASK><NEW_LINE>userIdDeleteProps.setProperty("value", "1");<NEW_LINE>result.put("user-id-delete-match-algorithm", new ShardingSphereAlgorithmConfiguration("VALUE_MATCH", userIdDeleteProps));<NEW_LINE>Properties userIdSelectProps = new Properties();<NEW_LINE>userIdSelectProps.setProperty("operation", "select");<NEW_LINE>userIdSelectProps.setProperty("column", "user_type");<NEW_LINE>userIdSelectProps.setProperty("value", "1");<NEW_LINE>result.put("user-id-select-match-algorithm", new ShardingSphereAlgorithmConfiguration("VALUE_MATCH", userIdSelectProps));<NEW_LINE>Properties noteAlgorithmProps = new Properties();<NEW_LINE>noteAlgorithmProps.setProperty("shadow", "true");<NEW_LINE>noteAlgorithmProps.setProperty("foo", "bar");<NEW_LINE>result.put("simple-hint-algorithm", new ShardingSphereAlgorithmConfiguration("SIMPLE_HINT", noteAlgorithmProps));<NEW_LINE>return result;<NEW_LINE>}
userIdDeleteProps.setProperty("column", "user_type");
1,535,027
protected void doValidate(Object value, String inputHint, ValidationContext context, ValidatorConfig config) {<NEW_LINE>if (config == null || config.isEmpty()) {<NEW_LINE>config = defaultConfig;<NEW_LINE>}<NEW_LINE>Number number = null;<NEW_LINE>if (value != null) {<NEW_LINE>try {<NEW_LINE>number = convert(value, config);<NEW_LINE>} catch (NumberFormatException ignore) {<NEW_LINE>// N/A<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (number == null) {<NEW_LINE>context.addError(new ValidationError(getId(), inputHint, MESSAGE_INVALID_NUMBER));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Number min = getMinMaxConfig(config, KEY_MIN);<NEW_LINE>Number max = getMinMaxConfig(config, KEY_MAX);<NEW_LINE>if (min != null && isFirstGreaterThanToSecond(min, number)) {<NEW_LINE>context.addError(new ValidationError(getId(), inputHint, selectRangeErrorMessage(config), min, max));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (max != null && isFirstGreaterThanToSecond(number, max)) {<NEW_LINE>context.addError(new ValidationError(getId(), inputHint, selectRangeErrorMessage(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
config), min, max));
1,845,459
public Optional<ProductPrice> calculateSalesRepNetUnitPrice(@NonNull final ComputeSalesRepPriceRequest request) {<NEW_LINE>final PricingSystemId pricingSystemId = bPartnerDAO.retrievePricingSystemIdOrNull(request.getSalesRepId(), request.getSoTrx());<NEW_LINE>if (pricingSystemId == null) {<NEW_LINE>loggable.addLog("createSalesRepPricingResult - No pricingSystemId set for bpartner={}" + request.getSalesRepId());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final IBPartnerDAO.BPartnerLocationQuery bPartnerLocationQuery = IBPartnerDAO.BPartnerLocationQuery.builder().bpartnerId(request.getSalesRepId()).type(IBPartnerDAO.BPartnerLocationQuery.Type.SHIP_TO).build();<NEW_LINE>final I_C_BPartner_Location salesRepShipToLocation = bPartnerDAO.retrieveBPartnerLocation(bPartnerLocationQuery);<NEW_LINE>if (salesRepShipToLocation == null) {<NEW_LINE>loggable.addLog("createSalesRepPricingResult - No bpartnerSalesRepLocation found for bpartner={}" + request.getSalesRepId());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final LocationId locationId = LocationId.ofRepoId(salesRepShipToLocation.getC_Location_ID());<NEW_LINE>final CountryId countryId = locationDAO.getCountryIdByLocationId(locationId);<NEW_LINE>final PriceListId priceListId = priceListDAO.retrievePriceListIdByPricingSyst(pricingSystemId, <MASK><NEW_LINE>if (priceListId == null) {<NEW_LINE>loggable.addLog("createSalesRepPricingResult - No priceListId set for bpartner={}" + request.getSalesRepId());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final OrgId salesRepOrgId = OrgId.ofRepoId(salesRepShipToLocation.getAD_Org_ID());<NEW_LINE>final IEditablePricingContext salesRepPricingCtx = pricingBL.createInitialContext(salesRepOrgId, request.getProductId(), request.getSalesRepId(), request.getQty(), request.getSoTrx()).setPricingSystemId(pricingSystemId).setCountryId(countryId).setPriceListId(priceListId).setConvertPriceToContextUOM(false);<NEW_LINE>final IPricingResult salesRepPriceResult = pricingBL.calculatePrice(salesRepPricingCtx);<NEW_LINE>if (!salesRepPriceResult.isCalculated()) {<NEW_LINE>loggable.addLog("createSalesRepPricingResult - Price not calculated for bpartner={}" + request.getSalesRepId());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>updatePricingResultToMatchUOM(salesRepPriceResult, request.getQty().getUomId());<NEW_LINE>final Money salesRepNetUnitPriceWithoutTax = deductTaxes(salesRepOrgId, salesRepShipToLocation, request, salesRepPriceResult);<NEW_LINE>final Money salesRepNetUnitPrice = convertToCustomerCurrency(salesRepOrgId, request, salesRepNetUnitPriceWithoutTax);<NEW_LINE>return Optional.of(ProductPrice.builder().money(salesRepNetUnitPrice).productId(salesRepPriceResult.getProductId()).uomId(salesRepPriceResult.getPriceUomId()).build());<NEW_LINE>}
countryId, request.getSoTrx());
826,994
static MTable recommendItems(Object userId, ItemCfRecommData model, int topN, boolean excludeKnown, double[] res, String objectName, TypeInformation<?> objType) {<NEW_LINE>Arrays.fill(res, 0.0);<NEW_LINE>PriorityQueue<RecommItemTopKResult> queue = new PriorityQueue<>(Comparator.comparing(o -> o.similarity));<NEW_LINE>SparseVector itemRate = model.userItemRates.get(userId);<NEW_LINE>if (null == itemRate) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set<Integer> items = model.userItems.get(userId);<NEW_LINE>int[] key = itemRate.getIndices();<NEW_LINE>double[<MASK><NEW_LINE>for (int i = 0; i < key.length; i++) {<NEW_LINE>if (model.itemSimilarityList[key[i]] != null) {<NEW_LINE>for (Tuple2<Integer, Double> t : model.itemSimilarityList[key[i]]) {<NEW_LINE>res[t.f0] += t.f1 * value[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double head = 0;<NEW_LINE>for (int i = 0; i < res.length; i++) {<NEW_LINE>if (excludeKnown && items.contains(i)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>head = updateQueue(queue, topN, res[i] / items.size(), model.items[i], head);<NEW_LINE>}<NEW_LINE>return serializeQueue(queue, KObjectUtil.SCORE_NAME, objectName, objType);<NEW_LINE>}
] value = itemRate.getValues();
1,117,276
private void configChanged() {<NEW_LINE>Settings settings = config.getRawSettings();<NEW_LINE>settings = settings.navigate("spring-boot", "ls", "problem");<NEW_LINE>Map<String, ProblemSeverity> severityOverrides = new HashMap<>();<NEW_LINE>for (String editorType : settings.keys()) {<NEW_LINE>Settings problemConf = settings.navigate(editorType);<NEW_LINE>for (String code : problemConf.keys()) {<NEW_LINE>String severity = problemConf.getString(code);<NEW_LINE>Assert.isLegal(!severityOverrides.containsKey(code), "Multpile entries for problem type " + code);<NEW_LINE>severityOverrides.put(code, ProblemSeverity.valueOf(severity));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>server.setDiagnosticSeverityProvider((ReconcileProblem problem) -> {<NEW_LINE>ProblemSeverity severity = severityOverrides.get(problem.<MASK><NEW_LINE>if (severity == null) {<NEW_LINE>severity = problem.getType().getDefaultSeverity();<NEW_LINE>}<NEW_LINE>return DiagnosticSeverityProvider.diagnosticSeverity(severity);<NEW_LINE>});<NEW_LINE>}
getType().getCode());
1,848,392
protected void parseDefineBitsLossless(InStream in, int length, boolean hasAlpha) throws IOException {<NEW_LINE>int id = in.readUI16();<NEW_LINE>int format = in.readUI8();<NEW_LINE>int width = in.readUI16();<NEW_LINE>int height = in.readUI16();<NEW_LINE>int size = 0;<NEW_LINE>switch(format) {<NEW_LINE>case BITMAP_FORMAT_8_BIT:<NEW_LINE>size = in.readUI8() + 1;<NEW_LINE>break;<NEW_LINE>case BITMAP_FORMAT_16_BIT:<NEW_LINE>size = in.readUI16() + 1;<NEW_LINE>break;<NEW_LINE>case BITMAP_FORMAT_32_BIT:<NEW_LINE>size = 0;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IOException("unknown bitmap format: " + format);<NEW_LINE>}<NEW_LINE>byte[] data = in.read(length - (int) in.getBytesRead());<NEW_LINE>// --unzip the data<NEW_LINE>ByteArrayInputStream bin = new ByteArrayInputStream(data);<NEW_LINE>InflaterInputStream inflater = new InflaterInputStream(bin);<NEW_LINE>InStream dataIn = new InStream(inflater);<NEW_LINE>Color[] colors = hasAlpha ? new AlphaColor[size] : new Color[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>colors[i] = hasAlpha ? new AlphaColor(dataIn) : new Color(dataIn);<NEW_LINE>}<NEW_LINE>byte[] imageData = dataIn.read();<NEW_LINE>if (hasAlpha) {<NEW_LINE>tagtypes.tagDefineBitsLossless2(id, format, width, height, (AlphaColor[]) colors, imageData);<NEW_LINE>} else {<NEW_LINE>tagtypes.tagDefineBitsLossless(id, format, <MASK><NEW_LINE>}<NEW_LINE>}
width, height, colors, imageData);
128,840
protected void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>// Load selected site<NEW_LINE>initSelectedSite();<NEW_LINE>// ensure the deep linking activity is enabled. We might be returning from the external-browser<NEW_LINE>// viewing of a post<NEW_LINE>WPActivityUtils.enableReaderDeeplinks(this);<NEW_LINE>// We need to track the current item on the screen when this activity is resumed.<NEW_LINE>// Ex: Notifications -> notifications detail -> back to notifications<NEW_LINE>PageType currentPageType = mBottomNav.getCurrentSelectedPage();<NEW_LINE>trackLastVisiblePage(currentPageType, mFirstResume);<NEW_LINE>if (currentPageType == PageType.NOTIFS) {<NEW_LINE>// if we are presenting the notifications list, it's safe to clear any outstanding<NEW_LINE>// notifications<NEW_LINE>mGCMMessageHandler.removeAllNotifications(this);<NEW_LINE>}<NEW_LINE>announceTitleForAccessibility(currentPageType);<NEW_LINE>checkConnection();<NEW_LINE>checkQuickStartNotificationStatus();<NEW_LINE>// Update account to update the notification unseen status<NEW_LINE>if (mAccountStore.hasAccessToken()) {<NEW_LINE>mDispatcher.dispatch(AccountActionBuilder.newFetchAccountAction());<NEW_LINE>}<NEW_LINE>ProfilingUtils.split("WPMainActivity.onResume");<NEW_LINE>ProfilingUtils.dump();<NEW_LINE>ProfilingUtils.stop();<NEW_LINE>mViewModel.onResume(getSelectedSite(), mSelectedSiteRepository.hasSelectedSite() && mBottomNav.<MASK><NEW_LINE>mFirstResume = false;<NEW_LINE>}
getCurrentSelectedPage() == PageType.MY_SITE);
13,160
public static void checkPortOpen(int port, long timeoutMs) {<NEW_LINE>Log.info(AcmeFatUtils.class, "checkPortOpen", "Checking if port " + port + " is open, will check for " + timeoutMs + "ms.");<NEW_LINE>boolean open = false;<NEW_LINE>long stoptime = System.currentTimeMillis() + timeoutMs;<NEW_LINE>Exception lastException = null;<NEW_LINE>while (!open && (stoptime > System.currentTimeMillis())) {<NEW_LINE>ServerSocket socket = null;<NEW_LINE>try {<NEW_LINE>// Create unbounded socket<NEW_LINE>socket = new ServerSocket();<NEW_LINE>// This allows the socket to close<NEW_LINE>socket.setReuseAddress(true);<NEW_LINE>// and others to bind to it even<NEW_LINE>// if its in TIME_WAIT state<NEW_LINE>socket.bind(new InetSocketAddress(port));<NEW_LINE>open = true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>lastException = e;<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>// Not a lot to do<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (null != socket) {<NEW_LINE>try {<NEW_LINE>// With setReuseAddress set to true we should free up<NEW_LINE>// our socket and allow<NEW_LINE>// someone else to bind to it even if we are in<NEW_LINE>// TIME_WAIT state.<NEW_LINE>socket.close();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// not a lot to do<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!open) {<NEW_LINE>Log.error(AcmeFatUtils.class, "checkPortOpen", lastException, "Port was not available in time.");<NEW_LINE>}<NEW_LINE>assertTrue("Expected port " + <MASK><NEW_LINE>}
port + " to be open. Last exception while checking: " + lastException, open);
1,218,639
private static void tryAssertion17IStream(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "price" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(200, 1, new Object[][] { { "IBM", 100L, 25d } });<NEW_LINE>expected.addResultInsert(1500, 1, new Object[][] { { "IBM", 150L, 24d } });<NEW_LINE>expected.addResultInsert(3500, 1, new Object[][] { { "YAH", 11000L, 2d } });<NEW_LINE>expected.addResultInsert(4300, 1, new Object[][] { { "IBM", 150L, 22d } });<NEW_LINE>expected.addResultInsert(5900, 1, new Object[][] { { "YAH", 10500L, 1.0d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, <MASK><NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
env, expected, ResultAssertExecutionTestSelector.TEST_ONLY_AS_PROVIDED);
987,953
void assembleMessageParameters() {<NEW_LINE>LOG.info("NetKeyIndex: " + mAppKey.getBoundNetKeyIndex());<NEW_LINE>LOG.info("AppKeyIndex: " + mAppKey.getKeyIndex());<NEW_LINE>final byte[] netKeyIndex = MeshParserUtils.addKeyIndexPadding(mAppKey.getBoundNetKeyIndex());<NEW_LINE>final byte[] appKeyIndex = MeshParserUtils.addKeyIndexPadding(mAppKey.getKeyIndex());<NEW_LINE>final ByteBuffer paramsBuffer = ByteBuffer.allocate(19).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.put(netKeyIndex[1]);<NEW_LINE>paramsBuffer.put((byte) (((appKeyIndex[1] & 0xFF) << 4) | (netKeyIndex[0] & 0xFF) & 0x0F));<NEW_LINE>paramsBuffer.put((byte) (((appKeyIndex[0] & 0xFF) << 4) | (appKeyIndex[1] & 0xFF) >> 4));<NEW_LINE>paramsBuffer.<MASK><NEW_LINE>mParameters = paramsBuffer.array();<NEW_LINE>}
put(mAppKey.getKey());
1,015,247
private void registerAddMapLayerReceiver(@NonNull MapActivity mapActivity) {<NEW_LINE>final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);<NEW_LINE>BroadcastReceiver addMapLayerReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>MapActivity mapActivity = mapActivityRef.get();<NEW_LINE>String layerId = intent.getStringExtra(AIDL_OBJECT_ID);<NEW_LINE>String packName = intent.getStringExtra(AIDL_PACKAGE_NAME);<NEW_LINE>if (mapActivity != null && layerId != null && packName != null) {<NEW_LINE>ConnectedApp <MASK><NEW_LINE>if (connectedApp != null) {<NEW_LINE>AidlMapLayerWrapper layer = connectedApp.getLayers().get(layerId);<NEW_LINE>if (layer != null) {<NEW_LINE>OsmandMapLayer mapLayer = connectedApp.getMapLayers().get(layerId);<NEW_LINE>if (mapLayer != null) {<NEW_LINE>mapActivity.getMapView().removeLayer(mapLayer);<NEW_LINE>}<NEW_LINE>mapLayer = new AidlMapLayer(mapActivity, layer, connectedApp.getPack());<NEW_LINE>mapActivity.getMapView().addLayer(mapLayer, layer.getZOrder());<NEW_LINE>connectedApp.getMapLayers().put(layerId, mapLayer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>registerReceiver(addMapLayerReceiver, mapActivity, AIDL_ADD_MAP_LAYER);<NEW_LINE>}
connectedApp = connectedApps.get(packName);
626,556
public void exitIf_ipv4_access_group(If_ipv4_access_groupContext ctx) {<NEW_LINE>int line = ctx.start.getLine();<NEW_LINE>if (ctx.common_acl != null) {<NEW_LINE>String <MASK><NEW_LINE>_configuration.referenceStructure(IPV4_ACCESS_LIST, name, INTERFACE_IPV4_ACCESS_GROUP_COMMON, line);<NEW_LINE>}<NEW_LINE>if (ctx.interface_acl != null) {<NEW_LINE>String name = toString(ctx.interface_acl);<NEW_LINE>CiscoXrStructureUsage usage = null;<NEW_LINE>if (ctx.INGRESS() != null) {<NEW_LINE>_currentInterface.setIncomingFilter(name);<NEW_LINE>usage = INTERFACE_IPV4_ACCESS_GROUP_INGRESS;<NEW_LINE>} else {<NEW_LINE>assert ctx.EGRESS() != null;<NEW_LINE>_currentInterface.setOutgoingFilter(name);<NEW_LINE>usage = INTERFACE_IPV4_ACCESS_GROUP_EGRESS;<NEW_LINE>}<NEW_LINE>_configuration.referenceStructure(IPV4_ACCESS_LIST, name, usage, line);<NEW_LINE>}<NEW_LINE>}
name = toString(ctx.common_acl);
267,916
public void marshall(CreateModelPackageRequest createModelPackageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createModelPackageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageName(), MODELPACKAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageGroupName(), MODELPACKAGEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageDescription(), MODELPACKAGEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getInferenceSpecification(), INFERENCESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getValidationSpecification(), VALIDATIONSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getSourceAlgorithmSpecification(), SOURCEALGORITHMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getCertifyForMarketplace(), CERTIFYFORMARKETPLACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelApprovalStatus(), MODELAPPROVALSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getMetadataProperties(), METADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelMetrics(), MODELMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getCustomerMetadataProperties(), CUSTOMERMETADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getDriftCheckBaselines(), DRIFTCHECKBASELINES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getTask(), TASK_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getSamplePayloadUrl(), SAMPLEPAYLOADURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getAdditionalInferenceSpecifications(), ADDITIONALINFERENCESPECIFICATIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,261,924
public Mono<Response<Void>> stopWithResponseAsync(String resourceGroupName, String containerGroupName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (containerGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), resourceGroupName, containerGroupName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,179,493
public static PickOutboundNumbersResponse unmarshall(PickOutboundNumbersResponse pickOutboundNumbersResponse, UnmarshallerContext _ctx) {<NEW_LINE>pickOutboundNumbersResponse.setRequestId(_ctx.stringValue("PickOutboundNumbersResponse.RequestId"));<NEW_LINE>pickOutboundNumbersResponse.setCode(_ctx.stringValue("PickOutboundNumbersResponse.Code"));<NEW_LINE>pickOutboundNumbersResponse.setHttpStatusCode(_ctx.integerValue("PickOutboundNumbersResponse.HttpStatusCode"));<NEW_LINE>pickOutboundNumbersResponse.setMessage(_ctx.stringValue("PickOutboundNumbersResponse.Message"));<NEW_LINE>List<NumberPair> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("PickOutboundNumbersResponse.Data.Length"); i++) {<NEW_LINE>NumberPair numberPair = new NumberPair();<NEW_LINE>Callee callee = new Callee();<NEW_LINE>callee.setNumber(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Callee.Number"));<NEW_LINE>callee.setCity(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Callee.City"));<NEW_LINE>callee.setProvince(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Callee.Province"));<NEW_LINE>numberPair.setCallee(callee);<NEW_LINE>Caller caller = new Caller();<NEW_LINE>caller.setNumber(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Caller.Number"));<NEW_LINE>caller.setCity(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Caller.City"));<NEW_LINE>caller.setProvince(_ctx.stringValue("PickOutboundNumbersResponse.Data[" + i + "].Caller.Province"));<NEW_LINE>numberPair.setCaller(caller);<NEW_LINE>data.add(numberPair);<NEW_LINE>}<NEW_LINE>pickOutboundNumbersResponse.setData(data);<NEW_LINE>return pickOutboundNumbersResponse;<NEW_LINE>}
= new ArrayList<NumberPair>();
1,563,199
public List<String> readHeaderValuesAsString(final String headerName) {<NEW_LINE>final int maxChars = Integer.parseInt(appConfig.readAppProperty(AppProperty.HTTP_PARAM_MAX_READ_LENGTH));<NEW_LINE>final List<String> <MASK><NEW_LINE>for (final Enumeration<String> headerValueEnum = this.getHttpServletRequest().getHeaders(headerName); headerValueEnum.hasMoreElements(); ) {<NEW_LINE>final String headerValue = headerValueEnum.nextElement();<NEW_LINE>final String sanitizedInputValue = Validator.sanitizeInputValue(appConfig, headerValue, maxChars);<NEW_LINE>final String sanitizedHeaderValue = Validator.sanitizeHeaderValue(appConfig, sanitizedInputValue);<NEW_LINE>if (sanitizedHeaderValue != null && !sanitizedHeaderValue.isEmpty()) {<NEW_LINE>valueList.add(sanitizedHeaderValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(valueList);<NEW_LINE>}
valueList = new ArrayList<>();
1,717,649
private static void handleClass(final Map<String, RdfClass> classes, final Set<HasSubclassRelationship> subclasses, final Node classNode) {<NEW_LINE>final <MASK><NEW_LINE>final String comment = getChildString(classNode, "rdfs:comment");<NEW_LINE>final String rawName = getString(attributes, "rdf:ID") != null ? getString(attributes, "rdf:ID") : getString(attributes, "rdf:about");<NEW_LINE>classes.put(rawName, new RdfClass(rawName, comment));<NEW_LINE>for (Node node = classNode.getChildNodes().item(0); node != null; node = node.getNextSibling()) {<NEW_LINE>final String type = node.getNodeName();<NEW_LINE>if ("rdfs:subClassOf".equals(type)) {<NEW_LINE>final String parent = handleSubclass(classes, node);<NEW_LINE>subclasses.add(new HasSubclassRelationship(parent, rawName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
NamedNodeMap attributes = classNode.getAttributes();
1,359,314
public IPSet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>IPSet iPSet = new IPSet();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("IPSetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSet.setIPSetId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSet.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("IPSetDescriptors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>iPSet.setIPSetDescriptors(new ListUnmarshaller<IPSetDescriptor>(IPSetDescriptorJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return iPSet;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();