idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
774,601
public void validateExistingType(EventType existingType, AvroSchemaEventType proposedType) {<NEW_LINE>if (!(existingType instanceof AvroSchemaEventType)) {<NEW_LINE>throw new EventAdapterException("Type by name '" + proposedType.getName() + "' is not a compatible type " + "(target type underlying is '" + existingType.getUnderlyingType().getName() + "', " + "source type underlying is '" + proposedType.getUnderlyingType().getName() + "')");<NEW_LINE>}<NEW_LINE>Schema proposed = (Schema) proposedType.getSchema();<NEW_LINE>Schema existing = (Schema) ((AvroSchemaEventType) existingType).getSchema();<NEW_LINE>if (!proposed.equals(existing)) {<NEW_LINE>throw new EventAdapterException("Event type named '" + existingType.getName() + "' has already been declared with differing column name or type information\n" + "schemaExisting: " + AvroSchemaUtil.toSchemaStringSafe(existing) + "\n" + "schemaProposed: " <MASK><NEW_LINE>}<NEW_LINE>}
+ AvroSchemaUtil.toSchemaStringSafe(proposed));
1,054,361
public void onUpdate(double tpf) {<NEW_LINE>// we need to apply table friction manually since the ball is effectively moving in 3D<NEW_LINE>// but the physics engine only knows about 2 dimensions<NEW_LINE>double frictionPerFrame = TABLE_FRICTION * tpf;<NEW_LINE>var vx = p.getVelocityX();<NEW_LINE>var vy = p.getVelocityY();<NEW_LINE>if (FXGLMath.abs(vx) > LINEAR_VELOCITY_THRESHOLD) {<NEW_LINE>vx -= vx * frictionPerFrame;<NEW_LINE>p.setVelocityX(vx);<NEW_LINE>} else {<NEW_LINE>p.setVelocityX(0);<NEW_LINE>}<NEW_LINE>if (FXGLMath.abs(vy) > LINEAR_VELOCITY_THRESHOLD) {<NEW_LINE>vy -= vy * frictionPerFrame;<NEW_LINE>p.setVelocityY(vy);<NEW_LINE>} else {<NEW_LINE>p.setVelocityY(0);<NEW_LINE>}<NEW_LINE>var a = p.getBody().getAngularVelocity();<NEW_LINE>if (FXGLMath.abs(a) > ANGULAR_VELOCITY_THRESHOLD) {<NEW_LINE>p.getBody().setAngularVelocity(a * ANGULAR_VELOCITY_DECAY);<NEW_LINE>} else {<NEW_LINE>p.<MASK><NEW_LINE>}<NEW_LINE>}
getBody().setAngularVelocity(0);
262,210
public void run() {<NEW_LINE>final long vmSize = readVmSize();<NEW_LINE>if (vmSize < 0) {<NEW_LINE>MatrixLog.e(TAG, "Fail to read vss size, skip checking this time.");<NEW_LINE>mSampleHandler.postDelayed(this, mVmSizeSampleInterval);<NEW_LINE>} else {<NEW_LINE>// (vmsize / 4G > ratio) => (vmsize > ratio * 4G)<NEW_LINE>if (vmSize > 4L * 1024 * 1024 * 1024 * mCriticalVmSizeRatio) {<NEW_LINE>MatrixLog.i(TAG, "VmSize usage reaches above critical level, trigger native install." + " vmsize: %s, critical_ratio: %s", vmSize, mCriticalVmSizeRatio);<NEW_LINE>final boolean nativeInstallRes = nativeInstall();<NEW_LINE>if (nativeInstallRes) {<NEW_LINE>MatrixLog.i(TAG, "nativeInstall triggered successfully.");<NEW_LINE>} else {<NEW_LINE>MatrixLog.i(TAG, "Fail to trigger nativeInstall.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MatrixLog.i(TAG, "VmSize usage is under critical level, check next time." + " vmsize: %s, critical_ratio: %s", vmSize, mCriticalVmSizeRatio);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mSampleHandler.postDelayed(this, mVmSizeSampleInterval);
26,579
final DescribeEnvironmentsResult executeDescribeEnvironments(DescribeEnvironmentsRequest describeEnvironmentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEnvironmentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEnvironmentsRequest> request = null;<NEW_LINE>Response<DescribeEnvironmentsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeEnvironmentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEnvironmentsRequest));<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, "Cloud9");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEnvironments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEnvironmentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEnvironmentsResultJsonUnmarshaller());<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);
150,142
public static void runSample() {<NEW_LINE><MASK><NEW_LINE>System.out.println(" Starting Cosmos Sample");<NEW_LINE>System.out.println("================================================================");<NEW_LINE>if (AZURE_COSMOS_ENDPOINT == null || AZURE_COSMOS_ENDPOINT.isEmpty()) {<NEW_LINE>System.err.println("azure_cosmos_endpoint environment variable is not set - exiting");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (AZURE_COSMOS_KEY == null || AZURE_COSMOS_KEY.isEmpty()) {<NEW_LINE>System.err.println("azure_cosmos_key environment variable is not set - exiting");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CosmosSample sample = new CosmosSample();<NEW_LINE>try {<NEW_LINE>sample.startSample();<NEW_LINE>System.out.println("Demo complete, please hold while resources are released");<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Error running Cosmos sample " + e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>System.out.println("Closing the client");<NEW_LINE>sample.shutdown();<NEW_LINE>}<NEW_LINE>System.out.println("\n================================================================");<NEW_LINE>System.out.println(" Cosmos Sample Complete");<NEW_LINE>System.out.println("================================================================");<NEW_LINE>}
System.out.println("\n================================================================");
1,202,493
private void addResourceRequest(Priority priority, String resourceName, Resource capability) {<NEW_LINE>Map<String, Map<Resource, ResourceRequest>> remoteRequests = this.remoteRequestsTable.get(priority);<NEW_LINE>if (remoteRequests == null) {<NEW_LINE>remoteRequests = new HashMap<String, Map<Resource, ResourceRequest>>();<NEW_LINE>this.remoteRequestsTable.put(priority, remoteRequests);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Added priority=" + priority);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<Resource, ResourceRequest> reqMap = remoteRequests.get(resourceName);<NEW_LINE>if (reqMap == null) {<NEW_LINE>reqMap = new HashMap<Resource, ResourceRequest>();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ResourceRequest remoteRequest = reqMap.get(capability);<NEW_LINE>if (remoteRequest == null) {<NEW_LINE>remoteRequest = recordFactory.newRecordInstance(ResourceRequest.class);<NEW_LINE>remoteRequest.setPriority(priority);<NEW_LINE>remoteRequest.setResourceName(resourceName);<NEW_LINE>remoteRequest.setCapability(capability);<NEW_LINE>remoteRequest.setNumContainers(0);<NEW_LINE>reqMap.put(capability, remoteRequest);<NEW_LINE>}<NEW_LINE>remoteRequest.setNumContainers(remoteRequest.getNumContainers() + 1);<NEW_LINE>// Note this down for next interaction with ResourceManager<NEW_LINE>addResourceRequestToAsk(remoteRequest);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("addResourceRequest:" + " applicationId=" + context.getApplicationId() + " priority=" + priority.getPriority() + " resourceName=" + resourceName + " numContainers=" + remoteRequest.getNumContainers() + " #asks=" + ask.size());<NEW_LINE>}<NEW_LINE>}
remoteRequests.put(resourceName, reqMap);
810,910
private void initData(LinkedBlockingDeque<TaskProfile> taskHistory) {<NEW_LINE>StatisticsAdapter.TableCell[] titles = new StatisticsAdapter.TableCell[5];<NEW_LINE>int width = getActivity().getWindowManager().getDefaultDisplay().getWidth() / titles.length;<NEW_LINE>for (int i = 0; i < titles.length; i++) {<NEW_LINE>titles[i] = new StatisticsAdapter.TableCell(tableTitles[i], width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>}<NEW_LINE>table.add(<MASK><NEW_LINE>for (TaskProfile profile : taskHistory) {<NEW_LINE>StatisticsAdapter.TableCell[] cells = new StatisticsAdapter.TableCell[5];<NEW_LINE>cells[0] = new StatisticsAdapter.TableCell(String.valueOf(profile.cgi.substring(profile.cgi.lastIndexOf("/") + 1)), width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>cells[1] = new StatisticsAdapter.TableCell((profile.errCode == 0 && profile.errType == 0) ? "true " : "false", width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>cells[2] = new StatisticsAdapter.TableCell((profile.endTaskTime - profile.startTaskTime) + "ms", width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>cells[3] = new StatisticsAdapter.TableCell(String.valueOf(profile.historyNetLinkers.length), width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>cells[4] = new StatisticsAdapter.TableCell((profile.channelSelect == 1 ? "shortlink " : "longlink "), width, LISTHEIGHT, StatisticsAdapter.TableCell.STRING);<NEW_LINE>table.add(new StatisticsAdapter.TableRow(cells));<NEW_LINE>}<NEW_LINE>}
new StatisticsAdapter.TableRow(titles));
1,200,025
public static DescribeGeoipInstanceDataInfosResponse unmarshall(DescribeGeoipInstanceDataInfosResponse describeGeoipInstanceDataInfosResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGeoipInstanceDataInfosResponse.setRequestId<MASK><NEW_LINE>List<DataInfo> dataInfos = new ArrayList<DataInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGeoipInstanceDataInfosResponse.DataInfos.Length"); i++) {<NEW_LINE>DataInfo dataInfo = new DataInfo();<NEW_LINE>dataInfo.setType(_ctx.stringValue("DescribeGeoipInstanceDataInfosResponse.DataInfos[" + i + "].Type"));<NEW_LINE>dataInfo.setVersion(_ctx.stringValue("DescribeGeoipInstanceDataInfosResponse.DataInfos[" + i + "].Version"));<NEW_LINE>dataInfo.setUpdateTime(_ctx.stringValue("DescribeGeoipInstanceDataInfosResponse.DataInfos[" + i + "].UpdateTime"));<NEW_LINE>dataInfo.setUpdateTimestamp(_ctx.longValue("DescribeGeoipInstanceDataInfosResponse.DataInfos[" + i + "].UpdateTimestamp"));<NEW_LINE>dataInfo.setDownloadCount(_ctx.longValue("DescribeGeoipInstanceDataInfosResponse.DataInfos[" + i + "].DownloadCount"));<NEW_LINE>dataInfos.add(dataInfo);<NEW_LINE>}<NEW_LINE>describeGeoipInstanceDataInfosResponse.setDataInfos(dataInfos);<NEW_LINE>return describeGeoipInstanceDataInfosResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeGeoipInstanceDataInfosResponse.RequestId"));
935,501
protected boolean processSysEvent(DispatcherState curState, DbusEvent event) {<NEW_LINE>boolean success = true;<NEW_LINE>boolean debugEnabled <MASK><NEW_LINE>Checkpoint ckptInEvent = null;<NEW_LINE>int eventSrcId = event.getSourceId();<NEW_LINE>if (event.isCheckpointMessage()) {<NEW_LINE>ByteBuffer eventValue = event.value();<NEW_LINE>byte[] eventBytes = new byte[eventValue.limit()];<NEW_LINE>eventValue.get(eventBytes);<NEW_LINE>if (eventValue.limit() > 0) {<NEW_LINE>try {<NEW_LINE>String cpString = new String(eventBytes, "UTF-8");<NEW_LINE>ckptInEvent = new Checkpoint(cpString);<NEW_LINE>_lastCkpt = ckptInEvent;<NEW_LINE>getLog().info("Bootstrap checkpoint received from the bootstrap server: " + ckptInEvent);<NEW_LINE>_bootstrapMode = _lastCkpt.getConsumptionMode();<NEW_LINE>curState.setEventsSeen(true);<NEW_LINE>if (_bootstrapMode == DbusClientMode.ONLINE_CONSUMPTION) {<NEW_LINE>getLog().info("Bootstrap is complete. Switching to relay consumption");<NEW_LINE>Checkpoint restartCkpt = _lastCkpt.clone();<NEW_LINE>_relayPuller.enqueueMessage(BootstrapResultMessage.createBootstrapCompleteMessage(restartCkpt));<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>getLog().error("Error while processing internal databus event", e);<NEW_LINE>success = false;<NEW_LINE>} catch (IOException e) {<NEW_LINE>getLog().error("Error while processing internal databus event", e);<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getLog().error("Missing checkpoint in control message");<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (debugEnabled)<NEW_LINE>getLog().debug(getName() + ": control srcid:" + eventSrcId);<NEW_LINE>success = super.processSysEvent(curState, event);<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
= getLog().isDebugEnabled();
425,994
public void tableChanged(TableModelEvent e) {<NEW_LINE>if (e.getColumn() != 0)<NEW_LINE>return;<NEW_LINE>log.config("Row=" + e.getFirstRow() + "-" + e.getLastRow() + ", Col=" + e.getColumn() + ", Type=" + e.getType());<NEW_LINE>boolean isUpdate = (e.getType() == TableModelEvent.UPDATE);<NEW_LINE>int row = e.getFirstRow();<NEW_LINE>// Not a table update<NEW_LINE>if (!isUpdate) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>boolean isMatched = false;<NEW_LINE>if (e.getSource().equals(currentPaymentTable.getModel())) {<NEW_LINE>int matchedRow = currentPaymentTable.getSelectedRow();<NEW_LINE>if (matchedRow != row) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (matchedRow >= 0) {<NEW_LINE>IDColumn paymentIdColumn = (IDColumn) currentPaymentTable.getValueAt(matchedRow, 0);<NEW_LINE>isMatched = paymentApplyForMatch(paymentIdColumn.getRecord_ID());<NEW_LINE>}<NEW_LINE>} else if (e.getSource().equals(importedPaymentTable.getModel())) {<NEW_LINE>int matchedRow = importedPaymentTable.getSelectedRow();<NEW_LINE>if (matchedRow != row) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (matchedRow >= 0) {<NEW_LINE>IDColumn importedPaymentIdColumn = (IDColumn) importedPaymentTable.getValueAt(matchedRow, 0);<NEW_LINE>isMatched = importedPaymentApplyForMatch(importedPaymentIdColumn.getRecord_ID());<NEW_LINE>}<NEW_LINE>} else if (e.getSource().equals(matchedPaymentTable.getModel())) {<NEW_LINE><MASK><NEW_LINE>if (matchedRow != row) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (matchedRow >= 0) {<NEW_LINE>IDColumn matchedPaymentIdColumn = (IDColumn) matchedPaymentTable.getValueAt(matchedRow, 0);<NEW_LINE>selectFromMatch(matchedPaymentIdColumn.getRecord_ID());<NEW_LINE>changeMessageButton();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Validate screen<NEW_LINE>if (isMatched) {<NEW_LINE>loadMatchedPaymentsFromMatch();<NEW_LINE>}<NEW_LINE>}
int matchedRow = matchedPaymentTable.getSelectedRow();
1,000,114
public void addDebugTask(String qid, List<String> docIds, JsonNode jsonQuery) {<NEW_LINE>if (debugTasks.containsKey(qid))<NEW_LINE>throw new IllegalArgumentException("existed qid");<NEW_LINE>debugTasks.put(qid, pool.submit(() -> {<NEW_LINE>List<FeatureExtractor> localExtractors = new ArrayList<>();<NEW_LINE>for (FeatureExtractor e : extractors) {<NEW_LINE>localExtractors.add(e.clone());<NEW_LINE>}<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>DocumentContext documentContext = new DocumentContext(reader, searcher, fieldsToLoad);<NEW_LINE>QueryContext queryContext = new QueryContext(qid, qfieldsToLoad, jsonQuery);<NEW_LINE>List<debugOutput> result = new ArrayList<>();<NEW_LINE>for (String docId : docIds) {<NEW_LINE>Query q = new TermQuery(new Term(IndexArgs.ID, docId));<NEW_LINE>TopDocs topDocs = searcher.search(q, 1);<NEW_LINE>if (topDocs.totalHits.value == 0) {<NEW_LINE>throw new IOException(String.format("Document Id %s expected but not found in index", docId));<NEW_LINE>}<NEW_LINE>ScoreDoc hit = topDocs.scoreDocs[0];<NEW_LINE>documentContext.updateDoc(docId, hit.doc);<NEW_LINE>List<Float> <MASK><NEW_LINE>List<Long> time = new ArrayList<>();<NEW_LINE>for (int i = 0; i < localExtractors.size(); i++) {<NEW_LINE>time.add(0L);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < localExtractors.size(); i++) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>float extractedFeature = localExtractors.get(i).extract(documentContext, queryContext);<NEW_LINE>assert extractedFeature == extractedFeature;<NEW_LINE>features.add(extractedFeature);<NEW_LINE>long end = System.nanoTime();<NEW_LINE>time.set(i, time.get(i) + end - start);<NEW_LINE>}<NEW_LINE>result.add(new debugOutput(docId, features, time));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}));<NEW_LINE>}
features = new ArrayList<>();
1,498,193
private void writeColorParams(Canvas canvas) {<NEW_LINE>if (mHSVenabled) {<NEW_LINE>canvas.drawText("H: " + (int) (mHSV[0] / 360.0f * 255), TEXT_HSV_POS[0], TEXT_HSV_POS[1] + mTextSizePx, mText);<NEW_LINE>canvas.drawText("S: " + (int) (mHSV[1] * 255), TEXT_HSV_POS[0], TEXT_HSV_POS[1<MASK><NEW_LINE>canvas.drawText("V: " + (int) (mHSV[2] * 255), TEXT_HSV_POS[0], TEXT_HSV_POS[1] + mTextSizePx * 3, mText);<NEW_LINE>}<NEW_LINE>if (mRGBenabled) {<NEW_LINE>canvas.drawText("R: " + mRGB[0], TEXT_RGB_POS[0], TEXT_RGB_POS[1] + mTextSizePx, mText);<NEW_LINE>canvas.drawText("G: " + mRGB[1], TEXT_RGB_POS[0], TEXT_RGB_POS[1] + mTextSizePx * 2, mText);<NEW_LINE>canvas.drawText("B: " + mRGB[2], TEXT_RGB_POS[0], TEXT_RGB_POS[1] + mTextSizePx * 3, mText);<NEW_LINE>}<NEW_LINE>if (mYUVenabled) {<NEW_LINE>canvas.drawText("Y: " + (int) (mYUV[0] * 255), TEXT_YUV_POS[0], TEXT_YUV_POS[1] + mTextSizePx, mText);<NEW_LINE>canvas.drawText("U: " + (int) ((mYUV[1] + .5f) * 255), TEXT_YUV_POS[0], TEXT_YUV_POS[1] + mTextSizePx * 2, mText);<NEW_LINE>canvas.drawText("V: " + (int) ((mYUV[2] + .5f) * 255), TEXT_YUV_POS[0], TEXT_YUV_POS[1] + mTextSizePx * 3, mText);<NEW_LINE>}<NEW_LINE>if (mHexenabled)<NEW_LINE>canvas.drawText("#" + mHexStr, TEXT_HEX_POS[0], TEXT_HEX_POS[1] + mTextSizePx, mText);<NEW_LINE>}
] + mTextSizePx * 2, mText);
921,531
public static void takeSignature(IMethodResult result, String imgFormat, Bitmap bitmap, String filePath, int penColor, int bgColor) {<NEW_LINE>Logger.D(TAG, "takeSignature+");<NEW_LINE>try {<NEW_LINE>String outputFilePath;<NEW_LINE>if (imgFormat.equals("jpg")) {<NEW_LINE>outputFilePath = saveJpg(bitmap, filePath);<NEW_LINE>} else if (imgFormat.equals("png")) {<NEW_LINE>outputFilePath = savePng(bitmap, filePath);<NEW_LINE>} else if (imgFormat.equals("bmp")) {<NEW_LINE>outputFilePath = saveBmp(bitmap, filePath, penColor, bgColor);<NEW_LINE>} else if (imgFormat.equals("datauri")) {<NEW_LINE>outputFilePath = generateDataUri(bitmap);<NEW_LINE>} else {<NEW_LINE>Logger.E(TAG, "Unknown image format: " + imgFormat);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Do Callback<NEW_LINE>Map<String, Object> results = new HashMap<String, Object>(3);<NEW_LINE>if (outputFilePath.contains("sdcard") && (Capabilities.READ_SDCARD_ENABLED == true)) {<NEW_LINE>results.put("status", "error");<NEW_LINE>results.put("imageUri", "only read sdcard permission is there in build.yml");<NEW_LINE>if (imgFormat.equals("datauri"))<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>else<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>} else {<NEW_LINE>results.put("status", "ok");<NEW_LINE>results.put("imageUri", outputFilePath);<NEW_LINE>if (imgFormat.equals("datauri"))<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>else<NEW_LINE>results.put("signature_uri", outputFilePath);<NEW_LINE>}<NEW_LINE>result.set(results);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>result.setError("FileNotFoundException: " + e);<NEW_LINE>Logger.E(TAG, "FNFE:" + e.getMessage());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>result.setError("Illegal characters in filePath: " + filePath);<NEW_LINE>Logger.E(TAG, "Illegal characters in filePath: " + filePath);<NEW_LINE>} catch (IOException ex) {<NEW_LINE><MASK><NEW_LINE>Logger.E(TAG, "IOEX " + ex.getMessage());<NEW_LINE>ex.printStackTrace();<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.setError("Could not capture due to exception");<NEW_LINE>Logger.E(TAG, e.getMessage());<NEW_LINE>}<NEW_LINE>Logger.D(TAG, "takeSignature-");<NEW_LINE>}
result.setError("IOException: " + ex);
1,471,922
public double g(double[] w, double[] g) {<NEW_LINE>double f = IntStream.range(0, partitions).parallel().mapToDouble(r -> {<NEW_LINE>double<MASK><NEW_LINE>Arrays.fill(gradient, 0.0);<NEW_LINE>int begin = r * partitionSize;<NEW_LINE>int end = (r + 1) * partitionSize;<NEW_LINE>if (end > x.length)<NEW_LINE>end = x.length;<NEW_LINE>return IntStream.range(begin, end).sequential().mapToDouble(i -> {<NEW_LINE>double[] xi = x[i];<NEW_LINE>double wx = dot(xi, w);<NEW_LINE>double err = y[i] - MathEx.sigmoid(wx);<NEW_LINE>for (int j = 0; j < p; j++) {<NEW_LINE>gradient[j] -= err * xi[j];<NEW_LINE>}<NEW_LINE>gradient[p] -= err;<NEW_LINE>return MathEx.log1pe(wx) - y[i] * wx;<NEW_LINE>}).sum();<NEW_LINE>}).sum();<NEW_LINE>Arrays.fill(g, 0.0);<NEW_LINE>for (double[] gradient : gradients) {<NEW_LINE>for (int i = 0; i < g.length; i++) {<NEW_LINE>g[i] += gradient[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lambda > 0.0) {<NEW_LINE>double wnorm = 0.0;<NEW_LINE>for (int i = 0; i < p; i++) {<NEW_LINE>wnorm += w[i] * w[i];<NEW_LINE>g[i] += lambda * w[i];<NEW_LINE>}<NEW_LINE>f += 0.5 * lambda * wnorm;<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>}
[] gradient = gradients[r];
1,599,968
public void testVariance(double[] x) {<NEW_LINE>int[] batchSizes = { 10, 20, 35, 50, 75, 150, 300, 500, 750, 1000, 5000, 10000 };<NEW_LINE>double[] varResult;<NEW_LINE>PrintWriter file = null;<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>file = new PrintWriter(new FileOutputStream("var.out"), true);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.info("Caught IOException outputing List to file: " + e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>for (int bSize : batchSizes) {<NEW_LINE>varResult = getVariance(x, bSize);<NEW_LINE>file.println(bSize + "," + nf.format(varResult[0]) + "," + nf.format(varResult[1]) + "," + nf.format(varResult[2]) + "," + nf.format(varResult[3]));<NEW_LINE>log.info("Batch size of: " + bSize + " " + varResult[0] + "," + nf.format(varResult[1]) + "," + nf.format(varResult[2]) + "," + nf.format(varResult[3]));<NEW_LINE>}<NEW_LINE>file.close();<NEW_LINE>}
NumberFormat nf = new DecimalFormat("0.000E0");
1,732,220
public void onNext(Notification<T> args) {<NEW_LINE>synchronized (gate) {<NEW_LINE>if (!DisposableHelper.isDisposed(get())) {<NEW_LINE>if (args.isOnError()) {<NEW_LINE>try {<NEW_LINE>onError.<MASK><NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Exceptions.throwIfFatal(ex);<NEW_LINE>RxJavaPlugins.onError(new CompositeException(args.getError(), ex));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>queue.add(args);<NEW_LINE>// remark: activePlans might change while iterating<NEW_LINE>for (ActivePlan0 a : new ArrayList<>(activePlans)) {<NEW_LINE>try {<NEW_LINE>a.match();<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Exceptions.throwIfFatal(ex);<NEW_LINE>try {<NEW_LINE>onError.accept(ex);<NEW_LINE>} catch (Throwable ex2) {<NEW_LINE>Exceptions.throwIfFatal(ex2);<NEW_LINE>RxJavaPlugins.onError(new CompositeException(ex, ex2));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
accept(args.getError());
1,821,823
public List<Node> querySelectorAll(Node node, String selector) {<NEW_LINE>List<Node<MASK><NEW_LINE>JSONObject params = new JSONObject();<NEW_LINE>// NOI18N<NEW_LINE>params.put("nodeId", node.getNodeId());<NEW_LINE>// NOI18N<NEW_LINE>params.put("selector", selector);<NEW_LINE>// NOI18N<NEW_LINE>Response response = transport.sendBlockingCommand(new Command("DOM.querySelectorAll", params));<NEW_LINE>if (response != null) {<NEW_LINE>JSONObject result = response.getResult();<NEW_LINE>if (result != null) {<NEW_LINE>list = new ArrayList<Node>();<NEW_LINE>// NOI18N<NEW_LINE>JSONArray array = (JSONArray) result.get("nodeIds");<NEW_LINE>synchronized (this) {<NEW_LINE>for (Object id : array) {<NEW_LINE>int nodeId = ((Number) id).intValue();<NEW_LINE>Node n = nodes.get(nodeId);<NEW_LINE>if (n != null) {<NEW_LINE>list.add(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
> list = Collections.emptyList();
178,691
private void resizeWizard(Window parentWindow, Dimension prevSize) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread() : "getComponent() must be called in EQ only.";<NEW_LINE>Dimension curSize = data.getIterator(this).current().getComponent().getPreferredSize();<NEW_LINE>// only enlarge if needed, don't shrink<NEW_LINE>if ((curSize.width > prevSize.width) || (curSize.height > prevSize.height)) {<NEW_LINE>Rectangle origBounds = parentWindow.getBounds();<NEW_LINE>int newWidth = origBounds.width;<NEW_LINE>int newHeight = origBounds.height;<NEW_LINE>Rectangle screenBounds = Utilities.getUsableScreenBounds();<NEW_LINE>Rectangle newBounds;<NEW_LINE>// don't allow to exceed screen size, center if needed<NEW_LINE>if (((origBounds.x + newWidth) > screenBounds.width) || ((origBounds.y + newHeight) > screenBounds.height)) {<NEW_LINE>newWidth = Math.min(screenBounds.width, newWidth);<NEW_LINE>newHeight = Math.<MASK><NEW_LINE>newBounds = Utilities.findCenterBounds(new Dimension(newWidth, newHeight));<NEW_LINE>} else {<NEW_LINE>newBounds = new Rectangle(origBounds.x, origBounds.y, newWidth, newHeight);<NEW_LINE>}<NEW_LINE>parentWindow.setBounds(newBounds);<NEW_LINE>parentWindow.invalidate();<NEW_LINE>parentWindow.validate();<NEW_LINE>parentWindow.repaint();<NEW_LINE>}<NEW_LINE>}
min(screenBounds.height, newHeight);
238,704
public void generateStart(OptimizedTagContext context) {<NEW_LINE>// PK65013 - start<NEW_LINE>String pageContextVar = Constants.JSP_PAGE_CONTEXT_ORIG;<NEW_LINE>JspOptions jspOptions = context.getJspOptions();<NEW_LINE>if (jspOptions != null) {<NEW_LINE>if (context.isTagFile() && jspOptions.isModifyPageContextVariable()) {<NEW_LINE>pageContextVar = Constants.JSP_PAGE_CONTEXT_NEW;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// PK65013 - end<NEW_LINE>context.writeSource("createIndexMgr(" + pageContextVar + ");");<NEW_LINE>context.writeSource("createRepeatStack(" + pageContextVar + ");");<NEW_LINE>context.writeSource("createRepeatLookup(" + pageContextVar + ");");<NEW_LINE>if (indexProvided == false) {<NEW_LINE>index = context.createTemporaryVariable();<NEW_LINE>} else {<NEW_LINE>index = index.substring(1, index.length() - 1);<NEW_LINE>}<NEW_LINE>if (start == null) {<NEW_LINE>start = "0";<NEW_LINE>} else if (start.charAt(0) == '\"') {<NEW_LINE>start = start.substring(1, start.length() - 1);<NEW_LINE>}<NEW_LINE>if (end == null) {<NEW_LINE>end = Integer.toString(Integer.MAX_VALUE);<NEW_LINE>} else if (end.charAt(0) == '\"') {<NEW_LINE>end = end.substring(1, end.length() - 1);<NEW_LINE>}<NEW_LINE>// PK65013 change pageContext variable to customizable one.<NEW_LINE>context.writeSource("((com.ibm.ws.jsp.tsx.tag.DefinedIndexManager) " + pageContextVar + ".getAttribute(\"TSXDefinedIndexManager\", PageContext.PAGE_SCOPE)).addIndex(\"" + index + "\");");<NEW_LINE>context.writeSource("((java.util.Stack)" + pageContextVar + ".getAttribute(\"TSXRepeatStack\", PageContext.PAGE_SCOPE)).push(\"" + index + "\");");<NEW_LINE>context.writeSource("for (int " + index + " = " + start + "; " + index + " <= " + <MASK><NEW_LINE>context.writeSource(" ((java.util.Hashtable)" + pageContextVar + ".getAttribute(\"TSXRepeatLookup\", PageContext.PAGE_SCOPE)).put(\"" + index + "\", new Integer(" + index + "));");<NEW_LINE>context.writeSource(" out = " + pageContextVar + ".pushBody();");<NEW_LINE>context.writeSource(" try {");<NEW_LINE>}
end + "; " + index + "++) {");
188,703
public static SecurityScheme createInstance(AnnotationModel annotation, ApiContext context) {<NEW_LINE>SecuritySchemeImpl from = new SecuritySchemeImpl();<NEW_LINE>EnumModel type = annotation.getValue("type", EnumModel.class);<NEW_LINE>if (type != null) {<NEW_LINE>from.setType(SecurityScheme.Type.valueOf(type.getValue()));<NEW_LINE>}<NEW_LINE>from.setDescription(annotation.getValue("description", String.class));<NEW_LINE>from.setName(annotation.getValue("apiKeyName", String.class));<NEW_LINE>String ref = annotation.getValue("ref", String.class);<NEW_LINE>if (ref != null && !ref.isEmpty()) {<NEW_LINE>from.setRef(ref);<NEW_LINE>}<NEW_LINE>EnumModel in = annotation.getValue("in", EnumModel.class);<NEW_LINE>if (in != null) {<NEW_LINE>from.setIn(SecurityScheme.In.valueOf(in.getValue()));<NEW_LINE>}<NEW_LINE>from.setScheme(annotation.getValue<MASK><NEW_LINE>from.setBearerFormat(annotation.getValue("bearerFormat", String.class));<NEW_LINE>AnnotationModel flowsAnnotation = annotation.getValue("flows", AnnotationModel.class);<NEW_LINE>if (flowsAnnotation != null) {<NEW_LINE>from.setFlows(OAuthFlowsImpl.createInstance(flowsAnnotation));<NEW_LINE>}<NEW_LINE>from.setOpenIdConnectUrl(annotation.getValue("openIdConnectUrl", String.class));<NEW_LINE>return from;<NEW_LINE>}
("scheme", String.class));
291,727
private static int processRequest(List<String> args) throws Exception {<NEW_LINE>OptionsParser optionsParser = OptionsParser.builder().optionsClasses(Options.class).allowResidue(true).argsPreProcessor(new ShellQuotedParamsFilePreProcessor(FileSystems.getDefault())).build();<NEW_LINE>Options options;<NEW_LINE>try {<NEW_LINE>optionsParser.parse(args);<NEW_LINE>options = <MASK><NEW_LINE>options.tool.call(optionsParser.getResidue().toArray(new String[0]));<NEW_LINE>} catch (UserException e) {<NEW_LINE>// UserException is for exceptions that shouldn't have stack traces recorded, including<NEW_LINE>// AndroidDataMerger.MergeConflictException.<NEW_LINE>logger.log(Level.SEVERE, e.getMessage());<NEW_LINE>return 1;<NEW_LINE>} catch (OptionsParsingException | IOException | Aapt2Exception | InvalidJavaIdentifier e) {<NEW_LINE>logSuppressed(e);<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO(jingwen): consider just removing this block.<NEW_LINE>logger.log(Level.SEVERE, "Error during processing", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
optionsParser.getOptions(Options.class);
1,454,864
public VoidResponse unmapValidValues(String serverName, String userId, String validValue1GUID, String validValue2GUID, NullRequestBody requestBody) {<NEW_LINE>final String methodName = "unmapValidValues";<NEW_LINE>RESTCallToken token = restCallLogger.<MASK><NEW_LINE>VoidResponse response = new VoidResponse();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>ValidValuesHandler<ValidValueElement, ValidValueAssignmentConsumerElement, ValidValueAssignmentDefinitionElement, ValidValueImplAssetElement, ValidValueImplDefinitionElement, ValidValueMappingElement, ReferenceValueAssignmentDefinitionElement, ReferenceValueAssignmentItemElement> handler = instanceHandler.getValidValuesHandler(userId, serverName, methodName);<NEW_LINE>handler.unmapValidValues(userId, null, null, validValue1GUID, validValue2GUID, null, methodName);<NEW_LINE>} catch (Exception error) {<NEW_LINE>restExceptionHandler.captureExceptions(response, error, methodName, auditLog);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>}
logRESTCall(serverName, userId, methodName);
296,654
public void handle(String method, String path, HashMap<String, String> headers, Map<String, String> queries, InputStream input, EmbedHttpServer.ResponseOutputStream response) throws Exception {<NEW_LINE>String lastSync = queries.get("lastSync");<NEW_LINE>FreelineCore.saveLastDynamicSyncId(Long.parseLong(lastSync));<NEW_LINE>Log.i(TAG, "save last sync value: " + lastSync);<NEW_LINE>boolean forceRestart = queries.containsKey("restart");<NEW_LINE>if (forceRestart) {<NEW_LINE>Log.i(TAG, "find restart marker, appliacation will restart.");<NEW_LINE>}<NEW_LINE>if (LongLinkServer.isDexChanged() || LongLinkServer.isResourcesChanged() || LongLinkServer.isNativeChanged()) {<NEW_LINE>if (LongLinkServer.isDexChanged() || LongLinkServer.isNativeChanged() || forceRestart) {<NEW_LINE>if (LongLinkServer.isDexChanged()) {<NEW_LINE><MASK><NEW_LINE>} else if (LongLinkServer.isNativeChanged()) {<NEW_LINE>Log.i(TAG, "with .so files changed, need to restart the process (activity stack will be reserved)");<NEW_LINE>}<NEW_LINE>FreelineCore.restartApplication(LongLinkServer.getBundleName(), LongLinkServer.getDstPath(), LongLinkServer.getDynamicDexPath(), LongLinkServer.getOptDirPath());<NEW_LINE>LongLinkServer.resetDexChangedFlag();<NEW_LINE>LongLinkServer.resetResourcesChangedFlag();<NEW_LINE>LongLinkServer.resetNativeChangedFlag();<NEW_LINE>} else if (LongLinkServer.isResourcesChanged()) {<NEW_LINE>FreelineCore.clearResourcesCache();<NEW_LINE>FreelineCore.updateActivity(LongLinkServer.getBundleName(), LongLinkServer.getDstPath());<NEW_LINE>LongLinkServer.resetResourcesChangedFlag();<NEW_LINE>Log.i(TAG, "with only res changes, just recreate the running activity.");<NEW_LINE>}<NEW_LINE>response.setStatusCode(200);<NEW_LINE>}<NEW_LINE>}
Log.i(TAG, "with dex changes, need to restart the process (activity stack will be reserved)");
1,032,984
public UpdateDatasetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateDatasetResult updateDatasetResult = new UpdateDatasetResult();<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 updateDatasetResult;<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateDatasetResult.setName(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 updateDatasetResult;<NEW_LINE>}
class).unmarshall(context));
1,749,830
final EnableAWSOrganizationsAccessResult executeEnableAWSOrganizationsAccess(EnableAWSOrganizationsAccessRequest enableAWSOrganizationsAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableAWSOrganizationsAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableAWSOrganizationsAccessRequest> request = null;<NEW_LINE>Response<EnableAWSOrganizationsAccessResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableAWSOrganizationsAccessRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableAWSOrganizationsAccessRequest));<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, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableAWSOrganizationsAccess");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableAWSOrganizationsAccessResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableAWSOrganizationsAccessResultJsonUnmarshaller());<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);
1,504,472
private void handle(final RecoverVmInstanceMsg msg) {<NEW_LINE>thdf.chainSubmit(new ChainTask(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSyncSignature() {<NEW_LINE>return syncThreadName;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(final SyncTaskChain chain) {<NEW_LINE>final RecoverVmInstanceReply reply = new RecoverVmInstanceReply();<NEW_LINE>refreshVO();<NEW_LINE>ErrorCode error = validateOperationByState(msg, self.<MASK><NEW_LINE>if (error != null) {<NEW_LINE>reply.setError(error);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>recoverVm(new Completion(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>reply.setError(errorCode);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return "recover-vm";<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getState(), SysErrors.OPERATION_ERROR);
92,644
public void paintObjectGroup(Graphics2D g, ObjectGroup group) {<NEW_LINE>// NOTE: Direct copy from OrthoMapView (candidate for generalization)<NEW_LINE>for (MapObject mo : group) {<NEW_LINE>double ox = mo.getX();<NEW_LINE>double oy = mo.getY();<NEW_LINE>if (mo.getWidth() == 0 || mo.getHeight() == 0) {<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g.setColor(Color.black);<NEW_LINE>g.fillOval((int) ox + 1, (int) oy + 1, 10, 10);<NEW_LINE>g.setColor(Color.orange);<NEW_LINE>g.fillOval((int) ox, (int) oy, 10, 10);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);<NEW_LINE>} else {<NEW_LINE>g.setColor(Color.black);<NEW_LINE>g.drawRect((int) ox + 1, (int) oy + 1, mo.getWidth().intValue(), mo.getHeight().intValue());<NEW_LINE>g.setColor(Color.orange);<NEW_LINE>g.drawRect((int) ox, (int) oy, mo.getWidth().intValue(), mo.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getHeight().intValue());
365,884
public RecordFieldWithDefaultValueNode transform(RecordFieldWithDefaultValueNode recordField) {<NEW_LINE>MetadataNode metadata = formatNode(recordField.metadata().orElse(null), 0, 1);<NEW_LINE>Token readonlyKeyword = formatNode(recordField.readonlyKeyword().orElse(null), 1, 0);<NEW_LINE>Node typeName = formatNode(recordField.typeName(), 1, 0);<NEW_LINE>Token fieldName = formatToken(recordField.fieldName(), 1, 0);<NEW_LINE>Token equalsToken = formatToken(recordField.equalsToken(), 1, 0);<NEW_LINE>ExpressionNode expression = formatNode(recordField.<MASK><NEW_LINE>Token semicolonToken = formatToken(recordField.semicolonToken(), env.trailingWS, env.trailingNL);<NEW_LINE>return recordField.modify().withMetadata(metadata).withReadonlyKeyword(readonlyKeyword).withTypeName(typeName).withFieldName(fieldName).withEqualsToken(equalsToken).withExpression(expression).withSemicolonToken(semicolonToken).apply();<NEW_LINE>}
expression(), 0, 0);
73,345
public static org.springframework.integration.context.IntegrationProperties integrationGlobalProperties(IntegrationProperties properties) {<NEW_LINE>org.springframework.integration.context.IntegrationProperties integrationProperties = new org.springframework.integration.context.IntegrationProperties();<NEW_LINE>PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();<NEW_LINE>map.from(properties.getChannel().isAutoCreate()).to(integrationProperties::setChannelsAutoCreate);<NEW_LINE>map.from(properties.getChannel().getMaxUnicastSubscribers()).to(integrationProperties::setChannelsMaxUnicastSubscribers);<NEW_LINE>map.from(properties.getChannel().getMaxBroadcastSubscribers()).to(integrationProperties::setChannelsMaxBroadcastSubscribers);<NEW_LINE>map.from(properties.getError().isRequireSubscribers()<MASK><NEW_LINE>map.from(properties.getError().isIgnoreFailures()).to(integrationProperties::setErrorChannelIgnoreFailures);<NEW_LINE>map.from(properties.getEndpoint().isThrowExceptionOnLateReply()).to(integrationProperties::setMessagingTemplateThrowExceptionOnLateReply);<NEW_LINE>map.from(properties.getEndpoint().getReadOnlyHeaders()).as(StringUtils::toStringArray).to(integrationProperties::setReadOnlyHeaders);<NEW_LINE>map.from(properties.getEndpoint().getNoAutoStartup()).as(StringUtils::toStringArray).to(integrationProperties::setNoAutoStartupEndpoints);<NEW_LINE>return integrationProperties;<NEW_LINE>}
).to(integrationProperties::setErrorChannelRequireSubscribers);
1,127,737
public void enterSy_authentication_order(Sy_authentication_orderContext ctx) {<NEW_LINE>if (_currentLine != null) {<NEW_LINE>// in system services/ports hierarchy<NEW_LINE>_currentAuthenticationOrder = _currentLine.getAaaAuthenticationLoginList();<NEW_LINE>if (_currentAuthenticationOrder == null || _currentAuthenticationOrder.isDefault()) {<NEW_LINE>// if the line already has a default authentication order, give it a new non-default one<NEW_LINE>_currentAuthenticationOrder = new AaaAuthenticationLoginList(new ArrayList<>(), false);<NEW_LINE>_currentLine.setAaaAuthenticationLoginList(_currentAuthenticationOrder);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// in system hierarchy<NEW_LINE>_currentAuthenticationOrder = _currentLogicalSystem.getJf().getSystemAuthenticationOrder();<NEW_LINE>if (_currentAuthenticationOrder == null || _currentAuthenticationOrder.isDefault()) {<NEW_LINE>// if system already has a default authentication order, give it a new non-default one<NEW_LINE>_currentAuthenticationOrder = new AaaAuthenticationLoginList(new ArrayList<>(), false);<NEW_LINE>_currentLogicalSystem.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// _currentAuthenticationOrder = authenticationOrder.getMethods();<NEW_LINE>}
getJf().setSystemAuthenticationOrder(_currentAuthenticationOrder);
1,489,298
public boolean onTouchEvent(MotionEvent event) {<NEW_LINE>if (!isEnabled()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>switch(event.getAction()) {<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>setSelected(true);<NEW_LINE>setPressed(true);<NEW_LINE>if (changeListener != null) {<NEW_LINE>changeListener.onStartTrackingTouch(this);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_UP:<NEW_LINE>setSelected(false);<NEW_LINE>setPressed(false);<NEW_LINE>if (changeListener != null) {<NEW_LINE>changeListener.onStopTrackingTouch(this);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_MOVE:<NEW_LINE>int progress = getMax() - (int) (getMax() * event.getY() / getHeight());<NEW_LINE>setProgress(progress);<NEW_LINE>onSizeChanged(getWidth(), <MASK><NEW_LINE>if (changeListener != null) {<NEW_LINE>changeListener.onProgressChanged(this, progress, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_CANCEL:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getHeight(), 0, 0);
322,521
private ByteBuffer toByteArray(BufferedImage image, int width, int height, int bpp, int targetBpp) throws IOException {<NEW_LINE><MASK><NEW_LINE>ByteBuffer buffer = ByteBuffer.allocateDirect(dataSize);<NEW_LINE>int[] rasterData = new int[width * height * 4];<NEW_LINE>image.getRaster().getPixels(0, 0, width, height, rasterData);<NEW_LINE>for (int y = 0; y < height; ++y) {<NEW_LINE>for (int x = 0; x < width; ++x) {<NEW_LINE>// BGRA to RGBA<NEW_LINE>int i = y * width * bpp + x * bpp;<NEW_LINE>int green = 0;<NEW_LINE>int red = 0;<NEW_LINE>int alpha = 0;<NEW_LINE>int blue = rasterData[i + 0];<NEW_LINE>if (bpp > 1)<NEW_LINE>green = rasterData[i + 1];<NEW_LINE>if (bpp > 2)<NEW_LINE>red = rasterData[i + 2];<NEW_LINE>if (bpp > 3)<NEW_LINE>alpha = rasterData[i + 3];<NEW_LINE>buffer.put((byte) (red & 0xFF));<NEW_LINE>if (targetBpp > 1)<NEW_LINE>buffer.put((byte) (green & 0xFF));<NEW_LINE>if (targetBpp > 2)<NEW_LINE>buffer.put((byte) (blue & 0xFF));<NEW_LINE>if (targetBpp > 3)<NEW_LINE>buffer.put((byte) (alpha & 0xFF));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// limit is set to current position, and position is set to zero<NEW_LINE>buffer.flip();<NEW_LINE>return buffer;<NEW_LINE>}
int dataSize = width * height * bpp;
1,140,071
private void exportEvent(final LoggedEvent event) {<NEW_LINE>final ActorFuture<Boolean> wrapRetryFuture = recordWrapStrategy.runWithRetry(() -> {<NEW_LINE>recordExporter.wrap(event);<NEW_LINE>return true;<NEW_LINE>}, this::isClosed);<NEW_LINE>actor.runOnCompletion(wrapRetryFuture, (b, t) -> {<NEW_LINE>assert t == null : "Throwable must be null";<NEW_LINE>final ActorFuture<Boolean> retryFuture = exportingRetryStrategy.runWithRetry(recordExporter::export, this::isClosed);<NEW_LINE>actor.runOnCompletion(retryFuture, (bool, throwable) -> {<NEW_LINE>if (throwable != null) {<NEW_LINE>LOG.<MASK><NEW_LINE>onFailure();<NEW_LINE>} else {<NEW_LINE>metrics.eventExported(recordExporter.getTypedEvent().getValueType());<NEW_LINE>inExportingPhase = false;<NEW_LINE>actor.submit(this::readNextEvent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
error(ERROR_MESSAGE_EXPORTING_ABORTED, event, throwable);
494,239
public void onClick(int position) {<NEW_LINE>if (MultiClickGuard.allowClick(getClass().getName())) {<NEW_LINE>switch(position) {<NEW_LINE>case 0:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>forumTabHelper.openWebPageInCustomTab(this, forumUri);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>Intent shareIntent = new Intent(Intent.ACTION_SEND);<NEW_LINE>shareIntent.setType("text/plain");<NEW_LINE>shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.tell_your_friends_msg) + " " + GOOGLE_PLAY_URL + getPackageName());<NEW_LINE>startActivity(Intent.createChooser(shareIntent, getString(R.string.tell_your_friends)));<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName()));<NEW_LINE>intentLauncher.launch(this, intent, () -> {<NEW_LINE>// Show a list of all available browsers if user doesn't have a default browser<NEW_LINE>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(GOOGLE_PLAY_URL + getPackageName())));<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>intent = new Intent(this, WebViewActivity.class);<NEW_LINE>intent.putExtra(ExternalWebPageHelper.OPEN_URL, LICENSES_HTML_PATH);<NEW_LINE>startActivity(intent);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
websiteTabHelper.openWebPageInCustomTab(this, websiteUri);
1,745,875
public void generateMultiSupplierInvoice(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>List<Map> stockMoveMap = (List<Map>) request.getContext().get("supplierStockMoveToInvoice");<NEW_LINE>List<Long> stockMoveIdList = new ArrayList<>();<NEW_LINE>List<StockMove> stockMoveList = new ArrayList<>();<NEW_LINE>for (Map map : stockMoveMap) {<NEW_LINE>stockMoveIdList.add(((Number) map.get("id")).longValue());<NEW_LINE>}<NEW_LINE>for (Long stockMoveId : stockMoveIdList) {<NEW_LINE>stockMoveList.add(JPA.em().find(StockMove.class, stockMoveId));<NEW_LINE>}<NEW_LINE>Beans.get(StockMoveMultiInvoiceService.class).checkForAlreadyInvoicedStockMove(stockMoveList);<NEW_LINE>Entry<List<Long>, String> result = Beans.get(StockMoveMultiInvoiceService.class).generateMultipleInvoices(stockMoveIdList);<NEW_LINE>List<Long> invoiceIdList = result.getKey();<NEW_LINE>String warningMessage = result.getValue();<NEW_LINE>if (!invoiceIdList.isEmpty()) {<NEW_LINE>ActionViewBuilder viewBuilder;<NEW_LINE><MASK><NEW_LINE>viewBuilder.model(Invoice.class.getName()).add("grid", "invoice-supplier-grid").add("form", "invoice-form").param("search-filters", "supplier-invoices-filters").domain("self.id IN (" + Joiner.on(",").join(invoiceIdList) + ")").context("_operationTypeSelect", InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE).context("todayDate", Beans.get(AppSupplychainService.class).getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null)));<NEW_LINE>response.setView(viewBuilder.map());<NEW_LINE>}<NEW_LINE>if (warningMessage != null && !warningMessage.isEmpty()) {<NEW_LINE>response.setFlash(warningMessage);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>}
viewBuilder = ActionView.define("Suppl. Invoices");
950,146
private void updateSelectedContent() {<NEW_LINE>TableRowCore[] rows = tv_subs_results.getSelectedRows();<NEW_LINE>ArrayList<ISelectedContent> valid = new ArrayList<>();<NEW_LINE>last_selected_content.clear();<NEW_LINE>for (int i = 0; i < rows.length; i++) {<NEW_LINE>SBC_SearchResult rc = (SBC_SearchResult) rows[i].getDataSource();<NEW_LINE>last_selected_content.add(rc);<NEW_LINE>byte[] hash = rc.getHash();<NEW_LINE>if (hash != null && hash.length > 0) {<NEW_LINE>SelectedContent sc = new SelectedContent(Base32.encode(hash), rc.getName());<NEW_LINE>sc.setDownloadInfo(new <MASK><NEW_LINE>valid.add(sc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ISelectedContent[] sels = valid.toArray(new ISelectedContent[valid.size()]);<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent("IconBarEnabler", sels, tv_subs_results);<NEW_LINE>UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();<NEW_LINE>if (uiFunctions != null) {<NEW_LINE>uiFunctions.refreshIconBar();<NEW_LINE>}<NEW_LINE>}
DownloadUrlInfo(getDownloadURI(rc)));
697,678
public void write(org.apache.thrift.protocol.TProtocol prot, unloadTablet_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetLock()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetGoal()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetRequestTime()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetLock()) {<NEW_LINE>oprot.writeString(struct.lock);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>struct.extent.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetGoal()) {<NEW_LINE>oprot.writeI32(struct.goal.getValue());<NEW_LINE>}<NEW_LINE>if (struct.isSetRequestTime()) {<NEW_LINE>oprot.writeI64(struct.requestTime);<NEW_LINE>}<NEW_LINE>}
oprot.writeBitSet(optionals, 6);
1,739,518
public static void main(String[] args) throws Exception {<NEW_LINE>final String fileNameInit = "/tmp/log-1.hpl";<NEW_LINE>final String fileNameUpd = "/tmp/log-2.hpl";<NEW_LINE>final int samplingIntervalInit = 41;<NEW_LINE>final int samplingIntervalUpd = 333;<NEW_LINE>final int maxFramesToCaptureInit = 42;<NEW_LINE>final int maxFramesToCaptureUpd = 121;<NEW_LINE>Agent.setFilePath(fileNameInit);<NEW_LINE>assertEquals(fileNameInit, Agent.getFilePath(), "set initial logs file path");<NEW_LINE>Agent.setSamplingInterval(samplingIntervalInit, 2 * samplingIntervalInit);<NEW_LINE>assertEquals(samplingIntervalInit, Agent.getSamplingIntervalMin(), "set initial min sampling interval");<NEW_LINE>assertEquals(2 * samplingIntervalInit, Agent.getSamplingIntervalMax(), "set initial max sampling interval");<NEW_LINE>Agent.setMaxFramesToCapture(maxFramesToCaptureInit);<NEW_LINE>assertEquals(maxFramesToCaptureInit, Agent.getMaxFramesToCapture(), "set initial max stack frames to capture");<NEW_LINE>Agent.start();<NEW_LINE>Agent.setFilePath(fileNameUpd);<NEW_LINE>assertEquals(fileNameInit, Agent.getFilePath(), "update logs file path when profiler is running");<NEW_LINE>Agent.setSamplingInterval(samplingIntervalUpd, 2 * samplingIntervalUpd);<NEW_LINE>assertEquals(samplingIntervalInit, Agent.getSamplingIntervalMin(), "update min sampling interval when profiler is running");<NEW_LINE>assertEquals(2 * samplingIntervalInit, <MASK><NEW_LINE>Agent.setMaxFramesToCapture(maxFramesToCaptureUpd);<NEW_LINE>assertEquals(maxFramesToCaptureInit, Agent.getMaxFramesToCapture(), "update max stack frames to capture when profiler is running");<NEW_LINE>Agent.stop();<NEW_LINE>Agent.setFilePath(fileNameUpd);<NEW_LINE>assertEquals(fileNameUpd, Agent.getFilePath(), "update logs file path");<NEW_LINE>Agent.setSamplingInterval(samplingIntervalUpd, 2 * samplingIntervalUpd);<NEW_LINE>assertEquals(samplingIntervalUpd, Agent.getSamplingIntervalMin(), "update min sampling interval");<NEW_LINE>assertEquals(2 * samplingIntervalUpd, Agent.getSamplingIntervalMax(), "update max sampling interval");<NEW_LINE>Agent.setMaxFramesToCapture(maxFramesToCaptureUpd);<NEW_LINE>assertEquals(maxFramesToCaptureUpd, Agent.getMaxFramesToCapture(), "update max stack frames to capture");<NEW_LINE>}
Agent.getSamplingIntervalMax(), "update max sampling interval when profiler is running");
1,384,695
static void findFieldsForComponents(JavaComponentInfo ci) {<NEW_LINE>// Components by UID:<NEW_LINE>int n = countComponents(ci);<NEW_LINE>long[] uids = new long[n];<NEW_LINE>JavaComponentInfo[] components = new JavaComponentInfo[n];<NEW_LINE><MASK><NEW_LINE>Arrays.sort(components, new JavaComponentInfoUIDComparator());<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>uids[i] = components[i].uid;<NEW_LINE>}<NEW_LINE>for (JavaComponentInfo jci : components) {<NEW_LINE>if (jci.isCustomType() && jci.getSubComponents().length > 0) {<NEW_LINE>ObjectReference c = jci.getComponent();<NEW_LINE>try {<NEW_LINE>Map<Field, Value> fieldValues = ObjectReferenceWrapper.getValues(c, ReferenceTypeWrapper.fields(ObjectReferenceWrapper.referenceType(c)));<NEW_LINE>for (Map.Entry<Field, Value> fv : fieldValues.entrySet()) {<NEW_LINE>Value value = fv.getValue();<NEW_LINE>if (value instanceof ObjectReference) {<NEW_LINE>long uid = ObjectReferenceWrapper.uniqueID((ObjectReference) value);<NEW_LINE>int index = Arrays.binarySearch(uids, uid);<NEW_LINE>if (index >= 0) {<NEW_LINE>components[index].setFieldInfo(new JavaComponentInfo.FieldInfo(fv.getKey(), jci));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ClassNotPreparedExceptionWrapper cnpex) {<NEW_LINE>} catch (InternalExceptionWrapper iex) {<NEW_LINE>} catch (ObjectCollectedExceptionWrapper ocex) {<NEW_LINE>} catch (VMDisconnectedExceptionWrapper vmdex) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fillComponents(ci, components, 0);
1,270,567
public static void startMethod(@Advice.This Query query, @Advice.Local("otelCallDepth") CallDepth callDepth, @Advice.Local("otelHibernateOperation") HibernateOperation hibernateOperation, @Advice.Local("otelContext") Context context, @Advice.Local("otelScope") Scope scope) {<NEW_LINE>callDepth = CallDepth.forClass(HibernateOperation.class);<NEW_LINE>if (callDepth.getAndIncrement() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VirtualField<Query, SessionInfo> criteriaVirtualField = VirtualField.find(Query.class, SessionInfo.class);<NEW_LINE>SessionInfo <MASK><NEW_LINE>Context parentContext = Java8BytecodeBridge.currentContext();<NEW_LINE>hibernateOperation = new HibernateOperation(getOperationNameForQuery(query.getQueryString()), sessionInfo);<NEW_LINE>if (!instrumenter().shouldStart(parentContext, hibernateOperation)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context = instrumenter().start(parentContext, hibernateOperation);<NEW_LINE>scope = context.makeCurrent();<NEW_LINE>}
sessionInfo = criteriaVirtualField.get(query);
1,174,371
// TODO(malcon): Create a builder like LogCmd, etc.<NEW_LINE>ImmutableList<TreeElement> lsTree(GitRevision reference, @Nullable String treeish, boolean recursive, boolean fullName) throws RepoException {<NEW_LINE>ImmutableList.Builder<TreeElement> result = ImmutableList.builder();<NEW_LINE>List<String> args = Lists.newArrayList("ls-tree", reference.getSha1());<NEW_LINE>if (recursive) {<NEW_LINE>args.add("-r");<NEW_LINE>}<NEW_LINE>if (fullName) {<NEW_LINE>args.add("--full-name");<NEW_LINE>}<NEW_LINE>if (treeish != null) {<NEW_LINE>args.add("--");<NEW_LINE>args.add(treeish);<NEW_LINE>}<NEW_LINE>String stdout = simpleCommand(args).getStdout();<NEW_LINE>for (String line : Splitter.on('\n').split(stdout)) {<NEW_LINE>if (line.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Matcher matcher = LS_TREE_ELEMENT.matcher(line);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>throw new RepoException("Unexpected format for ls-tree output: " + line);<NEW_LINE>}<NEW_LINE>// We ignore the mode for now<NEW_LINE>GitObjectType objectType = GitObjectType.valueOf(matcher.group(2).toUpperCase());<NEW_LINE>String <MASK><NEW_LINE>String path = // Per ls-tree documentation. Replace those escaped characters.<NEW_LINE>matcher.group(4).replace("\\\\", "\\").replace("\\t", "\t").replace("\\n", "\n");<NEW_LINE>result.add(new TreeElement(objectType, sha1, path));<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}
sha1 = matcher.group(3);
1,079,238
public static ListEventsResponse unmarshall(ListEventsResponse listEventsResponse, UnmarshallerContext context) {<NEW_LINE>listEventsResponse.setRequestId(context.stringValue("ListEventsResponse.RequestId"));<NEW_LINE>listEventsResponse.setCode(context.stringValue("ListEventsResponse.Code"));<NEW_LINE>listEventsResponse.setMessage(context.stringValue("ListEventsResponse.Message"));<NEW_LINE>listEventsResponse.setNextCursor(context.stringValue("ListEventsResponse.NextCursor"));<NEW_LINE>listEventsResponse.setTotalCount(context.integerValue("ListEventsResponse.TotalCount"));<NEW_LINE>listEventsResponse.setAction(context.stringValue("ListEventsResponse.Action"));<NEW_LINE>List<Event> events = new ArrayList<Event>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListEventsResponse.Events.Length"); i++) {<NEW_LINE>Event event = new Event();<NEW_LINE>event.setId(context.longValue<MASK><NEW_LINE>event.setIdStr(context.stringValue("ListEventsResponse.Events[" + i + "].IdStr"));<NEW_LINE>event.setTitle(context.stringValue("ListEventsResponse.Events[" + i + "].Title"));<NEW_LINE>event.setBannerPhotoId(context.stringValue("ListEventsResponse.Events[" + i + "].BannerPhotoId"));<NEW_LINE>event.setIdentity(context.stringValue("ListEventsResponse.Events[" + i + "].Identity"));<NEW_LINE>event.setSplashPhotoId(context.stringValue("ListEventsResponse.Events[" + i + "].SplashPhotoId"));<NEW_LINE>event.setState(context.stringValue("ListEventsResponse.Events[" + i + "].State"));<NEW_LINE>event.setWeixinTitle(context.stringValue("ListEventsResponse.Events[" + i + "].WeixinTitle"));<NEW_LINE>event.setWatermarkPhotoId(context.stringValue("ListEventsResponse.Events[" + i + "].WatermarkPhotoId"));<NEW_LINE>event.setStartAt(context.longValue("ListEventsResponse.Events[" + i + "].StartAt"));<NEW_LINE>event.setEndAt(context.longValue("ListEventsResponse.Events[" + i + "].EndAt"));<NEW_LINE>event.setCtime(context.longValue("ListEventsResponse.Events[" + i + "].Ctime"));<NEW_LINE>event.setMtime(context.longValue("ListEventsResponse.Events[" + i + "].Mtime"));<NEW_LINE>event.setViewsCount(context.longValue("ListEventsResponse.Events[" + i + "].ViewsCount"));<NEW_LINE>event.setLibraryId(context.stringValue("ListEventsResponse.Events[" + i + "].LibraryId"));<NEW_LINE>event.setIdStr1(context.stringValue("ListEventsResponse.Events[" + i + "].IdStr"));<NEW_LINE>events.add(event);<NEW_LINE>}<NEW_LINE>listEventsResponse.setEvents(events);<NEW_LINE>return listEventsResponse;<NEW_LINE>}
("ListEventsResponse.Events[" + i + "].Id"));
541,797
public static DropTableBuilder createBuilder(String schemaName, String logicalTableName, boolean ifExists, ExecutionContext executionContext) {<NEW_LINE>ReplaceTableNameWithQuestionMarkVisitor visitor = new ReplaceTableNameWithQuestionMarkVisitor(schemaName, executionContext);<NEW_LINE>SqlIdentifier logicalTableNameNode = new SqlIdentifier(logicalTableName, SqlParserPos.ZERO);<NEW_LINE>SqlDropTable sqlDropTable = SqlDdlNodes.dropTable(SqlParserPos.ZERO, ifExists, logicalTableNameNode, true);<NEW_LINE>sqlDropTable = (SqlDropTable) sqlDropTable.accept(visitor);<NEW_LINE>final RelOptCluster cluster = SqlConverter.getInstance(executionContext).createRelOptCluster(null);<NEW_LINE>DropTable dropTable = DropTable.<MASK><NEW_LINE>LogicalDropTable logicalDropTable = LogicalDropTable.create(dropTable);<NEW_LINE>logicalDropTable.setSchemaName(schemaName);<NEW_LINE>logicalDropTable.prepareData();<NEW_LINE>return new DropTableBuilder(dropTable, logicalDropTable.getDropTablePreparedData(), executionContext);<NEW_LINE>}
create(cluster, sqlDropTable, logicalTableNameNode);
370,200
public static KeyValuePart[] split(MatrixMeta matrixMeta, int rowId, int[] keys, IElement[] values, boolean isSorted) {<NEW_LINE>if (!isSorted) {<NEW_LINE>Sort.quickSort(keys, values, 0, keys.length - 1);<NEW_LINE>}<NEW_LINE>PartitionKey[<MASK><NEW_LINE>KeyValuePart[] dataParts = new KeyValuePart[matrixParts.length];<NEW_LINE>int keyIndex = 0;<NEW_LINE>int partIndex = 0;<NEW_LINE>while (keyIndex < keys.length || partIndex < matrixParts.length) {<NEW_LINE>int length = 0;<NEW_LINE>long endOffset = matrixParts[partIndex].getEndCol();<NEW_LINE>while (keyIndex < keys.length && keys[keyIndex] < endOffset) {<NEW_LINE>keyIndex++;<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>dataParts[partIndex] = new RangeViewIntKeysAnyValuesPart(rowId, keys, values, keyIndex - length, keyIndex);<NEW_LINE>partIndex++;<NEW_LINE>}<NEW_LINE>return dataParts;<NEW_LINE>}
] matrixParts = matrixMeta.getPartitionKeys();
1,550,601
protected void doHealthCheck(Health.Builder builder) throws Exception {<NEW_LINE>try {<NEW_LINE>this.lock.lock();<NEW_LINE>if (this.adminClient == null) {<NEW_LINE>this.adminClient = AdminClient.create(this.adminClientProperties);<NEW_LINE>}<NEW_LINE>final ListTopicsResult listTopicsResult = this.adminClient.listTopics();<NEW_LINE>listTopicsResult.listings().get(this.configurationProperties.getHealthTimeout(), TimeUnit.SECONDS);<NEW_LINE>if (this.kafkaStreamsBindingInformationCatalogue.getStreamsBuilderFactoryBeans().isEmpty()) {<NEW_LINE>builder.withDetail("No Kafka Streams bindings have been established", "Kafka Streams binder did not detect any processors");<NEW_LINE>builder.status(Status.UNKNOWN);<NEW_LINE>} else {<NEW_LINE>boolean up = true;<NEW_LINE>final Set<KafkaStreams> kafkaStreams = kafkaStreamsRegistry.getKafkaStreams();<NEW_LINE>Set<KafkaStreams> allKafkaStreams = new HashSet<>(kafkaStreams);<NEW_LINE>if (this.configurationProperties.isIncludeStoppedProcessorsForHealthCheck()) {<NEW_LINE>allKafkaStreams.addAll(kafkaStreamsBindingInformationCatalogue.getStoppedKafkaStreams().values());<NEW_LINE>}<NEW_LINE>for (KafkaStreams kStream : allKafkaStreams) {<NEW_LINE>if (isKafkaStreams25) {<NEW_LINE>up &= kStream.state().isRunningOrRebalancing();<NEW_LINE>} else {<NEW_LINE>// if Kafka client version is lower than 2.5, then call the method reflectively.<NEW_LINE>final boolean isRunningInvokedResult = (boolean) methodForIsRunning.<MASK><NEW_LINE>up &= isRunningInvokedResult;<NEW_LINE>}<NEW_LINE>builder.withDetails(buildDetails(kStream));<NEW_LINE>}<NEW_LINE>builder.status(up ? Status.UP : Status.DOWN);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>builder.withDetail("No topic information available", "Kafka broker is not reachable");<NEW_LINE>builder.status(Status.DOWN);<NEW_LINE>builder.withException(e);<NEW_LINE>} finally {<NEW_LINE>this.lock.unlock();<NEW_LINE>}<NEW_LINE>}
invoke(kStream.state());
608,458
public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ftp_cd" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>// if (size != 2) {<NEW_LINE>// MessageManager mm = EngineMessage.get();<NEW_LINE>// throw new RQException("ftp_cd" + mm.getMessage("function.invalidParam"));<NEW_LINE>// }<NEW_LINE>FtpClientImpl client = null;<NEW_LINE>SFtpClientImpl sclient = null;<NEW_LINE>String path = null;<NEW_LINE>if (size == 0) {<NEW_LINE>Object o = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (o instanceof FtpClientImpl)<NEW_LINE>client = (FtpClientImpl) o;<NEW_LINE>else if (o instanceof SFtpClientImpl)<NEW_LINE>sclient = (SFtpClientImpl) o;<NEW_LINE>else<NEW_LINE>throw new RQException("first parameter is not ftp_client");<NEW_LINE>path = "/";<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (param.getSub(i) == null) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("ftp_cd" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>if (i == 0) {<NEW_LINE>Object o = param.getSub(i).getLeafExpression().calculate(ctx);<NEW_LINE>if (o instanceof FtpClientImpl)<NEW_LINE>client = (FtpClientImpl) o;<NEW_LINE>else if (o instanceof SFtpClientImpl)<NEW_LINE>sclient = (SFtpClientImpl) o;<NEW_LINE>else<NEW_LINE>throw new RQException("first parameter is not ftp_client");<NEW_LINE>} else if (i == 1) {<NEW_LINE>path = (String) param.getSub(i).getLeafExpression().calculate(ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean r = false;<NEW_LINE>try {<NEW_LINE>if (client != null)<NEW_LINE>r = client.changeRemoteDir(path);<NEW_LINE>else<NEW_LINE>r = sclient.changeRemoteDir(path);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new RQException("ftp_cd : " + e.getMessage());<NEW_LINE>}<NEW_LINE>return "change directory [" + path + "] " + (r ? "success" : "falied");<NEW_LINE>}
MessageManager mm = EngineMessage.get();
874,963
static void writeSystemInformation(@NonNull Application application, @NonNull FileWriter fw) throws IOException {<NEW_LINE>fw.write("Android version: " + Build.VERSION.SDK_INT + "\n");<NEW_LINE>fw.write("Device: " + Utils.getFullDeviceModel() + "\n");<NEW_LINE>fw.write("App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_NAME + "\n");<NEW_LINE>fw.write("Installation ID: " + Utils.getInstallationId(application) + "\n");<NEW_LINE>fw.write(<MASK><NEW_LINE>fw.write("\nNetworks : ");<NEW_LINE>final ConnectivityManager manager = (ConnectivityManager) application.getSystemService(Context.CONNECTIVITY_SERVICE);<NEW_LINE>for (NetworkInfo info : manager.getAllNetworkInfo()) fw.write(info.toString());<NEW_LINE>fw.write("\nLocation providers: ");<NEW_LINE>final LocationManager locMngr = (android.location.LocationManager) application.getSystemService(Context.LOCATION_SERVICE);<NEW_LINE>for (String provider : locMngr.getProviders(true)) fw.write(provider + " ");<NEW_LINE>fw.write("\n\n");<NEW_LINE>}
"Locale : " + Locale.getDefault());
183,677
private static List<Map<String, String>> loadWords(InputStream stream) {<NEW_LINE>List<Map<String, String>> list = new ArrayList<>();<NEW_LINE>try (InputStreamReader isr = new InputStreamReader(stream, FILE_ENCODING);<NEW_LINE>BufferedReader br = new BufferedReader(isr)) {<NEW_LINE>String line;<NEW_LINE>Tokenizer wordTokenizer = new Breton().getWordTokenizer();<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.isEmpty() || line.charAt(0) == '#') {<NEW_LINE>// ignore comments<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String[] parts = line.split("=");<NEW_LINE>if (parts.length != 2) {<NEW_LINE>throw new IOException("Format error in file " + JLanguageTool.getDataBroker().getFromRulesDirAsUrl(FILE_NAME) + ", line: " + line);<NEW_LINE>}<NEW_LINE>// multiple incorrect forms<NEW_LINE>String[] wrongForms = parts[0].split("\\|");<NEW_LINE>for (String wrongForm : wrongForms) {<NEW_LINE>int wordCount = 0;<NEW_LINE>List<String> <MASK><NEW_LINE>for (String token : tokens) {<NEW_LINE>if (!StringTools.isWhitespace(token)) {<NEW_LINE>wordCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// grow if necessary<NEW_LINE>for (int i = list.size(); i < wordCount; i++) {<NEW_LINE>list.add(new HashMap<>());<NEW_LINE>}<NEW_LINE>list.get(wordCount - 1).put(wrongForm, parts[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// seal the result (prevent modification from outside this class)<NEW_LINE>List<Map<String, String>> result = new ArrayList<>();<NEW_LINE>for (Map<String, String> map : list) {<NEW_LINE>result.add(Collections.unmodifiableMap(map));<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(result);<NEW_LINE>}
tokens = wordTokenizer.tokenize(wrongForm);
663,932
public static int VROverlay_ShowKeyboard(@NativeType("EGamepadTextInputMode") int eInputMode, @NativeType("EGamepadTextInputLineMode") int eLineInputMode, @NativeType("uint32_t") int unFlags, @NativeType("char const *") CharSequence pchDescription, @NativeType("uint32_t") int unCharMax, @NativeType("char const *") CharSequence pchExistingText, @NativeType("bool") boolean bUseMinimalMode, @NativeType("uint64_t") long uUserValue) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nASCII(pchDescription, true);<NEW_LINE><MASK><NEW_LINE>stack.nASCII(pchExistingText, true);<NEW_LINE>long pchExistingTextEncoded = stack.getPointerAddress();<NEW_LINE>return nVROverlay_ShowKeyboard(eInputMode, eLineInputMode, unFlags, pchDescriptionEncoded, unCharMax, pchExistingTextEncoded, bUseMinimalMode, uUserValue);<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>}
long pchDescriptionEncoded = stack.getPointerAddress();
1,673,963
public static Message<byte[]> generateMessage(byte[] payload, MessageHeaders headers, Type inputType, JsonMapper objectMapper, @Nullable Context awsContext) {<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Incoming JSON Event: " + new String(payload));<NEW_LINE>}<NEW_LINE>if (FunctionTypeUtils.isMessage(inputType)) {<NEW_LINE>inputType = FunctionTypeUtils.getImmediateGenericType(inputType, 0);<NEW_LINE>}<NEW_LINE>MessageBuilder messageBuilder = null;<NEW_LINE>if (inputType != null && isSupportedAWSType(inputType)) {<NEW_LINE>PojoSerializer<?> serializer = LambdaEventSerializers.serializerFor(FunctionTypeUtils.getRawType(inputType), Thread.currentThread().getContextClassLoader());<NEW_LINE>Object event = serializer.fromJson(new ByteArrayInputStream(payload));<NEW_LINE>messageBuilder = MessageBuilder.withPayload(event);<NEW_LINE>if (event instanceof APIGatewayProxyRequestEvent || event instanceof APIGatewayV2HTTPEvent) {<NEW_LINE>messageBuilder.setHeader(AWS_API_GATEWAY, true);<NEW_LINE>logger.info("Incoming request is API Gateway");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object request;<NEW_LINE>try {<NEW_LINE>request = objectMapper.fromJson(payload, Object.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>if (request instanceof Map) {<NEW_LINE>logger.info("Incoming MAP: " + request);<NEW_LINE>if (((Map) request).containsKey("httpMethod")) {<NEW_LINE>// API Gateway<NEW_LINE>logger.info("Incoming request is API Gateway");<NEW_LINE>boolean mapInputType = (inputType instanceof ParameterizedType && ((Class<?>) ((ParameterizedType) inputType).getRawType()).isAssignableFrom(Map.class));<NEW_LINE>if (mapInputType) {<NEW_LINE>messageBuilder = MessageBuilder.withPayload(request).setHeader("httpMethod", ((Map) request).get("httpMethod"));<NEW_LINE>messageBuilder.setHeader(AWS_API_GATEWAY, true);<NEW_LINE>} else {<NEW_LINE>messageBuilder = createMessageBuilderForPOJOFunction(objectMapper, (Map) request);<NEW_LINE>}<NEW_LINE>} else if ((((Map) request).containsKey("routeKey") && ((Map) request).containsKey("version"))) {<NEW_LINE>logger.info("Incoming request is API Gateway v2.0");<NEW_LINE>messageBuilder = createMessageBuilderForPOJOFunction(objectMapper, (Map) request);<NEW_LINE>}<NEW_LINE>Object providedHeaders = ((Map<MASK><NEW_LINE>if (providedHeaders != null && providedHeaders instanceof Map) {<NEW_LINE>messageBuilder = MessageBuilder.withPayload(request);<NEW_LINE>messageBuilder.removeHeader("headers");<NEW_LINE>messageBuilder.copyHeaders((Map<String, Object>) providedHeaders);<NEW_LINE>}<NEW_LINE>} else if (request instanceof Iterable) {<NEW_LINE>messageBuilder = MessageBuilder.withPayload(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (messageBuilder == null) {<NEW_LINE>messageBuilder = MessageBuilder.withPayload(payload);<NEW_LINE>}<NEW_LINE>if (awsContext != null) {<NEW_LINE>messageBuilder.setHeader(AWS_CONTEXT, awsContext);<NEW_LINE>}<NEW_LINE>logger.info("Incoming request headers: " + headers);<NEW_LINE>return messageBuilder.copyHeaders(headers).build();<NEW_LINE>}
) request).remove("headers");
1,391,491
private void okPressed() {<NEW_LINE>Date notBefore = jdtNotBefore.getDateTime();<NEW_LINE>Date notAfter = jdtNotAfter.getDateTime();<NEW_LINE>if ((notBefore == null) && (notAfter == null)) {<NEW_LINE>JOptionPane.showMessageDialog(this, res.getString("DPrivateKeyUsagePeriod.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// BC forgot the value constructor for PrivateKeyUsagePeriod...<NEW_LINE>ASN1EncodableVector v = new ASN1EncodableVector();<NEW_LINE>if (notBefore != null) {<NEW_LINE><MASK><NEW_LINE>v.add(new DERTaggedObject(false, 0, notBeforeGenTime));<NEW_LINE>}<NEW_LINE>if (notAfter != null) {<NEW_LINE>DERGeneralizedTime notAfterGenTime = new DERGeneralizedTime(notAfter);<NEW_LINE>v.add(new DERTaggedObject(false, 1, notAfterGenTime));<NEW_LINE>}<NEW_LINE>PrivateKeyUsagePeriod privateKeyUsagePeriod = PrivateKeyUsagePeriod.getInstance(new DERSequence(v));<NEW_LINE>try {<NEW_LINE>value = privateKeyUsagePeriod.getEncoded(ASN1Encoding.DER);<NEW_LINE>} catch (IOException e) {<NEW_LINE>DError.displayError(this, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>closeDialog();<NEW_LINE>}
DERGeneralizedTime notBeforeGenTime = new DERGeneralizedTime(notBefore);
155,382
public void marshall(PutEventTypeRequest putEventTypeRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (putEventTypeRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getEventVariables(), EVENTVARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getLabels(), LABELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getEntityTypes(), ENTITYTYPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getEventIngestion(), EVENTINGESTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(putEventTypeRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
368,032
public static long sizeStringToBytes(String str) {<NEW_LINE>String numStr = str.substring(0, str.length() - 1);<NEW_LINE>String suffix = str.substring(str.length() - 1);<NEW_LINE>if (!validSuffix.contains(suffix)) {<NEW_LINE>return Long.parseLong(str);<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>if (suffix.equals(T_SUFFIX) || suffix.equals(t_SUFFIX)) {<NEW_LINE>return SizeUnit.TERABYTE.toByte(size);<NEW_LINE>} else if (suffix.equals(G_SUFFIX) || suffix.equals(g_SUFFIX)) {<NEW_LINE>return SizeUnit.GIGABYTE.toByte(size);<NEW_LINE>} else if (suffix.equals(M_SUFFIX) || suffix.equals(m_SUFFIX)) {<NEW_LINE>return SizeUnit.MEGABYTE.toByte(size);<NEW_LINE>} else if (suffix.equals(K_SUFFIX) || suffix.equals(k_SUFFIX)) {<NEW_LINE>return SizeUnit.KILOBYTE.toByte(size);<NEW_LINE>} else if (suffix.equals(B_SUFFIX) || suffix.equals(b_SUFFIX)) {<NEW_LINE>return SizeUnit.BYTE.toByte(size);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("should not be here," + str);<NEW_LINE>}
size = Long.parseLong(numStr);
287,995
private void printInputData() {<NEW_LINE>System.out.println("nbHouses = " + HOUSE_NUMBER + ";");<NEW_LINE>System.out.println("MarioHouse = " + MARIO_HOUSE_ID + ";");<NEW_LINE>System.out.println("LuigiHouse = " + LUIGI_HOUSE_ID + ";");<NEW_LINE>System.out.println("fuelMax = " + FUEL + ";");<NEW_LINE>System.out.println(<MASK><NEW_LINE>String conso = "conso = [";<NEW_LINE>for (int i = 0; i < HOUSE_NUMBER; i++) {<NEW_LINE>String s = "|";<NEW_LINE>for (int j = 0; j < HOUSE_NUMBER - 1; j++) {<NEW_LINE>s += this.consumptions[i][j] + ",";<NEW_LINE>}<NEW_LINE>conso += s + this.consumptions[i][HOUSE_NUMBER - 1];<NEW_LINE>}<NEW_LINE>conso += "|];";<NEW_LINE>System.out.println(conso);<NEW_LINE>String goldInHouse = "goldInHouse = [";<NEW_LINE>for (int i = 0; i < HOUSE_NUMBER - 1; i++) {<NEW_LINE>goldInHouse += this.gold[i] + ",";<NEW_LINE>}<NEW_LINE>goldInHouse += this.gold[HOUSE_NUMBER - 1] + "];";<NEW_LINE>System.out.println(goldInHouse);<NEW_LINE>}
"goldTotalAmount = " + MAX_GOLD * HOUSE_NUMBER + ";");
281,580
public static String condenseManaCostString(String rawCost) {<NEW_LINE>int total = 0;<NEW_LINE>int index = 0;<NEW_LINE>// Split the string in to an array of numbers and colored mana symbols<NEW_LINE>String[] splitCost = rawCost.replace("{", "").replace("}", " ").split(" ");<NEW_LINE>// Sort alphabetically which will push1 the numbers to the front before the colored mana symbols<NEW_LINE>Arrays.sort(splitCost);<NEW_LINE>for (String c : splitCost) {<NEW_LINE>// If the string is a representation of a number<NEW_LINE>if (c.matches("\\d+")) {<NEW_LINE>total += Integer.parseInt(c);<NEW_LINE>} else {<NEW_LINE>// First non-number we see we can finish as they are sorted<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>int splitCostLength = splitCost.length;<NEW_LINE>// No need to add {total} to the mana cost if total == 0<NEW_LINE>int shift = (total > 0) ? 1 : 0;<NEW_LINE>String[] finalCost = new String[shift + splitCostLength - index];<NEW_LINE>// Account for no colourless mana symbols seen<NEW_LINE>if (total > 0) {<NEW_LINE>finalCost[0] = String.valueOf(total);<NEW_LINE>}<NEW_LINE>System.arraycopy(splitCost, index, <MASK><NEW_LINE>// Combine the cost back as a mana string<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (String s : finalCost) {<NEW_LINE>sb.append('{').append(s).append('}');<NEW_LINE>}<NEW_LINE>// Return the condensed string<NEW_LINE>return sb.toString();<NEW_LINE>}
finalCost, shift, splitCostLength - index);
1,382,560
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>int primaryColor = themeColorUtils.primaryColor(getActivity());<NEW_LINE>mParentFolder = getArguments().getParcelable(ARG_PARENT_FOLDER);<NEW_LINE>// Inflate the layout for the dialog<NEW_LINE>LayoutInflater inflater = requireActivity().getLayoutInflater();<NEW_LINE>EditBoxDialogBinding binding = EditBoxDialogBinding.inflate(inflater, null, false);<NEW_LINE>View view = binding.getRoot();<NEW_LINE>// Setup layout<NEW_LINE>binding.userInput.setText("");<NEW_LINE>binding.userInput.requestFocus();<NEW_LINE>themeTextInputUtils.colorTextInput(binding.userInputContainer, binding.userInput, primaryColor);<NEW_LINE>// Build the dialog<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.setView(view).setPositiveButton(R.string.folder_confirm_create, this).setNeutralButton(R.string.common_cancel, this).<MASK><NEW_LINE>AlertDialog d = builder.create();<NEW_LINE>Window window = d.getWindow();<NEW_LINE>if (window != null) {<NEW_LINE>window.setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);<NEW_LINE>}<NEW_LINE>return d;<NEW_LINE>}
setTitle(R.string.uploader_info_dirname);
1,308,512
private Mono<Response<CheckNameAvailabilityResultInner>> checkNameAvailabilityWithResponseAsync(String resourceGroupName, String namespaceName, CheckNameAvailabilityParameter parameters, 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.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
87,776
private void cmd_zoom() {<NEW_LINE>int M_Lot_ID = 0;<NEW_LINE>KeyNamePair pp = (KeyNamePair) fieldLot.getSelectedItem();<NEW_LINE>if (pp != null)<NEW_LINE>M_Lot_ID = pp.getKey();<NEW_LINE>MQuery zoomQuery = new MQuery("M_Lot");<NEW_LINE>zoomQuery.addRestriction("M_Lot_ID", MQuery.EQUAL, M_Lot_ID);<NEW_LINE>log.info(zoomQuery.toString());<NEW_LINE>//<NEW_LINE>setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>//<NEW_LINE>// Lot<NEW_LINE>int AD_Window_ID = MWindow.getWindow_ID("Lot");<NEW_LINE>AWindow frame = new AWindow();<NEW_LINE>if (frame.initWindow(AD_Window_ID, zoomQuery)) {<NEW_LINE>this.setVisible(false);<NEW_LINE>// otherwise blocked<NEW_LINE>this.setModal(false);<NEW_LINE>this.setVisible(true);<NEW_LINE>AEnv.addToWindowManager(frame);<NEW_LINE>AEnv.showScreen(frame, SwingConstants.EAST);<NEW_LINE>}<NEW_LINE>// async window - not able to get feedback<NEW_LINE>frame = null;<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>}
setCursor(Cursor.getDefaultCursor());
1,566,266
public void testGetNextTimeoutWithActualExpiration() {<NEW_LINE>// 2 minutes<NEW_LINE>Date scheduledEnd = new Date(System.currentTimeMillis() + 2 * 60 * 1000);<NEW_LINE>ScheduleExpression se = new ScheduleExpression();<NEW_LINE>se.hour("*");<NEW_LINE>se.minute("*");<NEW_LINE>se.end(scheduledEnd);<NEW_LINE>svLogger.info("Creating timer with scheduled end = " + scheduledEnd);<NEW_LINE>String info = "verify last timeout with minute(*) and end 2 min later";<NEW_LINE>// (non-persistent)<NEW_LINE>Date firstTimeout = ivBean.createCalTimer(se, info);<NEW_LINE>// rounded up to next second<NEW_LINE>long actualEnd = roundToNextSecond(scheduledEnd);<NEW_LINE>long nextExpectedTimeout = firstTimeout.getTime() + 60 * 1000;<NEW_LINE>long numExpectedTimeouts = ((actualEnd - firstTimeout.getTime()) / (60 * 1000)) + 1;<NEW_LINE>svLogger.info("First timeout = " + firstTimeout + ", expected timeouts = " + numExpectedTimeouts);<NEW_LINE>while (numExpectedTimeouts > 0) {<NEW_LINE>svLogger.info("waiting for timer expiration; up to " + MAX_WAIT_TIME + "ms");<NEW_LINE>ivBean.waitForTimer(MAX_WAIT_TIME);<NEW_LINE>Date nextTimeout = ivBean.getNextTimeoutFromExpiration();<NEW_LINE>String failure = ivBean.getNextTimeoutFailureFromExpiration();<NEW_LINE>svLogger.info(numExpectedTimeouts + ": nextTimeout=" + nextTimeout + ", failure=" + failure);<NEW_LINE>if (numExpectedTimeouts > 1) {<NEW_LINE>assertEquals("timer.getNextTimeout returned unexpected value", nextExpectedTimeout, nextTimeout.getTime());<NEW_LINE>assertNull("timer.getNextTimeout() threw unexpected exception", failure);<NEW_LINE>nextExpectedTimeout += 60 * 1000;<NEW_LINE>} else {<NEW_LINE>assertNull("timer.getNextTimeout returned unexpected value", nextTimeout);<NEW_LINE><MASK><NEW_LINE>// With no more timeouts, timer is considered "expired". Verify that getSchedule() gives the NSOLE:<NEW_LINE>assertEquals("Expected NoSuchObjectLocalException.", "NoSuchObjectLocalException", ivBean.getScheduleString());<NEW_LINE>}<NEW_LINE>--numExpectedTimeouts;<NEW_LINE>}<NEW_LINE>}
assertEquals("timer.getNextTimeout() threw unexpected exception", "NoMoreTimeoutsException", failure);
200,666
public void write(org.apache.thrift.protocol.TProtocol prot, waitForFlush_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetStartRow()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetEndRow()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetFlushID()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>if (struct.isSetMaxLoops()) {<NEW_LINE>optionals.set(6);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetTableName()) {<NEW_LINE>oprot.writeString(struct.tableName);<NEW_LINE>}<NEW_LINE>if (struct.isSetStartRow()) {<NEW_LINE>oprot.writeBinary(struct.startRow);<NEW_LINE>}<NEW_LINE>if (struct.isSetEndRow()) {<NEW_LINE>oprot.writeBinary(struct.endRow);<NEW_LINE>}<NEW_LINE>if (struct.isSetFlushID()) {<NEW_LINE>oprot.writeI64(struct.flushID);<NEW_LINE>}<NEW_LINE>if (struct.isSetMaxLoops()) {<NEW_LINE>oprot.writeI64(struct.maxLoops);<NEW_LINE>}<NEW_LINE>}
oprot.writeBitSet(optionals, 7);
289,732
private static String askForSaveDirectory(DiskManagerFileInfo fileInfo, String message) {<NEW_LINE>// On Windows, Directory dialog doesn't seem to get mouse scroll focus<NEW_LINE>// unless we have a shell.<NEW_LINE>Shell anyShell = Utils.findAnyShell();<NEW_LINE>Shell shell = new Shell(anyShell.getDisplay(), SWT.NO_TRIM);<NEW_LINE>shell.setSize(1, 1);<NEW_LINE>shell.open();<NEW_LINE>DirectoryDialog dDialog = new DirectoryDialog(shell, SWT.SYSTEM_MODAL | SWT.SAVE);<NEW_LINE>File current_dir = fileInfo.getFile(true).getParentFile();<NEW_LINE>if (!current_dir.isDirectory()) {<NEW_LINE>current_dir = fileInfo.getDownloadManager().getSaveLocation();<NEW_LINE>}<NEW_LINE>dDialog.setFilterPath(current_dir.getPath());<NEW_LINE>dDialog.setText(MessageText.getString("FilesView.rename.choose.path.dir"));<NEW_LINE>if (message != null) {<NEW_LINE>dDialog.setMessage(message);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>shell.close();<NEW_LINE>return open;<NEW_LINE>}
String open = dDialog.open();
768,659
// Parameters example: 6 0.5 100<NEW_LINE>public static void main(String[] args) {<NEW_LINE>int vertices = Integer.parseInt(args[0]);<NEW_LINE>double radius = Double.parseDouble(args[1]);<NEW_LINE>int numberOfGraphs = Integer.parseInt(args[2]);<NEW_LINE>List<Exercise30_EuclideanWeightedGraphs.EuclideanEdgeWeightedGraph> randomEuclideanGraphs = new Exercise35_RandomEuclideanEdgeWeightedGraphs().generateRandomEuclideanEdgeWeightedGraphs(numberOfGraphs, vertices, radius);<NEW_LINE>Exercise30_EuclideanWeightedGraphs.EuclideanEdgeWeightedGraph firstEuclideanEdgeWeightedGraph = randomEuclideanGraphs.get(0);<NEW_LINE>firstEuclideanEdgeWeightedGraph.show(-0.1, 1.1, -0.1, 1.1, 0.03);<NEW_LINE>UnionFind unionFind = new UnionFind(vertices);<NEW_LINE>for (int vertex = 0; vertex < vertices; vertex++) {<NEW_LINE>for (Edge edge : firstEuclideanEdgeWeightedGraph.adjacent(vertex)) {<NEW_LINE>int neighbor = edge.other(vertex);<NEW_LINE>unionFind.union(vertex, neighbor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check theory that if "radius" is larger than threshold value SQRT(ln(V) / (Math.PI * V)) then the graph is<NEW_LINE>// almost certainly connected. Otherwise, it is almost certainly disconnected.<NEW_LINE>double thresholdValue = Math.sqrt(Math.log(vertices) / (Math.PI * vertices));<NEW_LINE>StdOut.println(<MASK><NEW_LINE>StdOut.println("Is connected: " + (unionFind.count() == 1));<NEW_LINE>}
"Expected to be connected: " + (radius > thresholdValue));
1,765,992
private void processTransactionTrigger(BlockCapsule newBlock) {<NEW_LINE>List<TransactionCapsule> transactionCapsuleList = newBlock.getTransactions();<NEW_LINE>// need to set eth compatible data from transactionInfoList<NEW_LINE>if (EventPluginLoader.getInstance().isTransactionLogTriggerEthCompatible()) {<NEW_LINE>TransactionInfoList transactionInfoList = TransactionInfoList.newBuilder().build();<NEW_LINE>TransactionInfoList.<MASK><NEW_LINE>try {<NEW_LINE>TransactionRetCapsule result = chainBaseManager.getTransactionRetStore().getTransactionInfoByBlockNum(ByteArray.fromLong(newBlock.getNum()));<NEW_LINE>if (!Objects.isNull(result) && !Objects.isNull(result.getInstance())) {<NEW_LINE>result.getInstance().getTransactioninfoList().forEach(transactionInfoListBuilder::addTransactionInfo);<NEW_LINE>transactionInfoList = transactionInfoListBuilder.build();<NEW_LINE>}<NEW_LINE>} catch (BadItemException e) {<NEW_LINE>logger.error("postBlockTrigger getTransactionInfoList blockNum={}, error is {}", newBlock.getNum(), e.getMessage());<NEW_LINE>}<NEW_LINE>if (transactionCapsuleList.size() == transactionInfoList.getTransactionInfoCount()) {<NEW_LINE>long cumulativeEnergyUsed = 0;<NEW_LINE>long cumulativeLogCount = 0;<NEW_LINE>long energyUnitPrice = chainBaseManager.getDynamicPropertiesStore().getEnergyFee();<NEW_LINE>for (int i = 0; i < transactionCapsuleList.size(); i++) {<NEW_LINE>TransactionInfo transactionInfo = transactionInfoList.getTransactionInfo(i);<NEW_LINE>TransactionCapsule transactionCapsule = transactionCapsuleList.get(i);<NEW_LINE>// reset block num to ignore value is -1<NEW_LINE>transactionCapsule.setBlockNum(newBlock.getNum());<NEW_LINE>cumulativeEnergyUsed += postTransactionTrigger(transactionCapsule, newBlock, i, cumulativeEnergyUsed, cumulativeLogCount, transactionInfo, energyUnitPrice);<NEW_LINE>cumulativeLogCount += transactionInfo.getLogCount();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("postBlockTrigger blockNum={} has no transactions or " + "the sizes of transactionInfoList and transactionCapsuleList are not equal", newBlock.getNum());<NEW_LINE>for (TransactionCapsule e : newBlock.getTransactions()) {<NEW_LINE>postTransactionTrigger(e, newBlock);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (TransactionCapsule e : newBlock.getTransactions()) {<NEW_LINE>postTransactionTrigger(e, newBlock);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Builder transactionInfoListBuilder = TransactionInfoList.newBuilder();
969,980
protected Map<String, Number> readRegisters(long threadOffset) throws IOException {<NEW_LINE>if (!hasVersionBeenDetermined) {<NEW_LINE>calculateThreadStructureSizes(threadOffset);<NEW_LINE>}<NEW_LINE>_fileReader.seek(threadOffset + sizeofThreadEntry64);<NEW_LINE>Map<String, Number> registers = new TreeMap<String, Number>();<NEW_LINE>for (int i = 0; i < GPR_COUNT; i++) registers.put("gpr" + i, Long.valueOf(readLong()));<NEW_LINE>registers.put("msr", Long.valueOf(readLong()));<NEW_LINE>registers.put("iar", Long.valueOf(readLong()));<NEW_LINE>registers.put("lr", Long.valueOf(readLong()));<NEW_LINE>registers.put("ctr", Long.valueOf(readLong()));<NEW_LINE>registers.put("cr", Integer<MASK><NEW_LINE>registers.put("xer", Integer.valueOf(readInt()));<NEW_LINE>registers.put("fpscr", Integer.valueOf(readInt()));<NEW_LINE>return registers;<NEW_LINE>}
.valueOf(readInt()));
1,704,563
private void parseAndSet_trigger(JSONObject jsonObject_trigger, int version) throws IllegalStorageDataException {<NEW_LINE>try {<NEW_LINE>String trigger_type = jsonObject_trigger.getString(C.TYPE);<NEW_LINE>switch(trigger_type) {<NEW_LINE>case C.TriggerType.T_RAW:<NEW_LINE>EventData eventData = parse_eventData(jsonObject_trigger, version);<NEW_LINE>builder.setTmpEvent(eventData);<NEW_LINE>break;<NEW_LINE>case C.TriggerType.T_PRE:<NEW_LINE>String event_name;<NEW_LINE>if (version < C.VERSION_RENAME_SCENARIO_TO_EVENT)<NEW_LINE>event_name = jsonObject_trigger.getString(C.SCENARIO);<NEW_LINE>else<NEW_LINE>event_name = jsonObject_trigger.getString(C.EVENT);<NEW_LINE>EventStructure event = new EventDataStorage(context).get(event_name);<NEW_LINE>builder.setEvent(event);<NEW_LINE>break;<NEW_LINE>case C.TriggerType.T_CONDITION:<NEW_LINE>String condition_name = jsonObject_trigger.getString(C.CONDITION);<NEW_LINE>ConditionStructure condition = new ConditionDataStorage<MASK><NEW_LINE>builder.setCondition(condition);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStorageDataException("Unexpected trigger type");<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new IllegalStorageDataException(e);<NEW_LINE>} catch (RequiredDataNotFoundException e) {<NEW_LINE>throw new IllegalStorageDataException(e);<NEW_LINE>}<NEW_LINE>}
(context).get(condition_name);
1,654,258
public void askDeleteItems(@NonNull final List<Content> contents, @NonNull final List<Group> groups, @Nullable final Runnable onSuccess, @NonNull final SelectExtension<?> selectExtension) {<NEW_LINE>// TODO display the number of books and groups that will be deleted<NEW_LINE>MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);<NEW_LINE>int count = !groups.isEmpty() ? groups.size() : contents.size();<NEW_LINE>String title = getResources().getQuantityString(R.plurals.ask_delete_multiple, count, count);<NEW_LINE>builder.setMessage(title).setPositiveButton(R.string.yes, (dialog, which) -> {<NEW_LINE>selectExtension.deselect(selectExtension.getSelections());<NEW_LINE>viewModel.deleteItems(<MASK><NEW_LINE>}).setNegativeButton(R.string.no, (dialog, which) -> selectExtension.deselect(selectExtension.getSelections())).setOnCancelListener(dialog -> selectExtension.deselect(selectExtension.getSelections())).create().show();<NEW_LINE>}
contents, groups, false, onSuccess);
672,487
private static void updateTranslatedPathIds(Collection<? extends URL> roots, TaggedClassPath tcp, Map<URL, PathIds> pathIdsResult, Map<String, Set<URL>> pathIdToRootsResult) {<NEW_LINE>Set<String> sids = new HashSet<>();<NEW_LINE>Set<String> mimeTypes = new HashSet<>();<NEW_LINE>for (String blid : tcp.getPathIds().getBlids()) {<NEW_LINE>Set<String> ids = PathRecognizerRegistry.getDefault().getSourceIdsForBinaryLibraryId(blid);<NEW_LINE>if (ids != null) {<NEW_LINE>sids.addAll(ids);<NEW_LINE>}<NEW_LINE>Set<String> mts = PathRecognizerRegistry.getDefault().getMimeTypesForBinaryLibraryId(blid);<NEW_LINE>if (mts != null) {<NEW_LINE>mimeTypes.addAll(mts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (URL root : roots) {<NEW_LINE>PathIds pathIds = pathIdsResult.get(root);<NEW_LINE>if (pathIds == null) {<NEW_LINE>pathIds = new PathIds();<NEW_LINE>pathIdsResult.put(root, pathIds);<NEW_LINE>}<NEW_LINE>pathIds.getSids().addAll(sids);<NEW_LINE>pathIds.<MASK><NEW_LINE>for (String id : sids) {<NEW_LINE>Set<URL> rootsWithId = pathIdToRootsResult.get(id);<NEW_LINE>if (rootsWithId == null) {<NEW_LINE>rootsWithId = new HashSet<>();<NEW_LINE>pathIdToRootsResult.put(id, rootsWithId);<NEW_LINE>}<NEW_LINE>rootsWithId.add(root);<NEW_LINE>}<NEW_LINE>if (LOGGER.isLoggable(Level.FINE)) {<NEW_LINE>LOGGER.log(Level.FINE, "Root {0} associated with {1}", new Object[] { root, tcp.getPathIds() });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getMimeTypes().addAll(mimeTypes);
408,288
public MaterializationKey defineMaterialization(final CalciteSchema schema, TileKey tileKey, String viewSql, List<String> viewSchemaPath, String suggestedTableName, TableFactory tableFactory, boolean create, boolean existing) {<NEW_LINE>final MaterializationActor.QueryKey queryKey = new MaterializationActor.QueryKey(viewSql, schema, viewSchemaPath);<NEW_LINE>final MaterializationKey existingKey = actor.keyBySql.get(queryKey);<NEW_LINE>if (existingKey != null) {<NEW_LINE>return existingKey;<NEW_LINE>}<NEW_LINE>if (!create) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final CalciteConnection connection = CalciteMetaImpl.connect(schema.root(), null);<NEW_LINE>CalciteSchema.TableEntry tableEntry;<NEW_LINE>// If the user says the materialization exists, first try to find a table<NEW_LINE>// with the name and if none can be found, lookup a view in the schema<NEW_LINE>if (existing) {<NEW_LINE>tableEntry = schema.getTable(suggestedTableName, true);<NEW_LINE>if (tableEntry == null) {<NEW_LINE>tableEntry = schema.getTableBasedOnNullaryFunction(suggestedTableName, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tableEntry = null;<NEW_LINE>}<NEW_LINE>if (tableEntry == null) {<NEW_LINE>tableEntry = schema.getTableBySql(viewSql);<NEW_LINE>}<NEW_LINE>RelDataType rowType = null;<NEW_LINE>if (tableEntry == null) {<NEW_LINE>Table table = tableFactory.createTable(schema, viewSql, viewSchemaPath);<NEW_LINE>final String tableName = Schemas.uniqueTableName(schema, Util.first(suggestedTableName, "m"));<NEW_LINE>tableEntry = schema.add(tableName, table, ImmutableList.of(viewSql));<NEW_LINE>Hook.CREATE_MATERIALIZATION.run(tableName);<NEW_LINE>rowType = table.getRowType(connection.getTypeFactory());<NEW_LINE>}<NEW_LINE>if (rowType == null) {<NEW_LINE>// If we didn't validate the SQL by populating a table, validate it now.<NEW_LINE>final CalcitePrepare.ParseResult parse = Schemas.parse(connection, schema, viewSchemaPath, viewSql);<NEW_LINE>rowType = parse.rowType;<NEW_LINE>}<NEW_LINE>final MaterializationKey key = new MaterializationKey();<NEW_LINE>final MaterializationActor.Materialization materialization = new MaterializationActor.Materialization(key, schema.root(), tableEntry, viewSql, rowType, viewSchemaPath);<NEW_LINE>actor.keyMap.put(materialization.key, materialization);<NEW_LINE>actor.keyBySql.<MASK><NEW_LINE>if (tileKey != null) {<NEW_LINE>actor.keyByTile.put(tileKey, materialization.key);<NEW_LINE>}<NEW_LINE>return key;<NEW_LINE>}
put(queryKey, materialization.key);
634,857
public void readAdditional(CompoundNBT compound) {<NEW_LINE>this.thrower = null;<NEW_LINE>if (compound.contains(THROWER_NBT, NBTtypesMBE.COMPOUND_NBT_ID)) {<NEW_LINE>this.throwerUUID = NBTUtil.readUniqueId(compound.getCompound(THROWER_NBT));<NEW_LINE>}<NEW_LINE>boolean isInFlight = compound.getBoolean(IN_FLIGHT_NBT);<NEW_LINE>this.dataManager.set(IN_FLIGHT_DMP, isInFlight);<NEW_LINE>pickupDelay = compound.getInt(PICKUP_DELAY_NBT);<NEW_LINE>ticksSpentInFlight = compound.getInt(TICKS_IN_FLIGHT_NBT);<NEW_LINE>ticksSpentNotInFlight = compound.getInt(TICKS_NOT_IN_FLIGHT_NBT);<NEW_LINE>boomerangFlightPath.deserializeNBT<MASK><NEW_LINE>CompoundNBT compoundnbt = compound.getCompound(ITEMSTACK_NBT);<NEW_LINE>ItemStack boomerangItemStack = ItemStack.read(compoundnbt);<NEW_LINE>this.setItemStack(boomerangItemStack);<NEW_LINE>if (this.getItemStack().isEmpty()) {<NEW_LINE>this.remove();<NEW_LINE>}<NEW_LINE>rightHandThrown = compound.getBoolean(RIGHT_HAND_THROWN_NBT);<NEW_LINE>damage = compound.getDouble(DAMAGE_NBT);<NEW_LINE>this.dataManager.set(MOMENTUM_DMP, compound.getFloat(MOMENTUM_NBT));<NEW_LINE>copyEnchantmentData(boomerangItemStack);<NEW_LINE>}
(compound.getCompound(FLIGHT_PATH_NBT));
1,787,027
private static void fetchThreadPoolMetrics(long now, MBeanServer mbs, List<Metric> metrics) throws JMException {<NEW_LINE>final <MASK><NEW_LINE>final Set<ObjectName> names = mbs.queryNames(threadPoolName, null);<NEW_LINE>if (names == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (ObjectName name : names) {<NEW_LINE>AttributeList list = mbs.getAttributes(name, THREAD_POOL_ATTRS);<NEW_LINE>// determine whether the shared threadPool is used<NEW_LINE>boolean isUsed = true;<NEW_LINE>for (Attribute a : list.asList()) {<NEW_LINE>if (a.getName().equals("maxThreads")) {<NEW_LINE>Number v = (Number) a.getValue();<NEW_LINE>isUsed = v.doubleValue() >= 0.0;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isUsed) {<NEW_LINE>// only add the attributes if the metric is used.<NEW_LINE>for (Attribute a : list.asList()) {<NEW_LINE>addMetric(metrics, toGauge(now, name, a));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ObjectName threadPoolName = new ObjectName("Catalina:type=ThreadPool,*");
560,773
public boolean isCached(RequestAuthenticator authenticator) {<NEW_LINE>logger.debug("Checking if {} is cached", authenticator);<NEW_LINE>SecurityContext context = SecurityContextHolder.getContext();<NEW_LINE>KeycloakAuthenticationToken token;<NEW_LINE>KeycloakSecurityContext keycloakSecurityContext;<NEW_LINE>if (context == null || context.getAuthentication() == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!KeycloakAuthenticationToken.class.isAssignableFrom(context.getAuthentication().getClass())) {<NEW_LINE>logger.warn("Expected a KeycloakAuthenticationToken, but found {}", context.getAuthentication());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>logger.debug("Remote logged in already. Establishing state from security context.");<NEW_LINE>token = (KeycloakAuthenticationToken) context.getAuthentication();<NEW_LINE>keycloakSecurityContext = token<MASK><NEW_LINE>if (!deployment.getRealm().equals(keycloakSecurityContext.getRealm())) {<NEW_LINE>logger.debug("Account from security context is from a different realm than for the request.");<NEW_LINE>logout();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (keycloakSecurityContext.getToken().isExpired()) {<NEW_LINE>logger.warn("Security token expired ... not returning from cache");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>request.setAttribute(KeycloakSecurityContext.class.getName(), keycloakSecurityContext);<NEW_LINE>return true;<NEW_LINE>}
.getAccount().getKeycloakSecurityContext();
723,698
// beforeSave<NEW_LINE>@Override<NEW_LINE>protected boolean afterSave(boolean newRecord, boolean success) {<NEW_LINE>if (!success)<NEW_LINE>return success;<NEW_LINE>if (newRecord) {<NEW_LINE>StringBuffer sb = new StringBuffer("INSERT INTO AD_TreeNodeCMM " + "(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, " + "AD_Tree_ID, Node_ID, Parent_ID, SeqNo) " + "VALUES (").append(getAD_Client_ID()).append(",0, 'Y', now(), 0, now(), 0,").append(getAD_Tree_ID()).append(",").append(get_ID()).append(", 0, 999)");<NEW_LINE>int no = DB.executeUpdate(sb.toString(), get_TrxName());<NEW_LINE>if (no > 0)<NEW_LINE>log.<MASK><NEW_LINE>else<NEW_LINE>log.warn("#" + no + " - TreeType=CMM");<NEW_LINE>return no > 0;<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
debug("#" + no + " - TreeType=CMM");
419,869
private void clipCycles(ReadClipperWithData clipper) {<NEW_LINE>if (cyclesToClip != null) {<NEW_LINE>GATKRead read = clipper.getRead();<NEW_LINE>ClippingData data = clipper.getData();<NEW_LINE>for (Pair<Integer, Integer> p : cyclesToClip) {<NEW_LINE>// iterate over each cycle range<NEW_LINE>int cycleStart = p.getLeft();<NEW_LINE>int cycleStop = p.getRight();<NEW_LINE>if (cycleStart < read.getLength()) {<NEW_LINE>// only try to clip if the cycleStart is less than the read's length<NEW_LINE>if (cycleStop >= read.getLength())<NEW_LINE>// we do tolerate [for convenience) clipping when the stop is beyond the end of the read<NEW_LINE>cycleStop = read.getLength() - 1;<NEW_LINE>Pair<Integer, Integer> startStop = strandAwarePositions(read, cycleStart, cycleStop);<NEW_LINE>int start = startStop.getLeft();<NEW_LINE><MASK><NEW_LINE>// ClippingOp op = new ClippingOp(ClippingOp.ClippingType.WITHIN_CLIP_RANGE, start, stop, null);<NEW_LINE>ClippingOp op = new ClippingOp(start, stop);<NEW_LINE>clipper.addOp(op);<NEW_LINE>data.incNRangeClippedBases(op.getLength());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clipper.setData(data);<NEW_LINE>}<NEW_LINE>}
int stop = startStop.getRight();
1,542,096
void write() throws IOException, ConfigurationException {<NEW_LINE>// Clear the configuration before saving to drop preferences which are unused anymore<NEW_LINE>configuration.clear();<NEW_LINE>// Get opened main frames list<NEW_LINE>List<MainFrame> mainFrames = WindowManager.getMainFrames();<NEW_LINE>// Save windows count<NEW_LINE><MASK><NEW_LINE>configuration.setVariable(WINDOWS_COUNT, nbMainFrames);<NEW_LINE>// Save the index of the selected window<NEW_LINE>int indexOfSelectedWindow = WindowManager.getCurrentWindowIndex();<NEW_LINE>configuration.setVariable(WINDOWS_SELECTION, indexOfSelectedWindow);<NEW_LINE>// Save attributes for each window<NEW_LINE>for (int i = 0; i < nbMainFrames; ++i) setFrameAttributes(mainFrames.get(i), i);<NEW_LINE>if (screenSize != null) {<NEW_LINE>configuration.setVariable(MuSnapshot.SCREEN_WIDTH, screenSize.width);<NEW_LINE>configuration.setVariable(MuSnapshot.SCREEN_HEIGHT, screenSize.height);<NEW_LINE>}<NEW_LINE>setGlobalHistory();<NEW_LINE>for (MuSnapshotable handler : snapshotables) {<NEW_LINE>handler.write(configuration);<NEW_LINE>}<NEW_LINE>configuration.write();<NEW_LINE>}
int nbMainFrames = mainFrames.size();
524,356
final UpdateUserHierarchyStructureResult executeUpdateUserHierarchyStructure(UpdateUserHierarchyStructureRequest updateUserHierarchyStructureRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserHierarchyStructureRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserHierarchyStructureRequest> request = null;<NEW_LINE>Response<UpdateUserHierarchyStructureResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserHierarchyStructureRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserHierarchyStructureRequest));<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, "UpdateUserHierarchyStructure");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserHierarchyStructureResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserHierarchyStructureResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
73,399
public static String relativePath(IPath fullPath, int skipSegmentCount) {<NEW_LINE>boolean hasTrailingSeparator = fullPath.hasTrailingSeparator();<NEW_LINE>String[<MASK><NEW_LINE>// compute length<NEW_LINE>int length = 0;<NEW_LINE>int max = segments.length;<NEW_LINE>if (max > skipSegmentCount) {<NEW_LINE>for (int i1 = skipSegmentCount; i1 < max; i1++) {<NEW_LINE>length += segments[i1].length();<NEW_LINE>}<NEW_LINE>// add the separator lengths<NEW_LINE>length += max - skipSegmentCount - 1;<NEW_LINE>}<NEW_LINE>if (hasTrailingSeparator)<NEW_LINE>length++;<NEW_LINE>char[] result = new char[length];<NEW_LINE>int offset = 0;<NEW_LINE>int len = segments.length - 1;<NEW_LINE>if (len >= skipSegmentCount) {<NEW_LINE>// append all but the last segment, with separators<NEW_LINE>for (int i = skipSegmentCount; i < len; i++) {<NEW_LINE>int size = segments[i].length();<NEW_LINE>segments[i].getChars(0, size, result, offset);<NEW_LINE>offset += size;<NEW_LINE>result[offset++] = '/';<NEW_LINE>}<NEW_LINE>// append the last segment<NEW_LINE>int size = segments[len].length();<NEW_LINE>segments[len].getChars(0, size, result, offset);<NEW_LINE>offset += size;<NEW_LINE>}<NEW_LINE>if (hasTrailingSeparator)<NEW_LINE>result[offset++] = '/';<NEW_LINE>return new String(result);<NEW_LINE>}
] segments = fullPath.segments();
627,251
public Inventory createInventoryHeader(@NonNull final InventoryHeaderCreateRequest request) {<NEW_LINE>final I_M_Inventory inventoryRecord = newInstance(I_M_Inventory.class);<NEW_LINE>inventoryRecord.setAD_Org_ID(request.getOrgId().getRepoId());<NEW_LINE>inventoryRecord.setDocStatus(DocStatus.Drafted.getCode());<NEW_LINE>inventoryRecord.setDocAction(IDocument.ACTION_Complete);<NEW_LINE>inventoryRecord.setMovementDate(TimeUtil.asTimestamp(request.getMovementDate()));<NEW_LINE>inventoryRecord.setM_Warehouse_ID(request.getWarehouseId().getRepoId());<NEW_LINE>inventoryRecord.setC_Activity_ID(ActivityId.toRepoId(request.getActivityId()));<NEW_LINE>inventoryRecord.setDescription(StringUtils.trimBlankToNull<MASK><NEW_LINE>if (request.getDocTypeId() != null) {<NEW_LINE>inventoryRecord.setC_DocType_ID(request.getDocTypeId().getRepoId());<NEW_LINE>}<NEW_LINE>inventoryRecord.setPOReference(request.getPoReference());<NEW_LINE>saveRecord(inventoryRecord);<NEW_LINE>return toInventory(inventoryRecord);<NEW_LINE>}
(request.getDescription()));
1,506,694
private Optional<Integer> toInteger(ParserRuleContext messageCtx, Named_icmp_typeContext ctx) {<NEW_LINE>if (ctx.DESTINATION_UNREACHABLE() != null) {<NEW_LINE>return Optional.of(IcmpType.DESTINATION_UNREACHABLE);<NEW_LINE>} else if (ctx.ECHO_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.ECHO_REPLY);<NEW_LINE>} else if (ctx.ECHO_REQUEST() != null) {<NEW_LINE>return Optional.of(IcmpType.ECHO_REQUEST);<NEW_LINE>} else if (ctx.INFO_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.INFO_REPLY);<NEW_LINE>} else if (ctx.INFO_REQUEST() != null) {<NEW_LINE>return Optional.of(IcmpType.INFO_REQUEST);<NEW_LINE>} else if (ctx.PARAMETER_PROBLEM() != null) {<NEW_LINE>return Optional.of(IcmpType.PARAMETER_PROBLEM);<NEW_LINE>} else if (ctx.REDIRECT() != null) {<NEW_LINE>return Optional.of(IcmpType.REDIRECT_MESSAGE);<NEW_LINE>} else if (ctx.ROUTER_ADVERTISEMENT() != null) {<NEW_LINE>return Optional.of(IcmpType.ROUTER_ADVERTISEMENT);<NEW_LINE>} else if (ctx.ROUTER_SOLICIT() != null) {<NEW_LINE>return Optional.of(IcmpType.ROUTER_SOLICITATION);<NEW_LINE>} else if (ctx.SOURCE_QUENCH() != null) {<NEW_LINE>return Optional.of(IcmpType.SOURCE_QUENCH);<NEW_LINE>} else if (ctx.TIME_EXCEEDED() != null) {<NEW_LINE>return Optional.of(IcmpType.TIME_EXCEEDED);<NEW_LINE>} else if (ctx.TIMESTAMP() != null) {<NEW_LINE>return Optional.of(IcmpType.TIMESTAMP_REQUEST);<NEW_LINE>} else if (ctx.TIMESTAMP_REPLY() != null) {<NEW_LINE>return Optional.of(IcmpType.TIMESTAMP_REPLY);<NEW_LINE>} else if (ctx.UNREACHABLE() != null) {<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>warn(messageCtx, String.format("Missing mapping for icmp-type: '%s'", ctx.getText()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
Optional.of(IcmpType.DESTINATION_UNREACHABLE);
709,097
public <T> boolean tryExecute(Class<T> remoteInterface, T object, ExecutorService executorService, long timeout, TimeUnit timeUnit) throws InterruptedException {<NEW_LINE>String requestQueueName = getRequestQueueName(remoteInterface);<NEW_LINE>RBlockingQueue<String> requestQueue = getBlockingQueue(requestQueueName, StringCodec.INSTANCE);<NEW_LINE>String requestId = <MASK><NEW_LINE>if (requestId == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>RMap<String, RemoteServiceRequest> tasks = getMap(((RedissonObject) requestQueue).getRawName() + ":tasks");<NEW_LINE>RFuture<RemoteServiceRequest> taskFuture = getTask(requestId, tasks);<NEW_LINE>RemoteServiceRequest request = commandExecutor.getInterrupted(taskFuture);<NEW_LINE>if (request == null) {<NEW_LINE>throw new IllegalStateException("Task can't be found for request: " + requestId);<NEW_LINE>}<NEW_LINE>RFuture<RRemoteServiceResponse> r = executeMethod(remoteInterface, requestQueue, executorService, request, object);<NEW_LINE>commandExecutor.getInterrupted(r);<NEW_LINE>return true;<NEW_LINE>}
requestQueue.poll(timeout, timeUnit);
351,288
final ListMobileDeviceAccessOverridesResult executeListMobileDeviceAccessOverrides(ListMobileDeviceAccessOverridesRequest listMobileDeviceAccessOverridesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMobileDeviceAccessOverridesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListMobileDeviceAccessOverridesRequest> request = null;<NEW_LINE>Response<ListMobileDeviceAccessOverridesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListMobileDeviceAccessOverridesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMobileDeviceAccessOverridesRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMobileDeviceAccessOverrides");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMobileDeviceAccessOverridesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMobileDeviceAccessOverridesResultJsonUnmarshaller());<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.SERVICE_ID, "WorkMail");
1,715,352
public void visit(BIRBasicBlock birBasicBlock) {<NEW_LINE>// Name of the basic block<NEW_LINE>addCpAndWriteString(birBasicBlock.id.value);<NEW_LINE>// Number of instructions<NEW_LINE>// Adding the terminator instruction as well.<NEW_LINE>buf.writeInt(birBasicBlock.instructions.size() + 1);<NEW_LINE>birBasicBlock.instructions.forEach(instruction -> {<NEW_LINE>// write pos and kind<NEW_LINE>writePosition(instruction.pos);<NEW_LINE>writeScopes(instruction);<NEW_LINE>buf.writeByte(<MASK><NEW_LINE>// write instruction<NEW_LINE>instruction.accept(this);<NEW_LINE>});<NEW_LINE>BIRTerminator terminator = birBasicBlock.terminator;<NEW_LINE>if (terminator == null) {<NEW_LINE>throw new BLangCompilerException("Basic block without a terminator : " + birBasicBlock.id);<NEW_LINE>}<NEW_LINE>// write pos and kind<NEW_LINE>writePosition(terminator.pos);<NEW_LINE>writeScope(terminator);<NEW_LINE>buf.writeByte(terminator.kind.getValue());<NEW_LINE>// write instruction<NEW_LINE>terminator.accept(this);<NEW_LINE>}
instruction.kind.getValue());
1,541,162
static app.freerouting.board.FixedState calc_fixed(Scanner p_scanner) {<NEW_LINE>try {<NEW_LINE>app.freerouting.board.FixedState result = app.freerouting.board.FixedState.UNFIXED;<NEW_LINE>Object next_token = p_scanner.next_token();<NEW_LINE>if (next_token == SHOVE_FIXED) {<NEW_LINE>result = app.freerouting.board.FixedState.SHOVE_FIXED;<NEW_LINE>} else if (next_token == FIX) {<NEW_LINE>result = app.freerouting.board.FixedState.SYSTEM_FIXED;<NEW_LINE>} else if (next_token != NORMAL) {<NEW_LINE>result = app.freerouting.board.FixedState.USER_FIXED;<NEW_LINE>}<NEW_LINE>next_token = p_scanner.next_token();<NEW_LINE>if (next_token != CLOSED_BRACKET) {<NEW_LINE>FRLogger.warn("Wiring.is_fixed: ) expected");<NEW_LINE>return app<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>FRLogger.error("Wiring.is_fixed: IO error scanning file", e);<NEW_LINE>return app.freerouting.board.FixedState.UNFIXED;<NEW_LINE>}<NEW_LINE>}
.freerouting.board.FixedState.UNFIXED;
1,804,777
public void createProcessInstanceIdentityLinkComment(ExecutionEntity processInstance, String userId, String groupId, String type, boolean create, boolean forceNullUserId) {<NEW_LINE>if (isHistoryLevelAtLeast(HistoryLevel.AUDIT, processInstance.getProcessDefinitionId())) {<NEW_LINE>String authenticatedUserId = Authentication.getAuthenticatedUserId();<NEW_LINE>CommentEntity comment = getCommentEntityManager().create();<NEW_LINE>comment.setUserId(authenticatedUserId);<NEW_LINE>comment.setType(CommentEntity.TYPE_EVENT);<NEW_LINE>comment.setTime(getClock().getCurrentTime());<NEW_LINE>comment.setProcessInstanceId(processInstance.getId());<NEW_LINE>if (userId != null || forceNullUserId) {<NEW_LINE>if (create && !forceNullUserId) {<NEW_LINE>comment.setAction(Event.ACTION_ADD_USER_LINK);<NEW_LINE>} else {<NEW_LINE>comment.setAction(Event.ACTION_DELETE_USER_LINK);<NEW_LINE>}<NEW_LINE>comment.setMessage(new String<MASK><NEW_LINE>} else {<NEW_LINE>if (create) {<NEW_LINE>comment.setAction(Event.ACTION_ADD_GROUP_LINK);<NEW_LINE>} else {<NEW_LINE>comment.setAction(Event.ACTION_DELETE_GROUP_LINK);<NEW_LINE>}<NEW_LINE>comment.setMessage(new String[] { groupId, type });<NEW_LINE>}<NEW_LINE>getCommentEntityManager().insert(comment);<NEW_LINE>}<NEW_LINE>}
[] { userId, type });
604,924
public SimulatePrincipalPolicyResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>SimulatePrincipalPolicyResult simulatePrincipalPolicyResult = new SimulatePrincipalPolicyResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return simulatePrincipalPolicyResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("EvaluationResults", targetDepth)) {<NEW_LINE>simulatePrincipalPolicyResult.withEvaluationResults(new ArrayList<EvaluationResult>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("EvaluationResults/member", targetDepth)) {<NEW_LINE>simulatePrincipalPolicyResult.withEvaluationResults(EvaluationResultStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("IsTruncated", targetDepth)) {<NEW_LINE>simulatePrincipalPolicyResult.setIsTruncated(BooleanStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>simulatePrincipalPolicyResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return simulatePrincipalPolicyResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,040,802
ArrayList<Object> new84() /* reduce ADeclaration */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PDeclaration pdeclarationNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>PJimpleType pjimpletypeNode2;<NEW_LINE>PLocalNameList plocalnamelistNode3;<NEW_LINE>TSemicolon tsemicolonNode4;<NEW_LINE>pjimpletypeNode2 = (<MASK><NEW_LINE>plocalnamelistNode3 = (PLocalNameList) nodeArrayList2.get(0);<NEW_LINE>tsemicolonNode4 = (TSemicolon) nodeArrayList3.get(0);<NEW_LINE>pdeclarationNode1 = new ADeclaration(pjimpletypeNode2, plocalnamelistNode3, tsemicolonNode4);<NEW_LINE>}<NEW_LINE>nodeList.add(pdeclarationNode1);<NEW_LINE>return nodeList;<NEW_LINE>}
PJimpleType) nodeArrayList1.get(0);
1,757,410
private static void walkAndSolve(ObjectNode n, ObjectNode root, OpenAPI oas) {<NEW_LINE>if (n.has("$ref")) {<NEW_LINE><MASK><NEW_LINE>} else if (n.has("allOf")) {<NEW_LINE>for (JsonNode jsonNode : n.get("allOf")) {<NEW_LINE>// We assert that parser validated allOf as array of objects<NEW_LINE>walkAndSolve((ObjectNode) jsonNode, root, oas);<NEW_LINE>}<NEW_LINE>} else if (n.has("anyOf")) {<NEW_LINE>for (JsonNode jsonNode : n.get("anyOf")) {<NEW_LINE>walkAndSolve((ObjectNode) jsonNode, root, oas);<NEW_LINE>}<NEW_LINE>} else if (n.has("oneOf")) {<NEW_LINE>for (JsonNode jsonNode : n.get("oneOf")) {<NEW_LINE>walkAndSolve((ObjectNode) jsonNode, root, oas);<NEW_LINE>}<NEW_LINE>} else if (n.has("properties")) {<NEW_LINE>ObjectNode properties = (ObjectNode) n.get("properties");<NEW_LINE>Iterator<String> it = properties.fieldNames();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>walkAndSolve((ObjectNode) properties.get(it.next()), root, oas);<NEW_LINE>}<NEW_LINE>} else if (n.has("items")) {<NEW_LINE>walkAndSolve((ObjectNode) n.get("items"), root, oas);<NEW_LINE>} else if (n.has("additionalProperties")) {<NEW_LINE>JsonNode jsonNode = n.get("additionalProperties");<NEW_LINE>if (jsonNode.getNodeType().equals(JsonNodeType.OBJECT)) {<NEW_LINE>walkAndSolve((ObjectNode) n.get("additionalProperties"), root, oas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
replaceRef(n, root, oas);
564,467
public void joinChatRoom(String chatRoomName, ChatRoomProviderWrapper chatRoomProvider) {<NEW_LINE>OperationSetMultiUserChat groupChatOpSet = chatRoomProvider.getProtocolProvider().getOperationSet(OperationSetMultiUserChat.class);<NEW_LINE>ChatRoom chatRoom = null;<NEW_LINE>try {<NEW_LINE>chatRoom = groupChatOpSet.findRoom(chatRoomName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>if (chatRoom != null) {<NEW_LINE>ChatRoomWrapper chatRoomWrapper = chatRoomList.findChatRoomWrapperFromChatRoom(chatRoom);<NEW_LINE>if (chatRoomWrapper == null) {<NEW_LINE>ChatRoomProviderWrapper parentProvider = chatRoomList.findServerWrapperFromProvider(chatRoom.getParentProvider());<NEW_LINE>chatRoomWrapper = new ChatRoomWrapperImpl(parentProvider, chatRoom);<NEW_LINE>chatRoomList.addChatRoom(chatRoomWrapper);<NEW_LINE>fireChatRoomListChangedEvent(chatRoomWrapper, ChatRoomListChangeEvent.CHAT_ROOM_ADDED);<NEW_LINE>}<NEW_LINE>joinChatRoom(chatRoomWrapper);<NEW_LINE>} else<NEW_LINE>MUCActivator.getAlertUIService().showAlertDialog(MUCActivator.getResources().getI18NString("service.gui.ERROR"), MUCActivator.getResources().getI18NString("service.gui.CHAT_ROOM_NOT_EXIST", new String[] { chatRoomName, chatRoomProvider.getProtocolProvider().getAccountID().getService() }));<NEW_LINE>}
trace("Un exception occurred while searching for room:" + chatRoomName, e);
1,503,296
public StockMove generateStockMove(Inventory inventory, boolean isEnteringStock) throws AxelorException {<NEW_LINE>StockLocation toStockLocation;<NEW_LINE>StockLocation fromStockLocation;<NEW_LINE>Company company = inventory.getCompany();<NEW_LINE>if (isEnteringStock) {<NEW_LINE>toStockLocation = inventory.getStockLocation();<NEW_LINE>fromStockLocation = stockConfigService.getInventoryVirtualStockLocation(stockConfigService.getStockConfig(company));<NEW_LINE>} else {<NEW_LINE>toStockLocation = stockConfigService.getInventoryVirtualStockLocation(stockConfigService.getStockConfig(company));<NEW_LINE>fromStockLocation = inventory.getStockLocation();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>LocalDate inventoryDate = inventory.getPlannedStartDateT().toLocalDate();<NEW_LINE>LocalDate realDate = inventory.getValidatedOn();<NEW_LINE>StockMove stockMove = stockMoveService.createStockMove(null, null, company, fromStockLocation, toStockLocation, realDate, inventoryDate, null, StockMoveRepository.TYPE_INTERNAL);<NEW_LINE>stockMove.setName(inventorySeq);<NEW_LINE>stockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_INVENTORY);<NEW_LINE>stockMove.setOriginId(inventory.getId());<NEW_LINE>stockMove.setOrigin(inventorySeq);<NEW_LINE>for (InventoryLine inventoryLine : inventory.getInventoryLineList()) {<NEW_LINE>generateStockMoveLines(inventoryLine, stockMove, isEnteringStock);<NEW_LINE>}<NEW_LINE>if (stockMove.getStockMoveLineList() != null && !stockMove.getStockMoveLineList().isEmpty()) {<NEW_LINE>stockMoveService.plan(stockMove);<NEW_LINE>stockMoveService.copyQtyToRealQty(stockMove);<NEW_LINE>stockMoveService.realize(stockMove, false);<NEW_LINE>}<NEW_LINE>return stockMove;<NEW_LINE>}
String inventorySeq = inventory.getInventorySeq();
1,630,479
public ListInfrastructureConfigurationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListInfrastructureConfigurationsResult listInfrastructureConfigurationsResult = new ListInfrastructureConfigurationsResult();<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 listInfrastructureConfigurationsResult;<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("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listInfrastructureConfigurationsResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("infrastructureConfigurationSummaryList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listInfrastructureConfigurationsResult.setInfrastructureConfigurationSummaryList(new ListUnmarshaller<InfrastructureConfigurationSummary>(InfrastructureConfigurationSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listInfrastructureConfigurationsResult.setNextToken(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 listInfrastructureConfigurationsResult;<NEW_LINE>}
class).unmarshall(context));
1,086,718
public static SourceMapping parse(String contents, SourceMapSupplier supplier) throws SourceMapParseException {<NEW_LINE>// Version 1, starts with a magic string<NEW_LINE>if (contents.startsWith("/** Begin line maps. **/")) {<NEW_LINE>throw new SourceMapParseException("This appears to be a V1 SourceMap, which is not supported.");<NEW_LINE>} else if (contents.startsWith("{")) {<NEW_LINE>SourceMapObject sourceMapObject = SourceMapObjectParser.parse(contents);<NEW_LINE>// Check basic assertions about the format.<NEW_LINE>switch(sourceMapObject.getVersion()) {<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>SourceMapConsumerV3 consumer = new SourceMapConsumerV3();<NEW_LINE><MASK><NEW_LINE>return consumer;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new SourceMapParseException("Unknown source map version:" + sourceMapObject.getVersion());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SourceMapParseException("unable to detect source map format");<NEW_LINE>}
consumer.parse(sourceMapObject, supplier);
314,187
private void initFields() {<NEW_LINE>System.out.println(getClass().getSimpleName() + ": Init Fields...");<NEW_LINE>List<?> fieldNodes = fields.selectNodes("//dataroot/Fields");<NEW_LINE>for (Object o : fieldNodes) {<NEW_LINE>Node node = (Node) o;<NEW_LINE>String tag = getSingleNodeTextSafe(node, "Tag");<NEW_LINE>String fieldName = getSingleNodeTextSafe(node, "FieldName");<NEW_LINE>System.out.println("\t " + fieldName + "(" + tag + ")");<NEW_LINE>String type = getSingleNodeTextSafe(node, "Type");<NEW_LINE>String desc = getSingleNodeTextSafe(node, "Desc");<NEW_LINE>String notReqXML = getSingleNodeTextSafe(node, "NotReqXML");<NEW_LINE>Field field = new Field(tag, <MASK><NEW_LINE>allFields.put(field.getTag(), field);<NEW_LINE>// Find enums<NEW_LINE>List<?> enumNodes = enums.selectNodes("//dataroot/Enums[Tag=" + tag + "]");<NEW_LINE>enumNodes.sort(new EnumNodeComparator());<NEW_LINE>if (!enumNodes.isEmpty()) {<NEW_LINE>for (Object enumO : enumNodes) {<NEW_LINE>Node enumNode = (Node) enumO;<NEW_LINE>String enumName = getSingleNodeTextSafe(enumNode, "Enum");<NEW_LINE>System.out.println("\t\t " + enumName);<NEW_LINE>String enumDesc = getSingleNodeTextSafe(enumNode, "Description");<NEW_LINE>field.addEnum(new Enum(enumName, enumDesc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(getClass().getSimpleName() + ": " + allFields.size() + " Fields found");<NEW_LINE>}
fieldName, type, desc, notReqXML);
392,275
public static void convolveBorder(GrayF64 integral, IntegralKernel kernel, GrayF64 output, int borderX, int borderY) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, integral.width, x -> {<NEW_LINE>for (int x = 0; x < integral.width; x++) {<NEW_LINE>for (int y = 0; y < borderY; y++) {<NEW_LINE>double total = 0;<NEW_LINE>for (int i = 0; i < kernel.blocks.length; i++) {<NEW_LINE>ImageRectangle b = kernel.blocks[i];<NEW_LINE>total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];<NEW_LINE>}<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>for (int y = integral.height - borderY; y < integral.height; y++) {<NEW_LINE>double total = 0;<NEW_LINE>for (int i = 0; i < kernel.blocks.length; i++) {<NEW_LINE>ImageRectangle b = kernel.blocks[i];<NEW_LINE>total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];<NEW_LINE>}<NEW_LINE>output.set(x, y, total);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>int endY = integral.height - borderY;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(borderY, endY, y -> {<NEW_LINE>for (int y = borderY; y < endY; y++) {<NEW_LINE>for (int x = 0; x < borderX; x++) {<NEW_LINE>double total = 0;<NEW_LINE>for (int i = 0; i < kernel.blocks.length; i++) {<NEW_LINE>ImageRectangle b = kernel.blocks[i];<NEW_LINE>total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];<NEW_LINE>}<NEW_LINE>output.set(x, y, total);<NEW_LINE>}<NEW_LINE>for (int x = integral.width - borderX; x < integral.width; x++) {<NEW_LINE>double total = 0;<NEW_LINE>for (int i = 0; i < kernel.blocks.length; i++) {<NEW_LINE>ImageRectangle b = kernel.blocks[i];<NEW_LINE>total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];<NEW_LINE>}<NEW_LINE>output.set(x, y, total);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
set(x, y, total);
410,718
public void parseTasklet(Element stepElement, Element taskletElement, AbstractBeanDefinition bd, ParserContext parserContext, boolean stepUnderspecified) {<NEW_LINE>bd.setBeanClass(StepParserStepFactoryBean.class);<NEW_LINE>bd.setAttribute("isNamespaceStep", true);<NEW_LINE>String <MASK><NEW_LINE>String taskletMethod = taskletElement.getAttribute(TASKLET_METHOD_ATTR);<NEW_LINE>List<Element> chunkElements = DomUtils.getChildElementsByTagName(taskletElement, CHUNK_ELE);<NEW_LINE>List<Element> beanElements = DomUtils.getChildElementsByTagName(taskletElement, BEAN_ELE);<NEW_LINE>List<Element> refElements = DomUtils.getChildElementsByTagName(taskletElement, REF_ELE);<NEW_LINE>validateTaskletAttributesAndSubelements(taskletElement, parserContext, stepUnderspecified, taskletRef, chunkElements, beanElements, refElements);<NEW_LINE>if (!chunkElements.isEmpty()) {<NEW_LINE>chunkElementParser.parse(chunkElements.get(0), bd, parserContext, stepUnderspecified);<NEW_LINE>} else {<NEW_LINE>BeanMetadataElement bme = null;<NEW_LINE>if (StringUtils.hasText(taskletRef)) {<NEW_LINE>bme = new RuntimeBeanReference(taskletRef);<NEW_LINE>} else if (beanElements.size() == 1) {<NEW_LINE>Element beanElement = beanElements.get(0);<NEW_LINE>BeanDefinitionHolder beanDefinitionHolder = parserContext.getDelegate().parseBeanDefinitionElement(beanElement, bd);<NEW_LINE>parserContext.getDelegate().decorateBeanDefinitionIfRequired(beanElement, beanDefinitionHolder);<NEW_LINE>bme = beanDefinitionHolder;<NEW_LINE>} else if (refElements.size() == 1) {<NEW_LINE>bme = (BeanMetadataElement) parserContext.getDelegate().parsePropertySubElement(refElements.get(0), null);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(taskletMethod)) {<NEW_LINE>bme = getTaskletAdapter(bme, taskletMethod);<NEW_LINE>}<NEW_LINE>if (bme != null) {<NEW_LINE>bd.getPropertyValues().addPropertyValue("tasklet", bme);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handleTaskletElement(taskletElement, bd, parserContext);<NEW_LINE>}
taskletRef = taskletElement.getAttribute(TASKLET_REF_ATTR);
314,173
final DescribeCampaignResult executeDescribeCampaign(DescribeCampaignRequest describeCampaignRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCampaignRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCampaignRequest> request = null;<NEW_LINE>Response<DescribeCampaignResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCampaignRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCampaignRequest));<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, "Personalize");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCampaign");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCampaignResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCampaignResultJsonUnmarshaller());<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);
1,315,197
// Fourth we get the onParseBlockComplete called after all rawTxs of blocks have been parsed<NEW_LINE>public void onParseBlockComplete(Block block) {<NEW_LINE>if (parseBlockChainComplete)<NEW_LINE>log.info("Parse block completed: Block height {}, {} BSQ transactions.", block.getHeight(), block.getTxs().size());<NEW_LINE>// Need to be called before onParseTxsCompleteAfterBatchProcessing as we use it in<NEW_LINE>// VoteResult and other listeners like balances usually listen on onParseTxsCompleteAfterBatchProcessing<NEW_LINE>// so we need to make sure that vote result calculation is completed before (e.g. for comp. request to<NEW_LINE>// update balance).<NEW_LINE>daoStateListeners.forEach(l -> l.onParseBlockComplete(block));<NEW_LINE>// We use 2 different handlers as we don't want to update domain listeners during batch processing of all<NEW_LINE>// blocks as that causes performance issues. In earlier versions when we updated at each block it took<NEW_LINE>// 50 sec. for 4000 blocks, after that change it was about 4 sec.<NEW_LINE>// Clients<NEW_LINE>if (parseBlockChainComplete)<NEW_LINE>daoStateListeners.forEach(l <MASK><NEW_LINE>// Here listeners must not trigger any state change in the DAO as we trigger the validation service to<NEW_LINE>// generate a hash of the state.<NEW_LINE>allowDaoStateChange = false;<NEW_LINE>daoStateListeners.forEach(l -> l.onDaoStateChanged(block));<NEW_LINE>}
-> l.onParseBlockCompleteAfterBatchProcessing(block));
911,307
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select " + "first(theString) as f1, " + "first(sb.*) as f2, " + "first(*) as f3, " + "last(theString) as l1, " + "last(sb.*) as l2, " + "last(*) as l3 " + "from SupportBean as sb";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>String[] fields = "f1,f2,f3,l1,l2,l3".split(",");<NEW_LINE>SupportBean beanOne = sendEvent(<MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", beanOne, beanOne, "E1", beanOne, beanOne });<NEW_LINE>env.milestone(0);<NEW_LINE>SupportBean beanTwo = sendEvent(env, "E2", 2d, 2);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", beanOne, beanOne, "E2", beanTwo, beanTwo });<NEW_LINE>env.milestone(1);<NEW_LINE>SupportBean beanThree = sendEvent(env, "E3", 3d, 3);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "E1", beanOne, beanOne, "E3", beanThree, beanThree });<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "E1", 1d, 1);
933,135
public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ftp_mget" <MASK><NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>if (size < 4) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ftp_mget" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>FtpClientImpl client = null;<NEW_LINE>SFtpClientImpl sclient = null;<NEW_LINE>String localFolder = null;<NEW_LINE>String remoteFolder = null;<NEW_LINE>ArrayList<String> remoteFiles = new ArrayList<String>();<NEW_LINE>boolean overwrite = option != null && option.indexOf("f") >= 0;<NEW_LINE>boolean ignore = option != null && option.indexOf("t") >= 0;<NEW_LINE>if (ignore)<NEW_LINE>overwrite = false;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (i == 0) {<NEW_LINE>if (param.getSub(i) == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("ftp_mget" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object o = param.getSub(i).getLeafExpression().calculate(ctx);<NEW_LINE>if (o instanceof FtpClientImpl)<NEW_LINE>client = (FtpClientImpl) o;<NEW_LINE>else if (o instanceof SFtpClientImpl)<NEW_LINE>sclient = (SFtpClientImpl) o;<NEW_LINE>else<NEW_LINE>throw new RQException("first parameter is not ftp_client");<NEW_LINE>} else if (i == 1) {<NEW_LINE>if (param.getSub(i) == null) {<NEW_LINE>remoteFolder = null;<NEW_LINE>} else<NEW_LINE>remoteFolder = (String) param.getSub(i).getLeafExpression().calculate(ctx);<NEW_LINE>} else if (i == 2) {<NEW_LINE>if (param.getSub(i) == null) {<NEW_LINE>localFolder = null;<NEW_LINE>} else<NEW_LINE>localFolder = (String) param.getSub(i).getLeafExpression().calculate(ctx);<NEW_LINE>} else {<NEW_LINE>remoteFiles.add((String) param.getSub(i).getLeafExpression().calculate(ctx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Sequence r = null;<NEW_LINE>try {<NEW_LINE>if (client != null)<NEW_LINE>r = client.mget(localFolder, remoteFolder, remoteFiles, overwrite, ignore);<NEW_LINE>else<NEW_LINE>// r = sclient.mget(remote,localFile.getLocalFile().file().getAbsolutePath());<NEW_LINE>throw new RQException("ftp_mget for sftp is not implementing.");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new RQException("ftp_mget : " + e.getMessage());<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}
+ mm.getMessage("function.missingParam"));
67,667
public static FetchPhotosResponse unmarshall(FetchPhotosResponse fetchPhotosResponse, UnmarshallerContext context) {<NEW_LINE>fetchPhotosResponse.setRequestId(context.stringValue("FetchPhotosResponse.RequestId"));<NEW_LINE>fetchPhotosResponse.setCode(context.stringValue("FetchPhotosResponse.Code"));<NEW_LINE>fetchPhotosResponse.setMessage(context.stringValue("FetchPhotosResponse.Message"));<NEW_LINE>fetchPhotosResponse.setTotalCount(context.integerValue("FetchPhotosResponse.TotalCount"));<NEW_LINE>fetchPhotosResponse.setAction(context.stringValue("FetchPhotosResponse.Action"));<NEW_LINE>List<Photo> photos <MASK><NEW_LINE>for (int i = 0; i < context.lengthValue("FetchPhotosResponse.Photos.Length"); i++) {<NEW_LINE>Photo photo = new Photo();<NEW_LINE>photo.setId(context.longValue("FetchPhotosResponse.Photos[" + i + "].Id"));<NEW_LINE>photo.setIdStr(context.stringValue("FetchPhotosResponse.Photos[" + i + "].IdStr"));<NEW_LINE>photo.setTitle(context.stringValue("FetchPhotosResponse.Photos[" + i + "].Title"));<NEW_LINE>photo.setFileId(context.stringValue("FetchPhotosResponse.Photos[" + i + "].FileId"));<NEW_LINE>photo.setLocation(context.stringValue("FetchPhotosResponse.Photos[" + i + "].Location"));<NEW_LINE>photo.setState(context.stringValue("FetchPhotosResponse.Photos[" + i + "].State"));<NEW_LINE>photo.setMd5(context.stringValue("FetchPhotosResponse.Photos[" + i + "].Md5"));<NEW_LINE>photo.setIsVideo(context.booleanValue("FetchPhotosResponse.Photos[" + i + "].IsVideo"));<NEW_LINE>photo.setRemark(context.stringValue("FetchPhotosResponse.Photos[" + i + "].Remark"));<NEW_LINE>photo.setSize(context.longValue("FetchPhotosResponse.Photos[" + i + "].Size"));<NEW_LINE>photo.setWidth(context.longValue("FetchPhotosResponse.Photos[" + i + "].Width"));<NEW_LINE>photo.setHeight(context.longValue("FetchPhotosResponse.Photos[" + i + "].Height"));<NEW_LINE>photo.setCtime(context.longValue("FetchPhotosResponse.Photos[" + i + "].Ctime"));<NEW_LINE>photo.setMtime(context.longValue("FetchPhotosResponse.Photos[" + i + "].Mtime"));<NEW_LINE>photo.setTakenAt(context.longValue("FetchPhotosResponse.Photos[" + i + "].TakenAt"));<NEW_LINE>photo.setInactiveTime(context.longValue("FetchPhotosResponse.Photos[" + i + "].InactiveTime"));<NEW_LINE>photo.setShareExpireTime(context.longValue("FetchPhotosResponse.Photos[" + i + "].ShareExpireTime"));<NEW_LINE>photos.add(photo);<NEW_LINE>}<NEW_LINE>fetchPhotosResponse.setPhotos(photos);<NEW_LINE>return fetchPhotosResponse;<NEW_LINE>}
= new ArrayList<Photo>();
243,062
protected void popContextData() {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.entering(CLASS_NAME, "popContextData", this);<NEW_LINE>}<NEW_LINE>// save off this thread's class loader and use the class loader of the thread that launch this thread.<NEW_LINE>this.originalCL = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClassLoader run() {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>Thread.currentThread().setContextClassLoader(newCL);<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "popContextData", "old context class loader [" + this.originalCL + "] , new context class loader [" + newCL + "]");<NEW_LINE>}<NEW_LINE>if (this.contextData != null) {<NEW_LINE>// pop data for other components that we already have hooks into<NEW_LINE>ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor();<NEW_LINE>ComponentMetaData cmd = (ComponentMetaData) this.contextData.get(ComponentMetaData);<NEW_LINE>if (cmd != null) {<NEW_LINE>cmdai.beginContext(cmd);<NEW_LINE>}<NEW_LINE>// each producer service of the Transfer service is accessed in order to get the thread context data<NEW_LINE>Iterator<ITransferContextService> TransferIterator = com.ibm.ws.webcontainer.osgi.WebContainer.getITransferContextServices();<NEW_LINE>if (TransferIterator != null) {<NEW_LINE>while (TransferIterator.hasNext()) {<NEW_LINE>ITransferContextService tcs = TransferIterator.next();<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "popContextData", "calling restoreState on: " + tcs);<NEW_LINE>}<NEW_LINE>tcs.restoreState(this.contextData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>}
exiting(CLASS_NAME, "popContextData", this);
155,539
public DescribeInstanceResult describeInstance(DescribeInstanceRequest describeInstanceRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeInstanceRequest> request = null;<NEW_LINE>Response<DescribeInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeInstanceRequestMarshaller().marshall(describeInstanceRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeInstanceResult, JsonUnmarshallerContext> unmarshaller = new DescribeInstanceResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeInstanceResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
new JsonResponseHandler<DescribeInstanceResult>(unmarshaller);