idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,072,465 | public Object calculate(Context ctx) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>if (param == null) {<NEW_LINE>throw new RQException("power" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object val = param.getLeafExpression().calculate(ctx);<NEW_LINE>return Variant.square(val);<NEW_LINE>}<NEW_LINE>if (param.getSubSize() != 2) {<NEW_LINE>throw new RQException("power" <MASK><NEW_LINE>}<NEW_LINE>IParam sub1 = param.getSub(0);<NEW_LINE>IParam sub2 = param.getSub(1);<NEW_LINE>if (sub1 == null || sub2 == null) {<NEW_LINE>throw new RQException("power" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object result1 = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>if (result1 == null) {<NEW_LINE>return null;<NEW_LINE>} else if (!(result1 instanceof Number)) {<NEW_LINE>throw new RQException("power" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Object result2 = sub2.getLeafExpression().calculate(ctx);<NEW_LINE>if (result2 == null) {<NEW_LINE>return null;<NEW_LINE>} else if (!(result2 instanceof Number)) {<NEW_LINE>throw new RQException("power" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return new Double(Math.pow(Variant.doubleValue(result1), Variant.doubleValue(result2)));<NEW_LINE>} | + mm.getMessage("function.invalidParam")); |
1,464,789 | public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {<NEW_LINE>SofaTracerSpan sofaTracerSpan = restTemplateTracer.clientSend(request.getMethod().name());<NEW_LINE>appendRestTemplateRequestSpanTags(request, sofaTracerSpan);<NEW_LINE>ClientHttpResponse response = null;<NEW_LINE>Throwable t = null;<NEW_LINE>try {<NEW_LINE>return response = execution.execute(request, body);<NEW_LINE>} catch (IOException e) {<NEW_LINE>t = e;<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>SofaTraceContext sofaTraceContext = SofaTraceContextHolder.getSofaTraceContext();<NEW_LINE>SofaTracerSpan currentSpan = sofaTraceContext.getCurrentSpan();<NEW_LINE>String resultCode = SofaTracerConstant.RESULT_CODE_ERROR;<NEW_LINE>// is get error<NEW_LINE>if (t != null) {<NEW_LINE>currentSpan.setTag(Tags.ERROR.getKey(), t.getMessage());<NEW_LINE>// current thread name<NEW_LINE>sofaTracerSpan.setTag(CommonSpanTags.CURRENT_THREAD_NAME, Thread.currentThread().getName());<NEW_LINE>}<NEW_LINE>if (response != null) {<NEW_LINE>// tag append<NEW_LINE>appendRestTemplateResponseSpanTags(response, currentSpan);<NEW_LINE>// finish<NEW_LINE>resultCode = String.valueOf(response.<MASK><NEW_LINE>}<NEW_LINE>restTemplateTracer.clientReceive(resultCode);<NEW_LINE>}<NEW_LINE>} | getStatusCode().value()); |
263 | public Optional<ListMultimapProperty> create(Config config) {<NEW_LINE><MASK><NEW_LINE>DeclaredType type = maybeDeclared(property.getType()).orElse(null);<NEW_LINE>if (!erasesToAnyOf(type, Multimap.class, ImmutableMultimap.class, ListMultimap.class, ImmutableListMultimap.class)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>TypeMirror keyType = upperBound(config.getElements(), type.getTypeArguments().get(0));<NEW_LINE>TypeMirror valueType = upperBound(config.getElements(), type.getTypeArguments().get(1));<NEW_LINE>Optional<TypeMirror> unboxedKeyType = maybeUnbox(keyType, config.getTypes());<NEW_LINE>Optional<TypeMirror> unboxedValueType = maybeUnbox(valueType, config.getTypes());<NEW_LINE>boolean overridesPutMethod = hasPutMethodOverride(config, unboxedKeyType.orElse(keyType), unboxedValueType.orElse(valueType));<NEW_LINE>FunctionalType mutatorType = functionalTypeAcceptedByMethod(config.getBuilder(), mutator(property), consumer(listMultimap(keyType, valueType, config.getElements(), config.getTypes())), config.getElements(), config.getTypes());<NEW_LINE>return Optional.of(new ListMultimapProperty(config.getDatatype(), property, overridesPutMethod, keyType, unboxedKeyType, valueType, unboxedValueType, mutatorType));<NEW_LINE>} | Property property = config.getProperty(); |
484,207 | public void serialize(ByteBuf buf) {<NEW_LINE>super.serialize(buf);<NEW_LINE>long startCol = splitContext.getPartKey().getStartCol();<NEW_LINE>if (isUseIntKey()) {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>int filterValue = (int) splitContext.getFilterThreshold();<NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.setInt(position, needUpdateItemNum);<NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>int filterValue = (int) splitContext.getFilterThreshold();<NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeInt(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | buf.setInt(position, needUpdateItemNum); |
717,657 | String validateAuthorizeService(PrincipalToken userToken, StringBuilder errMsg) {<NEW_LINE>errMsg = errMsg == null ? new StringBuilder(512) : errMsg;<NEW_LINE><MASK><NEW_LINE>if (authorizedServiceName == null) {<NEW_LINE>List<String> authorizedServices = userToken.getAuthorizedServices();<NEW_LINE>if (authorizedServices == null || authorizedServices.size() != 1) {<NEW_LINE>errMsg.append("PrincipalAuthority:validateAuthorizeService: ").append("No service name and services list empty OR contains multiple entries: token=").append(userToken.getUnsignedToken());<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>authorizedServiceName = authorizedServices.get(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder errDetail = new StringBuilder(512);<NEW_LINE>if (!userToken.validateForAuthorizedService(publicKey, errDetail)) {<NEW_LINE>errMsg.append("PrincipalAuthority:validateAuthorizeService: token validation for authorized service failed: ").append(errDetail);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return authorizedServiceName;<NEW_LINE>} | String authorizedServiceName = userToken.getAuthorizedServiceName(); |
761,761 | public void onRenderTooltip(RenderTooltipEvent.PostText event) {<NEW_LINE>ItemStack stack = event.getStack();<NEW_LINE>if (stack.getItem() instanceof IBulletContainer) {<NEW_LINE>NonNullList<ItemStack> bullets = ((IBulletContainer) stack.getItem()).getBullets(stack);<NEW_LINE>if (bullets != null) {<NEW_LINE>int bulletAmount = ((IBulletContainer) stack.getItem()).getBulletCount(stack);<NEW_LINE>List<String> linesString = event.getLines().stream().map(FormattedText::getString).collect(Collectors.toList());<NEW_LINE>int line = event.getLines().size() - Utils.findSequenceInList(linesString, BULLET_TOOLTIP, (a, b) <MASK><NEW_LINE>int currentX = event.getX();<NEW_LINE>int currentY = line > 0 ? event.getY() + (event.getHeight() + 1 - line * 10) : event.getY() - 42;<NEW_LINE>PoseStack transform = new PoseStack();<NEW_LINE>transform.pushPose();<NEW_LINE>transform.translate(currentX, currentY, 700);<NEW_LINE>transform.scale(.5f, .5f, 1);<NEW_LINE>RevolverScreen.drawExternalGUI(bullets, bulletAmount, transform);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | -> b.endsWith(a)); |
818,483 | protected SpanQuery buildQuery(List<String> queryTerms) {<NEW_LINE>List<SpanQuery> clauses = new ArrayList<>();<NEW_LINE>for (int i = 0, ln = queryTerms.size(); i < ln; i++) {<NEW_LINE>String <MASK><NEW_LINE>if (isWholeWordsOnly) {<NEW_LINE>clauses.add(new SpanTermQuery(new Term(CONTENT_FIELD, term)));<NEW_LINE>} else {<NEW_LINE>if (i == 0) {<NEW_LINE>term = "*" + term;<NEW_LINE>}<NEW_LINE>if (i == ln - 1) {<NEW_LINE>term = term + "*";<NEW_LINE>}<NEW_LINE>clauses.add(new SpanMultiTermQueryWrapper<>(new WildcardQuery(new Term(CONTENT_FIELD, term))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clauses.size() > 1) {<NEW_LINE>// create a spanQuery with no distance between terms; the terms' order matters<NEW_LINE>// SpanNearQuery requires at least 2 clauses<NEW_LINE>return new SpanNearQuery(clauses.toArray(new SpanQuery[] {}), 0, true);<NEW_LINE>} else if (clauses.size() == 1) {<NEW_LINE>return clauses.get(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | term = queryTerms.get(i); |
231,167 | public PlanItemInstanceResponse createPlanItemInstanceResponse(PlanItemInstance planItemInstance) {<NEW_LINE>RestUrlBuilder urlBuilder = createUrlBuilder();<NEW_LINE>PlanItemInstanceResponse result = new PlanItemInstanceResponse();<NEW_LINE>result.setId(planItemInstance.getId());<NEW_LINE>result.setUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_PLAN_ITEM_INSTANCE, planItemInstance.getId()));<NEW_LINE>result.setName(planItemInstance.getName());<NEW_LINE>result.setCaseDefinitionId(planItemInstance.getCaseDefinitionId());<NEW_LINE>result.setCaseDefinitionUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_DEFINITION, planItemInstance.getCaseDefinitionId()));<NEW_LINE>if (planItemInstance.getDerivedCaseDefinitionId() != null) {<NEW_LINE>result.setDerivedCaseDefinitionId(planItemInstance.getDerivedCaseDefinitionId());<NEW_LINE>result.setDerivedCaseDefinitionUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_DEFINITION, planItemInstance.getDerivedCaseDefinitionId()));<NEW_LINE>}<NEW_LINE>result.setCaseInstanceId(planItemInstance.getCaseInstanceId());<NEW_LINE>result.setCaseInstanceUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_INSTANCE, planItemInstance.getCaseInstanceId()));<NEW_LINE>if (planItemInstance.getStageInstanceId() != null) {<NEW_LINE>result.setStageInstanceId(planItemInstance.getStageInstanceId());<NEW_LINE>result.setStageInstanceUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_PLAN_ITEM_INSTANCE, planItemInstance.getStageInstanceId()));<NEW_LINE>}<NEW_LINE>result.setPlanItemDefinitionId(planItemInstance.getPlanItemDefinitionId());<NEW_LINE>result.setPlanItemDefinitionType(planItemInstance.getPlanItemDefinitionType());<NEW_LINE>result.setState(planItemInstance.getState());<NEW_LINE>result.setElementId(planItemInstance.getElementId());<NEW_LINE>result.setReferenceId(planItemInstance.getReferenceId());<NEW_LINE>result.setReferenceType(planItemInstance.getReferenceType());<NEW_LINE>result.setCreateTime(planItemInstance.getCreateTime());<NEW_LINE>result.setLastAvailableTime(planItemInstance.getLastAvailableTime());<NEW_LINE>result.setLastEnabledTime(planItemInstance.getLastEnabledTime());<NEW_LINE>result.setLastDisabledTime(planItemInstance.getLastDisabledTime());<NEW_LINE>result.setLastStartedTime(planItemInstance.getLastStartedTime());<NEW_LINE>result.setLastSuspendedTime(planItemInstance.getLastSuspendedTime());<NEW_LINE>result.setCompletedTime(planItemInstance.getCompletedTime());<NEW_LINE>result.setOccurredTime(planItemInstance.getOccurredTime());<NEW_LINE>result.setTerminatedTime(planItemInstance.getTerminatedTime());<NEW_LINE>result.setExitTime(planItemInstance.getExitTime());<NEW_LINE>result.setEndedTime(planItemInstance.getEndedTime());<NEW_LINE>result.setStartUserId(planItemInstance.getStartUserId());<NEW_LINE>result.setStage(planItemInstance.isStage());<NEW_LINE>result.setCompletable(planItemInstance.isCompletable());<NEW_LINE>result.setEntryCriterionId(planItemInstance.getEntryCriterionId());<NEW_LINE>result.setExitCriterionId(planItemInstance.getExitCriterionId());<NEW_LINE>result.setFormKey(planItemInstance.getFormKey());<NEW_LINE>result.<MASK><NEW_LINE>result.setTenantId(planItemInstance.getTenantId());<NEW_LINE>return result;<NEW_LINE>} | setExtraValue(planItemInstance.getExtraValue()); |
39,332 | private static Bitmap blur(Bitmap bitmap, Context context) {<NEW_LINE>Point previewSize = scaleKeepingAspectRatio(new Point(bitmap.getWidth(), bitmap.getHeight()), PREVIEW_DIMENSION_LIMIT);<NEW_LINE>Point blurSize = scaleKeepingAspectRatio(new Point(previewSize.x / 2, previewSize.y / 2), MAX_BLUR_DIMENSION);<NEW_LINE>Bitmap small = BitmapUtil.createScaledBitmap(bitmap, blurSize.x, blurSize.y);<NEW_LINE>Log.d(TAG, "Bitmap: " + bitmap.getWidth() + "x" + bitmap.getHeight() + ", Blur: " + blurSize.<MASK><NEW_LINE>RenderScript rs = RenderScript.create(context);<NEW_LINE>Allocation input = Allocation.createFromBitmap(rs, small);<NEW_LINE>Allocation output = Allocation.createTyped(rs, input.getType());<NEW_LINE>ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));<NEW_LINE>script.setRadius(25f);<NEW_LINE>script.setInput(input);<NEW_LINE>script.forEach(output);<NEW_LINE>Bitmap blurred = Bitmap.createBitmap(small.getWidth(), small.getHeight(), small.getConfig());<NEW_LINE>output.copyTo(blurred);<NEW_LINE>return blurred;<NEW_LINE>} | x + "x" + blurSize.y); |
87,813 | final UpdateProfileResult executeUpdateProfile(UpdateProfileRequest updateProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateProfileRequest> request = null;<NEW_LINE>Response<UpdateProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateProfileRequest));<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, "Customer Profiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateProfileResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
604,798 | public ConfigurationProperty create(String key, String value, String encryptedValue, Boolean isSecure) {<NEW_LINE>ConfigurationProperty configurationProperty = new ConfigurationProperty();<NEW_LINE>configurationProperty.setConfigurationKey(new ConfigurationKey(key));<NEW_LINE>if (isNotBlank(value) && isNotBlank(encryptedValue)) {<NEW_LINE><MASK><NEW_LINE>configurationProperty.addError("encryptedValue", "You may only specify `value` or `encrypted_value`, not both!");<NEW_LINE>configurationProperty.setConfigurationValue(new ConfigurationValue(value));<NEW_LINE>configurationProperty.setEncryptedValue(new EncryptedConfigurationValue(encryptedValue));<NEW_LINE>return configurationProperty;<NEW_LINE>}<NEW_LINE>if (isSecure) {<NEW_LINE>if (isNotBlank(encryptedValue)) {<NEW_LINE>configurationProperty.setEncryptedValue(new EncryptedConfigurationValue(encryptedValue));<NEW_LINE>}<NEW_LINE>if (isNotBlank(value)) {<NEW_LINE>configurationProperty.setEncryptedValue(new EncryptedConfigurationValue(encrypt(value)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isNotBlank(encryptedValue)) {<NEW_LINE>configurationProperty.addError("encryptedValue", "encrypted_value cannot be specified to a unsecured property.");<NEW_LINE>configurationProperty.setEncryptedValue(new EncryptedConfigurationValue(encryptedValue));<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>configurationProperty.setConfigurationValue(new ConfigurationValue(value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isNotBlank(configurationProperty.getEncryptedValue())) {<NEW_LINE>configurationProperty.setEncryptedValue(new EncryptedConfigurationValue(configurationProperty.getEncryptedValue()));<NEW_LINE>}<NEW_LINE>return configurationProperty;<NEW_LINE>} | configurationProperty.addError("configurationValue", "You may only specify `value` or `encrypted_value`, not both!"); |
534,690 | public void mapOverShards(final Bundle<F>[] bundles) {<NEW_LINE>final LinkedList<Split> splits;<NEW_LINE>{<NEW_LINE>final byte[][] keys = new byte[bundles.length][];<NEW_LINE>for (int i = 0; i < bundles.length; i++) {<NEW_LINE>keys[i] = bundles[i].fromKey;<NEW_LINE>}<NEW_LINE>splits = splitter.splitKeys(op.timestamp, 0, /* fromIndex */<NEW_LINE>bundles.length, /* toIndex */<NEW_LINE>keys);<NEW_LINE>}<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("nsplits=" + splits.size() + ", pred=" + op.pred);<NEW_LINE>for (Split split : splits) {<NEW_LINE>// Note: pmd is a PartitionLocator, so this cast is valid.<NEW_LINE>final IBuffer<IBindingSet[]> sink = op.getBuffer((PartitionLocator) split.pmd);<NEW_LINE>final IBindingSet[] slice <MASK><NEW_LINE>for (int j = 0, i = split.fromIndex; i < split.toIndex; i++, j++) {<NEW_LINE>final IBindingSet bset = bundles[i].bindingSet;<NEW_LINE>slice[j] = bset;<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("Mapping: keyOrder=" + keyOrder + ", bset=" + bset + " onto partitionId=" + split.pmd.getPartitionId());<NEW_LINE>}<NEW_LINE>sink.add(slice);<NEW_LINE>}<NEW_LINE>} | = new IBindingSet[split.ntuples]; |
1,521,785 | public void launch(GhidraApplicationLayout layout, String[] args) throws Exception {<NEW_LINE>Application.initializeApplication<MASK><NEW_LINE>JDialog dialog = new JDialog((Window) null, "Assembly Autocompleter Demo");<NEW_LINE>dialog.setLayout(new BorderLayout());<NEW_LINE>Box hbox = Box.createHorizontalBox();<NEW_LINE>dialog.add(hbox, BorderLayout.NORTH);<NEW_LINE>JLabel addrlabel = new GDLabel(String.format(ADDR_FORMAT, curAddr));<NEW_LINE>hbox.add(addrlabel);<NEW_LINE>AssemblyDualTextField input = new AssemblyDualTextField();<NEW_LINE>SleighLanguageProvider provider = new SleighLanguageProvider();<NEW_LINE>SleighLanguage lang = (SleighLanguage) provider.getLanguage(DEMO_LANG_ID);<NEW_LINE>curAddr = lang.getDefaultSpace().getAddress(0);<NEW_LINE>input.setLanguageLocation(lang, curAddr);<NEW_LINE>hbox.add(input.getAssemblyField());<NEW_LINE>hbox.add(input.getMnemonicField());<NEW_LINE>hbox.add(Box.createHorizontalStrut(10));<NEW_LINE>hbox.add(input.getOperandsField());<NEW_LINE>JTextArea asm = new JTextArea();<NEW_LINE>asm.setEditable(false);<NEW_LINE>asm.setLineWrap(true);<NEW_LINE>asm.setWrapStyleWord(false);<NEW_LINE>dialog.add(asm, BorderLayout.CENTER);<NEW_LINE>input.getAutocompleter().addAutocompletionListener(e -> {<NEW_LINE>if (e.getSelection() instanceof AssemblyInstruction) {<NEW_LINE>AssemblyInstruction ins = (AssemblyInstruction) e.getSelection();<NEW_LINE>String data = NumericUtilities.convertBytesToString(ins.getData());<NEW_LINE>asm.setText(asm.getText() + data);<NEW_LINE>input.clear();<NEW_LINE>curAddr = curAddr.addWrap(ins.getData().length);<NEW_LINE>input.setLanguageLocation(lang, curAddr);<NEW_LINE>addrlabel.setText(String.format(ADDR_FORMAT, curAddr));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AtomicReference<VisibilityMode> vis = new AtomicReference<>(VisibilityMode.DUAL_VISIBLE);<NEW_LINE>input.setVisible(vis.get());<NEW_LINE>KeyListener l = new KeyListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyTyped(KeyEvent e) {<NEW_LINE>// NOTHING<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>if (e.isAltDown() && e.isShiftDown() && e.getKeyChar() == KeyEvent.VK_D) {<NEW_LINE>if (vis.get() == VisibilityMode.DUAL_VISIBLE) {<NEW_LINE>vis.set(VisibilityMode.SINGLE_VISIBLE);<NEW_LINE>} else {<NEW_LINE>vis.set(VisibilityMode.DUAL_VISIBLE);<NEW_LINE>}<NEW_LINE>input.setVisible(vis.get());<NEW_LINE>dialog.validate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyReleased(KeyEvent e) {<NEW_LINE>// NOTHING<NEW_LINE>}<NEW_LINE>};<NEW_LINE>input.addKeyListener(l);<NEW_LINE>asm.setVisible(true);<NEW_LINE>dialog.setBounds(2560, 500, 400, 200);<NEW_LINE>dialog.setModal(true);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>} | (layout, new ApplicationConfiguration()); |
1,768,564 | public com.amazonaws.services.lakeformation.model.ResourceNotReadyException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lakeformation.model.ResourceNotReadyException resourceNotReadyException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 resourceNotReadyException;<NEW_LINE>} | lakeformation.model.ResourceNotReadyException(null); |
1,819,109 | public void render(PoseStack transform, int mx, int my, float partialTicks) {<NEW_LINE>if (!visible)<NEW_LINE>return;<NEW_LINE>Font fr = gui.manual.fontRenderer();<NEW_LINE>int mmY = my - this.y;<NEW_LINE>transform.pushPose();<NEW_LINE>transform.scale(textScale, textScale, textScale);<NEW_LINE>transform.translate(x / textScale, y / textScale, 0);<NEW_LINE>isHovered = mx >= x && mx < x + width && my >= y && my < y + height;<NEW_LINE>for (int i = 0; i < Math.min(perPage, headers.length); i++) {<NEW_LINE>int col = gui.manual.getTextColour();<NEW_LINE>boolean currEntryHovered = isHovered && mmY >= i * getFontHeight() && mmY < (i + 1) * getFontHeight();<NEW_LINE>if (currEntryHovered)<NEW_LINE>col = gui.manual.getHighlightColour();<NEW_LINE>if (i != 0)<NEW_LINE>transform.translate(0, getFontHeight(), 0);<NEW_LINE>int j = offset + i;<NEW_LINE>if (j > headers.length - 1)<NEW_LINE>j = headers.length - 1;<NEW_LINE>String s = headers[j];<NEW_LINE>if (isCategory[j]) {<NEW_LINE>ManualUtils.bindTexture(gui.texture);<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>RenderSystem.blendFuncSeparate(SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ONE, ZERO);<NEW_LINE>this.blit(transform, 0, 0, 11, 226 + (currEntryHovered ? 20 : 0), 5, 10);<NEW_LINE>}<NEW_LINE>fr.draw(transform, s, isCategory[j] ? <MASK><NEW_LINE>}<NEW_LINE>transform.scale(1 / textScale, 1 / textScale, 1 / textScale);<NEW_LINE>transform.popPose();<NEW_LINE>if (maxOffset > 0) {<NEW_LINE>final int minVisibleBlack = 0x1B << 24;<NEW_LINE>final int mainBarBlack = 0x28 << 24;<NEW_LINE>final float totalHeight = maxOffset * getFontHeight() + height;<NEW_LINE>final float heightTopRel = (offset * getFontHeight()) / totalHeight;<NEW_LINE>final float heightBottomRel = (offset * getFontHeight() + height) / totalHeight;<NEW_LINE>final int heightTopAbs = (int) (heightTopRel * height);<NEW_LINE>final int heightBottomAbs = (int) (heightBottomRel * height);<NEW_LINE>fill(transform, x + width, y, x + width + 8, y + height, minVisibleBlack);<NEW_LINE>fill(transform, x + width + 1, y + heightTopAbs, x + width + 7, y + heightBottomAbs, mainBarBlack);<NEW_LINE>}<NEW_LINE>} | 7 : 0, 0, col); |
1,201,101 | final public void remove() {<NEW_LINE>if (expectedModCount == backingMap.modCount) {<NEW_LINE>if (lastNode != null) {<NEW_LINE>int idx = lastOffset;<NEW_LINE>K key = null;<NEW_LINE>if (idx == lastNode.left_idx) {<NEW_LINE><MASK><NEW_LINE>} else if (idx == lastNode.right_idx) {<NEW_LINE>key = backingMap.removeRightmost(lastNode);<NEW_LINE>} else {<NEW_LINE>int lastRight = lastNode.right_idx;<NEW_LINE>key = backingMap.removeMiddleElement(node, idx);<NEW_LINE>if (null == key && lastRight > lastNode.right_idx) {<NEW_LINE>// removed from right<NEW_LINE>offset--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != key) {<NEW_LINE>// the node has been cleared, need to find new node<NEW_LINE>Entry<K, V> entry = backingMap.find(key);<NEW_LINE>node = entry.node;<NEW_LINE>offset = entry.index;<NEW_LINE>}<NEW_LINE>lastNode = null;<NEW_LINE>expectedModCount++;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ConcurrentModificationException();<NEW_LINE>}<NEW_LINE>} | key = backingMap.removeLeftmost(lastNode); |
1,754,200 | public double continueToMargin(double[] origin, double[] delta) {<NEW_LINE>assert (delta.length == <MASK><NEW_LINE>double factor = Double.POSITIVE_INFINITY;<NEW_LINE>if (delta[0] > 0) {<NEW_LINE>factor = Math.min(factor, (maxx - origin[0]) / delta[0]);<NEW_LINE>} else if (delta[0] < 0) {<NEW_LINE>factor = Math.min(factor, (origin[0] - minx) / -delta[0]);<NEW_LINE>}<NEW_LINE>if (delta[1] > 0) {<NEW_LINE>factor = Math.min(factor, (maxy - origin[1]) / delta[1]);<NEW_LINE>} else if (delta[1] < 0) {<NEW_LINE>factor = Math.min(factor, (origin[1] - miny) / -delta[1]);<NEW_LINE>}<NEW_LINE>return factor;<NEW_LINE>} | 2 && origin.length == 2); |
1,766,709 | private void forgeImpl$useWorldSaveDirectoryforMods(final CallbackInfoReturnable<File> cir) {<NEW_LINE>final ModContainer activeContainer = Loader.instance().activeModContainer();<NEW_LINE>// Since Forge uses a single save handler mods will expect this method to return overworld's world directory<NEW_LINE>// Fixes mods such as ComputerCraft and FuturePack<NEW_LINE>if ((activeContainer != null && activeContainer != SpongeMod.instance && !(activeContainer instanceof PluginContainerExtension))) {<NEW_LINE>if (this.forgeImpl$modWorldDirectory != null) {<NEW_LINE>cir.setReturnValue(this.forgeImpl$modWorldDirectory);<NEW_LINE>} else {<NEW_LINE>final String defaultWorldName = Sponge.getServer().getDefaultWorldName();<NEW_LINE>final String defaultWorldPath = Sponge.getPlatform().getType().isClient() ? "saves" + File.separator + defaultWorldName : defaultWorldName;<NEW_LINE>this.forgeImpl$modWorldDirectory = SpongeImpl.getGameDir().resolve(defaultWorldPath).toFile();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | cir.setReturnValue(this.forgeImpl$modWorldDirectory); |
1,328,738 | public static DigestBlob resumeTransfer(BlobContainer blobContainer, String digest, UUID transferId, long currentPos) {<NEW_LINE>DigestBlob digestBlob = new DigestBlob(blobContainer, digest, transferId);<NEW_LINE>digestBlob.file = getTmpFilePath(blobContainer, <MASK><NEW_LINE>try {<NEW_LINE>LOGGER.trace("Resuming DigestBlob {}. CurrentPos {}", digest, currentPos);<NEW_LINE>digestBlob.headFileChannel = new FileOutputStream(digestBlob.file, false).getChannel();<NEW_LINE>digestBlob.headLength = currentPos;<NEW_LINE>digestBlob.headSize = new AtomicLong();<NEW_LINE>digestBlob.headCatchedUpLatch = new CountDownLatch(1);<NEW_LINE>RandomAccessFile raf = new RandomAccessFile(digestBlob.file, "rw");<NEW_LINE>raf.setLength(currentPos);<NEW_LINE>raf.close();<NEW_LINE>FileOutputStream outputStream = new FileOutputStream(digestBlob.file, true);<NEW_LINE>digestBlob.fileChannel = outputStream.getChannel();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.error("error resuming transfer of {}, id: {}", ex, digest, transferId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return digestBlob;<NEW_LINE>} | digest, transferId).toFile(); |
295,558 | public DescribeOrganizationConfigurationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeOrganizationConfigurationResult describeOrganizationConfigurationResult = new DescribeOrganizationConfigurationResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeOrganizationConfigurationResult;<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("autoEnable", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeOrganizationConfigurationResult.setAutoEnable(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("memberAccountLimitReached", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeOrganizationConfigurationResult.setMemberAccountLimitReached(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("dataSources", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeOrganizationConfigurationResult.setDataSources(OrganizationDataSourceConfigurationsResultJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeOrganizationConfigurationResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
158,307 | private int findAudioData(String dataName, DataType dt, byte[] pattern, byte[] mask) {<NEW_LINE>println("Looking for " + dataName + "'s in " + currentProgram.getName());<NEW_LINE>int numDataFound = 0;<NEW_LINE>List<Address> foundList = scanForAudioData(pattern, mask);<NEW_LINE>// Loop over all potential found WAVs<NEW_LINE>for (int i = 0; i < foundList.size(); i++) {<NEW_LINE>boolean foundData = false;<NEW_LINE>// See if already applied WAV<NEW_LINE>Data data = getDataAt(foundList.get(i));<NEW_LINE>// If not already applied, try to apply WAV data type<NEW_LINE>if (data == null) {<NEW_LINE>println("Trying to apply " + dataName + " datatype at " + foundList.get<MASK><NEW_LINE>try {<NEW_LINE>Data newData = createData(foundList.get(i), dt);<NEW_LINE>if (newData != null) {<NEW_LINE>println("Applied WAV at " + newData.getAddressString(false, true));<NEW_LINE>foundData = true;<NEW_LINE>}<NEW_LINE>}// If data does not apply correctly then it is not really that kind of data<NEW_LINE>// Or it is bumping into other data<NEW_LINE>catch (Exception e) {<NEW_LINE>println("Invalid " + dataName + " at " + foundList.get(i).toString());<NEW_LINE>}<NEW_LINE>} else if (data.getMnemonicString().equals(dataName)) {<NEW_LINE>println(dataName + " already applied at " + data.getAddressString(false, true));<NEW_LINE>foundData = true;<NEW_LINE>}<NEW_LINE>// print found message only for those that apply correctly or were already applied<NEW_LINE>if (foundData) {<NEW_LINE>println("Found " + dataName + " in program " + currentProgram.getExecutablePath() + " at address " + foundList.get(i).toString());<NEW_LINE>numDataFound++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return numDataFound;<NEW_LINE>} | (i).toString()); |
174,981 | private void migrationOperationFailed(Member partitionOwner) {<NEW_LINE>migration.setStatus(MigrationStatus.FAILED);<NEW_LINE>migrationInterceptor.onMigrationComplete(<MASK><NEW_LINE>partitionServiceLock.lock();<NEW_LINE>try {<NEW_LINE>migrationInterceptor.onMigrationRollback(MigrationParticipant.MASTER, migration);<NEW_LINE>scheduleActiveMigrationFinalization(migration);<NEW_LINE>int delta = migration.getPartitionVersionIncrement() + 1;<NEW_LINE>partitionStateManager.incrementPartitionVersion(migration.getPartitionId(), delta);<NEW_LINE>migration.setPartitionVersionIncrement(delta);<NEW_LINE>node.getNodeExtension().onPartitionStateChange();<NEW_LINE>addCompletedMigration(migration);<NEW_LINE>if (!partitionOwner.localMember()) {<NEW_LINE>partitionService.sendPartitionRuntimeState(partitionOwner.getAddress());<NEW_LINE>}<NEW_LINE>if (!migration.getDestination().isIdentical(node.getLocalMember())) {<NEW_LINE>partitionService.sendPartitionRuntimeState(migration.getDestination().address());<NEW_LINE>}<NEW_LINE>triggerRepartitioningAfterMigrationFailure();<NEW_LINE>} finally {<NEW_LINE>partitionServiceLock.unlock();<NEW_LINE>}<NEW_LINE>} | MigrationParticipant.MASTER, migration, false); |
30,488 | public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) {<NEW_LINE>if ((boolean) context.getData(DISABLE_TRACING_KEY).orElse(false)) {<NEW_LINE>return next.process();<NEW_LINE>}<NEW_LINE>Span parentSpan = (Span) context.getData(PARENT_TRACE_CONTEXT_KEY).orElse(tracer.currentSpan());<NEW_LINE>HttpRequest request = context.getHttpRequest();<NEW_LINE>// Build new child span representing this outgoing request.<NEW_LINE>final UrlBuilder urlBuilder = UrlBuilder.parse(context.getHttpRequest().getUrl());<NEW_LINE>Span.Builder spanBuilder = tracer.spanBuilder().name(urlBuilder.getPath());<NEW_LINE>if (parentSpan != null) {<NEW_LINE>spanBuilder.setParent(parentSpan.context());<NEW_LINE>}<NEW_LINE>// A span's kind can be SERVER (incoming request) or CLIENT (outgoing request);<NEW_LINE>spanBuilder.<MASK><NEW_LINE>// Starting the span makes the sampling decision (nothing is logged at this time)<NEW_LINE>Span span = spanBuilder.start();<NEW_LINE>// If span is sampled in, add additional TRACING attributes<NEW_LINE>if (!span.isNoop()) {<NEW_LINE>// Adds HTTP method, URL, & user-agent<NEW_LINE>addSpanRequestAttributes(span, request, context);<NEW_LINE>}<NEW_LINE>// run the next policy and handle success and error<NEW_LINE>return next.process().doOnEach(SleuthHttpPolicy::handleResponse).contextWrite(Context.of("TRACING_SPAN", span));<NEW_LINE>} | kind(Span.Kind.CLIENT); |
128,519 | public Flux<NewAction> findUnpublishedActionsForRestApiOnLoad(Set<String> names, String pageId, String httpMethod, Boolean userSetOnLoad, AclPermission aclPermission) {<NEW_LINE>Criteria namesCriteria = where(fieldName(QNewAction.newAction.unpublishedAction) + "." + fieldName(QNewAction.newAction.unpublishedAction.name)).in(names);<NEW_LINE>Criteria pageCriteria = where(fieldName(QNewAction.newAction.unpublishedAction) + "." + fieldName(QNewAction.newAction.unpublishedAction.pageId)).is(pageId);<NEW_LINE>Criteria userSetOnLoadCriteria = where(fieldName(QNewAction.newAction.unpublishedAction) + "." + fieldName(QNewAction.newAction.unpublishedAction.<MASK><NEW_LINE>String httpMethodQueryKey = fieldName(QNewAction.newAction.unpublishedAction) + "." + fieldName(QNewAction.newAction.unpublishedAction.actionConfiguration) + "." + fieldName(QActionConfiguration.actionConfiguration.httpMethod);<NEW_LINE>Criteria httpMethodCriteria = where(httpMethodQueryKey).is(httpMethod);<NEW_LINE>List<Criteria> criterias = List.of(namesCriteria, pageCriteria, httpMethodCriteria, userSetOnLoadCriteria);<NEW_LINE>return queryAll(criterias, aclPermission);<NEW_LINE>} | userSetOnLoad)).is(userSetOnLoad); |
606,814 | public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {<NEW_LINE>// Allow the JDK to do whatever it wants (unit tests, etc.)<NEW_LINE>if (JAVA_MATCHER.matches(tree, state)) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>// Get the receiver of the method invocation and make sure it's not null<NEW_LINE>Type receiverType = ASTHelpers.getReceiverType(tree);<NEW_LINE>if (receiverType == null) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>// If the receiver is not one of our java.time types, then return early<NEW_LINE>JavaTimeType type = APIS.get(receiverType.toString());<NEW_LINE>if (type == null) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>// Otherwise, check the method matchers we have for that type<NEW_LINE>for (MatcherWithUnits matcherWithUnits : type.methods()) {<NEW_LINE>if (matcherWithUnits.matcher().matches(tree, state)) {<NEW_LINE>List<? extends ExpressionTree> arguments = tree.getArguments();<NEW_LINE>for (int i = 0; i < arguments.size(); i++) {<NEW_LINE>ExpressionTree argument = arguments.get(i);<NEW_LINE>Number constant = ASTHelpers.<MASK><NEW_LINE>if (constant != null) {<NEW_LINE>try {<NEW_LINE>matcherWithUnits.units().get(i).checkValidValue(constant.longValue());<NEW_LINE>} catch (DateTimeException invalid) {<NEW_LINE>return buildDescription(argument).setMessage(invalid.getMessage()).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we short-circuit the loop here; only 1 method matcher will ever match, so there's no<NEW_LINE>// sense in checking the rest of them<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>} | constValue(argument, Number.class); |
1,758,835 | public void update(@ApiParam(value = "Environment name", required = true) @PathParam("envName") String envName, @ApiParam(value = "Stage name", required = true) @PathParam("stageName") String stageName, @ApiParam(value = "List of MetricsConfigBean objects", required = true) @Valid List<MetricsConfigBean> metrics, @Context SecurityContext sc) throws Exception {<NEW_LINE>EnvironBean environBean = Utils.getEnvStage(environDAO, envName, stageName);<NEW_LINE>authorizer.authorize(sc, new Resource(environBean.getEnv_name(), Resource.Type<MASK><NEW_LINE>String userName = sc.getUserPrincipal().getName();<NEW_LINE>environHandler.updateMetrics(environBean, metrics, userName);<NEW_LINE>configHistoryHandler.updateConfigHistory(environBean.getEnv_id(), Constants.TYPE_ENV_METRIC, metrics, userName);<NEW_LINE>configHistoryHandler.updateChangeFeed(Constants.CONFIG_TYPE_ENV, environBean.getEnv_id(), Constants.TYPE_ENV_METRIC, userName);<NEW_LINE>LOG.info("Successfully updated metrics {} for env {}/{} by {}.", metrics, envName, stageName, userName);<NEW_LINE>} | .ENV), Role.OPERATOR); |
558,986 | private List<AtomicUpdateGroup<T>> findLatestFullyAvailableOvershadowedAtomicUpdateGroups(RootPartitionRange rangeOfAug, short minorVersion) {<NEW_LINE>final List<AtomicUpdateGroup<T>> overshadowedGroups = findOvershadowedBy(rangeOfAug, minorVersion, State.OVERSHADOWED);<NEW_LINE>// Filter out non-fully available groups.<NEW_LINE>final TreeMap<RootPartitionRange, AtomicUpdateGroup<T>> fullGroups = new TreeMap<>();<NEW_LINE>for (AtomicUpdateGroup<T> group : FluentIterable.from(overshadowedGroups).filter(AtomicUpdateGroup::isFull)) {<NEW_LINE>fullGroups.put(RootPartitionRange.of(group), group);<NEW_LINE>}<NEW_LINE>if (fullGroups.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (fullGroups.firstKey().startPartitionId != rangeOfAug.startPartitionId || fullGroups.lastKey().endPartitionId != rangeOfAug.endPartitionId) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// Find latest fully available groups.<NEW_LINE>final List<AtomicUpdateGroup<T>> visibles = new ArrayList<>();<NEW_LINE>// fullGroups is sorted by RootPartitionRange which means, the groups of the wider range will appear later<NEW_LINE>// in the fullGroups map. Since the wider groups have higer minor versions than narrower groups,<NEW_LINE>// we iterate the fullGroups from the last entry in descending order.<NEW_LINE>Entry<RootPartitionRange, AtomicUpdateGroup<T><MASK><NEW_LINE>while (currEntry != null) {<NEW_LINE>final Entry<RootPartitionRange, AtomicUpdateGroup<T>> lowerEntry = fullGroups.lowerEntry(currEntry.getKey());<NEW_LINE>if (lowerEntry != null) {<NEW_LINE>if (lowerEntry.getKey().endPartitionId != currEntry.getKey().startPartitionId) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visibles.add(currEntry.getValue());<NEW_LINE>currEntry = lowerEntry;<NEW_LINE>}<NEW_LINE>// visibles should be sorted.<NEW_LINE>visibles.sort(Comparator.comparing(RootPartitionRange::of));<NEW_LINE>return visibles;<NEW_LINE>} | > currEntry = fullGroups.lastEntry(); |
447,508 | public void populateItem(final Item<RepositoryCommit> commitItem) {<NEW_LINE>final <MASK><NEW_LINE>// author gravatar<NEW_LINE>commitItem.add(new AvatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));<NEW_LINE>// merge icon<NEW_LINE>if (commit.getParentCount() > 1) {<NEW_LINE>commitItem.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));<NEW_LINE>} else {<NEW_LINE>commitItem.add(WicketUtils.newBlankImage("commitIcon"));<NEW_LINE>}<NEW_LINE>// short message<NEW_LINE>String shortMessage = commit.getShortMessage();<NEW_LINE>String trimmedMessage = shortMessage;<NEW_LINE>if (commit.getRefs() != null && commit.getRefs().size() > 0) {<NEW_LINE>trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG_REFS);<NEW_LINE>} else {<NEW_LINE>trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG);<NEW_LINE>}<NEW_LINE>LinkPanel shortlog = new LinkPanel("commitShortMessage", "list", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(change.repository, commit.getName()));<NEW_LINE>if (!shortMessage.equals(trimmedMessage)) {<NEW_LINE>WicketUtils.setHtmlTooltip(shortlog, shortMessage);<NEW_LINE>}<NEW_LINE>commitItem.add(shortlog);<NEW_LINE>// commit hash link<NEW_LINE>int hashLen = app().settings().getInteger(Keys.web.shortCommitIdLength, 6);<NEW_LINE>LinkPanel commitHash = new LinkPanel("hashLink", null, commit.getName().substring(0, hashLen), CommitPage.class, WicketUtils.newObjectParameter(change.repository, commit.getName()));<NEW_LINE>WicketUtils.setCssClass(commitHash, "shortsha1");<NEW_LINE>WicketUtils.setHtmlTooltip(commitHash, commit.getName());<NEW_LINE>commitItem.add(commitHash);<NEW_LINE>} | RepositoryCommit commit = commitItem.getModelObject(); |
1,219,479 | protected void uninstallBundle(BundleContext bundleContext, String addonId) throws MarketplaceHandlerException {<NEW_LINE>try {<NEW_LINE>Path addonPath = getAddonCacheDirectory(addonId);<NEW_LINE>if (Files.isDirectory(addonPath)) {<NEW_LINE>for (Path bundleFile : Files.list(addonPath).collect(Collectors.toList())) {<NEW_LINE>Files.delete(bundleFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Files.delete(addonPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MarketplaceHandlerException("Failed to delete bundle-files: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (isBundleInstalled(bundleContext, addonId)) {<NEW_LINE>Bundle <MASK><NEW_LINE>try {<NEW_LINE>bundle.stop();<NEW_LINE>bundle.uninstall();<NEW_LINE>} catch (BundleException e) {<NEW_LINE>throw new MarketplaceHandlerException("Failed uninstalling bundle: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | bundle = bundleContext.getBundle(addonId); |
38,964 | public static boolean filterCheck(SearchSubsResultBase ds, String filter, boolean regex) {<NEW_LINE>if (filter == null || filter.length() == 0) {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean hash_filter = filter.startsWith("t:");<NEW_LINE>if (hash_filter) {<NEW_LINE>filter = filter.substring(2);<NEW_LINE>}<NEW_LINE>String s = regex ? filter : RegExUtil.splitAndQuote(filter, "\\s*[|;]\\s*");<NEW_LINE>boolean match_result = true;<NEW_LINE>if (regex && s.startsWith("!")) {<NEW_LINE>s = s.substring(1);<NEW_LINE>match_result = false;<NEW_LINE>}<NEW_LINE>Pattern pattern = Pattern.compile(s, <MASK><NEW_LINE>if (hash_filter) {<NEW_LINE>byte[] hash = ds.getHash();<NEW_LINE>if (hash == null) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>String[] names = { ByteFormatter.encodeString(hash), Base32.encode(hash) };<NEW_LINE>for (String name : names) {<NEW_LINE>if (pattern.matcher(name).find() == match_result) {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (false);<NEW_LINE>} else {<NEW_LINE>String name = ds.getName();<NEW_LINE>return (pattern.matcher(name).find() == match_result);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); |
570,172 | public void formatStatusIcon(ImageView statusIcon) {<NEW_LINE>// Note: order is important!<NEW_LINE>if (keyInfo.is_revoked()) {<NEW_LINE>KeyFormattingUtils.setStatusImage(context, statusIcon, null, KeyFormattingUtils.State.REVOKED, R.color.key_flag_gray);<NEW_LINE>statusIcon.setVisibility(View.VISIBLE);<NEW_LINE>} else if (keyInfo.is_expired()) {<NEW_LINE>KeyFormattingUtils.setStatusImage(context, statusIcon, null, KeyFormattingUtils.State.EXPIRED, R.color.key_flag_gray);<NEW_LINE>statusIcon.setVisibility(View.VISIBLE);<NEW_LINE>} else if (!keyInfo.is_secure()) {<NEW_LINE>KeyFormattingUtils.setStatusImage(context, statusIcon, null, KeyFormattingUtils.State.<MASK><NEW_LINE>statusIcon.setVisibility(View.VISIBLE);<NEW_LINE>} else if (keyInfo.has_any_secret()) {<NEW_LINE>statusIcon.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>// this is a public key - show if it's verified<NEW_LINE>if (keyInfo.is_verified()) {<NEW_LINE>KeyFormattingUtils.setStatusImage(context, statusIcon, KeyFormattingUtils.State.VERIFIED);<NEW_LINE>statusIcon.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>statusIcon.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | INSECURE, R.color.key_flag_gray); |
25,729 | public void outputAccumulators(FinishBundleContext context) {<NEW_LINE>// Establish immutable non-null handles to demonstrate that calling other<NEW_LINE>// methods cannot make them null<NEW_LINE>final Map<WindowedStructuralKey<K><MASK><NEW_LINE>final Map<WindowedStructuralKey<K>, Instant> timestamps = this.timestamps;<NEW_LINE>for (Map.Entry<WindowedStructuralKey<K>, Instant> timestampEntry : timestamps.entrySet()) {<NEW_LINE>WindowedStructuralKey<K> key = timestampEntry.getKey();<NEW_LINE>Instant timestamp = timestampEntry.getValue();<NEW_LINE>// Note that preCombineAccum may be null because no data arrives, or may be null because<NEW_LINE>// the accumulator type allows null. For this reason, we must iterate the timestamp entrySet<NEW_LINE>AccumT preCombineAccum = accumulators.get(key);<NEW_LINE>context.output(KV.of(key.getKey(), combineFn.compact(preCombineAccum)), timestamp, key.getWindow());<NEW_LINE>}<NEW_LINE>this.accumulators = null;<NEW_LINE>this.timestamps = null;<NEW_LINE>} | , AccumT> accumulators = this.accumulators; |
806,630 | private boolean isServiceVulnerable(NetworkService networkService) {<NEW_LINE>String targetUri = NetworkServiceUtils.buildWebApplicationRootUrl(networkService);<NEW_LINE>targetUri = targetUri + VULNERABLE_ENDPOINT;<NEW_LINE>HttpResponse response;<NEW_LINE>String csrfToken = "";<NEW_LINE>// Request 1: plain GET request to create a session and retrieve the session cookie and csrf.<NEW_LINE>logger.atInfo(<MASK><NEW_LINE>try {<NEW_LINE>response = httpClient.send(get(targetUri).withEmptyHeaders().build(), networkService);<NEW_LINE>csrfToken = getCSRFToken(response);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.atWarning().withCause(e).log("Unable to query '%s'.", targetUri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Parse the cookie values.<NEW_LINE>ImmutableList<String> cookies = parseCookies(response);<NEW_LINE>if (cookies.isEmpty()) {<NEW_LINE>logger.atInfo().log("No Set-Cookie header in the HTTP response.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Request 2: pass the PHP object injection payload in the password field as HTTP POST.<NEW_LINE>logger.atInfo().log("Sending Joomla Rusty RCE payload to target '%s'.", targetUri);<NEW_LINE>try {<NEW_LINE>String printPayload = buildPrintPayload(TEST_STRING);<NEW_LINE>response = executeHttpRequestWithPayload(networkService, targetUri, cookies, printPayload, csrfToken);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.atWarning().withCause(e).log("Unable to query '%s'.", targetUri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check if the concatenated string is echoed back.<NEW_LINE>return response.bodyString().map(body -> body.contains(TEST_STRING)).orElse(false);<NEW_LINE>} | ).log("Creating a new Joomla session on target '%s'.", targetUri); |
1,830,865 | public static ClusterState resolveTemporaryState(final String matchingTemplate, final String indexName, final ClusterState simulatedState) {<NEW_LINE>Settings settings = resolveSettings(<MASK><NEW_LINE>// create the index with dummy settings in the cluster state so we can parse and validate the aliases<NEW_LINE>Settings dummySettings = Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT).put(settings).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_INDEX_UUID, UUIDs.randomBase64UUID()).build();<NEW_LINE>final IndexMetadata indexMetadata = IndexMetadata.builder(indexName).settings(dummySettings).build();<NEW_LINE>return ClusterState.builder(simulatedState).metadata(Metadata.builder(simulatedState.metadata()).put(indexMetadata, true).build()).build();<NEW_LINE>} | simulatedState.metadata(), matchingTemplate); |
873,231 | public void drawTransform(Transform xf) {<NEW_LINE>GraphicsContext g = getGraphics();<NEW_LINE>getWorldToScreenToOut(xf.p, temp);<NEW_LINE>temp2.setZero();<NEW_LINE>float k_axisScale = 0.4f;<NEW_LINE>Color c = cpool.<MASK><NEW_LINE>g.setStroke(c);<NEW_LINE>temp2.x = xf.p.x + k_axisScale * xf.q.c;<NEW_LINE>temp2.y = xf.p.y + k_axisScale * xf.q.s;<NEW_LINE>getWorldToScreenToOut(temp2, temp2);<NEW_LINE>g.strokeLine(temp.x, temp.y, temp2.x, temp2.y);<NEW_LINE>c = cpool.getColor(0, 1, 0);<NEW_LINE>g.setStroke(c);<NEW_LINE>temp2.x = xf.p.x + -k_axisScale * xf.q.s;<NEW_LINE>temp2.y = xf.p.y + k_axisScale * xf.q.c;<NEW_LINE>getWorldToScreenToOut(temp2, temp2);<NEW_LINE>g.strokeLine(temp.x, temp.y, temp2.x, temp2.y);<NEW_LINE>} | getColor(1, 0, 0); |
1,211,434 | public void bridgeStatusChanged(final ThingStatusInfo bridgeStatusInfo) {<NEW_LINE>logger.debug("DEV {}: Controller status is {}", unitId, bridgeStatusInfo.getStatus());<NEW_LINE>if (bridgeStatusInfo.getStatus() != ThingStatus.ONLINE) {<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, Constants.OFFLINE_CTLR_OFFLINE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("DEV {}: Controller is ONLINE. Starting device initialisation.", unitId);<NEW_LINE>final Bridge bridge = getBridge();<NEW_LINE>if (bridge == null) {<NEW_LINE>logger.debug("DEV {}: bridge is null!", unitId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PIMHandler bridgeHandler = (PIMHandler) bridge.getHandler();<NEW_LINE>if (bridgeHandler == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateDeviceStatus(bridgeHandler);<NEW_LINE>pingDevice();<NEW_LINE>} | logger.debug("DEV {}: bridge handler is null!", unitId); |
11,630 | public void updateFlow(final Project project, final int version, final Flow flow) throws ProjectManagerException {<NEW_LINE>logger.info("Uploading flow " + flow.getId());<NEW_LINE>try {<NEW_LINE>final String json = JSONUtils.toJSON(flow.toObject());<NEW_LINE>final byte[] data = convertJsonToBytes(this.defaultEncodingType, json);<NEW_LINE>logger.info("Flow upload " + flow.getId() + " is byte size " + data.length);<NEW_LINE>final String UPDATE_FLOW = "UPDATE project_flows SET encoding_type=?,json=? WHERE project_id=? AND version=? AND flow_id=?";<NEW_LINE>try {<NEW_LINE>this.dbOperator.update(UPDATE_FLOW, this.defaultEncodingType.getNumVal(), data, project.getId(), version, flow.getId());<NEW_LINE>} catch (final SQLException e) {<NEW_LINE><MASK><NEW_LINE>throw new ProjectManagerException("Error inserting flow " + flow.getId(), e);<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new ProjectManagerException("Flow Upload failed.", e);<NEW_LINE>}<NEW_LINE>} | logger.error("Error inserting flow", e); |
390,076 | // -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public FunctionRequirements requirements(CmsTrade trade, Set<Measure> measures, CalculationParameters parameters, ReferenceData refData) {<NEW_LINE>// extract data from product<NEW_LINE>Cms product = trade.getProduct();<NEW_LINE>Set<Currency> currencies = product.allPaymentCurrencies();<NEW_LINE>RateIndex cmsIndex = trade.getProduct().getCmsLeg().getUnderlyingIndex();<NEW_LINE>Set<Index> payIndices = trade.getProduct().allRateIndices();<NEW_LINE>Set<Index> indices = ImmutableSet.<Index>builder().add(cmsIndex).<MASK><NEW_LINE>// use lookup to build requirements<NEW_LINE>RatesMarketDataLookup ratesLookup = parameters.getParameter(RatesMarketDataLookup.class);<NEW_LINE>FunctionRequirements ratesReqs = ratesLookup.requirements(currencies, indices);<NEW_LINE>SwaptionMarketDataLookup swaptionLookup = parameters.getParameter(SwaptionMarketDataLookup.class);<NEW_LINE>FunctionRequirements swaptionReqs = swaptionLookup.requirements(cmsIndex);<NEW_LINE>return ratesReqs.combinedWith(swaptionReqs);<NEW_LINE>} | addAll(payIndices).build(); |
185,740 | public void prepare(PrepareJobRequest request, StreamObserver<PrepareJobResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>LOG.trace("{} {}", PrepareJobRequest.class.getSimpleName(), request);<NEW_LINE>// insert preparation<NEW_LINE>String preparationId = String.format("%s_%s", request.getJobName(), UUID.<MASK><NEW_LINE>Struct pipelineOptions = request.getPipelineOptions();<NEW_LINE>if (pipelineOptions == null) {<NEW_LINE>throw new NullPointerException("Encountered null pipeline options.");<NEW_LINE>}<NEW_LINE>LOG.trace("PIPELINE OPTIONS {} {}", pipelineOptions.getClass(), pipelineOptions);<NEW_LINE>JobPreparation preparation = JobPreparation.builder().setId(preparationId).setPipeline(request.getPipeline()).setOptions(pipelineOptions).build();<NEW_LINE>JobPreparation previous = preparations.putIfAbsent(preparationId, preparation);<NEW_LINE>if (previous != null) {<NEW_LINE>// this should never happen with a UUID<NEW_LINE>String errMessage = String.format("A job with the preparation ID \"%s\" already exists.", preparationId);<NEW_LINE>StatusException exception = Status.NOT_FOUND.withDescription(errMessage).asException();<NEW_LINE>responseObserver.onError(exception);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String stagingSessionToken = stagingServiceTokenProvider.apply(preparationId);<NEW_LINE>stagingSessionTokens.putIfAbsent(preparationId, stagingSessionToken);<NEW_LINE>stagingService.getService().registerJob(stagingSessionToken, Maps.transformValues(request.getPipeline().getComponents().getEnvironmentsMap(), RunnerApi.Environment::getDependenciesList));<NEW_LINE>// send response<NEW_LINE>PrepareJobResponse response = PrepareJobResponse.newBuilder().setPreparationId(preparationId).setArtifactStagingEndpoint(stagingServiceDescriptor).setStagingSessionToken(stagingSessionToken).build();<NEW_LINE>responseObserver.onNext(response);<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Could not prepare job with name {}", request.getJobName(), e);<NEW_LINE>responseObserver.onError(Status.INTERNAL.withCause(e).asException());<NEW_LINE>}<NEW_LINE>} | randomUUID().toString()); |
801,825 | private BLangConstantValue evaluateUnaryOperator(BLangConstantValue value, OperatorKind kind) {<NEW_LINE>if (value == null || value.value == null) {<NEW_LINE>// This is a compilation error.<NEW_LINE>// This is to avoid NPE exceptions in sub-sequent validations.<NEW_LINE>return new BLangConstantValue(null, this.currentConstSymbol.type);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>switch(kind) {<NEW_LINE>case ADD:<NEW_LINE>return new BLangConstantValue(<MASK><NEW_LINE>case SUB:<NEW_LINE>return calculateNegation(value);<NEW_LINE>case BITWISE_COMPLEMENT:<NEW_LINE>return calculateBitWiseComplement(value);<NEW_LINE>case NOT:<NEW_LINE>return calculateBooleanComplement(value);<NEW_LINE>}<NEW_LINE>} catch (ClassCastException ce) {<NEW_LINE>// Ignore. This will be handled as a compiler error.<NEW_LINE>}<NEW_LINE>// This is a compilation error already logged.<NEW_LINE>// This is to avoid NPE exceptions in sub-sequent validations.<NEW_LINE>return new BLangConstantValue(null, this.currentConstSymbol.type);<NEW_LINE>} | value.value, currentConstSymbol.type); |
1,596,460 | private // parent class types.<NEW_LINE>String generateFileName() {<NEW_LINE>int checksum = 1;<NEW_LINE>Set<TypeId<?><MASK><NEW_LINE>Iterator<TypeId<?>> it = typesKeySet.iterator();<NEW_LINE>int[] checksums = new int[typesKeySet.size()];<NEW_LINE>int i = 0;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>TypeId<?> typeId = it.next();<NEW_LINE>TypeDeclaration decl = getTypeDeclaration(typeId);<NEW_LINE>Set<MethodId> methodSet = decl.methods.keySet();<NEW_LINE>if (decl.supertype != null) {<NEW_LINE>int sum = 31 * decl.supertype.hashCode() + decl.interfaces.hashCode();<NEW_LINE>checksums[i++] = 31 * sum + methodSet.hashCode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Arrays.sort(checksums);<NEW_LINE>for (int sum : checksums) {<NEW_LINE>checksum *= 31;<NEW_LINE>checksum += sum;<NEW_LINE>}<NEW_LINE>return "Generated_" + checksum + ".jar";<NEW_LINE>} | > typesKeySet = types.keySet(); |
638,269 | private void loadPropertiesConfiguration() {<NEW_LINE>// Initial configuration is seeded with any global configuration<NEW_LINE>configuration = new Properties(GlobalConfiguration.globalConfigurationProperties);<NEW_LINE>try {<NEW_LINE>Set<String> configurationFiles = new HashSet<String>();<NEW_LINE>ClassLoader classloader = classLoader.get();<NEW_LINE>Enumeration<URL> resources = classloader == null ? null : classloader.getResources("springloaded.properties");<NEW_LINE>if (resources == null) {<NEW_LINE>if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) {<NEW_LINE>log.info("Unable to load springloaded.properties, cannot find it through classloader " + classloader);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (resources.hasMoreElements()) {<NEW_LINE><MASK><NEW_LINE>String configFile = url.toString();<NEW_LINE>if (GlobalConfiguration.logging && log.isLoggable(Level.INFO)) {<NEW_LINE>log.log(Level.INFO, this.toString() + ": processing config file: " + url.toString());<NEW_LINE>}<NEW_LINE>if (configurationFiles.contains(configFile)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>configurationFiles.add(configFile);<NEW_LINE>InputStream is = url.openStream();<NEW_LINE>Properties p = new Properties();<NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>Set<String> keys = p.stringPropertyNames();<NEW_LINE>for (String key : keys) {<NEW_LINE>if (!configuration.containsKey(key)) {<NEW_LINE>configuration.put(key, p.getProperty(key));<NEW_LINE>} else {<NEW_LINE>// Extend our configuration<NEW_LINE>String valueSoFar = configuration.getProperty(key);<NEW_LINE>StringBuilder sb = new StringBuilder(valueSoFar);<NEW_LINE>sb.append(",");<NEW_LINE>sb.append(p.getProperty(key));<NEW_LINE>configuration.put(key, sb.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ReloadException("loadPropertiesConfiguration: Problem accessing springloaded.properties file resources", e);<NEW_LINE>}<NEW_LINE>// if (GlobalConfiguration.logging && log.isLoggable(Level.INFO)) {<NEW_LINE>// System.err.println("ee00");<NEW_LINE>// Set<String> configurationPropertyNames = configuration.stringPropertyNames();<NEW_LINE>// System.err.println("eeAA");<NEW_LINE>// if (configurationPropertyNames.isEmpty()) {<NEW_LINE>// System.err.println("eeBB");<NEW_LINE>// log.log(Level.INFO, "configuration:" + this + ": empty configuration");<NEW_LINE>// } else {<NEW_LINE>// System.err.println("eeCC");<NEW_LINE>// for (String configurationPropertyName : configurationPropertyNames) {<NEW_LINE>// System.err.println("eeDD");<NEW_LINE>// log.log(Level.INFO, "configuration:" + this + ": configuration: " + configurationPropertyName + "="<NEW_LINE>// + configuration.getProperty(configurationPropertyName));<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>} | URL url = resources.nextElement(); |
540,227 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,671,653 | public List<KeeperContainerInfoModel> findAllInfos() {<NEW_LINE>List<KeepercontainerTbl> baseInfos = findContainerBaseInfos();<NEW_LINE>HashMap<Long, KeeperContainerInfoModel> <MASK><NEW_LINE>baseInfos.forEach(baseInfo -> {<NEW_LINE>KeeperContainerInfoModel model = new KeeperContainerInfoModel();<NEW_LINE>model.setId(baseInfo.getKeepercontainerId());<NEW_LINE>model.setAddr(new HostPort(baseInfo.getKeepercontainerIp(), baseInfo.getKeepercontainerPort()));<NEW_LINE>model.setDcName(baseInfo.getDcInfo().getDcName());<NEW_LINE>model.setOrgName(baseInfo.getOrgInfo().getOrgName());<NEW_LINE>if (baseInfo.getAzId() != 0) {<NEW_LINE>AzTbl aztbl = azService.getAvailableZoneTblById(baseInfo.getAzId());<NEW_LINE>if (aztbl == null) {<NEW_LINE>throw new XpipeRuntimeException(String.format("dc %s do not has available zone %d", baseInfo.getDcInfo().getDcName(), baseInfo.getAzId()));<NEW_LINE>}<NEW_LINE>model.setAzName(aztbl.getAzName());<NEW_LINE>}<NEW_LINE>containerInfoMap.put(model.getId(), model);<NEW_LINE>});<NEW_LINE>List<RedisTbl> containerLoad = redisService.findAllKeeperContainerCountInfo();<NEW_LINE>containerLoad.forEach(load -> {<NEW_LINE>if (!containerInfoMap.containsKey(load.getKeepercontainerId()))<NEW_LINE>return;<NEW_LINE>KeeperContainerInfoModel model = containerInfoMap.get(load.getKeepercontainerId());<NEW_LINE>model.setKeeperCount(load.getCount());<NEW_LINE>model.setClusterCount(load.getDcClusterShardInfo().getClusterCount());<NEW_LINE>model.setShardCount(load.getDcClusterShardInfo().getShardCount());<NEW_LINE>});<NEW_LINE>return new ArrayList<>(containerInfoMap.values());<NEW_LINE>} | containerInfoMap = new HashMap<>(); |
1,014,520 | public Void execute(CommandContext commandContext) {<NEW_LINE>EnsureUtil.ensureNotNull(NotValidException.class, "incident id", incidentId);<NEW_LINE>IncidentEntity incident = (IncidentEntity) commandContext.getIncidentManager().findIncidentById(incidentId);<NEW_LINE>EnsureUtil.ensureNotNull(<MASK><NEW_LINE>if (incident.getExecutionId() != null) {<NEW_LINE>ExecutionEntity execution = commandContext.getExecutionManager().findExecutionById(incident.getExecutionId());<NEW_LINE>if (execution != null) {<NEW_LINE>// check rights for updating an execution-related incident<NEW_LINE>for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {<NEW_LINE>checker.checkUpdateProcessInstance(execution);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>incident.setAnnotation(annotation);<NEW_LINE>triggerHistoryEvent(commandContext, incident);<NEW_LINE>if (annotation == null) {<NEW_LINE>commandContext.getOperationLogManager().logClearIncidentAnnotationOperation(incidentId);<NEW_LINE>} else {<NEW_LINE>commandContext.getOperationLogManager().logSetIncidentAnnotationOperation(incidentId);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | BadUserRequestException.class, "incident", incident); |
1,205,444 | private Mono<Response<Flux<ByteBuffer>>> stopWithResponseAsync(String resourceGroupName, String labName, String virtualMachineName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (labName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualMachineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, labName, virtualMachineName, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,621,168 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();<NEW_LINE>assert actionBar != null;<NEW_LINE>actionBar.setTitle("Edit Budget Amounts");<NEW_LINE>setHasOptionsMenu(true);<NEW_LINE>ArrayList<BudgetAmount> budgetAmounts = getArguments().getParcelableArrayList(UxArgument.BUDGET_AMOUNT_LIST);<NEW_LINE>if (budgetAmounts != null) {<NEW_LINE>if (budgetAmounts.isEmpty()) {<NEW_LINE>BudgetAmountViewHolder viewHolder = (BudgetAmountViewHolder) addBudgetAmountView(null).getTag();<NEW_LINE>// there should always be at least one<NEW_LINE>viewHolder.removeItemBtn.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>loadBudgetAmountViews(budgetAmounts);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>BudgetAmountViewHolder viewHolder = (BudgetAmountViewHolder) <MASK><NEW_LINE>// there should always be at least one<NEW_LINE>viewHolder.removeItemBtn.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | addBudgetAmountView(null).getTag(); |
1,346,379 | public Optional<AuthenticationDetails> authenticateAndProvision(AuthServiceCredentials authCredentials, ProvisionerService provisionerService) {<NEW_LINE>try (final LDAPConnection connection = ldapConnector.connect(config.getLDAPConnectorConfig())) {<NEW_LINE>if (connection == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Optional<LDAPUser> optionalUser = findUser(connection, authCredentials);<NEW_LINE>if (!optionalUser.isPresent()) {<NEW_LINE>LOG.debug("User <{}> not found in LDAP", authCredentials.username());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final LDAPUser userEntry = optionalUser.get();<NEW_LINE>if (!authCredentials.isAuthenticated()) {<NEW_LINE>if (!isAuthenticated(connection, userEntry, authCredentials)) {<NEW_LINE>LOG.debug("Invalid credentials for user <{}> (DN: {})", authCredentials.username(), userEntry.dn());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final UserDetails userDetails = provisionerService.provision(provisionerService.newDetails(this).authServiceType(backendType()).authServiceId(backendId()).accountIsEnabled(true).base64AuthServiceUid(userEntry.base64UniqueId()).username(userEntry.username()).fullName(userEntry.fullName()).email(userEntry.email()).defaultRoles(backend.defaultRoles()).build());<NEW_LINE>return Optional.of(AuthenticationDetails.builder().userDetails<MASK><NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>LOG.error("Error setting up TLS connection", e);<NEW_LINE>throw new AuthenticationServiceUnavailableException("Error setting up TLS connection", e);<NEW_LINE>} catch (LDAPException e) {<NEW_LINE>LOG.error("LDAP error", e);<NEW_LINE>throw new AuthenticationServiceUnavailableException("LDAP error", e);<NEW_LINE>}<NEW_LINE>} | (userDetails).build()); |
1,778,027 | protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {<NEW_LINE>try {<NEW_LINE>AppIdentityCredential credential = new AppIdentityCredential(Arrays.asList(STORAGE_SCOPE));<NEW_LINE>// Set up and execute Google Cloud Storage request.<NEW_LINE>String bucketName = req.getRequestURI();<NEW_LINE>if (bucketName.equals("/")) {<NEW_LINE>resp.sendError(HTTP_NOT_FOUND, "No bucket specified - append /bucket-name to the URL and retry.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Remove any trailing slashes, if found.<NEW_LINE>// [START snippet]<NEW_LINE>String cleanBucketName = bucketName.replaceAll("/$", "");<NEW_LINE>String uri = GCS_URI + cleanBucketName;<NEW_LINE>HttpRequestFactory requestFactory = HTTP_TRANSPORT.createRequestFactory(credential);<NEW_LINE>GenericUrl url = new GenericUrl(uri);<NEW_LINE>HttpRequest request = requestFactory.buildGetRequest(url);<NEW_LINE>HttpResponse response = request.execute();<NEW_LINE>String content = response.parseAsString();<NEW_LINE>// [END snippet]<NEW_LINE>// Display the output XML.<NEW_LINE>resp.setContentType("text/xml");<NEW_LINE>BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(resp.getOutputStream()));<NEW_LINE>String formattedContent = content.replaceAll("(<ListBucketResult)", XSL + "$1");<NEW_LINE>writer.append(formattedContent);<NEW_LINE>writer.flush();<NEW_LINE>resp.setStatus(HTTP_OK);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>resp.sendError(<MASK><NEW_LINE>}<NEW_LINE>} | HTTP_NOT_FOUND, e.getMessage()); |
1,462,888 | protected void loadConfig() {<NEW_LINE>Map map = subs.getHistoryConfig();<NEW_LINE>Long l_enabled = (Long) map.get("enabled");<NEW_LINE>enabled = l_enabled == null ? true : l_enabled.longValue() == 1;<NEW_LINE>Long l_auto_dl = (<MASK><NEW_LINE>auto_dl = l_auto_dl == null ? false : l_auto_dl.longValue() == 1;<NEW_LINE>Long l_last_scan = (Long) map.get("last_scan");<NEW_LINE>last_scan = l_last_scan == null ? 0 : l_last_scan.longValue();<NEW_LINE>Long l_last_new = (Long) map.get("last_new");<NEW_LINE>last_new_result = l_last_new == null ? 0 : l_last_new.longValue();<NEW_LINE>Long l_num_unread = (Long) map.get("num_unread");<NEW_LINE>num_unread = l_num_unread == null ? 0 : l_num_unread.intValue();<NEW_LINE>Long l_num_read = (Long) map.get("num_read");<NEW_LINE>num_read = l_num_read == null ? 0 : l_num_read.intValue();<NEW_LINE>// migration - if we've already downloaded this feed then we default to being<NEW_LINE>// enabled<NEW_LINE>Long l_auto_dl_s = (Long) map.get("auto_dl_supported");<NEW_LINE>auto_dl_supported = l_auto_dl_s == null ? (last_scan > 0) : l_auto_dl_s.longValue() == 1;<NEW_LINE>Long l_dl_with_ref = (Long) map.get("dl_with_ref");<NEW_LINE>dl_with_ref = l_dl_with_ref == null ? true : l_dl_with_ref.longValue() == 1;<NEW_LINE>Long l_interval_override = (Long) map.get("interval_override");<NEW_LINE>interval_override = l_interval_override == null ? 0 : l_interval_override.intValue();<NEW_LINE>Long l_max_results = (Long) map.get("max_results");<NEW_LINE>max_results = l_max_results == null ? -1 : l_max_results.longValue();<NEW_LINE>String s_networks = MapUtils.getMapString(map, "nets", null);<NEW_LINE>if (s_networks != null) {<NEW_LINE>networks = s_networks.split(",");<NEW_LINE>for (int i = 0; i < networks.length; i++) {<NEW_LINE>networks[i] = AENetworkClassifier.internalise(networks[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Long l_post_noto = (Long) map.get("post_noti");<NEW_LINE>post_notifications = l_post_noto == null ? false : l_post_noto.longValue() == 1;<NEW_LINE>Long l_max_age_secs = (Long) map.get("max_age_secs");<NEW_LINE>max_age_secs = l_max_age_secs == null ? -1 : l_max_age_secs;<NEW_LINE>} | Long) map.get("auto_dl"); |
822,240 | /*<NEW_LINE>* Add a new referral entry to the cache, including: client principal,<NEW_LINE>* service principal, user principal (S4U2Self only), client service<NEW_LINE>* ticket (S4U2Proxy only), source KDC realm, destination KDC realm and<NEW_LINE>* referral TGT.<NEW_LINE>*<NEW_LINE>* If a loop is generated when adding the new referral, the first hop is<NEW_LINE>* automatically removed. For example, let's assume that adding a<NEW_LINE>* REALM-3.COM -> REALM-1.COM referral generates the following loop:<NEW_LINE>* REALM-1.COM -> REALM-2.COM -> REALM-3.COM -> REALM-1.COM. Then,<NEW_LINE>* REALM-1.COM -> REALM-2.COM referral entry is removed from the cache.<NEW_LINE>*/<NEW_LINE>static synchronized void put(PrincipalName cname, PrincipalName service, PrincipalName user, Ticket[] userSvcTickets, String fromRealm, String toRealm, Credentials creds) {<NEW_LINE>Ticket userSvcTicket = (userSvcTickets != null ? userSvcTickets[0] : null);<NEW_LINE>ReferralCacheKey k = new ReferralCacheKey(cname, service, user, userSvcTicket);<NEW_LINE>pruneExpired(k);<NEW_LINE>if (creds.getEndTime().before(new Date())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ReferralCacheEntry> entries = referralsMap.get(k);<NEW_LINE>if (entries == null) {<NEW_LINE>entries = new HashMap<String, ReferralCacheEntry>();<NEW_LINE>referralsMap.put(k, entries);<NEW_LINE>}<NEW_LINE>entries.remove(fromRealm);<NEW_LINE>ReferralCacheEntry newEntry = new ReferralCacheEntry(creds, toRealm);<NEW_LINE>entries.put(fromRealm, newEntry);<NEW_LINE>// Remove loops within the cache<NEW_LINE>ReferralCacheEntry current = newEntry;<NEW_LINE>List<ReferralCacheEntry> seen = new LinkedList<>();<NEW_LINE>while (current != null) {<NEW_LINE>if (seen.contains(current)) {<NEW_LINE>// Loop found. Remove the first referral to cut the loop.<NEW_LINE>entries.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>seen.add(current);<NEW_LINE>current = entries.get(current.getToRealm());<NEW_LINE>}<NEW_LINE>} | remove(newEntry.getToRealm()); |
879,255 | protected Long handleInternally(DataObject content) {<NEW_LINE>final long id = content.getLong("guild_id");<NEW_LINE>if (getJDA().getGuildSetupController().isLocked(id))<NEW_LINE>return id;<NEW_LINE>DataObject userJson = content.getObject("user");<NEW_LINE>final long userId = userJson.getLong("id");<NEW_LINE>GuildImpl guild = (GuildImpl) getJDA().getGuildById(id);<NEW_LINE>if (guild == null) {<NEW_LINE>// Do not cache this here, it will be outdated once we receive the GUILD_CREATE and could cause invalid cache<NEW_LINE>// getJDA().getEventCache().cache(EventCache.Type.GUILD, userId, responseNumber, allContent, this::handle);<NEW_LINE>EventCache.LOG.debug("Got GuildMember update but JDA currently does not have the Guild cached. Ignoring. {}", content);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MemberImpl member = (MemberImpl) guild.getMembersView().get(userId);<NEW_LINE>if (member == null) {<NEW_LINE>member = getJDA().getEntityBuilder(<MASK><NEW_LINE>} else {<NEW_LINE>List<Role> newRoles = toRolesList(guild, content.getArray("roles"));<NEW_LINE>getJDA().getEntityBuilder().updateMember(guild, member, content, newRoles);<NEW_LINE>}<NEW_LINE>getJDA().getEntityBuilder().updateMemberCache(member);<NEW_LINE>getJDA().handleEvent(new GuildMemberUpdateEvent(getJDA(), responseNumber, member));<NEW_LINE>return null;<NEW_LINE>} | ).createMember(guild, content); |
343,584 | private MacrosModel.Macro addMacro(String initCode) {<NEW_LINE><MASK><NEW_LINE>// NO18N<NEW_LINE>final DialogDescriptor descriptor = new DialogDescriptor(panel, loc("CTL_New_macro_dialog_title"));<NEW_LINE>panel.setChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>String name = panel.getNameValue().trim();<NEW_LINE>String err = model.validateMacroName(name);<NEW_LINE>descriptor.setValid(err == null);<NEW_LINE>panel.setErrorMessage(err);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (DialogDisplayer.getDefault().notify(descriptor) == DialogDescriptor.OK_OPTION) {<NEW_LINE>String macroName = panel.getNameValue().trim();<NEW_LINE>final Macro macro = model.createMacro(MimePath.EMPTY, macroName);<NEW_LINE>if (initCode != null) {<NEW_LINE>macro.setCode(initCode);<NEW_LINE>}<NEW_LINE>sorter.resortAfterModelChange();<NEW_LINE>int sel = sorter.viewIndex(model.getAllMacros().size() - 1);<NEW_LINE>tMacros.getSelectionModel().setSelectionInterval(sel, sel);<NEW_LINE>tMacros.scrollRectToVisible(tMacros.getCellRect(sel, 0, true));<NEW_LINE>return macro;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | final MacrosNamePanel panel = new MacrosNamePanel(); |
1,134,624 | Object POINTER(VirtualFrame frame, Object cls, @CachedLibrary(limit = "1") HashingStorageLibrary hlib, @Cached IsTypeNode isTypeNode, @Cached CallNode callNode, @Cached GetNameNode getNameNode, @Cached CastToJavaStringNode toJavaStringNode) {<NEW_LINE>CtypesThreadState ctypes = CtypesThreadState.get(getContext(), getLanguage());<NEW_LINE>Object result = hlib.getItem(ctypes.ptrtype_cache, cls);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Object key;<NEW_LINE>if (PGuards.isString(cls)) {<NEW_LINE>String <MASK><NEW_LINE>String buf = PythonUtils.format("LP_%s", name);<NEW_LINE>Object[] args = new Object[] { buf, PyCPointer, factory().createDict() };<NEW_LINE>result = callNode.execute(frame, PyCPointerType, args, PKeyword.EMPTY_KEYWORDS);<NEW_LINE>key = factory().createNativeVoidPtr(result);<NEW_LINE>} else if (isTypeNode.execute(cls)) {<NEW_LINE>String buf = PythonUtils.format("LP_%s", getNameNode.execute(cls));<NEW_LINE>PTuple bases = factory().createTuple(new Object[] { PyCPointer });<NEW_LINE>Object[] args = new Object[] { buf, bases, factory().createDict(new PKeyword[] { new PKeyword(_type_, cls) }) };<NEW_LINE>result = callNode.execute(frame, PyCPointerType, args, PKeyword.EMPTY_KEYWORDS);<NEW_LINE>key = cls;<NEW_LINE>} else {<NEW_LINE>throw raise(TypeError, MUST_BE_A_CTYPES_TYPE);<NEW_LINE>}<NEW_LINE>hlib.setItem(ctypes.ptrtype_cache, key, result);<NEW_LINE>return result;<NEW_LINE>} | name = toJavaStringNode.execute(cls); |
1,485,211 | public void remove(ContextID contextID, ContextKey contextKey) throws ErrorException {<NEW_LINE>String contextIdStr = SerializeHelper.serializeContextID(contextID);<NEW_LINE>String contextKeyStr = SerializeHelper.serializeContextKey(contextKey);<NEW_LINE>ContextRemoveAction contextRemoveAction = new ContextRemoveAction(contextIdStr, contextKeyStr);<NEW_LINE>contextRemoveAction.addHeader(ContextHTTPConstant.CONTEXT_ID_STR, contextIdStr);<NEW_LINE>contextRemoveAction.getRequestPayloads().put(ContextHTTPConstant.CONTEXT_KEY_STR, contextKeyStr);<NEW_LINE>contextRemoveAction.getRequestPayloads().put(ContextHTTPConstant.CONTEXT_ID_STR, contextIdStr);<NEW_LINE>contextRemoveAction.getRequestPayloads().put("contextId", contextID.getContextId());<NEW_LINE>Result result = null;<NEW_LINE>try {<NEW_LINE>result = dwsHttpClient.execute(contextRemoveAction);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("remove context id {} context key {} failed", contextIdStr, contextIdStr, e);<NEW_LINE>ExceptionHelper.throwErrorException(80015, "remove context failed", e);<NEW_LINE>}<NEW_LINE>if (result instanceof ContextRemoveResult) {<NEW_LINE>ContextRemoveResult contextRemoveResult = (ContextRemoveResult) result;<NEW_LINE><MASK><NEW_LINE>if (status != 0) {<NEW_LINE>String errMsg = contextRemoveResult.getMessage();<NEW_LINE>LOGGER.error("remove context failed contextID {}, contextKey {} ", contextIdStr, contextKey.getKey());<NEW_LINE>}<NEW_LINE>} else if (result != null) {<NEW_LINE>LOGGER.error("result is not a correct type, result type is {}", result.getClass().getSimpleName());<NEW_LINE>throw new ErrorException(80015, "result is not a correct type");<NEW_LINE>} else {<NEW_LINE>LOGGER.error("result is null");<NEW_LINE>throw new ErrorException(80015, "result is null");<NEW_LINE>}<NEW_LINE>} | int status = contextRemoveResult.getStatus(); |
831,866 | public UserContextDataType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UserContextDataType userContextDataType = new UserContextDataType();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("EncodedData", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>userContextDataType.setEncodedData(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 userContextDataType;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,787,882 | protected void analyzeMethodForServiceConnection(SootMethod method) {<NEW_LINE>// Do not analyze system classes<NEW_LINE>if (SystemClassHandler.v().isClassInSystemPackage(method.getDeclaringClass().getName()))<NEW_LINE>return;<NEW_LINE>if (!method.isConcrete() || !method.hasActiveBody())<NEW_LINE>return;<NEW_LINE>for (Unit u : method.getActiveBody().getUnits()) {<NEW_LINE>Stmt stmt = (Stmt) u;<NEW_LINE>if (stmt.containsInvokeExpr()) {<NEW_LINE>final InvokeExpr iexpr = stmt.getInvokeExpr();<NEW_LINE>final SootMethodRef methodRef = iexpr.getMethodRef();<NEW_LINE>if (methodRef.getSignature().equals(SIG_CAR_CREATE)) {<NEW_LINE>Value <MASK><NEW_LINE>// We need all possible types for the parameter<NEW_LINE>if (br instanceof Local && Scene.v().hasPointsToAnalysis()) {<NEW_LINE>PointsToSet pts = Scene.v().getPointsToAnalysis().reachingObjects((Local) br);<NEW_LINE>for (Type tp : pts.possibleTypes()) {<NEW_LINE>if (tp instanceof RefType) {<NEW_LINE>RefType rt = (RefType) tp;<NEW_LINE>if (!SystemClassHandler.v().isClassInSystemPackage(rt.getSootClass().getName()))<NEW_LINE>dynamicManifestComponents.add(rt.getSootClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Just to be sure, also add the declared type<NEW_LINE>if (br.getType() instanceof RefType) {<NEW_LINE>RefType rt = (RefType) br.getType();<NEW_LINE>if (!SystemClassHandler.v().isClassInSystemPackage(rt.getSootClass().getName()))<NEW_LINE>dynamicManifestComponents.add(rt.getSootClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | br = iexpr.getArg(1); |
1,466,528 | private Pair<Boolean, List<String>> doKill(TaskKillRequestCommand killCommand) {<NEW_LINE>boolean processFlag = true;<NEW_LINE>List<String> appIds = Collections.emptyList();<NEW_LINE>int taskInstanceId = killCommand.getTaskInstanceId();<NEW_LINE>TaskExecutionContext <MASK><NEW_LINE>try {<NEW_LINE>Integer processId = taskExecutionContext.getProcessId();<NEW_LINE>if (processId.equals(0)) {<NEW_LINE>workerManager.killTaskBeforeExecuteByInstanceId(taskInstanceId);<NEW_LINE>TaskExecutionContextCacheManager.removeByTaskInstanceId(taskInstanceId);<NEW_LINE>logger.info("the task has not been executed and has been cancelled, task id:{}", taskInstanceId);<NEW_LINE>return Pair.of(true, appIds);<NEW_LINE>}<NEW_LINE>String pidsStr = ProcessUtils.getPidsStr(taskExecutionContext.getProcessId());<NEW_LINE>if (!StringUtils.isEmpty(pidsStr)) {<NEW_LINE>String cmd = String.format("kill -9 %s", pidsStr);<NEW_LINE>cmd = OSUtils.getSudoCmd(taskExecutionContext.getTenantCode(), cmd);<NEW_LINE>logger.info("process id:{}, cmd:{}", taskExecutionContext.getProcessId(), cmd);<NEW_LINE>OSUtils.exeCmd(cmd);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>processFlag = false;<NEW_LINE>logger.error("kill task error", e);<NEW_LINE>}<NEW_LINE>// find log and kill yarn job<NEW_LINE>Pair<Boolean, List<String>> yarnResult = killYarnJob(Host.of(taskExecutionContext.getHost()), taskExecutionContext.getLogPath(), taskExecutionContext.getExecutePath(), taskExecutionContext.getTenantCode());<NEW_LINE>return Pair.of(processFlag && yarnResult.getLeft(), yarnResult.getRight());<NEW_LINE>} | taskExecutionContext = TaskExecutionContextCacheManager.getByTaskInstanceId(taskInstanceId); |
1,546,164 | public void findEdgeIdsInNeighborhood(double queryLat, double queryLon, int iteration, IntConsumer foundEntries) {<NEW_LINE>int x = keyAlgo.x(queryLon);<NEW_LINE>int y = keyAlgo.y(queryLat);<NEW_LINE>for (int yreg = -iteration; yreg <= iteration; yreg++) {<NEW_LINE>int subqueryY = y + yreg;<NEW_LINE>int subqueryXA = x - iteration;<NEW_LINE>int subqueryXB = x + iteration;<NEW_LINE>if (subqueryXA >= 0 && subqueryY >= 0) {<NEW_LINE>// TODO: Also don't walk off the _other_ side of the grid.<NEW_LINE>long keyPart = keyAlgo.encode(subqueryXA, subqueryY) << (64 - keyAlgo.getBits());<NEW_LINE>fillIDs(keyPart, foundEntries);<NEW_LINE>}<NEW_LINE>if (iteration > 0 && subqueryXB >= 0 && subqueryY >= 0) {<NEW_LINE>long keyPart = keyAlgo.encode(subqueryXB, subqueryY) << (<MASK><NEW_LINE>fillIDs(keyPart, foundEntries);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int xreg = -iteration + 1; xreg <= iteration - 1; xreg++) {<NEW_LINE>int subqueryX = x + xreg;<NEW_LINE>int subqueryYA = y - iteration;<NEW_LINE>int subqueryYB = y + iteration;<NEW_LINE>if (subqueryX >= 0 && subqueryYA >= 0) {<NEW_LINE>long keyPart = keyAlgo.encode(subqueryX, subqueryYA) << (64 - keyAlgo.getBits());<NEW_LINE>fillIDs(keyPart, foundEntries);<NEW_LINE>}<NEW_LINE>if (subqueryX >= 0 && subqueryYB >= 0) {<NEW_LINE>long keyPart = keyAlgo.encode(subqueryX, subqueryYB) << (64 - keyAlgo.getBits());<NEW_LINE>fillIDs(keyPart, foundEntries);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 64 - keyAlgo.getBits()); |
706,869 | private String findSpringVersion(FileObject ownerRoot) {<NEW_LINE>try {<NEW_LINE>if (ownerRoot != null) {<NEW_LINE>// NOI18N<NEW_LINE>if (ownerRoot.getFileSystem() instanceof JarFileSystem) {<NEW_LINE>JarFileSystem jarFileSystem = <MASK><NEW_LINE>String implementationVersion = SpringUtilities.getImplementationVersion(jarFileSystem);<NEW_LINE>if (implementationVersion != null) {<NEW_LINE>// NOI18N<NEW_LINE>String[] splitedVersion = implementationVersion.split("[.]");<NEW_LINE>if (splitedVersion.length < 2) {<NEW_LINE>LOG.log(Level.SEVERE, "Unknown syntax of implementation version={0}", implementationVersion);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return splitedVersion[0] + "." + splitedVersion[1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (FileStateInvalidException e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (JarFileSystem) ownerRoot.getFileSystem(); |
1,308,262 | public void updateContractStatusInOrder(final I_C_Flatrate_Term term) {<NEW_LINE>final IOrderDAO orderDAO = Services.get(IOrderDAO.class);<NEW_LINE>final IContractsDAO contractsDAO = Services.get(IContractsDAO.class);<NEW_LINE>final ISubscriptionBL subscriptionBL = Services.get(ISubscriptionBL.class);<NEW_LINE>final OrderId orderId = contractOrderService.getContractOrderId(term);<NEW_LINE>if (orderId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (InterfaceWrapperHelper.isNew(term) && !contractsDAO.termHasAPredecessor(term)) {<NEW_LINE>final I_C_Order contractOrder = orderDAO.getById(orderId, I_C_Order.class);<NEW_LINE>contractOrderService.setOrderContractStatusAndSave(contractOrder, I_C_Order.CONTRACTSTATUS_Active);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Set<OrderId> <MASK><NEW_LINE>final UpdateContractOrderStatus updateContractStatus = UpdateContractOrderStatus.builder().contractOrderService(contractOrderService).orderDAO(orderDAO).contractsDAO(contractsDAO).subscriptionBL(subscriptionBL).build();<NEW_LINE>updateContractStatus.updateStatusIfNeededWhenExtendind(term, orderIds);<NEW_LINE>updateContractStatus.updateStatusIfNeededWhenCancelling(term, orderIds);<NEW_LINE>updateContractStatus.updateStausIfNeededWhenVoiding(term);<NEW_LINE>} | orderIds = contractOrderService.retrieveAllContractOrderList(orderId); |
230,764 | public <T> Optional<T> selectOne(String prompt, List<T> entries, Function<T, String> entryFormatter) throws IOException {<NEW_LINE>Preconditions.checkArgument(entries.size() > 0);<NEW_LINE>output.println();<NEW_LINE>output.println(prompt);<NEW_LINE>output.println();<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>output.printf("[%d]. %s.\n", i, entryFormatter.apply(entries.get(i)));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String response = ask("(input individual number, for example 1 or 2)");<NEW_LINE>int index = response.trim().isEmpty() ? 0 : parseOne(response);<NEW_LINE>Preconditions.checkArgument(index >= 0 && index < entries.size(), "Index %s out of bounds.", index);<NEW_LINE>return Optional.of<MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>output.printf("Illegal choice: %s\n", e.getMessage());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} | (entries.get(index)); |
1,397,211 | private void indexNonCachedResources(Map<String, Long> fileModified, Map<String, SQLiteTileSource> rs) {<NEW_LINE>for (Map.Entry<String, Long> entry : fileModified.entrySet()) {<NEW_LINE>String filename = entry.getKey();<NEW_LINE>try {<NEW_LINE>log.info("Indexing " + type + " file " + filename);<NEW_LINE>ContentValues cv = new ContentValues();<NEW_LINE>cv.put("filename", filename);<NEW_LINE>cv.put("date_modified", entry.getValue());<NEW_LINE>SQLiteTileSource ts = rs.get(filename);<NEW_LINE>QuadRect rt = ts.getRectBoundary(ZOOM_BOUNDARY, 1);<NEW_LINE>if (rt != null) {<NEW_LINE>indexedResources.insert(filename, rt);<NEW_LINE>cv.put("left", (int) rt.left);<NEW_LINE>cv.put("right", (int) rt.right);<NEW_LINE>cv.put("top", (int) rt.top);<NEW_LINE>cv.put("bottom", (int) rt.bottom);<NEW_LINE>sqliteDb.insert("TILE_SOURCES", null, cv);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>log.error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,696,679 | void fillAdditionalValues(JsonMapper mapper) {<NEW_LINE>if (this.data != null) {<NEW_LINE>JsonObject dataObject = Json.parse(this.data).asObject();<NEW_LINE>if (dataObject.get("rating") != null) {<NEW_LINE>JsonObject rating = dataObject.get("rating").asObject();<NEW_LINE>if (rating != null) {<NEW_LINE>ratingValue = rating.get("value").asDouble();<NEW_LINE>ratingScale = rating.get("scale").asLong();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dataObject.get("language") != null) {<NEW_LINE>language = dataObject.get("language").asString();<NEW_LINE>}<NEW_LINE>if (dataObject.get("is_draft") != null) {<NEW_LINE>isDraft = dataObject.get("is_draft").asBoolean();<NEW_LINE>}<NEW_LINE>if (dataObject.get("review_text") != null) {<NEW_LINE>reviewText = dataObject.get("review_text").asString();<NEW_LINE>}<NEW_LINE>if (dataObject.get("generic_place") != null) {<NEW_LINE>place = mapper.toJavaObject(dataObject.get("generic_place").<MASK><NEW_LINE>} else if (dataObject.get("seller") != null) {<NEW_LINE>place = mapper.toJavaObject(dataObject.get("seller").toString(), Place.class);<NEW_LINE>}<NEW_LINE>if (dataObject.get("recommendation_type") != null) {<NEW_LINE>try {<NEW_LINE>String typeString = dataObject.get("recommendation_type").asString();<NEW_LINE>recommendationType = RecommendationType.valueOf(typeString.toUpperCase());<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>// no enum value found ignore this<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toString(), Place.class); |
315,887 | public void process(final String get, final InputStream is, final OutputStream os) throws IOException {<NEW_LINE>new AEThread2("MagnetProcessor", true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>boolean close = false;<NEW_LINE>try {<NEW_LINE>long start = SystemTime.getMonotonousTime();<NEW_LINE>while (!CoreFactory.isCoreRunning()) {<NEW_LINE>if (SystemTime.getMonotonousTime() - start > 60 * 1000) {<NEW_LINE>Debug.out("Timeout waiting for core to start");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>close = process(get, new BufferedReader(new <MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out("Magnet processing failed", e);<NEW_LINE>} finally {<NEW_LINE>if (close) {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>os.flush();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>if (close) {<NEW_LINE>try {<NEW_LINE>os.close();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>} | InputStreamReader(is)), os); |
764,855 | public static IconCompat createFromBundle(@NonNull Bundle bundle) {<NEW_LINE>int type = bundle.getInt(EXTRA_TYPE);<NEW_LINE>IconCompat icon = new IconCompat(type);<NEW_LINE>icon.mInt1 = bundle.getInt(EXTRA_INT1);<NEW_LINE>icon.<MASK><NEW_LINE>if (bundle.containsKey(EXTRA_TINT_LIST)) {<NEW_LINE>icon.mTintList = bundle.getParcelable(EXTRA_TINT_LIST);<NEW_LINE>}<NEW_LINE>if (bundle.containsKey(EXTRA_TINT_MODE)) {<NEW_LINE>icon.mTintMode = PorterDuff.Mode.valueOf(bundle.getString(EXTRA_TINT_MODE));<NEW_LINE>}<NEW_LINE>switch(type) {<NEW_LINE>case TYPE_BITMAP:<NEW_LINE>case TYPE_ADAPTIVE_BITMAP:<NEW_LINE>case TYPE_UNKNOWN:<NEW_LINE>icon.mObj1 = bundle.getParcelable(EXTRA_OBJ);<NEW_LINE>break;<NEW_LINE>case TYPE_RESOURCE:<NEW_LINE>case TYPE_URI:<NEW_LINE>icon.mObj1 = bundle.getString(EXTRA_OBJ);<NEW_LINE>break;<NEW_LINE>case TYPE_DATA:<NEW_LINE>icon.mObj1 = bundle.getByteArray(EXTRA_OBJ);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Log.w(TAG, "Unknown type " + type);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return icon;<NEW_LINE>} | mInt2 = bundle.getInt(EXTRA_INT2); |
673,578 | private // NOSONAR<NEW_LINE>// NOSONAR<NEW_LINE>void // NOSONAR<NEW_LINE>paintMarkerLines(PaintEvent e) {<NEW_LINE>if (markerLines.isEmpty())<NEW_LINE>return;<NEW_LINE>IAxis xAxis = getAxisSet().getXAxis(0);<NEW_LINE>IAxis yAxis = getAxisSet().getYAxis(0);<NEW_LINE>int labelExtentX = 0;<NEW_LINE>int labelStackY = 0;<NEW_LINE>for (MarkerLine marker : markerLines) {<NEW_LINE>int x = xAxis.getPixelCoordinate((double) marker.getTimeMillis());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String label = marker.label != null ? marker.label : "";<NEW_LINE>Point textExtent = e.gc.textExtent(label);<NEW_LINE>boolean flip = x + 5 + textExtent.x > e.width;<NEW_LINE>int textX = flip ? x - 5 - textExtent.x : x + 5;<NEW_LINE>labelStackY = labelExtentX > textX ? labelStackY + textExtent.y : 0;<NEW_LINE>labelExtentX = x + 5 + textExtent.x;<NEW_LINE>e.<MASK><NEW_LINE>e.gc.setForeground(marker.color);<NEW_LINE>e.gc.setLineWidth(2);<NEW_LINE>e.gc.drawLine(x, 0, x, e.height);<NEW_LINE>e.gc.drawText(label, textX, e.height - 20 - labelStackY, true);<NEW_LINE>if (marker.value != null) {<NEW_LINE>int y = yAxis.getPixelCoordinate(marker.value);<NEW_LINE>e.gc.drawLine(x - 5, y, x + 5, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | gc.setLineStyle(SWT.LINE_SOLID); |
704,669 | public com.amazonaws.services.voiceid.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.voiceid.model.ValidationException validationException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 validationException;<NEW_LINE>} | voiceid.model.ValidationException(null); |
327,699 | final CreateNamedQueryResult executeCreateNamedQuery(CreateNamedQueryRequest createNamedQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNamedQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNamedQueryRequest> request = null;<NEW_LINE>Response<CreateNamedQueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNamedQueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNamedQueryRequest));<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, "Athena");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNamedQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNamedQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNamedQueryResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
175,286 | private void checkPropertyInheritanceOnGetpropAssign(Node assign, Node object, String property, JSDocInfo info, JSType propertyType) {<NEW_LINE>// Inheritance checks for prototype properties.<NEW_LINE>//<NEW_LINE>// TODO(nicksantos): This isn't the right place to do this check. We<NEW_LINE>// really want to do this when we're looking at the constructor.<NEW_LINE>// We'd find all its properties and make sure they followed inheritance<NEW_LINE>// rules, like we currently do for @implements to make sure<NEW_LINE>// all the methods are implemented.<NEW_LINE>//<NEW_LINE>// As-is, this misses many other ways to override a property.<NEW_LINE>if (object.isGetProp() && object.getString().equals("prototype")) {<NEW_LINE>// ASSIGN = assign<NEW_LINE>// GETPROP<NEW_LINE>// GETPROP = object<NEW_LINE>// ? = preObject<NEW_LINE>// STRING = "prototype"<NEW_LINE>// STRING = property<NEW_LINE><MASK><NEW_LINE>@Nullable<NEW_LINE>FunctionType ctorType = getJSType(preObject).toMaybeFunctionType();<NEW_LINE>if (ctorType == null || !ctorType.hasInstanceType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkDeclaredPropertyAgainstNominalInheritance(assign, ctorType, property, info, propertyType);<NEW_LINE>checkAbstractMethodInConcreteClass(assign, ctorType, info);<NEW_LINE>} else {<NEW_LINE>// ASSIGN = assign<NEW_LINE>// GETPROP<NEW_LINE>// ? = object<NEW_LINE>// STRING = property<NEW_LINE>// We only care about checking a static property assignment.<NEW_LINE>@Nullable<NEW_LINE>FunctionType ctorType = getJSType(object).toMaybeFunctionType();<NEW_LINE>if (ctorType == null || !ctorType.hasInstanceType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkDeclaredPropertyAgainstPrototypalInheritance(assign, ctorType, property, info, propertyType);<NEW_LINE>}<NEW_LINE>} | Node preObject = object.getFirstChild(); |
1,403,952 | public static KeyRange transformRange(Token leftKeyExclusive, Token rightKeyInclusive) {<NEW_LINE>if (!(leftKeyExclusive instanceof BytesToken))<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>// if left part is BytesToken, right part should be too, otherwise there is no sense in the ring<NEW_LINE>assert rightKeyInclusive instanceof BytesToken;<NEW_LINE>// l is exclusive, r is inclusive<NEW_LINE>BytesToken l = (BytesToken) leftKeyExclusive;<NEW_LINE>BytesToken r = (BytesToken) rightKeyInclusive;<NEW_LINE>byte[] leftTokenValue = l.getTokenValue();<NEW_LINE>byte[] rightTokenValue = r.getTokenValue();<NEW_LINE>Preconditions.checkArgument(leftTokenValue.length == rightTokenValue.length, "Tokens have unequal length");<NEW_LINE>int tokenLength = leftTokenValue.length;<NEW_LINE>byte[][] tokens = new byte[<MASK><NEW_LINE>byte[][] plusOne = new byte[2][tokenLength];<NEW_LINE>for (int j = 0; j < 2; j++) {<NEW_LINE>boolean carry = true;<NEW_LINE>for (int i = tokenLength - 1; i >= 0; i--) {<NEW_LINE>byte b = tokens[j][i];<NEW_LINE>if (carry) {<NEW_LINE>b++;<NEW_LINE>carry = false;<NEW_LINE>}<NEW_LINE>if (b == 0)<NEW_LINE>carry = true;<NEW_LINE>plusOne[j][i] = b;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StaticBuffer lb = StaticArrayBuffer.of(plusOne[0]);<NEW_LINE>StaticBuffer rb = StaticArrayBuffer.of(plusOne[1]);<NEW_LINE>Preconditions.checkArgument(lb.length() == tokenLength, lb.length());<NEW_LINE>Preconditions.checkArgument(rb.length() == tokenLength, rb.length());<NEW_LINE>return new KeyRange(lb, rb);<NEW_LINE>} | ][] { leftTokenValue, rightTokenValue }; |
456,554 | public boolean storeEntry(AuditLogEntry entry) {<NEW_LINE>LOGGER.debug("Storing entry {}", entry);<NEW_LINE>// Note checks for action, time and action are redundant since<NEW_LINE>// they are already checked in AuditLogEntry<NEW_LINE>if (entry == null || entry.getAction() == null || entry.getUser() == null || entry.getTime() == null) {<NEW_LINE>throw new RepositoryException("Can not insert AuditLogEntry " + entry + " into database, required values are null.");<NEW_LINE>}<NEW_LINE>// If application name is null use global entry name<NEW_LINE>String applicationName = AuditLogRepository.GLOBAL_ENTRY_APPLICATION.toString();<NEW_LINE>if (entry.getApplicationName() != null && !StringUtils.isBlank(entry.getApplicationName().toString())) {<NEW_LINE>applicationName = entry.getApplicationName().toString();<NEW_LINE>}<NEW_LINE>Date time = entry.getTime().getTime();<NEW_LINE>String action = entry.getAction().toString();<NEW_LINE>String firstName = makeEmptyStringForNull(entry.getUser().getFirstName());<NEW_LINE>String lastName = makeEmptyStringForNull(entry.getUser().getLastName());<NEW_LINE>String email = makeEmptyStringForNull(entry.getUser().getEmail());<NEW_LINE>String userId = makeEmptyStringForNull(entry.getUser().getUserId());<NEW_LINE>String userName = makeEmptyStringForNull(entry.getUser().getUsername().getUsername());<NEW_LINE>UUID experimentId = entry.getExperimentId() == null ? null : entry.getExperimentId().getRawID();<NEW_LINE>String experimentLabel = entry.getExperimentLabel() == null ? "" : entry.getExperimentLabel().toString();<NEW_LINE>String bucketLabel = entry.getBucketLabel() == null ? "" : entry.getBucketLabel().toString();<NEW_LINE>String changedProperty = makeEmptyStringForNull(entry.getChangedProperty());<NEW_LINE>String before = makeEmptyStringForNull(entry.getBefore());<NEW_LINE>String after = makeEmptyStringForNull(entry.getAfter());<NEW_LINE>accessor.storeEntry(applicationName, time, action, firstName, lastName, email, userName, userId, experimentId, experimentLabel, <MASK><NEW_LINE>return true;<NEW_LINE>} | bucketLabel, changedProperty, before, after); |
1,397,705 | public void queryWithResponse() {<NEW_LINE>// BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.queryWithResponse#BlobQueryOptions<NEW_LINE>String expression = "SELECT * from BlobStorage";<NEW_LINE>BlobQueryJsonSerialization input = new BlobQueryJsonSerialization().setRecordSeparator('\n');<NEW_LINE>BlobQueryDelimitedSerialization output = new BlobQueryDelimitedSerialization().setEscapeChar('\0').setColumnSeparator(',').setRecordSeparator('\n').setFieldQuote('\'').setHeadersPresent(true);<NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId);<NEW_LINE>Consumer<BlobQueryError> errorConsumer = System.out::println;<NEW_LINE>Consumer<BlobQueryProgress> progressConsumer = progress -> System.out.println("total blob bytes read: " + progress.getBytesScanned());<NEW_LINE>BlobQueryOptions queryOptions = new BlobQueryOptions(expression).setInputSerialization(input).setOutputSerialization(output).setRequestConditions(requestConditions).setErrorConsumer<MASK><NEW_LINE>client.queryWithResponse(queryOptions).subscribe(response -> {<NEW_LINE>ByteArrayOutputStream queryData = new ByteArrayOutputStream();<NEW_LINE>response.getValue().subscribe(piece -> {<NEW_LINE>try {<NEW_LINE>queryData.write(piece.array());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new UncheckedIOException(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>// END: com.azure.storage.blob.specialized.BlobAsyncClientBase.queryWithResponse#BlobQueryOptions<NEW_LINE>} | (errorConsumer).setProgressConsumer(progressConsumer); |
1,686,111 | private final int compareToInterval(final FcnRcdValue fcn) {<NEW_LINE>int result;<NEW_LINE>if (fcn.intv != null) {<NEW_LINE>result = this.intv<MASK><NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.values.length; i++) {<NEW_LINE>result = this.values[i].compareTo(fcn.values[i]);<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < fcn.domain.length; i++) {<NEW_LINE>final Value dElem = fcn.domain[i];<NEW_LINE>if (!(dElem instanceof IntValue)) {<NEW_LINE>Assert.fail("Attempted to compare integer with non-integer:\n" + Values.ppr(dElem.toString()) + ".", getSource());<NEW_LINE>}<NEW_LINE>result = this.intv.low + i - ((IntValue) dElem).val;<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < fcn.domain.length; i++) {<NEW_LINE>result = this.values[i].compareTo(fcn.values[i]);<NEW_LINE>if (result != 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | .low - fcn.intv.low; |
857,537 | private void updateLockMetrics() {<NEW_LINE>LockStats.getGlobal().getLockMetricsByPath().forEach((lockPath, lockMetrics) -> {<NEW_LINE>Metric.Context context = getContext(Map.of("lockPath", lockPath));<NEW_LINE>LatencyMetrics acquireLatencyMetrics = lockMetrics.getAndResetAcquireLatencyMetrics();<NEW_LINE>setNonZero("lockAttempt.acquireMaxActiveLatency", acquireLatencyMetrics.maxActiveLatencySeconds(), context);<NEW_LINE>setNonZero("lockAttempt.acquireHz", acquireLatencyMetrics.startHz(), context);<NEW_LINE>setNonZero("lockAttempt.acquireLoad", acquireLatencyMetrics.load(), context);<NEW_LINE>LatencyMetrics lockedLatencyMetrics = lockMetrics.getAndResetLockedLatencyMetrics();<NEW_LINE>setNonZero("lockAttempt.lockedLatency", <MASK><NEW_LINE>setNonZero("lockAttempt.lockedLoad", lockedLatencyMetrics.load(), context);<NEW_LINE>setNonZero("lockAttempt.acquireTimedOut", lockMetrics.getAndResetAcquireTimedOutCount(), context);<NEW_LINE>setNonZero("lockAttempt.deadlock", lockMetrics.getAndResetDeadlockCount(), context);<NEW_LINE>// bucket for various rare errors - to reduce #metrics<NEW_LINE>setNonZero("lockAttempt.errors", lockMetrics.getAndResetAcquireFailedCount() + lockMetrics.getAndResetReleaseFailedCount() + lockMetrics.getAndResetNakedReleaseCount() + lockMetrics.getAndResetAcquireWithoutReleaseCount() + lockMetrics.getAndResetForeignReleaseCount(), context);<NEW_LINE>});<NEW_LINE>} | lockedLatencyMetrics.maxLatencySeconds(), context); |
10,388 | private static ThinLevel convertLevel(QueryLevel ql, ThinQuery tq) {<NEW_LINE>List<ThinMember> inclusions = convertMembers(ql.getInclusions(), tq);<NEW_LINE>List<ThinMember> exclusions = convertMembers(ql.getExclusions(), tq);<NEW_LINE>ThinMember rangeStart = convertMember(ql.getRangeStart(), tq);<NEW_LINE>ThinMember rangeEnd = convertMember(ql.getRangeEnd(), tq);<NEW_LINE>ThinSelection ts = new ThinSelection(ThinSelection.Type.INCLUSION, null);<NEW_LINE>if (inclusions.size() > 0) {<NEW_LINE>ts = new ThinSelection(ThinSelection.Type.INCLUSION, inclusions);<NEW_LINE>} else if (exclusions.size() > 0) {<NEW_LINE>ts = new ThinSelection(ThinSelection.Type.EXCLUSION, exclusions);<NEW_LINE>} else if (rangeStart != null && rangeEnd != null) {<NEW_LINE>List<ThinMember> <MASK><NEW_LINE>range.add(rangeStart);<NEW_LINE>range.add(rangeEnd);<NEW_LINE>ts = new ThinSelection(ThinSelection.Type.RANGE, range);<NEW_LINE>}<NEW_LINE>if (ql.hasParameter()) {<NEW_LINE>ts.setParameterName(ql.getParameterName());<NEW_LINE>tq.addParameter(ql.getParameterName());<NEW_LINE>}<NEW_LINE>List<String> aggs = ql.getQueryHierarchy().getQuery().getAggregators(ql.getUniqueName());<NEW_LINE>ThinLevel l = new ThinLevel(ql.getName(), ql.getCaption(), ts, aggs);<NEW_LINE>extendQuerySet(l, ql);<NEW_LINE>return l;<NEW_LINE>} | range = new ArrayList<>(); |
1,137,151 | public void processEvent(SystemEvent event) {<NEW_LINE>Map<String, Object> scope = null;<NEW_LINE>if (event instanceof PreDestroyViewMapEvent) {<NEW_LINE>UIViewRoot viewRoot = (UIViewRoot) ((PreDestroyViewMapEvent) event).getComponent();<NEW_LINE>scope = viewRoot.getViewMap(false);<NEW_LINE>if (scope == null) {<NEW_LINE>// view map does not exist --> nothing to destroy<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (event instanceof PreDestroyCustomScopeEvent) {<NEW_LINE>ScopeContext scopeContext = ((<MASK><NEW_LINE>scope = scopeContext.getScope();<NEW_LINE>} else {<NEW_LINE>// wrong event<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!scope.isEmpty()) {<NEW_LINE>Set<String> keySet = scope.keySet();<NEW_LINE>String[] keys = keySet.toArray(new String[keySet.size()]);<NEW_LINE>for (String key : keys) {<NEW_LINE>Object value = scope.get(key);<NEW_LINE>this.destroy(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | PreDestroyCustomScopeEvent) event).getContext(); |
1,063,908 | public static Optional<ScalablePushRegistry> create(final LogicalSchema logicalSchema, final Supplier<List<PersistentQueryMetadata>> allPersistentQueries, final boolean isTable, final Map<String, Object> streamsProperties, final Map<String, Object> consumerProperties, final String sourceApplicationId, final KsqlTopic ksqlTopic, final ServiceContext serviceContext, final KsqlConfig ksqlConfig) {<NEW_LINE>final Object appServer = streamsProperties.get(StreamsConfig.APPLICATION_SERVER_CONFIG);<NEW_LINE>if (appServer == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (!(appServer instanceof String)) {<NEW_LINE>throw new IllegalArgumentException(StreamsConfig.APPLICATION_SERVER_CONFIG + " not String");<NEW_LINE>}<NEW_LINE>final URL localhost;<NEW_LINE>try {<NEW_LINE>localhost = new URL((String) appServer);<NEW_LINE>} catch (final MalformedURLException e) {<NEW_LINE>throw new IllegalArgumentException(StreamsConfig.APPLICATION_SERVER_CONFIG + " malformed: " + "'" + appServer + "'");<NEW_LINE>}<NEW_LINE>final PushLocator pushLocator = new AllHostsLocator(allPersistentQueries, localhost);<NEW_LINE>return Optional.of(new ScalablePushRegistry(pushLocator, logicalSchema, isTable, consumerProperties, ksqlTopic, serviceContext, ksqlConfig, sourceApplicationId, KafkaConsumerFactory::create, LatestConsumer::new, CatchupConsumer::new, Executors.newSingleThreadExecutor(), Executors.newScheduledThreadPool(ksqlConfig.getInt<MASK><NEW_LINE>} | (KsqlConfig.KSQL_QUERY_PUSH_V2_MAX_CATCHUP_CONSUMERS)))); |
1,521,827 | public static void pasteSelectedChunks(TileMap tileMap, Stage primaryStage) {<NEW_LINE>if (tileMap.isInPastingMode()) {<NEW_LINE>DataProperty<ImportConfirmationDialog.ChunkImportConfirmationData> dataProperty = new DataProperty<>();<NEW_LINE>ChunkImportConfirmationData preFill = new ChunkImportConfirmationData(tileMap.getPastedChunksOffset(), 0, true, false, null);<NEW_LINE>Optional<ButtonType> result = new ImportConfirmationDialog(primaryStage, preFill, dataProperty::set).showAndWait();<NEW_LINE>result.ifPresent(r -> {<NEW_LINE>if (r == ButtonType.OK) {<NEW_LINE>DataProperty<Map<Point2i, RegionDirectories>> tempFiles = new DataProperty<>();<NEW_LINE>new CancellableProgressDialog(Translation.DIALOG_PROGRESS_TITLE_IMPORTING_CHUNKS, primaryStage).showProgressBar(t -> ChunkImporter.importChunks(tileMap.getPastedWorld(), t, false, dataProperty.get().overwrite(), new SelectionData(tileMap.getPastedChunks(), tileMap.getPastedChunksInverted()), dataProperty.get().selectionOnly() ? new SelectionData(tileMap.getMarkedChunks(), tileMap.isSelectionInverted()) : null, dataProperty.get().getRanges(), dataProperty.get().getOffset(), tempFiles));<NEW_LINE>deleteTempFiles(tempFiles.get());<NEW_LINE>CacheHelper.clearAllCache(tileMap);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Clipboard clipboard = Toolkit<MASK><NEW_LINE>Transferable content = clipboard.getContents(tileMap);<NEW_LINE>DataFlavor[] flavors = content.getTransferDataFlavors();<NEW_LINE>if (flavors.length == 1 && flavors[0].equals(TileMapSelection.SELECTION_DATA_FLAVOR)) {<NEW_LINE>try {<NEW_LINE>Object data = content.getTransferData(flavors[0]);<NEW_LINE>Selection selection = (Selection) data;<NEW_LINE>tileMap.setPastedChunks(selection.getSelectionData(), selection.isInverted(), selection.getMin(), selection.getMax(), selection.getWorld());<NEW_LINE>tileMap.draw();<NEW_LINE>} catch (UnsupportedFlavorException | IOException ex) {<NEW_LINE>Debug.dumpException("failed to paste chunks", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getDefaultToolkit().getSystemClipboard(); |
182,521 | public String buildAppConfig(DeployAppBuildAppConfigReq request, String operator) {<NEW_LINE>AppPackageDO appPackageDO = appPackageRepository.getByCondition(AppPackageQueryCondition.builder().id(request.getAppPackageId()).withBlobs(false).build());<NEW_LINE>DeployAppSchema deployAppSchema = new DeployAppSchema();<NEW_LINE>deployAppSchema.setApiVersion("core.oam.dev/v1alpha2");<NEW_LINE>deployAppSchema.setKind("ApplicationConfiguration");<NEW_LINE>MetaData metaData = new MetaData();<NEW_LINE>metaData.setName("deploy-app-package");<NEW_LINE>MetaDataAnnotations annotations = new MetaDataAnnotations();<NEW_LINE>annotations.setAppId(appPackageDO.getAppId());<NEW_LINE>annotations.setAppPackageId(appPackageDO.getId());<NEW_LINE>metaData.setAnnotations(annotations);<NEW_LINE>Spec spec = new Spec();<NEW_LINE>for (ComponentBinder componentBinder : request.getComponentList()) {<NEW_LINE>SpecComponent specComponent = new SpecComponent();<NEW_LINE>specComponent.setRevisionName(getComponentRevisionName(componentBinder));<NEW_LINE>specComponent.setScopes(getSpecComponentScope());<NEW_LINE>Schema schema;<NEW_LINE>try {<NEW_LINE>schema = getSchema(appPackageDO.getAppId(), componentBinder);<NEW_LINE>} catch (AppException e) {<NEW_LINE>log.error("action=deployAppPackageService|generateDeployYaml|Error|e={}", e.getErrorMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>specComponent.setParameterValues(getParameterValue(componentBinder, schema));<NEW_LINE>specComponent.setTraits(getSpecComponentTrait(componentBinder));<NEW_LINE>specComponent.setDataOutputs(getDataOutputList(componentBinder, schema));<NEW_LINE>specComponent.setDataInputs(getDataInputList(componentBinder, schema));<NEW_LINE>specComponent.setDependencies(getDependencyList(componentBinder, request.getComponentList()));<NEW_LINE>spec.<MASK><NEW_LINE>}<NEW_LINE>deployAppSchema.setSpec(spec);<NEW_LINE>Yaml yaml = SchemaUtil.createYaml();<NEW_LINE>return yaml.dumpAsMap(deployAppSchema);<NEW_LINE>} | getComponents().add(specComponent); |
285,594 | private void buildRuleTable(FDE fde, long instructionPointer) throws IOException {<NEW_LINE>PrintStream out = System.err;<NEW_LINE>state = new RuleState();<NEW_LINE>state.registerRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>{<NEW_LINE>// out.printf("CIE has initial instructions:\n");<NEW_LINE>//<NEW_LINE>// String s = "";<NEW_LINE>// for( byte b: fde.getCIE().getInitialInstructions() ) {<NEW_LINE>// s += String.format("0x%x ", b);<NEW_LINE>// }<NEW_LINE>// out.println(s);<NEW_LINE>// ByteBuffer initialInstructionStream = ByteBuffer.wrap(fde.getCIE().getInitialInstructions());<NEW_LINE>// initialInstructionStream.order(fde.getCIE().byteOrder);<NEW_LINE>InputStream i = new ByteArrayInputStream(fde.getCIE().getInitialInstructions());<NEW_LINE><MASK><NEW_LINE>initialInstructionStream.setByteOrder(fde.getCIE().byteOrder);<NEW_LINE>// System.err.println("Initial Instructions:");<NEW_LINE>while (initialInstructionStream.getStreamPosition() < fde.getCIE().getInitialInstructions().length) {<NEW_LINE>// currentAddress is 0 as initialInstructions are always applied.<NEW_LINE>processInstruction(/*out,*/<NEW_LINE>initialInstructionStream, fde.getCIE(), state, 0);<NEW_LINE>// out.println();<NEW_LINE>}<NEW_LINE>state.cieRegisterRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>// We can copy the rules as rules are immutable. (Don't need a deep copy.)<NEW_LINE>state.cieRegisterRules.putAll(state.registerRules);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// System.err.printf("FDE has instructions:\n");<NEW_LINE>//<NEW_LINE>// String s = "";<NEW_LINE>// for( byte b: fde.getCallFrameInstructions()) {<NEW_LINE>// s += String.format("0x%x ", b);<NEW_LINE>// }<NEW_LINE>// out.println(s);<NEW_LINE>InputStream i = new ByteArrayInputStream(fde.getCallFrameInstructions());<NEW_LINE>ImageInputStream instructionStream = new MemoryCacheImageInputStream(i);<NEW_LINE>instructionStream.setByteOrder(fde.getCIE().byteOrder);<NEW_LINE>Map<Integer, RegisterRule> fdeRules = new HashMap<Integer, RegisterRule>();<NEW_LINE>// fdeRules.putAll(ruleRows.get(ruleRows.size()-1));<NEW_LINE>long currentAddress = fde.getBaseAddress();<NEW_LINE>// out.printf("@0x%x -\t", currentAddress);<NEW_LINE>// System.err.println("FDE Instructions:");<NEW_LINE>while (instructionStream.getStreamPosition() < fde.getCallFrameInstructions().length && instructionPointer >= currentAddress) {<NEW_LINE>currentAddress = processInstruction(/*out,*/<NEW_LINE>instructionStream, fde.getCIE(), state, currentAddress);<NEW_LINE>// out.println();<NEW_LINE>// out.printf("@0x%x -\t", currentAddress);<NEW_LINE>}<NEW_LINE>// out.println();<NEW_LINE>}<NEW_LINE>} | ImageInputStream initialInstructionStream = new MemoryCacheImageInputStream(i); |
1,637,178 | protected void validateOverridingRules(Set<String> overridingFieldNames, NullAway analysis, VisitorState state, MethodTree tree, Symbol.MethodSymbol overriddenMethod) {<NEW_LINE>Set<String> overriddenFieldNames = getAnnotationValueArray(overriddenMethod, annotName, false);<NEW_LINE>if (overriddenFieldNames == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (overridingFieldNames == null) {<NEW_LINE>overridingFieldNames = Collections.emptySet();<NEW_LINE>}<NEW_LINE>if (overridingFieldNames.containsAll(overriddenFieldNames)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>overriddenFieldNames.removeAll(overridingFieldNames);<NEW_LINE>StringBuilder errorMessage = new StringBuilder();<NEW_LINE>errorMessage.append("postcondition inheritance is violated, this method must guarantee that all fields written in the @EnsuresNonNull annotation of overridden method ").append(castToNonNull(ASTHelpers.enclosingClass(overriddenMethod)).getSimpleName()).append(".").append(overriddenMethod.getSimpleName()).append(" are @NonNull at exit point as well. Fields [");<NEW_LINE>Iterator<String> iterator = overriddenFieldNames.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>errorMessage.<MASK><NEW_LINE>if (iterator.hasNext()) {<NEW_LINE>errorMessage.append(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>errorMessage.append("] must explicitly appear as parameters at this method @EnsuresNonNull annotation");<NEW_LINE>state.reportMatch(analysis.getErrorBuilder().createErrorDescription(new ErrorMessage(ErrorMessage.MessageTypes.WRONG_OVERRIDE_POSTCONDITION, errorMessage.toString()), tree, analysis.buildDescription(tree), state, null));<NEW_LINE>} | append(iterator.next()); |
1,010,585 | protected void onDraw(Canvas canvas) {<NEW_LINE>if (!mHasSelectorWheel) {<NEW_LINE>super.onDraw(canvas);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float x = (getRight() - getLeft()) / 2;<NEW_LINE>float y = mCurrentScrollOffset;<NEW_LINE>if (mVirtualButtonPressedDrawable != null && mScrollState == OnScrollListener.SCROLL_STATE_IDLE) {<NEW_LINE>if (mDecrementVirtualButtonPressed) {<NEW_LINE>mVirtualButtonPressedDrawable.setState(PRESSED_STATE_SET);<NEW_LINE>mVirtualButtonPressedDrawable.setBounds(0, 0, getRight(), mTopSelectionDividerTop);<NEW_LINE>mVirtualButtonPressedDrawable.draw(canvas);<NEW_LINE>}<NEW_LINE>if (mIncrementVirtualButtonPressed) {<NEW_LINE>mVirtualButtonPressedDrawable.setState(PRESSED_STATE_SET);<NEW_LINE>mVirtualButtonPressedDrawable.setBounds(0, mBottomSelectionDividerBottom, getRight(), getBottom());<NEW_LINE>mVirtualButtonPressedDrawable.draw(canvas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] selectorIndices = mSelectorIndices;<NEW_LINE>for (int i = 0; i < selectorIndices.length; i++) {<NEW_LINE>int selectorIndex = selectorIndices[i];<NEW_LINE>String scrollSelectorValue = mSelectorIndexToStringCache.get(selectorIndex);<NEW_LINE>if (i != NumberPicker.SELECTOR_WHELL_MIDDLE_ITEM_INDEX || mInputText.getVisibility() != View.VISIBLE) {<NEW_LINE>canvas.drawText(<MASK><NEW_LINE>}<NEW_LINE>y += mSelectorElementHeight;<NEW_LINE>}<NEW_LINE>if (mSelectionDivider != null) {<NEW_LINE>int topOfTopDivider = mTopSelectionDividerTop;<NEW_LINE>int bottomOfTopDivider = topOfTopDivider + mSelectionDividerHeight;<NEW_LINE>mSelectionDivider.setBounds(0, topOfTopDivider, getRight(), bottomOfTopDivider);<NEW_LINE>mSelectionDivider.draw(canvas);<NEW_LINE>int bottomOfBottomDivider = mBottomSelectionDividerBottom;<NEW_LINE>int topOfBottomDivider = bottomOfBottomDivider - mSelectionDividerHeight;<NEW_LINE>mSelectionDivider.setBounds(0, topOfBottomDivider, getRight(), bottomOfBottomDivider);<NEW_LINE>mSelectionDivider.draw(canvas);<NEW_LINE>}<NEW_LINE>} | scrollSelectorValue, x, y, mSelectorWheelPaint); |
746,978 | final ListUserTagsResult executeListUserTags(ListUserTagsRequest listUserTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUserTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUserTagsRequest> request = null;<NEW_LINE>Response<ListUserTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUserTagsRequestMarshaller().marshall(super.beforeMarshalling(listUserTagsRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUserTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListUserTagsResult> responseHandler = new StaxResponseHandler<ListUserTagsResult>(new ListUserTagsResultStaxUnmarshaller());<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); |
910,570 | public PlacementTemplate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PlacementTemplate placementTemplate = new PlacementTemplate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("defaultAttributes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>placementTemplate.setDefaultAttributes(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("deviceTemplates", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>placementTemplate.setDeviceTemplates(new MapUnmarshaller<String, DeviceTemplate>(context.getUnmarshaller(String.class), DeviceTemplateJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return placementTemplate;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
34,290 | public static File normalize(final String path) {<NEW_LINE>Stack s = new Stack();<NEW_LINE>String[] dissect = dissect(path);<NEW_LINE>s.push(dissect[0]);<NEW_LINE>StringTokenizer tok = new StringTokenizer(dissect[1], File.separator);<NEW_LINE>while (tok.hasMoreTokens()) {<NEW_LINE>String thisToken = tok.nextToken();<NEW_LINE>if (".".equals(thisToken)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if ("..".equals(thisToken)) {<NEW_LINE>if (s.size() < 2) {<NEW_LINE>// Cannot resolve it, so skip it.<NEW_LINE>return new File(path);<NEW_LINE>}<NEW_LINE>s.pop();<NEW_LINE>} else {<NEW_LINE>// plain component<NEW_LINE>s.push(thisToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int i = 0; i < s.size(); i++) {<NEW_LINE>if (i > 1) {<NEW_LINE>// not before the filesystem root and not after it, since root<NEW_LINE>// already contains one<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>sb.append(s.elementAt(i));<NEW_LINE>}<NEW_LINE>return new File(sb.toString());<NEW_LINE>} | sb.append(File.separatorChar); |
992,483 | private static void sortSam(final File input, final File output, final File reference, final ValidationStringency stringency) {<NEW_LINE><MASK><NEW_LINE>// We can't use ArgumentsBuilder since it assumes GATK argument names, but we're running a Picard<NEW_LINE>// tool, which uses upper case argument names.<NEW_LINE>final List<String> args = new ArrayList<>(6);<NEW_LINE>args.add("-I");<NEW_LINE>args.add(input.getAbsolutePath());<NEW_LINE>args.add("-O");<NEW_LINE>args.add(output.getAbsolutePath());<NEW_LINE>args.add("-SO");<NEW_LINE>args.add(SAMFileHeader.SortOrder.coordinate.name());<NEW_LINE>args.add("--VALIDATION_STRINGENCY");<NEW_LINE>args.add(stringency.name());<NEW_LINE>if (reference != null) {<NEW_LINE>args.add("--REFERENCE_SEQUENCE");<NEW_LINE>args.add(reference.getAbsolutePath());<NEW_LINE>}<NEW_LINE>int returnCode = sort.instanceMain(args.toArray(new String[0]));<NEW_LINE>if (returnCode != 0) {<NEW_LINE>throw new RuntimeException("Failure running SortSam on inputs");<NEW_LINE>}<NEW_LINE>} | final SortSam sort = new SortSam(); |
294,045 | public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Level world, BlockState blockState, IProbeHitData data) {<NEW_LINE>BlockEntity te = world.getBlockEntity(data.getPos());<NEW_LINE>if (te instanceof IEBlockInterfaces.IConfigurableSides && data.getSideHit() != null) {<NEW_LINE>boolean flip = player.isShiftKeyDown();<NEW_LINE>Direction side = flip ? data.getSideHit().getOpposite() : data.getSideHit();<NEW_LINE>IOSideConfig config = ((IEBlockInterfaces.IConfigurableSides) te).getSideConfig(side);<NEW_LINE>TextComponent combined = new TextComponent("");<NEW_LINE>TranslatableComponent direction = new TranslatableComponent(Lib.DESC_INFO + "blockSide." + <MASK><NEW_LINE>TranslatableComponent connection = new TranslatableComponent(Lib.DESC_INFO + "blockSide.io." + config.getSerializedName());<NEW_LINE>combined.append(direction);<NEW_LINE>combined.append(": ");<NEW_LINE>combined.append(connection);<NEW_LINE>probeInfo.text(combined);<NEW_LINE>}<NEW_LINE>} | (flip ? "opposite" : "facing")); |
275,809 | private static void tryComputeLayer2EdgesForLayer1ChildEdge(Layer1Edge layer1MappedEdge, Map<String, Configuration> configurations, Consumer<Layer2Edge> edges, Map<String, InterfacesByVlanRange> vlanRangesPerNode) {<NEW_LINE>Layer1Node node1 = layer1MappedEdge.getNode1();<NEW_LINE>Layer1Node node2 = layer1MappedEdge.getNode2();<NEW_LINE>Interface i1 = getInterface(node1, configurations);<NEW_LINE>Interface i2 = getInterface(node2, configurations);<NEW_LINE>// Exit early if either interface is missing<NEW_LINE>if (i1 == null || i2 == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (i1.getSwitchportMode() == SwitchportMode.TRUNK || i2.getSwitchportMode() == SwitchportMode.TRUNK) {<NEW_LINE>addLayer2TrunkEdges(i1, i2, edges, node1, node2, vlanRangesPerNode);<NEW_LINE>} else if (i1.getEncapsulationVlan() != null || i2.getEncapsulationVlan() != null) {<NEW_LINE>// Both interfaces are tagged Layer3 interfaces<NEW_LINE>tryAddLayer2TaggedNonTrunkEdge(i1, i2, edges, node1, node2);<NEW_LINE>} else {<NEW_LINE>Integer node1VlanId = i1.getSwitchportMode() == SwitchportMode.ACCESS <MASK><NEW_LINE>Integer node2VlanId = i2.getSwitchportMode() == SwitchportMode.ACCESS ? i2.getAccessVlan() : null;<NEW_LINE>edges.accept(new Layer2Edge(node1, node1VlanId == null ? null : Range.singleton(node1VlanId), node2, node2VlanId == null ? null : Range.singleton(node2VlanId)));<NEW_LINE>}<NEW_LINE>} | ? i1.getAccessVlan() : null; |
67,903 | private void initPersistedHosts() {<NEW_LINE>if (HostsSupport.storageDirectoryExists()) {<NEW_LINE>File storageDir = HostsSupport.getStorageDirectory();<NEW_LINE>File[] files = storageDir.listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return name.endsWith(Storage.DEFAULT_PROPERTIES_EXT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Set<File> unresolvedHostsF = new HashSet();<NEW_LINE>Set<String> unresolvedHostsS = new HashSet();<NEW_LINE>Set<RemoteHostImpl> hosts = new HashSet();<NEW_LINE>for (File file : files) {<NEW_LINE>if (HostsSupportImpl.LOCALHOST_PROPERTIES_FILENAME.equals(file.getName()))<NEW_LINE>continue;<NEW_LINE>Storage storage = new Storage(<MASK><NEW_LINE>String hostName = storage.getCustomProperty(PROPERTY_HOSTNAME);<NEW_LINE>RemoteHostImpl persistedHost = null;<NEW_LINE>try {<NEW_LINE>persistedHost = new RemoteHostImpl(hostName, storage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.throwing(HostProvider.class.getName(), "initPersistedHosts", e);<NEW_LINE>unresolvedHostsF.add(file);<NEW_LINE>unresolvedHostsS.add(hostName);<NEW_LINE>}<NEW_LINE>if (persistedHost != null)<NEW_LINE>hosts.add(persistedHost);<NEW_LINE>}<NEW_LINE>if (!unresolvedHostsF.isEmpty())<NEW_LINE>notifyUnresolvedHosts(unresolvedHostsF, unresolvedHostsS);<NEW_LINE>RemoteHostsContainer.sharedInstance().getRepository().addDataSources(hosts);<NEW_LINE>}<NEW_LINE>} | storageDir, file.getName()); |
1,746,347 | public static void register(String userName, String userPassword, String session) {<NEW_LINE>Context context = ContextFactory.getContext();<NEW_LINE>SharedPreferences userPrefs = context.getSharedPreferences<MASK><NEW_LINE>if (userName != null && userName.length() != 0 && userPassword != null && userPassword.length() != 0) {<NEW_LINE>Editor userEditor = userPrefs.edit();<NEW_LINE>userEditor.putString(ANS_USER_PREF_USER, userName);<NEW_LINE>userEditor.putString(ANS_USER_PREF_PASS, userPassword);<NEW_LINE>userEditor.putString(ANS_USER_PREF_SESSION, session);<NEW_LINE>userEditor.commit();<NEW_LINE>} else {<NEW_LINE>userName = userPrefs.getString(ANS_USER_PREF_USER, "");<NEW_LINE>userPassword = userPrefs.getString(ANS_USER_PREF_PASS, "");<NEW_LINE>if (session == null || session.length() == 0) {<NEW_LINE>session = userPrefs.getString(ANS_USER_PREF_SESSION, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (userName == null || userName.length() == 0 || userPassword == null || userPassword.length() == 0 || session == null || session.length() == 0) {<NEW_LINE>PushContract.handleError(context, "Incomplete registration credentials", ANS_PUSH_CLIENT);<NEW_LINE>}<NEW_LINE>ANSManager.register(context, RhoConf.getString(ANS_APP_NAME), userName, userPassword, session, RhoConf.getString(ANS_SERVER));<NEW_LINE>} | (getSharedPrefName(context), 0); |
11,770 | static String generateGlobalKey(final ComponentContext parentContext, @Nullable final Component parentComponent, final Component childComponent) {<NEW_LINE>final boolean hasManualKey = childComponent.hasManualKey();<NEW_LINE>final String key = hasManualKey ? "$" + childComponent.getKey() : childComponent.getKey();<NEW_LINE>final String globalKey;<NEW_LINE>if (parentComponent == null) {<NEW_LINE>globalKey = key;<NEW_LINE>} else {<NEW_LINE>final String parentGlobalKey = parentContext.getGlobalKey();<NEW_LINE>if (parentGlobalKey == null) {<NEW_LINE>logParentHasNullGlobalKey(parentComponent, childComponent);<NEW_LINE>globalKey = "null" + key;<NEW_LINE>} else {<NEW_LINE>final String <MASK><NEW_LINE>final int index;<NEW_LINE>if (hasManualKey) {<NEW_LINE>index = parentContext.getScopedComponentInfo().getManualKeyUsagesCountAndIncrement(key);<NEW_LINE>if (index != 0) {<NEW_LINE>logDuplicateManualKeyWarning(childComponent, key.substring(1));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>index = parentContext.getScopedComponentInfo().getChildCountAndIncrement(childComponent);<NEW_LINE>}<NEW_LINE>globalKey = getKeyForChildPosition(childKey, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return globalKey;<NEW_LINE>} | childKey = getKeyWithSeparator(parentGlobalKey, key); |
1,228,238 | public static void writeSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder) throws IOException {<NEW_LINE>xContentBuilder.startObject();<NEW_LINE>if (request.indices() != null) {<NEW_LINE>xContentBuilder.field("index", request.indices());<NEW_LINE>}<NEW_LINE>if (request.indicesOptions() != null && request.indicesOptions() != SearchRequest.DEFAULT_INDICES_OPTIONS) {<NEW_LINE>if (request.indicesOptions().expandWildcardsOpen() && request.indicesOptions().expandWildcardsClosed()) {<NEW_LINE>xContentBuilder.field("expand_wildcards", "all");<NEW_LINE>} else if (request.indicesOptions().expandWildcardsOpen()) {<NEW_LINE>xContentBuilder.field("expand_wildcards", "open");<NEW_LINE>} else if (request.indicesOptions().expandWildcardsClosed()) {<NEW_LINE>xContentBuilder.field("expand_wildcards", "closed");<NEW_LINE>} else {<NEW_LINE>xContentBuilder.field("expand_wildcards", "none");<NEW_LINE>}<NEW_LINE>xContentBuilder.field("ignore_unavailable", request.indicesOptions().ignoreUnavailable());<NEW_LINE>xContentBuilder.field("allow_no_indices", request.indicesOptions().allowNoIndices());<NEW_LINE>}<NEW_LINE>if (request.types() != null) {<NEW_LINE>xContentBuilder.field("types", request.types());<NEW_LINE>}<NEW_LINE>if (request.searchType() != null) {<NEW_LINE>xContentBuilder.field("search_type", request.searchType().name().toLowerCase(Locale.ROOT));<NEW_LINE>}<NEW_LINE>if (request.requestCache() != null) {<NEW_LINE>xContentBuilder.field(<MASK><NEW_LINE>}<NEW_LINE>if (request.preference() != null) {<NEW_LINE>xContentBuilder.field("preference", request.preference());<NEW_LINE>}<NEW_LINE>if (request.routing() != null) {<NEW_LINE>xContentBuilder.field("routing", request.routing());<NEW_LINE>}<NEW_LINE>if (request.tokenRanges() != null) {<NEW_LINE>xContentBuilder.field("tokens", request.tokenRanges());<NEW_LINE>}<NEW_LINE>if (request.tokenRangesBitsetCache() != null) {<NEW_LINE>xContentBuilder.field("token_ranges_bitset_cache", request.tokenRanges());<NEW_LINE>}<NEW_LINE>if (request.allowPartialSearchResults() != null) {<NEW_LINE>xContentBuilder.field("allow_partial_search_results", request.allowPartialSearchResults());<NEW_LINE>}<NEW_LINE>xContentBuilder.endObject();<NEW_LINE>} | "request_cache", request.requestCache()); |
1,714,174 | private void updateView(NeededMapsVH holder) {<NEW_LINE>boolean paidVersion = Version.isPaidVersion(app);<NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>IndexItem item = items.get(i);<NEW_LINE>boolean downloading = downloadThread.isDownloading(item);<NEW_LINE>boolean currentDownloading = downloading && downloadThread.getCurrentDownloadingItem() == item;<NEW_LINE>boolean lastItem = i == items.size() - 1;<NEW_LINE>final View view = holder.itemsContainer.getChildAt(i);<NEW_LINE>if (item.isDownloaded()) {<NEW_LINE>view.setOnClickListener(null);<NEW_LINE>} else {<NEW_LINE>view.setTag(item);<NEW_LINE>view.setOnClickListener(onItemClickListener);<NEW_LINE>}<NEW_LINE>((ImageView) view.findViewById(R.id.icon)).setImageDrawable(getActiveIcon(item.getType().getIconResource()));<NEW_LINE>((TextView) view.findViewById(R.id.title)).setText(item.getVisibleName(app, app.getRegions(), false));<NEW_LINE>((TextView) view.findViewById(R.id.description)).setText(getItemDescription(item));<NEW_LINE>ImageView iconAction = (ImageView) view.findViewById(R.id.icon_action);<NEW_LINE>Button buttonAction = (Button) view.findViewById(R.id.button_action);<NEW_LINE>if (item.isDownloaded()) {<NEW_LINE>iconAction.setVisibility(View.GONE);<NEW_LINE>buttonAction.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>boolean showBtn = !paidVersion && (item.getType() == DownloadActivityType.WIKIPEDIA_FILE || item.getType() == DownloadActivityType.TRAVEL_FILE);<NEW_LINE>iconAction.setVisibility(showBtn ? View.GONE : View.VISIBLE);<NEW_LINE>buttonAction.setVisibility(showBtn ? View.VISIBLE : View.GONE);<NEW_LINE>if (showBtn) {<NEW_LINE>buttonAction.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>view.callOnClick();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>iconAction.setImageDrawable(downloading ? cancelIcon : downloadIcon);<NEW_LINE>buttonAction.setOnClickListener(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress_bar);<NEW_LINE>progressBar.setVisibility(downloading ? View.VISIBLE : View.GONE);<NEW_LINE>if (currentDownloading) {<NEW_LINE><MASK><NEW_LINE>progressBar.setProgress(progress < 0 ? 0 : progress);<NEW_LINE>} else {<NEW_LINE>progressBar.setProgress(0);<NEW_LINE>}<NEW_LINE>view.findViewById(R.id.divider).setVisibility(lastItem ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE>} | int progress = downloadThread.getCurrentDownloadingItemProgress(); |
714,240 | protected Bundle doInBackground(Bundle... params) {<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>Bundle args = params[0];<NEW_LINE>String userID;<NEW_LINE>try {<NEW_LINE>LinkedInApiClient client = mLinkedInApiClientFactory.createLinkedInApiClient(new LinkedInAccessToken(mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_TOKEN, null), mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_SECRET, null)));<NEW_LINE>Person person;<NEW_LINE>if (args.containsKey(PARAM_USER_ID)) {<NEW_LINE>userID = args.getString(PARAM_USER_ID);<NEW_LINE>result.putBoolean(CURRENT, false);<NEW_LINE>Set<ProfileField> scope = EnumSet.of(ProfileField.PICTURE_URL, ProfileField.ID, ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.PUBLIC_PROFILE_URL);<NEW_LINE>person = client.getProfileById(userID, scope);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>person = client.getProfileForCurrentUser(PROFILE_PARAMETERS);<NEW_LINE>}<NEW_LINE>SocialPerson socialPerson = new SocialPerson();<NEW_LINE>getSocialPerson(socialPerson, person);<NEW_LINE>result.putParcelable(REQUEST_GET_PERSON, socialPerson);<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.putString(RESULT_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result.putBoolean(CURRENT, true); |
304,048 | final GetAutoSnapshotsResult executeGetAutoSnapshots(GetAutoSnapshotsRequest getAutoSnapshotsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAutoSnapshotsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAutoSnapshotsRequest> request = null;<NEW_LINE>Response<GetAutoSnapshotsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAutoSnapshotsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAutoSnapshotsRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAutoSnapshots");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAutoSnapshotsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAutoSnapshotsResultJsonUnmarshaller());<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); |
995,353 | static ShapeFill newInstance(JSONObject json, LottieComposition composition) {<NEW_LINE>AnimatableColorValue color = null;<NEW_LINE>boolean fillEnabled;<NEW_LINE>AnimatableIntegerValue opacity = null;<NEW_LINE>JSONObject <MASK><NEW_LINE>if (jsonColor != null) {<NEW_LINE>color = AnimatableColorValue.Factory.newInstance(jsonColor, composition);<NEW_LINE>}<NEW_LINE>JSONObject jsonOpacity = json.optJSONObject("o");<NEW_LINE>if (jsonOpacity != null) {<NEW_LINE>opacity = AnimatableIntegerValue.Factory.newInstance(jsonOpacity, composition);<NEW_LINE>}<NEW_LINE>fillEnabled = json.optBoolean("fillEnabled");<NEW_LINE>int fillTypeInt = json.optInt("r", 1);<NEW_LINE>Path.FillType fillType = fillTypeInt == 1 ? Path.FillType.WINDING : Path.FillType.EVEN_ODD;<NEW_LINE>return new ShapeFill(fillEnabled, fillType, color, opacity);<NEW_LINE>} | jsonColor = json.optJSONObject("c"); |
83,435 | protected void layoutPeer() {<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!superPeerMode) {<NEW_LINE>// called by Codename One EDT to position the native component.<NEW_LINE>activity.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (layoutWrapper != null) {<NEW_LINE>if (v.getVisibility() == View.VISIBLE) {<NEW_LINE>RelativeLayout.LayoutParams layoutParams = layoutWrapper.createMyLayoutParams(AndroidImplementation.AndroidPeer.this.getAbsoluteX(), AndroidImplementation.AndroidPeer.this.getAbsoluteY(), AndroidImplementation.AndroidPeer.this.getWidth(), AndroidImplementation.<MASK><NEW_LINE>layoutWrapper.setLayoutParams(layoutParams);<NEW_LINE>if (AndroidImplementation.this.relativeLayout != null) {<NEW_LINE>AndroidImplementation.this.relativeLayout.requestLayout();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | AndroidPeer.this.getHeight()); |
941,612 | private List<Integer> columnTypesForQuery(String table) {<NEW_LINE>if ("revlog".equals(table)) {<NEW_LINE>return Arrays.asList(TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, <MASK><NEW_LINE>} else if ("cards".equals(table)) {<NEW_LINE>return Arrays.asList(TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_STRING);<NEW_LINE>} else {<NEW_LINE>return Arrays.asList(TYPE_INTEGER, TYPE_STRING, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_INTEGER, TYPE_STRING);<NEW_LINE>}<NEW_LINE>} | TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER, TYPE_INTEGER); |
1,651,387 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> executions = new ArrayList<>();<NEW_LINE>executions.add(new ExprDTIntervalCalendarOps());<NEW_LINE>executions.add(new ExprDTIntervalInvalid());<NEW_LINE>executions.add(new ExprDTIntervalBeforeInSelectClause());<NEW_LINE>executions.add(new ExprDTIntervalBeforeWhereClauseWithBean());<NEW_LINE>executions.add(new ExprDTIntervalBeforeWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalAfterWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalCoincidesWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalDuringWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalFinishesWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalFinishedByWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalIncludesByWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalMeetsWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalMetByWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalOverlapsWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalOverlappedByWhereClause());<NEW_LINE>executions.add(new ExprDTIntervalStartsWhereClause());<NEW_LINE>executions<MASK><NEW_LINE>executions.add(new ExprDTIntervalPointInTimeWCalendarOps());<NEW_LINE>executions.add(new ExprDTIntervalBeforeWVariable());<NEW_LINE>executions.add(new ExprDTIntervalTimePeriodWYearNonConst());<NEW_LINE>return executions;<NEW_LINE>} | .add(new ExprDTIntervalStartedByWhereClause()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.