idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,675,657
|
private void supports(ClassWriter writer) {<NEW_LINE>MethodVisitor visitor = writer.visitMethod(ACC_PUBLIC, "supports", "(Ljava/lang/Class;)Z", null, null);<NEW_LINE>visitor.visitParameter("type", 0);<NEW_LINE>visitor.visitCode();<NEW_LINE>visitor.visitVarInsn(ALOAD, 1);<NEW_LINE>visitor.visitLdcInsn(Type.getObjectType(controllerClass.replace(".", "/")));<NEW_LINE>Label l0 = new Label();<NEW_LINE>visitor.visitJumpInsn(IF_ACMPNE, l0);<NEW_LINE>visitor.visitInsn(Opcodes.ICONST_1);<NEW_LINE>Label l1 = new Label();<NEW_LINE>visitor.visitJumpInsn(Opcodes.GOTO, l1);<NEW_LINE>visitor.visitLabel(l0);<NEW_LINE>visitor.visitFrame(Opcodes.F_SAME, 0, null, 0, null);<NEW_LINE>visitor.visitInsn(Opcodes.ICONST_0);<NEW_LINE>visitor.visitLabel(l1);<NEW_LINE>visitor.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] { Opcodes.INTEGER });<NEW_LINE>visitor.visitInsn(Opcodes.IRETURN);<NEW_LINE><MASK><NEW_LINE>visitor.visitEnd();<NEW_LINE>}
|
visitor.visitMaxs(0, 0);
|
285,115
|
public static void main(final String[] args) throws IOException {<NEW_LINE>String remoteHost = "localhost";<NEW_LINE>if (1 <= args.length) {<NEW_LINE>remoteHost = args[0];<NEW_LINE>}<NEW_LINE>int packetSize = 16;<NEW_LINE>if (2 <= args.length) {<NEW_LINE>packetSize = min(Configuration.MTU_LENGTH_DEFAULT, max(packetSize, Integer.parseInt(args[1])));<NEW_LINE>}<NEW_LINE>int burstSize = 1;<NEW_LINE>if (3 <= args.length) {<NEW_LINE>burstSize = min(1024, Integer.parseInt(args[2]));<NEW_LINE>}<NEW_LINE>System.out.printf("Remote host: %s, packet size: %d, burstSize: %d%n", remoteHost, packetSize, burstSize);<NEW_LINE>final Histogram histogram = new Histogram(TimeUnit.SECONDS.toNanos(10), 3);<NEW_LINE>final ByteBuffer buffer = ByteBuffer.allocateDirect(Configuration.MTU_LENGTH_DEFAULT);<NEW_LINE>for (int i = 0, length = buffer.capacity(); i < length; i++) {<NEW_LINE>buffer.put(i, (byte) 0xFF);<NEW_LINE>}<NEW_LINE>final DatagramChannel receiveChannel = DatagramChannel.open();<NEW_LINE>receiveChannel.bind(new InetSocketAddress("0.0.0.0", Common.PONG_PORT));<NEW_LINE>final InetSocketAddress sendAddress = new <MASK><NEW_LINE>final DatagramChannel sendChannel = DatagramChannel.open();<NEW_LINE>init(sendChannel);<NEW_LINE>final AtomicBoolean running = new AtomicBoolean(true);<NEW_LINE>SigInt.register(() -> running.set(false));<NEW_LINE>while (running.get()) {<NEW_LINE>measureRoundTrip(histogram, sendAddress, buffer, packetSize, burstSize, receiveChannel, sendChannel, running);<NEW_LINE>histogram.reset();<NEW_LINE>System.gc();<NEW_LINE>LockSupport.parkNanos(1_000_000_000);<NEW_LINE>}<NEW_LINE>}
|
InetSocketAddress(remoteHost, Common.PING_PORT);
|
553,779
|
public void bindTrackItem(TrackViewHolder viewHolder, SearchResult searchResult, int position) {<NEW_LINE>GPXInfo gpxInfo = (GPXInfo) searchResult.relatedObject;<NEW_LINE>QuickSearchListItem listItem = new QuickSearchListItem(app, searchResult);<NEW_LINE>QuickSearchListAdapter.bindGpxTrack(viewHolder.itemView, listItem, gpxInfo);<NEW_LINE>boolean selected = selectedItems.contains(searchResult);<NEW_LINE>viewHolder.compoundButton.setChecked(selected);<NEW_LINE>viewHolder.itemView.setOnClickListener(v -> {<NEW_LINE>boolean checked = !viewHolder.compoundButton.isChecked();<NEW_LINE>if (listener != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>notifyDataSetChanged();<NEW_LINE>});<NEW_LINE>int iconColor = ContextCompat.getColor(app, selected ? activeColorId : defaultColorId);<NEW_LINE>viewHolder.icon.setImageDrawable(UiUtilities.tintDrawable(listItem.getIcon(), iconColor));<NEW_LINE>boolean lastItem = position == getItemCount() - 1;<NEW_LINE>AndroidUiHelper.updateVisibility(viewHolder.divider, lastItem);<NEW_LINE>UiUtilities.setupCompoundButton(nightMode, ContextCompat.getColor(app, activeColorId), viewHolder.compoundButton);<NEW_LINE>}
|
listener.onItemSelected(searchResult, checked);
|
1,275,548
|
public void handle(PacketWrapper wrapper) throws Exception {<NEW_LINE>String channel = wrapper.get(Type.STRING, 0);<NEW_LINE>if (channel.equals("minecraft:trader_list") || channel.equals("trader_list")) {<NEW_LINE>// Passthrough Window ID<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>int size = wrapper.passthrough(Type.UNSIGNED_BYTE);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// Input Item<NEW_LINE>handleItemToClient(wrapper.passthrough(Type.FLAT_ITEM));<NEW_LINE>// Output Item<NEW_LINE>handleItemToClient(wrapper.passthrough(Type.FLAT_ITEM));<NEW_LINE>// Has second item<NEW_LINE>boolean secondItem = <MASK><NEW_LINE>if (secondItem) {<NEW_LINE>// Second Item<NEW_LINE>handleItemToClient(wrapper.passthrough(Type.FLAT_ITEM));<NEW_LINE>}<NEW_LINE>// Trade disabled<NEW_LINE>wrapper.passthrough(Type.BOOLEAN);<NEW_LINE>// Number of tools uses<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>// Maximum number of trade uses<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
wrapper.passthrough(Type.BOOLEAN);
|
561,090
|
public JRCrosstabColumnGroup removeColumnGroup(String groupName) {<NEW_LINE>JRCrosstabColumnGroup removed = null;<NEW_LINE>Integer idx = columnGroupsMap.remove(groupName);<NEW_LINE>if (idx != null) {<NEW_LINE>removed = columnGroups.remove((int) idx);<NEW_LINE>for (ListIterator<JRCrosstabColumnGroup> it = columnGroups.listIterator(idx); it.hasNext(); ) {<NEW_LINE>JRCrosstabColumnGroup group = it.next();<NEW_LINE>columnGroupsMap.put(group.getName(), it.previousIndex());<NEW_LINE>}<NEW_LINE>for (Iterator<JRCrosstabCell> it = cellsList.iterator(); it.hasNext(); ) {<NEW_LINE>JRCrosstabCell cell = it.next();<NEW_LINE><MASK><NEW_LINE>if (columnTotalGroup != null && columnTotalGroup.equals(groupName)) {<NEW_LINE>it.remove();<NEW_LINE>cellsMap.remove(new Pair<String, String>(cell.getRowTotalGroup(), columnTotalGroup));<NEW_LINE>getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_CELLS, cell, -1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>removeColGroupVars(removed);<NEW_LINE>getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_COLUMN_GROUPS, removed, idx);<NEW_LINE>}<NEW_LINE>return removed;<NEW_LINE>}
|
String columnTotalGroup = cell.getColumnTotalGroup();
|
695,751
|
private void zip(ZipOutputStream out, File root, File file, TransferStatus status, HttpRange range) throws IOException {<NEW_LINE>// Exclude all hidden files starting with a "."<NEW_LINE>if (file.getName().startsWith(".")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String zipName = file.getCanonicalPath().substring(root.getCanonicalPath().length() + 1);<NEW_LINE>if (file.isFile()) {<NEW_LINE>status.setFile(file);<NEW_LINE>ZipEntry zipEntry = new ZipEntry(zipName);<NEW_LINE>zipEntry.setSize(file.length());<NEW_LINE>zipEntry.<MASK><NEW_LINE>zipEntry.setCrc(computeCrc(file));<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>copyFileToStream(file, out, status, range);<NEW_LINE>out.closeEntry();<NEW_LINE>} else {<NEW_LINE>ZipEntry zipEntry = new ZipEntry(zipName + '/');<NEW_LINE>zipEntry.setSize(0);<NEW_LINE>zipEntry.setCompressedSize(0);<NEW_LINE>zipEntry.setCrc(0);<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>out.closeEntry();<NEW_LINE>File[] children = FileUtil.listFiles(file);<NEW_LINE>for (File child : children) {<NEW_LINE>zip(out, root, child, status, range);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
setCompressedSize(file.length());
|
187,463
|
final DescribeAppInstanceAdminResult executeDescribeAppInstanceAdmin(DescribeAppInstanceAdminRequest describeAppInstanceAdminRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAppInstanceAdminRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAppInstanceAdminRequest> request = null;<NEW_LINE>Response<DescribeAppInstanceAdminResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAppInstanceAdminRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAppInstanceAdminRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime SDK Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAppInstanceAdmin");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAppInstanceAdminResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAppInstanceAdminResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion());
|
650,245
|
private void registerLeftWidgets(@NonNull MapActivity mapActivity, @NonNull RouteInfoWidgetsFactory routeWidgetsFactory) {<NEW_LINE>int settingsIconId = R.drawable.ic_action_next_turn;<NEW_LINE>WidgetsPanel leftPanel = WidgetsPanel.LEFT;<NEW_LINE>MapWidget bigInfoControl = routeWidgetsFactory.createNextInfoControl(mapActivity, false);<NEW_LINE>registerWidget(WIDGET_NEXT_TURN, bigInfoControl, settingsIconId, R.string.map_widget_next_turn, leftPanel);<NEW_LINE>MapWidget smallInfoControl = <MASK><NEW_LINE>registerWidget(WIDGET_NEXT_TURN_SMALL, smallInfoControl, settingsIconId, R.string.map_widget_next_turn_small, leftPanel);<NEW_LINE>MapWidget nextNextInfoControl = routeWidgetsFactory.createNextNextInfoControl(mapActivity, true);<NEW_LINE>registerWidget(WIDGET_NEXT_NEXT_TURN, nextNextInfoControl, settingsIconId, R.string.map_widget_next_next_turn, leftPanel);<NEW_LINE>}
|
routeWidgetsFactory.createNextInfoControl(mapActivity, true);
|
1,354,181
|
final DescribeStreamProcessorResult executeDescribeStreamProcessor(DescribeStreamProcessorRequest describeStreamProcessorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeStreamProcessorRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeStreamProcessorRequest> request = null;<NEW_LINE>Response<DescribeStreamProcessorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeStreamProcessorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeStreamProcessorRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStreamProcessor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeStreamProcessorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeStreamProcessorResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
|
1,251,498
|
public EnumMap<LsMetricStats, ListStatistics> call() throws IOException {<NEW_LINE>final ListStatistics stats = new ListStatistics();<NEW_LINE>long count = 0L;<NEW_LINE>final ListStatistics counts = new ListStatistics();<NEW_LINE>final ListStatistics cpu = new ListStatistics();<NEW_LINE>final ListStatistics mem = new ListStatistics();<NEW_LINE>long start = System.nanoTime();<NEW_LINE>while (running) {<NEW_LINE>try {<NEW_LINE>TimeUnit.SECONDS.sleep(1L);<NEW_LINE>final long[] newcounts = getCounts();<NEW_LINE><MASK><NEW_LINE>if (newcount < 0L) {<NEW_LINE>start = System.nanoTime();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final long newstrt = System.nanoTime();<NEW_LINE>stats.addValue((double) (newcount - count) / (double) TimeUnit.SECONDS.convert(Math.max(newstrt - start, 1_000_000_000), TimeUnit.NANOSECONDS));<NEW_LINE>start = newstrt;<NEW_LINE>count = newcount;<NEW_LINE>counts.addValue((double) count);<NEW_LINE>cpu.addValue(newcounts[1]);<NEW_LINE>mem.addValue(newcounts[2]);<NEW_LINE>} catch (final InterruptedException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final EnumMap<LsMetricStats, ListStatistics> result = new EnumMap<>(LsMetricStats.class);<NEW_LINE>result.put(LsMetricStats.THROUGHPUT, stats);<NEW_LINE>result.put(LsMetricStats.COUNT, counts);<NEW_LINE>result.put(LsMetricStats.CPU_USAGE, cpu);<NEW_LINE>result.put(LsMetricStats.HEAP_USAGE, mem);<NEW_LINE>store.store(result);<NEW_LINE>return result;<NEW_LINE>}
|
final long newcount = newcounts[0];
|
210,189
|
public void listAnomalyDimensionValuesWithOptions() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listAnomalyDimensionValues#String-String-OffsetDateTime-OffsetDateTime-ListAnomalyDimensionValuesOptions<NEW_LINE>final String detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8";<NEW_LINE>final String dimensionName = "Dim1";<NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-01-01T00:00:00Z");<NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");<NEW_LINE>final ListAnomalyDimensionValuesOptions options = new ListAnomalyDimensionValuesOptions().setMaxPageSize(10);<NEW_LINE>metricsAdvisorAsyncClient.listAnomalyDimensionValues(detectionConfigurationId, dimensionName, startTime, endTime, options).subscribe(dimensionValue -> {<NEW_LINE>System.<MASK><NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listAnomalyDimensionValues#String-String-OffsetDateTime-OffsetDateTime-ListAnomalyDimensionValuesOptions<NEW_LINE>}
|
out.printf("DataFeedDimension Value: %s%n", dimensionValue);
|
1,520,230
|
private static void fillFromPortfolioTransaction(TransactionPair<PortfolioTransaction> transaction, JTransaction jtx) {<NEW_LINE>jtx.portfolio = transaction.getOwner().toString();<NEW_LINE>PortfolioTransaction.Type type = transaction.getTransaction().getType();<NEW_LINE>switch(type) {<NEW_LINE>case BUY:<NEW_LINE>jtx.type = JTransaction.Type.PURCHASE;<NEW_LINE>jtx.account = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case SELL:<NEW_LINE>jtx.type = JTransaction.Type.SALE;<NEW_LINE>jtx.account = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case TRANSFER_OUT:<NEW_LINE>jtx.type = JTransaction.Type.SECURITY_TRANSFER;<NEW_LINE>jtx.otherPortfolio = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case TRANSFER_IN:<NEW_LINE>jtx<MASK><NEW_LINE>jtx.otherPortfolio = jtx.portfolio;<NEW_LINE>jtx.portfolio = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case DELIVERY_INBOUND:<NEW_LINE>jtx.type = JTransaction.Type.INBOUND_DELIVERY;<NEW_LINE>break;<NEW_LINE>case DELIVERY_OUTBOUND:<NEW_LINE>jtx.type = JTransaction.Type.OUTBOUND_DELIVERY;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}
|
.type = JTransaction.Type.SECURITY_TRANSFER;
|
137,419
|
private void initData() throws ParserConfigurationException, IOException, SAXException {<NEW_LINE>DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder builder = dbFactory.newDocumentBuilder();<NEW_LINE>Document doc = builder.parse(ExternalExtensionsDialog.class.getResourceAsStream("/com/badlogic/gdx/setup/data/extensions.xml"));<NEW_LINE>doc.getDocumentElement().normalize();<NEW_LINE>NodeList nList = doc.getElementsByTagName("extension");<NEW_LINE>for (int i = 0; i < nList.getLength(); i++) {<NEW_LINE>Node nNode = nList.item(i);<NEW_LINE>if (nNode.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>Element eElement = (Element) nNode;<NEW_LINE>String name = eElement.getElementsByTagName("name").item(0).getTextContent();<NEW_LINE>String description = eElement.getElementsByTagName("description").item(0).getTextContent();<NEW_LINE>String version = eElement.getElementsByTagName("version").item(0).getTextContent();<NEW_LINE>String compatibility = eElement.getElementsByTagName("compatibility").item(0).getTextContent();<NEW_LINE>String url = eElement.getElementsByTagName("website").item(0).getTextContent();<NEW_LINE>String[] gwtInherits = null;<NEW_LINE>NodeList inheritsNode = eElement.getElementsByTagName("inherit");<NEW_LINE>gwtInherits = new String[inheritsNode.getLength()];<NEW_LINE>for (int j = 0; j < inheritsNode.getLength(); j++) gwtInherits[j] = inheritsNode.item(j).getTextContent();<NEW_LINE>final HashMap<String, List<ExternalExtensionDependency>> dependencies = new HashMap<String, List<ExternalExtensionDependency>>();<NEW_LINE>addToDependencyMapFromXML(dependencies, eElement, "core");<NEW_LINE>addToDependencyMapFromXML(dependencies, eElement, "desktop");<NEW_LINE>addToDependencyMapFromXML(dependencies, eElement, "android");<NEW_LINE>addToDependencyMapFromXML(dependencies, eElement, "ios");<NEW_LINE>addToDependencyMapFromXML(dependencies, eElement, "html");<NEW_LINE>URI uri = null;<NEW_LINE>try {<NEW_LINE>uri = new URI(url);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (uri != null) {<NEW_LINE>final ExternalExtension extension = new ExternalExtension(name, gwtInherits, description, version);<NEW_LINE>extension.setDependencies(dependencies);<NEW_LINE>tableModel.addExtension(extension, false, name, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
description, version, compatibility, uri);
|
464,347
|
protected void perform(@Nonnull final XDebugSession session, final DataContext dataContext) {<NEW_LINE>final XDebuggerEditorsProvider editorsProvider = session.getDebugProcess().getEditorsProvider();<NEW_LINE>final XStackFrame stackFrame = session.getCurrentStackFrame();<NEW_LINE>final XDebuggerEvaluator evaluator = session.getDebugProcess().getEvaluator();<NEW_LINE>if (evaluator == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Editor editor = dataContext.getData(CommonDataKeys.EDITOR);<NEW_LINE>EvaluationMode mode = EvaluationMode.EXPRESSION;<NEW_LINE>String selectedText = editor != null ? editor.getSelectionModel().getSelectedText() : null;<NEW_LINE>if (selectedText != null) {<NEW_LINE>selectedText = evaluator.formatTextForEvaluation(selectedText);<NEW_LINE>mode = evaluator.getEvaluationMode(selectedText, editor.getSelectionModel().getSelectionStart(), editor.getSelectionModel().getSelectionEnd(), dataContext.getData(CommonDataKeys.PSI_FILE));<NEW_LINE>}<NEW_LINE>String text = selectedText;<NEW_LINE>if (text == null && editor != null) {<NEW_LINE>text = getExpressionText(evaluator, dataContext.getData(CommonDataKeys.PROJECT), editor);<NEW_LINE>}<NEW_LINE>final VirtualFile file = dataContext.getData(CommonDataKeys.VIRTUAL_FILE);<NEW_LINE>if (text == null) {<NEW_LINE>XValue value = XDebuggerTreeActionBase.getSelectedValue(dataContext);<NEW_LINE>if (value != null) {<NEW_LINE>value.calculateEvaluationExpression().doWhenDone(new Consumer<XExpression>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(final XExpression expression) {<NEW_LINE>if (expression != null) {<NEW_LINE>AppUIUtil.invokeOnEdt(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>showDialog(session, file, editorsProvider, stackFrame, evaluator, expression);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>XExpression expression = XExpressionImpl.fromText(StringUtil.notNullize(text), mode);<NEW_LINE>showDialog(session, file, <MASK><NEW_LINE>}
|
editorsProvider, stackFrame, evaluator, expression);
|
981,050
|
private void init(@Nonnull IModObject modObject) {<NEW_LINE>SmartModelAttacher.registerNoProps(this);<NEW_LINE>PaintRegistry.registerModel(MODEL_UP, new ResourceLocation("minecraft:block/stone_pressure_plate_up"), PaintRegistry.PaintMode.ALL_TEXTURES);<NEW_LINE>PaintRegistry.registerModel(MODEL_DOWN, new ResourceLocation("minecraft:block/stone_pressure_plate_down"), PaintRegistry.PaintMode.ALL_TEXTURES);<NEW_LINE>defaultPaints.put(EnumPressurePlateType.WOOD, Blocks.WOODEN_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.STONE, Blocks.STONE_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.IRON, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE.getDefaultState());<NEW_LINE>defaultPaints.put(EnumPressurePlateType.GOLD, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE.getDefaultState());<NEW_LINE>// we "hide" our textures for our variants in these blockstates. Our paint rendering will make sure they are never actually rendered.<NEW_LINE>defaultPaints.put(EnumPressurePlateType.DARKSTEEL, getDefaultState().withProperty<MASK><NEW_LINE>defaultPaints.put(EnumPressurePlateType.SOULARIUM, getDefaultState().withProperty(BlockPressurePlateWeighted.POWER, 2));<NEW_LINE>defaultPaints.put(EnumPressurePlateType.TUNED, getDefaultState().withProperty(BlockPressurePlateWeighted.POWER, 3));<NEW_LINE>}
|
(BlockPressurePlateWeighted.POWER, 1));
|
954,901
|
public long execute(WithdrawRewardParam param, Repository repo) throws ContractExeException {<NEW_LINE>byte[<MASK><NEW_LINE>VoteRewardUtil.withdrawReward(ownerAddress, repo);<NEW_LINE>AccountCapsule accountCapsule = repo.getAccount(ownerAddress);<NEW_LINE>long oldBalance = accountCapsule.getBalance();<NEW_LINE>long allowance = accountCapsule.getAllowance();<NEW_LINE>long newBalance = 0;<NEW_LINE>try {<NEW_LINE>newBalance = LongMath.checkedAdd(oldBalance, allowance);<NEW_LINE>} catch (ArithmeticException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>// If no allowance, do nothing and just return zero.<NEW_LINE>if (allowance <= 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>accountCapsule.setInstance(accountCapsule.getInstance().toBuilder().setBalance(newBalance).setAllowance(0L).setLatestWithdrawTime(param.getNowInMs()).build());<NEW_LINE>repo.updateAccount(accountCapsule.createDbKey(), accountCapsule);<NEW_LINE>return allowance;<NEW_LINE>}
|
] ownerAddress = param.getOwnerAddress();
|
271,552
|
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE><MASK><NEW_LINE>Table table = emc.flag(flag, Table.class);<NEW_LINE>if (null == table) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Table.class);<NEW_LINE>}<NEW_LINE>Query query = business.entityManagerContainer().flag(table.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(table.getQuery(), Query.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, query);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, table)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, table);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(table);<NEW_LINE>wo.setQueryName(query.getName());<NEW_LINE>wo.setQueryAlias(query.getAlias());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
|
Business business = new Business(emc);
|
1,487,439
|
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>PrimaryStorageAllocationSpec spec = (PrimaryStorageAllocationSpec) data.get(AllocatorParams.SPEC);<NEW_LINE>List<PrimaryStorageVO> candidates = (List<PrimaryStorageVO>) data.get(AllocatorParams.CANDIDATES);<NEW_LINE>DebugUtils.Assert(candidates != null && !candidates.isEmpty(), "PrimaryStorageReservedCapacityAllocatorFlow cannot be the first element in allocator chain");<NEW_LINE>List<PrimaryStorageVO> ret = candidates.stream().filter(psvo -> PrimaryStorageCapacityChecker.New(psvo.getCapacity()).checkIncreasedAndTotalRequiredSize(spec.getSize(), spec.getTotalSize())).collect(Collectors.toList());<NEW_LINE>if (ret.isEmpty()) {<NEW_LINE>throw new OperationFailureException(operr("after subtracting reserved capacity[%s], there is no primary storage having required size[%s bytes], may be the threshold of primary storage physical capacity setting is lower", PrimaryStorageGlobalConfig.RESERVED_CAPACITY.value(), spec.getSize()));<NEW_LINE>}<NEW_LINE>data.<MASK><NEW_LINE>trigger.next();<NEW_LINE>}
|
put(AllocatorParams.CANDIDATES, ret);
|
832,832
|
static void copyDirectory(final Path source, final Path target, final CopyOption... options) throws IOException {<NEW_LINE>final boolean foreign = source.getFileSystem().provider() != target.getFileSystem().provider();<NEW_LINE>FileVisitor<Path> visitor = new SimpleFileVisitor<Path>() {<NEW_LINE><NEW_LINE>public FileVisitResult preVisitDirectory(Path current, BasicFileAttributes attr) throws IOException {<NEW_LINE>// get the *delta* path against the source path<NEW_LINE>Path rel = source.relativize(current);<NEW_LINE>String delta = rel != null ? rel.toString() : null;<NEW_LINE>Path newFolder = delta != null ? target.resolve(delta) : target;<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE><MASK><NEW_LINE>// this `copy` creates the new folder, but does not copy the contained files<NEW_LINE>Files.createDirectory(newFolder);<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path current, BasicFileAttributes attr) throws IOException {<NEW_LINE>// get the *delta* path against the source path<NEW_LINE>Path rel = source.relativize(current);<NEW_LINE>String delta = rel != null ? rel.toString() : null;<NEW_LINE>Path newFile = delta != null ? target.resolve(delta) : target;<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("Copy file: " + current + " -> " + newFile.toUri());<NEW_LINE>copyFile(current, newFile, foreign, options);<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, visitor);<NEW_LINE>}
|
log.trace("Copy DIR: $current -> " + newFolder);
|
1,037,319
|
// //////////////////////////////////////////////////////////////////////////<NEW_LINE>// Methods //<NEW_LINE>// //////////////////////////////////////////////////////////////////////////<NEW_LINE>Runner newRunner(final GlassFishServer srv, final Command cmd, final Class runnerClass) throws CommandException {<NEW_LINE>final String METHOD = "newRunner";<NEW_LINE>Constructor<Runner> con = null;<NEW_LINE>Runner runner = null;<NEW_LINE>try {<NEW_LINE>con = runnerClass.getConstructor(GlassFishServer.class, Command.class);<NEW_LINE>} catch (NoSuchMethodException | SecurityException nsme) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (con == null) {<NEW_LINE>return runner;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>runner = con.newInstance(srv, cmd);<NEW_LINE>} catch (InstantiationException | IllegalAccessException ie) {<NEW_LINE>throw new CommandException(CommandException.RUNNER_INIT, ie);<NEW_LINE>} catch (InvocationTargetException ite) {<NEW_LINE>LOGGER.log(Level.WARNING, "exceptionMsg", ite.getMessage());<NEW_LINE>Throwable t = ite.getCause();<NEW_LINE>if (t != null) {<NEW_LINE>LOGGER.log(Level.WARNING, "cause", t.getMessage());<NEW_LINE>}<NEW_LINE>throw new CommandException(CommandException.RUNNER_INIT, ite);<NEW_LINE>}<NEW_LINE>return runner;<NEW_LINE>}
|
CommandException(CommandException.RUNNER_INIT, nsme);
|
664,069
|
public static void untarOneFile(File inputFile, String fileName, File outputFile) throws IOException {<NEW_LINE>try (InputStream fileIn = Files.<MASK><NEW_LINE>InputStream bufferedIn = new BufferedInputStream(fileIn);<NEW_LINE>InputStream gzipIn = new GzipCompressorInputStream(bufferedIn);<NEW_LINE>ArchiveInputStream tarGzIn = new TarArchiveInputStream(gzipIn)) {<NEW_LINE>ArchiveEntry entry;<NEW_LINE>while ((entry = tarGzIn.getNextEntry()) != null) {<NEW_LINE>if (!entry.isDirectory()) {<NEW_LINE>String entryName = entry.getName();<NEW_LINE>String[] parts = StringUtils.split(entryName, ENTRY_NAME_SEPARATOR);<NEW_LINE>if (parts.length > 0 && parts[parts.length - 1].equals(fileName)) {<NEW_LINE>try (OutputStream out = Files.newOutputStream(outputFile.toPath())) {<NEW_LINE>IOUtils.copy(tarGzIn, out);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IOException(String.format("Failed to find file: %s in: %s", fileName, inputFile));<NEW_LINE>}<NEW_LINE>}
|
newInputStream(inputFile.toPath());
|
1,524,293
|
public void modifyTx(ClientDetailsModification[] clients) {<NEW_LINE>for (ClientDetailsModification client : clients) {<NEW_LINE>if (ClientDetailsModification.ADD.equals(client.getAction())) {<NEW_LINE>publish(new ClientCreateEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>} else if (ClientDetailsModification.UPDATE.equals(client.getAction())) {<NEW_LINE>publish(new ClientUpdateEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>} else if (ClientDetailsModification.DELETE.equals(client.getAction())) {<NEW_LINE>publish(new ClientDeleteEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>} else if (ClientDetailsModification.UPDATE_SECRET.equals(client.getAction())) {<NEW_LINE>publish(new ClientUpdateEvent(client, getPrincipal()<MASK><NEW_LINE>if (client.isApprovalsDeleted()) {<NEW_LINE>publish(new SecretChangeEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>publish(new ClientApprovalsDeletedEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>}<NEW_LINE>} else if (ClientDetailsModification.SECRET.equals(client.getAction())) {<NEW_LINE>if (client.isApprovalsDeleted()) {<NEW_LINE>publish(new SecretChangeEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>publish(new ClientApprovalsDeletedEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
, identityZoneManager.getCurrentIdentityZoneId()));
|
112,672
|
// Could override this to provide a custom behavior.<NEW_LINE>protected void ensureEmailConstraint(List<UserEntity> users, RealmModel realm) {<NEW_LINE>UserEntity user = users.get(0);<NEW_LINE>if (users.size() > 1) {<NEW_LINE>// Realm settings have been changed from allowing duplicate emails to not allowing them<NEW_LINE>// but duplicates haven't been removed.<NEW_LINE>throw new ModelDuplicateException("Multiple users with email '" + user.getEmail() + "' exist in Keycloak.");<NEW_LINE>}<NEW_LINE>if (realm.isDuplicateEmailsAllowed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (user.getEmail() != null && !user.getEmail().equals(user.getEmailConstraint())) {<NEW_LINE>// Realm settings have been changed from allowing duplicate emails to not allowing them.<NEW_LINE>// We need to update the email constraint to reflect this change in the user entities.<NEW_LINE>user.<MASK><NEW_LINE>em.persist(user);<NEW_LINE>}<NEW_LINE>}
|
setEmailConstraint(user.getEmail());
|
366,646
|
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main_menu);<NEW_LINE>// Show App version and footer.<NEW_LINE>TextView tv = findViewById(R.id.textViewMainFooter);<NEW_LINE>tv.setText(getString(R.string.app_version) + ": " + Common.getVersionCode());<NEW_LINE>// Add the context menu to the tools button.<NEW_LINE>Button tools = findViewById(R.id.buttonMainTools);<NEW_LINE>registerForContextMenu(tools);<NEW_LINE>// Restore state.<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>mDonateDialogWasShown = savedInstanceState.getBoolean("donate_dialog_was_shown");<NEW_LINE>mInfoExternalNfcDialogWasShown = savedInstanceState.getBoolean("info_external_nfc_dialog_was_shown");<NEW_LINE>mHasNoNfc = savedInstanceState.getBoolean("has_no_nfc");<NEW_LINE>mOldIntent = savedInstanceState.getParcelable("old_intent");<NEW_LINE>}<NEW_LINE>// Bind main layout buttons.<NEW_LINE>mReadTag = <MASK><NEW_LINE>mWriteTag = findViewById(R.id.buttonMainWriteTag);<NEW_LINE>mKeyEditor = findViewById(R.id.buttonMainEditKeyDump);<NEW_LINE>mDumpEditor = findViewById(R.id.buttonMainEditCardDump);<NEW_LINE>initFolders();<NEW_LINE>copyStdKeysFiles();<NEW_LINE>}
|
findViewById(R.id.buttonMainReadTag);
|
1,178,321
|
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(game.getActivePlayerId());<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (player == null || permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Choice choice = new ChoiceImpl();<NEW_LINE>choice.setChoices(new HashSet(Arrays.asList("Add a doom counter", "Remove a doom counter", "Do nothing")));<NEW_LINE>player.choose(outcome, choice, game);<NEW_LINE>switch(choice.getChoice()) {<NEW_LINE>case "Add a doom counter":<NEW_LINE>permanent.addCounters(CounterType.DOOM.createInstance(), player.getId(), source, game);<NEW_LINE>break;<NEW_LINE>case "Remove a doom counter":<NEW_LINE>permanent.removeCounters(CounterType.DOOM.createInstance(), source, game);<NEW_LINE>break;<NEW_LINE>case "Do nothing":<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (permanent.getCounters(game).getCount(CounterType.DOOM) < 3 || !permanent.sacrifice(source, game)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(new DamageAllEffect(6, StaticFilters.FILTER_PERMANENT_CREATURE), false, "it deals 6 damage to each creature."), source);<NEW_LINE>return true;<NEW_LINE>}
|
getPermanent(source.getSourceId());
|
354,553
|
public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ContextNestedWithFilterUDF());<NEW_LINE>execs.add(new ContextNestedIterateTargetedCP());<NEW_LINE>execs.add(new ContextNestedInvalid());<NEW_LINE>execs.add(new ContextNestedIterator());<NEW_LINE>execs.add(new ContextNestedPartitionedWithFilterOverlap());<NEW_LINE>execs.add(new ContextNestedPartitionedWithFilterNonOverlap());<NEW_LINE>execs.add(new ContextNestedNestingFilterCorrectness());<NEW_LINE>execs.add(new ContextNestedCategoryOverPatternInitiated());<NEW_LINE>execs.add(new ContextNestedSingleEventTriggerNested());<NEW_LINE>execs.add(new ContextNestedFourContextsNested());<NEW_LINE>execs.add(new ContextNestedTemporalOverCategoryOverPartition());<NEW_LINE>execs.add(new ContextNestedTemporalFixedOverHash());<NEW_LINE>execs.add(new ContextNestedCategoryOverTemporalOverlapping());<NEW_LINE>execs.add(new ContextNestedFixedTemporalOverPartitioned());<NEW_LINE>execs.add(new ContextNestedPartitionedOverFixedTemporal());<NEW_LINE>execs.add(new ContextNestedContextProps());<NEW_LINE>execs.add(new ContextNestedLateComingStatement());<NEW_LINE>execs.add(new ContextNestedPartitionWithMultiPropsAndTerm());<NEW_LINE>execs.add(new ContextNestedOverlappingAndPattern());<NEW_LINE>execs.add(new ContextNestedNonOverlapping());<NEW_LINE>execs.add(new ContextNestedPartitionedOverPatternInitiated());<NEW_LINE>execs.add(new ContextNestedInitWStartNow());<NEW_LINE>execs.add(new ContextNestedInitWStartNowSceneTwo());<NEW_LINE>execs.add(new ContextNestedKeyedStartStop());<NEW_LINE>execs.add(new ContextNestedKeyedFilter());<NEW_LINE>execs.add(new ContextNestedNonOverlapOverNonOverlapNoEndCondition(false));<NEW_LINE>execs.add(new ContextNestedNonOverlapOverNonOverlapNoEndCondition(true));<NEW_LINE>execs.add(new ContextNestedInitTermWCategoryWHash());<NEW_LINE>execs.add(new ContextNestedInitTermOverHashIterate(true));<NEW_LINE>execs.add(new ContextNestedInitTermOverHashIterate(false));<NEW_LINE>execs.add(new ContextNestedInitTermOverPartitionedIterate());<NEW_LINE>execs.add(new ContextNestedInitTermOverCategoryIterate());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ContextNestedCategoryOverInitTermDistinct());<NEW_LINE>execs.add(new ContextNestedKeySegmentedWInitTermEndEvent());<NEW_LINE>execs.add(new ContextNestedTemporalOverlapOverPartition());<NEW_LINE>return execs;<NEW_LINE>}
|
.add(new ContextNestedInitTermOverInitTermIterate());
|
658,586
|
protected void buttonPressed(int buttonId) {<NEW_LINE>DataFormatterRegistry registry = DataFormatterRegistry.getInstance();<NEW_LINE>if (buttonId == NEW_ID) {<NEW_LINE>String profileName = EnterNameDialog.chooseName(getShell(), ResultSetMessages.dialog_data_format_profiles_dialog_name_chooser_title);<NEW_LINE>if (CommonUtils.isEmpty(profileName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (registry.getCustomProfile(profileName) != null) {<NEW_LINE>UIUtils.showMessageBox(getShell(), ResultSetMessages.dialog_data_format_profiles_error_title, NLS.bind(ResultSetMessages.dialog_data_format_profiles_error_message<MASK><NEW_LINE>} else {<NEW_LINE>registry.createCustomProfile(profileName);<NEW_LINE>loadProfiles();<NEW_LINE>}<NEW_LINE>} else if (buttonId == DELETE_ID) {<NEW_LINE>int selectionIndex = profileList.getSelectionIndex();<NEW_LINE>if (selectionIndex >= 0) {<NEW_LINE>DBDDataFormatterProfile profile = registry.getCustomProfile(profileList.getItem(selectionIndex));<NEW_LINE>if (profile != null) {<NEW_LINE>if (UIUtils.confirmAction(getShell(), ResultSetMessages.dialog_data_format_profiles_confirm_delete_title, ResultSetMessages.dialog_data_format_profiles_confirm_delete_message)) {<NEW_LINE>registry.deleteCustomProfile(profile);<NEW_LINE>loadProfiles();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.buttonPressed(buttonId);<NEW_LINE>}<NEW_LINE>}
|
, profileName), SWT.ICON_ERROR);
|
1,460,560
|
public void generateMultiCustomerInvoice(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>List<Map> stockMoveMap = (List<Map>) request.getContext().get("customerStockMoveToInvoice");<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<MASK><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("Cust. Invoices");<NEW_LINE>viewBuilder.model(Invoice.class.getName()).add("grid", "invoice-grid").add("form", "invoice-form").param("search-filters", "customer-invoices-filters").domain("self.id IN (" + Joiner.on(",").join(invoiceIdList) + ")").context("_operationTypeSelect", InvoiceRepository.OPERATION_TYPE_CLIENT_SALE).context("todayDate", Beans.get(AppSupplychainService.class).getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null)));<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>}
|
.class).generateMultipleInvoices(stockMoveIdList);
|
1,378,515
|
public static synchronized void updateValues() {<NEW_LINE>// Only do this if either LiveWindow mode or telemetry is enabled.<NEW_LINE>if (!liveWindowEnabled && !telemetryEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SendableRegistry.foreachLiveWindow(dataHandle, cbdata -> {<NEW_LINE>if (cbdata.sendable == null || cbdata.parent != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cbdata.data == null) {<NEW_LINE>cbdata.data = new Component();<NEW_LINE>}<NEW_LINE>Component component = (Component) cbdata.data;<NEW_LINE>if (!liveWindowEnabled && !component.m_telemetryEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (component.m_firstTime) {<NEW_LINE>// By holding off creating the NetworkTable entries, it allows the<NEW_LINE>// components to be redefined. This allows default sensor and actuator<NEW_LINE>// values to be created that are replaced with the custom names from<NEW_LINE>// users calling setName.<NEW_LINE>if (cbdata.name.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NetworkTable ssTable = liveWindowTable.getSubTable(cbdata.subsystem);<NEW_LINE>NetworkTable table;<NEW_LINE>// Treat name==subsystem as top level of subsystem<NEW_LINE>if (cbdata.name.equals(cbdata.subsystem)) {<NEW_LINE>table = ssTable;<NEW_LINE>} else {<NEW_LINE>table = <MASK><NEW_LINE>}<NEW_LINE>table.getEntry(".name").setString(cbdata.name);<NEW_LINE>((SendableBuilderImpl) cbdata.builder).setTable(table);<NEW_LINE>cbdata.sendable.initSendable(cbdata.builder);<NEW_LINE>ssTable.getEntry(".type").setString("LW Subsystem");<NEW_LINE>component.m_firstTime = false;<NEW_LINE>}<NEW_LINE>if (startLiveWindow) {<NEW_LINE>((SendableBuilderImpl) cbdata.builder).startLiveWindowMode();<NEW_LINE>}<NEW_LINE>cbdata.builder.update();<NEW_LINE>});<NEW_LINE>startLiveWindow = false;<NEW_LINE>}
|
ssTable.getSubTable(cbdata.name);
|
1,436,349
|
public ListAddonsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAddonsResult listAddonsResult = new ListAddonsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAddonsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("addons", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAddonsResult.setAddons(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAddonsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listAddonsResult;<NEW_LINE>}
|
class).unmarshall(context));
|
1,554,601
|
// taken from http://www.docjar.com/html/api/org/apache/pdfbox/examples/util/RemoveAllText.java.html<NEW_LINE>private PDDocument removeText(PDPage page) throws IOException {<NEW_LINE>PDFStreamParser parser = new PDFStreamParser(page);<NEW_LINE>parser.parse();<NEW_LINE>List<Object> tokens = parser.getTokens();<NEW_LINE>List<Object> newTokens = new ArrayList<>();<NEW_LINE>for (Object token : tokens) {<NEW_LINE>if (token instanceof Operator) {<NEW_LINE>Operator op = (Operator) token;<NEW_LINE>if (op.getName().equals("TJ") || op.getName().equals("Tj")) {<NEW_LINE>// remove the one argument to this operator<NEW_LINE>newTokens.remove(newTokens.size() - 1);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newTokens.add(token);<NEW_LINE>}<NEW_LINE>PDDocument document = new PDDocument();<NEW_LINE>PDPage <MASK><NEW_LINE>newPage.setResources(page.getResources());<NEW_LINE>PDStream newContents = new PDStream(document);<NEW_LINE>OutputStream out = newContents.createOutputStream(COSName.FLATE_DECODE);<NEW_LINE>ContentStreamWriter writer = new ContentStreamWriter(out);<NEW_LINE>writer.writeTokens(newTokens);<NEW_LINE>out.close();<NEW_LINE>newPage.setContents(newContents);<NEW_LINE>return document;<NEW_LINE>}
|
newPage = document.importPage(page);
|
717,482
|
public void run() {<NEW_LINE>if (!LOG.isStatistics()) {<NEW_LINE>LOG.error("Logging level should be at least level STATISTICS (parameter -time) to see any output.");<NEW_LINE>}<NEW_LINE>Database database = inputstep.getDatabase();<NEW_LINE>Relation<O> relation = database.<MASK><NEW_LINE>final String key = getClass().getName();<NEW_LINE>Duration dur = LOG.newDuration(key + ".duration");<NEW_LINE>int hash;<NEW_LINE>MeanVariance mv = new MeanVariance(), mvdist = new MeanVariance();<NEW_LINE>// No query set - use original database.<NEW_LINE>if (queries == null) {<NEW_LINE>KNNSearcher<DBIDRef> knnQuery = new QueryBuilder<>(relation, distance).kNNByDBID(k);<NEW_LINE>logIndexStatistics(database);<NEW_LINE>hash = run(knnQuery, relation, dur, mv, mvdist);<NEW_LINE>} else {<NEW_LINE>// Separate query set.<NEW_LINE>KNNSearcher<O> knnQuery = new QueryBuilder<>(relation, distance).kNNByObject(k);<NEW_LINE>logIndexStatistics(database);<NEW_LINE>hash = run(knnQuery, dur, mv, mvdist);<NEW_LINE>}<NEW_LINE>LOG.statistics(dur.end());<NEW_LINE>if (dur instanceof MillisTimeDuration) {<NEW_LINE>LOG.statistics(new StringStatistic(key + ".duration.avg", dur.getDuration() / mv.getCount() * 1000. + " ns"));<NEW_LINE>}<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".results.mean", mv.getMean()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".results.std", mv.getPopulationStddev()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".kdist.mean", mvdist.getMean()));<NEW_LINE>LOG.statistics(new DoubleStatistic(key + ".kdist.std", mvdist.getPopulationStddev()));<NEW_LINE>logIndexStatistics(database);<NEW_LINE>LOG.statistics(new LongStatistic(key + ".checksum", hash));<NEW_LINE>}
|
getRelation(distance.getInputTypeRestriction());
|
700,112
|
private static void flatten(String parentKey, String key, Object value, Map<String, String> results) {<NEW_LINE>String parent = (parentKey == null || parentKey.equals("")) ? "" : parentKey + addTheDot(parentKey);<NEW_LINE>if (value instanceof String) {<NEW_LINE>results.put(parent + key, (String) value);<NEW_LINE>return;<NEW_LINE>} else if (value instanceof List) {<NEW_LINE>((List<?>) value).forEach(l -> {<NEW_LINE>if (l instanceof String) {<NEW_LINE>// remove the [] at the ends of toString()<NEW_LINE>String val = value.toString();<NEW_LINE>results.put(parent + key, val.substring(1, val.length() - 1)<MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>flatten(parent, key, l, results);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> map = (Map<String, Object>) value;<NEW_LINE>map.forEach((k, v) -> flatten(parent + key, k, v, results));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled object type: " + value.getClass());<NEW_LINE>}<NEW_LINE>}
|
.replace(", ", " "));
|
503,325
|
boolean canCreate(TemplateWizard wizard) {<NEW_LINE>if (webApp == null) {<NEW_LINE>// This case is considered as normal in other cases. So I keep it also as valid.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (webApp.getStatus() == WebApp.STATE_INVALID_OLD_VERSION) {<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(ServletData.class, "MSG_OldVersion"));<NEW_LINE>return false;<NEW_LINE>} else if (webApp.getStatus() == WebApp.STATE_INVALID_UNPARSABLE) {<NEW_LINE>if (webApp.getVersion() == null) {<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(ServletData.class, "MSG_UnuspportedVersion"));<NEW_LINE>} else {<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage<MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
(ServletData.class, "MSG_InvalidWebXml"));
|
284,988
|
public ContactGibberishImpl createVolatileContact(String contactAddress) {<NEW_LINE>// First create the new volatile contact;<NEW_LINE>ContactGibberishImpl newVolatileContact = new <MASK><NEW_LINE>newVolatileContact.setPersistent(false);<NEW_LINE>// Check whether a volatile group already exists and if not create<NEW_LINE>// one<NEW_LINE>ContactGroupGibberishImpl theVolatileGroup = getNonPersistentGroup();<NEW_LINE>// if the parent volatile group is null then we create it<NEW_LINE>if (theVolatileGroup == null) {<NEW_LINE>theVolatileGroup = new ContactGroupGibberishImpl(GibberishActivator.getResources().getI18NString("service.gui.NOT_IN_CONTACT_LIST_GROUP_NAME"), parentProvider);<NEW_LINE>theVolatileGroup.setResolved(false);<NEW_LINE>theVolatileGroup.setPersistent(false);<NEW_LINE>this.contactListRoot.addSubgroup(theVolatileGroup);<NEW_LINE>fireServerStoredGroupEvent(theVolatileGroup, ServerStoredGroupEvent.GROUP_CREATED_EVENT);<NEW_LINE>}<NEW_LINE>// now add the volatile contact instide it<NEW_LINE>theVolatileGroup.addContact(newVolatileContact);<NEW_LINE>fireSubscriptionEvent(newVolatileContact, theVolatileGroup, SubscriptionEvent.SUBSCRIPTION_CREATED);<NEW_LINE>return newVolatileContact;<NEW_LINE>}
|
ContactGibberishImpl(contactAddress, this.parentProvider);
|
1,252,154
|
private void startDetect() {<NEW_LINE>ArrayList<String> result_list = FileUtils.ReadListFromFile(getActivity().getAssets(), RESULT_LIST);<NEW_LINE>final Bitmap originBitmap = FileUtils.readBitmapFromFile(getActivity().getAssets(), IMAGE);<NEW_LINE>final Bitmap scaleBitmap = Bitmap.createScaledBitmap(originBitmap, NET_INPUT, NET_INPUT, false);<NEW_LINE>ImageView source = (ImageView) $(R.id.origin);<NEW_LINE>source.setImageBitmap(originBitmap);<NEW_LINE>String modelPath = initModel();<NEW_LINE>Log.d(TAG, "Init classify " + modelPath);<NEW_LINE>int device = 0;<NEW_LINE>if (mUseHuaweiNpu) {<NEW_LINE>device = 2;<NEW_LINE>} else if (mUseGPU) {<NEW_LINE>device = 1;<NEW_LINE>}<NEW_LINE>int result = mImageClassify.init(modelPath, NET_INPUT, NET_INPUT, device);<NEW_LINE>if (result == 0) {<NEW_LINE>Log.d(TAG, "detect from image");<NEW_LINE>int[] indexArray = mImageClassify.detectFromImage(scaleBitmap, NET_INPUT, NET_INPUT);<NEW_LINE>Log.d(TAG, "detect from image result " + result + " index :" + indexArray);<NEW_LINE>if (indexArray != null && indexArray.length > 0) {<NEW_LINE>Log.d(TAG<MASK><NEW_LINE>String resultText = "result: " + result_list.get(indexArray[0]) + " " + Helper.getBenchResult();<NEW_LINE>TextView result_view = (TextView) $(R.id.result);<NEW_LINE>result_view.setText(resultText);<NEW_LINE>}<NEW_LINE>mImageClassify.deinit();<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "failed to init model " + result);<NEW_LINE>}<NEW_LINE>}
|
, "detect index " + indexArray[0]);
|
1,828,640
|
public ResponseEntity<Resource> exportToExcel(@PathVariable("windowId") final String windowIdStr, @PathVariable(PARAM_ViewId) final String viewIdStr, @RequestParam(name = "selectedIds", required = false) @ApiParam("comma separated IDs") final String selectedIdsListStr) throws Exception {<NEW_LINE>userSession.assertLoggedIn();<NEW_LINE>final ViewId viewId = ViewId.ofViewIdString(viewIdStr, WindowId.fromJson(windowIdStr));<NEW_LINE>final <MASK><NEW_LINE>final File tmpFile = File.createTempFile("exportToExcel", "." + excelFormat.getFileExtension());<NEW_LINE>try (final FileOutputStream out = new FileOutputStream(tmpFile)) {<NEW_LINE>ViewExcelExporter.builder().excelFormat(excelFormat).view(viewsRepo.getView(viewId)).rowIds(DocumentIdsSelection.ofCommaSeparatedString(selectedIdsListStr)).layout(viewsRepo.getViewLayout(viewId.getWindowId(), JSONViewDataType.grid, ViewProfileId.NULL)).language(userSession.getLanguage()).zoneId(userSession.getTimeZone()).build().export(out);<NEW_LINE>}<NEW_LINE>// TODO: use a better name<NEW_LINE>final String filename = "report." + excelFormat.getFileExtension();<NEW_LINE>final String contentType = MimeType.getMimeType(filename);<NEW_LINE>final HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(MediaType.parseMediaType(contentType));<NEW_LINE>headers.set(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + filename + "\"");<NEW_LINE>headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");<NEW_LINE>return new ResponseEntity<>(new InputStreamResource(new FileInputStream(tmpFile)), headers, HttpStatus.OK);<NEW_LINE>}
|
ExcelFormat excelFormat = ExcelFormats.getDefaultFormat();
|
10,768
|
// -------------------------------------------------------------------------<NEW_LINE>@VisibleForTesting<NEW_LINE>static ImmutableMap<Currency, HolidayCalendarId> loadDefaultsFromIni(String filename) {<NEW_LINE>List<ResourceLocator> resources = ResourceConfig.orderedResources(filename);<NEW_LINE>Map<Currency, HolidayCalendarId> map = new HashMap<>();<NEW_LINE>for (ResourceLocator resource : resources) {<NEW_LINE>try {<NEW_LINE>IniFile ini = IniFile.<MASK><NEW_LINE>PropertySet section = ini.section("defaultByCurrency");<NEW_LINE>for (String currencyCode : section.keys()) {<NEW_LINE>map.put(Currency.of(currencyCode), HolidayCalendarId.of(section.value(currencyCode)));<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>log.log(Level.SEVERE, "Error processing resource as Holiday Calendar Defaults INI file: " + resource, ex);<NEW_LINE>return ImmutableMap.of();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ImmutableMap.copyOf(map);<NEW_LINE>}
|
of(resource.getCharSource());
|
67,110
|
public // stack sections<NEW_LINE>void testEquals(Object ddrObject, Object jextractObject, int members) {<NEW_LINE>ImageThread ddrImageThread = (ImageThread) ddrObject;<NEW_LINE>ImageThread jextractImageThread = (ImageThread) jextractObject;<NEW_LINE>// getID()<NEW_LINE>if ((ID & members) != 0)<NEW_LINE>testJavaEquals(ddrImageThread, jextractImageThread, "getID");<NEW_LINE>// getProperties()<NEW_LINE>if ((PROPERTIES & members) != 0)<NEW_LINE>testPropertiesEquals(ddrImageThread, jextractImageThread, "getProperties");<NEW_LINE>// getRegisters<NEW_LINE>if ((REGISTERS & members) != 0)<NEW_LINE>new ImageRegisterComparator().testComparatorIteratorEquals(ddrImageThread, <MASK><NEW_LINE>// getStackFrames();<NEW_LINE>if ((STACK_FRAMES & members) != 0)<NEW_LINE>new ImageStackFrameComparator().testComparatorIteratorEquals(ddrImageThread, jextractImageThread, "getStackFrames", ImageStackFrame.class);<NEW_LINE>// getStackSections();<NEW_LINE>if ((STACK_SECTIONS & members) != 0)<NEW_LINE>new ImageSectionComparator().testComparatorIteratorEquals(ddrImageThread, jextractImageThread, "getStackSections", ImageSection.class);<NEW_LINE>}
|
jextractImageThread, "getRegisters", ImageRegister.class);
|
325,474
|
public KmsConfig createAuthConfig(UUID customerUUID, String configName, ObjectNode config) {<NEW_LINE>ObjectNode maskedConfig = EncryptionAtRestUtil.maskConfigData(customerUUID, config, this.keyProvider);<NEW_LINE>KmsConfig result = KmsConfig.createKMSConfig(customerUUID, <MASK><NEW_LINE>UUID configUUID = result.configUUID;<NEW_LINE>ObjectNode existingConfig = getAuthConfig(configUUID);<NEW_LINE>ObjectNode updatedConfig = createAuthConfigWithService(configUUID, existingConfig);<NEW_LINE>if (updatedConfig != null) {<NEW_LINE>ObjectNode updatedMaskedConfig = EncryptionAtRestUtil.maskConfigData(customerUUID, updatedConfig, this.keyProvider);<NEW_LINE>KmsConfig.updateKMSConfig(configUUID, updatedMaskedConfig);<NEW_LINE>} else {<NEW_LINE>result.delete();<NEW_LINE>result = null;<NEW_LINE>}<NEW_LINE>// LOG.debug("DO_NOT_PRINT::createAuthConfig returning: {}", result);<NEW_LINE>return result;<NEW_LINE>}
|
this.keyProvider, maskedConfig, configName);
|
338,688
|
private void whileStatement() {<NEW_LINE>move(true);<NEW_LINE>// prepare to call __reducer_callcc(LOOP, iterator, statements)<NEW_LINE>getCodeGeneratorWithTimes().onMethodName(Constants.ReducerFn);<NEW_LINE>getCodeGeneratorWithTimes().onConstant(Constants.REDUCER_LOOP);<NEW_LINE>getCodeGeneratorWithTimes().onMethodParameter(this.lookhead);<NEW_LINE>// create a lambda function wraps while body(iterator)<NEW_LINE>boolean newLexicalScope = this.scope.newLexicalScope;<NEW_LINE>this.scope.newLexicalScope = true;<NEW_LINE>{<NEW_LINE>getCodeGeneratorWithTimes().onLambdaDefineStart(getPrevToken().withMeta(Constants.SCOPE_META, this.scope.newLexicalScope));<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyStart(this.lookhead);<NEW_LINE>ifStatement(true, false);<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyEnd(this.lookhead);<NEW_LINE>getCodeGenerator().onMethodParameter(this.lookhead);<NEW_LINE>}<NEW_LINE>if (expectChar(';')) {<NEW_LINE>// the statement is ended.<NEW_LINE>getCodeGenerator().onConstant(Constants.ReducerEmptyVal);<NEW_LINE>} else {<NEW_LINE>// create a lambda function wraps statements after while(statements)<NEW_LINE>//<NEW_LINE>getCodeGeneratorWithTimes().//<NEW_LINE>onLambdaDefineStart(getPrevToken().withMeta(Constants.SCOPE_META, this.scope.newLexicalScope).withMeta(Constants.INHERIT_ENV_META, true));<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyStart(this.lookhead);<NEW_LINE>if (statements() == StatementType.Empty) {<NEW_LINE>getCodeGenerator().onConstant(Constants.ReducerEmptyVal);<NEW_LINE>}<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyEnd(this.lookhead);<NEW_LINE>}<NEW_LINE>getCodeGeneratorWithTimes(<MASK><NEW_LINE>// call __reducer_callcc(LOOP, iterator, statements)<NEW_LINE>getCodeGeneratorWithTimes().onMethodInvoke(this.lookhead);<NEW_LINE>// restore newLexicalScope<NEW_LINE>this.scope.newLexicalScope = newLexicalScope;<NEW_LINE>}
|
).onMethodParameter(this.lookhead);
|
646,179
|
public ResponseEntity<Void> testInlineAdditionalPropertiesWithHttpInfo(Map<String, String> param) throws RestClientException {<NEW_LINE>Object localVarPostBody = param;<NEW_LINE>// verify the required parameter 'param' is set<NEW_LINE>if (param == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");<NEW_LINE>}<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders localVarHeaderParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>}
|
LinkedMultiValueMap<String, Object>();
|
29,170
|
protected void changedUpdateImpl(@Nonnull DocumentEvent e) {<NEW_LINE>// todo Denis Zhdanov<NEW_LINE>DocumentEventImpl event = (DocumentEventImpl) e;<NEW_LINE>final boolean shouldTranslateViaDiff = isValid() && PersistentRangeMarkerUtil.shouldTranslateViaDiff(event, <MASK><NEW_LINE>boolean wasTranslatedViaDiff = shouldTranslateViaDiff;<NEW_LINE>if (shouldTranslateViaDiff) {<NEW_LINE>wasTranslatedViaDiff = translatedViaDiff(e, event);<NEW_LINE>}<NEW_LINE>if (!wasTranslatedViaDiff) {<NEW_LINE>super.changedUpdateImpl(e);<NEW_LINE>if (isValid()) {<NEW_LINE>myLine = getDocument().getLineNumber(getStartOffset());<NEW_LINE>int endLine = getDocument().getLineNumber(getEndOffset());<NEW_LINE>if (endLine != myLine) {<NEW_LINE>setIntervalEnd(getDocument().getLineEndOffset(myLine));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isValid() && getTargetArea() == HighlighterTargetArea.LINES_IN_RANGE) {<NEW_LINE>setIntervalStart(DocumentUtil.getFirstNonSpaceCharOffset(getDocument(), myLine));<NEW_LINE>setIntervalEnd(getDocument().getLineEndOffset(myLine));<NEW_LINE>}<NEW_LINE>}
|
getStartOffset(), getEndOffset());
|
748,988
|
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException {<NEW_LINE>final Trade charge = getTrade(sign, 3, ess);<NEW_LINE>charge.isAffordableFor(player);<NEW_LINE>final String chapter = sign.getLine(1);<NEW_LINE>final String page = sign.getLine(2);<NEW_LINE>final IText input;<NEW_LINE>try {<NEW_LINE>player.setDisplayNick();<NEW_LINE>input = new TextInput(player.getSource(), "info", true, ess);<NEW_LINE>final IText output = new KeywordReplacer(input, <MASK><NEW_LINE>final TextPager pager = new TextPager(output);<NEW_LINE>pager.showPage(chapter, page, null, player.getSource());<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new SignException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>charge.charge(player);<NEW_LINE>Trade.log("Sign", "Info", "Interact", username, null, username, charge, sign.getBlock().getLocation(), player.getMoney(), ess);<NEW_LINE>return true;<NEW_LINE>}
|
player.getSource(), ess);
|
850,303
|
public void replaceSelection(String text) {<NEW_LINE>// It's legal for null to be used here...<NEW_LINE>if (text == null) {<NEW_LINE>handleReplaceSelection(text);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getTabsEmulated()) {<NEW_LINE>int firstTab = text.indexOf('\t');<NEW_LINE>if (firstTab > -1) {<NEW_LINE>int docOffs = getSelectionStart();<NEW_LINE>try {<NEW_LINE>text = replaceTabsWithSpaces(text, docOffs, firstTab);<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>// Never happens<NEW_LINE>ble.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If the user wants to overwrite text...<NEW_LINE>if (textMode == OVERWRITE_MODE && !"\n".equals(text)) {<NEW_LINE>Caret caret = getCaret();<NEW_LINE>int caretPos = caret.getDot();<NEW_LINE>Document doc = getDocument();<NEW_LINE><MASK><NEW_LINE>int curLine = map.getElementIndex(caretPos);<NEW_LINE>int lastLine = map.getElementCount() - 1;<NEW_LINE>try {<NEW_LINE>// If we're not at the end of a line, select the characters<NEW_LINE>// that will be overwritten (otherwise JTextArea will simply<NEW_LINE>// insert in front of them).<NEW_LINE>int curLineEnd = getLineEndOffset(curLine);<NEW_LINE>if (caretPos == caret.getMark() && caretPos != curLineEnd) {<NEW_LINE>if (curLine == lastLine) {<NEW_LINE>caretPos = Math.min(caretPos + text.length(), curLineEnd);<NEW_LINE>} else {<NEW_LINE>caretPos = Math.min(caretPos + text.length(), curLineEnd - 1);<NEW_LINE>}<NEW_LINE>// moveCaretPosition(caretPos);<NEW_LINE>caret.moveDot(caretPos);<NEW_LINE>}<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>// Never happens<NEW_LINE>UIManager.getLookAndFeel().provideErrorFeedback(this);<NEW_LINE>ble.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// End of if (textMode==OVERWRITE_MODE).<NEW_LINE>// Now, actually do the inserting/replacing. Our undoManager will<NEW_LINE>// take care of remembering the remove/insert as atomic if we are in<NEW_LINE>// overwrite mode.<NEW_LINE>handleReplaceSelection(text);<NEW_LINE>}
|
Element map = doc.getDefaultRootElement();
|
1,355,938
|
private void init() {<NEW_LINE>setLayout(new BorderLayout(0, 5));<NEW_LINE>setBorder(makeBorder());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>clearEachIteration = new JCheckBox(JMeterUtils<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>controlledByThreadGroup = new JCheckBox(JMeterUtils.getResString("cache_clear_controlled_by_threadgroup"), false);<NEW_LINE>controlledByThreadGroup.setActionCommand(CONTROLLED_BY_THREADGROUP);<NEW_LINE>controlledByThreadGroup.addActionListener(this);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>useExpires = new JCheckBox(JMeterUtils.getResString("use_expires"), false);<NEW_LINE>JPanel northPanel = new JPanel();<NEW_LINE>northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));<NEW_LINE>northPanel.add(makeTitlePanel());<NEW_LINE>northPanel.add(clearEachIteration);<NEW_LINE>northPanel.add(controlledByThreadGroup);<NEW_LINE>northPanel.add(useExpires);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JLabel label = new JLabel(JMeterUtils.getResString("cache_manager_size"));<NEW_LINE>maxCacheSize = new JTextField(20);<NEW_LINE>maxCacheSize.setName(CacheManager.MAX_SIZE);<NEW_LINE>label.setLabelFor(maxCacheSize);<NEW_LINE>JPanel maxCacheSizePanel = new JPanel(new BorderLayout(5, 0));<NEW_LINE>maxCacheSizePanel.add(label, BorderLayout.WEST);<NEW_LINE>maxCacheSizePanel.add(maxCacheSize, BorderLayout.CENTER);<NEW_LINE>northPanel.add(maxCacheSizePanel);<NEW_LINE>add(northPanel, BorderLayout.NORTH);<NEW_LINE>}
|
.getResString("clear_cache_per_iter"), false);
|
1,834,666
|
private Node put(Node node, int key, Value value) {<NEW_LINE>if (node == null) {<NEW_LINE>return new Node(key, value, 1, RED);<NEW_LINE>}<NEW_LINE>if (key < node.key) {<NEW_LINE>node.left = put(node.left, key, value);<NEW_LINE>} else if (key > node.key) {<NEW_LINE>node.right = put(<MASK><NEW_LINE>} else {<NEW_LINE>node.value = value;<NEW_LINE>}<NEW_LINE>if (isRed(node.right) && !isRed(node.left)) {<NEW_LINE>node = rotateLeft(node);<NEW_LINE>}<NEW_LINE>if (isRed(node.left) && isRed(node.left.left)) {<NEW_LINE>node = rotateRight(node);<NEW_LINE>}<NEW_LINE>if (isRed(node.left) && isRed(node.right)) {<NEW_LINE>flipColors(node);<NEW_LINE>}<NEW_LINE>node.size = size(node.left) + 1 + size(node.right);<NEW_LINE>return node;<NEW_LINE>}
|
node.right, key, value);
|
39,019
|
public void shutDown() {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Keyword search ingest module instance {0} shutting down", instanceNum);<NEW_LINE>if ((initialized == false) || (context == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (context.fileIngestIsCancelled()) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Keyword search ingest module instance {0} stopping search job due to ingest cancellation", instanceNum);<NEW_LINE>IngestSearchRunner.getInstance().stopJob(jobId);<NEW_LINE>cleanup();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Remove from the search list and trigger final commit and final search<NEW_LINE>IngestSearchRunner.<MASK><NEW_LINE>// We only need to post the summary msg from the last module per job<NEW_LINE>if (refCounter.decrementAndGet(jobId) == 0) {<NEW_LINE>try {<NEW_LINE>final int numIndexedFiles = KeywordSearch.getServer().queryNumIndexedFiles();<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Indexed files count: {0}", numIndexedFiles);<NEW_LINE>final int numIndexedChunks = KeywordSearch.getServer().queryNumIndexedChunks();<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Indexed file chunks count: {0}", numIndexedChunks);<NEW_LINE>} catch (NoOpenCoreException | KeywordSearchModuleException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Error executing Solr queries to check number of indexed files and file chunks", ex);<NEW_LINE>}<NEW_LINE>postIndexSummary();<NEW_LINE>synchronized (ingestStatus) {<NEW_LINE>ingestStatus.remove(jobId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cleanup();<NEW_LINE>}
|
getInstance().endJob(jobId);
|
1,094,705
|
private static void decodeAnsiX12Segment(BitSource bits, ECIStringBuilder result) throws FormatException {<NEW_LINE>// Three ANSI X12 values are encoded in a 16-bit value as<NEW_LINE>// (1600 * C1) + (40 * C2) + C3 + 1<NEW_LINE>int[<MASK><NEW_LINE>do {<NEW_LINE>// If there is only one byte left then it will be encoded as ASCII<NEW_LINE>if (bits.available() == 8) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int firstByte = bits.readBits(8);<NEW_LINE>if (firstByte == 254) {<NEW_LINE>// Unlatch codeword<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>parseTwoBytes(firstByte, bits.readBits(8), cValues);<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>int cValue = cValues[i];<NEW_LINE>switch(cValue) {<NEW_LINE>case // X12 segment terminator <CR><NEW_LINE>0:<NEW_LINE>result.append('\r');<NEW_LINE>break;<NEW_LINE>case // X12 segment separator *<NEW_LINE>1:<NEW_LINE>result.append('*');<NEW_LINE>break;<NEW_LINE>case // X12 sub-element separator ><NEW_LINE>2:<NEW_LINE>result.append('>');<NEW_LINE>break;<NEW_LINE>case // space<NEW_LINE>3:<NEW_LINE>result.append(' ');<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (cValue < 14) {<NEW_LINE>// 0 - 9<NEW_LINE>result.append((char) (cValue + 44));<NEW_LINE>} else if (cValue < 40) {<NEW_LINE>// A - Z<NEW_LINE>result.append((char) (cValue + 51));<NEW_LINE>} else {<NEW_LINE>throw FormatException.getFormatInstance();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (bits.available() > 0);<NEW_LINE>}
|
] cValues = new int[3];
|
867,881
|
public void dumpReplayData(PrintStream out) {<NEW_LINE>out.println("JvmtiExport can_access_local_variables " + (JvmtiExport.canAccessLocalVariables() ? '1' : '0'));<NEW_LINE>out.println("JvmtiExport can_hotswap_or_post_breakpoint " + (JvmtiExport.canHotswapOrPostBreakpoint() ? '1' : '0'));<NEW_LINE>out.println("JvmtiExport can_post_on_exceptions " + (JvmtiExport.canPostOnExceptions() ? '1' : '0'));<NEW_LINE>GrowableArray<ciMetadata> objects = factory().objects();<NEW_LINE>out.println("# " + objects.length() + " ciObject found");<NEW_LINE>for (int i = 0; i < objects.length(); i++) {<NEW_LINE>ciMetadata o = objects.at(i);<NEW_LINE>out.println(<MASK><NEW_LINE>o.dumpReplayData(out);<NEW_LINE>}<NEW_LINE>CompileTask task = task();<NEW_LINE>Method method = task.method();<NEW_LINE>int entryBci = task.osrBci();<NEW_LINE>int compLevel = task.compLevel();<NEW_LINE>Klass holder = method.getMethodHolder();<NEW_LINE>out.print("compile " + holder.getName().asString() + " " + OopUtilities.escapeString(method.getName().asString()) + " " + method.getSignature().asString() + " " + entryBci + " " + compLevel);<NEW_LINE>Compile compiler = compilerData();<NEW_LINE>if (compiler != null) {<NEW_LINE>// Dump inlining data.<NEW_LINE>compiler.dumpInlineData(out);<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}
|
"# ciMetadata" + i + " @ " + o);
|
617,681
|
final CreateStudioResult executeCreateStudio(CreateStudioRequest createStudioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStudioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStudioRequest> request = null;<NEW_LINE>Response<CreateStudioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStudioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createStudioRequest));<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, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStudio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateStudioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateStudioResultJsonUnmarshaller());<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());
|
236,802
|
public SearchCostResult isCheapEnoughToSearch(@Nonnull String name, @Nonnull final GlobalSearchScope scope, @Nullable final PsiFile fileToIgnoreOccurrencesIn, @Nullable final ProgressIndicator progress) {<NEW_LINE>final AtomicInteger count = new AtomicInteger();<NEW_LINE>final ProgressIndicator indicator = progress == null ? new EmptyProgressIndicator() : progress;<NEW_LINE>final Processor<VirtualFile> processor = new Processor<VirtualFile>() {<NEW_LINE><NEW_LINE>private final VirtualFile virtualFileToIgnoreOccurrencesIn = fileToIgnoreOccurrencesIn == null ? null : fileToIgnoreOccurrencesIn.getVirtualFile();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean process(VirtualFile file) {<NEW_LINE>indicator.checkCanceled();<NEW_LINE>if (Comparing.equal(file, virtualFileToIgnoreOccurrencesIn))<NEW_LINE>return true;<NEW_LINE>final <MASK><NEW_LINE>return value < 10;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<IdIndexEntry> keys = getWordEntries(name, true);<NEW_LINE>boolean cheap = keys.isEmpty() || processFilesContainingAllKeys(myManager.getProject(), scope, null, keys, processor);<NEW_LINE>if (!cheap) {<NEW_LINE>return SearchCostResult.TOO_MANY_OCCURRENCES;<NEW_LINE>}<NEW_LINE>return count.get() == 0 ? SearchCostResult.ZERO_OCCURRENCES : SearchCostResult.FEW_OCCURRENCES;<NEW_LINE>}
|
int value = count.incrementAndGet();
|
987,924
|
private void fixupPinnedSymbolsAfterRebase(Address oldBase, Address base, Address minAddr, Address maxAddr) {<NEW_LINE>List<SymbolDB> fixupPinnedSymbols = findPinnedSymbols(minAddr, maxAddr);<NEW_LINE>Set<Address> primaryFixups = new HashSet<>();<NEW_LINE>for (SymbolDB symbol : fixupPinnedSymbols) {<NEW_LINE>Address currentAddress = symbol.getAddress();<NEW_LINE>Address beforeBaseChangeAddress = oldBase.add<MASK><NEW_LINE>primaryFixups.add(currentAddress);<NEW_LINE>primaryFixups.add(beforeBaseChangeAddress);<NEW_LINE>// see if there is a name collision for the pinned symbol we are about to move back<NEW_LINE>Symbol match = getSymbol(symbol.getName(), beforeBaseChangeAddress, symbol.getParentNamespace());<NEW_LINE>if (symbol.getSymbolType() == SymbolType.FUNCTION) {<NEW_LINE>fixupPinnedFunctionSymbolAfterRebase(symbol, beforeBaseChangeAddress, match);<NEW_LINE>} else {<NEW_LINE>fixupPinnedLabelSymbolAfterRebase(symbol, beforeBaseChangeAddress, match);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fixupPrimarySymbols(primaryFixups);<NEW_LINE>}
|
(currentAddress.subtract(base));
|
1,333,696
|
private void checkBelongsToTheTree(@Nonnull T interval, boolean assertInvalid) {<NEW_LINE>IntervalNode<T> root = lookupNode(interval);<NEW_LINE>if (root == null)<NEW_LINE>return;<NEW_LINE>// noinspection NumberEquality<NEW_LINE>assert root.getTree() == this : root.getTree() + "; this: " + this;<NEW_LINE>if (!VERIFY)<NEW_LINE>return;<NEW_LINE>if (assertInvalid) {<NEW_LINE>assert !root.intervals.isEmpty();<NEW_LINE>boolean contains = false;<NEW_LINE>for (int i = root.intervals.size() - 1; i >= 0; i--) {<NEW_LINE>T key = root.intervals.<MASK><NEW_LINE>if (key == null)<NEW_LINE>continue;<NEW_LINE>contains |= key == interval;<NEW_LINE>IntervalNode<T> node = lookupNode(key);<NEW_LINE>assert node == root : node;<NEW_LINE>// noinspection NumberEquality<NEW_LINE>assert node.getTree() == this : node;<NEW_LINE>}<NEW_LINE>assert contains : root.intervals + "; " + interval;<NEW_LINE>}<NEW_LINE>IntervalNode<T> e = root;<NEW_LINE>while (e.getParent() != null) e = e.getParent();<NEW_LINE>// assert the node belongs to our tree<NEW_LINE>assert e == getRoot();<NEW_LINE>}
|
get(i).get();
|
1,484,676
|
public static PubsubSubscription fromPath(String path) {<NEW_LINE>if (path.startsWith(SUBSCRIPTION_RANDOM_TEST_PREFIX) || path.startsWith(SUBSCRIPTION_STARTING_SIGNAL)) {<NEW_LINE>return new PubsubSubscription(PubsubSubscription.Type.FAKE, "", path);<NEW_LINE>}<NEW_LINE>String projectName, subscriptionName;<NEW_LINE>Matcher v1beta1Match = V1BETA1_SUBSCRIPTION_REGEXP.matcher(path);<NEW_LINE>if (v1beta1Match.matches()) {<NEW_LINE>LOG.warn("Saw subscription in v1beta1 format. Subscriptions should be in the format " + "projects/<project_id>/subscriptions/<subscription_name>");<NEW_LINE><MASK><NEW_LINE>subscriptionName = v1beta1Match.group(2);<NEW_LINE>} else {<NEW_LINE>Matcher match = SUBSCRIPTION_REGEXP.matcher(path);<NEW_LINE>if (!match.matches()) {<NEW_LINE>throw new IllegalArgumentException("Pubsub subscription is not in " + "projects/<project_id>/subscriptions/<subscription_name> format: " + path);<NEW_LINE>}<NEW_LINE>projectName = match.group(1);<NEW_LINE>subscriptionName = match.group(2);<NEW_LINE>}<NEW_LINE>validateProjectName(projectName);<NEW_LINE>validatePubsubName(subscriptionName);<NEW_LINE>return new PubsubSubscription(PubsubSubscription.Type.NORMAL, projectName, subscriptionName);<NEW_LINE>}
|
projectName = v1beta1Match.group(1);
|
470,306
|
public ASTNode visitCloneAction(final CloneActionContext ctx) {<NEW_LINE>CloneActionSegment result = new CloneActionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());<NEW_LINE>if (null != ctx.cloneInstance()) {<NEW_LINE><MASK><NEW_LINE>CloneInstanceSegment cloneInstanceSegment = new CloneInstanceSegment(cloneInstance.start.getStartIndex(), cloneInstance.stop.getStopIndex());<NEW_LINE>cloneInstanceSegment.setUsername(((StringLiteralValue) visitUsername(cloneInstance.username())).getValue());<NEW_LINE>cloneInstanceSegment.setHostname(((StringLiteralValue) visit(cloneInstance.hostname())).getValue());<NEW_LINE>cloneInstanceSegment.setPort(new NumberLiteralValue(cloneInstance.port().NUMBER_().getText()).getValue().intValue());<NEW_LINE>cloneInstanceSegment.setPassword(((StringLiteralValue) visit(ctx.string_())).getValue());<NEW_LINE>if (null != ctx.SSL() && null == ctx.NO()) {<NEW_LINE>cloneInstanceSegment.setSslRequired(true);<NEW_LINE>}<NEW_LINE>result.setCloneInstance(cloneInstanceSegment);<NEW_LINE>}<NEW_LINE>if (null != ctx.cloneDir()) {<NEW_LINE>result.setCloneDir(((StringLiteralValue) visit(ctx.cloneDir())).getValue());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
CloneInstanceContext cloneInstance = ctx.cloneInstance();
|
1,244,437
|
public com.amazonaws.services.codedeploy.model.ApplicationAlreadyExistsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.ApplicationAlreadyExistsException applicationAlreadyExistsException = new com.amazonaws.services.codedeploy.model.ApplicationAlreadyExistsException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return applicationAlreadyExistsException;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
29,983
|
// Step4: aggregation functions are available in the view output<NEW_LINE>private void checkAggregationFunction(OlapTable table, Set<FunctionCallExpr> aggregatedColumnsInQueryOutput, Map<Long, MaterializedIndexMeta> candidateIndexIdToMeta) throws AnalysisException {<NEW_LINE>Iterator<Map.Entry<Long, MaterializedIndexMeta>> iterator = candidateIndexIdToMeta.entrySet().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Map.Entry<Long, MaterializedIndexMeta<MASK><NEW_LINE>MaterializedIndexMeta candidateIndexMeta = entry.getValue();<NEW_LINE>List<FunctionCallExpr> indexAggColumnExpsList = mvAggColumnsToExprList(candidateIndexMeta);<NEW_LINE>// When the candidate index is SPJ type, it passes the verification directly<NEW_LINE>boolean noNeedAggregation = candidateIndexMeta.getKeysType() == KeysType.DUP_KEYS || (candidateIndexMeta.getKeysType() == KeysType.UNIQUE_KEYS && table.getTableProperty().getEnableUniqueKeyMergeOnWrite());<NEW_LINE>if (indexAggColumnExpsList.size() == 0 && noNeedAggregation) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// When the query is SPJ type but the candidate index is SPJG type, it will not pass directly.<NEW_LINE>if (isSPJQuery || disableSPJGView) {<NEW_LINE>iterator.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// The query is SPJG. The candidate index is SPJG too.<NEW_LINE>if (aggregatedColumnsInQueryOutput == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// The aggregated columns in query output must be subset of the aggregated columns in view<NEW_LINE>if (!aggFunctionsMatchAggColumns(aggregatedColumnsInQueryOutput, indexAggColumnExpsList)) {<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug("Those mv pass the test of aggregation function:" + Joiner.on(",").join(candidateIndexIdToMeta.keySet()));<NEW_LINE>}
|
> entry = iterator.next();
|
551,710
|
public com.amazonaws.services.codedeploy.model.DeploymentDoesNotExistException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.DeploymentDoesNotExistException deploymentDoesNotExistException = new com.amazonaws.services.codedeploy.model.DeploymentDoesNotExistException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deploymentDoesNotExistException;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
354,064
|
private static byte[] decryptCbcDesEde3(SSL2ServerVerifyMessage message, TlsContext context) {<NEW_LINE>byte[] clientReadKey = new byte[24];<NEW_LINE>byte[] keyMaterial0 = makeKeyMaterial(context, "0");<NEW_LINE>System.arraycopy(keyMaterial0, 0, clientReadKey, 0, keyMaterial0.length);<NEW_LINE>byte[] keyMaterial1 = makeKeyMaterial(context, "1");<NEW_LINE>System.arraycopy(keyMaterial1, 0, <MASK><NEW_LINE>byte[] iv = context.getSSL2Iv();<NEW_LINE>CBCBlockCipher cbcDesEde = new CBCBlockCipher(new DESedeEngine());<NEW_LINE>ParametersWithIV params = new ParametersWithIV(new KeyParameter(clientReadKey), iv);<NEW_LINE>cbcDesEde.init(false, params);<NEW_LINE>return processEncryptedBlocks(cbcDesEde, message.getEncryptedPart().getValue(), message.getPaddingLength().getValue());<NEW_LINE>}
|
clientReadKey, keyMaterial0.length, 8);
|
977,524
|
// Looking for a model worker<NEW_LINE>public Pair<Set<Long>, Integer> findModelWorkerStores(final int above) {<NEW_LINE>final Set<Map.Entry<Long, Set<Long>>> values = this.leaderTable.entrySet();<NEW_LINE>if (values.isEmpty()) {<NEW_LINE>return Pair.of(Collections.emptySet(), 0);<NEW_LINE>}<NEW_LINE>final Map.Entry<Long, Set<Long>> modelWorker = Collections.max(values, (o1, o2) -> {<NEW_LINE>final int o1Val = o1.getValue() == null ? 0 : o1.getValue().size();<NEW_LINE>final int o2Val = o2.getValue() == null ? 0 : o2.getValue().size();<NEW_LINE>return Integer.compare(o1Val, o2Val);<NEW_LINE>});<NEW_LINE>final int maxLeaderCount = modelWorker<MASK><NEW_LINE>if (maxLeaderCount <= above) {<NEW_LINE>return Pair.of(Collections.emptySet(), maxLeaderCount);<NEW_LINE>}<NEW_LINE>final Set<Long> modelWorkerStoreIds = new HashSet<>();<NEW_LINE>for (final Map.Entry<Long, Set<Long>> entry : values) {<NEW_LINE>if (entry.getValue().size() >= maxLeaderCount) {<NEW_LINE>modelWorkerStoreIds.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Pair.of(modelWorkerStoreIds, maxLeaderCount);<NEW_LINE>}
|
.getValue().size();
|
537,946
|
public Match findBestList(List<Object> pList) {<NEW_LINE>Debug.log(lvl, "findBest: enter");<NEW_LINE>if (pList == null || pList.size() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Match mResult = null;<NEW_LINE>List<Match> mList = findAnyCollect(pList);<NEW_LINE>if (mList.size() > 0) {<NEW_LINE>Collections.sort(mList, new Comparator<Match>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Match m1, Match m2) {<NEW_LINE>double ms = m2.getScore<MASK><NEW_LINE>if (ms < 0) {<NEW_LINE>return -1;<NEW_LINE>} else if (ms > 0) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mResult = mList.get(0);<NEW_LINE>}<NEW_LINE>return mResult;<NEW_LINE>}
|
() - m1.getScore();
|
591,090
|
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.request.MonitorWaitedRequest createMonitorWaitedRequest(com.sun.jdi.request.EventRequestManager a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.request.EventRequestManager", "createMonitorWaitedRequest", "JDI CALL: com.sun.jdi.request.EventRequestManager({0}).createMonitorWaitedRequest()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.<MASK><NEW_LINE>ret = a.createMonitorWaitedRequest();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.request.EventRequestManager", "createMonitorWaitedRequest", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
sun.jdi.request.MonitorWaitedRequest ret;
|
931,625
|
private void changeLetter(final WebuiLetter letter, final WebuiLetter.WebuiLetterBuilder newLetterBuilder, final JSONDocumentChangedEvent event) {<NEW_LINE>if (!event.isReplace()) {<NEW_LINE>throw new AdempiereException("Unsupported event").setParameter("event", event);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (PATCH_FIELD_Message.equals(fieldName)) {<NEW_LINE>final String message = event.getValueAsString(null);<NEW_LINE>newLetterBuilder.content(message);<NEW_LINE>} else if (PATCH_FIELD_TemplateId.equals(fieldName)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final LookupValue templateId = JSONLookupValue.integerLookupValueFromJsonMap((Map<String, Object>) event.getValue());<NEW_LINE>applyTemplate(letter, newLetterBuilder, templateId);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Unsupported event path").setParameter("event", event).setParameter("fieldName", fieldName).setParameter("availablePaths", PATCH_FIELD_ALL);<NEW_LINE>}<NEW_LINE>}
|
String fieldName = event.getPath();
|
599,088
|
public Mono<Response<Void>> deleteBackupConfigurationWithResponseAsync(String resourceGroupName, String name) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name 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>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.deleteBackupConfiguration(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
|
976,538
|
private Object jpql(Statement statement, Runtime runtime) throws Exception {<NEW_LINE>Object data = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE><MASK><NEW_LINE>Class<? extends JpaObject> cls = this.clazz(business, statement);<NEW_LINE>EntityManager em;<NEW_LINE>if (StringUtils.equalsIgnoreCase(statement.getEntityCategory(), Statement.ENTITYCATEGORY_DYNAMIC) && StringUtils.equalsIgnoreCase(statement.getType(), Statement.TYPE_SELECT)) {<NEW_LINE>em = business.entityManagerContainer().get(DynamicBaseEntity.class);<NEW_LINE>} else {<NEW_LINE>em = business.entityManagerContainer().get(cls);<NEW_LINE>}<NEW_LINE>Query query = em.createQuery(statement.getData());<NEW_LINE>for (Parameter<?> p : query.getParameters()) {<NEW_LINE>if (runtime.hasParameter(p.getName())) {<NEW_LINE>query.setParameter(p.getName(), runtime.getParameter(p.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.equalsIgnoreCase(statement.getType(), Statement.TYPE_SELECT)) {<NEW_LINE>if (isPageSql(statement.getData())) {<NEW_LINE>query.setFirstResult((runtime.page - 1) * runtime.size);<NEW_LINE>query.setMaxResults(runtime.size);<NEW_LINE>}<NEW_LINE>data = query.getResultList();<NEW_LINE>} else {<NEW_LINE>business.entityManagerContainer().beginTransaction(cls);<NEW_LINE>data = query.executeUpdate();<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
|
Business business = new Business(emc);
|
531,816
|
public DescribeRootFoldersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeRootFoldersResult describeRootFoldersResult = new DescribeRootFoldersResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeRootFoldersResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Folders", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeRootFoldersResult.setFolders(new ListUnmarshaller<FolderMetadata>(FolderMetadataJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeRootFoldersResult.setMarker(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeRootFoldersResult;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
112,357
|
public static void syncCheckSums(Map<String, String> checksumMap, String server) {<NEW_LINE>try {<NEW_LINE>Map<String, String> headers = new HashMap<>(128);<NEW_LINE>headers.put("Client-Version", UtilsAndCommons.SERVER_VERSION);<NEW_LINE>headers.<MASK><NEW_LINE>headers.put("Connection", "Keep-Alive");<NEW_LINE>HttpClient.asyncHttpPutLarge("http://" + server + RunningConfig.getContextPath() + UtilsAndCommons.NACOS_NAMING_CONTEXT + TIMESTAMP_SYNC_URL + "?source=" + NetUtils.localServer(), headers, JSON.toJSONBytes(checksumMap), new AsyncCompletionHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object onCompleted(Response response) throws Exception {<NEW_LINE>if (HttpURLConnection.HTTP_OK != response.getStatusCode()) {<NEW_LINE>Loggers.DISTRO.error("failed to req API: {}, code: {}, msg: {}", "http://" + server + RunningConfig.getContextPath() + UtilsAndCommons.NACOS_NAMING_CONTEXT + TIMESTAMP_SYNC_URL, response.getStatusCode(), response.getResponseBody());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onThrowable(Throwable t) {<NEW_LINE>Loggers.DISTRO.error("failed to req API:" + "http://" + server + RunningConfig.getContextPath() + UtilsAndCommons.NACOS_NAMING_CONTEXT + TIMESTAMP_SYNC_URL, t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>Loggers.DISTRO.warn("NamingProxy", e);<NEW_LINE>}<NEW_LINE>}
|
put("User-Agent", UtilsAndCommons.SERVER_VERSION);
|
1,305,165
|
public ReplicaRegionType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ReplicaRegionType replicaRegionType = new ReplicaRegionType();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Region", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replicaRegionType.setRegion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("KmsKeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replicaRegionType.setKmsKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return replicaRegionType;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
286,231
|
private <T> T[] readObjectArrayField(@Nonnull String fieldName, FieldType fieldType, Function<Integer, T[]> constructor, Reader<ObjectDataInput, T> reader) {<NEW_LINE>int currentPos = in.position();<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>if (isNullOrEmpty(position)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>in.position(position);<NEW_LINE>int len = in.readInt();<NEW_LINE>if (len == Bits.NULL_ARRAY_LENGTH) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>T[] values = constructor.apply(len);<NEW_LINE>if (len > 0) {<NEW_LINE>int offset = in.position();<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>int pos = in.readInt(offset + i * Bits.INT_SIZE_IN_BYTES);<NEW_LINE>in.position(pos);<NEW_LINE>values[i] = reader.read(in);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw newIllegalStateException(e);<NEW_LINE>} finally {<NEW_LINE>in.position(currentPos);<NEW_LINE>}<NEW_LINE>}
|
position = readPosition(fieldName, fieldType);
|
658,057
|
public AbstractIntegrationMessageBuilder<T> popSequenceDetails() {<NEW_LINE>List<List<Object>> incomingSequenceDetails = getSequenceDetails();<NEW_LINE>if (incomingSequenceDetails == null) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>incomingSequenceDetails = new ArrayList<>(incomingSequenceDetails);<NEW_LINE>}<NEW_LINE>List<Object> sequenceDetails = incomingSequenceDetails.remove(incomingSequenceDetails.size() - 1);<NEW_LINE>// NOSONAR<NEW_LINE>// NOSONAR<NEW_LINE>Assert.// NOSONAR<NEW_LINE>state(sequenceDetails.size() == 3, () -> "Wrong sequence details (not created by MessageBuilder?): " + sequenceDetails);<NEW_LINE>setCorrelationId<MASK><NEW_LINE>Integer sequenceNumber = (Integer) sequenceDetails.get(1);<NEW_LINE>Integer sequenceSize = (Integer) sequenceDetails.get(2);<NEW_LINE>if (sequenceNumber != null) {<NEW_LINE>setSequenceNumber(sequenceNumber);<NEW_LINE>}<NEW_LINE>if (sequenceSize != null) {<NEW_LINE>setSequenceSize(sequenceSize);<NEW_LINE>}<NEW_LINE>if (!incomingSequenceDetails.isEmpty()) {<NEW_LINE>setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails);<NEW_LINE>} else {<NEW_LINE>removeHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
|
(sequenceDetails.get(0));
|
535,752
|
public ListAssociationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAssociationsResult listAssociationsResult = new ListAssociationsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAssociationsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AssociationSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssociationsResult.setAssociationSummaries(new ListUnmarshaller<AssociationSummary>(AssociationSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAssociationsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listAssociationsResult;<NEW_LINE>}
|
JsonToken token = context.getCurrentToken();
|
1,392,453
|
public void writeConfig() throws ExecutionException, TimeoutException, InterruptedException {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>FutureCallback<None> <MASK><NEW_LINE>_store.start(callback);<NEW_LINE>callback.get(_timeout, _timeoutUnit);<NEW_LINE>final Semaphore outstandingPutSemaphore = new Semaphore(_maxOutstandingWrites);<NEW_LINE>for (final String key : _source.keySet()) {<NEW_LINE>Map<String, Object> map = merge(_source.get(key), _defaultMap);<NEW_LINE>T properties = _builder.fromMap(map);<NEW_LINE>Callback<None> putCallback = new Callback<None>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(None none) {<NEW_LINE>outstandingPutSemaphore.release();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>_log.error("Put failed for {}", key, e);<NEW_LINE>outstandingPutSemaphore.release();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (!outstandingPutSemaphore.tryAcquire(_timeout, _timeoutUnit)) {<NEW_LINE>_log.error("Put timed out for {}", key);<NEW_LINE>throw new TimeoutException();<NEW_LINE>}<NEW_LINE>_store.put(key, properties, putCallback);<NEW_LINE>}<NEW_LINE>// Wait until all puts are finished.<NEW_LINE>if (!outstandingPutSemaphore.tryAcquire(_maxOutstandingWrites, _timeout, _timeoutUnit)) {<NEW_LINE>_log.error("Put timed out with {} outstanding writes", _maxOutstandingWrites - outstandingPutSemaphore.availablePermits());<NEW_LINE>throw new TimeoutException();<NEW_LINE>}<NEW_LINE>FutureCallback<None> shutdownCallback = new FutureCallback<>();<NEW_LINE>_store.shutdown(shutdownCallback);<NEW_LINE>shutdownCallback.get(_timeout, _timeoutUnit);<NEW_LINE>long elapsedTime = System.currentTimeMillis() - startTime;<NEW_LINE>_log.info("A total of {}.{}s elapsed to write configs to store.", elapsedTime / 1000, elapsedTime % 1000);<NEW_LINE>}
|
callback = new FutureCallback<>();
|
897,716
|
public String amt(final Properties ctx, final int WindowNo, final GridTab mTab, final GridField mField, final Object value) {<NEW_LINE>if (isCalloutActive() || value == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// temporary<NEW_LINE>final int StdPrecision = 2;<NEW_LINE>// get values<NEW_LINE>BigDecimal QtyEntered = (BigDecimal) mTab.getValue("QtyEntered");<NEW_LINE>BigDecimal PriceEntered = (BigDecimal) mTab.getValue("PriceEntered");<NEW_LINE>log.debug("QtyEntered=" + QtyEntered + ", PriceEntered=" + PriceEntered);<NEW_LINE>if (QtyEntered == null) {<NEW_LINE>QtyEntered = Env.ZERO;<NEW_LINE>}<NEW_LINE>if (PriceEntered == null) {<NEW_LINE>PriceEntered = Env.ZERO;<NEW_LINE>}<NEW_LINE>// Line Net Amt<NEW_LINE>BigDecimal LineNetAmt = QtyEntered.multiply(PriceEntered);<NEW_LINE>if (LineNetAmt.scale() > StdPrecision) {<NEW_LINE>LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP);<NEW_LINE>}<NEW_LINE>// Calculate Tax Amount<NEW_LINE>final boolean IsSOTrx = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx"));<NEW_LINE>final boolean IsTaxIncluded = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsTaxIncluded"));<NEW_LINE>BigDecimal TaxAmt = null;<NEW_LINE>if (mField.getColumnName().equals("TaxAmt")) {<NEW_LINE>TaxAmt = (BigDecimal) mTab.getValue("TaxAmt");<NEW_LINE>} else {<NEW_LINE>final Integer taxID = (Integer) mTab.getValue("C_Tax_ID");<NEW_LINE>if (taxID != null) {<NEW_LINE>final int C_Tax_ID = taxID.intValue();<NEW_LINE>final MTax tax = new MTax(ctx, C_Tax_ID, null);<NEW_LINE>TaxAmt = tax.<MASK><NEW_LINE>mTab.setValue("TaxAmt", TaxAmt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (IsTaxIncluded) {<NEW_LINE>mTab.setValue("LineTotalAmt", LineNetAmt);<NEW_LINE>mTab.setValue("LineNetAmt", LineNetAmt.subtract(TaxAmt));<NEW_LINE>} else {<NEW_LINE>mTab.setValue("LineNetAmt", LineNetAmt);<NEW_LINE>mTab.setValue("LineTotalAmt", LineNetAmt.add(TaxAmt));<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
|
calculateTax(LineNetAmt, IsTaxIncluded, StdPrecision);
|
1,394,822
|
private void execFilterMethod(RpcConnection rpcConnection, Request<JsonObject> request) {<NEW_LINE>Participant participant;<NEW_LINE>try {<NEW_LINE>participant = sanityCheckOfSession(rpcConnection, "execFilterMethod");<NEW_LINE>} catch (OpenViduException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String streamId = <MASK><NEW_LINE>String filterMethod = getStringParam(request, ProtocolElements.FILTER_METHOD_PARAM);<NEW_LINE>JsonObject filterParams = JsonParser.parseString(getStringParam(request, ProtocolElements.FILTER_PARAMS_PARAM)).getAsJsonObject();<NEW_LINE>boolean isModerator = this.sessionManager.isModeratorInSession(rpcConnection.getSessionId(), participant);<NEW_LINE>// Allow executing filter method if the user is a MODERATOR (owning the stream<NEW_LINE>// or other user's stream) or if the user is the owner of the stream<NEW_LINE>if (isModerator || this.userIsStreamOwner(rpcConnection.getSessionId(), participant, streamId)) {<NEW_LINE>Participant moderator = isModerator ? participant : null;<NEW_LINE>sessionManager.execFilterMethod(sessionManager.getSession(rpcConnection.getSessionId()), streamId, filterMethod, filterParams, moderator, request.getId(), "execFilterMethod");<NEW_LINE>} else {<NEW_LINE>log.error("Error: participant {} is not a moderator", participant.getParticipantPublicId());<NEW_LINE>throw new OpenViduException(Code.USER_UNAUTHORIZED_ERROR_CODE, "Unable to execute filter method. The user does not have a valid token");<NEW_LINE>}<NEW_LINE>}
|
getStringParam(request, ProtocolElements.FILTER_STREAMID_PARAM);
|
1,365,086
|
public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitIntegerTestMove: " + left + " " + "&" + right + " ? " + trueValue + " : " + falseValue);<NEW_LINE>assert left.getPlatformKind() == right.getPlatformKind() && ((OCLKind) left.getPlatformKind()).isInteger();<NEW_LINE>assert trueValue.getPlatformKind() == falseValue.getPlatformKind();<NEW_LINE>final OCLBinary.Expr condExpr = new OCLBinary.Expr(OCLBinaryOp.BITWISE_AND, null, left, right);<NEW_LINE>final OCLTernary.Select selectExpr = new OCLTernary.Select(LIRKind.combine(trueValue, falseValue), condExpr, falseValue, trueValue);<NEW_LINE>final Variable variable = newVariable(LIRKind<MASK><NEW_LINE>final AssignStmt assignStmt = new AssignStmt(variable, selectExpr);<NEW_LINE>append(assignStmt);<NEW_LINE>return variable;<NEW_LINE>}
|
.combine(trueValue, falseValue));
|
22,551
|
private SecurityContext readSecurityContextFromSession(HttpSession httpSession) {<NEW_LINE>if (httpSession == null) {<NEW_LINE>this.logger.trace("No HttpSession currently exists");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Session exists, so try to obtain a context from it.<NEW_LINE>Object contextFromSession = <MASK><NEW_LINE>if (contextFromSession == null) {<NEW_LINE>if (this.logger.isTraceEnabled()) {<NEW_LINE>this.logger.trace(LogMessage.format("Did not find SecurityContext in HttpSession %s " + "using the SPRING_SECURITY_CONTEXT session attribute", httpSession.getId()));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// We now have the security context object from the session.<NEW_LINE>if (!(contextFromSession instanceof SecurityContext)) {<NEW_LINE>this.logger.warn(LogMessage.format("%s did not contain a SecurityContext but contained: '%s'; are you improperly " + "modifying the HttpSession directly (you should always use SecurityContextHolder) " + "or using the HttpSession attribute reserved for this class?", this.springSecurityContextKey, contextFromSession));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (this.logger.isTraceEnabled()) {<NEW_LINE>this.logger.trace(LogMessage.format("Retrieved %s from %s", contextFromSession, this.springSecurityContextKey));<NEW_LINE>} else if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug(LogMessage.format("Retrieved %s", contextFromSession));<NEW_LINE>}<NEW_LINE>// Everything OK. The only non-null return from this method.<NEW_LINE>return (SecurityContext) contextFromSession;<NEW_LINE>}
|
httpSession.getAttribute(this.springSecurityContextKey);
|
404,287
|
final GetEventPredictionResult executeGetEventPrediction(GetEventPredictionRequest getEventPredictionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEventPredictionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEventPredictionRequest> request = null;<NEW_LINE>Response<GetEventPredictionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEventPredictionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEventPredictionRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEventPrediction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEventPredictionResult>> 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 GetEventPredictionResultJsonUnmarshaller());
|
796,854
|
private Mono<Response<SignaturesOverridesListInner>> listWithResponseAsync(String resourceGroupName, String firewallPolicyName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (firewallPolicyName == 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>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter firewallPolicyName is required and cannot be null."));
|
245,189
|
// Explicitly checking for named null.<NEW_LINE>@SuppressWarnings("ReferenceEquality")<NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>public File dumpHeap() {<NEW_LINE>File heapDumpFile = leakDirectoryProvider.newHeapDumpFile();<NEW_LINE>if (heapDumpFile == RETRY_LATER) {<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>FutureResult<Toast> waitingForToast = new FutureResult<>();<NEW_LINE>showToast(waitingForToast);<NEW_LINE>if (!waitingForToast.wait(5, SECONDS)) {<NEW_LINE>CanaryLog.d("Did not dump heap, too much time waiting for Toast.");<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>Notification.Builder builder = new Notification.Builder(context).setContentTitle(context.getString(R.string.leak_canary_notification_dumping));<NEW_LINE>Notification notification = LeakCanaryInternals.buildNotification(context, builder);<NEW_LINE>NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>int notificationId = (int) SystemClock.uptimeMillis();<NEW_LINE><MASK><NEW_LINE>Toast toast = waitingForToast.get();<NEW_LINE>try {<NEW_LINE>Debug.dumpHprofData(heapDumpFile.getAbsolutePath());<NEW_LINE>cancelToast(toast);<NEW_LINE>notificationManager.cancel(notificationId);<NEW_LINE>return heapDumpFile;<NEW_LINE>} catch (Exception e) {<NEW_LINE>CanaryLog.d(e, "Could not dump heap");<NEW_LINE>// Abort heap dump<NEW_LINE>return RETRY_LATER;<NEW_LINE>}<NEW_LINE>}
|
notificationManager.notify(notificationId, notification);
|
515,952
|
public void initPreferences() {<NEW_LINE>mJpMonitorActivePref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_monitor_uptime);<NEW_LINE>mJpMonitorEmailNotesPref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_send_email_notifications);<NEW_LINE>mJpMonitorWpNotesPref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_send_wp_notifications);<NEW_LINE>mJpSsoPref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_allow_wpcom_sign_in);<NEW_LINE>mJpBruteForcePref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_prevent_brute_force);<NEW_LINE>mJpMatchEmailPref = (WPSwitchPreference) getChangePref(R.string.pref_key_jetpack_match_via_email);<NEW_LINE>mJpUseTwoFactorPref = (WPSwitchPreference) <MASK><NEW_LINE>}
|
getChangePref(R.string.pref_key_jetpack_require_two_factor);
|
842,103
|
private DeleteByQueryRequest buildDeleteByQuery(List<JobForecastId> ids) {<NEW_LINE>DeleteByQueryRequest request = new DeleteByQueryRequest();<NEW_LINE>request.setSlices(AbstractBulkByScrollRequest.AUTO_SLICES);<NEW_LINE>request.setTimeout(DEFAULT_MAX_DURATION);<NEW_LINE>request.indices(RESULTS_INDEX_PATTERN);<NEW_LINE>BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().minimumShouldMatch(1);<NEW_LINE>boolQuery.must(QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(), ForecastRequestStats.RESULT_TYPE_VALUE, Forecast.RESULT_TYPE_VALUE));<NEW_LINE>for (JobForecastId jobForecastId : ids) {<NEW_LINE>if (jobForecastId.hasNullValue() == false) {<NEW_LINE>boolQuery.should(QueryBuilders.boolQuery().must(QueryBuilders.termQuery(Job.ID.getPreferredName(), jobForecastId.jobId)).must(QueryBuilders.termQuery(Forecast.FORECAST_ID.getPreferredName(), jobForecastId.forecastId)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>QueryBuilder query = QueryBuilders.boolQuery().filter(boolQuery);<NEW_LINE>request.setQuery(query);<NEW_LINE>// _doc is the most efficient sort order and will also disable scoring<NEW_LINE>request.getSearchRequest().source(<MASK><NEW_LINE>return request;<NEW_LINE>}
|
).sort(ElasticsearchMappings.ES_DOC);
|
1,743,440
|
public Dimension preferredLayoutSize(final Container container) {<NEW_LINE>final JSplitPane splitPane = (JSplitPane) container;<NEW_LINE>int prePrimary = 0;<NEW_LINE>int preSecondary = 0;<NEW_LINE>final Insets insets = splitPane.getInsets();<NEW_LINE>for (int counter = 0; counter < 3; counter++) {<NEW_LINE>if (components[counter] != null) {<NEW_LINE>final Dimension preSize = components[counter].getPreferredSize();<NEW_LINE>final int secSize = getSizeForSecondaryAxis(preSize);<NEW_LINE>prePrimary += getSizeForPrimaryAxis(preSize);<NEW_LINE>if (secSize > preSecondary) {<NEW_LINE>preSecondary = secSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (insets != null) {<NEW_LINE>prePrimary += getSizeForPrimaryAxis(insets, true<MASK><NEW_LINE>preSecondary += getSizeForSecondaryAxis(insets, true) + getSizeForSecondaryAxis(insets, false);<NEW_LINE>}<NEW_LINE>if (axis == 0) {<NEW_LINE>return new Dimension(prePrimary, preSecondary);<NEW_LINE>}<NEW_LINE>return new Dimension(preSecondary, prePrimary);<NEW_LINE>}
|
) + getSizeForPrimaryAxis(insets, false);
|
547,372
|
private static Map<String, Policy> parseRules(List<Map<String, ?>> objects, String name) throws IllegalArgumentException {<NEW_LINE>Map<String, Policy> policies = new LinkedHashMap<String, Policy>();<NEW_LINE>for (Map<String, ?> object : objects) {<NEW_LINE>String policyName = JsonUtil.getString(object, "name");<NEW_LINE>if (policyName == null || policyName.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("rule \"name\" is absent or empty");<NEW_LINE>}<NEW_LINE>List<Principal> principals = new ArrayList<>();<NEW_LINE>Map<String, ?> source = JsonUtil.getObject(object, "source");<NEW_LINE>if (source != null) {<NEW_LINE>principals.add(parseSource(source));<NEW_LINE>} else {<NEW_LINE>principals.add(Principal.newBuilder().setAny(true).build());<NEW_LINE>}<NEW_LINE>List<Permission> <MASK><NEW_LINE>Map<String, ?> request = JsonUtil.getObject(object, "request");<NEW_LINE>if (request != null) {<NEW_LINE>permissions.add(parseRequest(request));<NEW_LINE>} else {<NEW_LINE>permissions.add(Permission.newBuilder().setAny(true).build());<NEW_LINE>}<NEW_LINE>Policy policy = Policy.newBuilder().addAllPermissions(permissions).addAllPrincipals(principals).build();<NEW_LINE>policies.put(name + "_" + policyName, policy);<NEW_LINE>}<NEW_LINE>return policies;<NEW_LINE>}
|
permissions = new ArrayList<>();
|
1,772,472
|
public static CreateDataTasksResponse unmarshall(CreateDataTasksResponse createDataTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>createDataTasksResponse.setRequestId(_ctx.stringValue("CreateDataTasksResponse.RequestId"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateDataTasksResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>SourceCluster sourceCluster = new SourceCluster();<NEW_LINE>sourceCluster.setDataSourceType(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.dataSourceType"));<NEW_LINE>sourceCluster.setVpcInstancePort(_ctx.integerValue<MASK><NEW_LINE>sourceCluster.setVpcId(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.vpcId"));<NEW_LINE>sourceCluster.setVpcInstanceId(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.vpcInstanceId"));<NEW_LINE>sourceCluster.setIndex(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.index"));<NEW_LINE>sourceCluster.setType(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.type"));<NEW_LINE>sourceCluster.setEndpoint(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.endpoint"));<NEW_LINE>sourceCluster.setUsername(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.username"));<NEW_LINE>sourceCluster.setPassword(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sourceCluster.password"));<NEW_LINE>resultItem.setSourceCluster(sourceCluster);<NEW_LINE>SinkCluster sinkCluster = new SinkCluster();<NEW_LINE>sinkCluster.setDataSourceType(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.dataSourceType"));<NEW_LINE>sinkCluster.setIndex(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.index"));<NEW_LINE>sinkCluster.setType(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.type"));<NEW_LINE>sinkCluster.setSettings(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.settings"));<NEW_LINE>sinkCluster.setMapping(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.mapping"));<NEW_LINE>sinkCluster.setRouting(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.routing"));<NEW_LINE>sinkCluster.setVpcId(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.vpcId"));<NEW_LINE>sinkCluster.setVpcInstanceId(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.vpcInstanceId"));<NEW_LINE>sinkCluster.setVpcInstancePort(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.vpcInstancePort"));<NEW_LINE>sinkCluster.setUsername(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.username"));<NEW_LINE>sinkCluster.setPassword(_ctx.stringValue("CreateDataTasksResponse.Result[" + i + "].sinkCluster.password"));<NEW_LINE>resultItem.setSinkCluster(sinkCluster);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>createDataTasksResponse.setResult(result);<NEW_LINE>return createDataTasksResponse;<NEW_LINE>}
|
("CreateDataTasksResponse.Result[" + i + "].sourceCluster.vpcInstancePort"));
|
665,979
|
public void readFrom(StreamInput in) throws IOException {<NEW_LINE>super.readFrom(in);<NEW_LINE>cause = in.readString();<NEW_LINE>name = in.readString();<NEW_LINE>if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {<NEW_LINE>indexPatterns = in.readStringList();<NEW_LINE>} else {<NEW_LINE>indexPatterns = Collections.singletonList(in.readString());<NEW_LINE>}<NEW_LINE>order = in.readInt();<NEW_LINE>create = in.readBoolean();<NEW_LINE>settings = readSettingsFromStream(in);<NEW_LINE>int size = in.readVInt();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>final String type = in.readString();<NEW_LINE>String mappingSource = in.readString();<NEW_LINE>if (in.getVersion().before(Version.V_5_3_0)) {<NEW_LINE>// we do not know the incoming type so convert it if needed<NEW_LINE>mappingSource = XContentHelper.convertToJson(new BytesArray(mappingSource), false, false, XContentFactory.xContentType(mappingSource));<NEW_LINE>}<NEW_LINE>mappings.put(type, mappingSource);<NEW_LINE>}<NEW_LINE>if (in.getVersion().before(Version.V_6_5_0)) {<NEW_LINE>// Used to be used for custom index metadata<NEW_LINE><MASK><NEW_LINE>assert customSize == 0 : "expected not to have any custom metadata";<NEW_LINE>if (customSize > 0) {<NEW_LINE>throw new IllegalStateException("unexpected custom metadata when none is supported");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int aliasesSize = in.readVInt();<NEW_LINE>for (int i = 0; i < aliasesSize; i++) {<NEW_LINE>aliases.add(Alias.read(in));<NEW_LINE>}<NEW_LINE>version = in.readOptionalVInt();<NEW_LINE>}
|
int customSize = in.readVInt();
|
1,194,724
|
public static byte[] encrypt(CipherSuite suite, SecretKey key, SecretKey macKey, byte[] additionalData, byte[] payload) throws GeneralSecurityException {<NEW_LINE>DatagramWriter plainMessage = new DatagramWriter(payload.length + suite.getMacLength() + suite.getRecordIvLength(), true);<NEW_LINE>plainMessage.writeBytes(payload);<NEW_LINE>// add MAC<NEW_LINE>byte[] mac = getBlockCipherMac(suite.getThreadLocalMac(), macKey, additionalData, payload, payload.length);<NEW_LINE>plainMessage.writeBytes(mac);<NEW_LINE>Bytes.clear(mac);<NEW_LINE>// determine padding length<NEW_LINE>int ciphertextLength = payload.length + suite.getMacLength() + 1;<NEW_LINE>int blocksize = suite.getRecordIvLength();<NEW_LINE>int lastBlockBytes = ciphertextLength % blocksize;<NEW_LINE>int paddingLength = lastBlockBytes > 0 ? blocksize - lastBlockBytes : 0;<NEW_LINE>// create padding<NEW_LINE>byte[] padding = new byte[paddingLength + 1];<NEW_LINE>Arrays.fill(padding, (byte) paddingLength);<NEW_LINE>plainMessage.writeBytes(padding);<NEW_LINE>Bytes.clear(padding);<NEW_LINE>Cipher blockCipher = suite.getThreadLocalCipher();<NEW_LINE>blockCipher.init(Cipher.ENCRYPT_MODE, key);<NEW_LINE>byte[] iv = blockCipher.getIV();<NEW_LINE>byte[<MASK><NEW_LINE>plainMessage.close();<NEW_LINE>byte[] message = Arrays.copyOf(iv, iv.length + plaintext.length);<NEW_LINE>blockCipher.doFinal(plaintext, 0, plaintext.length, message, iv.length);<NEW_LINE>return message;<NEW_LINE>}
|
] plaintext = plainMessage.toByteArray();
|
1,374,937
|
final UpdateCrawlerResult executeUpdateCrawler(UpdateCrawlerRequest updateCrawlerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateCrawlerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateCrawlerRequest> request = null;<NEW_LINE>Response<UpdateCrawlerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateCrawlerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCrawlerRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateCrawler");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateCrawlerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCrawlerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");
|
348,316
|
public Uni<SecurityIdentity> authenticate(RoutingContext routingContext, IdentityProviderManager identityProviderManager) {<NEW_LINE>MultiMap qheaders = routingContext<MASK><NEW_LINE>if (qheaders instanceof QuarkusHttpHeaders) {<NEW_LINE>Map<Class<?>, Object> contextObjects = ((QuarkusHttpHeaders) qheaders).getContextObjects();<NEW_LINE>if (contextObjects.containsKey(AwsProxyRequest.class)) {<NEW_LINE>AwsProxyRequest event = (AwsProxyRequest) contextObjects.get(AwsProxyRequest.class);<NEW_LINE>if (isAuthenticatable(event)) {<NEW_LINE>if (useDefault) {<NEW_LINE>return identityProviderManager.authenticate(HttpSecurityUtils.setRoutingContextAttribute(new DefaultLambdaAuthenticationRequest(event), routingContext));<NEW_LINE>} else {<NEW_LINE>return identityProviderManager.authenticate(HttpSecurityUtils.setRoutingContextAttribute(new LambdaAuthenticationRequest(event), routingContext));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Uni.createFrom().optional(Optional.empty());<NEW_LINE>}
|
.request().headers();
|
756,049
|
private ApiCallMonitoringEvent generateApiCallMonitoringEvent(Request<?> request) {<NEW_LINE>String apiName = request.getHandlerContext(HandlerContextKey.OPERATION_NAME);<NEW_LINE>String serviceId = request.getHandlerContext(HandlerContextKey.SERVICE_ID);<NEW_LINE>String region = request.getHandlerContext(HandlerContextKey.SIGNING_REGION);<NEW_LINE>ApiCallAttemptMonitoringEvent lastApiCallAttempt = request.getHandlerContext(LAST_CALL_ATTEMPT);<NEW_LINE>Long timestamp = null;<NEW_LINE>Long latency = null;<NEW_LINE>Integer requestCount = 0;<NEW_LINE>AWSRequestMetrics metrics = request.getAWSRequestMetrics();<NEW_LINE>if (metrics != null) {<NEW_LINE>TimingInfo timingInfo = metrics.getTimingInfo();<NEW_LINE>requestCount = timingInfo.getCounter(AWSRequestMetrics.Field.RequestCount.name()) == null ? 0 : timingInfo.getCounter(AWSRequestMetrics.Field.RequestCount.name()).intValue();<NEW_LINE>TimingInfo latencyTimingInfo = timingInfo.getSubMeasurement(AwsClientSideMonitoringMetrics.ApiCallLatency.name());<NEW_LINE>if (latencyTimingInfo != null) {<NEW_LINE>latency = convertToLongIfNotNull(latencyTimingInfo.getTimeTakenMillisIfKnown());<NEW_LINE>timestamp = latencyTimingInfo.getStartEpochTimeMilliIfKnown();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ApiCallMonitoringEvent event = new ApiCallMonitoringEvent().withApi(apiName).withVersion(VERSION).withRegion(region).withService(serviceId).withClientId(clientId).withAttemptCount(requestCount).withLatency(latency).withUserAgent(trimValueIfExceedsMaxLength(USER_AGENT_KEY, getDefaultUserAgent(request))).withTimestamp(timestamp);<NEW_LINE>if (lastApiCallAttempt != null) {<NEW_LINE>event.withFinalAwsException(lastApiCallAttempt.getAwsException()).withFinalAwsExceptionMessage(lastApiCallAttempt.getAwsExceptionMessage()).withFinalSdkException(lastApiCallAttempt.getSdkException()).withFinalSdkExceptionMessage(lastApiCallAttempt.getSdkExceptionMessage()).<MASK><NEW_LINE>}<NEW_LINE>return event;<NEW_LINE>}
|
withFinalHttpStatusCode(lastApiCallAttempt.getHttpStatusCode());
|
525,226
|
public static void rgbToLab_U8(Planar<GrayU8> rgb, Planar<GrayF32> lab) {<NEW_LINE>GrayU8 R = rgb.getBand(0);<NEW_LINE>GrayU8 G = rgb.getBand(1);<NEW_LINE>GrayU8 <MASK><NEW_LINE>GrayF32 L_ = lab.getBand(0);<NEW_LINE>GrayF32 A_ = lab.getBand(1);<NEW_LINE>GrayF32 B_ = lab.getBand(2);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0,lab.height,row->{<NEW_LINE>for (int row = 0; row < lab.height; row++) {<NEW_LINE>int indexLab = lab.startIndex + row * lab.stride;<NEW_LINE>int indexRgb = rgb.startIndex + row * rgb.stride;<NEW_LINE>for (int col = 0; col < lab.width; col++, indexLab++, indexRgb++) {<NEW_LINE>float r = ColorXyz.table_invgamma_f[R.data[indexRgb] & 0xFF];<NEW_LINE>float g = ColorXyz.table_invgamma_f[G.data[indexRgb] & 0xFF];<NEW_LINE>float b = ColorXyz.table_invgamma_f[B.data[indexRgb] & 0xFF];<NEW_LINE>float X = 0.412453f * r + 0.35758f * g + 0.180423f * b;<NEW_LINE>float Y = 0.212671f * r + 0.71516f * g + 0.072169f * b;<NEW_LINE>float Z = 0.019334f * r + 0.119193f * g + 0.950227f * b;<NEW_LINE>float xr = X / Xr_f;<NEW_LINE>float yr = Y / Yr_f;<NEW_LINE>float zr = Z / Zr_f;<NEW_LINE>float fx, fy, fz;<NEW_LINE>if (xr > epsilon_f)<NEW_LINE>fx = (float) Math.pow(xr, 1.0f / 3.0f);<NEW_LINE>else<NEW_LINE>fx = (kappa_f * xr + 16.0f) / 116.0f;<NEW_LINE>if (yr > epsilon_f)<NEW_LINE>fy = (float) Math.pow(yr, 1.0 / 3.0f);<NEW_LINE>else<NEW_LINE>fy = (kappa_f * yr + 16.0f) / 116.0f;<NEW_LINE>if (zr > epsilon_f)<NEW_LINE>fz = (float) Math.pow(zr, 1.0 / 3.0f);<NEW_LINE>else<NEW_LINE>fz = (kappa_f * zr + 16.0f) / 116.0f;<NEW_LINE>L_.data[indexLab] = 116.0f * fy - 16.0f;<NEW_LINE>A_.data[indexLab] = 500.0f * (fx - fy);<NEW_LINE>B_.data[indexLab] = 200.0f * (fy - fz);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
|
B = rgb.getBand(2);
|
1,744,861
|
public static void main(String[] args) {<NEW_LINE>// Fermat's little theorem, b^-1 = b^{m-2} (mod m)<NEW_LINE>// example 1, output 2<NEW_LINE>System.out.println((27 % 7 * modPow(3, 5, 7)) % 7);<NEW_LINE>// example 2, output 5<NEW_LINE>System.out.println((27 % 7 * modPow(4, <MASK><NEW_LINE>// example 3, wrong answer, doesn't output 10 because 18 is not a prime<NEW_LINE>System.out.println((520 % 18 * modPow(25, 16, 18)) % 18);<NEW_LINE>// Using extEuclid<NEW_LINE>// example 1, output 2<NEW_LINE>System.out.println((27 % 7 * modInverse(3, 7)) % 7);<NEW_LINE>// example 2, output 5<NEW_LINE>System.out.println((27 % 7 * modInverse(4, 7)) % 7);<NEW_LINE>// example 3, output 10<NEW_LINE>System.out.println((520 % 18 * modInverse(25, 18)) % 18);<NEW_LINE>}
|
5, 7)) % 7);
|
1,110,174
|
private void recomputeLOFs(DBIDs ids, LOFResult<O> lofResult) {<NEW_LINE>WritableDoubleDataStore new_lofs = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>DoubleMinMax new_lofminmax = new DoubleMinMax();<NEW_LINE>computeLOFs(lofResult.getKNNRefer(), ids, lofResult.getLrds(), new_lofs, new_lofminmax);<NEW_LINE>for (DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {<NEW_LINE>lofResult.getLofs().putDouble(iter<MASK><NEW_LINE>}<NEW_LINE>// Actualize meta info<NEW_LINE>if (new_lofminmax.isValid()) {<NEW_LINE>if (lofResult.getResult().getOutlierMeta().getActualMaximum() < new_lofminmax.getMax()) {<NEW_LINE>BasicOutlierScoreMeta scoreMeta = (BasicOutlierScoreMeta) lofResult.getResult().getOutlierMeta();<NEW_LINE>scoreMeta.setActualMaximum(new_lofminmax.getMax());<NEW_LINE>}<NEW_LINE>if (lofResult.getResult().getOutlierMeta().getActualMinimum() > new_lofminmax.getMin()) {<NEW_LINE>BasicOutlierScoreMeta scoreMeta = (BasicOutlierScoreMeta) lofResult.getResult().getOutlierMeta();<NEW_LINE>scoreMeta.setActualMinimum(new_lofminmax.getMin());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
, new_lofs.doubleValue(iter));
|
942,536
|
private void removeAfterInFile(int fileId, long untilLogId) {<NEW_LINE>String oldFilePath = storagePath + File.separator + OPLOG_FILE.replace("$NUM$", "" + fileId);<NEW_LINE>File oldFile = new File(oldFilePath);<NEW_LINE>String newFilePath = storagePath + File.separator + OPLOG_FILE.replace("$NUM$", "" + fileId) + "_temp";<NEW_LINE>File newFile = new File(newFilePath);<NEW_LINE>if (newFile.exists()) {<NEW_LINE>newFile.delete();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>newFile.createNewFile();<NEW_LINE>FileOutputStream outFileStream = new FileOutputStream(newFile);<NEW_LINE>DataInputStream readStream = new DataInputStream(new FileInputStream(oldFile));<NEW_LINE>DataOutputStream writeStream = new DataOutputStream(outFileStream);<NEW_LINE>OOperationLogEntry record = readRecord(readStream);<NEW_LINE>while (record != null && record.getLogId().getId() <= untilLogId) {<NEW_LINE>writeRecord(writeStream, record.getLogId(), record.getRequest());<NEW_LINE>record = readRecord(readStream);<NEW_LINE>}<NEW_LINE>readStream.close();<NEW_LINE>outFileStream.getFD().sync();<NEW_LINE>writeStream.close();<NEW_LINE>File oldFileCopy = new File(<MASK><NEW_LINE>if (oldFileCopy.exists()) {<NEW_LINE>oldFileCopy.delete();<NEW_LINE>}<NEW_LINE>oldFile.renameTo(oldFileCopy);<NEW_LINE>newFile.renameTo(new File(oldFilePath));<NEW_LINE>oldFileCopy.delete();<NEW_LINE>this.lastId = null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ODistributedException("Cannot find oplog file: " + oldFilePath);<NEW_LINE>}<NEW_LINE>}
|
oldFile.toString() + "_copy");
|
1,779,459
|
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + decoder.state_zs_extraRegisterBase + baseReg);<NEW_LINE>instruction.setOp1Register(decoder.state_vvvv + baseReg);<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp2Register(decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + baseReg);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>decoder.readOpMem(instruction);<NEW_LINE>}<NEW_LINE>int ib = decoder.readByte();<NEW_LINE>instruction.setOp3Register(((ib >>> 4) & decoder.reg15Mask) + baseReg);<NEW_LINE>assert instruction.getOp4Kind() == OpKind.IMMEDIATE8 : instruction.getOp4Kind();<NEW_LINE>instruction.setImmediate8((byte) (ib & 0xF));<NEW_LINE>}
|
instruction.setOp2Kind(OpKind.MEMORY);
|
1,749,223
|
/*<NEW_LINE>* Find javadoc block tags for a given completion javadoc tag node<NEW_LINE>*/<NEW_LINE>private void findJavadocBlockTags(CompletionOnJavadocTag javadocTag) {<NEW_LINE>char[][] possibleTags = javadocTag.getPossibleBlockTags();<NEW_LINE>if (possibleTags == null)<NEW_LINE>return;<NEW_LINE>int length = possibleTags.length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>int relevance = computeBaseRelevance();<NEW_LINE>relevance += computeRelevanceForInterestingProposal();<NEW_LINE>// no access restriction for keywors<NEW_LINE>relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);<NEW_LINE>this.noProposal = false;<NEW_LINE>if (!this.requestor.isIgnored(CompletionProposal.JAVADOC_BLOCK_TAG)) {<NEW_LINE>char[] possibleTag = possibleTags[i];<NEW_LINE>InternalCompletionProposal proposal = createProposal(CompletionProposal.JAVADOC_BLOCK_TAG, this.actualCompletionPosition);<NEW_LINE>proposal.setName(possibleTag);<NEW_LINE>int tagLength = possibleTag.length;<NEW_LINE>char[] completion = new char[1 + tagLength];<NEW_LINE>completion[0] = '@';<NEW_LINE>System.arraycopy(possibleTag, 0, completion, 1, tagLength);<NEW_LINE>proposal.setCompletion(completion);<NEW_LINE>proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);<NEW_LINE>proposal.setTokenRange(this.tokenStart - this.offset, <MASK><NEW_LINE>proposal.setRelevance(relevance);<NEW_LINE>this.requestor.accept(proposal);<NEW_LINE>if (DEBUG) {<NEW_LINE>this.printDebug(proposal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
this.tokenEnd - this.offset);
|
788,458
|
public boolean onPreferenceClick(Preference preference) {<NEW_LINE>String prefId = preference.getKey();<NEW_LINE>if (prefId.equals(BACKUP_TO_FILE)) {<NEW_LINE>MapActivity activity = getMapActivity();<NEW_LINE>if (AndroidUtils.isActivityNotDestroyed(activity)) {<NEW_LINE>ApplicationMode mode = getSelectedAppMode();<NEW_LINE>List<ExportSettingsType> types = new ArrayList<>();<NEW_LINE>types.add(ExportSettingsType.SEARCH_HISTORY);<NEW_LINE>types.add(ExportSettingsType.HISTORY_MARKERS);<NEW_LINE>ExportSettingsFragment.showInstance(activity.getSupportFragmentManager(), mode, types, true);<NEW_LINE>}<NEW_LINE>} else if (prefId.equals(CLEAR_ALL_HISTORY)) {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>if (fragmentManager != null) {<NEW_LINE>ClearAllHistoryBottomSheet.showInstance(fragmentManager, this);<NEW_LINE>}<NEW_LINE>} else if (prefId.equals(SEARCH_HISTORY)) {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>if (fragmentManager != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (prefId.equals(NAVIGATION_HISTORY)) {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>if (fragmentManager != null) {<NEW_LINE>NavigationHistorySettingsFragment.showInstance(fragmentManager, this);<NEW_LINE>}<NEW_LINE>} else if (prefId.equals(MAP_MARKERS_HISTORY)) {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>if (fragmentManager != null) {<NEW_LINE>MarkersHistorySettingsFragment.showInstance(fragmentManager, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.onPreferenceClick(preference);<NEW_LINE>}
|
SearchHistorySettingsFragment.showInstance(fragmentManager, this);
|
856,555
|
public static void saveUserDetails(final Context context, final UserDetails profile) {<NEW_LINE>final SharedPreferences preferences = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);<NEW_LINE>final Editor edit = preferences.edit();<NEW_LINE>edit.putInt(PrefConstants.USER_AVERAGE_STORIES_PER_MONTH, profile.averageStoriesPerMonth);<NEW_LINE>edit.putString(PrefConstants.USER_BIO, profile.bio);<NEW_LINE>edit.putString(PrefConstants.USER_FEED_ADDRESS, profile.feedAddress);<NEW_LINE>edit.putString(PrefConstants.USER_FEED_TITLE, profile.feedTitle);<NEW_LINE>edit.putInt(<MASK><NEW_LINE>edit.putInt(PrefConstants.USER_FOLLOWING_COUNT, profile.followingCount);<NEW_LINE>edit.putString(PrefConstants.USER_ID, profile.userId);<NEW_LINE>edit.putString(PrefConstants.USER_LOCATION, profile.location);<NEW_LINE>edit.putString(PrefConstants.USER_PHOTO_SERVICE, profile.photoService);<NEW_LINE>edit.putString(PrefConstants.USER_PHOTO_URL, profile.photoUrl);<NEW_LINE>edit.putInt(PrefConstants.USER_SHARED_STORIES_COUNT, profile.sharedStoriesCount);<NEW_LINE>edit.putInt(PrefConstants.USER_STORIES_LAST_MONTH, profile.storiesLastMonth);<NEW_LINE>edit.putInt(PrefConstants.USER_SUBSCRIBER_COUNT, profile.subscriptionCount);<NEW_LINE>edit.putString(PrefConstants.USER_USERNAME, profile.username);<NEW_LINE>edit.putString(PrefConstants.USER_WEBSITE, profile.website);<NEW_LINE>edit.commit();<NEW_LINE>saveUserImage(context, profile.photoUrl);<NEW_LINE>}
|
PrefConstants.USER_FOLLOWER_COUNT, profile.followerCount);
|
1,332,254
|
final DescribeClusterResult executeDescribeCluster(DescribeClusterRequest describeClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClusterRequest> request = null;<NEW_LINE>Response<DescribeClusterResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeClusterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeClusterRequest));<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, "Snowball");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeClusterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeClusterResultJsonUnmarshaller());<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.RequestMarshallTime);
|
412,461
|
/*@Override<NEW_LINE>public String getMenuName() {//KS TODO not implemented<NEW_LINE>return getString(R.string.snooze_alert);<NEW_LINE>}*/<NEW_LINE>public void addListenerOnButton() {<NEW_LINE>buttonSnooze = (Button) <MASK><NEW_LINE>// low alerts<NEW_LINE>disableLowAlerts = (Button) findViewById(R.id.button_disable_low_alerts);<NEW_LINE>clearLowDisabled = (Button) findViewById(R.id.enable_low_alerts);<NEW_LINE>// high alerts<NEW_LINE>disableHighAlerts = (Button) findViewById(R.id.button_disable_high_alerts);<NEW_LINE>clearHighDisabled = (Button) findViewById(R.id.enable_high_alerts);<NEW_LINE>// all alerts<NEW_LINE>disableAlerts = (Button) findViewById(R.id.button_disable_alerts);<NEW_LINE>clearDisabled = (Button) findViewById(R.id.enable_alerts);<NEW_LINE>sendRemoteSnooze = (Button) findViewById(R.id.send_remote_snooze);<NEW_LINE>buttonSnooze.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>int intValue = getTimeFromSnoozeValue(snoozeValue.getValue());<NEW_LINE>AlertPlayer.getPlayer().Snooze(getApplicationContext(), intValue);<NEW_LINE>Intent intent = new Intent(getApplicationContext(), Home.class);<NEW_LINE>if (ActiveBgAlert.getOnly() != null) {<NEW_LINE>Log.e(TAG, "Snoozed! ActiveBgAlert.getOnly() != null TODO restart Home.class - watchface?");<NEW_LINE>// KS TODO startActivity(intent);<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>showDisableEnableButtons();<NEW_LINE>setOnClickListenerOnDisableButton(disableAlerts, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableLowAlerts, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableHighAlerts, "high_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearDisabled, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearLowDisabled, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearHighDisabled, "high_alerts_disabled_until");<NEW_LINE>}
|
findViewById(R.id.button_snooze);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.