idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
772,295 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.microsoft.windowsazure.services.media.entityoperations.EntityContract<NEW_LINE>* #delete(com.microsoft.windowsazure.services.media.entityoperations.<NEW_LINE>* EntityDeleteOperation)<NEW_LINE>* @return operation-id if any otherwise null.<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public String delete(EntityDeleteOperation deleter) throws ServiceException {<NEW_LINE>deleter.setProxyData(createProxyData());<NEW_LINE>ClientResponse clientResponse = getResource(deleter.getUri()<MASK><NEW_LINE>PipelineHelpers.throwIfNotSuccess(clientResponse);<NEW_LINE>if (clientResponse.getHeaders().containsKey("operation-id")) {<NEW_LINE>List<String> operationIds = clientResponse.getHeaders().get("operation-id");<NEW_LINE>if (operationIds.size() >= 0) {<NEW_LINE>return operationIds.get(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ).delete(ClientResponse.class); |
1,832,487 | public okhttp3.Call apisApiIdSdksLanguageGetCall(String apiId, String language, String xWSO2Tenant, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/sdks/{language}".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())).replaceAll("\\{" + "language" + "\\}", localVarApiClient.escapeString(language.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (xWSO2Tenant != null) {<NEW_LINE>localVarHeaderParams.put("X-WSO2-Tenant", localVarApiClient.parameterToString(xWSO2Tenant));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/zip", "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
1,704,845 | public Builder clear() {<NEW_LINE>super.clear();<NEW_LINE>ruleName_ = "";<NEW_LINE>functionName_ = "";<NEW_LINE>inputStringAttrName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>outputStringAttrName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>inputIntName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>outputIntName_ = org.nd4j<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>inputFloatName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>outputFloatName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>inputDoubleName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>outputDoubleName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000080);<NEW_LINE>inputBooleanName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000100);<NEW_LINE>outputBooleanName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000200);<NEW_LINE>inputTensorName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000400);<NEW_LINE>outputTensorName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000800);<NEW_LINE>inputDataTypeName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00001000);<NEW_LINE>outputDataTypeName_ = org.nd4j.shade.protobuf.LazyStringArrayList.EMPTY;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00002000);<NEW_LINE>internalGetMutableInputToOutput().clear();<NEW_LINE>ruleType_ = "";<NEW_LINE>if (transformerArgsBuilder_ == null) {<NEW_LINE>transformerArgs_ = java.util.Collections.emptyList();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00008000);<NEW_LINE>} else {<NEW_LINE>transformerArgsBuilder_.clear();<NEW_LINE>}<NEW_LINE>inputFrameworkOpName_ = "";<NEW_LINE>return this;<NEW_LINE>} | .shade.protobuf.LazyStringArrayList.EMPTY; |
1,692,154 | private void updateLabels() {<NEW_LINE>String src = getFirstNotNullTrimmed(sourceText.getText(), "");<NEW_LINE>boolean validSource = isFileAccesible(src);<NEW_LINE>IPath path = Path.fromOSString(src);<NEW_LINE>String filename = (src.isEmpty() || path.isEmpty()) ? "Invalid" : path.segment(path.segmentCount() - 1);<NEW_LINE>String extension = (src.isEmpty() || path.isEmpty()) ? null : path.getFileExtension();<NEW_LINE>String noext = (extension == null) ? filename : filename.substring(0, filename.indexOf(extension) - 1);<NEW_LINE>String basename = (validSource) ? generator.getModelName() : noext;<NEW_LINE>idlLabel.setEnabled(validSource);<NEW_LINE>hLabel.setEnabled(validSource);<NEW_LINE>cppLabel.setEnabled(validSource);<NEW_LINE>trhLabel.setEnabled(validSource);<NEW_LINE>trcLabel.setEnabled(validSource);<NEW_LINE>mpcLabel.setEnabled(validSource);<NEW_LINE>mpbLabel.setEnabled(validSource);<NEW_LINE>pathMpbLabel.setEnabled(validSource);<NEW_LINE>idlBtn.setEnabled(validSource);<NEW_LINE>hBtn.setEnabled(validSource);<NEW_LINE>cppBtn.setEnabled(validSource);<NEW_LINE>trhBtn.setEnabled(validSource);<NEW_LINE>trcBtn.setEnabled(validSource);<NEW_LINE>mpcBtn.setEnabled(validSource);<NEW_LINE>mpbBtn.setEnabled(validSource);<NEW_LINE>pathMpbBtn.setEnabled(validSource);<NEW_LINE>idlLabel.setText(basename + SdkTransformer.TransformType.IDL.getSuffix());<NEW_LINE>idlLabel.setSize(idlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>hLabel.setText(basename + SdkTransformer.TransformType.H.getSuffix());<NEW_LINE>hLabel.setSize(hLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>cppLabel.setText(basename + SdkTransformer.TransformType.CPP.getSuffix());<NEW_LINE>cppLabel.setSize(cppLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>trhLabel.setText(basename + SdkTransformer.TransformType.TRH.getSuffix());<NEW_LINE>trhLabel.setSize(trhLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>trcLabel.setText(basename + SdkTransformer.TransformType.TRC.getSuffix());<NEW_LINE>trcLabel.setSize(trcLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>mpcLabel.setText(basename + SdkTransformer.<MASK><NEW_LINE>mpcLabel.setSize(mpcLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>mpbLabel.setText(basename + SdkTransformer.TransformType.MPB.getSuffix());<NEW_LINE>mpbLabel.setSize(mpbLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>pathMpbLabel.setText(basename + SdkTransformer.TransformType.PATH_MPB.getSuffix());<NEW_LINE>pathMpbLabel.setSize(pathMpbLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>String tgt = getFirstNotNullTrimmed(targetDir.getText(), "");<NEW_LINE>boolean validTarget = isFolderUsable(tgt);<NEW_LINE>genAllBtn.setEnabled(validSource && validTarget);<NEW_LINE>IStatusLineManager statusLineManager = editor.getActionBars().getStatusLineManager();<NEW_LINE>statusLineManager.setErrorMessage(validSource & validTarget ? null : "Unable to generate into " + targetDir.getText());<NEW_LINE>} | TransformType.MPC.getSuffix()); |
1,232,848 | private void createSetResultMethod() {<NEW_LINE>// We need to create an implementation of "getIntent". If there is already such<NEW_LINE>// an implementation, we don't touch it.<NEW_LINE>if (component.declaresMethod("void setResult(int,android.content.Intent)"))<NEW_LINE>return;<NEW_LINE>Type intentType = RefType.v("android.content.Intent");<NEW_LINE>List<Type> params = new ArrayList<>();<NEW_LINE>params.add(IntType.v());<NEW_LINE>params.add(intentType);<NEW_LINE>SootMethod sm = Scene.v().makeSootMethod("setResult", params, VoidType.<MASK><NEW_LINE>component.addMethod(sm);<NEW_LINE>sm.addTag(SimulatedCodeElementTag.TAG);<NEW_LINE>JimpleBody b = Jimple.v().newBody(sm);<NEW_LINE>sm.setActiveBody(b);<NEW_LINE>b.insertIdentityStmts();<NEW_LINE>Local lcIntent = b.getParameterLocal(1);<NEW_LINE>b.getUnits().add(Jimple.v().newAssignStmt(Jimple.v().newInstanceFieldRef(b.getThisLocal(), resultIntentField.makeRef()), lcIntent));<NEW_LINE>b.getUnits().add(Jimple.v().newReturnVoidStmt());<NEW_LINE>// Activity.setResult() is final. We need to change that<NEW_LINE>SootMethod smSetResult = Scene.v().grabMethod("<android.app.Activity: void setResult(int,android.content.Intent)>");<NEW_LINE>if (smSetResult != null && smSetResult.getDeclaringClass().isApplicationClass())<NEW_LINE>smSetResult.setModifiers(smSetResult.getModifiers() & ~Modifier.FINAL);<NEW_LINE>} | v(), Modifier.PUBLIC); |
1,196,560 | private void reposition() {<NEW_LINE>// If we're detached, no need to redraw anything.<NEW_LINE>if (!attached_ || ele_ == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If we're still on the same row, no need to redraw anything<NEW_LINE>int row = anchor_.getRow();<NEW_LINE>if (row == row_) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We've moved; save the new row position<NEW_LINE>row_ = row;<NEW_LINE>// Get all the line groups in the editor; note that this only works if the<NEW_LINE>// word wrapping is turned on (otherwise Ace doesn't create ace_line_group<NEW_LINE>// elements), but we can rely on word wrapping since we enforce it in the<NEW_LINE>// visual editor.<NEW_LINE>Element[] lines = DomUtils.getElementsByClassName(editor_.asWidget().getElement(), "ace_line_group");<NEW_LINE>if (row_ >= lines.length) {<NEW_LINE>// Very unlikely, but ensure we aren't trying to walk off the end of<NEW_LINE>// the array<NEW_LINE>Debug.logWarning("Can't draw execution state on line " + row + " of " + lines.length);<NEW_LINE>} else {<NEW_LINE>// Copy the position attributes from the line group<NEW_LINE>Style style = ele_.getStyle();<NEW_LINE>Style lineStyle = <MASK><NEW_LINE>style.setProperty("top", lineStyle.getTop());<NEW_LINE>style.setProperty("height", lineStyle.getHeight());<NEW_LINE>style.setProperty("position", "absolute");<NEW_LINE>}<NEW_LINE>} | lines[row].getStyle(); |
978,443 | public String convert(String s, int numRows) {<NEW_LINE>if (numRows == 1 || numRows >= s.length())<NEW_LINE>return s;<NEW_LINE>ArrayList<String> <MASK><NEW_LINE>for (int i = 0; i < Math.min(numRows, s.length()); i++) arrLL.add("");<NEW_LINE>int counter = 0;<NEW_LINE>boolean b = false;<NEW_LINE>int size = Math.min(numRows, s.length());<NEW_LINE>for (char c : s.toCharArray()) {<NEW_LINE>String str = Character.toString(c);<NEW_LINE>String initial = "";<NEW_LINE>if (counter < arrLL.size() || arrLL.get(counter) != "") {<NEW_LINE>initial = arrLL.get(counter);<NEW_LINE>arrLL.add(counter, initial + str);<NEW_LINE>arrLL.remove(counter + 1);<NEW_LINE>}<NEW_LINE>if (counter == 0 || counter + 1 == numRows)<NEW_LINE>b = !b;<NEW_LINE>// adding -1 in b if b is false<NEW_LINE>counter += b ? 1 : -1;<NEW_LINE>// adding 1 in b if b is true<NEW_LINE>}<NEW_LINE>String ans = "";<NEW_LINE>for (int i = 0; i < arrLL.size(); i++) {<NEW_LINE>ans += arrLL.get(i);<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>} | arrLL = new ArrayList<>(); |
680,150 | public ECPoint twice() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>if (X1.isZero()) {<NEW_LINE>// A point with X == 0 is its own additive inverse<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>ECFieldElement L1 = this.y, Z1 = this.zs[0];<NEW_LINE>boolean Z1IsOne = Z1.isOne();<NEW_LINE>ECFieldElement L1Z1 = Z1IsOne ? <MASK><NEW_LINE>ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.square();<NEW_LINE>ECFieldElement T = L1.square().add(L1Z1).add(Z1Sq);<NEW_LINE>if (T.isZero()) {<NEW_LINE>return new SecT233R1Point(curve, T, curve.getB().sqrt());<NEW_LINE>}<NEW_LINE>ECFieldElement X3 = T.square();<NEW_LINE>ECFieldElement Z3 = Z1IsOne ? T : T.multiply(Z1Sq);<NEW_LINE>ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.multiply(Z1);<NEW_LINE>ECFieldElement L3 = X1Z1.squarePlusProduct(T, L1Z1).add(X3).add(Z3);<NEW_LINE>return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 });<NEW_LINE>} | L1 : L1.multiply(Z1); |
1,219,043 | public static Map<String, Object> javaTypeToDatabaseType(SecurityContext securityContext, Class<? extends GraphObject> entity, PropertyMap properties) throws FrameworkException {<NEW_LINE>Map<String, Object> databaseTypedProperties = new LinkedHashMap<>();<NEW_LINE>for (Entry<PropertyKey, Object> entry : properties.entrySet()) {<NEW_LINE>PropertyKey propertyKey = entry.getKey();<NEW_LINE>PropertyConverter converter = propertyKey.databaseConverter(securityContext);<NEW_LINE>if (converter != null) {<NEW_LINE>try {<NEW_LINE>Object propertyValue = converter.convert(entry.getValue());<NEW_LINE>databaseTypedProperties.put(propertyKey.jsonName(), propertyValue);<NEW_LINE>} catch (ClassCastException cce) {<NEW_LINE>throw new FrameworkException(422, "Invalid JSON input for key " + propertyKey.jsonName() + ", expected a JSON " + <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>databaseTypedProperties.put(propertyKey.jsonName(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return databaseTypedProperties;<NEW_LINE>} | propertyKey.typeName() + "."); |
1,830,685 | final DeleteTranscriptionJobResult executeDeleteTranscriptionJob(DeleteTranscriptionJobRequest deleteTranscriptionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTranscriptionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTranscriptionJobRequest> request = null;<NEW_LINE>Response<DeleteTranscriptionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTranscriptionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTranscriptionJobRequest));<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, "Transcribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTranscriptionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTranscriptionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTranscriptionJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,074,038 | private static void executeCommandForPid(String pid, String command) throws AttachNotSupportedException, IOException, UnsupportedEncodingException {<NEW_LINE>VirtualMachine vm = VirtualMachine.attach(pid);<NEW_LINE>// Cast to HotSpotVirtualMachine as this is an<NEW_LINE>// implementation specific method.<NEW_LINE>HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;<NEW_LINE>String[] lines = command.split("\\n");<NEW_LINE>for (String line : lines) {<NEW_LINE>if (line.trim().equals("stop")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try (InputStream in = hvm.executeJCmd(line)) {<NEW_LINE>// read to EOF and just print output<NEW_LINE>byte[] b = new byte[256];<NEW_LINE>int n;<NEW_LINE>boolean messagePrinted = false;<NEW_LINE>do {<NEW_LINE>n = in.read(b);<NEW_LINE>if (n > 0) {<NEW_LINE>String s = new String(b, 0, n, "UTF-8");<NEW_LINE>System.out.print(s);<NEW_LINE>messagePrinted = true;<NEW_LINE>}<NEW_LINE>} while (n > 0);<NEW_LINE>if (!messagePrinted) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>vm.detach();<NEW_LINE>} | System.out.println("Command executed successfully"); |
1,768,825 | private void createSessionDiagnosticsVariable(Session session) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>String id = Util.buildBrowseNamePath(node) + "[" + index + "]";<NEW_LINE>NodeId elementNodeId = new NodeId(1, id);<NEW_LINE>SessionDiagnosticsVariableTypeNode elementNode = (SessionDiagnosticsVariableTypeNode) nodeFactory.createNode(elementNodeId, Identifiers.SessionDiagnosticsVariableType);<NEW_LINE>elementNode.setBrowseName(new QualifiedName(1, "SessionDiagnostics"));<NEW_LINE>elementNode.setDisplayName(new LocalizedText(node.getDisplayName().getLocale(), "SessionDiagnostics"));<NEW_LINE>elementNode.setArrayDimensions(null);<NEW_LINE>elementNode.setValueRank(ValueRank.Scalar.getValue());<NEW_LINE>elementNode.setDataType(Identifiers.SessionDiagnosticsDataType);<NEW_LINE>elementNode.setAccessLevel(AccessLevel.toValue(AccessLevel.READ_ONLY));<NEW_LINE>elementNode.setUserAccessLevel(AccessLevel.toValue(AccessLevel.READ_ONLY));<NEW_LINE>elementNode.addReference(new Reference(elementNode.getNodeId(), Identifiers.HasComponent, node.getNodeId().expanded(), Reference.Direction.INVERSE));<NEW_LINE>diagnosticsNodeManager.addNode(elementNode);<NEW_LINE>SessionDiagnosticsVariable sessionDiagnosticsVariable = new SessionDiagnosticsVariable(elementNode, session);<NEW_LINE>sessionDiagnosticsVariable.startup();<NEW_LINE>sessionDiagnosticsVariables.add(sessionDiagnosticsVariable);<NEW_LINE>} catch (UaException e) {<NEW_LINE>logger.warn("Failed to create SessionDiagnosticsVariableTypeNode for session id={}", session.getSessionId(), e);<NEW_LINE>}<NEW_LINE>} | int index = sessionDiagnosticsVariables.size(); |
1,321,189 | public static List<TraceView> decodeFromTraceTransData(String key, MessageExt messageExt) {<NEW_LINE>List<TraceView> messageTraceViewList = new ArrayList<TraceView>();<NEW_LINE>String messageBody = new String(messageExt.getBody(), StandardCharsets.UTF_8);<NEW_LINE>if (messageBody == null || messageBody.length() <= 0) {<NEW_LINE>return messageTraceViewList;<NEW_LINE>}<NEW_LINE>List<TraceContext> traceContextList = TraceDataEncoder.decoderFromTraceDataString(messageBody);<NEW_LINE>for (TraceContext context : traceContextList) {<NEW_LINE>TraceView messageTraceView = new TraceView();<NEW_LINE>TraceBean traceBean = context.getTraceBeans().get(0);<NEW_LINE>if (!traceBean.getMsgId().equals(key)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>messageTraceView.<MASK><NEW_LINE>messageTraceView.setGroupName(context.getGroupName());<NEW_LINE>if (context.isSuccess()) {<NEW_LINE>messageTraceView.setStatus("success");<NEW_LINE>} else {<NEW_LINE>messageTraceView.setStatus("failed");<NEW_LINE>}<NEW_LINE>messageTraceView.setKeys(traceBean.getKeys());<NEW_LINE>messageTraceView.setMsgId(traceBean.getMsgId());<NEW_LINE>messageTraceView.setTags(traceBean.getTags());<NEW_LINE>messageTraceView.setTopic(traceBean.getTopic());<NEW_LINE>messageTraceView.setMsgType(context.getTraceType().name());<NEW_LINE>messageTraceView.setOffSetMsgId(traceBean.getOffsetMsgId());<NEW_LINE>messageTraceView.setTimeStamp(context.getTimeStamp());<NEW_LINE>messageTraceView.setStoreHost(traceBean.getStoreHost());<NEW_LINE>messageTraceView.setClientHost(messageExt.getBornHostString());<NEW_LINE>messageTraceViewList.add(messageTraceView);<NEW_LINE>}<NEW_LINE>return messageTraceViewList;<NEW_LINE>} | setCostTime(context.getCostTime()); |
1,176,857 | public Long validate(Context context) throws AxelorException {<NEW_LINE>if (!appProductionService.isApp("production") || !appProductionService.getAppProduction().getManageBusinessProduction()) {<NEW_LINE>return super.validate(context);<NEW_LINE>}<NEW_LINE>Map<String, Object> bomContext = (Map<String, Object>) context.get("billOfMaterial");<NEW_LINE>BillOfMaterial billOfMaterial = billOfMaterialRepo.find(((Integer) bomContext.get("id")).longValue());<NEW_LINE>BigDecimal qty = new BigDecimal((String) context.get("qty"));<NEW_LINE>Product product = null;<NEW_LINE>if (context.get("product") != null) {<NEW_LINE>Map<String, Object> productContext = (Map<String, Object>) context.get("product");<NEW_LINE>product = productRepo.find(((Integer) productContext.get(<MASK><NEW_LINE>} else {<NEW_LINE>product = billOfMaterial.getProduct();<NEW_LINE>}<NEW_LINE>ZonedDateTime startDateT, endDateT = null;<NEW_LINE>if (context.containsKey("_startDate") && context.get("_startDate") != null) {<NEW_LINE>startDateT = ZonedDateTime.parse(context.get("_startDate").toString(), DateTimeFormatter.ISO_INSTANT.withZone(ZoneId.systemDefault()));<NEW_LINE>} else {<NEW_LINE>startDateT = appProductionService.getTodayDateTime();<NEW_LINE>}<NEW_LINE>if (context.containsKey("_endDate") && context.get("_endDate") != null) {<NEW_LINE>endDateT = ZonedDateTime.parse(context.get("_endDate").toString(), DateTimeFormatter.ISO_INSTANT.withZone(ZoneId.systemDefault()));<NEW_LINE>}<NEW_LINE>Project project = null;<NEW_LINE>if (context.get("business_id") != null) {<NEW_LINE>project = Beans.get(ProjectRepository.class).find(((Integer) context.get("business_id")).longValue());<NEW_LINE>}<NEW_LINE>ProductionOrder productionOrder = productionOrderServiceBusinessImpl.generateProductionOrder(product, billOfMaterial, qty, project, startDateT.toLocalDateTime(), endDateT != null ? endDateT.toLocalDateTime() : null, null);<NEW_LINE>if (productionOrder != null) {<NEW_LINE>return productionOrder.getId();<NEW_LINE>} else {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.PRODUCTION_ORDER_2));<NEW_LINE>}<NEW_LINE>} | "id")).longValue()); |
645,991 | public boolean visit(MySqlJSONTableExpr.Column x) {<NEW_LINE>x.getName().accept(this);<NEW_LINE>if (x.isOrdinality()) {<NEW_LINE>print0(ucase ? " FOR ORDINALITY" : " for ordinality");<NEW_LINE>}<NEW_LINE>SQLDataType dataType = x.getDataType();<NEW_LINE>if (dataType != null) {<NEW_LINE>print(' ');<NEW_LINE>dataType.accept(this);<NEW_LINE>}<NEW_LINE>if (x.isExists()) {<NEW_LINE>print0(ucase ? " EXISTS" : " exists");<NEW_LINE>}<NEW_LINE>SQLExpr path = x.getPath();<NEW_LINE>if (path != null) {<NEW_LINE>print0(ucase ? " PATH " : " path ");<NEW_LINE>path.accept(this);<NEW_LINE>}<NEW_LINE>List<MySqlJSONTableExpr.Column> nestedColumns = x.getNestedColumns();<NEW_LINE>if (nestedColumns.size() > 0) {<NEW_LINE>print0(ucase ? " COLUMNS (" : " columns (");<NEW_LINE>printAndAccept(nestedColumns, ", ");<NEW_LINE>print(')');<NEW_LINE>}<NEW_LINE>SQLExpr onEmpty = x.getOnEmpty();<NEW_LINE>if (onEmpty != null) {<NEW_LINE>print(' ');<NEW_LINE>if (!(onEmpty instanceof SQLNullExpr || onEmpty instanceof SQLIdentifierExpr)) {<NEW_LINE>print0(ucase ? "DEFAULT " : "default ");<NEW_LINE>}<NEW_LINE>onEmpty.accept(this);<NEW_LINE>print0(ucase ? " ON EMPTY" : " on empty");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (onError != null) {<NEW_LINE>print(' ');<NEW_LINE>if (!(onEmpty instanceof SQLNullExpr || onEmpty instanceof SQLIdentifierExpr)) {<NEW_LINE>print0(ucase ? "DEFAULT " : "default ");<NEW_LINE>}<NEW_LINE>onError.accept(this);<NEW_LINE>print0(ucase ? " ON ERROR" : " on error");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | SQLExpr onError = x.getOnError(); |
324,302 | public void registerView(Object forDSTypeOrViewID, UISWTViewBuilderCore builder) {<NEW_LINE>boolean skipWarning = false;<NEW_LINE>if (forDSTypeOrViewID == null) {<NEW_LINE>forDSTypeOrViewID = UISWTInstance.VIEW_MAIN;<NEW_LINE>} else if (forDSTypeOrViewID instanceof String) {<NEW_LINE>// Legacy convert. Older plugins registered for a parent viewid when<NEW_LINE>// they really want to be in all views with a certain datasource type.<NEW_LINE>// Example, registering to VIEW_MYTORRENTS when they are usefull in all<NEW_LINE>// Download.class type views<NEW_LINE>Class<?> cla = mapViewIDToClass((String) forDSTypeOrViewID);<NEW_LINE>if (cla != null) {<NEW_LINE>forDSTypeOrViewID = cla;<NEW_LINE>skipWarning = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (mapDataSourceTypeToBuilder) {<NEW_LINE>Map<String, <MASK><NEW_LINE>UISWTViewBuilderCore existingBuilder = builderMap.put(builder.getViewID(), builder);<NEW_LINE>if (existingBuilder != null && existingBuilder != builder && !skipWarning) {<NEW_LINE>Debug.out("Overiding already registered view '" + builder.getViewID() + "' for " + forDSTypeOrViewID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SWTViewListener[] viewListeners = listSWTViewListeners.toArray(new SWTViewListener[0]);<NEW_LINE>for (SWTViewListener l : viewListeners) {<NEW_LINE>l.setViewRegistered(forDSTypeOrViewID, builder);<NEW_LINE>}<NEW_LINE>} | UISWTViewBuilderCore> builderMap = getBuilderMap(forDSTypeOrViewID); |
106,016 | private static void sendTransactionsToListener(StoredBlock block, NewBlockType blockType, TransactionReceivedInBlockListener listener, int relativityOffset, List<Transaction> transactions, boolean clone, Set<Sha256Hash> falsePositives) throws VerificationException {<NEW_LINE>for (Transaction tx : transactions) {<NEW_LINE>try {<NEW_LINE>falsePositives.<MASK><NEW_LINE>if (clone)<NEW_LINE>tx = tx.params.getDefaultSerializer().makeTransaction(tx.bitcoinSerialize());<NEW_LINE>listener.receiveFromBlock(tx, block, blockType, relativityOffset++);<NEW_LINE>} catch (ScriptException e) {<NEW_LINE>// We don't want scripts we don't understand to break the block chain so just note that this tx was<NEW_LINE>// not scanned here and continue.<NEW_LINE>log.warn("Failed to parse a script: " + e.toString());<NEW_LINE>} catch (ProtocolException e) {<NEW_LINE>// Failed to duplicate tx, should never happen.<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | remove(tx.getTxId()); |
339,326 | public KrollPromise<KrollDict> requestPhotoGalleryPermissions(@Kroll.argument(optional = true) KrollFunction permissionCallback) {<NEW_LINE>final KrollObject callbackThisObject = getKrollObject();<NEW_LINE>return KrollPromise.create((promise) -> {<NEW_LINE>// Do not continue if we already have permission.<NEW_LINE>if (hasPhotoGalleryPermissions()) {<NEW_LINE>KrollDict response = new KrollDict();<NEW_LINE>response.putCodeAndMessage(0, null);<NEW_LINE>if (permissionCallback != null) {<NEW_LINE>permissionCallback.callAsync(callbackThisObject, response);<NEW_LINE>}<NEW_LINE>promise.resolve(response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Do not continue if there is no activity to host the request dialog.<NEW_LINE>Activity activity = TiApplication.getInstance().getCurrentActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>KrollDict response = new KrollDict();<NEW_LINE>response.putCodeAndMessage(-1, "There are no activities to host the external storage permission request dialog.");<NEW_LINE>if (permissionCallback != null) {<NEW_LINE>permissionCallback.callAsync(callbackThisObject, response);<NEW_LINE>}<NEW_LINE>promise.reject(new Throwable(response.getString(TiC.EVENT_PROPERTY_ERROR)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Show dialog requesting permission.<NEW_LINE>TiBaseActivity.registerPermissionRequestCallback(TiC.PERMISSION_CODE_EXTERNAL_STORAGE, permissionCallback, callbackThisObject, promise);<NEW_LINE>activity.requestPermissions(new String[] { Manifest.permission<MASK><NEW_LINE>});<NEW_LINE>} | .WRITE_EXTERNAL_STORAGE }, TiC.PERMISSION_CODE_EXTERNAL_STORAGE); |
722,723 | protected void formatSnippet(FilePosition errorPosition, FilePosition snippetPos, CharSequence line, int start, int end, Appendable out) throws IOException {<NEW_LINE>// Write out "file:14: <line-of-sourcecode>"<NEW_LINE>StringBuilder posBuf = new StringBuilder();<NEW_LINE>formatFilePosition(snippetPos, posBuf);<NEW_LINE>posBuf.append(": ");<NEW_LINE>int filePosLength = posBuf.length();<NEW_LINE>int nSpaces = start + filePosLength;<NEW_LINE>int nCarets = end - start;<NEW_LINE>out.append(posBuf);<NEW_LINE>// Expand tabs so that the carets line up with the source.<NEW_LINE>int nExtraSpaces = expandTabs(line, 0, start, 0, out);<NEW_LINE>int nExtraCarets = expandTabs(line, start, end, nExtraSpaces, out);<NEW_LINE>expandTabs(line, end, line.length(<MASK><NEW_LINE>if (line.length() == 0 || !isLinebreak(line.charAt(line.length() - 1))) {<NEW_LINE>// If the line is the last in the file, it may not end with a newline.<NEW_LINE>out.append("\n");<NEW_LINE>}<NEW_LINE>repeat(" ", nSpaces + nExtraSpaces, out);<NEW_LINE>repeat("^^^^^^^^^^^^^^^^", Math.max(nCarets + nExtraCarets, 1), out);<NEW_LINE>} | ), nExtraSpaces + nExtraCarets, out); |
1,331,921 | public com.amazonaws.services.frauddetector.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.frauddetector.model.ConflictException conflictException = new com.amazonaws.services.frauddetector.model.ConflictException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return conflictException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
262,242 | public void translate(ProxySession session, ServerBossBarPacket packet) {<NEW_LINE>BossEventPacket bossEventPacket = new BossEventPacket();<NEW_LINE>bossEventPacket.setColor(1);<NEW_LINE>bossEventPacket.setOverlay(1);<NEW_LINE>bossEventPacket.setDarkenSky(1);<NEW_LINE>bossEventPacket.setPlayerUniqueEntityId(session.getCachedEntity().getProxyEid());<NEW_LINE>switch(packet.getAction()) {<NEW_LINE>case ADD:<NEW_LINE>// See the documentation for addFakeEntity() below<NEW_LINE>addFakeEntity(session, packet.getUuid());<NEW_LINE>bossEventPacket.setTitle(MessageTranslator.translate(packet.getTitle()));<NEW_LINE>bossEventPacket.setAction(BossEventPacket.Action.SHOW);<NEW_LINE>bossEventPacket.<MASK><NEW_LINE>break;<NEW_LINE>case REMOVE:<NEW_LINE>removeFakeEntity(session, packet.getUuid());<NEW_LINE>bossEventPacket.setAction(BossEventPacket.Action.HIDE);<NEW_LINE>break;<NEW_LINE>case UPDATE_HEALTH:<NEW_LINE>bossEventPacket.setAction(BossEventPacket.Action.HEALTH_PERCENTAGE);<NEW_LINE>bossEventPacket.setHealthPercentage(packet.getHealth());<NEW_LINE>break;<NEW_LINE>case UPDATE_TITLE:<NEW_LINE>bossEventPacket.setAction(BossEventPacket.Action.TITLE);<NEW_LINE>bossEventPacket.setTitle(MessageTranslator.translate(packet.getTitle()));<NEW_LINE>break;<NEW_LINE>case UPDATE_STYLE:<NEW_LINE>// bossEventPacket.setType(BossEventPacket.Type.OVERLAY);<NEW_LINE>// bossEventPacket.setOverlay(0);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.info(TextFormat.GRAY + "(debug) Unhandled boss bar action: " + packet.getAction().name());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Long bossEid = session.getEntityCache().getBossbars().get(packet.getUuid());<NEW_LINE>bossEventPacket.setBossUniqueEntityId(bossEid == null ? -1 : bossEid);<NEW_LINE>session.sendPacket(bossEventPacket);<NEW_LINE>} | setHealthPercentage(packet.getHealth()); |
1,121,895 | private void checkIncrementAndDecrement(Object data, Set<String> loopVariables, ASTStatement loopBody, IgnoreFlags... ignoreFlags) {<NEW_LINE>// foo ++ and foo --<NEW_LINE>for (ASTPostfixExpression expression : loopBody.findDescendantsOfType(ASTPostfixExpression.class)) {<NEW_LINE>if (ignoreNode(expression, loopBody, ignoreFlags)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>checkVariable(data, loopVariables, singleVariableName(expression.getFirstDescendantOfType(ASTPrimaryExpression.class)));<NEW_LINE>}<NEW_LINE>// ++ foo<NEW_LINE>for (ASTPreIncrementExpression expression : loopBody.findDescendantsOfType(ASTPreIncrementExpression.class)) {<NEW_LINE>if (ignoreNode(expression, loopBody, ignoreFlags)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>checkVariable(data, loopVariables, singleVariableName(expression.getFirstDescendantOfType(ASTPrimaryExpression.class)));<NEW_LINE>}<NEW_LINE>// -- foo<NEW_LINE>for (ASTPreDecrementExpression expression : loopBody.findDescendantsOfType(ASTPreDecrementExpression.class)) {<NEW_LINE>if (ignoreNode(expression, loopBody, ignoreFlags)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>checkVariable(data, loopVariables, singleVariableName(expression.getFirstDescendantOfType(ASTPrimaryExpression.class)));<NEW_LINE>}<NEW_LINE>// foo += x and foo -= x<NEW_LINE>checkAssignments(data, <MASK><NEW_LINE>} | loopVariables, loopBody, true, ignoreFlags); |
1,814,319 | private void resizeVolume(VolumeInfo volumeInfo) {<NEW_LINE>LOGGER.debug("Resizing PowerFlex volume");<NEW_LINE>Preconditions.checkArgument(volumeInfo != null, "volumeInfo cannot be null");<NEW_LINE>try {<NEW_LINE>String scaleIOVolumeId = ScaleIOUtil.getVolumePath(volumeInfo.getPath());<NEW_LINE>Long storagePoolId = volumeInfo.getPoolId();<NEW_LINE>ResizeVolumePayload payload = (ResizeVolumePayload) volumeInfo.getpayload();<NEW_LINE>long newSizeInBytes = payload.newSize != null ? payload.newSize : volumeInfo.getSize();<NEW_LINE>// Only increase size is allowed and size should be specified in granularity of 8 GB<NEW_LINE>if (newSizeInBytes <= volumeInfo.getSize()) {<NEW_LINE>throw new CloudRuntimeException("Only increase size is allowed for volume: " + volumeInfo.getName());<NEW_LINE>}<NEW_LINE>org.apache.cloudstack.storage.datastore.api.Volume scaleIOVolume = null;<NEW_LINE>long newSizeInGB = newSizeInBytes / (1024 * 1024 * 1024);<NEW_LINE>long newSizeIn8gbBoundary = (long) (Math.ceil(newSizeInGB / 8.0) * 8.0);<NEW_LINE>final ScaleIOGatewayClient client = getScaleIOClient(storagePoolId);<NEW_LINE>scaleIOVolume = client.resizeVolume(scaleIOVolumeId, (int) newSizeIn8gbBoundary);<NEW_LINE>if (scaleIOVolume == null) {<NEW_LINE>throw new CloudRuntimeException(<MASK><NEW_LINE>}<NEW_LINE>VolumeVO volume = volumeDao.findById(volumeInfo.getId());<NEW_LINE>long oldVolumeSize = volume.getSize();<NEW_LINE>volume.setSize(scaleIOVolume.getSizeInKb() * 1024);<NEW_LINE>volumeDao.update(volume.getId(), volume);<NEW_LINE>StoragePoolVO storagePool = storagePoolDao.findById(storagePoolId);<NEW_LINE>long capacityBytes = storagePool.getCapacityBytes();<NEW_LINE>long usedBytes = storagePool.getUsedBytes();<NEW_LINE>long newVolumeSize = volume.getSize();<NEW_LINE>usedBytes += newVolumeSize - oldVolumeSize;<NEW_LINE>storagePool.setUsedBytes(usedBytes > capacityBytes ? capacityBytes : usedBytes);<NEW_LINE>storagePoolDao.update(storagePoolId, storagePool);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errMsg = "Unable to resize PowerFlex volume: " + volumeInfo.getId() + " due to " + e.getMessage();<NEW_LINE>LOGGER.warn(errMsg);<NEW_LINE>throw new CloudRuntimeException(errMsg, e);<NEW_LINE>}<NEW_LINE>} | "Failed to resize volume: " + volumeInfo.getName()); |
1,392,993 | public void registerAsyncAction() {<NEW_LINE>pythonContext.registerAsyncAction(() -> {<NEW_LINE>Reference<? extends Object> reference = null;<NEW_LINE>try {<NEW_LINE>reference = queue.remove();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>ArrayList<AsyncAction> actions = new ArrayList<>();<NEW_LINE>do {<NEW_LINE>if (reference instanceof FinalizableReference) {<NEW_LINE>FinalizableReference object = (FinalizableReference) reference;<NEW_LINE>try {<NEW_LINE>liveReferencesSet.remove(object);<NEW_LINE>if (!object.isReleased()) {<NEW_LINE>AsyncAction action = object.release();<NEW_LINE>if (action != null) {<NEW_LINE>actions.add(action);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>actions.add(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>reference = queue.poll();<NEW_LINE>} while (reference != null);<NEW_LINE>if (!actions.isEmpty()) {<NEW_LINE>return new AsyncActionsList(actions.toArray(new AsyncAction[0]));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} | new SharedFinalizerErrorCallback(object, e)); |
401,712 | public static void addSymbols(IProcess process, long j9RasAddress, StructureReader structureReader) {<NEW_LINE>long vmAddress = 0;<NEW_LINE>try {<NEW_LINE>vmAddress = followPointerFromStructure("J9RAS", j9RasAddress, "vm", structureReader, process);<NEW_LINE>} catch (MemoryFault e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (com.ibm.j9ddr.NoSuchFieldException e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This is optional information, we don't want to let an exception escape<NEW_LINE>// and block DDR startup!<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>}<NEW_LINE>if (vmAddress == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String[][] path : paths) {<NEW_LINE>try {<NEW_LINE>long currentAddress = vmAddress;<NEW_LINE>String currentType = "J9JavaVM";<NEW_LINE>for (String[] pathEntry : path) {<NEW_LINE>String structType = pathEntry[0];<NEW_LINE>String fieldName = pathEntry[1];<NEW_LINE>currentAddress = followPointerFromStructure(currentType, currentAddress, fieldName, structureReader, process);<NEW_LINE>currentType = structType;<NEW_LINE>}<NEW_LINE>addVoidPointersAsSymbols(currentType, currentAddress, structureReader, process);<NEW_LINE>} catch (MemoryFault e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (com.ibm.j9ddr.NoSuchFieldException e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (DataUnavailableException e) {<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.log(FINE, null, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This is optional information, we don't want to let an exception escape<NEW_LINE>// and block DDR startup!<NEW_LINE>Logger logger = Logger.getLogger(LoggerNames.LOGGER_STRUCTURE_READER);<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log(FINE, null, e); |
1,189,536 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime SDK Messaging");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
418,785 | public InstrumentInterval instrumentGetActiveIntervals() throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/instrument/activeIntervals";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams <MASK><NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return (InstrumentInterval) ApiInvoker.deserialize(localVarResponse, "", InstrumentInterval.class);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | = new ArrayList<Pair>(); |
1,052,220 | public static ExecutionStatus tryCatchException(Exception e) {<NEW_LINE>ExecutionStatus responseResult = new ExecutionStatus();<NEW_LINE>if (e instanceof QueryProcessException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((QueryProcessException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageGroupNotSetException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((StorageGroupNotSetException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageEngineException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((StorageEngineException<MASK><NEW_LINE>} else if (e instanceof AuthException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(Status.BAD_REQUEST.getStatusCode());<NEW_LINE>} else if (e instanceof IllegalPathException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IllegalPathException) e).getErrorCode());<NEW_LINE>} else if (e instanceof MetadataException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((MetadataException) e).getErrorCode());<NEW_LINE>} else if (e instanceof IoTDBException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IoTDBException) e).getErrorCode());<NEW_LINE>} else if (!(e instanceof IOException) && !(e instanceof NullPointerException)) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());<NEW_LINE>} else {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>}<NEW_LINE>LOGGER.warn(e.getMessage(), e);<NEW_LINE>return responseResult;<NEW_LINE>} | ) e).getErrorCode()); |
1,072,829 | private final PO retrieveObjectFromTrx(final ITableCacheConfig cacheConfig, final Properties ctx, final String tableName, final int recordId, final ITrx trx) {<NEW_LINE>//<NEW_LINE>// Check if we can cache on this transaction level?<NEW_LINE>if (!isTrxLevelEnabled(cacheConfig, trx)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (trxCacheMap == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final CCache<Object, PO> cache = trxCacheMap.getByTableNameIfExists(tableName);<NEW_LINE>if (cache == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PO poCached = cache.get(recordId);<NEW_LINE>if (poCached == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Check if our cached object is expired (i.e. trxName changed etc)<NEW_LINE>if (isExpired(ctx, tableName, recordId, trx, poCached)) {<NEW_LINE>cache.remove(recordId);<NEW_LINE>logger.trace("Removed {} from model cache because it's expired (trx={})", poCached, trx);<NEW_LINE>poCached = null;<NEW_LINE>}<NEW_LINE>return poCached;<NEW_LINE>} | final TrxCacheMap trxCacheMap = getTrxCacheMapIfPresent(trx); |
432,267 | public void contributeRuntimeProperties(BiConsumer<String, Object> propertyCollector) {<NEW_LINE>if (runtimeConfig == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!runtimeConfig.enabled) {<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.ENABLED, false);<NEW_LINE>// Do not process other properties: Hibernate Search is disabled anyway.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.SCHEMA_MANAGEMENT_STRATEGY, runtimeConfig.schemaManagement.strategy);<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.AUTOMATIC_INDEXING_SYNCHRONIZATION_STRATEGY, runtimeConfig.automaticIndexing.synchronization.strategy);<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.AUTOMATIC_INDEXING_ENABLE_DIRTY_CHECK, runtimeConfig.automaticIndexing.enableDirtyCheck);<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.QUERY_LOADING_CACHE_LOOKUP_STRATEGY, runtimeConfig.queryLoading.cacheLookup.strategy);<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.QUERY_LOADING_FETCH_SIZE, runtimeConfig.queryLoading.fetchSize);<NEW_LINE>addConfig(propertyCollector, HibernateOrmMapperSettings.MULTI_TENANCY_TENANT_IDS, runtimeConfig.multiTenancy.tenantIds);<NEW_LINE>contributeBackendRuntimeProperties(<MASK><NEW_LINE>for (Entry<String, ElasticsearchBackendRuntimeConfig> backendEntry : runtimeConfig.namedBackends.backends.entrySet()) {<NEW_LINE>contributeBackendRuntimeProperties(propertyCollector, backendEntry.getKey(), backendEntry.getValue());<NEW_LINE>}<NEW_LINE>for (HibernateOrmIntegrationRuntimeInitListener integrationRuntimeInitListener : integrationRuntimeInitListeners) {<NEW_LINE>integrationRuntimeInitListener.contributeRuntimeProperties(propertyCollector);<NEW_LINE>}<NEW_LINE>} | propertyCollector, null, runtimeConfig.defaultBackend); |
1,047,953 | private void signalCached(Signal<T> signal) {<NEW_LINE>Signal<T> signalToPropagate = signal;<NEW_LINE>if (STATE.compareAndSet(main, this, signal)) {<NEW_LINE>Duration ttl = null;<NEW_LINE>try {<NEW_LINE>ttl = main.ttlGenerator.apply(signal);<NEW_LINE>} catch (Throwable generatorError) {<NEW_LINE><MASK><NEW_LINE>STATE.set(main, signalToPropagate);<NEW_LINE>if (signal.isOnError()) {<NEW_LINE>// noinspection ThrowableNotThrown<NEW_LINE>Exceptions.addSuppressed(generatorError, signal.getThrowable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ttl != null) {<NEW_LINE>if (ttl.isZero()) {<NEW_LINE>// immediate cache clear<NEW_LINE>main.run();<NEW_LINE>} else if (!ttl.equals(DURATION_INFINITE)) {<NEW_LINE>main.clock.schedule(main, ttl.toNanos(), TimeUnit.NANOSECONDS);<NEW_LINE>}<NEW_LINE>// else TTL is Long.MAX_VALUE, schedule nothing but still cache<NEW_LINE>} else {<NEW_LINE>// error during TTL generation, signal != updatedSignal, aka dropped<NEW_LINE>if (signal.isOnNext()) {<NEW_LINE>Operators.onNextDropped(signal.get(), currentContext());<NEW_LINE>}<NEW_LINE>// if signal.isOnError(), avoid dropping the error. it is not really dropped but already suppressed<NEW_LINE>// in all cases, unless nextDropped hook throws, immediate cache clear<NEW_LINE>main.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Operators.MonoSubscriber<T, T> inner : SUBSCRIBERS.getAndSet(this, TERMINATED)) {<NEW_LINE>if (signalToPropagate.isOnNext()) {<NEW_LINE>inner.complete(signalToPropagate.get());<NEW_LINE>} else if (signalToPropagate.isOnError()) {<NEW_LINE>inner.onError(signalToPropagate.getThrowable());<NEW_LINE>} else {<NEW_LINE>inner.onComplete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | signalToPropagate = Signal.error(generatorError); |
1,100,278 | private HyperlinkInfo buildFileHyperlinkInfo(@Nonnull String url) {<NEW_LINE>if (myProject != null && !url.endsWith(".html") && url.startsWith(LocalFileSystem.PROTOCOL_PREFIX)) {<NEW_LINE>int documentLine = 0, documentColumn = 0;<NEW_LINE>int filePathEndIndex = url.length();<NEW_LINE>final int lastColonInd = url.lastIndexOf(':');<NEW_LINE>if (lastColonInd > LocalFileSystem.PROTOCOL_PREFIX.length() && lastColonInd < url.length() - 1) {<NEW_LINE>int lastValue = StringUtil.parseInt(url.substring(lastColonInd + 1), Integer.MIN_VALUE);<NEW_LINE>if (lastValue != Integer.MIN_VALUE) {<NEW_LINE>documentLine = lastValue - 1;<NEW_LINE>filePathEndIndex = lastColonInd;<NEW_LINE>int preLastColonInd = url.lastIndexOf(':', lastColonInd - 1);<NEW_LINE>if (preLastColonInd > LocalFileSystem.PROTOCOL_PREFIX.length()) {<NEW_LINE>int preLastValue = StringUtil.parseInt(url.substring(preLastColonInd + 1<MASK><NEW_LINE>if (preLastValue != Integer.MIN_VALUE) {<NEW_LINE>documentLine = preLastValue - 1;<NEW_LINE>documentColumn = lastValue - 1;<NEW_LINE>filePathEndIndex = preLastColonInd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String filePath = url.substring(LocalFileSystem.PROTOCOL_PREFIX.length(), filePathEndIndex);<NEW_LINE>return new FileUrlHyperlinkInfo(filePath, documentLine, documentColumn, url);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , lastColonInd), Integer.MIN_VALUE); |
915,148 | protected void blockInter(BitReader bits, VLC vlcCoeff, int[] block, int[] scan, int escSize, int qScale, int[] qmat) {<NEW_LINE>block[1] = block[2] = block[3] = 0;<NEW_LINE>int idx = -1;<NEW_LINE>if (vlcCoeff == vlcCoeff0 && bits.checkNBit(1) == 1) {<NEW_LINE>bits.read1Bit();<NEW_LINE>block[0] = toSigned(quantInter(1, qScale * qmat[0]), bits.read1Bit());<NEW_LINE>idx++;<NEW_LINE>} else {<NEW_LINE>block[0] = 0;<NEW_LINE>}<NEW_LINE>int readVLC = 0;<NEW_LINE>for (; idx < 6; ) {<NEW_LINE>readVLC = vlcCoeff.readVLC(bits);<NEW_LINE>int ac;<NEW_LINE>if (readVLC == MPEGConst.CODE_END) {<NEW_LINE>break;<NEW_LINE>} else if (readVLC == MPEGConst.CODE_ESCAPE) {<NEW_LINE>idx += bits.readNBit(6) + 1;<NEW_LINE>ac = quantInterSigned(twosSigned(bits, escSize), qScale * qmat[idx]);<NEW_LINE>} else {<NEW_LINE>idx += (readVLC >> 6) + 1;<NEW_LINE>ac = toSigned(quantInter(readVLC & 0x3f, qScale * qmat[idx]), bits.read1Bit());<NEW_LINE>}<NEW_LINE>block[scan[idx]] = ac;<NEW_LINE>}<NEW_LINE>if (readVLC != MPEGConst.CODE_END)<NEW_LINE>finishOff(<MASK><NEW_LINE>IDCT2x2.idct(block, 0);<NEW_LINE>} | bits, idx, vlcCoeff, escSize); |
1,089,490 | public okhttp3.Call apiCategoriesApiCategoryIdPutCall(String apiCategoryId, APICategoryDTO apICategoryDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = apICategoryDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api-categories/{apiCategoryId}".replaceAll("\\{" + "apiCategoryId" + "\\}", localVarApiClient.escapeString(apiCategoryId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, String>(); |
1,437,772 | public boolean add(Session session) {<NEW_LINE>Require.nonNull("Session to add", session);<NEW_LINE>try (Span span = tracer.getCurrentContext().createSpan("MSET sessionUriKey <sessionUri> capabilitiesKey <capabilities> ")) {<NEW_LINE>Map<String, EventAttributeValue> attributeMap = new HashMap<>();<NEW_LINE>SESSION_ID.accept(span, session.getId());<NEW_LINE>SESSION_ID_EVENT.accept(attributeMap, session.getId());<NEW_LINE>CAPABILITIES.accept(span, session.getCapabilities());<NEW_LINE>CAPABILITIES_EVENT.accept(attributeMap, session.getCapabilities());<NEW_LINE>setCommonSpanAttributes(span);<NEW_LINE>setCommonEventAttributes(attributeMap);<NEW_LINE>String uriKey = uriKey(session.getId());<NEW_LINE>String uriValue = session.getUri().toString();<NEW_LINE>String stereotypeKey = stereotypeKey(session.getId());<NEW_LINE>String stereotypeJson = JSON.toJson(session.getStereotype());<NEW_LINE>String capabilitiesKey = <MASK><NEW_LINE>String capabilitiesJson = JSON.toJson(session.getCapabilities());<NEW_LINE>String startKey = startKey(session.getId());<NEW_LINE>String startValue = JSON.toJson(session.getStartTime());<NEW_LINE>span.setAttribute(REDIS_URI_KEY, uriKey);<NEW_LINE>span.setAttribute(REDIS_URI_VALUE, uriValue);<NEW_LINE>span.setAttribute(REDIS_CAPABILITIES_KEY, capabilitiesKey);<NEW_LINE>span.setAttribute(REDIS_CAPABILITIES_VALUE, capabilitiesJson);<NEW_LINE>span.setAttribute(DATABASE_OPERATION, "MSET");<NEW_LINE>attributeMap.put(REDIS_URI_KEY, EventAttribute.setValue(uriKey));<NEW_LINE>attributeMap.put(REDIS_URI_VALUE, EventAttribute.setValue(uriValue));<NEW_LINE>attributeMap.put(REDIS_CAPABILITIES_KEY, EventAttribute.setValue(capabilitiesKey));<NEW_LINE>attributeMap.put(REDIS_CAPABILITIES_VALUE, EventAttribute.setValue(capabilitiesJson));<NEW_LINE>attributeMap.put(REDIS_START_KEY, EventAttribute.setValue(startKey));<NEW_LINE>attributeMap.put(REDIS_START_VALUE, EventAttribute.setValue(startValue));<NEW_LINE>attributeMap.put(DATABASE_OPERATION, EventAttribute.setValue("MSET"));<NEW_LINE>span.addEvent("Inserted into the database", attributeMap);<NEW_LINE>connection.mset(ImmutableMap.of(uriKey, uriValue, stereotypeKey, stereotypeJson, capabilitiesKey, capabilitiesJson, startKey, startValue));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | capabilitiesKey(session.getId()); |
199,515 | private static Map<String, TextAttributesKey> createAdditionalHlAttrs() {<NEW_LINE>@NonNls<NEW_LINE>final Map<String, TextAttributesKey> descriptors = new THashMap<>();<NEW_LINE>descriptors.put("string", DefaultLanguageHighlighterColors.STRING);<NEW_LINE>descriptors.put("keyword", JS_KEYWORD);<NEW_LINE>descriptors.put("function", FUNCTION);<NEW_LINE>descriptors.put("function_name", FUNCTION_NAME);<NEW_LINE>descriptors.put("val", VAL);<NEW_LINE>descriptors.put("local_variable", VARIABLE);<NEW_LINE>descriptors.put("this", THIS_SUPER);<NEW_LINE>descriptors.put("null", NULL);<NEW_LINE>descriptors.put("primitive", PRIMITIVE);<NEW_LINE>descriptors.put("debugger", DEBUGGER);<NEW_LINE><MASK><NEW_LINE>descriptors.put("console", CONSOLE);<NEW_LINE>descriptors.put("number", JS_NUMBER);<NEW_LINE>descriptors.put("inst_field", DefaultLanguageHighlighterColors.INSTANCE_FIELD);<NEW_LINE>return descriptors;<NEW_LINE>} | descriptors.put("import", MODULE); |
1,754,139 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_flexiblespacewithimagescrollview);<NEW_LINE>mFlexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_image_height);<NEW_LINE>mFlexibleSpaceShowFabOffset = getResources().getDimensionPixelSize(R.dimen.flexible_space_show_fab_offset);<NEW_LINE>mActionBarSize = getActionBarSize();<NEW_LINE>mImageView = findViewById(R.id.image);<NEW_LINE>mOverlayView = findViewById(R.id.overlay);<NEW_LINE>mScrollView = (ObservableScrollView) findViewById(R.id.scroll);<NEW_LINE>mScrollView.setScrollViewCallbacks(this);<NEW_LINE>mTitleView = (TextView) findViewById(R.id.title);<NEW_LINE>mTitleView.setText(getTitle());<NEW_LINE>setTitle(null);<NEW_LINE>mFab = <MASK><NEW_LINE>mFab.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Toast.makeText(FlexibleSpaceWithImageScrollViewActivity.this, "FAB is clicked", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mFabMargin = getResources().getDimensionPixelSize(R.dimen.margin_standard);<NEW_LINE>ViewHelper.setScaleX(mFab, 0);<NEW_LINE>ViewHelper.setScaleY(mFab, 0);<NEW_LINE>ScrollUtils.addOnGlobalLayoutListener(mScrollView, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>mScrollView.scrollTo(0, mFlexibleSpaceImageHeight - mActionBarSize);<NEW_LINE>// If you'd like to start from scrollY == 0, don't write like this:<NEW_LINE>// mScrollView.scrollTo(0, 0);<NEW_LINE>// The initial scrollY is 0, so it won't invoke onScrollChanged().<NEW_LINE>// To do this, use the following:<NEW_LINE>// onScrollChanged(0, false, false);<NEW_LINE>// You can also achieve it with the following codes.<NEW_LINE>// This causes scroll change from 1 to 0.<NEW_LINE>// mScrollView.scrollTo(0, 1);<NEW_LINE>// mScrollView.scrollTo(0, 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.fab); |
1,076,302 | public Context start(Context parentContext, REQUEST request) {<NEW_LINE>SpanKind spanKind = spanKindExtractor.extract(request);<NEW_LINE>SpanBuilder spanBuilder = tracer.spanBuilder(spanNameExtractor.extract(request)).setSpanKind<MASK><NEW_LINE>Instant startTime = null;<NEW_LINE>if (timeExtractor != null) {<NEW_LINE>startTime = timeExtractor.extractStartTime(request);<NEW_LINE>spanBuilder.setStartTimestamp(startTime);<NEW_LINE>}<NEW_LINE>SpanLinksBuilder spanLinksBuilder = new SpanLinksBuilderImpl(spanBuilder);<NEW_LINE>for (SpanLinksExtractor<? super REQUEST> spanLinksExtractor : spanLinksExtractors) {<NEW_LINE>spanLinksExtractor.extract(spanLinksBuilder, parentContext, request);<NEW_LINE>}<NEW_LINE>UnsafeAttributes attributesBuilder = new UnsafeAttributes();<NEW_LINE>for (AttributesExtractor<? super REQUEST, ? super RESPONSE> extractor : attributesExtractors) {<NEW_LINE>extractor.onStart(attributesBuilder, parentContext, request);<NEW_LINE>}<NEW_LINE>Attributes attributes = attributesBuilder;<NEW_LINE>Context context = parentContext;<NEW_LINE>spanBuilder.setAllAttributes(attributes);<NEW_LINE>Span span = spanBuilder.startSpan();<NEW_LINE>context = context.with(span);<NEW_LINE>for (ContextCustomizer<? super REQUEST> contextCustomizer : contextCustomizers) {<NEW_LINE>context = contextCustomizer.start(context, request, attributes);<NEW_LINE>}<NEW_LINE>if (!requestListeners.isEmpty()) {<NEW_LINE>long startNanos = getNanos(startTime);<NEW_LINE>for (RequestListener requestListener : requestListeners) {<NEW_LINE>context = requestListener.start(context, attributes, startNanos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return spanSuppressionStrategy.storeInContext(context, spanKind, span);<NEW_LINE>} | (spanKind).setParent(parentContext); |
210,652 | public ProcessStatus restSearchSettings(final PwmRequest pwmRequest) throws IOException, PwmUnrecoverableException {<NEW_LINE>final ConfigManagerBean configManagerBean = getBean(pwmRequest);<NEW_LINE>final String bodyData = pwmRequest.readRequestBodyAsString();<NEW_LINE>final Map<String, String> valueMap = JsonFactory.get().deserializeStringMap(bodyData);<NEW_LINE>final Locale locale = pwmRequest.getLocale();<NEW_LINE>final RestResultBean restResultBean;<NEW_LINE>final String <MASK><NEW_LINE>final StoredConfiguration storedConfiguration = configManagerBean.getStoredConfiguration();<NEW_LINE>if (StringUtil.isEmpty(searchTerm)) {<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.fromError(new ErrorInformation(PwmError.ERROR_MISSING_PARAMETER, "missing search parameter")));<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}<NEW_LINE>final Set<DomainID> searchDomains = DomainStateReader.forRequest(pwmRequest).searchIDs();<NEW_LINE>final Set<StoredConfigKey> searchResults = new ConfigSearchMachine(storedConfiguration, locale).search(searchTerm, searchDomains);<NEW_LINE>final TreeMap<String, Map<String, SearchResultItem>> returnData = new TreeMap<>();<NEW_LINE>searchResults.stream().filter(key -> key.getRecordType() == StoredConfigKey.RecordType.SETTING).forEach(recordID -> {<NEW_LINE>final SearchResultItem item = SearchResultItem.fromKey(recordID, storedConfiguration, locale);<NEW_LINE>final String returnCategory = item.getNavigation();<NEW_LINE>returnData.computeIfAbsent(returnCategory, k -> new TreeMap<>()).put(recordID.getRecordID(), item);<NEW_LINE>});<NEW_LINE>restResultBean = RestResultBean.withData(returnData, Map.class);<NEW_LINE>pwmRequest.outputJsonResult(restResultBean);<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>} | searchTerm = valueMap.get("search"); |
545,925 | StringBuilder appendAttrs(StringBuilder sb) {<NEW_LINE>Object[] sharedPairs = sharedPairs();<NEW_LINE><MASK><NEW_LINE>sb.append("{");<NEW_LINE>if (sharedPairs.length > 0) {<NEW_LINE>sb.append('S').append(sharedPairs.length).append('{');<NEW_LINE>for (int i = 0; i < sharedPairs.length; ) {<NEW_LINE>if (i > 0)<NEW_LINE>sb.append(',');<NEW_LINE>Object key = ((KeyWrapper) sharedPairs[i++]).key;<NEW_LINE>Object value = sharedPairs[i++];<NEW_LINE>sb.append(key).append("=").append(value);<NEW_LINE>}<NEW_LINE>sb.append('}');<NEW_LINE>}<NEW_LINE>if (extraPairs.length > 0) {<NEW_LINE>sb.append('S').append(extraPairs.length).append('{');<NEW_LINE>for (int i = 0; i < extraPairs.length; ) {<NEW_LINE>if (i > 0)<NEW_LINE>sb.append(',');<NEW_LINE>Object key = extraPairs[i++];<NEW_LINE>Object value = extraPairs[i++];<NEW_LINE>sb.append(key).append("=").append(value);<NEW_LINE>}<NEW_LINE>sb.append('}');<NEW_LINE>}<NEW_LINE>sb.append('}');<NEW_LINE>return sb;<NEW_LINE>} | Object[] extraPairs = extraPairs(); |
487,034 | final CreateRecipeResult executeCreateRecipe(CreateRecipeRequest createRecipeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRecipeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRecipeRequest> request = null;<NEW_LINE>Response<CreateRecipeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateRecipeRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRecipe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRecipeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRecipeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(createRecipeRequest)); |
867,583 | private void addInfusionConversionCarbonRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Charcoal Block<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(MekanismTags.Items.STORAGE_BLOCKS_CHARCOAL), MekanismInfuseTypes.CARBON.getStack(180)).build(consumer, Mekanism.rl(basePath + "from_charcoal_block"));<NEW_LINE>// Charcoal<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(BaseRecipeProvider.createIngredient(MekanismTags.Items.DUSTS_CHARCOAL, Items.CHARCOAL)), MekanismInfuseTypes.CARBON.getStack(20)).build(consumer, Mekanism.rl(basePath + "from_charcoal"));<NEW_LINE>// Coal Block<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(Tags.Items.STORAGE_BLOCKS_COAL), MekanismInfuseTypes.CARBON.getStack(90)).build(consumer, Mekanism<MASK><NEW_LINE>// Coal<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(BaseRecipeProvider.createIngredient(MekanismTags.Items.DUSTS_COAL, Items.COAL)), MekanismInfuseTypes.CARBON.getStack(10)).build(consumer, Mekanism.rl(basePath + "from_coal"));<NEW_LINE>// Enriched<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(MekanismTags.Items.ENRICHED_CARBON), MekanismInfuseTypes.CARBON.getStack(80)).build(consumer, Mekanism.rl(basePath + "from_enriched"));<NEW_LINE>} | .rl(basePath + "from_coal_block")); |
635,662 | protected boolean decode() throws IOException {<NEW_LINE>if (rleOnlyMode) {<NEW_LINE>// for RLE only mode there is nothing more to read<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (inputStream.available() <= 0) {<NEW_LINE>currentCount = 0;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int header = readUnsignedVarInt(inputStream);<NEW_LINE>mode = (header & 1) == 0 ? RLE : PACKED;<NEW_LINE>switch(mode) {<NEW_LINE>case RLE:<NEW_LINE>currentCount = header >>> 1;<NEW_LINE>currentValue = readIntLittleEndianPaddedOnBitWidth(inputStream, bitWidth);<NEW_LINE>return true;<NEW_LINE>case PACKED:<NEW_LINE>int numGroups = header >>> 1;<NEW_LINE>currentCount = numGroups * 8;<NEW_LINE>currentBuffer = new int[currentCount];<NEW_LINE>byte[] bytes = new byte[numGroups * bitWidth];<NEW_LINE>int bytesToRead = (int) ceil((double) (currentCount * bitWidth) / 8.0D);<NEW_LINE>bytesToRead = Math.min(bytesToRead, inputStream.available());<NEW_LINE>DataInputStream dataInputStream = new DataInputStream(inputStream);<NEW_LINE>dataInputStream.readFully(bytes, 0, bytesToRead);<NEW_LINE>int valueIndex = 0;<NEW_LINE>for (int byteIndex = 0; valueIndex < currentCount; byteIndex += bitWidth) {<NEW_LINE>packer.unpack8Values(bytes, byteIndex, currentBuffer, valueIndex);<NEW_LINE>valueIndex += 8;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new ParquetDecodingException("not a valid mode " + mode); |
758,987 | // Event Handlers ---<NEW_LINE>@Override<NEW_LINE>public void onAttachOrDetach(AttachEvent event) {<NEW_LINE>if (event.isAttached()) {<NEW_LINE>previewHandler_ = Event.addNativePreviewHandler(new NativePreviewHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPreviewNativeEvent(NativePreviewEvent preview) {<NEW_LINE>int type = preview.getTypeInt();<NEW_LINE>if (type == Event.ONKEYDOWN) {<NEW_LINE>int modifier = KeyboardShortcut.<MASK><NEW_LINE>beginDetectClickTarget(mouseTracker_.getLastMouseX(), mouseTracker_.getLastMouseY(), modifier);<NEW_LINE>} else if (type == Event.ONKEYUP) {<NEW_LINE>endDetectClickTarget();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>for (HandlerRegistration handler : handlers_) handler.removeHandler();<NEW_LINE>handlers_.clear();<NEW_LINE>if (previewHandler_ != null) {<NEW_LINE>previewHandler_.removeHandler();<NEW_LINE>previewHandler_ = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getModifierValue(preview.getNativeEvent()); |
457,511 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View rootView = inflater.inflate(R.layout.fragment_diary, container, false);<NEW_LINE>ScrollView_diary_content = (ScrollView) rootView.findViewById(R.id.ScrollView_diary_content);<NEW_LINE>ViewTools.setScrollBarColor(getActivity(), ScrollView_diary_content);<NEW_LINE>RL_diary_info = (RelativeLayout) rootView.findViewById(R.id.RL_diary_info);<NEW_LINE>RL_diary_info.setBackgroundColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));<NEW_LINE>LinearLayout LL_diary_edit_bar = (LinearLayout) rootView.<MASK><NEW_LINE>LL_diary_edit_bar.setBackgroundColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));<NEW_LINE>LL_diary_time_information = (LinearLayout) rootView.findViewById(R.id.LL_diary_time_information);<NEW_LINE>LL_diary_time_information.setOnClickListener(this);<NEW_LINE>TV_diary_month = (TextView) rootView.findViewById(R.id.TV_diary_month);<NEW_LINE>TV_diary_date = (TextView) rootView.findViewById(R.id.TV_diary_date);<NEW_LINE>TV_diary_day = (TextView) rootView.findViewById(R.id.TV_diary_day);<NEW_LINE>TV_diary_time = (TextView) rootView.findViewById(R.id.TV_diary_time);<NEW_LINE>TV_diary_location = (TextView) rootView.findViewById(R.id.TV_diary_location);<NEW_LINE>rootView.findViewById(IV_diary_location_name_icon).setVisibility(View.VISIBLE);<NEW_LINE>SP_diary_weather = (Spinner) rootView.findViewById(R.id.SP_diary_weather);<NEW_LINE>SP_diary_weather.setVisibility(View.VISIBLE);<NEW_LINE>SP_diary_mood = (Spinner) rootView.findViewById(R.id.SP_diary_mood);<NEW_LINE>SP_diary_mood.setVisibility(View.VISIBLE);<NEW_LINE>EDT_diary_title = (EditText) rootView.findViewById(R.id.EDT_diary_title);<NEW_LINE>EDT_diary_title.getBackground().mutate().setColorFilter(ThemeManager.getInstance().getThemeMainColor(getActivity()), PorterDuff.Mode.SRC_ATOP);<NEW_LINE>TV_diary_item_content_hint = (TextView) rootView.findViewById(R.id.TV_diary_item_content_hint);<NEW_LINE>// For create diary<NEW_LINE>LL_diary_item_content = (LinearLayout) rootView.findViewById(R.id.LL_diary_item_content);<NEW_LINE>LL_diary_item_content.setOnClickListener(this);<NEW_LINE>IV_diary_menu = (ImageView) rootView.findViewById(R.id.IV_diary_menu);<NEW_LINE>IV_diary_location = (ImageView) rootView.findViewById(R.id.IV_diary_location);<NEW_LINE>IV_diary_location.setOnClickListener(this);<NEW_LINE>IV_diary_photo = (ImageView) rootView.findViewById(R.id.IV_diary_photo);<NEW_LINE>IV_diary_photo.setOnClickListener(this);<NEW_LINE>IV_diary_delete = (ImageView) rootView.findViewById(R.id.IV_diary_delete);<NEW_LINE>IV_diary_delete.setVisibility(View.GONE);<NEW_LINE>IV_diary_clear = (ImageView) rootView.findViewById(R.id.IV_diary_clear);<NEW_LINE>IV_diary_clear.setOnClickListener(this);<NEW_LINE>IV_diary_save = (ImageView) rootView.findViewById(R.id.IV_diary_save);<NEW_LINE>IV_diary_save.setOnClickListener(this);<NEW_LINE>return rootView;<NEW_LINE>} | findViewById(R.id.LL_diary_edit_bar); |
1,747,013 | public int generate(EditSession editSession, BiomeType baseBiome, boolean hollow) {<NEW_LINE>int affected = 0;<NEW_LINE>for (BlockVector3 position : getExtent()) {<NEW_LINE>int x = position.getBlockX();<NEW_LINE>int y = position.getBlockY();<NEW_LINE>int z = position.getBlockZ();<NEW_LINE>if (!hollow) {<NEW_LINE>final BiomeType material = getBiome(x, y, z, baseBiome);<NEW_LINE>if (material != null) {<NEW_LINE>editSession.getWorld().setBiome(position, material);<NEW_LINE>++affected;<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final BiomeType material = getBiomeCached(<MASK><NEW_LINE>if (material == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!shouldDraw(x, y, z, material)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>editSession.getWorld().setBiome(position, material);<NEW_LINE>++affected;<NEW_LINE>}<NEW_LINE>return affected;<NEW_LINE>} | x, y, z, baseBiome); |
1,316,154 | private void drawHorizontalDecorations(Canvas canvas, RecyclerView parent) {<NEW_LINE>if (!needsHorizontalDecoration()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FlexboxLayoutManager layoutManager = (FlexboxLayoutManager) parent.getLayoutManager();<NEW_LINE>int flexDirection = layoutManager.getFlexDirection();<NEW_LINE>int parentLeft = parent.getLeft() - parent.getPaddingLeft();<NEW_LINE>int parentRight = parent.getRight() + parent.getPaddingRight();<NEW_LINE>int childCount = parent.getChildCount();<NEW_LINE>for (int i = 0; i < childCount; i++) {<NEW_LINE>View child = parent.getChildAt(i);<NEW_LINE>RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) child.getLayoutParams();<NEW_LINE>int top, bottom;<NEW_LINE>if (flexDirection == FlexDirection.COLUMN_REVERSE) {<NEW_LINE>top = child.getBottom() + lp.bottomMargin;<NEW_LINE>bottom = top + mDrawable.getIntrinsicHeight();<NEW_LINE>} else {<NEW_LINE>bottom = child.getTop() - lp.topMargin;<NEW_LINE>top <MASK><NEW_LINE>}<NEW_LINE>int left, right;<NEW_LINE>if (layoutManager.isMainAxisDirectionHorizontal()) {<NEW_LINE>if (layoutManager.isLayoutRtl()) {<NEW_LINE>right = child.getRight() + lp.rightMargin + mDrawable.getIntrinsicWidth();<NEW_LINE>right = Math.min(right, parentRight);<NEW_LINE>left = child.getLeft() - lp.leftMargin;<NEW_LINE>} else {<NEW_LINE>left = child.getLeft() - lp.leftMargin - mDrawable.getIntrinsicWidth();<NEW_LINE>left = Math.max(left, parentLeft);<NEW_LINE>right = child.getRight() + lp.rightMargin;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>left = child.getLeft() - lp.leftMargin;<NEW_LINE>right = child.getRight() + lp.rightMargin;<NEW_LINE>}<NEW_LINE>mDrawable.setBounds(left, top, right, bottom);<NEW_LINE>mDrawable.draw(canvas);<NEW_LINE>}<NEW_LINE>} | = bottom - mDrawable.getIntrinsicHeight(); |
741,492 | private void putMultisets(FactoryCache cache) {<NEW_LINE>cache.put(Multiset.class, collection(HashMultiset::create));<NEW_LINE>cache.put(SortedMultiset.class, collection(() -> TreeMultiset.create(OBJECT_COMPARATOR)));<NEW_LINE>cache.put(HashMultiset.class, collection(HashMultiset::create));<NEW_LINE>cache.put(TreeMultiset.class, collection(() -> TreeMultiset.create(OBJECT_COMPARATOR)));<NEW_LINE>cache.put(LinkedHashMultiset.class, collection(LinkedHashMultiset::create));<NEW_LINE>cache.put(ConcurrentHashMultiset.class, collection(ConcurrentHashMultiset::create));<NEW_LINE>cache.put(EnumMultiset.class, new EnumSetFactory<MASK><NEW_LINE>cache.put(ImmutableMultiset.class, copy(Set.class, ImmutableMultiset::copyOf));<NEW_LINE>cache.put(ImmutableSortedMultiset.class, copy(SortedMultiset.class, ImmutableSortedMultiset::copyOfSorted));<NEW_LINE>} | <>(EnumMultiset::create)); |
854,287 | public void resetAvatarImage() {<NEW_LINE>if (avatarFrame == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (credentialsMapping.getConnector() instanceof IAvatar) {<NEW_LINE>AndroidRxUtils.andThenOnUi(AndroidRxUtils.networkScheduler, () -> AvatarUtils.getAvatar((IAvatar) credentialsMapping.getConnector()), img -> {<NEW_LINE>if (img != null) {<NEW_LINE>final ImageView iconView = new ImageView(getContext());<NEW_LINE>iconView.setImageDrawable(img);<NEW_LINE>avatarFrame.removeAllViews();<NEW_LINE>avatarFrame.addView(iconView);<NEW_LINE><MASK><NEW_LINE>final LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1.5f);<NEW_LINE>avatarFrame.setLayoutParams(param);<NEW_LINE>} else {<NEW_LINE>avatarFrame.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>avatarFrame.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | avatarFrame.setVisibility(View.VISIBLE); |
497,185 | public StringIndexerTrainBatchOp linkFrom(BatchOperator<?>... inputs) {<NEW_LINE>BatchOperator<?> in = checkAndGetFirst(inputs);<NEW_LINE>final String selectedCol = getSelectedCol();<NEW_LINE>final String[] selectedCols = getSelectedCols();<NEW_LINE>String[] allSelectCols = new String[] { selectedCol };<NEW_LINE>if (selectedCols != null) {<NEW_LINE>allSelectCols = new String[selectedCols.length + 1];<NEW_LINE>allSelectCols[0] = selectedCol;<NEW_LINE>for (int i = 0; i < selectedCols.length; i++) {<NEW_LINE>allSelectCols[i + 1] = selectedCols[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final HasStringOrderTypeDefaultAsRandom.StringOrderType orderType = getStringOrderType();<NEW_LINE>TypeInformation[] types = TableUtil.findColTypes(in.getSchema(), allSelectCols);<NEW_LINE>for (TypeInformation type : types) {<NEW_LINE>if (!type.equals(types[0])) {<NEW_LINE>throw new RuntimeException("All selectCols must be the same type!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DataSet<Tuple2<Integer, String>> inputRows = ((DataSet<Row>) in.select(allSelectCols).getDataSet()).flatMap(new FlatMapFunction<Row, Tuple2<Integer, String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void flatMap(Row row, Collector<Tuple2<Integer, String>> collector) throws Exception {<NEW_LINE>for (int i = 0; i < row.getArity(); i++) {<NEW_LINE>if (row.getField(i) != null) {<NEW_LINE>collector.collect(Tuple2.of(0, String.valueOf(row.getField(i))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 584117860691580161L;<NEW_LINE>}).name("flatten_input_feature").returns(new TupleTypeInfo<>(Types.INT, Types.STRING));<NEW_LINE>DataSet<Tuple3<Integer, String, Long>> indexedToken = HugeStringIndexerUtil.indexTokens(inputRows, orderType, 0L);<NEW_LINE>DataSet<Row> values = indexedToken.mapPartition(new RichMapPartitionFunction<Tuple3<Integer, String, Long>, Row>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 176349483834372192L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mapPartition(Iterable<Tuple3<Integer, String, Long>> values, Collector<Row> out) throws Exception {<NEW_LINE>new StringIndexerModelDataConverter().save(values, out);<NEW_LINE>}<NEW_LINE>}).name("build_model").returns(new RowTypeInfo(new StringIndexerModelDataConverter().getModelSchema().getFieldTypes()));<NEW_LINE>this.setOutput(values, new <MASK><NEW_LINE>return this;<NEW_LINE>} | StringIndexerModelDataConverter().getModelSchema()); |
1,640,059 | private Mono<Response<Flux<ByteBuffer>>> stopWithResponseAsync(String groupName, String serviceName) {<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 (groupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
414,405 | public void execute() throws AnalysisException {<NEW_LINE>if (groupExpression.hasApplied(rule)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GroupExpressionMatching groupExpressionMatching = new GroupExpressionMatching(rule.getPattern(), groupExpression);<NEW_LINE>for (Plan plan : groupExpressionMatching) {<NEW_LINE>context.onInvokeRule(rule.getRuleType());<NEW_LINE>List<Plan> newPlans = rule.transform(<MASK><NEW_LINE>for (Plan newPlan : newPlans) {<NEW_LINE>CopyInResult result = context.getCascadesContext().getMemo().copyIn(newPlan, groupExpression.getOwnerGroup(), false);<NEW_LINE>if (!result.generateNewExpression) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>GroupExpression newGroupExpression = result.correspondingExpression;<NEW_LINE>if (newPlan instanceof LogicalPlan) {<NEW_LINE>if (exploredOnly) {<NEW_LINE>pushJob(new ExploreGroupExpressionJob(newGroupExpression, context));<NEW_LINE>pushJob(new DeriveStatsJob(newGroupExpression, context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>pushJob(new OptimizeGroupExpressionJob(newGroupExpression, context));<NEW_LINE>pushJob(new DeriveStatsJob(newGroupExpression, context));<NEW_LINE>} else {<NEW_LINE>pushJob(new CostAndEnforcerJob(newGroupExpression, context));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groupExpression.setApplied(rule);<NEW_LINE>} | plan, context.getCascadesContext()); |
597,402 | private Haplotype composeInsertionHaplotype(final ReferenceBases referenceBases) {<NEW_LINE>final byte[] insertedSequence = getInsertedSequence();<NEW_LINE>final byte[] referenceBaseBytes = referenceBases.getBases();<NEW_LINE>final byte[] resultBases = new byte[referenceBases.getInterval().size() + insertedSequence.length];<NEW_LINE>final int leftPaddingSize = getStart() - referenceBases.getInterval().getStart() + 1;<NEW_LINE>final int rightPaddingSize = referenceBases.getInterval().getEnd() - getStart();<NEW_LINE>System.arraycopy(referenceBaseBytes, 0, resultBases, 0, leftPaddingSize);<NEW_LINE>System.arraycopy(insertedSequence, 0, resultBases, leftPaddingSize, insertedSequence.length);<NEW_LINE>System.arraycopy(referenceBaseBytes, leftPaddingSize, resultBases, leftPaddingSize + insertedSequence.length, rightPaddingSize);<NEW_LINE>final Cigar cigar = new Cigar(Arrays.asList(new CigarElement(leftPaddingSize, CigarOperator.M), new CigarElement(insertedSequence.length, CigarOperator.I), new CigarElement(rightPaddingSize, CigarOperator.M)));<NEW_LINE>final Haplotype result = new Haplotype(resultBases, false);<NEW_LINE>result.setCigar(cigar);<NEW_LINE>result.<MASK><NEW_LINE>return result;<NEW_LINE>} | setGenomeLocation(referenceBases.getInterval()); |
581,562 | public synchronized void merge(MergeSource mergeSource, MergeTrigger trigger) throws IOException {<NEW_LINE>if (trigger == MergeTrigger.CLOSING) {<NEW_LINE>// Disable throttling on close:<NEW_LINE>targetMBPerSec = MAX_MERGE_MB_PER_SEC;<NEW_LINE>updateMergeThreads();<NEW_LINE>}<NEW_LINE>// First, quickly run through the newly proposed merges<NEW_LINE>// and add any orthogonal merges (ie a merge not<NEW_LINE>// involving segments already pending to be merged) to<NEW_LINE>// the queue. If we are way behind on merging, many of<NEW_LINE>// these newly proposed merges will likely already be<NEW_LINE>// registered.<NEW_LINE>if (verbose()) {<NEW_LINE>message("now merge");<NEW_LINE>message(<MASK><NEW_LINE>}<NEW_LINE>// Iterate, pulling from the IndexWriter's queue of<NEW_LINE>// pending merges, until it's empty:<NEW_LINE>while (true) {<NEW_LINE>if (maybeStall(mergeSource) == false) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>OneMerge merge = mergeSource.getNextMerge();<NEW_LINE>if (merge == null) {<NEW_LINE>if (verbose()) {<NEW_LINE>message(" no more merges pending; now return");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>// OK to spawn a new merge thread to handle this<NEW_LINE>// merge:<NEW_LINE>final MergeThread newMergeThread = getMergeThread(mergeSource, merge);<NEW_LINE>mergeThreads.add(newMergeThread);<NEW_LINE>updateIOThrottle(newMergeThread.merge, newMergeThread.rateLimiter);<NEW_LINE>if (verbose()) {<NEW_LINE>message(" launch new thread [" + newMergeThread.getName() + "]");<NEW_LINE>}<NEW_LINE>newMergeThread.start();<NEW_LINE>updateMergeThreads();<NEW_LINE>success = true;<NEW_LINE>} finally {<NEW_LINE>if (!success) {<NEW_LINE>mergeSource.onMergeFinished(merge);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | " index(source): " + mergeSource.toString()); |
1,135,523 | private void encode(Object value, ChannelBuffer cb) throws ProtocolException {<NEW_LINE>// try {<NEW_LINE>if (value == null) {<NEW_LINE>encodeNull(cb);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>encodeString((String) value, cb);<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>encodeBoolean((Boolean) value, cb);<NEW_LINE>} else if (value instanceof Short) {<NEW_LINE>encodeInt((Short) value, cb);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>encodeInt((Integer) value, cb);<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>encodeLong((Long) value, cb);<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>encodeDouble(((Float) value).doubleValue(), cb);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>encodeDouble((Double) value, cb);<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>// Other numbers (i.e.<NEW_LINE>// BigInteger and BigDecimal)<NEW_LINE>encodeString(<MASK><NEW_LINE>} else if (value instanceof Collection) {<NEW_LINE>encodeCollection((Collection<?>) value, cb);<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>encodeMap((Map<?, ?>) value, cb);<NEW_LINE>} else if (value.getClass().isArray()) {<NEW_LINE>int arraySize = Array.getLength(value);<NEW_LINE>List<Object> arrayToList = new ArrayList<>(arraySize);<NEW_LINE>for (int i = 0; i < arraySize; i++) {<NEW_LINE>arrayToList.add(Array.get(value, i));<NEW_LINE>}<NEW_LINE>encodeCollection(arrayToList, cb);<NEW_LINE>} else {<NEW_LINE>throw new ProtocolException("Unsupported type : " + value.getClass().getName());<NEW_LINE>}<NEW_LINE>// } catch (Exception e) {<NEW_LINE>// throw new ProtocolException(e);<NEW_LINE>// }<NEW_LINE>} | value.toString(), cb); |
559,702 | protected ErrorDescription[] apply(TypeElement subject, ProblemContext ctx) {<NEW_LINE>ArrayList<ErrorDescription> errors = new ArrayList<ErrorDescription>();<NEW_LINE>AnnotationMirror annEntity = Utilities.findAnnotation(subject, ANNOTATION_WEBSERVICE);<NEW_LINE>if (subject.getKind() == ElementKind.CLASS && Utilities.getAnnotationAttrValue(annEntity, ANNOTATION_ATTRIBUTE_SEI) != null) {<NEW_LINE>for (String aName : new String[] { ANNOTATION_WEBMETHOD, ANNOTATION_WEBPARAM, ANNOTATION_WEBRESULT, ANNOTATION_ONEWAY, ANNOTATION_SOAPMESSAGEHANDLERS, ANNOTATION_INITPARAM, ANNOTATION_SOAPBINDING, ANNOTATION_SOAPMESSAGEHANDLER }) {<NEW_LINE>AnnotationMirror wrongAnnon = Utilities.findAnnotation(subject, aName);<NEW_LINE>if (wrongAnnon != null) {<NEW_LINE>String label = NbBundle.getMessage(InvalidJSRAnnotations.class, "MSG_Invalid_JSR181Annotation");<NEW_LINE>Tree problemTree = ctx.getCompilationInfo().getTrees().getTree(subject, wrongAnnon);<NEW_LINE>Fix removeHC = new RemoveAnnotation(ctx.getFileObject(), subject, wrongAnnon);<NEW_LINE>ctx.setElementToAnnotate(problemTree);<NEW_LINE>errors.add(createProblem(subject, ctx, label, removeHC));<NEW_LINE>ctx.setElementToAnnotate(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return errors.isEmpty() ? null : errors.toArray(new ErrorDescription<MASK><NEW_LINE>} | [errors.size()]); |
1,595,579 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>lblImage = new javax.swing.JLabel();<NEW_LINE>// Variables declaration - do not modify//GEN-BEGIN:variables<NEW_LINE>javax.swing.JPanel jPanel1 = new javax.swing.JPanel();<NEW_LINE>lblName = new javax.swing.JLabel();<NEW_LINE>lblVersion = new javax.swing.JLabel();<NEW_LINE>lblCopyright = new javax.swing.JLabel();<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>lblImage.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>// NOI18N<NEW_LINE>lblImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/fr3ts0n/ecu/gui/res/JaVAG_Logo.png")));<NEW_LINE>add(lblImage, java.awt.BorderLayout.CENTER);<NEW_LINE>jPanel1.setLayout(new java.awt.GridLayout(0, 1));<NEW_LINE>lblName.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>jPanel1.add(lblName);<NEW_LINE>lblVersion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>jPanel1.add(lblVersion);<NEW_LINE>add(jPanel1, <MASK><NEW_LINE>lblCopyright.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>add(lblCopyright, java.awt.BorderLayout.PAGE_END);<NEW_LINE>} | java.awt.BorderLayout.PAGE_START); |
1,446,004 | public void inspectFlow(FacesContext context, Flow flow) {<NEW_LINE>Map<String, Set<NavigationCase>> rules = flow.getNavigationCases();<NEW_LINE>int rulesSize = rules.size();<NEW_LINE>Map<String, Set<NavigationCase>> cases = new HashMap<String, Set<NavigationCase>>(HashMapUtils.calcCapacity(rulesSize));<NEW_LINE>List<_WildcardPattern> wildcardPatterns = new ArrayList<_WildcardPattern>();<NEW_LINE>for (Map.Entry<String, Set<NavigationCase>> entry : rules.entrySet()) {<NEW_LINE>String fromViewId = entry.getKey();<NEW_LINE>// specification 7.4.2 footnote 4 - missing fromViewId is allowed:<NEW_LINE>if (fromViewId == null) {<NEW_LINE>fromViewId = ASTERISK;<NEW_LINE>} else {<NEW_LINE>fromViewId = fromViewId.trim();<NEW_LINE>}<NEW_LINE>Set<NavigationCase> set = cases.get(fromViewId);<NEW_LINE>if (set == null) {<NEW_LINE>set = new HashSet<NavigationCase>(entry.getValue());<NEW_LINE><MASK><NEW_LINE>if (fromViewId.endsWith(ASTERISK)) {<NEW_LINE>wildcardPatterns.add(new _WildcardPattern(fromViewId));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>set.addAll(entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(wildcardPatterns, new KeyComparator());<NEW_LINE>_flowNavigationStructureMap.put(flow.getId(), new _FlowNavigationStructure(flow.getDefiningDocumentId(), flow.getId(), cases, wildcardPatterns));<NEW_LINE>} | cases.put(fromViewId, set); |
1,489,856 | public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>List<JasperPrint> jasperPrintList = BaseHttpServlet.getJasperPrintList(request);<NEW_LINE>if (jasperPrintList == null) {<NEW_LINE>throw new ServletException("No JasperPrint documents found on the HTTP session.");<NEW_LINE>}<NEW_LINE>Boolean isBuffered = Boolean.valueOf(request.getParameter(BaseHttpServlet.BUFFERED_OUTPUT_REQUEST_PARAMETER));<NEW_LINE>if (isBuffered) {<NEW_LINE>FileBufferedOutputStream fbos = new FileBufferedOutputStream();<NEW_LINE>JROdsExporter exporter = new JROdsExporter(DefaultJasperReportsContext.getInstance());<NEW_LINE>exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));<NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fbos));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>fbos.close();<NEW_LINE>if (fbos.size() > 0) {<NEW_LINE>response.setContentType("application/vnd.oasis.opendocument.spreadsheet");<NEW_LINE>response.setHeader("Content-Disposition", "inline; filename=\"file.ods\"");<NEW_LINE>response.setContentLength(fbos.size());<NEW_LINE>ServletOutputStream outputStream = response.getOutputStream();<NEW_LINE>try {<NEW_LINE>fbos.writeData(outputStream);<NEW_LINE>fbos.dispose();<NEW_LINE>outputStream.flush();<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>fbos.close();<NEW_LINE>fbos.dispose();<NEW_LINE>}<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>// response.setContentType("text/html");<NEW_LINE>// PrintWriter out = response.getWriter();<NEW_LINE>// out.println("<html>");<NEW_LINE>// out.println("<body bgcolor=\"white\">");<NEW_LINE>// out.println("<span class=\"bold\">Empty response.</span>");<NEW_LINE>// out.println("</body>");<NEW_LINE>// out.println("</html>");<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>response.setContentType("application/vnd.oasis.opendocument.spreadsheet");<NEW_LINE>response.setHeader("Content-Disposition", "inline; filename=\"file.ods\"");<NEW_LINE>JROdsExporter exporter = new <MASK><NEW_LINE>exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));<NEW_LINE>OutputStream outputStream = response.getOutputStream();<NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | JROdsExporter(DefaultJasperReportsContext.getInstance()); |
1,225,720 | private static ResultCursor handleExplainDdl(ExecutionContext executionContext, ExecutionPlan executionPlan) {<NEW_LINE>if (executionPlan.getPlan() instanceof BaseDdlOperation) {<NEW_LINE>final BaseDdlOperation plan = (BaseDdlOperation) executionPlan.getPlan();<NEW_LINE>ArrayResultCursor result = new ArrayResultCursor("ExecutionPlan");<NEW_LINE>result.addColumn("Logical ExecutionPlan", DataTypes.StringType);<NEW_LINE>result.addColumn("DDL Sql", DataTypes.StringType);<NEW_LINE>result.addColumn("Logical_Table", DataTypes.StringType);<NEW_LINE>result.addColumn("Sharding", DataTypes.StringType);<NEW_LINE>result.addColumn("Count", DataTypes.IntegerType);<NEW_LINE>result.initMeta();<NEW_LINE>result.addRow(new Object[] { "DDL:ReturnType:" + plan.getRowType() + ",HitCache:" + executionPlan.isHitCache(), executionPlan.getAst().toString(), plan.getTableName(), "", -1 });<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return handleExplain(executionContext, <MASK><NEW_LINE>}<NEW_LINE>} | executionPlan, ExplainResult.ExplainMode.DETAIL); |
340,064 | private static void writeDiagnostics(ZipOutputStream zip, List<DiagnosticsReportSource> sources, DiagnosticsReporterProgress progress) {<NEW_LINE>int step = 0;<NEW_LINE>// same as default buf size in buffered streams<NEW_LINE>final byte[] buf = new byte[(int) kibiBytes(8)];<NEW_LINE>for (DiagnosticsReportSource source : sources) {<NEW_LINE>++step;<NEW_LINE>progress.started(step, source.destinationPath());<NEW_LINE>try (<MASK><NEW_LINE>InputStream input = new ProgressAwareInputStream(new BufferedInputStream(rawInput), source.estimatedSize(), progress::percentChanged)) {<NEW_LINE>final ZipEntry entry = new ZipEntry(source.destinationPath());<NEW_LINE>zip.putNextEntry(entry);<NEW_LINE>int chunkSize;<NEW_LINE>while ((chunkSize = input.read(buf)) >= 0) {<NEW_LINE>zip.write(buf, 0, chunkSize);<NEW_LINE>}<NEW_LINE>zip.closeEntry();<NEW_LINE>} catch (Exception e) {<NEW_LINE>progress.error("Failed to write " + source.destinationPath(), e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>progress.finished();<NEW_LINE>}<NEW_LINE>} | InputStream rawInput = source.newInputStream(); |
1,341,532 | public static Spinner create(double min, double max, double currentValue, double step) {<NEW_LINE>Spinner s = new Spinner(new SpinnerNumberModel(min, max, currentValue, step), new SpinnerRenderer<Object>() {<NEW_LINE><NEW_LINE>public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected) {<NEW_LINE>if (value != null && value instanceof Double) {<NEW_LINE>// round the number in the spinner to two digits<NEW_LINE>double d = ((Double) value).doubleValue();<NEW_LINE>long l = (long) d;<NEW_LINE>long r = (long) (d * 100);<NEW_LINE>r %= 100;<NEW_LINE>if (r == 0) {<NEW_LINE>value = "" + l;<NEW_LINE>} else {<NEW_LINE>value = "" + l + "." + r;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.getListCellRendererComponent(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>s.setRenderingPrototype(new Double(max * 10));<NEW_LINE>return s;<NEW_LINE>} | list, value, index, isSelected); |
343,655 | protected void drawShadow(mxGraphicsCanvas2D canvas, mxCellState state, double rotation, boolean flipH, boolean flipV, mxRectangle bounds, double alpha, boolean filled) {<NEW_LINE>// Requires background in generic shape for shadow, looks like only one<NEW_LINE>// fillAndStroke is allowed per current path, try working around that<NEW_LINE>// Computes rotated shadow offset<NEW_LINE>double rad = rotation * Math.PI / 180;<NEW_LINE>double cos <MASK><NEW_LINE>double sin = Math.sin(-rad);<NEW_LINE>mxPoint offset = mxUtils.getRotatedPoint(new mxPoint(mxConstants.SHADOW_OFFSETX, mxConstants.SHADOW_OFFSETY), cos, sin);<NEW_LINE>if (flipH) {<NEW_LINE>offset.setX(offset.getX() * -1);<NEW_LINE>}<NEW_LINE>if (flipV) {<NEW_LINE>offset.setY(offset.getY() * -1);<NEW_LINE>}<NEW_LINE>// TODO: Use save/restore instead of negative offset to restore (requires fix for HTML canvas)<NEW_LINE>canvas.translate(offset.getX(), offset.getY());<NEW_LINE>// Returns true if a shadow has been painted (path has been created)<NEW_LINE>if (drawShape(canvas, state, bounds, true)) {<NEW_LINE>canvas.setAlpha(mxConstants.STENCIL_SHADOW_OPACITY * alpha);<NEW_LINE>// TODO: Implement new shadow<NEW_LINE>// canvas.shadow(mxConstants.STENCIL_SHADOWCOLOR, filled);<NEW_LINE>}<NEW_LINE>canvas.translate(-offset.getX(), -offset.getY());<NEW_LINE>} | = Math.cos(-rad); |
928,385 | public void deleteShardStore(String reason, ShardId shardId, ClusterState clusterState) throws IOException, ShardLockObtainFailedException {<NEW_LINE>final IndexMetadata metadata = clusterState.getMetadata().indices().get(shardId.getIndexName());<NEW_LINE><MASK><NEW_LINE>ShardDeletionCheckResult shardDeletionCheckResult = canDeleteShardContent(shardId, indexSettings);<NEW_LINE>if (shardDeletionCheckResult != ShardDeletionCheckResult.FOLDER_FOUND_CAN_DELETE) {<NEW_LINE>throw new IllegalStateException("Can't delete shard " + shardId + " (cause: " + shardDeletionCheckResult + ")");<NEW_LINE>}<NEW_LINE>nodeEnv.deleteShardDirectorySafe(shardId, indexSettings);<NEW_LINE>LOGGER.debug("{} deleted shard reason [{}]", shardId, reason);<NEW_LINE>if (canDeleteIndexContents(shardId.getIndex(), indexSettings)) {<NEW_LINE>if (nodeEnv.findAllShardIds(shardId.getIndex()).isEmpty()) {<NEW_LINE>try {<NEW_LINE>// note that deleteIndexStore have more safety checks and may throw an exception if index was concurrently created.<NEW_LINE>deleteIndexStore("no longer used", metadata);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// wrap the exception to indicate we already deleted the shard<NEW_LINE>throw new ElasticsearchException("failed to delete unused index after deleting its last shard (" + shardId + ")", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.trace("[{}] still has shard stores, leaving as is", shardId.getIndex());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final IndexSettings indexSettings = buildIndexSettings(metadata); |
1,722,481 | public static void main(String[] args) throws Exception {<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>// Set rate limit to 1000 bytes per second (since parallelism is set to 2,<NEW_LINE>builder.setSpout("word", new TestWordSpout(), 2).// each instance is rate limited as 500 bps).<NEW_LINE>addConfiguration(Config.TOPOLOGY_COMPONENT_OUTPUT_BPS, 1000);<NEW_LINE>builder.setBolt("exclaim1", new ExclamationBolt(), 2).shuffleGrouping("word");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>conf.setMaxSpoutPending(10);<NEW_LINE>// component resource configuration<NEW_LINE>conf.setComponentCpu("word", 0.5);<NEW_LINE>conf.setComponentRam("word", ByteAmount.fromMegabytes(512));<NEW_LINE>conf.setComponentDisk("word", ByteAmount.fromMegabytes(512));<NEW_LINE><MASK><NEW_LINE>conf.setComponentRam("exclaim1", ByteAmount.fromMegabytes(512));<NEW_LINE>conf.setComponentDisk("exclaim1", ByteAmount.fromMegabytes(512));<NEW_LINE>// container resource configuration<NEW_LINE>conf.setContainerDiskRequested(ByteAmount.fromGigabytes(2));<NEW_LINE>conf.setContainerRamRequested(ByteAmount.fromGigabytes(3));<NEW_LINE>conf.setContainerCpuRequested(2);<NEW_LINE>// Specify the size of RAM padding to per container.<NEW_LINE>// Notice, this config will be considered as a hint,<NEW_LINE>// and it's up to the packing algorithm to determine whether to apply this hint<NEW_LINE>conf.setContainerRamPadding(ByteAmount.fromGigabytes(2));<NEW_LINE>if (args != null && args.length > 0) {<NEW_LINE>conf.setNumStmgrs(2);<NEW_LINE>HeronSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>} else {<NEW_LINE>Simulator simulator = new Simulator();<NEW_LINE>simulator.submitTopology("test", conf, builder.createTopology());<NEW_LINE>Utils.sleep(10000);<NEW_LINE>simulator.killTopology("test");<NEW_LINE>simulator.shutdown();<NEW_LINE>}<NEW_LINE>} | conf.setComponentCpu("exclaim1", 0.5); |
1,315,215 | public IReplRequestHandlerResult handleRequest(final PO po, IReplRequestHandlerCtx ctx) {<NEW_LINE>final <MASK><NEW_LINE>if (!Util.same(po.getCtx(), ctxToUse)) {<NEW_LINE>// this shall not happen, it's an internal error<NEW_LINE>throw new ReplicationException("PO does not have same context as we need it to use").setParameter("PO", po).setParameter("Ctx", po.getCtx()).setParameter("CtxToUse", ctxToUse);<NEW_LINE>// Alternative: reload the given PO with 'ctxToUse' and therefore see if the current role really has access<NEW_LINE>// final PO poToSend = MTable.get(ctxToUse, po.get_Table_ID()).getPO(po.get_ID(), po.get_TrxName());<NEW_LINE>}<NEW_LINE>final IReplRequestHandlerResult result = Services.get(IReplRequestHandlerBL.class).createInitialRequestHandlerResult();<NEW_LINE>final IUserRolePermissions role = Env.getUserRolePermissions(ctxToUse);<NEW_LINE>final boolean allowResponse = // createError<NEW_LINE>role.// createError<NEW_LINE>canUpdate(// createError<NEW_LINE>ClientId.ofRepoId(po.getAD_Client_ID()), // createError<NEW_LINE>OrgId.ofRepoId(po.getAD_Org_ID()), // createError<NEW_LINE>po.get_Table_ID(), // createError<NEW_LINE>po.get_ID(), false);<NEW_LINE>if (!allowResponse) {<NEW_LINE>logger.warn("Response not allowed because there is no access to '{}'", po);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>final PO poToSend = createResponse(ctx, po);<NEW_LINE>result.setPOToExport(poToSend);<NEW_LINE>return result;<NEW_LINE>} | Properties ctxToUse = ctx.getEnvCtxToUse(); |
1,353,028 | private void config_table() {<NEW_LINE>// The child class has to setup the behaviour of the ENTER key. Default is to ignore it.<NEW_LINE>// Change behaviour for multi-selection<NEW_LINE>if (isMultiSelection()) {<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl A"), "doSelectAll");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl UP"), "doChangeLeadUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl KP_UP"), "doChangeLeadUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift UP"), "doAddRowUpExtend");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift KP_UP"), "doAddRowUpExtend");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift UP"), "doAddRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift KP_UP"), "doAddRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl DOWN"), "doChangeLeadDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl KP_DOWN"), "doChangeLeadDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift DOWN"), "doAddRowDownExtend");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift KP_DOWN"), "doAddRowDownExtend");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift DOWN"), "doAddRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift KP_DOWN"), "doAddRowDown");<NEW_LINE>} else {<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doNothing");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl A"), "doNothing");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl UP"), "doSelectRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl KP_UP"), "doSelectRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke<MASK><NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift KP_UP"), "doSelectRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift UP"), "doSelectRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift KP_UP"), "doSelectRowUp");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl DOWN"), "doSelectRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl KP_DOWN"), "doSelectRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift DOWN"), "doSelectRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("shift KP_DOWN"), "doSelectRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift DOWN"), "doSelectRowDown");<NEW_LINE>this.getInputMap().put(KeyStroke.getKeyStroke("ctrl shift KP_DOWN"), "doSelectRowDown");<NEW_LINE>}<NEW_LINE>} | .getKeyStroke("shift UP"), "doSelectRowUp"); |
76,378 | final CreateCanaryResult executeCreateCanary(CreateCanaryRequest createCanaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCanaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCanaryRequest> request = null;<NEW_LINE>Response<CreateCanaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCanaryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCanaryRequest));<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, "synthetics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCanary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCanaryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCanaryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,659,056 | private void makeMvhd(final long longestTrack) throws IOException {<NEW_LINE>auxWrite(new byte[] { 0x00, 0x00, 0x00, 0x78, 0x6D, 0x76, 0x68, 0x64, 0x01, 0x00, 0x00, 0x00 });<NEW_LINE>auxWrite(ByteBuffer.allocate(28).putLong(time).putLong(time).putInt(DEFAULT_TIMESCALE).putLong(longestTrack).array());<NEW_LINE>auxWrite(new byte[] { // default volume and rate<NEW_LINE>// default volume and rate<NEW_LINE>0x00, // default volume and rate<NEW_LINE>0x01, // default volume and rate<NEW_LINE>0x00, // default volume and rate<NEW_LINE>0x00, // default volume and rate<NEW_LINE>0x01, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // reserved values<NEW_LINE>0x00, // default matrix<NEW_LINE>0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40<MASK><NEW_LINE>// predefined<NEW_LINE>auxWrite(new byte[24]);<NEW_LINE>auxWrite(ByteBuffer.allocate(4).putInt(tracks.length + 1).array());<NEW_LINE>} | , 0x00, 0x00, 0x00 }); |
232,098 | private TsModel transformDates(SymbolTable symbolTable, TsModel tsModel) {<NEW_LINE>final TsAliasModel dateAsNumber = new TsAliasModel(null, symbolTable.getSyntheticSymbol("DateAsNumber"), null, TsType.Number, null);<NEW_LINE>final TsAliasModel dateAsString = new TsAliasModel(null, symbolTable.getSyntheticSymbol("DateAsString"), <MASK><NEW_LINE>final LinkedHashSet<TsAliasModel> typeAliases = new LinkedHashSet<>(tsModel.getTypeAliases());<NEW_LINE>final TsModel model = transformBeanPropertyTypes(tsModel, new TsType.Transformer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TsType transform(TsType.Context context, TsType type) {<NEW_LINE>if (type == TsType.Date) {<NEW_LINE>if (settings.mapDate == DateMapping.asNumber) {<NEW_LINE>typeAliases.add(dateAsNumber);<NEW_LINE>return new TsType.ReferenceType(dateAsNumber.getName());<NEW_LINE>}<NEW_LINE>if (settings.mapDate == DateMapping.asString) {<NEW_LINE>typeAliases.add(dateAsString);<NEW_LINE>return new TsType.ReferenceType(dateAsString.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return model.withTypeAliases(new ArrayList<>(typeAliases));<NEW_LINE>} | null, TsType.String, null); |
880,418 | protected List<StaticNat> createStaticNatForIp(IpAddress sourceIp, Account caller, boolean forRevoke) {<NEW_LINE>List<StaticNat> staticNats = new ArrayList<StaticNat>();<NEW_LINE>if (!sourceIp.isOneToOneNat()) {<NEW_LINE>s_logger.debug("Source ip id=" + sourceIp + " is not one to one nat");<NEW_LINE>return staticNats;<NEW_LINE>}<NEW_LINE>Long networkId = sourceIp.getAssociatedWithNetworkId();<NEW_LINE>if (networkId == null) {<NEW_LINE>throw new CloudRuntimeException("Ip address is not associated with any network");<NEW_LINE>}<NEW_LINE>VMInstanceVO vm = _vmInstanceDao.findByIdIncludingRemoved(sourceIp.getAssociatedWithVmId());<NEW_LINE>Network <MASK><NEW_LINE>if (network == null) {<NEW_LINE>CloudRuntimeException ex = new CloudRuntimeException("Unable to find an ip address to map to specified vm id");<NEW_LINE>ex.addProxyObject(vm.getUuid(), "vmId");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>if (caller != null) {<NEW_LINE>_accountMgr.checkAccess(caller, null, true, sourceIp);<NEW_LINE>}<NEW_LINE>// create new static nat rule<NEW_LINE>// Get nic IP4 address<NEW_LINE>Nic guestNic = _networkModel.getNicInNetworkIncludingRemoved(vm.getId(), networkId);<NEW_LINE>if (guestNic == null) {<NEW_LINE>throw new InvalidParameterValueException("Vm doesn't belong to the network with specified id");<NEW_LINE>}<NEW_LINE>String dstIp;<NEW_LINE>dstIp = sourceIp.getVmIp();<NEW_LINE>if (dstIp == null) {<NEW_LINE>throw new InvalidParameterValueException("Vm ip is not set as dnat ip for this public ip");<NEW_LINE>}<NEW_LINE>String srcMac = null;<NEW_LINE>try {<NEW_LINE>srcMac = _networkModel.getNextAvailableMacAddressInNetwork(networkId);<NEW_LINE>} catch (InsufficientAddressCapacityException e) {<NEW_LINE>throw new CloudRuntimeException("Insufficient MAC address for static NAT instantiation.");<NEW_LINE>}<NEW_LINE>StaticNatImpl staticNat = new StaticNatImpl(sourceIp.getAllocatedToAccountId(), sourceIp.getAllocatedInDomainId(), networkId, sourceIp.getId(), dstIp, srcMac, forRevoke);<NEW_LINE>staticNats.add(staticNat);<NEW_LINE>return staticNats;<NEW_LINE>} | network = _networkModel.getNetwork(networkId); |
1,810,497 | public static DescribeSendFileResultsResponse unmarshall(DescribeSendFileResultsResponse describeSendFileResultsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSendFileResultsResponse.setRequestId(_ctx.stringValue("DescribeSendFileResultsResponse.RequestId"));<NEW_LINE>describeSendFileResultsResponse.setPageSize(_ctx.longValue("DescribeSendFileResultsResponse.PageSize"));<NEW_LINE>describeSendFileResultsResponse.setPageNumber(_ctx.longValue("DescribeSendFileResultsResponse.PageNumber"));<NEW_LINE>describeSendFileResultsResponse.setTotalCount(_ctx.longValue("DescribeSendFileResultsResponse.TotalCount"));<NEW_LINE>List<Invocation> invocations = new ArrayList<Invocation>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSendFileResultsResponse.Invocations.Length"); i++) {<NEW_LINE>Invocation invocation = new Invocation();<NEW_LINE>invocation.setCreationTime(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].CreationTime"));<NEW_LINE>invocation.setInvocationStatus(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvocationStatus"));<NEW_LINE>invocation.setContentType(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].ContentType"));<NEW_LINE>invocation.setTargetDir(_ctx.stringValue<MASK><NEW_LINE>invocation.setFileOwner(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].FileOwner"));<NEW_LINE>invocation.setDescription(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].Description"));<NEW_LINE>invocation.setVmCount(_ctx.integerValue("DescribeSendFileResultsResponse.Invocations[" + i + "].VmCount"));<NEW_LINE>invocation.setFileMode(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].FileMode"));<NEW_LINE>invocation.setFileGroup(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].FileGroup"));<NEW_LINE>invocation.setInvokeId(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeId"));<NEW_LINE>invocation.setName(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].Name"));<NEW_LINE>invocation.setContent(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].Content"));<NEW_LINE>invocation.setOverwrite(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].Overwrite"));<NEW_LINE>List<InvokeInstance> invokeInstances = new ArrayList<InvokeInstance>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances.Length"); j++) {<NEW_LINE>InvokeInstance invokeInstance = new InvokeInstance();<NEW_LINE>invokeInstance.setCreationTime(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].CreationTime"));<NEW_LINE>invokeInstance.setStartTime(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].StartTime"));<NEW_LINE>invokeInstance.setInvocationStatus(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].InvocationStatus"));<NEW_LINE>invokeInstance.setFinishTime(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].FinishTime"));<NEW_LINE>invokeInstance.setUpdateTime(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].UpdateTime"));<NEW_LINE>invokeInstance.setErrorInfo(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].ErrorInfo"));<NEW_LINE>invokeInstance.setErrorCode(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].ErrorCode"));<NEW_LINE>invokeInstance.setInstanceId(_ctx.stringValue("DescribeSendFileResultsResponse.Invocations[" + i + "].InvokeInstances[" + j + "].InstanceId"));<NEW_LINE>invokeInstances.add(invokeInstance);<NEW_LINE>}<NEW_LINE>invocation.setInvokeInstances(invokeInstances);<NEW_LINE>invocations.add(invocation);<NEW_LINE>}<NEW_LINE>describeSendFileResultsResponse.setInvocations(invocations);<NEW_LINE>return describeSendFileResultsResponse;<NEW_LINE>} | ("DescribeSendFileResultsResponse.Invocations[" + i + "].TargetDir")); |
377,668 | private JSONObject addThreadStopInfo(ThreadReference thread, long stopThreadId, DebuggerStopReason stopReason) {<NEW_LINE>JSONObject threadJson = new JSONObject();<NEW_LINE>long threadId = thread.uniqueID();<NEW_LINE>String threadName = thread.name();<NEW_LINE>boolean stackFrameValid = false;<NEW_LINE>threadJson.put("id", threadId);<NEW_LINE>threadJson.put("name", threadName);<NEW_LINE>threadJson.put("description", threadName);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>if (thread.frameCount() > 0) {<NEW_LINE>StackFrame leafFrame = thread.frame(0);<NEW_LINE>threadJson.put("address", Utils.getFrameName(leafFrame));<NEW_LINE>threadJson.put("location", Utils.getFrameLocationJson(_contextManager.getFileManager(), leafFrame));<NEW_LINE>stackFrameValid = true;<NEW_LINE>}<NEW_LINE>} catch (InvalidStackFrameException e) {<NEW_LINE>}<NEW_LINE>if (stackFrameValid == false) {<NEW_LINE>threadJson.put("address", NOT_AVAILABLE_TEXT);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (threadId == stopThreadId) {<NEW_LINE>threadJson.put("stopReason", Utils.getStopReasonString(stopReason));<NEW_LINE>} else {<NEW_LINE>threadJson.put("stopReason", "");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>threadJson.put("address", NOT_AVAILABLE_TEXT);<NEW_LINE>threadJson.put("location", NOT_AVAILABLE_TEXT);<NEW_LINE>}<NEW_LINE>return threadJson;<NEW_LINE>} | threadJson.put("location", NOT_AVAILABLE_TEXT); |
1,273,496 | public static CreateHotParamItemsResponse unmarshall(CreateHotParamItemsResponse createHotParamItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>createHotParamItemsResponse.setRequestId(_ctx.stringValue("CreateHotParamItemsResponse.RequestId"));<NEW_LINE>createHotParamItemsResponse.setCode(_ctx.stringValue("CreateHotParamItemsResponse.Code"));<NEW_LINE>createHotParamItemsResponse.setMessage(_ctx.stringValue("CreateHotParamItemsResponse.Message"));<NEW_LINE>createHotParamItemsResponse.setSuccess<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setAppName(_ctx.stringValue("CreateHotParamItemsResponse.Data.AppName"));<NEW_LINE>data.setBurstCount(_ctx.integerValue("CreateHotParamItemsResponse.Data.BurstCount"));<NEW_LINE>data.setControlBehavior(_ctx.integerValue("CreateHotParamItemsResponse.Data.ControlBehavior"));<NEW_LINE>data.setEnable(_ctx.booleanValue("CreateHotParamItemsResponse.Data.Enable"));<NEW_LINE>data.setMaxQueueingTimeMs(_ctx.integerValue("CreateHotParamItemsResponse.Data.MaxQueueingTimeMs"));<NEW_LINE>data.setMetricType(_ctx.integerValue("CreateHotParamItemsResponse.Data.MetricType"));<NEW_LINE>data.setNamespace(_ctx.stringValue("CreateHotParamItemsResponse.Data.Namespace"));<NEW_LINE>data.setParamIdx(_ctx.integerValue("CreateHotParamItemsResponse.Data.ParamIdx"));<NEW_LINE>data.setResource(_ctx.stringValue("CreateHotParamItemsResponse.Data.Resource"));<NEW_LINE>data.setRuleId(_ctx.longValue("CreateHotParamItemsResponse.Data.RuleId"));<NEW_LINE>data.setStatDurationSec(_ctx.longValue("CreateHotParamItemsResponse.Data.StatDurationSec"));<NEW_LINE>data.setThreshold(_ctx.floatValue("CreateHotParamItemsResponse.Data.Threshold"));<NEW_LINE>List<ParamFlowItemListItem> paramFlowItemList = new ArrayList<ParamFlowItemListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateHotParamItemsResponse.Data.ParamFlowItemList.Length"); i++) {<NEW_LINE>ParamFlowItemListItem paramFlowItemListItem = new ParamFlowItemListItem();<NEW_LINE>paramFlowItemListItem.setItemType(_ctx.stringValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].ItemType"));<NEW_LINE>paramFlowItemListItem.setItemValue(_ctx.stringValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].ItemValue"));<NEW_LINE>paramFlowItemListItem.setThreshold(_ctx.floatValue("CreateHotParamItemsResponse.Data.ParamFlowItemList[" + i + "].Threshold"));<NEW_LINE>paramFlowItemList.add(paramFlowItemListItem);<NEW_LINE>}<NEW_LINE>data.setParamFlowItemList(paramFlowItemList);<NEW_LINE>createHotParamItemsResponse.setData(data);<NEW_LINE>return createHotParamItemsResponse;<NEW_LINE>} | (_ctx.booleanValue("CreateHotParamItemsResponse.Success")); |
117,562 | private static Object decimalSerializer(Object data, Schema schema, Schema.Type primitiveType, LogicalType logicalType) {<NEW_LINE>int scale = ((LogicalTypes.Decimal) schema.getLogicalType()).getScale();<NEW_LINE>int precision = ((LogicalTypes.Decimal) schema.getLogicalType()).getPrecision();<NEW_LINE>double multiply = Math.pow(10D, precision - scale * 1D);<NEW_LINE>BigDecimal value;<NEW_LINE>if (data instanceof String) {<NEW_LINE>value = new BigDecimal((String) data);<NEW_LINE>} else if (data instanceof Long) {<NEW_LINE>value = BigDecimal.valueOf((long) ((long) data * multiply), scale);<NEW_LINE>} else if (data instanceof Integer) {<NEW_LINE>value = BigDecimal.valueOf((int) ((int) data * multiply), scale);<NEW_LINE>} else if (data instanceof Double) {<NEW_LINE>value = new BigDecimal((double) data, new MathContext(precision));<NEW_LINE>} else if (data instanceof Float) {<NEW_LINE>value = new BigDecimal((float) data, new MathContext(precision));<NEW_LINE>} else {<NEW_LINE>value = (BigDecimal) data;<NEW_LINE>}<NEW_LINE>value = value.setScale(scale, RoundingMode.HALF_EVEN);<NEW_LINE>switch(primitiveType) {<NEW_LINE>case BYTES:<NEW_LINE>return AvroSerializer.DECIMAL_CONVERSION.<MASK><NEW_LINE>case FIXED:<NEW_LINE>return AvroSerializer.DECIMAL_CONVERSION.toFixed(value, schema, logicalType);<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected value: " + primitiveType);<NEW_LINE>}<NEW_LINE>} | toBytes(value, schema, logicalType); |
778,959 | public Explainability unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Explainability explainability = new Explainability();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Report", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>explainability.setReport(MetricsSourceJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return explainability;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
245,634 | public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select * from SupportBean#lastevent sb, SupportBeanTwo#lastevent sbt, " + "sql:MyDBWithRetain ['select myint from mytesttable'] as s1 " + " where sb.theString = sbt.stringTwo and s1.myint = sbt.intPrimitiveTwo";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>assertStatelessStmt(env, "s0", false);<NEW_LINE>env.sendEventBean(new SupportBeanTwo("T1", 2));<NEW_LINE>env.sendEventBean(new SupportBean("T1", -1));<NEW_LINE>env.sendEventBean(new SupportBeanTwo("T2", 30));<NEW_LINE>env.sendEventBean(new SupportBean("T2", -1));<NEW_LINE>env.assertPropsNew("s0", "sb.theString,sbt.stringTwo,s1.myint".split(","), new Object[] { "T2", "T2", 30 });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("T3", -1));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertPropsNew("s0", "sb.theString,sbt.stringTwo,s1.myint".split(","), new Object[] { "T3", "T3", 40 });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBeanTwo("T3", 40)); |
732,626 | public String amounts(final ICalloutField calloutField) {<NEW_LINE>if (// assuming it is resetting value<NEW_LINE>isCalloutActive()) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>final I_C_PaymentAllocate paymentAlloc = calloutField.getModel(I_C_PaymentAllocate.class);<NEW_LINE>// No Invoice<NEW_LINE>final <MASK><NEW_LINE>if (C_Invoice_ID <= 0) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>// Get Info from Tab<NEW_LINE>BigDecimal Amount = paymentAlloc.getAmount();<NEW_LINE>final BigDecimal DiscountAmt = paymentAlloc.getDiscountAmt();<NEW_LINE>BigDecimal WriteOffAmt = paymentAlloc.getWriteOffAmt();<NEW_LINE>final BigDecimal OverUnderAmt = paymentAlloc.getOverUnderAmt();<NEW_LINE>final BigDecimal InvoiceAmt = paymentAlloc.getInvoiceAmt();<NEW_LINE>// Changed Column<NEW_LINE>final String colName = calloutField.getColumnName();<NEW_LINE>// PayAmt - calculate write off<NEW_LINE>if (I_C_PaymentAllocate.COLUMNNAME_Amount.equals(colName)) {<NEW_LINE>WriteOffAmt = InvoiceAmt.subtract(Amount).subtract(DiscountAmt).subtract(OverUnderAmt);<NEW_LINE>paymentAlloc.setWriteOffAmt(WriteOffAmt);<NEW_LINE>} else // calculate Amount<NEW_LINE>{<NEW_LINE>Amount = InvoiceAmt.subtract(DiscountAmt).subtract(WriteOffAmt).subtract(OverUnderAmt);<NEW_LINE>paymentAlloc.setAmount(Amount);<NEW_LINE>}<NEW_LINE>return NO_ERROR;<NEW_LINE>} | int C_Invoice_ID = paymentAlloc.getC_Invoice_ID(); |
972,848 | public void invoke(List<PdfObject> operands, PdfContentStreamHandler handler, PdfDictionary resources) {<NEW_LINE>PdfName dictionaryName = (PdfName) operands.get(0);<NEW_LINE>PdfDictionary extGState = resources.getAsDict(PdfName.EXTGSTATE);<NEW_LINE>if (extGState == null) {<NEW_LINE>throw new IllegalArgumentException(MessageLocalization.getComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.operator.1", getOperatorName()));<NEW_LINE>}<NEW_LINE>PdfDictionary gsDic = extGState.getAsDict(dictionaryName);<NEW_LINE>if (gsDic == null) {<NEW_LINE>throw new IllegalArgumentException(MessageLocalization.getComposedMessage("1.is.an.unknown.graphics.state.dictionary", dictionaryName));<NEW_LINE>}<NEW_LINE>// at this point, all we care about is the FONT entry in the GS<NEW_LINE>// dictionary<NEW_LINE>PdfArray fontParameter = gsDic.getAsArray(PdfName.FONT);<NEW_LINE>if (fontParameter != null) {<NEW_LINE>PdfObject pdfObject = fontParameter.getPdfObject(0);<NEW_LINE>CMapAwareDocumentFont font = <MASK><NEW_LINE>float size = fontParameter.getAsNumber(1).floatValue();<NEW_LINE>handler.graphicsState().setFont(font);<NEW_LINE>handler.graphicsState().setFontSize(size);<NEW_LINE>}<NEW_LINE>} | new CMapAwareDocumentFont((PRIndirectReference) pdfObject); |
317,307 | protected UserModel validateCache(RealmModel realm, CachedUser cached) {<NEW_LINE>if (!realm.getId().equals(cached.getRealm())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StorageId storageId = cached.getFederationLink() != null ? new StorageId(cached.getFederationLink(), cached.getId()) : new StorageId(cached.getId());<NEW_LINE>if (!storageId.isLocal()) {<NEW_LINE>ComponentModel component = realm.<MASK><NEW_LINE>CacheableStorageProviderModel model = new CacheableStorageProviderModel(component);<NEW_LINE>// although we do set a timeout, Infinispan has no guarantees when the user will be evicted<NEW_LINE>// its also hard to test stuff<NEW_LINE>if (model.shouldInvalidate(cached)) {<NEW_LINE>registerUserInvalidation(realm, cached);<NEW_LINE>return getDelegate().getUserById(realm, cached.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new UserAdapter(cached, this, session, realm);<NEW_LINE>} | getComponent(storageId.getProviderId()); |
494,194 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>getWindow().setFormat(PixelFormat.RGBA_8888);<NEW_LINE>setContentView(R.layout.activity_color_picker);<NEW_LINE>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>int initialColor = prefs.getInt("color_3", 0xFF000000);<NEW_LINE>colorPickerView = (ColorPickerView) findViewById(R.id.cpv_color_picker_view);<NEW_LINE>ColorPanelView colorPanelView = (ColorPanelView) findViewById(R.id.cpv_color_panel_old);<NEW_LINE>newColorPanelView = (ColorPanelView) findViewById(R.id.cpv_color_panel_new);<NEW_LINE>Button btnOK = (Button) findViewById(R.id.okButton);<NEW_LINE>Button btnCancel = (Button) <MASK><NEW_LINE>((LinearLayout) colorPanelView.getParent()).setPadding(colorPickerView.getPaddingLeft(), 0, colorPickerView.getPaddingRight(), 0);<NEW_LINE>colorPickerView.setOnColorChangedListener(this);<NEW_LINE>colorPickerView.setColor(initialColor, true);<NEW_LINE>colorPanelView.setColor(initialColor);<NEW_LINE>btnOK.setOnClickListener(this);<NEW_LINE>btnCancel.setOnClickListener(this);<NEW_LINE>} | findViewById(R.id.cancelButton); |
331,729 | public boolean test() {<NEW_LINE>TagCollection<Item> itemTags = SerializationTags.getInstance().getOrEmpty(Registry.ITEM_REGISTRY);<NEW_LINE>List<Tag<Item>> tags = names.stream().map(itemTags::getTagOrEmpty).toList();<NEW_LINE>// if there is just one tag, just needs to be filled<NEW_LINE>if (tags.size() == 1) {<NEW_LINE>return !tags.get(0).getValues().isEmpty();<NEW_LINE>}<NEW_LINE>// if any list is empty, the intersection is empty<NEW_LINE>if (tags.stream().anyMatch(tag -> tag.getValues().isEmpty())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// all tags have something, so find the first item that is in all tags<NEW_LINE><MASK><NEW_LINE>itemLoop: for (Item item : tags.get(0).getValues()) {<NEW_LINE>// find the first item contained in all other intersecion tags<NEW_LINE>for (int i = 1; i < count; i++) {<NEW_LINE>if (!tags.get(i).contains(item)) {<NEW_LINE>continue itemLoop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// all tags contain the item? success<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// no item in all tags<NEW_LINE>return false;<NEW_LINE>} | int count = tags.size(); |
1,402,515 | public static List<Tuple2<Double, ConfusionMatrix>> filterCloseEntries(List<Tuple2<Double, ConfusionMatrix>> threshCMs, int limit) {<NEW_LINE>int n = threshCMs.size();<NEW_LINE>if (n <= limit) {<NEW_LINE>return threshCMs;<NEW_LINE>}<NEW_LINE>int toRemove = n - limit;<NEW_LINE>// Maintain a double-linked list to store the prev/next entry when removing<NEW_LINE>int[] prev = new int[n];<NEW_LINE>int[] next = new int[n];<NEW_LINE>boolean[] removed = new boolean[n];<NEW_LINE>for (int i = 0; i < n; i += 1) {<NEW_LINE>prev[i] = i - 1;<NEW_LINE><MASK><NEW_LINE>removed[i] = false;<NEW_LINE>}<NEW_LINE>// Use a priority queue to help extract the entry with the smallest threshold difference compared to its previous entry.<NEW_LINE>// The tuple contains current index and its previous index.<NEW_LINE>// If multiple entries have the same smallest value, pick the one with the smallest index.<NEW_LINE>Comparator<Tuple2<Integer, Integer>> comparator = Comparator.<Tuple2<Integer, Integer>, Double>comparing(d -> threshCMs.get(d.f1).f0 - threshCMs.get(d.f0).f0).thenComparingInt(d -> d.f0);<NEW_LINE>PriorityQueue<Tuple2<Integer, Integer>> pq = new PriorityQueue<>(comparator);<NEW_LINE>for (int i = 1; i < n; i += 1) {<NEW_LINE>pq.add(Tuple2.of(i, i - 1));<NEW_LINE>}<NEW_LINE>while (toRemove > 0) {<NEW_LINE>Tuple2<Integer, Integer> cntTuple = pq.remove();<NEW_LINE>// Tuples with same current index could be added multiple times after removal,<NEW_LINE>// so need to check its current predecessor.<NEW_LINE>if (cntTuple.f1 != prev[cntTuple.f0]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int cntIndex = cntTuple.f0;<NEW_LINE>int prevIndex = cntTuple.f1;<NEW_LINE>int nextIndex = next[cntIndex];<NEW_LINE>if (nextIndex < n) {<NEW_LINE>prev[nextIndex] = prevIndex;<NEW_LINE>}<NEW_LINE>if (prevIndex >= 0) {<NEW_LINE>next[prevIndex] = nextIndex;<NEW_LINE>}<NEW_LINE>if (nextIndex < n) {<NEW_LINE>pq.add(Tuple2.of(nextIndex, prevIndex));<NEW_LINE>}<NEW_LINE>removed[cntIndex] = true;<NEW_LINE>toRemove -= 1;<NEW_LINE>}<NEW_LINE>return IntStream.range(0, n).filter(d -> !removed[d]).mapToObj(threshCMs::get).collect(Collectors.toList());<NEW_LINE>} | next[i] = i + 1; |
568,970 | public void read(org.apache.thrift.protocol.TProtocol iprot, BuildRuleType struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // TYPE<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.type = iprot.readString();<NEW_LINE>struct.setTypeIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | skip(iprot, schemeField.type); |
832,221 | void makeSelection(Boolean shiftDown, Long newFileID) {<NEW_LINE>if (shiftDown) {<NEW_LINE>// TODO: do more hear to implement slicker multiselect<NEW_LINE>int endIndex = grouping.get().getFileIDs().indexOf(newFileID);<NEW_LINE>int startIndex = IntStream.of(grouping.get().getFileIDs().size(), selectionAnchorIndex, endIndex).min().getAsInt();<NEW_LINE>endIndex = IntStream.of(0, selectionAnchorIndex, endIndex)<MASK><NEW_LINE>List<Long> subList = grouping.get().getFileIDs().subList(Math.max(0, startIndex), Math.min(endIndex, grouping.get().getFileIDs().size()) + 1);<NEW_LINE>selectionModel.clearAndSelectAll(subList.toArray(new Long[subList.size()]));<NEW_LINE>selectionModel.select(newFileID);<NEW_LINE>} else {<NEW_LINE>selectionAnchorIndex = null;<NEW_LINE>selectionModel.clearAndSelect(newFileID);<NEW_LINE>}<NEW_LINE>} | .max().getAsInt(); |
1,297,272 | public void writeAllCurrentRequestsAsPart(Map<JavaInformations, List<CounterRequestContext>> currentRequests, Collector collector, List<Counter> counters, long timeOfSnapshot) throws IOException {<NEW_LINE>try {<NEW_LINE>document.open();<NEW_LINE>// on remplace les parentCounters<NEW_LINE>final List<CounterRequestContext> allCurrentRequests = new ArrayList<>();<NEW_LINE>for (final List<CounterRequestContext> rootCurrentContexts : currentRequests.values()) {<NEW_LINE>allCurrentRequests.addAll(rootCurrentContexts);<NEW_LINE>}<NEW_LINE>CounterRequestContext.replaceParentCounters(allCurrentRequests, counters);<NEW_LINE>final List<PdfCounterReport> pdfCounterReports = new ArrayList<>();<NEW_LINE>// ce range n'a pas d'importance pour ce pdf<NEW_LINE>final Range range = Period.TOUT.getRange();<NEW_LINE>for (final Counter counter : counters) {<NEW_LINE>final PdfCounterReport pdfCounterReport = new PdfCounterReport(collector, <MASK><NEW_LINE>pdfCounterReports.add(pdfCounterReport);<NEW_LINE>}<NEW_LINE>final Font normalFont = PdfFonts.NORMAL.getFont();<NEW_LINE>for (final Map.Entry<JavaInformations, List<CounterRequestContext>> entry : currentRequests.entrySet()) {<NEW_LINE>final JavaInformations javaInformations = entry.getKey();<NEW_LINE>final List<CounterRequestContext> rootCurrentContexts = entry.getValue();<NEW_LINE>addParagraph(getString("Requetes_en_cours"), "hourglass.png");<NEW_LINE>if (rootCurrentContexts.isEmpty()) {<NEW_LINE>addToDocument(new Phrase(getString("Aucune_requete_en_cours"), normalFont));<NEW_LINE>} else {<NEW_LINE>final PdfCounterRequestContextReport pdfCounterRequestContextReport = new PdfCounterRequestContextReport(rootCurrentContexts, pdfCounterReports, javaInformations.getThreadInformationsList(), javaInformations.isStackTraceEnabled(), pdfDocumentFactory, document);<NEW_LINE>pdfCounterRequestContextReport.setTimeOfSnapshot(timeOfSnapshot);<NEW_LINE>pdfCounterRequestContextReport.writeContextDetails();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final DocumentException e) {<NEW_LINE>throw createIOException(e);<NEW_LINE>}<NEW_LINE>document.close();<NEW_LINE>} | counter, range, false, document); |
1,370,252 | public void update(AnActionEvent event) {<NEW_LINE>Presentation presentation = event.getPresentation();<NEW_LINE>Project project = event.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project == null) {<NEW_LINE>presentation.setEnabled(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);<NEW_LINE>String[] ids = toolWindowManager.getToolWindowIds();<NEW_LINE>for (String id : ids) {<NEW_LINE>if (toolWindowManager.getToolWindow(id).isVisible()) {<NEW_LINE>presentation.setEnabled(true);<NEW_LINE>presentation.setText(IdeBundle.message("action.hide.all.windows"), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ToolWindowLayout layout = toolWindowManager.getLayoutToRestoreLater();<NEW_LINE>if (layout != null) {<NEW_LINE>presentation.setEnabled(true);<NEW_LINE>presentation.setText<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>presentation.setEnabled(false);<NEW_LINE>} | (IdeBundle.message("action.restore.windows")); |
768,841 | private DownloadTask parseCursor(Cursor cursor) {<NEW_LINE>int primaryId = cursor.getInt(cursor.getColumnIndexOrThrow(BaseColumns._ID));<NEW_LINE>String taskId = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_TASK_ID));<NEW_LINE>int status = cursor.getInt(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_STATUS));<NEW_LINE>int progress = cursor.getInt(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_PROGRESS));<NEW_LINE>String url = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_URL));<NEW_LINE>String filename = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_FILE_NAME));<NEW_LINE>String savedDir = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_SAVED_DIR));<NEW_LINE>String headers = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_HEADERS));<NEW_LINE>String mimeType = cursor.getString(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_MIME_TYPE));<NEW_LINE>int resumable = cursor.getShort(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_RESUMABLE));<NEW_LINE>int showNotification = cursor.getShort(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_SHOW_NOTIFICATION));<NEW_LINE>int clickToOpenDownloadedFile = cursor.getShort(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_OPEN_FILE_FROM_NOTIFICATION));<NEW_LINE>long timeCreated = cursor.getLong(cursor.getColumnIndexOrThrow(TaskContract.TaskEntry.COLUMN_NAME_TIME_CREATED));<NEW_LINE>int saveInPublicStorage = cursor.getShort(cursor.getColumnIndexOrThrow<MASK><NEW_LINE>return new DownloadTask(primaryId, taskId, status, progress, url, filename, savedDir, headers, mimeType, resumable == 1, showNotification == 1, clickToOpenDownloadedFile == 1, timeCreated, saveInPublicStorage == 1);<NEW_LINE>} | (TaskContract.TaskEntry.COLUMN_SAVE_IN_PUBLIC_STORAGE)); |
1,271,626 | private void astHeight(AstNode ast) {<NEW_LINE>if (ast == this.astMap[0]) {<NEW_LINE>int len = 0;<NEW_LINE>if (this.autotags || this.astGroups == AST_GROUPS_ALL) {<NEW_LINE>len = this.astMap.length * 2;<NEW_LINE>} else {<NEW_LINE>len = this.astenumi * 2 + 1;<NEW_LINE>}<NEW_LINE>this.tagHeight = new int[len];<NEW_LINE>this.tagAst = new int[len];<NEW_LINE>}<NEW_LINE>if (this.autotags || this.astGroups == AST_GROUPS_ALL) {<NEW_LINE>int tag = otag(ast);<NEW_LINE>this.tagHeight[tag] = ast.lev + 1;<NEW_LINE>this.tagAst[tag] = ast.seq;<NEW_LINE>tag = ctag(ast);<NEW_LINE>this.tagHeight[tag] = ast.lev;<NEW_LINE>this.tagAst[tag] = ast.seq;<NEW_LINE>} else if (ast.implicit != 0) {<NEW_LINE>int tag = otag(ast);<NEW_LINE>if (ast.fat != null) {<NEW_LINE>this.tagHeight[tag] = this.tagHeight[otag(ast.fat)] + 1;<NEW_LINE>} else {<NEW_LINE>this.tagHeight[tag] = 1;<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>tag = ctag(ast);<NEW_LINE>this.tagHeight[tag] = this.tagHeight[otag(ast)] - 1;<NEW_LINE>this.tagAst[tag] = ast.seq;<NEW_LINE>}<NEW_LINE>for (AstNode a = ast.son; a != null; a = a.bro) {<NEW_LINE>astHeight(a);<NEW_LINE>}<NEW_LINE>} | tagAst[tag] = ast.seq; |
1,041,894 | public static ByteString synthesizeSsmlFile(String ssmlFile) throws Exception {<NEW_LINE>// Instantiates a client<NEW_LINE>try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {<NEW_LINE>// Read the file's contents<NEW_LINE>String contents = new String(Files.readAllBytes(<MASK><NEW_LINE>// Set the ssml input to be synthesized<NEW_LINE>SynthesisInput input = SynthesisInput.newBuilder().setSsml(contents).build();<NEW_LINE>// Build the voice request<NEW_LINE>VoiceSelectionParams voice = // languageCode = "en_us"<NEW_LINE>VoiceSelectionParams.newBuilder().// languageCode = "en_us"<NEW_LINE>setLanguageCode(// ssmlVoiceGender = SsmlVoiceGender.FEMALE<NEW_LINE>"en-US").// ssmlVoiceGender = SsmlVoiceGender.FEMALE<NEW_LINE>setSsmlGender(SsmlVoiceGender.FEMALE).build();<NEW_LINE>// Select the type of audio file you want returned<NEW_LINE>AudioConfig audioConfig = // MP3 audio.<NEW_LINE>AudioConfig.newBuilder().// MP3 audio.<NEW_LINE>setAudioEncoding(AudioEncoding.MP3).build();<NEW_LINE>// Perform the text-to-speech request<NEW_LINE>SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(input, voice, audioConfig);<NEW_LINE>// Get the audio contents from the response<NEW_LINE>ByteString audioContents = response.getAudioContent();<NEW_LINE>// Write the response to the output file.<NEW_LINE>try (OutputStream out = new FileOutputStream("output.mp3")) {<NEW_LINE>out.write(audioContents.toByteArray());<NEW_LINE>System.out.println("Audio content written to file \"output.mp3\"");<NEW_LINE>return audioContents;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Paths.get(ssmlFile))); |
1,349,537 | private void println_NonBlocking(String value) throws IOException {<NEW_LINE>synchronized (this) {<NEW_LINE>if (this.isOutputStreamNBClosed()) {<NEW_LINE><MASK><NEW_LINE>throw new IOException(Tr.formatMessage(tc, "stream.is.closed.no.read.write"));<NEW_LINE>}<NEW_LINE>byte[] stringBytes = value.getBytes();<NEW_LINE>this.write_NonBlocking(stringBytes, 0, stringBytes.length);<NEW_LINE>// need to check if we can write first in case the first write has gone async<NEW_LINE>if (_httpOut.isWriteReady()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "println crlf , write allowed now , WriteListener enabled: " + this._listener + " , check crlf_pending " + _httpOut.write_crlf_pending);<NEW_LINE>}<NEW_LINE>WebContainerRequestState.getInstance(true).setAttribute("com.ibm.ws.webcontainer.WriteAllowedonThisThread", true);<NEW_LINE>this.writeCRLFIfNeeded();<NEW_LINE>} else {<NEW_LINE>// the previous write must have gone async and has not completed yet.<NEW_LINE>// Do the next write of CRLF in complete<NEW_LINE>_httpOut.write_crlf_pending = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Tr.error(tc, "stream.is.closed.no.read.write"); |
1,532,124 | final GetSqlInjectionMatchSetResult executeGetSqlInjectionMatchSet(GetSqlInjectionMatchSetRequest getSqlInjectionMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSqlInjectionMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSqlInjectionMatchSetRequest> request = null;<NEW_LINE>Response<GetSqlInjectionMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSqlInjectionMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSqlInjectionMatchSetRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSqlInjectionMatchSet");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSqlInjectionMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSqlInjectionMatchSetResultJsonUnmarshaller());<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); |
1,151,419 | final GetWebACLResult executeGetWebACL(GetWebACLRequest getWebACLRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWebACLRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWebACLRequest> request = null;<NEW_LINE>Response<GetWebACLResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWebACLRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWebACLRequest));<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, "GetWebACL");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWebACLResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWebACLResultJsonUnmarshaller());<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, "WAF Regional"); |
1,220,621 | public Void doInTransaction(@Nonnull TransactionStatus theStatus) {<NEW_LINE>List<ResourcePersistentId> persistentIds = myData.getIds().stream().map(t -> new ResourcePersistentId(t.getId())).collect(Collectors.toList());<NEW_LINE>ourLog.info("Starting reindex work chunk with {} resources - Instance[{}] Chunk[{}]", persistentIds.size(), myInstanceId, myChunkId);<NEW_LINE>StopWatch sw = new StopWatch();<NEW_LINE>// Prefetch Resources from DB<NEW_LINE>mySystemDao.preFetchResources(persistentIds);<NEW_LINE>ourLog.info("Prefetched {} resources in {} - Instance[{}] Chunk[{}]", persistentIds.size(), sw, myInstanceId, myChunkId);<NEW_LINE>// Reindex<NEW_LINE>sw.restart();<NEW_LINE>for (int i = 0; i < myData.getIds().size(); i++) {<NEW_LINE>String nextResourceType = myData.getIds().<MASK><NEW_LINE>IFhirResourceDao<?> dao = myDaoRegistry.getResourceDao(nextResourceType);<NEW_LINE>ResourcePersistentId resourcePersistentId = persistentIds.get(i);<NEW_LINE>try {<NEW_LINE>dao.reindex(resourcePersistentId, myRequestDetails, myTransactionDetails);<NEW_LINE>} catch (BaseServerResponseException | DataFormatException e) {<NEW_LINE>String resourceForcedId = myIdHelperService.translatePidIdToForcedIdWithCache(resourcePersistentId).orElse(resourcePersistentId.toString());<NEW_LINE>String resourceId = nextResourceType + "/" + resourceForcedId;<NEW_LINE>ourLog.debug("Failure during reindexing {}", resourceId, e);<NEW_LINE>myDataSink.recoveredError("Failure reindexing " + resourceId + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ourLog.info("Finished reindexing {} resources in {} - {}/sec - Instance[{}] Chunk[{}]", persistentIds.size(), sw, sw.formatThroughput(persistentIds.size(), TimeUnit.SECONDS), myInstanceId, myChunkId);<NEW_LINE>return null;<NEW_LINE>} | get(i).getResourceType(); |
170,711 | protected Collection<Match<Either<SymbolInformation, DocumentSymbol>>> compute() {<NEW_LINE>String query = searchBox.getValue();<NEW_LINE>if (!StringUtil.hasText(query)) {<NEW_LINE>query = "";<NEW_LINE>}<NEW_LINE>query = query.toLowerCase();<NEW_LINE>List<Match<Either<SymbolInformation, DocumentSymbol>>> <MASK><NEW_LINE>for (Either<SymbolInformation, DocumentSymbol> symbol : unfilteredSymbols.getValues()) {<NEW_LINE>String name = null;<NEW_LINE>if (symbol.isLeft()) {<NEW_LINE>name = symbol.getLeft().getName().toLowerCase();<NEW_LINE>} else if (symbol.isRight()) {<NEW_LINE>name = symbol.getRight().getName().toLowerCase();<NEW_LINE>}<NEW_LINE>double score = FuzzyMatcher.matchScore(query, name);<NEW_LINE>if (score != 0.0) {<NEW_LINE>matches.add(new Match<Either<SymbolInformation, DocumentSymbol>>(score, query, symbol));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(matches, MATCH_COMPARATOR);<NEW_LINE>return ImmutableList.copyOf(matches);<NEW_LINE>} | matches = new ArrayList<>(); |
405,700 | public S3InitiateRestoreObjectOperation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>S3InitiateRestoreObjectOperation s3InitiateRestoreObjectOperation = new S3InitiateRestoreObjectOperation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return s3InitiateRestoreObjectOperation;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ExpirationInDays", targetDepth)) {<NEW_LINE>s3InitiateRestoreObjectOperation.setExpirationInDays(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("GlacierJobTier", targetDepth)) {<NEW_LINE>s3InitiateRestoreObjectOperation.setGlacierJobTier(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return s3InitiateRestoreObjectOperation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
111,195 | public int difference(int geometry_a, int geometry_b) {<NEW_LINE>int gtA = m_topo_graph.getShape().getGeometryType(geometry_a);<NEW_LINE>int gtB = m_topo_graph.getShape().getGeometryType(geometry_b);<NEW_LINE>int dim_a = Geometry.getDimensionFromType(gtA);<NEW_LINE>int dim_b = Geometry.getDimensionFromType(gtB);<NEW_LINE>if (dim_a > dim_b) {<NEW_LINE>return geometry_a;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int ID_b = m_topo_graph.getGeometryID(geometry_b);<NEW_LINE>initMaskLookupArray_((ID_a | ID_b) + 1);<NEW_LINE>m_mask_lookup[m_topo_graph.getGeometryID(geometry_a)] = true;<NEW_LINE>if (dim_a == 2 && dim_b == 2)<NEW_LINE>return topoOperationPolygonPolygon_(geometry_a, geometry_b, -1);<NEW_LINE>if (dim_a == 1 && dim_b == 2)<NEW_LINE>return topoOperationPolylinePolylineOrPolygon_(-1);<NEW_LINE>if (dim_a == 1 && dim_b == 1)<NEW_LINE>return topoOperationPolylinePolylineOrPolygon_(-1);<NEW_LINE>if (dim_a == 0)<NEW_LINE>return topoOperationMultiPoint_();<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>} | ID_a = m_topo_graph.getGeometryID(geometry_a); |
676,578 | public TranslateTextResult translateText(TranslateTextRequest translateTextRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(translateTextRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TranslateTextRequest> request = null;<NEW_LINE>Response<TranslateTextResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TranslateTextRequestMarshaller().marshall(translateTextRequest);<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<TranslateTextResult, JsonUnmarshallerContext> unmarshaller = new TranslateTextResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<TranslateTextResult> 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<TranslateTextResult>(unmarshaller); |
639,208 | public static InfluxConfig createInfluxConfig(MetricsConfig conf) {<NEW_LINE>log.info("Configuring stats with direct InfluxDB at {}", conf.getInfluxDBUri());<NEW_LINE>return new InfluxConfig() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Duration step() {<NEW_LINE>return Duration.ofSeconds(conf.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String prefix() {<NEW_LINE>return conf.getMetricsPrefix();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String uri() {<NEW_LINE>return conf.getInfluxDBUri();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String db() {<NEW_LINE>return conf.getInfluxDBName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String userName() {<NEW_LINE>return conf.getInfluxDBUserName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String password() {<NEW_LINE>return String.valueOf(conf.getInfluxDBPassword());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String retentionPolicy() {<NEW_LINE>return conf.getInfluxDBRetention();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String get(String k) {<NEW_LINE>// accept the rest of the defaults, see https://micrometer.io/docs/registry/influx.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | getOutputFrequencySeconds().getSeconds()); |
872,920 | static Pair<Point, Short> chooseBestHintPosition(Editor editor, VisualPosition pos, LightweightHint hint, short preferredPosition, boolean showLookupHint) {<NEW_LINE>if (ApplicationManager.getApplication().isUnitTestMode() || ApplicationManager.getApplication().isHeadlessEnvironment())<NEW_LINE>return Pair.pair(new Point(), HintManager.DEFAULT);<NEW_LINE>HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl();<NEW_LINE>Dimension hintSize = hint.getComponent().getPreferredSize();<NEW_LINE>JComponent editorComponent = editor.getComponent();<NEW_LINE>JLayeredPane layeredPane = editorComponent.getRootPane().getLayeredPane();<NEW_LINE>Point p1;<NEW_LINE>Point p2;<NEW_LINE>if (showLookupHint) {<NEW_LINE>p1 = hintManager.getHintPosition(hint, editor, HintManager.UNDER);<NEW_LINE>p2 = hintManager.getHintPosition(hint, editor, HintManager.ABOVE);<NEW_LINE>} else {<NEW_LINE>p1 = HintManagerImpl.getHintPosition(hint, <MASK><NEW_LINE>p2 = HintManagerImpl.getHintPosition(hint, editor, pos, HintManager.ABOVE);<NEW_LINE>}<NEW_LINE>boolean p1Ok = p1.y + hintSize.height < layeredPane.getHeight();<NEW_LINE>boolean p2Ok = p2.y >= 0;<NEW_LINE>if (!showLookupHint) {<NEW_LINE>if (preferredPosition != HintManager.DEFAULT) {<NEW_LINE>if (preferredPosition == HintManager.ABOVE) {<NEW_LINE>if (p2Ok)<NEW_LINE>return new Pair<>(p2, HintManager.ABOVE);<NEW_LINE>} else if (preferredPosition == HintManager.UNDER) {<NEW_LINE>if (p1Ok)<NEW_LINE>return new Pair<>(p1, HintManager.UNDER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p1Ok)<NEW_LINE>return new Pair<>(p1, HintManager.UNDER);<NEW_LINE>if (p2Ok)<NEW_LINE>return new Pair<>(p2, HintManager.ABOVE);<NEW_LINE>int underSpace = layeredPane.getHeight() - p1.y;<NEW_LINE>int aboveSpace = p2.y;<NEW_LINE>return aboveSpace > underSpace ? new Pair<>(new Point(p2.x, 0), HintManager.UNDER) : new Pair<>(p1, HintManager.ABOVE);<NEW_LINE>} | editor, pos, HintManager.UNDER); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.