idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,508,324 | public void rename(PartName newName) {<NEW_LINE>log.info("Renaming part " + this.getPartName().getName() + " to " + newName.getName());<NEW_LINE>// Rename in the part store<NEW_LINE>// @since 8.1.4<NEW_LINE>this.getPackage().getSourcePartStore().rename(this.getPartName(), newName);<NEW_LINE>// Remove this part<NEW_LINE>this.getPackage().getParts().remove(this.getPartName());<NEW_LINE>for (Relationship rel : sourceRelationships) {<NEW_LINE>// System.out.println("Altering source rel: " + rel.getTarget());<NEW_LINE>// Update the source relationship<NEW_LINE>// Work out new target<NEW_LINE>URI tobeRelativized = newName.getURI();<NEW_LINE>// get the source part from the source rel<NEW_LINE>Relationships thisRels = (Relationships) rel.getParent();<NEW_LINE>RelationshipsPart thisRelsPart = (RelationshipsPart) thisRels.getParent();<NEW_LINE>if (thisRelsPart == null) {<NEW_LINE>log.error("Couldn't determine rels part from rels object");<NEW_LINE>}<NEW_LINE>URI relativizeAgainst = thisRelsPart.getSourceURI();<NEW_LINE>log.debug("Relativising target " + tobeRelativized + " against source " + relativizeAgainst);<NEW_LINE>String result = org.docx4j.openpackaging.URIHelper.relativizeURI(relativizeAgainst, tobeRelativized).toString();<NEW_LINE>if (relativizeAgainst.getPath().equals("/") && result.startsWith("/")) {<NEW_LINE>result = result.substring(1);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>rel.setTarget(result);<NEW_LINE>}<NEW_LINE>// Set the new part name<NEW_LINE>this.setPartName(newName);<NEW_LINE>// Add this part back to the parts collection<NEW_LINE>this.getPackage().getParts().put(this);<NEW_LINE>} | log.debug("Result " + result); |
355,767 | protected Tuple4<String[], String[], TypeInformation<?>[], String[]> prepareIoSchema(TableSchema modelSchema, TableSchema dataSchema, Params params) {<NEW_LINE>FeatureClause[] featureClauses = FeatureClauseUtil.extractFeatureClauses(params.get(AggLookupParams.CLAUSE));<NEW_LINE>this.numAgg = featureClauses.length;<NEW_LINE>this.sequenceLens = new int[numAgg];<NEW_LINE>this.operators = new FeatureClauseOperator[numAgg];<NEW_LINE>String[] selectedCols = new String[numAgg];<NEW_LINE>String[] outputCols = new String[numAgg];<NEW_LINE>String[] reservedCols = params.get(AggLookupParams.RESERVED_COLS);<NEW_LINE>if (reservedCols == null) {<NEW_LINE>reservedCols = dataSchema.getFieldNames();<NEW_LINE>}<NEW_LINE>TypeInformation<?>[] outputTypes = new TypeInformation<?>[numAgg];<NEW_LINE>for (int i = 0; i < numAgg; ++i) {<NEW_LINE>this.operators[i] = featureClauses[i].op;<NEW_LINE>selectedCols[i<MASK><NEW_LINE>outputCols[i] = featureClauses[i].outColName;<NEW_LINE>outputTypes[i] = AlinkTypes.DENSE_VECTOR;<NEW_LINE>sequenceLens[i] = (featureClauses[i].inputParams.length == 1) ? Integer.parseInt(featureClauses[i].inputParams[0].toString()) : -1;<NEW_LINE>}<NEW_LINE>return Tuple4.of(selectedCols, outputCols, outputTypes, reservedCols);<NEW_LINE>} | ] = featureClauses[i].inColName; |
309,294 | public void removeContainers(Set<PackingPlan.ContainerPlan> containersToRemove) {<NEW_LINE>LOG.log(Level.INFO, "Kill {0} of {1} containers", new Object[] { containersToRemove.size(), processToContainer.size() });<NEW_LINE>synchronized (processToContainer) {<NEW_LINE>// Create a inverse map to be able to get process instance from container id<NEW_LINE>Map<Integer, Process> containerToProcessMap = new HashMap<>();<NEW_LINE>for (Map.Entry<Process, Integer> entry : processToContainer.entrySet()) {<NEW_LINE>containerToProcessMap.put(entry.getValue(), entry.getKey());<NEW_LINE>}<NEW_LINE>for (PackingPlan.ContainerPlan containerToRemove : containersToRemove) {<NEW_LINE>int containerId = containerToRemove.getId();<NEW_LINE>Process process = containerToProcessMap.get(containerId);<NEW_LINE>if (process == null) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// remove the process so that it is not monitored and relaunched<NEW_LINE>LOG.info("Killing executor for container: " + containerId);<NEW_LINE>processToContainer.remove(process);<NEW_LINE>process.destroy();<NEW_LINE>LOG.info("Killed executor for container: " + containerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Level.WARNING, "Container for id:{0} not found.", containerId); |
706,570 | public static ListInboundOrderPreboxingsResponse unmarshall(ListInboundOrderPreboxingsResponse listInboundOrderPreboxingsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listInboundOrderPreboxingsResponse.setRequestId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.RequestId"));<NEW_LINE>listInboundOrderPreboxingsResponse.setSuccess(_ctx.booleanValue("ListInboundOrderPreboxingsResponse.Success"));<NEW_LINE>List<InboundOrderPreboxingBiz> inboundOrderPreboxings = new ArrayList<InboundOrderPreboxingBiz>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings.Length"); i++) {<NEW_LINE>InboundOrderPreboxingBiz inboundOrderPreboxingBiz = new InboundOrderPreboxingBiz();<NEW_LINE>inboundOrderPreboxingBiz.setOrderId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].OrderId"));<NEW_LINE>inboundOrderPreboxingBiz.setOrderType(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].OrderType"));<NEW_LINE>inboundOrderPreboxingBiz.setOrderCode(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].OrderCode"));<NEW_LINE>inboundOrderPreboxingBiz.setCaseId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].CaseId"));<NEW_LINE>inboundOrderPreboxingBiz.setBarcode(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].Barcode"));<NEW_LINE>inboundOrderPreboxingBiz.setTagValue(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].TagValue"));<NEW_LINE>inboundOrderPreboxingBiz.setQuantity(_ctx.integerValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].Quantity"));<NEW_LINE>inboundOrderPreboxingBiz.setOperateQuantity(_ctx.integerValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].OperateQuantity"));<NEW_LINE>inboundOrderPreboxingBiz.setStyleId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].StyleId"));<NEW_LINE>inboundOrderPreboxingBiz.setStyleCode(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].StyleCode"));<NEW_LINE>inboundOrderPreboxingBiz.setStyleName(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].StyleName"));<NEW_LINE>inboundOrderPreboxingBiz.setColorId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].ColorId"));<NEW_LINE>inboundOrderPreboxingBiz.setColorCode(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].ColorCode"));<NEW_LINE>inboundOrderPreboxingBiz.setColorName(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].ColorName"));<NEW_LINE>inboundOrderPreboxingBiz.setSizeId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].SizeId"));<NEW_LINE>inboundOrderPreboxingBiz.setSizeCode(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].SizeCode"));<NEW_LINE>inboundOrderPreboxingBiz.setSizeName(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].SizeName"));<NEW_LINE>inboundOrderPreboxingBiz.setSKUName(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].SKUName"));<NEW_LINE>inboundOrderPreboxingBiz.setSKUId(_ctx.stringValue("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].SKUId"));<NEW_LINE>inboundOrderPreboxingBiz.setCaseCode(_ctx.stringValue<MASK><NEW_LINE>inboundOrderPreboxings.add(inboundOrderPreboxingBiz);<NEW_LINE>}<NEW_LINE>listInboundOrderPreboxingsResponse.setInboundOrderPreboxings(inboundOrderPreboxings);<NEW_LINE>return listInboundOrderPreboxingsResponse;<NEW_LINE>} | ("ListInboundOrderPreboxingsResponse.InboundOrderPreboxings[" + i + "].CaseCode")); |
789,249 | protected void processEmbed(CrawlURI curi, final CharSequence value, CharSequence context, Hop hop) {<NEW_LINE>if (logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.finest("embed (" + hop.getHopChar() + "): " + value.toString() + " from " + curi);<NEW_LINE>}<NEW_LINE>if (context.equals(HTMLLinkContext.IMG_SRCSET.toString()) || context.equals(HTMLLinkContext.SOURCE_SRCSET.toString()) || context.equals(HTMLLinkContext.IMG_DATA_SRCSET.toString()) || context.equals(HTMLLinkContext.IMG_DATA_ORIGINAL_SET.toString()) || context.equals(HTMLLinkContext.SOURCE_DATA_ORIGINAL_SET.toString())) {<NEW_LINE>logger.log(Level.FINE, "Found srcset listing: {0}", value);<NEW_LINE>Matcher matcher = TextUtils.getMatcher("[\\s,]*(\\S*[^,\\s])(?:\\s(?:[^,(]+|\\([^)]*(?:\\)|$))*)?", value);<NEW_LINE>while (matcher.lookingAt()) {<NEW_LINE>CharSequence link = value.subSequence(matcher.start(1), matcher.end(1));<NEW_LINE>matcher.region(matcher.end(), matcher.regionEnd());<NEW_LINE>logger.log(Level.FINER, "Found {0} adding to outlinks.", link);<NEW_LINE>addLinkFromString(<MASK><NEW_LINE>numberOfLinksExtracted.incrementAndGet();<NEW_LINE>}<NEW_LINE>TextUtils.recycleMatcher(matcher);<NEW_LINE>} else {<NEW_LINE>addLinkFromString(curi, value, context, hop);<NEW_LINE>numberOfLinksExtracted.incrementAndGet();<NEW_LINE>}<NEW_LINE>} | curi, link, context, hop); |
1,099,100 | public final QualifiedClassNameListContext qualifiedClassNameList() throws RecognitionException {<NEW_LINE>QualifiedClassNameListContext _localctx = new QualifiedClassNameListContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 90, RULE_qualifiedClassNameList);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(725);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>setState(732);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 61, _ctx);<NEW_LINE>while (_alt != 2 && _alt != groovyjarjarantlr4.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(726);<NEW_LINE>match(COMMA);<NEW_LINE>setState(727);<NEW_LINE>nls();<NEW_LINE>setState(728);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(734);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 61, _ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _errHandler.recover(this, re); |
1,853,350 | public ExprNode validate(ExprValidationContext validationContext) throws ExprValidationException {<NEW_LINE>if (this.getChildNodes().length != 2) {<NEW_LINE>throw new ExprValidationException("Arithmatic node must have 2 parameters");<NEW_LINE>}<NEW_LINE>for (ExprNode child : this.getChildNodes()) {<NEW_LINE>ExprNodeUtilityValidate.validateReturnsNumeric(child.getForge());<NEW_LINE>}<NEW_LINE>// Determine result type, set up compute function<NEW_LINE>ExprNode lhs = this.getChildNodes()[0];<NEW_LINE>ExprNode rhs = this.getChildNodes()[1];<NEW_LINE>EPTypeClass lhsType = (EPTypeClass) lhs.getForge().getEvaluationType();<NEW_LINE>EPTypeClass rhsType = (EPTypeClass) rhs.getForge().getEvaluationType();<NEW_LINE>EPTypeClass resultType;<NEW_LINE>if ((lhsType.getType() == short.class || lhsType.getType() == Short.class) && (rhsType.getType() == short.class || rhsType.getType() == Short.class)) {<NEW_LINE>resultType = EPTypePremade.INTEGERBOXED.getEPType();<NEW_LINE>} else if ((lhsType.getType() == byte.class || lhsType.getType() == Byte.class) && (rhsType.getType() == byte.class || rhsType.getType() == Byte.class)) {<NEW_LINE>resultType = EPTypePremade.INTEGERBOXED.getEPType();<NEW_LINE>} else if (lhsType.equals(rhsType)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>resultType = JavaClassHelper.getArithmaticCoercionType(lhsType, rhsType);<NEW_LINE>}<NEW_LINE>if ((mathArithTypeEnum == MathArithTypeEnum.DIVIDE) && (!isIntegerDivision)) {<NEW_LINE>if (resultType.getType() != BigDecimal.class) {<NEW_LINE>resultType = EPTypePremade.DOUBLEBOXED.getEPType();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MathArithTypeEnum.Computer arithTypeEnumComputer = mathArithTypeEnum.getComputer(resultType, lhsType, rhsType, isIntegerDivision, isDivisionByZeroReturnsNull, validationContext.getClasspathImportService().getDefaultMathContext());<NEW_LINE>forge = new ExprMathNodeForge(this, arithTypeEnumComputer, resultType);<NEW_LINE>return null;<NEW_LINE>} | resultType = JavaClassHelper.getBoxedType(rhsType); |
868,106 | protected boolean beforeSave(boolean newRecord) {<NEW_LINE>// Create Trees<NEW_LINE>if (newRecord) {<NEW_LINE>MTree_Base tree = new MTree_Base(getCtx(), getName() + MTree_Base.TREETYPE_CMContainer, MTree_Base.TREETYPE_CMContainer, get_TrxName());<NEW_LINE>if (!tree.save())<NEW_LINE>return false;<NEW_LINE>setAD_TreeCMC_ID(tree.getAD_Tree_ID());<NEW_LINE>//<NEW_LINE>tree = new MTree_Base(getCtx(), getName() + MTree_Base.TREETYPE_CMContainerStage, MTree_Base.TREETYPE_CMContainerStage, get_TrxName());<NEW_LINE>if (!tree.save())<NEW_LINE>return false;<NEW_LINE>setAD_TreeCMS_ID(tree.getAD_Tree_ID());<NEW_LINE>//<NEW_LINE>tree = new MTree_Base(getCtx(), getName() + MTree_Base.TREETYPE_CMTemplate, <MASK><NEW_LINE>if (!tree.save())<NEW_LINE>return false;<NEW_LINE>setAD_TreeCMT_ID(tree.getAD_Tree_ID());<NEW_LINE>//<NEW_LINE>tree = new MTree_Base(getCtx(), getName() + MTree_Base.TREETYPE_CMMedia, MTree_Base.TREETYPE_CMMedia, get_TrxName());<NEW_LINE>if (!tree.save())<NEW_LINE>return false;<NEW_LINE>setAD_TreeCMM_ID(tree.getAD_Tree_ID());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | MTree_Base.TREETYPE_CMTemplate, get_TrxName()); |
317,805 | public Object execute(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>executeCheckPassword(request, response);<NEW_LINE>checkGlobalAuth(ConnectContext.get().getCurrentUserIdentity(), PrivPredicate.ADMIN);<NEW_LINE>String dbName = request.getParameter(DB_KEY);<NEW_LINE>String tableName = request.getParameter(TABLE_KEY);<NEW_LINE>if (Strings.isNullOrEmpty(dbName) || Strings.isNullOrEmpty(tableName)) {<NEW_LINE>return ResponseEntityBuilder.badRequest("Missing params. Need database name and Table name");<NEW_LINE>}<NEW_LINE>String fullDbName = getFullDbName(dbName);<NEW_LINE>Table table;<NEW_LINE>try {<NEW_LINE>Database db = Catalog.getCurrentCatalog().getDbOrMetaException(fullDbName);<NEW_LINE>table = db.getTableOrMetaException(tableName, Table.TableType.OLAP);<NEW_LINE>} catch (MetaNotFoundException e) {<NEW_LINE>return ResponseEntityBuilder.okWithCommonError(e.getMessage());<NEW_LINE>}<NEW_LINE>List<String> createTableStmt = Lists.newArrayList();<NEW_LINE>List<String> addPartitionStmt = Lists.newArrayList();<NEW_LINE>List<String<MASK><NEW_LINE>table.readLock();<NEW_LINE>try {<NEW_LINE>Catalog.getDdlStmt(table, createTableStmt, addPartitionStmt, createRollupStmt, true, false);<NEW_LINE>} finally {<NEW_LINE>table.readUnlock();<NEW_LINE>}<NEW_LINE>Map<String, List<String>> results = Maps.newHashMap();<NEW_LINE>results.put("create_table", createTableStmt);<NEW_LINE>results.put("create_partition", addPartitionStmt);<NEW_LINE>results.put("create_rollup", createRollupStmt);<NEW_LINE>return ResponseEntityBuilder.ok(results);<NEW_LINE>} | > createRollupStmt = Lists.newArrayList(); |
428,392 | public R execute(Callable<R> callable, ExecutionContext executionContext) {<NEW_LINE>ExecutionContextImpl executionContextImpl = (ExecutionContextImpl) executionContext;<NEW_LINE>SyncFailsafe<R> failsafe = Failsafe.with(executionContextImpl.getRetry());<NEW_LINE>configureFailsafe(failsafe, executionContextImpl);<NEW_LINE>Callable<R> task = createTask(callable, executionContextImpl);<NEW_LINE>preRun(executionContextImpl);<NEW_LINE>R result = null;<NEW_LINE>Throwable failure = null;<NEW_LINE>try {<NEW_LINE>result = failsafe.get(task);<NEW_LINE>} catch (net.jodah.failsafe.CircuitBreakerOpenException e) {<NEW_LINE>failure = e;<NEW_LINE>// Task was not run at all, make sure we run end of execution processing<NEW_LINE>executionContextImpl.onMainExecutionComplete(e);<NEW_LINE>throw new CircuitBreakerOpenException(e);<NEW_LINE>} catch (net.jodah.failsafe.FailsafeException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Fault tolerance execution ended in failure: {0} - {1}", <MASK><NEW_LINE>}<NEW_LINE>failure = e;<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause instanceof FaultToleranceException) {<NEW_LINE>throw (FaultToleranceException) cause;<NEW_LINE>} else {<NEW_LINE>throw new ExecutionException(cause);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>failure = t;<NEW_LINE>throw t;<NEW_LINE>} finally {<NEW_LINE>executionComplete(executionContextImpl, failure);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | executionContextImpl.getMethod(), e); |
1,820,131 | public SaleOrder addPack(SaleOrder saleOrder, Pack pack, BigDecimal packQty) {<NEW_LINE>List<PackLine> packLineList = pack.getComponents();<NEW_LINE>if (ObjectUtils.isEmpty(packLineList)) {<NEW_LINE>return saleOrder;<NEW_LINE>}<NEW_LINE>packLineList.sort(Comparator.comparing(PackLine::getSequence));<NEW_LINE>Integer sequence = -1;<NEW_LINE>List<SaleOrderLine> soLines = saleOrder.getSaleOrderLineList();<NEW_LINE>if (soLines != null && !soLines.isEmpty()) {<NEW_LINE>sequence = soLines.stream().mapToInt(SaleOrderLine::getSequence).max().getAsInt();<NEW_LINE>}<NEW_LINE>BigDecimal conversionRate = new BigDecimal(1.00);<NEW_LINE>if (pack.getCurrency() != null && !pack.getCurrency().getCode().equals(saleOrder.getCurrency().getCode())) {<NEW_LINE>try {<NEW_LINE>conversionRate = Beans.get(CurrencyConversionFactory.class).getCurrencyConversionService().convert(pack.getCurrency(), saleOrder.getCurrency());<NEW_LINE>} catch (MalformedURLException | JSONException | AxelorException e) {<NEW_LINE>TraceBackService.trace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Boolean.FALSE.equals(pack.getDoNotDisplayHeaderAndEndPack())) {<NEW_LINE>if (saleOrderLineService.getPackLineTypes(packLineList) == null || !saleOrderLineService.getPackLineTypes(packLineList).contains(PackLineRepository.TYPE_START_OF_PACK)) {<NEW_LINE>sequence++;<NEW_LINE>}<NEW_LINE>soLines = saleOrderLineService.createNonStandardSOLineFromPack(pack, saleOrder, packQty, soLines, sequence);<NEW_LINE>}<NEW_LINE>SaleOrderLine soLine;<NEW_LINE>for (PackLine packLine : packLineList) {<NEW_LINE>if (packLine.getTypeSelect() != PackLineRepository.TYPE_NORMAL && Boolean.TRUE.equals(pack.getDoNotDisplayHeaderAndEndPack())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>soLine = saleOrderLineService.createSaleOrderLine(packLine, saleOrder<MASK><NEW_LINE>if (soLine != null) {<NEW_LINE>soLine.setSaleOrder(saleOrder);<NEW_LINE>soLines.add(soLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (soLines != null && !soLines.isEmpty()) {<NEW_LINE>try {<NEW_LINE>saleOrder = saleOrderComputeService.computeSaleOrder(saleOrder);<NEW_LINE>saleOrderMarginService.computeMarginSaleOrder(saleOrder);<NEW_LINE>} catch (AxelorException e) {<NEW_LINE>TraceBackService.trace(e);<NEW_LINE>}<NEW_LINE>saleOrderRepo.save(saleOrder);<NEW_LINE>}<NEW_LINE>return saleOrder;<NEW_LINE>} | , packQty, conversionRate, ++sequence); |
1,650,400 | /*<NEW_LINE>* implemented as per wiki suggested algo with minor adjustments.<NEW_LINE>*/<NEW_LINE>private void compactAndRemove(final E[] buffer, final int mask, int removeHashIndex) {<NEW_LINE>// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,9c,10a,10b,null,11a,null]<NEW_LINE>removeHashIndex = removeHashIndex & mask;<NEW_LINE>int j = removeHashIndex;<NEW_LINE>while (true) {<NEW_LINE>int k;<NEW_LINE>E slotJ;<NEW_LINE>// skip elements which belong where they are<NEW_LINE>do {<NEW_LINE>// j := (j+1) modulo num_slots<NEW_LINE>j = (j + 1) & mask;<NEW_LINE>slotJ = buffer[j];<NEW_LINE>// if slot[j] is unoccupied exit<NEW_LINE>if (slotJ == null) {<NEW_LINE>// delete last duplicate slot<NEW_LINE>buffer[removeHashIndex] = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// k := hash(slot[j].key) modulo num_slots<NEW_LINE>k = rehash(<MASK><NEW_LINE>// determine if k lies cyclically in [i,j]<NEW_LINE>// | i.k.j |<NEW_LINE>// |....j i.k.| or |.k..j i...|<NEW_LINE>} while ((removeHashIndex <= j) ? ((removeHashIndex < k) && (k <= j)) : ((removeHashIndex < k) || (k <= j)));<NEW_LINE>// slot[removeHashIndex] := slot[j]<NEW_LINE>buffer[removeHashIndex] = slotJ;<NEW_LINE>// removeHashIndex := j<NEW_LINE>removeHashIndex = j;<NEW_LINE>}<NEW_LINE>} | slotJ.hashCode()) & mask; |
1,381,453 | public void update() {<NEW_LINE>if (externalMetricsSupplier != null) {<NEW_LINE>Set<CompactionExecutorId> seenIds = new HashSet<>();<NEW_LINE>synchronized (exCeMetricsMap) {<NEW_LINE>externalMetricsSupplier.get().forEach(ecm -> {<NEW_LINE>seenIds.add(ecm.ceid);<NEW_LINE>ExMetrics exm = exCeMetricsMap.computeIfAbsent(ecm.ceid, id -> {<NEW_LINE>ExMetrics m = new ExMetrics();<NEW_LINE>if (registry != null) {<NEW_LINE>m.queued = registry.gauge(METRICS_MAJC_QUEUED, Tags.of("id", ecm.ceid.canonical()<MASK><NEW_LINE>m.running = registry.gauge(METRICS_MAJC_RUNNING, Tags.of("id", ecm.ceid.canonical()), new AtomicInteger(0));<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>});<NEW_LINE>exm.queued.set(ecm.queued);<NEW_LINE>exm.running.set(ecm.running);<NEW_LINE>});<NEW_LINE>Sets.difference(exCeMetricsMap.keySet(), seenIds).forEach(unusedId -> {<NEW_LINE>ExMetrics exm = exCeMetricsMap.get(unusedId);<NEW_LINE>exm.queued.set(0);<NEW_LINE>exm.running.set(0);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ceMetricsList.forEach(cem -> {<NEW_LINE>cem.running.set(cem.runningSupplier.getAsInt());<NEW_LINE>cem.queued.set(cem.queuedSupplier.getAsInt());<NEW_LINE>});<NEW_LINE>} | ), new AtomicInteger(0)); |
384,166 | protected BiConsumer<Row, List<Span>> accumulator() {<NEW_LINE>return (row, result) -> {<NEW_LINE>String traceId = row.getString("trace_id");<NEW_LINE>String traceIdHigh = row.getString("trace_id_high");<NEW_LINE>if (traceIdHigh != null)<NEW_LINE>traceId = traceIdHigh + traceId;<NEW_LINE>Span.Builder builder = Span.newBuilder().traceId(traceId).parentId(row.getString("parent_id")).id(row.getString("id")).name(row.getString("span"));<NEW_LINE>if (!row.isNull("ts"))<NEW_LINE>builder.timestamp<MASK><NEW_LINE>if (!row.isNull("duration"))<NEW_LINE>builder.duration(row.getLong("duration"));<NEW_LINE>if (!row.isNull("kind")) {<NEW_LINE>try {<NEW_LINE>builder.kind(Span.Kind.valueOf(row.getString("kind")));<NEW_LINE>} catch (IllegalArgumentException ignored) {<NEW_LINE>// EmptyCatch ignored<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!row.isNull("l_ep"))<NEW_LINE>builder.localEndpoint(row.get("l_ep", Endpoint.class));<NEW_LINE>if (!row.isNull("r_ep"))<NEW_LINE>builder.remoteEndpoint(row.get("r_ep", Endpoint.class));<NEW_LINE>if (!row.isNull("debug"))<NEW_LINE>builder.debug(row.getBoolean("debug"));<NEW_LINE>if (!row.isNull("shared"))<NEW_LINE>builder.shared(row.getBoolean("shared"));<NEW_LINE>for (Annotation annotation : row.getList("annotations", Annotation.class)) {<NEW_LINE>builder.addAnnotation(annotation.timestamp(), annotation.value());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> tag : row.getMap("tags", String.class, String.class).entrySet()) {<NEW_LINE>builder.putTag(tag.getKey(), tag.getValue());<NEW_LINE>}<NEW_LINE>result.add(builder.build());<NEW_LINE>};<NEW_LINE>} | (row.getLong("ts")); |
532,438 | public int compareTo(add_filter_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetMid()).compareTo(other.isSetMid());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetMid()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mid, other.mid);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetFilterId()).compareTo(other.isSetFilterId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetFilterId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filter_id, other.filter_id);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetFilterEx()).<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetFilterEx()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filter_ex, other.filter_ex);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | compareTo(other.isSetFilterEx()); |
403,745 | public void renderJSON(PrintWriter writer, Map<String, String> params) {<NEW_LINE>String clusterName = params.get("cluster");<NEW_LINE>String <MASK><NEW_LINE>JsonArray json = new JsonArray();<NEW_LINE>KafkaClusterManager clusterMananger = DoctorKMain.doctorK.getClusterManager(clusterName);<NEW_LINE>if (clusterMananger == null) {<NEW_LINE>ClusterInfoError error = new ClusterInfoError("Failed to find cluster manager for {}", clusterName);<NEW_LINE>writer.print(gson.toJson(error));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>KafkaCluster cluster = clusterMananger.getCluster();<NEW_LINE>TreeSet<TopicPartition> topicPartitions = new TreeSet(new KafkaUtils.TopicPartitionComparator());<NEW_LINE>topicPartitions.addAll(cluster.topicPartitions.get(topic));<NEW_LINE>for (TopicPartition topicPartition : topicPartitions) {<NEW_LINE>double bytesInMax = cluster.getMaxBytesIn(topicPartition) / 1024.0 / 1024.0;<NEW_LINE>double bytesOutMax = cluster.getMaxBytesOut(topicPartition) / 1024.0 / 1024.0;<NEW_LINE>JsonObject jsonPartition = new JsonObject();<NEW_LINE>jsonPartition.add("bytesInMax", gson.toJsonTree(bytesInMax));<NEW_LINE>jsonPartition.add("bytesOutMax", gson.toJsonTree(bytesOutMax));<NEW_LINE>jsonPartition.add("partition", gson.toJsonTree(topicPartition.partition()));<NEW_LINE>json.add(jsonPartition);<NEW_LINE>}<NEW_LINE>writer.print(json);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.print(gson.toJson(e));<NEW_LINE>}<NEW_LINE>} | topic = params.get("topic"); |
887,106 | public MutablePair<CoreV1Event, V1Patch> observe(CoreV1Event event, String key) {<NEW_LINE>OffsetDateTime now = OffsetDateTime.now();<NEW_LINE>EventLog lastObserved = this.eventCache.getIfPresent(key);<NEW_LINE>V1Patch patch = null;<NEW_LINE>if (lastObserved != null && lastObserved.count != null && lastObserved.count > 0) {<NEW_LINE>event.setCount(lastObserved.count + 1);<NEW_LINE>event.setFirstTimestamp(lastObserved.firstTimestamp);<NEW_LINE>event.getMetadata().setName(lastObserved.name);<NEW_LINE>event.getMetadata().setResourceVersion(lastObserved.resourceVersion);<NEW_LINE>patch = buildEventPatch(event.getCount(), event.getMessage(), now);<NEW_LINE>}<NEW_LINE>EventLog log = new EventLog();<NEW_LINE>log.count = event.getCount();<NEW_LINE>log.firstTimestamp = event.getFirstTimestamp();<NEW_LINE>log.name = event<MASK><NEW_LINE>log.resourceVersion = event.getMetadata().getResourceVersion();<NEW_LINE>this.eventCache.put(key, log);<NEW_LINE>return new MutablePair<>(event, patch);<NEW_LINE>} | .getMetadata().getName(); |
1,538,149 | private void visitPatterns(List<Concrete.Pattern> patterns, List<Concrete.Parameter> parameters, Map<String, Referable> usedNames, boolean resolvePatterns) {<NEW_LINE>int j = 0;<NEW_LINE>for (int i = 0; i < patterns.size(); i++) {<NEW_LINE>Concrete.Pattern pattern = patterns.get(i);<NEW_LINE>if (pattern == null) {<NEW_LINE>visitParameter(parameters.get(j++), null);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Referable ref = pattern instanceof Concrete.NamePattern ? ((Concrete.NamePattern) pattern).getReferable() : null;<NEW_LINE>Referable constructor = visitPattern(pattern, usedNames);<NEW_LINE>if (constructor != null) {<NEW_LINE>Concrete.ConstructorPattern newPattern = new Concrete.ConstructorPattern(pattern.getData(), pattern.isExplicit(), constructor, Collections.emptyList(), null);<NEW_LINE><MASK><NEW_LINE>if (myResolverListener != null) {<NEW_LINE>myResolverListener.patternResolved(ref, newPattern, Collections.singletonList(constructor));<NEW_LINE>}<NEW_LINE>} else if (pattern instanceof Concrete.NamePattern && myResolverListener != null) {<NEW_LINE>myResolverListener.patternResolved((Concrete.NamePattern) pattern);<NEW_LINE>}<NEW_LINE>if (resolvePatterns) {<NEW_LINE>resolvePattern(patterns.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | patterns.set(i, newPattern); |
1,700,877 | public void runSupport() {<NEW_LINE>FileDialog dialog = new FileDialog(Utils.findAnyShell(), SWT.SYSTEM_MODAL | SWT.SAVE);<NEW_LINE>dialog.setFilterPath(TorrentOpener.getFilterPathData());<NEW_LINE>dialog.setText(MessageText.getString("subscript.export.select.template.file"));<NEW_LINE>dialog.setFilterExtensions(VuzeFileHandler.getVuzeFileFilterExtensions());<NEW_LINE>dialog.setFilterNames(VuzeFileHandler.getVuzeFileFilterExtensions());<NEW_LINE>String path = TorrentOpener.setFilterPathData(dialog.open());<NEW_LINE>if (path != null) {<NEW_LINE>if (!VuzeFileHandler.isAcceptedVuzeFileName(path)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>VuzeFile vf = subs.getVuzeFile();<NEW_LINE>vf.write(new File(path));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | path = VuzeFileHandler.getVuzeFileName(path); |
1,638,399 | final ListAuditMitigationActionsTasksResult executeListAuditMitigationActionsTasks(ListAuditMitigationActionsTasksRequest listAuditMitigationActionsTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAuditMitigationActionsTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAuditMitigationActionsTasksRequest> request = null;<NEW_LINE>Response<ListAuditMitigationActionsTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAuditMitigationActionsTasksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAuditMitigationActionsTasksRequest));<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.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAuditMitigationActionsTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAuditMitigationActionsTasksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAuditMitigationActionsTasksResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
430,344 | public boolean performOk() {<NEW_LINE>getPreferenceStore().setValue(GRID_SIZE, fGridSizeSpinner.getSelection());<NEW_LINE>getPreferenceStore().setValue(PALETTE_STATE, fPaletteStateButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(VIEW_TOOLTIPS, fViewTooltipsButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(VIEWPOINTS_FILTER_MODEL_TREE, fViewpointsFilterModelTreeButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(VIEWPOINTS_HIDE_PALETTE_ELEMENTS, fViewpointsHidePaletteElementsButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(VIEWPOINTS_HIDE_MAGIC_CONNECTOR_ELEMENTS, fViewpointsHideMagicConnectorElementsButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(<MASK><NEW_LINE>getPreferenceStore().setValue(EDIT_NAME_ON_NEW_OBJECT, fEditNameOnNewObjectButton.getSelection());<NEW_LINE>for (int i = 0; i < fPasteSpecialButtons.length; i++) {<NEW_LINE>if (fPasteSpecialButtons[i].getSelection()) {<NEW_LINE>getPreferenceStore().setValue(DIAGRAM_PASTE_SPECIAL_BEHAVIOR, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < fResizeBehaviourButtons.length; i++) {<NEW_LINE>if (fResizeBehaviourButtons[i].getSelection()) {<NEW_LINE>getPreferenceStore().setValue(DIAGRAM_OBJECT_RESIZE_BEHAVIOUR, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getPreferenceStore().setValue(USE_SCALED_IMAGES, fScaleFigureImagesButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(USE_FIGURE_LINE_OFFSET, fUseFigureLineOffsetButton.getSelection());<NEW_LINE>return true;<NEW_LINE>} | VIEWPOINTS_GHOST_DIAGRAM_ELEMENTS, fViewpointsGhostDiagramElementsButton.getSelection()); |
1,793,311 | public void construct() {<NEW_LINE>try {<NEW_LINE>panel.wizardDescriptor.putProperty(WizardDescriptor.PROP_INFO_MESSAGE, "Contacting service...");<NEW_LINE>MicronautLaunchService service = MicronautLaunchService.getInstance();<NEW_LINE>String serviceUrl = getServiceUrl();<NEW_LINE>String <MASK><NEW_LINE>for (MicronautLaunchService.ApplicationType type : service.getApplicationTypes(serviceUrl)) {<NEW_LINE>applicationTypeComboBox.addItem(type);<NEW_LINE>}<NEW_LINE>for (String version : service.getJdkVersions(serviceUrl)) {<NEW_LINE>javaVersionComboBox.addItem(version);<NEW_LINE>}<NEW_LINE>versionTextField.setText(micronautVersion);<NEW_LINE>initialized = true;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>panel.wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, "Could not query Micronaut Launch service");<NEW_LINE>failed = true;<NEW_LINE>panel.fireChangeEvent();<NEW_LINE>}<NEW_LINE>} | micronautVersion = service.getMicronautVersion(serviceUrl); |
1,397,149 | public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> list, TooltipFlag flag) {<NEW_LINE>String tag = getRevolverDisplayTag(stack);<NEW_LINE>if (!tag.isEmpty())<NEW_LINE>list.add(new TranslatableComponent(Lib.DESC_FLAVOUR + "revolver." + tag));<NEW_LINE>else if (ItemNBTHelper.hasKey(stack, "flavour"))<NEW_LINE>list.add(new TranslatableComponent(Lib.DESC_FLAVOUR + "revolver." + ItemNBTHelper.getString(stack, "flavour")));<NEW_LINE>else<NEW_LINE>list.add(new TranslatableComponent<MASK><NEW_LINE>CompoundTag perks = getPerks(stack);<NEW_LINE>for (String key : perks.getAllKeys()) {<NEW_LINE>RevolverPerk perk = RevolverPerk.get(key);<NEW_LINE>if (perk != null)<NEW_LINE>list.add(new TextComponent(" ").append(perk.getDisplayString(perks.getDouble(key))));<NEW_LINE>}<NEW_LINE>} | (Lib.DESC_FLAVOUR + "revolver")); |
1,123,389 | public MetastoreOperationResult renameColumn(MetastoreContext metastoreContext, String databaseName, String tableName, String oldColumnName, String newColumnName) {<NEW_LINE>com.amazonaws.services.glue.model.Table table = getGlueTableOrElseThrow(databaseName, tableName);<NEW_LINE>if (table.getPartitionKeys() != null && table.getPartitionKeys().stream().anyMatch(c -> c.getName().equals(oldColumnName))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ImmutableList.Builder<com.amazonaws.services.glue.model.Column> newDataColumns = ImmutableList.builder();<NEW_LINE>for (com.amazonaws.services.glue.model.Column column : table.getStorageDescriptor().getColumns()) {<NEW_LINE>if (column.getName().equals(oldColumnName)) {<NEW_LINE>newDataColumns.add(new com.amazonaws.services.glue.model.Column().withName(newColumnName).withType(column.getType()).withComment(column.getComment()));<NEW_LINE>} else {<NEW_LINE>newDataColumns.add(column);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.getStorageDescriptor().setColumns(newDataColumns.build());<NEW_LINE>replaceGlueTable(databaseName, tableName, table);<NEW_LINE>return EMPTY_RESULT;<NEW_LINE>} | throw new PrestoException(NOT_SUPPORTED, "Renaming partition columns is not supported"); |
6,959 | protected void run() throws Exception {<NEW_LINE>// Error if not running on Windows<NEW_LINE>if (Platform.CURRENT_PLATFORM.getOperatingSystem() != OperatingSystem.WINDOWS) {<NEW_LINE>popup("Aborting: This script is for use on Windows only.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get appropriate pdb.exe file<NEW_LINE>String pdbExeLocation = Application.getOSFile("pdb.exe").getAbsolutePath();<NEW_LINE>List<String> choices = Arrays.asList("single file", "directory of files");<NEW_LINE>String fileOrDir = askChoice("PDB file or directory", "Would you like to operate on a single " + ".pdb file or a directory of .pdb files?", choices, choices.get(1));<NEW_LINE>File pdbParentDir;<NEW_LINE>String pdbName;<NEW_LINE>int filesCreated = 0;<NEW_LINE>try {<NEW_LINE>if (fileOrDir.equals(choices.get(0))) {<NEW_LINE>File pdbFile = askFile("Choose a PDB file", "OK");<NEW_LINE>if (!pdbFile.exists()) {<NEW_LINE>popup(pdbFile.getAbsolutePath() + " is not a valid file.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!pdbFile.getName().endsWith(".pdb")) {<NEW_LINE>popup("Aborting: Expected input file to have extension of type .pdb (got '" + pdbFile.getName() + "').");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pdbParentDir = pdbFile.getParentFile();<NEW_LINE>pdbName = pdbFile.getName();<NEW_LINE>println("Processing: " + pdbFile.getAbsolutePath());<NEW_LINE>runPdbExe(pdbExeLocation, pdbParentDir, pdbName, pdbFile.getAbsolutePath());<NEW_LINE>filesCreated = 1;<NEW_LINE>} else {<NEW_LINE>// Do recursive processing<NEW_LINE>File pdbDir = askDirectory("Choose PDB root folder (performs recursive search for .pdb files)", "OK");<NEW_LINE>// Get list of files to process<NEW_LINE>List<File> pdbFiles = new ArrayList<>();<NEW_LINE>getPDBFiles(pdbDir, pdbFiles);<NEW_LINE>int createdFilesCounter = 0;<NEW_LINE>for (File childPDBFile : pdbFiles) {<NEW_LINE>pdbParentDir = childPDBFile.getParentFile();<NEW_LINE>pdbName = childPDBFile.getName();<NEW_LINE>String currentFilePath = childPDBFile.getAbsolutePath();<NEW_LINE>println("Processing: " + currentFilePath);<NEW_LINE>runPdbExe(pdbExeLocation, pdbParentDir, pdbName, currentFilePath);<NEW_LINE>createdFilesCounter++;<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filesCreated = createdFilesCounter;<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (filesCreated > 0) {<NEW_LINE>popup("Created " + filesCreated + " .pdb.xml file(s).");<NEW_LINE>}<NEW_LINE>} | popup(ioe.getMessage()); |
1,588,941 | GeckoResult<Integer> handleWebXRPermission(GeckoSession aGeckoSession, ContentPermission perm) {<NEW_LINE>Session session = SessionStore.get().getSession(aGeckoSession);<NEW_LINE>if (session == null || !SettingsStore.getInstance(mContext).isWebXREnabled()) {<NEW_LINE>return GeckoResult.fromValue(ContentPermission.VALUE_DENY);<NEW_LINE>}<NEW_LINE>final String domain = UrlUtils.getHost(perm.uri);<NEW_LINE>@Nullable<NEW_LINE>SitePermission site = null;<NEW_LINE>if (mSitePermissions != null) {<NEW_LINE>site = mSitePermissions.stream().filter(sitePermission -> sitePermission.category == SitePermission.SITE_PERMISSION_WEBXR && sitePermission.url.equalsIgnoreCase(domain)).findFirst().orElse(null);<NEW_LINE>}<NEW_LINE>if (site == null) {<NEW_LINE>session.setWebXRState(SessionState.WEBXR_ALLOWED);<NEW_LINE>return GeckoResult.fromValue(ContentPermission.VALUE_ALLOW);<NEW_LINE>} else {<NEW_LINE>session.setWebXRState(SessionState.WEBXR_BLOCKED);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>} | GeckoResult.fromValue(ContentPermission.VALUE_DENY); |
498,420 | private void visualizeData() {<NEW_LINE>if (scienceLab.isConnected()) {<NEW_LINE>double ppm = <MASK><NEW_LINE>dustSensorMeter.setPointerColor(ppm > highLimit ? Color.WHITE : Color.RED);<NEW_LINE>dustValue.setText(String.format(Locale.getDefault(), "%.2f", ppm));<NEW_LINE>String status = ppm > highLimit ? "Good" : "Bad";<NEW_LINE>dustStatus.setText(status);<NEW_LINE>dustSensorMeter.setWithTremble(false);<NEW_LINE>dustSensorMeter.setSpeedAt((float) ppm);<NEW_LINE>timeElapsed = ((System.currentTimeMillis() - startTime) / updatePeriod);<NEW_LINE>if (timeElapsed != previousTimeElapsed) {<NEW_LINE>previousTimeElapsed = timeElapsed;<NEW_LINE>Entry entry = new Entry((float) timeElapsed, (float) ppm);<NEW_LINE>entries.add(entry);<NEW_LINE>writeLogToFile(System.currentTimeMillis(), (float) ppm);<NEW_LINE>LineDataSet dataSet = new LineDataSet(entries, getString(R.string.gas_sensor_unit));<NEW_LINE>dataSet.setDrawCircles(false);<NEW_LINE>dataSet.setDrawValues(false);<NEW_LINE>dataSet.setLineWidth(2);<NEW_LINE>LineData data = new LineData(dataSet);<NEW_LINE>mChart.setData(data);<NEW_LINE>mChart.notifyDataSetChanged();<NEW_LINE>mChart.setVisibleXRangeMaximum(80);<NEW_LINE>mChart.moveViewToX(data.getEntryCount());<NEW_LINE>mChart.invalidate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | scienceLab.getVoltage("CH1", 1); |
183,311 | public V replace(K key, V value) {<NEW_LINE>requireNonNull(value);<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>V[] oldValue = (V[]) new Object[1];<NEW_LINE>boolean[] done = { false };<NEW_LINE>for (; ; ) {<NEW_LINE>CompletableFuture<V> <MASK><NEW_LINE>if ((future == null) || future.isCompletedExceptionally()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Async.getWhenSuccessful(future);<NEW_LINE>delegate.compute(key, (k, oldValueFuture) -> {<NEW_LINE>if (oldValueFuture == null) {<NEW_LINE>done[0] = true;<NEW_LINE>return null;<NEW_LINE>} else if (!oldValueFuture.isDone()) {<NEW_LINE>return oldValueFuture;<NEW_LINE>}<NEW_LINE>done[0] = true;<NEW_LINE>oldValue[0] = Async.getIfReady(oldValueFuture);<NEW_LINE>return (oldValue[0] == null) ? null : CompletableFuture.completedFuture(value);<NEW_LINE>}, delegate.expiry(), /* recordStats */<NEW_LINE>false, /* recordLoad */<NEW_LINE>false, /* recordLoadFailure */<NEW_LINE>false);<NEW_LINE>if (done[0]) {<NEW_LINE>return oldValue[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | future = delegate.getIfPresentQuietly(key); |
1,362,152 | public <T> CompletionStage<ReadResultSet<T>> readFromEventJournal(long startSequence, int minSize, int maxSize, int partitionId, java.util.function.Predicate<? super EventJournalMapEvent<K, V>> predicate, java.util.function.Function<? super EventJournalMapEvent<K, V>, ? extends T> projection) {<NEW_LINE>if (maxSize < minSize) {<NEW_LINE>throw new IllegalArgumentException("maxSize " + maxSize + " must be greater or equal to minSize " + minSize);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>predicate = (java.util.function.Predicate<? super EventJournalMapEvent<K, V>>) context.initialize(predicate);<NEW_LINE>projection = (java.util.function.Function<? super EventJournalMapEvent<K, V>, ? extends T>) context.initialize(projection);<NEW_LINE>final MapEventJournalReadOperation<K, V, T> op = new MapEventJournalReadOperation<>(name, startSequence, minSize, maxSize, predicate, projection);<NEW_LINE>op.setPartitionId(partitionId);<NEW_LINE>return operationService.invokeOnPartition(op);<NEW_LINE>} | ManagedContext context = serializationService.getManagedContext(); |
840,805 | public final // F49213<NEW_LINE>void formatTo(IncidentStream is) {<NEW_LINE>// -----------------------------------------------------------------------<NEW_LINE>// Indicate the start of the dump, and include the identity<NEW_LINE>// of InjectionProcessor, so this can easily be matched to a trace.<NEW_LINE>// -----------------------------------------------------------------------<NEW_LINE>is.writeLine("", ">--- Start InjectionProcessor Dump ---> " + Util.identity(this));<NEW_LINE>is.writeLine("", "Annotation = " + ivAnnotationClass);<NEW_LINE>is.writeLine("", "Annotations = " + ivAnnotationsClass);<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", ivContext != null ? ivContext.toString() : "ivContext = null");<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", ivNameSpaceConfig != null ? ivNameSpaceConfig.toString() : "ivNameSpaceConfig = null");<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Override Processor : " + ivOverrideProcessor);<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Object Factory Map : ");<NEW_LINE>for (Class<?> key : ivObjectFactoryMap.keySet()) {<NEW_LINE>is.writeLine("", " " + key.getName() + " : " + Util.identity(<MASK><NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "No-Override Object Factory Map : ");<NEW_LINE>for (Class<?> key : ivNoOverrideObjectFactoryMap.keySet()) {<NEW_LINE>is.writeLine("", " " + key.getName() + " : " + Util.identity(ivNoOverrideObjectFactoryMap.get(key)));<NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Override Reference Factories : ");<NEW_LINE>for (OverrideReferenceFactory<A> factory : ivOverrideReferenceFactories) {<NEW_LINE>is.writeLine("", " " + Util.identity(factory));<NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "All Bindings : ");<NEW_LINE>for (String key : ivAllAnnotationsCollection.keySet()) {<NEW_LINE>is.writeLine("", " " + key + " : " + Util.identity(ivAllAnnotationsCollection.get(key)));<NEW_LINE>}<NEW_LINE>is.writeLine("", "<--- InjectionProcessor Dump Complete---< ");<NEW_LINE>} | ivObjectFactoryMap.get(key))); |
257,351 | public BeanDefinition parse(Element element, ParserContext parserContext) {<NEW_LINE>Object source = parserContext.extractSource(element);<NEW_LINE>// Register component for the surrounding <rabbit:annotation-driven> element.<NEW_LINE>CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), source);<NEW_LINE>parserContext.pushContainingComponent(compDefinition);<NEW_LINE>// Nest the concrete post-processor bean in the surrounding component.<NEW_LINE>BeanDefinitionRegistry registry = parserContext.getRegistry();<NEW_LINE>if (registry.containsBeanDefinition(RabbitListenerConfigUtils.RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)) {<NEW_LINE>parserContext.getReaderContext().error("Only one RabbitListenerAnnotationBeanPostProcessor may exist within the context.", source);<NEW_LINE>} else {<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(RabbitListenerAnnotationBeanPostProcessor.class);<NEW_LINE>builder.getRawBeanDefinition().setSource(source);<NEW_LINE>String endpointRegistry = element.getAttribute("registry");<NEW_LINE>if (StringUtils.hasText(endpointRegistry)) {<NEW_LINE>builder.addPropertyReference("endpointRegistry", endpointRegistry);<NEW_LINE>} else {<NEW_LINE>registerDefaultEndpointRegistry(source, parserContext);<NEW_LINE>}<NEW_LINE>String containerFactory = element.getAttribute("container-factory");<NEW_LINE>if (StringUtils.hasText(containerFactory)) {<NEW_LINE>builder.addPropertyValue("containerFactoryBeanName", containerFactory);<NEW_LINE>}<NEW_LINE>String handlerMethodFactory = element.getAttribute("handler-method-factory");<NEW_LINE>if (StringUtils.hasText(handlerMethodFactory)) {<NEW_LINE>builder.addPropertyReference("messageHandlerMethodFactory", handlerMethodFactory);<NEW_LINE>}<NEW_LINE>registerInfrastructureBean(<MASK><NEW_LINE>}<NEW_LINE>// Finally register the composite component.<NEW_LINE>parserContext.popAndRegisterContainingComponent();<NEW_LINE>return null;<NEW_LINE>} | parserContext, builder, RabbitListenerConfigUtils.RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME); |
147,093 | private void createOrUpdateBpartnerProduct(@NonNull final JsonRequestBPartnerProductUpsert jsonRequestBPartnerProductUpsert, @NonNull final SyncAdvise effectiveSyncAdvise, @NonNull final ProductId productId, @NonNull final String orgCode) {<NEW_LINE>final ExternalIdentifier externalIdentifier = ExternalIdentifier.<MASK><NEW_LINE>final BPartnerId bPartnerId = getBPartnerId(externalIdentifier, orgCode);<NEW_LINE>final BPartnerProduct existingBPartnerProduct = productRepository.getByIdOrNull(productId, bPartnerId);<NEW_LINE>if (existingBPartnerProduct != null) {<NEW_LINE>if (effectiveSyncAdvise.getIfExists().isUpdate()) {<NEW_LINE>final BPartnerProduct bPartnerProduct = syncBPartnerProductWithJson(jsonRequestBPartnerProductUpsert, existingBPartnerProduct, bPartnerId);<NEW_LINE>productRepository.updateBPartnerProduct(bPartnerProduct);<NEW_LINE>}<NEW_LINE>} else if (effectiveSyncAdvise.isFailIfNotExists()) {<NEW_LINE>throw MissingResourceException.builder().resourceName("C_BPartner_Product").resourceIdentifier("{c_bpartner_identifier:" + jsonRequestBPartnerProductUpsert.getBpartnerIdentifier() + ", m_product_id: " + productId.getRepoId()).build().setParameter("effectiveSyncAdvise", effectiveSyncAdvise);<NEW_LINE>} else {<NEW_LINE>final CreateBPartnerProductRequest createBPartnerProductRequest = getCreateBPartnerProductRequest(jsonRequestBPartnerProductUpsert, productId, bPartnerId);<NEW_LINE>productRepository.createBPartnerProduct(createBPartnerProductRequest);<NEW_LINE>}<NEW_LINE>} | of(jsonRequestBPartnerProductUpsert.getBpartnerIdentifier()); |
573,173 | public ScalarOperator rewriteSubqueryScalarOperator(Expr predicate, OptExprBuilder subOpt, List<ColumnRefOperator> correlation) {<NEW_LINE>ScalarOperator scalarPredicate = SqlToScalarOperatorTranslator.translate(predicate, subOpt.getExpressionMapping(), correlation);<NEW_LINE>ArrayList<InPredicate> <MASK><NEW_LINE>predicate.collect(InPredicate.class, inPredicates);<NEW_LINE>ArrayList<ExistsPredicate> existsSubquerys = new ArrayList<>();<NEW_LINE>predicate.collect(ExistsPredicate.class, existsSubquerys);<NEW_LINE>List<ScalarOperator> s = Utils.extractConjuncts(scalarPredicate);<NEW_LINE>for (InPredicate e : inPredicates) {<NEW_LINE>if (!(e.getChild(1) instanceof Subquery)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ColumnRefOperator columnRefOperator = subOpt.getExpressionMapping().get(e);<NEW_LINE>s.remove(columnRefOperator);<NEW_LINE>}<NEW_LINE>for (ExistsPredicate e : existsSubquerys) {<NEW_LINE>ColumnRefOperator columnRefOperator = subOpt.getExpressionMapping().get(e);<NEW_LINE>s.remove(columnRefOperator);<NEW_LINE>}<NEW_LINE>scalarPredicate = Utils.compoundAnd(s);<NEW_LINE>return scalarPredicate;<NEW_LINE>} | inPredicates = new ArrayList<>(); |
363,267 | ArrayList<Object> new155() /* reduce AFieldSignature */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList5 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList4 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PFieldSignature pfieldsignatureNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TCmplt tcmpltNode2;<NEW_LINE>PClassName pclassnameNode3;<NEW_LINE>TColon tcolonNode4;<NEW_LINE>PType ptypeNode5;<NEW_LINE>PName pnameNode6;<NEW_LINE>TCmpgt tcmpgtNode7;<NEW_LINE>tcmpltNode2 = (TCmplt) nodeArrayList1.get(0);<NEW_LINE>pclassnameNode3 = (PClassName) nodeArrayList2.get(0);<NEW_LINE>tcolonNode4 = (TColon) nodeArrayList3.get(0);<NEW_LINE>ptypeNode5 = (PType) nodeArrayList4.get(0);<NEW_LINE>pnameNode6 = (PName) nodeArrayList5.get(0);<NEW_LINE>tcmpgtNode7 = (TCmpgt) nodeArrayList6.get(0);<NEW_LINE>pfieldsignatureNode1 = new AFieldSignature(tcmpltNode2, pclassnameNode3, tcolonNode4, ptypeNode5, pnameNode6, tcmpgtNode7);<NEW_LINE>}<NEW_LINE>nodeList.add(pfieldsignatureNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | <Object> nodeArrayList6 = pop(); |
1,576,632 | public void onBindViewHolder(@NonNull final GroupsViewHolder holder, int position) {<NEW_LINE>if (position == items.size()) {<NEW_LINE>holder.groupButton.setOnClickListener(view -> {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>DialogFragment dialogFragment = createAddCategoryDialog();<NEW_LINE>if (fragmentManager != null && dialogFragment != null) {<NEW_LINE>dialogFragment.show(fragmentManager, AddNewFavoriteCategoryBottomSheet.TAG);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>holder.groupButton.setOnClickListener(view -> {<NEW_LINE>int previousSelectedPosition = getItemPosition(selectedItemName);<NEW_LINE>selectedItemName = items.get(holder.getAdapterPosition());<NEW_LINE>updateColorSelector(getCategoryColor(selectedItemName));<NEW_LINE>AndroidUiHelper.updateVisibility(addToHiddenGroupInfo, !isCategoryVisible(selectedItemName));<NEW_LINE>notifyItemChanged(holder.getAdapterPosition());<NEW_LINE>notifyItemChanged(previousSelectedPosition);<NEW_LINE>});<NEW_LINE>final String group = items.get(position);<NEW_LINE>holder.groupName.setText(group);<NEW_LINE>holder.pointsCounter.setText(String.valueOf(getCategoryPointsCount(group)));<NEW_LINE>int strokeColor;<NEW_LINE>int strokeWidth;<NEW_LINE>if (selectedItemName != null && selectedItemName.equals(items.get(position))) {<NEW_LINE>strokeColor = ColorUtilities.getActiveColor(app, nightMode);<NEW_LINE>strokeWidth = 2;<NEW_LINE>} else {<NEW_LINE>strokeColor = ContextCompat.getColor(app, nightMode ? R.color.stroked_buttons_and_links_outline_dark : R.color.stroked_buttons_and_links_outline_light);<NEW_LINE>strokeWidth = 1;<NEW_LINE>}<NEW_LINE>GradientDrawable rectContourDrawable = (GradientDrawable) AppCompatResources.getDrawable(app, R.drawable.bg_select_group_button_outline);<NEW_LINE>if (rectContourDrawable != null) {<NEW_LINE>rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, strokeWidth), strokeColor);<NEW_LINE>holder.groupButton.setImageDrawable(rectContourDrawable);<NEW_LINE>}<NEW_LINE>int color;<NEW_LINE>int iconID;<NEW_LINE>if (isCategoryVisible(group)) {<NEW_LINE>int categoryColor = getCategoryColor(group);<NEW_LINE>color = categoryColor == 0 ? getDefaultColor() : categoryColor;<NEW_LINE>iconID = R.drawable.ic_action_folder;<NEW_LINE>holder.groupName.setTypeface(null, Typeface.NORMAL);<NEW_LINE>} else {<NEW_LINE>color = ContextCompat.getColor(app, R.color.text_color_secondary_light);<NEW_LINE>iconID = R.drawable.ic_action_hide;<NEW_LINE>holder.groupName.setTypeface(null, Typeface.ITALIC);<NEW_LINE>}<NEW_LINE>holder.groupIcon.setImageDrawable(UiUtilities.tintDrawable(AppCompatResources.getDrawable(app, iconID), color));<NEW_LINE>}<NEW_LINE>AndroidUtils.setBackground(app, holder.groupButton, nightMode, R.drawable.<MASK><NEW_LINE>} | ripple_solid_light_6dp, R.drawable.ripple_solid_dark_6dp); |
593,979 | public static void collectOverlayQuads(@Nonnull ModelBakeEvent event) {<NEW_LINE>final Block block = ModObject.block_machine_io.getBlockNN();<NEW_LINE>Map<IBlockState, ModelResourceLocation> locations = event.getModelManager().getBlockModelShapes().getBlockStateMapper().getVariants(block);<NEW_LINE>NNIterator<IOMode> modes = crazypants.enderio.base.render.property.IOMode.MODES.iterator();<NEW_LINE>while (modes.hasNext()) {<NEW_LINE><MASK><NEW_LINE>IBlockState state = block.getDefaultState().withProperty(IOMode.IO, mode);<NEW_LINE>ModelResourceLocation mrl = locations.get(state);<NEW_LINE>if (mrl == null) {<NEW_LINE>throw new RuntimeException("Model for state " + state + " failed to load from " + mrl + ". ");<NEW_LINE>}<NEW_LINE>IBakedModel model = event.getModelRegistry().getObject(mrl);<NEW_LINE>if (model == null) {<NEW_LINE>Log.warn("Model for state " + state + " failed to load from " + mrl + ".");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>QuadCollector quads = new QuadCollector();<NEW_LINE>BlockRenderLayer oldRenderLayer = MinecraftForgeClient.getRenderLayer();<NEW_LINE>BlockRenderLayer layer = block.getBlockLayer();<NEW_LINE>ForgeHooksClient.setRenderLayer(layer);<NEW_LINE>List<BakedQuad> generalQuads = model.getQuads(state, null, 0);<NEW_LINE>if (!generalQuads.isEmpty()) {<NEW_LINE>quads.addQuads(null, layer, generalQuads);<NEW_LINE>}<NEW_LINE>for (EnumFacing face1 : EnumFacing.values()) {<NEW_LINE>List<BakedQuad> faceQuads = model.getQuads(state, mode.getDirection(), 0);<NEW_LINE>if (!faceQuads.isEmpty()) {<NEW_LINE>quads.addQuads(face1, layer, faceQuads);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ForgeHooksClient.setRenderLayer(oldRenderLayer);<NEW_LINE>data[mode.getDirection().ordinal()][mode.getIomode().ordinal()] = quads;<NEW_LINE>}<NEW_LINE>} | IOMode mode = modes.next(); |
49,108 | private static Map<String, Tuple<String, List<Tuple<String, Supplier<DiscoveryNode>>>>> buildRemoteClustersDynamicConfig(final Settings settings, final Setting.AffixSetting<List<String>> seedsSetting) {<NEW_LINE>final Stream<Setting<List<String>>> allConcreteSettings = seedsSetting.getAllConcreteSettings(settings);<NEW_LINE>return allConcreteSettings.collect(Collectors.toMap(seedsSetting::getNamespace, concreteSetting -> {<NEW_LINE>String clusterName = seedsSetting.getNamespace(concreteSetting);<NEW_LINE>List<String> addresses = concreteSetting.get(settings);<NEW_LINE>final boolean proxyMode = REMOTE_CLUSTERS_PROXY.getConcreteSettingForNamespace(clusterName).existsOrFallbackExists(settings);<NEW_LINE>List<Tuple<String, Supplier<DiscoveryNode>>> nodes = new ArrayList<>(addresses.size());<NEW_LINE>for (String address : addresses) {<NEW_LINE>nodes.add(Tuple.tuple(address, () -> buildSeedNode(clusterName, address, proxyMode)));<NEW_LINE>}<NEW_LINE>return new Tuple<>(REMOTE_CLUSTERS_PROXY.getConcreteSettingForNamespace(clusterName)<MASK><NEW_LINE>}));<NEW_LINE>} | .get(settings), nodes); |
400,456 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2".split(",");<NEW_LINE>String epl = "@name('s0') select " + "value = all (select sum(intPrimitive) from SupportBean#keepall) as c0, " + "value = any (select sum(intPrimitive) from SupportBean#keepall) as c1, " + "value = some (select sum(intPrimitive) from SupportBean#keepall) as c2 " + "from SupportValueEvent";<NEW_LINE><MASK><NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { null, null, null });<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { true, true, true });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 11));<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { false, false, false });<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeployAddListenerMileZero(epl, "s0"); |
27,798 | /* package */<NEW_LINE>Map<ArrayKey, List<I_AD_Table_ScriptValidator>> retrieveAllTableScriptValidators(@CacheCtx final Properties ctx) {<NEW_LINE>//<NEW_LINE>// Retrieve all table script validators<NEW_LINE>final IQueryBuilder<I_AD_Table_ScriptValidator> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_AD_Table_ScriptValidator.class, ctx, ITrx.TRXNAME_None).addOnlyActiveRecordsFilter();<NEW_LINE>queryBuilder.orderBy().addColumn(I_AD_Table_ScriptValidator.COLUMNNAME_AD_Table_ID).addColumn(I_AD_Table_ScriptValidator.COLUMNNAME_EventModelValidator).addColumn(I_AD_Table_ScriptValidator.COLUMNNAME_SeqNo);<NEW_LINE>final List<I_AD_Table_ScriptValidator> tableModelValidatorsList = queryBuilder.create().list();<NEW_LINE>//<NEW_LINE>// Iterate all of them and group them by AD_Table_ID/EventModelValidator<NEW_LINE>final Map<ArrayKey, List<I_AD_Table_ScriptValidator>> tableModelValidatorsMap = new HashMap<>();<NEW_LINE>ArrayKey currentGroupKey = null;<NEW_LINE>List<I_AD_Table_ScriptValidator> currentGroupValidators = null;<NEW_LINE>for (final I_AD_Table_ScriptValidator tableModelValidator : tableModelValidatorsList) {<NEW_LINE>final ArrayKey key = mkKey(tableModelValidator);<NEW_LINE>if (currentGroupKey == null || !currentGroupKey.equals(key)) {<NEW_LINE>if (currentGroupKey != null) {<NEW_LINE>tableModelValidatorsMap.put(currentGroupKey<MASK><NEW_LINE>currentGroupKey = null;<NEW_LINE>currentGroupValidators = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentGroupKey == null) {<NEW_LINE>currentGroupKey = key;<NEW_LINE>currentGroupValidators = new ArrayList<>();<NEW_LINE>}<NEW_LINE>currentGroupValidators.add(tableModelValidator);<NEW_LINE>}<NEW_LINE>// Add the last group<NEW_LINE>if (currentGroupKey != null) {<NEW_LINE>tableModelValidatorsMap.put(currentGroupKey, Collections.unmodifiableList(currentGroupValidators));<NEW_LINE>currentGroupKey = null;<NEW_LINE>currentGroupValidators = null;<NEW_LINE>}<NEW_LINE>return tableModelValidatorsMap;<NEW_LINE>} | , Collections.unmodifiableList(currentGroupValidators)); |
1,242,846 | public Number parse(String text, ParsePosition parsePosition) {<NEW_LINE>long num = 0;<NEW_LINE>boolean sawNumber = false;<NEW_LINE>boolean negative = false;<NEW_LINE>int base = parsePosition.getIndex();<NEW_LINE>int offset = 0;<NEW_LINE>for (; base + offset < text.length(); offset++) {<NEW_LINE>char ch = text.charAt(base + offset);<NEW_LINE>if (offset == 0 && ch == minusSign) {<NEW_LINE>if (positiveOnly) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>negative = true;<NEW_LINE>} else {<NEW_LINE>int digit = ch - digits[0];<NEW_LINE>if (digit < 0 || 9 < digit) {<NEW_LINE>digit = UCharacter.digit(ch);<NEW_LINE>}<NEW_LINE>if (digit < 0 || 9 < digit) {<NEW_LINE>for (digit = 0; digit < 10; digit++) {<NEW_LINE>if (ch == digits[digit]) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (0 <= digit && digit <= 9 && num < PARSE_THRESHOLD) {<NEW_LINE>sawNumber = true;<NEW_LINE>num = num * 10 + digit;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Number result = null;<NEW_LINE>if (sawNumber) {<NEW_LINE>num = negative ? <MASK><NEW_LINE>result = Long.valueOf(num);<NEW_LINE>parsePosition.setIndex(base + offset);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | num * (-1) : num; |
1,714,921 | public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {<NEW_LINE>if (suppressAllComments) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addJavaDocLine("/**");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addJavaDocLine(" * This method was generated by MyBatis Generator.");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" * This method sets the value of the database column ");<NEW_LINE>sb.append(introspectedTable.getFullyQualifiedTable());<NEW_LINE>sb.append('.');<NEW_LINE>sb.append(introspectedColumn.getActualColumnName());<NEW_LINE>method.addJavaDocLine(sb.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addJavaDocLine(" *");<NEW_LINE>Parameter parm = method.getParameters().get(0);<NEW_LINE>sb.setLength(0);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" * @param ");<NEW_LINE>sb.append(parm.getName());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" the value for ");<NEW_LINE>sb.append(introspectedTable.getFullyQualifiedTable());<NEW_LINE>sb.append('.');<NEW_LINE>sb.<MASK><NEW_LINE>method.addJavaDocLine(sb.toString());<NEW_LINE>addJavadocTag(method, false);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addJavaDocLine(" */");<NEW_LINE>} | append(introspectedColumn.getActualColumnName()); |
1,225,418 | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject(Fields.TRANSPORT);<NEW_LINE>builder.array(Fields.BOUND_ADDRESS, (Object[]) address.boundAddresses());<NEW_LINE>builder.field(Fields.PUBLISH_ADDRESS, formatPublishAddressString("transport.publish_address", address.publishAddress()));<NEW_LINE>builder.startObject(Fields.PROFILES);<NEW_LINE>if (profileAddresses != null && profileAddresses.size() > 0) {<NEW_LINE>for (Map.Entry<String, BoundTransportAddress> entry : profileAddresses.entrySet()) {<NEW_LINE>builder.startObject(entry.getKey());<NEW_LINE>builder.array(Fields.BOUND_ADDRESS, (Object[]) entry.getValue().boundAddresses());<NEW_LINE>String propertyName = "transport." <MASK><NEW_LINE>builder.field(Fields.PUBLISH_ADDRESS, formatPublishAddressString(propertyName, entry.getValue().publishAddress()));<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | + entry.getKey() + ".publish_address"; |
328,842 | final DeleteSchemaResult executeDeleteSchema(DeleteSchemaRequest deleteSchemaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSchemaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSchemaRequest> request = null;<NEW_LINE>Response<DeleteSchemaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSchemaRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSchemaRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "schemas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSchema");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSchemaResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSchemaResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
872,019 | public int compareTo(TSummarizerConfiguration other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetClassname(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetClassname()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.classname, other.classname);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetOptions(), other.isSetOptions());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetOptions()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetConfigId(), other.isSetConfigId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetConfigId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configId, other.configId);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | ), other.isSetClassname()); |
635,413 | public void replaceDexMerge(BaseVariantOutput vod) {<NEW_LINE>List<TransformTask> list = TransformManager.findTransformTaskByTransformType(variantContext, DexMergerTransform.class);<NEW_LINE>DexingType dexingType = variantContext.getScope().getDexingType();<NEW_LINE>if (variantContext.getScope().getInstantRunBuildContext().isInInstantRunMode() && variantContext.getVariantConfiguration().getMinSdkVersion().getApiLevel() < 21) {<NEW_LINE>dexingType = DexingType.LEGACY_MULTIDEX;<NEW_LINE>}<NEW_LINE>DexMergerTool dexMergerTool = variantContext<MASK><NEW_LINE>int sdkVerision = variantContext.getScope().getMinSdkVersion().getFeatureLevel();<NEW_LINE>boolean debug = variantContext.getScope().getVariantConfiguration().getBuildType().isDebuggable();<NEW_LINE>ErrorReporter errorReporter = variantContext.getScope().getGlobalScope().getAndroidBuilder().getErrorReporter();<NEW_LINE>for (TransformTask transformTask : list) {<NEW_LINE>AtlasDexMergerTransform dexMergerTransform = new AtlasDexMergerTransform(variantContext.getAppVariantOutputContext(ApkDataUtils.get(vod)), dexingType, dexingType == DexingType.LEGACY_MULTIDEX ? variantContext.getProject().files(variantContext.getScope().getMainDexListFile()) : null, errorReporter, dexMergerTool, sdkVerision, debug);<NEW_LINE>ReflectUtils.updateField(transformTask, "transform", dexMergerTransform);<NEW_LINE>}<NEW_LINE>} | .getScope().getDexMerger(); |
981,980 | private static String addCommentsToDDL(DBRProgressMonitor monitor, OracleTableBase object, String ddl) {<NEW_LINE>StringBuilder ddlBuilder = new StringBuilder(ddl);<NEW_LINE>String objectFullName = object.getFullyQualifiedName(DBPEvaluationContext.DDL);<NEW_LINE>String objectComment = object.getComment(monitor);<NEW_LINE>if (!CommonUtils.isEmpty(objectComment)) {<NEW_LINE>String objectTypeName = "TABLE";<NEW_LINE>if (object instanceof OracleMaterializedView) {<NEW_LINE>objectTypeName = "MATERIALIZED VIEW";<NEW_LINE>}<NEW_LINE>ddlBuilder.append("\n\n").append("COMMENT ON ").append(objectTypeName).append(" ").append(objectFullName).append(" IS ").append(SQLUtils.quoteString(object.getDataSource(), objectComment)).append(SQLConstants.DEFAULT_STATEMENT_DELIMITER);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<OracleTableColumn> attributes = object.getAttributes(monitor);<NEW_LINE>if (!CommonUtils.isEmpty(attributes)) {<NEW_LINE>List<DBEPersistAction> actions = new ArrayList<>();<NEW_LINE>if (CommonUtils.isEmpty(objectComment)) {<NEW_LINE>ddlBuilder.append("\n");<NEW_LINE>}<NEW_LINE>for (OracleTableColumn column : CommonUtils.safeCollection(attributes)) {<NEW_LINE>String columnComment = column.getComment(monitor);<NEW_LINE>if (!CommonUtils.isEmpty(columnComment)) {<NEW_LINE>OracleTableColumnManager.addColumnCommentAction(actions, column, column.getTable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!CommonUtils.isEmpty(actions)) {<NEW_LINE>for (DBEPersistAction action : actions) {<NEW_LINE>ddlBuilder.append("\n").append(action.getScript()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (DBException e) {<NEW_LINE>log.debug("Error reading object columns", e);<NEW_LINE>}<NEW_LINE>return ddlBuilder.toString();<NEW_LINE>} | ).append(SQLConstants.DEFAULT_STATEMENT_DELIMITER); |
1,489,917 | private void addCell(TableRowBox row, TableCellBox cell, int cRow) {<NEW_LINE>int rSpan = cell.getStyle().getRowSpan();<NEW_LINE>int cSpan = cell.getStyle().getColSpan();<NEW_LINE>List<ColumnData> columns = getTable().getColumns();<NEW_LINE>int nCols = columns.size();<NEW_LINE>int cCol = 0;<NEW_LINE>ensureRows(cRow + rSpan);<NEW_LINE>while (cCol < nCols && cellAt(cRow, cCol) != null) {<NEW_LINE>cCol++;<NEW_LINE>}<NEW_LINE>int col = cCol;<NEW_LINE>TableCellBox set = cell;<NEW_LINE>while (cSpan > 0) {<NEW_LINE>int currentSpan;<NEW_LINE>while (cCol >= getTable().getColumns().size()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ColumnData cData = columns.get(cCol);<NEW_LINE>if (cSpan < cData.getSpan()) {<NEW_LINE>getTable().splitColumn(cCol, cSpan);<NEW_LINE>}<NEW_LINE>cData = columns.get(cCol);<NEW_LINE>currentSpan = cData.getSpan();<NEW_LINE>int r = 0;<NEW_LINE>while (r < rSpan) {<NEW_LINE>if (cellAt(cRow + r, cCol) == null) {<NEW_LINE>setCellAt(cRow + r, cCol, set);<NEW_LINE>}<NEW_LINE>r++;<NEW_LINE>}<NEW_LINE>cCol++;<NEW_LINE>cSpan -= currentSpan;<NEW_LINE>set = TableCellBox.SPANNING_CELL;<NEW_LINE>}<NEW_LINE>cell.setRow(cRow);<NEW_LINE>cell.setCol(getTable().effColToCol(col));<NEW_LINE>} | getTable().appendColumn(1); |
1,648,755 | public void visit(BLangWhile whileNode, AnalyzerData data) {<NEW_LINE>SymbolEnv whileEnv = SymbolEnv.createLoopEnv(whileNode, data.env);<NEW_LINE>data.loopAndDoClauseEnvs.add(whileEnv);<NEW_LINE>data.potentiallyInvalidAssignmentInLoopsInfo.add(new PotentiallyInvalidAssignmentInfo(new ArrayList<>(), data.env.enclInvokable));<NEW_LINE>boolean prevStatementReturnsPanicsOrFails = data.statementReturnsPanicsOrFails;<NEW_LINE>boolean prevBreakAsLastStatement = data.breakAsLastStatement;<NEW_LINE>boolean prevContinueAsLastStatement = data.continueAsLastStatement;<NEW_LINE>boolean prevBreakStmtFound = data.breakStmtFound;<NEW_LINE>boolean failureHandled = data.failureHandled;<NEW_LINE>checkStatementExecutionValidity(whileNode, data);<NEW_LINE>if (!data.failureHandled) {<NEW_LINE>data<MASK><NEW_LINE>}<NEW_LINE>incrementLoopCount(data);<NEW_LINE>data.breakStmtFound = false;<NEW_LINE>data.unreachableBlock = data.unreachableBlock || data.booleanConstCondition == symTable.falseType;<NEW_LINE>data.env = whileEnv;<NEW_LINE>analyzeReachability(whileNode.body, data);<NEW_LINE>resetUnreachableBlock(data);<NEW_LINE>resetSkipFurtherAnalysisInUnreachableBlock(data);<NEW_LINE>handlePotentiallyInvalidAssignmentsToTypeNarrowedVariablesInLoop(data.breakAsLastStatement || data.statementReturnsPanicsOrFails, true, data.potentiallyInvalidAssignmentInLoopsInfo);<NEW_LINE>decrementLoopCount(data);<NEW_LINE>data.failureHandled = failureHandled;<NEW_LINE>if (data.booleanConstCondition != symTable.trueType || data.breakStmtFound) {<NEW_LINE>data.statementReturnsPanicsOrFails = prevStatementReturnsPanicsOrFails;<NEW_LINE>data.continueAsLastStatement = prevContinueAsLastStatement;<NEW_LINE>data.breakAsLastStatement = prevBreakAsLastStatement;<NEW_LINE>} else {<NEW_LINE>data.statementReturnsPanicsOrFails = true;<NEW_LINE>}<NEW_LINE>data.breakStmtFound = prevBreakStmtFound;<NEW_LINE>analyzeOnFailClause(whileNode.onFailClause, data);<NEW_LINE>data.loopAndDoClauseEnvs.pop();<NEW_LINE>} | .failureHandled = whileNode.onFailClause != null; |
1,742,682 | public void afterOpcode(int seen) {<NEW_LINE>super.afterOpcode(seen);<NEW_LINE>if (seen == Const.INVOKEINTERFACE || seen == Const.INVOKEVIRTUAL) {<NEW_LINE>if (fieldUnderClone != null) {<NEW_LINE>arrayFieldClones.put(stack.getStackItem(0), fieldUnderClone);<NEW_LINE>}<NEW_LINE>if (paramUnderClone != null) {<NEW_LINE>arrayParamClones.put(stack.getStackItem(0), paramUnderClone);<NEW_LINE>}<NEW_LINE>if (seen == Const.INVOKEVIRTUAL) {<NEW_LINE>if (bufferFieldUnderDuplication != null) {<NEW_LINE>bufferFieldDuplicates.put(stack.getStackItem(0), bufferFieldUnderDuplication);<NEW_LINE>}<NEW_LINE>if (bufferParamUnderDuplication != null) {<NEW_LINE>bufferParamDuplicates.put(stack.getStackItem(0), bufferParamUnderDuplication);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen == Const.INVOKESTATIC) {<NEW_LINE>if (fieldUnderWrapToBuffer != null) {<NEW_LINE>arrayFieldsWrappedToBuffers.put(stack.getStackItem(0), fieldUnderWrapToBuffer);<NEW_LINE>}<NEW_LINE>if (paramUnderWrapToBuffer != null) {<NEW_LINE>arrayParamsWrappedToBuffers.put(stack<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen == Const.CHECKCAST) {<NEW_LINE>OpcodeStack.Item item = stack.getStackItem(0);<NEW_LINE>if (fieldCloneUnderCast != null) {<NEW_LINE>arrayFieldClones.put(item, fieldCloneUnderCast);<NEW_LINE>}<NEW_LINE>if (paramCloneUnderCast != null) {<NEW_LINE>arrayParamClones.put(item, paramCloneUnderCast);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getStackItem(0), paramUnderWrapToBuffer); |
1,342,294 | public static IRubyObject name_list(ThreadContext context, IRubyObject recv) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>EncodingService service = runtime.getEncodingService();<NEW_LINE>RubyArray result = runtime.newArray(service.getEncodings().size() + service.getAliases().size());<NEW_LINE>HashEntryIterator i;<NEW_LINE>i = service.getEncodings().entryIterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>) i.next());<NEW_LINE>result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.<MASK><NEW_LINE>}<NEW_LINE>i = service.getAliases().entryIterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry> e = ((CaseInsensitiveBytesHash.CaseInsensitiveBytesHashEntry<Entry>) i.next());<NEW_LINE>result.append(RubyString.newUsAsciiStringShared(runtime, e.bytes, e.p, e.end - e.p).freeze(context));<NEW_LINE>}<NEW_LINE>result.append(runtime.newString(EXTERNAL));<NEW_LINE>result.append(runtime.newString(FILESYSTEM));<NEW_LINE>result.append(runtime.newString(INTERNAL));<NEW_LINE>result.append(runtime.newString(LOCALE));<NEW_LINE>return result;<NEW_LINE>} | p).freeze(context)); |
1,100,226 | public void writeReference(Reference ref) {<NEW_LINE>out.lf();<NEW_LINE>// Prefix<NEW_LINE>if (!ref.prefix().isEmpty()) {<NEW_LINE>out.escaped(ref.prefix()).lf();<NEW_LINE>}<NEW_LINE>// Authors<NEW_LINE>//<NEW_LINE>// authors<NEW_LINE>out.append(//<NEW_LINE>ref.authors()).// Title<NEW_LINE>lf().append("**").escaped(ref.title()).append("**").lf();<NEW_LINE>// Booktitle<NEW_LINE>if (!ref.booktitle().isEmpty() && !ref.booktitle().equals(ref.url()) && !ref.booktitle().equals("Online")) {<NEW_LINE>out.append(ref.booktitle().startsWith("Online:") ? "" : "In: ").escaped(ref.booktitle()).lf();<NEW_LINE>}<NEW_LINE>// URL<NEW_LINE>if (!ref.url().isEmpty()) {<NEW_LINE>if (ref.url().startsWith(DOIPREFIX)) {<NEW_LINE>//<NEW_LINE>out.append("[DOI:").append(ref.url(), DOIPREFIX.length(), ref.url().length()).append("](").append(ref.url()).append(')').lf();<NEW_LINE>} else {<NEW_LINE>out.append("Online: <").append(ref.url()).<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Bibkey, if we can link to DBLP:<NEW_LINE>if (!ref.bibkey().isEmpty()) {<NEW_LINE>if (ref.bibkey().startsWith(DBLPPREFIX)) {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>out.append("[DBLP:").append(ref.bibkey(), DBLPPREFIX.length(), ref.bibkey().length()).append("](").//<NEW_LINE>append(DBLPURL).append(ref.bibkey(), DBLPPREFIX.length(), ref.bibkey().length()).append(')').lf();<NEW_LINE>} else {<NEW_LINE>out.nl().append("<!-- ").append(ref.bibkey()).append(" -->").lf();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.par();<NEW_LINE>} | append('>').lf(); |
1,508,591 | private boolean isCurrentUserAdminJ() {<NEW_LINE>boolean adm = false;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>setEnvironmentVariable("LANG", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_COLLATE", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_CTYPE", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_MESSAGES", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_MONETARY", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_NUMERIC", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_TIME", <MASK><NEW_LINE>} catch (NativeException e) {<NEW_LINE>LogManager.log(e);<NEW_LINE>}<NEW_LINE>String stdout = SystemUtils.executeCommand("id").getStdOut();<NEW_LINE>Matcher matcher = Pattern.compile("euid=([0-9]+)\\(").matcher(stdout);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>matcher = Pattern.compile("uid=([0-9]+)\\(").matcher(stdout);<NEW_LINE>}<NEW_LINE>if (matcher.find()) {<NEW_LINE>adm = Integer.parseInt(matcher.group(1)) == 0;<NEW_LINE>}<NEW_LINE>} catch (IOException | NumberFormatException e) {<NEW_LINE>LogManager.log(e);<NEW_LINE>}<NEW_LINE>return adm;<NEW_LINE>} | "C", EnvironmentScope.PROCESS, false); |
906,337 | private void maybeInitializeAnimators() {<NEW_LINE>if (animator == null) {<NEW_LINE>// Instantiates an animator with the linear interpolator to control the animation progress.<NEW_LINE>animator = ObjectAnimator.ofFloat(this, ANIMATION_FRACTION, 0, 1);<NEW_LINE>animator.setDuration(TOTAL_DURATION_IN_MS);<NEW_LINE>animator.setInterpolator(null);<NEW_LINE>animator.setRepeatCount(ValueAnimator.INFINITE);<NEW_LINE>animator.addListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationRepeat(Animator animation) {<NEW_LINE>super.onAnimationRepeat(animation);<NEW_LINE>indicatorColorIndex = (indicatorColorIndex + <MASK><NEW_LINE>dirtyColors = true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (completeEndAnimator == null) {<NEW_LINE>completeEndAnimator = ObjectAnimator.ofFloat(this, ANIMATION_FRACTION, 1);<NEW_LINE>completeEndAnimator.setDuration(TOTAL_DURATION_IN_MS);<NEW_LINE>completeEndAnimator.setInterpolator(null);<NEW_LINE>completeEndAnimator.addListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>super.onAnimationEnd(animation);<NEW_LINE>cancelAnimatorImmediately();<NEW_LINE>if (animatorCompleteCallback != null) {<NEW_LINE>animatorCompleteCallback.onAnimationEnd(drawable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | 1) % baseSpec.indicatorColors.length; |
1,522,421 | public IRubyObject squeeze_bang(ThreadContext context, IRubyObject[] args) {<NEW_LINE>if (value.getRealSize() == 0) {<NEW_LINE>modifyCheck();<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>RubyString otherStr = args[0].convertToString();<NEW_LINE>Encoding enc = checkEncoding(otherStr);<NEW_LINE>final boolean[] squeeze = new <MASK><NEW_LINE>StringSupport.TrTables tables = StringSupport.trSetupTable(otherStr.value, runtime, squeeze, null, true, enc);<NEW_LINE>boolean singleByte = singleByteOptimizable() && otherStr.singleByteOptimizable();<NEW_LINE>for (int i = 1; i < args.length; i++) {<NEW_LINE>otherStr = args[i].convertToString();<NEW_LINE>enc = checkEncoding(otherStr);<NEW_LINE>singleByte = singleByte && otherStr.singleByteOptimizable();<NEW_LINE>tables = StringSupport.trSetupTable(otherStr.value, runtime, squeeze, tables, false, enc);<NEW_LINE>}<NEW_LINE>modifyAndKeepCodeRange();<NEW_LINE>if (singleByte) {<NEW_LINE>if (!StringSupport.singleByteSqueeze(value, squeeze)) {<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!StringSupport.multiByteSqueeze(runtime, value, squeeze, tables, enc, true)) {<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | boolean[StringSupport.TRANS_SIZE + 1]; |
680,475 | public List<Interval> inTransaction(Handle handle, TransactionStatus status) {<NEW_LINE>Iterator<Interval> iter = handle.createQuery(StringUtils.format("SELECT start, %2$send%2$s FROM %1$s WHERE dataSource = :dataSource AND " + "%2$send%2$s <= :end AND used = false ORDER BY start, %2$send%2$s", getSegmentsTable(), connector.getQuoteString())).setFetchSize(connector.getStreamingFetchSize()).setMaxRows(limit).bind("dataSource", dataSource).bind("end", maxEndTime.toString()).map(new BaseResultSetMapper<Interval>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Interval mapInternal(int index, Map<String, Object> row) {<NEW_LINE>return new Interval(DateTimes.of((String) row.get("start")), DateTimes.of((String) row.get("end")));<NEW_LINE>}<NEW_LINE>}).iterator();<NEW_LINE>List<Interval> <MASK><NEW_LINE>for (int i = 0; i < limit && iter.hasNext(); i++) {<NEW_LINE>try {<NEW_LINE>result.add(iter.next());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = Lists.newArrayListWithCapacity(limit); |
12,681 | static void branch_counts(int n, /* n = size of alphabet */<NEW_LINE>Token[] tok, ReadOnlyIntArrPointer tree, /* unsigned */<NEW_LINE>int[][] branch_ct, /* unsigned */<NEW_LINE>int[] num_events) {<NEW_LINE>final int tree_len = n - 1;<NEW_LINE>int t = 0;<NEW_LINE>assert (tree_len != 0);<NEW_LINE>do {<NEW_LINE>branch_ct[t][0] = branch_ct[t][1] = 0;<NEW_LINE>} while (++t < tree_len);<NEW_LINE>t = 0;<NEW_LINE>do {<NEW_LINE>int L = tok[t].len;<NEW_LINE>final int enc = tok[t].value;<NEW_LINE>final int /* unsigned */<NEW_LINE>ct = num_events[t];<NEW_LINE>int i = 0;<NEW_LINE>do {<NEW_LINE>final int b = (enc >> --L) & 1;<NEW_LINE>final int j = i >> 1;<NEW_LINE>assert (j < tree_len && 0 <= L);<NEW_LINE>branch_ct[j][b] += ct;<NEW_LINE>i = <MASK><NEW_LINE>} while (i > 0);<NEW_LINE>assert L == 0;<NEW_LINE>} while (++t < n);<NEW_LINE>} | tree.getRel(i + b); |
1,261,008 | private void createConsumerGroupOpt(String masterUrl, String topicName, String consumerGroup, String token, String operator) {<NEW_LINE>LOGGER.info(String.format("begin to create consumer group %s for topic %s in master %s", consumerGroup, topicName, masterUrl));<NEW_LINE>String url = masterUrl + ADD_CONSUMER_PATH + TOPIC_NAME + topicName + GROUP_NAME + consumerGroup + CREATE_USER + operator + CONF_MOD_AUTH_TOKEN + token;<NEW_LINE>try {<NEW_LINE>TubeHttpResponse response = HttpUtils.request(restTemplate, url, HttpMethod.GET, null, new HttpHeaders(), TubeHttpResponse.class);<NEW_LINE>if (response.getErrCode() != SUCCESS_CODE) {<NEW_LINE>String msg = String.format("failed to create tubemq consumer group %s for topic %s, error: %s", consumerGroup, topicName, response.getErrMsg());<NEW_LINE>LOGGER.error(msg + ", url {}", url);<NEW_LINE>throw new BusinessException(msg);<NEW_LINE>}<NEW_LINE>LOGGER.info("success to create tubemq topic {} in {}", topicName, url);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = String.format("failed to create tubemq topic %s in %s", topicName, masterUrl);<NEW_LINE>LOGGER.error(msg, e);<NEW_LINE>throw new BusinessException(msg + <MASK><NEW_LINE>}<NEW_LINE>} | ", error: " + e.getMessage()); |
1,085,642 | public Void visitFieldAccess(RexFieldAccess fieldAccess) {<NEW_LINE>final RexNode ref = fieldAccess.getReferenceExpr();<NEW_LINE>if (ref instanceof RexCorrelVariable) {<NEW_LINE>final RexCorrelVariable var = (RexCorrelVariable) ref;<NEW_LINE>if (mapFieldAccessToCorVar.containsKey(fieldAccess)) {<NEW_LINE>// for cases where different Rel nodes are referring to<NEW_LINE>// same correlation var (e.g. in case of NOT IN)<NEW_LINE>// avoid generating another correlation var<NEW_LINE>// and record the 'rel' is using the same correlation<NEW_LINE>mapRefRelToCorRef.put(rel, mapFieldAccessToCorVar.get(fieldAccess));<NEW_LINE>} else {<NEW_LINE>final CorRef correlation = new CorRef(var.getId(), fieldAccess.getField().getIndex(), corrIdGenerator++);<NEW_LINE><MASK><NEW_LINE>mapRefRelToCorRef.put(rel, correlation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visitFieldAccess(fieldAccess);<NEW_LINE>} | mapFieldAccessToCorVar.put(fieldAccess, correlation); |
845,251 | protected boolean storeCheckpoint(DispatcherState curState, Checkpoint cp, SCN winScn) throws IOException {<NEW_LINE>boolean debugEnabled = _log.isDebugEnabled();<NEW_LINE>if (debugEnabled)<NEW_LINE>_log.debug("About to store checkpoint");<NEW_LINE>boolean success = true;<NEW_LINE>// processBatch - returns false ; then<NEW_LINE>ConsumerCallbackResult callbackResult = getAsyncCallback().onCheckpoint(winScn);<NEW_LINE>boolean persistCheckpoint = !ConsumerCallbackResult.isSkipCheckpoint(callbackResult) && ConsumerCallbackResult.isSuccess(callbackResult);<NEW_LINE>if (persistCheckpoint) {<NEW_LINE>if (null != getCheckpointPersistor()) {<NEW_LINE>getCheckpointPersistor().storeCheckpointV3(getSubsciptionsList(), cp, _registrationId);<NEW_LINE>++_numCheckPoints;<NEW_LINE>}<NEW_LINE>curState.storeCheckpoint(cp, winScn);<NEW_LINE>removeEvents(curState);<NEW_LINE>if (debugEnabled)<NEW_LINE>_log.debug("Checkpoint saved: " + cp.toString());<NEW_LINE>} else {<NEW_LINE>if (debugEnabled)<NEW_LINE>_log.debug(<MASK><NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | "Checkpoint " + cp + " not saved as callback returned " + callbackResult); |
1,193,848 | final PeerVpcResult executePeerVpc(PeerVpcRequest peerVpcRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(peerVpcRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PeerVpcRequest> request = null;<NEW_LINE>Response<PeerVpcResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PeerVpcRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(peerVpcRequest));<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, "Lightsail");<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<PeerVpcResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PeerVpcResultJsonUnmarshaller());<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, "PeerVpc"); |
1,128,391 | private void fireDiagnosticData(IMethodResult result) {<NEW_LINE>if (result == null) {<NEW_LINE>Logger.<MASK><NEW_LINE>} else {<NEW_LINE>if (diagnosticData != null) {<NEW_LINE>HashMap<String, Object> resultMap = new HashMap<String, Object>();<NEW_LINE>resultMap.put(IBatterySingleton.HK_STATE_OF_HEALTH_PERCENT, diagnosticData.batteryStateOfHealth);<NEW_LINE>resultMap.put(IBatterySingleton.HK_BATTERY_CAPACITY_PERCENT, diagnosticData.batteryStateOfCharge);<NEW_LINE>resultMap.put(IBatterySingleton.HK_BATTERY_CAPACITY_MINUTES, diagnosticData.batteryTimeToEmpty);<NEW_LINE>resultMap.put(IBatterySingleton.HK_BATTERY_EXPIRATION_IN_MONTHS, "undefined");<NEW_LINE>resultMap.put(IBatterySingleton.HK_PREVIOUS_BATTERY_REPLACEMENT, diagnosticData.timeSinceBatteryReplaced);<NEW_LINE>resultMap.put(IBatterySingleton.HK_TIME_SINCE_LAST_COLD_BOOT, diagnosticData.timeSinceReboot);<NEW_LINE>resultMap.put(IBatterySingleton.HK_REQUIRED_CHARGE_TIME, diagnosticData.batteryChargingTime);<NEW_LINE>resultMap.put(IBatterySingleton.HK_CHARGING_TIME, diagnosticData.batteryChargingTimeElapsed);<NEW_LINE>result.set(resultMap);<NEW_LINE>} else<NEW_LINE>result.setError("Diagnostic Data is NOT collected");<NEW_LINE>}<NEW_LINE>} | D(TAG, "EMDK fireDiagnosticData result =" + result); |
1,247,760 | final ListResolverQueryLogConfigAssociationsResult executeListResolverQueryLogConfigAssociations(ListResolverQueryLogConfigAssociationsRequest listResolverQueryLogConfigAssociationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listResolverQueryLogConfigAssociationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListResolverQueryLogConfigAssociationsRequest> request = null;<NEW_LINE>Response<ListResolverQueryLogConfigAssociationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListResolverQueryLogConfigAssociationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listResolverQueryLogConfigAssociationsRequest));<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, "Route53Resolver");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListResolverQueryLogConfigAssociations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListResolverQueryLogConfigAssociationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResolverQueryLogConfigAssociationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,699,321 | public void addInterfaceElements(Interface interfaze) {<NEW_LINE>Method method = new Method(introspectedTable.getInsertStatementId());<NEW_LINE>method.setReturnType(FullyQualifiedJavaType.getIntInstance());<NEW_LINE>method.setVisibility(JavaVisibility.PUBLIC);<NEW_LINE>method.setAbstract(true);<NEW_LINE>FullyQualifiedJavaType parameterType;<NEW_LINE>if (isSimple) {<NEW_LINE>parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());<NEW_LINE>} else {<NEW_LINE>parameterType = introspectedTable.getRules().calculateAllFieldsClass();<NEW_LINE>}<NEW_LINE>Set<FullyQualifiedJavaType> <MASK><NEW_LINE>importedTypes.add(parameterType);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addParameter(new Parameter(parameterType, "row"));<NEW_LINE>context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);<NEW_LINE>addMapperAnnotations(method);<NEW_LINE>if (context.getPlugins().clientInsertMethodGenerated(method, interfaze, introspectedTable)) {<NEW_LINE>addExtraImports(interfaze);<NEW_LINE>interfaze.addImportedTypes(importedTypes);<NEW_LINE>interfaze.addMethod(method);<NEW_LINE>}<NEW_LINE>} | importedTypes = new TreeSet<>(); |
1,100,234 | public static Response decrypt(OSCoreCtxDB db, Response response, int requestSequenceNr) throws OSException {<NEW_LINE>LOGGER.info("Removes E options from outer options which are not allowed there");<NEW_LINE>discardEOptions(response);<NEW_LINE>byte[] protectedData = response.getPayload();<NEW_LINE>Encrypt0Message enc = null;<NEW_LINE>Token token = response.getToken();<NEW_LINE>OSCoreCtx ctx = null;<NEW_LINE>OptionSet uOptions = response.getOptions();<NEW_LINE>if (token != null) {<NEW_LINE>ctx = db.getContextByToken(token);<NEW_LINE>if (ctx == null) {<NEW_LINE>LOGGER.error(ErrorDescriptions.TOKEN_INVALID);<NEW_LINE>throw new OSException(ErrorDescriptions.TOKEN_INVALID);<NEW_LINE>}<NEW_LINE>enc = decompression(protectedData, response);<NEW_LINE>} else {<NEW_LINE>LOGGER.error(ErrorDescriptions.TOKEN_NULL);<NEW_LINE>throw new OSException(ErrorDescriptions.TOKEN_NULL);<NEW_LINE>}<NEW_LINE>// Retrieve Context ID (kid context)<NEW_LINE>CBORObject kidContext = enc.findAttribute(CBORObject.FromObject(10));<NEW_LINE>byte[] contextID = null;<NEW_LINE>if (kidContext != null) {<NEW_LINE>contextID = kidContext.GetByteString();<NEW_LINE>}<NEW_LINE>// Perform context re-derivation procedure if ongoing<NEW_LINE>try {<NEW_LINE>ctx = ContextRederivation.incomingResponse(db, ctx, contextID);<NEW_LINE>} catch (OSException e) {<NEW_LINE>LOGGER.error(ErrorDescriptions.CONTEXT_REGENERATION_FAILED);<NEW_LINE>throw new OSException(ErrorDescriptions.CONTEXT_REGENERATION_FAILED);<NEW_LINE>}<NEW_LINE>// Check if parsing of response plaintext succeeds<NEW_LINE>try {<NEW_LINE>byte[] plaintext = decryptAndDecode(<MASK><NEW_LINE>DatagramReader reader = new DatagramReader(new ByteArrayInputStream(plaintext));<NEW_LINE>response = OptionJuggle.setRealCodeResponse(response, CoAP.ResponseCode.valueOf(reader.read(CoAP.MessageFormat.CODE_BITS)));<NEW_LINE>// resets option so eOptions gets priority during parse<NEW_LINE>response.setOptions(EMPTY);<NEW_LINE>new UdpDataParser().parseOptionsAndPayload(reader, response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(ErrorDescriptions.DECRYPTION_FAILED);<NEW_LINE>throw new OSException(ErrorDescriptions.DECRYPTION_FAILED);<NEW_LINE>}<NEW_LINE>OptionSet eOptions = response.getOptions();<NEW_LINE>eOptions = OptionJuggle.merge(eOptions, uOptions);<NEW_LINE>response.setOptions(eOptions);<NEW_LINE>// Remove token after response is received, unless it has Observe<NEW_LINE>// If it has Observe it will be removed after cancellation elsewhere<NEW_LINE>if (response.getOptions().hasObserve() == false) {<NEW_LINE>db.removeToken(token);<NEW_LINE>}<NEW_LINE>// Set information about the OSCORE context used in the endpoint context of this response<NEW_LINE>OSCoreEndpointContextInfo.receivingResponse(ctx, response);<NEW_LINE>return response;<NEW_LINE>} | enc, response, ctx, requestSequenceNr); |
630,101 | public static long[] hash(final long[] key, final int offsetLongs, final int lengthLongs, final long seed) {<NEW_LINE>Objects.requireNonNull(key);<NEW_LINE>final int arrLen = key.length;<NEW_LINE>checkPositive(arrLen);<NEW_LINE>Util.checkBounds(offsetLongs, lengthLongs, arrLen);<NEW_LINE>final HashState hashState = new HashState(seed, seed);<NEW_LINE>// Number of full 128-bit blocks of 2 longs (the body).<NEW_LINE>// Possible exclusion of a remainder of 1 long.<NEW_LINE>// longs / 2<NEW_LINE>final int nblocks = lengthLongs >>> 1;<NEW_LINE>// Process the 128-bit blocks (the body) into the hash<NEW_LINE>for (int i = 0; i < nblocks; i++) {<NEW_LINE>// offsetLongs + 0, 2, 4, ...<NEW_LINE>final long k1 = key[offsetLongs + (i << 1)];<NEW_LINE>// offsetLongs + 1, 3, 5, ...<NEW_LINE>final long k2 = key[offsetLongs + <MASK><NEW_LINE>hashState.blockMix128(k1, k2);<NEW_LINE>}<NEW_LINE>// Get the tail index wrt hashed portion, remainder length<NEW_LINE>// 2 longs / block<NEW_LINE>final int tail = nblocks << 1;<NEW_LINE>// remainder longs: 0,1<NEW_LINE>final int rem = lengthLongs - tail;<NEW_LINE>// Get the tail<NEW_LINE>// k2 -> 0<NEW_LINE>final long k1 = rem == 0 ? 0 : key[offsetLongs + tail];<NEW_LINE>// Mix the tail into the hash and return<NEW_LINE>// convert to bytes<NEW_LINE>return hashState.finalMix128(k1, 0, lengthLongs << 3);<NEW_LINE>} | (i << 1) + 1]; |
582,474 | public UserIdentity login(String username, Object credentials, ServletRequest request) {<NEW_LINE>if (!(credentials instanceof String)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Authenticate WebUser locally using UserAuthenticator. If WebServer is started that guarantees the PLAIN<NEW_LINE>// mechanism is configured and authenticator is also available<NEW_LINE>final AuthenticatorFactory plainFactory = drillbitContext.getAuthProvider().getAuthenticatorFactory(PlainFactory.SIMPLE_NAME);<NEW_LINE>final UserAuthenticator userAuthenticator = ((PlainFactory) plainFactory).getAuthenticator();<NEW_LINE>// Authenticate the user with configured Authenticator<NEW_LINE>userAuthenticator.authenticate(username, credentials.toString());<NEW_LINE>logger.info("WebUser {} logged in from {}:{}", username, request.getRemoteHost(), request.getRemotePort());<NEW_LINE>final <MASK><NEW_LINE>final boolean isAdmin = ImpersonationUtil.hasAdminPrivileges(username, ExecConstants.ADMIN_USERS_VALIDATOR.getAdminUsers(sysOptions), ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.getAdminUserGroups(sysOptions));<NEW_LINE>// Create the UserPrincipal corresponding to logged in user.<NEW_LINE>final Principal userPrincipal = new DrillUserPrincipal(username, isAdmin);<NEW_LINE>final Subject subject = new Subject();<NEW_LINE>subject.getPrincipals().add(userPrincipal);<NEW_LINE>subject.getPrivateCredentials().add(credentials);<NEW_LINE>if (isAdmin) {<NEW_LINE>subject.getPrincipals().addAll(DrillUserPrincipal.ADMIN_PRINCIPALS);<NEW_LINE>return identityService.newUserIdentity(subject, userPrincipal, DrillUserPrincipal.ADMIN_USER_ROLES);<NEW_LINE>} else {<NEW_LINE>subject.getPrincipals().addAll(DrillUserPrincipal.NON_ADMIN_PRINCIPALS);<NEW_LINE>return identityService.newUserIdentity(subject, userPrincipal, DrillUserPrincipal.NON_ADMIN_USER_ROLES);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>if (e instanceof UserAuthenticationException) {<NEW_LINE>logger.debug("Authentication failed for WebUser '{}'", username, e);<NEW_LINE>} else {<NEW_LINE>logger.error("Unexpected failure occurred for WebUser {} during login.", username, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | SystemOptionManager sysOptions = drillbitContext.getOptionManager(); |
359,373 | public void initialize(ServiceConfiguration config) throws IOException {<NEW_LINE>int port = config.port == null ? (config.port = config.secure ? 8883 : 1883) : config.port;<NEW_LINE>// Create MqttBrokerConnection<NEW_LINE>connection = <MASK><NEW_LINE>if (connection != null) {<NEW_LINE>// Close the existing connection and remove it from the service<NEW_LINE>connection.stop();<NEW_LINE>service.removeBrokerConnection(Constants.CLIENTID);<NEW_LINE>}<NEW_LINE>connection = new MqttBrokerConnection("127.0.0.1", config.port, config.secure, Constants.CLIENTID);<NEW_LINE>connection.addConnectionObserver(this);<NEW_LINE>if (config.username != null) {<NEW_LINE>connection.setCredentials(config.username, config.password);<NEW_LINE>}<NEW_LINE>// Start embedded server<NEW_LINE>startEmbeddedServer(port, config.secure, config.username, config.password, config.persistenceFile);<NEW_LINE>} | service.getBrokerConnection(Constants.CLIENTID); |
625,691 | public void install(@NotNull final C component) {<NEW_LINE>super.install(component);<NEW_LINE>// Installing ActionMap<NEW_LINE>final UIActionMap actionMap = new UIActionMap();<NEW_LINE>actionMap.put(new Action(component, Action.RESTORE));<NEW_LINE>actionMap.put(new Action(component, Action.CLOSE));<NEW_LINE>actionMap.put(new Action(component, Action.MOVE));<NEW_LINE>actionMap.put(new Action(component, Action.RESIZE));<NEW_LINE>actionMap.put(new Action(component, Action.LEFT));<NEW_LINE>actionMap.put(new Action(component, Action.SHRINK_LEFT));<NEW_LINE>actionMap.put(new Action(component, Action.RIGHT));<NEW_LINE>actionMap.put(new Action(component, Action.SHRINK_RIGHT));<NEW_LINE>actionMap.put(new Action<MASK><NEW_LINE>actionMap.put(new Action(component, Action.SHRINK_UP));<NEW_LINE>actionMap.put(new Action(component, Action.DOWN));<NEW_LINE>actionMap.put(new Action(component, Action.SHRINK_DOWN));<NEW_LINE>actionMap.put(new Action(component, Action.ESCAPE));<NEW_LINE>actionMap.put(new Action(component, Action.MINIMIZE));<NEW_LINE>actionMap.put(new Action(component, Action.MAXIMIZE));<NEW_LINE>actionMap.put(new Action(component, Action.NEXT_FRAME));<NEW_LINE>actionMap.put(new Action(component, Action.PREVIOUS_FRAME));<NEW_LINE>actionMap.put(new Action(component, Action.NAVIGATE_NEXT));<NEW_LINE>actionMap.put(new Action(component, Action.NAVIGATE_PREVIOUS));<NEW_LINE>SwingUtilities.replaceUIActionMap(component, actionMap);<NEW_LINE>// Installing InputMap<NEW_LINE>final InputMap focusedWindowInputMap = LafLookup.getInputMap(component, JComponent.WHEN_IN_FOCUSED_WINDOW);<NEW_LINE>SwingUtilities.replaceUIInputMap(component, JComponent.WHEN_IN_FOCUSED_WINDOW, focusedWindowInputMap);<NEW_LINE>final InputMap focusedAncestorInputMap = LafLookup.getInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>SwingUtilities.replaceUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, focusedAncestorInputMap);<NEW_LINE>} | (component, Action.UP)); |
1,379,738 | public String loginUser(String username, String password) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'password' is set<NEW_LINE>if (password == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/user/login".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password));<NEW_LINE>final String[] localVarAccepts = { "application/xml", "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<String> localVarReturnType = new GenericType<String>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | HashMap<String, Object>(); |
928,175 | public boolean verifyMembers(boolean debugVerification) {<NEW_LINE>List<String> verificationProblems = new ArrayList<>();<NEW_LINE>// Fields<NEW_LINE>Set<String> typesInSignature = null;<NEW_LINE>List<Field> fields = getFields();<NEW_LINE>for (Field field : fields) {<NEW_LINE>typesInSignature = field.getTypesInSignature();<NEW_LINE>for (String type : typesInSignature) {<NEW_LINE>while (type.endsWith("[]")) {<NEW_LINE>type = type.substring(0, type.length() - 2);<NEW_LINE>}<NEW_LINE>if (typeSystem.isVoidOrPrimitive(type))<NEW_LINE>continue;<NEW_LINE>Type resolved = typeSystem.resolveSlashed(type, true);<NEW_LINE>if (resolved == null) {<NEW_LINE>verificationProblems.add("Cannot resolve " + type + " in signature of field " + field.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Methods<NEW_LINE>List<MASK><NEW_LINE>for (Method method : methods) {<NEW_LINE>typesInSignature = method.getTypesInSignature();<NEW_LINE>for (String type : typesInSignature) {<NEW_LINE>while (type.endsWith("[]")) {<NEW_LINE>type = type.substring(0, type.length() - 2);<NEW_LINE>}<NEW_LINE>if (typeSystem.isVoidOrPrimitive(type))<NEW_LINE>continue;<NEW_LINE>Type resolved = typeSystem.resolveSlashed(type, true);<NEW_LINE>if (resolved == null) {<NEW_LINE>verificationProblems.add("Cannot resolve " + type + " in signature of method " + method.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (verificationProblems.size() != 0) {<NEW_LINE>if (debugVerification) {<NEW_LINE>logger.warn("Failed verification check: problems with members of " + getDottedName() + "\n" + verificationProblems);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return verificationProblems.isEmpty();<NEW_LINE>} | <Method> methods = getMethods(); |
1,375,855 | private static CigarBuilder.Result trimCigar(final Cigar cigar, final int start, final int end, final boolean byReference) {<NEW_LINE>ParamUtils.isPositiveOrZero(start, "start position can't be negative");<NEW_LINE>Utils.validateArg(end >= start, () -> "end " + end + " is before start " + start);<NEW_LINE>final CigarBuilder newElements = new CigarBuilder();<NEW_LINE>// these variables track the inclusive start and exclusive end of the current cigar element in reference (if byReference) or read (otherwise) coordinates<NEW_LINE>// inclusive<NEW_LINE>int elementStart;<NEW_LINE>// exclusive -- start of next element<NEW_LINE>int elementEnd = 0;<NEW_LINE>for (final CigarElement elt : cigar.getCigarElements()) {<NEW_LINE>elementStart = elementEnd;<NEW_LINE>elementEnd = elementStart + (byReference ? lengthOnReference(<MASK><NEW_LINE>// we are careful to include zero-length elements at both ends, that is, elements with elementStart == elementEnd == start and elementStart == elementEnd == end + 1<NEW_LINE>if (elementEnd < start || (elementEnd == start && elementStart < start)) {<NEW_LINE>continue;<NEW_LINE>} else if (elementStart > end && elementEnd > end + 1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final int overlapLength = elementEnd == elementStart ? elt.getLength() : Math.min(end + 1, elementEnd) - Math.max(start, elementStart);<NEW_LINE>newElements.add(new CigarElement(overlapLength, elt.getOperator()));<NEW_LINE>}<NEW_LINE>Utils.validateArg(elementEnd > end, () -> "cigar elements don't reach end position (inclusive) " + end);<NEW_LINE>return newElements.makeAndRecordDeletionsRemovedResult();<NEW_LINE>} | elt) : lengthOnRead(elt)); |
119,182 | public GetDataflowGraphResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDataflowGraphResult getDataflowGraphResult = new GetDataflowGraphResult();<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 getDataflowGraphResult;<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("DagNodes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDataflowGraphResult.setDagNodes(new ListUnmarshaller<CodeGenNode>(CodeGenNodeJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DagEdges", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDataflowGraphResult.setDagEdges(new ListUnmarshaller<CodeGenEdge>(CodeGenEdgeJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getDataflowGraphResult;<NEW_LINE>} | )).unmarshall(context)); |
1,832,050 | protected synchronized // the respective internal or external data.<NEW_LINE>void ensureExternalResults() {<NEW_LINE>String methodName = "ensureExternalResults";<NEW_LINE>if (externalTable != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, methodName, "ENTER [ {0} ]", getHashName());<NEW_LINE>}<NEW_LINE>ensureInternalResults();<NEW_LINE>TargetsScannerOverallImpl useOverallScanner = overallScanner;<NEW_LINE>overallScanner = null;<NEW_LINE>useOverallScanner.validExternal();<NEW_LINE>externalTable = useOverallScanner.getExternalTable();<NEW_LINE>long cacheReadTime = useOverallScanner.getCacheReadTime();<NEW_LINE>long cacheWriteTime = useOverallScanner.getCacheWriteTime();<NEW_LINE>long containerReadTime = useOverallScanner.getContainerReadTime();<NEW_LINE>long containerWriteTime = useOverallScanner.getContainerWriteTime();<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, methodName, "Cache Read [ {0} (ms)", Long.valueOf(cacheReadTime / NS_IN_MS));<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, methodName, "Cache Write [ {0} (ms)", Long.valueOf(cacheWriteTime / NS_IN_MS));<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, methodName, "Container Read [ {0} (ms)", Long.valueOf(containerReadTime / NS_IN_MS));<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, methodName, "Container Write [ {0} (ms)", Long.valueOf(containerWriteTime / NS_IN_MS));<NEW_LINE>}<NEW_LINE>ClassSource_Aggregate useRootClassSource = useOverallScanner.getRootClassSource();<NEW_LINE>useRootClassSource.addCacheReadTime(cacheReadTime, "Module Reads");<NEW_LINE>useRootClassSource.addCacheReadTime(containerReadTime, "Container Reads");<NEW_LINE>useRootClassSource.addCacheWriteTime(cacheWriteTime, "Module Writes");<NEW_LINE>useRootClassSource.addCacheWriteTime(containerWriteTime, "Container Writes");<NEW_LINE>// The class table was already set during internal processing.<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, <MASK><NEW_LINE>}<NEW_LINE>} | methodName, "RETURN [ {0} ]", getHashName()); |
445,380 | private ArrayList<ClusterCandidate> hardClustering(WritableDataStore<double[]> probClusterIGivenX, List<Signature> clusterCores, DBIDs dbids) {<NEW_LINE>final <MASK><NEW_LINE>// Initialize cluster sets.<NEW_LINE>ArrayList<ClusterCandidate> candidates = new ArrayList<>();<NEW_LINE>for (Signature sig : clusterCores) {<NEW_LINE>candidates.add(new ClusterCandidate(sig));<NEW_LINE>}<NEW_LINE>// Perform hard partitioning, assigning each data point only to one cluster,<NEW_LINE>// namely that one it is most likely to belong to.<NEW_LINE>for (DBIDIter iter = dbids.iter(); iter.valid(); iter.advance()) {<NEW_LINE>final double[] probs = probClusterIGivenX.get(iter);<NEW_LINE>int bestCluster = 0;<NEW_LINE>double bestProbability = probs[0];<NEW_LINE>for (int c = 1; c < k; ++c) {<NEW_LINE>if (probs[c] > bestProbability) {<NEW_LINE>bestCluster = c;<NEW_LINE>bestProbability = probs[c];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>candidates.get(bestCluster).ids.add(iter);<NEW_LINE>}<NEW_LINE>return candidates;<NEW_LINE>} | int k = clusterCores.size(); |
747,950 | public ResourceDefinitionVersion unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ResourceDefinitionVersion resourceDefinitionVersion = new ResourceDefinitionVersion();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Resources", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceDefinitionVersion.setResources(new ListUnmarshaller<Resource>(ResourceJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceDefinitionVersion;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
421,545 | protected String doIt() {<NEW_LINE>final PPOrderLineRow ppOrderLineRow = getSingleSelectedRow();<NEW_LINE>final PPOrderBOMLineId ppOrderBomLineId = ppOrderLineRow.getOrderBOMLineId();<NEW_LINE>final ViewId ppOrderLineViewId = getView().getViewId();<NEW_LINE>final List<HuId> availableHUsIDs = retrieveHuIdsToShowInEditor(ppOrderBomLineId);<NEW_LINE>final IView husToPickView = getViewsRepo().createView(CreateViewRequest.builder(WEBUI_HU_Constants.WEBUI_HU_Window_ID, JSONViewDataType.includedView).setParentViewId(ppOrderLineViewId).setParentRowId(ppOrderLineRow.getId()).addStickyFilters(HUIdsFilterHelper.createFilter(availableHUsIDs)).addAdditionalRelatedProcessDescriptor(createIssueTopLevelHusDescriptor()).addAdditionalRelatedProcessDescriptor(createIssueTUsDescriptor()).addAdditionalRelatedProcessDescriptor(createSelectHuAsSourceHuDescriptor<MASK><NEW_LINE>getResult().setWebuiViewToOpen(WebuiViewToOpen.builder().viewId(husToPickView.getViewId().getViewId()).target(ViewOpenTarget.IncludedView).build());<NEW_LINE>return MSG_OK;<NEW_LINE>} | ()).build()); |
645,028 | public void closing(CommandContext commandContext) {<NEW_LINE>// This logic needs to be done before the dbSqlSession is flushed<NEW_LINE>// which means it can't be done in the transaction pre-commit<NEW_LINE>Map<JobServiceConfiguration, AsyncHistorySessionData> sessionData = asyncHistorySession.getSessionData();<NEW_LINE>if (sessionData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (JobServiceConfiguration jobServiceConfiguration : sessionData.keySet()) {<NEW_LINE>Map<String, List<ObjectNode>> jobData = sessionData.get(jobServiceConfiguration).getJobData();<NEW_LINE>if (!jobData.isEmpty()) {<NEW_LINE>List<ObjectNode> <MASK><NEW_LINE>// First, the registered types<NEW_LINE>for (String type : asyncHistorySession.getJobDataTypes()) {<NEW_LINE>if (jobData.containsKey(type)) {<NEW_LINE>generateJson(jobServiceConfiguration, jobData, objectNodes, type);<NEW_LINE>jobData.remove(type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Additional data for which the type is not registered<NEW_LINE>if (!jobData.isEmpty()) {<NEW_LINE>for (String type : jobData.keySet()) {<NEW_LINE>generateJson(jobServiceConfiguration, jobData, objectNodes, type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// History job needs to be created in the context of which it originated<NEW_LINE>asyncHistoryListener.historyDataGenerated(jobServiceConfiguration, objectNodes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | objectNodes = new ArrayList<>(); |
1,041,114 | public static void deleteProject(String project, boolean waitStatus) {<NEW_LINE>new DeleteAction().performAPI(ProjectsTabOperator.invoke().getProjectRootNode(project));<NEW_LINE>// delete project<NEW_LINE>// NOI18N<NEW_LINE>NbDialogOperator deleteProject = new NbDialogOperator("Delete Project");<NEW_LINE>JCheckBoxOperator delete_sources = new JCheckBoxOperator(deleteProject);<NEW_LINE>if (delete_sources.isEnabled())<NEW_LINE>delete_sources.changeSelection(true);<NEW_LINE>deleteProject.yes();<NEW_LINE>waitForPendingBackgroundTasks();<NEW_LINE>if (waitStatus)<NEW_LINE>// NOI18N<NEW_LINE>MainWindowOperator.getDefault().<MASK><NEW_LINE>try {<NEW_LINE>// sometimes dialog rises<NEW_LINE>// NOI18N<NEW_LINE>new NbDialogOperator("Question").yes();<NEW_LINE>} catch (Exception exc) {<NEW_LINE>System.err.println("No Question dialog rises - no problem this is just workarround!");<NEW_LINE>exc.printStackTrace(System.err);<NEW_LINE>}<NEW_LINE>} | waitStatusText("Finished building " + project + " (clean)"); |
764,025 | public static void tearDown() throws Exception {<NEW_LINE>try {<NEW_LINE>// Clean up database<NEW_LINE>try {<NEW_LINE>final Set<String> ddlSet <MASK><NEW_LINE>for (String ddlName : dropSet) {<NEW_LINE>ddlSet.add(ddlName.replace("${dbvendor}", getDbVendor().name()));<NEW_LINE>}<NEW_LINE>executeDDL(server, ddlSet, true);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>// From Eclipselink drop-and-create tables option<NEW_LINE>// From Eclipselink drop-and-create tables option<NEW_LINE>server.// From Eclipselink drop-and-create tables option<NEW_LINE>stopServer(// RuntimeException test, expected<NEW_LINE>"CWWJP9991W", "WTRN0074E: Exception caught from before_completion synchronization operation");<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>ServerConfiguration sc = server.getServerConfiguration();<NEW_LINE>sc.getApplications().clear();<NEW_LINE>server.updateServerConfiguration(sc);<NEW_LINE>server.saveServerConfiguration();<NEW_LINE>server.deleteFileFromLibertyServerRoot("apps/" + appNameEar);<NEW_LINE>server.deleteFileFromLibertyServerRoot("apps/DatabaseManagement.war");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>bannerEnd(JPA10EmbeddableBasic_EJB.class, timestart);<NEW_LINE>}<NEW_LINE>} | = new HashSet<String>(); |
572,226 | public static void launchQuPath(HostServices hostServices, boolean isSwing) {<NEW_LINE>QuPathGUI instance = getInstance();<NEW_LINE>if (instance != null) {<NEW_LINE>logger.info("Request to launch QuPath - will try to show existing instance instead");<NEW_LINE>if (Platform.isFxApplicationThread())<NEW_LINE>instance.getStage().show();<NEW_LINE>else {<NEW_LINE>Platform.runLater(() -> instance.getStage().show());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Platform.isFxApplicationThread()) {<NEW_LINE>System.out.println("Launching new QuPath instance...");<NEW_LINE>logger.info("Launching new QuPath instance...");<NEW_LINE>Stage stage = new Stage();<NEW_LINE>QuPathGUI qupath = new QuPathGUI(hostServices, stage, (String) null, false, false);<NEW_LINE>qupath.getStage().show();<NEW_LINE>System.out.println("Done!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("QuPath launch requested in " + Thread.currentThread());<NEW_LINE>if (isSwing) {<NEW_LINE>// If we are starting from a Swing application, try to ensure we are on the correct thread<NEW_LINE>// (This can be particularly important on macOS)<NEW_LINE>if (SwingUtilities.isEventDispatchThread()) {<NEW_LINE>System.out.println("Initializing with JFXPanel...");<NEW_LINE>// To initialize<NEW_LINE>new JFXPanel();<NEW_LINE>Platform.runLater(() -> launchQuPath(hostServices, true));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>SwingUtilities.invokeLater(() -> launchQuPath(hostServices, true));<NEW_LINE>// Required to be able to restart QuPath... or probably any JavaFX application<NEW_LINE>Platform.setImplicitExit(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>// This will fail if already started... but unfortunately there is no method to query if this is the case<NEW_LINE>System.out.println("Calling Platform.startup()...");<NEW_LINE>Platform.startup(() -> launchQuPath(hostServices, false));<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("If JavaFX is initialized, be sure to call launchQuPath() on the Application thread!");<NEW_LINE><MASK><NEW_LINE>Platform.runLater(() -> launchQuPath(hostServices, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.out.println("Calling Platform.runLater()..."); |
1,569,028 | private void refillDocs() throws IOException {<NEW_LINE>final int left = docFreq - blockUpto;<NEW_LINE>assert left >= 0;<NEW_LINE>if (left >= BLOCK_SIZE) {<NEW_LINE>pforUtil.decodeAndPrefixSum(docIn, accum, docBuffer);<NEW_LINE>pforUtil.decode(docIn, freqBuffer);<NEW_LINE>blockUpto += BLOCK_SIZE;<NEW_LINE>} else if (docFreq == 1) {<NEW_LINE>docBuffer[0] = singletonDocID;<NEW_LINE>freqBuffer[0] = totalTermFreq;<NEW_LINE>docBuffer[1] = NO_MORE_DOCS;<NEW_LINE>blockUpto++;<NEW_LINE>} else {<NEW_LINE>readVIntBlock(docIn, <MASK><NEW_LINE>prefixSum(docBuffer, left, accum);<NEW_LINE>docBuffer[left] = NO_MORE_DOCS;<NEW_LINE>blockUpto += left;<NEW_LINE>}<NEW_LINE>accum = docBuffer[BLOCK_SIZE - 1];<NEW_LINE>docBufferUpto = 0;<NEW_LINE>assert docBuffer[BLOCK_SIZE] == NO_MORE_DOCS;<NEW_LINE>} | docBuffer, freqBuffer, left, true); |
371,422 | public Map<String, Object> queryProcessInstanceById(User loginUser, long projectCode, Integer processId) {<NEW_LINE>Project <MASK><NEW_LINE>// check user access for project<NEW_LINE>Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode);<NEW_LINE>if (result.get(Constants.STATUS) != Status.SUCCESS) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>ProcessInstance processInstance = processService.findProcessInstanceDetailById(processId);<NEW_LINE>ProcessDefinition processDefinition = processService.findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion());<NEW_LINE>if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {<NEW_LINE>putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processId);<NEW_LINE>} else {<NEW_LINE>processInstance.setWarningGroupId(processDefinition.getWarningGroupId());<NEW_LINE>processInstance.setLocations(processDefinition.getLocations());<NEW_LINE>processInstance.setDagData(processService.genDagData(processDefinition));<NEW_LINE>result.put(DATA_LIST, processInstance);<NEW_LINE>putMsg(result, Status.SUCCESS);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | project = projectMapper.queryByCode(projectCode); |
166,190 | public void addElements(XmlElement parentElement) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement answer = new XmlElement("update");<NEW_LINE>answer.addAttribute(new // $NON-NLS-1$<NEW_LINE>Attribute(// $NON-NLS-1$<NEW_LINE>"id", introspectedTable.getUpdateByPrimaryKeySelectiveStatementId()));<NEW_LINE>String parameterType;<NEW_LINE>if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {<NEW_LINE>parameterType = introspectedTable.getRecordWithBLOBsType();<NEW_LINE>} else {<NEW_LINE>parameterType = introspectedTable.getBaseRecordType();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>answer.addAttribute(new Attribute("parameterType", parameterType));<NEW_LINE>context.getCommentGenerator().addComment(answer);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("update ");<NEW_LINE>sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime());<NEW_LINE>answer.addElement(new TextElement<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement dynamicElement = new XmlElement("set");<NEW_LINE>answer.addElement(dynamicElement);<NEW_LINE>for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())) {<NEW_LINE>sb.setLength(0);<NEW_LINE>sb.append(introspectedColumn.getJavaProperty());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" != null");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>XmlElement isNotNullElement = new XmlElement("if");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>isNotNullElement.addAttribute(new Attribute("test", sb.toString()));<NEW_LINE>dynamicElement.addElement(isNotNullElement);<NEW_LINE>sb.setLength(0);<NEW_LINE>sb.append(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" = ");<NEW_LINE>sb.append(MyBatis3FormattingUtilities.getParameterClause(introspectedColumn));<NEW_LINE>sb.append(',');<NEW_LINE>isNotNullElement.addElement(new TextElement(sb.toString()));<NEW_LINE>}<NEW_LINE>buildPrimaryKeyWhereClause().forEach(answer::addElement);<NEW_LINE>if (context.getPlugins().sqlMapUpdateByPrimaryKeySelectiveElementGenerated(answer, introspectedTable)) {<NEW_LINE>parentElement.addElement(answer);<NEW_LINE>}<NEW_LINE>} | (sb.toString())); |
706,493 | public Map<String, BlobMetaData> listBlobsByPrefix(String account, String container, String keyPath, String prefix) throws URISyntaxException, StorageException, IOException {<NEW_LINE>// NOTE: this should be here: if (prefix == null) prefix = "";<NEW_LINE>// however, this is really inefficient since deleteBlobsByPrefix enumerates everything and<NEW_LINE>// then does a prefix match on the result; it should just call listBlobsByPrefix with the prefix!<NEW_LINE>final MapBuilder<String, BlobMetaData> blobsBuilder = MapBuilder.newMapBuilder();<NEW_LINE>final EnumSet<BlobListingDetails> enumBlobListingDetails = EnumSet.of(BlobListingDetails.METADATA);<NEW_LINE>final Tuple<CloudBlobClient, Supplier<OperationContext>> client = client(account);<NEW_LINE>final CloudBlobContainer blobContainer = client.v1().getContainerReference(container);<NEW_LINE>logger.trace(() -> new ParameterizedMessage("listing container [{}], keyPath [{}], prefix [{}]", container, keyPath, prefix));<NEW_LINE>SocketAccess.doPrivilegedVoidException(() -> {<NEW_LINE>for (final ListBlobItem blobItem : blobContainer.listBlobs(keyPath + (prefix == null ? "" : prefix), false, enumBlobListingDetails, null, client.v2().get())) {<NEW_LINE>final <MASK><NEW_LINE>logger.trace(() -> new ParameterizedMessage("blob url [{}]", uri));<NEW_LINE>// uri.getPath is of the form /container/keyPath.* and we want to strip off the /container/<NEW_LINE>// this requires 1 + container.length() + 1, with each 1 corresponding to one of the /<NEW_LINE>final String blobPath = uri.getPath().substring(1 + container.length() + 1);<NEW_LINE>final BlobProperties properties = ((CloudBlockBlob) blobItem).getProperties();<NEW_LINE>final String name = blobPath.substring(keyPath.length());<NEW_LINE>logger.trace(() -> new ParameterizedMessage("blob url [{}], name [{}], size [{}]", uri, name, properties.getLength()));<NEW_LINE>blobsBuilder.put(name, new PlainBlobMetaData(name, properties.getLength()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return blobsBuilder.immutableMap();<NEW_LINE>} | URI uri = blobItem.getUri(); |
1,599,769 | public NToken sign(PrivateKey privateKey) {<NEW_LINE>// See https://github.com/AthenZ/athenz/blob/master/libs/go/zmssvctoken/token.go<NEW_LINE>var generationTime = clock.instant();<NEW_LINE>token.setLength(0);<NEW_LINE>append('v', "S1");<NEW_LINE>append('d', domain);<NEW_LINE>append('n', name);<NEW_LINE>append('k', keyVersion);<NEW_LINE>append('z', keyService, false);<NEW_LINE>append('h', hostname, false);<NEW_LINE>append('i', ip, false);<NEW_LINE>append('a', format("%x", randomGenerator.getAsLong()));<NEW_LINE>append('t', format("%d", generationTime.getEpochSecond()));<NEW_LINE>append('e', format("%d", generationTime.plus(Duration.ofMinutes(10)).getEpochSecond()));<NEW_LINE>append('s', signer.sign(token<MASK><NEW_LINE>return new NToken(token.toString());<NEW_LINE>} | .toString(), privateKey)); |
1,334,844 | public net.osmand.binary.OsmandOdb.TransportRouteScheduleException buildPartial() {<NEW_LINE>net.osmand.binary.OsmandOdb.TransportRouteScheduleException result = new net.osmand.binary.OsmandOdb.TransportRouteScheduleException(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>tripIndexes_ = java.util.Collections.unmodifiableList(tripIndexes_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.tripIndexes_ = tripIndexes_;<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>stopIndexes_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.stopIndexes_ = stopIndexes_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.available_ = available_;<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>delayArrival_ = java.util.Collections.unmodifiableList(delayArrival_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.delayArrival_ = delayArrival_;<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>deltaWaitInterval_ = java.util.Collections.unmodifiableList(deltaWaitInterval_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000010);<NEW_LINE>}<NEW_LINE>result.deltaWaitInterval_ = deltaWaitInterval_;<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>dayOfWeekRestriction_ = java.util.Collections.unmodifiableList(dayOfWeekRestriction_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.dayOfWeekRestriction_ = dayOfWeekRestriction_;<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>dayOfYearRestriction_ = java.util.Collections.unmodifiableList(dayOfYearRestriction_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>}<NEW_LINE>result.dayOfYearRestriction_ = dayOfYearRestriction_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | util.Collections.unmodifiableList(stopIndexes_); |
219,703 | public int argb() {<NEW_LINE>if (mAlpha <= 0 || mAlpha > 254) {<NEW_LINE>return mTargetColor.argb();<NEW_LINE>}<NEW_LINE>int baseArgb = mBaseColor.argb();<NEW_LINE>int targetArgb = mTargetColor.argb();<NEW_LINE>int r1 = android.graphics.Color.red(baseArgb);<NEW_LINE>int g1 = android.graphics.Color.green(baseArgb);<NEW_LINE>int b1 = android.graphics.Color.blue(baseArgb);<NEW_LINE>int r3 = android.graphics.Color.red(targetArgb);<NEW_LINE>int g3 = android.graphics.Color.green(targetArgb);<NEW_LINE>int b3 = android.<MASK><NEW_LINE>int r2 = (int) Math.ceil((Math.max(0, r3 * 255 - r1 * (255 - mAlpha))) / mAlpha);<NEW_LINE>int g2 = (int) Math.ceil((Math.max(0, g3 * 255 - g1 * (255 - mAlpha))) / mAlpha);<NEW_LINE>int b2 = (int) Math.ceil((Math.max(0, b3 * 255 - b1 * (255 - mAlpha))) / mAlpha);<NEW_LINE>return android.graphics.Color.argb(mAlpha, r2, g2, b2);<NEW_LINE>} | graphics.Color.blue(targetArgb); |
11,831 | public void marshall(ChannelMessageSummary channelMessageSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (channelMessageSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getMessageId(), MESSAGEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getContent(), CONTENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getMetadata(), METADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getLastUpdatedTimestamp(), LASTUPDATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getLastEditedTimestamp(), LASTEDITEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getSender(), SENDER_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getRedacted(), REDACTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(channelMessageSummary.getMessageAttributes(), MESSAGEATTRIBUTES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | channelMessageSummary.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING); |
591,771 | public Void visitMethodInvocation(final MethodInvocationTree invocation, final Trees trees) {<NEW_LINE>PackageElement compilationUnitPackageElement = Util.getElement(compilationUnit.getPackage());<NEW_LINE>// TODO: same for static variables<NEW_LINE>if (invocation.getMethodSelect() instanceof IdentifierTree && JSweetConfig.TS_STRICT_MODE_KEYWORDS.contains(invocation.getMethodSelect().toString().toLowerCase())) {<NEW_LINE>Element invokedMethodElement = Util.getElement((IdentifierTree) invocation.getMethodSelect());<NEW_LINE>PackageElement invocationPackage = util().getParentElement(invokedMethodElement, PackageElement.class);<NEW_LINE>String rootRelativeInvocationPackageName = getRootRelativeName(invocationPackage);<NEW_LINE>if (rootRelativeInvocationPackageName.indexOf('.') == -1) {<NEW_LINE>return super.visitMethodInvocation(invocation, trees);<NEW_LINE>}<NEW_LINE>String targetRootPackageName = rootRelativeInvocationPackageName.substring(0, rootRelativeInvocationPackageName.indexOf('.'));<NEW_LINE>String pathToReachRootPackage = util().getRelativePath("/" + compilationUnitPackageElement.getQualifiedName().toString().replace('.', '/'), "/" + targetRootPackageName);<NEW_LINE>if (pathToReachRootPackage == null) {<NEW_LINE>return super.visitMethodInvocation(invocation, trees);<NEW_LINE>}<NEW_LINE>File moduleFile = new File(new File(pathToReachRootPackage), JSweetConfig.MODULE_FILE_NAME);<NEW_LINE>if (!invocationPackage.toString().equals(compilationUnitPackageElement.getSimpleName().toString())) {<NEW_LINE>useModule(false, false, invocationPackage, invocation, targetRootPackageName, moduleFile.getPath().replace('\\', '/'), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | super.visitMethodInvocation(invocation, trees); |
78,147 | public void deserialize(ByteBuf input) {<NEW_LINE>int <MASK><NEW_LINE>if (featsFlag > 0) {<NEW_LINE>feats = (IntFloatVector) ByteBufSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>int neighborsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (neighborsFlag > 0) {<NEW_LINE>neighbors = ByteBufSerdeUtils.deserializeLongs(input);<NEW_LINE>}<NEW_LINE>int typesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (typesFlag > 0) {<NEW_LINE>types = ByteBufSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeTypesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeTypesFlag > 0) {<NEW_LINE>edgeTypes = ByteBufSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeFeaturesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeFeaturesFlag > 0) {<NEW_LINE>int len = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>edgeFeatures = new IntFloatVector[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>edgeFeatures[i] = (IntFloatVector) ByteBufSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (weightsFlag > 0) {<NEW_LINE>weights = ByteBufSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>int labelsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (labelsFlag > 0) {<NEW_LINE>weights = ByteBufSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>} | featsFlag = ByteBufSerdeUtils.deserializeInt(input); |
787,290 | public RunOutcome run(@Nonnull StepExecutionDetails<BulkImportJobParameters, VoidModel> theStepExecutionDetails, @Nonnull IJobDataSink<NdJsonFileJson> theDataSink) {<NEW_LINE>Integer maxBatchResourceCount = theStepExecutionDetails.getParameters().getMaxBatchResourceCount();<NEW_LINE>if (maxBatchResourceCount == null || maxBatchResourceCount <= 0) {<NEW_LINE>maxBatchResourceCount = BulkImportAppCtx.PARAM_MAXIMUM_BATCH_SIZE_DEFAULT;<NEW_LINE>}<NEW_LINE>try (CloseableHttpClient httpClient = newHttpClient(theStepExecutionDetails)) {<NEW_LINE>StopWatch outerSw = new StopWatch();<NEW_LINE>List<String> urls = theStepExecutionDetails.getParameters().getNdJsonUrls();<NEW_LINE>for (String nextUrl : urls) {<NEW_LINE>ourLog.info("Fetching URL: {}", nextUrl);<NEW_LINE>StopWatch urlSw = new StopWatch();<NEW_LINE>try (CloseableHttpResponse response = httpClient.execute(new HttpGet(nextUrl))) {<NEW_LINE>int statusCode = response.getStatusLine().getStatusCode();<NEW_LINE>if (statusCode >= 400) {<NEW_LINE>throw new JobExecutionFailedException(Msg.code(2056) + "Received HTTP " + statusCode + " from URL: " + nextUrl);<NEW_LINE>}<NEW_LINE>String contentType = response.getEntity().getContentType().getValue();<NEW_LINE>EncodingEnum encoding = EncodingEnum.forContentType(contentType);<NEW_LINE>Validate.isTrue(encoding == EncodingEnum.NDJSON, "Received non-NDJSON content type \"%s\" from URL: %s", contentType, nextUrl);<NEW_LINE>try (InputStream inputStream = response.getEntity().getContent()) {<NEW_LINE>try (LineIterator lineIterator = new LineIterator(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {<NEW_LINE>int chunkCount = 0;<NEW_LINE>int lineCount = 0;<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>while (lineIterator.hasNext()) {<NEW_LINE>String nextLine = lineIterator.nextLine();<NEW_LINE>builder.append<MASK><NEW_LINE>lineCount++;<NEW_LINE>int charCount = builder.length();<NEW_LINE>int batchSizeChars = (int) (20 * FileUtils.ONE_MB);<NEW_LINE>if (lineCount >= maxBatchResourceCount || charCount >= batchSizeChars || !lineIterator.hasNext()) {<NEW_LINE>ourLog.info("Loaded chunk {} of {} NDJSON file with {} resources from URL: {}", chunkCount, FileUtil.formatFileSize(charCount), lineCount, nextUrl);<NEW_LINE>NdJsonFileJson data = new NdJsonFileJson();<NEW_LINE>data.setNdJsonText(builder.toString());<NEW_LINE>data.setSourceName(nextUrl);<NEW_LINE>theDataSink.accept(data);<NEW_LINE>builder.setLength(0);<NEW_LINE>lineCount = 0;<NEW_LINE>chunkCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ourLog.info("Loaded and processed URL in {}", urlSw);<NEW_LINE>}<NEW_LINE>ourLog.info("Loaded and processed {} URLs in {}", urls.size(), outerSw);<NEW_LINE>return new RunOutcome(0);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new InternalErrorException(Msg.code(2054) + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | (nextLine).append('\n'); |
1,182,967 | public void updateSchedule(@Context SecurityContext sc, @PathParam("envName") String envName, @PathParam("stageName") String stageName, @Valid ScheduleBean bean) throws Exception {<NEW_LINE>String operator = sc.getUserPrincipal().getName();<NEW_LINE>EnvironBean envBean = environDAO.getByStage(envName, stageName);<NEW_LINE>String scheduleId = envBean.getSchedule_id();<NEW_LINE>String cooldownTimes = bean.getCooldown_times();<NEW_LINE>String hostNumbers = bean.getHost_numbers();<NEW_LINE>Integer totalSessions = bean.getTotal_sessions();<NEW_LINE>if (totalSessions > 0) {<NEW_LINE>// there is a schedule<NEW_LINE>ScheduleBean scheduleBean = new ScheduleBean();<NEW_LINE>scheduleBean.setState_start_time(System.currentTimeMillis());<NEW_LINE>scheduleBean.setCooldown_times(cooldownTimes);<NEW_LINE>scheduleBean.setHost_numbers(hostNumbers);<NEW_LINE>scheduleBean.setTotal_sessions(totalSessions);<NEW_LINE>LOG.info(scheduleBean.toString());<NEW_LINE>if (scheduleId == null) {<NEW_LINE>scheduleId = CommonUtils.getBase64UUID();<NEW_LINE>envBean.setSchedule_id(scheduleId);<NEW_LINE>environDAO.update(envName, stageName, envBean);<NEW_LINE>scheduleBean.setId(scheduleId);<NEW_LINE>scheduleDAO.insert(scheduleBean);<NEW_LINE>LOG.info(String.format("Successfully inserted one env %s (%s)'s schedule by %s: %s", envName, stageName, operator<MASK><NEW_LINE>} else {<NEW_LINE>scheduleBean.setId(scheduleId);<NEW_LINE>scheduleDAO.update(scheduleBean, scheduleId);<NEW_LINE>LOG.info(String.format("Successfully updated one env %s (%s)'s schedule by %s: %s", envName, stageName, operator, scheduleBean.toString()));<NEW_LINE>}<NEW_LINE>} else if (scheduleId != null) {<NEW_LINE>// there are no sessions, so delete the schedule<NEW_LINE>scheduleDAO.delete(scheduleId);<NEW_LINE>environDAO.deleteSchedule(envName, stageName);<NEW_LINE>LOG.info(String.format("Successfully deleted env %s (%s)'s schedule by %s", envName, stageName, operator));<NEW_LINE>}<NEW_LINE>} | , scheduleBean.toString())); |
244,725 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_places_on_map);<NEW_LINE>ButterKnife.bind(this);<NEW_LINE>editTextSearch.addTextChangedListener(this);<NEW_LINE>Intent intent = getIntent();<NEW_LINE>mCity = (City) intent.getSerializableExtra(EXTRA_MESSAGE_CITY_OBJECT);<NEW_LINE>String type = intent.getStringExtra(EXTRA_MESSAGE_TYPE);<NEW_LINE>mHandler = new Handler(Looper.getMainLooper());<NEW_LINE>SharedPreferences <MASK><NEW_LINE>mToken = mSharedPreferences.getString(USER_TOKEN, null);<NEW_LINE>sheetBehavior = BottomSheetBehavior.from(layoutBottomSheet);<NEW_LINE>mMap = findViewById(R.id.map);<NEW_LINE>setTitle(mCity.getNickname());<NEW_LINE>mMarker = this.getDrawable(R.drawable.ic_radio_button_checked_orange_24dp);<NEW_LINE>mDefaultMarker = this.getDrawable(R.drawable.marker_default);<NEW_LINE>switch(type) {<NEW_LINE>case "restaurant":<NEW_LINE>mMode = "eat-drink";<NEW_LINE>mIcon = R.drawable.restaurant;<NEW_LINE>break;<NEW_LINE>case "hangout":<NEW_LINE>mMode = "going-out,leisure-outdoor";<NEW_LINE>mIcon = R.drawable.hangout;<NEW_LINE>break;<NEW_LINE>case "monument":<NEW_LINE>mMode = "sights-museums";<NEW_LINE>mIcon = R.drawable.monuments;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>mMode = "shopping";<NEW_LINE>mIcon = R.drawable.shopping_icon;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>getPlaces();<NEW_LINE>initMap();<NEW_LINE>setTitle("Places");<NEW_LINE>Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>} | mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); |
582,352 | public void initView() {<NEW_LINE>Array<AttributeVO> gridAttributes = new Array<>();<NEW_LINE>gridAttributes.add(new AttributeVO("Width", currentParameters.gridWidth));<NEW_LINE>gridAttributes.add(new AttributeVO("Height", currentParameters.gridHeight));<NEW_LINE>CategoryVO gridVO = new CategoryVO("Grid size: ", gridAttributes);<NEW_LINE>grid = new Category(gridVO);<NEW_LINE>content.add(grid).expandX().colspan(2).padTop(10).left().top().row();<NEW_LINE>panel.<MASK><NEW_LINE>VisTextButton okBtn = new VisTextButton("Save");<NEW_LINE>content.add(okBtn).width(70).pad(20).colspan(2).expandX().center().bottom().row();<NEW_LINE>okBtn.addListener(new ClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void clicked(InputEvent event, float x, float y) {<NEW_LINE>super.clicked(event, x, y);<NEW_LINE>currentParameters.gridWidth = grid.getAttributeVO("Width: ").value;<NEW_LINE>currentParameters.gridHeight = grid.getAttributeVO("Height: ").value;<NEW_LINE>panel.facade.sendNotification(OK_BTN_CLICKED, currentParameters);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | tiledPlugin.dataToSave.setParameterVO(currentParameters); |
1,716,243 | public void finishedToExecuteTask(Queueable msg) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>StringBuffer buff = new StringBuffer();<NEW_LINE>buff.append("QId=");<NEW_LINE>buff.append(getId());<NEW_LINE>buff.append(" Message = ");<NEW_LINE>buff.append(msg);<NEW_LINE>// buff.append("Queue size =");<NEW_LINE>// buff.append(_queue.size());<NEW_LINE>c_logger.traceEntry(this, "finishedToExecuteTask", buff.toString());<NEW_LINE>}<NEW_LINE>PerformanceMgr perfMgr = PerformanceMgr.getInstance();<NEW_LINE>if (perfMgr != null && perfMgr.isApplicationDurationPMIEnabled() && msg != null && msg.getApplicationCodeDuration() != null && msg.getAppName() != null && msg.getAppIndexForPMI() != null) {<NEW_LINE>perfMgr.measureInApplicationTaskDuration(msg.getAppName(), msg.getAppIndexForPMI(), msg.getApplicationCodeDuration().takeTimeMeasurement());<NEW_LINE>}<NEW_LINE>invalidateWhenReadyTU();<NEW_LINE>synchronized (this) {<NEW_LINE>// currentQueue.set(null);<NEW_LINE>finishToExecuteRunnable();<NEW_LINE>this.notifyAll();<NEW_LINE>unrecordThreadID();<NEW_LINE>if (_queue.isEmpty()) {<NEW_LINE>m_isQhasTaskInThreadPool = false;<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "finishedToExecuteTask", "no more messages in Qid=" + getId() + " .releasing flag");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer buff = new StringBuffer();<NEW_LINE>buff.append("QId=").append(getId<MASK><NEW_LINE>buff.append(_queue.size());<NEW_LINE>buff.append(" more messages.");<NEW_LINE>buff.append(msg);<NEW_LINE>c_logger.traceDebug(this, "finishedToExecuteTask", buff.toString());<NEW_LINE>}<NEW_LINE>// go fetch another task.<NEW_LINE>extractAmsgAndExecute();<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "finishedToExecuteTask");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).append(" has "); |
241,478 | @Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Removes assignment of a vulnerability from a component")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Access to the specified component is forbidden"), @ApiResponse(code = 404, message = "The vulnerability or component could not be found") })<NEW_LINE>@PermissionRequired(Permissions.Constants.PORTFOLIO_MANAGEMENT)<NEW_LINE>public Response unassignVulnerability(@ApiParam(value = "The UUID of the vulnerability", required = true) @PathParam("uuid") String uuid, @ApiParam(value = "The UUID of the component", required = true) @PathParam("component") String componentUuid) {<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>Vulnerability vulnerability = qm.<MASK><NEW_LINE>if (vulnerability == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("The vulnerability could not be found.").build();<NEW_LINE>}<NEW_LINE>Component component = qm.getObjectByUuid(Component.class, componentUuid);<NEW_LINE>if (component != null) {<NEW_LINE>if (qm.hasAccess(super.getPrincipal(), component.getProject())) {<NEW_LINE>qm.removeVulnerability(vulnerability, component);<NEW_LINE>return Response.ok().build();<NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.FORBIDDEN).entity("Access to the specified component is forbidden").build();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("The component could not be found.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getObjectByUuid(Vulnerability.class, uuid); |
1,853,066 | public static void showEditInstance(final MapObject mapObject, final AppCompatActivity activity) {<NEW_LINE>final OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);<NEW_LINE>if (plugin == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OsmandApplication app = ((OsmandApplication) activity.getApplication());<NEW_LINE>final OpenstreetmapUtil openstreetmapUtilToLoad = app.getSettings().isInternetConnectionAvailable(true) ? plugin.getPoiModificationRemoteUtil() : plugin.getPoiModificationLocalUtil();<NEW_LINE>new AsyncTask<Void, Void, Entity>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Entity doInBackground(Void... params) {<NEW_LINE>return openstreetmapUtilToLoad.loadEntity(mapObject);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(Entity entity) {<NEW_LINE>if (entity != null) {<NEW_LINE>Entity existingOsmEditEntity = getExistingOsmEditEntity(plugin, entity.getId());<NEW_LINE>Entity entityToEdit = existingOsmEditEntity != null ? existingOsmEditEntity : entity;<NEW_LINE>EditPoiDialogFragment fragment = <MASK><NEW_LINE>fragment.show(activity.getSupportFragmentManager(), TAG);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(activity, activity.getString(R.string.poi_cannot_be_found), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>private Entity getExistingOsmEditEntity(@NonNull OsmEditingPlugin osmEditingPlugin, long entityId) {<NEW_LINE>List<OpenstreetmapPoint> osmEdits = osmEditingPlugin.getDBPOI().getOpenstreetmapPoints();<NEW_LINE>for (OpenstreetmapPoint osmEdit : osmEdits) {<NEW_LINE>if (osmEdit.getId() == entityId && osmEdit.getAction() == Action.MODIFY) {<NEW_LINE>return osmEdit.getEntity();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>} | EditPoiDialogFragment.createInstance(entityToEdit, false); |
1,039,676 | protected ActionResult<List<Wo>> execute(HttpServletRequest request, EffectivePerson effectivePerson, String subjectId) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<List<Wo>>();<NEW_LINE>List<Wo> wrapOutSubjectAttachmentList = null;<NEW_LINE>List<BBSSubjectAttachment> fileInfoList = null;<NEW_LINE>BBSSubjectInfo subjectInfo = null;<NEW_LINE>try {<NEW_LINE>subjectInfo = subjectInfoServiceAdv.get(subjectId);<NEW_LINE>if (subjectInfo != null) {<NEW_LINE>if (subjectInfo.getAttachmentList() != null && subjectInfo.getAttachmentList().size() > 0) {<NEW_LINE>fileInfoList = subjectInfoServiceAdv.listAttachmentByIds(subjectInfo.getAttachmentList());<NEW_LINE>} else {<NEW_LINE>fileInfoList = new ArrayList<BBSSubjectAttachment>();<NEW_LINE>}<NEW_LINE>wrapOutSubjectAttachmentList = <MASK><NEW_LINE>} else {<NEW_LINE>Exception exception = new ExceptionSubjectNotExists(subjectId);<NEW_LINE>result.error(exception);<NEW_LINE>logger.error(exception, effectivePerson, request, null);<NEW_LINE>}<NEW_LINE>if (wrapOutSubjectAttachmentList == null) {<NEW_LINE>wrapOutSubjectAttachmentList = new ArrayList<Wo>();<NEW_LINE>}<NEW_LINE>result.setData(wrapOutSubjectAttachmentList);<NEW_LINE>} catch (Throwable th) {<NEW_LINE>Exception exception = new ExceptionSubjectQueryById(th, subjectId);<NEW_LINE>result.error(exception);<NEW_LINE>logger.error(exception, effectivePerson, request, null);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Wo.copier.copy(fileInfoList); |
1,645,986 | public void run() {<NEW_LINE>TcpProxy <MASK><NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("id", id);<NEW_LINE>param.put("pass", CipherUtil.sha256(password));<NEW_LINE>param.put("email", email);<NEW_LINE>param.put("group", selectedGroup);<NEW_LINE>MapPack p = (MapPack) tcp.getSingle(RequestCmd.ADD_ACCOUNT, param);<NEW_LINE>result = p.getBoolean("result");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>final boolean finalResult = result;<NEW_LINE>ExUtil.exec(dialog, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (finalResult) {<NEW_LINE>MessageDialog.openInformation(dialog, "Success[Add Account]", "Your registration has been successful");<NEW_LINE>dialog.close();<NEW_LINE>} else {<NEW_LINE>MessageDialog.openError(dialog, "Failed[Add Account]", "Your registration failed");<NEW_LINE>okBtn.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | tcp = TcpProxy.getTcpProxy(serverId); |
1,012,407 | public int execute(DalHints hints, Map<String, ?> fields, T rawPojo, DalTaskContext taskContext) throws SQLException {<NEW_LINE>List<Map<String, ?>> pojoList = new ArrayList<Map<String, ?>>();<NEW_LINE>List<T> rawPojos = new ArrayList<>();<NEW_LINE>pojoList.add(fields);<NEW_LINE>rawPojos.add(rawPojo);<NEW_LINE>Set<String> unqualifiedColumns = filterUnqualifiedColumns(hints, pojoList, rawPojos);<NEW_LINE>removeUnqualifiedColumns(fields, unqualifiedColumns);<NEW_LINE>// Put identityFields into context<NEW_LINE>List<Map<String, Object>> <MASK><NEW_LINE>Map<String, Object> identityField = getIdentityField(fields);<NEW_LINE>if (identityField != null) {<NEW_LINE>identityFields.add(identityField);<NEW_LINE>}<NEW_LINE>if (taskContext instanceof DefaultTaskContext) {<NEW_LINE>((DefaultTaskContext) taskContext).setIdentityFields(identityFields);<NEW_LINE>((DefaultTaskContext) taskContext).setPojosCount(1);<NEW_LINE>}<NEW_LINE>String tableName = getRawTableName(hints, fields);<NEW_LINE>if (taskContext instanceof DalContextConfigure)<NEW_LINE>((DalContextConfigure) taskContext).addTables(tableName);<NEW_LINE>String insertSql = buildInsertSql(hints, fields, tableName);<NEW_LINE>StatementParameters parameters = new StatementParameters();<NEW_LINE>addParameters(parameters, fields);<NEW_LINE>if (client instanceof DalContextClient)<NEW_LINE>return ((DalContextClient) client).update(insertSql, parameters, hints, taskContext);<NEW_LINE>else<NEW_LINE>throw new DalRuntimeException("The client is not instance of DalClient");<NEW_LINE>} | identityFields = new ArrayList<>(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.