idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
620,294 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaStore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
976,867 | static private void onnxTypeToJson(JsonGenerator g, Onnx.ValueInfoProto valueInfo) throws IOException {<NEW_LINE>g.writeStartObject();<NEW_LINE>g.writeStringField("name", valueInfo.getName());<NEW_LINE>g.writeStringField("type", onnxValueTypeToString(valueInfo.getType().getTensorType().getElemType()));<NEW_LINE>g.writeArrayFieldStart("dim");<NEW_LINE>for (Onnx.TensorShapeProto.Dimension dim : valueInfo.getType().getTensorType().getShape().getDimList()) {<NEW_LINE>g.writeStartObject();<NEW_LINE>if (dim.hasDimParam()) {<NEW_LINE>g.writeStringField("type", "param");<NEW_LINE>g.writeStringField("size", dim.getDimParam());<NEW_LINE>} else {<NEW_LINE>g.writeStringField("type", "value");<NEW_LINE>g.writeNumberField(<MASK><NEW_LINE>}<NEW_LINE>g.writeEndObject();<NEW_LINE>}<NEW_LINE>g.writeEndArray();<NEW_LINE>g.writeEndObject();<NEW_LINE>} | "size", dim.getDimValue()); |
685,300 | protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>Pack p = null;<NEW_LINE>try {<NEW_LINE>p = tcp.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>if (p != null) {<NEW_LINE>final List<SummaryData> list = new ArrayList<SummaryData>();<NEW_LINE>MapPack m = (MapPack) p;<NEW_LINE>ListValue idLv = m.getList("id");<NEW_LINE>ListValue countLv = m.getList("count");<NEW_LINE>ListValue errorLv = m.getList("error");<NEW_LINE>ListValue elapsedLv = m.getList("elapsed");<NEW_LINE>for (int i = 0; i < idLv.size(); i++) {<NEW_LINE>SummaryData data = new SummaryData();<NEW_LINE>data.hash = idLv.getInt(i);<NEW_LINE>data.count = countLv.getInt(i);<NEW_LINE>data.errorCount = errorLv.getInt(i);<NEW_LINE>data.elapsedSum = elapsedLv.getLong(i);<NEW_LINE>list.add(data);<NEW_LINE>}<NEW_LINE>TextProxy.apicall.load(date, idLv, serverId);<NEW_LINE>ExUtil.exec(viewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>viewer.setInput(list);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | getSingle(RequestCmd.LOAD_APICALL_SUMMARY, param); |
1,040,451 | private static Pair<String, ArrayList<String>> build(Where where) {<NEW_LINE>StringBuilder selectionBuilder = new StringBuilder();<NEW_LINE>ArrayList<String> selectionArgsBuilder = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < where.whereSpecs.size(); i++) {<NEW_LINE>Object obj = <MASK><NEW_LINE>boolean and;<NEW_LINE>boolean braces = false;<NEW_LINE>Pair<String, ArrayList<String>> sel;<NEW_LINE>if (obj instanceof Where) {<NEW_LINE>braces = true;<NEW_LINE>Where where2 = (Where) obj;<NEW_LINE>and = where2.and;<NEW_LINE>sel = build(where2);<NEW_LINE>} else {<NEW_LINE>WhereSpec spec = (WhereSpec) obj;<NEW_LINE>and = spec.and;<NEW_LINE>sel = build(spec);<NEW_LINE>}<NEW_LINE>if (i > 0) {<NEW_LINE>selectionBuilder.append(and ? AND : OR);<NEW_LINE>}<NEW_LINE>if (braces) {<NEW_LINE>selectionBuilder.append("(").append(sel.first).append(")");<NEW_LINE>} else {<NEW_LINE>selectionBuilder.append(sel.first);<NEW_LINE>}<NEW_LINE>selectionArgsBuilder.addAll(sel.second);<NEW_LINE>}<NEW_LINE>return Pair.create(selectionBuilder.toString(), selectionArgsBuilder);<NEW_LINE>} | where.whereSpecs.get(i); |
1,717,037 | private void analyzeNonStdOutSink(final Sink sink) {<NEW_LINE>final CreateSourceAsProperties props = sink.getProperties();<NEW_LINE>analysis.setProperties(props);<NEW_LINE>if (!sink.shouldCreateSink()) {<NEW_LINE>final DataSource existing = metaStore.getSource(sink.getName());<NEW_LINE>if (existing == null) {<NEW_LINE>throw new KsqlException("Unknown source: " + sink.getName().toString(FormatOptions.noEscape()));<NEW_LINE>}<NEW_LINE>analysis.setInto(Into.existingSink(sink.getName(), existing.getKsqlTopic()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String topicName = props.getKafkaTopic().orElseGet(() -> topicPrefix + sink.getName().text());<NEW_LINE>final KsqlTopic srcTopic = analysis.getFrom()<MASK><NEW_LINE>final String keyFormatName = keyFormatName(props.getKeyFormat(), srcTopic.getKeyFormat().getFormatInfo());<NEW_LINE>final FormatInfo keyFmtInfo = buildFormatInfo(keyFormatName, props.getKeyFormatProperties(sink.getName().text(), keyFormatName), srcTopic.getKeyFormat().getFormatInfo());<NEW_LINE>final String valueFormatName = formatName(props.getValueFormat(), srcTopic.getValueFormat().getFormatInfo());<NEW_LINE>final FormatInfo valueFmtInfo = buildFormatInfo(valueFormatName, props.getValueFormatProperties(valueFormatName), srcTopic.getValueFormat().getFormatInfo());<NEW_LINE>final Optional<WindowInfo> explicitWindowInfo = analysis.getWindowExpression().map(WindowExpression::getKsqlWindowExpression).map(KsqlWindowExpression::getWindowInfo);<NEW_LINE>final Optional<WindowInfo> windowInfo = explicitWindowInfo.isPresent() ? explicitWindowInfo : srcTopic.getKeyFormat().getWindowInfo();<NEW_LINE>analysis.setInto(Into.newSink(sink.getName(), topicName, windowInfo, keyFmtInfo, valueFmtInfo));<NEW_LINE>analysis.setOrReplace(sink.shouldReplace());<NEW_LINE>} | .getDataSource().getKsqlTopic(); |
1,289,257 | private void drawArrows(Point[] point, Canvas canvas, Paint paint) {<NEW_LINE>float[] points = new float[8];<NEW_LINE>points[0] = point[0].x;<NEW_LINE>points[1] = point[0].y;<NEW_LINE>points[2<MASK><NEW_LINE>points[3] = point[1].y;<NEW_LINE>points[4] = point[2].x;<NEW_LINE>points[5] = point[2].y;<NEW_LINE>points[6] = point[0].x;<NEW_LINE>points[7] = point[0].y;<NEW_LINE>canvas.drawVertices(Canvas.VertexMode.TRIANGLES, 8, points, 0, null, 0, null, 0, null, 0, 0, paint);<NEW_LINE>Path path = new Path();<NEW_LINE>path.moveTo(point[0].x, point[0].y);<NEW_LINE>path.lineTo(point[1].x, point[1].y);<NEW_LINE>path.lineTo(point[2].x, point[2].y);<NEW_LINE>canvas.drawPath(path, paint);<NEW_LINE>} | ] = point[1].x; |
677,901 | public boolean extractFrom(@Nonnull AdvancedGasConduit advancedGasConduit, @Nonnull EnumFacing dir, int maxExtractPerTick) {<NEW_LINE>if (tank.isFull()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IGasHandler extTank = getTankContainer(advancedGasConduit, dir);<NEW_LINE>if (extTank != null) {<NEW_LINE>int maxExtract = Math.min(<MASK><NEW_LINE>if (gasType == null || !tank.containsValidGas()) {<NEW_LINE>GasStack newGas = GasUtil.getGasStack(extTank, dir.getOpposite());<NEW_LINE>if (newGas == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>setGasType(newGas);<NEW_LINE>}<NEW_LINE>GasStack couldDrain = gasType.copy();<NEW_LINE>couldDrain.amount = maxExtract;<NEW_LINE>GasStack drained = extTank.drawGas(dir, couldDrain.amount, true);<NEW_LINE>if (drained == null || drained.amount == 0) {<NEW_LINE>return false;<NEW_LINE>} else if (drained.isGasEqual(getGasType())) {<NEW_LINE>tank.addAmount(drained.amount);<NEW_LINE>} else {<NEW_LINE>extTank.receiveGas(dir, drained, true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | maxExtractPerTick, tank.getNeeded()); |
1,448,091 | public static BeanComponentDefinition parseInnerHandlerDefinition(Element element, ParserContext parserContext) {<NEW_LINE>// parses out the inner bean definition for concrete implementation if defined<NEW_LINE>List<Element> childElements = DomUtils.getChildElementsByTagName(element, "bean");<NEW_LINE>BeanComponentDefinition innerComponentDefinition = null;<NEW_LINE>if (childElements.size() == 1) {<NEW_LINE>Element beanElement = childElements.get(0);<NEW_LINE>BeanDefinitionParserDelegate delegate = parserContext.getDelegate();<NEW_LINE>BeanDefinitionHolder bdHolder = delegate.parseBeanDefinitionElement(beanElement);<NEW_LINE>// NOSONAR never null<NEW_LINE>bdHolder = delegate.decorateBeanDefinitionIfRequired(beanElement, bdHolder);<NEW_LINE>BeanDefinition inDef = bdHolder.getBeanDefinition();<NEW_LINE>innerComponentDefinition = new BeanComponentDefinition(inDef, bdHolder.getBeanName());<NEW_LINE>}<NEW_LINE>String ref = element.getAttribute(REF_ATTRIBUTE);<NEW_LINE>if (StringUtils.hasText(ref) && innerComponentDefinition != null) {<NEW_LINE>parserContext.getReaderContext().error("Ambiguous definition. Inner bean " + (innerComponentDefinition.getBeanDefinition().getBeanClassName()) + " declaration and \"ref\" " + ref + " are not allowed together on element " + IntegrationNamespaceUtils.createElementDescription(element) + "."<MASK><NEW_LINE>}<NEW_LINE>return innerComponentDefinition;<NEW_LINE>} | , parserContext.extractSource(element)); |
1,196,921 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent minionLeshrac = game.getPermanentOrLKIBattlefield(source.getSourceId());<NEW_LINE>if (controller != null && minionLeshrac != null) {<NEW_LINE>FilterControlledPermanent filterCreature = new FilterControlledPermanent();<NEW_LINE>filterCreature.add(CardType.CREATURE.getPredicate());<NEW_LINE>filterCreature.add(AnotherPredicate.instance);<NEW_LINE><MASK><NEW_LINE>SacrificeTargetCost cost = new SacrificeTargetCost(target);<NEW_LINE>if (controller.chooseUse(Outcome.AIDontUseIt, "Sacrifice another creature to prevent the damage?", source, game) && cost.canPay(source, source, source.getControllerId(), game) && cost.pay(source, game, source, source.getControllerId(), true)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (controller.damage(5, minionLeshrac.getId(), source, game) > 0) {<NEW_LINE>minionLeshrac.tap(source, game);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | TargetControlledPermanent target = new TargetControlledPermanent(filterCreature); |
1,623,680 | public static void HtoRt(CvMat H, CvMat R, CvMat t) {<NEW_LINE>CvMat M = M3x2.get(), S = S2x2.get(), U = U3x2.get()<MASK><NEW_LINE>M.put(H.get(0), H.get(1), H.get(3), H.get(4), H.get(6), H.get(7));<NEW_LINE>cvSVD(M, S, U, V, CV_SVD_V_T);<NEW_LINE>double lambda = S.get(3);<NEW_LINE>t.put(H.get(2) / lambda, H.get(5) / lambda, H.get(8) / lambda);<NEW_LINE>cvMatMul(U, V, M);<NEW_LINE>R.put(M.get(0), M.get(1), M.get(2) * M.get(5) - M.get(3) * M.get(4), M.get(2), M.get(3), M.get(1) * M.get(4) - M.get(0) * M.get(5), M.get(4), M.get(5), M.get(0) * M.get(3) - M.get(1) * M.get(2));<NEW_LINE>} | , V = V2x2.get(); |
1,322,222 | public Group createAdministrators(Context context, Community community) throws SQLException, AuthorizeException {<NEW_LINE>// Check authorisation - Must be an Admin to create more Admins<NEW_LINE>AuthorizeUtil.authorizeManageAdminGroup(context, community);<NEW_LINE><MASK><NEW_LINE>if (admins == null) {<NEW_LINE>// turn off authorization so that Community Admins can create Sub-Community Admins<NEW_LINE>context.turnOffAuthorisationSystem();<NEW_LINE>admins = groupService.create(context);<NEW_LINE>context.restoreAuthSystemState();<NEW_LINE>groupService.setName(admins, "COMMUNITY_" + community.getID() + "_ADMIN");<NEW_LINE>groupService.update(context, admins);<NEW_LINE>}<NEW_LINE>authorizeService.addPolicy(context, community, Constants.ADMIN, admins);<NEW_LINE>// register this as the admin group<NEW_LINE>community.setAdmins(admins);<NEW_LINE>context.addEvent(new Event(Event.MODIFY, Constants.COMMUNITY, community.getID(), null, getIdentifiers(context, community)));<NEW_LINE>return admins;<NEW_LINE>} | Group admins = community.getAdministrators(); |
1,243,298 | public ClassicLinkDnsSupport unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ClassicLinkDnsSupport classicLinkDnsSupport = new ClassicLinkDnsSupport();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return classicLinkDnsSupport;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("vpcId", targetDepth)) {<NEW_LINE>classicLinkDnsSupport.setVpcId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("classicLinkDnsSupported", targetDepth)) {<NEW_LINE>classicLinkDnsSupport.setClassicLinkDnsSupported(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return classicLinkDnsSupport;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,227,752 | public Vector ifilter(double threshold) {<NEW_LINE>if (storage.isDense()) {<NEW_LINE>int[] values = ((LongIntVectorStorage) storage).getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>if (Math.abs(values[i]) <= threshold) {<NEW_LINE>values[i] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (storage.isSparse()) {<NEW_LINE>ObjectIterator<Long2IntMap.Entry> iter = ((LongIntVectorStorage) storage).entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2IntMap.Entry entry = iter.next();<NEW_LINE>int value = entry.getIntValue();<NEW_LINE>if (Math.abs(value) <= threshold) {<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long[] indices = ((LongIntVectorStorage) storage).getIndices();<NEW_LINE>int[] values = ((<MASK><NEW_LINE>long size = ((LongIntVectorStorage) storage).size();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>if (Math.abs(values[k]) <= threshold) {<NEW_LINE>values = ArrayUtils.remove(values, k);<NEW_LINE>indices = ArrayUtils.remove(indices, k);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LongIntVector(matrixId, rowId, clock, getDim(), (LongIntVectorStorage) storage);<NEW_LINE>} | LongIntVectorStorage) storage).getValues(); |
569,712 | /*<NEW_LINE>* Public Instance Methods<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement item) {<NEW_LINE>int tailOffset = context.getTailOffset();<NEW_LINE>Document document = context.getDocument();<NEW_LINE>int documentTextLength = document.getTextLength();<NEW_LINE>boolean insertParentheses;<NEW_LINE>if (documentTextLength > tailOffset) {<NEW_LINE>String currentTail = document.getText(new TextRange(tailOffset, tailOffset + 1));<NEW_LINE>char firstChar = currentTail.charAt(0);<NEW_LINE>insertParentheses = firstChar != ' ' && firstChar != '(' && firstChar != '[';<NEW_LINE>} else {<NEW_LINE>insertParentheses = true;<NEW_LINE>}<NEW_LINE>if (insertParentheses) {<NEW_LINE>context.getDocument(<MASK><NEW_LINE>// + 1 to put between the `(` and `)`<NEW_LINE>context.getEditor().getCaretModel().moveToOffset(tailOffset + 1);<NEW_LINE>}<NEW_LINE>} | ).insertString(tailOffset, "()"); |
5,889 | public SingularSortedSet2<T> build() {<NEW_LINE>java.util.SortedSet<java.lang.Object> rawTypes = new java.util.TreeSet<java.lang.Object>();<NEW_LINE>if (this.rawTypes != null)<NEW_LINE>rawTypes.addAll(this.rawTypes);<NEW_LINE>rawTypes = java.util.Collections.unmodifiableSortedSet(rawTypes);<NEW_LINE>java.util.SortedSet<Integer> integers = new java.<MASK><NEW_LINE>if (this.integers != null)<NEW_LINE>integers.addAll(this.integers);<NEW_LINE>integers = java.util.Collections.unmodifiableSortedSet(integers);<NEW_LINE>java.util.SortedSet<T> generics = new java.util.TreeSet<T>();<NEW_LINE>if (this.generics != null)<NEW_LINE>generics.addAll(this.generics);<NEW_LINE>generics = java.util.Collections.unmodifiableSortedSet(generics);<NEW_LINE>java.util.SortedSet<Number> extendsGenerics = new java.util.TreeSet<Number>();<NEW_LINE>if (this.extendsGenerics != null)<NEW_LINE>extendsGenerics.addAll(this.extendsGenerics);<NEW_LINE>extendsGenerics = java.util.Collections.unmodifiableSortedSet(extendsGenerics);<NEW_LINE>return new SingularSortedSet2<T>(rawTypes, integers, generics, extendsGenerics);<NEW_LINE>} | util.TreeSet<Integer>(); |
281,008 | public void handleEvent(@NonNull final PPOrderChangedEvent ppOrderChangedEvent) {<NEW_LINE>updateMainData(ppOrderChangedEvent);<NEW_LINE>final List<PPOrderLine> newPPOrderLines = ppOrderChangedEvent.getNewPPOrderLines();<NEW_LINE>final OrgId orgId = ppOrderChangedEvent<MASK><NEW_LINE>final ZoneId timeZone = orgDAO.getTimeZone(orgId);<NEW_LINE>final List<UpdateMainDataRequest> requests = new ArrayList<>();<NEW_LINE>for (final PPOrderLine newPPOrderLine : newPPOrderLines) {<NEW_LINE>final MainDataRecordIdentifier identifier = MainDataRecordIdentifier.builder().productDescriptor(newPPOrderLine.getPpOrderLineData().getProductDescriptor()).date(TimeUtil.getDay(newPPOrderLine.getPpOrderLineData().getIssueOrReceiveDate(), timeZone)).build();<NEW_LINE>final BigDecimal //<NEW_LINE>//<NEW_LINE>qtyRequiredForProduction = newPPOrderLine.getPpOrderLineData().getQtyRequired().subtract(newPPOrderLine.getPpOrderLineData().getQtyDelivered());<NEW_LINE>final UpdateMainDataRequest request = UpdateMainDataRequest.builder().identifier(identifier).qtyDemandPPOrder(qtyRequiredForProduction).build();<NEW_LINE>requests.add(request);<NEW_LINE>}<NEW_LINE>final List<DeletedPPOrderLineDescriptor> deletedPPOrderLines = ppOrderChangedEvent.getDeletedPPOrderLines();<NEW_LINE>for (final DeletedPPOrderLineDescriptor deletedPPOrderLine : deletedPPOrderLines) {<NEW_LINE>final MainDataRecordIdentifier identifier = MainDataRecordIdentifier.builder().productDescriptor(deletedPPOrderLine.getProductDescriptor()).date(deletedPPOrderLine.getIssueOrReceiveDate().truncatedTo(ChronoUnit.DAYS)).build();<NEW_LINE>final BigDecimal //<NEW_LINE>//<NEW_LINE>qtyRequiredForProduction = deletedPPOrderLine.getQtyRequired().subtract(deletedPPOrderLine.getQtyDelivered()).negate();<NEW_LINE>final UpdateMainDataRequest request = UpdateMainDataRequest.builder().identifier(identifier).qtyDemandPPOrder(qtyRequiredForProduction).build();<NEW_LINE>requests.add(request);<NEW_LINE>}<NEW_LINE>for (final ChangedPPOrderLineDescriptor changedPPOrderLine : ppOrderChangedEvent.getPpOrderLineChanges()) {<NEW_LINE>final BigDecimal qtyDelta = changedPPOrderLine.computeOpenQtyDelta();<NEW_LINE>if (qtyDelta.signum() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final MainDataRecordIdentifier identifier = MainDataRecordIdentifier.builder().productDescriptor(changedPPOrderLine.getProductDescriptor()).date(TimeUtil.getDay(changedPPOrderLine.getIssueOrReceiveDate(), timeZone)).build();<NEW_LINE>final UpdateMainDataRequest request = UpdateMainDataRequest.builder().identifier(identifier).qtyDemandPPOrder(qtyDelta).build();<NEW_LINE>requests.add(request);<NEW_LINE>}<NEW_LINE>requests.forEach(dataUpdateRequestHandler::handleDataUpdateRequest);<NEW_LINE>} | .getEventDescriptor().getOrgId(); |
1,080,330 | private void createMapView(IArchimateModel smodel) {<NEW_LINE>diagramModel = IArchimateFactory.eINSTANCE.createArchimateDiagramModel();<NEW_LINE>diagramModel.setName(Messages.CreateMapViewCheatSheetAction_6);<NEW_LINE>// Add diagram model *first* to get id!<NEW_LINE>parentFolder = model.getDefaultFolderForObject(diagramModel);<NEW_LINE>parentFolder.getElements().add(0, diagramModel);<NEW_LINE>// Add diagram model references<NEW_LINE>int y = 20;<NEW_LINE>for (IDiagramModel dm : model.getDiagramModels()) {<NEW_LINE>// Don't add the new map view<NEW_LINE>if (dm == diagramModel) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IDiagramModelReference ref = IArchimateFactory.eINSTANCE.createDiagramModelReference();<NEW_LINE>ref.setReferencedModel(dm);<NEW_LINE>ref.setBounds(<MASK><NEW_LINE>diagramModel.getChildren().add(ref);<NEW_LINE>y += 120;<NEW_LINE>ref.setTextPosition(ITextPosition.TEXT_POSITION_TOP);<NEW_LINE>}<NEW_LINE>} | 20, y, 400, 100); |
1,344,854 | public void propagate(InstanceState state) {<NEW_LINE>// get attributes<NEW_LINE>final var dataWidth = state.getAttributeValue(StdAttr.FP_WIDTH);<NEW_LINE>// compute outputs<NEW_LINE>final var a = state.getPortValue(IN0);<NEW_LINE>final var b = state.getPortValue(IN1);<NEW_LINE>final var a_val = dataWidth.getWidth() == 64 ? a.toDoubleValue() : a.toFloatValue();<NEW_LINE>final var b_val = dataWidth.getWidth() == 64 ? b.toDoubleValue() : b.toFloatValue();<NEW_LINE>final var out_val = a_val + b_val;<NEW_LINE>final var out = dataWidth.getWidth() == 64 ? Value.createKnown(out_val) : Value.createKnown((float) out_val);<NEW_LINE>// propagate them<NEW_LINE>final var delay = (dataWidth.<MASK><NEW_LINE>state.setPort(OUT, out, delay);<NEW_LINE>state.setPort(ERR, Value.createKnown(BitWidth.create(1), Double.isNaN(out_val) ? 1 : 0), delay);<NEW_LINE>} | getWidth() + 2) * PER_DELAY; |
1,544,670 | private void checkForm() {<NEW_LINE>File selFile = platformChooser.getSelectedFile();<NEW_LINE>boolean invalid = true;<NEW_LINE>if (selFile != null) {<NEW_LINE>// #73123<NEW_LINE>File <MASK><NEW_LINE>if (/* #60133 */<NEW_LINE>NbPlatform.isPlatformDirectory(plafDir)) {<NEW_LINE>try {<NEW_LINE>setPlafLabel(cleanupLabel(NbPlatform.computeDisplayName(plafDir)));<NEW_LINE>} catch (IOException e) {<NEW_LINE>setPlafLabel(plafDir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>plafLabelValue.setText(NbPlatform.getComputedLabel(plafDir));<NEW_LINE>plafLabelValue.setCaretPosition(0);<NEW_LINE>if (!NbPlatform.isSupportedPlatform(plafDir)) {<NEW_LINE>setError(getMessage("MSG_UnsupportedPlatform"));<NEW_LINE>} else if (NbPlatform.contains(plafDir)) {<NEW_LINE>setError(getMessage("MSG_AlreadyAddedPlatform"));<NEW_LINE>} else if (!NbPlatform.isLabelValid(plafNameValue.getText())) {<NEW_LINE>setWarning(getMessage("MSG_NameIsAlreadyUsedGoToNext"));<NEW_LINE>} else {<NEW_LINE>markValid();<NEW_LINE>ModuleUISettings.getDefault().setLastUsedNbPlatformLocation(plafDir.getParentFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>invalid = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (invalid) {<NEW_LINE>markInvalid();<NEW_LINE>setPlafLabel(null);<NEW_LINE>plafLabelValue.setText(null);<NEW_LINE>storeData();<NEW_LINE>}<NEW_LINE>} | plafDir = FileUtil.normalizeFile(selFile); |
557,778 | private void configureKeepAliveVisualizer() {<NEW_LINE>final KeepAliveMonitor kaMonitor = monitor.getKeepAliveMonitor();<NEW_LINE>SimpleXYChartDescriptor desc = SimpleXYChartDescriptor.decimal(10, false, 500);<NEW_LINE>desc.addLineItems("Refused", "Flushed", "Timed Out");<NEW_LINE>keepAliveChart = ChartFactory.createSimpleXYChart(desc);<NEW_LINE>kaRefreshTask = Scheduler.sharedInstance().schedule(new SchedulerTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSchedule(long timeStamp) {<NEW_LINE>try {<NEW_LINE>KeepAliveStats stats = kaMonitor.getKeepAliveStats();<NEW_LINE>keepAliveChart.addValues(timeStamp, new long[] { stats.getCountRefusals().getCount(), stats.getCountFlushes().getCount(), stats.getCountTimeouts().getCount() });<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!(e instanceof UndeclaredThrowableException)) {<NEW_LINE>LOGGER.log(Level.INFO, "onSchedule", e);<NEW_LINE>} else {<NEW_LINE>Scheduler.<MASK><NEW_LINE>kaRefreshTask = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, Quantum.seconds(1));<NEW_LINE>dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Keep Alive", true), DataViewComponent.BOTTOM_RIGHT);<NEW_LINE>dvc.addDetailsView(new DataViewComponent.DetailsView("Keep Alive", null, 10, keepAliveChart.getChart(), null), DataViewComponent.BOTTOM_RIGHT);<NEW_LINE>} | sharedInstance().unschedule(kaRefreshTask); |
1,439,346 | private Sendung createGODeliveryOrder(final DeliveryOrder request, final GOOrderStatus status) {<NEW_LINE>final <MASK><NEW_LINE>final GoDeliveryOrderData goDeliveryOrderData = GoDeliveryOrderData.ofDeliveryOrder(request);<NEW_LINE>final HWBNumber hwbNumber = goDeliveryOrderData.getHwbNumber();<NEW_LINE>final Sendung.Abholadresse pickupAddress = createGOPickupAddress(request.getPickupAddress());<NEW_LINE>final Sendung.Abholdatum pickupDate = createGOPickupDate(request.getPickupDate());<NEW_LINE>final Sendung.Empfaenger deliveryAddress = createGODeliveryAddress(request.getDeliveryAddress(), request.getDeliveryContact());<NEW_LINE>// at GO!, we have just one position per order<NEW_LINE>final DeliveryPosition shipmentPosition = GOUtils.getSingleDeliveryPosition(request);<NEW_LINE>final Sendung.SendungsPosition deliveryPosition = createGODeliveryPosition(shipmentPosition);<NEW_LINE>final Sendung goRequest = newGODeliveryRequest();<NEW_LINE>// Order status<NEW_LINE>goRequest.setStatus(status.getCode());<NEW_LINE>// AX4 shipment no. (n15, mandatory for update and cancellation)<NEW_LINE>goRequest.setSendungsnummerAX4(orderId != null ? orderId.getOrderIdAsString() : null);<NEW_LINE>// HWB no. (N18, not mandatory). If you provide a HWB no. in this field, AX4 will not generate a new HWB no.<NEW_LINE>goRequest.setFrachtbriefnummer(hwbNumber != null ? hwbNumber.getAsString() : null);<NEW_LINE>// Customer reference no (an40, i guess it's not mandatory)<NEW_LINE>goRequest.setKundenreferenz(request.getCustomerReference());<NEW_LINE>// Pickup address (mandatory)<NEW_LINE>goRequest.setAbholadresse(pickupAddress);<NEW_LINE>// Pickup date (mandatory)<NEW_LINE>goRequest.setAbholdatum(pickupDate);<NEW_LINE>// Pickup note (an128, not mandatory)<NEW_LINE>goRequest.setAbholhinweise(request.getPickupNote());<NEW_LINE>// Delivery address (mandatory)<NEW_LINE>goRequest.setEmpfaenger(deliveryAddress);<NEW_LINE>// Delivery date (not mandatory)<NEW_LINE>goRequest.setZustelldatum(createGODeliveryDateOrNull(request.getDeliveryDate()));<NEW_LINE>// Delivery note (an128, not mandatory)<NEW_LINE>goRequest.setZustellhinweise(request.getDeliveryNote());<NEW_LINE>// Service type (mandatory)<NEW_LINE>goRequest.setService(request.getShipperProduct().getCode());<NEW_LINE>// Flag unpaid (mandatory)<NEW_LINE>goRequest.setUnfrei(goDeliveryOrderData.getPaidMode().getCode());<NEW_LINE>// Flag self delivery (mandatory)<NEW_LINE>goRequest.setSelbstanlieferung(goDeliveryOrderData.getSelfDelivery().getCode());<NEW_LINE>// Flag self pickup (mandatory)<NEW_LINE>goRequest.setSelbstabholung(goDeliveryOrderData.getSelfPickup().getCode());<NEW_LINE>// Value of goods (not mandatory)<NEW_LINE>goRequest.setWarenwert(null);<NEW_LINE>// Special insurance (not mandatory)<NEW_LINE>goRequest.setSonderversicherung(null);<NEW_LINE>// Cash on delivery (not mandatory)<NEW_LINE>goRequest.setNachnahme(null);<NEW_LINE>// Phone no. for confirmation of receipt (an25, mandatory)<NEW_LINE>goRequest.setTelefonEmpfangsbestaetigung(goDeliveryOrderData.getReceiptConfirmationPhoneNumber());<NEW_LINE>// Shipment position (mandatory, max. 1)<NEW_LINE>goRequest.setSendungsPosition(deliveryPosition);<NEW_LINE>return goRequest;<NEW_LINE>} | OrderId orderId = request.getOrderId(); |
729,144 | public static LookupDataSourceContext mergeToMultipleIds(@NonNull final Collection<LookupDataSourceContext> contexts) {<NEW_LINE>Check.assumeNotEmpty(contexts, "empty contexts not allowed");<NEW_LINE>LookupDataSourceContext templateContext = null;<NEW_LINE>IdsToFilter idsToFilter = null;<NEW_LINE>for (final LookupDataSourceContext context : contexts) {<NEW_LINE>if (templateContext == null) {<NEW_LINE>templateContext = context.withIdToFilter(IdsToFilter.NO_VALUE);<NEW_LINE>idsToFilter = context.getIdsToFilter();<NEW_LINE>} else {<NEW_LINE>Check.assumeEquals(templateContext, context<MASK><NEW_LINE>idsToFilter = idsToFilter.mergeWith(context.getIdsToFilter());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (templateContext == null || idsToFilter == null) {<NEW_LINE>throw new AdempiereException("At least one context shall be provided");<NEW_LINE>}<NEW_LINE>return templateContext.withIdToFilter(idsToFilter);<NEW_LINE>} | .withIdToFilter(IdsToFilter.NO_VALUE)); |
519,340 | public static ElementDeclaration fromJson(JsonObject jsonObject) {<NEW_LINE>String name = jsonObject.get("name").getAsString();<NEW_LINE>String kind = jsonObject.get("kind").getAsString();<NEW_LINE>int fileIndex = jsonObject.get("fileIndex").getAsInt();<NEW_LINE>int offset = jsonObject.get("offset").getAsInt();<NEW_LINE>int line = jsonObject.get("line").getAsInt();<NEW_LINE>int column = jsonObject.get("column").getAsInt();<NEW_LINE>int codeOffset = jsonObject.get("codeOffset").getAsInt();<NEW_LINE>int codeLength = jsonObject.get("codeLength").getAsInt();<NEW_LINE>String className = jsonObject.get("className") == null ? null : jsonObject.get("className").getAsString();<NEW_LINE>String mixinName = jsonObject.get("mixinName") == null ? null : jsonObject.get("mixinName").getAsString();<NEW_LINE>String parameters = jsonObject.get("parameters") == null ? null : jsonObject.get("parameters").getAsString();<NEW_LINE>return new ElementDeclaration(name, kind, fileIndex, offset, line, column, codeOffset, <MASK><NEW_LINE>} | codeLength, className, mixinName, parameters); |
42,297 | public void run(RegressionEnvironment env) {<NEW_LINE>SupportBean bean = new SupportBean();<NEW_LINE>bean.setTheString("a\nc");<NEW_LINE>bean.setIntPrimitive(1);<NEW_LINE>bean.setIntBoxed(992);<NEW_LINE>bean.setCharPrimitive('x');<NEW_LINE>bean.setEnumValue(SupportEnum.ENUM_VALUE_2);<NEW_LINE>env.compileDeploy("@name('s0') select * from SupportBean");<NEW_LINE>env.sendEventBean(bean);<NEW_LINE>env.assertThat(() -> {<NEW_LINE>String result = env.runtime().getRenderEventService().renderXML("supportBean", env.iterator("s0").next());<NEW_LINE>// System.out.println(result);<NEW_LINE>String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<supportBean>\n" + " <boolPrimitive>false</boolPrimitive>\n" + " <bytePrimitive>0</bytePrimitive>\n" + " <charPrimitive>x</charPrimitive>\n" + " <doublePrimitive>0.0</doublePrimitive>\n" + " <enumValue>ENUM_VALUE_2</enumValue>\n" + " <floatPrimitive>0.0</floatPrimitive>\n" + " <intBoxed>992</intBoxed>\n" + " <intPrimitive>1</intPrimitive>\n" <MASK><NEW_LINE>assertEquals(removeNewline(expected), removeNewline(result));<NEW_LINE>});<NEW_LINE>env.assertThat(() -> {<NEW_LINE>String result = env.runtime().getRenderEventService().renderXML("supportBean", env.iterator("s0").next(), new XMLRenderingOptions().setDefaultAsAttribute(true));<NEW_LINE>// System.out.println(result);<NEW_LINE>String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <supportBean boolPrimitive=\"false\" bytePrimitive=\"0\" charPrimitive=\"x\" doublePrimitive=\"0.0\" enumValue=\"ENUM_VALUE_2\" floatPrimitive=\"0.0\" intBoxed=\"992\" intPrimitive=\"1\" longPrimitive=\"0\" shortPrimitive=\"0\" theString=\"a\\u000ac\"/>";<NEW_LINE>assertEquals(removeNewline(expected), removeNewline(result));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | + " <longPrimitive>0</longPrimitive>\n" + " <shortPrimitive>0</shortPrimitive>\n" + " <theString>a\\u000ac</theString>\n" + "</supportBean>"; |
1,665,476 | private JDBCCollection convertStringToCollection(@NotNull DBCSession session, @NotNull DBSTypedObject arrayType, @NotNull PostgreDataType itemType, @NotNull String value) throws DBCException {<NEW_LINE>String delimiter;<NEW_LINE>PostgreDataType arrayDataType = PostgreUtils.findDataType(session, (PostgreDataSource) session.getDataSource(), arrayType);<NEW_LINE>if (arrayDataType != null) {<NEW_LINE>delimiter = CommonUtils.toString(arrayDataType.getArrayDelimiter(), PostgreConstants.DEFAULT_ARRAY_DELIMITER);<NEW_LINE>} else {<NEW_LINE>delimiter = PostgreConstants.DEFAULT_ARRAY_DELIMITER;<NEW_LINE>}<NEW_LINE>if (itemType.getDataKind() == DBPDataKind.STRUCT) {<NEW_LINE>// Items are structures. Parse them as CSV<NEW_LINE>List<Object> itemStrings = PostgreValueParser.parseArrayString(value, delimiter);<NEW_LINE>Object[] itemValues = new Object[itemStrings.size()];<NEW_LINE>DBDValueHandler itemValueHandler = DBUtils.findValueHandler(session, itemType);<NEW_LINE>for (int i = 0; i < itemStrings.size(); i++) {<NEW_LINE>Object itemString = itemStrings.get(i);<NEW_LINE>Object itemValue = itemValueHandler.getValueFromObject(session, <MASK><NEW_LINE>itemValues[i] = itemValue;<NEW_LINE>}<NEW_LINE>return new JDBCCollection(session.getProgressMonitor(), itemType, itemValueHandler, itemValues);<NEW_LINE>} else {<NEW_LINE>List<Object> strings = PostgreValueParser.parseArrayString(value, delimiter);<NEW_LINE>Object[] contents = new Object[strings.size()];<NEW_LINE>for (int i = 0; i < strings.size(); i++) {<NEW_LINE>contents[i] = PostgreValueParser.convertStringToValue(session, itemType, String.valueOf(strings.get(i)));<NEW_LINE>}<NEW_LINE>return new JDBCCollection(session.getProgressMonitor(), itemType, DBUtils.findValueHandler(session, itemType), contents);<NEW_LINE>}<NEW_LINE>} | itemType, itemString, false, false); |
1,531,736 | private void editSelectedPolicyMapping() {<NEW_LINE>int selectedRow = jtPolicyMappings.getSelectedRow();<NEW_LINE>if (selectedRow != -1) {<NEW_LINE>PolicyMapping policyMapping = (PolicyMapping) jtPolicyMappings.getValueAt(selectedRow, 0);<NEW_LINE>Container container = getTopLevelAncestor();<NEW_LINE>DPolicyMappingChooser dPolicyMappingChooser = null;<NEW_LINE>if (container instanceof JDialog) {<NEW_LINE>dPolicyMappingChooser = new DPolicyMappingChooser((JDialog) container, title, policyMapping);<NEW_LINE>} else {<NEW_LINE>dPolicyMappingChooser = new DPolicyMappingChooser((JFrame) container, title, policyMapping);<NEW_LINE>}<NEW_LINE>dPolicyMappingChooser.setLocationRelativeTo(container);<NEW_LINE>dPolicyMappingChooser.setVisible(true);<NEW_LINE>PolicyMapping newPolicyMapping = dPolicyMappingChooser.getPolicyMapping();<NEW_LINE>if (newPolicyMapping == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>policyMappings = PolicyMappingsUtil.remove(policyMapping, policyMappings);<NEW_LINE>policyMappings = <MASK><NEW_LINE>populate();<NEW_LINE>selectPolicyMappingInTable(newPolicyMapping);<NEW_LINE>}<NEW_LINE>} | PolicyMappingsUtil.add(newPolicyMapping, policyMappings); |
760,828 | private Header parseHeader(InputStream stream) throws IOException {<NEW_LINE>DataInputStream dis = new DataInputStream(stream);<NEW_LINE>// Check if the stream starts with the expected header<NEW_LINE>String header = dis.readUTF();<NEW_LINE>if (!header.equals(HEADER)) {<NEW_LINE>throw new IllegalArgumentException("Could not restore normalizer: invalid header. If this normalizer was saved with a opType-specific " + "strategy like StandardizeSerializerStrategy, use that class to restore it as well.");<NEW_LINE>}<NEW_LINE>// The next byte is an integer indicating the version<NEW_LINE>int version = dis.readInt();<NEW_LINE>// Right now, we only support version 1<NEW_LINE>if (version != 1) {<NEW_LINE>throw new IllegalArgumentException("Could not restore normalizer: invalid version (" + version + ")");<NEW_LINE>}<NEW_LINE>// The next value is a string indicating the normalizer opType<NEW_LINE>NormalizerType type = NormalizerType.valueOf(dis.readUTF());<NEW_LINE>if (type.equals(NormalizerType.CUSTOM)) {<NEW_LINE>// For custom serializers, the next value is a string with the class opName<NEW_LINE><MASK><NEW_LINE>Class<? extends NormalizerSerializerStrategy> strategyClass = ND4JClassLoading.loadClassByName(strategyClassName);<NEW_LINE>return new Header(type, strategyClass);<NEW_LINE>} else {<NEW_LINE>return new Header(type, null);<NEW_LINE>}<NEW_LINE>} | String strategyClassName = dis.readUTF(); |
1,659,581 | public String generateResultsDataUpdateScript(@NotNull DBRProgressMonitor monitor, @NotNull WebSQLContextInfo contextInfo, @NotNull String resultsId, @Nullable List<WebSQLResultsRow> updatedRows, @Nullable List<WebSQLResultsRow> deletedRows, @Nullable List<WebSQLResultsRow> addedRows, @Nullable WebDataFormat dataFormat) throws DBException {<NEW_LINE>Map<DBSDataManipulator.ExecuteBatch, Object[]> resultBatches = new LinkedHashMap<>();<NEW_LINE>DBSDataManipulator dataManipulator = generateUpdateResultsDataBatch(monitor, contextInfo, resultsId, updatedRows, deletedRows, <MASK><NEW_LINE>List<DBEPersistAction> actions = new ArrayList<>();<NEW_LINE>DBCExecutionContext executionContext = getExecutionContext(dataManipulator);<NEW_LINE>try (DBCSession session = executionContext.openSession(monitor, DBCExecutionPurpose.USER, "Update data in container")) {<NEW_LINE>Map<String, Object> options = Collections.emptyMap();<NEW_LINE>for (DBSDataManipulator.ExecuteBatch batch : resultBatches.keySet()) {<NEW_LINE>batch.generatePersistActions(session, actions, options);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return SQLUtils.generateScript(executionContext.getDataSource(), actions.toArray(new DBEPersistAction[0]), false);<NEW_LINE>} | addedRows, dataFormat, resultBatches, null); |
1,656,111 | static GatewayObserver compose(GatewayObserver first, GatewayObserver second) {<NEW_LINE>if (first == GatewayObserver.NOOP_LISTENER) {<NEW_LINE>return second;<NEW_LINE>}<NEW_LINE>if (second == GatewayObserver.NOOP_LISTENER) {<NEW_LINE>return first;<NEW_LINE>}<NEW_LINE>final GatewayObserver[] combinedObservers;<NEW_LINE>final GatewayObserver[] firstObservers;<NEW_LINE>final GatewayObserver[] secondObservers;<NEW_LINE>int length = 2;<NEW_LINE>if (first instanceof CompositeGatewayObserver) {<NEW_LINE>firstObservers = ((CompositeGatewayObserver) first).observers;<NEW_LINE>length += firstObservers.length - 1;<NEW_LINE>} else {<NEW_LINE>firstObservers = null;<NEW_LINE>}<NEW_LINE>if (second instanceof CompositeGatewayObserver) {<NEW_LINE>secondObservers = <MASK><NEW_LINE>length += secondObservers.length - 1;<NEW_LINE>} else {<NEW_LINE>secondObservers = null;<NEW_LINE>}<NEW_LINE>combinedObservers = new GatewayObserver[length];<NEW_LINE>int pos;<NEW_LINE>if (firstObservers != null) {<NEW_LINE>pos = firstObservers.length;<NEW_LINE>System.arraycopy(firstObservers, 0, combinedObservers, 0, pos);<NEW_LINE>} else {<NEW_LINE>pos = 1;<NEW_LINE>combinedObservers[0] = first;<NEW_LINE>}<NEW_LINE>if (secondObservers != null) {<NEW_LINE>System.arraycopy(secondObservers, 0, combinedObservers, pos, secondObservers.length);<NEW_LINE>} else {<NEW_LINE>combinedObservers[pos] = second;<NEW_LINE>}<NEW_LINE>return new CompositeGatewayObserver(combinedObservers);<NEW_LINE>} | ((CompositeGatewayObserver) second).observers; |
802,321 | public void read(org.apache.thrift.protocol.TProtocol iprot, EchoReplyMessage struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // HEADER<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE><MASK><NEW_LINE>struct.header.read(iprot);<NEW_LINE>struct.setHeaderIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | struct.header = new AsyncMessageHeader(); |
1,002,630 | private ExecutionPlan buildPlanForBackfillDuplicateCheck(TableMeta tableMeta, List<String> outputColumns, List<String> filterColumns, boolean useHint) {<NEW_LINE>initParams(0);<NEW_LINE>// Build select list<NEW_LINE>final SqlNodeList selectList = new SqlNodeList(outputColumns.stream().map(c -> new SqlIdentifier(c, SqlParserPos.ZERO)).collect(Collectors.toList<MASK><NEW_LINE>// Build where<NEW_LINE>final List<SqlNode> compareNodes = new ArrayList<>(filterColumns.size());<NEW_LINE>// keep primary keys in the order as defined<NEW_LINE>for (int i = 0; i < filterColumns.size(); i++) {<NEW_LINE>final String columnName = filterColumns.get(i);<NEW_LINE>final SqlIdentifier left = new SqlIdentifier(columnName, SqlParserPos.ZERO);<NEW_LINE>final SqlDynamicParam right = new SqlDynamicParam(nextDynamicIndex++, SqlParserPos.ZERO);<NEW_LINE>// Null-safe comparison<NEW_LINE>final SqlNode compareNode = new SqlBasicCall(TddlOperatorTable.NULL_SAFE_EQUAL, new SqlNode[] { left, right }, SqlParserPos.ZERO);<NEW_LINE>compareNodes.add(compareNode);<NEW_LINE>}<NEW_LINE>final SqlNode condition = PlannerUtils.buildAndTree(compareNodes);<NEW_LINE>SqlSelect sqlSelect = new SqlSelect(SqlParserPos.ZERO, null, selectList, new SqlIdentifier(tableMeta.getTableName(), SqlParserPos.ZERO), condition, null, null, null, null, null, null);<NEW_LINE>PlannerContext plannerContext = new PlannerContext(ec);<NEW_LINE>plannerContext.getExecutionContext().setUseHint(useHint);<NEW_LINE>return Planner.getInstance().getPlan(sqlSelect, plannerContext);<NEW_LINE>} | ()), SqlParserPos.ZERO); |
1,628,612 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>@Override<NEW_LINE>public void initializeDefaultPreferences() {<NEW_LINE>IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID);<NEW_LINE>prefs.putBoolean(ICorePreferenceConstants.PREF_SHOW_SYSTEM_JOBS, ICorePreferenceConstants.DEFAULT_DEBUG_MODE);<NEW_LINE>prefs.put(ICorePreferenceConstants.PREF_DEBUG_LEVEL, IdeLog.StatusLevel.ERROR.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.// $NON-NLS-1$<NEW_LINE>put(// $NON-NLS-1$<NEW_LINE>ICorePreferenceConstants.PREF_WEB_FILES, "*.js;*.htm;*.html;*.xhtm;*.xhtml;*.css;*.xml;*.xsl;*.xslt;*.fla;*.gif;*.jpg;*.jpeg;*.php;*.asp;*.jsp;*.png;*.as;*.sdoc;*.swf;*.shtml;*.txt;*.aspx;*.asmx;");<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>IdeLog.logError(CorePlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>// Migrate auto-refresh pref to Eclipse's<NEW_LINE>prefs = InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID);<NEW_LINE>boolean migrated = prefs.getBoolean(MIGRATED_AUTO_REFRESH, false);<NEW_LINE>if (!migrated) {<NEW_LINE>// by default, turn on auto refresh<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().setValue(ResourcesPlugin.PREF_AUTO_REFRESH, ICorePreferenceConstants.DEFAULT_AUTO_REFRESH_PROJECTS);<NEW_LINE>// Listen for user changing auto-refresh value, when they do, don't automatically turn it on for them<NEW_LINE>// anymore<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().addPropertyChangeListener(new Preferences.IPropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) {<NEW_LINE>if (ResourcesPlugin.PREF_AUTO_REFRESH.equals(event.getProperty())) {<NEW_LINE>IEclipsePreferences ourPrefs = InstanceScope.<MASK><NEW_LINE>ourPrefs.putBoolean(MIGRATED_AUTO_REFRESH, true);<NEW_LINE>try {<NEW_LINE>ourPrefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>CorePlugin.getDefault(), // $NON-NLS-1$<NEW_LINE>"Failed to store boolean to avoid overriding auto-refresh setting", e);<NEW_LINE>}<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().removePropertyChangeListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | INSTANCE.getNode(CorePlugin.PLUGIN_ID); |
197,162 | private Event toEvent(Object event) {<NEW_LINE>SerializedObject<byte[]> serializedPayload;<NEW_LINE>MetaData metadata;<NEW_LINE>String requestId = null;<NEW_LINE>if (event instanceof EventMessage<?>) {<NEW_LINE>serializedPayload = ((EventMessage<?>) event).serializePayload(serializer, byte[].class);<NEW_LINE>metadata = ((EventMessage<?>) event).getMetaData();<NEW_LINE>requestId = ((EventMessage<?>) event).getIdentifier();<NEW_LINE>} else {<NEW_LINE>metadata = MetaData.emptyInstance();<NEW_LINE>serializedPayload = serializer.serialize(event, byte[].class);<NEW_LINE>}<NEW_LINE>if (requestId == null) {<NEW_LINE>requestId = IdentifierFactory<MASK><NEW_LINE>}<NEW_LINE>Event.Builder builder = Event.newBuilder().setMessageIdentifier(requestId);<NEW_LINE>builder.setPayload(io.axoniq.axonserver.grpc.SerializedObject.newBuilder().setType(serializedPayload.getType().getName()).setRevision(getOrDefault(serializedPayload.getType().getRevision(), "")).setData(ByteString.copyFrom(serializedPayload.getData())));<NEW_LINE>metadata.forEach((k, v) -> builder.putMetaData(k, converter.convertToMetaDataValue(v)));<NEW_LINE>return builder.build();<NEW_LINE>} | .getInstance().generateIdentifier(); |
1,564,994 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {<NEW_LINE>TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE);<NEW_LINE>if (controller.choose(Outcome.PutCreatureInPlay, target, source, game)) {<NEW_LINE>Card card = game.getCard(target.getFirstTarget());<NEW_LINE>if (card != null) {<NEW_LINE>if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>Permanent permanent = game.getPermanent(card.getId());<NEW_LINE>if (permanent != null) {<NEW_LINE>ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());<NEW_LINE>sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE><MASK><NEW_LINE>game.addDelayedTriggeredAbility(delayedAbility, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); |
1,641,733 | public void onReadRemoteRssi(@NonNull final BluetoothGatt gatt, @IntRange(from = -128, to = 20) final int rssi, final int status) {<NEW_LINE>if (status == BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>log(Log.INFO, () -> "Remote RSSI received: " + rssi + " dBm");<NEW_LINE>if (request instanceof ReadRssiRequest) {<NEW_LINE>((ReadRssiRequest) request).notifyRssiRead(gatt.getDevice(), rssi);<NEW_LINE>request.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log(Log.WARN, () -> "Reading remote RSSI failed with status " + status);<NEW_LINE>if (request instanceof ReadRssiRequest) {<NEW_LINE>request.notifyFail(gatt.getDevice(), status);<NEW_LINE>}<NEW_LINE>awaitingRequest = null;<NEW_LINE>postCallback(c -> c.onError(gatt.getDevice(), ERROR_READ_RSSI, status));<NEW_LINE>}<NEW_LINE>checkCondition();<NEW_LINE>nextRequest(true);<NEW_LINE>} | notifySuccess(gatt.getDevice()); |
66,864 | public ArrayList<Ring> combineToRings(List<Way> ways) {<NEW_LINE>// make a list of multiLines (connecter pieces of way)<NEW_LINE>TLongObjectHashMap<List<Way>> multilineStartPoint = new TLongObjectHashMap<List<Way>>();<NEW_LINE>TLongObjectHashMap<List<Way>> multilineEndPoint = new TLongObjectHashMap<List<Way>>();<NEW_LINE>for (Way toAdd : ways) {<NEW_LINE>if (toAdd.getNodeIds().size() < 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// iterate over the multiLines, and add the way to the correct one<NEW_LINE>Way changedWay = toAdd;<NEW_LINE>Way newWay;<NEW_LINE>do {<NEW_LINE>newWay = merge(multilineStartPoint, getLastId(changedWay), changedWay, multilineEndPoint, getFirstId(changedWay));<NEW_LINE>if (newWay == null) {<NEW_LINE>newWay = merge(multilineEndPoint, getFirstId(changedWay), changedWay, multilineStartPoint, getLastId(changedWay));<NEW_LINE>}<NEW_LINE>if (newWay == null) {<NEW_LINE>newWay = merge(multilineStartPoint, getFirstId(changedWay), changedWay, multilineEndPoint, getLastId(changedWay));<NEW_LINE>}<NEW_LINE>if (newWay == null) {<NEW_LINE>newWay = merge(multilineEndPoint, getLastId(changedWay), changedWay, multilineStartPoint, getFirstId(changedWay));<NEW_LINE>}<NEW_LINE>if (newWay != null) {<NEW_LINE>changedWay = newWay;<NEW_LINE>}<NEW_LINE>} while (newWay != null);<NEW_LINE>addToMap(multilineStartPoint, getFirstId(changedWay), changedWay);<NEW_LINE>addToMap(multilineEndPoint<MASK><NEW_LINE>}<NEW_LINE>List<Way> multiLines = new ArrayList<Way>();<NEW_LINE>for (List<Way> lst : multilineStartPoint.valueCollection()) {<NEW_LINE>multiLines.addAll(lst);<NEW_LINE>}<NEW_LINE>ArrayList<Ring> result = new ArrayList<Ring>();<NEW_LINE>for (Way multiLine : multiLines) {<NEW_LINE>Ring r = new Ring(multiLine);<NEW_LINE>result.add(r);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , getLastId(changedWay), changedWay); |
885,050 | public void run() {<NEW_LINE>BufferedReader br = null;<NEW_LINE>try {<NEW_LINE>br = new BufferedReader(new InputStreamReader(externalProcess.getInputStream()));<NEW_LINE>String line;<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>processOutput.append(line).append("\n");<NEW_LINE>if (line.indexOf("SCRIPT_SUCCESS") >= 0) {<NEW_LINE>success[0] = true;<NEW_LINE>killProcess(externalProcess, 100);<NEW_LINE>} else if (line.indexOf("SCRIPT_ERROR") >= 0) {<NEW_LINE>success[0] = false;<NEW_LINE>killProcess(externalProcess, 100);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("External process output:\n" + processOutput.toString());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (br != null) {<NEW_LINE>try {<NEW_LINE>br.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (log.isWarnEnabled()) {<NEW_LINE>log.warn("Failed to close phantomjs process' inputstream", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | debug(e.getMessage()); |
1,556,070 | public synchronized static ImageNameSubstitutor instance() {<NEW_LINE>if (instance == null) {<NEW_LINE>final String configuredClassName = TestcontainersConfiguration.getInstance().getImageSubstitutorClassName();<NEW_LINE>if (configuredClassName != null) {<NEW_LINE>log.debug("Attempting to instantiate an ImageNameSubstitutor with class: {}", configuredClassName);<NEW_LINE>ImageNameSubstitutor configuredInstance;<NEW_LINE>try {<NEW_LINE>configuredInstance = (ImageNameSubstitutor) Class.forName(configuredClassName).getConstructor().newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalArgumentException("Configured Image Substitutor could not be loaded: " + configuredClassName, e);<NEW_LINE>}<NEW_LINE>log.info("Found configured ImageNameSubstitutor: {}", configuredInstance.getDescription());<NEW_LINE>instance = new ChainedImageNameSubstitutor(wrapWithLogging(defaultImplementation), wrapWithLogging(configuredInstance));<NEW_LINE>} else {<NEW_LINE>instance = wrapWithLogging(defaultImplementation);<NEW_LINE>}<NEW_LINE>log.info(<MASK><NEW_LINE>}<NEW_LINE>return instance;<NEW_LINE>} | "Image name substitution will be performed by: {}", instance.getDescription()); |
1,242,597 | private StringBuilder genQuery() {<NEW_LINE>int columnCount = 0;<NEW_LINE>StringBuilder sb = new StringBuilder(INSERT_INTO);<NEW_LINE>sb.append(keyspace + <MASK><NEW_LINE>sb.append(OPEN_PARA);<NEW_LINE>Iterator<ColumnDefinition> iter = cfDef.getPartitionKeyColumnDefinitionList().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.next().getName());<NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = cfDef.getClusteringKeyColumnDefinitionList().iterator();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.next().getName());<NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = cfDef.getRegularColumnDefinitionList().iterator();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sb.append(iter.next().getName());<NEW_LINE>columnCount++;<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(VALUES);<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>if (i < (columnCount - 1)) {<NEW_LINE>sb.append(BIND_MARKER);<NEW_LINE>} else {<NEW_LINE>sb.append(LAST_BIND_MARKER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(CLOSE_PARA);<NEW_LINE>appendWriteOptions(sb, mutation.getTTL(), mutation.getTimestamp());<NEW_LINE>return sb;<NEW_LINE>} | "." + cfDef.getName()); |
1,200,361 | private Mono<StatefulRedisMasterReplicaConnection<K, V>> initializeConnection(RedisCodec<K, V> codec, Tuple2<RedisURI, StatefulRedisConnection<K, V>> connectionAndUri) {<NEW_LINE>ReplicaTopologyProvider topologyProvider = new ReplicaTopologyProvider(connectionAndUri.getT2(), connectionAndUri.getT1());<NEW_LINE>MasterReplicaTopologyRefresh refresh = new MasterReplicaTopologyRefresh(redisClient, topologyProvider);<NEW_LINE>MasterReplicaConnectionProvider<K, V> connectionProvider = new MasterReplicaConnectionProvider<>(redisClient, codec, redisURI, (Map) initialConnections);<NEW_LINE>Mono<List<RedisNodeDescription>> <MASK><NEW_LINE>return refreshFuture.map(nodes -> {<NEW_LINE>EventRecorder.getInstance().record(new MasterReplicaTopologyChangedEvent(redisURI, nodes));<NEW_LINE>connectionProvider.setKnownNodes(nodes);<NEW_LINE>MasterReplicaChannelWriter channelWriter = new MasterReplicaChannelWriter(connectionProvider, redisClient.getResources());<NEW_LINE>StatefulRedisMasterReplicaConnectionImpl<K, V> connection = new StatefulRedisMasterReplicaConnectionImpl<>(channelWriter, codec, redisURI.getTimeout());<NEW_LINE>connection.setOptions(redisClient.getOptions());<NEW_LINE>return connection;<NEW_LINE>});<NEW_LINE>} | refreshFuture = refresh.getNodes(redisURI); |
153,511 | private List<SettingsItem> processItems(@NonNull File file, @Nullable List<SettingsItem> items) throws IllegalArgumentException, IOException {<NEW_LINE>boolean collecting = items == null;<NEW_LINE>if (collecting) {<NEW_LINE>items = getItemsFromJson(file);<NEW_LINE>}<NEW_LINE>if (items.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("No items");<NEW_LINE>}<NEW_LINE>ZipInputStream zis = new ZipInputStream(new FileInputStream(file));<NEW_LINE>InputStream ois = new BufferedInputStream(zis);<NEW_LINE>try {<NEW_LINE>ZipEntry entry;<NEW_LINE>while ((entry = zis.getNextEntry()) != null) {<NEW_LINE>String fileName = <MASK><NEW_LINE>SettingsItem item = null;<NEW_LINE>for (SettingsItem settingsItem : items) {<NEW_LINE>if (settingsItem != null && settingsItem.applyFileName(fileName)) {<NEW_LINE>item = settingsItem;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (item != null && collecting && item.shouldReadOnCollecting() || item != null && !collecting && !item.shouldReadOnCollecting()) {<NEW_LINE>try {<NEW_LINE>SettingsItemReader<? extends SettingsItem> reader = item.getReader();<NEW_LINE>if (reader != null) {<NEW_LINE>reader.readFromStream(ois, fileName);<NEW_LINE>}<NEW_LINE>item.applyAdditionalParams(reader);<NEW_LINE>} catch (IllegalArgumentException | IOException e) {<NEW_LINE>item.getWarnings().add(app.getString(R.string.settings_item_read_error, item.getName()));<NEW_LINE>SettingsHelper.LOG.error("Error reading item data: " + item.getName(), e);<NEW_LINE>} finally {<NEW_LINE>zis.closeEntry();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>SettingsHelper.LOG.error("Failed to read next entry", ex);<NEW_LINE>} finally {<NEW_LINE>Algorithms.closeStream(ois);<NEW_LINE>Algorithms.closeStream(zis);<NEW_LINE>}<NEW_LINE>return items;<NEW_LINE>} | checkEntryName(entry.getName()); |
415,531 | public void fill() throws JRException {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>File sourceFile = new File("build/reports/AlterDesignReport.jasper");<NEW_LINE>System.err.println(" : " + sourceFile.getAbsolutePath());<NEW_LINE>JasperReport jasperReport = (JasperReport) JRLoader.loadObject(sourceFile);<NEW_LINE>JRRectangle rectangle = (JRRectangle) jasperReport.getTitle().getElementByKey("first.rectangle");<NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle = (JRRectangle) jasperReport.getTitle().getElementByKey("second.rectangle");<NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle = (JRRectangle) jasperReport.<MASK><NEW_LINE>rectangle.setForecolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>rectangle.setBackcolor(new Color((int) (16000000 * Math.random())));<NEW_LINE>JRStyle style = jasperReport.getStyles()[0];<NEW_LINE>style.setFontSize(16f);<NEW_LINE>style.setItalic(Boolean.TRUE);<NEW_LINE>JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, (JRDataSource) null);<NEW_LINE>File destFile = new File(sourceFile.getParent(), jasperReport.getName() + ".jrprint");<NEW_LINE>JRSaver.saveObject(jasperPrint, destFile);<NEW_LINE>System.err.println("Filling time : " + (System.currentTimeMillis() - start));<NEW_LINE>} | getTitle().getElementByKey("third.rectangle"); |
1,477,187 | public void layoutContainer(Container parent) {<NEW_LINE>final var in = parent.getInsets();<NEW_LINE>final var maxWidth = parent.getWidth() - (in.left + in.right);<NEW_LINE>final var maxHeight = parent.getHeight() - (in.top + in.bottom);<NEW_LINE>int split;<NEW_LINE>if (fraction <= 0.0) {<NEW_LINE>split = 0;<NEW_LINE>dragbar.setVisible(false);<NEW_LINE>} else if (fraction >= 1.0) {<NEW_LINE>split = maxHeight;<NEW_LINE>dragbar.setVisible(false);<NEW_LINE>} else {<NEW_LINE>split = (int) Math.round(maxHeight * fraction);<NEW_LINE>split = Math.min(split, maxHeight - comp1.getMinimumSize().height);<NEW_LINE>split = Math.max(split, <MASK><NEW_LINE>dragbar.setVisible(true);<NEW_LINE>}<NEW_LINE>comp0.setBounds(in.left, in.top, maxWidth, split);<NEW_LINE>comp1.setBounds(in.left, in.top + split, maxWidth, maxHeight - split);<NEW_LINE>dragbar.setBounds(in.left, in.top + split - DRAG_TOLERANCE, maxWidth, 2 * DRAG_TOLERANCE);<NEW_LINE>} | comp0.getMinimumSize().height); |
962,225 | private void showRouteOnMap(List<WptPt> points) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (points.size() > 0 && mapActivity != null) {<NEW_LINE>OsmandMapTileView mapView = mapActivity.getMapView();<NEW_LINE>double left = 0, right = 0;<NEW_LINE>double top = 0, bottom = 0;<NEW_LINE>Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();<NEW_LINE>if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {<NEW_LINE>left = myLocation.getLongitude();<NEW_LINE>right = myLocation.getLongitude();<NEW_LINE>top = myLocation.getLatitude();<NEW_LINE>bottom = myLocation.getLatitude();<NEW_LINE>}<NEW_LINE>for (WptPt pt : points) {<NEW_LINE>if (left == 0) {<NEW_LINE>left = pt.getLongitude();<NEW_LINE>right = pt.getLongitude();<NEW_LINE>top = pt.getLatitude();<NEW_LINE>bottom = pt.getLatitude();<NEW_LINE>} else {<NEW_LINE>left = Math.min(left, pt.getLongitude());<NEW_LINE>right = Math.max(right, pt.getLongitude());<NEW_LINE>top = Math.max(top, pt.getLatitude());<NEW_LINE>bottom = Math.min(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>RotatedTileBox tb = mapView.getCurrentRotatedTileBox().copy();<NEW_LINE>int tileBoxWidthPx = 0;<NEW_LINE>int tileBoxHeightPx = 0;<NEW_LINE>if (portrait) {<NEW_LINE>tileBoxHeightPx = 3 * (tb.getPixHeight() - toolbarHeight) / 4;<NEW_LINE>} else {<NEW_LINE>tileBoxWidthPx = tb.getPixWidth() - mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);<NEW_LINE>}<NEW_LINE>mapView.fitRectToMap(left, right, top, bottom, tileBoxWidthPx, tileBoxHeightPx, toolbarHeight * 3 / 2);<NEW_LINE>}<NEW_LINE>} | bottom, pt.getLatitude()); |
1,494,061 | public IoBuffer encodePing(Ping ping) {<NEW_LINE>int len;<NEW_LINE>short type = ping.getEventType();<NEW_LINE>switch(type) {<NEW_LINE>case Ping.CLIENT_BUFFER:<NEW_LINE>len = 10;<NEW_LINE>break;<NEW_LINE>case Ping.PONG_SWF_VERIFY:<NEW_LINE>len = 44;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>len = 6;<NEW_LINE>}<NEW_LINE>final IoBuffer out = IoBuffer.allocate(len);<NEW_LINE>out.putShort(type);<NEW_LINE>switch(type) {<NEW_LINE>case Ping.STREAM_BEGIN:<NEW_LINE>case Ping.STREAM_PLAYBUFFER_CLEAR:<NEW_LINE>case Ping.STREAM_DRY:<NEW_LINE>case Ping.RECORDED_STREAM:<NEW_LINE>case Ping.PING_CLIENT:<NEW_LINE>case Ping.PONG_SERVER:<NEW_LINE>case Ping.BUFFER_EMPTY:<NEW_LINE>case Ping.BUFFER_FULL:<NEW_LINE>out.putInt(ping.getValue2().intValue());<NEW_LINE>break;<NEW_LINE>case Ping.CLIENT_BUFFER:<NEW_LINE>if (ping instanceof SetBuffer) {<NEW_LINE>SetBuffer setBuffer = (SetBuffer) ping;<NEW_LINE>out.putInt(setBuffer.getStreamId());<NEW_LINE>out.putInt(setBuffer.getBufferLength());<NEW_LINE>} else {<NEW_LINE>out.putInt(ping.<MASK><NEW_LINE>out.putInt(ping.getValue3());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Ping.PING_SWF_VERIFY:<NEW_LINE>break;<NEW_LINE>case Ping.PONG_SWF_VERIFY:<NEW_LINE>out.put(((SWFResponse) ping).getBytes());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// this may not be needed anymore<NEW_LINE>if (ping.getValue4() != Ping.UNDEFINED) {<NEW_LINE>out.putInt(ping.getValue4());<NEW_LINE>}<NEW_LINE>return out;<NEW_LINE>} | getValue2().intValue()); |
453,405 | public void configure(Parameterization config) {<NEW_LINE>//<NEW_LINE>new ObjectListParameter<SpatialSorter>(CURVES_ID, SpatialSorter.class).grab(config, x -> curvegen = x);<NEW_LINE>//<NEW_LINE>new DoubleParameter(WINDOW_ID, 10.0).grab(config, x -> window = x);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>new IntParameter(VARIANTS_ID, 1).//<NEW_LINE>addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT).grab(config, x -> variants = x);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>new IntParameter(DIM_ID).//<NEW_LINE>setOptional(//<NEW_LINE>true).//<NEW_LINE>addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT).grab(config, x -> odim = x);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>new ObjectParameter<RandomProjectionFamily>(PROJECTION_ID, RandomProjectionFamily.class).//<NEW_LINE>setOptional(true).grab(config, x -> proj = x);<NEW_LINE>new RandomParameter(RANDOM_ID).grab(<MASK><NEW_LINE>} | config, x -> random = x); |
1,745,621 | protected static void start(Remote remote) throws Exception {<NEW_LINE>setupRMI();<NEW_LINE>banJNDI();<NEW_LINE>if (ourRemote != null)<NEW_LINE>throw new AssertionError("Already started");<NEW_LINE>ourRemote = remote;<NEW_LINE>Registry registry;<NEW_LINE>int port;<NEW_LINE>for (Random random = new Random(); ; ) {<NEW_LINE>port = random.nextInt(0xffff);<NEW_LINE>if (port < 4000)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>registry = LocateRegistry.createRegistry(port);<NEW_LINE>break;<NEW_LINE>} catch (ExportException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Remote stub = UnicastRemoteObject.exportObject(ourRemote, 0);<NEW_LINE>final String name = remote.getClass().getSimpleName() + Integer.toHexString(stub.hashCode());<NEW_LINE>registry.bind(name, stub);<NEW_LINE>String id = port + "/" + name;<NEW_LINE>System.out.println("Port/ID: " + id);<NEW_LINE>long waitTime = 2 * 60 * 1000L;<NEW_LINE>Object lock = new Object();<NEW_LINE>// noinspection InfiniteLoopStatement<NEW_LINE>while (true) {<NEW_LINE>// noinspection SynchronizationOnLocalVariableOrMethodParameter<NEW_LINE>synchronized (lock) {<NEW_LINE>lock.wait(waitTime);<NEW_LINE>}<NEW_LINE>RemoteDeadHand deadHand = (RemoteDeadHand) registry.lookup(RemoteDeadHand.BINDING_NAME);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace(System.err);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | waitTime = deadHand.ping(id); |
469,932 | public static Download from(Cursor cursor) {<NEW_LINE>Download download = new Download();<NEW_LINE>download.mId = cursor.getLong(cursor.getColumnIndex(DownloadManager.COLUMN_ID));<NEW_LINE>download.mUri = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_URI));<NEW_LINE>int status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));<NEW_LINE>switch(status) {<NEW_LINE>case DownloadManager.STATUS_RUNNING:<NEW_LINE>download.mStatus = RUNNING;<NEW_LINE>break;<NEW_LINE>case DownloadManager.STATUS_FAILED:<NEW_LINE>download.mStatus = FAILED;<NEW_LINE>break;<NEW_LINE>case DownloadManager.STATUS_PAUSED:<NEW_LINE>download.mStatus = PAUSED;<NEW_LINE>break;<NEW_LINE>case DownloadManager.STATUS_PENDING:<NEW_LINE>download.mStatus = PENDING;<NEW_LINE>break;<NEW_LINE>case DownloadManager.STATUS_SUCCESSFUL:<NEW_LINE>download.mStatus = SUCCESSFUL;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>download.mStatus = UNAVAILABLE;<NEW_LINE>}<NEW_LINE>download.mMediaType = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_MEDIA_TYPE));<NEW_LINE>download.mTitle = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_TITLE));<NEW_LINE>download.mOutputFile = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));<NEW_LINE>download.mDescription = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_DESCRIPTION));<NEW_LINE>download.mSizeBytes = cursor.getLong(cursor.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES));<NEW_LINE>download.mDownloadedBytes = cursor.getLong(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR));<NEW_LINE>download.mLastModified = cursor.getLong(cursor.getColumnIndex(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP));<NEW_LINE>download.mReason = cursor.getString(cursor<MASK><NEW_LINE>return download;<NEW_LINE>} | .getColumnIndex(DownloadManager.COLUMN_REASON)); |
1,738,315 | protected Long createAclListForNetworkAndReturnAclListId(CreateNetworkACLCmd aclItemCmd, Network network) {<NEW_LINE>s_logger.debug("Network " + network.getId() + " is not associated with any ACL. Creating an ACL before adding acl item");<NEW_LINE>if (!networkModel.areServicesSupportedByNetworkOffering(network.getNetworkOfferingId(), Network.Service.NetworkACL)) {<NEW_LINE>throw new InvalidParameterValueException("Network Offering does not support NetworkACL service");<NEW_LINE>}<NEW_LINE>Vpc vpc = _entityMgr.findById(Vpc.class, network.getVpcId());<NEW_LINE>if (vpc == null) {<NEW_LINE>throw new InvalidParameterValueException("Unable to find Vpc associated with the Network");<NEW_LINE>}<NEW_LINE>String aclName = "VPC_" + vpc.getName() + "_Tier_" + network.getName() + "_ACL_" + network.getUuid();<NEW_LINE>String description = "ACL for " + aclName;<NEW_LINE>NetworkACL acl = _networkAclMgr.createNetworkACL(aclName, description, network.getVpcId(<MASK><NEW_LINE>if (acl == null) {<NEW_LINE>throw new CloudRuntimeException("Error while create ACL before adding ACL Item for network " + network.getId());<NEW_LINE>}<NEW_LINE>s_logger.debug("Created ACL: " + aclName + " for network " + network.getId());<NEW_LINE>Long aclId = acl.getId();<NEW_LINE>// Apply acl to network<NEW_LINE>try {<NEW_LINE>if (!_networkAclMgr.replaceNetworkACL(acl, (NetworkVO) network)) {<NEW_LINE>throw new CloudRuntimeException("Unable to apply auto created ACL to network " + network.getId());<NEW_LINE>}<NEW_LINE>s_logger.debug("Created ACL is applied to network " + network.getId());<NEW_LINE>} catch (ResourceUnavailableException e) {<NEW_LINE>throw new CloudRuntimeException("Unable to apply auto created ACL to network " + network.getId(), e);<NEW_LINE>}<NEW_LINE>return aclId;<NEW_LINE>} | ), aclItemCmd.isDisplay()); |
474,631 | private void altCommitToOriginal(@Nonnull DocumentEvent e) {<NEW_LINE>final PsiFile origPsiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(myOrigDocument);<NEW_LINE>String newText = myNewDocument.getText();<NEW_LINE>// prepare guarded blocks<NEW_LINE>Map<String, String> replacementMap = new LinkedHashMap<>();<NEW_LINE>int count = 0;<NEW_LINE>for (RangeMarker o : ContainerUtil.reverse(((DocumentEx) myNewDocument).getGuardedBlocks())) {<NEW_LINE>String replacement = o.getUserData(REPLACEMENT_KEY);<NEW_LINE>String tempText = "REPLACE" + (count++) + Long.toHexString(StringHash.calc(replacement));<NEW_LINE>newText = newText.substring(0, o.getStartOffset()) + tempText + newText.substring(o.getEndOffset());<NEW_LINE>replacementMap.put(tempText, replacement);<NEW_LINE>}<NEW_LINE>// run preformat processors<NEW_LINE>final int hostStartOffset = myAltFullRange.getStartOffset();<NEW_LINE>myEditor.getCaretModel().moveToOffset(hostStartOffset);<NEW_LINE>for (CopyPastePreProcessor preProcessor : Extensions.getExtensions(CopyPastePreProcessor.EP_NAME)) {<NEW_LINE>newText = preProcessor.preprocessOnPaste(myProject, origPsiFile, myEditor, newText, null);<NEW_LINE>}<NEW_LINE>myOrigDocument.replaceString(hostStartOffset, myAltFullRange.getEndOffset(), newText);<NEW_LINE>// replace temp strings for guarded blocks<NEW_LINE>for (String tempText : replacementMap.keySet()) {<NEW_LINE>int idx = CharArrayUtil.indexOf(myOrigDocument.getCharsSequence(), tempText, hostStartOffset, myAltFullRange.getEndOffset());<NEW_LINE>myOrigDocument.replaceString(idx, idx + tempText.length(), replacementMap.get(tempText));<NEW_LINE>}<NEW_LINE>// JAVA: fix occasional char literal concatenation<NEW_LINE><MASK><NEW_LINE>fixDocumentQuotes(myOrigDocument, myAltFullRange.getEndOffset());<NEW_LINE>// reformat<NEW_LINE>PsiDocumentManager.getInstance(myProject).commitDocument(myOrigDocument);<NEW_LINE>Runnable task = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>CodeStyleManager.getInstance(myProject).reformatRange(origPsiFile, hostStartOffset, myAltFullRange.getEndOffset(), true);<NEW_LINE>} catch (IncorrectOperationException e) {<NEW_LINE>// LOG.error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DocumentUtil.executeInBulk(myOrigDocument, true, task);<NEW_LINE>PsiElement newInjected = InjectedLanguageManager.getInstance(myProject).findInjectedElementAt(origPsiFile, hostStartOffset);<NEW_LINE>DocumentWindow documentWindow = newInjected == null ? null : InjectedLanguageUtil.getDocumentWindow(newInjected);<NEW_LINE>if (documentWindow != null) {<NEW_LINE>myEditor.getCaretModel().moveToOffset(documentWindow.injectedToHost(e.getOffset()));<NEW_LINE>myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);<NEW_LINE>}<NEW_LINE>} | fixDocumentQuotes(myOrigDocument, hostStartOffset - 1); |
1,426,708 | final DeleteScheduledAuditResult executeDeleteScheduledAudit(DeleteScheduledAuditRequest deleteScheduledAuditRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteScheduledAuditRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteScheduledAuditRequest> request = null;<NEW_LINE>Response<DeleteScheduledAuditResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteScheduledAuditRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteScheduledAuditRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteScheduledAuditResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteScheduledAuditResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteScheduledAudit"); |
600,483 | public Mono<MatchResult> matches(ServerWebExchange exchange) {<NEW_LINE>List<MediaType> httpRequestMediaTypes;<NEW_LINE>try {<NEW_LINE>httpRequestMediaTypes = resolveMediaTypes(exchange);<NEW_LINE>} catch (NotAcceptableStatusException ex) {<NEW_LINE>this.logger.debug("Failed to parse MediaTypes, returning false", ex);<NEW_LINE>return MatchResult.notMatch();<NEW_LINE>}<NEW_LINE>this.logger.debug(LogMessage.format("httpRequestMediaTypes=%s", httpRequestMediaTypes));<NEW_LINE>for (MediaType httpRequestMediaType : httpRequestMediaTypes) {<NEW_LINE>this.logger.debug(LogMessage.format("Processing %s", httpRequestMediaType));<NEW_LINE>if (shouldIgnore(httpRequestMediaType)) {<NEW_LINE>this.logger.debug("Ignoring");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (this.useEquals) {<NEW_LINE>boolean isEqualTo = this.matchingMediaTypes.contains(httpRequestMediaType);<NEW_LINE>this.logger.debug("isEqualTo " + isEqualTo);<NEW_LINE>return isEqualTo ? MatchResult.match() : MatchResult.notMatch();<NEW_LINE>}<NEW_LINE>for (MediaType matchingMediaType : this.matchingMediaTypes) {<NEW_LINE>boolean <MASK><NEW_LINE>this.logger.debug(LogMessage.format("%s .isCompatibleWith %s = %s", matchingMediaType, httpRequestMediaType, isCompatibleWith));<NEW_LINE>if (isCompatibleWith) {<NEW_LINE>return MatchResult.match();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.logger.debug("Did not match any media types");<NEW_LINE>return MatchResult.notMatch();<NEW_LINE>} | isCompatibleWith = matchingMediaType.isCompatibleWith(httpRequestMediaType); |
260,590 | public static DescribeCacheAnalysisReportListResponse unmarshall(DescribeCacheAnalysisReportListResponse describeCacheAnalysisReportListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCacheAnalysisReportListResponse.setRequestId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.RequestId"));<NEW_LINE>describeCacheAnalysisReportListResponse.setInstanceId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.InstanceId"));<NEW_LINE>describeCacheAnalysisReportListResponse.setPageRecordCount(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.PageRecordCount"));<NEW_LINE>describeCacheAnalysisReportListResponse.setPageNumbers(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.PageNumbers"));<NEW_LINE>describeCacheAnalysisReportListResponse.setTotalRecordCount(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.TotalRecordCount"));<NEW_LINE>List<DailyTask> dailyTasks <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCacheAnalysisReportListResponse.DailyTasks.Length"); i++) {<NEW_LINE>DailyTask dailyTask = new DailyTask();<NEW_LINE>dailyTask.setDate(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Date"));<NEW_LINE>List<Task> tasks = new ArrayList<Task>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks.Length"); j++) {<NEW_LINE>Task task = new Task();<NEW_LINE>task.setStatus(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].Status"));<NEW_LINE>task.setStartTime(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].StartTime"));<NEW_LINE>task.setTaskId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].TaskId"));<NEW_LINE>task.setNodeId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].NodeId"));<NEW_LINE>tasks.add(task);<NEW_LINE>}<NEW_LINE>dailyTask.setTasks(tasks);<NEW_LINE>dailyTasks.add(dailyTask);<NEW_LINE>}<NEW_LINE>describeCacheAnalysisReportListResponse.setDailyTasks(dailyTasks);<NEW_LINE>return describeCacheAnalysisReportListResponse;<NEW_LINE>} | = new ArrayList<DailyTask>(); |
624,417 | private void registerMetadata(final String rpcType, final String contextPath, final MetaDataRegisterDTO metadata) {<NEW_LINE>String metadataNodeName = buildMetadataNodeName(metadata);<NEW_LINE>String metaDataPath = RegisterPathConstants.buildMetaDataParentPath(rpcType, contextPath);<NEW_LINE>if (!zkClient.exists(metaDataPath)) {<NEW_LINE>zkClient.createPersistent(metaDataPath, true);<NEW_LINE>}<NEW_LINE>String realNode = <MASK><NEW_LINE>if (zkClient.exists(realNode)) {<NEW_LINE>zkClient.writeData(realNode, GsonUtils.getInstance().toJson(metadata));<NEW_LINE>} else {<NEW_LINE>// if contextPath has two /, in zk means two folder, we need to create parent folder first, or else it will throw no node exception<NEW_LINE>zkClient.createPersistent(realNode, true);<NEW_LINE>zkClient.writeData(realNode, GsonUtils.getInstance().toJson(metadata));<NEW_LINE>}<NEW_LINE>} | RegisterPathConstants.buildRealNode(metaDataPath, metadataNodeName); |
1,380,819 | public Project doInTransaction(TransactionStatus status) {<NEW_LINE>// Create an account associated with the project<NEW_LINE>StringBuilder acctNm = new StringBuilder("PrjAcct-");<NEW_LINE>acctNm.append(name).append("-").<MASK><NEW_LINE>Account projectAccount = _accountMgr.createAccount(acctNm.toString(), Account.Type.PROJECT, null, domainId, null, null, UUID.randomUUID().toString());<NEW_LINE>Project project = _projectDao.persist(new ProjectVO(name, displayText, ownerFinal.getDomainId(), projectAccount.getId()));<NEW_LINE>// assign owner to the project<NEW_LINE>assignAccountToProject(project, ownerFinal.getId(), ProjectAccount.Role.Admin, Optional.ofNullable(finalUser).map(User::getId).orElse(null), null);<NEW_LINE>if (project != null) {<NEW_LINE>CallContext.current().setEventDetails("Project id=" + project.getId());<NEW_LINE>CallContext.current().putContextParameter(Project.class, project.getUuid());<NEW_LINE>}<NEW_LINE>// Increment resource count<NEW_LINE>_resourceLimitMgr.incrementResourceCount(ownerFinal.getId(), ResourceType.project);<NEW_LINE>return project;<NEW_LINE>} | append(ownerFinal.getDomainId()); |
717,821 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.<MASK><NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>FilterControlledPermanent filter = new FilterControlledPermanent("creature");<NEW_LINE>filter.add(CardType.CREATURE.getPredicate());<NEW_LINE>filter.add(TargetController.YOU.getControllerPredicate());<NEW_LINE>TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true);<NEW_LINE>// A spell or ability could have removed the only legal target this player<NEW_LINE>// had, if thats the case this ability should fizzle.<NEW_LINE>if (target.canChoose(player.getId(), source, game)) {<NEW_LINE>player.choose(Outcome.Sacrifice, target, source, game);<NEW_LINE>Permanent permanent = game.getPermanent(target.getFirstTarget());<NEW_LINE>if (permanent != null) {<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>controller.drawCards(permanent.getPower().getValue(), source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getTargets().getFirstTarget()); |
772,623 | void collectDbStats(ArrayList<DbStats> dbStatsList) {<NEW_LINE>// Get information about the main database.<NEW_LINE>int lookaside = nativeGetDbLookaside(mConnectionPtr);<NEW_LINE>long pageCount = 0;<NEW_LINE>long pageSize = 0;<NEW_LINE>try {<NEW_LINE>pageCount = executeForLong("PRAGMA page_count;", null, null);<NEW_LINE>pageSize = executeForLong("PRAGMA page_size;", null, null);<NEW_LINE>} catch (SQLiteException ex) {<NEW_LINE>// Ignore.<NEW_LINE>}<NEW_LINE>dbStatsList.add(getMainDbStatsUnsafe<MASK><NEW_LINE>// Get information about attached databases.<NEW_LINE>// We ignore the first row in the database list because it corresponds to<NEW_LINE>// the main database which we have already described.<NEW_LINE>CursorWindow window = new CursorWindow("collectDbStats");<NEW_LINE>try {<NEW_LINE>executeForCursorWindow("PRAGMA database_list;", null, window, 0, 0, false, null);<NEW_LINE>for (int i = 1; i < window.getNumRows(); i++) {<NEW_LINE>String name = window.getString(i, 1);<NEW_LINE>String path = window.getString(i, 2);<NEW_LINE>pageCount = 0;<NEW_LINE>pageSize = 0;<NEW_LINE>try {<NEW_LINE>pageCount = executeForLong("PRAGMA " + name + ".page_count;", null, null);<NEW_LINE>pageSize = executeForLong("PRAGMA " + name + ".page_size;", null, null);<NEW_LINE>} catch (SQLiteException ex) {<NEW_LINE>// Ignore.<NEW_LINE>}<NEW_LINE>String label = " (attached) " + name;<NEW_LINE>if (!path.isEmpty()) {<NEW_LINE>label += ": " + path;<NEW_LINE>}<NEW_LINE>dbStatsList.add(new DbStats(label, pageCount, pageSize, 0, 0, 0, 0));<NEW_LINE>}<NEW_LINE>} catch (SQLiteException ex) {<NEW_LINE>// Ignore.<NEW_LINE>} finally {<NEW_LINE>window.close();<NEW_LINE>}<NEW_LINE>} | (lookaside, pageCount, pageSize)); |
70,424 | void createOAuth2ClientFilter(BeanReference requestCache, BeanReference authenticationManager, BeanReference authenticationFilterSecurityContextRepositoryRef) {<NEW_LINE>Element oauth2ClientElt = DomUtils.getChildElementByTagName(this.httpElt, Elements.OAUTH2_CLIENT);<NEW_LINE>if (oauth2ClientElt == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.oauth2ClientEnabled = true;<NEW_LINE>OAuth2ClientBeanDefinitionParser parser = new OAuth2ClientBeanDefinitionParser(requestCache, authenticationManager, authenticationFilterSecurityContextRepositoryRef);<NEW_LINE>parser.parse(oauth2ClientElt, this.pc);<NEW_LINE>BeanDefinition defaultAuthorizedClientRepository = parser.getDefaultAuthorizedClientRepository();<NEW_LINE>registerDefaultAuthorizedClientRepositoryIfNecessary(defaultAuthorizedClientRepository);<NEW_LINE>this.authorizationRequestRedirectFilter = parser.getAuthorizationRequestRedirectFilter();<NEW_LINE>String authorizationRequestRedirectFilterId = this.pc.getReaderContext().generateBeanName(this.authorizationRequestRedirectFilter);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(this.authorizationRequestRedirectFilter, authorizationRequestRedirectFilterId));<NEW_LINE>this.authorizationCodeGrantFilter = parser.getAuthorizationCodeGrantFilter();<NEW_LINE>String authorizationCodeGrantFilterId = this.pc.getReaderContext().generateBeanName(this.authorizationCodeGrantFilter);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition<MASK><NEW_LINE>BeanDefinition authorizationCodeAuthenticationProvider = parser.getAuthorizationCodeAuthenticationProvider();<NEW_LINE>String authorizationCodeAuthenticationProviderId = this.pc.getReaderContext().generateBeanName(authorizationCodeAuthenticationProvider);<NEW_LINE>this.pc.registerBeanComponent(new BeanComponentDefinition(authorizationCodeAuthenticationProvider, authorizationCodeAuthenticationProviderId));<NEW_LINE>this.authorizationCodeAuthenticationProviderRef = new RuntimeBeanReference(authorizationCodeAuthenticationProviderId);<NEW_LINE>} | (this.authorizationCodeGrantFilter, authorizationCodeGrantFilterId)); |
1,358,347 | public com.amazonaws.services.lexruntimev2.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lexruntimev2.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.lexruntimev2.model.ResourceNotFoundException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 resourceNotFoundException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,396,145 | final DeleteFileShareResult executeDeleteFileShare(DeleteFileShareRequest deleteFileShareRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFileShareRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFileShareRequest> request = null;<NEW_LINE>Response<DeleteFileShareResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFileShareRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFileShareRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFileShare");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFileShareResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFileShareResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway"); |
1,508,774 | final UpdateLoggingConfigurationResult executeUpdateLoggingConfiguration(UpdateLoggingConfigurationRequest updateLoggingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateLoggingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateLoggingConfigurationRequest> request = null;<NEW_LINE>Response<UpdateLoggingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateLoggingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateLoggingConfigurationRequest));<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, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateLoggingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateLoggingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateLoggingConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,010,615 | private static LinkedHashMap<String, List<RestLogFileHandle>> sortHandles(List<RestLogFileHandle> handles) {<NEW_LINE>// group by taskName<NEW_LINE>Map<String, List<RestLogFileHandle>> group = new HashMap<>();<NEW_LINE>for (RestLogFileHandle handle : handles) {<NEW_LINE>List<RestLogFileHandle> list = group.get(handle.getTaskName());<NEW_LINE>if (list == null) {<NEW_LINE>list = new ArrayList<>();<NEW_LINE>group.put(<MASK><NEW_LINE>}<NEW_LINE>list.add(handle);<NEW_LINE>}<NEW_LINE>// sort by min(fileTime)<NEW_LINE>List<List<RestLogFileHandle>> sorted = new ArrayList<>(group.values());<NEW_LINE>Collections.sort(sorted, new Comparator<List<RestLogFileHandle>>() {<NEW_LINE><NEW_LINE>public int compare(List<RestLogFileHandle> o1, List<RestLogFileHandle> o2) {<NEW_LINE>return getMinTime(o1).compareTo(getMinTime(o2));<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean equals(Object o) {<NEW_LINE>return o == this;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LinkedHashMap<String, List<RestLogFileHandle>> map = new LinkedHashMap<>();<NEW_LINE>for (List<RestLogFileHandle> list : sorted) {<NEW_LINE>map.put(list.get(0).getTaskName(), list);<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | handle.getTaskName(), list); |
1,274,346 | private GraphQLResponse process(final String requestJson, final String operationName, final Map<String, Object> variables) {<NEW_LINE>Map<GraphQLContextType, Object> contextMap = new ConcurrentHashMap<>();<NEW_LINE>contextMap.putAll(graphQlContextMap);<NEW_LINE>contextMap.put(GraphQLContextType.IS_ALIVE_HANDLER, new IsAliveHandler(scheduler, config.getHttpTimeoutSec()));<NEW_LINE>final ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(requestJson).operationName(operationName).variables(variables).graphQLContext(contextMap).build();<NEW_LINE>final ExecutionResult result = graphQL.execute(executionInput);<NEW_LINE>final Map<String, Object<MASK><NEW_LINE>final List<GraphQLError> errors = result.getErrors();<NEW_LINE>if (errors.size() == 0) {<NEW_LINE>return new GraphQLSuccessResponse(toSpecificationResult);<NEW_LINE>} else {<NEW_LINE>return new GraphQLErrorResponse(toSpecificationResult);<NEW_LINE>}<NEW_LINE>} | > toSpecificationResult = result.toSpecification(); |
193,161 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int xValue = source.getManaCostsToPay().getX();<NEW_LINE>Cards cards = new CardsImpl(player.getLibrary()<MASK><NEW_LINE>player.lookAtCards(source, null, cards, game);<NEW_LINE>FilterCard filter = new FilterCreatureCard("creature card with mana value " + xValue + " or less");<NEW_LINE>filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xValue + 1));<NEW_LINE>TargetCard target = new TargetCardInLibrary(0, 1, filter);<NEW_LINE>if (player.choose(outcome, cards, target, game)) {<NEW_LINE>Card card = game.getCard(target.getFirstTarget());<NEW_LINE>if (player.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>cards.remove(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return player.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>} | .getTopCards(game, xValue)); |
1,256,275 | public SwitchCase convert(org.eclipse.jdt.internal.compiler.ast.CaseStatement statement) {<NEW_LINE>SwitchCase switchCase = new SwitchCase(this.ast);<NEW_LINE>if (this.ast.apiLevel >= AST.JLS14_INTERNAL) {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Expression[] expressions = statement.constantExpressions;<NEW_LINE>if (expressions == null || expressions.length == 0) {<NEW_LINE>switchCase.expressions().clear();<NEW_LINE>} else {<NEW_LINE>for (org.eclipse.jdt.internal.compiler.ast.Expression expression : expressions) {<NEW_LINE>switchCase.expressions().add(convert(expression));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Expression[] constantExpressions = statement.constantExpressions;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Expression constantExpression = constantExpressions != null && constantExpressions.length > <MASK><NEW_LINE>if (constantExpression == null) {<NEW_LINE>internalSetExpression(switchCase, null);<NEW_LINE>} else {<NEW_LINE>internalSetExpression(switchCase, convert(constantExpression));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.ast.apiLevel >= AST.JLS14_INTERNAL) {<NEW_LINE>switchCase.setSwitchLabeledRule(statement.isExpr);<NEW_LINE>}<NEW_LINE>switchCase.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);<NEW_LINE>if (statement.isExpr) {<NEW_LINE>retrieveArrowPosition(switchCase);<NEW_LINE>} else {<NEW_LINE>retrieveColonPosition(switchCase);<NEW_LINE>}<NEW_LINE>return switchCase;<NEW_LINE>} | 0 ? constantExpressions[0] : null; |
1,663,046 | public static void main(String[] args) throws Exception {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption(option(0, "l", OPTION_LOCAL, "Run the topology in local mode."));<NEW_LINE>options.addOption(option(0, "r", OPTION_REMOTE, "Deploy the topology to a remote cluster."));<NEW_LINE>options.addOption(option(0, "R", OPTION_RESOURCE, "Treat the supplied path as a classpath resource instead of a file."));<NEW_LINE>options.addOption(option(1, "s", OPTION_SLEEP, "ms", "When running locally, the amount of time to sleep (in ms.) " + "before killing the topology and shutting down the local cluster."));<NEW_LINE>options.addOption(option(0, "d", OPTION_DRY_RUN, "Do not run or deploy the topology. Just build, validate, " + "and print information about the topology."));<NEW_LINE>options.addOption(option(0, "q", OPTION_NO_DETAIL, "Suppress the printing of topology details."));<NEW_LINE>options.addOption(option(0, "n", OPTION_NO_SPLASH, "Suppress the printing of the splash screen."));<NEW_LINE>options.addOption(option(0, "i", OPTION_INACTIVE, "Deploy the topology, but do not activate it."));<NEW_LINE>options.addOption(option(1, "z", OPTION_ZOOKEEPER, "host:port", "When running in local mode, use the ZooKeeper at the " + "specified <host>:<port> instead of the in-process ZooKeeper. (requires Storm 0.9.3 or later)"));<NEW_LINE>options.addOption(option(1, "f", OPTION_FILTER, "file"<MASK><NEW_LINE>options.addOption(option(0, "e", OPTION_ENV_FILTER, "Perform environment variable substitution. Replace keys" + "identified with `${ENV-[NAME]}` will be replaced with the corresponding `NAME` environment value"));<NEW_LINE>CommandLineParser parser = new BasicParser();<NEW_LINE>CommandLine cmd = parser.parse(options, args);<NEW_LINE>if (cmd.getArgs().length != 1) {<NEW_LINE>usage(options);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>runCli(cmd);<NEW_LINE>} | , "Perform property substitution. Use the specified file " + "as a source of properties, and replace keys identified with {$[property name]} with the value defined " + "in the properties file.")); |
1,137,336 | public void acaoBotaoPickColor(WebButton botao, String tema, PainelCor pc) {<NEW_LINE>botao.addActionListener(new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>Color cor = JColorChooser.showDialog(null, "Selecione a cor", pc.getSelectedColor());<NEW_LINE>if (cor != null) {<NEW_LINE>if (!tema.equals("Dark") && !tema.equals("Portugol")) {<NEW_LINE>WeblafUtils.configurarBotao(botao, cor, ColorController.COR_LETRA_TITULO, cor.brighter(), <MASK><NEW_LINE>pc.setSelectedColor(cor);<NEW_LINE>botao.revalidate();<NEW_LINE>botao.repaint();<NEW_LINE>} else {<NEW_LINE>String newName = tema + "Editado" + editavelcount;<NEW_LINE>editavelcount++;<NEW_LINE>while (model.contains(newName)) {<NEW_LINE>newName = tema + "Editado" + editavelcount;<NEW_LINE>editavelcount++;<NEW_LINE>}<NEW_LINE>criarNovoTema(newName);<NEW_LINE>alterarCorPainel(pc.getNome(), cor);<NEW_LINE>botao.revalidate();<NEW_LINE>botao.repaint();<NEW_LINE>}<NEW_LINE>alterarCorJson(tema, pc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ColorController.COR_LETRA_TITULO, 1, true); |
252,443 | @Consume(HibernateEnhancersRegisteredBuildItem.class)<NEW_LINE>void build(PanacheHibernateOrmRecorder recorder, CombinedIndexBuildItem index, BuildProducer<BytecodeTransformerBuildItem> transformers, List<PanacheEntityClassBuildItem> entityClasses, Optional<JpaModelPersistenceUnitMappingBuildItem> jpaModelPersistenceUnitMapping, List<PanacheMethodCustomizerBuildItem> methodCustomizersBuildItems) {<NEW_LINE>List<PanacheMethodCustomizer> methodCustomizers = methodCustomizersBuildItems.stream().map(PanacheMethodCustomizerBuildItem::getMethodCustomizer).collect(Collectors.toList());<NEW_LINE>PanacheJpaRepositoryEnhancer daoEnhancer = new PanacheJpaRepositoryEnhancer(index.getIndex(), JavaJpaTypeBundle.BUNDLE);<NEW_LINE>Set<String> panacheEntities = new HashSet<>();<NEW_LINE>for (ClassInfo classInfo : index.getIndex().getAllKnownImplementors(DOTNAME_PANACHE_REPOSITORY_BASE)) {<NEW_LINE>// Skip PanacheRepository<NEW_LINE>if (classInfo.name().equals(DOTNAME_PANACHE_REPOSITORY))<NEW_LINE>continue;<NEW_LINE>if (daoEnhancer.skipRepository(classInfo))<NEW_LINE>continue;<NEW_LINE>List<org.jboss.jandex.Type> typeParameters = JandexUtil.resolveTypeParameters(classInfo.name(), DOTNAME_PANACHE_REPOSITORY_BASE, index.getIndex());<NEW_LINE>panacheEntities.add(typeParameters.get(0).name().toString());<NEW_LINE>transformers.produce(new BytecodeTransformerBuildItem(classInfo.name().toString(), daoEnhancer));<NEW_LINE>}<NEW_LINE>PanacheJpaEntityOperationsEnhancer entityOperationsEnhancer = new PanacheJpaEntityOperationsEnhancer(index.getIndex(<MASK><NEW_LINE>Set<String> modelClasses = new HashSet<>();<NEW_LINE>for (PanacheEntityClassBuildItem entityClass : entityClasses) {<NEW_LINE>String entityClassName = entityClass.get().name().toString();<NEW_LINE>modelClasses.add(entityClassName);<NEW_LINE>transformers.produce(new BytecodeTransformerBuildItem(true, entityClassName, entityOperationsEnhancer));<NEW_LINE>}<NEW_LINE>panacheEntities.addAll(modelClasses);<NEW_LINE>recordPanacheEntityPersistenceUnits(recorder, jpaModelPersistenceUnitMapping, panacheEntities);<NEW_LINE>} | ), methodCustomizers, JavaJpaTypeBundle.BUNDLE); |
617,993 | public static String obfuscate(String s) {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>byte[] b = s.getBytes(StandardCharsets.UTF_8);<NEW_LINE>buf.append(__OBFUSCATE);<NEW_LINE>for (int i = 0; i < b.length; i++) {<NEW_LINE>byte b1 = b[i];<NEW_LINE>byte b2 = b[b.length - (i + 1)];<NEW_LINE>if (b1 < 0 || b2 < 0) {<NEW_LINE>int i0 = (0xff & b1) * 256 + (0xff & b2);<NEW_LINE>String x = Integer.toString(i0, 36).toLowerCase(Locale.ENGLISH);<NEW_LINE>buf.append("U0000", 0, 5 - x.length());<NEW_LINE>buf.append(x);<NEW_LINE>} else {<NEW_LINE>int i1 = 127 + b1 + b2;<NEW_LINE>int i2 = 127 + b1 - b2;<NEW_LINE>int i0 = i1 * 256 + i2;<NEW_LINE>String x = Integer.toString(i0, 36).toLowerCase(Locale.ENGLISH);<NEW_LINE>int j0 = Integer.parseInt(x, 36);<NEW_LINE>int j1 = (i0 / 256);<NEW_LINE>int j2 = (i0 % 256);<NEW_LINE>byte bx = (byte) ((j1 <MASK><NEW_LINE>buf.append("000", 0, 4 - x.length());<NEW_LINE>buf.append(x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>} | + j2 - 254) / 2); |
1,684,225 | public Response<Void> deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) {<NEW_LINE>String groupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (groupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "services");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));<NEW_LINE>}<NEW_LINE>String projectName = Utils.getValueFromIdByName(id, "projects");<NEW_LINE>if (projectName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String taskName = Utils.getValueFromIdByName(id, "tasks");<NEW_LINE>if (taskName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(groupName, serviceName, projectName, taskName, deleteRunningTasks, context);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); |
721,980 | private void cleanConfig() {<NEW_LINE>removeInvalidTags("tagtabs");<NEW_LINE>List<String> tags = configManager.getConfigurationKeys(CONFIG_GROUP + ".item_");<NEW_LINE>tags.forEach(s -> {<NEW_LINE>String[] split = s.split("\\.", 2);<NEW_LINE>removeInvalidTags(split[1]);<NEW_LINE>});<NEW_LINE>List<String> icons = configManager.getConfigurationKeys(CONFIG_GROUP + ".icon_");<NEW_LINE>icons.forEach(s -> {<NEW_LINE>String[] split = s.split("\\.", 2);<NEW_LINE>String replaced = split[1].replaceAll("[<>/]", "");<NEW_LINE>if (!split[1].equals(replaced)) {<NEW_LINE>String value = configManager.getConfiguration(CONFIG_GROUP, split[1]);<NEW_LINE>configManager.unsetConfiguration<MASK><NEW_LINE>if (replaced.length() > "icon_".length()) {<NEW_LINE>configManager.setConfiguration(CONFIG_GROUP, replaced, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (CONFIG_GROUP, split[1]); |
1,383,071 | public int compare(DLNAResource o1, DLNAResource o2) {<NEW_LINE>if (getDiscNum(o1) == null || getDiscNum(o2) == null || getDiscNum(o1).equals(getDiscNum(o2))) {<NEW_LINE>if (o1 != null && o1.getFormat() != null && o1.getFormat().isAudio()) {<NEW_LINE>if (o2 != null && o2.getFormat() != null && o2.getFormat().isAudio()) {<NEW_LINE>return getTrackNum(o1).compareTo(getTrackNum(o2));<NEW_LINE>} else {<NEW_LINE>return o1.getDisplayNameBase().<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return o1.getDisplayNameBase().compareTo(o2.getDisplayNameBase());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return getDiscNum(o1).compareTo(getDiscNum(o2));<NEW_LINE>}<NEW_LINE>} | compareTo(o2.getDisplayNameBase()); |
617,951 | // return true if commit success and publish success, return false if publish timeout<NEW_LINE>private boolean loadTxnCommitImpl(TLoadTxnCommitRequest request) throws UserException {<NEW_LINE><MASK><NEW_LINE>if (Strings.isNullOrEmpty(cluster)) {<NEW_LINE>cluster = SystemInfoService.DEFAULT_CLUSTER;<NEW_LINE>}<NEW_LINE>if (request.isSetAuthCode()) {<NEW_LINE>// TODO(cmy): find a way to check<NEW_LINE>} else if (request.isSetAuthCodeUuid()) {<NEW_LINE>checkAuthCodeUuid(request.getDb(), request.getTxnId(), request.getAuthCodeUuid());<NEW_LINE>} else {<NEW_LINE>checkPasswordAndPrivs(cluster, request.getUser(), request.getPasswd(), request.getDb(), request.getTbl(), request.getUserIp(), PrivPredicate.LOAD);<NEW_LINE>}<NEW_LINE>// get database<NEW_LINE>Env env = Env.getCurrentEnv();<NEW_LINE>String fullDbName = ClusterNamespace.getFullName(cluster, request.getDb());<NEW_LINE>Database db;<NEW_LINE>if (request.isSetDbId() && request.getDbId() > 0) {<NEW_LINE>db = env.getInternalCatalog().getDbNullable(request.getDbId());<NEW_LINE>} else {<NEW_LINE>db = env.getInternalCatalog().getDbNullable(fullDbName);<NEW_LINE>}<NEW_LINE>if (db == null) {<NEW_LINE>String dbName = fullDbName;<NEW_LINE>if (Strings.isNullOrEmpty(request.getCluster())) {<NEW_LINE>dbName = request.getDb();<NEW_LINE>}<NEW_LINE>throw new UserException("unknown database, database=" + dbName);<NEW_LINE>}<NEW_LINE>long timeoutMs = request.isSetThriftRpcTimeoutMs() ? request.getThriftRpcTimeoutMs() / 2 : 5000;<NEW_LINE>Table table = db.getTableOrMetaException(request.getTbl(), TableType.OLAP);<NEW_LINE>return Env.getCurrentGlobalTransactionMgr().commitAndPublishTransaction(db, Lists.newArrayList(table), request.getTxnId(), TabletCommitInfo.fromThrift(request.getCommitInfos()), timeoutMs, TxnCommitAttachment.fromThrift(request.txnCommitAttachment));<NEW_LINE>} | String cluster = request.getCluster(); |
407,573 | void compileSingleFile(Path filePath, Path outputDir, AvroOptions options) throws CodeGenException {<NEW_LINE>try (Idl parser = new Idl(filePath.toFile())) {<NEW_LINE>Protocol idlProtocol = parser.CompilationUnit();<NEW_LINE>String json = idlProtocol.toString(false);<NEW_LINE>Protocol protocol = Protocol.parse(json);<NEW_LINE>final SpecificCompiler compiler = new SpecificCompiler(protocol);<NEW_LINE>compiler.setTemplateDir(templateDirectory);<NEW_LINE>compiler.setStringType(options.stringType);<NEW_LINE>compiler.setFieldVisibility(SpecificCompiler.FieldVisibility.PRIVATE);<NEW_LINE>compiler.setCreateOptionalGetters(options.createOptionalGetters);<NEW_LINE>compiler.setGettersReturnOptional(options.gettersReturnOptional);<NEW_LINE>compiler.setOptionalGettersForNullableFieldsOnly(options.optionalGettersForNullableFieldsOnly);<NEW_LINE>compiler.setCreateSetters(options.createSetters);<NEW_LINE>compiler.setEnableDecimalLogicalType(options.enableDecimalLogicalType);<NEW_LINE>compiler.setOutputCharacterEncoding("UTF-8");<NEW_LINE>compiler.compileToDestination(filePath.toFile(), outputDir.toFile());<NEW_LINE>} catch (IOException | ParseException e) {<NEW_LINE>throw new CodeGenException("Failed to compile avro IDL file: " + filePath.<MASK><NEW_LINE>}<NEW_LINE>} | toString() + " to Java", e); |
849,339 | private // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>supertypePanel = new javax.swing.JPanel();<NEW_LINE>supertypeCombo = new javax.swing.JComboBox();<NEW_LINE>supertypeLabel = new javax.swing.JLabel();<NEW_LINE>chooseLabel = <MASK><NEW_LINE>scrollPane = new javax.swing.JScrollPane();<NEW_LINE>membersTable = new javax.swing.JTable();<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 11, 11));<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>supertypePanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));<NEW_LINE>supertypePanel.setLayout(new java.awt.BorderLayout(12, 0));<NEW_LINE>supertypePanel.add(supertypeCombo, java.awt.BorderLayout.CENTER);<NEW_LINE>supertypeLabel.setLabelFor(supertypeCombo);<NEW_LINE>// NOI18N<NEW_LINE>java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/refactoring/java/ui/Bundle");<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(supertypeLabel, bundle.getString("LBL_PullUp_Supertype"));<NEW_LINE>supertypePanel.add(supertypeLabel, java.awt.BorderLayout.WEST);<NEW_LINE>// NOI18N<NEW_LINE>supertypeLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PullUpPanel.class, "ACSD_DestinationSupertypeName"));<NEW_LINE>// NOI18N<NEW_LINE>supertypeLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PullUpPanel.class, "ACSD_DestinationSupertypeDescription"));<NEW_LINE>chooseLabel.setLabelFor(membersTable);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(chooseLabel, org.openide.util.NbBundle.getMessage(PullUpPanel.class, "LBL_PullUpLabel"));<NEW_LINE>chooseLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(6, 0, 0, 0));<NEW_LINE>supertypePanel.add(chooseLabel, java.awt.BorderLayout.SOUTH);<NEW_LINE>add(supertypePanel, java.awt.BorderLayout.NORTH);<NEW_LINE>membersTable.setModel(tableModel);<NEW_LINE>membersTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);<NEW_LINE>scrollPane.setViewportView(membersTable);<NEW_LINE>// NOI18N<NEW_LINE>membersTable.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PullUpPanel.class, "ACSD_MembersToPullUp"));<NEW_LINE>// NOI18N<NEW_LINE>membersTable.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PullUpPanel.class, "ACSD_MembersToPullUpDescription"));<NEW_LINE>add(scrollPane, java.awt.BorderLayout.CENTER);<NEW_LINE>} | new javax.swing.JLabel(); |
1,011,094 | // submit the map/reduce job.<NEW_LINE>public int run(final String[] args) throws Exception {<NEW_LINE>if (args.length != 1) {<NEW_LINE>return printUsage();<NEW_LINE>}<NEW_LINE>Path in_path = new Path(args[0]);<NEW_LINE>System.out.println("\n-----===[PEGASUS: A Peta-Scale Graph Mining System]===-----\n");<NEW_LINE>System.out.println("[PEGASUS] Computing L1norm. in_path=" + <MASK><NEW_LINE>final FileSystem fs = FileSystem.get(getConf());<NEW_LINE>Path l1norm_output = new Path("l1norm_output");<NEW_LINE>fs.delete(l1norm_output);<NEW_LINE>JobClient.runJob(configL1norm(in_path, l1norm_output));<NEW_LINE>System.out.println("\n[PEGASUS] L1norm computed. Output is saved in HDFS " + l1norm_output.getName() + "\n");<NEW_LINE>return 0;<NEW_LINE>} | in_path.getName() + "\n"); |
1,570,926 | private void generateWritesGroup() {<NEW_LINE>GridData gridData;<NEW_LINE>Group gCacheWrites = new Group(panel, SWT.NULL);<NEW_LINE>Messages.setLanguageText(gCacheWrites, "CacheView.writes.title");<NEW_LINE>gCacheWrites.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>GridLayout layoutGeneral = new GridLayout();<NEW_LINE>layoutGeneral.numColumns = 6;<NEW_LINE>gCacheWrites.setLayout(layoutGeneral);<NEW_LINE>Label lbl;<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>Messages.setLanguageText(lbl, "CacheView.reads.#");<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>Messages.setLanguageText(lbl, "CacheView.reads.amount");<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>Messages.setLanguageText(lbl, "CacheView.reads.avgsize");<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lbl.setLayoutData(gridData);<NEW_LINE>Messages.setLanguageText(lbl, "CacheView.writes.toCache");<NEW_LINE>lblNumberWritesToCache = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblNumberWritesToCache.setLayoutData(gridData);<NEW_LINE>lblWritesToCache = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblWritesToCache.setLayoutData(gridData);<NEW_LINE>lblAvgSizeToCache = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblAvgSizeToCache.setLayoutData(gridData);<NEW_LINE>pbWrites = new ProgressBar(gCacheWrites, SWT.HORIZONTAL);<NEW_LINE>gridData = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>gridData.verticalSpan = 2;<NEW_LINE>pbWrites.setLayoutData(gridData);<NEW_LINE>pbWrites.setMinimum(0);<NEW_LINE>pbWrites.setMaximum(1000);<NEW_LINE>if (Constants.isWindows) {<NEW_LINE>pbWrites.setState(SWT.PAUSED);<NEW_LINE>}<NEW_LINE>lblPercentWrites = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.verticalSpan = 2;<NEW_LINE>gridData.widthHint = 120;<NEW_LINE>lblPercentWrites.setLayoutData(gridData);<NEW_LINE>lbl = new Label(gCacheWrites, SWT.NULL);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lbl.setLayoutData(gridData);<NEW_LINE><MASK><NEW_LINE>lblNumberWritesToFile = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblNumberWritesToFile.setLayoutData(gridData);<NEW_LINE>lblWritesToFile = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblWritesToFile.setLayoutData(gridData);<NEW_LINE>lblAvgSizeToFile = new BufferedLabel(gCacheWrites, SWT.DOUBLE_BUFFERED);<NEW_LINE>gridData = new GridData();<NEW_LINE>gridData.widthHint = 100;<NEW_LINE>lblAvgSizeToFile.setLayoutData(gridData);<NEW_LINE>} | Messages.setLanguageText(lbl, "CacheView.writes.toFile"); |
326,827 | private void deleteDataInFiles(Collection<TsFileResource> tsFileResourceList, Deletion deletion, Set<PartialPath> devicePaths, List<ModificationFile> updatedModFiles, long planIndex, TimePartitionFilter timePartitionFilter) throws IOException {<NEW_LINE>for (TsFileResource tsFileResource : tsFileResourceList) {<NEW_LINE>if (canSkipDelete(tsFileResource, devicePaths, deletion.getStartTime(), deletion.getEndTime(), timePartitionFilter)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (tsFileResource.isCompacting()) {<NEW_LINE>// we have to set modification offset to MAX_VALUE, as the offset of source chunk may<NEW_LINE>// change after compaction<NEW_LINE>deletion.setFileOffset(Long.MAX_VALUE);<NEW_LINE>// write deletion into compaction modification file<NEW_LINE>tsFileResource.getCompactionModFile().write(deletion);<NEW_LINE>// write deletion into modification file to enable query during compaction<NEW_LINE>tsFileResource.getModFile().write(deletion);<NEW_LINE>// remember to close mod file<NEW_LINE>tsFileResource.getCompactionModFile().close();<NEW_LINE>tsFileResource<MASK><NEW_LINE>} else {<NEW_LINE>deletion.setFileOffset(tsFileResource.getTsFileSize());<NEW_LINE>// write deletion into modification file<NEW_LINE>tsFileResource.getModFile().write(deletion);<NEW_LINE>// remember to close mod file<NEW_LINE>tsFileResource.getModFile().close();<NEW_LINE>}<NEW_LINE>logger.info("[Deletion] Deletion with path:{}, time:{}-{} written into mods file:{}.", deletion.getPath(), deletion.getStartTime(), deletion.getEndTime(), tsFileResource.getModFile().getFilePath());<NEW_LINE>tsFileResource.updatePlanIndexes(planIndex);<NEW_LINE>// delete data in memory of unsealed file<NEW_LINE>if (!tsFileResource.isClosed()) {<NEW_LINE>TsFileProcessor tsfileProcessor = tsFileResource.getProcessor();<NEW_LINE>tsfileProcessor.deleteDataInMemory(deletion, devicePaths);<NEW_LINE>}<NEW_LINE>// add a record in case of rollback<NEW_LINE>updatedModFiles.add(tsFileResource.getModFile());<NEW_LINE>}<NEW_LINE>} | .getModFile().close(); |
94,561 | private void attachCluster(final APIAttachPrimaryStorageToClusterMsg msg, final NoErrorCompletion completion) {<NEW_LINE>final APIAttachPrimaryStorageToClusterEvent evt = new APIAttachPrimaryStorageToClusterEvent(msg.getId());<NEW_LINE>try {<NEW_LINE>extpEmitter.preAttach(self, msg.getClusterUuid());<NEW_LINE>} catch (PrimaryStorageException pe) {<NEW_LINE>evt.setError(err(PrimaryStorageErrors.ATTACH_ERROR, pe.getMessage()));<NEW_LINE>bus.publish(evt);<NEW_LINE>completion.done();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>extpEmitter.beforeAttach(self, msg.getClusterUuid());<NEW_LINE>attachHook(msg.getClusterUuid(), new Completion(msg, completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>PrimaryStorageClusterRefVO ref = new PrimaryStorageClusterRefVO();<NEW_LINE>ref.setClusterUuid(msg.getClusterUuid());<NEW_LINE>ref.setPrimaryStorageUuid(self.getUuid());<NEW_LINE>dbf.persist(ref);<NEW_LINE>self = dbf.reload(self);<NEW_LINE>extpEmitter.afterAttach(self, msg.getClusterUuid());<NEW_LINE>PrimaryStorageInventory pinv = self.toInventory();<NEW_LINE>evt.setInventory(pinv);<NEW_LINE>logger.debug(String.format("successfully attached primary storage[name:%s, uuid:%s]", pinv.getName(), pinv.getUuid()));<NEW_LINE>bus.publish(evt);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>extpEmitter.failToAttach(<MASK><NEW_LINE>evt.setError(err(PrimaryStorageErrors.ATTACH_ERROR, errorCode, errorCode.getDetails()));<NEW_LINE>bus.publish(evt);<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | self, msg.getClusterUuid()); |
707,379 | private static GeoJsonFeature parseFeature(JSONObject geoJsonFeature) {<NEW_LINE>String id = null;<NEW_LINE>LatLngBounds boundingBox = null;<NEW_LINE>Geometry geometry = null;<NEW_LINE>HashMap<String, String> properties = new HashMap<String, String>();<NEW_LINE>try {<NEW_LINE>if (geoJsonFeature.has(FEATURE_ID)) {<NEW_LINE>id = geoJsonFeature.getString(FEATURE_ID);<NEW_LINE>}<NEW_LINE>if (geoJsonFeature.has(BOUNDING_BOX)) {<NEW_LINE>boundingBox = parseBoundingBox(geoJsonFeature.getJSONArray(BOUNDING_BOX));<NEW_LINE>}<NEW_LINE>if (geoJsonFeature.has(FEATURE_GEOMETRY) && !geoJsonFeature.isNull(FEATURE_GEOMETRY)) {<NEW_LINE>geometry = parseGeometry(geoJsonFeature.getJSONObject(FEATURE_GEOMETRY));<NEW_LINE>}<NEW_LINE>if (geoJsonFeature.has(PROPERTIES) && !geoJsonFeature.isNull(PROPERTIES)) {<NEW_LINE>properties = parseProperties(geoJsonFeature.getJSONObject("properties"));<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>Log.w(LOG_TAG, <MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new GeoJsonFeature(geometry, id, properties, boundingBox);<NEW_LINE>} | "Feature could not be successfully parsed " + geoJsonFeature.toString()); |
1,713,209 | protected void registerTables() {<NEW_LINE>registerHemp();<NEW_LINE>register(StoneDecoration.concreteSprayed, LootTable.lootTable());<NEW_LINE>register(WoodenDevices.windmill, LootTable.lootTable().withPool(createPoolBuilder().add(LootItem.lootTableItem(WoodenDevices.windmill).apply(new WindmillLootFunction.Builder()))));<NEW_LINE>LootPoolEntryContainer.Builder<?> tileOrInv = AlternativesEntry.alternatives(TileDropLootEntry.builder().when(ExplosionCondition.survivesExplosion()), DropInventoryLootEntry.builder());<NEW_LINE>register(WoodenDevices.crate, LootPool.lootPool().add(tileOrInv));<NEW_LINE>register(WoodenDevices.reinforcedCrate, tileDrop());<NEW_LINE>register(StoneDecoration.coresample, tileDrop());<NEW_LINE>register(<MASK><NEW_LINE>register(Cloth.shaderBanner, tileDrop());<NEW_LINE>register(Cloth.shaderBannerWall, tileDrop());<NEW_LINE>register(Cloth.curtain, tileDrop());<NEW_LINE>for (Block cap : new Block[] { MetalDevices.capacitorLV, MetalDevices.capacitorMV, MetalDevices.capacitorHV, MetalDevices.capacitorCreative }) register(cap, tileDrop());<NEW_LINE>register(Connectors.feedthrough, tileDrop());<NEW_LINE>register(MetalDevices.turretChem, tileDrop());<NEW_LINE>register(MetalDevices.turretGun, tileDrop(), dropInv());<NEW_LINE>register(WoodenDevices.woodenBarrel, tileDrop());<NEW_LINE>register(WoodenDevices.logicUnit, tileDrop());<NEW_LINE>register(MetalDevices.barrel, tileDrop());<NEW_LINE>registerMultiblocks();<NEW_LINE>registerSelfDropping(WoodenDevices.craftingTable, dropInv());<NEW_LINE>registerSelfDropping(WoodenDevices.workbench, dropInv());<NEW_LINE>registerSelfDropping(WoodenDevices.itemBatcher, dropInv());<NEW_LINE>registerSelfDropping(WoodenDevices.circuitTable, dropInv());<NEW_LINE>registerSelfDropping(MetalDevices.cloche, dropInv());<NEW_LINE>registerSelfDropping(MetalDevices.chargingStation, dropInv());<NEW_LINE>registerSlabs();<NEW_LINE>registerSawdust();<NEW_LINE>registerAllRemainingAsDefault();<NEW_LINE>} | MetalDevices.toolbox, tileDrop()); |
1,786,207 | public void generateEvidence(IndentWriter writer) {<NEW_LINE>writer.println("BT announce:");<NEW_LINE>try {<NEW_LINE>writer.indent();<NEW_LINE>writer.println("state: " + tracker_state + ", in_progress=" + update_in_progress);<NEW_LINE>writer.println("current: " + (lastUsedUrl == null ? "null" : lastUsedUrl.toString()));<NEW_LINE>writer.println("last: " + (last_response == null ? "null" : last_response.getString()));<NEW_LINE>writer.println("last_update_secs: " + last_update_time_secs);<NEW_LINE>writer.println("secs_to_wait: " + current_time_to_wait_secs + (manual_control ? " - manual" : ""));<NEW_LINE>writer.println("t_interval: " + tracker_interval);<NEW_LINE>writer.println("t_min_interval: " + tracker_min_interval);<NEW_LINE>writer.println("min_interval: " + min_interval);<NEW_LINE>writer.println("min_interval_override: " + min_interval_override);<NEW_LINE>writer.println("rd: last_override=" + rd_last_override + ",percentage=" + rd_override_percentage);<NEW_LINE>writer.println("event: " + (current_timer_event == null ? "null" : current_timer_event.getString()));<NEW_LINE>writer.println(<MASK><NEW_LINE>writer.println("complete: " + completed + ", reported=" + complete_reported);<NEW_LINE>} finally {<NEW_LINE>writer.exdent();<NEW_LINE>}<NEW_LINE>} | "stopped: " + stopped + ", for_q=" + stopped_for_queue); |
903,094 | public ListAppsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAppsResult listAppsResult = new ListAppsResult();<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 listAppsResult;<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("apps", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAppsResult.setApps(new ListUnmarshaller<AppSummary>(AppSummaryJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAppsResult.setNextToken(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 listAppsResult;<NEW_LINE>} | )).unmarshall(context)); |
1,658,810 | private ArrayDBIDs updateKNNsAfterInsertion(DBIDs ids) {<NEW_LINE>ArrayModifiableDBIDs rkNN_ids = DBIDUtil.newArray();<NEW_LINE>DBIDs oldids = DBIDUtil.difference(relation.getDBIDs(), ids);<NEW_LINE>for (DBIDIter iter = oldids.iter(); iter.valid(); iter.advance()) {<NEW_LINE>KNNList kNNs = storage.get(iter);<NEW_LINE>double knnDist = kNNs.getKNNDistance();<NEW_LINE>// look for new kNNs<NEW_LINE>KNNHeap heap = null;<NEW_LINE>for (DBIDIter iter2 = ids.iter(); iter2.valid(); iter2.advance()) {<NEW_LINE>final double dist = <MASK><NEW_LINE>if (dist <= knnDist) {<NEW_LINE>heap = heap != null ? heap : DBIDUtil.newHeap(kNNs);<NEW_LINE>heap.insert(dist, iter2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (heap != null) {<NEW_LINE>storage.put(iter, kNNs = heap.toKNNList());<NEW_LINE>rkNN_ids.add(iter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rkNN_ids;<NEW_LINE>} | distanceQuery.distance(iter, iter2); |
1,277,296 | public static void main(String[] args) {<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.out.println("Usage: java twitter4j.examples.list.CreateUserList [list name] [list description]");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Twitter twitter = new TwitterFactory().getInstance();<NEW_LINE>String description = null;<NEW_LINE>if (args.length >= 2) {<NEW_LINE>description = args[1];<NEW_LINE>}<NEW_LINE>UserList list = twitter.createUserList(args<MASK><NEW_LINE>System.out.println("Successfully created a list (id:" + list.getId() + ", slug:" + list.getSlug() + ").");<NEW_LINE>System.exit(0);<NEW_LINE>} catch (TwitterException te) {<NEW_LINE>te.printStackTrace();<NEW_LINE>System.out.println("Failed to create a list: " + te.getMessage());<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>} | [0], true, description); |
671,460 | protected void evaluateTables(List<SlimAssertion> assertions, Map<String, Object> instructionResults) throws SlimCommunicationException {<NEW_LINE>for (SlimAssertion a : assertions) {<NEW_LINE>final String key = a.getInstruction().getId();<NEW_LINE>final Object returnValue = instructionResults.get(key);<NEW_LINE>// Exception management<NEW_LINE>if (returnValue != null && returnValue instanceof String && ((String) returnValue).startsWith(EXCEPTION_TAG)) {<NEW_LINE>SlimExceptionResult exceptionResult = new SlimExceptionResult(key, (String) returnValue);<NEW_LINE>if (exceptionResult.isStopTestException()) {<NEW_LINE>stopTestCalled = true;<NEW_LINE>stopSuiteCalled = PageData.SUITE_SETUP_NAME.equals(testContext.getPageToTest().getName());<NEW_LINE>}<NEW_LINE>if (exceptionResult.isStopSuiteException()) {<NEW_LINE>stopTestCalled = stopSuiteCalled = true;<NEW_LINE>}<NEW_LINE>exceptionResult = a.getExpectation().evaluateException(exceptionResult);<NEW_LINE>if (exceptionResult != null) {<NEW_LINE>if (!exceptionResult.isCatchException())<NEW_LINE>testExceptionOccurred(a, exceptionResult);<NEW_LINE>else<NEW_LINE>testAssertionVerified(a, exceptionResult.catchTestResult());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Normal results<NEW_LINE>TestResult testResult = a.<MASK><NEW_LINE>testAssertionVerified(a, testResult);<NEW_LINE>// Retrieve variables set during expectation step<NEW_LINE>if (testResult != null) {<NEW_LINE>Map<String, ?> variables = testResult.getVariablesToStore();<NEW_LINE>if (variables != null) {<NEW_LINE>List<Instruction> instructions = new ArrayList<>(variables.size());<NEW_LINE>int i = 0;<NEW_LINE>for (Entry<String, ?> variable : variables.entrySet()) {<NEW_LINE>instructions.add(new AssignInstruction("assign_" + i++, variable.getKey(), variable.getValue()));<NEW_LINE>}<NEW_LINE>// Store variables in context<NEW_LINE>if (i > 0) {<NEW_LINE>slimClient.invokeAndGetResponse(instructions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getExpectation().evaluateExpectation(returnValue); |
1,064,835 | private void handleLineWithFlags(String line, List<String> result) {<NEW_LINE>String[] parts = cleanTagsAndEscapeChars<MASK><NEW_LINE>if (parts.length != 2) {<NEW_LINE>throw new IllegalArgumentException("Unexpected line format, expected at most one slash: " + line);<NEW_LINE>}<NEW_LINE>String word = parts[0];<NEW_LINE>String suffix = parts[1];<NEW_LINE>for (int i = 0; i < suffix.length(); i++) {<NEW_LINE>char c = suffix.charAt(i);<NEW_LINE>if (c == 'S') {<NEW_LINE>add(result, word);<NEW_LINE>result.add(word + "s");<NEW_LINE>} else if (c == 'N') {<NEW_LINE>add(result, word);<NEW_LINE>result.add(word + "n");<NEW_LINE>} else if (c == 'E') {<NEW_LINE>add(result, word);<NEW_LINE>result.add(word + "e");<NEW_LINE>} else if (c == 'F') {<NEW_LINE>add(result, word);<NEW_LINE>// (m/f)<NEW_LINE>result.add(word + "in");<NEW_LINE>} else if (c == 'A') {<NEW_LINE>// Adjektiv<NEW_LINE>add(result, word);<NEW_LINE>if (word.endsWith("e")) {<NEW_LINE>result.add(word + "r");<NEW_LINE>result.add(word + "s");<NEW_LINE>result.add(word + "n");<NEW_LINE>result.add(word + "m");<NEW_LINE>} else {<NEW_LINE>result.add(word + "e");<NEW_LINE>result.add(word + "er");<NEW_LINE>result.add(word + "es");<NEW_LINE>result.add(word + "en");<NEW_LINE>result.add(word + "em");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown suffix: " + suffix + " in line: " + line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (line).split("/"); |
82,371 | private KubernetesSupportedVersionResponse createKubernetesSupportedVersionResponse(final KubernetesSupportedVersion kubernetesSupportedVersion) {<NEW_LINE>KubernetesSupportedVersionResponse response = new KubernetesSupportedVersionResponse();<NEW_LINE>response.setObjectName("kubernetessupportedversion");<NEW_LINE>response.setId(kubernetesSupportedVersion.getUuid());<NEW_LINE>response.setName(kubernetesSupportedVersion.getName());<NEW_LINE>response.<MASK><NEW_LINE>if (kubernetesSupportedVersion.getState() != null) {<NEW_LINE>response.setState(kubernetesSupportedVersion.getState().toString());<NEW_LINE>}<NEW_LINE>response.setMinimumCpu(kubernetesSupportedVersion.getMinimumCpu());<NEW_LINE>response.setMinimumRamSize(kubernetesSupportedVersion.getMinimumRamSize());<NEW_LINE>DataCenterVO zone = dataCenterDao.findById(kubernetesSupportedVersion.getZoneId());<NEW_LINE>if (zone != null) {<NEW_LINE>response.setZoneId(zone.getUuid());<NEW_LINE>response.setZoneName(zone.getName());<NEW_LINE>}<NEW_LINE>response.setSupportsHA(compareSemanticVersions(kubernetesSupportedVersion.getSemanticVersion(), KubernetesClusterService.MIN_KUBERNETES_VERSION_HA_SUPPORT) >= 0);<NEW_LINE>response.setSupportsAutoscaling(versionSupportsAutoscaling(kubernetesSupportedVersion));<NEW_LINE>TemplateJoinVO template = templateJoinDao.findById(kubernetesSupportedVersion.getIsoId());<NEW_LINE>if (template != null) {<NEW_LINE>response.setIsoId(template.getUuid());<NEW_LINE>response.setIsoName(template.getName());<NEW_LINE>response.setIsoState(template.getState().toString());<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | setSemanticVersion(kubernetesSupportedVersion.getSemanticVersion()); |
1,451,404 | public static Optional<ServerInterceptor> toServerInterceptor(File configFile, Class<?> grpcServiceClass) {<NEW_LINE>// From a global rate metering config file, create a specific gRPC service<NEW_LINE>// interceptor configuration in the form of an interceptor constructor argument,<NEW_LINE>// a map<method-name, rate-meter>.<NEW_LINE>// Transforming json into the List<Map<String, GrpcCallRateMeter>> is a bit<NEW_LINE>// convoluted due to Gson's loss of generic type information during deserialization.<NEW_LINE>Optional<GrpcServiceRateMeteringConfig> grpcServiceConfig = getAllDeserializedConfigs(configFile).stream().filter(x -> x.isConfigForGrpcService<MASK><NEW_LINE>if (grpcServiceConfig.isPresent()) {<NEW_LINE>Map<String, GrpcCallRateMeter> serviceCallRateMeters = new HashMap<>();<NEW_LINE>for (Map<String, GrpcCallRateMeter> methodToRateMeterMap : grpcServiceConfig.get().methodRateMeters) {<NEW_LINE>Map.Entry<String, GrpcCallRateMeter> entry = methodToRateMeterMap.entrySet().stream().findFirst().orElseThrow(() -> new IllegalStateException("Gson deserialized a method rate meter configuration into an empty map."));<NEW_LINE>serviceCallRateMeters.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>return Optional.of(new CallRateMeteringInterceptor(serviceCallRateMeters));<NEW_LINE>} else {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} | (grpcServiceClass)).findFirst(); |
53,510 | public Map<String, Object> doGetLiveReports(String full) {<NEW_LINE>Map<String, Object> returnMap = new HashMap<>();<NEW_LINE>Map<String, Object> ingestionStatsAndErrors = new HashMap<>();<NEW_LINE>Map<String, Object> payload = new HashMap<>();<NEW_LINE>Pair<Map<String, Object>, Map<String, Object>> rowStatsAndUnparsebleEvents = doGetRowStatsAndUnparseableEvents(full, true);<NEW_LINE>// use the sequential task's ingestion state if we were running that mode<NEW_LINE>IngestionState ingestionStateForReport;<NEW_LINE>if (isParallelMode()) {<NEW_LINE>ingestionStateForReport = ingestionState;<NEW_LINE>} else {<NEW_LINE>IndexTask currentSequentialTask = <MASK><NEW_LINE>ingestionStateForReport = currentSequentialTask == null ? ingestionState : currentSequentialTask.getIngestionState();<NEW_LINE>}<NEW_LINE>payload.put("ingestionState", ingestionStateForReport);<NEW_LINE>payload.put("unparseableEvents", rowStatsAndUnparsebleEvents.rhs);<NEW_LINE>payload.put("rowStats", rowStatsAndUnparsebleEvents.lhs);<NEW_LINE>ingestionStatsAndErrors.put("taskId", getId());<NEW_LINE>ingestionStatsAndErrors.put("payload", payload);<NEW_LINE>ingestionStatsAndErrors.put("type", "ingestionStatsAndErrors");<NEW_LINE>returnMap.put("ingestionStatsAndErrors", ingestionStatsAndErrors);<NEW_LINE>return returnMap;<NEW_LINE>} | (IndexTask) currentSubTaskHolder.getTask(); |
938,702 | public static APIAddImageEvent __example__() {<NEW_LINE>APIAddImageEvent event = new APIAddImageEvent();<NEW_LINE>ImageInventory inv = new ImageInventory();<NEW_LINE><MASK><NEW_LINE>ImageBackupStorageRefInventory ref = new ImageBackupStorageRefInventory();<NEW_LINE>ref.setBackupStorageUuid(uuid());<NEW_LINE>ref.setImageUuid(inv.getUuid());<NEW_LINE>ref.setInstallPath("ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd");<NEW_LINE>ref.setStatus(ImageStatus.Ready.toString());<NEW_LINE>inv.setName("TinyLinux");<NEW_LINE>inv.setBackupStorageRefs(Collections.singletonList(ref));<NEW_LINE>inv.setUrl("http://192.168.1.20/share/images/tinylinux.qcow2");<NEW_LINE>inv.setFormat(ImageConstant.QCOW2_FORMAT_STRING);<NEW_LINE>inv.setMediaType(ImageConstant.ImageMediaType.RootVolumeTemplate.toString());<NEW_LINE>inv.setPlatform(ImagePlatform.Linux.toString());<NEW_LINE>inv.setArchitecture(ImageArchitecture.x86_64.toString());<NEW_LINE>event.setInventory(inv);<NEW_LINE>return event;<NEW_LINE>} | inv.setUuid(uuid()); |
273,735 | // ManagedService<NEW_LINE>@Override<NEW_LINE>public void init(NodeEngine engine, Properties hzProperties) {<NEW_LINE>this.nodeEngine = (NodeEngineImpl) engine;<NEW_LINE>this.config = <MASK><NEW_LINE>jetInstance = new JetInstanceImpl((HazelcastInstanceImpl) engine.getHazelcastInstance(), config);<NEW_LINE>taskletExecutionService = new TaskletExecutionService(nodeEngine, config.getInstanceConfig().getCooperativeThreadCount(), nodeEngine.getProperties());<NEW_LINE>jobRepository = new JobRepository(jetInstance);<NEW_LINE>jobExecutionService = new JobExecutionService(nodeEngine, taskletExecutionService, jobRepository);<NEW_LINE>jobCoordinationService = createJobCoordinationService();<NEW_LINE>MetricsService metricsService = nodeEngine.getService(MetricsService.SERVICE_NAME);<NEW_LINE>metricsService.registerPublisher(nodeEngine -> new JobMetricsPublisher(jobExecutionService, nodeEngine.getLocalMember()));<NEW_LINE>nodeEngine.getMetricsRegistry().registerDynamicMetricsProvider(jobExecutionService);<NEW_LINE>networking = new Networking(engine, jobExecutionService, config.getInstanceConfig().getFlowControlPeriodMs());<NEW_LINE>ClientEngineImpl clientEngine = engine.getService(ClientEngineImpl.SERVICE_NAME);<NEW_LINE>ExceptionUtil.registerJetExceptions(clientEngine.getExceptionFactory());<NEW_LINE>if (parseBoolean(config.getHazelcastConfig().getProperties().getProperty(JET_SHUTDOWNHOOK_ENABLED.getName()))) {<NEW_LINE>logger.finest("Adding Jet shutdown hook");<NEW_LINE>Runtime.getRuntime().addShutdownHook(shutdownHookThread);<NEW_LINE>}<NEW_LINE>logger.info("Setting number of cooperative threads and default parallelism to " + config.getInstanceConfig().getCooperativeThreadCount());<NEW_LINE>if (sqlCoreBackend != null) {<NEW_LINE>try {<NEW_LINE>Method initJetInstanceMethod = sqlCoreBackend.getClass().getMethod("init", AbstractJetInstance.class);<NEW_LINE>initJetInstanceMethod.invoke(sqlCoreBackend, jetInstance);<NEW_LINE>} catch (ReflectiveOperationException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | findJetServiceConfig(engine.getConfig()); |
57,765 | @Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>public RestConditionValue update(@Context HttpServletRequest request, @Context final HttpServletResponse response, @PathParam("siteId") String siteId, @PathParam("conditionId") String conditionId, @PathParam("valueId") String valueId, RestConditionValue restConditionValue) throws DotDataException, DotSecurityException, JSONException {<NEW_LINE>siteId = checkNotEmpty(<MASK><NEW_LINE>conditionId = checkNotEmpty(conditionId, BadRequestException.class, "Condition Id is required.");<NEW_LINE>User user = getUser(request, response);<NEW_LINE>// forces check that host exists. This should be handled by rulesAPI?<NEW_LINE>getHost(siteId, user);<NEW_LINE>// forces check that condition exists. This should be handled by rulesAPI?<NEW_LINE>getCondition(conditionId, user);<NEW_LINE>updateConditionValueInternal(user, valueId, restConditionValue);<NEW_LINE>return restConditionValue;<NEW_LINE>} | siteId, BadRequestException.class, "Site Id is required."); |
866,071 | private void printStartupInfo() {<NEW_LINE>boolean corsEnabled = _config.getBoolean(WebServerConfig.WEBSERVER_HTTP_CORS_ENABLED_CONFIG);<NEW_LINE>String webApiUrlPrefix = <MASK><NEW_LINE>String uiUrlPrefix = _config.getString(WebServerConfig.WEBSERVER_UI_URLPREFIX_CONFIG);<NEW_LINE>String webDir = _config.getString(WebServerConfig.WEBSERVER_UI_DISKPATH_CONFIG);<NEW_LINE>String sessionPath = _config.getString(WebServerConfig.WEBSERVER_SESSION_PATH_CONFIG);<NEW_LINE>System.out.println(">> ********************************************* <<");<NEW_LINE>System.out.println(">> Application directory : " + System.getProperty("user.dir"));<NEW_LINE>System.out.println(">> REST API available on : " + webApiUrlPrefix);<NEW_LINE>System.out.println(">> Web UI available on : " + uiUrlPrefix);<NEW_LINE>System.out.println(">> Web UI Directory : " + webDir);<NEW_LINE>System.out.println(">> Cookie prefix path : " + sessionPath);<NEW_LINE>System.out.println(">> Kafka Cruise Control started on : " + serverUrl());<NEW_LINE>System.out.println(">> CORS Enabled ? : " + corsEnabled);<NEW_LINE>System.out.println(">> ********************************************* <<");<NEW_LINE>} | _config.getString(WebServerConfig.WEBSERVER_API_URLPREFIX_CONFIG); |
730,058 | public static ListSuccessInstanceAmountResponse unmarshall(ListSuccessInstanceAmountResponse listSuccessInstanceAmountResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSuccessInstanceAmountResponse.setRequestId(_ctx.stringValue("ListSuccessInstanceAmountResponse.RequestId"));<NEW_LINE>InstanceStatusTrend instanceStatusTrend = new InstanceStatusTrend();<NEW_LINE>List<TodayTrendItem> todayTrend = new ArrayList<TodayTrendItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.TodayTrend.Length"); i++) {<NEW_LINE>TodayTrendItem todayTrendItem = new TodayTrendItem();<NEW_LINE>todayTrendItem.setTimePoint(_ctx.stringValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.TodayTrend[" + i + "].TimePoint"));<NEW_LINE>todayTrendItem.setCount(_ctx.integerValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.TodayTrend[" + i + "].Count"));<NEW_LINE>todayTrend.add(todayTrendItem);<NEW_LINE>}<NEW_LINE>instanceStatusTrend.setTodayTrend(todayTrend);<NEW_LINE>List<YesterdayTrendItem> yesterdayTrend = new ArrayList<YesterdayTrendItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.YesterdayTrend.Length"); i++) {<NEW_LINE>YesterdayTrendItem yesterdayTrendItem = new YesterdayTrendItem();<NEW_LINE>yesterdayTrendItem.setTimePoint(_ctx.stringValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.YesterdayTrend[" + i + "].TimePoint"));<NEW_LINE>yesterdayTrendItem.setCount(_ctx.integerValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.YesterdayTrend[" + i + "].Count"));<NEW_LINE>yesterdayTrend.add(yesterdayTrendItem);<NEW_LINE>}<NEW_LINE>instanceStatusTrend.setYesterdayTrend(yesterdayTrend);<NEW_LINE>List<AvgTrendItem> avgTrend = new ArrayList<AvgTrendItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.AvgTrend.Length"); i++) {<NEW_LINE>AvgTrendItem avgTrendItem = new AvgTrendItem();<NEW_LINE>avgTrendItem.setTimePoint(_ctx.stringValue<MASK><NEW_LINE>avgTrendItem.setCount(_ctx.integerValue("ListSuccessInstanceAmountResponse.InstanceStatusTrend.AvgTrend[" + i + "].Count"));<NEW_LINE>avgTrend.add(avgTrendItem);<NEW_LINE>}<NEW_LINE>instanceStatusTrend.setAvgTrend(avgTrend);<NEW_LINE>listSuccessInstanceAmountResponse.setInstanceStatusTrend(instanceStatusTrend);<NEW_LINE>return listSuccessInstanceAmountResponse;<NEW_LINE>} | ("ListSuccessInstanceAmountResponse.InstanceStatusTrend.AvgTrend[" + i + "].TimePoint")); |
1,467,332 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, String path6, String path7, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Work work = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>WoControl control = business.getControl(<MASK><NEW_LINE>if (BooleanUtils.isNotTrue(control.getAllowSave())) {<NEW_LINE>throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Wo wo = ThisApplication.context().applications().postQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("data", "work", work.getId(), path0, path1, path2, path3, path4, path5, path6, path7), jsonElement, work.getJob()).getData(Wo.class);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | effectivePerson, work, WoControl.class); |
1,047,260 | // endregion Active call<NEW_LINE>// region Call setup<NEW_LINE>@NonNull<NEW_LINE>protected final WebRtcServiceState handleSendIceCandidates(@NonNull WebRtcServiceState currentState, @NonNull CallMetadata callMetadata, boolean broadcast, @NonNull List<byte[]> iceCandidates) {<NEW_LINE>Log.i(tag, "handleSendIceCandidates(): id: " + callMetadata.getCallId().format(callMetadata.getRemoteDevice()));<NEW_LINE>List<IceUpdateMessage> iceUpdateMessages = Stream.of(iceCandidates).map(c -> new IceUpdateMessage(callMetadata.getCallId().longValue(), c<MASK><NEW_LINE>Integer destinationDeviceId = broadcast ? null : callMetadata.getRemoteDevice();<NEW_LINE>SignalServiceCallMessage callMessage = SignalServiceCallMessage.forIceUpdates(iceUpdateMessages, true, destinationDeviceId);<NEW_LINE>webRtcInteractor.sendCallMessage(callMetadata.getRemotePeer(), callMessage);<NEW_LINE>return currentState;<NEW_LINE>} | , null)).toList(); |
497,996 | private static HandshakeMessage fromReader(HandshakeType type, DatagramReader reader, HandshakeParameter parameter) throws HandshakeException {<NEW_LINE>HandshakeMessage body;<NEW_LINE>switch(type) {<NEW_LINE>case HELLO_REQUEST:<NEW_LINE>body = new HelloRequest();<NEW_LINE>break;<NEW_LINE>case CLIENT_HELLO:<NEW_LINE>body = ClientHello.fromReader(reader);<NEW_LINE>break;<NEW_LINE>case SERVER_HELLO:<NEW_LINE>body = ServerHello.fromReader(reader);<NEW_LINE>break;<NEW_LINE>case HELLO_VERIFY_REQUEST:<NEW_LINE>body = HelloVerifyRequest.fromReader(reader);<NEW_LINE>break;<NEW_LINE>case CERTIFICATE:<NEW_LINE>if (parameter == null) {<NEW_LINE>throw new MissingHandshakeParameterException("HandshakeParameter must not be null!");<NEW_LINE>}<NEW_LINE>body = CertificateMessage.fromReader(reader, parameter.getCertificateType());<NEW_LINE>break;<NEW_LINE>case SERVER_KEY_EXCHANGE:<NEW_LINE>if (parameter == null) {<NEW_LINE>throw new MissingHandshakeParameterException("HandshakeParameter must not be null!");<NEW_LINE>}<NEW_LINE>body = readServerKeyExchange(reader, parameter.getKeyExchangeAlgorithm());<NEW_LINE>break;<NEW_LINE>case CERTIFICATE_REQUEST:<NEW_LINE>body = CertificateRequest.fromReader(reader);<NEW_LINE>break;<NEW_LINE>case SERVER_HELLO_DONE:<NEW_LINE>body = new ServerHelloDone();<NEW_LINE>break;<NEW_LINE>case CERTIFICATE_VERIFY:<NEW_LINE>body = CertificateVerify.fromReader(reader);<NEW_LINE>break;<NEW_LINE>case CLIENT_KEY_EXCHANGE:<NEW_LINE>if (parameter == null) {<NEW_LINE>throw new MissingHandshakeParameterException("HandshakeParameter must not be null!");<NEW_LINE>}<NEW_LINE>body = readClientKeyExchange(<MASK><NEW_LINE>break;<NEW_LINE>case FINISHED:<NEW_LINE>body = Finished.fromReader(reader);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new HandshakeException(String.format("Cannot parse unsupported message type %s", type), new AlertMessage(AlertLevel.FATAL, AlertDescription.UNEXPECTED_MESSAGE));<NEW_LINE>}<NEW_LINE>if (reader.bytesAvailable()) {<NEW_LINE>int bytesLeft = reader.bitsLeft() / Byte.SIZE;<NEW_LINE>throw new HandshakeException(String.format("Too many bytes, %d left, message not completely parsed! message type %s", bytesLeft, type), new AlertMessage(AlertLevel.FATAL, AlertDescription.DECODE_ERROR));<NEW_LINE>}<NEW_LINE>return body;<NEW_LINE>} | reader, parameter.getKeyExchangeAlgorithm()); |
144,475 | public void expandRaggedSelection() {<NEW_LINE>if (!inMultiSelectMode())<NEW_LINE>return;<NEW_LINE>// TODO: It looks like we need to use an alternative API when<NEW_LINE>// using Vim mode.<NEW_LINE>if (isVimModeOn())<NEW_LINE>return;<NEW_LINE>boolean hasSelection = hasSelection();<NEW_LINE>Range[] ranges = widget_.getEditor().getSession().getSelection().getAllRanges();<NEW_LINE>// Get the maximum columns for the current selection.<NEW_LINE>int colMin = Integer.MAX_VALUE;<NEW_LINE>int colMax = 0;<NEW_LINE>for (Range range : ranges) {<NEW_LINE>colMin = Math.min(range.getStart().getColumn(), colMin);<NEW_LINE>colMax = Math.max(range.getEnd().getColumn(), colMax);<NEW_LINE>}<NEW_LINE>// For each range:<NEW_LINE>//<NEW_LINE>// 1. Set the left side of the selection to the minimum,<NEW_LINE>// 2. Set the right side of the selection to the maximum,<NEW_LINE>// moving the cursor and inserting whitespace as necessary.<NEW_LINE>for (Range range : ranges) {<NEW_LINE>range.getStart().setColumn(colMin);<NEW_LINE>range.getEnd().setColumn(colMax);<NEW_LINE>String line = getLine(range.<MASK><NEW_LINE>if (line.length() < colMax) {<NEW_LINE>insertCode(Position.create(range.getStart().getRow(), line.length()), StringUtil.repeat(" ", colMax - line.length()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clearSelection();<NEW_LINE>Selection selection = getNativeSelection();<NEW_LINE>for (Range range : ranges) {<NEW_LINE>if (hasSelection)<NEW_LINE>selection.addRange(range, true);<NEW_LINE>else {<NEW_LINE>Range newRange = Range.create(range.getEnd().getRow(), range.getEnd().getColumn(), range.getEnd().getRow(), range.getEnd().getColumn());<NEW_LINE>selection.addRange(newRange, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getStart().getRow()); |
1,147,093 | private static void addBoxSetCounts(Context context, BaseItemDto item, LinearLayout layout) {<NEW_LINE>boolean hasSpecificCounts = false;<NEW_LINE>if (item.getMovieCount() != null && item.getMovieCount() > 0) {<NEW_LINE>TextView amt = new TextView(context);<NEW_LINE>amt.setTextSize(textSize);<NEW_LINE>amt.setText(item.getMovieCount().toString() + " " + context.getResources().getString(R.string.lbl_movies) + " ");<NEW_LINE>layout.addView(amt);<NEW_LINE>hasSpecificCounts = true;<NEW_LINE>}<NEW_LINE>if (item.getSeriesCount() != null && item.getSeriesCount() > 0) {<NEW_LINE>TextView amt = new TextView(context);<NEW_LINE>amt.setTextSize(textSize);<NEW_LINE>amt.setText(item.getSeriesCount().toString() + " " + context.getResources().getString(R.string.lbl_tv_series) + " ");<NEW_LINE>layout.addView(amt);<NEW_LINE>hasSpecificCounts = true;<NEW_LINE>}<NEW_LINE>if (!hasSpecificCounts && item.getChildCount() != null && item.getChildCount() > 0) {<NEW_LINE>TextView amt = new TextView(context);<NEW_LINE>amt.setTextSize(textSize);<NEW_LINE>amt.setText(item.getChildCount().toString() + " " + context.getResources().getString(item.getChildCount() > 1 ? R.string.lbl_items : R<MASK><NEW_LINE>layout.addView(amt);<NEW_LINE>}<NEW_LINE>} | .string.lbl_item) + " "); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.