idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
447,445 | public ViewUpdatedCollection makeViewUpdatedCollection(SortedSet<Integer> priorRequests, AgentInstanceContext agentInstanceContext) {<NEW_LINE>if (priorRequests.isEmpty()) {<NEW_LINE>throw new IllegalStateException("No resources requested");<NEW_LINE>}<NEW_LINE>// Construct an array of requested prior-event indexes (such as 10th prior event, 8th prior = {10, 8})<NEW_LINE>int[] requested = new int[priorRequests.size()];<NEW_LINE>int count = 0;<NEW_LINE>for (int reqIndex : priorRequests) {<NEW_LINE>requested[count++] = reqIndex;<NEW_LINE>}<NEW_LINE>// For unbound streams the buffer is strictly rolling new events<NEW_LINE>if (isUnbound) {<NEW_LINE>return new PriorEventBufferUnbound(priorRequests.last());<NEW_LINE>} else if (requested.length == 1) {<NEW_LINE>// For bound streams (with views posting old and new data), and if only one prior index requested<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>// For bound streams (with views posting old and new data)<NEW_LINE>// Multiple prior event indexes requested, such as "prior(2, price), prior(8, price)"<NEW_LINE>// Sharing a single viewUpdatedCollection for multiple prior-event indexes<NEW_LINE>return new PriorEventBufferMulti(requested);<NEW_LINE>}<NEW_LINE>} | new PriorEventBufferSingle(requested[0]); |
1,824,645 | private Object arrayClone(Object array) {<NEW_LINE>if (array instanceof Object[])<NEW_LINE>return objectArrayClone((Object[]) array);<NEW_LINE>else if (array instanceof byte[])<NEW_LINE>return Arrays.copyOf((byte[]) array, ((byte<MASK><NEW_LINE>else if (array instanceof char[])<NEW_LINE>return Arrays.copyOf((char[]) array, ((char[]) array).length);<NEW_LINE>else if (array instanceof short[])<NEW_LINE>return Arrays.copyOf((short[]) array, ((short[]) array).length);<NEW_LINE>else if (array instanceof int[])<NEW_LINE>return Arrays.copyOf((int[]) array, ((int[]) array).length);<NEW_LINE>else if (array instanceof long[])<NEW_LINE>return Arrays.copyOf((long[]) array, ((long[]) array).length);<NEW_LINE>else if (array instanceof float[])<NEW_LINE>return Arrays.copyOf((float[]) array, ((float[]) array).length);<NEW_LINE>else if (array instanceof double[])<NEW_LINE>return Arrays.copyOf((double[]) array, ((double[]) array).length);<NEW_LINE>else if (array instanceof boolean[])<NEW_LINE>return Arrays.copyOf((boolean[]) array, ((boolean[]) array).length);<NEW_LINE>else<NEW_LINE>return new IllegalArgumentException("Unexpected primitive array type " + array.getClass());<NEW_LINE>} | []) array).length); |
1,755,758 | private void mergeBucketsWithPlan(List<Bucket> buckets, List<BucketRange> plan, AggregationReduceContext reduceContext) {<NEW_LINE>for (int i = plan.size() - 1; i >= 0; i--) {<NEW_LINE>BucketRange range = plan.get(i);<NEW_LINE>int endIdx = range.endIdx;<NEW_LINE>int startIdx = range.startIdx;<NEW_LINE>if (startIdx == endIdx)<NEW_LINE>continue;<NEW_LINE>List<Bucket> toMerge = new ArrayList<>();<NEW_LINE>for (int idx = endIdx; idx > startIdx; idx--) {<NEW_LINE>toMerge.add(buckets.get(idx));<NEW_LINE>buckets.remove(idx);<NEW_LINE>}<NEW_LINE>// Don't remove the startIdx bucket because it will be replaced by the merged bucket<NEW_LINE>toMerge.add(buckets.get(startIdx));<NEW_LINE>int toRemove = toMerge.stream().mapToInt(b -> countInnerBucket(b) + 1).sum();<NEW_LINE>reduceContext.consumeBucketsAndMaybeBreak(-toRemove + 1);<NEW_LINE>Bucket merged_bucket = reduceBucket(toMerge, reduceContext);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | buckets.set(startIdx, merged_bucket); |
1,323,092 | public Future<List<InetSocketAddress>> resolve(NameResolver<InetAddress> nameResolver, InetSocketAddress unresolvedAddress, AsyncHandler<?> asyncHandler) {<NEW_LINE>final String hostname = unresolvedAddress.getHostString();<NEW_LINE>final int port = unresolvedAddress.getPort();<NEW_LINE>final Promise<List<InetSocketAddress>> promise = ImmediateEventExecutor.INSTANCE.newPromise();<NEW_LINE>try {<NEW_LINE>asyncHandler.onHostnameResolutionAttempt(hostname);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("onHostnameResolutionAttempt crashed", e);<NEW_LINE>promise.tryFailure(e);<NEW_LINE>return promise;<NEW_LINE>}<NEW_LINE>final Future<List<InetAddress>> whenResolved = nameResolver.resolveAll(hostname);<NEW_LINE>whenResolved.addListener(new SimpleFutureListener<List<InetAddress>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(List<InetAddress> value) {<NEW_LINE>ArrayList<InetSocketAddress> socketAddresses = new ArrayList<>(value.size());<NEW_LINE>for (InetAddress a : value) {<NEW_LINE>socketAddresses.add(new InetSocketAddress(a, port));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("onHostnameResolutionSuccess crashed", e);<NEW_LINE>promise.tryFailure(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>promise.trySuccess(socketAddresses);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onFailure(Throwable t) {<NEW_LINE>try {<NEW_LINE>asyncHandler.onHostnameResolutionFailure(hostname, t);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("onHostnameResolutionFailure crashed", e);<NEW_LINE>promise.tryFailure(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>promise.tryFailure(t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return promise;<NEW_LINE>} | asyncHandler.onHostnameResolutionSuccess(hostname, socketAddresses); |
463,013 | public static boolean renderBehaviorizedOnchangeEventHandler(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String targetClientId, Map<String, List<ClientBehavior>> clientBehaviors) throws IOException {<NEW_LINE>boolean hasChange = HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.CHANGE, clientBehaviors, facesContext);<NEW_LINE>boolean hasValueChange = HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.VALUECHANGE, clientBehaviors, facesContext);<NEW_LINE>if (hasChange && hasValueChange) {<NEW_LINE>String chain = HtmlRendererUtils.buildBehaviorChain(facesContext, uiComponent, targetClientId, ClientBehaviorEvents.CHANGE, null, ClientBehaviorEvents.VALUECHANGE, null, clientBehaviors, (String) uiComponent.getAttributes().get<MASK><NEW_LINE>return HtmlRendererUtils.renderHTMLStringAttribute(writer, HTML.ONCHANGE_ATTR, HTML.ONCHANGE_ATTR, chain);<NEW_LINE>} else if (hasChange) {<NEW_LINE>return HtmlRendererUtils.renderBehaviorizedAttribute(facesContext, writer, HTML.ONCHANGE_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.CHANGE, clientBehaviors, HTML.ONCHANGE_ATTR);<NEW_LINE>} else if (hasValueChange) {<NEW_LINE>return HtmlRendererUtils.renderBehaviorizedAttribute(facesContext, writer, HTML.ONCHANGE_ATTR, uiComponent, targetClientId, ClientBehaviorEvents.VALUECHANGE, clientBehaviors, HTML.ONCHANGE_ATTR);<NEW_LINE>} else {<NEW_LINE>return HtmlRendererUtils.renderHTMLStringAttribute(writer, uiComponent, HTML.ONCHANGE_ATTR, HTML.ONCHANGE_ATTR);<NEW_LINE>}<NEW_LINE>} | (HTML.ONCHANGE_ATTR), null); |
883,762 | public String toSignature(String name) {<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>StringBuilder buffer1 = new StringBuilder();<NEW_LINE>String s = getConventionPointerNameString(name);<NEW_LINE>addFunctionPointerParens(buffer1, s);<NEW_LINE>buffer1.append('(');<NEW_LINE>for (int i = 0; i < parameters.size(); ++i) {<NEW_LINE>buffer1.append(parameters.get(i).getSignature());<NEW_LINE>if (i < parameters.size() - 1) {<NEW_LINE>buffer1.append(',');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer1.append(')');<NEW_LINE>if (returnType instanceof DemangledFunctionPointer) {<NEW_LINE>DemangledFunctionPointer dfp = (DemangledFunctionPointer) returnType;<NEW_LINE>buffer.append(dfp.toSignature(buffer1.toString())).append(SPACE);<NEW_LINE>} else if (returnType instanceof DemangledFunctionReference) {<NEW_LINE>DemangledFunctionReference dfr = (DemangledFunctionReference) returnType;<NEW_LINE>buffer.append(dfr.toSignature(buffer1.toString())).append(SPACE);<NEW_LINE>} else if (returnType instanceof DemangledFunctionIndirect) {<NEW_LINE>DemangledFunctionIndirect dfi = (DemangledFunctionIndirect) returnType;<NEW_LINE>buffer.append(dfi.toSignature(buffer1.toString())).append(SPACE);<NEW_LINE>} else {<NEW_LINE>buffer.append(returnType.getSignature<MASK><NEW_LINE>buffer.append(buffer1);<NEW_LINE>}<NEW_LINE>if (isConst()) {<NEW_LINE>if (buffer.length() > 2) {<NEW_LINE>buffer.append(SPACE);<NEW_LINE>}<NEW_LINE>buffer.append(CONST);<NEW_LINE>}<NEW_LINE>if (isVolatile()) {<NEW_LINE>if (buffer.length() > 2) {<NEW_LINE>buffer.append(SPACE);<NEW_LINE>}<NEW_LINE>buffer.append(VOLATILE);<NEW_LINE>}<NEW_LINE>if (isTrailingUnaligned) {<NEW_LINE>if (buffer.length() > 2) {<NEW_LINE>buffer.append(SPACE);<NEW_LINE>}<NEW_LINE>buffer.append(UNALIGNED);<NEW_LINE>}<NEW_LINE>if (isTrailingPointer64) {<NEW_LINE>if (buffer.length() > 2) {<NEW_LINE>buffer.append(SPACE);<NEW_LINE>}<NEW_LINE>buffer.append(PTR64);<NEW_LINE>}<NEW_LINE>if (isTrailingRestrict) {<NEW_LINE>if (buffer.length() > 2) {<NEW_LINE>buffer.append(SPACE);<NEW_LINE>}<NEW_LINE>buffer.append(RESTRICT);<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>} | ()).append(SPACE); |
1,066,436 | protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>monitor.beginTask("Find " + Hexa32.toString32(gxid), IProgressMonitor.UNKNOWN);<NEW_LINE>final LongKeyLinkedMap<Object> xlogMap = new LongKeyLinkedMap<Object>();<NEW_LINE>Iterator<Integer> itr = ServerManager.getInstance().getOpenServerList().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>final int serverId = itr.next();<NEW_LINE>monitor.subTask(ServerManager.getInstance().getServer(serverId).getName());<NEW_LINE>TcpProxy <MASK><NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", date);<NEW_LINE>param.put("gxid", gxid);<NEW_LINE>tcp.process(RequestCmd.XLOG_READ_BY_GXID, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>XLogPack xlog = XLogUtil.toXLogPack(p);<NEW_LINE>XLogData d = new XLogData(xlog, serverId);<NEW_LINE>d.objName = TextProxy.object.getLoadText(date, d.p.objHash, d.serverId);<NEW_LINE>xlogMap.putFirst(xlog.txid, d);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable th) {<NEW_LINE>ConsoleProxy.errorSafe(th.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExUtil.exec(viewer.getGraphControl(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>viewer.setInput(xlogMap);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | tcp = TcpProxy.getTcpProxy(serverId); |
923,537 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>scrollPane = new javax.swing.JScrollPane();<NEW_LINE>list = new javax.swing.JList();<NEW_LINE>label = new javax.swing.JLabel();<NEW_LINE>list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>scrollPane.setViewportView(list);<NEW_LINE>// NOI18N<NEW_LINE>list.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PoliciesVisualPanel.class, "ACSN_SelectPolicy"));<NEW_LINE>// NOI18N<NEW_LINE>list.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PoliciesVisualPanel.class, "ACSD_SelectPolicy"));<NEW_LINE>label.setLabelFor(list);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(label, org.openide.util.NbBundle.getMessage(PoliciesVisualPanel.class, "LBL_ChoosePolicyLbl"));<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE).addComponent(label)).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(label).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 264, Short.<MASK><NEW_LINE>// NOI18N<NEW_LINE>label.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PoliciesVisualPanel.class, "ACSN_SelectPolicy"));<NEW_LINE>// NOI18N<NEW_LINE>label.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PoliciesVisualPanel.class, "ACSD_SelectPolicy"));<NEW_LINE>} | MAX_VALUE).addContainerGap())); |
1,044,379 | public static MutableRoaringBitmap horizontal_or(ImmutableRoaringBitmap... bitmaps) {<NEW_LINE>MutableRoaringBitmap answer = new MutableRoaringBitmap();<NEW_LINE>if (bitmaps.length == 0) {<NEW_LINE>return answer;<NEW_LINE>}<NEW_LINE>PriorityQueue<MappeableContainerPointer> pq = new PriorityQueue<>(bitmaps.length);<NEW_LINE>for (int k = 0; k < bitmaps.length; ++k) {<NEW_LINE>MappeableContainerPointer x = bitmaps[k].highLowContainer.getContainerPointer();<NEW_LINE>if (x.getContainer() != null) {<NEW_LINE>pq.add(x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (!pq.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>if (pq.isEmpty() || (pq.peek().key() != x1.key())) {<NEW_LINE>answer.getMappeableRoaringArray().append(x1.key(), x1.getContainer().clone());<NEW_LINE>x1.advance();<NEW_LINE>if (x1.getContainer() != null) {<NEW_LINE>pq.add(x1);<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MappeableContainerPointer x2 = pq.poll();<NEW_LINE>MappeableContainer newc = x1.getContainer().lazyOR(x2.getContainer());<NEW_LINE>while (!pq.isEmpty() && (pq.peek().key() == x1.key())) {<NEW_LINE>MappeableContainerPointer x = pq.poll();<NEW_LINE>newc = newc.lazyIOR(x.getContainer());<NEW_LINE>x.advance();<NEW_LINE>if (x.getContainer() != null) {<NEW_LINE>pq.add(x);<NEW_LINE>} else if (pq.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newc = newc.repairAfterLazy();<NEW_LINE>answer.getMappeableRoaringArray().append(x1.key(), newc);<NEW_LINE>x1.advance();<NEW_LINE>if (x1.getContainer() != null) {<NEW_LINE>pq.add(x1);<NEW_LINE>}<NEW_LINE>x2.advance();<NEW_LINE>if (x2.getContainer() != null) {<NEW_LINE>pq.add(x2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>} | MappeableContainerPointer x1 = pq.poll(); |
1,745,875 | public void generateMultiSupplierInvoice(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>List<Map> stockMoveMap = (List<Map>) request.getContext().get("supplierStockMoveToInvoice");<NEW_LINE>List<Long> stockMoveIdList = new ArrayList<>();<NEW_LINE>List<StockMove> stockMoveList = new ArrayList<>();<NEW_LINE>for (Map map : stockMoveMap) {<NEW_LINE>stockMoveIdList.add(((Number) map.get("id")).longValue());<NEW_LINE>}<NEW_LINE>for (Long stockMoveId : stockMoveIdList) {<NEW_LINE>stockMoveList.add(JPA.em().find(StockMove.class, stockMoveId));<NEW_LINE>}<NEW_LINE>Beans.get(StockMoveMultiInvoiceService.class).checkForAlreadyInvoicedStockMove(stockMoveList);<NEW_LINE>Entry<List<Long>, String> result = Beans.get(StockMoveMultiInvoiceService.class).generateMultipleInvoices(stockMoveIdList);<NEW_LINE>List<Long> invoiceIdList = result.getKey();<NEW_LINE>String warningMessage = result.getValue();<NEW_LINE>if (!invoiceIdList.isEmpty()) {<NEW_LINE>ActionViewBuilder viewBuilder;<NEW_LINE>viewBuilder = ActionView.define("Suppl. Invoices");<NEW_LINE>viewBuilder.model(Invoice.class.getName()).add("grid", "invoice-supplier-grid").add("form", "invoice-form").param("search-filters", "supplier-invoices-filters").domain("self.id IN (" + Joiner.on(",").join(invoiceIdList) + ")").context("_operationTypeSelect", InvoiceRepository.OPERATION_TYPE_SUPPLIER_PURCHASE).context("todayDate", Beans.get(AppSupplychainService.class).getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany<MASK><NEW_LINE>response.setView(viewBuilder.map());<NEW_LINE>}<NEW_LINE>if (warningMessage != null && !warningMessage.isEmpty()) {<NEW_LINE>response.setFlash(warningMessage);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(response, e);<NEW_LINE>}<NEW_LINE>} | ).orElse(null))); |
1,145,501 | public static void main(String[] args) throws IOException, InterruptedException {<NEW_LINE>Context context = context(1);<NEW_LINE>// Socket to send messages on<NEW_LINE>Socket <MASK><NEW_LINE>sender.bind(TCP_5557);<NEW_LINE>// Socket to send messages on<NEW_LINE>Socket sink = context.socket(PUSH);<NEW_LINE>// Why connect ?<NEW_LINE>sink.connect(TCP_5558);<NEW_LINE>System.out.println("Press Enter as soon as the workers are all set: ");<NEW_LINE>System.in.read();<NEW_LINE>System.out.println("Sending Tasks to the workers ...");<NEW_LINE>// The first message is "0" and signals start of batch<NEW_LINE>sink.send("0", 0);<NEW_LINE>// Initialize random number generator<NEW_LINE>Random random = new Random(System.currentTimeMillis());<NEW_LINE>// Send 100 tasks<NEW_LINE>int totalDuration = 0;<NEW_LINE>for (int taskNum = 0; taskNum < 100; taskNum++) {<NEW_LINE>int workload;<NEW_LINE>// Random workload from 1 to 100 msecs.<NEW_LINE>workload = random.nextInt(100) + 1;<NEW_LINE>totalDuration += workload;<NEW_LINE>System.out.println(workload + ".");<NEW_LINE>String taskDuration = format("%d", workload);<NEW_LINE>sender.send(taskDuration, 0);<NEW_LINE>}<NEW_LINE>System.out.printf("\nTotal expected cost: %d msec.", totalDuration);<NEW_LINE>// Give 0MQ time to deliver<NEW_LINE>Thread.sleep(1000);<NEW_LINE>sink.close();<NEW_LINE>sender.close();<NEW_LINE>context.term();<NEW_LINE>} | sender = context.socket(PUSH); |
94,168 | public static void drawPolygon(Polygon2D_F64 polygon, boolean loop, double scale, Color color0, Color colorOthers, Graphics2D g2) {<NEW_LINE>BoofSwingUtil.antialiasing(g2);<NEW_LINE>Path2D path = new Path2D.Double();<NEW_LINE>for (int i = 1; i <= polygon.size(); i++) {<NEW_LINE>Point2D_F64 p = polygon.get(i % polygon.size());<NEW_LINE>if (i == 1) {<NEW_LINE>path.moveTo(scale * p.x, scale * p.y);<NEW_LINE>} else {<NEW_LINE>path.lineTo(scale * p.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>g2.setColor(colorOthers);<NEW_LINE>g2.draw(path);<NEW_LINE>path.reset();<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>Point2D_F64 p = polygon.get(i);<NEW_LINE>if (i == 0) {<NEW_LINE>path.moveTo(scale * p.x, scale * p.y);<NEW_LINE>} else {<NEW_LINE>path.lineTo(scale * p.x, scale * p.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g2.setColor(color0);<NEW_LINE>g2.draw(path);<NEW_LINE>} | x, scale * p.y); |
515,150 | private void loadFromAttributes(@Nullable AttributeSet attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) {<NEW_LINE>TypedArray a = ThemeEnforcement.obtainStyledAttributes(context, attrs, R.styleable.Tooltip, defStyleAttr, defStyleRes);<NEW_LINE>arrowSize = context.getResources().getDimensionPixelSize(R.dimen.mtrl_tooltip_arrowSize);<NEW_LINE>setShapeAppearanceModel(getShapeAppearanceModel().toBuilder().setBottomEdge(createMarkerEdge()).build());<NEW_LINE>setText(a.getText(R.styleable.Tooltip_android_text));<NEW_LINE>TextAppearance textAppearance = MaterialResources.getTextAppearance(context, a, R.styleable.Tooltip_android_textAppearance);<NEW_LINE>if (textAppearance != null && a.hasValue(R.styleable.Tooltip_android_textColor)) {<NEW_LINE>textAppearance.setTextColor(MaterialResources.getColorStateList(context, a, R.styleable.Tooltip_android_textColor));<NEW_LINE>}<NEW_LINE>setTextAppearance(textAppearance);<NEW_LINE>int onBackground = MaterialColors.getColor(context, R.attr.colorOnBackground, TooltipDrawable.class.getCanonicalName());<NEW_LINE>int background = MaterialColors.getColor(context, android.R.attr.colorBackground, TooltipDrawable.class.getCanonicalName());<NEW_LINE>int backgroundTintDefault = MaterialColors.layer(ColorUtils.setAlphaComponent(background, (int) (0.9f * 255)), ColorUtils.setAlphaComponent(onBackground, (int) (0.6f * 255)));<NEW_LINE>setFillColor(ColorStateList.valueOf(a.getColor(R.styleable.Tooltip_backgroundTint, backgroundTintDefault)));<NEW_LINE>setStrokeColor(ColorStateList.valueOf(MaterialColors.getColor(context, R.attr.colorSurface, TooltipDrawable.<MASK><NEW_LINE>padding = a.getDimensionPixelSize(R.styleable.Tooltip_android_padding, 0);<NEW_LINE>minWidth = a.getDimensionPixelSize(R.styleable.Tooltip_android_minWidth, 0);<NEW_LINE>minHeight = a.getDimensionPixelSize(R.styleable.Tooltip_android_minHeight, 0);<NEW_LINE>layoutMargin = a.getDimensionPixelSize(R.styleable.Tooltip_android_layout_margin, 0);<NEW_LINE>a.recycle();<NEW_LINE>} | class.getCanonicalName()))); |
510,622 | private String genTransformSelectSql(TransformNode transformNode, NodeRelation relation, Map<String, Node> nodeMap) {<NEW_LINE>String selectSql;<NEW_LINE>if (relation instanceof JoinRelation) {<NEW_LINE>// parse join relation and generate the transform sql<NEW_LINE>JoinRelation joinRelation = (JoinRelation) relation;<NEW_LINE>selectSql = genJoinSelectSql(transformNode, transformNode.getFieldRelations(), joinRelation, transformNode.getFilters(), transformNode.getFilterStrategy(), nodeMap);<NEW_LINE>} else if (relation instanceof UnionNodeRelation) {<NEW_LINE>// parse union relation and generate the transform sql<NEW_LINE>Preconditions.checkState(transformNode.getFilters() == null || transformNode.getFilters().isEmpty(), "Filter is not supported when union");<NEW_LINE>Preconditions.checkState(transformNode.getClass() == TransformNode.class, String.format("union is not supported for %s", transformNode.getClass().getSimpleName()));<NEW_LINE>UnionNodeRelation unionRelation = (UnionNodeRelation) relation;<NEW_LINE>selectSql = genUnionNodeSelectSql(transformNode, transformNode.getFieldRelations(), unionRelation, nodeMap);<NEW_LINE>} else {<NEW_LINE>// parse base relation that one to one and generate the transform sql<NEW_LINE>Preconditions.checkState(relation.getInputs().size() == 1, "simple transform only support one input node");<NEW_LINE>Preconditions.checkState(relation.getOutputs().size() == 1, "join node only support one output node");<NEW_LINE>selectSql = genSimpleSelectSql(transformNode, transformNode.getFieldRelations(), relation, transformNode.getFilters(), <MASK><NEW_LINE>}<NEW_LINE>return selectSql;<NEW_LINE>} | transformNode.getFilterStrategy(), nodeMap); |
301,210 | protected void initUi() {<NEW_LINE>buttonShowView = new JToggleButton(DisplayUtils.getScaledIcon(new ImageIcon(RequestSplitComponent.class.getResource("/resource/icon/view_split.png"))));<NEW_LINE>buttonShowView.setToolTipText(BUTTON_TOOL_TIP);<NEW_LINE>panelOptions = new JPanel();<NEW_LINE>panelOptions.add(headerViews.getSelectableViewsComponent());<NEW_LINE>panelOptions.<MASK><NEW_LINE>headerViews.addView(createHttpPanelHeaderTextView());<NEW_LINE>splitMain = new JSplitPane();<NEW_LINE>splitMain.setDividerSize(3);<NEW_LINE>splitMain.setResizeWeight(0.5d);<NEW_LINE>splitMain.setContinuousLayout(false);<NEW_LINE>splitMain.setOrientation(JSplitPane.VERTICAL_SPLIT);<NEW_LINE>splitMain.setTopComponent(headerViews.getViewsPanel());<NEW_LINE>splitMain.setBottomComponent(bodyViews.getViewsPanel());<NEW_LINE>initViews();<NEW_LINE>panelMain = new JPanel(new BorderLayout());<NEW_LINE>panelMain.add(splitMain, BorderLayout.CENTER);<NEW_LINE>setSelected(false);<NEW_LINE>} | add(bodyViews.getSelectableViewsComponent()); |
1,023,114 | protected boolean acceptType(IType type, int acceptFlags, boolean isSourceType) {<NEW_LINE>if (acceptFlags == 0 || acceptFlags == ACCEPT_ALL)<NEW_LINE>// no flags or all flags, always accepted<NEW_LINE>return true;<NEW_LINE>try {<NEW_LINE>int kind = isSourceType ? TypeDeclaration.kind(((SourceTypeElementInfo) ((SourceType) type).getElementInfo()).getModifiers()) : TypeDeclaration.kind(((IBinaryType) ((BinaryType) type).getElementInfo()).getModifiers());<NEW_LINE>switch(kind) {<NEW_LINE>case TypeDeclaration.CLASS_DECL:<NEW_LINE>return (acceptFlags & <MASK><NEW_LINE>case TypeDeclaration.INTERFACE_DECL:<NEW_LINE>return (acceptFlags & ACCEPT_INTERFACES) != 0;<NEW_LINE>case TypeDeclaration.ENUM_DECL:<NEW_LINE>return (acceptFlags & ACCEPT_ENUMS) != 0;<NEW_LINE>case TypeDeclaration.RECORD_DECL:<NEW_LINE>return (acceptFlags & ACCEPT_RECORDS) != 0;<NEW_LINE>default:<NEW_LINE>// case IGenericType.ANNOTATION_TYPE :<NEW_LINE>return (acceptFlags & ACCEPT_ANNOTATIONS) != 0;<NEW_LINE>}<NEW_LINE>} catch (JavaModelException npe) {<NEW_LINE>// the class is not present, do not accept.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | (ACCEPT_CLASSES | ACCEPT_RECORDS)) != 0; |
442,205 | protected void onCreate(@Nullable final Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>mKickstarter = new ViewModelProvider(this).get(SignInKickstarter.class);<NEW_LINE>mKickstarter.init(getFlowParams());<NEW_LINE>mKickstarter.getOperation().observe(this, new ResourceObserver<IdpResponse>(this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(@NonNull IdpResponse response) {<NEW_LINE>finish(RESULT_OK, response.toIntent());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onFailure(@NonNull Exception e) {<NEW_LINE>if (e instanceof UserCancellationException) {<NEW_LINE>finish(RESULT_CANCELED, null);<NEW_LINE>} else if (e instanceof FirebaseAuthAnonymousUpgradeException) {<NEW_LINE>IdpResponse res = ((FirebaseAuthAnonymousUpgradeException) e).getResponse();<NEW_LINE>finish(RESULT_CANCELED, new Intent().putExtra(ExtraConstants.IDP_RESPONSE, res));<NEW_LINE>} else {<NEW_LINE>finish(RESULT_CANCELED, IdpResponse.getErrorIntent(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Task<Void> checkPlayServicesTask = getFlowParams().isPlayServicesRequired() ? GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(this) : Tasks<MASK><NEW_LINE>checkPlayServicesTask.addOnSuccessListener(this, aVoid -> {<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mKickstarter.start();<NEW_LINE>}).addOnFailureListener(this, e -> finish(RESULT_CANCELED, IdpResponse.getErrorIntent(new FirebaseUiException(ErrorCodes.PLAY_SERVICES_UPDATE_CANCELLED, e))));<NEW_LINE>} | .forResult((Void) null); |
831,679 | public static void registerTiles(BiConsumer<BlockEntityType<?>, ResourceLocation> r) {<NEW_LINE>r.accept(ALTAR, prefix(LibBlockNames.ALTAR));<NEW_LINE>r.accept(SPREADER, prefix(LibBlockNames.SPREADER));<NEW_LINE>r.accept(POOL, prefix(LibBlockNames.POOL));<NEW_LINE>r.accept(RUNE_ALTAR, prefix(LibBlockNames.RUNE_ALTAR));<NEW_LINE>r.accept(PYLON, prefix(LibBlockNames.PYLON));<NEW_LINE>r.accept(DISTRIBUTOR, prefix(LibBlockNames.DISTRIBUTOR));<NEW_LINE>r.accept(ENCHANTER, prefix(LibBlockNames.ENCHANTER));<NEW_LINE>r.accept(TURNTABLE, prefix(LibBlockNames.TURNTABLE));<NEW_LINE>r.accept(TINY_PLANET, prefix(LibBlockNames.TINY_PLANET));<NEW_LINE>r.accept(OPEN_CRATE, prefix(LibBlockNames.OPEN_CRATE));<NEW_LINE>r.accept(CRAFT_CRATE, prefix(LibBlockNames.CRAFT_CRATE));<NEW_LINE>r.accept(FORSET_EYE, prefix(LibBlockNames.FOREST_EYE));<NEW_LINE>r.accept(PLATFORM, prefix(LibBlockNames.PLATFORM));<NEW_LINE>r.accept(ALF_PORTAL, prefix(LibBlockNames.ALF_PORTAL));<NEW_LINE>r.accept(BIFROST<MASK><NEW_LINE>r.accept(MINI_ISLAND, prefix(LibBlockNames.MINI_ISLAND));<NEW_LINE>r.accept(TINY_POTATO, prefix(LibBlockNames.TINY_POTATO));<NEW_LINE>r.accept(SPAWNER_CLAW, prefix(LibBlockNames.SPAWNER_CLAW));<NEW_LINE>r.accept(ENDER_EYE, prefix(LibBlockNames.ENDER_EYE_BLOCK));<NEW_LINE>r.accept(STARFIELD, prefix(LibBlockNames.STARFIELD));<NEW_LINE>r.accept(FLUXFIELD, prefix(LibBlockNames.FLUXFIELD));<NEW_LINE>r.accept(BREWERY, prefix(LibBlockNames.BREWERY));<NEW_LINE>r.accept(TERRA_PLATE, prefix(LibBlockNames.TERRA_PLATE));<NEW_LINE>r.accept(RED_STRING_CONTAINER, prefix(LibBlockNames.RED_STRING_CONTAINER));<NEW_LINE>r.accept(RED_STRING_DISPENSER, prefix(LibBlockNames.RED_STRING_DISPENSER));<NEW_LINE>r.accept(RED_STRING_FERTILIZER, prefix(LibBlockNames.RED_STRING_FERTILIZER));<NEW_LINE>r.accept(RED_STRING_COMPARATOR, prefix(LibBlockNames.RED_STRING_COMPARATOR));<NEW_LINE>r.accept(RED_STRING_RELAY, prefix(LibBlockNames.RED_STRING_RELAY));<NEW_LINE>r.accept(MANA_FLAME, prefix(LibBlockNames.MANA_FLAME));<NEW_LINE>r.accept(PRISM, prefix(LibBlockNames.PRISM));<NEW_LINE>r.accept(CORPOREA_INDEX, prefix(LibBlockNames.CORPOREA_INDEX));<NEW_LINE>r.accept(CORPOREA_FUNNEL, prefix(LibBlockNames.CORPOREA_FUNNEL));<NEW_LINE>r.accept(PUMP, prefix(LibBlockNames.PUMP));<NEW_LINE>r.accept(FAKE_AIR, prefix(LibBlockNames.FAKE_AIR));<NEW_LINE>r.accept(CORPOREA_INTERCEPTOR, prefix(LibBlockNames.CORPOREA_INTERCEPTOR));<NEW_LINE>r.accept(CORPOREA_CRYSTAL_CUBE, prefix(LibBlockNames.CORPOREA_CRYSTAL_CUBE));<NEW_LINE>r.accept(INCENSE_PLATE, prefix(LibBlockNames.INCENSE_PLATE));<NEW_LINE>r.accept(HOURGLASS, prefix(LibBlockNames.HOURGLASS));<NEW_LINE>r.accept(SPARK_CHANGER, prefix(LibBlockNames.SPARK_CHANGER));<NEW_LINE>r.accept(COCOON, prefix(LibBlockNames.COCOON));<NEW_LINE>r.accept(LIGHT_RELAY, prefix(LibBlockNames.LIGHT_RELAY));<NEW_LINE>r.accept(CACOPHONIUM, prefix(LibBlockNames.CACOPHONIUM));<NEW_LINE>r.accept(BELLOWS, prefix(LibBlockNames.BELLOWS));<NEW_LINE>r.accept(CELL_BLOCK, prefix(LibBlockNames.CELL_BLOCK));<NEW_LINE>r.accept(RED_STRING_INTERCEPTOR, prefix(LibBlockNames.RED_STRING_INTERCEPTOR));<NEW_LINE>r.accept(GAIA_HEAD, prefix(LibBlockNames.GAIA_HEAD));<NEW_LINE>r.accept(CORPOREA_RETAINER, prefix(LibBlockNames.CORPOREA_RETAINER));<NEW_LINE>r.accept(TERU_TERU_BOZU, prefix(LibBlockNames.TERU_TERU_BOZU));<NEW_LINE>r.accept(AVATAR, prefix(LibBlockNames.AVATAR));<NEW_LINE>r.accept(ANIMATED_TORCH, prefix(LibBlockNames.ANIMATED_TORCH));<NEW_LINE>} | , prefix(LibBlockNames.BIFROST)); |
1,453,673 | public static ListDeployConfigResponse unmarshall(ListDeployConfigResponse listDeployConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDeployConfigResponse.setRequestId(_ctx.stringValue("ListDeployConfigResponse.RequestId"));<NEW_LINE>listDeployConfigResponse.setCode(_ctx.integerValue("ListDeployConfigResponse.Code"));<NEW_LINE>listDeployConfigResponse.setErrorMsg(_ctx.stringValue("ListDeployConfigResponse.ErrorMsg"));<NEW_LINE>listDeployConfigResponse.setPageNumber<MASK><NEW_LINE>listDeployConfigResponse.setPageSize(_ctx.integerValue("ListDeployConfigResponse.PageSize"));<NEW_LINE>listDeployConfigResponse.setTotalCount(_ctx.longValue("ListDeployConfigResponse.TotalCount"));<NEW_LINE>List<DeployConfigInstance> data = new ArrayList<DeployConfigInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDeployConfigResponse.Data.Length"); i++) {<NEW_LINE>DeployConfigInstance deployConfigInstance = new DeployConfigInstance();<NEW_LINE>deployConfigInstance.setName(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].Name"));<NEW_LINE>deployConfigInstance.setId(_ctx.longValue("ListDeployConfigResponse.Data[" + i + "].Id"));<NEW_LINE>deployConfigInstance.setAppId(_ctx.longValue("ListDeployConfigResponse.Data[" + i + "].AppId"));<NEW_LINE>deployConfigInstance.setEnvType(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].EnvType"));<NEW_LINE>ContainerCodePath containerCodePath = new ContainerCodePath();<NEW_LINE>containerCodePath.setCodePath(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerCodePath.CodePath"));<NEW_LINE>deployConfigInstance.setContainerCodePath(containerCodePath);<NEW_LINE>ContainerYamlConf containerYamlConf = new ContainerYamlConf();<NEW_LINE>containerYamlConf.setStatefulSet(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.StatefulSet"));<NEW_LINE>containerYamlConf.setDeployment(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.Deployment"));<NEW_LINE>containerYamlConf.setCronJob(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.CronJob"));<NEW_LINE>containerYamlConf.setConfigMap(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.ConfigMap"));<NEW_LINE>List<String> secretList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.SecretList.Length"); j++) {<NEW_LINE>secretList.add(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.SecretList[" + j + "]"));<NEW_LINE>}<NEW_LINE>containerYamlConf.setSecretList(secretList);<NEW_LINE>List<String> configMapList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.ConfigMapList.Length"); j++) {<NEW_LINE>configMapList.add(_ctx.stringValue("ListDeployConfigResponse.Data[" + i + "].ContainerYamlConf.ConfigMapList[" + j + "]"));<NEW_LINE>}<NEW_LINE>containerYamlConf.setConfigMapList(configMapList);<NEW_LINE>deployConfigInstance.setContainerYamlConf(containerYamlConf);<NEW_LINE>data.add(deployConfigInstance);<NEW_LINE>}<NEW_LINE>listDeployConfigResponse.setData(data);<NEW_LINE>return listDeployConfigResponse;<NEW_LINE>} | (_ctx.integerValue("ListDeployConfigResponse.PageNumber")); |
673,517 | final ListLoggingConfigurationsResult executeListLoggingConfigurations(ListLoggingConfigurationsRequest listLoggingConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLoggingConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLoggingConfigurationsRequest> request = null;<NEW_LINE>Response<ListLoggingConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLoggingConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLoggingConfigurationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLoggingConfigurations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLoggingConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new ListLoggingConfigurationsResultJsonUnmarshaller()); |
829,148 | public static ApiDefinitionExecResult addResult(BatchRunDefinitionRequest request, TestPlanApiCase key, String status) {<NEW_LINE>ApiDefinitionExecResult apiResult = new ApiDefinitionExecResult();<NEW_LINE>apiResult.setId(UUID.randomUUID().toString());<NEW_LINE>apiResult.setCreateTime(System.currentTimeMillis());<NEW_LINE>apiResult.setStartTime(System.currentTimeMillis());<NEW_LINE>apiResult.setEndTime(System.currentTimeMillis());<NEW_LINE>apiResult.setReportType(ReportTypeConstants.API_INDEPENDENT.name());<NEW_LINE>ApiTestCaseWithBLOBs caseWithBLOBs = CommonBeanFactory.getBean(ApiTestCaseMapper.class).selectByPrimaryKey(key.getApiCaseId());<NEW_LINE>if (caseWithBLOBs != null) {<NEW_LINE>apiResult.setName(caseWithBLOBs.getName());<NEW_LINE>apiResult.setProjectId(caseWithBLOBs.getProjectId());<NEW_LINE>apiResult.setVersionId(caseWithBLOBs.getVersionId());<NEW_LINE>}<NEW_LINE>apiResult.setTriggerMode(request.getTriggerMode());<NEW_LINE>apiResult.setActuator("LOCAL");<NEW_LINE>if (request.getConfig() != null && GenerateHashTreeUtil.isResourcePool(request.getConfig().getResourcePoolId()).isPool()) {<NEW_LINE>apiResult.setActuator(request.getConfig().getResourcePoolId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(request.getUserId())) {<NEW_LINE>if (SessionUtils.getUser() != null) {<NEW_LINE>apiResult.setUserId(SessionUtils.getUser().getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>apiResult.setUserId(request.getUserId());<NEW_LINE>}<NEW_LINE>apiResult.setResourceId(key.getApiCaseId());<NEW_LINE>apiResult.setStartTime(System.currentTimeMillis());<NEW_LINE>apiResult.setType(<MASK><NEW_LINE>apiResult.setStatus(status);<NEW_LINE>apiResult.setContent(request.getPlanReportId());<NEW_LINE>return apiResult;<NEW_LINE>} | ApiRunMode.API_PLAN.name()); |
1,087,948 | public boolean process(Person person, long time) {<NEW_LINE>// Randomly pick number of series and instances if bounds were provided<NEW_LINE>duplicateSeries(person, time);<NEW_LINE>duplicateInstances(person, time);<NEW_LINE>// The modality code of the first series is a good approximation<NEW_LINE>// of the type of ImagingStudy this is<NEW_LINE>String primaryModality = series.get(0).modality.code;<NEW_LINE>entry = person.record.imagingStudy(time, primaryModality, series);<NEW_LINE>// Add the procedure code to the ImagingStudy<NEW_LINE>String primaryProcedureCode = procedureCode.code;<NEW_LINE>entry.codes.add(procedureCode);<NEW_LINE>// Also add the Procedure equivalent of this ImagingStudy to the patient's record<NEW_LINE>HealthRecord.Procedure procedure = person.<MASK><NEW_LINE>procedure.name = this.name;<NEW_LINE>procedure.codes.add(procedureCode);<NEW_LINE>procedure.stop = procedure.start + TimeUnit.MINUTES.toMillis(30);<NEW_LINE>return true;<NEW_LINE>} | record.procedure(time, primaryProcedureCode); |
286,666 | private void processImports(ConfigurationClass configClass, SourceClass currentSourceClass, Collection<SourceClass> importCandidates, Predicate<String> exclusionFilter, boolean checkForCircularImports) {<NEW_LINE>if (importCandidates.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (checkForCircularImports && isChainedImportOnStack(configClass)) {<NEW_LINE>this.problemReporter.error(new CircularImportProblem(configClass, this.importStack));<NEW_LINE>} else {<NEW_LINE>this.importStack.push(configClass);<NEW_LINE>try {<NEW_LINE>for (SourceClass candidate : importCandidates) {<NEW_LINE>if (candidate.isAssignable(ImportSelector.class)) {<NEW_LINE>// Candidate class is an ImportSelector -> delegate to it to determine imports<NEW_LINE>Class<?> candidateClass = candidate.loadClass();<NEW_LINE>ImportSelector selector = ParserStrategyUtils.instantiateClass(candidateClass, ImportSelector.class, this.environment, this.resourceLoader, this.registry);<NEW_LINE>Predicate<String> selectorFilter = selector.getExclusionFilter();<NEW_LINE>if (selectorFilter != null) {<NEW_LINE>exclusionFilter = exclusionFilter.or(selectorFilter);<NEW_LINE>}<NEW_LINE>if (selector instanceof DeferredImportSelector) {<NEW_LINE>this.deferredImportSelectorHandler.handle(configClass, (DeferredImportSelector) selector);<NEW_LINE>} else {<NEW_LINE>String[] importClassNames = selector.<MASK><NEW_LINE>Collection<SourceClass> importSourceClasses = asSourceClasses(importClassNames, exclusionFilter);<NEW_LINE>processImports(configClass, currentSourceClass, importSourceClasses, exclusionFilter, false);<NEW_LINE>}<NEW_LINE>} else if (candidate.isAssignable(ImportBeanDefinitionRegistrar.class)) {<NEW_LINE>// Candidate class is an ImportBeanDefinitionRegistrar -><NEW_LINE>// delegate to it to register additional bean definitions<NEW_LINE>Class<?> candidateClass = candidate.loadClass();<NEW_LINE>ImportBeanDefinitionRegistrar registrar = ParserStrategyUtils.instantiateClass(candidateClass, ImportBeanDefinitionRegistrar.class, this.environment, this.resourceLoader, this.registry);<NEW_LINE>configClass.addImportBeanDefinitionRegistrar(registrar, currentSourceClass.getMetadata());<NEW_LINE>} else {<NEW_LINE>// Candidate class not an ImportSelector or ImportBeanDefinitionRegistrar -><NEW_LINE>// process it as an @Configuration class<NEW_LINE>this.importStack.registerImport(currentSourceClass.getMetadata(), candidate.getMetadata().getClassName());<NEW_LINE>processConfigurationClass(candidate.asConfigClass(configClass), exclusionFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BeanDefinitionStoreException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>throw new BeanDefinitionStoreException("Failed to process import candidates for configuration class [" + configClass.getMetadata().getClassName() + "]", ex);<NEW_LINE>} finally {<NEW_LINE>this.importStack.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | selectImports(currentSourceClass.getMetadata()); |
97,526 | public static String rightPad(final String str, final int size, String padStr) {<NEW_LINE>if (str == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(padStr)) {<NEW_LINE>padStr = " ";<NEW_LINE>}<NEW_LINE>int padLen = padStr.length();<NEW_LINE>int strLen = str.length();<NEW_LINE>int pads = size - strLen;<NEW_LINE>if (pads <= 0) {<NEW_LINE>// returns original String when possible<NEW_LINE>return str;<NEW_LINE>}<NEW_LINE>if (padLen == 1 && pads <= StringUtils.PAD_LIMIT) {<NEW_LINE>return StringUtils.rightPad(str, size, padStr.charAt(0));<NEW_LINE>}<NEW_LINE>if (pads == padLen) {<NEW_LINE>return str.concat(padStr);<NEW_LINE>} else if (pads < padLen) {<NEW_LINE>return str.concat(padStr.substring(0, pads));<NEW_LINE>} else {<NEW_LINE>char[] padding = new char[pads];<NEW_LINE>char[<MASK><NEW_LINE>for (int i = 0; i < pads; i++) {<NEW_LINE>padding[i] = padChars[i % padLen];<NEW_LINE>}<NEW_LINE>return str.concat(new String(padding));<NEW_LINE>}<NEW_LINE>} | ] padChars = padStr.toCharArray(); |
580,471 | void validateAffectedFolds(Fold fold, DocumentEvent evt, Collection damaged) {<NEW_LINE><MASK><NEW_LINE>int endOffset = startOffset + evt.getLength();<NEW_LINE>int childIndex = FoldUtilitiesImpl.findFoldStartIndex(fold, startOffset, true);<NEW_LINE>if (childIndex == -1) {<NEW_LINE>if (fold.getFoldCount() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Fold first = fold.getFold(0);<NEW_LINE>if (first.getStartOffset() <= endOffset) {<NEW_LINE>childIndex = 0;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (childIndex >= 1) {<NEW_LINE>Fold prevChildFold = fold.getFold(childIndex - 1);<NEW_LINE>if (prevChildFold.getEndOffset() == startOffset) {<NEW_LINE>validateAffectedFolds(prevChildFold, evt, damaged);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int pStart = fold.getStartOffset();<NEW_LINE>int pEnd = fold.getEndOffset();<NEW_LINE>boolean removed;<NEW_LINE>boolean startsWithin = false;<NEW_LINE>do {<NEW_LINE>Fold childFold = fold.getFold(childIndex);<NEW_LINE>int cStart = childFold.getStartOffset();<NEW_LINE>int cEnd = childFold.getEndOffset();<NEW_LINE>startsWithin = cStart < startOffset && cEnd <= endOffset;<NEW_LINE>removed = false;<NEW_LINE>if (cStart < pStart || cEnd > pEnd || cStart == cEnd) {<NEW_LINE>damaged.add(childFold);<NEW_LINE>}<NEW_LINE>if (childFold.getFoldCount() > 0) {<NEW_LINE>// check children<NEW_LINE>// Some children could be damaged even if this one was not<NEW_LINE>validateAffectedFolds(childFold, evt, damaged);<NEW_LINE>}<NEW_LINE>childIndex++;<NEW_LINE>} while ((startsWithin || removed) && childIndex < fold.getFoldCount());<NEW_LINE>} | int startOffset = evt.getOffset(); |
363,920 | protected void registerCustomCredential(final Props props, final Credentials hadoopCred, final String userToProxy, final org.apache.log4j.Logger jobLogger, final String customCredentialProviderName) {<NEW_LINE>final CredentialProvider customCredential = getCustomCredentialProvider(props, hadoopCred, jobLogger, customCredentialProviderName);<NEW_LINE>final KeyStore keyStore = KeyStoreManager.getInstance().getKeyStore();<NEW_LINE>if (keyStore != null) {<NEW_LINE>// KeyStore is prepopulated to be used by Credential Provider.<NEW_LINE>// This KeyStore is expected especially in case of containerized execution when it is preferred<NEW_LINE>// to keep it in-memory of Azkaban user rather than on the file-system of container. This ensures<NEW_LINE>// that the user can't access it.<NEW_LINE>try {<NEW_LINE>((CredentialProviderWithKeyStore) customCredential).setKeyStore(keyStore);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>logger.error("Encountered error while casting to CredentialProviderWithKeyStore", e);<NEW_LINE>throw new IllegalStateException("Encountered error while casting to CredentialProviderWithKeyStore", e);<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>throw new IllegalStateException("Unknown error occurred while setting keyStore", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>customCredential.register(userToProxy);<NEW_LINE>} | logger.error("Unknown error occurred while setting keyStore", e); |
1,744,539 | public void finish() throws IOException {<NEW_LINE>for (MKVMuxerTrack track : tracks) {<NEW_LINE>track.finish();<NEW_LINE>}<NEW_LINE>beforeCues = sink.position();<NEW_LINE>mkvCues <MASK><NEW_LINE>muxCues();<NEW_LINE>mkvCues.mux(sink);<NEW_LINE>eof = sink.position();<NEW_LINE>sink.setPosition(afterebmlHeader);<NEW_LINE>// Segment basic details<NEW_LINE>ByteBuffer segmentHeader = ByteBuffer.allocate(12);<NEW_LINE>segmentHeader.put(Segment.id);<NEW_LINE>segmentHeader.put(EbmlUtil.ebmlEncodeLen(eof - afterebmlHeader - 12, 8));<NEW_LINE>segmentHeader.flip();<NEW_LINE>sink.write(segmentHeader);<NEW_LINE>afterSegment = sink.position();<NEW_LINE>mkvInfo = muxInfo();<NEW_LINE>mkvSeekHead = muxSeekHead();<NEW_LINE>mkvSeekHead.mux(sink);<NEW_LINE>mkvInfo.mux(sink);<NEW_LINE>mkvTracks.mux(sink);<NEW_LINE>long endOfHeaders = sink.position();<NEW_LINE>long needsVoid = beforeClusters - endOfHeaders;<NEW_LINE>ByteBuffer voidFiller = ByteBuffer.allocate((int) needsVoid);<NEW_LINE>voidFiller.put(MKVType.Void.id);<NEW_LINE>voidFiller.put(EbmlUtil.ebmlEncodeLen(needsVoid - 1 - 8, 8));<NEW_LINE>voidFiller.flip();<NEW_LINE>sink.write(voidFiller);<NEW_LINE>} | = (EbmlMaster) createByType(Cues); |
1,790,814 | public Object call(Object who, Method method, Object... args) throws Throwable {<NEW_LINE>IInterface appThread = (IInterface) args[0];<NEW_LINE>Intent service = (Intent) args[1];<NEW_LINE>String resolvedType = (String) args[2];<NEW_LINE>if (service.getComponent() != null && getHostPkg().equals(service.getComponent().getPackageName())) {<NEW_LINE>// for server process<NEW_LINE>return method.invoke(who, args);<NEW_LINE>}<NEW_LINE>int userId = VUserHandle.myUserId();<NEW_LINE>if (service.getBooleanExtra("_VA_|_from_inner_", false)) {<NEW_LINE>userId = service.getIntExtra("_VA_|_user_id_", userId);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>if (isServerProcess()) {<NEW_LINE>userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>service.setDataAndType(service.getData(), resolvedType);<NEW_LINE>ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, VUserHandle.myUserId());<NEW_LINE>if (serviceInfo != null) {<NEW_LINE>if (isFiltered(service)) {<NEW_LINE>return service.getComponent();<NEW_LINE>}<NEW_LINE>return VActivityManager.get().startService(appThread, service, resolvedType, userId);<NEW_LINE>}<NEW_LINE>return method.invoke(who, args);<NEW_LINE>} | service = service.getParcelableExtra("_VA_|_intent_"); |
945,552 | protected void parseLightArray(BitSet mask, BitSet emptyMask, DataTypeProvider provider, BiConsumer<ChunkSection, byte[]> c, Function<ChunkSection, byte[]> get) {<NEW_LINE>for (int sectionY = getMinSection(); sectionY <= (getMaxSection() + 1) && (!mask.isEmpty() || !emptyMask.isEmpty()); sectionY++) {<NEW_LINE>ChunkSection s = getChunkSection(sectionY);<NEW_LINE>if (s == null) {<NEW_LINE>s = createNewChunkSection((byte) sectionY, Palette.empty());<NEW_LINE>s.setBlocks(new long[256]);<NEW_LINE>setChunkSection(sectionY, s);<NEW_LINE>}<NEW_LINE>// Mask tells us if a section is present or not<NEW_LINE>if (!mask.get(sectionY - getMinSection())) {<NEW_LINE>if (!emptyMask.get(sectionY - getMinSection())) {<NEW_LINE>c.accept(<MASK><NEW_LINE>}<NEW_LINE>emptyMask.set(sectionY - getMinSection(), false);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>mask.set(sectionY - getMinSection(), false);<NEW_LINE>int skyLength = provider.readVarInt();<NEW_LINE>byte[] data = provider.readByteArray(skyLength);<NEW_LINE>c.accept(s, data);<NEW_LINE>}<NEW_LINE>} | s, new byte[2048]); |
777,081 | public void annotate(final ReferenceContext ref, final VariantContext vc, final Genotype g, final GenotypeBuilder gb, final AlleleLikelihoods<GATKRead, Allele> likelihoods) {<NEW_LINE>Utils.nonNull(vc);<NEW_LINE>Utils.nonNull(g);<NEW_LINE>Utils.nonNull(gb);<NEW_LINE>if (likelihoods == null || !g.isCalled()) {<NEW_LINE>droppedElementLogger.warn(() -> AnnotationUtils.generateMissingDataWarning(vc, g, likelihoods));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check that there are reads<NEW_LINE>final String sample = g.getSampleName();<NEW_LINE>if (likelihoods.sampleEvidenceCount(likelihoods.indexOfSample(sample)) == 0) {<NEW_LINE>gb.DP(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Set<Allele> alleles = new LinkedHashSet<>(vc.getAlleles());<NEW_LINE>// make sure that there's a meaningful relationship between the alleles in the likelihoods and our VariantContext<NEW_LINE>if (!likelihoods.alleles().containsAll(alleles)) {<NEW_LINE>logger.warn("VC alleles " + alleles + " not a strict subset of AlleleLikelihoods alleles " + likelihoods.alleles());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// the depth for the HC is the sum of the informative alleles at this site. It's not perfect (as we cannot<NEW_LINE>// differentiate between reads that align over the event but aren't informative vs. those that aren't even<NEW_LINE>// close) but it's a pretty good proxy and it matches with the AD field (i.e., sum(AD) = DP).<NEW_LINE>final Map<Allele, List<Allele>> alleleSubset = alleles.stream().collect(Collectors.toMap(a -> a, a -> Arrays.asList(a)));<NEW_LINE>final AlleleLikelihoods<GATKRead, Allele> <MASK><NEW_LINE>final int depth = (int) subsettedLikelihoods.bestAllelesBreakingTies(sample).stream().filter(ba -> ba.isInformative()).count();<NEW_LINE>gb.DP(depth);<NEW_LINE>} | subsettedLikelihoods = likelihoods.marginalize(alleleSubset); |
719,764 | private Node buildFilteredTableViewControl() {<NEW_LINE>final GridPane grid = new GridPane();<NEW_LINE>grid.setHgap(5);<NEW_LINE>grid.setVgap(10);<NEW_LINE>grid.setPadding(new Insets(5, 5, 5, 5));<NEW_LINE>int row = 0;<NEW_LINE>final Label label = new Label("Select the columns filter editor from the options below");<NEW_LINE>label.setWrapText(true);<NEW_LINE>grid.add(label, 0, row++);<NEW_LINE>ToggleGroup filterGroup = new ToggleGroup();<NEW_LINE>RadioButton popupFilter = new RadioButton("Use PopupFilter");<NEW_LINE>popupFilter.setSelected(true);<NEW_LINE>popupFilter.setToggleGroup(filterGroup);<NEW_LINE>grid.add<MASK><NEW_LINE>RadioButton southFilter = new RadioButton("Use FilterEditor in SouthNode");<NEW_LINE>southFilter.setToggleGroup(filterGroup);<NEW_LINE>grid.add(southFilter, 0, row++);<NEW_LINE>filterGroup.selectedToggleProperty().addListener((obs, ov, nv) -> table.setupFilter(nv == southFilter));<NEW_LINE>return new TitledPane("FilteredTableView Options", grid);<NEW_LINE>} | (popupFilter, 0, row++); |
1,691,300 | public void actionPerformed(ActionEvent e) {<NEW_LINE>if (mSelectedRecording == null) {<NEW_LINE>JOptionPane.showMessageDialog(AddRecordingTunerDialog.this, "Please select a recording file", "Select a Recording File", JOptionPane.ERROR_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long frequency = getFrequency();<NEW_LINE>if (frequency <= 0 || frequency > Integer.MAX_VALUE) {<NEW_LINE>JOptionPane.showMessageDialog(AddRecordingTunerDialog.this, "Please provide a recording center frequency (1 Hz to 2.14 GHz)", "Center Frequency Required", JOptionPane.ERROR_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mLog.info("Adding recording tuner = frequency [" + frequency + "] recording [" + mSelectedRecording.getAbsolutePath() + "]");<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>mTunerModel.addTuner(tuner);<NEW_LINE>RecordingTunerController controller = tuner.getTunerController();<NEW_LINE>RecordingTunerConfiguration config = new RecordingTunerConfiguration();<NEW_LINE>config.setFrequency(frequency);<NEW_LINE>config.setPath(mSelectedRecording.getAbsolutePath());<NEW_LINE>controller.apply(config);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>mLog.error("Error adding recording tuner", ex);<NEW_LINE>}<NEW_LINE>AddRecordingTunerDialog.this.setVisible(false);<NEW_LINE>} | RecordingTuner tuner = new RecordingTuner(mUserPreferences); |
1,762,179 | public Object invoke(@Nullable Object proxy, @Nullable Method method, Object @Nullable [] args) throws Throwable {<NEW_LINE>if (method != null) {<NEW_LINE>Invocation invocation = new Invocation(this, method, args);<NEW_LINE>Invocation activeInvocation = getManager().getActiveInvocation();<NEW_LINE>if (activeInvocation != null) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug(MSG_CONTEXT, toString(method), getTarget());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>activeInvocation.getInvocationStack().push(invocation);<NEW_LINE>return invokeDirect(invocation);<NEW_LINE>} finally {<NEW_LINE>activeInvocation.getInvocationStack().poll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Future<Object> future = getManager().<MASK><NEW_LINE>return future.get(getTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>handleTimeout(method, invocation);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>handleExecutionException(method, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getScheduler().submit(invocation); |
796,271 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String privateLinkHubName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateLinkHubName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, privateLinkHubName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); |
73,439 | public void run(RegressionEnvironment env) {<NEW_LINE>String selectStmt = "select * from SupportBean#length(5)";<NEW_LINE>String statement1 = "@name('s0') " + selectStmt + " output every 1 events";<NEW_LINE>String statement2 = "@name('s1') " + selectStmt + " output every 2 events";<NEW_LINE>String statement3 = "@name('s2') " + selectStmt + " output every 3 events";<NEW_LINE>env.compileDeploy(statement1).addListener("s0");<NEW_LINE>env.compileDeploy(statement2).addListener("s1");<NEW_LINE>env.compileDeploy(statement3).addListener("s2");<NEW_LINE>// send event 1<NEW_LINE>sendEvent(env, "IBM");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.assertListenerNotInvoked("s2");<NEW_LINE>// send event 2<NEW_LINE>sendEvent(env, "MSFT");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.assertListener("s1", listener -> {<NEW_LINE>assertEquals(2, listener.getLastNewData().length);<NEW_LINE><MASK><NEW_LINE>listener.reset();<NEW_LINE>});<NEW_LINE>env.assertListenerNotInvoked("s2");<NEW_LINE>// send event 3<NEW_LINE>sendEvent(env, "YAH");<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.assertListener("s2", listener -> {<NEW_LINE>assertEquals(3, listener.getLastNewData().length);<NEW_LINE>assertNull(listener.getLastOldData());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | assertNull(listener.getLastOldData()); |
403,302 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>if (Boolean.parseBoolean(request.getParameter("throw"))) {<NEW_LINE>throw new ServletException("Test Exception");<NEW_LINE>}<NEW_LINE>response.setContentType("text/html");<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE><MASK><NEW_LINE>out.println("<h1>DumpServlet</h1>");<NEW_LINE>out.println("<h2>Context Fields:</h2>");<NEW_LINE>out.println("<pre>");<NEW_LINE>out.printf("serverInfo=%s%n", getServletContext().getServerInfo());<NEW_LINE>out.printf("getServletContextName=%s%n", getServletContext().getServletContextName());<NEW_LINE>out.printf("virtualServerName=%s%n", getServletContext().getVirtualServerName());<NEW_LINE>out.printf("contextPath=%s%n", getServletContext().getContextPath());<NEW_LINE>out.printf("version=%d.%d%n", getServletContext().getMajorVersion(), getServletContext().getMinorVersion());<NEW_LINE>out.printf("effectiveVersion=%d.%d%n", getServletContext().getEffectiveMajorVersion(), getServletContext().getEffectiveMinorVersion());<NEW_LINE>out.println("</pre>");<NEW_LINE>out.println("<h2>Request Fields:</h2>");<NEW_LINE>out.println("<pre>");<NEW_LINE>out.printf("remoteHost/Addr:port=%s/%s:%d%n", request.getRemoteHost(), request.getRemoteAddr(), request.getRemotePort());<NEW_LINE>out.printf("localName/Addr:port=%s/%s:%d%n", request.getLocalName(), request.getLocalAddr(), request.getLocalPort());<NEW_LINE>out.printf("scheme=%s method=%s protocol=%s%n", request.getScheme(), request.getMethod(), request.getProtocol());<NEW_LINE>out.printf("serverName:serverPort=%s:%d%n", request.getServerName(), request.getServerPort());<NEW_LINE>out.printf("requestURI=%s%n", request.getRequestURI());<NEW_LINE>out.printf("requestURL=%s%n", request.getRequestURL().toString());<NEW_LINE>out.printf("contextPath|servletPath|pathInfo=%s|%s|%s%n", request.getContextPath(), request.getServletPath(), request.getPathInfo());<NEW_LINE>out.printf("session/new=%s/%b%n", request.getSession(true).getId(), request.getSession().isNew());<NEW_LINE>out.println("</pre>");<NEW_LINE>out.println("<h2>Request Headers:</h2>");<NEW_LINE>out.println("<pre>");<NEW_LINE>for (String n : Collections.list(request.getHeaderNames())) {<NEW_LINE>for (String v : Collections.list(request.getHeaders(n))) {<NEW_LINE>out.printf("%s: %s%n", n, v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println("</pre>");<NEW_LINE>out.println("<h2>Response Fields:</h2>");<NEW_LINE>out.println("<pre>");<NEW_LINE>out.printf("bufferSize=%d%n", response.getBufferSize());<NEW_LINE>out.printf("encodedURL(\"/foo/bar\")=%s%n", response.encodeURL("/foo/bar"));<NEW_LINE>out.printf("encodedRedirectURL(\"/foo/bar\")=%s%n", response.encodeRedirectURL("/foo/bar"));<NEW_LINE>out.println("</pre>");<NEW_LINE>} | PrintWriter out = response.getWriter(); |
173,659 | protected Document parse(InputStream is) throws Exception {<NEW_LINE>DocumentBuilder builder = getNsAwareDocumentBuilderFactory().newDocumentBuilder();<NEW_LINE>Document doc;<NEW_LINE>try {<NEW_LINE>doc = builder.parse(is);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (configurationFile != null) {<NEW_LINE>String msg = "Failed to parse " + configurationFile + LINE_SEPARATOR + "Exception: " + e.getMessage() + LINE_SEPARATOR + "Hazelcast startup interrupted.";<NEW_LINE>LOGGER.severe(msg);<NEW_LINE>} else if (configurationUrl != null) {<NEW_LINE>String msg = "Failed to parse " + configurationUrl + LINE_SEPARATOR + "Exception: " + e.getMessage() + LINE_SEPARATOR + "Hazelcast startup interrupted.";<NEW_LINE>LOGGER.severe(msg);<NEW_LINE>} else {<NEW_LINE>String msg = "Failed to parse the inputstream" + LINE_SEPARATOR + "Exception: " + e<MASK><NEW_LINE>LOGGER.severe(msg);<NEW_LINE>}<NEW_LINE>throw new InvalidConfigurationException(e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>IOUtil.closeResource(is);<NEW_LINE>}<NEW_LINE>return doc;<NEW_LINE>} | .getMessage() + LINE_SEPARATOR + "Hazelcast startup interrupted."; |
281,052 | private void initLocator() {<NEW_LINE>log.fine("");<NEW_LINE>// Load Warehouse<NEW_LINE>String sql = "SELECT M_Warehouse_ID, Name FROM M_Warehouse";<NEW_LINE>if (m_only_Warehouse_ID != 0)<NEW_LINE>sql += " WHERE M_Warehouse_ID=" + m_only_Warehouse_ID;<NEW_LINE>String SQL = MRole.getDefault().addAccessSQL(sql, "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) + " ORDER BY 2";<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(SQL, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair key = new KeyNamePair(rs.getInt(1), rs.getString(2));<NEW_LINE>lstWarehouse.appendItem(key.getName(), key);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, SQL, e);<NEW_LINE>}<NEW_LINE>log.fine("Warehouses=" + lstWarehouse.getItemCount());<NEW_LINE>// Load existing Locators<NEW_LINE>m_mLocator.fillComboBox(m_mandatory, true, true, false);<NEW_LINE>log.fine(m_mLocator.toString());<NEW_LINE>for (int i = 0; i < m_mLocator.getSize(); i++) {<NEW_LINE>Object obj = m_mLocator.getElementAt(i);<NEW_LINE>lstLocator.appendItem(obj.toString(), obj);<NEW_LINE>}<NEW_LINE>// lstLocator.setModel(m_mLocator);<NEW_LINE>// lstLocator.setValue(m_M_Locator_ID);<NEW_LINE>lstLocator.setSelectedIndex(0);<NEW_LINE>lstLocator.<MASK><NEW_LINE>displayLocator();<NEW_LINE>chkCreateNew.setChecked(false);<NEW_LINE>chkCreateNew.addEventListener(Events.ON_CHECK, this);<NEW_LINE>enableNew();<NEW_LINE>lstWarehouse.addEventListener(Events.ON_SELECT, this);<NEW_LINE>txtAisleX.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>txtBinY.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>txtLevelZ.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>// Update UI<NEW_LINE>// pack();<NEW_LINE>} | addEventListener(Events.ON_SELECT, this); |
728,939 | private void configureShiroForRBAC() {<NEW_LINE>final RbacConfig config = new ConfigurationObjectFactory(configSource).build(RbacConfig.class);<NEW_LINE>bind(RbacConfig.class).toInstance(config);<NEW_LINE>bindRealm().to(KillBillJdbcRealm.class).asEagerSingleton();<NEW_LINE>if (KillBillShiroModule.isLDAPEnabled()) {<NEW_LINE>bindRealm().to(KillBillJndiLdapRealm.class).asEagerSingleton();<NEW_LINE>}<NEW_LINE>if (KillBillShiroModule.isOktaEnabled()) {<NEW_LINE>bindRealm().to(KillBillOktaRealm.class).asEagerSingleton();<NEW_LINE>}<NEW_LINE>if (KillBillShiroModule.isAuth0Enabled()) {<NEW_LINE>bindRealm().to(KillBillAuth0Realm.class).asEagerSingleton();<NEW_LINE>}<NEW_LINE>if (KillBillShiroModule.isRBACEnabled()) {<NEW_LINE>addFilterChain(JaxrsResource.PREFIX + "/**", Key.get(BearerHttpAuthenticationPermissiveFilter.class), Key.get(CorsBasicHttpAuthenticationFilter.class));<NEW_LINE>addFilterChain(JaxrsResource.PLUGINS_PATH + "/**", Key.get(BearerHttpAuthenticationPermissiveFilter.class), Key<MASK><NEW_LINE>}<NEW_LINE>} | .get(CorsBasicHttpAuthenticationOptionalFilter.class)); |
1,071,433 | public void renderTo(Iterable<BlockDoc> blocks, Element parent) {<NEW_LINE>Document document = parent.getOwnerDocument();<NEW_LINE>// <thead><NEW_LINE>// <tr><NEW_LINE>// <td>Block</td><NEW_LINE>// <td>Description</td><NEW_LINE>// </tr><NEW_LINE>// </thead><NEW_LINE>Element thead = document.createElement("thead");<NEW_LINE>parent.appendChild(thead);<NEW_LINE>Element tr = document.createElement("tr");<NEW_LINE>thead.appendChild(tr);<NEW_LINE>Element <MASK><NEW_LINE>tr.appendChild(td);<NEW_LINE>td.appendChild(document.createTextNode("Block"));<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>td.appendChild(document.createTextNode("Description"));<NEW_LINE>for (BlockDoc blockDoc : blocks) {<NEW_LINE>// <tr><NEW_LINE>// <td><link linkend="$id"><literal>$name</literal></link</td><NEW_LINE>// <td>$description</td><NEW_LINE>// </tr><NEW_LINE>tr = document.createElement("tr");<NEW_LINE>parent.appendChild(tr);<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>Element link = document.createElement("link");<NEW_LINE>td.appendChild(link);<NEW_LINE>link.setAttribute("linkend", blockDoc.getId());<NEW_LINE>Element literal = document.createElement("literal");<NEW_LINE>link.appendChild(literal);<NEW_LINE>literal.appendChild(document.createTextNode(blockDoc.getName()));<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>if (blockDoc.isDeprecated()) {<NEW_LINE>Element caution = document.createElement("caution");<NEW_LINE>td.appendChild(caution);<NEW_LINE>caution.appendChild(document.createTextNode("Deprecated"));<NEW_LINE>}<NEW_LINE>if (blockDoc.isIncubating()) {<NEW_LINE>Element caution = document.createElement("caution");<NEW_LINE>td.appendChild(caution);<NEW_LINE>caution.appendChild(document.createTextNode("Incubating"));<NEW_LINE>}<NEW_LINE>td.appendChild(document.importNode(blockDoc.getDescription(), true));<NEW_LINE>}<NEW_LINE>} | td = document.createElement("td"); |
1,540,993 | public static CompositeValuesSourceBuilder<?> fromXContent(XContentParser parser) throws IOException {<NEW_LINE>XContentParser.Token token = parser.currentToken();<NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>token = parser.nextToken();<NEW_LINE>ensureExpectedToken(XContentParser.Token.FIELD_NAME, token, parser);<NEW_LINE>String name = parser.currentName();<NEW_LINE>token = parser.nextToken();<NEW_LINE>ensureExpectedToken(XContentParser.<MASK><NEW_LINE>token = parser.nextToken();<NEW_LINE>ensureExpectedToken(XContentParser.Token.FIELD_NAME, token, parser);<NEW_LINE>String type = parser.currentName();<NEW_LINE>token = parser.nextToken();<NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>final CompositeValuesSourceBuilder<?> builder;<NEW_LINE>switch(type) {<NEW_LINE>case TermsValuesSourceBuilder.TYPE:<NEW_LINE>builder = TermsValuesSourceBuilder.parse(name, parser);<NEW_LINE>break;<NEW_LINE>case DateHistogramValuesSourceBuilder.TYPE:<NEW_LINE>builder = DateHistogramValuesSourceBuilder.PARSER.parse(parser, name);<NEW_LINE>break;<NEW_LINE>case HistogramValuesSourceBuilder.TYPE:<NEW_LINE>builder = HistogramValuesSourceBuilder.parse(name, parser);<NEW_LINE>break;<NEW_LINE>case GeoTileGridValuesSourceBuilder.TYPE:<NEW_LINE>builder = GeoTileGridValuesSourceBuilder.parse(name, parser);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ParsingException(parser.getTokenLocation(), "invalid source type: " + type);<NEW_LINE>}<NEW_LINE>parser.nextToken();<NEW_LINE>parser.nextToken();<NEW_LINE>return builder;<NEW_LINE>} | Token.START_OBJECT, token, parser); |
544,585 | private static MysqlDateTime handleYearInterval(MysqlDateTime src, MySQLInterval interval) {<NEW_LINE>MysqlDateTime ret = new MysqlDateTime();<NEW_LINE>ret.setSqlType(src.getSqlType());<NEW_LINE>int sign = interval.isNeg() ? -1 : 1;<NEW_LINE>long year = src.getYear() + sign * interval.getYear();<NEW_LINE><MASK><NEW_LINE>long day = src.getDay();<NEW_LINE>if (year < 0 || year > 10000L) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (month > 0 && day > MySQLTimeTypeUtil.DAYS_IN_MONTH[(int) (month - 1)] && !(month == 2 && day == 29 && MySQLTimeTypeUtil.calcDaysInYear((int) year) == 366)) {<NEW_LINE>day = 28;<NEW_LINE>}<NEW_LINE>ret.setYear(year);<NEW_LINE>ret.setMonth(month);<NEW_LINE>ret.setDay(day);<NEW_LINE>ret.setSecondPart(src.getSecondPart());<NEW_LINE>ret.setSecond(src.getSecond());<NEW_LINE>ret.setMinute(src.getMinute());<NEW_LINE>ret.setHour(src.getHour());<NEW_LINE>return ret;<NEW_LINE>} | long month = src.getMonth(); |
146,455 | public okhttp3.Call readNamespacedHorizontalPodAutoscalerStatusCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | final String[] localVarContentTypes = {}; |
673,189 | // Dump the content of this bean returning it as a String<NEW_LINE>public void dump(StringBuffer str, String indent) {<NEW_LINE>String s;<NEW_LINE>Object o;<NEW_LINE>org.netbeans.modules.schema2beans.BaseBean n;<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyOne");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyOne();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_ONE, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyTwo");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyTwo();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_TWO, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyThree[" + this.sizePropertyThree() + "]");<NEW_LINE>for (int i = 0; i < this.sizePropertyThree(); i++) {<NEW_LINE>str.append(indent + "\t");<NEW_LINE>str.append("#" + i + ":");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyThree(i);<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_THREE, i, str, indent);<NEW_LINE>}<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("PropertyFour[" + this.sizePropertyFour() + "]");<NEW_LINE>for (int i = 0; i < this.sizePropertyFour(); i++) {<NEW_LINE><MASK><NEW_LINE>str.append("#" + i + ":");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getPropertyFour(i);<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(PROPERTY_FOUR, i, str, indent);<NEW_LINE>}<NEW_LINE>} | str.append(indent + "\t"); |
1,365,343 | private JoinReference buildJoin(Queryable source, String referenceName, Map<String, Argument> callingColumnArgs, Map<String, Argument> fixedArguments) {<NEW_LINE>Queryable root = source.getRoot();<NEW_LINE>Type<?> tableClass = dictionary.getEntityClass(root.getName(), root.getVersion());<NEW_LINE>JoinPath joinPath = new JoinPath(tableClass, metaDataStore, referenceName);<NEW_LINE>Path.PathElement lastElement = joinPath.lastElement().get();<NEW_LINE>Queryable joinSource = metaDataStore.<MASK><NEW_LINE>String fieldName = lastElement.getFieldName();<NEW_LINE>Reference reference;<NEW_LINE>if (fieldName.startsWith("$")) {<NEW_LINE>reference = PhysicalReference.builder().source(joinSource).name(fieldName.substring(1)).build();<NEW_LINE>} else {<NEW_LINE>ColumnProjection referencedColumn = joinSource.getColumnProjection(fieldName);<NEW_LINE>ColumnProjection newColumn = referencedColumn.withArguments(mergedArgumentMap(referencedColumn.getArguments(), callingColumnArgs, fixedArguments));<NEW_LINE>reference = LogicalReference.builder().source(joinSource).column(newColumn).references(buildReferenceForColumn(joinSource, newColumn)).build();<NEW_LINE>}<NEW_LINE>return JoinReference.builder().path(joinPath).source(source).reference(reference).build();<NEW_LINE>} | getTable(lastElement.getType()); |
707,991 | public // sub-level<NEW_LINE>void // sub-level<NEW_LINE>forSubResourceMethod(// sub-level<NEW_LINE>ClassCreator subClassCreator, // sub-level<NEW_LINE>MethodCreator subConstructor, // sub-level<NEW_LINE>MethodCreator subClinit, // sub-level<NEW_LINE>MethodCreator subMethodCreator, // sub-level<NEW_LINE>ClassInfo rootInterfaceClass, // sub-level<NEW_LINE>ClassInfo subInterfaceClass, // sub-level<NEW_LINE>MethodInfo subMethod, // sub-level<NEW_LINE>MethodInfo rootMethod, AssignableResultHandle invocationBuilder, IndexView index, BuildProducer<GeneratedClassBuildItem> generatedClasses, int methodIndex, int subMethodIndex, FieldDescriptor javaMethodField) {<NEW_LINE>addJavaMethodToContext(javaMethodField, subMethodCreator, invocationBuilder);<NEW_LINE>Map<String, HeaderData> headerFillersByName = new HashMap<>();<NEW_LINE>collectHeaderFillers(rootInterfaceClass, rootMethod, headerFillersByName);<NEW_LINE>collectHeaderFillers(subInterfaceClass, subMethod, headerFillersByName);<NEW_LINE>String subHeaderFillerName = subInterfaceClass.name().toString() + sha1(rootInterfaceClass.name().toString()) <MASK><NEW_LINE>createAndReturnHeaderFiller(subClassCreator, subConstructor, subMethodCreator, subMethod, invocationBuilder, index, generatedClasses, subMethodIndex, subHeaderFillerName, headerFillersByName);<NEW_LINE>} | + "$$" + methodIndex + "$$" + subMethodIndex; |
567,575 | public boolean remoteTriggeredCrawlJob() {<NEW_LINE>// work off crawl requests that had been placed by other peers to our crawl stack<NEW_LINE>// do nothing if either there are private processes to be done<NEW_LINE>// or there is no global crawl on the stack<NEW_LINE>final String queueCheck = <MASK><NEW_LINE>if (queueCheck != null) {<NEW_LINE>if (CrawlQueues.log.isFinest()) {<NEW_LINE>CrawlQueues.log.finest("omitting de-queue/remote: " + queueCheck);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (isPaused(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL)) {<NEW_LINE>if (CrawlQueues.log.isFinest()) {<NEW_LINE>CrawlQueues.log.finest("omitting de-queue/remote: paused");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// we don't want to crawl a global URL globally, since WE are the global part. (from this point of view)<NEW_LINE>final String stats = "REMOTETRIGGEREDCRAWL[" + this.noticeURL.stackSize(NoticedURL.StackType.LOCAL) + ", " + this.noticeURL.stackSize(NoticedURL.StackType.GLOBAL) + ", " + this.noticeURL.stackSize(NoticedURL.StackType.REMOTE) + "]";<NEW_LINE>try {<NEW_LINE>final Request urlEntry = this.noticeURL.pop(NoticedURL.StackType.REMOTE, true, this.sb.crawler, this.sb.robots);<NEW_LINE>if (urlEntry == null)<NEW_LINE>return false;<NEW_LINE>load(urlEntry, stats);<NEW_LINE>return true;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>CrawlQueues.log.severe(stats + ": CANNOT FETCH ENTRY: " + e.getMessage(), e);<NEW_LINE>if (e.getMessage().indexOf("hash is null", 0) > 0) {<NEW_LINE>this.noticeURL.clear(NoticedURL.StackType.REMOTE);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | loadIsPossible(NoticedURL.StackType.REMOTE); |
1,526,118 | private static void fixImportedAttributes(Map<String, String> ip, FileObject fo) {<NEW_LINE>if (!ip.containsKey(GlassfishModule.NB73_IMPORT_FIXED)) {<NEW_LINE>String password = ip.get(GlassfishModule.PASSWORD_ATTR);<NEW_LINE>if (password != null) {<NEW_LINE>boolean local = ip.get(GlassfishModule.DOMAINS_FOLDER_ATTR) != null;<NEW_LINE>if (local && GlassfishInstance.OLD_DEFAULT_ADMIN_PASSWORD.equals(password)) {<NEW_LINE>if (GlassfishInstance.DEFAULT_ADMIN_PASSWORD == null || GlassfishInstance.DEFAULT_ADMIN_PASSWORD.length() == 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ip.put(GlassfishModule.PASSWORD_ATTR, GlassfishInstance.DEFAULT_ADMIN_PASSWORD);<NEW_LINE>}<NEW_LINE>org.netbeans.modules.glassfish.common.utils.ServerUtils.setStringAttribute(fo, GlassfishModule.PASSWORD_ATTR, GlassfishInstance.DEFAULT_ADMIN_PASSWORD);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ip.put(GlassfishModule.NB73_IMPORT_FIXED, Boolean.toString(true));<NEW_LINE>}<NEW_LINE>} | ip.remove(GlassfishModule.PASSWORD_ATTR); |
1,321,438 | protected void registerForQuartz(Consumer<FinishedRecipe> consumer, String variant, ItemLike baseItem) {<NEW_LINE>Block base = Registry.BLOCK.getOptional(prefix<MASK><NEW_LINE>Block slab = Registry.BLOCK.getOptional(prefix(variant + LibBlockNames.SLAB_SUFFIX)).get();<NEW_LINE>Block stairs = Registry.BLOCK.getOptional(prefix(variant + LibBlockNames.STAIR_SUFFIX)).get();<NEW_LINE>Block chiseled = Registry.BLOCK.getOptional(prefix("chiseled_" + variant)).get();<NEW_LINE>Block pillar = Registry.BLOCK.getOptional(prefix(variant + "_pillar")).get();<NEW_LINE>ShapedRecipeBuilder.shaped(base).define('Q', baseItem).pattern("QQ").pattern("QQ").unlockedBy("has_item", conditionsFromItem(baseItem)).save(consumer);<NEW_LINE>stairs(stairs, base).save(consumer);<NEW_LINE>slabShape(slab, base).save(consumer);<NEW_LINE>pillar(pillar, base).save(consumer);<NEW_LINE>chiseled(chiseled, slab).unlockedBy("has_base_item", conditionsFromItem(base)).save(consumer);<NEW_LINE>} | (variant)).get(); |
1,353,280 | private static String[] sanitizeHttp(final String type, final String... entries) {<NEW_LINE>// Only javadoc may contain http(s)<NEW_LINE>if (!"javadoc".equals(type)) {<NEW_LINE>// NOI18N<NEW_LINE>return entries;<NEW_LINE>}<NEW_LINE>final Collection<String> result = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < entries.length; i++) {<NEW_LINE>if (i < entries.length - 1 && entries[i].matches("https?")) {<NEW_LINE>// #212877: Definitions.getProperties already converted to \, so have entries=["http", "\\server\path\"]<NEW_LINE>String schemeSpecificPart = entries[i + 1<MASK><NEW_LINE>if (schemeSpecificPart.startsWith("//")) {<NEW_LINE>result.add(entries[i] + ':' + schemeSpecificPart);<NEW_LINE>i++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.add(entries[i]);<NEW_LINE>}<NEW_LINE>return result.toArray(new String[result.size()]);<NEW_LINE>} | ].replace('\\', '/'); |
1,691,427 | private void genCode() {<NEW_LINE>String modelModuleName = "/module-" + moduleName + "-model";<NEW_LINE>String serviceApiModuleName = "/module-" + moduleName + "-service";<NEW_LINE>String serviceProviderModuleName = "/module-" + moduleName + "-service-provider";<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.url", dbUrl);<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.user", dbUser);<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.password", dbPassword);<NEW_LINE>String baseModelPackage = modelPackage + ".base";<NEW_LINE>String modelDir = basePath + modelModuleName + "/src/main/java/" + modelPackage.replace(".", "/");<NEW_LINE>String baseModelDir = basePath + modelModuleName + "/src/main/java/" + baseModelPackage.replace(".", "/");<NEW_LINE>System.out.println("start generate... dir:" + modelDir);<NEW_LINE>Set<String> genTableNames = StrUtil.splitToSet(dbTables, ",");<NEW_LINE>MetaBuilder mb = CodeGenHelpler.createMetaBuilder();<NEW_LINE>mb.setGenerateRemarks(true);<NEW_LINE>List<TableMeta> tableMetas = mb.build();<NEW_LINE>tableMetas.removeIf(tableMeta -> genTableNames != null && !genTableNames.contains(tableMeta.name.toLowerCase()));<NEW_LINE>new BaseModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);<NEW_LINE>new ModelGenerator(modelPackage, baseModelPackage<MASK><NEW_LINE>String apiPath = basePath + serviceApiModuleName + "/src/main/java/" + servicePackage.replace(".", "/");<NEW_LINE>String providerPath = basePath + serviceProviderModuleName + "/src/main/java/" + servicePackage.replace(".", "/") + "/provider";<NEW_LINE>new ServiceApiGenerator(servicePackage, modelPackage, apiPath).generate(tableMetas);<NEW_LINE>new ServiceProviderGenerator(servicePackage, modelPackage, providerPath).generate(tableMetas);<NEW_LINE>if (genUI) {<NEW_LINE>new ModuleUIGenerator(moduleName, modelPackage, tableMetas).genListener().genControllers().genEdit().genList();<NEW_LINE>}<NEW_LINE>Set<String> optionsTableNames = StrUtil.splitToSet(optionsTables, ",");<NEW_LINE>if (optionsTableNames != null && optionsTableNames.size() > 0) {<NEW_LINE>new BaseOptionsModelGenerator(baseModelPackage, baseModelDir).generate(copyTableMetasByNames(tableMetas, optionsTableNames));<NEW_LINE>}<NEW_LINE>// SortTables<NEW_LINE>Set<String> sortTableNames = StrUtil.splitToSet(sortTables, ",");<NEW_LINE>if (sortTableNames != null && sortTableNames.size() > 0) {<NEW_LINE>new BaseSortModelGenerator(baseModelPackage, baseModelDir).generate(copyTableMetasByNames(tableMetas, sortTableNames));<NEW_LINE>}<NEW_LINE>// SortOptionsTables<NEW_LINE>Set<String> sortOptionsTableNames = StrUtil.splitToSet(sortOptionsTables, ",");<NEW_LINE>if (sortOptionsTableNames != null && sortOptionsTableNames.size() > 0) {<NEW_LINE>new BaseSortOptionsModelGenerator(baseModelPackage, baseModelDir).generate(copyTableMetasByNames(tableMetas, sortOptionsTableNames));<NEW_LINE>}<NEW_LINE>} | , modelDir).generate(tableMetas); |
884,190 | public static void main(String[] args) {<NEW_LINE>final Scanner scanner = new Scanner(System.in);<NEW_LINE>System.out.println("\n=========================================================" + "\n " + "\n Welcome to the Spring Integration JMS Sample! " + "\n " + "\n For more information please visit: " + "\n https://www.springsource.org/spring-integration/ " + "\n " + "\n=========================================================");<NEW_LINE>ActiveMqTestUtils.prepare();<NEW_LINE>System.out.println("\n Which Demo would you like to run? <enter>:\n");<NEW_LINE>System.out.println("\t1. Channel Adapter Demo");<NEW_LINE>System.out.println("\t2. Gateway Demo");<NEW_LINE>System.out.println("\t3. Aggregation Demo");<NEW_LINE>while (true) {<NEW_LINE>final String input = scanner.nextLine();<NEW_LINE>if ("1".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Channel Adapter Demo...");<NEW_LINE>new ClassPathXmlApplicationContext(configFilesChannelAdapterDemo, Main.class);<NEW_LINE>break;<NEW_LINE>} else if ("2".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Gateway Demo...");<NEW_LINE>new <MASK><NEW_LINE>break;<NEW_LINE>} else if ("3".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Aggregation Demo...");<NEW_LINE>new ClassPathXmlApplicationContext(configFilesAggregationDemo, Main.class);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>System.out.println("Invalid choice\n\n");<NEW_LINE>System.out.print("Enter you choice: ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(" Please type something and hit <enter>\n");<NEW_LINE>scanner.close();<NEW_LINE>} | ClassPathXmlApplicationContext(configFilesGatewayDemo, Main.class); |
1,241,215 | public static SlaAlertAction createFromJson(final HashMap<String, Object> obj) throws Exception {<NEW_LINE>final Map<String, Object> jsonObj = (HashMap<String, Object>) obj;<NEW_LINE>if (!jsonObj.get("type").equals(type)) {<NEW_LINE>throw new Exception("Cannot create action of " + type + " from " + jsonObj.get("type"));<NEW_LINE>}<NEW_LINE>final String actionId = (String) jsonObj.get("actionId");<NEW_LINE>SlaOption slaOption;<NEW_LINE>List<String> emails;<NEW_LINE>// TODO edlu: is this being written? Handle both old and new formats, when written in new<NEW_LINE>// format<NEW_LINE>slaOption = SlaOption.fromObject(jsonObj.get("slaOption"));<NEW_LINE>final int execId = Integer.valueOf((String<MASK><NEW_LINE>return new SlaAlertAction(actionId, slaOption, execId);<NEW_LINE>} | ) jsonObj.get("execId")); |
1,147,472 | protected void generateStatementsImpl() throws CustomChangeException {<NEW_LINE>extractClientsData("SELECT C.ID, C.CLIENT_ID FROM " + getTableName("CLIENT") + " C " + "LEFT JOIN " + getTableName("CLIENT_ATTRIBUTES") + " CA " + "ON C.ID = CA.CLIENT_ID AND CA.NAME='" + SAML_ARTIFACT_BINDING_IDENTIFIER + "' " + "WHERE C.PROTOCOL='saml' AND CA.NAME IS NULL");<NEW_LINE>for (Map.Entry<String, String> clientPair : clientIds.entrySet()) {<NEW_LINE>String id = clientPair.getKey();<NEW_LINE><MASK><NEW_LINE>String samlIdentifier = computeArtifactBindingIdentifierString(clientId);<NEW_LINE>statements.add(new InsertStatement(null, null, database.correctObjectName("CLIENT_ATTRIBUTES", Table.class)).addColumnValue("CLIENT_ID", id).addColumnValue("NAME", SAML_ARTIFACT_BINDING_IDENTIFIER).addColumnValue("VALUE", samlIdentifier));<NEW_LINE>}<NEW_LINE>} | String clientId = clientPair.getValue(); |
939,121 | public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {<NEW_LINE>try {<NEW_LINE>debug("Round #%s", round++);<NEW_LINE>if (roundEnv.processingOver()) {<NEW_LINE>build(processingEnv.getFiler());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (TypeElement annotation : annotations) {<NEW_LINE>Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(annotation);<NEW_LINE>elements.stream().filter(TypeElement.class::isInstance).map(TypeElement.class::cast).filter(type -> !type.getModifiers().contains(Modifier.ABSTRACT)).forEach(e -> routeMap.computeIfAbsent(e, k -> new LinkedHashMap<>()));<NEW_LINE>if (Annotations.HTTP_METHODS.contains(annotation.asType().toString())) {<NEW_LINE>Set<ExecutableElement> methods = elements.stream().filter(ExecutableElement.class::isInstance).map(ExecutableElement.class::cast).collect(Collectors<MASK><NEW_LINE>for (ExecutableElement method : methods) {<NEW_LINE>Map<TypeElement, List<ExecutableElement>> mapping = routeMap.computeIfAbsent((TypeElement) method.getEnclosingElement(), k -> new LinkedHashMap<>());<NEW_LINE>mapping.computeIfAbsent(annotation, k -> new ArrayList<>()).add(method);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (extendedLooupOfSuperTypes) {<NEW_LINE>elements.stream().filter(TypeElement.class::isInstance).map(TypeElement.class::cast).forEach(parentTypeElement -> extendedLookupOfSuperTypes(parentTypeElement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (Exception x) {<NEW_LINE>throw SneakyThrows.propagate(x);<NEW_LINE>}<NEW_LINE>} | .toCollection(LinkedHashSet::new)); |
528,401 | private void parseAnonymousIpConfig(final JsonNode jo) throws JsonUtilsException {<NEW_LINE>final String anonymousPollingUrl = "anonymousip.polling.url";<NEW_LINE>final String anonymousPollingInterval = "anonymousip.polling.interval";<NEW_LINE>final String anonymousPolicyConfiguration = "anonymousip.policy.configuration";<NEW_LINE>final JsonNode config = JsonUtils.getJsonNode(jo, "config");<NEW_LINE>final String configUrl = JsonUtils.optString(config, anonymousPolicyConfiguration, null);<NEW_LINE>final String databaseUrl = JsonUtils.optString(config, anonymousPollingUrl, null);<NEW_LINE>if (configUrl == null) {<NEW_LINE>LOGGER.info(anonymousPolicyConfiguration + " not configured; stopping service updater and disabling feature");<NEW_LINE>getAnonymousIpConfigUpdater().stopServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (databaseUrl == null) {<NEW_LINE>LOGGER.info(anonymousPollingUrl + " not configured; stopping service updater and disabling feature");<NEW_LINE>getAnonymousIpDatabaseUpdater().stopServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (jo.has(deliveryServicesKey)) {<NEW_LINE>final JsonNode dss = JsonUtils.getJsonNode(jo, deliveryServicesKey);<NEW_LINE>final Iterator<String> dsNames = dss.fieldNames();<NEW_LINE>while (dsNames.hasNext()) {<NEW_LINE>final String ds = dsNames.next();<NEW_LINE>final JsonNode dsNode = JsonUtils.getJsonNode(dss, ds);<NEW_LINE>if (JsonUtils.optString(dsNode, "anonymousBlockingEnabled").equals("true")) {<NEW_LINE>final long interval = JsonUtils.optLong(config, anonymousPollingInterval);<NEW_LINE>getAnonymousIpConfigUpdater().setDataBaseURL(configUrl, interval);<NEW_LINE>getAnonymousIpDatabaseUpdater(<MASK><NEW_LINE>AnonymousIp.getCurrentConfig().enabled = true;<NEW_LINE>LOGGER.debug("Anonymous Blocking in use, scheduling service updaters and enabling feature");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug("No DS using anonymous ip blocking - disabling feature");<NEW_LINE>getAnonymousIpConfigUpdater().cancelServiceUpdater();<NEW_LINE>getAnonymousIpDatabaseUpdater().cancelServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>} | ).setDataBaseURL(databaseUrl, interval); |
44,848 | private String initializePath(BeanWrapper wrapper, RelaxedDataBinder.BeanPath path, int index) {<NEW_LINE>String prefix = path.prefix(index);<NEW_LINE>String key = path.name(index);<NEW_LINE>if (path.isProperty(index)) {<NEW_LINE>key = getActualPropertyName(wrapper, prefix, key);<NEW_LINE>path.rename(index, key);<NEW_LINE>}<NEW_LINE>if (path.name(++index) == null) {<NEW_LINE>return path.toString();<NEW_LINE>}<NEW_LINE>String name = path.prefix(index);<NEW_LINE>TypeDescriptor descriptor = wrapper.getPropertyTypeDescriptor(name);<NEW_LINE>if (descriptor == null || descriptor.isMap()) {<NEW_LINE>if (isMapValueStringType(descriptor) || isBlanked(wrapper, name, path.name(index))) {<NEW_LINE>path.collapseKeys(index);<NEW_LINE>}<NEW_LINE>path.mapIndex(index);<NEW_LINE>extendMapIfNecessary(wrapper, path, index);<NEW_LINE>} else if (descriptor.isCollection()) {<NEW_LINE>extendCollectionIfNecessary(wrapper, path, index);<NEW_LINE>} else if (descriptor.getType().equals(Object.class)) {<NEW_LINE>if (isBlanked(wrapper, name, path.name(index))) {<NEW_LINE>path.collapseKeys(index);<NEW_LINE>}<NEW_LINE>path.mapIndex(index);<NEW_LINE>if (path.isLastNode(index)) {<NEW_LINE>wrapper.setPropertyValue(path.toString(), BLANK);<NEW_LINE>} else {<NEW_LINE>String next = path.prefix(index + 1);<NEW_LINE>if (wrapper.getPropertyValue(next) == null) {<NEW_LINE>wrapper.setPropertyValue(next, new LinkedHashMap<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return initializePath(wrapper, path, index);<NEW_LINE>} | <String, Object>()); |
830,721 | public static void main(String[] args) throws IOException {<NEW_LINE>EventGridPublisherAsyncClient<CloudEvent> publisherClient = // make sure it accepts CloudEvent<NEW_LINE>new EventGridPublisherClientBuilder().// make sure it accepts CloudEvent<NEW_LINE>endpoint(System.getenv("AZURE_EVENTGRID_CLOUDEVENT_ENDPOINT")).credential(new AzureKeyCredential(System.getenv("AZURE_EVENTGRID_CLOUDEVENT_KEY"))).buildCloudEventPublisherAsyncClient();<NEW_LINE>// Create a CloudEvent with String data<NEW_LINE>String str = "FirstName: John1, LastName:James";<NEW_LINE>CloudEvent cloudEventStr = new CloudEvent("https://com.example.myapp", "User.Created.Text", BinaryData.fromObject(str), CloudEventDataFormat.JSON, "text/plain");<NEW_LINE>// Create a CloudEvent with Object data<NEW_LINE>User newUser = new User("John2", "James");<NEW_LINE>CloudEvent cloudEventModel = new CloudEvent("https://com.example.myapp", "User.Created.Object", BinaryData.fromObject(newUser), CloudEventDataFormat.JSON, "application/json");<NEW_LINE>// Create a CloudEvent with bytes data<NEW_LINE>byte[] byteSample = "FirstName: John3, LastName: James".getBytes(StandardCharsets.UTF_8);<NEW_LINE>CloudEvent cloudEventBytes = new CloudEvent("https://com.example.myapp", "User.Created.Binary", BinaryData.fromBytes(byteSample), CloudEventDataFormat.BYTES, "application/octet-stream");<NEW_LINE>// Create a CloudEvent with Json String data<NEW_LINE>String jsonStrData = "\"FirstName: John1, LastName:James\"";<NEW_LINE>CloudEvent cloudEventJsonStrData = new CloudEvent("https://com.example.myapp", "User.Created.Text", BinaryData.fromString(jsonStrData), CloudEventDataFormat.JSON, "text/plain");<NEW_LINE>// Send them to the event grid topic altogether.<NEW_LINE>List<CloudEvent> <MASK><NEW_LINE>events.add(cloudEventStr);<NEW_LINE>events.add(cloudEventModel);<NEW_LINE>events.add(cloudEventBytes);<NEW_LINE>events.add(cloudEventJsonStrData);<NEW_LINE>events.add(cloudEventBytes.addExtensionAttribute("extension", "value"));<NEW_LINE>// This is non-blocking.<NEW_LINE>publisherClient.sendEvents(events).subscribe();<NEW_LINE>System.out.println("Press any key to exit.");<NEW_LINE>// Prevent exit immediately.<NEW_LINE>System.in.read();<NEW_LINE>} | events = new ArrayList<>(); |
230,696 | public ListUserPoolsResult listUserPools(ListUserPoolsRequest listUserPoolsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUserPoolsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUserPoolsRequest> request = null;<NEW_LINE>Response<ListUserPoolsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUserPoolsRequestMarshaller().marshall(listUserPoolsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListUserPoolsResult, JsonUnmarshallerContext> unmarshaller = new ListUserPoolsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListUserPoolsResult> responseHandler = new JsonResponseHandler<ListUserPoolsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,174,712 | public Matching<D> matchesContracts(Binding<?, ?> other) {<NEW_LINE>boolean atLeastOneMatch = false;<NEW_LINE>boolean allMatch = true;<NEW_LINE>final Set<MASK><NEW_LINE>final Set<Type> secondContracts = other.getContracts();<NEW_LINE>final Set<Type> biggerContracts = firstContracts.size() < secondContracts.size() ? secondContracts : firstContracts;<NEW_LINE>final Set<Type> smallerContracts = firstContracts.size() < secondContracts.size() ? firstContracts : secondContracts;<NEW_LINE>for (Type thisType : biggerContracts) {<NEW_LINE>boolean aMatch = false;<NEW_LINE>for (Type otherType : smallerContracts) {<NEW_LINE>if (thisType.equals(otherType)) {<NEW_LINE>aMatch = true;<NEW_LINE>atLeastOneMatch = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!aMatch) {<NEW_LINE>allMatch = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MatchLevel matchLevel = atLeastOneMatch ? (allMatch ? MatchLevel.FULL_CONTRACT : MatchLevel.PARTIAL_CONTRACT) : MatchLevel.NONE;<NEW_LINE>final Matching<D> matching = new Matching<>((D) this, matchLevel);<NEW_LINE>return matching;<NEW_LINE>} | <Type> firstContracts = getContracts(); |
1,238,622 | public CreditsLoader load() {<NEW_LINE>String configProperty = AppContext.getProperty("cuba.creditsConfig");<NEW_LINE>if (StringUtils.isBlank(configProperty)) {<NEW_LINE>log.info("Property cuba.creditsConfig is empty");<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(configProperty);<NEW_LINE>String[] locations = tokenizer.getTokenArray();<NEW_LINE>for (String location : locations) {<NEW_LINE>Resources resources = <MASK><NEW_LINE>String xml = resources.getResourceAsString(location);<NEW_LINE>if (xml == null) {<NEW_LINE>log.debug("Resource {} not found, ignore it", location);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Element rootElement = AppBeans.get(Dom4jTools.class).readDocument(xml).getRootElement();<NEW_LINE>loadLicenses(rootElement);<NEW_LINE>loadConfig(rootElement);<NEW_LINE>}<NEW_LINE>Collections.sort(items);<NEW_LINE>return this;<NEW_LINE>} | AppBeans.get(Resources.NAME); |
367,384 | public static ApiVersionBean hideSensitiveDataFromApiVersionBean(ApiVersionBean apiVersionBean) {<NEW_LINE>ApiBean api = new ApiBean();<NEW_LINE>api.setId(apiVersionBean.getApi().getId());<NEW_LINE>api.setName(apiVersionBean.getApi().getName());<NEW_LINE>api.setDescription(apiVersionBean.getApi().getDescription());<NEW_LINE>OrganizationBean org = new OrganizationBean();<NEW_LINE>org.setId(apiVersionBean.getApi().getOrganization().getId());<NEW_LINE>org.setName(apiVersionBean.getApi().getOrganization().getName());<NEW_LINE>org.setDescription(apiVersionBean.getApi().<MASK><NEW_LINE>api.setOrganization(org);<NEW_LINE>ApiVersionBean apiVersion = new ApiVersionBean();<NEW_LINE>apiVersion.setApi(api);<NEW_LINE>apiVersion.setStatus(apiVersionBean.getStatus());<NEW_LINE>apiVersion.setEndpointType(apiVersionBean.getEndpointType());<NEW_LINE>apiVersion.setEndpointContentType(apiVersionBean.getEndpointContentType());<NEW_LINE>apiVersion.setGateways(apiVersionBean.getGateways());<NEW_LINE>apiVersion.setPublicAPI(apiVersionBean.isPublicAPI());<NEW_LINE>apiVersion.setPlans(apiVersionBean.getPlans());<NEW_LINE>apiVersion.setVersion(apiVersionBean.getVersion());<NEW_LINE>apiVersion.setDefinitionType(apiVersionBean.getDefinitionType());<NEW_LINE>return apiVersion;<NEW_LINE>} | getOrganization().getDescription()); |
969,862 | private Portal create(Business business, Wi wi) throws Exception {<NEW_LINE>List<JpaObject> persistObjects = new ArrayList<>();<NEW_LINE>Portal portal = business.entityManagerContainer().find(wi.getId(), Portal.class);<NEW_LINE>if (null != portal) {<NEW_LINE>throw new ExceptionPortalExistForCreate(wi.getId());<NEW_LINE>}<NEW_LINE>portal = WrapPortal.inCopier.copy(wi);<NEW_LINE>portal.setName(this.idlePortalName(business, portal.getName(), portal.getId()));<NEW_LINE>portal.setAlias(this.idlePortalAlias(business, portal.getAlias(), portal.getId()));<NEW_LINE>persistObjects.add(portal);<NEW_LINE>for (WrapWidget _o : wi.getWidgetList()) {<NEW_LINE>Widget obj = business.entityManagerContainer().find(_o.getId(), Widget.class);<NEW_LINE>if (null != obj) {<NEW_LINE>throw new ExceptionMenuExistForCreate(_o.getId());<NEW_LINE>}<NEW_LINE>obj = WrapWidget.inCopier.copy(_o);<NEW_LINE>obj.setPortal(portal.getId());<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>for (WrapPage _o : wi.getPageList()) {<NEW_LINE>Page obj = business.entityManagerContainer().find(_o.getId(), Page.class);<NEW_LINE>if (null != obj) {<NEW_LINE>throw new ExceptionPageExistForCreate(_o.getId());<NEW_LINE>}<NEW_LINE>obj = WrapPage.inCopier.copy(_o);<NEW_LINE>obj.setPortal(portal.getId());<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>for (WrapScript _o : wi.getScriptList()) {<NEW_LINE>Script obj = business.entityManagerContainer().find(_o.getId(), Script.class);<NEW_LINE>if (null != obj) {<NEW_LINE>throw new ExceptionScriptExistForCreate(_o.getId());<NEW_LINE>}<NEW_LINE>obj = WrapScript.inCopier.copy(_o);<NEW_LINE>obj.setPortal(portal.getId());<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>for (WrapFile _o : wi.getFileList()) {<NEW_LINE>File obj = business.entityManagerContainer().find(_o.getId(), File.class);<NEW_LINE>if (null != obj) {<NEW_LINE>throw new ExceptionFileExistForCreate(_o.getId());<NEW_LINE>}<NEW_LINE>obj = WrapFile.inCopier.copy(_o);<NEW_LINE>obj.setPortal(portal.getId());<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().beginTransaction(Portal.class);<NEW_LINE>business.entityManagerContainer(<MASK><NEW_LINE>business.entityManagerContainer().beginTransaction(Page.class);<NEW_LINE>business.entityManagerContainer().beginTransaction(Script.class);<NEW_LINE>business.entityManagerContainer().beginTransaction(File.class);<NEW_LINE>for (JpaObject o : persistObjects) {<NEW_LINE>business.entityManagerContainer().persist(o);<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>return portal;<NEW_LINE>} | ).beginTransaction(Widget.class); |
1,323,017 | public void prepare(AbstractRequest request, Context context) throws BizException {<NEW_LINE>super.prepare(request, context);<NEW_LINE>SortedMap sParaTemp = context.getsParaTemp();<NEW_LINE>AliPaymentContext aliPaymentContext = (AliPaymentContext) context;<NEW_LINE>sParaTemp.put(<MASK><NEW_LINE>sParaTemp.put("service", aliPaymentConfig.getAli_service());<NEW_LINE>// sParaTemp.put("seller_email", aliPaymentConfig.getSeller_email());<NEW_LINE>sParaTemp.put("seller_id", aliPaymentConfig.getSeller_id());<NEW_LINE>sParaTemp.put("payment_type", "1");<NEW_LINE>sParaTemp.put("it_b_pay", aliPaymentConfig.getIt_b_pay());<NEW_LINE>sParaTemp.put("notify_url", aliPaymentConfig.getNotify_url());<NEW_LINE>sParaTemp.put("return_url", aliPaymentConfig.getReturn_url());<NEW_LINE>sParaTemp.put("out_trade_no", aliPaymentContext.getOutTradeNo());<NEW_LINE>sParaTemp.put("subject", aliPaymentContext.getSubject());<NEW_LINE>sParaTemp.put("total_fee", aliPaymentContext.getTotalFee());<NEW_LINE>aliPaymentContext.setsParaTemp(sParaTemp);<NEW_LINE>} | "partner", aliPaymentConfig.getAli_partner()); |
1,684,830 | private void process(JTextComponent component, boolean overwrite) {<NEW_LINE>if (onSelectCallback != null) {<NEW_LINE>CompletionUtilities.OnSelectContext ctx = CompletionSupportSpiPackageAccessor.get().createOnSelectContext(component, overwrite);<NEW_LINE>onSelectCallback.accept(ctx);<NEW_LINE>} else {<NEW_LINE>final BaseDocument doc = (BaseDocument) component.getDocument();<NEW_LINE>doc.runAtomic(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>if (startOffset < 0) {<NEW_LINE>if (overwrite && endOffset > component.getCaretPosition()) {<NEW_LINE>doc.remove(component.getCaretPosition(), endOffset - component.getCaretPosition());<NEW_LINE>}<NEW_LINE>doc.insertString(component.<MASK><NEW_LINE>} else {<NEW_LINE>doc.remove(startOffset, (overwrite && endOffset > component.getCaretPosition() ? endOffset : component.getCaretPosition()) - startOffset);<NEW_LINE>doc.insertString(startOffset, insertText, null);<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | getCaretPosition(), insertText, null); |
344,052 | private static void PaintSegment(Point lastPoint, Point point, RenderState state) {<NEW_LINE>double distance = lastPoint.getDistanceTo(point);<NEW_LINE>Point vector = point.substract(lastPoint);<NEW_LINE>Point unitVector = new Point(1.0f, 1.0f, 0.0f);<NEW_LINE>float vectorAngle = Math.abs(state.angle) > 0.0f ? state.angle : (float) Math.atan2(vector.y, vector.x);<NEW_LINE>float brushWeight = state.baseWeight * state.scale * 1f / state.viewportScale;<NEW_LINE>double step = Math.max(1.0f, state.spacing * brushWeight);<NEW_LINE>if (distance > 0.0) {<NEW_LINE>unitVector = vector.multiplyByScalar(1.0 / distance);<NEW_LINE>}<NEW_LINE>float boldenedAlpha = Math.min(1.0f, state.alpha * 1.15f);<NEW_LINE>boolean boldenHead = lastPoint.edge;<NEW_LINE>boolean boldenTail = point.edge;<NEW_LINE>int count = (int) Math.ceil((distance - state.remainder) / step);<NEW_LINE>int currentCount = state.getCount();<NEW_LINE>state.appendValuesCount(count);<NEW_LINE>state.setPosition(currentCount);<NEW_LINE>Point start = lastPoint.add(unitVector<MASK><NEW_LINE>boolean succeed = true;<NEW_LINE>double f = state.remainder;<NEW_LINE>for (; f <= distance; f += step) {<NEW_LINE>float alpha = boldenHead ? boldenedAlpha : state.alpha;<NEW_LINE>succeed = state.addPoint(start.toPointF(), brushWeight, vectorAngle, alpha, -1);<NEW_LINE>if (!succeed) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>start = start.add(unitVector.multiplyByScalar(step));<NEW_LINE>boldenHead = false;<NEW_LINE>}<NEW_LINE>if (succeed && boldenTail) {<NEW_LINE>state.appendValuesCount(1);<NEW_LINE>state.addPoint(point.toPointF(), brushWeight, vectorAngle, boldenedAlpha, -1);<NEW_LINE>}<NEW_LINE>state.remainder = f - distance;<NEW_LINE>} | .multiplyByScalar(state.remainder)); |
1,467,683 | public Map<Long, Optional<String>> translatePidsToForcedIds(Set<Long> thePids) {<NEW_LINE>assert myDontCheckActiveTransactionForUnitTest || TransactionSynchronizationManager.isSynchronizationActive();<NEW_LINE>Map<Long, Optional<String>> retVal = new HashMap<>(myMemoryCacheService.getAllPresent(MemoryCacheService.CacheEnum.PID_TO_FORCED_ID, thePids));<NEW_LINE>List<Long> remainingPids = thePids.stream().filter(t -> !retVal.containsKey(t)).collect(Collectors.toList());<NEW_LINE>new QueryChunker<Long>().chunk(remainingPids, t -> {<NEW_LINE>List<ForcedId> forcedIds = myForcedIdDao.findAllByResourcePid(t);<NEW_LINE>for (ForcedId forcedId : forcedIds) {<NEW_LINE>Long nextResourcePid = forcedId.getResourceId();<NEW_LINE>Optional<String> nextForcedId = Optional.of(forcedId.getForcedId());<NEW_LINE>retVal.put(nextResourcePid, nextForcedId);<NEW_LINE>myMemoryCacheService.putAfterCommit(MemoryCacheService.CacheEnum.PID_TO_FORCED_ID, nextResourcePid, nextForcedId);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>remainingPids = thePids.stream().filter(t -> !retVal.containsKey(t)).<MASK><NEW_LINE>for (Long nextResourcePid : remainingPids) {<NEW_LINE>retVal.put(nextResourcePid, Optional.empty());<NEW_LINE>myMemoryCacheService.putAfterCommit(MemoryCacheService.CacheEnum.PID_TO_FORCED_ID, nextResourcePid, Optional.empty());<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | collect(Collectors.toList()); |
956,262 | private void createContent() {<NEW_LINE>headerLabelWidget = new ImageLabelWidget(getScene(), getIcon(), getTitle());<NEW_LINE>headerLabelWidget.setLabelFont(getScene().getFont().deriveFont(Font.BOLD));<NEW_LINE>getHeaderWidget().addChild(new Widget(getScene()), 5);<NEW_LINE>getHeaderWidget().addChild(headerLabelWidget);<NEW_LINE>getHeaderWidget().addChild(new Widget(getScene()), 4);<NEW_LINE>buttons = new Widget(getScene());<NEW_LINE>buttons.setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 8));<NEW_LINE>buttons.addChild(getExpanderWidget());<NEW_LINE>getHeaderWidget().addChild(buttons);<NEW_LINE>LabelWidget returnWidget = new LabelWidget(getScene(), method.isOneWay() ? NbBundle.getMessage(OperationWidget.class, "LBL_ReturnTypeNone") : NbBundle.getMessage(OperationWidget.class, "LBL_ReturnType", method.getResult<MASK><NEW_LINE>returnWidget.setAlignment(LabelWidget.Alignment.CENTER);<NEW_LINE>getContentWidget().addChild(returnWidget);<NEW_LINE>} | ().getResultType())); |
710,580 | public static void restoreDisksWithIaasVMRestoreWithRehydrationRequest(com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {<NEW_LINE>manager.restores().trigger("testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", new RestoreRequestResource().withProperties(new IaasVMRestoreWithRehydrationRequest().withRecoveryPointId("348916168024334").withRecoveryType(RecoveryType.RESTORE_DISKS).withSourceResourceId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1").withStorageAccountId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount").withRegion("southeastasia").withCreateNewCloudService(true).withOriginalStorageAccountOption(false).withEncryptionDetails(new EncryptionDetails().withEncryptionEnabled(false)).withRecoveryPointRehydrationInfo(new RecoveryPointRehydrationInfo().withRehydrationRetentionDuration("P7D").withRehydrationPriority(RehydrationPriority.STANDARD<MASK><NEW_LINE>} | ))), Context.NONE); |
1,126,555 | // Validate parts and throw an IllegalArgumentException if a part is not valid<NEW_LINE>private void doValidate() {<NEW_LINE>List<String> errors = new ArrayList<>();<NEW_LINE>// Strip off user from repository name<NEW_LINE>String image = user != null ? repository.substring(user.length() + 1) : repository;<NEW_LINE>Object[] checks = new Object[] { "registry", DOMAIN_REGEXP, registry, "image", IMAGE_NAME_REGEXP, image, "user", NAME_COMP_REGEXP, user, "tag", TAG_REGEXP, <MASK><NEW_LINE>for (int i = 0; i < checks.length; i += 3) {<NEW_LINE>String value = (String) checks[i + 2];<NEW_LINE>Pattern checkPattern = (Pattern) checks[i + 1];<NEW_LINE>if (value != null && !checkPattern.matcher(value).matches()) {<NEW_LINE>errors.add(String.format("%s part '%s' doesn't match allowed pattern '%s'", checks[i], value, checkPattern.pattern()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (errors.size() > 0) {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append(String.format("Given Docker name '%s' is invalid:", getFullName()));<NEW_LINE>buf.append("\n");<NEW_LINE>for (String error : errors) {<NEW_LINE>buf.append(String.format(" * %s", error));<NEW_LINE>buf.append("\n");<NEW_LINE>}<NEW_LINE>buf.append("See http://bit.ly/docker_image_fmt for more details");<NEW_LINE>throw new IllegalArgumentException(buf.toString());<NEW_LINE>}<NEW_LINE>} | tag, "digest", DIGEST_REGEXP, digest }; |
1,153,328 | List<ZeebePartition> constructPartitions(final RaftPartitionGroup partitionGroup, final List<PartitionListener> partitionListeners, final TopologyManager topologyManager, final FeatureFlags featureFlags) {<NEW_LINE>final var partitions = new ArrayList<ZeebePartition>();<NEW_LINE>final var communicationService = clusterServices.getCommunicationService();<NEW_LINE>final var eventService = clusterServices.getEventService();<NEW_LINE>final var membershipService = clusterServices.getMembershipService();<NEW_LINE>final MemberId nodeId = membershipService.getLocalMember().id();<NEW_LINE>final List<RaftPartition> owningPartitions = partitionGroup.getPartitionsWithMember(nodeId).stream().map(RaftPartition.class::cast).collect(Collectors.toList());<NEW_LINE>final var typedRecordProcessorsFactory = createFactory(topologyManager, localBroker, communicationService, eventService, deploymentRequestHandler, featureFlags);<NEW_LINE>for (final RaftPartition owningPartition : owningPartitions) {<NEW_LINE>final var partitionId = owningPartition.id().id();<NEW_LINE>final ConstructableSnapshotStore constructableSnapshotStore = snapshotStoreFactory.getConstructableSnapshotStore(partitionId);<NEW_LINE>final StateController stateController = createStateController(owningPartition, constructableSnapshotStore, snapshotStoreFactory.getSnapshotStoreConcurrencyControl(partitionId));<NEW_LINE>final PartitionStartupAndTransitionContextImpl partitionStartupAndTransitionContext = new PartitionStartupAndTransitionContextImpl(localBroker.getNodeId(), owningPartition, partitionListeners, new AtomixPartitionMessagingService(communicationService, membershipService, owningPartition.members()), actorSchedulingService, brokerCfg, commandApiService::newCommandResponseWriter, () -> commandApiService.getOnProcessedListener(partitionId), constructableSnapshotStore, snapshotStoreFactory.getReceivableSnapshotStore(partitionId), stateController, typedRecordProcessorsFactory, <MASK><NEW_LINE>final PartitionTransition newTransitionBehavior = new PartitionTransitionImpl(TRANSITION_STEPS);<NEW_LINE>final ZeebePartition zeebePartition = new ZeebePartition(partitionStartupAndTransitionContext, newTransitionBehavior, STARTUP_STEPS);<NEW_LINE>healthCheckService.registerMonitoredPartition(zeebePartition.getPartitionId(), zeebePartition);<NEW_LINE>partitions.add(zeebePartition);<NEW_LINE>}<NEW_LINE>return partitions;<NEW_LINE>} | exporterRepository, new PartitionProcessingState(owningPartition)); |
694,035 | final PurchaseOfferingResult executePurchaseOffering(PurchaseOfferingRequest purchaseOfferingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(purchaseOfferingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PurchaseOfferingRequest> request = null;<NEW_LINE>Response<PurchaseOfferingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PurchaseOfferingRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PurchaseOffering");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PurchaseOfferingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PurchaseOfferingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(purchaseOfferingRequest)); |
1,748,185 | final DeleteMailboxPermissionsResult executeDeleteMailboxPermissions(DeleteMailboxPermissionsRequest deleteMailboxPermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMailboxPermissionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMailboxPermissionsRequest> request = null;<NEW_LINE>Response<DeleteMailboxPermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMailboxPermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteMailboxPermissionsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteMailboxPermissions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteMailboxPermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteMailboxPermissionsResultJsonUnmarshaller());<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>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,000,429 | private Widget createAdvancedForm() {<NEW_LINE>// Create a table to layout the form options<NEW_LINE>FlexTable layout = new FlexTable();<NEW_LINE>layout.setCellSpacing(6);<NEW_LINE>layout.setWidth("300px");<NEW_LINE>FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();<NEW_LINE>// Add a title to the form<NEW_LINE>layout.setHTML(0, 0, constants.cwDisclosurePanelFormTitle());<NEW_LINE>cellFormatter.setColSpan(0, 0, 2);<NEW_LINE>cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);<NEW_LINE>// Add some standard form options<NEW_LINE>layout.setHTML(1, 0, constants.cwDisclosurePanelFormName());<NEW_LINE>layout.setWidget(1, 1, new TextBox());<NEW_LINE>layout.setHTML(2, 0, constants.cwDisclosurePanelFormDescription());<NEW_LINE>layout.setWidget(2, 1, new TextBox());<NEW_LINE>// Create some advanced options<NEW_LINE>HorizontalPanel genderPanel = new HorizontalPanel();<NEW_LINE>String[] genderOptions = constants.cwDisclosurePanelFormGenderOptions();<NEW_LINE>for (int i = 0; i < genderOptions.length; i++) {<NEW_LINE>genderPanel.add(new RadioButton("gender", genderOptions[i]));<NEW_LINE>}<NEW_LINE>Grid advancedOptions = new Grid(2, 2);<NEW_LINE>advancedOptions.setCellSpacing(6);<NEW_LINE>advancedOptions.setHTML(0, 0, constants.cwDisclosurePanelFormLocation());<NEW_LINE>advancedOptions.setWidget(0, 1, new TextBox());<NEW_LINE>advancedOptions.setHTML(1, 0, constants.cwDisclosurePanelFormGender());<NEW_LINE>advancedOptions.setWidget(1, 1, genderPanel);<NEW_LINE>// Add advanced options to form in a disclosure panel<NEW_LINE>DisclosurePanel advancedDisclosure = new <MASK><NEW_LINE>advancedDisclosure.setAnimationEnabled(true);<NEW_LINE>advancedDisclosure.ensureDebugId("cwDisclosurePanel");<NEW_LINE>advancedDisclosure.setContent(advancedOptions);<NEW_LINE>layout.setWidget(3, 0, advancedDisclosure);<NEW_LINE>cellFormatter.setColSpan(3, 0, 2);<NEW_LINE>// Wrap the contents in a DecoratorPanel<NEW_LINE>DecoratorPanel decPanel = new DecoratorPanel();<NEW_LINE>decPanel.setWidget(layout);<NEW_LINE>return decPanel;<NEW_LINE>} | DisclosurePanel(constants.cwDisclosurePanelFormAdvancedCriteria()); |
808,352 | private Mono<Response<Flux<ByteBuffer>>> updateWithResponseAsync(String resourceGroupName, String accountName, VideoAnalyzerUpdate parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,743,113 | private OutboundSecurityResponse propagate(JwtOutboundTarget ot, Subject subject) {<NEW_LINE>Map<String, List<String>> headers = new HashMap<>();<NEW_LINE>Jwk jwk = signKeys.forKeyId(ot.jwkKid).orElseThrow(() -> new JwtException("Signing JWK with kid: " + ot.jwkKid + " is not defined."));<NEW_LINE><MASK><NEW_LINE>Jwt.Builder builder = Jwt.builder();<NEW_LINE>principal.abacAttributeNames().forEach(name -> {<NEW_LINE>principal.abacAttribute(name).ifPresent(val -> builder.addPayloadClaim(name, val));<NEW_LINE>});<NEW_LINE>principal.abacAttribute("full_name").ifPresentOrElse(name -> builder.addPayloadClaim("name", name), () -> builder.removePayloadClaim("name"));<NEW_LINE>builder.subject(principal.id()).preferredUsername(principal.getName()).issuer(issuer).algorithm(jwk.algorithm());<NEW_LINE>ot.update(builder);<NEW_LINE>// MP specific<NEW_LINE>if (!principal.abacAttribute("upn").isPresent()) {<NEW_LINE>builder.userPrincipal(principal.getName());<NEW_LINE>}<NEW_LINE>Security.getRoles(subject).forEach(builder::addUserGroup);<NEW_LINE>Jwt jwt = builder.build();<NEW_LINE>SignedJwt signed = SignedJwt.sign(jwt, jwk);<NEW_LINE>ot.outboundHandler.header(headers, signed.tokenContent());<NEW_LINE>return OutboundSecurityResponse.withHeaders(headers);<NEW_LINE>} | Principal principal = subject.principal(); |
1,410,957 | public static <T> SimpleExpression<T> asSimple(Expression<T> expr) {<NEW_LINE>Expression<T> underlyingMixin = ExpressionUtils.extract(expr);<NEW_LINE>if (underlyingMixin instanceof PathImpl) {<NEW_LINE>return new SimplePath<T>((PathImpl<T>) underlyingMixin);<NEW_LINE>} else if (underlyingMixin instanceof OperationImpl) {<NEW_LINE>return new SimpleOperation<T>((OperationImpl<T>) underlyingMixin);<NEW_LINE>} else if (underlyingMixin instanceof TemplateExpressionImpl) {<NEW_LINE>return new SimpleTemplate<T>(<MASK><NEW_LINE>} else {<NEW_LINE>return new SimpleExpression<T>(underlyingMixin) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -8712299418891960222L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public <R, C> R accept(Visitor<R, C> v, C context) {<NEW_LINE>return this.mixin.accept(v, context);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>} | (TemplateExpressionImpl<T>) underlyingMixin); |
1,583,311 | protected void fillAAnswer() {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceEntry(this, "StateMachine: fillAAnswer: entry: id=" + hashCode());<NEW_LINE>for (Enumeration e = _AResponses.elements(); e.hasMoreElements(); ) {<NEW_LINE>Vector vector2 = (Vector) e.nextElement();<NEW_LINE>for (Enumeration e1 = vector2.elements(); e1.hasMoreElements(); ) {<NEW_LINE>ARecord a = (ARecord) e1.nextElement();<NEW_LINE>SIPUri answer = SIPUri.createSIPUri(_simpl._suri.getURI());<NEW_LINE>answer.setScheme(_simpl._scheme);<NEW_LINE>answer.setHost(a.getAddress().getHostAddress());<NEW_LINE>// "tcp"<NEW_LINE>answer.setTransport(_simpl._transport);<NEW_LINE>// 5060<NEW_LINE>answer.setPortInt(_simpl._port);<NEW_LINE>addUriToList(answer, _simpl._answerList, a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Enumeration e = _AAAAResponses.elements(); e.hasMoreElements(); ) {<NEW_LINE>Vector vector2 = (Vector) e.nextElement();<NEW_LINE>for (Enumeration e1 = vector2.elements(); e1.hasMoreElements(); ) {<NEW_LINE>AAAARecord aaaa = <MASK><NEW_LINE>SIPUri answer = SIPUri.createSIPUri(_simpl._suri.getURI());<NEW_LINE>answer.setScheme(_simpl._scheme);<NEW_LINE>answer.setHost(aaaa.getAddress().getHostAddress());<NEW_LINE>// "tcp"<NEW_LINE>answer.setTransport(_simpl._transport);<NEW_LINE>// 5060<NEW_LINE>answer.setPortInt(_simpl._port);<NEW_LINE>addUriToList(answer, _simpl._answerList, aaaa);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceExit(this, "StateMachine: fillAAnswer: exit: id=" + hashCode());<NEW_LINE>} | (AAAARecord) e1.nextElement(); |
240,406 | boolean appendNewLeadershipTermEvent(final long leadershipTermId, final long timestamp, final long termBaseLogPosition, final int leaderMemberId, final int logSessionId, final TimeUnit timeUnit, final int appVersion) {<NEW_LINE>final int length = MessageHeaderEncoder.ENCODED_LENGTH + NewLeadershipTermEventEncoder.BLOCK_LENGTH;<NEW_LINE>final int fragmentLength = DataHeaderFlyweight.HEADER_LENGTH + length;<NEW_LINE>final int <MASK><NEW_LINE>int attempts = SEND_ATTEMPTS;<NEW_LINE>do {<NEW_LINE>final long logPosition = publication.position() + alignedFragmentLength;<NEW_LINE>final long result = publication.tryClaim(length, bufferClaim);<NEW_LINE>if (result > 0) {<NEW_LINE>newLeadershipTermEventEncoder.wrapAndApplyHeader(bufferClaim.buffer(), bufferClaim.offset(), messageHeaderEncoder).leadershipTermId(leadershipTermId).logPosition(logPosition).timestamp(timestamp).termBaseLogPosition(termBaseLogPosition).leaderMemberId(leaderMemberId).logSessionId(logSessionId).timeUnit(ClusterClock.map(timeUnit)).appVersion(appVersion);<NEW_LINE>bufferClaim.commit();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>checkResult(result);<NEW_LINE>} while (--attempts > 0);<NEW_LINE>return false;<NEW_LINE>} | alignedFragmentLength = align(fragmentLength, FRAME_ALIGNMENT); |
69,790 | // actionPerformed<NEW_LINE>private void send() throws Exception {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final Properties ctx = Env.getCtx();<NEW_LINE>setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>confirmPanel.<MASK><NEW_LINE>final StringTokenizer st = new StringTokenizer(getTo(), " ,;", false);<NEW_LINE>final EMailAddress to = EMailAddress.ofString(st.nextToken());<NEW_LINE>email = m_client.createEMail(getFromUserEMailConfig(), to, getSubject(), getMessage(), true);<NEW_LINE>String status = "Check Setup";<NEW_LINE>if (email != null) {<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>email.addTo(EMailAddress.ofString(st.nextToken()));<NEW_LINE>}<NEW_LINE>// cc<NEW_LINE>final StringTokenizer stcc = new StringTokenizer(getCc(), " ,;", false);<NEW_LINE>while (stcc.hasMoreTokens()) {<NEW_LINE>final String cc = stcc.nextToken();<NEW_LINE>if (cc != null && cc.length() > 0) {<NEW_LINE>email.addCc(EMailAddress.ofString(cc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// metas<NEW_LINE>addBcc(email);<NEW_LINE>// Attachment<NEW_LINE>// metas<NEW_LINE>attachDocument(email);<NEW_LINE>if (m_attachFile != null && m_attachFile.exists()) {<NEW_LINE>email.addAttachment(m_attachFile);<NEW_LINE>}<NEW_LINE>// metas: begin<NEW_LINE>final File pdf = fLetter.getPDF();<NEW_LINE>if (pdf != null && pdf.exists()) {<NEW_LINE>email.addAttachment(pdf);<NEW_LINE>}<NEW_LINE>// metas: end<NEW_LINE>final EMailSentStatus emailSentStatus = email.send();<NEW_LINE>//<NEW_LINE>if (m_user != null) {<NEW_LINE>new MUserMail(Env.getCtx(), m_user.getAD_User_ID(), email, emailSentStatus).save();<NEW_LINE>}<NEW_LINE>if (emailSentStatus.isSentOK()) {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_SENT);<NEW_LINE>ADialog.info(0, this, "MessageSent");<NEW_LINE>dispose();<NEW_LINE>} else {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_NOT_SENT);<NEW_LINE>ADialog.error(0, this, "MessageNotSent", status);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_NOT_SENT);<NEW_LINE>ADialog.error(0, this, "MessageNotSent", status);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>confirmPanel.getOKButton().setEnabled(true);<NEW_LINE>setCursor(Cursor.getDefaultCursor());<NEW_LINE>} | getOKButton().setEnabled(false); |
1,757,831 | public void initialize(WizardDescriptor wiz) {<NEW_LINE>this.wiz = wiz;<NEW_LINE>index = 0;<NEW_LINE>panels = createPanels(wiz);<NEW_LINE>loadSettings(wiz);<NEW_LINE>// Make sure list of steps is accurate.<NEW_LINE>String[] beforeSteps = null;<NEW_LINE>// NOI18N<NEW_LINE>Object prop = wiz.getProperty("WizardPanel_contentData");<NEW_LINE>if (prop != null && prop instanceof String[]) {<NEW_LINE>beforeSteps = (String[]) prop;<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>for (int i = 0; i < panels.length; i++) {<NEW_LINE>Component c = panels[i].getComponent();<NEW_LINE>if (steps[i] == null) {<NEW_LINE>// Default step name to component name of panel.<NEW_LINE>// Mainly useful for getting the name of the target<NEW_LINE>// chooser to appear in the list of steps.<NEW_LINE>steps[i] = c.getName();<NEW_LINE>}<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>// assume Swing components<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>// Step #.<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty("WizardPanel_contentSelectedIndex", Integer.valueOf(i));<NEW_LINE>// Step name (actually the whole list for reference).<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty("WizardPanel_contentData", steps);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | steps = createSteps(beforeSteps, panels); |
1,717,651 | private void processMultiSelectControl(ControlFontPair pair, Control ctrl, PDAcroForm acro, int i, Box root) throws IOException {<NEW_LINE>PDListBox field = new PDListBox(acro);<NEW_LINE>setPartialNameToField(ctrl, field);<NEW_LINE>field.setMultiSelect(true);<NEW_LINE>List<String> labels = new ArrayList<>();<NEW_LINE>List<String> values = new ArrayList<>();<NEW_LINE>List<Integer> <MASK><NEW_LINE>populateOptions(ctrl.box.getElement(), labels, values, selected);<NEW_LINE>field.setOptions(values, labels);<NEW_LINE>field.setSelectedOptionsIndex(selected);<NEW_LINE>FSColor color = ctrl.box.getStyle().getColor();<NEW_LINE>String colorOperator = getColorOperator(color);<NEW_LINE>String fontInstruction = "/" + pair.fontName + " 0 Tf";<NEW_LINE>field.setDefaultAppearance(fontInstruction + ' ' + colorOperator);<NEW_LINE>if (ctrl.box.getElement().hasAttribute("required")) {<NEW_LINE>field.setRequired(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("readonly")) {<NEW_LINE>field.setReadOnly(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("title")) {<NEW_LINE>field.setAlternateFieldName(ctrl.box.getElement().getAttribute("title"));<NEW_LINE>}<NEW_LINE>PDAnnotationWidget widget = field.getWidgets().get(0);<NEW_LINE>Rectangle2D rect2D = PdfBoxFastLinkManager.createTargetArea(ctrl.c, ctrl.box, ctrl.pageHeight, ctrl.transform, root, od);<NEW_LINE>PDRectangle rect = new PDRectangle((float) rect2D.getMinX(), (float) rect2D.getMinY(), (float) rect2D.getWidth(), (float) rect2D.getHeight());<NEW_LINE>widget.setRectangle(rect);<NEW_LINE>widget.setPage(ctrl.page);<NEW_LINE>widget.setPrinted(true);<NEW_LINE>ctrl.page.getAnnotations().add(widget);<NEW_LINE>} | selected = new ArrayList<>(); |
429,563 | public void importMarkdownZip(final RequestContext context) {<NEW_LINE>context.renderJSON(StatusCodes.ERR);<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final FileUpload file = request.getFileUpload("file");<NEW_LINE>if (null == file) {<NEW_LINE>context.renderMsg(langPropsService.get("allowZipOnlyLabel"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String fileName = file.getFilename();<NEW_LINE>String suffix = StringUtils.substringAfterLast(fileName, ".");<NEW_LINE>if (!StringUtils.equalsIgnoreCase(suffix, "zip")) {<NEW_LINE>context.renderMsg(langPropsService.get("allowZipOnlyLabel"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final byte[] bytes = file.getData();<NEW_LINE>final String tmpDir = System.getProperty("java.io.tmpdir");<NEW_LINE>final String date = DateFormatUtils.format<MASK><NEW_LINE>final String zipPath = tmpDir + File.separator + "solo-import-" + date + ".zip";<NEW_LINE>final File zipFile = new File(zipPath);<NEW_LINE>FileUtils.writeByteArrayToFile(zipFile, bytes);<NEW_LINE>final String unzipPath = tmpDir + File.separator + "solo-import-" + date;<NEW_LINE>final File unzipDir = new File(unzipPath);<NEW_LINE>ZipUtil.unzip(zipFile, unzipDir);<NEW_LINE>final JSONObject result = importService.importMarkdownDir(unzipDir);<NEW_LINE>final int succCount = result.optInt("succCount");<NEW_LINE>final int failCount = result.optInt("failCount");<NEW_LINE>FileUtils.deleteQuietly(zipFile);<NEW_LINE>FileUtils.deleteQuietly(unzipDir);<NEW_LINE>context.renderJSONValue(Keys.CODE, StatusCodes.SUCC);<NEW_LINE>String msg = langPropsService.get("importSuccLabel");<NEW_LINE>msg = msg.replace("${succCount}", succCount + "");<NEW_LINE>if (0 < failCount) {<NEW_LINE>msg = langPropsService.get("importFailLabel");<NEW_LINE>msg = msg.replace("${failCount}", failCount + "");<NEW_LINE>}<NEW_LINE>context.renderMsg(msg);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Imports markdown file failed", e);<NEW_LINE>context.renderMsg(langPropsService.get("importFailedSeeLogLabel"));<NEW_LINE>}<NEW_LINE>} | (new Date(), "yyyyMMddHHmmss"); |
1,751,674 | public synchronized void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) {<NEW_LINE>if (this.latLong == null || (this.paintStroke == null && this.paintFill == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double latitude = this.latLong.latitude;<NEW_LINE>double longitude = this.latLong.longitude;<NEW_LINE>long mapSize = MercatorProjection.getMapSize(zoomLevel, displayModel.getTileSize());<NEW_LINE>int pixelX = (int) (MercatorProjection.longitudeToPixelX(longitude, mapSize) - topLeftPoint.x);<NEW_LINE>int pixelY = (int) (MercatorProjection.latitudeToPixelY(latitude, mapSize) - topLeftPoint.y);<NEW_LINE>int radiusInPixel = getRadiusInPixels(latitude, zoomLevel);<NEW_LINE>Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(), canvas.getHeight());<NEW_LINE>if (!canvasRectangle.intersectsCircle(pixelX, pixelY, radiusInPixel)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.paintStroke != null) {<NEW_LINE>if (this.keepAligned) {<NEW_LINE>this.paintStroke.setBitmapShaderShift(topLeftPoint);<NEW_LINE>}<NEW_LINE>canvas.drawCircle(pixelX, pixelY, radiusInPixel, this.paintStroke);<NEW_LINE>}<NEW_LINE>if (this.paintFill != null) {<NEW_LINE>if (this.keepAligned) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>canvas.drawCircle(pixelX, pixelY, radiusInPixel, this.paintFill);<NEW_LINE>}<NEW_LINE>} | this.paintFill.setBitmapShaderShift(topLeftPoint); |
1,301,154 | public // }<NEW_LINE>JsonNode toJson(Object object) throws IOException {<NEW_LINE>if (object instanceof SBase) {<NEW_LINE>SBase base = (SBase) object;<NEW_LINE>ObjectNode jsonObject = OBJECT_MAPPER.createObjectNode();<NEW_LINE>jsonObject.put("__type", base.getSClass().getSimpleName());<NEW_LINE>for (SField field : base.getSClass().getAllFields()) {<NEW_LINE>jsonObject.set(field.getName(), toJson(base.sGet(field)));<NEW_LINE>}<NEW_LINE>return jsonObject;<NEW_LINE>} else if (object instanceof Collection) {<NEW_LINE>Collection<?> collection = (Collection<?>) object;<NEW_LINE>ArrayNode jsonArray = OBJECT_MAPPER.createArrayNode();<NEW_LINE>for (Object value : collection) {<NEW_LINE>jsonArray.add(toJson(value));<NEW_LINE>}<NEW_LINE>return jsonArray;<NEW_LINE>} else if (object instanceof Date) {<NEW_LINE>return new LongNode(((Date) object).getTime());<NEW_LINE>} else if (object instanceof DataHandler) {<NEW_LINE>DataHandler dataHandler = (DataHandler) object;<NEW_LINE>InputStream inputStream = dataHandler.getInputStream();<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>IOUtils.copy(inputStream, out);<NEW_LINE>return new TextNode(new String(Base64.encodeBase64(out.toByteArray()), Charsets.UTF_8));<NEW_LINE>} else if (object instanceof Boolean) {<NEW_LINE>return BooleanNode.valueOf((Boolean) object);<NEW_LINE>} else if (object instanceof String) {<NEW_LINE>return new TextNode((String) object);<NEW_LINE>} else if (object instanceof Long) {<NEW_LINE>return new LongNode((Long) object);<NEW_LINE>} else if (object instanceof UUID) {<NEW_LINE>return new TextNode(((UUID) object).toString());<NEW_LINE>} else if (object instanceof Integer) {<NEW_LINE>return new IntNode((Integer) object);<NEW_LINE>} else if (object instanceof Double) {<NEW_LINE>return new DoubleNode((Double) object);<NEW_LINE>} else if (object instanceof Float) {<NEW_LINE>return new FloatNode((Float) object);<NEW_LINE>} else if (object instanceof Enum) {<NEW_LINE>return new TextNode(object.toString());<NEW_LINE>} else if (object == null) {<NEW_LINE>return NullNode.getInstance();<NEW_LINE>} else if (object instanceof byte[]) {<NEW_LINE>byte[] data = (byte[]) object;<NEW_LINE>return new TextNode(new String(Base64.encodeBase64(data), Charsets.UTF_8));<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException(object.<MASK><NEW_LINE>} | getClass().getName()); |
1,103,991 | public static void sendRequestsAsync(@Nullable final OsmandApplication ctx, @NonNull final List<Request> requests, @Nullable final OnSendRequestsListener listener, final Executor executor) {<NEW_LINE>new AsyncTask<Void, Object, List<RequestResponse>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<RequestResponse> doInBackground(Void... params) {<NEW_LINE>List<RequestResponse> responses = new ArrayList<>();<NEW_LINE>for (Request request : requests) {<NEW_LINE>RequestResponse requestResponse;<NEW_LINE>try {<NEW_LINE>publishProgress(request);<NEW_LINE>final String[] response = { null, null };<NEW_LINE>sendRequest(ctx, request.getUrl(), request.getParameters(), request.getUserOperation(), request.isToastAllowed(), request.isPost(), (result, error, resultCode) -> {<NEW_LINE>response[0] = result;<NEW_LINE>response[1] = error;<NEW_LINE>});<NEW_LINE>requestResponse = new RequestResponse(request, response[<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>requestResponse = new RequestResponse(request, null, "Unexpected error");<NEW_LINE>}<NEW_LINE>responses.add(requestResponse);<NEW_LINE>publishProgress(requestResponse);<NEW_LINE>}<NEW_LINE>return responses;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onProgressUpdate(Object... values) {<NEW_LINE>if (listener != null) {<NEW_LINE>Object obj = values[0];<NEW_LINE>if (obj instanceof RequestResponse) {<NEW_LINE>listener.onRequestSent((RequestResponse) obj);<NEW_LINE>} else if (obj instanceof Request) {<NEW_LINE>listener.onRequestSending((Request) obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(@NonNull List<RequestResponse> results) {<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onRequestsSent(results);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(executor, (Void) null);<NEW_LINE>} | 0], response[1]); |
1,761,454 | final CreateDeploymentResult executeCreateDeployment(CreateDeploymentRequest createDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDeploymentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateDeploymentRequest> request = null;<NEW_LINE>Response<CreateDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDeploymentRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDeployment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDeploymentResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
283,366 | static Context of(Map<?, ?> map) {<NEW_LINE>int size = Objects.requireNonNull(map, "map").size();<NEW_LINE>if (size == 0)<NEW_LINE>return Context.empty();<NEW_LINE>if (size <= 5) {<NEW_LINE>Map.Entry[] entries = map.entrySet().toArray(new Map.Entry[size]);<NEW_LINE>switch(size) {<NEW_LINE>case 1:<NEW_LINE>return new Context1(entries[0].getKey(), entries[0].getValue());<NEW_LINE>case 2:<NEW_LINE>return new Context2(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue());<NEW_LINE>case 3:<NEW_LINE>return new Context3(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue());<NEW_LINE>case 4:<NEW_LINE>return new Context4(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue(), entries[3].getKey(), entries[3].getValue());<NEW_LINE>case 5:<NEW_LINE>return new Context5(entries[0].getKey(), entries[0].getValue(), entries[1].getKey(), entries[1].getValue(), entries[2].getKey(), entries[2].getValue(), entries[3].getKey(), entries[3].getValue(), entries[4].getKey(), entries[4].getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Since ContextN(Map) is a low level API that DOES NOT perform null checks,<NEW_LINE>// we need to check every key/value before passing it to ContextN(Map)<NEW_LINE>map.forEach((key, value) -> {<NEW_LINE>Objects.requireNonNull(key, "null key found");<NEW_LINE>if (value == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Map<Object, Object> generifiedMap = (Map<Object, Object>) map;<NEW_LINE>return new ContextN(generifiedMap);<NEW_LINE>} | throw new NullPointerException("null value for key " + key); |
1,219,007 | public Integer commit() {<NEW_LINE>int count <MASK><NEW_LINE>if (count <= 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (Entry<String, Changes> table : this.batch.entrySet()) {<NEW_LINE>if (table.getValue().isEmpty() || table.getKey().endsWith("i")) {<NEW_LINE>// Skip empty value table or index table<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// TODO: limit individual SST file size<NEW_LINE>SstFileWriter sst = table(table.getKey());<NEW_LINE>for (Pair<byte[], byte[]> change : table.getValue()) {<NEW_LINE>sst.put(change.getKey(), change.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RocksDBException e) {<NEW_LINE>throw new BackendException("Failed to commit", e);<NEW_LINE>}<NEW_LINE>// Clear batch if write() successfully (retained if failed)<NEW_LINE>this.batch.clear();<NEW_LINE>return count;<NEW_LINE>} | = this.batch.size(); |
1,332,839 | protected void activate(Map<String, Object> config) {<NEW_LINE>List<Map<String, Object>> loginConfigs = NestingUtils.<MASK><NEW_LINE>if (loginConfigs != null && !loginConfigs.isEmpty())<NEW_LINE>this.loginConfig = new LoginConfigImpl(loginConfigs.get(0));<NEW_LINE>List<Map<String, Object>> securityConstraintConfigs = NestingUtils.nest(WebserviceSecurity.SECURITY_CONSTRAINT_ELEMENT_NAME, config);<NEW_LINE>if (securityConstraintConfigs != null) {<NEW_LINE>for (Map<String, Object> securityConstraintConfig : securityConstraintConfigs) {<NEW_LINE>securityConstraints.add(new SecurityConstraintImpl(securityConstraintConfig));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> securityRoleConfigs = NestingUtils.nest(WebserviceSecurity.SECURITY_ROLE_ELEMENT_NAME, config);<NEW_LINE>if (securityRoleConfigs != null) {<NEW_LINE>for (Map<String, Object> securityRoleConfig : securityRoleConfigs) {<NEW_LINE>securityRoles.add(new SecurityRoleImpl(securityRoleConfig));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nest(WebserviceSecurity.LOGIN_CONFIG_ELEMENT_NAME, config); |
842,480 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "WorkSpaces Web");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
1,481,735 | public StructuredGraph buildGraph(DebugContext debug, ResolvedJavaMethod method, HostedProviders providers, Purpose purpose) {<NEW_LINE>HostedGraphKit kit = new HostedGraphKit(debug, providers, method);<NEW_LINE>StructuredGraph graph = kit.getGraph();<NEW_LINE>ResolvedJavaType returnType = (ResolvedJavaType) method.getSignature().getReturnType(null);<NEW_LINE>ValueNode arg = kit.loadArguments(method.toParameterTypes()).get(0);<NEW_LINE>CInterfaceEnumTool tool = new CInterfaceEnumTool(providers.getMetaAccess(), providers.getSnippetReflection());<NEW_LINE>JavaKind pushKind = CInterfaceInvocationPlugin.pushKind(method);<NEW_LINE>ValueNode returnValue;<NEW_LINE>if (method.getAnnotation(CEnumLookup.class) != null) {<NEW_LINE>EnumInfo enumInfo = (EnumInfo) nativeLibraries.findElementInfo(returnType);<NEW_LINE>JavaKind parameterKind = JavaKind.Int;<NEW_LINE>returnValue = tool.createEnumLookupInvoke(kit, returnType, enumInfo, parameterKind, arg);<NEW_LINE>} else if (method.getAnnotation(CEnumValue.class) != null) {<NEW_LINE>ResolvedJavaType declaringType = method.getDeclaringClass();<NEW_LINE>EnumInfo enumInfo = (<MASK><NEW_LINE>ValueNode invoke = tool.createEnumValueInvoke(kit, enumInfo, returnType.getJavaKind(), arg);<NEW_LINE>ValueNode adapted = CInterfaceInvocationPlugin.adaptPrimitiveType(graph, invoke, invoke.stamp(NodeView.DEFAULT).getStackKind(), returnType.getJavaKind(), false);<NEW_LINE>Stamp originalStamp = StampFactory.forKind(returnType.getJavaKind());<NEW_LINE>returnValue = CInterfaceInvocationPlugin.adaptPrimitiveType(graph, adapted, returnType.getJavaKind(), originalStamp.getStackKind(), false);<NEW_LINE>} else {<NEW_LINE>throw VMError.shouldNotReachHere();<NEW_LINE>}<NEW_LINE>kit.getFrameState().push(pushKind, returnValue);<NEW_LINE>kit.createReturn(returnValue, pushKind);<NEW_LINE>return kit.finalizeGraph();<NEW_LINE>} | EnumInfo) nativeLibraries.findElementInfo(declaringType); |
1,427,793 | private void processMap(final Contentlet contentlet, final Map<String, Object> map) throws DotDataException, DotSecurityException {<NEW_LINE>final String stInode = <MASK><NEW_LINE>if (UtilMethods.isSet(stInode)) {<NEW_LINE>final ContentType type = APILocator.getContentTypeAPI(APILocator.systemUser()).find(stInode);<NEW_LINE>if (type != null && InodeUtils.isSet(type.inode())) {<NEW_LINE>// basic data<NEW_LINE>contentlet.setContentTypeId(type.inode());<NEW_LINE>contentlet.setLanguageId(map.containsKey(LANGUAGE_ID) ? Long.parseLong(map.get(LANGUAGE_ID).toString()) : APILocator.getLanguageAPI().getDefaultLanguage().getId());<NEW_LINE>this.processIdentifier(contentlet, map);<NEW_LINE>this.processWorkflow(contentlet, map);<NEW_LINE>// build a field map for easy lookup<NEW_LINE>final Map<String, Field> fieldMap = new HashMap<>();<NEW_LINE>for (final Field field : new LegacyFieldTransformer(type.fields()).asOldFieldList()) {<NEW_LINE>fieldMap.put(field.getVelocityVarName(), field);<NEW_LINE>}<NEW_LINE>// look for relationships<NEW_LINE>contentlet.setProperty(RELATIONSHIP_KEY, this.getContentletRelationships(map, contentlet));<NEW_LINE>// fill fields<NEW_LINE>this.fillFields(contentlet, map, type, fieldMap);<NEW_LINE>}<NEW_LINE>this.setIndexPolicy(contentlet, map);<NEW_LINE>}<NEW_LINE>} | this.getStInode(map, contentlet); |
647,391 | void recordRequestParameters() throws Exception {<NEW_LINE>List<String> missingParams = new ArrayList<String>();<NEW_LINE><MASK><NEW_LINE>if (formTarget == null) {<NEW_LINE>missingParams.add(PARAM_ORIGINAL_REQ_URL);<NEW_LINE>}<NEW_LINE>requestMethod = request.getParameter(PARAM_REQUEST_METHOD);<NEW_LINE>if (requestMethod == null) {<NEW_LINE>missingParams.add(PARAM_REQUEST_METHOD);<NEW_LINE>}<NEW_LINE>formSubmitParamName = request.getParameter(PARAM_SUBMIT_PARAM_NAME);<NEW_LINE>if (formSubmitParamName == null) {<NEW_LINE>missingParams.add(PARAM_SUBMIT_PARAM_NAME);<NEW_LINE>}<NEW_LINE>configurationInfo = request.getParameter(PARAM_CONFIG_JSON_DATA);<NEW_LINE>if (configurationInfo == null) {<NEW_LINE>missingParams.add(PARAM_CONFIG_JSON_DATA);<NEW_LINE>}<NEW_LINE>if (!missingParams.isEmpty()) {<NEW_LINE>throw new Exception("The request is missing the following parameters: " + missingParams);<NEW_LINE>}<NEW_LINE>} | formTarget = request.getParameter(PARAM_ORIGINAL_REQ_URL); |
1,458,246 | public void visit(Node<E> expr) {<NEW_LINE>assert expr != null;<NEW_LINE>if (expr instanceof ColumnReferenceNode<?, ?>) {<NEW_LINE>sb.append(((ColumnReferenceNode<?, ?>) expr).getColumn().getFullQualifiedName());<NEW_LINE>} else if (expr instanceof NewUnaryPostfixOperatorNode<?>) {<NEW_LINE>visit((NewUnaryPostfixOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewUnaryPrefixOperatorNode<?>) {<NEW_LINE>visit((NewUnaryPrefixOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewBinaryOperatorNode<?>) {<NEW_LINE>visit((NewBinaryOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof TableReferenceNode<?, ?>) {<NEW_LINE>visit((TableReferenceNode<E, ?>) expr);<NEW_LINE>} else if (expr instanceof NewFunctionNode<?, ?>) {<NEW_LINE>visit((NewFunctionNode<E, ?>) expr);<NEW_LINE>} else if (expr instanceof NewBetweenOperatorNode<?>) {<NEW_LINE>visit((NewBetweenOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewInOperatorNode<?>) {<NEW_LINE>visit((NewInOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewCaseOperatorNode<?>) {<NEW_LINE>visit((NewCaseOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewOrderingTerm<?>) {<NEW_LINE>visit((NewOrderingTerm<E>) expr);<NEW_LINE>} else if (expr instanceof NewAliasNode<?>) {<NEW_LINE>visit(<MASK><NEW_LINE>} else if (expr instanceof NewPostfixTextNode<?>) {<NEW_LINE>visit((NewPostfixTextNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewTernaryNode<?>) {<NEW_LINE>visit((NewTernaryNode<E>) expr);<NEW_LINE>} else {<NEW_LINE>visitSpecific(expr);<NEW_LINE>}<NEW_LINE>} | (NewAliasNode<E>) expr); |
619,337 | public TadPack tadShapeInfoAndOffsets(INDArray array, int[] dimension) {<NEW_LINE>if (nativeOps.lastErrorCode() != 0)<NEW_LINE>throw new <MASK><NEW_LINE>OpaqueTadPack pack = nativeOps.tadOnlyShapeInfo((LongPointer) array.shapeInfoDataBuffer().addressPointer(), new IntPointer(dimension), dimension.length);<NEW_LINE>if (nativeOps.lastErrorCode() != 0)<NEW_LINE>throw new RuntimeException(nativeOps.lastErrorMessage());<NEW_LINE>val tadShape = new CudaLongDataBuffer(nativeOps.getPrimaryShapeInfo(pack), nativeOps.getSpecialShapeInfo(pack), nativeOps.getShapeInfoLength(pack));<NEW_LINE>val tadOffsets = new CudaLongDataBuffer(nativeOps.getPrimaryOffsets(pack), nativeOps.getSpecialOffsets(pack), nativeOps.getNumberOfTads(pack));<NEW_LINE>nativeOps.deleteTadPack(pack);<NEW_LINE>return new TadPack(tadShape, tadOffsets);<NEW_LINE>} | RuntimeException(nativeOps.lastErrorMessage()); |
1,148,950 | private void addAdd(SourceBuilder code) {<NEW_LINE>code.addLine("").addLine("/**").addLine(" * Adds {@code element} to the set to be returned from %s.", datatype.getType().javadocNoArgMethodLink(property.getGetterName())).addLine(" * If the set already contains {@code element}, then {@code %s}", addMethod(property)).addLine(" * has no effect (only the previously added element is retained).").addLine(" *").addLine(" * @return this {@code %s} object", datatype.<MASK><NEW_LINE>if (!unboxedType.isPresent()) {<NEW_LINE>code.addLine(" * @throws NullPointerException if {@code element} is null");<NEW_LINE>}<NEW_LINE>code.addLine(" */").addLine("public %s %s(%s element) {", datatype.getBuilder(), addMethod(property), unboxedType.orElse(elementType));<NEW_LINE>if (code.feature(GUAVA).isAvailable()) {<NEW_LINE>code.addLine(" if (%s instanceof %s) {", property.getField(), ImmutableSet.class).addLine(" %1$s = new %2$s<>(%1$s);", property.getField(), LinkedHashSet.class).addLine(" }");<NEW_LINE>}<NEW_LINE>if (unboxedType.isPresent()) {<NEW_LINE>code.addLine(" %s.add(element);", property.getField());<NEW_LINE>} else {<NEW_LINE>code.addLine(" %s.add(%s.requireNonNull(element));", property.getField(), Objects.class);<NEW_LINE>}<NEW_LINE>code.addLine(" return (%s) this;", datatype.getBuilder()).addLine("}");<NEW_LINE>} | getBuilder().getSimpleName()); |
1,615,042 | public static TimeValue parseTimeValue(String sValue, TimeValue defaultValue, String settingName) {<NEW_LINE><MASK><NEW_LINE>if (sValue == null) {<NEW_LINE>return defaultValue;<NEW_LINE>}<NEW_LINE>final String normalized = sValue.toLowerCase(Locale.ROOT).trim();<NEW_LINE>if (normalized.endsWith("nanos")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "nanos"), TimeUnit.NANOSECONDS);<NEW_LINE>} else if (normalized.endsWith("micros")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "micros"), TimeUnit.MICROSECONDS);<NEW_LINE>} else if (normalized.endsWith("ms")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "ms"), TimeUnit.MILLISECONDS);<NEW_LINE>} else if (normalized.endsWith("s")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "s"), TimeUnit.SECONDS);<NEW_LINE>} else if (sValue.endsWith("m")) {<NEW_LINE>// parsing minutes should be case-sensitive as 'M' means "months", not "minutes"; this is the only special case.<NEW_LINE>return new TimeValue(parse(sValue, normalized, "m"), TimeUnit.MINUTES);<NEW_LINE>} else if (normalized.endsWith("h")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "h"), TimeUnit.HOURS);<NEW_LINE>} else if (normalized.endsWith("d")) {<NEW_LINE>return new TimeValue(parse(sValue, normalized, "d"), TimeUnit.DAYS);<NEW_LINE>} else if (normalized.matches("-0*1")) {<NEW_LINE>return TimeValue.MINUS_ONE;<NEW_LINE>} else if (normalized.matches("0+")) {<NEW_LINE>return TimeValue.ZERO;<NEW_LINE>} else {<NEW_LINE>// Missing units == expect milliseconds<NEW_LINE>return new TimeValue(parse(sValue, normalized, ""), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>} | settingName = Objects.requireNonNull(settingName); |
1,827,839 | public SortedMap<Integer, Map<String, String>> read(BufferedReader bRdr) throws IOException {<NEW_LINE>SortedMap<Integer, Map<String, String>> map = new TreeMap<>();<NEW_LINE>try {<NEW_LINE>boolean found = false;<NEW_LINE>String line;<NEW_LINE>while ((line = bRdr.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.startsWith(DOC)) {<NEW_LINE>found = true;<NEW_LINE>Map<String, String> fields = new HashMap<>();<NEW_LINE>String qid = "";<NEW_LINE>// continue to read DOCNO<NEW_LINE>while ((line = bRdr.readLine()) != null) {<NEW_LINE>if (line.startsWith(DOCNO)) {<NEW_LINE>Matcher m = QUERY_ID_PATTERN.matcher(line);<NEW_LINE>if (!m.find()) {<NEW_LINE>throw new IOException("Error parsing " + line);<NEW_LINE>}<NEW_LINE>qid = m.group(1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>while ((line = bRdr.readLine()) != null) {<NEW_LINE>if (line.startsWith(TERMINATING_DOC)) {<NEW_LINE>fields.put(<MASK><NEW_LINE>map.put(Integer.valueOf(qid), fields);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sb.append(line).append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>bRdr.close();<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | "title", sb.toString()); |
831,473 | private static Bitmap blur(Bitmap bitmap, Context context, float blurRadius) {<NEW_LINE>Point previewSize = scaleKeepingAspectRatio(new Point(bitmap.getWidth(), bitmap.getHeight()), PREVIEW_DIMENSION_LIMIT);<NEW_LINE>Point blurSize = scaleKeepingAspectRatio(new Point(previewSize.x / 2, previewSize.y / 2), MAX_BLUR_DIMENSION);<NEW_LINE>Bitmap small = BitmapUtil.createScaledBitmap(bitmap, <MASK><NEW_LINE>Log.d(TAG, "Bitmap: " + bitmap.getWidth() + "x" + bitmap.getHeight() + ", Blur: " + blurSize.x + "x" + blurSize.y);<NEW_LINE>RenderScript rs = RenderScript.create(context);<NEW_LINE>Allocation input = Allocation.createFromBitmap(rs, small);<NEW_LINE>Allocation output = Allocation.createTyped(rs, input.getType());<NEW_LINE>ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));<NEW_LINE>script.setRadius(blurRadius);<NEW_LINE>script.setInput(input);<NEW_LINE>script.forEach(output);<NEW_LINE>Bitmap blurred = Bitmap.createBitmap(small.getWidth(), small.getHeight(), small.getConfig());<NEW_LINE>output.copyTo(blurred);<NEW_LINE>return blurred;<NEW_LINE>} | blurSize.x, blurSize.y); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.