idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
515,131
public void preFillOperationsFromOptionals(ActionRequest request, ActionResponse response) {<NEW_LINE>Set<Map<String, Object>> optionalControlPoints = new HashSet<Map<String, Object>>();<NEW_LINE>List<ControlPoint> optionalControlPointList = new ArrayList<ControlPoint>();<NEW_LINE>Collection<Map<String, Object>> optionalControlPointSet = (Collection<Map<String, Object>>) request.getContext().get("optionalControlPointSet");<NEW_LINE>if (optionalControlPointSet != null) {<NEW_LINE>optionalControlPoints.addAll(optionalControlPointSet);<NEW_LINE>}<NEW_LINE>for (Map<String, Object> optionalControlPointData : optionalControlPoints) {<NEW_LINE>ControlPoint optionalControlPoint = Beans.get(ControlPointRepository.class).find(Long.parseLong(optionalControlPointData.get("id").toString()));<NEW_LINE>optionalControlPointList.add(optionalControlPoint);<NEW_LINE>}<NEW_LINE>LinkedHashMap<String, Object> qualityControlMap = (LinkedHashMap<String, Object>) request.getContext().get("_qualityControl");<NEW_LINE>QualityControl qualityControl = Beans.get(QualityControlRepository.class).find(((Integer) qualityControlMap.get(<MASK><NEW_LINE>Beans.get(QualityControlService.class).preFillOperationsFromOptionals(qualityControl, optionalControlPointList);<NEW_LINE>response.setCanClose(true);<NEW_LINE>}
"id")).longValue());
1,566,900
public void fullRedraw() {<NEW_LINE>makeLayerElement();<NEW_LINE>addCSSClasses();<NEW_LINE>final OPTICSPlot opticsplot = optics.getOPTICSPlot(context);<NEW_LINE>final ClusterOrder co = getClusterOrder();<NEW_LINE>final int oheight = opticsplot.getHeight();<NEW_LINE>final double xscale = plotwidth / (double) co.size();<NEW_LINE>final double <MASK><NEW_LINE>DBIDArrayIter tmp = co.iter();<NEW_LINE>for (OPTICSXi.SteepArea area : areas) {<NEW_LINE>boolean down = area instanceof OPTICSXi.SteepDownArea;<NEW_LINE>final int st = area.getStartIndex();<NEW_LINE>final int en = area.getEndIndex() + 1;<NEW_LINE>final double x1 = st + (down ? 1. : .5);<NEW_LINE>final double x2 = en + (down ? .5 : 0.);<NEW_LINE>final double y1 = opticsplot.scaleToPixel(co.getReachability(tmp.seek(st)));<NEW_LINE>final double y2 = opticsplot.scaleToPixel(en < co.size() ? co.getReachability(tmp.seek(en)) : Double.POSITIVE_INFINITY);<NEW_LINE>Element e = svgp.svgLine(x1 * xscale, y1 * yscale, x2 * xscale, y2 * yscale);<NEW_LINE>SVGUtil.addCSSClass(e, down ? CSS_STEEP_DOWN : CSS_STEEP_UP);<NEW_LINE>layer.appendChild(e);<NEW_LINE>}<NEW_LINE>}
yscale = plotheight / (double) oheight;
1,764,373
public void marshall(ColorCorrector colorCorrector, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (colorCorrector == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(colorCorrector.getBrightness(), BRIGHTNESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(colorCorrector.getColorSpaceConversion(), COLORSPACECONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(colorCorrector.getContrast(), CONTRAST_BINDING);<NEW_LINE>protocolMarshaller.marshall(colorCorrector.getHdr10Metadata(), HDR10METADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(colorCorrector.getSampleRangeConversion(), SAMPLERANGECONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(colorCorrector.getSaturation(), SATURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
colorCorrector.getHue(), HUE_BINDING);
1,011,065
final DeleteCertificateResult executeDeleteCertificate(DeleteCertificateRequest deleteCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteCertificateRequest> request = null;<NEW_LINE>Response<DeleteCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCertificateRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCertificateResultJsonUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,139,777
private static BitfinexWebSocketAuthOrder createOrderObject(JsonNode order) {<NEW_LINE>if (order.size() < 32) {<NEW_LINE>LOG.error("createOrderObject unexpected record size={}, record={}", order.size(), order.toString());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long id = order.get(0).longValue();<NEW_LINE>long groupId = order.get(1).longValue();<NEW_LINE>long cid = order.get(2).longValue();<NEW_LINE>String symbol = order.get(3).textValue();<NEW_LINE>long mtsCreate = order.get(4).longValue();<NEW_LINE>long mtsUpdate = order.get(5).longValue();<NEW_LINE>BigDecimal amount = order.get(6).decimalValue();<NEW_LINE>BigDecimal amountOrig = order.get(7).decimalValue();<NEW_LINE>String type = order.get(8).textValue();<NEW_LINE>String typePrev = order.get(9).textValue();<NEW_LINE>int flags = order.get(12).intValue();<NEW_LINE>String orderStatus = order.get(13).textValue();<NEW_LINE>BigDecimal price = order.get(16).decimalValue();<NEW_LINE>BigDecimal priceAvg = order.get(17).decimalValue();<NEW_LINE>BigDecimal priceTrailing = order.<MASK><NEW_LINE>BigDecimal priceAuxLimit = order.get(19).decimalValue();<NEW_LINE>long placedId = order.get(25).longValue();<NEW_LINE>return new BitfinexWebSocketAuthOrder(id, groupId, cid, symbol, mtsCreate, mtsUpdate, amount, amountOrig, type, typePrev, orderStatus, price, priceAvg, priceTrailing, priceAuxLimit, placedId, flags);<NEW_LINE>}
get(18).decimalValue();
17,282
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {<NEW_LINE>super.onActivityResult(requestCode, resultCode, data);<NEW_LINE>if (requestCode == SUBREDDIT_SELECTION_REQUEST_CODE) {<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>if (data != null) {<NEW_LINE>subredditName = <MASK><NEW_LINE>iconUrl = data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_ICON_URL);<NEW_LINE>subredditSelected = true;<NEW_LINE>subredditIsUser = data.getBooleanExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_IS_USER, false);<NEW_LINE>subredditNameTextView.setTextColor(primaryTextColor);<NEW_LINE>subredditNameTextView.setText(subredditName);<NEW_LINE>displaySubredditIcon();<NEW_LINE>flairTextView.setVisibility(View.VISIBLE);<NEW_LINE>flairTextView.setBackgroundColor(resources.getColor(android.R.color.transparent));<NEW_LINE>flairTextView.setTextColor(primaryTextColor);<NEW_LINE>flairTextView.setText(getString(R.string.flair));<NEW_LINE>flair = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (requestCode == PICK_VIDEO_REQUEST_CODE) {<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>if (data == null) {<NEW_LINE>Snackbar.make(coordinatorLayout, R.string.error_getting_video, Snackbar.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>videoUri = data.getData();<NEW_LINE>loadVideo();<NEW_LINE>}<NEW_LINE>} else if (requestCode == CAPTURE_VIDEO_REQUEST_CODE) {<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>if (data != null && data.getData() != null) {<NEW_LINE>videoUri = data.getData();<NEW_LINE>loadVideo();<NEW_LINE>} else {<NEW_LINE>Snackbar.make(coordinatorLayout, R.string.error_getting_video, Snackbar.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
data.getStringExtra(SubredditSelectionActivity.EXTRA_RETURN_SUBREDDIT_NAME);
1,413,961
public TemplateModel exec(List args) throws TemplateModelException {<NEW_LINE>if (args.size() == 1) {<NEW_LINE>String messageKey = ((SimpleScalar) args.get(0)).getAsString();<NEW_LINE>String messageValue = messages.get(messageKey, language);<NEW_LINE>return new SimpleScalar(messageValue);<NEW_LINE>} else if (args.size() > 1) {<NEW_LINE>List<Object> objects = new ArrayList<>();<NEW_LINE>for (Object o : args) {<NEW_LINE>if (o instanceof SimpleScalar) {<NEW_LINE>objects.add(((SimpleScalar) o).getAsString());<NEW_LINE>} else if (o instanceof SimpleNumber) {<NEW_LINE>objects.add(o.toString());<NEW_LINE>} else if (o instanceof StringModel) {<NEW_LINE>objects.add(((StringModel<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String messageKey = objects.get(0).toString();<NEW_LINE>String messageValue = messages.get(messageKey, language, objects.subList(1, objects.size()).toArray());<NEW_LINE>return new SimpleScalar(messageValue);<NEW_LINE>} else {<NEW_LINE>throw new TemplateModelException("Please specify a message key for the i18n() method!");<NEW_LINE>}<NEW_LINE>}
) o).getWrappedObject());
196,584
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.openhab.binding.digitalSTROM2.internal.client.job.SensorJob#execute(org.openhab.binding.digitalSTROM2.<NEW_LINE>* internal.client.DigitalSTROMAPI, java.lang.String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void execute(DigitalSTROMAPI digitalSTROM, String token) {<NEW_LINE>int sensorValue = digitalSTROM.getDeviceSensorValue(token, this.device.getDSID(), null, this.sensorIndex);<NEW_LINE>logger.info(this.device.getName() + " DeviceSensorValue : " + this.sensorIndex + " " + this.sensorIndex.ordinal() + " " + this.sensorIndex.getIndex() + " " + sensorValue + ", DSID: " + this.device.getDSID().getValue());<NEW_LINE>switch(this.sensorIndex) {<NEW_LINE>case TEMPERATURE_INDOORS:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_INDOORS:<NEW_LINE>this.device.setHumiditySensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case TEMPERATURE_OUTDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_OUTDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
this.device.setTemperatureSensorValue(sensorValue);
765,337
final UpdateDomainNameResult executeUpdateDomainName(UpdateDomainNameRequest updateDomainNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainNameRequest> request = null;<NEW_LINE>Response<UpdateDomainNameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainNameRequest));<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, "AppSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDomainName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDomainNameResultJsonUnmarshaller());<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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
753,201
public static void main(String[] args) {<NEW_LINE>final String resultsFolder = "target" + File.separatorChar + "results";<NEW_LINE>final String reportsFolder = "target" + File.separatorChar + "reports";<NEW_LINE>String longTermBenchmarkResultFilename = System.getProperty("longTermBenchmarkResultFile");<NEW_LINE>if (longTermBenchmarkResultFilename != null) {<NEW_LINE>File longTermBenchmarkResultFile = new File(longTermBenchmarkResultFilename);<NEW_LINE>longTermBenchmarkResultFile.getParentFile().mkdirs();<NEW_LINE>if (longTermBenchmarkResultFile.exists()) {<NEW_LINE>// Do nothing, append current results later<NEW_LINE>} else {<NEW_LINE>FileUtil.appendStringToFile("name;" + "number of runs;" + "database;" + "history level;" + "starttime;" + "platform;" + "number of threads;" + "duration;" + "throughput", longTermBenchmarkResultFilename);<NEW_LINE>}<NEW_LINE>TabularResultSet longTermResultTable = new BenchmarkLongtermAggregator(resultsFolder).execute();<NEW_LINE>FileUtil.appendStringToFile(CsvUtil.resultSetAsCsv(longTermResultTable), longTermBenchmarkResultFilename);<NEW_LINE>}<NEW_LINE>writeReport(resultsFolder, reportsFolder, "benchmark", <MASK><NEW_LINE>}
new BenchmarkAggregator(resultsFolder), "Benchmark Duration Report");
1,194,446
final ListQueuesResult executeListQueues(ListQueuesRequest listQueuesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listQueuesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListQueuesRequest> request = null;<NEW_LINE>Response<ListQueuesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListQueuesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listQueuesRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListQueues");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListQueuesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListQueuesResultJsonUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
225,099
private static String convertSpecialCharacters(StringBuilder idlName) {<NEW_LINE>for (int i = 0; i < idlName.length(); ++i) {<NEW_LINE>char c = idlName.charAt(i);<NEW_LINE>if (c == '$' || c > 255) {<NEW_LINE>idlName.replace(i, i + 1, "U");<NEW_LINE>String hex = Integer.<MASK><NEW_LINE>int numHex = hex.length();<NEW_LINE>int numZero = 4 - numHex;<NEW_LINE>while (numZero > 0) {<NEW_LINE>idlName.insert(++i, '0');<NEW_LINE>--numZero;<NEW_LINE>}<NEW_LINE>idlName.insert(i + 1, hex);<NEW_LINE>i += numHex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (idlName.charAt(0) == '_') {<NEW_LINE>idlName.insert(0, 'J');<NEW_LINE>}<NEW_LINE>return idlName.toString();<NEW_LINE>}
toHexString(c).toUpperCase();
881,283
public void marshall(ContainerRecipeSummary containerRecipeSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (containerRecipeSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getContainerType(), CONTAINERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getParentImage(), PARENTIMAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getDateCreated(), DATECREATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
containerRecipeSummary.getOwner(), OWNER_BINDING);
1,722,863
public void save(JasperPrint jasperPrint, File file) throws JRException {<NEW_LINE>if (!file.getName().toLowerCase().endsWith(EXTENSION_XML) && !file.getName().toLowerCase().endsWith(EXTENSION_JRPXML)) {<NEW_LINE>file = new File(<MASK><NEW_LINE>}<NEW_LINE>if (!file.exists() || JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(null, MessageFormat.format(getBundleString("file.exists"), new Object[] { file.getName() }), getBundleString("save"), JOptionPane.OK_CANCEL_OPTION)) {<NEW_LINE>JRXmlExporter exporter = new JRXmlExporter(getJasperReportsContext());<NEW_LINE>exporter.setExporterInput(new SimpleExporterInput(jasperPrint));<NEW_LINE>SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(file);<NEW_LINE>output.setEmbeddingImages(false);<NEW_LINE>exporter.setExporterOutput(output);<NEW_LINE>exporter.exportReport();<NEW_LINE>}<NEW_LINE>}
file.getAbsolutePath() + EXTENSION_JRPXML);
921,361
public SegmentResponse createSegment(AmazonPinpointClient client, String appId) {<NEW_LINE>Map<String, AttributeDimension> segmentAttributes = new HashMap<>();<NEW_LINE>segmentAttributes.put("Team", new AttributeDimension().withAttributeType(AttributeType.INCLUSIVE).withValues("Lakers"));<NEW_LINE>SegmentBehaviors segmentBehaviors = new SegmentBehaviors();<NEW_LINE>SegmentDemographics segmentDemographics = new SegmentDemographics();<NEW_LINE>SegmentLocation segmentLocation = new SegmentLocation();<NEW_LINE>RecencyDimension recencyDimension = new RecencyDimension();<NEW_LINE>recencyDimension.withDuration<MASK><NEW_LINE>segmentBehaviors.setRecency(recencyDimension);<NEW_LINE>SegmentDimensions dimensions = new SegmentDimensions().withAttributes(segmentAttributes).withBehavior(segmentBehaviors).withDemographic(segmentDemographics).withLocation(segmentLocation);<NEW_LINE>WriteSegmentRequest writeSegmentRequest = new WriteSegmentRequest().withName("MySegment").withDimensions(dimensions);<NEW_LINE>CreateSegmentRequest createSegmentRequest = new CreateSegmentRequest().withApplicationId(appId).withWriteSegmentRequest(writeSegmentRequest);<NEW_LINE>CreateSegmentResult createSegmentResult = client.createSegment(createSegmentRequest);<NEW_LINE>System.out.println("Segment ID: " + createSegmentResult.getSegmentResponse().getId());<NEW_LINE>return createSegmentResult.getSegmentResponse();<NEW_LINE>}
("DAY_30").withRecencyType("ACTIVE");
954,010
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE><MASK><NEW_LINE>HttpSession ses = request.getSession(true);<NEW_LINE>Locale locale = new Locale(Validate.validateLanguage(ses));<NEW_LINE>boolean validSession = Validate.validateSession(ses);<NEW_LINE>boolean validRequest = Validate.validateTokens(Validate.getToken(request.getCookies()), request.getParameter("csrfToken"));<NEW_LINE>if (validSession && validRequest) {<NEW_LINE>JSONArray theModules = new JSONArray();<NEW_LINE>String userId = ses.getAttribute("userStamp").toString();<NEW_LINE>String floor = new String();<NEW_LINE>// Return All Level Information with Completed/NotCompleted Flags for this user's session<NEW_LINE>if (ModulePlan.isIncrementalFloor()) {<NEW_LINE>floor = "ctf";<NEW_LINE>} else if (ModulePlan.isOpenFloor()) {<NEW_LINE>floor = "by-type";<NEW_LINE>} else {<NEW_LINE>floor = "by-difficulty";<NEW_LINE>}<NEW_LINE>theModules = Getter.getModulesJson(userId, floor, locale);<NEW_LINE>response.setContentType("application/json");<NEW_LINE>out.write(theModules.toJSONString());<NEW_LINE>} else {<NEW_LINE>if (!validSession) {<NEW_LINE>log.debug("Unauthentiated Module List Call");<NEW_LINE>// Return 403<NEW_LINE>response.setStatus(HttpServletResponse.SC_FORBIDDEN);<NEW_LINE>} else {<NEW_LINE>log.debug("CSRF Attack Detected");<NEW_LINE>// Return 400<NEW_LINE>response.setStatus(HttpServletResponse.SC_BAD_REQUEST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out.print(getServletInfo());
1,552,875
public static int pickBestTransparency(Image image) {<NEW_LINE>// Take a shortcut if possible<NEW_LINE>if (image instanceof BufferedImage) {<NEW_LINE>return pickBestTransparency((BufferedImage) image);<NEW_LINE>}<NEW_LINE>// Legacy method<NEW_LINE>// NOTE: This is a horrible memory hog<NEW_LINE>int width = image.getWidth(null);<NEW_LINE>int height = image.getHeight(null);<NEW_LINE>int[] pixelArray = new int[width * height];<NEW_LINE>PixelGrabber pg = new PixelGrabber(image, 0, 0, width, height, pixelArray, 0, width);<NEW_LINE>try {<NEW_LINE>pg.grabPixels();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>System.err.println("interrupted waiting for pixels!");<NEW_LINE>return Transparency.OPAQUE;<NEW_LINE>}<NEW_LINE>if ((pg.getStatus() & ImageObserver.ABORT) != 0) {<NEW_LINE>log.error("image fetch aborted or errored");<NEW_LINE>System.err.println("image fetch aborted or errored");<NEW_LINE>return Transparency.OPAQUE;<NEW_LINE>}<NEW_LINE>// Look for specific pixels<NEW_LINE>boolean foundTransparent = false;<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>// Get the next pixel<NEW_LINE>int pixel = <MASK><NEW_LINE>int alpha = (pixel >> 24) & 0xff;<NEW_LINE>// Is there translucency or just pure transparency ?<NEW_LINE>if (alpha > 0 && alpha < 255) {<NEW_LINE>return Transparency.TRANSLUCENT;<NEW_LINE>}<NEW_LINE>if (alpha == 0 && !foundTransparent) {<NEW_LINE>foundTransparent = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foundTransparent ? Transparency.BITMASK : Transparency.OPAQUE;<NEW_LINE>}
pixelArray[y * width + x];
773,704
protected void handleRedirect(FacesContext context, Throwable rootCause, ExceptionInfo info, boolean responseResetted) throws IOException {<NEW_LINE>ExternalContext externalContext = context.getExternalContext();<NEW_LINE>externalContext.getSessionMap().put(ExceptionInfo.ATTRIBUTE_NAME, info);<NEW_LINE>Map<String, String> errorPages = PrimeApplicationContext.getCurrentInstance(context).getConfig().getErrorPages();<NEW_LINE>String errorPage = evaluateErrorPage(errorPages, rootCause);<NEW_LINE>String url = constructRedirectUrl(context, errorPage);<NEW_LINE>// workaround for mojarra -> mojarra doesn't reset PartialResponseWriter#inChanges if we call externalContext#resetResponse<NEW_LINE>if (responseResetted && context.getPartialViewContext().isAjaxRequest()) {<NEW_LINE>PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();<NEW_LINE>externalContext.addResponseHeader("Content-Type", "text/xml; charset=" + externalContext.getResponseCharacterEncoding());<NEW_LINE>externalContext.addResponseHeader("Cache-Control", "no-cache");<NEW_LINE>externalContext.setResponseContentType("text/xml");<NEW_LINE>writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");<NEW_LINE>writer.startElement("partial-response", null);<NEW_LINE><MASK><NEW_LINE>writer.writeAttribute("url", url, null);<NEW_LINE>writer.endElement("redirect");<NEW_LINE>writer.endElement("partial-response");<NEW_LINE>} else {<NEW_LINE>// workaround for IllegalStateException from redirect of committed response<NEW_LINE>if (externalContext.isResponseCommitted() && !context.getPartialViewContext().isAjaxRequest()) {<NEW_LINE>PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();<NEW_LINE>writer.startElement("script", null);<NEW_LINE>writer.write("window.location.href = '" + url + "';");<NEW_LINE>writer.endElement("script");<NEW_LINE>writer.getWrapped().endDocument();<NEW_LINE>} else {<NEW_LINE>externalContext.redirect(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.responseComplete();<NEW_LINE>}
writer.startElement("redirect", null);
1,092,666
final GetPolicyResult executeGetPolicy(GetPolicyRequest getPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPolicyRequest> request = null;<NEW_LINE>Response<GetPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPolicyRequest));<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, "ACM PCA");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPolicyResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
927,658
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>setDebugLogSubmitMultiTapView(view.findViewById(R.id.verify_header));<NEW_LINE>countryCode = view.findViewById(R.id.country_code);<NEW_LINE>number = view.findViewById(R.id.number);<NEW_LINE>countrySpinner = view.findViewById(R.id.country_spinner);<NEW_LINE>cancel = view.findViewById(R.id.cancel_button);<NEW_LINE>scrollView = view.findViewById(R.id.scroll_view);<NEW_LINE>register = view.findViewById(R.id.registerButton);<NEW_LINE>RegistrationNumberInputController controller = new RegistrationNumberInputController(requireContext(), countryCode, number, countrySpinner, true, this);<NEW_LINE>register.setOnClickListener(v -> handleRegister(requireContext()));<NEW_LINE>disposables.bindTo(getViewLifecycleOwner().getLifecycle());<NEW_LINE>viewModel = new ViewModelProvider(requireActivity()<MASK><NEW_LINE>if (viewModel.isReregister()) {<NEW_LINE>cancel.setVisibility(View.VISIBLE);<NEW_LINE>cancel.setOnClickListener(v -> Navigation.findNavController(v).navigateUp());<NEW_LINE>} else {<NEW_LINE>cancel.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>viewModel.getLiveNumber().observe(getViewLifecycleOwner(), controller::updateNumber);<NEW_LINE>if (viewModel.hasCaptchaToken()) {<NEW_LINE>ThreadUtil.runOnMainDelayed(() -> handleRegister(requireContext()), 250);<NEW_LINE>}<NEW_LINE>Toolbar toolbar = view.findViewById(R.id.toolbar);<NEW_LINE>((AppCompatActivity) requireActivity()).setSupportActionBar(toolbar);<NEW_LINE>((AppCompatActivity) requireActivity()).getSupportActionBar().setTitle(null);<NEW_LINE>}
).get(RegistrationViewModel.class);
1,161,923
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "Braket");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
125,421
public synchronized void addVariable(String deploymentId, VariableMetaData metaData, String optionalDeploymentIdContext, DataInputOutputSerde optionalSerde) {<NEW_LINE>// check if already exists<NEW_LINE>VariableDeployment deploymentEntry = deploymentsWithVariables.get(deploymentId);<NEW_LINE>if (deploymentEntry != null) {<NEW_LINE>Variable variable = deploymentEntry.getVariable(metaData.getVariableName());<NEW_LINE>if (variable != null) {<NEW_LINE>throw new IllegalArgumentException("Variable already exists by name '" + metaData.getVariableName() + "' and deployment '" + deploymentId + "'");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>deploymentEntry = new VariableDeployment();<NEW_LINE>deploymentsWithVariables.put(deploymentId, deploymentEntry);<NEW_LINE>}<NEW_LINE>// find empty spot<NEW_LINE>int emptySpot = -1;<NEW_LINE>int count = 0;<NEW_LINE>for (Map<Integer, VariableReader> entry : variableVersionsPerCP) {<NEW_LINE>if (entry == null) {<NEW_LINE>emptySpot = count;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>int variableNumber;<NEW_LINE>if (emptySpot != -1) {<NEW_LINE>variableNumber = emptySpot;<NEW_LINE>variableVersionsPerCP.set(emptySpot, new ConcurrentHashMap<>());<NEW_LINE>changeCallbacksPerCP.set(emptySpot, null);<NEW_LINE>} else {<NEW_LINE>variableNumber = currentVariableNumber;<NEW_LINE>variableVersionsPerCP.add<MASK><NEW_LINE>changeCallbacksPerCP.add(null);<NEW_LINE>currentVariableNumber++;<NEW_LINE>}<NEW_LINE>Variable variable = new Variable(variableNumber, deploymentId, metaData, optionalDeploymentIdContext);<NEW_LINE>deploymentEntry.addVariable(metaData.getVariableName(), variable);<NEW_LINE>if (optionalStateHandler != null && !metaData.isConstant()) {<NEW_LINE>optionalStateHandler.addVariable(deploymentId, metaData.getVariableName(), variable, optionalSerde);<NEW_LINE>}<NEW_LINE>}
(new ConcurrentHashMap<>());
1,260,116
private MethodType callCheckMethod(Warner warner, Inliner inliner, Object resultInfo, List<Type> actualArgTypes, MethodSymbol methodSymbol, Type site, Env<AttrContext> env) throws InferException {<NEW_LINE>try {<NEW_LINE>Method checkMethod;<NEW_LINE>checkMethod = Resolve.class.getDeclaredMethod("checkMethod", Env.class, Type.class, Symbol.class, // ResultInfo is package-private<NEW_LINE>Class.// ResultInfo is package-private<NEW_LINE>forName("com.sun.tools.javac.comp.Attr$ResultInfo"), List.class, <MASK><NEW_LINE>checkMethod.setAccessible(true);<NEW_LINE>return (MethodType) checkMethod.invoke(Resolve.instance(inliner.getContext()), env, site, methodSymbol, resultInfo, actualArgTypes, /* freeTypeVariables */<NEW_LINE>List.<Type>nil(), warner);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getCause() instanceof Resolve.InapplicableMethodException) {<NEW_LINE>throw new InferException(ImmutableList.of(((Resolve.InapplicableMethodException) e.getTargetException()).getDiagnostic()));<NEW_LINE>}<NEW_LINE>throw new LinkageError(e.getMessage(), e.getCause());<NEW_LINE>} catch (ReflectiveOperationException e) {<NEW_LINE>throw new LinkageError(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
List.class, Warner.class);
642,787
public RelNode visit(QueryOperation other) {<NEW_LINE>if (other instanceof PlannerQueryOperation) {<NEW_LINE>return ((PlannerQueryOperation) other).getCalciteTree();<NEW_LINE>} else if (other instanceof DataStreamQueryOperation) {<NEW_LINE>return convertToDataStreamScan(<MASK><NEW_LINE>} else if (other instanceof JavaDataStreamQueryOperation) {<NEW_LINE>JavaDataStreamQueryOperation<?> dataStreamQueryOperation = (JavaDataStreamQueryOperation<?>) other;<NEW_LINE>return convertToDataStreamScan(dataStreamQueryOperation.getDataStream(), dataStreamQueryOperation.getFieldIndices(), dataStreamQueryOperation.getTableSchema(), dataStreamQueryOperation.getIdentifier());<NEW_LINE>} else if (other instanceof ScalaDataStreamQueryOperation) {<NEW_LINE>ScalaDataStreamQueryOperation dataStreamQueryOperation = (ScalaDataStreamQueryOperation<?>) other;<NEW_LINE>return convertToDataStreamScan(dataStreamQueryOperation.getDataStream(), dataStreamQueryOperation.getFieldIndices(), dataStreamQueryOperation.getTableSchema(), dataStreamQueryOperation.getIdentifier());<NEW_LINE>}<NEW_LINE>throw new TableException("Unknown table operation: " + other);<NEW_LINE>}
(DataStreamQueryOperation<?>) other);
1,121,901
protected LeafRope makeValidLeafRopeAsciiCompat(byte[] bytes, Encoding encoding, CodeRange codeRange, NotProvided characterLength, @Cached BranchProfile errorProfile, @Cached CalculateCharacterLengthNode calculateCharacterLengthNode) {<NEW_LINE>// Extracted from StringSupport.strLength.<NEW_LINE>int calculatedCharacterLength = 0;<NEW_LINE>int p = 0;<NEW_LINE>int e = bytes.length;<NEW_LINE>while (p < e) {<NEW_LINE>if (Encoding.isAscii(bytes[p])) {<NEW_LINE>int q = StringSupport.searchNonAscii(bytes, p, e);<NEW_LINE>if (q == -1) {<NEW_LINE>calculatedCharacterLength += (e - p);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>calculatedCharacterLength += q - p;<NEW_LINE>p = q;<NEW_LINE>}<NEW_LINE>final int delta = calculateCharacterLengthNode.characterLengthWithRecovery(encoding, CR_VALID, Bytes.fromRange<MASK><NEW_LINE>if (delta < 0) {<NEW_LINE>errorProfile.enter();<NEW_LINE>throw Utils.unsupportedOperation("Code range is reported as valid, but is invalid for the given encoding: ", encoding);<NEW_LINE>}<NEW_LINE>p += delta;<NEW_LINE>calculatedCharacterLength++;<NEW_LINE>}<NEW_LINE>return new ValidLeafRope(bytes, encoding, calculatedCharacterLength);<NEW_LINE>}
(bytes, p, e));
681,979
private void registerWrapper(StandardWrapper wrapper) throws Exception {<NEW_LINE>ObjectName objectName = wrapper.getJmxName();<NEW_LINE>if (objectName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String wrapperName = objectName.getKeyProperty("name");<NEW_LINE>String name = objectName.getKeyProperty("WebModule");<NEW_LINE>String hostName;<NEW_LINE>String contextName;<NEW_LINE>if (name.startsWith("//")) {<NEW_LINE>name = name.substring(2);<NEW_LINE>}<NEW_LINE>int slash = name.indexOf('/');<NEW_LINE>if (slash != -1) {<NEW_LINE>hostName = name.substring(0, slash);<NEW_LINE>contextName = name.substring(slash);<NEW_LINE>contextName = RequestUtil.urlDecode(contextName, "UTF-8");<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Special case for the root context<NEW_LINE>if (contextName.equals("/")) {<NEW_LINE>contextName = "";<NEW_LINE>}<NEW_LINE>String msg = MessageFormat.format(rb.getString(LogFacade.REGISTER_WRAPPER), wrapperName, contextName);<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.fine(msg);<NEW_LINE>}<NEW_LINE>String[] mappings = wrapper.findMappings();<NEW_LINE>for (int i = 0; i < mappings.length; i++) {<NEW_LINE>boolean jspWildCard = (wrapperName.equals("jsp") && mappings[i].endsWith("/*"));<NEW_LINE>mapper.addWrapper(hostName, contextName, mappings[i], <MASK><NEW_LINE>}<NEW_LINE>}
wrapper, jspWildCard, wrapperName, true);
550,480
public Dataset updateDatasetAttributes(String datasetId, KeyValue attribute) {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>DatasetEntity datasetObj = session.get(DatasetEntity.class, datasetId, LockMode.PESSIMISTIC_WRITE);<NEW_LINE>if (datasetObj == null) {<NEW_LINE>var errorMessage = "Dataset not found for given ID";<NEW_LINE>throw new NotFoundException(errorMessage);<NEW_LINE>}<NEW_LINE>var updatedAttributeObj = RdbmsUtils.generateAttributeEntity(datasetObj, ModelDBConstants.ATTRIBUTES, attribute);<NEW_LINE>List<AttributeEntity> existingAttributes = datasetObj.getAttributeMapping();<NEW_LINE>if (!existingAttributes.isEmpty()) {<NEW_LINE>var doesExist = false;<NEW_LINE>for (AttributeEntity existingAttribute : existingAttributes) {<NEW_LINE>if (existingAttribute.getKey().equals(attribute.getKey())) {<NEW_LINE>existingAttribute.setKey(updatedAttributeObj.getKey());<NEW_LINE>existingAttribute.setValue(updatedAttributeObj.getValue());<NEW_LINE>existingAttribute.setValue_type(updatedAttributeObj.getValue_type());<NEW_LINE>doesExist = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!doesExist) {<NEW_LINE>datasetObj.setAttributeMapping(Collections.singletonList(updatedAttributeObj));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>datasetObj.setAttributeMapping<MASK><NEW_LINE>}<NEW_LINE>datasetObj.setTime_updated(Calendar.getInstance().getTimeInMillis());<NEW_LINE>var transaction = session.beginTransaction();<NEW_LINE>session.saveOrUpdate(datasetObj);<NEW_LINE>transaction.commit();<NEW_LINE>return datasetObj.getProtoObject(mdbRoleService);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ModelDBUtils.needToRetry(ex)) {<NEW_LINE>return updateDatasetAttributes(datasetId, attribute);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Collections.singletonList(updatedAttributeObj));
29,694
private void resolveSegments() {<NEW_LINE>if (!StringUtils.hasText(this.str)) {<NEW_LINE>LOGGER.warn("'connectionString' doesn't have text.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String[] tokenValuePairs = this.str.split(TOKEN_VALUE_PAIR_DELIMITER);<NEW_LINE>validateTokenValuePresents(tokenValuePairs);<NEW_LINE>validateTokensAreLegal(collectTokens(tokenValuePairs));<NEW_LINE>for (String tokenValuePair : tokenValuePairs) {<NEW_LINE>final String[] pair = tokenValuePair.split(TOKEN_VALUE_SEPARATOR, 2);<NEW_LINE>String token = pair[0], value = pair[1];<NEW_LINE>if (ENDPOINT.equalsIgnoreCase(token)) {<NEW_LINE>try {<NEW_LINE>this.endpoint = new URI(value);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.US, "Invalid endpoint: %s", tokenValuePair), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
segments.put(token, value);
226,883
public static void main(String[] args) {<NEW_LINE>final MetricsAdvisorAsyncClient advisorAsyncClient = new MetricsAdvisorClientBuilder().endpoint("https://{endpoint}.cognitiveservices.azure.com/").credential(new MetricsAdvisorKeyCredential("subscription_key", "api_key")).buildAsyncClient();<NEW_LINE>final String alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299";<NEW_LINE>final String alertId = "1746b031c00";<NEW_LINE>final ListAnomaliesAlertedOptions options = new ListAnomaliesAlertedOptions().setMaxPageSize(10);<NEW_LINE>advisorAsyncClient.listAnomaliesForAlert(alertConfigurationId, alertId, options).doOnNext(anomaly -> {<NEW_LINE>System.out.printf("Data Feed Metric Id: %s%n", anomaly.getMetricId());<NEW_LINE>System.out.printf(<MASK><NEW_LINE>System.out.printf("DataPoint Anomaly Created Time: %s%n", anomaly.getCreatedTime());<NEW_LINE>System.out.printf("DataPoint Anomaly Modified Time: %s%n", anomaly.getModifiedTime());<NEW_LINE>System.out.printf("DataPoint Anomaly Severity: %s%n", anomaly.getSeverity());<NEW_LINE>System.out.printf("DataPoint Anomaly Status: %s%n", anomaly.getStatus());<NEW_LINE>System.out.printf("Series Key: %s%n", anomaly.getSeriesKey().asMap());<NEW_LINE>}).blockLast();<NEW_LINE>}
"Detection Configuration Id: %s%n", anomaly.getDetectionConfigurationId());
939,537
protected static <T extends ParsedSingleBucketAggregation> T parseXContent(final XContentParser parser, T aggregation, String name) throws IOException {<NEW_LINE>aggregation.setName(name);<NEW_LINE>XContentParser.Token token = parser.currentToken();<NEW_LINE>String currentFieldName = parser.currentName();<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>token = parser.nextToken();<NEW_LINE>}<NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>List<Aggregation> aggregations = new ArrayList<>();<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>currentFieldName = parser.currentName();<NEW_LINE>} else if (token.isValue()) {<NEW_LINE>if (CommonFields.DOC_COUNT.getPreferredName().equals(currentFieldName)) {<NEW_LINE>aggregation.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == XContentParser.Token.START_OBJECT) {<NEW_LINE>if (CommonFields.META.getPreferredName().equals(currentFieldName)) {<NEW_LINE>aggregation.metadata = parser.map();<NEW_LINE>} else {<NEW_LINE>XContentParserUtils.parseTypedKeysObject(parser, Aggregation.TYPED_KEYS_DELIMITER, Aggregation.class, aggregations::add);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>aggregation.aggregations = new Aggregations(aggregations);<NEW_LINE>return aggregation;<NEW_LINE>}
setDocCount(parser.longValue());
1,151,369
public static void horizontal5(Kernel1D_S32 kernel, GrayU8 image, GrayI16 dest) {<NEW_LINE>final byte[] dataSrc = image.data;<NEW_LINE>final short[] dataDst = dest.data;<NEW_LINE>final int <MASK><NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = image.getWidth();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[indexSrc++] & 0xFF) * k1;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k2;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k3;<NEW_LINE>total += (dataSrc[indexSrc++] & 0xFF) * k4;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
k1 = kernel.data[0];
1,552,766
private static String fixRelativeLink(Pattern pattern, Path helpFile, String fileContents) {<NEW_LINE>int currentPosition = 0;<NEW_LINE>StringBuffer newContents = new StringBuffer();<NEW_LINE>Matcher matcher = pattern.matcher(fileContents);<NEW_LINE>boolean hasMatches = matcher.find();<NEW_LINE>if (!hasMatches) {<NEW_LINE>// no work to do<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (hasMatches) {<NEW_LINE>int matchStart = matcher.start();<NEW_LINE>String fullMatch = matcher.group(0);<NEW_LINE>String beforeMatchString = fileContents.substring(currentPosition, matchStart);<NEW_LINE>newContents.append(beforeMatchString);<NEW_LINE>currentPosition <MASK><NEW_LINE>String HREFText = matcher.group(1);<NEW_LINE>debug("Found HREF text: " + HREFText + " in file: " + helpFile.getFileName());<NEW_LINE>String updatedHREFText = resolveLink(HREFText);<NEW_LINE>debug("\tnew link text: " + updatedHREFText);<NEW_LINE>newContents.append('"').append(updatedHREFText).append('"');<NEW_LINE>hasMatches = matcher.find();<NEW_LINE>}<NEW_LINE>// grab the remaining content<NEW_LINE>if (currentPosition < fileContents.length()) {<NEW_LINE>newContents.append(fileContents.substring(currentPosition));<NEW_LINE>}<NEW_LINE>return newContents.toString();<NEW_LINE>}
= matchStart + fullMatch.length();
66,832
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(Job.ID.getPreferredName(), jobId);<NEW_LINE>builder.field(Result.RESULT_TYPE.getPreferredName(), RESULT_TYPE_VALUE);<NEW_LINE>if (partitionFieldName != null) {<NEW_LINE>builder.field(PARTITION_FIELD_NAME.getPreferredName(), partitionFieldName);<NEW_LINE>builder.field(PARTITION_FIELD_VALUE.getPreferredName(), partitionFieldValue);<NEW_LINE>if (ReservedFieldNames.isValidFieldName(partitionFieldName)) {<NEW_LINE>builder.field(partitionFieldName, partitionFieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.field(CATEGORIZED_DOC_COUNT_FIELD.getPreferredName(), categorizedDocCount);<NEW_LINE>builder.field(TOTAL_CATEGORY_COUNT_FIELD.getPreferredName(), totalCategoryCount);<NEW_LINE>builder.field(FREQUENT_CATEGORY_COUNT_FIELD.getPreferredName(), frequentCategoryCount);<NEW_LINE>builder.field(RARE_CATEGORY_COUNT_FIELD.getPreferredName(), rareCategoryCount);<NEW_LINE>builder.field(DEAD_CATEGORY_COUNT_FIELD.getPreferredName(), deadCategoryCount);<NEW_LINE>builder.field(<MASK><NEW_LINE>builder.field(CATEGORIZATION_STATUS_FIELD.getPreferredName(), categorizationStatus);<NEW_LINE>builder.timeField(LOG_TIME_FIELD.getPreferredName(), LOG_TIME_FIELD.getPreferredName() + "_string", logTime.toEpochMilli());<NEW_LINE>builder.timeField(TIMESTAMP_FIELD.getPreferredName(), TIMESTAMP_FIELD.getPreferredName() + "_string", timestamp.toEpochMilli());<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
FAILED_CATEGORY_COUNT_FIELD.getPreferredName(), failedCategoryCount);
1,541,453
public static void vertical(Kernel1D_S32 kernel, ImageBorder_S32 input, GrayI8 output, int divisor) {<NEW_LINE>final byte[] dataDst = output.data;<NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int width = output.getWidth();<NEW_LINE>final int height = output.getHeight();<NEW_LINE>final int borderBottom = kernelWidth - offset - 1;<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int indexDest = output.startIndex + x;<NEW_LINE>for (int y = 0; y < offset; y++, indexDest += output.stride) {<NEW_LINE>int total = 0;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += input.get(x, y + k - offset) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDest] = (byte) (<MASK><NEW_LINE>}<NEW_LINE>indexDest = output.startIndex + (height - borderBottom) * output.stride + x;<NEW_LINE>for (int y = height - borderBottom; y < height; y++, indexDest += output.stride) {<NEW_LINE>int total = 0;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += input.get(x, y + k - offset) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDest] = (byte) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(total + halfDivisor) / divisor);
1,592,953
public int crypto_kem_dec(byte[] k, byte[] c, byte[] sk) {<NEW_LINE>int i, fail;<NEW_LINE>byte[] cmp = new byte[SABER_BYTES_CCA_DEC];<NEW_LINE>byte[] buf = new byte[64];<NEW_LINE>// Will contain key, coins<NEW_LINE>byte[] kr = new byte[64];<NEW_LINE>byte[] pk = Arrays.copyOfRange(sk, SABER_INDCPA_SECRETKEYBYTES, sk.length);<NEW_LINE>// buf[0:31] <-- message<NEW_LINE>indcpa_kem_dec(sk, c, buf);<NEW_LINE>// Multitarget countermeasure for coins + contributory KEM<NEW_LINE>for (// Save hash by storing h(pk) in sk<NEW_LINE>// Save hash by storing h(pk) in sk<NEW_LINE>i = 0; // Save hash by storing h(pk) in sk<NEW_LINE>i < 32; i++) buf[32 + i] = sk[SABER_SECRETKEYBYTES - 64 + i];<NEW_LINE>SHA3Digest digest_256 = new SHA3Digest(256);<NEW_LINE>SHA3Digest digest_512 = new SHA3Digest(512);<NEW_LINE>digest_512.<MASK><NEW_LINE>digest_512.doFinal(kr, 0);<NEW_LINE>indcpa_kem_enc(buf, Arrays.copyOfRange(kr, 32, kr.length), pk, cmp);<NEW_LINE>fail = verify(c, cmp, SABER_BYTES_CCA_DEC);<NEW_LINE>// overwrite coins in kr with h(c)<NEW_LINE>digest_256.update(c, 0, SABER_BYTES_CCA_DEC);<NEW_LINE>digest_256.doFinal(kr, 32);<NEW_LINE>cmov(kr, sk, SABER_SECRETKEYBYTES - SABER_KEYBYTES, SABER_KEYBYTES, (byte) fail);<NEW_LINE>// hash concatenation of pre-k and h(c) to k<NEW_LINE>// todo support 128 and 192 bit keys<NEW_LINE>byte[] temp_k = new byte[32];<NEW_LINE>digest_256.update(kr, 0, 64);<NEW_LINE>digest_256.doFinal(temp_k, 0);<NEW_LINE>System.arraycopy(temp_k, 0, k, 0, defaultKeySize / 8);<NEW_LINE>return 0;<NEW_LINE>}
update(buf, 0, 64);
298,608
public List<validationData> addGeneralGoodExpectations(String testName, TestSettings settings, String providerTypeOverride) throws Exception {<NEW_LINE>// expect good (200) status codes for all steps<NEW_LINE>List<validationData> expectations = vData.addSuccessStatusCodes();<NEW_LINE>// Check if we got authorization code<NEW_LINE>expectations = vData.addExpectation(expectations, Constants.PERFORM_LOGIN, Constants.RESPONSE_FULL, Constants.STRING_CONTAINS, "Did not receive authorization code", null, Constants.RECV_AUTH_CODE);<NEW_LINE>// Check if we got the access token<NEW_LINE>expectations = vData.addExpectation(expectations, Constants.PERFORM_LOGIN, Constants.RESPONSE_FULL, Constants.STRING_CONTAINS, "Did not receive access token", null, Constants.RECV_FROM_TOKEN_ENDPOINT);<NEW_LINE>// Make sure we get to the app<NEW_LINE>expectations = vData.addExpectation(expectations, Constants.INVOKE_PROTECTED_RESOURCE, Constants.RESPONSE_FULL, Constants.STRING_CONTAINS, <MASK><NEW_LINE>// Response should not have an ltpa token<NEW_LINE>expectations = vData.addExpectation(expectations, Constants.INVOKE_PROTECTED_RESOURCE, Constants.RESPONSE_TOKEN, null, "Response has an ltpa token, but should not", null, "false");<NEW_LINE>String providerType = null;<NEW_LINE>if (providerTypeOverride == null) {<NEW_LINE>providerType = eSettings.getProviderType();<NEW_LINE>} else {<NEW_LINE>providerType = providerTypeOverride;<NEW_LINE>}<NEW_LINE>// add generic id_token expectations<NEW_LINE>expectations = validationTools.addDefaultIDTokenExpectations(expectations, testName, providerType, Constants.PERFORM_LOGIN, settings);<NEW_LINE>// add generic response expectations<NEW_LINE>expectations = validationTools.addDefaultGeneralResponseExpectations(expectations, testName, providerType, Constants.PERFORM_LOGIN, settings);<NEW_LINE>return expectations;<NEW_LINE>}
"Could not invoke protected application", null, Constants.APP_TITLE);
737,683
private HmilyParticipant buildParticipant(final HmilyTransactionContext context, final SofaRequest sofaRequest) throws HmilyRuntimeException {<NEW_LINE>if (HmilyActionEnum.TRYING.getCode() != context.getAction()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HmilyParticipant hmilyParticipant = new HmilyParticipant();<NEW_LINE>hmilyParticipant.setParticipantId(IdWorkerUtils.getInstance().createUUID());<NEW_LINE>hmilyParticipant.setTransId(context.getTransId());<NEW_LINE>hmilyParticipant.setTransType(context.getTransType());<NEW_LINE><MASK><NEW_LINE>Class<?> clazz = ClassUtils.forName(sofaRequest.getInterfaceName());<NEW_LINE>Class<?>[] args = ClassTypeUtils.getClasses(sofaRequest.getMethodArgSigs());<NEW_LINE>final Object[] arguments = sofaRequest.getMethodArgs();<NEW_LINE>HmilyInvocation hmilyInvocation = new HmilyInvocation(clazz, methodName, args, arguments);<NEW_LINE>hmilyParticipant.setConfirmHmilyInvocation(hmilyInvocation);<NEW_LINE>hmilyParticipant.setCancelHmilyInvocation(hmilyInvocation);<NEW_LINE>return hmilyParticipant;<NEW_LINE>}
String methodName = sofaRequest.getMethodName();
771,625
public Map<String, Object> toMap() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {<NEW_LINE>final Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("active", this.getActive());<NEW_LINE>map.put("actualCompanyId", this.getActualCompanyId());<NEW_LINE>map.put("birthday", this.getBirthday());<NEW_LINE>map.put("comments", this.getComments());<NEW_LINE>map.put("companyId", this.getCompanyId());<NEW_LINE>map.put("createDate", this.getCreateDate());<NEW_LINE>map.put("modificationDate", this.getModificationDate());<NEW_LINE>String emailAddress = this.getEmailAddress();<NEW_LINE>if (!UtilMethods.isSet(this.getEmailAddress())) {<NEW_LINE>emailAddress = StringPool.BLANK;<NEW_LINE>Logger.warn(this, String.format("Email address for user '%s' is null. Returning an empty value instead.", getUserId()));<NEW_LINE>map.put("gravitar", StringPool.BLANK);<NEW_LINE>} else {<NEW_LINE>map.put("gravitar", DigestUtils.md5Hex(emailAddress.toLowerCase()));<NEW_LINE>}<NEW_LINE>map.put("emailAddress", emailAddress);<NEW_LINE>map.put("emailaddress", emailAddress);<NEW_LINE>map.put("failedLoginAttempts", this.getFailedLoginAttempts());<NEW_LINE>map.put("male", this.getMale());<NEW_LINE>map.put("firstName", this.getFirstName());<NEW_LINE>map.put("fullName", this.getFullName());<NEW_LINE>map.put("name", getFullName());<NEW_LINE>map.put("languageId", this.getLanguageId());<NEW_LINE>map.put("lastLoginDate", this.getLastLoginDate());<NEW_LINE>map.put("lastLoginIP", this.getLastLoginIP());<NEW_LINE>map.put("lastName", this.getLastName());<NEW_LINE>map.put("middleName", this.getMiddleName());<NEW_LINE>map.put("female", this.getFemale());<NEW_LINE>map.put(<MASK><NEW_LINE>map.put("timeZoneId", this.getTimeZoneId());<NEW_LINE>map.put("deleteInProgress", getDeleteInProgress());<NEW_LINE>map.put("deleteDate", getDeleteDate());<NEW_LINE>map.put("passwordExpirationDate", getPasswordExpirationDate());<NEW_LINE>map.put("passwordExpired", isPasswordExpired());<NEW_LINE>map.put("passwordReset", isPasswordReset());<NEW_LINE>map.put("userId", getUserId());<NEW_LINE>map.put("backendUser", isBackendUser());<NEW_LINE>map.put("frontendUser", isFrontendUser());<NEW_LINE>map.put("hasConsoleAccess", hasConsoleAccess());<NEW_LINE>map.put("id", getUserId());<NEW_LINE>map.put("type", UserAjax.USER_TYPE_VALUE);<NEW_LINE>map.put("additionalInfo", getAdditionalInfo());<NEW_LINE>return map;<NEW_LINE>}
"nickname", this.getNickName());
477,612
protected MouseListener createMouseListener() {<NEW_LINE>return new MouseEventAdapter<MouseListener>(super.createMouseListener()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseDragged(MouseEvent event) {<NEW_LINE>// DnDManagerImpl.SOURCE_KEY<NEW_LINE>Object property = UIUtil.getClientProperty(event.getSource(), "DnD Source");<NEW_LINE>// use Swing-based DnD only if custom DnD is not set<NEW_LINE>if (property == null)<NEW_LINE>super.mouseDragged(event);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>protected MouseEvent convert(@Nonnull MouseEvent event) {<NEW_LINE>JTree tree = getTree();<NEW_LINE>if (tree != null && tree == event.getSource() && tree.isEnabled()) {<NEW_LINE>if (!event.isConsumed() && SwingUtilities.isLeftMouseButton(event)) {<NEW_LINE>int x = event.getX();<NEW_LINE><MASK><NEW_LINE>TreePath path = getClosestPathForLocation(tree, x, y);<NEW_LINE>if (path != null && !isLocationInExpandControl(path, x, y)) {<NEW_LINE>Rectangle bounds = getPathBounds(tree, path);<NEW_LINE>if (bounds != null && bounds.y <= y && y <= (bounds.y + bounds.height)) {<NEW_LINE>x = Math.max(bounds.x, Math.min(x, bounds.x + bounds.width - 1));<NEW_LINE>if (x != event.getX())<NEW_LINE>event = convert(event, tree, x, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return event;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
int y = event.getY();
1,348,643
private List<Future> schedule(Settings settings) {<NEW_LINE>List<Future> futures = new LinkedList<>();<NEW_LINE>if (threadPoolExecutor != null) {<NEW_LINE>logger.info("already scheduled");<NEW_LINE>return futures;<NEW_LINE>}<NEW_LINE>String[] schedule = settings.getAsArray("schedule");<NEW_LINE>Long seconds = settings.getAsTime("interval", TimeValue.timeValueSeconds(0)).seconds();<NEW_LINE>if (schedule != null && schedule.length > 0) {<NEW_LINE>Thread thread = new Thread(this);<NEW_LINE>CronThreadPoolExecutor cronThreadPoolExecutor = new CronThreadPoolExecutor(settings.getAsInt("threadpoolsize", 1));<NEW_LINE>for (String cron : schedule) {<NEW_LINE>futures.add(cronThreadPoolExecutor.schedule(thread<MASK><NEW_LINE>}<NEW_LINE>this.threadPoolExecutor = cronThreadPoolExecutor;<NEW_LINE>logger.info("scheduled with cron expressions {}", Arrays.asList(schedule));<NEW_LINE>} else if (seconds > 0L) {<NEW_LINE>Thread thread = new Thread(this);<NEW_LINE>ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(settings.getAsInt("threadpoolsize", 1));<NEW_LINE>futures.add(scheduledThreadPoolExecutor.scheduleAtFixedRate(thread, 0L, seconds, TimeUnit.SECONDS));<NEW_LINE>this.threadPoolExecutor = scheduledThreadPoolExecutor;<NEW_LINE>logger.info("scheduled at fixed rate of {} seconds", seconds);<NEW_LINE>}<NEW_LINE>return futures;<NEW_LINE>}
, new CronExpression(cron)));
419,125
public static boolean isOnline(Context context, boolean careAboutWifiOnly) {<NEW_LINE>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);<NEW_LINE>// Check if we are restricted to download over wifi only<NEW_LINE>boolean wifiOnly = prefs.getBoolean("pref_download_wifi_only", true);<NEW_LINE>// If we don't care whether wifi is allowed or not, set wifiOnly to false<NEW_LINE>if (!careAboutWifiOnly) {<NEW_LINE>wifiOnly = false;<NEW_LINE>}<NEW_LINE>final ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);<NEW_LINE>// Check the state of the wifi network<NEW_LINE>final NetworkInfo wifiNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);<NEW_LINE>if (wifiNetwork != null && wifiNetwork.isConnectedOrConnecting()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Check other networks<NEW_LINE>final NetworkInfo netInfo = cm.getActiveNetworkInfo();<NEW_LINE>return netInfo != null && <MASK><NEW_LINE>}
netInfo.isConnectedOrConnecting() && !wifiOnly;
774,881
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent permanent = game.getPermanentEntering(source.getSourceId());<NEW_LINE>if (controller == null || permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int permanentsInPlay = new PermanentsOnBattlefieldCount(filter).calculate(game, source, null);<NEW_LINE>int cardsInGraveyards = new CardsInAllGraveyardsCount(filter2).calculate(game, source, null);<NEW_LINE>int maxAmount = Math.min(permanentsInPlay + cardsInGraveyards, controller.getLife());<NEW_LINE>int payAmount = controller.getAmount(0, maxAmount, "Pay up to " + maxAmount + " life", game);<NEW_LINE><MASK><NEW_LINE>if (!cost.pay(source, game, source, source.getControllerId(), true)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card sourceCard = game.getCard(source.getSourceId());<NEW_LINE>game.informPlayers((sourceCard != null ? sourceCard.getLogName() : "") + ": " + controller.getLogName() + " pays " + payAmount + " life");<NEW_LINE>game.addEffect(new SetPowerToughnessSourceEffect(payAmount, payAmount, Duration.Custom, SubLayer.CharacteristicDefining_7a), source);<NEW_LINE>permanent.addInfo("life paid", CardUtil.addToolTipMarkTags("Life paid: " + payAmount), game);<NEW_LINE>return true;<NEW_LINE>}
Cost cost = new PayLifeCost(payAmount);
1,666,432
public void visitRoot() {<NEW_LINE>preVisitStatement(root);<NEW_LINE>// write package<NEW_LINE>if (root.getPackageName() != null) {<NEW_LINE>groovyCode.append("package ");<NEW_LINE>String packageName = root.getPackageName();<NEW_LINE>// packageName ends with ".", chop it<NEW_LINE>groovyCode.append(packageName.substring(0, packageName.length() - 1));<NEW_LINE>}<NEW_LINE>// write importPackage like import test.*<NEW_LINE>printImports(root.getStarImports());<NEW_LINE>// write imports like import test.TestClass<NEW_LINE>printImports(root.getImports());<NEW_LINE>// write imports like import static java.lang.Math.PI<NEW_LINE>printImports(root.getStaticImports().values());<NEW_LINE>// write imports like import static java.lang.Math.*<NEW_LINE>printImports(root.<MASK><NEW_LINE>// write Statements that are not inside a class<NEW_LINE>if (!root.getStatementBlock().isEmpty()) {<NEW_LINE>visitBlockStatement(root.getStatementBlock());<NEW_LINE>}<NEW_LINE>// write the classes<NEW_LINE>List<ClassNode> classes = root.getClasses();<NEW_LINE>for (ClassNode classNode : classes) {<NEW_LINE>if (!classNode.isScript()) {<NEW_LINE>visitClass(classNode);<NEW_LINE>} else {<NEW_LINE>List<MethodNode> methods = root.getMethods();<NEW_LINE>for (MethodNode method : methods) {<NEW_LINE>visitMethod(method);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postVisitStatement(root);<NEW_LINE>}
getStaticStarImports().values());
1,522,609
public Void scan(Tree node, TreePath p) {<NEW_LINE>if (node == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TreePath currentPath = new TreePath(p, node);<NEW_LINE>boolean[<MASK><NEW_LINE>final NFA.State newActiveAfterVariable = nfa.transition(active, new Input(Kind.IDENTIFIER, "$", false));<NEW_LINE>Input normalizedInput = normalizeInput(node, goDeeper, null);<NEW_LINE>boolean ignoreKind = normalizedInput.kind == Kind.IDENTIFIER || normalizedInput.kind == Kind.MEMBER_SELECT;<NEW_LINE>NFA.State newActiveBefore = nfa.transition(active, normalizedInput);<NEW_LINE>if (normalizedInput.name != null && !ignoreKind) {<NEW_LINE>newActiveBefore = nfa.join(newActiveBefore, nfa.transition(active, new Input(normalizedInput.kind, "$", false)));<NEW_LINE>}<NEW_LINE>active = newActiveBefore;<NEW_LINE>if (goDeeper[0]) {<NEW_LINE>super.scan(node, currentPath);<NEW_LINE>} else {<NEW_LINE>new CollectIdentifiers<Void, Void>(identifiers, cancel).scan(node, null);<NEW_LINE>}<NEW_LINE>if (cancel.get())<NEW_LINE>return null;<NEW_LINE>NFA.State newActiveAfter = nfa.transition(active, UP);<NEW_LINE>active = nfa.join(newActiveAfter, nfa.transition(newActiveAfterVariable, UP));<NEW_LINE>for (Res r : nfa.getResults(active)) {<NEW_LINE>addOccurrence(r, currentPath);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
] goDeeper = new boolean[1];
86,618
public void removeDependency(@NonNull T y, @NonNull D x) {<NEW_LINE>dependencies.removeGroupReturn(y, t -> t.equals(x));<NEW_LINE>Set<T> s2 = reverseDependencies.get(x);<NEW_LINE>if (s2 != null) {<NEW_LINE>s2.remove(y);<NEW_LINE>if (s2.isEmpty())<NEW_LINE>reverseDependencies.remove(x);<NEW_LINE>}<NEW_LINE>Iterable<Pair<D, D>> s3 = orDependencies.removeGroupReturn(y, t -> {<NEW_LINE>return x.equals(t.getFirst()) || x.equals(t.getSecond());<NEW_LINE>});<NEW_LINE>if (s3 != null) {<NEW_LINE>boolean removedReverse = false;<NEW_LINE>for (Pair<D, D> p : s3) {<NEW_LINE>if (!removedReverse) {<NEW_LINE>Set<T> set1 = reverseOrDependencies.get(p.getFirst());<NEW_LINE>Set<T> set2 = reverseOrDependencies.<MASK><NEW_LINE>set1.remove(y);<NEW_LINE>set2.remove(y);<NEW_LINE>if (set1.isEmpty())<NEW_LINE>reverseOrDependencies.remove(p.getFirst());<NEW_LINE>if (set2.isEmpty())<NEW_LINE>reverseOrDependencies.remove(p.getSecond());<NEW_LINE>removedReverse = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(p.getSecond());
1,225,826
public void onBindViewHolder(@NonNull ViewHistoryHolder holder, int position) {<NEW_LINE>final String filePath = mHistoryList.get(position).getFilePath();<NEW_LINE>File file = new File(filePath);<NEW_LINE>final String operationDate = mHistoryList.get(position).getDate();<NEW_LINE>String[] formatDate = operationDate.split(" ");<NEW_LINE>String date;<NEW_LINE>if (formatDate.length >= 3) {<NEW_LINE>String time = formatDate[3];<NEW_LINE>String[] formatTime = time.split(":");<NEW_LINE>date = formatTime[0] + ":" + formatTime[1];<NEW_LINE>date = formatDate[0] + ", " + formatDate[1] + " " + formatDate[2] + " at " + date;<NEW_LINE>} else {<NEW_LINE>date = operationDate;<NEW_LINE>}<NEW_LINE>final String operationType = mHistoryList.get(position).getOperationType();<NEW_LINE>final String fileName = file.getName();<NEW_LINE><MASK><NEW_LINE>holder.mOperationDate.setText(date);<NEW_LINE>holder.mOperationType.setText(operationType);<NEW_LINE>if (mIconsOperationList != null && mIconsOperationList.containsKey(operationType))<NEW_LINE>holder.mOperationImage.setImageResource(mIconsOperationList.get(operationType));<NEW_LINE>else<NEW_LINE>holder.mOperationImage.setImageResource(R.drawable.ic_create_black_24dp);<NEW_LINE>}
holder.mFilename.setText(fileName);
1,394,085
private UnpackResult unpack(CacheableEntity entity, TarArchiveInputStream tarInput, OriginReader readOriginAction) throws IOException {<NEW_LINE>ImmutableMap.Builder<String, CacheableTree> treesBuilder = ImmutableMap.builder();<NEW_LINE>entity.visitOutputTrees((name, type, root) -> treesBuilder.put(name, new CacheableTree(type, root)));<NEW_LINE>ImmutableMap<String, CacheableTree> treesByName = treesBuilder.build();<NEW_LINE>TarArchiveEntry tarEntry;<NEW_LINE>OriginMetadata originMetadata = null;<NEW_LINE>Map<String, FileSystemLocationSnapshot> snapshots = new HashMap<>();<NEW_LINE>tarEntry = tarInput.getNextTarEntry();<NEW_LINE>AtomicLong entries = new AtomicLong();<NEW_LINE>while (tarEntry != null) {<NEW_LINE>entries.incrementAndGet();<NEW_LINE>String path = tarEntry.getName();<NEW_LINE>if (path.equals(METADATA_PATH)) {<NEW_LINE>// handle origin metadata<NEW_LINE>originMetadata = readOriginAction.execute(CloseShieldInputStream.wrap(tarInput));<NEW_LINE>tarEntry = tarInput.getNextTarEntry();<NEW_LINE>} else {<NEW_LINE>// handle tree<NEW_LINE>Matcher matcher = TREE_PATH.matcher(path);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>throw new IllegalStateException("Cached entry format error, invalid contents: " + path);<NEW_LINE>}<NEW_LINE>String treeName = unescape(matcher.group(2));<NEW_LINE>CacheableTree tree = treesByName.get(treeName);<NEW_LINE>if (tree == null) {<NEW_LINE>throw new IllegalStateException(String.format("No tree '%s' registered", treeName));<NEW_LINE>}<NEW_LINE>boolean missing = matcher.group(1) != null;<NEW_LINE>String childPath = matcher.group(3);<NEW_LINE>tarEntry = unpackTree(treeName, tree.getType(), tree.getRoot(), tarInput, tarEntry, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (originMetadata == null) {<NEW_LINE>throw new IllegalStateException("Cached result format error, no origin metadata was found.");<NEW_LINE>}<NEW_LINE>return new UnpackResult(originMetadata, entries.get(), snapshots);<NEW_LINE>}
childPath, missing, snapshots, entries);
1,472,558
protected void onCreate(final Bundle savedInstanceState) {<NEW_LINE>inNightMode = SettingValues.isNight();<NEW_LINE>disableSwipeBackLayout();<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>applyColorTheme();<NEW_LINE>setContentView(R.layout.activity_news);<NEW_LINE>mToolbar = (Toolbar) findViewById(R.id.toolbar);<NEW_LINE>mToolbar.setPopupTheme(new ColorPreferences(this).getFontStyle().getBaseId());<NEW_LINE>setSupportActionBar(mToolbar);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>Window window = this.getWindow();<NEW_LINE>window.setStatusBarColor(Palette.getDarkerColor(Palette.getDarkerColor(Palette.getDefaultColor())));<NEW_LINE>}<NEW_LINE>mTabLayout = (TabLayout) findViewById(R.id.sliding_tabs);<NEW_LINE>header = findViewById(R.id.header);<NEW_LINE>pager = (ToggleSwipeViewPager) findViewById(R.id.content_view);<NEW_LINE>mTabLayout = (TabLayout) findViewById(R.id.sliding_tabs);<NEW_LINE>UserSubscriptions.doNewsSubs(NewsActivity.this);<NEW_LINE>SettingValues.currentTheme = new ColorPreferences(this).getFontStyle().getThemeType();<NEW_LINE>networkStateReceiver = new NetworkStateReceiver();<NEW_LINE>networkStateReceiver.addListener(this);<NEW_LINE>try {<NEW_LINE>this.registerReceiver(networkStateReceiver, new IntentFilter(android<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}
.net.ConnectivityManager.CONNECTIVITY_ACTION));
918,034
private void attachRouteActions(@NotNull Collection<? super LineMarkerInfo<?>> lineMarkerInfos, @NotNull PsiElement psiElement) {<NEW_LINE>if (psiElement.getNode().getElementType() != YAMLTokenTypes.SCALAR_KEY) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (!(yamlKeyValue instanceof YAMLKeyValue)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String yamlController = RouteHelper.getYamlController((YAMLKeyValue) yamlKeyValue);<NEW_LINE>if (yamlController != null) {<NEW_LINE>PsiElement[] methods = RouteHelper.getMethodsOnControllerShortcut(psiElement.getProject(), yamlController);<NEW_LINE>if (methods.length > 0) {<NEW_LINE>NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.TWIG_CONTROLLER_LINE_MARKER).setTargets(methods).setTooltipText("Navigate to action");<NEW_LINE>lineMarkerInfos.add(builder.createLineMarkerInfo(psiElement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PsiElement yamlKeyValue = psiElement.getParent();
949,815
public ByteBuffer write(ByteBuffer bb, FrontendConnection c, boolean writeSocketIfFull) {<NEW_LINE>bb = c.checkWriteBuffer(bb, c.getPacketHeaderSize(), writeSocketIfFull);<NEW_LINE>BufferUtil.writeUB3(bb, calcPacketSize());<NEW_LINE>bb.put(packetId);<NEW_LINE>for (int i = 0; i < fieldCount; i++) {<NEW_LINE>byte[] fv = fieldValues.get(i);<NEW_LINE>if (fv == null) {<NEW_LINE>bb = c.checkWriteBuffer(bb, 1, writeSocketIfFull);<NEW_LINE>bb.put(RowDataPacket.NULL_MARK);<NEW_LINE>} else if (fv.length == 0) {<NEW_LINE>bb = c.<MASK><NEW_LINE>bb.put(RowDataPacket.EMPTY_MARK);<NEW_LINE>} else {<NEW_LINE>bb = c.checkWriteBuffer(bb, BufferUtil.getLength(fv), writeSocketIfFull);<NEW_LINE>BufferUtil.writeLength(bb, fv.length);<NEW_LINE>bb = c.writeToBuffer(fv, bb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bb;<NEW_LINE>}
checkWriteBuffer(bb, 1, writeSocketIfFull);
319,622
public Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize) {<NEW_LINE>if (maskArray == null || maskArray.rank() == 2)<NEW_LINE>return new Pair<>(maskArray, currentMaskState);<NEW_LINE>if (maskArray.rank() != 4 || maskArray.size(2) != 1 || maskArray.size(3) != 1) {<NEW_LINE>throw new UnsupportedOperationException("Expected rank 4 mask array for 2D CNN layer activations. Got rank " + maskArray.rank() + " mask array (shape " + Arrays.toString(maskArray.shape()) + ") - when used in conjunction with input data of shape" + " [batch,channels,h,w] 4d masks passing through CnnToFeedForwardPreProcessor should have shape" + " [batchSize,1,1,1]");<NEW_LINE>}<NEW_LINE>return new Pair<>(maskArray.reshape(maskArray.ordering(), maskArray.size(0), maskArray.<MASK><NEW_LINE>}
size(1)), currentMaskState);
1,456,723
private static AgentRollup createAgentRollup(String agentRollupId, Multimap<String, String> childMultimap, Map<String, String> agentDisplayMap, boolean stripTopLevelDisplay) {<NEW_LINE>Collection<String> childAgentRollupIds = childMultimap.get(agentRollupId);<NEW_LINE>List<String> agentRollupIds = AgentRollupIds.getAgentRollupIds(agentRollupId);<NEW_LINE>List<String> displayParts = new ArrayList<>();<NEW_LINE>ListIterator<String> i = agentRollupIds.listIterator(agentRollupIds.size());<NEW_LINE>if (stripTopLevelDisplay) {<NEW_LINE>i.previous();<NEW_LINE>}<NEW_LINE>while (i.hasPrevious()) {<NEW_LINE>displayParts.add(checkNotNull(agentDisplayMap.get(i.previous())));<NEW_LINE>}<NEW_LINE>ImmutableAgentRollup.Builder builder = ImmutableAgentRollup.builder().id(agentRollupId).display(Joiner.on(" :: ").join(displayParts)).lastDisplayPart(displayParts.get(displayParts.size() - 1));<NEW_LINE>List<AgentRollup> <MASK><NEW_LINE>for (String childAgentRollupId : childAgentRollupIds) {<NEW_LINE>childAgentRollups.add(createAgentRollup(childAgentRollupId, childMultimap, agentDisplayMap, stripTopLevelDisplay));<NEW_LINE>}<NEW_LINE>childAgentRollups.sort(Comparator.comparing(AgentRollup::display));<NEW_LINE>return builder.addAllChildren(childAgentRollups).build();<NEW_LINE>}
childAgentRollups = new ArrayList<>();
1,463,072
public InstanceIdentity unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceIdentity instanceIdentity = new InstanceIdentity();<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("Document", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceIdentity.setDocument(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Signature", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceIdentity.setSignature(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 instanceIdentity;<NEW_LINE>}
class).unmarshall(context));
1,581,487
private void serialize(Server server, Query query, List<Result> results, OutputStream outputStream) throws IOException {<NEW_LINE>JsonGenerator g = jsonFactory.createGenerator(outputStream, JsonEncoding.UTF8);<NEW_LINE>g.writeStartObject();<NEW_LINE>g.writeArrayFieldStart("counters");<NEW_LINE>g.writeEndArray();<NEW_LINE>String source = getSource(server);<NEW_LINE>g.writeArrayFieldStart("gauges");<NEW_LINE>List<String> typeNames = getTypeNames();<NEW_LINE>for (Result result : results) {<NEW_LINE>if (isNumeric(result.getValue())) {<NEW_LINE>g.writeStartObject();<NEW_LINE>g.writeStringField("name", KeyUtils.getKeyString(query, result, typeNames));<NEW_LINE>if (source != null && !source.isEmpty()) {<NEW_LINE>g.writeStringField("source", source);<NEW_LINE>}<NEW_LINE>g.writeNumberField("measure_time", TimeUnit.SECONDS.convert(result.getEpoch(), TimeUnit.MILLISECONDS));<NEW_LINE><MASK><NEW_LINE>if (value instanceof Integer) {<NEW_LINE>g.writeNumberField("value", (Integer) value);<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>g.writeNumberField("value", (Long) value);<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>g.writeNumberField("value", (Float) value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>g.writeNumberField("value", (Double) value);<NEW_LINE>}<NEW_LINE>g.writeEndObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.writeEndArray();<NEW_LINE>g.writeEndObject();<NEW_LINE>g.flush();<NEW_LINE>g.close();<NEW_LINE>}
Object value = result.getValue();
1,613,206
public void call(ClientSide clientSide, String data) {<NEW_LINE>Room room = new Room(ServerContains.getServerId());<NEW_LINE>room.setStatus(RoomStatus.WAIT);<NEW_LINE>room.setType(RoomType.PVP);<NEW_LINE>room.<MASK><NEW_LINE>room.getClientSideMap().put(clientSide.getId(), clientSide);<NEW_LINE>room.getClientSideList().add(clientSide);<NEW_LINE>room.setCurrentSellClient(clientSide.getId());<NEW_LINE>room.setCreateTime(System.currentTimeMillis());<NEW_LINE>room.setLastFlushTime(System.currentTimeMillis());<NEW_LINE>clientSide.setRoomId(room.getId());<NEW_LINE>ServerContains.addRoom(room);<NEW_LINE>clientSide.setStatus(ClientStatus.NO_READY);<NEW_LINE>ChannelUtils.pushToClient(clientSide.getChannel(), ClientEventCode.CODE_ROOM_CREATE_SUCCESS, Noson.reversal(room));<NEW_LINE>}
setRoomOwner(clientSide.getNickname());
1,298,271
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null) {<NEW_LINE>routeId = args.getInt(ROUTE_ID_KEY);<NEW_LINE>}<NEW_LINE>pageMarginPx = dpToPx(PAGE_MARGIN);<NEW_LINE>toolbarHeightPx = getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);<NEW_LINE>View view = super.onCreateView(inflater, container, savedInstanceState);<NEW_LINE>if (view != null) {<NEW_LINE>if (isPortrait()) {<NEW_LINE>view.findViewById(getBottomScrollViewId()).setBackgroundDrawable(null);<NEW_LINE>LinearLayout cardsContainer = getCardsContainer();<NEW_LINE>FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) cardsContainer.getLayoutParams();<NEW_LINE>AndroidUtils.setMargins(layoutParams, <MASK><NEW_LINE>cardsContainer.setLayoutParams(layoutParams);<NEW_LINE>updateCardsLayout();<NEW_LINE>}<NEW_LINE>updateCards();<NEW_LINE>runLayoutListener();<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>}
pageMarginPx, 0, pageMarginPx, 0);
1,206,767
private void postAllStashedGraphicAction(final String instanceId, final BasicGraphicAction action) {<NEW_LINE>final RenderContextImpl <MASK><NEW_LINE>// / keep actions if renderContext still exist<NEW_LINE>ArrayList<Map<String, Object>> tmpList = null;<NEW_LINE>if (renderContext != null) {<NEW_LINE>tmpList = new ArrayList<>(mBatchActions);<NEW_LINE>}<NEW_LINE>// clear stashed actions<NEW_LINE>this.mBatchActions.clear();<NEW_LINE>mCurrentBatchInstanceId = null;<NEW_LINE>nativeBatchTimes = 0;<NEW_LINE>// return if renderContext has been destroyed<NEW_LINE>if (renderContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// / post actions if renderContext still exist<NEW_LINE>ArrayList<BasicGraphicAction> actions = new ArrayList<>(tmpList.size());<NEW_LINE>for (int i = 0; i < tmpList.size(); i++) {<NEW_LINE>Map<String, Object> item = tmpList.get(i);<NEW_LINE>Object mustBeAction = item.get(sKeyAction);<NEW_LINE>if (!(mustBeAction instanceof BasicGraphicAction)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BasicGraphicAction tmpAction = (BasicGraphicAction) mustBeAction;<NEW_LINE>if (tmpAction.mActionType == BasicGraphicAction.ActionTypeBatchBegin || tmpAction.mActionType == BasicGraphicAction.ActionTypeBatchEnd) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>actions.add(tmpAction);<NEW_LINE>}<NEW_LINE>postGraphicAction(instanceId, new GraphicActionBatchAction(action.getWXSDKIntance(), action.getRef(), actions));<NEW_LINE>}
renderContext = mRenderContext.get(instanceId);
1,028,170
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException {<NEW_LINE>final ArrayList<MailMessage<MASK><NEW_LINE>final ListIterator<MailMessage> iterator = mail.listIterator();<NEW_LINE>boolean hadMail = false;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>final MailMessage mailObj = iterator.next();<NEW_LINE>if (mailObj.isExpired()) {<NEW_LINE>iterator.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>hadMail = true;<NEW_LINE>player.sendMessage(ess.getMail().getMailLine(mailObj));<NEW_LINE>iterator.set(new MailMessage(true, mailObj.isLegacy(), mailObj.getSenderUsername(), mailObj.getSenderUUID(), mailObj.getTimeSent(), mailObj.getTimeExpire(), mailObj.getMessage()));<NEW_LINE>}<NEW_LINE>if (!hadMail) {<NEW_LINE>player.sendMessage(tl("noNewMail"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>player.setMailList(mail);<NEW_LINE>player.sendMessage(tl("markMailAsRead"));<NEW_LINE>return true;<NEW_LINE>}
> mail = player.getMailMessages();
1,357,812
final DescribeOrganizationResult executeDescribeOrganization(DescribeOrganizationRequest describeOrganizationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeOrganizationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeOrganizationRequest> request = null;<NEW_LINE>Response<DescribeOrganizationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeOrganizationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeOrganizationRequest));<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, "Organizations");<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<DescribeOrganizationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeOrganizationResultJsonUnmarshaller());<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, "DescribeOrganization");
521,677
public SVD createSVD(final RealMatrix realMat) {<NEW_LINE>Utils.nonNull(realMat, "Cannot perform Spark MLLib SVD on a null matrix.");<NEW_LINE>final RowMatrix mat = SparkConverter.convertRealMatrixToSparkRowMatrix(sc, realMat, NUM_SLICES);<NEW_LINE>// Compute all of the singular values and corresponding singular vectors.<NEW_LINE>final SingularValueDecomposition<RowMatrix, Matrix> svd = mat.computeSVD((int) mat.numCols(), true, 1.0E-9d);<NEW_LINE>// Get our distributed results<NEW_LINE>final RowMatrix u = svd.U();<NEW_LINE>final Vector s = svd.s();<NEW_LINE>final Matrix v = svd<MASK><NEW_LINE>// Move the matrices from Spark/distributed space to Apache Commons space<NEW_LINE>logger.info("Converting distributed Spark matrix to local matrix...");<NEW_LINE>final RealMatrix uReal = SparkConverter.convertSparkRowMatrixToRealMatrix(u, realMat.getRowDimension());<NEW_LINE>logger.info("Done converting distributed Spark matrix to local matrix...");<NEW_LINE>logger.info("Converting Spark matrix to local matrix...");<NEW_LINE>final RealMatrix vReal = SparkConverter.convertSparkMatrixToRealMatrix(v);<NEW_LINE>logger.info("Done converting Spark matrix to local matrix...");<NEW_LINE>final double[] singularValues = s.toArray();<NEW_LINE>logger.info("Calculating the pseudoinverse...");<NEW_LINE>logger.info("Pinv: calculating tolerance...");<NEW_LINE>// Note that the pinv of realMat is V * invS * U'<NEW_LINE>final double tolerance = Math.max(realMat.getColumnDimension(), realMat.getRowDimension()) * realMat.getNorm() * EPS;<NEW_LINE>logger.info("Pinv: inverting the singular values (with tolerance) and creating a diagonal matrix...");<NEW_LINE>final double[] invS = Arrays.stream(singularValues).map(sv -> invertSVWithTolerance(sv, tolerance)).toArray();<NEW_LINE>final Matrix invSMat = Matrices.diag(Vectors.dense(invS));<NEW_LINE>logger.info("Pinv: Multiplying V * invS * U' to get the pinv (using pinv transpose = U * invS' * V') ...");<NEW_LINE>final RowMatrix pinvT = u.multiply(invSMat).multiply(v);<NEW_LINE>logger.info("Pinv: Converting back to local matrix ...");<NEW_LINE>final RealMatrix pinv = SparkConverter.convertSparkRowMatrixToRealMatrix(pinvT, realMat.getRowDimension()).transpose();<NEW_LINE>logger.info("Done calculating the pseudoinverse and converting it...");<NEW_LINE>return new SimpleSVD(uReal, s.toArray(), vReal, pinv);<NEW_LINE>}
.V().transpose();
1,477,887
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException {<NEW_LINE>logger.info("x");<NEW_LINE>return new DirectoryStream() {<NEW_LINE><NEW_LINE>boolean closed = false;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Iterator iterator() {<NEW_LINE>if (!closed) {<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>final List<StructrSSHFile> <MASK><NEW_LINE>final StructrSSHFile thisDir = (StructrSSHFile) dir;<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>for (final Folder child : thisDir.getFolders()) {<NEW_LINE>files.add(new StructrSSHFile(thisDir, child.getName(), child));<NEW_LINE>}<NEW_LINE>for (final File child : thisDir.getFiles()) {<NEW_LINE>files.add(new StructrSSHFile(thisDir, child.getName(), child));<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>logger.warn("", fex);<NEW_LINE>}<NEW_LINE>return files.iterator();<NEW_LINE>}<NEW_LINE>return Collections.emptyIterator();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close() throws IOException {<NEW_LINE>closed = true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
files = new LinkedList<>();
1,248,658
private IWeEventFileClient buildIWeEventFileClient(Integer brokerId, String groupId, String nodeAddress) {<NEW_LINE>String clientKey = brokerId <MASK><NEW_LINE>if (!this.fileClientMap.containsKey(clientKey)) {<NEW_LINE>FiscoConfig fiscoConfig = new FiscoConfig();<NEW_LINE>fiscoConfig.load("");<NEW_LINE>List<String> nodeList = Arrays.asList(nodeAddress.split(","));<NEW_LINE>fiscoConfig.setFiscoNodes(nodeList);<NEW_LINE>String downloadPath = this.downloadPath + File.separator + nodeAddress2Path(nodeAddress);<NEW_LINE>IWeEventFileClient fileClient = IWeEventFileClient.build(groupId, downloadPath, ConstantProperties.FILE_CHUNK_SIZE, fiscoConfig);<NEW_LINE>this.fileClientMap.put(clientKey, fileClient);<NEW_LINE>}<NEW_LINE>return this.fileClientMap.get(clientKey);<NEW_LINE>}
+ IDENTIFIER + groupId + IDENTIFIER + nodeAddress;
1,097,984
private void execute(SSSPContext context, IFragment<Long, Long, Long, Double> frag) {<NEW_LINE>int innerVerticesNum = (int) frag.getInnerVerticesNum();<NEW_LINE>BiConsumer<Vertex<Long>, Integer> consumer = (vertex, finalTid) -> {<NEW_LINE>double curDist = context.partialResults.get(vertex);<NEW_LINE>AdjList<Long, Double> <MASK><NEW_LINE>for (Nbr<Long, Double> nbr : nbrs.iterable()) {<NEW_LINE>long curLid = nbr.neighbor().GetValue();<NEW_LINE>double nextDist = curDist + nbr.data();<NEW_LINE>if (nextDist < context.partialResults.get(curLid)) {<NEW_LINE>context.partialResults.compareAndSetMin(curLid, nextDist);<NEW_LINE>context.nextModified.set(curLid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>forEachVertex(frag.innerVertices(), context.threadNum, context.executor, context.curModified, consumer);<NEW_LINE>}
nbrs = frag.getOutgoingAdjList(vertex);
1,764,982
public static // fun_name? argument_definition_list clause_guard? clause_body<NEW_LINE>boolean fun_clause(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "fun_clause"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, "<fun clause>", ERL_PAR_LEFT, ERL_VAR))<NEW_LINE>return false;<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ERL_FUN_CLAUSE, "<fun clause>");<NEW_LINE>r = fun_clause_0(b, l + 1);<NEW_LINE>r = r && argument_definition_list(b, l + 1);<NEW_LINE>// pin = 2<NEW_LINE>p = r;<NEW_LINE>r = r && report_error_(b, fun_clause_2<MASK><NEW_LINE>r = p && clause_body(b, l + 1) && r;<NEW_LINE>exit_section_(b, l, m, r, p, null);<NEW_LINE>return r || p;<NEW_LINE>}
(b, l + 1));
306,050
public StepExecutionResult execute(ExecutionContext context) throws IOException, InterruptedException {<NEW_LINE>if (dryRunResultsPath.isPresent()) {<NEW_LINE>NSDictionary dryRunResult = new NSDictionary();<NEW_LINE>dryRunResult.put("relative-path-to-sign", dryRunResultsPath.get().getParent().relativize(pathToSign).toString());<NEW_LINE>dryRunResult.put("use-entitlements", pathToSigningEntitlements.isPresent());<NEW_LINE>dryRunResult.put("identity", getIdentityArg(codeSignIdentitySupplier.get()));<NEW_LINE>filesystem.writeContentsToPath(dryRunResult.toXMLPropertyList(), dryRunResultsPath.get());<NEW_LINE>return StepExecutionResults.SUCCESS;<NEW_LINE>}<NEW_LINE>ProcessExecutorParams.Builder paramsBuilder = ProcessExecutorParams.builder();<NEW_LINE>if (codesignAllocatePath.isPresent()) {<NEW_LINE>ImmutableList<String> commandPrefix = codesignAllocatePath.get().getCommandPrefix(resolver);<NEW_LINE>paramsBuilder.setEnvironment(ImmutableMap.of("CODESIGN_ALLOCATE", Joiner.on(" ").join(commandPrefix)));<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<String<MASK><NEW_LINE>commandBuilder.addAll(codesign.getCommandPrefix(resolver));<NEW_LINE>commandBuilder.add("--force", "--sign", getIdentityArg(codeSignIdentitySupplier.get()));<NEW_LINE>commandBuilder.addAll(codesignFlags);<NEW_LINE>if (pathToSigningEntitlements.isPresent()) {<NEW_LINE>commandBuilder.add("--entitlements", pathToSigningEntitlements.get().toString());<NEW_LINE>}<NEW_LINE>commandBuilder.add(pathToSign.toString());<NEW_LINE>ProcessExecutorParams processExecutorParams = paramsBuilder.setCommand(commandBuilder.build()).setDirectory(filesystem.getRootPath().getPath()).build();<NEW_LINE>// Must specify that stdout is expected or else output may be wrapped in Ansi escape chars.<NEW_LINE>Set<ProcessExecutor.Option> options = EnumSet.of(ProcessExecutor.Option.EXPECTING_STD_OUT);<NEW_LINE>ProcessExecutor processExecutor = context.getProcessExecutor();<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("codesign command: %s", Joiner.on(" ").join(processExecutorParams.getCommand()));<NEW_LINE>}<NEW_LINE>ProcessExecutor.Result result = processExecutor.launchAndExecute(processExecutorParams, options, /* stdin */<NEW_LINE>Optional.empty(), /* timeOutMs */<NEW_LINE>Optional.of(codesignTimeout.toMillis()), /* timeOutHandler */<NEW_LINE>Optional.empty());<NEW_LINE>if (result.isTimedOut()) {<NEW_LINE>throw new RuntimeException("codesign timed out. This may be due to the keychain being locked.");<NEW_LINE>}<NEW_LINE>if (result.getExitCode() != 0) {<NEW_LINE>return StepExecutionResult.of(result);<NEW_LINE>}<NEW_LINE>return StepExecutionResults.SUCCESS;<NEW_LINE>}
> commandBuilder = ImmutableList.builder();
711,282
public ReleaseDTO updateAndPublish(@PathVariable("appId") String appId, @PathVariable("clusterName") String clusterName, @PathVariable("namespaceName") String namespaceName, @RequestParam("releaseName") String releaseName, @RequestParam("branchName") String branchName, @RequestParam(value = "deleteBranch", defaultValue = "true") boolean deleteBranch, @RequestParam(name = "releaseComment", required = false) String releaseComment, @RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish, @RequestBody ItemChangeSets changeSets) {<NEW_LINE>Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);<NEW_LINE>if (namespace == null) {<NEW_LINE>throw new NotFoundException("Could not find namespace for %s %s %s", appId, clusterName, namespaceName);<NEW_LINE>}<NEW_LINE>Release release = releaseService.mergeBranchChangeSetsAndRelease(namespace, branchName, releaseName, releaseComment, isEmergencyPublish, changeSets);<NEW_LINE>if (deleteBranch) {<NEW_LINE>namespaceBranchService.deleteBranch(appId, clusterName, namespaceName, branchName, NamespaceBranchStatus.MERGED, changeSets.getDataChangeLastModifiedBy());<NEW_LINE>}<NEW_LINE>messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName), Topics.APOLLO_RELEASE_TOPIC);<NEW_LINE>return BeanUtils.<MASK><NEW_LINE>}
transform(ReleaseDTO.class, release);
661,617
public void writeEntryHeader(byte[] outbuf) {<NEW_LINE>int offset = 0;<NEW_LINE>offset = TarHeader.getNameBytes(this.header.name, outbuf, offset, TarHeader.NAMELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.mode, outbuf, offset, TarHeader.MODELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.userId, outbuf, offset, TarHeader.UIDLEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.groupId, outbuf, offset, TarHeader.GIDLEN);<NEW_LINE>long size = this.header.size;<NEW_LINE>offset = Octal.getLongOctalBytes(size, outbuf, offset, TarHeader.SIZELEN);<NEW_LINE>offset = Octal.getLongOctalBytes(this.header.modTime, outbuf, offset, TarHeader.MODTIMELEN);<NEW_LINE>int csOffset = offset;<NEW_LINE>for (int c = 0; c < TarHeader.CHKSUMLEN; ++c) outbuf[offset++] = (byte) ' ';<NEW_LINE>outbuf[offset++] = this.header.linkFlag;<NEW_LINE>offset = TarHeader.getNameBytes(this.header.linkName, outbuf, offset, TarHeader.NAMELEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.magic, outbuf, offset, TarHeader.MAGICLEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.userName, outbuf, offset, TarHeader.UNAMELEN);<NEW_LINE>offset = TarHeader.getNameBytes(this.header.groupName, outbuf, offset, TarHeader.GNAMELEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.devMajor, outbuf, offset, TarHeader.DEVLEN);<NEW_LINE>offset = Octal.getOctalBytes(this.header.devMinor, outbuf, offset, TarHeader.DEVLEN);<NEW_LINE>for (; offset < outbuf.length; ) outbuf[offset++] = 0;<NEW_LINE>long <MASK><NEW_LINE>Octal.getCheckSumOctalBytes(checkSum, outbuf, csOffset, TarHeader.CHKSUMLEN);<NEW_LINE>}
checkSum = this.computeCheckSum(outbuf);
1,116,306
private DeploymentRoutingStatus deploymentStatus(String upstreamName) {<NEW_LINE>Instant changedAt = clock.instant();<NEW_LINE>Path path = deploymentStatusPath(upstreamName);<NEW_LINE>Optional<byte[]> data = curator.getData(path);<NEW_LINE>if (data.isEmpty()) {<NEW_LINE>return new DeploymentRoutingStatus(RoutingStatus.in, "", "", changedAt);<NEW_LINE>}<NEW_LINE>String agent = "";<NEW_LINE>String reason = "";<NEW_LINE>RoutingStatus status = RoutingStatus.out;<NEW_LINE>if (data.get().length > 0) {<NEW_LINE>// Compatibility with old format, where no data is stored<NEW_LINE>Slime slime = SlimeUtils.jsonToSlime(data.get());<NEW_LINE>Cursor root = slime.get();<NEW_LINE>status = asRoutingStatus(root.field("status").asString());<NEW_LINE>agent = root.field("agent").asString();<NEW_LINE>reason = root.<MASK><NEW_LINE>changedAt = Instant.ofEpochSecond(root.field("lastUpdate").asLong());<NEW_LINE>}<NEW_LINE>return new DeploymentRoutingStatus(status, agent, reason, changedAt);<NEW_LINE>}
field("cause").asString();
1,832,488
private static Map<OmrShape, Shape> buildOmrShapeMap() {<NEW_LINE>final Map<OmrShape, Shape> map = new EnumMap<>(OmrShape.class);<NEW_LINE>for (Map.Entry<Shape, OmrShape> entry : SHAPE_TO_OMRSHAPE.entrySet()) {<NEW_LINE>final Shape shape = entry.getKey();<NEW_LINE>final OmrShape omrShape = entry.getValue();<NEW_LINE>if (omrShape != null) {<NEW_LINE>map.put(omrShape, shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// -------------------<NEW_LINE>// Manual adjustments<NEW_LINE>// -------------------<NEW_LINE>//<NEW_LINE>map.put(OmrShape.cClefAlto, Shape.C_CLEF);<NEW_LINE>map.put(OmrShape.cClefTenor, Shape.C_CLEF);<NEW_LINE>// map.put(OmrShape.cClefAltoChange, Shape.XXX);<NEW_LINE>//<NEW_LINE>map.put(OmrShape.keyFlat, Shape.FLAT);<NEW_LINE>map.put(OmrShape.keySharp, Shape.SHARP);<NEW_LINE>map.put(OmrShape.keyNatural, Shape.NATURAL);<NEW_LINE>map.put(OmrShape.articAccentAbove, Shape.ACCENT);<NEW_LINE>map.put(OmrShape.articAccentBelow, Shape.ACCENT);<NEW_LINE>map.put(OmrShape.articMarcatoAbove, Shape.STRONG_ACCENT);<NEW_LINE>map.put(OmrShape.articMarcatoBelow, Shape.STRONG_ACCENT);<NEW_LINE>map.put(OmrShape.articStaccatissimoAbove, Shape.STACCATISSIMO);<NEW_LINE>map.put(OmrShape.articStaccatissimoBelow, Shape.STACCATISSIMO);<NEW_LINE>map.put(<MASK><NEW_LINE>map.put(OmrShape.articStaccatoBelow, Shape.STACCATO);<NEW_LINE>map.put(OmrShape.articTenutoAbove, Shape.TENUTO);<NEW_LINE>map.put(OmrShape.articTenutoBelow, Shape.TENUTO);<NEW_LINE>//<NEW_LINE>// map.put(OmrShape.graceNoteAcciaccaturaStemDown, Shape.XXX);<NEW_LINE>// map.put(OmrShape.graceNoteAppoggiaturaStemDown, Shape.XXX);<NEW_LINE>//<NEW_LINE>return map;<NEW_LINE>}
OmrShape.articStaccatoAbove, Shape.STACCATO);
948,095
private void deleteItems() {<NEW_LINE>// Sort in ascending order so deleted items can be easily restored<NEW_LINE><MASK><NEW_LINE>Collections.sort(mPendingDeletedMessages, cmp);<NEW_LINE>removeItems();<NEW_LINE>Snackbar snackbar = Snackbar.make(getView(), getActivity().getString(R.string.item_deleted, mPendingDeletedMessages.size()), Snackbar.LENGTH_LONG);<NEW_LINE>snackbar.setAction(R.string.undo, e -> {<NEW_LINE>mIsPermanentlyDeleted = false;<NEW_LINE>// Restore items<NEW_LINE>for (PendingDeletedMessage pendingDeletedDeployment : mPendingDeletedMessages) {<NEW_LINE>mRecyclerViewAdapter.addItem(pendingDeletedDeployment.messageModel, pendingDeletedDeployment.getPosition());<NEW_LINE>}<NEW_LINE>clearItems();<NEW_LINE>});<NEW_LINE>View view = snackbar.getView();<NEW_LINE>TextView tv = (TextView) view.findViewById(android.support.design.R.id.snackbar_text);<NEW_LINE>tv.setTextColor(getAppContext().getResources().getColor(R.color.red));<NEW_LINE>snackbar.setCallback(new Snackbar.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDismissed(Snackbar snackbar, int event) {<NEW_LINE>super.onDismissed(snackbar, event);<NEW_LINE>if (event != Snackbar.Callback.DISMISS_EVENT_ACTION) {<NEW_LINE>if (mPendingDeletedMessages.size() > 0) {<NEW_LINE>for (PendingDeletedMessage pendingDeletedDeployment : mPendingDeletedMessages) {<NEW_LINE>mDeleteMessagePresenter.deleteMessage(pendingDeletedDeployment.messageModel.getMessageUuid());<NEW_LINE>}<NEW_LINE>clearItems();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>snackbar.show();<NEW_LINE>}
Comparator cmp = Collections.reverseOrder();
1,676,525
public Map<FileObject, Collection<String>> findByPrefix(RefactoringElementType type, String prefix) {<NEW_LINE>String keyName = type.getIndexKey();<NEW_LINE>Map<FileObject, Collection<String>> <MASK><NEW_LINE>try {<NEW_LINE>Collection<? extends IndexResult> results = querySupport.query(keyName, prefix, QuerySupport.Kind.PREFIX, keyName);<NEW_LINE>for (IndexResult result : results) {<NEW_LINE>String[] elements = result.getValues(keyName);<NEW_LINE>for (String e : elements) {<NEW_LINE>String val = e;<NEW_LINE>if (val.startsWith(prefix)) {<NEW_LINE>if (val.endsWith(VIRTUAL_ELEMENT_MARKER_STR)) {<NEW_LINE>// strip the marker<NEW_LINE>val = val.substring(0, val.length() - 1);<NEW_LINE>}<NEW_LINE>FileObject file = result.getFile();<NEW_LINE>if (file != null) {<NEW_LINE>map.computeIfAbsent(file, f -> new LinkedList<>()).add(val);<NEW_LINE>}<NEW_LINE>// else file deleted and index not updated yet<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
map = new HashMap<>();
996,865
private void updateImpl() {<NEW_LINE>Color color = <MASK><NEW_LINE>myText.setForeground(color);<NEW_LINE>myText2.setForeground(color);<NEW_LINE>myProgressBar.setForeground(color);<NEW_LINE>if (!StringUtil.equals(myText.getText(), myProgress.getText())) {<NEW_LINE>myText.setText(myProgress.getText());<NEW_LINE>}<NEW_LINE>if (!StringUtil.equals(myText2.getText(), myProgress.getText2())) {<NEW_LINE>myText2.setText(myProgress.getText2());<NEW_LINE>}<NEW_LINE>if ((myProgress.isIndeterminate() || myProgress.getFraction() == 0.0) != myProgressBar.isIndeterminate()) {<NEW_LINE>myProgressBar.setIndeterminate(myProgress.isIndeterminate() || myProgress.getFraction() == 0.0);<NEW_LINE>myProgressBar.revalidate();<NEW_LINE>}<NEW_LINE>if (!myProgressBar.isIndeterminate()) {<NEW_LINE>myProgressBar.setValue((int) (myProgress.getFraction() * 99) + 1);<NEW_LINE>}<NEW_LINE>myEastButtons.forEach(b -> b.updateAction.run());<NEW_LINE>}
TargetAWT.to(getTextForeground());
1,797,267
void propagate() {<NEW_LINE>if (this.parent != null) {<NEW_LINE>// Propagate the lowest death level of any descendants:<NEW_LINE>if (this.propagatedLowestChildSplitLevel == Double.MAX_VALUE) {<NEW_LINE>this.propagatedLowestChildSplitLevel = this.splitLevel;<NEW_LINE>}<NEW_LINE>if (this.propagatedLowestChildSplitLevel < this.parent.propagatedLowestChildSplitLevel) {<NEW_LINE>this.parent.propagatedLowestChildSplitLevel = this.propagatedLowestChildSplitLevel;<NEW_LINE>}<NEW_LINE>// If this cluster has no children, it must propagate itself:<NEW_LINE>if (!this.hasChildren) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.parent.propagatedDescendants.add(this);<NEW_LINE>} else {<NEW_LINE>// Chose the parent over descendants if there is a tie in stability:<NEW_LINE>if (this.stability >= this.propagatedStability) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.<MASK><NEW_LINE>} else {<NEW_LINE>this.parent.propagatedStability += this.propagatedStability;<NEW_LINE>this.parent.propagatedDescendants.addAll(this.propagatedDescendants);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
parent.propagatedDescendants.add(this);
248,575
public void uploadProject(final Project project, final int version, final File localFile, final File startupDependencies, final User uploader, final String uploaderIPAddr) {<NEW_LINE>byte[] md5 = null;<NEW_LINE>if (!(this.storage instanceof DatabaseStorage)) {<NEW_LINE>md5 = computeHash(localFile);<NEW_LINE>}<NEW_LINE>final ProjectStorageMetadata metadata = new ProjectStorageMetadata(project.getId(), version, uploader.<MASK><NEW_LINE>log.info(String.format("Adding archive to storage. Meta:%s File: %s[%d bytes]", metadata, localFile.getName(), localFile.length()));<NEW_LINE>// TODO spyne: remove hack. Database storage should go through the same flow<NEW_LINE>if (!(this.storage instanceof DatabaseStorage)) {<NEW_LINE>this.projectLoader.addProjectVersion(project.getId(), version, localFile, startupDependencies, uploader.getUserId(), requireNonNull(md5), requireNonNull(resourceId), uploaderIPAddr);<NEW_LINE>log.info(String.format("Added project metadata to DB. Meta:%s File: %s[%d bytes] URI: %s", metadata, localFile.getName(), localFile.length(), resourceId));<NEW_LINE>}<NEW_LINE>}
getUserId(), md5, uploaderIPAddr);
867,399
public LinkedHashSet<String> unify(String statement, int max) {<NEW_LINE>assert statement != null;<NEW_LINE>// this should not happen<NEW_LINE>if (statement == null)<NEW_LINE>return null;<NEW_LINE>boolean urlencode = statement.startsWith("http://") || statement.startsWith("https://");<NEW_LINE>// initialize collection<NEW_LINE>// completely instantiated<NEW_LINE>LinkedHashSet<String> <MASK><NEW_LINE>// partly instantiated<NEW_LINE>LinkedHashSet<String> s_inc = new LinkedHashSet<>();<NEW_LINE>if (SusiThought.hasVariablePattern(statement))<NEW_LINE>s_inc.add(statement);<NEW_LINE>else<NEW_LINE>s_com.add(statement);<NEW_LINE>// explore the past<NEW_LINE>pastsearch: for (SusiThought t : this) {<NEW_LINE>if (s_inc.size() == 0)<NEW_LINE>break pastsearch;<NEW_LINE>// this uses our iterator which iterates in reverse order.<NEW_LINE>// That means, latest thought is first returned.<NEW_LINE>// It also means that we are exploring the past, most recent events first.<NEW_LINE>// next instances<NEW_LINE>LinkedHashSet<String> ix = new LinkedHashSet<>();<NEW_LINE>// work through all already partly instantiated statements<NEW_LINE>for (String i : s_inc) {<NEW_LINE>String[] nextStatements = t.unify(i, Integer.MAX_VALUE, true, urlencode);<NEW_LINE>for (String s : nextStatements) {<NEW_LINE>if (SusiThought.hasVariablePattern(s))<NEW_LINE>ix.add(s);<NEW_LINE>else<NEW_LINE>s_com.add(s);<NEW_LINE>if (s_com.size() >= max)<NEW_LINE>break pastsearch;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>s_inc = ix;<NEW_LINE>}<NEW_LINE>// arrived here we ignore all s_inc and return just the complete statements<NEW_LINE>return s_com;<NEW_LINE>}
s_com = new LinkedHashSet<>();
1,248,986
public int calcScanParallelism(double io, SplitInfo splitInfo) {<NEW_LINE>if (lowConcurrencyQuery) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>ParamManager paramManager = session.getClientContext().getParamManager();<NEW_LINE>int parallelsim = -1;<NEW_LINE>if (paramManager.getBoolean(ConnectionParams.MPP_PARALLELISM_AUTO_ENABLE)) {<NEW_LINE>int maxParallelism = ExecUtils.getMppMaxParallelism(paramManager, !onlyUseReadInstance);<NEW_LINE>int minParallelism = ExecUtils.getMppMinParallelism(paramManager);<NEW_LINE>parallelsim = (int) (io / paramManager.getInt(ConnectionParams.MPP_QUERY_IO_PER_PARTITION)) + 1;<NEW_LINE>parallelsim = Math.max(Math.min(parallelsim, maxParallelism), minParallelism);<NEW_LINE>} else {<NEW_LINE>parallelsim = <MASK><NEW_LINE>if (parallelsim == 0) {<NEW_LINE>// Parallel query is disabled but we have a parallel plan... Very strange...<NEW_LINE>parallelsim = 1;<NEW_LINE>} else if (parallelsim < 0) {<NEW_LINE>parallelsim = (int) (io / paramManager.getInt(ConnectionParams.MPP_QUERY_IO_PER_PARTITION)) + 1;<NEW_LINE>parallelsim = Math.max(Math.min(parallelsim, ExecUtils.getMppMaxParallelism(paramManager, !onlyUseReadInstance)), ExecUtils.getMppMinParallelism(paramManager));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int dbParallelism = ExecUtils.getPolarDbCores(paramManager, !onlyUseReadInstance);<NEW_LINE>parallelsim = Math.max(Math.min(Math.min(splitInfo.getSplitCount(), dbParallelism * splitInfo.getInsCount()), parallelsim), 1);<NEW_LINE>return parallelsim;<NEW_LINE>}
paramManager.getInt(ConnectionParams.MPP_PARALLELISM);
1,020,204
public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>this.setPartName("ResponseTime[" + server.getName() + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(true);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE><MASK><NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));<NEW_LINE>CircularBufferDataProvider avgProvider = new CircularBufferDataProvider(true);<NEW_LINE>avgProvider.setBufferSize(((int) (TIME_RANGE / REFRESH_INTERVAL) + 1));<NEW_LINE>avgProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>avgProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>avgTrace = new Trace("Response Time(ms)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, avgProvider);<NEW_LINE>avgTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>avgTrace.setTraceType(TraceType.AREA);<NEW_LINE>avgTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>avgTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));<NEW_LINE>xyGraph.addTrace(avgTrace);<NEW_LINE>ScouterUtil.addHorizontalRangeListener(xyGraph.getPlotArea(), new OpenDigestTableAction(serverId), false);<NEW_LINE>thread = new RefreshThread(this, REFRESH_INTERVAL);<NEW_LINE>thread.start();<NEW_LINE>}
xyGraph.primaryXAxis.setDateEnabled(true);
880,779
public Map<Long, DbgSectionImpl> complete(DbgPendingCommand<?> pending) {<NEW_LINE>Map<DebugThreadId, DbgThread> threads = process.getKnownThreads();<NEW_LINE>Set<DebugThreadId> cur = threads.keySet();<NEW_LINE>DebugSystemObjects so = manager.getSystemObjects();<NEW_LINE>DebugThreadId previous = so.getCurrentThreadId();<NEW_LINE>for (DebugThreadId id : updatedThreadIds) {<NEW_LINE>if (cur.contains(id)) {<NEW_LINE>// Do nothing, we're in sync<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Need to create the thread as if we receive =thread-created<NEW_LINE>Msg.<MASK><NEW_LINE>so.setCurrentThreadId(id);<NEW_LINE>int tid = so.getCurrentThreadSystemId();<NEW_LINE>manager.getThreadComputeIfAbsent(id, process, tid);<NEW_LINE>}<NEW_LINE>for (DebugThreadId id : new ArrayList<>(cur)) {<NEW_LINE>if (updatedThreadIds.contains(id)) {<NEW_LINE>// Do nothing, we're in sync<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Need to remove the thread as if we received =thread-exited<NEW_LINE>Msg.warn(this, "Resync: Had extra thread: " + id);<NEW_LINE>process.removeThread(id);<NEW_LINE>manager.removeThread(id);<NEW_LINE>}<NEW_LINE>so.setCurrentThreadId(previous);<NEW_LINE>return process.getKnownMappings();<NEW_LINE>}
warn(this, "Resync: Was missing thread: " + id);
1,241,025
public void postProcessPartitionTable(int index) {<NEW_LINE>if (nodePartitionTables.size() == 1) {<NEW_LINE>PartitionTable table = nodePartitionTables.values()<MASK><NEW_LINE>while (!partitionQ.isEmpty()) {<NEW_LINE>table.add(index, partitionQ.poll());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<PartitionTable> underLoadedStates = new LinkedList<>();<NEW_LINE>int avgCount = slimDownNodesToAvgPartitionTableSize(index, underLoadedStates);<NEW_LINE>if (!partitionQ.isEmpty()) {<NEW_LINE>for (PartitionTable table : underLoadedStates) {<NEW_LINE>while (table.size(index) < avgCount) {<NEW_LINE>table.add(index, partitionQ.poll());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (!partitionQ.isEmpty()) {<NEW_LINE>for (PartitionTable table : nodePartitionTables.values()) {<NEW_LINE>table.add(index, partitionQ.poll());<NEW_LINE>if (partitionQ.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.iterator().next();
1,175,356
private void sysmonLoop() {<NEW_LINE>final long interval = TimeUnit.MICROSECONDS.toNanos(WispConfiguration.SYSMON_TICK_US);<NEW_LINE>final long carrierCheckRate = TimeUnit.<MASK><NEW_LINE>final long checkCarrierOnNthTick = carrierCheckRate / interval;<NEW_LINE>final boolean checkCarrier = // Detach carrier's worker cnt is not specified by configuration<NEW_LINE>WispConfiguration.CARRIER_GROW && checkCarrierOnNthTick > 0 && WispConfiguration.WORKER_COUNT == Runtime.getRuntime().availableProcessors();<NEW_LINE>long nextTick = System.nanoTime() + interval;<NEW_LINE>int tick = 0;<NEW_LINE>while (true) {<NEW_LINE>long timeout = nextTick - System.nanoTime();<NEW_LINE>if (timeout > 0) {<NEW_LINE>do {<NEW_LINE>UA.park0(false, timeout);<NEW_LINE>} while ((timeout = nextTick - System.nanoTime()) > 0);<NEW_LINE>handleLongOccupation();<NEW_LINE>if (checkCarrier && tick++ == checkCarrierOnNthTick) {<NEW_LINE>WispEngine.WISP_ROOT_ENGINE.scheduler.checkAndGrowWorkers(Runtime.getRuntime().availableProcessors());<NEW_LINE>tick = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// else: we're too slow, skip a tick<NEW_LINE>nextTick += interval;<NEW_LINE>}<NEW_LINE>}
MICROSECONDS.toNanos(WispConfiguration.SYSMON_CARRIER_GROW_TICK_US);
358,079
public void run() {<NEW_LINE>Thread.currentThread().setName("LogDispatcher-" + member.getName() + "-" + receiver);<NEW_LINE>try {<NEW_LINE>while (!Thread.interrupted()) {<NEW_LINE>SendLogRequest poll = logBlockingDeque.take();<NEW_LINE>currBatch.add(poll);<NEW_LINE>logBlockingDeque.drainTo(currBatch);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Sending {} logs to {}", currBatch.size(), receiver);<NEW_LINE>}<NEW_LINE>for (SendLogRequest request : currBatch) {<NEW_LINE>request.getAppendEntryRequest().entry <MASK><NEW_LINE>}<NEW_LINE>sendBatchLogs(currBatch);<NEW_LINE>currBatch.clear();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Unexpected error in log dispatcher", e);<NEW_LINE>}<NEW_LINE>logger.info("Dispatcher exits");<NEW_LINE>}
= request.serializedLogFuture.get();
23,545
public Request<GetSessionTokenRequest> marshall(GetSessionTokenRequest getSessionTokenRequest) {<NEW_LINE>if (getSessionTokenRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<GetSessionTokenRequest> request = new DefaultRequest<GetSessionTokenRequest>(getSessionTokenRequest, "AWSSecurityTokenService");<NEW_LINE>request.addParameter("Action", "GetSessionToken");<NEW_LINE>request.addParameter("Version", "2011-06-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (getSessionTokenRequest.getDurationSeconds() != null) {<NEW_LINE>request.addParameter("DurationSeconds", StringUtils.fromInteger(getSessionTokenRequest.getDurationSeconds()));<NEW_LINE>}<NEW_LINE>if (getSessionTokenRequest.getSerialNumber() != null) {<NEW_LINE>request.addParameter("SerialNumber", StringUtils.fromString(getSessionTokenRequest.getSerialNumber()));<NEW_LINE>}<NEW_LINE>if (getSessionTokenRequest.getTokenCode() != null) {<NEW_LINE>request.addParameter("TokenCode", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(getSessionTokenRequest.getTokenCode()));
1,700,492
public static ListApmApplicationResponse unmarshall(ListApmApplicationResponse listApmApplicationResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApmApplicationResponse.setRequestId(_ctx.stringValue("ListApmApplicationResponse.RequestId"));<NEW_LINE>listApmApplicationResponse.setTotal(_ctx.integerValue("ListApmApplicationResponse.Total"));<NEW_LINE>listApmApplicationResponse.setPageSize(_ctx.integerValue("ListApmApplicationResponse.PageSize"));<NEW_LINE>listApmApplicationResponse.setPageNumber<MASK><NEW_LINE>List<ApmAppInfo> apmAppInfoList = new ArrayList<ApmAppInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApmApplicationResponse.ApmAppInfoList.Length"); i++) {<NEW_LINE>ApmAppInfo apmAppInfo = new ApmAppInfo();<NEW_LINE>apmAppInfo.setApplicationId(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].ApplicationId"));<NEW_LINE>apmAppInfo.setClusterBizId(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].ClusterBizId"));<NEW_LINE>apmAppInfo.setApplicationType(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].ApplicationType"));<NEW_LINE>apmAppInfo.setName(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].Name"));<NEW_LINE>apmAppInfo.setState(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].State"));<NEW_LINE>apmAppInfo.setFinalStatus(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].FinalStatus"));<NEW_LINE>apmAppInfo.setQueue(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].Queue"));<NEW_LINE>apmAppInfo.setUser(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].User"));<NEW_LINE>apmAppInfo.setAllocatedVcore(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].AllocatedVcore"));<NEW_LINE>apmAppInfo.setAllocatedMemory(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].AllocatedMemory"));<NEW_LINE>apmAppInfo.setProgress(_ctx.floatValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].Progress"));<NEW_LINE>apmAppInfo.setVcoreSeconds(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].VcoreSeconds"));<NEW_LINE>apmAppInfo.setMemorySeconds(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].MemorySeconds"));<NEW_LINE>apmAppInfo.setStartTime(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].StartTime"));<NEW_LINE>apmAppInfo.setSubmitTime(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].SubmitTime"));<NEW_LINE>apmAppInfo.setFinishedTime(_ctx.longValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].FinishedTime"));<NEW_LINE>apmAppInfo.setDuration(_ctx.integerValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].Duration"));<NEW_LINE>apmAppInfo.setDiagnostics(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].Diagnostics"));<NEW_LINE>apmAppInfo.setClusterUsagePercent(_ctx.floatValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].ClusterUsagePercent"));<NEW_LINE>apmAppInfo.setQueueUsagePercent(_ctx.floatValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].QueueUsagePercent"));<NEW_LINE>apmAppInfo.setRunningContainers(_ctx.integerValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].RunningContainers"));<NEW_LINE>apmAppInfo.setRunningDuration(_ctx.integerValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].RunningDuration"));<NEW_LINE>apmAppInfo.setResourceRequests(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].ResourceRequests"));<NEW_LINE>apmAppInfo.setDiagnoseResult(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].DiagnoseResult"));<NEW_LINE>apmAppInfo.setDiagnoseCode(_ctx.stringValue("ListApmApplicationResponse.ApmAppInfoList[" + i + "].DiagnoseCode"));<NEW_LINE>apmAppInfoList.add(apmAppInfo);<NEW_LINE>}<NEW_LINE>listApmApplicationResponse.setApmAppInfoList(apmAppInfoList);<NEW_LINE>return listApmApplicationResponse;<NEW_LINE>}
(_ctx.integerValue("ListApmApplicationResponse.PageNumber"));
1,451,367
private BucketSearchResult firstItem(final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final LinkedList<PagePathItemUnit> path = new LinkedList<>();<NEW_LINE>long bucketIndex = ROOT_INDEX;<NEW_LINE>OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, bucketIndex, false);<NEW_LINE>int itemIndex = 0;<NEW_LINE>try {<NEW_LINE>CellBTreeBucketSingleValueV1<K> bucket = new CellBTreeBucketSingleValueV1<>(cacheEntry);<NEW_LINE>while (true) {<NEW_LINE>if (!bucket.isLeaf()) {<NEW_LINE>if (bucket.isEmpty() || itemIndex > bucket.size()) {<NEW_LINE>if (!path.isEmpty()) {<NEW_LINE>final PagePathItemUnit pagePathItemUnit = path.removeLast();<NEW_LINE>bucketIndex = pagePathItemUnit.pageIndex;<NEW_LINE>itemIndex = pagePathItemUnit.itemIndex + 1;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// noinspection ObjectAllocationInLoop<NEW_LINE>path.add(new PagePathItemUnit(bucketIndex, itemIndex));<NEW_LINE>if (itemIndex < bucket.size()) {<NEW_LINE>bucketIndex = bucket.getLeft(itemIndex);<NEW_LINE>} else {<NEW_LINE>bucketIndex = bucket.getRight(itemIndex - 1);<NEW_LINE>}<NEW_LINE>itemIndex = 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (bucket.isEmpty()) {<NEW_LINE>if (!path.isEmpty()) {<NEW_LINE>final PagePathItemUnit pagePathItemUnit = path.removeLast();<NEW_LINE>bucketIndex = pagePathItemUnit.pageIndex;<NEW_LINE>itemIndex = pagePathItemUnit.itemIndex + 1;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return new BucketSearchResult(0, bucketIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>cacheEntry = loadPageForRead(atomicOperation, fileId, bucketIndex, false);<NEW_LINE>// noinspection ObjectAllocationInLoop<NEW_LINE>bucket <MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>}
= new CellBTreeBucketSingleValueV1<>(cacheEntry);
844,902
public FlaggedLine readLineExpectComment() throws IOException {<NEW_LINE>int charRead = read();<NEW_LINE>if (charRead == -1)<NEW_LINE>// end of the reader reached<NEW_LINE>return null;<NEW_LINE>boolean decided = false;<NEW_LINE>FlaggedLine fl = new FlaggedLine();<NEW_LINE>while (charRead != -1 && charRead != (int) '\n' && charRead != (int) '\r') {<NEW_LINE>if (!decided)<NEW_LINE>if (UtilConvert.whiteSpaceChars.indexOf((char) charRead) == -1) {<NEW_LINE>// not a whitespace - decide now<NEW_LINE>fl.flag = (((char) charRead == '!') || ((char) charRead == '#'));<NEW_LINE>decided = true;<NEW_LINE>}<NEW_LINE>fl.line<MASK><NEW_LINE>charRead = read();<NEW_LINE>}<NEW_LINE>if (!decided)<NEW_LINE>// all were whitespaces<NEW_LINE>fl.flag = true;<NEW_LINE>// set the line separator<NEW_LINE>if (charRead == (int) '\r')<NEW_LINE>if (peek() == (int) '\n') {<NEW_LINE>charRead = read();<NEW_LINE>// NOI18N<NEW_LINE>fl.lineSep = "\r\n";<NEW_LINE>} else<NEW_LINE>// NOI18N<NEW_LINE>fl.lineSep = "\r";<NEW_LINE>else if (charRead == (int) '\n')<NEW_LINE>// NOI18N<NEW_LINE>fl.lineSep = "\n";<NEW_LINE>else<NEW_LINE>fl.lineSep = System.getProperty(LINE_SEPARATOR);<NEW_LINE>return fl;<NEW_LINE>}
.append((char) charRead);
903,796
public void generateProduct(Configurator configurator, JsonContext jsonAttributes, JsonContext jsonIndicators) throws AxelorException {<NEW_LINE>cleanIndicators(jsonIndicators);<NEW_LINE>Mapper mapper = Mapper.of(Product.class);<NEW_LINE>Product product = new Product();<NEW_LINE>for (String key : jsonIndicators.keySet()) {<NEW_LINE>mapper.set(product, key<MASK><NEW_LINE>}<NEW_LINE>fixRelationalFields(product);<NEW_LINE>fetchManyToManyFields(product);<NEW_LINE>fillOneToManyFields(configurator, product, jsonAttributes);<NEW_LINE>if (product.getProductTypeSelect() == null) {<NEW_LINE>product.setProductTypeSelect(ProductRepository.PRODUCT_TYPE_STORABLE);<NEW_LINE>}<NEW_LINE>if (product.getCode() == null) {<NEW_LINE>throw new AxelorException(configurator, TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.CONFIGURATOR_PRODUCT_MISSING_CODE));<NEW_LINE>}<NEW_LINE>if (product.getName() == null) {<NEW_LINE>throw new AxelorException(configurator, TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.CONFIGURATOR_PRODUCT_MISSING_NAME));<NEW_LINE>}<NEW_LINE>configurator.setProduct(product);<NEW_LINE>product.setConfigurator(configurator);<NEW_LINE>Beans.get(ProductRepository.class).save(product);<NEW_LINE>}
, jsonIndicators.get(key));
240,245
public void writePage(int zeroBasedPageNumber) throws IOException {<NEW_LINE>List<PageBox> pages = _root.getLayer().getPages();<NEW_LINE>if (zeroBasedPageNumber >= pages.size()) {<NEW_LINE>throw new IndexOutOfBoundsException();<NEW_LINE>}<NEW_LINE>RenderingContext c = newRenderingContext();<NEW_LINE>c.setInitialPageNo(_initialPageNo);<NEW_LINE>c.setFastRenderer(true);<NEW_LINE>PageBox page = pages.get(zeroBasedPageNumber);<NEW_LINE>Rectangle2D pageSize = new Rectangle2D.Float(0, 0, page.getWidth(c) / DEFAULT_DOTS_PER_PIXEL, page.getHeight(c) / DEFAULT_DOTS_PER_PIXEL);<NEW_LINE>_outputDevice.setRoot(_root);<NEW_LINE>FSPage pg = _pageProcessor.createPage(zeroBasedPageNumber, (int) pageSize.getWidth(), (int) pageSize.getHeight());<NEW_LINE>try {<NEW_LINE>_outputDevice.initializePage(pg.getGraphics());<NEW_LINE>_root.getLayer().assignPagePaintingPositions(c, _pagingMode);<NEW_LINE>c.setPageCount(pages.size());<NEW_LINE>c.setPage(zeroBasedPageNumber, page);<NEW_LINE><MASK><NEW_LINE>DisplayListContainer displayList = boxCollector.collectRoot(c, _root.getLayer());<NEW_LINE>paintPage(c, page, displayList.getPageInstructions(zeroBasedPageNumber));<NEW_LINE>} finally {<NEW_LINE>_pageProcessor.finishPage(pg);<NEW_LINE>_outputDevice.finish(c, _root);<NEW_LINE>}<NEW_LINE>}
DisplayListCollector boxCollector = new DisplayListCollector(pages);
1,028,512
private Address adjustTableEntryIfNonZero(Address tableBaseAddr, int entryIndex, long adjustment, ElfLoadHelper elfLoadHelper) throws MemoryAccessException, AddressOverflowException {<NEW_LINE>boolean is64Bit = elfLoadHelper.getElfHeader().is64Bit();<NEW_LINE>Memory memory = elfLoadHelper.getProgram().getMemory();<NEW_LINE>Address tableEntryAddr;<NEW_LINE>if (is64Bit) {<NEW_LINE>tableEntryAddr = tableBaseAddr.add(entryIndex * 8);<NEW_LINE>if (adjustment != 0) {<NEW_LINE>long offset = memory.getLong(tableEntryAddr);<NEW_LINE>if (offset != 0) {<NEW_LINE>elfLoadHelper.addFakeRelocTableEntry(tableEntryAddr, 8);<NEW_LINE>memory.setLong(tableEntryAddr, offset + adjustment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tableEntryAddr = tableBaseAddr.add(entryIndex * 4);<NEW_LINE>if (adjustment != 0) {<NEW_LINE>int offset = memory.getInt(tableEntryAddr);<NEW_LINE>if (offset != 0) {<NEW_LINE>elfLoadHelper.addFakeRelocTableEntry(tableEntryAddr, 4);<NEW_LINE>memory.setInt(tableEntryAddr, (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tableEntryAddr;<NEW_LINE>}
int) (offset + adjustment));
1,400,161
protected void testNavigationHandlerInjectionByApp(String contextRoot, LibertyServer server) throws Exception {<NEW_LINE>try (WebClient webClient = new WebClient()) {<NEW_LINE>URL url = JSFUtils.createHttpUrl(server, contextRoot, "NavigationHandler.jsf");<NEW_LINE>HtmlPage page = (HtmlPage) webClient.getPage(url);<NEW_LINE>if (page == null) {<NEW_LINE>Assert.fail("NavigationHandler.jsf did not render properly.");<NEW_LINE>}<NEW_LINE>// Click link to execute the methods and update the page<NEW_LINE>HtmlElement button = (HtmlElement) page.getElementById("form:submitButton");<NEW_LINE>page = button.click();<NEW_LINE>// Small wait to make sure the call happens.<NEW_LINE>Thread.sleep(2000);<NEW_LINE>HtmlElement testBeanValue = (HtmlElement) page.getElementById("navigationHandlerBeanValue");<NEW_LINE>assertNotNull(testBeanValue);<NEW_LINE>LOG.info("Bean Value = " + testBeanValue.asText());<NEW_LINE>assertTrue(testBeanValue.asText().contains(":NavigationHandlerBean:"));<NEW_LINE>assertTrue(testBeanValue.asText().contains(":NavigationHandler:"));<NEW_LINE>assertTrue(testBeanValue.asText().contains("com.ibm.ws.jsf22.fat.cdicommon.beans.injected.ManagedBeanFieldBean"));<NEW_LINE>assertTrue(testBeanValue.asText().contains("com.ibm.ws.jsf22.fat.cdicommon.beans.injected.ConstructorBean"));<NEW_LINE>assertTrue(testBeanValue.asText().contains("com.ibm.ws.jsf22.fat.cdicommon.beans.injected.MethodBean"));<NEW_LINE>assertTrue(testBeanValue.asText<MASK><NEW_LINE>assertTrue(testBeanValue.asText().contains(":PostConstructCalled:"));<NEW_LINE>}<NEW_LINE>}
().contains(":TestNavigationHandlerInterceptor:"));
271,968
public SecurityAuthentication create(SecurityCredentials credentials) {<NEW_LINE>String grantType = credentials.getPropertyStr("grantType");<NEW_LINE>String requestScope = credentials.getPropertyStr("scope");<NEW_LINE>String accessTokenUri = credentials.getPropertyStr("accessTokenUri");<NEW_LINE>String <MASK><NEW_LINE>// Resource owner<NEW_LINE>String username = credentials.getPropertyStr("resourceOwner.identifier");<NEW_LINE>char[] password = credentials.getPropertyChars("resourceOwner.secret");<NEW_LINE>try {<NEW_LINE>SURL tokenService = SURL.create(accessTokenUri);<NEW_LINE>StringBuilder content = new StringBuilder().append("grant_type=").append(urlEncode(grantType));<NEW_LINE>if (StringUtils.isNotEmpty(requestScope)) {<NEW_LINE>content.append("&scope=").append(urlEncode(requestScope));<NEW_LINE>}<NEW_LINE>// OAuth2 with BasicAuth via principal (standard)<NEW_LINE>SecurityAuthentication basicAuth = basicAuthManager.create(SecurityCredentials.basicAuth(credentials.getIdentifier(), credentials.getSecret()));<NEW_LINE>// We need to add the principal to the form<NEW_LINE>content.append("&username=").append(urlEncode(username)).append("&password=").append(urlEncode(new String(password)));<NEW_LINE>return requestAndCreateAuthFromResponse(credentials.getProxy(), grantType, tokenType, tokenService, content.toString(), basicAuth);<NEW_LINE>} finally {<NEW_LINE>if (password != null && password.length > 0) {<NEW_LINE>Arrays.fill(password, '*');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
tokenType = credentials.getPropertyStr("tokenType");
1,601,511
protected void addVerbatimBeforeComponent(UIComponentClassicTagBase parentTag, UIComponent verbatimComp, UIComponent component) {<NEW_LINE>UIComponent parent = component.getParent();<NEW_LINE>if (parent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<UIComponent<MASK><NEW_LINE>// EDGE CASE:<NEW_LINE>// Consider CASE 1 or 2 where the _componentInstance is provided via a<NEW_LINE>// _componentInstance binding in session or application scope.<NEW_LINE>// The automatically created UIOuput instances for the template text<NEW_LINE>// will already be present. Check the JSP_CREATED_COMPONENT_IDS attribute,<NEW_LINE>// if present and the number of created components is the same<NEW_LINE>// as the number of children replace at a -1 offset from the current<NEW_LINE>// value of indexOfComponentInParent, otherwise, call add()<NEW_LINE>List<String> childrenAddedIds = (List<String>) parent.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);<NEW_LINE>int parentIndex = children.indexOf(component);<NEW_LINE>if (childrenAddedIds != null) {<NEW_LINE>if (parentIndex > 0 && childrenAddedIds.size() == parentIndex) {<NEW_LINE>UIComponent formerVerbatim = children.get(parentIndex - 1);<NEW_LINE>if (formerVerbatim instanceof UIOutput && formerVerbatim.isTransient()) {<NEW_LINE>children.set(parentIndex - 1, verbatimComp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>children.add(parentIndex, verbatimComp);<NEW_LINE>parentTag.addChild(verbatimComp);<NEW_LINE>}
> children = parent.getChildren();
1,500,132
private static void deindentPreCodeBlock(ImmutableList.Builder<Token> output, PeekingIterator<Token> tokens) {<NEW_LINE>Deque<Token> saved = new ArrayDeque<>();<NEW_LINE>output.add(new Token(LITERAL, tokens.next().getValue<MASK><NEW_LINE>while (tokens.hasNext() && tokens.peek().getType() != PRE_CLOSE_TAG) {<NEW_LINE>Token token = tokens.next();<NEW_LINE>saved.addLast(token);<NEW_LINE>}<NEW_LINE>while (!saved.isEmpty() && saved.peekFirst().getType() == FORCED_NEWLINE) {<NEW_LINE>saved.removeFirst();<NEW_LINE>}<NEW_LINE>while (!saved.isEmpty() && saved.peekLast().getType() == FORCED_NEWLINE) {<NEW_LINE>saved.removeLast();<NEW_LINE>}<NEW_LINE>if (saved.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// move the trailing `}` to its own line<NEW_LINE>Token last = saved.peekLast();<NEW_LINE>boolean trailingBrace = false;<NEW_LINE>if (last.getType() == LITERAL && last.getValue().endsWith("}")) {<NEW_LINE>saved.removeLast();<NEW_LINE>if (last.length() > 1) {<NEW_LINE>saved.addLast(new Token(LITERAL, last.getValue().substring(0, last.getValue().length() - 1)));<NEW_LINE>saved.addLast(new Token(FORCED_NEWLINE, null));<NEW_LINE>}<NEW_LINE>trailingBrace = true;<NEW_LINE>}<NEW_LINE>int trim = -1;<NEW_LINE>for (Token token : saved) {<NEW_LINE>if (token.getType() == LITERAL) {<NEW_LINE>int idx = CharMatcher.isNot(' ').indexIn(token.getValue());<NEW_LINE>if (idx != -1 && (trim == -1 || idx < trim)) {<NEW_LINE>trim = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.add(new Token(FORCED_NEWLINE, "\n"));<NEW_LINE>for (Token token : saved) {<NEW_LINE>if (token.getType() == LITERAL) {<NEW_LINE>output.add(new Token(LITERAL, trim > 0 && token.length() > trim ? token.getValue().substring(trim) : token.getValue()));<NEW_LINE>} else {<NEW_LINE>output.add(token);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (trailingBrace) {<NEW_LINE>output.add(new Token(LITERAL, "}"));<NEW_LINE>} else {<NEW_LINE>output.add(new Token(FORCED_NEWLINE, "\n"));<NEW_LINE>}<NEW_LINE>}
().trim()));
135,559
public void onValidate(@NonNull String purchaseData, @NonNull ValidationStatus status, boolean isTrial) {<NEW_LINE>LOGGER.i(TAG, "Validation status of '" + mType + "': " + status);<NEW_LINE>if (status == ValidationStatus.VERIFIED)<NEW_LINE>Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_VALIDATION_SUCCESS, mType.getServerId());<NEW_LINE>else<NEW_LINE>Statistics.INSTANCE.trackPurchaseValidationError(mType.getServerId(), status);<NEW_LINE>final <MASK><NEW_LINE>final boolean hasActiveSubscription = Framework.nativeHasActiveSubscription(mType.ordinal());<NEW_LINE>if (!hasActiveSubscription && shouldActivateSubscription) {<NEW_LINE>LOGGER.i(TAG, "'" + mType + "' subscription activated");<NEW_LINE>Statistics.INSTANCE.trackPurchaseProductDelivered(mType.getServerId(), mType.getVendor(), isTrial);<NEW_LINE>} else if (hasActiveSubscription && !shouldActivateSubscription) {<NEW_LINE>LOGGER.i(TAG, "'" + mType + "' subscription deactivated");<NEW_LINE>}<NEW_LINE>Framework.nativeSetActiveSubscription(mType.ordinal(), shouldActivateSubscription, isTrial);<NEW_LINE>if (getUiCallback() != null)<NEW_LINE>getUiCallback().onValidationFinish(shouldActivateSubscription);<NEW_LINE>}
boolean shouldActivateSubscription = status != ValidationStatus.NOT_VERIFIED;
391,820
public static void copy(Path sourcePath, Path targetPath) {<NEW_LINE>try {<NEW_LINE>Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFileFailed(Path file, IOException exc) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {<NEW_LINE>if (Files.exists(dir)) {<NEW_LINE>Files.createDirectories(targetPath.resolve(sourcePath.relativize(dir)));<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {<NEW_LINE>if (!IGNORE.equals(file.getFileName().toString()) && Files.exists(file)) {<NEW_LINE>CopyOption[] option = { <MASK><NEW_LINE>Files.copy(file, targetPath.resolve(sourcePath.relativize(file)), option);<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new BLangRuntimeException("error occured while copying from '" + sourcePath + "' " + "to '" + targetPath + "'", e);<NEW_LINE>}<NEW_LINE>}
StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES };
1,428,394
public void checkEmptyListText(boolean isSearch) {<NEW_LINE>if (isSearch) {<NEW_LINE>getNoteListFragment().setEmptyListButton(isSearchQueryNotNull() ? getString(R.string.empty_notes_search_button, mSearchView.getQuery().toString()) : getString(R.string.empty_notes_search_button_default));<NEW_LINE>getNoteListFragment().setEmptyListImage(-1);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString(R.string.empty_notes_search));<NEW_LINE>} else if (mSelectedTag != null) {<NEW_LINE>getNoteListFragment().setEmptyListButton("");<NEW_LINE>if (mSelectedTag.id == ALL_NOTES_ID) {<NEW_LINE>getNoteListFragment().setEmptyListImage(R.drawable.ic_notes_24dp);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString<MASK><NEW_LINE>} else if (mSelectedTag.id == TRASH_ID) {<NEW_LINE>getNoteListFragment().setEmptyListImage(R.drawable.ic_trash_24dp);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString(R.string.empty_notes_trash));<NEW_LINE>AnalyticsTracker.track(LIST_TRASH_VIEWED, CATEGORY_NOTE, "trash_filter_selected");<NEW_LINE>} else if (mSelectedTag.id == UNTAGGED_NOTES_ID) {<NEW_LINE>getNoteListFragment().setEmptyListImage(R.drawable.ic_untagged_24dp);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString(R.string.empty_notes_untagged));<NEW_LINE>} else {<NEW_LINE>getNoteListFragment().setEmptyListImage(R.drawable.ic_tag_24dp);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString(R.string.empty_notes_tag, mSelectedTag.name));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getNoteListFragment().setEmptyListButton("");<NEW_LINE>getNoteListFragment().setEmptyListImage(R.drawable.ic_notes_24dp);<NEW_LINE>getNoteListFragment().setEmptyListMessage(getString(R.string.empty_notes_all));<NEW_LINE>}<NEW_LINE>}
(R.string.empty_notes_all));
1,368,700
/*<NEW_LINE>* This is kind of a hack, but it's safe to use this if the regular portability<NEW_LINE>* is stateless.<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public static <T> PersistentPortability<T> persistent(final Portability<T> normal) {<NEW_LINE>if (normal instanceof PersistentPortability<?>) {<NEW_LINE>return (PersistentPortability<T>) normal;<NEW_LINE>} else {<NEW_LINE>LinkedHashSet<Class<?>> proxyInterfaces = new LinkedHashSet<>();<NEW_LINE>for (Class<?> klazz = normal.getClass(); klazz != null; klazz = klazz.getSuperclass()) {<NEW_LINE>proxyInterfaces.addAll(asList<MASK><NEW_LINE>}<NEW_LINE>proxyInterfaces.add(PersistentPortability.class);<NEW_LINE>return (PersistentPortability<T>) Proxy.newProxyInstance(normal.getClass().getClassLoader(), proxyInterfaces.toArray(new Class<?>[0]), (o, method, os) -> {<NEW_LINE>if (method.getDeclaringClass().equals(Persistent.class)) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return method.invoke(normal, os);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
(klazz.getInterfaces()));
1,371,966
private Mono<Response<Flux<ByteBuffer>>> startWithResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Context context) {<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 (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (streamingEndpointName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, streamingEndpointName, apiVersion, accept, context);<NEW_LINE>}
this.client.mergeContext(context);
404,033
public void start(final WorkerSourceConfig sourceConfig, final Path jobRoot) throws Exception {<NEW_LINE>Preconditions.checkState(sourceProcess == null);<NEW_LINE>sourceProcess = integrationLauncher.read(jobRoot, WorkerConstants.SOURCE_CONFIG_JSON_FILENAME, Jsons.serialize(sourceConfig.getSourceConnectionConfiguration()), WorkerConstants.SOURCE_CATALOG_JSON_FILENAME, Jsons.serialize(sourceConfig.getCatalog()), sourceConfig.getState() == null ? null : WorkerConstants.INPUT_STATE_JSON_FILENAME, sourceConfig.getState() == null ? null : Jsons.serialize(sourceConfig.getState<MASK><NEW_LINE>// stdout logs are logged elsewhere since stdout also contains data<NEW_LINE>LineGobbler.gobble(sourceProcess.getErrorStream(), LOGGER::error, "airbyte-source", CONTAINER_LOG_MDC_BUILDER);<NEW_LINE>messageIterator = streamFactory.create(IOs.newBufferedReader(sourceProcess.getInputStream())).peek(message -> heartbeatMonitor.beat()).filter(message -> message.getType() == Type.RECORD || message.getType() == Type.STATE).iterator();<NEW_LINE>}
().getState()));
297,372
private int completeDeletions() throws IOException {<NEW_LINE>int numPending = deletions.size();<NEW_LINE>int numFailures = 0;<NEW_LINE>if (numPending < 1) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>List<PendingFileDeletionExec> pendingExecs = deletions.parallelStream().map(f -> new PendingFileDeletionExec(f.getAbsolutePath())).collect(Collectors.toList());<NEW_LINE>Map<Boolean, List<PendingFileDeletionExec>> bySuccess;<NEW_LINE>try (Progress progress = new Progress(LOGGER, "pending deletions", numPending)) {<NEW_LINE>bySuccess = pendingExecs.parallelStream().collect(Collectors.groupingByConcurrent((x) -> {<NEW_LINE>progress.increment();<NEW_LINE>doDelete(x);<NEW_LINE>return true;<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>deletions.clear();<NEW_LINE>List<PendingFileDeletionExec> successes = bySuccess.<MASK><NEW_LINE>if (successes != null) {<NEW_LINE>tryDeleteParents(successes);<NEW_LINE>}<NEW_LINE>List<PendingFileDeletionExec> failures = bySuccess.getOrDefault(Boolean.FALSE, null);<NEW_LINE>if (failures != null && failures.size() > 0) {<NEW_LINE>numFailures = failures.size();<NEW_LINE>double pctFailed = 100.0 * numFailures / numPending;<NEW_LINE>String exmsg = String.format("%d failures (%.1f%%) while deleting pending files", numFailures, pctFailed);<NEW_LINE>throw new IOException(exmsg, failures.get(0).exception);<NEW_LINE>}<NEW_LINE>return numPending - numFailures;<NEW_LINE>}
getOrDefault(Boolean.TRUE, null);
1,039,765
public S3Location unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3Location s3Location = new S3Location();<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("Bucket", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setBucket(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RoleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setRoleArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ObjectVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3Location.setObjectVersion(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 s3Location;<NEW_LINE>}
class).unmarshall(context));