idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,656,380 | public void executeOnEvent(ClientPolicyContext context) throws ClientPolicyException {<NEW_LINE>switch(context.getEvent()) {<NEW_LINE>case TOKEN_REQUEST:<NEW_LINE>case SERVICE_ACCOUNT_TOKEN_REQUEST:<NEW_LINE>case TOKEN_REFRESH:<NEW_LINE>case TOKEN_REVOKE:<NEW_LINE>case TOKEN_INTROSPECT:<NEW_LINE>case LOGOUT_REQUEST:<NEW_LINE>boolean isRequireClientAssertion = Optional.ofNullable(configuration.isRequireClientAssertion()).orElse(Boolean.FALSE).booleanValue();<NEW_LINE>HttpRequest req = session.getContext(<MASK><NEW_LINE>String clientAssertion = req.getDecodedFormParameters().getFirst(OAuth2Constants.CLIENT_ASSERTION);<NEW_LINE>if (!isRequireClientAssertion && ObjectUtil.isBlank(clientAssertion)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>JWSInput jws = null;<NEW_LINE>try {<NEW_LINE>jws = new JWSInput(clientAssertion);<NEW_LINE>} catch (JWSInputException e) {<NEW_LINE>throw new ClientPolicyException(OAuthErrorException.INVALID_REQUEST, "not allowed input format.");<NEW_LINE>}<NEW_LINE>verifySecureSigningAlgorithm(jws.getHeader().getAlgorithm().name());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | ).getContextObject(HttpRequest.class); |
1,272,837 | private void parseBytes(byte[] weightBytes) {<NEW_LINE>int userId = weightBytes[0] & 0xFF;<NEW_LINE>// 0x00 male; 0x01 female<NEW_LINE>int gender = weightBytes[1] & 0xFF;<NEW_LINE>// 10 ~ 99<NEW_LINE>int age = weightBytes[2] & 0xFF;<NEW_LINE>// 0 ~ 255<NEW_LINE>int height = weightBytes[3] & 0xFF;<NEW_LINE>// kg<NEW_LINE>float weight = Converters.fromUnsignedInt16Be(weightBytes, 4) / 10.0f;<NEW_LINE>// %<NEW_LINE>float fat = Converters.fromUnsignedInt16Be(weightBytes, 6) / 10.0f;<NEW_LINE>// %<NEW_LINE>float water = Converters.fromUnsignedInt16Be(weightBytes, 8) / 10.0f;<NEW_LINE>// kg<NEW_LINE>float bone = Converters.<MASK><NEW_LINE>// %<NEW_LINE>float muscle = Converters.fromUnsignedInt16Be(weightBytes, 12) / 10.0f;<NEW_LINE>// index<NEW_LINE>float visc_fat = weightBytes[14] & 0xFF;<NEW_LINE>float calorie = Converters.fromUnsignedInt16Be(weightBytes, 15);<NEW_LINE>float bmi = Converters.fromUnsignedInt16Be(weightBytes, 17) / 10.0f;<NEW_LINE>ScaleMeasurement scaleBtData = new ScaleMeasurement();<NEW_LINE>final ScaleUser selectedUser = OpenScale.getInstance().getSelectedScaleUser();<NEW_LINE>scaleBtData.setWeight(weight);<NEW_LINE>scaleBtData.setFat(fat);<NEW_LINE>scaleBtData.setMuscle(muscle);<NEW_LINE>scaleBtData.setWater(water);<NEW_LINE>scaleBtData.setBone(bone);<NEW_LINE>scaleBtData.setVisceralFat(visc_fat);<NEW_LINE>scaleBtData.setDateTime(new Date());<NEW_LINE>addScaleMeasurement(scaleBtData);<NEW_LINE>} | fromUnsignedInt16Be(weightBytes, 10) / 10.0f; |
1,689,274 | public void format() throws IOException {<NEW_LINE>if (textContent != null && !textContent.getParagraphs().isEmpty()) {<NEW_LINE>boolean isFirstParagraph = true;<NEW_LINE>for (Paragraph paragraph : textContent.getParagraphs()) {<NEW_LINE>if (wrapLines) {<NEW_LINE>List<Line> lines = paragraph.getLines(appearanceStyle.getFont(), appearanceStyle.getFontSize(), width);<NEW_LINE>processLines(lines, isFirstParagraph);<NEW_LINE>isFirstParagraph = false;<NEW_LINE>} else {<NEW_LINE>float startOffset = 0f;<NEW_LINE>float lineWidth = appearanceStyle.getFont().getStringWidth(paragraph.getText()) * appearanceStyle.getFontSize() / FONTSCALE;<NEW_LINE>if (lineWidth < width) {<NEW_LINE>switch(textAlignment) {<NEW_LINE>case CENTER:<NEW_LINE>startOffset = (width - lineWidth) / 2;<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>startOffset = width - lineWidth;<NEW_LINE>break;<NEW_LINE>case JUSTIFY:<NEW_LINE>default:<NEW_LINE>startOffset = 0f;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>contents.<MASK><NEW_LINE>contents.showText(paragraph.getText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | newLineAtOffset(horizontalOffset + startOffset, verticalOffset); |
1,469,789 | private void initializeActiveElement() {<NEW_LINE>if (activeElement == null) {<NEW_LINE>// if handle was not passed in the constructor, try to obtain<NEW_LINE>// it from the html source task<NEW_LINE>activeElement = HtmlEditorSourceTask.getElement();<NEW_LINE>}<NEW_LINE>if (activeElement == null) {<NEW_LINE>// still nothing, out of luck...<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// set element's path in the UI<NEW_LINE>StringBuilder compoundDefaultValue = new StringBuilder();<NEW_LINE>StringBuilder elementPathLabelText = new StringBuilder();<NEW_LINE>elementPathLabelText.append("<html><body>");<NEW_LINE>TreePath path = new TreePath(activeElement.getOpenTag());<NEW_LINE>for (int i = path.path().size() - 2; i >= 0; i--) {<NEW_LINE>// skip the last "root" element<NEW_LINE>Element e = path.path().get(i);<NEW_LINE>compoundDefaultValue.append(e.id());<NEW_LINE>elementPathLabelText.append("<font color=\"");<NEW_LINE>elementPathLabelText.append<MASK><NEW_LINE>elementPathLabelText.append("\">");<NEW_LINE>elementPathLabelText.append("<");<NEW_LINE>elementPathLabelText.append(e.id());<NEW_LINE>elementPathLabelText.append(">");<NEW_LINE>elementPathLabelText.append("</font>");<NEW_LINE>if (i > 0) {<NEW_LINE>// not last element<NEW_LINE>// NOI18N<NEW_LINE>compoundDefaultValue.append(' ');<NEW_LINE>// NOI18N<NEW_LINE>elementPathLabelText.append(' ');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>elementPathLabelText.append("</body></html>");<NEW_LINE>// update the default for compound rule<NEW_LINE>compoundSelectorDefaultValue = compoundDefaultValue.toString();<NEW_LINE>} | (WebUIUtils.toHexCode(tagColor)); |
1,700,930 | private void addClassAnnotation(ClassWriter cw) {<NEW_LINE>AnnotationVisitor annotationVisitor = cw.visitAnnotation("Lorg/glowroot/agent/plugin/api/weaving/Pointcut;", true);<NEW_LINE>annotationVisitor.visit("className", config.className());<NEW_LINE>annotationVisitor.visit("classAnnotation", config.classAnnotation());<NEW_LINE>annotationVisitor.visit("subTypeRestriction", config.subTypeRestriction());<NEW_LINE>annotationVisitor.visit("superTypeRestriction", config.superTypeRestriction());<NEW_LINE>annotationVisitor.visit("methodName", config.methodName());<NEW_LINE>annotationVisitor.visit("methodAnnotation", config.methodAnnotation());<NEW_LINE>AnnotationVisitor arrayAnnotationVisitor = checkNotNull<MASK><NEW_LINE>for (String methodParameterType : config.methodParameterTypes()) {<NEW_LINE>arrayAnnotationVisitor.visit(null, methodParameterType);<NEW_LINE>}<NEW_LINE>arrayAnnotationVisitor.visitEnd();<NEW_LINE>String timerName = config.timerName();<NEW_LINE>if (config.isTimerOrGreater()) {<NEW_LINE>if (timerName.isEmpty()) {<NEW_LINE>annotationVisitor.visit("timerName", "<no timer name provided>");<NEW_LINE>} else {<NEW_LINE>annotationVisitor.visit("timerName", timerName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String nestingGroup = config.nestingGroup();<NEW_LINE>if (!nestingGroup.isEmpty()) {<NEW_LINE>annotationVisitor.visit("nestingGroup", nestingGroup);<NEW_LINE>} else if (!config.traceEntryCaptureSelfNested()) {<NEW_LINE>annotationVisitor.visit("nestingGroup", "__GeneratedAdvice" + uniqueNum);<NEW_LINE>}<NEW_LINE>annotationVisitor.visit("order", config.order());<NEW_LINE>annotationVisitor.visitEnd();<NEW_LINE>} | (annotationVisitor.visitArray("methodParameterTypes")); |
1,356,667 | public void marshall(Launch launch, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (launch == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(launch.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getExecution(), EXECUTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getGroups(), GROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getMetricMonitors(), METRICMONITORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getProject(), PROJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(launch.getScheduledSplitsDefinition(), SCHEDULEDSPLITSDEFINITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getStatusReason(), STATUSREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(launch.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | launch.getRandomizationSalt(), RANDOMIZATIONSALT_BINDING); |
742,951 | protected Element generateCloud(final Cloud cloud) {<NEW_LINE>final Element eCloud = new Element("cloud", getFeedNamespace());<NEW_LINE>final String domain = cloud.getDomain();<NEW_LINE>if (domain != null) {<NEW_LINE>eCloud.setAttribute(new Attribute("domain", domain));<NEW_LINE>}<NEW_LINE>final int port = cloud.getPort();<NEW_LINE>if (port != 0) {<NEW_LINE>eCloud.setAttribute(new Attribute("port", <MASK><NEW_LINE>}<NEW_LINE>final String path = cloud.getPath();<NEW_LINE>if (path != null) {<NEW_LINE>eCloud.setAttribute(new Attribute("path", path));<NEW_LINE>}<NEW_LINE>final String registerProcedure = cloud.getRegisterProcedure();<NEW_LINE>if (registerProcedure != null) {<NEW_LINE>eCloud.setAttribute(new Attribute("registerProcedure", registerProcedure));<NEW_LINE>}<NEW_LINE>final String protocol = cloud.getProtocol();<NEW_LINE>if (protocol != null) {<NEW_LINE>eCloud.setAttribute(new Attribute("protocol", protocol));<NEW_LINE>}<NEW_LINE>return eCloud;<NEW_LINE>} | String.valueOf(port))); |
1,458,676 | public void maybeExportToJson() {<NEW_LINE>if (dumpBlockchainData && daoStateService.isParseBlockChainComplete()) {<NEW_LINE>// We store the data we need once we write the data to disk (in the thread) locally.<NEW_LINE>// Access to daoStateService is single threaded, we must not access daoStateService from the thread.<NEW_LINE>List<JsonTxOutput> allJsonTxOutputs = new ArrayList<>();<NEW_LINE>List<JsonTx> jsonTxs = daoStateService.getUnorderedTxStream().map(tx -> {<NEW_LINE>JsonTx jsonTx = getJsonTx(tx);<NEW_LINE>allJsonTxOutputs.addAll(jsonTx.getOutputs());<NEW_LINE>return jsonTx;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>GcUtil.maybeReleaseMemory();<NEW_LINE>DaoState daoState = daoStateService.getClone();<NEW_LINE>List<JsonBlock> jsonBlockList = daoState.getBlocks().stream().map(this::getJsonBlock).collect(Collectors.toList());<NEW_LINE>JsonBlocks jsonBlocks = new JsonBlocks(daoState.getChainHeight(), jsonBlockList);<NEW_LINE>ListenableFuture<Void> future = executor.submit(() -> {<NEW_LINE>bsqStateFileManager.writeToDisc(JsonUtil.objectToJson(jsonBlocks), "blocks");<NEW_LINE>allJsonTxOutputs.forEach(jsonTxOutput -> txOutputFileManager.writeToDisc(JsonUtil.objectToJson(jsonTxOutput), jsonTxOutput.getId()));<NEW_LINE>jsonTxs.forEach(jsonTx -> txFileManager.writeToDisc(JsonUtil.objectToJson(jsonTx), jsonTx.getId()));<NEW_LINE>GcUtil.maybeReleaseMemory();<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>Futures.addCallback(future, Utilities.failureCallback(throwable -> {<NEW_LINE>log.<MASK><NEW_LINE>throwable.printStackTrace();<NEW_LINE>}), MoreExecutors.directExecutor());<NEW_LINE>}<NEW_LINE>} | error(throwable.toString()); |
182,722 | public void visitType(JavacNode typeNode, JCClassDecl type) {<NEW_LINE>AnnotationValues<FieldDefaults> fieldDefaults = null;<NEW_LINE>JavacNode source = typeNode;<NEW_LINE>boolean levelIsExplicit = false;<NEW_LINE>boolean makeFinalIsExplicit = false;<NEW_LINE>FieldDefaults fd = null;<NEW_LINE>for (JavacNode jn : typeNode.down()) {<NEW_LINE>if (jn.getKind() != Kind.ANNOTATION)<NEW_LINE>continue;<NEW_LINE>JCAnnotation ann = (JCAnnotation) jn.get();<NEW_LINE>JCTree typeTree = ann.annotationType;<NEW_LINE>if (typeTree == null)<NEW_LINE>continue;<NEW_LINE>String typeTreeToString = typeTree.toString();<NEW_LINE>if (!typeTreeToString.equals("FieldDefaults") && !typeTreeToString.equals("lombok.experimental.FieldDefaults"))<NEW_LINE>continue;<NEW_LINE>if (!typeMatches(FieldDefaults.class, jn, typeTree))<NEW_LINE>continue;<NEW_LINE>source = jn;<NEW_LINE>fieldDefaults = createAnnotation(FieldDefaults.class, jn);<NEW_LINE>levelIsExplicit = fieldDefaults.isExplicit("level");<NEW_LINE>makeFinalIsExplicit = fieldDefaults.isExplicit("makeFinal");<NEW_LINE>handleExperimentalFlagUsage(jn, ConfigurationKeys.FIELD_DEFAULTS_FLAG_USAGE, "@FieldDefaults");<NEW_LINE>fd = fieldDefaults.getInstance();<NEW_LINE>if (!levelIsExplicit && !makeFinalIsExplicit) {<NEW_LINE>jn.addError("This does nothing; provide either level or makeFinal or both.");<NEW_LINE>}<NEW_LINE>if (levelIsExplicit && fd.level() == AccessLevel.NONE) {<NEW_LINE>jn.addError("AccessLevel.NONE doesn't mean anything here. Pick another value.");<NEW_LINE>levelIsExplicit = false;<NEW_LINE>}<NEW_LINE>deleteAnnotationIfNeccessary(jn, FieldDefaults.class);<NEW_LINE>deleteImportFromCompilationUnit(jn, "lombok.AccessLevel");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (fd == null && (type.mods.flags & (Flags.INTERFACE | Flags.ANNOTATION)) != 0)<NEW_LINE>return;<NEW_LINE>boolean defaultToPrivate = levelIsExplicit ? false : Boolean.TRUE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.FIELD_DEFAULTS_PRIVATE_EVERYWHERE));<NEW_LINE>boolean defaultToFinal = makeFinalIsExplicit ? false : Boolean.TRUE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.FIELD_DEFAULTS_FINAL_EVERYWHERE));<NEW_LINE>if (!defaultToPrivate && !defaultToFinal && fieldDefaults == null)<NEW_LINE>return;<NEW_LINE>// Do not apply field defaults to records if set using the the config system<NEW_LINE>if (fieldDefaults == null && !isClassOrEnum(typeNode))<NEW_LINE>return;<NEW_LINE>AccessLevel fdAccessLevel = (fieldDefaults != null && levelIsExplicit) ? fd.level() : defaultToPrivate ? AccessLevel.PRIVATE : null;<NEW_LINE>boolean fdToFinal = (fieldDefaults != null && makeFinalIsExplicit) <MASK><NEW_LINE>generateFieldDefaultsForType(typeNode, source, fdAccessLevel, fdToFinal, false);<NEW_LINE>} | ? fd.makeFinal() : defaultToFinal; |
1,363,065 | public byte[] encrypt(byte[] nonce, byte[] message) {<NEW_LINE>checkLength(nonce, XSALSA20_POLY1305_SECRETBOX_NONCEBYTES);<NEW_LINE>byte[] msg = org.libsodium.jni.crypto.Util.prependZeros(ZERO_BYTES, message);<NEW_LINE>byte[] ct = org.libsodium.jni.crypto.Util.zeros(msg.length);<NEW_LINE>isValid(sodium().crypto_secretbox_xsalsa20poly1305(ct, msg, msg.length, nonce, mKey), "Encryption failed");<NEW_LINE>byte[] cipherWithoutNonce = removeZeros(BOXZERO_BYTES, ct);<NEW_LINE>byte[] ciphertext = new byte[cipherWithoutNonce.length + XSALSA20_POLY1305_SECRETBOX_NONCEBYTES];<NEW_LINE>System.arraycopy(nonce, 0, <MASK><NEW_LINE>System.arraycopy(cipherWithoutNonce, 0, ciphertext, nonce.length, cipherWithoutNonce.length);<NEW_LINE>return ciphertext;<NEW_LINE>} | ciphertext, 0, nonce.length); |
1,367,336 | final PutEmailIdentityMailFromAttributesResult executePutEmailIdentityMailFromAttributes(PutEmailIdentityMailFromAttributesRequest putEmailIdentityMailFromAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putEmailIdentityMailFromAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutEmailIdentityMailFromAttributesRequest> request = null;<NEW_LINE>Response<PutEmailIdentityMailFromAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutEmailIdentityMailFromAttributesRequestProtocolMarshaller(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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutEmailIdentityMailFromAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutEmailIdentityMailFromAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutEmailIdentityMailFromAttributesResultJsonUnmarshaller());<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(putEmailIdentityMailFromAttributesRequest)); |
1,819,239 | public void localize(ProcessInstance processInstance, String locale, boolean withLocalizationFallback) {<NEW_LINE>ExecutionEntity processInstanceExecution = (ExecutionEntity) processInstance;<NEW_LINE>processInstanceExecution.setLocalizedName(null);<NEW_LINE>processInstanceExecution.setLocalizedDescription(null);<NEW_LINE>if (locale != null) {<NEW_LINE>String processDefinitionId = processInstanceExecution.getProcessDefinitionId();<NEW_LINE>if (processDefinitionId != null) {<NEW_LINE>ObjectNode languageNode = BpmnOverrideContext.getLocalizationElementProperties(locale, processInstanceExecution.getProcessDefinitionKey(), processDefinitionId, withLocalizationFallback);<NEW_LINE>if (languageNode != null) {<NEW_LINE>JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME);<NEW_LINE>if (languageNameNode != null && !languageNameNode.isNull()) {<NEW_LINE>processInstanceExecution.<MASK><NEW_LINE>}<NEW_LINE>JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION);<NEW_LINE>if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) {<NEW_LINE>processInstanceExecution.setLocalizedDescription(languageDescriptionNode.asText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setLocalizedName(languageNameNode.asText()); |
744,916 | private Query cidrQuery(String term, SearchExecutionContext context) {<NEW_LINE>Tuple<InetAddress, Integer> cidr = InetAddresses.parseCidr(term);<NEW_LINE>InetAddress addr = cidr.v1();<NEW_LINE>int prefixLength = cidr.v2();<NEW_LINE>// create the lower value by zeroing out the host portion, upper value by filling it with all ones.<NEW_LINE>byte[] lower = addr.getAddress();<NEW_LINE>byte[] upper = addr.getAddress();<NEW_LINE>for (int i = prefixLength; i < 8 * lower.length; i++) {<NEW_LINE>int m = 1 << (7 - (i & 7));<NEW_LINE>lower[i >> 3] &= ~m;<NEW_LINE>upper[i >> 3] |= m;<NEW_LINE>}<NEW_LINE>// Force the terms into IPv6<NEW_LINE>BytesRef lowerBytes = new BytesRef(InetAddressPoint.encode(InetAddressPoint.decode(lower)));<NEW_LINE>BytesRef upperBytes = new BytesRef(InetAddressPoint.encode(InetAddressPoint.decode(upper)));<NEW_LINE>return new IpScriptFieldRangeQuery(script, leafFactory(context), <MASK><NEW_LINE>} | name(), lowerBytes, upperBytes); |
1,286,179 | public void onClick(View view) {<NEW_LINE>Intent compose;<NEW_LINE>if (!secondAcc) {<NEW_LINE>compose = new Intent(context, ComposeActivity.class);<NEW_LINE>} else {<NEW_LINE>compose = new Intent(context, ComposeSecAccActivity.class);<NEW_LINE>String text = context.getString(R.string.using_second_account).replace("%s", "@" + settings.secondScreenName);<NEW_LINE>Toast.makeText(context, text, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>String string = holder.reply.getText().toString();<NEW_LINE>try {<NEW_LINE>compose.putExtra("user", string.substring(0, string.length() - 1));<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>compose.<MASK><NEW_LINE>compose.putExtra("reply_to_text", "@" + holder.screenName + ": " + holder.tweet.getText().toString());<NEW_LINE>if (isHomeTimeline) {<NEW_LINE>sharedPrefs.edit().putLong("current_position_" + settings.currentAccount, holder.tweetId).commit();<NEW_LINE>}<NEW_LINE>context.startActivity(compose);<NEW_LINE>removeExpansionWithAnimation(holder);<NEW_LINE>} | putExtra("id", holder.tweetId); |
510,451 | public AdminEnableUserResult adminEnableUser(AdminEnableUserRequest adminEnableUserRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminEnableUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AdminEnableUserRequest> request = null;<NEW_LINE>Response<AdminEnableUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminEnableUserRequestMarshaller().marshall(adminEnableUserRequest);<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<AdminEnableUserResult, JsonUnmarshallerContext> unmarshaller = new AdminEnableUserResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<AdminEnableUserResult> 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<AdminEnableUserResult>(unmarshaller); |
1,581,440 | private void genVirtualCall(BIRTerminator.Call callIns, boolean isBuiltInModule, int localVarOffset) {<NEW_LINE>// load self<NEW_LINE>BIRNode.BIRVariableDcl selfArg = callIns.args.get(0).variableDcl;<NEW_LINE>this.loadVar(selfArg);<NEW_LINE>this.mv.visitTypeInsn(CHECKCAST, B_OBJECT);<NEW_LINE>// load the strand<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>// load the function name as the second argument<NEW_LINE>this.mv.visitLdcInsn(JvmCodeGenUtil.rewriteVirtualCallTypeName(callIns.name.value));<NEW_LINE>// create an Object[] for the rest params<NEW_LINE>int argsCount = callIns.args.size() - 1;<NEW_LINE>// arg count doubled and 'isExist' boolean variables added for each arg.<NEW_LINE>this.mv.visitLdcInsn((long) (argsCount * 2));<NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>this.mv.visitTypeInsn(ANEWARRAY, OBJECT);<NEW_LINE>int i = 0;<NEW_LINE>int j = 0;<NEW_LINE>while (i < argsCount) {<NEW_LINE>this.mv.visitInsn(DUP);<NEW_LINE>this.mv.visitLdcInsn((long) j);<NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>j += 1;<NEW_LINE>// i + 1 is used since we skip the first argument (self)<NEW_LINE>BIRArgument arg = callIns.args.get(i + 1);<NEW_LINE>this.loadArgument(arg);<NEW_LINE>// Add the to the rest params array<NEW_LINE>jvmCastGen.addBoxInsn(this.mv, arg.variableDcl.type);<NEW_LINE>this.mv.visitInsn(AASTORE);<NEW_LINE>this.mv.visitInsn(DUP);<NEW_LINE>this.mv<MASK><NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>j += 1;<NEW_LINE>this.loadStateOfArgument(arg, isBuiltInModule);<NEW_LINE>jvmCastGen.addBoxInsn(this.mv, symbolTable.booleanType);<NEW_LINE>this.mv.visitInsn(AASTORE);<NEW_LINE>i += 1;<NEW_LINE>}<NEW_LINE>// call method<NEW_LINE>String methodDesc = BOBJECT_CALL;<NEW_LINE>this.mv.visitMethodInsn(INVOKEINTERFACE, B_OBJECT, "call", methodDesc, true);<NEW_LINE>BType returnType = callIns.lhsOp.variableDcl.type;<NEW_LINE>jvmCastGen.addUnboxInsn(this.mv, returnType);<NEW_LINE>} | .visitLdcInsn((long) j); |
1,021,080 | public void populateAssignmentsMetadata(User.ID userID, Application.Name appName, Context context, ExperimentBatch experimentBatch, Optional<Map<Experiment.ID, Boolean>> allowAssignments, PrioritizedExperimentList prioritizedExperimentList, Map<Experiment.ID, com.intuit.wasabi.experimentobjects.Experiment> experimentMap, Map<Experiment.ID, BucketList> bucketMap, Map<Experiment.ID, List<Experiment.ID>> exclusionMap) {<NEW_LINE>if (LOGGER.isDebugEnabled())<NEW_LINE>LOGGER.debug("populateExperimentMetadata - STARTED: userID={}, appName={}, context={}, experimentBatch={}, experimentIds={}", userID, appName, context, experimentBatch, allowAssignments);<NEW_LINE>if (isNull(experimentBatch.getLabels()) && !allowAssignments.isPresent()) {<NEW_LINE>LOGGER.error("Invalid input to CassandraAssignmentsRepository.populateExperimentMetadata(): Given input: userID={}, appName={}, context={}, experimentBatch={}, allowAssignments={}", userID, appName, context, experimentBatch, allowAssignments);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Populate experiments map, prioritized experiments list and existing user assignments.<NEW_LINE>populateExperimentApplicationAndUserAssignments(userID, <MASK><NEW_LINE>// Populate experiments ids of given batch<NEW_LINE>Set<Experiment.ID> experimentIds = allowAssignments.isPresent() ? allowAssignments.get().keySet() : new HashSet<>();<NEW_LINE>populateExperimentIdsAndExperimentBatch(allowAssignments, experimentMap, experimentBatch, experimentIds);<NEW_LINE>// Based on given experiment ids, populate experiment buckets and exclusions..<NEW_LINE>populateBucketsAndExclusions(experimentIds, bucketMap, exclusionMap);<NEW_LINE>if (LOGGER.isDebugEnabled())<NEW_LINE>LOGGER.debug("populateExperimentMetadata - FINISHED...");<NEW_LINE>} | appName, context, prioritizedExperimentList, experimentMap); |
157,211 | public void onConnectReceived(WearableConnection connection, String nodeId, Connect connect) {<NEW_LINE>for (ConnectionConfiguration config : getConfigurations()) {<NEW_LINE>if (config.nodeId.equals(nodeId)) {<NEW_LINE>if (config.nodeId != nodeId) {<NEW_LINE>config.nodeId = connect.id;<NEW_LINE>configDatabase.putConfiguration(config, nodeId);<NEW_LINE>}<NEW_LINE>config.peerNodeId = connect.id;<NEW_LINE>config.connected = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d(TAG, "Adding connection to list of open connections: " + connection + " with connect " + connect);<NEW_LINE>activeConnections.put(connect.id, connection);<NEW_LINE>onPeerConnected(new NodeParcelable(connect.id, connect.name));<NEW_LINE>// Fetch missing assets<NEW_LINE>Cursor cursor = nodeDatabase.listMissingAssets();<NEW_LINE>if (cursor != null) {<NEW_LINE>while (cursor.moveToNext()) {<NEW_LINE>try {<NEW_LINE>Log.d(TAG, "Fetch for " + cursor.getString(12));<NEW_LINE>connection.writeMessage(new RootMessage.Builder().fetchAsset(new FetchAsset.Builder().assetName(cursor.getString(12)).packageName(cursor.getString(1)).signatureDigest(cursor.getString(2)).permission(false).build()).build());<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>closeConnection(connect.id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>} | Log.w(TAG, e); |
652,910 | public void outASTLabeledBlockNode(ASTLabeledBlockNode node) {<NEW_LINE>String outerLabel = node.get_Label().toString();<NEW_LINE>if (outerLabel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String innerLabel = null;<NEW_LINE>ASTLabeledBlockNode secondLabeledBlockNode = isLabelWithinLabel(node);<NEW_LINE>if (secondLabeledBlockNode == null) {<NEW_LINE>// node doesnt have an immediate label following it<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// store the labelname<NEW_LINE>innerLabel = secondLabeledBlockNode.get_Label().toString();<NEW_LINE>if (innerLabel == null) {<NEW_LINE>// empty or marked for deletion<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List secondLabelsBodies = getSecondLabeledBlockBodies(secondLabeledBlockNode);<NEW_LINE>boolean allIfs = checkAllAreIfsWithProperBreaks(secondLabelsBodies.iterator(), outerLabel, innerLabel);<NEW_LINE>if (!allIfs) {<NEW_LINE>// pattern doesnt match<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// the pattern has been matched do the transformation<NEW_LINE>// Create a list of conditions to be Ored together<NEW_LINE>// remembering that the last ones condition is to be flipped<NEW_LINE>List<ASTCondition> conditions = getConditions(secondLabelsBodies.iterator());<NEW_LINE>// create an aggregated condition<NEW_LINE>Iterator<ASTCondition> condIt = conditions.iterator();<NEW_LINE>ASTCondition newCond = null;<NEW_LINE>;<NEW_LINE>while (condIt.hasNext()) {<NEW_LINE>ASTCondition next = condIt.next();<NEW_LINE>if (newCond == null) {<NEW_LINE>newCond = next;<NEW_LINE>} else {<NEW_LINE>newCond = new ASTOrCondition(newCond, next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// will contain the Body of the ASTIfNode<NEW_LINE>List<Object> newIfBody = new ArrayList<Object>();<NEW_LINE>// get_SubBodies of upper labeled block<NEW_LINE>List<Object> subBodies = node.get_SubBodies();<NEW_LINE>// we know that there is only one SubBody for this node retrieve that<NEW_LINE>List labeledBlockBody = (<MASK><NEW_LINE>// from the isLabelWithinLabel method we know that the first is the labeled block<NEW_LINE>// discard that keep the rest<NEW_LINE>Iterator subBodiesIt = labeledBlockBody.iterator();<NEW_LINE>// discarding first<NEW_LINE>subBodiesIt.next();<NEW_LINE>while (subBodiesIt.hasNext()) {<NEW_LINE>ASTNode temp = (ASTNode) subBodiesIt.next();<NEW_LINE>newIfBody.add(temp);<NEW_LINE>}<NEW_LINE>ASTIfNode newNode = new ASTIfNode(new SETNodeLabel(), newCond, newIfBody);<NEW_LINE>List<Object> newLabeledBlockBody = new ArrayList<Object>();<NEW_LINE>newLabeledBlockBody.add(newNode);<NEW_LINE>G.v().ASTTransformations_modified = true;<NEW_LINE>// System.out.println("OR AGGREGATING ONE!!!");<NEW_LINE>node.replaceBody(newLabeledBlockBody);<NEW_LINE>UselessLabelFinder.v().findAndKill(node);<NEW_LINE>} | List) subBodies.get(0); |
264,508 | public Map<String, TF_Tensor> recastInputs(Map<String, TF_Tensor> inputs, List<String> inputOrder, Map<String, TensorDataType> inputDataTypes) {<NEW_LINE>if (inputDataTypes == null || inputDataTypes.isEmpty()) {<NEW_LINE>inputDataTypes = new LinkedHashMap<>();<NEW_LINE>for (int i = 0; i < inputOrder.size(); i++) {<NEW_LINE>TensorDataType tensorDataType = TensorDataType.values()[TF_TensorType(inputs.get(inputOrder.get(i)))];<NEW_LINE>Preconditions.checkNotNull(tensorDataType, "Data type of " + TF_TensorType(inputs.get(inputOrder.get(i))) + " was null!");<NEW_LINE>inputDataTypes.put(inputOrder.get(i), tensorDataType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, TF_Tensor> ret = new HashMap<>();<NEW_LINE>for (int i = 0; i < inputOrder.size(); i++) {<NEW_LINE>TF_Tensor currInput = inputs.get(inputOrder.get(i));<NEW_LINE>TensorDataType fromDType = TensorDataType.values<MASK><NEW_LINE>if (fromDType != inputDataTypes.get(inputOrder.get(i))) {<NEW_LINE>TF_Tensor oldTensor = currInput;<NEW_LINE>currInput = castTensor(currInput, fromDType, inputDataTypes.get(inputOrder.get(i)));<NEW_LINE>TF_DeleteTensor(oldTensor);<NEW_LINE>}<NEW_LINE>ret.put(inputOrder.get(i), currInput);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ()[TF_TensorType(currInput)]; |
653,453 | public static DescribeLiveDomainLimitResponse unmarshall(DescribeLiveDomainLimitResponse describeLiveDomainLimitResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveDomainLimitResponse.setRequestId<MASK><NEW_LINE>List<LiveDomainLimit> liveDomainLimitList = new ArrayList<LiveDomainLimit>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveDomainLimitResponse.LiveDomainLimitList.Length"); i++) {<NEW_LINE>LiveDomainLimit liveDomainLimit = new LiveDomainLimit();<NEW_LINE>liveDomainLimit.setLimitTranscodeNum(_ctx.integerValue("DescribeLiveDomainLimitResponse.LiveDomainLimitList[" + i + "].LimitTranscodeNum"));<NEW_LINE>liveDomainLimit.setDomainName(_ctx.stringValue("DescribeLiveDomainLimitResponse.LiveDomainLimitList[" + i + "].DomainName"));<NEW_LINE>liveDomainLimit.setLimitNum(_ctx.integerValue("DescribeLiveDomainLimitResponse.LiveDomainLimitList[" + i + "].LimitNum"));<NEW_LINE>liveDomainLimitList.add(liveDomainLimit);<NEW_LINE>}<NEW_LINE>describeLiveDomainLimitResponse.setLiveDomainLimitList(liveDomainLimitList);<NEW_LINE>return describeLiveDomainLimitResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeLiveDomainLimitResponse.RequestId")); |
109,648 | final GetGroupResult executeGetGroup(GetGroupRequest getGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupRequest> request = null;<NEW_LINE>Response<GetGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getGroupRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGroupResultJsonUnmarshaller());<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); |
1,759,521 | protected boolean onExecute(String verb, String parameter, MissionInit missionInit) {<NEW_LINE>if (verb.equalsIgnoreCase(InventoryCommand.SWAP_INVENTORY_ITEMS.value())) {<NEW_LINE>if (parameter != null && parameter.length() != 0) {<NEW_LINE>List<Object> params <MASK><NEW_LINE>if (getParameters(parameter, params)) {<NEW_LINE>// All okay, so create a swap message for the server:<NEW_LINE>MalmoMod.network.sendToServer(new InventoryMessage(params, false));<NEW_LINE>return true;<NEW_LINE>} else<NEW_LINE>// Duff parameters.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (verb.equalsIgnoreCase(InventoryCommand.COMBINE_INVENTORY_ITEMS.value())) {<NEW_LINE>if (parameter != null && parameter.length() != 0) {<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>if (getParameters(parameter, params)) {<NEW_LINE>// All okay, so create a combine message for the server:<NEW_LINE>MalmoMod.network.sendToServer(new InventoryMessage(params, true));<NEW_LINE>return true;<NEW_LINE>} else<NEW_LINE>// Duff parameters.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (verb.equalsIgnoreCase(InventoryCommand.DISCARD_CURRENT_ITEM.value())) {<NEW_LINE>// This we can do on the client side:<NEW_LINE>// false means just drop one item - true means drop everything in the current stack.<NEW_LINE>Minecraft.getMinecraft().player.dropItem(false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.onExecute(verb, parameter, missionInit);<NEW_LINE>} | = new ArrayList<Object>(); |
760,729 | public static DescribeTemplateResponse unmarshall(DescribeTemplateResponse describeTemplateResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeTemplateResponse.setRequestId(_ctx.stringValue("DescribeTemplateResponse.RequestId"));<NEW_LINE>describeTemplateResponse.setId(_ctx.stringValue("DescribeTemplateResponse.Id"));<NEW_LINE>describeTemplateResponse.setName(_ctx.stringValue("DescribeTemplateResponse.Name"));<NEW_LINE>describeTemplateResponse.setDescription(_ctx.stringValue("DescribeTemplateResponse.Description"));<NEW_LINE>describeTemplateResponse.setType(_ctx.stringValue("DescribeTemplateResponse.Type"));<NEW_LINE>describeTemplateResponse.setRegion(_ctx.stringValue("DescribeTemplateResponse.Region"));<NEW_LINE>describeTemplateResponse.setOssBucket(_ctx.stringValue("DescribeTemplateResponse.OssBucket"));<NEW_LINE>describeTemplateResponse.setOssEndpoint(_ctx.stringValue("DescribeTemplateResponse.OssEndpoint"));<NEW_LINE>describeTemplateResponse.setOssFilePrefix(_ctx.stringValue("DescribeTemplateResponse.OssFilePrefix"));<NEW_LINE>describeTemplateResponse.setTrigger(_ctx.stringValue("DescribeTemplateResponse.Trigger"));<NEW_LINE>describeTemplateResponse.setStartTime(_ctx.stringValue("DescribeTemplateResponse.StartTime"));<NEW_LINE>describeTemplateResponse.setEndTime(_ctx.stringValue("DescribeTemplateResponse.EndTime"));<NEW_LINE>describeTemplateResponse.setInterval(_ctx.longValue("DescribeTemplateResponse.Interval"));<NEW_LINE>describeTemplateResponse.setRetention(_ctx.longValue("DescribeTemplateResponse.Retention"));<NEW_LINE>describeTemplateResponse.setFileFormat(_ctx.stringValue("DescribeTemplateResponse.FileFormat"));<NEW_LINE>describeTemplateResponse.setJpgOverwrite(_ctx.stringValue("DescribeTemplateResponse.JpgOverwrite"));<NEW_LINE>describeTemplateResponse.setJpgSequence(_ctx.stringValue("DescribeTemplateResponse.JpgSequence"));<NEW_LINE>describeTemplateResponse.setJpgOnDemand(_ctx.stringValue("DescribeTemplateResponse.JpgOnDemand"));<NEW_LINE>describeTemplateResponse.setMp4<MASK><NEW_LINE>describeTemplateResponse.setFlv(_ctx.stringValue("DescribeTemplateResponse.Flv"));<NEW_LINE>describeTemplateResponse.setHlsM3u8(_ctx.stringValue("DescribeTemplateResponse.HlsM3u8"));<NEW_LINE>describeTemplateResponse.setHlsTs(_ctx.stringValue("DescribeTemplateResponse.HlsTs"));<NEW_LINE>describeTemplateResponse.setCallback(_ctx.stringValue("DescribeTemplateResponse.Callback"));<NEW_LINE>describeTemplateResponse.setCreatedTime(_ctx.stringValue("DescribeTemplateResponse.CreatedTime"));<NEW_LINE>List<TransConfig> transConfigs = new ArrayList<TransConfig>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeTemplateResponse.TransConfigs.Length"); i++) {<NEW_LINE>TransConfig transConfig = new TransConfig();<NEW_LINE>transConfig.setId(_ctx.stringValue("DescribeTemplateResponse.TransConfigs[" + i + "].Id"));<NEW_LINE>transConfig.setName(_ctx.stringValue("DescribeTemplateResponse.TransConfigs[" + i + "].Name"));<NEW_LINE>transConfig.setVideoCodec(_ctx.stringValue("DescribeTemplateResponse.TransConfigs[" + i + "].VideoCodec"));<NEW_LINE>transConfig.setVideoBitrate(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].VideoBitrate"));<NEW_LINE>transConfig.setFps(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Fps"));<NEW_LINE>transConfig.setGop(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Gop"));<NEW_LINE>transConfig.setHeight(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Height"));<NEW_LINE>transConfig.setWidth(_ctx.longValue("DescribeTemplateResponse.TransConfigs[" + i + "].Width"));<NEW_LINE>transConfigs.add(transConfig);<NEW_LINE>}<NEW_LINE>describeTemplateResponse.setTransConfigs(transConfigs);<NEW_LINE>return describeTemplateResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeTemplateResponse.Mp4")); |
1,002,874 | protected void configure(HttpSecurity http) throws Exception {<NEW_LINE>http.<MASK><NEW_LINE>// define user login page<NEW_LINE>// if login success<NEW_LINE>http.formLogin().loginPage("/user/require").loginProcessingUrl("/user/login").usernameParameter("username").passwordParameter("password").permitAll().// if login success<NEW_LINE>successHandler(// if login fail<NEW_LINE>authenticationSuccessHandler).// if login fail<NEW_LINE>failureHandler(loginfailHandler).and().addFilterAfter(new UserFilter(), LoginFilter.class).addFilter(new LoginFilter(authenticationManagerBean(), authenticationSuccessHandler, loginfailHandler)).authorizeRequests().antMatchers("/user/**", "/", "/static/**", "/weevent-governance/user/**").permitAll().anyRequest().authenticated().and().csrf().disable().httpBasic().authenticationEntryPoint(jsonAuthenticationEntryPoint).disable().cors().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().logout().logoutUrl("/user/logout").logoutSuccessHandler(jsonLogoutSuccessHandler).permitAll();<NEW_LINE>} | exceptionHandling().accessDeniedHandler(jsonAccessDeniedHandler); |
1,762,416 | public static CustomCommandLine.Builder defaultSingleJarCommandLine(Artifact outputJar, String javaMainClass, ImmutableList<String> deployManifestLines, Iterable<Artifact> buildInfoFiles, ImmutableList<Artifact> classpathResources, NestedSet<Artifact> runtimeClasspath, boolean includeBuildData, Compression compress, Artifact launcher, OneVersionEnforcementLevel oneVersionEnforcementLevel, @Nullable Artifact oneVersionAllowlistArtifact, boolean multiReleaseDeployJars) {<NEW_LINE>CustomCommandLine.Builder args = CustomCommandLine.builder();<NEW_LINE>args.addExecPath("--output", outputJar);<NEW_LINE>if (compress == Compression.COMPRESSED) {<NEW_LINE>args.add("--compression");<NEW_LINE>}<NEW_LINE>args.add("--normalize");<NEW_LINE>if (javaMainClass != null) {<NEW_LINE>args.add("--main_class", javaMainClass);<NEW_LINE>}<NEW_LINE>if (!deployManifestLines.isEmpty()) {<NEW_LINE>args.add("--deploy_manifest_lines");<NEW_LINE>args.addAll(deployManifestLines);<NEW_LINE>}<NEW_LINE>if (buildInfoFiles != null) {<NEW_LINE>for (Artifact artifact : buildInfoFiles) {<NEW_LINE>args.addExecPath("--build_info_file", artifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!includeBuildData) {<NEW_LINE>args.add("--exclude_build_data");<NEW_LINE>}<NEW_LINE>if (launcher != null) {<NEW_LINE>args.addExecPath("--java_launcher", launcher);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (runtimeClasspath != null) {<NEW_LINE>args.addAll("--sources", OneVersionCheckActionBuilder.jarAndTargetVectorArg(runtimeClasspath));<NEW_LINE>}<NEW_LINE>if (oneVersionEnforcementLevel != OneVersionEnforcementLevel.OFF) {<NEW_LINE>args.add("--enforce_one_version");<NEW_LINE>// RuleErrors should have been added in Builder.build() before this command<NEW_LINE>// line is invoked.<NEW_LINE>Preconditions.checkNotNull(oneVersionAllowlistArtifact);<NEW_LINE>args.addExecPath("--one_version_whitelist", oneVersionAllowlistArtifact);<NEW_LINE>if (oneVersionEnforcementLevel == OneVersionEnforcementLevel.WARNING) {<NEW_LINE>args.add("--succeed_on_found_violations");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (multiReleaseDeployJars) {<NEW_LINE>args.add("--multi_release");<NEW_LINE>}<NEW_LINE>return args;<NEW_LINE>} | args.addExecPaths("--classpath_resources", classpathResources); |
1,274,872 | public void writeQueryData(final ChannelHandlerContext context, final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount) throws SQLException {<NEW_LINE>if (ResponseType.QUERY != queryCommandExecutor.getResponseType() || !context.channel().isActive()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>int flushThreshold = ProxyContext.getInstance().getContextManager().getMetaDataContexts().getProps().<Integer>getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD);<NEW_LINE>int currentSequenceId = 0;<NEW_LINE>while (queryCommandExecutor.next()) {<NEW_LINE>count++;<NEW_LINE>while (!context.channel().isWritable() && context.channel().isActive()) {<NEW_LINE>context.flush();<NEW_LINE>((JDBCBackendConnection) backendConnection)<MASK><NEW_LINE>}<NEW_LINE>DatabasePacket<?> dataValue = queryCommandExecutor.getQueryRowPacket();<NEW_LINE>context.write(dataValue);<NEW_LINE>if (flushThreshold == count) {<NEW_LINE>context.flush();<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>currentSequenceId++;<NEW_LINE>}<NEW_LINE>context.write(new MySQLEofPacket(++currentSequenceId + headerPackagesCount));<NEW_LINE>} | .getResourceLock().doAwait(); |
610,586 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>String executorSeed = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>WorkCompleted workCompleted = emc.fetch(id, WorkCompleted.class, ListTools.toList(WorkCompleted.job_FIELDNAME));<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(id, WorkCompleted.class);<NEW_LINE>}<NEW_LINE>executorSeed = workCompleted.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>WorkCompleted workCompleted = emc.find(id, WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(id, WorkCompleted.class);<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isTrue(workCompleted.getMerged())) {<NEW_LINE>throw new ExceptionModifyMerged(workCompleted.getId());<NEW_LINE>}<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(workCompleted.getId());<NEW_LINE>updateData(business, workCompleted, jsonElement, path0, path1, path2, path3, path4, path5);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).<MASK><NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | get(300, TimeUnit.SECONDS); |
625,934 | private void commonSupportingFiles() {<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>if (getLibrary().equals(MULTIPLATFORM)) {<NEW_LINE>supportingFiles.add(new SupportingFile("build.gradle.kts.mustache", "", "build.gradle.kts"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>} else if (getLibrary().equals(JVM_VOLLEY)) {<NEW_LINE>supportingFiles.add(new SupportingFile("build.mustache", "", "build.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));<NEW_LINE>supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("manifest.mustache", "", "src/main/AndroidManifest.xml"));<NEW_LINE>} else {<NEW_LINE>supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle"));<NEW_LINE>supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle"));<NEW_LINE>}<NEW_LINE>// gradle wrapper supporting files<NEW_LINE>supportingFiles.add(new SupportingFile("gradlew.mustache", "", "gradlew"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradlew.bat.mustache", "", "gradlew.bat"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradle-wrapper.properties.mustache", "gradle.wrapper".replace(".", File.separator), "gradle-wrapper.properties"));<NEW_LINE>supportingFiles.add(new SupportingFile("gradle-wrapper.jar", "gradle.wrapper".replace(".", File.separator), "gradle-wrapper.jar"));<NEW_LINE>} | ("settings.gradle.kts.mustache", "", "settings.gradle.kts")); |
1,220,446 | public static ListCallTaskResponse unmarshall(ListCallTaskResponse listCallTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCallTaskResponse.setRequestId(_ctx.stringValue("ListCallTaskResponse.RequestId"));<NEW_LINE>listCallTaskResponse.setCode<MASK><NEW_LINE>listCallTaskResponse.setPageNumber(_ctx.longValue("ListCallTaskResponse.PageNumber"));<NEW_LINE>listCallTaskResponse.setPageSize(_ctx.longValue("ListCallTaskResponse.PageSize"));<NEW_LINE>listCallTaskResponse.setTotal(_ctx.longValue("ListCallTaskResponse.Total"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCallTaskResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setId(_ctx.longValue("ListCallTaskResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setTaskName(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].TaskName"));<NEW_LINE>dataItem.setTemplateName(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].TemplateName"));<NEW_LINE>dataItem.setBizType(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].BizType"));<NEW_LINE>dataItem.setResource(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].Resource"));<NEW_LINE>dataItem.setFireTime(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].FireTime"));<NEW_LINE>dataItem.setCompleteTime(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].CompleteTime"));<NEW_LINE>dataItem.setStatus(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].Status"));<NEW_LINE>dataItem.setStopTime(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].StopTime"));<NEW_LINE>dataItem.setTemplateCode(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].TemplateCode"));<NEW_LINE>dataItem.setData(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].Data"));<NEW_LINE>dataItem.setDataType(_ctx.stringValue("ListCallTaskResponse.Data[" + i + "].DataType"));<NEW_LINE>dataItem.setTotalCount(_ctx.longValue("ListCallTaskResponse.Data[" + i + "].TotalCount"));<NEW_LINE>dataItem.setCompletedCount(_ctx.longValue("ListCallTaskResponse.Data[" + i + "].CompletedCount"));<NEW_LINE>dataItem.setCompletedRate(_ctx.integerValue("ListCallTaskResponse.Data[" + i + "].CompletedRate"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listCallTaskResponse.setData(data);<NEW_LINE>return listCallTaskResponse;<NEW_LINE>} | (_ctx.stringValue("ListCallTaskResponse.Code")); |
1,426,677 | public void addCertificates(ActionRequest request, ActionResponse response) throws AxelorException {<NEW_LINE>Context context = request.getContext();<NEW_LINE>EbicsBank ebicsBank = (EbicsBank) context.get("ebicsBank");<NEW_LINE>ebicsBank = Beans.get(EbicsBankRepository.class).find(ebicsBank.getId());<NEW_LINE>try {<NEW_LINE>X509Certificate certificate = Beans.get(EbicsCertificateService.class).convertToCertificate((String) context.get("certificateE002"));<NEW_LINE>Beans.get(EbicsCertificateService.class).createCertificate(certificate, ebicsBank, EbicsCertificateRepository.TYPE_ENCRYPTION);<NEW_LINE>certificate = Beans.get(EbicsCertificateService.class).convertToCertificate((String) context.get("certificateX002"));<NEW_LINE>Beans.get(EbicsCertificateService.class).createCertificate(certificate, ebicsBank, EbicsCertificateRepository.TYPE_AUTHENTICATION);<NEW_LINE>} catch (CertificateException | IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new AxelorException(e, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR<MASK><NEW_LINE>}<NEW_LINE>response.setCanClose(true);<NEW_LINE>} | , I18n.get("Error in adding bank certificate")); |
147,174 | public Set<PotionMixData> load(Object input) {<NEW_LINE>List<ItemMapping> ingredients = new ArrayList<>();<NEW_LINE>ingredients.add(getNonNull("minecraft:nether_wart"));<NEW_LINE>ingredients.add(getNonNull("minecraft:redstone"));<NEW_LINE>ingredients.add(getNonNull("minecraft:glowstone_dust"));<NEW_LINE>ingredients.add(getNonNull("minecraft:fermented_spider_eye"));<NEW_LINE>ingredients.add(getNonNull("minecraft:gunpowder"));<NEW_LINE>ingredients.add(getNonNull("minecraft:dragon_breath"));<NEW_LINE>ingredients.add(getNonNull("minecraft:sugar"));<NEW_LINE>ingredients.add(getNonNull("minecraft:rabbit_foot"));<NEW_LINE>ingredients.add(getNonNull("minecraft:glistering_melon_slice"));<NEW_LINE>ingredients.add(getNonNull("minecraft:spider_eye"));<NEW_LINE>ingredients.add(getNonNull("minecraft:pufferfish"));<NEW_LINE>ingredients.add(getNonNull("minecraft:magma_cream"));<NEW_LINE>ingredients.add(getNonNull("minecraft:golden_carrot"));<NEW_LINE>ingredients.add(getNonNull("minecraft:blaze_powder"));<NEW_LINE>ingredients<MASK><NEW_LINE>ingredients.add(getNonNull("minecraft:turtle_helmet"));<NEW_LINE>ingredients.add(getNonNull("minecraft:phantom_membrane"));<NEW_LINE>List<ItemMapping> inputs = new ArrayList<>();<NEW_LINE>inputs.add(getNonNull("minecraft:potion"));<NEW_LINE>inputs.add(getNonNull("minecraft:splash_potion"));<NEW_LINE>inputs.add(getNonNull("minecraft:lingering_potion"));<NEW_LINE>ItemMapping glassBottle = getNonNull("minecraft:glass_bottle");<NEW_LINE>Set<PotionMixData> potionMixes = new HashSet<>();<NEW_LINE>// Add all types of potions as inputs<NEW_LINE>ItemMapping fillerIngredient = ingredients.get(0);<NEW_LINE>for (ItemMapping entryInput : inputs) {<NEW_LINE>for (Potion potion : Potion.values()) {<NEW_LINE>potionMixes.add(new PotionMixData(entryInput.getBedrockId(), potion.getBedrockId(), fillerIngredient.getBedrockId(), fillerIngredient.getBedrockData(), glassBottle.getBedrockId(), glassBottle.getBedrockData()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add all brewing ingredients<NEW_LINE>// Also adds glass bottle as input<NEW_LINE>for (ItemMapping ingredient : ingredients) {<NEW_LINE>potionMixes.add(new PotionMixData(glassBottle.getBedrockId(), glassBottle.getBedrockData(), ingredient.getBedrockId(), ingredient.getBedrockData(), glassBottle.getBedrockId(), glassBottle.getBedrockData()));<NEW_LINE>}<NEW_LINE>return potionMixes;<NEW_LINE>} | .add(getNonNull("minecraft:ghast_tear")); |
849,570 | private Point[] sortPoints(Point[] src) {<NEW_LINE>ArrayList<Point> srcPoints = new ArrayList<>(Arrays.asList(src));<NEW_LINE>Point[] result = { null, null, null, null };<NEW_LINE>Comparator<Point> sumComparator = (lhs, rhs) -> Double.valueOf(lhs.y + lhs.x).compareTo(rhs.y + rhs.x);<NEW_LINE>Comparator<Point> diffComparator = (lhs, rhs) -> Double.valueOf(lhs.y - lhs.x).compareTo(rhs.y - rhs.x);<NEW_LINE>// top-left corner = minimal sum<NEW_LINE>result[0] = Collections.min(srcPoints, sumComparator);<NEW_LINE>// bottom-right corner = maximal sum<NEW_LINE>result[2] = Collections.max(srcPoints, sumComparator);<NEW_LINE>// top-right corner = minimal diference<NEW_LINE>result[1] = Collections.min(srcPoints, diffComparator);<NEW_LINE>// bottom-left corner = maximal diference<NEW_LINE>result[3] = <MASK><NEW_LINE>return result;<NEW_LINE>} | Collections.max(srcPoints, diffComparator); |
319,430 | private void adjustFrameBufferMatrix(MapPosition mapPositionFrameBuffer, Dimension mapViewDimension, double scaleFactor, LatLong pivot) {<NEW_LINE>MapPosition mapViewPosition = this.model.mapViewPosition.getMapPosition();<NEW_LINE>long mapSize = MercatorProjection.getMapSize(mapPositionFrameBuffer.zoomLevel, model.displayModel.getTileSize());<NEW_LINE>Point pointFrameBuffer = MercatorProjection.getPixel(mapPositionFrameBuffer.latLong, mapSize);<NEW_LINE>Point pointMapPosition = MercatorProjection.getPixel(mapViewPosition.latLong, mapSize);<NEW_LINE>double diffX = pointFrameBuffer.x - pointMapPosition.x;<NEW_LINE>double diffY = pointFrameBuffer.y - pointMapPosition.y;<NEW_LINE>// we need to compute the pivot distance from the map center<NEW_LINE>// as we will need to find the pivot point for the<NEW_LINE>// frame buffer (which generally has not the same size as the<NEW_LINE>// map view).<NEW_LINE>double pivotDistanceX = 0d;<NEW_LINE>double pivotDistanceY = 0d;<NEW_LINE>if (pivot != null) {<NEW_LINE>Point pivotXY = MercatorProjection.getPixel(pivot, mapSize);<NEW_LINE>pivotDistanceX = pivotXY.x - pointFrameBuffer.x;<NEW_LINE>pivotDistanceY = pivotXY.y - pointFrameBuffer.y;<NEW_LINE>}<NEW_LINE>float currentScaleFactor = (float) (scaleFactor / Math.pow<MASK><NEW_LINE>this.frameBuffer.adjustMatrix((float) diffX, (float) diffY, currentScaleFactor, mapViewDimension, (float) pivotDistanceX, (float) pivotDistanceY);<NEW_LINE>} | (2, mapPositionFrameBuffer.zoomLevel)); |
248,786 | public void initGradientsView() {<NEW_LINE>try (MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {<NEW_LINE>if (layers == null)<NEW_LINE>init();<NEW_LINE>int nLayers = layers.length;<NEW_LINE>// First: Work out total length of params<NEW_LINE>long paramLength = 0;<NEW_LINE>val nParamsPerLayer = new long[nLayers];<NEW_LINE>for (int i = 0; i < nLayers; i++) {<NEW_LINE>NeuralNetConfiguration conf = layerWiseConfigurations.getConf(i);<NEW_LINE>nParamsPerLayer[i] = conf.getLayer().initializer().numParams(conf);<NEW_LINE>paramLength += nParamsPerLayer[i];<NEW_LINE>}<NEW_LINE>if (paramLength > 0) {<NEW_LINE>// No need to initialize, as each layer will do it each iteration anyway<NEW_LINE>flattenedGradients = Nd4j.create(flattenedParams.dataType(), new long[] { 1, paramLength }, 'f');<NEW_LINE>}<NEW_LINE>long paramsSoFar = 0;<NEW_LINE>for (int i = 0; i < layers.length; i++) {<NEW_LINE>if (nParamsPerLayer[i] == 0)<NEW_LINE>// This layer doesn't have any parameters...<NEW_LINE>continue;<NEW_LINE>INDArray thisLayerGradView = flattenedGradients.get(NDArrayIndex.interval(0, 0, true), NDArrayIndex.interval(paramsSoFar, paramsSoFar + nParamsPerLayer[i]));<NEW_LINE>layers<MASK><NEW_LINE>paramsSoFar += nParamsPerLayer[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [i].setBackpropGradientsViewArray(thisLayerGradView); |
1,019,033 | public static boolean lz4wpack(String prev, String fin, String fout) {<NEW_LINE>// better to remove output file for lz4w<NEW_LINE>FileUtil.delete(fout, false);<NEW_LINE>// build complete command line<NEW_LINE>final String[] cmd = new String[] { "java", "-jar", FileUtil.adjustPath(sgdk.rescomp.Compiler.currentDir, "lz4w.jar"), "p", (!StringUtil.isEmpty(prev) ? prev + "@" : ""<MASK><NEW_LINE>// final String[] cmd = new String[] {"java", "-jar",<NEW_LINE>// FileUtil.adjustPath(sgdk.rescomp.Compiler.currentDir, "lz4w.jar"), "p", fin, fout, "-s"};<NEW_LINE>String cmdLine = "";<NEW_LINE>for (String s : cmd) cmdLine += s + " ";<NEW_LINE>System.out.println("Executing " + cmdLine);<NEW_LINE>// execute<NEW_LINE>final Process p = SystemUtil.exec(cmd, true);<NEW_LINE>try {<NEW_LINE>// wait for execution<NEW_LINE>p.waitFor();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>// file exist --> ok<NEW_LINE>return FileUtil.exists(fout);<NEW_LINE>} | ) + fin, fout, "-s" }; |
190,434 | public ApplicationFleetAssociation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ApplicationFleetAssociation applicationFleetAssociation = new ApplicationFleetAssociation();<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("FleetName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationFleetAssociation.setFleetName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ApplicationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationFleetAssociation.setApplicationArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return applicationFleetAssociation;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
282,216 | static org.batfish.datamodel.hsrp.HsrpGroup toHsrpGroup(HsrpGroup hsrpGroup, Set<Integer> trackMethodIds, @Nullable ConcreteInterfaceAddress sourceAddress, Configuration c) {<NEW_LINE><MASK><NEW_LINE>// HSRP track uses negated value of referenced TrackMethod<NEW_LINE>SortedMap<String, TrackAction> trackActions = hsrpGroup.getTrackActions().entrySet().stream().filter(actionByTrackMethodId -> trackMethodIds.contains(actionByTrackMethodId.getKey())).collect(ImmutableSortedMap.toImmutableSortedMap(Comparator.naturalOrder(), actionByTrackMethodId -> createNegatedTrackMethodIfNeededAndReturnName(actionByTrackMethodId.getKey(), c), actionByTrackMethodId -> toTrackAction(actionByTrackMethodId.getValue())));<NEW_LINE>return org.batfish.datamodel.hsrp.HsrpGroup.builder().setAuthentication(hsrpGroup.getAuthentication()).setHelloTime(hsrpGroup.getHelloTime()).setHoldTime(hsrpGroup.getHoldTime()).setVirtualAddresses(groupIp == null ? ImmutableSet.of() : ImmutableSet.of(groupIp)).setSourceAddress(sourceAddress).setPreempt(hsrpGroup.getPreempt()).setPriority(hsrpGroup.getPriority()).setTrackActions(trackActions).build();<NEW_LINE>} | Ip groupIp = hsrpGroup.getIp(); |
1,799,106 | public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>// taking input array<NEW_LINE>System.out.println("Enter size of array:");<NEW_LINE>int size = sc.nextInt();<NEW_LINE>float[] arr = new float[size];<NEW_LINE>System.out.println("Enter array elements:");<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>arr[i] = sc.nextFloat();<NEW_LINE>}<NEW_LINE>System.out.println("Enter number of buckets:");<NEW_LINE>int bucketNum = sc.nextInt();<NEW_LINE>// before sorting<NEW_LINE>System.out.println("Array before bucket sort:");<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>System.out.print(arr[i] + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>bucketSort(arr, bucketNum);<NEW_LINE>// after sorting<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>System.out.print(arr[i] + " ");<NEW_LINE>}<NEW_LINE>sc.close();<NEW_LINE>} | System.out.println("Array after Bucket sort:"); |
77,721 | final DescribeGeofenceCollectionResult executeDescribeGeofenceCollection(DescribeGeofenceCollectionRequest describeGeofenceCollectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeGeofenceCollectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeGeofenceCollectionRequest> request = null;<NEW_LINE>Response<DescribeGeofenceCollectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeGeofenceCollectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeGeofenceCollectionRequest));<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, "DescribeGeofenceCollection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "geofencing.";<NEW_LINE>String resolvedHostPrefix = String.format("geofencing.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeGeofenceCollectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeGeofenceCollectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Location"); |
578,233 | public static ImmutableMap<Payment, PointSensitivityBuilder> cashFlowEquivalentAndSensitivityFixedLeg(ResolvedSwapLeg fixedLeg, RatesProvider ratesProvider) {<NEW_LINE>ArgChecker.isTrue(fixedLeg.getType().equals(SwapLegType.FIXED), "Leg type should be FIXED");<NEW_LINE>ArgChecker.isTrue(fixedLeg.getPaymentEvents().isEmpty(), "PaymentEvent should be empty");<NEW_LINE>Map<Payment, PointSensitivityBuilder> res = new HashMap<Payment, PointSensitivityBuilder>();<NEW_LINE>for (SwapPaymentPeriod paymentPeriod : fixedLeg.getPaymentPeriods()) {<NEW_LINE>ArgChecker.isTrue(paymentPeriod instanceof RatePaymentPeriod, "rate payment should be RatePaymentPeriod");<NEW_LINE>RatePaymentPeriod ratePaymentPeriod = (RatePaymentPeriod) paymentPeriod;<NEW_LINE>ArgChecker.isTrue(ratePaymentPeriod.getAccrualPeriods().size() == 1, "rate payment should not be compounding");<NEW_LINE>RateAccrualPeriod rateAccrualPeriod = ratePaymentPeriod.getAccrualPeriods().get(0);<NEW_LINE>double factor = rateAccrualPeriod.getYearFraction() * ((FixedRateComputation) rateAccrualPeriod.<MASK><NEW_LINE>CurrencyAmount notional = ratePaymentPeriod.getNotionalAmount().multipliedBy(factor);<NEW_LINE>LocalDate paymentDate = ratePaymentPeriod.getPaymentDate();<NEW_LINE>Payment pay = Payment.of(notional, paymentDate);<NEW_LINE>res.put(pay, PointSensitivityBuilder.none());<NEW_LINE>}<NEW_LINE>return ImmutableMap.copyOf(res);<NEW_LINE>} | getRateComputation()).getRate(); |
1,468,367 | private static TriangleTreeNode build(List<IndexableField> fields, Extent extent) {<NEW_LINE>final byte[] scratch = new byte[7 * Integer.BYTES];<NEW_LINE>if (fields.size() == 1) {<NEW_LINE>final TriangleTreeNode triangleTreeNode = new TriangleTreeNode(toDecodedTriangle(fields.get(0), scratch));<NEW_LINE>extent.addRectangle(triangleTreeNode.minX, triangleTreeNode.minY, triangleTreeNode.maxX, triangleTreeNode.maxY);<NEW_LINE>return triangleTreeNode;<NEW_LINE>}<NEW_LINE>final TriangleTreeNode[] nodes = new TriangleTreeNode[fields.size()];<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>nodes[i] = new TriangleTreeNode(toDecodedTriangle(fields.get(i), scratch));<NEW_LINE>extent.addRectangle(nodes[i].minX, nodes[i].minY, nodes[i].maxX, nodes[i].maxY);<NEW_LINE>}<NEW_LINE>return createTree(nodes, 0, fields.<MASK><NEW_LINE>} | size() - 1, true); |
1,738,087 | public void run() {<NEW_LINE>List<TransportRouteResult> res = null;<NEW_LINE>String error = null;<NEW_LINE>try {<NEW_LINE>res = calculateRouteImpl(params, lib);<NEW_LINE>if (res != null && !params.calculationProgress.isCancelled) {<NEW_LINE>calculateWalkingRoutes(res);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>error = e.getMessage();<NEW_LINE>log.error(e);<NEW_LINE>}<NEW_LINE>if (params.calculationProgress.isCancelled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (transportRoutingHelper) {<NEW_LINE>transportRoutingHelper.routes = res;<NEW_LINE>transportRoutingHelper.walkingRouteSegments = walkingRouteSegments;<NEW_LINE>if (res != null) {<NEW_LINE>if (params.resultListener != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OsmandApplication app = routingHelper.getApplication();<NEW_LINE>if (res != null) {<NEW_LINE>transportRoutingHelper.setNewRoute(res);<NEW_LINE>} else if (error != null) {<NEW_LINE>routeCalcError = app.getString(R.string.error_calculating_route) + ":\n" + error;<NEW_LINE>routeCalcErrorShort = app.getString(R.string.error_calculating_route);<NEW_LINE>showMessage(routeCalcError);<NEW_LINE>} else {<NEW_LINE>routeCalcError = app.getString(R.string.empty_route_calculated);<NEW_LINE>routeCalcErrorShort = app.getString(R.string.empty_route_calculated);<NEW_LINE>showMessage(routeCalcError);<NEW_LINE>}<NEW_LINE>app.getNotificationHelper().refreshNotification(NAVIGATION);<NEW_LINE>} | params.resultListener.onRouteCalculated(res); |
707,279 | private File downloadFile(String fileToDownload, String urlToDownload) throws IOException {<NEW_LINE>long range = 0;<NEW_LINE>String path = cacheDir + "/" + fileToDownload;<NEW_LINE>File outputFile = new File(path);<NEW_LINE>if (outputFile.isFile()) {<NEW_LINE>range = outputFile.length();<NEW_LINE>} else {<NEW_LINE>removeOldApkFileFromPrevUpdate(cacheDir);<NEW_LINE>// noinspection ResultOfMethodCallIgnored<NEW_LINE>outputFile.createNewFile();<NEW_LINE>}<NEW_LINE>HttpsURLConnection con = httpsConnectionManager.get().getHttpsUrlConnection(urlToDownload);<NEW_LINE>con.setConnectTimeout(1000 * CONNECT_TIMEOUT);<NEW_LINE>con.setReadTimeout(1000 * READ_TIMEOUT);<NEW_LINE>con.setRequestProperty("User-Agent", TOR_BROWSER_USER_AGENT);<NEW_LINE>if (range != 0) {<NEW_LINE>con.setRequestProperty("Range", "bytes=" + range + "-");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try (InputStream input = new BufferedInputStream(con.getInputStream());<NEW_LINE>OutputStream output = new FileOutputStream(path, true)) {<NEW_LINE>byte[] data = new byte[1024];<NEW_LINE>int count;<NEW_LINE>int percent = 0;<NEW_LINE>while ((count = input.read(data)) != -1) {<NEW_LINE>range += count;<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>logw("Download was interrupted by user " + fileToDownload);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int currentPercent = (int) (range * 100 / fileLength);<NEW_LINE>if (currentPercent - percent >= 5) {<NEW_LINE>percent = currentPercent;<NEW_LINE>updateNotification(fileToDownload, percent);<NEW_LINE>}<NEW_LINE>output.write(data, 0, count);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>con.disconnect();<NEW_LINE>}<NEW_LINE>return outputFile;<NEW_LINE>} | long fileLength = con.getContentLength(); |
1,170,707 | public ResponseEntity<CreationResponse> createReservation(@PathVariable("slug") String eventSlug, @RequestBody ReservationCreationRequest reservationCreationRequest, Principal principal) {<NEW_LINE>var bindingResult = new BeanPropertyBindingResult(reservationCreationRequest, "reservation");<NEW_LINE>var optionalEvent = eventManager.getOptionalByName(eventSlug, principal.getName());<NEW_LINE>if (optionalEvent.isEmpty()) {<NEW_LINE>return ResponseEntity.notFound().build();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Optional<String> promoCodeDiscount = ReservationUtil.checkPromoCode(reservationCreationRequest, event, promoCodeRequestManager, bindingResult);<NEW_LINE>var locale = Locale.forLanguageTag(requireNonNullElseGet(reservationCreationRequest.getLanguage(), () -> event.getContentLanguages().get(0).getLanguage()));<NEW_LINE>var selected = ReservationUtil.validateCreateRequest(reservationCreationRequest, bindingResult, ticketReservationManager, eventManager, "", event);<NEW_LINE>if (selected.isPresent() && !bindingResult.hasErrors()) {<NEW_LINE>var pair = selected.get();<NEW_LINE>return ticketReservationManager.createTicketReservation(event, pair.getLeft(), pair.getRight(), promoCodeDiscount, locale, bindingResult, principal).map(id -> {<NEW_LINE>var user = reservationCreationRequest.getUser();<NEW_LINE>if (user != null) {<NEW_LINE>ticketReservationManager.setReservationOwner(id, user.getUsername(), user.getEmail(), user.getFirstName(), user.getLastName(), locale.getLanguage());<NEW_LINE>}<NEW_LINE>return ResponseEntity.ok(CreationResponse.success(id, ticketReservationManager.reservationUrlForExternalClients(id, event, locale.getLanguage(), user != null)));<NEW_LINE>}).orElseGet(() -> ResponseEntity.badRequest().build());<NEW_LINE>} else {<NEW_LINE>return ResponseEntity.badRequest().body(CreationResponse.error(bindingResult.getAllErrors().stream().map(err -> ErrorCode.custom("invalid." + err.getObjectName(), err.getCode())).collect(Collectors.toList())));<NEW_LINE>}<NEW_LINE>} | var event = optionalEvent.get(); |
723,900 | public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);<NEW_LINE>if (permanent != null) {<NEW_LINE>Effect effect = new CreateTokenCopyTargetEffect();<NEW_LINE>effect.setTargetPointer(getTargetPointer());<NEW_LINE>effect.apply(game, source);<NEW_LINE>Set<UUID> <MASK><NEW_LINE>PlayerList playerList = game.getPlayerList().copy();<NEW_LINE>playerList.setCurrent(game.getActivePlayerId());<NEW_LINE>Player player = game.getPlayer(game.getActivePlayerId());<NEW_LINE>do {<NEW_LINE>if (game.getOpponents(source.getControllerId()).contains(player.getId())) {<NEW_LINE>String decision;<NEW_LINE>if (player.chooseUse(outcome, "Create a copy of target creature for you?", source, game)) {<NEW_LINE>playersSaidYes.add(player.getId());<NEW_LINE>decision = " chooses to copy ";<NEW_LINE>} else {<NEW_LINE>decision = " won't copy ";<NEW_LINE>}<NEW_LINE>game.informPlayers((player.getLogName() + decision + permanent.getName()));<NEW_LINE>}<NEW_LINE>player = playerList.getNext(game, false);<NEW_LINE>} while (player != null && !player.getId().equals(game.getActivePlayerId()));<NEW_LINE>for (UUID playerId : playersSaidYes) {<NEW_LINE>effect = new CreateTokenCopyTargetEffect(playerId);<NEW_LINE>effect.setTargetPointer(getTargetPointer());<NEW_LINE>effect.apply(game, source);<NEW_LINE>// create a token for the source controller as well<NEW_LINE>effect = new CreateTokenCopyTargetEffect();<NEW_LINE>effect.setTargetPointer(getTargetPointer());<NEW_LINE>effect.apply(game, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | playersSaidYes = new HashSet<>(); |
696,624 | public Integer save(SinkRequest request, String operator) {<NEW_LINE>LOGGER.info("begin to save sink info: {}", request);<NEW_LINE>this.checkParams(request);<NEW_LINE>// Check if it can be added<NEW_LINE>String groupId = request.getInlongGroupId();<NEW_LINE>groupCheckService.checkGroupStatus(groupId, operator);<NEW_LINE>// Make sure that there is no sink info with the current groupId and streamId<NEW_LINE>String streamId = request.getInlongStreamId();<NEW_LINE>String sinkName = request.getSinkName();<NEW_LINE>List<StreamSinkEntity> sinkList = sinkMapper.selectByRelatedId(groupId, streamId, sinkName);<NEW_LINE>for (StreamSinkEntity sinkEntity : sinkList) {<NEW_LINE>if (sinkEntity != null && Objects.equals(sinkEntity.getSinkName(), sinkName)) {<NEW_LINE>String err = "sink name=%s already exists with the groupId=%s streamId=%s";<NEW_LINE>throw new BusinessException(String.format(err<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// According to the sink type, save sink information<NEW_LINE>StreamSinkOperator operation = operatorFactory.getInstance(request.getSinkType());<NEW_LINE>List<SinkField> fields = request.getSinkFieldList();<NEW_LINE>// Remove id in sinkField when save<NEW_LINE>if (CollectionUtils.isNotEmpty(fields)) {<NEW_LINE>fields.forEach(sinkField -> sinkField.setId(null));<NEW_LINE>}<NEW_LINE>int id = operation.saveOpt(request, operator);<NEW_LINE>LOGGER.info("success to save sink info: {}", request);<NEW_LINE>return id;<NEW_LINE>} | , sinkName, groupId, streamId)); |
859,146 | private static Throwable appendSteps(List<StepResult> steps, StringBuilder sb) {<NEW_LINE>Throwable error = null;<NEW_LINE>for (StepResult sr : steps) {<NEW_LINE>int length = sb.length();<NEW_LINE>sb.append(sr.getStep().getPrefix());<NEW_LINE>sb.append(' ');<NEW_LINE>sb.append(sr.<MASK><NEW_LINE>sb.append(' ');<NEW_LINE>do {<NEW_LINE>sb.append('.');<NEW_LINE>} while (sb.length() - length < 75);<NEW_LINE>sb.append(' ');<NEW_LINE>sb.append(sr.getResult().getStatus());<NEW_LINE>sb.append('\n');<NEW_LINE>if (sr.getResult().isFailed()) {<NEW_LINE>sb.append("\nStack Trace:\n");<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>error = sr.getResult().getError();<NEW_LINE>error.printStackTrace(new PrintWriter(sw));<NEW_LINE>sb.append(sw.toString());<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return error;<NEW_LINE>} | getStep().getText()); |
596,693 | Hash hashHeader(final BlockHeader header) {<NEW_LINE>final BytesValueRLPOutput out = new BytesValueRLPOutput();<NEW_LINE>// Encode header without nonce and mixhash<NEW_LINE>out.startList();<NEW_LINE>out.writeBytes(header.getParentHash());<NEW_LINE>out.writeBytes(header.getOmmersHash());<NEW_LINE>out.writeBytes(header.getCoinbase());<NEW_LINE>out.writeBytes(header.getStateRoot());<NEW_LINE>out.writeBytes(header.getTransactionsRoot());<NEW_LINE>out.<MASK><NEW_LINE>out.writeBytes(header.getLogsBloom());<NEW_LINE>out.writeUInt256Scalar(header.getDifficulty());<NEW_LINE>out.writeLongScalar(header.getNumber());<NEW_LINE>out.writeLongScalar(header.getGasLimit());<NEW_LINE>out.writeLongScalar(header.getGasUsed());<NEW_LINE>out.writeLongScalar(header.getTimestamp());<NEW_LINE>out.writeBytes(header.getExtraData());<NEW_LINE>if (imlementsBaseFeeMarket() && header.getBaseFee().isPresent()) {<NEW_LINE>out.writeUInt256Scalar(header.getBaseFee().get());<NEW_LINE>}<NEW_LINE>out.endList();<NEW_LINE>return Hash.hash(out.encoded());<NEW_LINE>} | writeBytes(header.getReceiptsRoot()); |
639,922 | public void actionPerformed(ActionEvent e) {<NEW_LINE>// Preference<NEW_LINE>if (e.getActionCommand().equals(ValuePreference.NAME)) {<NEW_LINE>if (MRole.getDefault().isShowPreference())<NEW_LINE>ValuePreference.start(m_mField, <MASK><NEW_LINE>return;<NEW_LINE>} else if (e.getActionCommand().equals(RecordInfo.CHANGE_LOG_COMMAND)) {<NEW_LINE>RecordInfo.start(m_mField);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (e.getSource() == m_button) {<NEW_LINE>m_button.setEnabled(false);<NEW_LINE>setValue(startCalendar(this, getTimestamp(), m_format, m_displayType, m_title));<NEW_LINE>try {<NEW_LINE>fireVetoableChange(m_columnName, m_oldText, getValue());<NEW_LINE>} catch (PropertyVetoException pve) {<NEW_LINE>}<NEW_LINE>m_button.setEnabled(true);<NEW_LINE>m_text.requestFocus();<NEW_LINE>}<NEW_LINE>} | getValue(), getDisplay()); |
169,298 | public static ZSuperInstr decode(IRReaderDecoder d) {<NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("decoding call");<NEW_LINE>int callTypeOrdinal = d.decodeInt();<NEW_LINE>CallType callType = CallType.fromOrdinal(callTypeOrdinal);<NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("decoding call, calltype(ord): " + callType);<NEW_LINE>RubySymbol methAddr = d.decodeSymbol();<NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("decoding call, methaddr: " + methAddr);<NEW_LINE>Operand receiver = d.decodeOperand();<NEW_LINE>int argsCount = d.decodeInt();<NEW_LINE>boolean hasClosureArg = argsCount < 0;<NEW_LINE>int argsLength = hasClosureArg ? (-1 * <MASK><NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg);<NEW_LINE>Operand[] args = new Operand[argsLength];<NEW_LINE>for (int i = 0; i < argsLength; i++) {<NEW_LINE>args[i] = d.decodeOperand();<NEW_LINE>}<NEW_LINE>Operand closure = hasClosureArg ? d.decodeOperand() : null;<NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("before result");<NEW_LINE>Variable result = d.decodeVariable();<NEW_LINE>if (RubyInstanceConfig.IR_READING_DEBUG)<NEW_LINE>System.out.println("decoding call, result: " + result);<NEW_LINE>return new ZSuperInstr(d.getCurrentScope(), result, receiver, args, closure, d.getCurrentScope().maybeUsingRefinements());<NEW_LINE>} | (argsCount + 1)) : argsCount; |
1,291,161 | final MergePullRequestByFastForwardResult executeMergePullRequestByFastForward(MergePullRequestByFastForwardRequest mergePullRequestByFastForwardRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(mergePullRequestByFastForwardRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<MergePullRequestByFastForwardRequest> request = null;<NEW_LINE>Response<MergePullRequestByFastForwardResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new MergePullRequestByFastForwardRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(mergePullRequestByFastForwardRequest));<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, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "MergePullRequestByFastForward");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<MergePullRequestByFastForwardResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new MergePullRequestByFastForwardResultJsonUnmarshaller());<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,713,395 | public Object fromMessage(Message message) throws MessageConversionException {<NEW_LINE>Object content = null;<NEW_LINE>MessageProperties properties = message.getMessageProperties();<NEW_LINE>if (properties != null) {<NEW_LINE>String contentType = properties.getContentType();<NEW_LINE>if (contentType != null && contentType.startsWith("text")) {<NEW_LINE>String encoding = properties.getContentEncoding();<NEW_LINE>if (encoding == null) {<NEW_LINE>encoding = this.defaultCharset;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>content = new String(<MASK><NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new MessageConversionException("failed to convert text-based Message content", e);<NEW_LINE>}<NEW_LINE>} else if (contentType != null && contentType.equals(MessageProperties.CONTENT_TYPE_SERIALIZED_OBJECT)) {<NEW_LINE>try {<NEW_LINE>content = SerializationUtils.deserialize(createObjectInputStream(new ByteArrayInputStream(message.getBody())));<NEW_LINE>} catch (IOException | IllegalArgumentException | IllegalStateException e) {<NEW_LINE>throw new MessageConversionException("failed to convert serialized Message content", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (content == null) {<NEW_LINE>content = message.getBody();<NEW_LINE>}<NEW_LINE>return content;<NEW_LINE>} | message.getBody(), encoding); |
43,814 | private void initLocalizedMapping() {<NEW_LINE>mSegmentLocalizedMapping = new HashMap<>();<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_SPONSOR, R.string.content_block_sponsor);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_INTRO, R.string.content_block_intro);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_OUTRO, R.string.content_block_outro);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_SELF_PROMO, R.string.content_block_self_promo);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_INTERACTION, R.string.content_block_interaction);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_MUSIC_OFF_TOPIC, R.string.content_block_music_off_topic);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.<MASK><NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_HIGHLIGHT, R.string.content_block_highlight);<NEW_LINE>mSegmentLocalizedMapping.put(SponsorSegment.CATEGORY_FILLER, R.string.content_block_filler);<NEW_LINE>} | CATEGORY_PREVIEW_RECAP, R.string.content_block_preview_recap); |
889,936 | private void verifyParameterDescriptors(Operation operation) {<NEW_LINE>Set<<MASK><NEW_LINE>Set<String> expectedParameters = new HashSet<>();<NEW_LINE>for (Entry<String, ParameterDescriptor> entry : this.descriptorsByName.entrySet()) {<NEW_LINE>if (!entry.getValue().isOptional()) {<NEW_LINE>expectedParameters.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> undocumentedParameters;<NEW_LINE>if (this.ignoreUndocumentedParameters) {<NEW_LINE>undocumentedParameters = Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>undocumentedParameters = new HashSet<>(actualParameters);<NEW_LINE>undocumentedParameters.removeAll(this.descriptorsByName.keySet());<NEW_LINE>}<NEW_LINE>Set<String> missingParameters = new HashSet<>(expectedParameters);<NEW_LINE>missingParameters.removeAll(actualParameters);<NEW_LINE>if (!undocumentedParameters.isEmpty() || !missingParameters.isEmpty()) {<NEW_LINE>verificationFailed(undocumentedParameters, missingParameters);<NEW_LINE>}<NEW_LINE>} | String> actualParameters = extractActualParameters(operation); |
1,706,097 | public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer object = context.getPointerArg(1);<NEW_LINE>UnidbgPointer jfieldID = context.getPointerArg(2);<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(16);<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.put(emulator.getBackend().reg_read_vector(Arm64Const.UC_ARM64_REG_Q0));<NEW_LINE>buffer.flip();<NEW_LINE>double value = buffer.getDouble();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("SetDoubleField object=" + object + ", jfieldID=" + jfieldID + ", value=" + value);<NEW_LINE>}<NEW_LINE>DvmObject<?> dvmObject = getObject(object.toIntPeer());<NEW_LINE>DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType();<NEW_LINE>DvmField dvmField = dvmClass == null ? null : dvmClass.<MASK><NEW_LINE>if (dvmField == null) {<NEW_LINE>throw new BackendException();<NEW_LINE>} else {<NEW_LINE>dvmField.setDoubleField(dvmObject, value);<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->SetDoubleField(%s, %s => %s) was called from %s%n", dvmObject, dvmField.fieldName, value, context.getLRPointer());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | getField(jfieldID.toIntPeer()); |
993,298 | protected void onCreate(Bundle bundle) {<NEW_LINE>super.onCreate(bundle);<NEW_LINE>mServiceBridge = new ServiceBridge();<NEW_LINE>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);<NEW_LINE>intent.putExtra("calling_package", /*RecognizerIntent.EXTRA_CALLING_PACKAGE*/<NEW_LINE>getApplicationContext().getPackageName());<NEW_LINE>intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);<NEW_LINE>intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);<NEW_LINE>// Specify the recognition language if provided.<NEW_LINE>if (bundle != null) {<NEW_LINE>String languageLocale = <MASK><NEW_LINE>if (languageLocale != null) {<NEW_LINE>intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, languageLocale);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>startActivityForResult(intent, RECOGNITION_REQUEST);<NEW_LINE>} | bundle.getString(RecognizerIntent.EXTRA_LANGUAGE); |
468,684 | public void testAuthenticateMethodFL_ProtectedServlet2() throws Exception {<NEW_LINE>METHODS = "testMethod=login,logout_once,authenticate";<NEW_LINE>String url = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/formlogin/ProgrammaticAPIServlet?" + METHODS + "&user=" + managerUser + "&password=" + managerPassword;<NEW_LINE>HttpClient client = new DefaultHttpClient();<NEW_LINE>String response = authenticateWithValidAuthDataFLTwice(client, validUser, validPassword, url);<NEW_LINE>// Get servlet output to verify each test<NEW_LINE>String test1 = response.substring(response.indexOf("STARTTEST1")<MASK><NEW_LINE>// Skip test 2 because logout_once will not run logout on the 2nd pass<NEW_LINE>String test3 = response.substring(response.indexOf("STARTTEST3"), response.indexOf("ENDTEST3"));<NEW_LINE>// TEST1 - check values after login<NEW_LINE>assertTrue("Failed to find after login: ServletException", test1.contains("ServletException"));<NEW_LINE>// Skip test 2 because logout_once will not run logout on the 2nd pass<NEW_LINE>// TEST3 - check values after authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, validUser, test3, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>} | , response.indexOf("ENDTEST1")); |
288,519 | private static void doJavaCompletion(CompilationContext ccontext, PrefixMatcher pm, final int offset, final List<CompletionProposal> proposals) throws IOException {<NEW_LINE>CompilationController cc = (CompilationController) ccontext.info();<NEW_LINE>String packName = pm.getPrefix();<NEW_LINE>// NOI18N<NEW_LINE>int dotIndex = pm.getPrefix().lastIndexOf('.');<NEW_LINE>if (dotIndex != -1) {<NEW_LINE>packName = pm.getPrefix().substring(0, dotIndex);<NEW_LINE>}<NEW_LINE>// adds packages to the CC<NEW_LINE>addPackages(cc, pm.getPrefix(), offset, proposals);<NEW_LINE>Set<PackageEntry> packages = new HashSet<>();<NEW_LINE>if (dotIndex == -1) {<NEW_LINE>// java.lang package is imported by default<NEW_LINE>packages.add(DEFAULT_PACKAGE);<NEW_LINE>}<NEW_LINE>if (!packName.isEmpty()) {<NEW_LINE>packages.add(new PackageEntry(packName, false));<NEW_LINE>}<NEW_LINE>// adds types to the CC<NEW_LINE>addTypesFromPackages(cc, pm, packages, offset + dotIndex + 1, proposals);<NEW_LINE>// adds element type fields and methods<NEW_LINE>TypeElement typeElement = cc.getElements().getTypeElement(packName);<NEW_LINE>if (typeElement == null && dotIndex != -1) {<NEW_LINE>typeElement = cc.getElements().getTypeElement(JAVA_LANG_PREFIX + pm.getPrefix()<MASK><NEW_LINE>}<NEW_LINE>if (typeElement != null) {<NEW_LINE>proposals.addAll(getFieldsAndMethods(typeElement, offset + dotIndex + 1));<NEW_LINE>}<NEW_LINE>} | .substring(0, dotIndex)); |
261,248 | private static void addColors(Map<String, AttributeSet> colorsMap, Language l, ResourceBundle bundle) {<NEW_LINE>if (l.getParser() == null)<NEW_LINE>return;<NEW_LINE>Map<String, AttributeSet> defaultsMap = getDefaultColors();<NEW_LINE>List<Feature> list = l.getFeatureList().getFeatures(COLOR);<NEW_LINE>Iterator<Feature> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Feature f = it.next();<NEW_LINE>AttributeSet as = createColoring(f, bundle);<NEW_LINE>colorsMap.put((String) as.getAttribute(StyleConstants.NameAttribute), as);<NEW_LINE>}<NEW_LINE>Iterator<TokenType> it2 = l.getParser().getTokenTypes().iterator();<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>TokenType token = it2.next();<NEW_LINE>String type = token.getType();<NEW_LINE>if (colorsMap.containsKey(type))<NEW_LINE>continue;<NEW_LINE>SimpleAttributeSet sas = new SimpleAttributeSet();<NEW_LINE>sas.addAttribute(StyleConstants.NameAttribute, type);<NEW_LINE>String displayName = type;<NEW_LINE>if (bundle != null) {<NEW_LINE>try {<NEW_LINE>displayName = bundle.getString(type);<NEW_LINE>} catch (MissingResourceException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sas.addAttribute(EditorStyleConstants.DisplayName, displayName);<NEW_LINE>String def = type;<NEW_LINE>int i = def.lastIndexOf('_');<NEW_LINE>if (i > 0)<NEW_LINE>def = <MASK><NEW_LINE>if (defaultsMap.containsKey(def))<NEW_LINE>sas.addAttribute(EditorStyleConstants.Default, def);<NEW_LINE>colorsMap.put(type, sas);<NEW_LINE>}<NEW_LINE>} | def.substring(i + 1); |
77,491 | private // ============================================================<NEW_LINE>void addToChart(Derivation deriv, Ingredient ingredient, BackPointer bp1, BackPointer bp2) {<NEW_LINE>if (Parser.opts.verbose >= 3)<NEW_LINE>LogInfo.logs("addToChart %s %s: %s", ingredient.parentCell, deriv.value, deriv);<NEW_LINE>ensureExecuted(deriv);<NEW_LINE>Map<String, Map<Value, Metadata>> cells = getCellsForCurrentPass();<NEW_LINE>Map<Value, Metadata> denotationToData = cells.get(ingredient.parentCell);<NEW_LINE>if (denotationToData == null)<NEW_LINE>cells.put(ingredient.parentCell, denotationToData = new HashMap<>());<NEW_LINE>Metadata metadata = <MASK><NEW_LINE>if (metadata == null)<NEW_LINE>denotationToData.put(deriv.value, metadata = new Metadata(deriv.value));<NEW_LINE>metadata.add(deriv, ingredient, bp1, bp2);<NEW_LINE>} | denotationToData.get(deriv.value); |
61,152 | static Object executeVariableExpression(final IExpressionContext context, final VariableExpression expression, final IStandardVariableExpressionEvaluator expressionEvaluator, final StandardExpressionExecutionContext expContext) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("[THYMELEAF][{}] Evaluating variable expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());<NEW_LINE>}<NEW_LINE>final StandardExpressionExecutionContext evalExpContext = (expression.getConvertToString() ? expContext.withTypeConversion() : expContext.withoutTypeConversion());<NEW_LINE>final Object result = expressionEvaluator.evaluate(context, expression, evalExpContext);<NEW_LINE>if (!expContext.getForbidUnsafeExpressionResults()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// We are only allowing results of type Number and Boolean, and cosidering the rest of data types "unsafe",<NEW_LINE>// as they could be rendered into a non-trustable String. This is mainly useful for helping prevent code<NEW_LINE>// injection in th:on* event handlers.<NEW_LINE>if (result == null || result instanceof Number || result instanceof Boolean) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>throw new TemplateProcessingException("Only variable expressions returning numbers or booleans are allowed in this context, any other data" + <MASK><NEW_LINE>} | "types are not trusted in the context of this expression, including Strings or any other " + "object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. " + "\"onload\"), in which textual data from variables should better be output to \"data-*\" attributes and then " + "read from the event handler."); |
1,753,781 | Object doCached(PolyglotLanguageContext languageContext, Object receiver, Object[] args, @CachedLibrary("receiver") InteropLibrary iterators, @Cached PolyglotToHostNode toHost, @Cached BranchProfile error, @Cached BranchProfile stop) {<NEW_LINE>TriState lastHasNext = (TriState) args[ARGUMENT_OFFSET];<NEW_LINE>try {<NEW_LINE>Object next = iterators.getIteratorNextElement(receiver);<NEW_LINE>if (lastHasNext == TriState.FALSE) {<NEW_LINE>error.enter();<NEW_LINE>throw PolyglotInteropErrors.iteratorConcurrentlyModified(languageContext, receiver, cache.valueType);<NEW_LINE>}<NEW_LINE>return toHost.execute(languageContext, next, cache.valueClass, cache.valueType);<NEW_LINE>} catch (StopIterationException e) {<NEW_LINE>stop.enter();<NEW_LINE>if (lastHasNext == TriState.TRUE) {<NEW_LINE>throw PolyglotInteropErrors.iteratorConcurrentlyModified(languageContext, receiver, cache.valueType);<NEW_LINE>} else {<NEW_LINE>throw PolyglotInteropErrors.stopIteration(languageContext, receiver, cache.valueType);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>error.enter();<NEW_LINE>throw PolyglotInteropErrors.iteratorElementUnreadable(<MASK><NEW_LINE>}<NEW_LINE>} | languageContext, receiver, cache.valueType); |
619,348 | // </editor-fold>//GEN-END:initComponents<NEW_LINE>@Messages({ "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title=Path cannot be used", "# {0} - path", "AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description=Unable to create temporary directory within specified path: {0}" })<NEW_LINE>private void tempDirectoryBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_tempDirectoryBrowseButtonActionPerformed<NEW_LINE>if (tempDirChooser == null) {<NEW_LINE>tempDirChooser = tempChooserHelper.getChooser();<NEW_LINE>tempDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>tempDirChooser.setMultiSelectionEnabled(false);<NEW_LINE>}<NEW_LINE>int returnState = tempDirChooser.showOpenDialog(this);<NEW_LINE>if (returnState == JFileChooser.APPROVE_OPTION) {<NEW_LINE>String specifiedPath = tempDirChooser.getSelectedFile().getPath();<NEW_LINE>try {<NEW_LINE>File f = new File(specifiedPath);<NEW_LINE>if (!f.exists() && !f.mkdirs()) {<NEW_LINE>throw new InvalidPathException(specifiedPath, "Unable to create parent directories leading to " + specifiedPath);<NEW_LINE>}<NEW_LINE>tempCustomField.setText(specifiedPath);<NEW_LINE>firePropertyChange(<MASK><NEW_LINE>} catch (InvalidPathException ex) {<NEW_LINE>logger.log(Level.WARNING, "Unable to create temporary directory in " + specifiedPath, ex);<NEW_LINE>JOptionPane.showMessageDialog(this, Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_description(specifiedPath), Bundle.AutopsyOptionsPanel_tempDirectoryBrowseButtonActionPerformed_onInvalidPath_title(), JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OptionsPanelController.PROP_CHANGED, null, null); |
598,391 | public void testCriteriaQuery_Float(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>final String testName = getTestName();<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail(testName + ": Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process Test Properties<NEW_LINE>final Map<String, Serializable> testProps = testExecCtx.getProperties();<NEW_LINE>if (testProps != null) {<NEW_LINE>for (String key : testProps.keySet()) {<NEW_LINE>System.out.println("Test Property: " + key + " = " + testProps.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EntityManager em = jpaResource.getEm();<NEW_LINE>TransactionJacket tx = jpaResource.getTj();<NEW_LINE>// Execute Test Case<NEW_LINE>try {<NEW_LINE>tx.beginTransaction();<NEW_LINE>if (jpaResource.getPcCtxInfo().getPcType() == PersistenceContextType.APPLICATION_MANAGED_JTA)<NEW_LINE>em.joinTransaction();<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Entity0009> cq = cb.createQuery(Entity0009.class);<NEW_LINE>Root<Entity0009> root = <MASK><NEW_LINE>cq.select(root);<NEW_LINE>TypedQuery<Entity0009> tq = em.createQuery(cq);<NEW_LINE>Entity0009 findEntity = tq.getSingleResult();<NEW_LINE>System.out.println("Object returned by query: " + findEntity);<NEW_LINE>assertNotNull("Did not find entity in criteria query", findEntity);<NEW_LINE>assertTrue("Entity returned by find was not contained in the persistence context.", em.contains(findEntity));<NEW_LINE>assertEquals(new Float(09.09f), findEntity.getEntity0009_id());<NEW_LINE>assertEquals("Entity0009_STRING01", findEntity.getEntity0009_string01());<NEW_LINE>assertEquals("Entity0009_STRING02", findEntity.getEntity0009_string02());<NEW_LINE>assertEquals("Entity0009_STRING03", findEntity.getEntity0009_string03());<NEW_LINE>tx.commitTransaction();<NEW_LINE>} finally {<NEW_LINE>System.out.println(testName + ": End");<NEW_LINE>}<NEW_LINE>} | cq.from(Entity0009.class); |
820,013 | public SnapshotVisitResult visitEntry(FileSystemLocationSnapshot snapshot, RelativePathSupplier relativePath) {<NEW_LINE>snapshot.accept(new FileSystemLocationSnapshotVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitRegularFile(RegularFileSnapshot fileSnapshot) {<NEW_LINE>HashCode normalizedContentHash = hashContent(fileSnapshot, relativePath);<NEW_LINE>if (normalizedContentHash == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String absolutePath = snapshot.getAbsolutePath();<NEW_LINE>if (!processedEntries.add(absolutePath)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileSystemLocationFingerprint fingerprint;<NEW_LINE>if (relativePath.isRoot()) {<NEW_LINE>fingerprint = IgnoredPathFileSystemLocationFingerprint.create(snapshot.getType(), normalizedContentHash);<NEW_LINE>} else {<NEW_LINE>String internedRelativePath = stringInterner.intern(relativePath.toRelativePath());<NEW_LINE>fingerprint = new DefaultFileSystemLocationFingerprint(internedRelativePath, FileType.RegularFile, normalizedContentHash);<NEW_LINE>}<NEW_LINE>builder.put(absolutePath, fingerprint);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitMissing(MissingFileSnapshot missingSnapshot) {<NEW_LINE>if (!relativePath.isRoot()) {<NEW_LINE>throw new RuntimeException(String.format("Couldn't read file content: '%s'."<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return SnapshotVisitResult.CONTINUE;<NEW_LINE>} | , missingSnapshot.getAbsolutePath())); |
348,987 | ExecuteResult execute(final KsqlPlan plan, final boolean restoreInProgress) {<NEW_LINE>if (!plan.getQueryPlan().isPresent()) {<NEW_LINE>final String ddlResult = plan.getDdlCommand().map(ddl -> executeDdl(ddl, plan.getStatementText(), false, Collections.emptySet(), restoreInProgress)).orElseThrow(() -> new IllegalStateException("DdlResult should be present if there is no physical plan."));<NEW_LINE>return ExecuteResult.of(ddlResult);<NEW_LINE>}<NEW_LINE>final QueryPlan queryPlan = plan.getQueryPlan().get();<NEW_LINE>final KsqlConstants.PersistentQueryType persistentQueryType = plan.getPersistentQueryType().get();<NEW_LINE>// CREATE_SOURCE do not write to any topic. We check for read-only topics only for queries<NEW_LINE>// that attempt to write to a sink (i.e. INSERT or CREATE_AS).<NEW_LINE>if (persistentQueryType != KsqlConstants.PersistentQueryType.CREATE_SOURCE) {<NEW_LINE>final DataSource sinkSource = engineContext.getMetaStore().getSource(queryPlan.getSink().get());<NEW_LINE>if (sinkSource != null && sinkSource.isSource()) {<NEW_LINE>throw new KsqlException(String.format("Cannot insert into read-only %s: %s", sinkSource.getDataSourceType().getKsqlType().toLowerCase(), sinkSource.getName().text()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Optional<String> ddlResult = plan.getDdlCommand().map(ddl -> executeDdl(ddl, plan.getStatementText(), true, queryPlan.getSources(), restoreInProgress));<NEW_LINE>// Return if the source to create already exists.<NEW_LINE>if (ddlResult.isPresent() && ddlResult.get().contains("already exists")) {<NEW_LINE>return ExecuteResult.<MASK><NEW_LINE>}<NEW_LINE>// Do not execute the plan (found on new CST commands or commands read from the command topic)<NEW_LINE>// for source tables if the feature is disabled. CST will still be read-only, but no query<NEW_LINE>// must be executed.<NEW_LINE>if (persistentQueryType == KsqlConstants.PersistentQueryType.CREATE_SOURCE && !isSourceTableMaterializationEnabled()) {<NEW_LINE>LOG.info(String.format("Source table query '%s' won't be materialized because '%s' is disabled.", plan.getStatementText(), KsqlConfig.KSQL_SOURCE_TABLE_MATERIALIZATION_ENABLED));<NEW_LINE>return ExecuteResult.of(ddlResult.get());<NEW_LINE>}<NEW_LINE>return ExecuteResult.of(executePersistentQuery(queryPlan, plan.getStatementText(), persistentQueryType));<NEW_LINE>} | of(ddlResult.get()); |
262,792 | public okhttp3.Call readNamespacedResourceQuotaCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/resourcequotas/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<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", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | final String[] localVarContentTypes = {}; |
1,041,046 | protected void configure() {<NEW_LINE>bind(ChartBuilderRepository.class).to(ChartBuilderRepo.class);<NEW_LINE>bind(ActionBuilderRepository.class).to(ActionBuilderRepo.class);<NEW_LINE>bind(MenuBuilderRepository.class).to(MenuBuilderRepo.class);<NEW_LINE>bind(DashboardBuilderRepository.class).to(DashboardBuilderRepo.class);<NEW_LINE>bind(AppBuilderRepository.class<MASK><NEW_LINE>bind(MetaJsonFieldRepository.class).to(MetaJsonFieldRepo.class);<NEW_LINE>bind(MetaJsonModelRepository.class).to(MetaJsonModelRepo.class);<NEW_LINE>bind(SelectionBuilderRepository.class).to(SelectionBuilderRepo.class);<NEW_LINE>bind(MapperScriptGeneratorService.class).to(MapperScriptGeneratorServiceImpl.class);<NEW_LINE>bind(AppLoaderImportService.class).to(AppLoaderImportServiceImpl.class);<NEW_LINE>bind(AppLoaderExportService.class).to(AppLoaderExportServiceImpl.class);<NEW_LINE>bind(ChartRecordViewService.class).to(ChartRecordViewServiceImpl.class);<NEW_LINE>} | ).to(AppBuilderRepo.class); |
794,012 | // @AroundInvoke, defined in xml<NEW_LINE>Object aroundInvoke(InvocationContext invCtx) throws Exception {<NEW_LINE>CheckInvocation.getInstance().recordCallInfo("AroundInvoke", "Interceptor03.aroundInvoke", this);<NEW_LINE>svLogger.info("Interceptor03.aroundInvoke: this=" + this);<NEW_LINE>for (Iterator<Entry<String, Object>> it = invCtx.getContextData().entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Entry<String, Object> entry = it.next();<NEW_LINE>svLogger.info("Interceptor03.aroundInvoke: ctxData.key=" + entry.getKey() + "; ctxData.value=" + (String) entry.getValue());<NEW_LINE>CheckInvocation.getInstance().recordCallInfo(entry.getKey(), (String) entry.getValue(), this);<NEW_LINE>}<NEW_LINE>String targetStr = invCtx.getTarget().toString();<NEW_LINE>String methodStr = invCtx.getMethod().toString();<NEW_LINE>String parameterStr = Arrays.toString(invCtx.getParameters());<NEW_LINE>svLogger.info("Interceptor03.aroundInvoke: getTarget=" + targetStr);<NEW_LINE>svLogger.info("Interceptor03.aroundInvoke: getMethod=" + methodStr);<NEW_LINE><MASK><NEW_LINE>CheckInvocation.getInstance().recordCallInfo("Target", invCtx.getTarget().toString(), this);<NEW_LINE>CheckInvocation.getInstance().recordCallInfo("Method", invCtx.getMethod().toString(), this);<NEW_LINE>CheckInvocation.getInstance().recordCallInfo("Parameters", Arrays.toString(invCtx.getParameters()), this);<NEW_LINE>return invCtx.proceed();<NEW_LINE>} | svLogger.info("Interceptor03.aroundInvoke: getParameters=" + parameterStr); |
610,792 | final TransactGetItemsResult executeTransactGetItems(TransactGetItemsRequest transactGetItemsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(transactGetItemsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TransactGetItemsRequest> request = null;<NEW_LINE>Response<TransactGetItemsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TransactGetItemsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(transactGetItemsRequest));<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, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TransactGetItems");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), false, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TransactGetItemsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TransactGetItemsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | responseHandler, executionContext, cachedEndpoint, null); |
723,174 | public AnnotatedTextFieldMapper build(BuilderContext context) {<NEW_LINE>if (fieldType().indexOptions() == IndexOptions.NONE) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (positionIncrementGap != POSITION_INCREMENT_GAP_USE_ANALYZER) {<NEW_LINE>if (fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) {<NEW_LINE>throw new IllegalArgumentException("Cannot set position_increment_gap on field [" + name + "] without positions enabled");<NEW_LINE>}<NEW_LINE>fieldType.setIndexAnalyzer(new NamedAnalyzer(fieldType.indexAnalyzer(), positionIncrementGap));<NEW_LINE>fieldType.setSearchAnalyzer(new NamedAnalyzer(fieldType.searchAnalyzer(), positionIncrementGap));<NEW_LINE>fieldType.setSearchQuoteAnalyzer(new NamedAnalyzer(fieldType.searchQuoteAnalyzer(), positionIncrementGap));<NEW_LINE>} else {<NEW_LINE>// Using the analyzer's default BUT need to do the same thing AnalysisRegistry.processAnalyzerFactory<NEW_LINE>// does to splice in new default of posIncGap=100 by wrapping the analyzer<NEW_LINE>if (fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0) {<NEW_LINE>int overrideInc = TextFieldMapper.Defaults.POSITION_INCREMENT_GAP;<NEW_LINE>fieldType.setIndexAnalyzer(new NamedAnalyzer(fieldType.indexAnalyzer(), overrideInc));<NEW_LINE>fieldType.setSearchAnalyzer(new NamedAnalyzer(fieldType.searchAnalyzer(), overrideInc));<NEW_LINE>fieldType.setSearchQuoteAnalyzer(new NamedAnalyzer(fieldType.searchQuoteAnalyzer(), overrideInc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setupFieldType(context);<NEW_LINE>return new AnnotatedTextFieldMapper(name, fieldType(), defaultFieldType, positionIncrementGap, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);<NEW_LINE>} | IllegalArgumentException("[" + CONTENT_TYPE + "] fields must be indexed"); |
919,040 | protected void saveSelectionDetail() {<NEW_LINE>// publish for Callout to read<NEW_LINE>Integer ID = getSelectedRowKey();<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Product_ID", ID == null ? "0" : ID.toString());<NEW_LINE>if (fPriceList_ID.getValue() != null) {<NEW_LINE>String pickPL = ((Integer) fPriceList_ID.getValue()).toString();<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_PriceList_Version_ID", pickPL);<NEW_LINE>}<NEW_LINE>if (fWarehouse_ID.getValue() != null) {<NEW_LINE>String pickWH = ((Integer) fWarehouse_ID.<MASK><NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Warehouse_ID", pickWH);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (// not selected<NEW_LINE>m_M_AttributeSetInstance_ID == -1) {<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", "0");<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", "0");<NEW_LINE>} else {<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID", String.valueOf(m_M_AttributeSetInstance_ID));<NEW_LINE>Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "M_Locator_ID", String.valueOf(m_M_Locator_ID));<NEW_LINE>}<NEW_LINE>} | getValue()).toString(); |
668,199 | private void createUi() {<NEW_LINE>contentPanel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }));<NEW_LINE>lblNewLabel = new JLabel("Actuator");<NEW_LINE>contentPanel.add(lblNewLabel, "2, 2, right, default");<NEW_LINE>actuator = new JComboBox();<NEW_LINE>contentPanel.add(actuator, "4, 2, fill, default");<NEW_LINE>lblNewLabel_1 = new JLabel("Job State");<NEW_LINE><MASK><NEW_LINE>jobState = new JComboBox();<NEW_LINE>contentPanel.add(jobState, "4, 4, fill, default");<NEW_LINE>lblNewLabel_2 = new JLabel("Machine State");<NEW_LINE>contentPanel.add(lblNewLabel_2, "2, 6, right, default");<NEW_LINE>machineState = new JComboBox();<NEW_LINE>contentPanel.add(machineState, "4, 6, fill, default");<NEW_LINE>for (Actuator actuator : Configuration.get().getMachine().getActuators()) {<NEW_LINE>this.actuator.addItem(actuator);<NEW_LINE>}<NEW_LINE>jobState.addItem(null);<NEW_LINE>for (AbstractJobProcessor.State state : AbstractJobProcessor.State.values()) {<NEW_LINE>this.jobState.addItem(state);<NEW_LINE>}<NEW_LINE>machineState.addItem(null);<NEW_LINE>for (AbstractMachine.State state : AbstractMachine.State.values()) {<NEW_LINE>this.machineState.addItem(state);<NEW_LINE>}<NEW_LINE>} | contentPanel.add(lblNewLabel_1, "2, 4, right, default"); |
868,579 | final ListTransformJobsResult executeListTransformJobs(ListTransformJobsRequest listTransformJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTransformJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTransformJobsRequest> request = null;<NEW_LINE>Response<ListTransformJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTransformJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTransformJobsRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTransformJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTransformJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new ListTransformJobsResultJsonUnmarshaller()); |
1,731,908 | public void perform() {<NEW_LINE>OutputLogger logger = getLogger();<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>logger.outputInRed(NbBundle.getMessage(CreateTagAction.class, "MSG_CREATE_TITLE"));<NEW_LINE>// NOI18N<NEW_LINE>logger.outputInRed(NbBundle.getMessage<MASK><NEW_LINE>// NOI18N<NEW_LINE>logger.output(NbBundle.getMessage(CreateTagAction.class, "MSG_CREATE_INFO_SEP", tagName, repository.getAbsolutePath()));<NEW_LINE>HgCommand.createTag(repository, tagName, message, revision, local, logger);<NEW_LINE>if (!local) {<NEW_LINE>HgUtils.logHgLog(HgCommand.doTip(repository, logger), logger);<NEW_LINE>}<NEW_LINE>} catch (HgException.HgCommandCanceledException ex) {<NEW_LINE>// canceled by user, do nothing<NEW_LINE>} catch (HgException ex) {<NEW_LINE>HgUtils.notifyException(ex);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>logger.outputInRed(NbBundle.getMessage(CreateTagAction.class, "MSG_CREATE_DONE"));<NEW_LINE>// NOI18N<NEW_LINE>logger.output("");<NEW_LINE>} | (CreateTagAction.class, "MSG_CREATE_TITLE_SEP")); |
277,228 | public io.kubernetes.client.proto.V1Autoscaling.HorizontalPodAutoscalerStatus buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Autoscaling.HorizontalPodAutoscalerStatus result = new io.kubernetes.client.proto.V1Autoscaling.HorizontalPodAutoscalerStatus(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.observedGeneration_ = observedGeneration_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>if (lastScaleTimeBuilder_ == null) {<NEW_LINE>result.lastScaleTime_ = lastScaleTime_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.currentReplicas_ = currentReplicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.desiredReplicas_ = desiredReplicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.currentCPUUtilizationPercentage_ = currentCPUUtilizationPercentage_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .lastScaleTime_ = lastScaleTimeBuilder_.build(); |
1,011,683 | private boolean markMessageLocally(CounterDao counterDao, Message message) {<NEW_LINE>boolean unreadIncrease = false;<NEW_LINE>if (!TextUtils.isEmpty(mLabelId)) {<NEW_LINE>message.addLabels(Collections.singletonList(mLabelId));<NEW_LINE>removeOldFolderIds(message);<NEW_LINE>}<NEW_LINE>if (!message.isRead()) {<NEW_LINE>UnreadLocationCounter unreadLocationCounter = counterDao.findUnreadLocationByIdBlocking(message.getLocation());<NEW_LINE>if (unreadLocationCounter != null) {<NEW_LINE>unreadLocationCounter.decrement();<NEW_LINE>counterDao.insertUnreadLocationBlocking(unreadLocationCounter);<NEW_LINE>}<NEW_LINE>unreadIncrease = true;<NEW_LINE>}<NEW_LINE>Constants.MessageLocationType location = Constants.MessageLocationType.Companion.fromInt(message.getLocation());<NEW_LINE>if (location == Constants.MessageLocationType.SENT || location == Constants.MessageLocationType.ALL_SENT) {<NEW_LINE>message.addLabels(Collections.singletonList(mLabelId));<NEW_LINE>} else {<NEW_LINE>message.setLocation(Constants.<MASK><NEW_LINE>}<NEW_LINE>message.setFolderLocation(getLabelRepository());<NEW_LINE>Timber.d("Move message id: %s, location: %s, labels: %s", message.getMessageId(), message.getLocation(), message.getAllLabelIDs());<NEW_LINE>getMessageDetailsRepository().saveMessageBlocking(message);<NEW_LINE>return unreadIncrease;<NEW_LINE>} | MessageLocationType.LABEL_FOLDER.getMessageLocationTypeValue()); |
716,972 | public FTPFile parseFTPEntry(final String line) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Parse %s", line));<NEW_LINE>}<NEW_LINE>if (current != null) {<NEW_LINE>final FTPFile parsed = current.parseFTPEntry(line);<NEW_LINE>if (null != parsed) {<NEW_LINE>return parsed;<NEW_LINE>}<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Switching parser implementation because %s failed", current));<NEW_LINE>}<NEW_LINE>current = null;<NEW_LINE>}<NEW_LINE>for (FTPFileEntryParser parser : parsers) {<NEW_LINE>final FTPFile matched = parser.parseFTPEntry(line);<NEW_LINE>if (matched != null) {<NEW_LINE>current = parser;<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Caching %s parser implementation", current));<NEW_LINE>}<NEW_LINE>return matched;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.warn(String<MASK><NEW_LINE>return null;<NEW_LINE>} | .format("Failure parsing line %s", line)); |
1,715,831 | public <T> CompletableFuture<T> asyncCall(Callable<T> callable) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>setAttachment(ASYNC_KEY, Boolean.TRUE.toString());<NEW_LINE>final T o = callable.call();<NEW_LINE>// local invoke will return directly<NEW_LINE>if (o != null) {<NEW_LINE>if (o instanceof CompletableFuture) {<NEW_LINE>return (CompletableFuture<T>) o;<NEW_LINE>}<NEW_LINE>return CompletableFuture.completedFuture(o);<NEW_LINE>} else {<NEW_LINE>// The service has a normal sync method signature, should get future from RpcContext.<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RpcException(e);<NEW_LINE>} finally {<NEW_LINE>removeAttachment(ASYNC_KEY);<NEW_LINE>}<NEW_LINE>} catch (final RpcException e) {<NEW_LINE>CompletableFuture<T> <MASK><NEW_LINE>exceptionFuture.completeExceptionally(e);<NEW_LINE>return exceptionFuture;<NEW_LINE>}<NEW_LINE>return ((CompletableFuture<T>) getServiceContext().getFuture());<NEW_LINE>} | exceptionFuture = new CompletableFuture<>(); |
340,353 | public UserModel authenticate(String username, char[] password) {<NEW_LINE>ConnectorConfig config = new ConnectorConfig();<NEW_LINE>config.setUsername(username);<NEW_LINE>config.setPassword(new String(password));<NEW_LINE>try {<NEW_LINE>PartnerConnection connection = Connector.newConnection(config);<NEW_LINE>GetUserInfoResult info = connection.getUserInfo();<NEW_LINE>String org = settings.getString(Keys.realm.salesforce.orgId, "0").trim();<NEW_LINE>if (!org.equals("0")) {<NEW_LINE>if (!org.equals(info.getOrganizationId())) {<NEW_LINE>logger.warn("Access attempted by user of an invalid org: " + info.getUserName() + ", org: " + info.getOrganizationName() + "(" + info.getOrganizationId() + ")");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("Authenticated user " + info.getUserName() + " using org " + info.getOrganizationName() + "(" + info.getOrganizationId() + ")");<NEW_LINE>String simpleUsername = getSimpleUsername(info);<NEW_LINE>UserModel user = null;<NEW_LINE>synchronized (this) {<NEW_LINE>user = userManager.getUserModel(simpleUsername);<NEW_LINE>if (user == null) {<NEW_LINE>user = new UserModel(simpleUsername);<NEW_LINE>}<NEW_LINE>setCookie(user);<NEW_LINE>setUserAttributes(user, info);<NEW_LINE>updateUser(user);<NEW_LINE>}<NEW_LINE>return user;<NEW_LINE>} catch (ConnectionException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | logger.error("Failed to authenticate", e); |
708,969 | public void notifyTextAvailable(@Nonnull String line, @Nonnull Key outputType) {<NEW_LINE>if (outputType == ProcessOutputTypes.STDERR) {<NEW_LINE>LOG.warn(line);<NEW_LINE>}<NEW_LINE>if (outputType != ProcessOutputTypes.STDOUT) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (LOG.isTraceEnabled())<NEW_LINE>LOG.trace(">> " + line);<NEW_LINE>if (myLastOp == null) {<NEW_LINE>WatcherOp watcherOp;<NEW_LINE>try {<NEW_LINE>watcherOp = WatcherOp.valueOf(line);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>String message = "Illegal watcher command: '" + line + "'";<NEW_LINE>if (line.length() <= 20)<NEW_LINE>message += " " + Arrays.toString(line.chars().toArray());<NEW_LINE>LOG.error(message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (watcherOp == WatcherOp.GIVEUP) {<NEW_LINE>notifyOnFailure(ApplicationBundle.message("watcher.gave.up"), null);<NEW_LINE>myIsShuttingDown = true;<NEW_LINE>} else if (watcherOp == WatcherOp.RESET) {<NEW_LINE>myNotificationSink.notifyReset(null);<NEW_LINE>} else {<NEW_LINE>myLastOp = watcherOp;<NEW_LINE>}<NEW_LINE>} else if (myLastOp == WatcherOp.MESSAGE) {<NEW_LINE>LOG.warn(line);<NEW_LINE><MASK><NEW_LINE>myLastOp = null;<NEW_LINE>} else if (myLastOp == WatcherOp.REMAP || myLastOp == WatcherOp.UNWATCHEABLE) {<NEW_LINE>if ("#".equals(line)) {<NEW_LINE>if (myLastOp == WatcherOp.REMAP) {<NEW_LINE>processRemap();<NEW_LINE>} else {<NEW_LINE>mySettingRoots.decrementAndGet();<NEW_LINE>processUnwatchable();<NEW_LINE>}<NEW_LINE>myLines.clear();<NEW_LINE>myLastOp = null;<NEW_LINE>} else {<NEW_LINE>myLines.add(line);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// unescape<NEW_LINE>String path = StringUtil.trimEnd(line.replace('\0', '\n'), File.separator);<NEW_LINE>processChange(path, myLastOp);<NEW_LINE>myLastOp = null;<NEW_LINE>}<NEW_LINE>} | notifyOnFailure(line, NotificationListener.URL_OPENING_LISTENER); |
281,757 | public Request<ListSecurityProfilesRequest> marshall(ListSecurityProfilesRequest listSecurityProfilesRequest) {<NEW_LINE>if (listSecurityProfilesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListSecurityProfilesRequest)");<NEW_LINE>}<NEW_LINE>Request<ListSecurityProfilesRequest> request = new DefaultRequest<ListSecurityProfilesRequest>(listSecurityProfilesRequest, "AmazonConnect");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/security-profiles-summary/{InstanceId}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (listSecurityProfilesRequest.getInstanceId() == null) ? "" : StringUtils.fromString(listSecurityProfilesRequest.getInstanceId()));<NEW_LINE>if (listSecurityProfilesRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString(listSecurityProfilesRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listSecurityProfilesRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger<MASK><NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (listSecurityProfilesRequest.getMaxResults())); |
615,954 | public GenotypeAlleleCounts genotypeAlleleCountsAt(final int index) {<NEW_LINE>Utils.validateArg(index >= 0 && index < genotypeCount, () -> "invalid likelihood index: " + index + " >= " + genotypeCount + " (genotype count for nalleles = " + alleleCount + " and ploidy " + ploidy);<NEW_LINE>if (index < GenotypeLikelihoodCalculators.MAXIMUM_STRONG_REF_GENOTYPE_PER_PLOIDY) {<NEW_LINE>return genotypeAlleleCounts[index];<NEW_LINE>} else if (lastOverheadCounts == null || lastOverheadCounts.index() > index) {<NEW_LINE>final GenotypeAlleleCounts result = genotypeAlleleCounts[GenotypeLikelihoodCalculators.MAXIMUM_STRONG_REF_GENOTYPE_PER_PLOIDY - 1].copy();<NEW_LINE>result.increase(<MASK><NEW_LINE>lastOverheadCounts = result;<NEW_LINE>return result.copy();<NEW_LINE>} else {<NEW_LINE>lastOverheadCounts.increase(index - lastOverheadCounts.index());<NEW_LINE>return lastOverheadCounts.copy();<NEW_LINE>}<NEW_LINE>} | index - GenotypeLikelihoodCalculators.MAXIMUM_STRONG_REF_GENOTYPE_PER_PLOIDY + 1); |
1,178,023 | protected void onActivityResult(int requestCode, int resultCode, Intent intent) {<NEW_LINE>super.<MASK><NEW_LINE>try {<NEW_LINE>if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {<NEW_LINE>CropImage.ActivityResult result = CropImage.getActivityResult(intent);<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>if (intent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (imageChangeUri != null) {<NEW_LINE>imageChangeUri = result.getUri();<NEW_LINE>// <--- added to force redraw of ImageView<NEW_LINE>circleImageView.setImageDrawable(null);<NEW_LINE>circleImageView.setImageURI(imageChangeUri);<NEW_LINE>AlTask.execute(new ProfilePictureUpload(true, profilePhotoFile, imageChangeUri, ChannelCreateActivity.this));<NEW_LINE>} else {<NEW_LINE>imageChangeUri = result.getUri();<NEW_LINE>String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());<NEW_LINE>String imageFileName = "JPEG_" + timeStamp + "_" + ".jpeg";<NEW_LINE>// <--- added to force redraw of ImageView<NEW_LINE>circleImageView.setImageDrawable(null);<NEW_LINE>circleImageView.setImageURI(imageChangeUri);<NEW_LINE>profilePhotoFile = FileClientService.getFilePath(imageFileName, this, "image/jpeg");<NEW_LINE>AlTask.execute(new ProfilePictureUpload(true, profilePhotoFile, imageChangeUri, ChannelCreateActivity.this));<NEW_LINE>}<NEW_LINE>} else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {<NEW_LINE>Toast.makeText(this, this.getString(R.string.applozic_Cropping_failed) + result.getError(), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resultCode == Activity.RESULT_OK) {<NEW_LINE>handleOnActivityResult(requestCode, intent);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Utils.printLog(this, TAG, "exception in profile image");<NEW_LINE>}<NEW_LINE>} | onActivityResult(requestCode, resultCode, intent); |
1,465,422 | private void sendPayerApprovalRequestEmail(@NonNull final PaymentReservation reservation, @NonNull final URL payerApproveUrl, @NonNull final MailTemplateId mailTemplateId) {<NEW_LINE>final MailTextBuilder mailTextBuilder = mailService.newMailTextBuilder(mailTemplateId);<NEW_LINE>mailTextBuilder.bpartnerContact(reservation.getPayerContactId());<NEW_LINE>mailTextBuilder.customVariable(MAIL_VAR_ApproveURL, payerApproveUrl.toExternalForm());<NEW_LINE>mailTextBuilder.customVariable(MAIL_VAR_Amount, moneyService.toTranslatableString<MASK><NEW_LINE>final I_C_Order salesOrder = ordersRepo.getById(reservation.getSalesOrderId());<NEW_LINE>mailTextBuilder.customVariable(MAIL_VAR_SalesOrderDocumentNo, salesOrder.getDocumentNo());<NEW_LINE>final Mailbox mailbox = findMailbox(reservation);<NEW_LINE>final EMail email = mailService.createEMail(mailbox, reservation.getPayerEmail(), mailTextBuilder.getMailHeader(), mailTextBuilder.getFullMailText(), mailTextBuilder.isHtml());<NEW_LINE>trxManager.runAfterCommit(() -> mailService.send(email));<NEW_LINE>} | (reservation.getAmount())); |
1,535,708 | private <T extends EhcacheEntityResponse> void fireResponseEvent(T response) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<ResponseListener<T>> responseListeners = (List) this.responseListeners.get(response.getClass());<NEW_LINE>if (responseListeners == null) {<NEW_LINE>LOGGER.warn("Ignoring the response {} as no registered response listener could be found.", response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.debug("{} registered response listener(s) for {}", responseListeners.size(<MASK><NEW_LINE>for (ResponseListener<T> responseListener : responseListeners) {<NEW_LINE>Runnable responseProcessing = () -> {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse(response);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>LOGGER.debug("Timeout exception processing: {} - resubmitting", response, e);<NEW_LINE>fireResponseEvent(response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Unhandled failure processing: {}", response, e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>asyncWorker.execute(responseProcessing);<NEW_LINE>} catch (RejectedExecutionException f) {<NEW_LINE>LOGGER.warn("Response task execution rejected using inline execution: {}", response, f);<NEW_LINE>responseProcessing.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), response.getClass()); |
452,149 | final DeleteTimeSeriesResult executeDeleteTimeSeries(DeleteTimeSeriesRequest deleteTimeSeriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTimeSeriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTimeSeriesRequest> request = null;<NEW_LINE>Response<DeleteTimeSeriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTimeSeriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTimeSeriesRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTimeSeries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTimeSeriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTimeSeriesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | responseHandler, executionContext, null, endpointTraitHost); |
1,566,318 | final ListAvailableManagedRuleGroupVersionsResult executeListAvailableManagedRuleGroupVersions(ListAvailableManagedRuleGroupVersionsRequest listAvailableManagedRuleGroupVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAvailableManagedRuleGroupVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAvailableManagedRuleGroupVersionsRequest> request = null;<NEW_LINE>Response<ListAvailableManagedRuleGroupVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAvailableManagedRuleGroupVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAvailableManagedRuleGroupVersionsRequest));<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, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAvailableManagedRuleGroupVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAvailableManagedRuleGroupVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new ListAvailableManagedRuleGroupVersionsResultJsonUnmarshaller()); |
1,360,513 | private JPanel createCommandBarPanel() {<NEW_LINE>YBoxPanel panel = new YBoxPanel();<NEW_LINE>panel.setBorder(BorderFactory.createTitledBorder(Translator.get("preview")));<NEW_LINE>panel.add(Box.createRigidArea(new Dimension(0, 5)));<NEW_LINE>YBoxPanel listsPanel = new YBoxPanel();<NEW_LINE>listsPanel.add(commandBarButtonsList);<NEW_LINE>listsPanel.add(commandBarAlternateButtonsList);<NEW_LINE>JScrollPane scrollPane = new JScrollPane(listsPanel, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);<NEW_LINE>scrollPane.setBorder(null);<NEW_LINE>panel.add(scrollPane);<NEW_LINE>panel.add(Box.createRigidArea(new Dimension(0, 5)));<NEW_LINE>panel.add(new JLabel("(" + Translator.get("command_bar_dialog.help") + ")"));<NEW_LINE>panel.add(Box.createRigidArea(new <MASK><NEW_LINE>JPanel modifierPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));<NEW_LINE>modifierField = new RecordingKeyStrokeTextField(MODIFIER_FIELD_MAX_LENGTH, CommandBarAttributes.getModifier()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setText(String t) {<NEW_LINE>super.setText(t);<NEW_LINE>componentChanged();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>int pressedKeyCode = e.getKeyCode();<NEW_LINE>// Accept modifier keys only<NEW_LINE>if (pressedKeyCode == KeyEvent.VK_CONTROL || pressedKeyCode == KeyEvent.VK_ALT || pressedKeyCode == KeyEvent.VK_META || pressedKeyCode == KeyEvent.VK_SHIFT)<NEW_LINE>super.keyPressed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>modifierPanel.add(new JLabel(Translator.get("command_bar_customize_dialog.modifier")));<NEW_LINE>modifierPanel.add(modifierField);<NEW_LINE>panel.add(modifierPanel);<NEW_LINE>return panel;<NEW_LINE>} | Dimension(0, 5))); |
37,756 | final ResetParameterGroupResult executeResetParameterGroup(ResetParameterGroupRequest resetParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resetParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResetParameterGroupRequest> request = null;<NEW_LINE>Response<ResetParameterGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ResetParameterGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(resetParameterGroupRequest));<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, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResetParameterGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ResetParameterGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ResetParameterGroupResultJsonUnmarshaller());<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,275,259 | private void emitLoopBegin(final LoopBeginNode loopBeginNode) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "visiting emitLoopBegin %s", loopBeginNode);<NEW_LINE>final Block block = (Block) gen.getCurrentBlock();<NEW_LINE>final Block currentBlockDominator = block.getDominator();<NEW_LINE>final LIR lir = getGen().getResult().getLIR();<NEW_LINE>final LabelOp label = (LabelOp) lir.getLIRforBlock(block).get(0);<NEW_LINE>List<ValuePhiNode> valuePhis = loopBeginNode.valuePhis().snapshot();<NEW_LINE>for (ValuePhiNode phi : valuePhis) {<NEW_LINE>final Value value = operand(phi.firstValue());<NEW_LINE>if (phi.singleBackValueOrThis() == phi && value instanceof Variable) {<NEW_LINE>setResult(phi, value);<NEW_LINE>} else {<NEW_LINE>final AllocatableValue result = gen<MASK><NEW_LINE>append(new OCLLIRStmt.AssignStmt(result, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>emitOCLFPGAPragmas(currentBlockDominator);<NEW_LINE>append(new OCLControlFlow.LoopInitOp());<NEW_LINE>append(new OCLControlFlow.LoopPostOp());<NEW_LINE>label.clearIncomingValues();<NEW_LINE>} | .asAllocatable(operandForPhi(phi)); |
437,677 | public static String findLicenseByMavenProjectContent(String url) {<NEW_LINE>// try to match the project's license URL and the mavenLicenseURL attribute of license template<NEW_LINE>// NOI18N<NEW_LINE>FileObject licensesFO = FileUtil.getConfigFile("Templates/Licenses");<NEW_LINE>if (licensesFO == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FileObject[] licenseFiles = licensesFO.getChildren();<NEW_LINE>if (url != null) {<NEW_LINE>for (FileObject fo : licenseFiles) {<NEW_LINE>// NOI18N<NEW_LINE>String str = (String) fo.getAttribute("mavenLicenseURL");<NEW_LINE>if (str != null && Arrays.asList(str.split(" ")).contains(url)) {<NEW_LINE>if (fo.getName().startsWith("license-")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>return fo.getName().substring("license-".length());<NEW_LINE>} else {<NEW_LINE>Logger.getLogger(TemplateAttrProvider.class.getName()).log(Level.WARNING, <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | "Bad license file name {0} (expected to start with ''license-'' prefix)", fo.getName()); |
327,212 | private boolean testngXmlExistsInJar(File jarFile, List<String> classes) throws IOException {<NEW_LINE>try (JarFile jf = new JarFile(jarFile)) {<NEW_LINE>Enumeration<JarEntry> entries = jf.entries();<NEW_LINE>File file = java.nio.file.Files.createTempDirectory("testngXmlPathInJar-").toFile();<NEW_LINE>String suitePath = null;<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE>JarEntry je = entries.nextElement();<NEW_LINE>String jeName = je.getName();<NEW_LINE>if (Parser.canParse(jeName.toLowerCase())) {<NEW_LINE>InputStream inputStream = jf.getInputStream(je);<NEW_LINE>File copyFile = new File(file, jeName);<NEW_LINE>Files.copyFile(inputStream, copyFile);<NEW_LINE>if (matchesXmlPathInJar(je)) {<NEW_LINE>suitePath = copyFile.toString();<NEW_LINE>}<NEW_LINE>} else if (isJavaClass(je)) {<NEW_LINE>classes<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(suitePath)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Collection<XmlSuite> parsedSuites = Parser.parse(suitePath, processor);<NEW_LINE>delete(file);<NEW_LINE>for (XmlSuite suite : parsedSuites) {<NEW_LINE>// If test names were specified, only run these test names<NEW_LINE>if (testNames != null) {<NEW_LINE>TestNamesMatcher testNamesMatcher = new TestNamesMatcher(suite, testNames);<NEW_LINE>testNamesMatcher.validateMissMatchedTestNames();<NEW_LINE>suites.addAll(testNamesMatcher.getSuitesMatchingTestNames());<NEW_LINE>} else {<NEW_LINE>suites.add(suite);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .add(constructClassName(je)); |
1,218,174 | private Variable createStackVariable(final String name, final int offset, DataType dt, MessageLog log) {<NEW_LINE>StackFrame stackFrame = function.getStackFrame();<NEW_LINE>Variable variable = stackFrame.getVariableContaining(offset);<NEW_LINE>try {<NEW_LINE>if (variable == null || variable.getStackOffset() != offset) {<NEW_LINE>if (variable != null) {<NEW_LINE>stackFrame.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>variable = stackFrame.createVariable(name, offset, dt, SourceType.IMPORTED);<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>variable = stackFrame.createVariable(name + "@" + Integer.toHexString(offset), offset, dt, SourceType.IMPORTED);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>variable.setDataType(dt, false, true, SourceType.ANALYSIS);<NEW_LINE>try {<NEW_LINE>variable.setName(name, SourceType.IMPORTED);<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>variable.setName(name + "@" + Integer.toHexString(offset), SourceType.IMPORTED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendMsg("PDB", "Unable to create stack variable " + name + " at offset " + offset + " in " + function.getName());<NEW_LINE>}<NEW_LINE>return variable;<NEW_LINE>} | clearVariable(variable.getStackOffset()); |
1,337,392 | public Pair<IterOutcome, BatchStatusWrappper> next() {<NEW_LINE>while (!batchStatusStack.isEmpty()) {<NEW_LINE>BatchStatusWrappper topStatus = batchStatusStack.peek();<NEW_LINE>if (topStatus.prefetched) {<NEW_LINE>topStatus.prefetched = false;<NEW_LINE>batchMemoryManager.update(topStatus.batch, topStatus.inputIndex);<NEW_LINE>RecordBatchStats.logRecordBatchStats(topStatus.inputIndex == 0 ? RecordBatchIOType.INPUT_LEFT : RecordBatchIOType.INPUT_RIGHT, batchMemoryManager.getRecordBatchSizer(topStatus.inputIndex), getRecordBatchStatsContext());<NEW_LINE>return Pair.of(topStatus.outcome, topStatus);<NEW_LINE>} else {<NEW_LINE>// If we have more records to process, just return the top batch.<NEW_LINE>if (topStatus.getRemainingRecords() > 0) {<NEW_LINE>return Pair.of(IterOutcome.OK, topStatus);<NEW_LINE>}<NEW_LINE>IterOutcome outcome = UnionAllRecordBatch.this.next(topStatus.inputIndex, topStatus.batch);<NEW_LINE>switch(outcome) {<NEW_LINE>case OK:<NEW_LINE>case OK_NEW_SCHEMA:<NEW_LINE>// since we just read a new batch, update memory manager and initialize batch stats.<NEW_LINE>topStatus.recordsProcessed = 0;<NEW_LINE>topStatus.totalRecordsToProcess = topStatus.batch.getRecordCount();<NEW_LINE>batchMemoryManager.update(topStatus.batch, topStatus.inputIndex);<NEW_LINE>RecordBatchStats.logRecordBatchStats(topStatus.inputIndex == 0 ? RecordBatchIOType.INPUT_LEFT : RecordBatchIOType.INPUT_RIGHT, batchMemoryManager.getRecordBatchSizer(topStatus.inputIndex), getRecordBatchStatsContext());<NEW_LINE>return Pair.of(outcome, topStatus);<NEW_LINE>case NONE:<NEW_LINE>batchStatusStack.pop();<NEW_LINE>if (batchStatusStack.isEmpty()) {<NEW_LINE>return Pair.of(IterOutcome.NONE, null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException(String<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>} | .format("Unexpected state %s", outcome)); |
45,414 | public void methodReferenceSwingsBothWays(ReferenceExpression expression, MethodBinding instanceMethod, MethodBinding nonInstanceMethod) {<NEW_LINE>char[] selector = instanceMethod.selector;<NEW_LINE>TypeBinding receiverType = instanceMethod.declaringClass;<NEW_LINE>StringBuilder buffer1 = new StringBuilder();<NEW_LINE>StringBuilder shortBuffer1 = new StringBuilder();<NEW_LINE>TypeBinding[] parameters = instanceMethod.parameters;<NEW_LINE>for (int i = 0, length = parameters.length; i < length; i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buffer1.append(", ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>shortBuffer1.append(", ");<NEW_LINE>}<NEW_LINE>buffer1.append(new String(parameters[i].readableName()));<NEW_LINE>shortBuffer1.append(new String(parameters[i].shortReadableName()));<NEW_LINE>}<NEW_LINE>StringBuilder buffer2 = new StringBuilder();<NEW_LINE>StringBuilder shortBuffer2 = new StringBuilder();<NEW_LINE>parameters = nonInstanceMethod.parameters;<NEW_LINE>for (int i = 0, length = parameters.length; i < length; i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buffer2.append(", ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>shortBuffer2.append(", ");<NEW_LINE>}<NEW_LINE>buffer2.append(new String(parameters[i].readableName()));<NEW_LINE>shortBuffer2.append(new String(parameters[i].shortReadableName()));<NEW_LINE>}<NEW_LINE>int id = IProblem.MethodReferenceSwingsBothWays;<NEW_LINE>this.handle(id, new String[] { new String(receiverType.readableName()), new String(selector), buffer1.toString(), new String(selector), buffer2.toString() }, new String[] { new String(receiverType.shortReadableName()), new String(selector), shortBuffer1.toString(), new String(selector), shortBuffer2.toString() }, <MASK><NEW_LINE>} | expression.sourceStart, expression.sourceEnd); |
253,992 | public static void filterNonIngestNodesIfNeeded(Settings settings, Log log) {<NEW_LINE>if (!settings.getNodesIngestOnly()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RestClient bootstrap = new RestClient(settings);<NEW_LINE>try {<NEW_LINE>String message = "Ingest-only routing specified but no ingest nodes with HTTP-enabled available";<NEW_LINE>List<NodeInfo> clientNodes = bootstrap.getHttpIngestNodes();<NEW_LINE>if (clientNodes.isEmpty()) {<NEW_LINE>throw new EsHadoopIllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Found ingest nodes %s", clientNodes));<NEW_LINE>}<NEW_LINE>List<String> toRetain = new ArrayList<String>(clientNodes.size());<NEW_LINE>for (NodeInfo node : clientNodes) {<NEW_LINE>toRetain.add(node.getPublishAddress());<NEW_LINE>}<NEW_LINE>List<String> ddNodes = SettingsUtils.discoveredOrDeclaredNodes(settings);<NEW_LINE>// remove non-client nodes<NEW_LINE>ddNodes.retainAll(toRetain);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Filtered discovered only nodes %s to ingest-only %s", SettingsUtils.<MASK><NEW_LINE>}<NEW_LINE>if (ddNodes.isEmpty()) {<NEW_LINE>if (settings.getNodesDiscovery()) {<NEW_LINE>message += String.format("; looks like the ingest nodes discovered have been removed; is the cluster in a stable state? %s", clientNodes);<NEW_LINE>} else {<NEW_LINE>message += String.format("; node discovery is disabled and none of nodes specified fit the criterion %s", SettingsUtils.discoveredOrDeclaredNodes(settings));<NEW_LINE>}<NEW_LINE>throw new EsHadoopIllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>SettingsUtils.setDiscoveredNodes(settings, ddNodes);<NEW_LINE>} finally {<NEW_LINE>bootstrap.close();<NEW_LINE>}<NEW_LINE>} | discoveredOrDeclaredNodes(settings), ddNodes)); |
7,483 | final UpdateAccountResult executeUpdateAccount(UpdateAccountRequest updateAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAccountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAccountRequest> request = null;<NEW_LINE>Response<UpdateAccountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAccountRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAccountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAccountResultJsonUnmarshaller());<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); |
20,193 | public void onGlobalLayout() {<NEW_LINE>Rect visibleDisplayFrame = new Rect();<NEW_LINE>buttonsHeight = getResources().<MASK><NEW_LINE>shadowHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_top_shadow_height);<NEW_LINE>scrollView = getView().findViewById(R.id.scroll_view);<NEW_LINE>scrollView.getWindowVisibleDisplayFrame(visibleDisplayFrame);<NEW_LINE>int contentHeight = visibleDisplayFrame.bottom - visibleDisplayFrame.top - buttonsHeight;<NEW_LINE>if (contentHeightPrevious != contentHeight) {<NEW_LINE>boolean showTopShadow;<NEW_LINE>if (scrollView.getHeight() + shadowHeight > contentHeight) {<NEW_LINE>scrollView.getLayoutParams().height = contentHeight;<NEW_LINE>showTopShadow = false;<NEW_LINE>} else {<NEW_LINE>scrollView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;<NEW_LINE>showTopShadow = true;<NEW_LINE>}<NEW_LINE>scrollView.requestLayout();<NEW_LINE>int delay = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? 300 : 1000;<NEW_LINE>scrollView.postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>scrollView.scrollTo(0, scrollView.getHeight());<NEW_LINE>}<NEW_LINE>}, delay);<NEW_LINE>contentHeightPrevious = contentHeight;<NEW_LINE>drawTopShadow(showTopShadow);<NEW_LINE>}<NEW_LINE>} | getDimensionPixelSize(R.dimen.dialog_button_ex_height); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.