idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,773,797 | private boolean isItOKToAddCertToTrustStore(X509Certificate c) {<NEW_LINE>if (!interactive) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String result = null;<NEW_LINE>LineReader lineReader = null;<NEW_LINE>try {<NEW_LINE>lineReader = LineReaderBuilder.builder().terminal(new DumbTerminal(System.in, System.out)).build();<NEW_LINE>result = lineReader.readLine(STRING_MANAGER.get("certificateTrustPrompt"));<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.log(Level.WARNING, "Error instantiating console", ioe);<NEW_LINE>} finally {<NEW_LINE>if (lineReader != null && lineReader.getTerminal() != null) {<NEW_LINE>try {<NEW_LINE>lineReader.getTerminal().close();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result != null && result.equalsIgnoreCase("y");<NEW_LINE>} | Level.WARNING, "Error closing terminal", ioe); |
98,160 | BlockEntryStreamMerger<KEY, VALUE> startMerge() {<NEW_LINE>List<BlockEntryCursor<KEY, VALUE>> remainingParts <MASK><NEW_LINE>while (remainingParts.size() > MERGE_FACTOR) {<NEW_LINE>// Build one "level" of mergers, each merger in this level merging "merge factor" number of streams<NEW_LINE>List<BlockEntryCursor<KEY, VALUE>> current = new ArrayList<>();<NEW_LINE>List<BlockEntryCursor<KEY, VALUE>> levelParts = new ArrayList<>();<NEW_LINE>for (BlockEntryCursor<KEY, VALUE> remainingPart : remainingParts) {<NEW_LINE>current.add(remainingPart);<NEW_LINE>if (current.size() == MERGE_FACTOR) {<NEW_LINE>BlockEntryStreamMerger<KEY, VALUE> merger = new BlockEntryStreamMerger<>(current, layout, null, cancellation, batchSize, QUEUE_SIZE);<NEW_LINE>allMergers.add(merger);<NEW_LINE>levelParts.add(merger);<NEW_LINE>current = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>levelParts.addAll(current);<NEW_LINE>remainingParts = levelParts;<NEW_LINE>}<NEW_LINE>BlockEntryStreamMerger<KEY, VALUE> merger = new BlockEntryStreamMerger<>(remainingParts, layout, samplingComparator, cancellation, batchSize, QUEUE_SIZE);<NEW_LINE>allMergers.add(merger);<NEW_LINE>allMergers.forEach(merge -> mergeHandles.add(populationWorkScheduler.schedule(indexName -> "Part merger while writing scan update for " + indexName, merge)));<NEW_LINE>return merger;<NEW_LINE>} | = new ArrayList<>(parts); |
679,119 | public static void main(String[] args) {<NEW_LINE>Exercise26_LazyDeleteLinearProbing lazyDeleteLinearProbing = new Exercise26_LazyDeleteLinearProbing();<NEW_LINE>LinearProbingHashTableLazyDelete<Integer, Integer> linearProbingHashTableLazyDelete = lazyDeleteLinearProbing.new LinearProbingHashTableLazyDelete<>(16);<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>linearProbingHashTableLazyDelete.put(i, i);<NEW_LINE>}<NEW_LINE>StdOut.println("Size: " + linearProbingHashTableLazyDelete.size() + " Expected: 4");<NEW_LINE>StdOut.println("Lazy delete 2");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(2);<NEW_LINE>StdOut.println("Size: " + linearProbingHashTableLazyDelete.size() + " Expected: 3");<NEW_LINE>StdOut.println("Lazy delete 0");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(0);<NEW_LINE>StdOut.println("Expected: Deleting tombstone items");<NEW_LINE>StdOut.println("Size: " + linearProbingHashTableLazyDelete.size() + " Expected: 2");<NEW_LINE>for (int i = 4; i < 8; i++) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StdOut.println("\nLazy delete 3");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(3);<NEW_LINE>StdOut.println("Lazy delete 4");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(4);<NEW_LINE>StdOut.println("Lazy delete 5");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(5);<NEW_LINE>StdOut.println("Put 3");<NEW_LINE>linearProbingHashTableLazyDelete.put(3, 3);<NEW_LINE>StdOut.println("Lazy delete 6");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(6);<NEW_LINE>StdOut.println("Lazy delete 7");<NEW_LINE>linearProbingHashTableLazyDelete.lazyDelete(7);<NEW_LINE>StdOut.println("Expected: Deleting tombstone items");<NEW_LINE>StdOut.println("Size: " + linearProbingHashTableLazyDelete.size() + " Expected: 2");<NEW_LINE>} | linearProbingHashTableLazyDelete.put(i, i); |
503,536 | private void createVmFlowChainBuilder() throws InstantiationException, IllegalAccessException, ClassNotFoundException {<NEW_LINE>createVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(createVmWorkFlowElements).construct();<NEW_LINE>stopVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(stopVmWorkFlowElements).construct();<NEW_LINE>rebootVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(rebootVmWorkFlowElements).construct();<NEW_LINE>startVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(startVmWorkFlowElements).construct();<NEW_LINE>destroyVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(destroyVmWorkFlowElements).construct();<NEW_LINE>migrateVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(migrateVmWorkFlowElements).construct();<NEW_LINE>attachVolumeFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(attachVolumeWorkFlowElements).construct();<NEW_LINE>attachIsoFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(attachIsoWorkFlowElements).construct();<NEW_LINE>detachIsoFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(detachIsoWorkFlowElements).construct();<NEW_LINE>expungeVmFlowBuilder = FlowChainBuilder.newBuilder().<MASK><NEW_LINE>pauseVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(pauseVmWorkFlowElements).construct();<NEW_LINE>resumeVmFlowBuilder = FlowChainBuilder.newBuilder().setFlowClassNames(resumeVmWorkFlowElements).construct();<NEW_LINE>} | setFlowClassNames(expungeVmWorkFlowElements).construct(); |
167,081 | public com.amazonaws.services.codedeploy.model.DeploymentGroupNameRequiredException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.DeploymentGroupNameRequiredException deploymentGroupNameRequiredException = new com.amazonaws.services.codedeploy.model.DeploymentGroupNameRequiredException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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 deploymentGroupNameRequiredException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,460,864 | public OperationResult execute(final MessageFrame frame, final EVM evm) {<NEW_LINE>try {<NEW_LINE>final Address address = Words.toAddress(frame.popStackItem());<NEW_LINE>final boolean accountIsWarm = frame.warmUpAddress(address) || gasCalculator().isPrecompile(address);<NEW_LINE>final Optional<Gas> optionalCost = Optional.of(cost(accountIsWarm));<NEW_LINE>if (frame.getRemainingGas().compareTo(optionalCost.get()) < 0) {<NEW_LINE>return new OperationResult(optionalCost, Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS));<NEW_LINE>} else {<NEW_LINE>final Account account = frame.getWorldUpdater().get(address);<NEW_LINE>if (account == null || account.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>frame.pushStackItem(UInt256.fromBytes(account.getCodeHash()));<NEW_LINE>}<NEW_LINE>return new OperationResult(optionalCost, Optional.empty());<NEW_LINE>}<NEW_LINE>} catch (final UnderflowException ufe) {<NEW_LINE>return new OperationResult(Optional.of(cost(true)), Optional.of(ExceptionalHaltReason.INSUFFICIENT_STACK_ITEMS));<NEW_LINE>} catch (final OverflowException ofe) {<NEW_LINE>return new OperationResult(Optional.of(cost(true)), Optional.of(ExceptionalHaltReason.TOO_MANY_STACK_ITEMS));<NEW_LINE>}<NEW_LINE>} | frame.pushStackItem(UInt256.ZERO); |
851,972 | public static GetTextLogoListResponse unmarshall(GetTextLogoListResponse getTextLogoListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getTextLogoListResponse.setRequestId(_ctx.stringValue("GetTextLogoListResponse.RequestId"));<NEW_LINE>getTextLogoListResponse.setSuccess(_ctx.booleanValue("GetTextLogoListResponse.Success"));<NEW_LINE>getTextLogoListResponse.setLogoVersion(_ctx.stringValue("GetTextLogoListResponse.LogoVersion"));<NEW_LINE>List<LogosItem> logos <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetTextLogoListResponse.Logos.Length"); i++) {<NEW_LINE>LogosItem logosItem = new LogosItem();<NEW_LINE>logosItem.setGoodsId(_ctx.stringValue("GetTextLogoListResponse.Logos[" + i + "].GoodsId"));<NEW_LINE>logosItem.setUrl(_ctx.stringValue("GetTextLogoListResponse.Logos[" + i + "].Url"));<NEW_LINE>logos.add(logosItem);<NEW_LINE>}<NEW_LINE>getTextLogoListResponse.setLogos(logos);<NEW_LINE>return getTextLogoListResponse;<NEW_LINE>} | = new ArrayList<LogosItem>(); |
1,578,436 | public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if (evt.getPropertyName().equals(WorkspaceInformation.EVENT_RENAME)) {<NEW_LINE>final WorkspaceInformation workspaceInformation = (WorkspaceInformation) evt.getSource();<NEW_LINE>final int index = tabbedContainer<MASK><NEW_LINE>if (!tabDataModel.getTab(index).getText().equals(workspaceInformation.getName())) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>tabbedContainer.setTitleAt(index, workspaceInformation.getName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (evt.getPropertyName().equals(WorkspaceInformation.EVENT_SET_SOURCE)) {<NEW_LINE>final WorkspaceInformation workspaceInformation = (WorkspaceInformation) evt.getSource();<NEW_LINE>final int index = tabbedContainer.getSelectionModel().getSelectedIndex();<NEW_LINE>if (tabDataModel.getTab(index).getTooltip() == null || !tabDataModel.getTab(index).getTooltip().equals(workspaceInformation.getSource())) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>tabbedContainer.setToolTipTextAt(index, workspaceInformation.getSource());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getSelectionModel().getSelectedIndex(); |
1,277,432 | public io.kubernetes.client.proto.V1alpha1Rbac.ClusterRoleList buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1alpha1Rbac.ClusterRoleList result = new io.kubernetes.client.proto.V1alpha1Rbac.ClusterRoleList(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result.metadata_ = metadataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>items_ = java.util.Collections.unmodifiableList(items_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.items_ = items_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .items_ = itemsBuilder_.build(); |
193,124 | public void deployResource(Object resource, String applicationName, String moduleName) throws Exception {<NEW_LINE>ManagedExecutorService managedExecutorServiceRes = (ManagedExecutorService) resource;<NEW_LINE>if (managedExecutorServiceRes == null) {<NEW_LINE>_logger.log(Level.WARNING, LogFacade.DEPLOY_ERROR_NULL_CONFIG, "ManagedExecutorService");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jndiName = managedExecutorServiceRes.getJndiName();<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "ManagedExecutorServiceDeployer.deployResource() : jndi-name [" + jndiName + "], ");<NEW_LINE>}<NEW_LINE>ResourceInfo resourceInfo = new ResourceInfo(managedExecutorServiceRes.getJndiName(), applicationName, moduleName);<NEW_LINE>ManagedExecutorServiceConfig config = new ManagedExecutorServiceConfig(managedExecutorServiceRes);<NEW_LINE>javax.naming.Reference ref = new javax.naming.Reference(javax.enterprise.concurrent.ManagedExecutorService.class.getName(), "org.glassfish.concurrent.runtime.deployer.ConcurrentObjectFactory", null);<NEW_LINE>RefAddr addr = new SerializableObjectRefAddr(ManagedExecutorServiceConfig.class.getName(), config);<NEW_LINE>ref.add(addr);<NEW_LINE>RefAddr resAddr = new SerializableObjectRefAddr(ResourceInfo.class.getName(), resourceInfo);<NEW_LINE>ref.add(resAddr);<NEW_LINE>try {<NEW_LINE>// Publish the object ref<NEW_LINE>namingService.publishObject(resourceInfo, ref, true);<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>LogHelper.log(_logger, Level.SEVERE, LogFacade.<MASK><NEW_LINE>}<NEW_LINE>registerMonitorableComponent(managedExecutorServiceRes);<NEW_LINE>} | UNABLE_TO_BIND_OBJECT, ex, "ManagedExecutorService", jndiName); |
1,591,114 | public void load(Map<String, Object> parameters) {<NEW_LINE>setCurrentSetup(new TreeMap<>());<NEW_LINE><MASK><NEW_LINE>getCurrentSetup().putAll(getSetup());<NEW_LINE>LOGGER.log(Level.INFO, "[{0}] Stack \"{1}\" is loading.", new Object[] { getFlag().toString().toUpperCase(Locale.ROOT), getName() });<NEW_LINE>// fill properly the "forGroups" and "forProjects" fields<NEW_LINE>processTargetGroupsAndProjects();<NEW_LINE>setWorking();<NEW_LINE>int cnt = 0;<NEW_LINE>for (AuthorizationEntity authEntity : getStack()) {<NEW_LINE>authEntity.load(getCurrentSetup());<NEW_LINE>if (authEntity.isWorking()) {<NEW_LINE>cnt++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getStack().size() > 0 && cnt < getStack().size()) {<NEW_LINE>setFailed();<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.INFO, "[{0}] Stack \"{1}\" is {2}.", new Object[] { getFlag().toString().toUpperCase(Locale.ROOT), getName(), isWorking() ? "ready" : "not fully ok" });<NEW_LINE>} | getCurrentSetup().putAll(parameters); |
1,685,921 | private void startImportApp(@NonNull Class<? extends DatabaseImporter> importerType) {<NEW_LINE>DatabaseImporter importer = DatabaseImporter.create(this, importerType);<NEW_LINE>// obtain the global root shell and close it immediately after we're done<NEW_LINE>// TODO: find a way to use SuFileInputStream with Shell.newInstance()<NEW_LINE>try (Shell shell = Shell.getShell()) {<NEW_LINE>if (!shell.isRoot()) {<NEW_LINE>Toast.makeText(this, R.string.root_error, <MASK><NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DatabaseImporter.State state = importer.readFromApp();<NEW_LINE>processImporterState(state);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Toast.makeText(this, R.string.app_lookup_error, Toast.LENGTH_SHORT).show();<NEW_LINE>finish();<NEW_LINE>} catch (IOException | DatabaseImporterException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Dialogs.showErrorDialog(this, R.string.reading_file_error, e, (dialog, which) -> finish());<NEW_LINE>}<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
1,476,477 | private void init() {<NEW_LINE>setUndecorated(true);<NEW_LINE>try {<NEW_LINE>if (GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {<NEW_LINE>if (!Config.getInstance().isNoTransparency())<NEW_LINE>setOpacity(0.85f);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>setIconImage(ImageResource.getImage("icon.png"));<NEW_LINE>setSize(getScaledInt(350), getScaledInt(200));<NEW_LINE>setLocationRelativeTo(null);<NEW_LINE>setResizable(false);<NEW_LINE>getContentPane().setLayout(null);<NEW_LINE>getContentPane().setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>titlePanel = new TitlePanel(null, this);<NEW_LINE>titlePanel.setOpaque(false);<NEW_LINE>titlePanel.setBounds(0, 0, getScaledInt(350), getScaledInt(50));<NEW_LINE>closeBtn = new CustomButton();<NEW_LINE>closeBtn.setBounds(getScaledInt(320), getScaledInt(5), getScaledInt(24), getScaledInt(24));<NEW_LINE>closeBtn.setIcon(ImageResource.getIcon("title_close.png", 20, 20));<NEW_LINE>closeBtn.setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>closeBtn.setBorderPainted(false);<NEW_LINE>closeBtn.setFocusPainted(false);<NEW_LINE>closeBtn.setName("CLOSE");<NEW_LINE>closeBtn.addActionListener(this);<NEW_LINE>minBtn = new CustomButton();<NEW_LINE>minBtn.setBounds(getScaledInt(296), getScaledInt(5), getScaledInt(24), getScaledInt(24));<NEW_LINE>minBtn.setIcon(ImageResource.getIcon("title_min.png", 20, 20));<NEW_LINE>minBtn.setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>minBtn.setBorderPainted(false);<NEW_LINE>minBtn.setFocusPainted(false);<NEW_LINE>minBtn.setName("MIN");<NEW_LINE>minBtn.addActionListener(this);<NEW_LINE>titleLbl = new JLabel(StringResource.get("TITLE_CONVERT"));<NEW_LINE>titleLbl.setFont(FontResource.getBiggerFont());<NEW_LINE>titleLbl.setForeground(ColorResource.getSelectionColor());<NEW_LINE>titleLbl.setBounds(getScaledInt(25), getScaledInt(15), getScaledInt(250), getScaledInt(30));<NEW_LINE>JLabel lineLbl = new JLabel();<NEW_LINE>lineLbl.<MASK><NEW_LINE>lineLbl.setBounds(0, getScaledInt(55), getScaledInt(400), 2);<NEW_LINE>lineLbl.setOpaque(true);<NEW_LINE>prg = new JProgressBar();<NEW_LINE>prg.setBounds(getScaledInt(20), getScaledInt(85), getScaledInt(350) - getScaledInt(40), getScaledInt(5));<NEW_LINE>statLbl = new JLabel();<NEW_LINE>statLbl.setForeground(Color.WHITE);<NEW_LINE>statLbl.setBounds(getScaledInt(20), getScaledInt(100), getScaledInt(350) - getScaledInt(40), getScaledInt(25));<NEW_LINE>titlePanel.add(titleLbl);<NEW_LINE>titlePanel.add(minBtn);<NEW_LINE>titlePanel.add(closeBtn);<NEW_LINE>add(lineLbl);<NEW_LINE>add(titlePanel);<NEW_LINE>add(prg);<NEW_LINE>add(statLbl);<NEW_LINE>panel = new JPanel(null);<NEW_LINE>panel.setBounds(0, getScaledInt(150), getScaledInt(350), getScaledInt(50));<NEW_LINE>panel.setBackground(Color.DARK_GRAY);<NEW_LINE>btnCN = new CustomButton(StringResource.get("MENU_PAUSE"));<NEW_LINE>btnCN.setBounds(0, 1, getScaledInt(350), getScaledInt(50));<NEW_LINE>btnCN.setName("CLOSE");<NEW_LINE>applyStyle(btnCN);<NEW_LINE>panel.add(btnCN);<NEW_LINE>add(panel);<NEW_LINE>} | setBackground(ColorResource.getSelectionColor()); |
876,889 | public void addOverlays() {<NEW_LINE>super.addOverlays();<NEW_LINE>String cacheDir = getActivity().getApplicationContext().getCacheDir()<MASK><NEW_LINE>mir.init(cacheDir);<NEW_LINE>mMapView.addMapListener(new MapListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onScroll(ScrollEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onScroll " + event.getX() + "," + event.getY());<NEW_LINE>// Toast.makeText(getActivity(), "onScroll", Toast.LENGTH_SHORT).show();<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onZoom(ZoomEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onZoom " + event.getZoomLevel());<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mMapView.getController().setZoom(15f);<NEW_LINE>mMapView.getController().setCenter(new GeoPoint(41.0, -77.0));<NEW_LINE>updateInfo();<NEW_LINE>mMapView.getOverlayManager().add(plotter);<NEW_LINE>} | .getAbsoluteFile().getAbsolutePath(); |
1,736,631 | public static void main(String[] args) {<NEW_LINE>// Instantiate a client that will be used to call the service.<NEW_LINE>TextAnalyticsClient client = new TextAnalyticsClientBuilder().credential(new AzureKeyCredential("{key}")).endpoint("{endpoint}").buildClient();<NEW_LINE>// The texts that need be analyzed.<NEW_LINE>List<TextDocumentInput> documents = Arrays.asList(new TextDocumentInput("A", "The food was delicious and there were wonderful staff.").setLanguage("en"), new TextDocumentInput("B", "The pitot tube is used to measure airspeed.").setLanguage("en"));<NEW_LINE>TextAnalyticsRequestOptions requestOptions = new TextAnalyticsRequestOptions().setIncludeStatistics(true).setModelVersion("latest");<NEW_LINE>// Extracting key phrases for each document in a batch of documents<NEW_LINE>Response<ExtractKeyPhrasesResultCollection> keyPhrasesBatchResultResponse = client.extractKeyPhrasesBatchWithResponse(documents, requestOptions, Context.NONE);<NEW_LINE>// Response's status code<NEW_LINE>System.out.printf("Status code of request response: %d%n", keyPhrasesBatchResultResponse.getStatusCode());<NEW_LINE>ExtractKeyPhrasesResultCollection keyPhrasesBatchResultCollection = keyPhrasesBatchResultResponse.getValue();<NEW_LINE>// Model version<NEW_LINE>System.out.printf("Results of Azure Text Analytics \"Key Phrases Extraction\" Model, version: %s%n", keyPhrasesBatchResultCollection.getModelVersion());<NEW_LINE>// Batch statistics<NEW_LINE><MASK><NEW_LINE>System.out.printf("Documents statistics: document count = %s, erroneous document count = %s, transaction count = %s, valid document count = %s.%n", batchStatistics.getDocumentCount(), batchStatistics.getInvalidDocumentCount(), batchStatistics.getTransactionCount(), batchStatistics.getValidDocumentCount());<NEW_LINE>// Extracted key phrases for each document in a batch of documents<NEW_LINE>AtomicInteger counter = new AtomicInteger();<NEW_LINE>keyPhrasesBatchResultCollection.forEach(extractKeyPhraseResult -> {<NEW_LINE>System.out.printf("%n%s%n", documents.get(counter.getAndIncrement()));<NEW_LINE>if (extractKeyPhraseResult.isError()) {<NEW_LINE>// Erroneous document<NEW_LINE>System.out.printf("Cannot extract key phrases. Error: %s%n", extractKeyPhraseResult.getError().getMessage());<NEW_LINE>} else {<NEW_LINE>// Valid document<NEW_LINE>System.out.println("Extracted phrases:");<NEW_LINE>extractKeyPhraseResult.getKeyPhrases().forEach(keyPhrases -> System.out.printf("\t%s.%n", keyPhrases));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | TextDocumentBatchStatistics batchStatistics = keyPhrasesBatchResultCollection.getStatistics(); |
665,911 | private void addParameterInfo(CompilationUnitRewrite cuRewrite) throws JavaModelException {<NEW_LINE>ITypeBinding typeBinding = Bindings.normalizeForDeclarationUse(fSelectedExpression.resolveTypeBinding(), fSelectedExpression.getAST());<NEW_LINE>String name = fParameterName != null ? fParameterName : guessedParameterName();<NEW_LINE>Expression expression = ASTNodes.getUnparenthesedExpression(fSelectedExpression);<NEW_LINE>ImportRewrite importRewrite = cuRewrite.getImportRewrite();<NEW_LINE>ImportRewriteContext importRewriteContext = new ContextSensitiveImportRewriteContext(fSelectedExpression, importRewrite);<NEW_LINE>String typeName = importRewrite.addImport(typeBinding, importRewriteContext);<NEW_LINE>String defaultValue = null;<NEW_LINE>if (expression instanceof ClassInstanceCreation && typeBinding.isParameterizedType()) {<NEW_LINE>ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) expression;<NEW_LINE>Type cicType = classInstanceCreation.getType();<NEW_LINE>if (cicType instanceof ParameterizedType && ((ParameterizedType) cicType).typeArguments().size() == 0) {<NEW_LINE>// expand the diamond:<NEW_LINE>AST ast = cuRewrite.getAST();<NEW_LINE>Type type = importRewrite.addImport(typeBinding, ast, importRewriteContext);<NEW_LINE>// Should not touch the original AST ...<NEW_LINE>classInstanceCreation.setType(type);<NEW_LINE>Map<String, String> settings = FormatterHandler.getCombinedDefaultFormatterSettings();<NEW_LINE>defaultValue = ASTNodes.asFormattedString(classInstanceCreation, 0, StubUtility.getLineDelimiterUsed(cuRewrite<MASK><NEW_LINE>// ... so let's restore it right away.<NEW_LINE>classInstanceCreation.setType(cicType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (defaultValue == null) {<NEW_LINE>defaultValue = fSourceCU.getBuffer().getText(expression.getStartPosition(), expression.getLength());<NEW_LINE>}<NEW_LINE>fParameter = ParameterInfo.createInfoForAddedParameter(typeBinding, typeName, name, defaultValue);<NEW_LINE>if (fArguments == null) {<NEW_LINE>List<ParameterInfo> parameterInfos = fChangeSignatureProcessor.getParameterInfos();<NEW_LINE>int parametersCount = parameterInfos.size();<NEW_LINE>if (parametersCount > 0 && parameterInfos.get(parametersCount - 1).isOldVarargs()) {<NEW_LINE>parameterInfos.add(parametersCount - 1, fParameter);<NEW_LINE>} else {<NEW_LINE>parameterInfos.add(fParameter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getCu()), settings); |
61,457 | public TableMetadataPersistence.TableMetadata.Builder persistToProto() {<NEW_LINE>TableMetadataPersistence.TableMetadata.Builder builder = TableMetadataPersistence.TableMetadata.newBuilder();<NEW_LINE>builder.setConflictHandler(ConflictHandlers.persistToProto(getConflictHandler()));<NEW_LINE>builder.setRowName(getRowMetadata().persistToProto());<NEW_LINE>builder.setColumns(getColumns().persistToProto());<NEW_LINE>builder.setCachePriority(getCachePriority());<NEW_LINE>builder.setRangeScanAllowed(isRangeScanAllowed());<NEW_LINE>if (getExplicitCompressionBlockSizeKB() != 0) {<NEW_LINE>builder.setExplicitCompressionBlockSizeKiloBytes(getExplicitCompressionBlockSizeKB());<NEW_LINE>}<NEW_LINE>builder.setNegativeLookups(hasNegativeLookups());<NEW_LINE>builder.setSweepStrategy(getSweepStrategy());<NEW_LINE>builder.setAppendHeavyAndReadLight(isAppendHeavyAndReadLight());<NEW_LINE><MASK><NEW_LINE>if (hasDenselyAccessedWideRows()) {<NEW_LINE>builder.setDenselyAccessedWideRows(hasDenselyAccessedWideRows());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | builder.setNameLogSafety(getNameLogSafety()); |
1,456,702 | public static DescribeUserDomainsResponse unmarshall(DescribeUserDomainsResponse describeUserDomainsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeUserDomainsResponse.setRequestId(_ctx.stringValue("DescribeUserDomainsResponse.RequestId"));<NEW_LINE>describeUserDomainsResponse.setPageNumber(_ctx.longValue("DescribeUserDomainsResponse.PageNumber"));<NEW_LINE>describeUserDomainsResponse.setPageSize(_ctx.longValue("DescribeUserDomainsResponse.PageSize"));<NEW_LINE>describeUserDomainsResponse.setTotalCount(_ctx.longValue("DescribeUserDomainsResponse.TotalCount"));<NEW_LINE>List<PageData> domains = new ArrayList<PageData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeUserDomainsResponse.Domains.Length"); i++) {<NEW_LINE>PageData pageData = new PageData();<NEW_LINE>pageData.setDomainName(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].DomainName"));<NEW_LINE>pageData.setCname(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Cname"));<NEW_LINE>pageData.setCdnType(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].CdnType"));<NEW_LINE>pageData.setDomainStatus(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].DomainStatus"));<NEW_LINE>pageData.setGmtCreated(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].GmtCreated"));<NEW_LINE>pageData.setGmtModified(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].GmtModified"));<NEW_LINE>pageData.setDescription(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Description"));<NEW_LINE>pageData.setSslProtocol(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].SslProtocol"));<NEW_LINE>pageData.setResourceGroupId(_ctx.stringValue<MASK><NEW_LINE>pageData.setSandbox(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Sandbox"));<NEW_LINE>pageData.setCoverage(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Coverage"));<NEW_LINE>List<Source> sources = new ArrayList<Source>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources.Length"); j++) {<NEW_LINE>Source source = new Source();<NEW_LINE>source.setType(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources[" + j + "].Type"));<NEW_LINE>source.setContent(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources[" + j + "].Content"));<NEW_LINE>source.setPort(_ctx.integerValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources[" + j + "].Port"));<NEW_LINE>source.setPriority(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources[" + j + "].Priority"));<NEW_LINE>source.setWeight(_ctx.stringValue("DescribeUserDomainsResponse.Domains[" + i + "].Sources[" + j + "].Weight"));<NEW_LINE>sources.add(source);<NEW_LINE>}<NEW_LINE>pageData.setSources(sources);<NEW_LINE>domains.add(pageData);<NEW_LINE>}<NEW_LINE>describeUserDomainsResponse.setDomains(domains);<NEW_LINE>return describeUserDomainsResponse;<NEW_LINE>} | ("DescribeUserDomainsResponse.Domains[" + i + "].ResourceGroupId")); |
225,362 | public void initializeChildBlocks(NDManager manager, DataType dataType, Shape... inputShapes) {<NEW_LINE>super.beforeInitialize(inputShapes);<NEW_LINE>inputNames = Arrays.<MASK><NEW_LINE>Shape[] tokenShape = { inputShapes[0] };<NEW_LINE>Shape[] typeShape = { inputShapes[1] };<NEW_LINE>this.tokenEmbedding.initialize(manager, dataType, tokenShape);<NEW_LINE>Shape[] embeddingOutput = this.tokenEmbedding.getOutputShapes(tokenShape);<NEW_LINE>this.typeEmbedding.initialize(manager, dataType, typeShape);<NEW_LINE>this.embeddingNorm.initialize(manager, dataType, embeddingOutput);<NEW_LINE>this.embeddingDropout.initialize(manager, dataType, embeddingOutput);<NEW_LINE>for (final TransformerEncoderBlock tb : transformerEncoderBlocks) {<NEW_LINE>tb.initialize(manager, dataType, embeddingOutput);<NEW_LINE>}<NEW_LINE>long batchSize = inputShapes[0].get(0);<NEW_LINE>this.pooling.initialize(manager, dataType, new Shape(batchSize, embeddingSize));<NEW_LINE>} | asList("tokenIds", "typeIds", "masks"); |
1,724,889 | protected void paintClientArea(final Graphics graphics) {<NEW_LINE>// Don't do anything when hidden<NEW_LINE>if (!isVisible())<NEW_LINE>return;<NEW_LINE>super.paintClientArea(graphics);<NEW_LINE>// graphics.pushState();<NEW_LINE>graphics.setFont(titleFont);<NEW_LINE>final Dimension titleSize = FigureUtilities.getTextExtents(title, titleFont);<NEW_LINE>if (isHorizontal()) {<NEW_LINE>if (getTickLablesSide() == LabelSide.Primary)<NEW_LINE>graphics.drawText(title, bounds.x + bounds.width / 2 - titleSize.width / 2, bounds.y + bounds.height - titleSize.height);<NEW_LINE>else<NEW_LINE>graphics.drawText(title, bounds.x + bounds.width / 2 - titleSize.<MASK><NEW_LINE>} else {<NEW_LINE>final int w = titleSize.height;<NEW_LINE>final int h = titleSize.width + 1;<NEW_LINE>if (getTickLablesSide() == LabelSide.Primary) {<NEW_LINE>GraphicsUtil.drawVerticalText(graphics, title, bounds.x, bounds.y + bounds.height / 2 - h / 2, false);<NEW_LINE>} else {<NEW_LINE>GraphicsUtil.drawVerticalText(graphics, title, bounds.x + bounds.width - w, bounds.y + bounds.height / 2 - h / 2, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// graphics.popState();<NEW_LINE>// Show the start/end cursor or the 'rubberband' of a zoom operation?<NEW_LINE>if (armed && end != null && start != null) {<NEW_LINE>switch(zoomType) {<NEW_LINE>case RUBBERBAND_ZOOM:<NEW_LINE>case HORIZONTAL_ZOOM:<NEW_LINE>case VERTICAL_ZOOM:<NEW_LINE>graphics.setLineStyle(SWTConstants.LINE_DOT);<NEW_LINE>graphics.setLineWidth(1);<NEW_LINE>graphics.setForegroundColor(revertBackColor);<NEW_LINE>graphics.drawRectangle(start.x, start.y, end.x - start.x - 1, end.y - start.y - 1);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | width / 2, bounds.y); |
999,666 | public void put(long ledgerId, long entryId, ByteBuf entry) {<NEW_LINE>int entrySize = entry.readableBytes();<NEW_LINE>int alignedSize = align64(entrySize);<NEW_LINE>lock.readLock().lock();<NEW_LINE>try {<NEW_LINE>if (entrySize > segmentSize) {<NEW_LINE>log.warn("entrySize {} > segmentSize {}, skip update read cache!", entrySize, segmentSize);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int offset = currentSegmentOffset.getAndAdd(alignedSize);<NEW_LINE>if (offset + entrySize > segmentSize) {<NEW_LINE>// Roll-over the segment (outside the read-lock)<NEW_LINE>} else {<NEW_LINE>// Copy entry into read cache segment<NEW_LINE>cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes());<NEW_LINE>cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.readLock().unlock();<NEW_LINE>}<NEW_LINE>// We could not insert in segment, we to get the write lock and roll-over to<NEW_LINE>// next segment<NEW_LINE>lock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>int offset = currentSegmentOffset.getAndAdd(entrySize);<NEW_LINE>if (offset + entrySize > segmentSize) {<NEW_LINE>// Rollover to next segment<NEW_LINE>currentSegmentIdx = (currentSegmentIdx + 1) % cacheSegments.size();<NEW_LINE>currentSegmentOffset.set(alignedSize);<NEW_LINE>cacheIndexes.get(currentSegmentIdx).clear();<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>// Copy entry into read cache segment<NEW_LINE>cacheSegments.get(currentSegmentIdx).setBytes(offset, entry, entry.readerIndex(), entry.readableBytes());<NEW_LINE>cacheIndexes.get(currentSegmentIdx).put(ledgerId, entryId, offset, entrySize);<NEW_LINE>} finally {<NEW_LINE>lock<MASK><NEW_LINE>}<NEW_LINE>} | .writeLock().unlock(); |
506,164 | public static void main(String[] args) {<NEW_LINE>if (args.length != 4) {<NEW_LINE>System.out.println("Usage: java com.dotcms.cli.security.TrustStoreImportKey truststore truststore_password alias certfile ");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>String keypass = args[1];<NEW_LINE>String alias = args[2];<NEW_LINE>String truststorename = args[0];<NEW_LINE>if (truststorename == null) {<NEW_LINE>System.out.println("Error: you must pass the truststorename file");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>String certfile = args[3];<NEW_LINE>try {<NEW_LINE>KeyStore ks = KeyStore.getInstance("JKS", "SUN");<NEW_LINE>System.out.println("Using truststore-file : " + truststorename);<NEW_LINE>ks.load(Files.newInputStream(Paths.get(truststorename)), keypass.toCharArray());<NEW_LINE>// loading CertificateChain<NEW_LINE>CertificateFactory cf = CertificateFactory.getInstance("X.509");<NEW_LINE>InputStream certstream = fullStream(certfile);<NEW_LINE>Collection c = cf.generateCertificates(certstream);<NEW_LINE>Certificate[] certs = new Certificate[<MASK><NEW_LINE>if (c.size() == 1) {<NEW_LINE>certstream = fullStream(certfile);<NEW_LINE>System.out.println("One certificate, no chain.");<NEW_LINE>Certificate cert = cf.generateCertificate(certstream);<NEW_LINE>certs[0] = cert;<NEW_LINE>}<NEW_LINE>ks.setCertificateEntry(alias, certs[0]);<NEW_LINE>System.out.println("Certificate stored.");<NEW_LINE>System.out.println("Alias:" + alias + " Password:" + keypass);<NEW_LINE>ks.store(Files.newOutputStream(Paths.get(truststorename)), keypass.toCharArray());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} | c.toArray().length]; |
33,900 | public List<Datastream> findGroup(@Context PagingContext pagingContext, @QueryParam("datastreamName") String datastreamName) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, FINDER_CALL, 1);<NEW_LINE>Datastream datastream = _store.getDatastream(datastreamName);<NEW_LINE>if (datastream == null) {<NEW_LINE>_errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_404_NOT_FOUND, "Datastream not found: " + datastreamName);<NEW_LINE>}<NEW_LINE>List<Datastream> ret = RestliUtils.withPaging(getGroupedDatastreams(datastream).stream(), pagingContext).filter(Objects::nonNull).collect(Collectors.toList());<NEW_LINE>LOG.debug("Result collected for findDuplicates: {}", ret);<NEW_LINE>return ret;<NEW_LINE>} catch (Exception e) {<NEW_LINE>_dynamicMetricsManager.createOrUpdateMeter(CLASS_NAME, CALL_ERROR, 1);<NEW_LINE>_errorLogger.logAndThrowRestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "Call findDuplicates failed.", e);<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>} | LOG.info("findDuplicates called with paging context {}", pagingContext); |
389,663 | final DescribeEventsResult executeDescribeEvents(DescribeEventsRequest describeEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEventsRequest> request = null;<NEW_LINE>Response<DescribeEventsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeEventsRequestMarshaller().marshall(super.beforeMarshalling(describeEventsRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeEventsResult> responseHandler = new StaxResponseHandler<DescribeEventsResult>(new DescribeEventsResultStaxUnmarshaller());<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); |
1,541,647 | public void afterExitScope(NodeTraversal t, ReferenceMap referenceMap) {<NEW_LINE>// Check all vars after finishing a scope<NEW_LINE>Scope scope = t.getScope();<NEW_LINE>if (scope.isFunctionBlockScope()) {<NEW_LINE>varsInFunctionBody.clear();<NEW_LINE>for (Var v : scope.getVarIterable()) {<NEW_LINE>varsInFunctionBody.add(v.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Var v : scope.getVarIterable()) {<NEW_LINE>ReferenceCollection <MASK><NEW_LINE>// TODO(moz): Figure out why this could be null<NEW_LINE>if (referenceCollection != null) {<NEW_LINE>if (scope.getRootNode().isFunction() && v.isDefaultParam()) {<NEW_LINE>checkDefaultParam(v, scope, varsInFunctionBody);<NEW_LINE>}<NEW_LINE>if (scope.getRootNode().isFunction()) {<NEW_LINE>checkShadowParam(v, scope, referenceCollection.references);<NEW_LINE>}<NEW_LINE>checkVar(v, referenceCollection.references);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scope.hasOwnImplicitSlot(ImplicitVar.EXPORTS)) {<NEW_LINE>checkGoogModuleExports(scope.makeImplicitVar(ImplicitVar.EXPORTS), referenceMap);<NEW_LINE>}<NEW_LINE>} | referenceCollection = referenceMap.getReferences(v); |
530,552 | private static List<Execution> createExecutions(List<Event> events) {<NEW_LINE>List<Execution> executions = new ArrayList<>();<NEW_LINE>Map<TestDescriptor, Instant> <MASK><NEW_LINE>for (Event event : events) {<NEW_LINE>switch(event.getType()) {<NEW_LINE>case STARTED:<NEW_LINE>{<NEW_LINE>executionStarts.put(event.getTestDescriptor(), event.getTimestamp());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SKIPPED:<NEW_LINE>{<NEW_LINE>// Based on the Javadoc for EngineExecutionListener.executionSkipped(...),<NEW_LINE>// a skipped descriptor must never be reported as started or finished,<NEW_LINE>// but just in case a TestEngine does not adhere to that contract, we<NEW_LINE>// make an attempt to remove any tracked "started" event.<NEW_LINE>executionStarts.remove(event.getTestDescriptor());<NEW_LINE>// Use the same timestamp for both the start and end Instant values.<NEW_LINE>Instant timestamp = event.getTimestamp();<NEW_LINE>Execution skippedEvent = Execution.skipped(event.getTestDescriptor(), timestamp, timestamp, event.getRequiredPayload(String.class));<NEW_LINE>executions.add(skippedEvent);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case FINISHED:<NEW_LINE>{<NEW_LINE>Instant startInstant = executionStarts.remove(event.getTestDescriptor());<NEW_LINE>Instant endInstant = event.getTimestamp();<NEW_LINE>// If "started" events have already been filtered out, it is no<NEW_LINE>// longer possible to create a legitimate Execution for the current<NEW_LINE>// descriptor. So we effectively ignore it in that case.<NEW_LINE>if (startInstant != null) {<NEW_LINE>Execution finishedEvent = Execution.finished(event.getTestDescriptor(), startInstant, endInstant, event.getRequiredPayload(TestExecutionResult.class));<NEW_LINE>executions.add(finishedEvent);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>// Ignore other events<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return executions;<NEW_LINE>} | executionStarts = new HashMap<>(); |
1,613,538 | public void updateUser(String username, User body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/user/{username}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> localVarFormParams = new HashMap<String, String>();<NEW_LINE>String[] localVarContentTypes = {};<NEW_LINE>String localVarContentType = localVarContentTypes.length > <MASK><NEW_LINE>if (localVarContentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>localVarPostBody = localVarBuilder.build();<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | 0 ? localVarContentTypes[0] : "application/json"; |
122,584 | static org.batfish.datamodel.ospf.OspfNetworkType toOspfNetworkType(@Nullable OspfNetworkType type, Warnings warnings) {<NEW_LINE>if (type == null) {<NEW_LINE>// default is broadcast for all Ethernet interfaces<NEW_LINE>// (https://learningnetwork.cisco_xr.com/thread/66827)<NEW_LINE>return org.batfish.datamodel.ospf.OspfNetworkType.BROADCAST;<NEW_LINE>}<NEW_LINE>switch(type) {<NEW_LINE>case BROADCAST:<NEW_LINE>return org.batfish.datamodel.ospf.OspfNetworkType.BROADCAST;<NEW_LINE>case POINT_TO_POINT:<NEW_LINE>return org.batfish.datamodel.ospf.OspfNetworkType.POINT_TO_POINT;<NEW_LINE>case NON_BROADCAST:<NEW_LINE>return org.batfish.datamodel.ospf.OspfNetworkType.NON_BROADCAST_MULTI_ACCESS;<NEW_LINE>case POINT_TO_MULTIPOINT:<NEW_LINE>return org.batfish<MASK><NEW_LINE>default:<NEW_LINE>warnings.redFlag(String.format("Conversion of CiscoXr OSPF network type '%s' is not handled.", type));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | .datamodel.ospf.OspfNetworkType.POINT_TO_MULTIPOINT; |
1,588,771 | public ApiResponse<File> favoritesUpdateWithHttpInfo(String id, UpdateFavoriteRequest updateFavoriteRequest) throws ApiException {<NEW_LINE>Object localVarPostBody = updateFavoriteRequest;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling favoritesUpdate");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'updateFavoriteRequest' is set<NEW_LINE>if (updateFavoriteRequest == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'updateFavoriteRequest' when calling favoritesUpdate");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/favorites/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "text/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<File> localVarReturnType = new GenericType<File>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | = new ArrayList<Pair>(); |
80,987 | private void insertUniqueItem(String item) {<NEW_LINE>item = item.trim(<MASK><NEW_LINE>// Pattern to match <space><literal string><space OR end of line><NEW_LINE>// i.e. to check if a word is present in the line<NEW_LINE>final Pattern pattern = Pattern.compile(String.format("\\s\\Q%s\\E(:?\\s|$)", item));<NEW_LINE>final String lines = StringUtils.getSelectedLines(_hlEditor);<NEW_LINE>// Multiline or setting<NEW_LINE>if (lines.contains("\n") || _appSettings.isTodoAppendProConOnEndEnabled()) {<NEW_LINE>// Replace existing item with itself. i.e. do nothing<NEW_LINE>runRegexReplaceAction(// Append to end<NEW_LINE>new ReplacePattern(pattern, "$0"), new ReplacePattern("\\s*$", " " + item));<NEW_LINE>} else if (!pattern.matcher(lines).find()) {<NEW_LINE>insertInline(item);<NEW_LINE>}<NEW_LINE>} | ).replace(" ", "_"); |
1,327,848 | private List<Wo> list(Business business, Wi wi, List<Identity> identityList) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (StringUtils.isBlank(wi.getKey()) && (ListTools.isEmpty(wi.getUnitList()) || ListTools.isEmpty(identityList))) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Person.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Person> root = cq.from(Person.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (StringUtils.isNotBlank(wi.getKey())) {<NEW_LINE>String str = StringUtils.lowerCase(StringTools.escapeSqlLikeKey(wi.getKey()));<NEW_LINE>p = cb.like(cb.lower(root.get(Person_.name)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR);<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.unique)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.mobile)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.distinguishedName)), str <MASK><NEW_LINE>}<NEW_LINE>Map<String, Integer> map = new HashMap<>();<NEW_LINE>if (ListTools.isNotEmpty(identityList)) {<NEW_LINE>for (Identity identity : identityList) {<NEW_LINE>map.put(identity.getPerson(), identity.getOrderNumber());<NEW_LINE>}<NEW_LINE>p = cb.and(p, cb.isMember(root.get(Person_.id), cb.literal(map.keySet())));<NEW_LINE>}<NEW_LINE>List<String> list = em.createQuery(cq.select(root.get(Person_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>for (Person o : business.person().pick(list)) {<NEW_LINE>if (!map.isEmpty()) {<NEW_LINE>o.setOrderNumber(map.get(o.getId()));<NEW_LINE>}<NEW_LINE>wos.add(this.convert(business, o, Wo.class));<NEW_LINE>}<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Comparator.comparing(Wo::getName, Comparator.nullsFirst(String::compareTo)).reversed())).collect(Collectors.toList());<NEW_LINE>return wos;<NEW_LINE>} | + "%", StringTools.SQL_ESCAPE_CHAR)); |
281,525 | protected String doIt() throws Exception {<NEW_LINE>String[] tables = new String[] { "AD_Window_Access", "AD_Process_Access", "AD_Form_Access", "AD_Workflow_Access", "AD_Task_Access", "AD_Document_Action_Access", X_AD_Role_Included.Table_Name };<NEW_LINE>String[] keycolumns = new String[] { "AD_Window_ID", "AD_Process_ID", "AD_Form_ID", "AD_Workflow_ID", "AD_Task_ID", "C_DocType_ID, AD_Ref_List_ID", X_AD_Role_Included.COLUMNNAME_Included_Role_ID };<NEW_LINE>int action = 0;<NEW_LINE>for (int i = 0; i < tables.length; i++) {<NEW_LINE>String table = tables[i];<NEW_LINE>String keycolumn = keycolumns[i];<NEW_LINE>String sql = "DELETE FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_To;<NEW_LINE>int no = DB.executeUpdateEx(sql, get_TrxName());<NEW_LINE>addLog(action++, null, BigDecimal.valueOf<MASK><NEW_LINE>final boolean column_IsReadWrite = !table.equals("AD_Document_Action_Access") && !table.equals(X_AD_Role_Included.Table_Name);<NEW_LINE>final boolean column_SeqNo = table.equals(X_AD_Role_Included.Table_Name);<NEW_LINE>sql = "INSERT INTO " + table + " (AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, " + "AD_Role_ID, " + keycolumn + ", isActive";<NEW_LINE>if (column_SeqNo)<NEW_LINE>sql += ", SeqNo ";<NEW_LINE>if (column_IsReadWrite)<NEW_LINE>sql += ", isReadWrite) ";<NEW_LINE>else<NEW_LINE>sql += ") ";<NEW_LINE>sql += "SELECT " + m_AD_Client_ID + ", " + m_AD_Org_ID + ", getdate(), " + Env.getAD_User_ID(Env.getCtx()) + ", getdate(), " + Env.getAD_User_ID(Env.getCtx()) + ", " + m_AD_Role_ID_To + ", " + keycolumn + ", IsActive ";<NEW_LINE>if (column_SeqNo)<NEW_LINE>sql += ", SeqNo ";<NEW_LINE>if (column_IsReadWrite)<NEW_LINE>sql += ", isReadWrite ";<NEW_LINE>sql += "FROM " + table + " WHERE AD_Role_ID = " + m_AD_Role_ID_From;<NEW_LINE>no = DB.executeUpdateEx(sql, get_TrxName());<NEW_LINE>addLog(action++, null, new BigDecimal(no), "New records inserted into " + table);<NEW_LINE>}<NEW_LINE>return "Role copied";<NEW_LINE>} | (no), "Old records deleted from " + table); |
64,513 | static FileObject[] listSavedHeapdumps(File directory) {<NEW_LINE>try {<NEW_LINE>FileObject snapshotsFolder = null;<NEW_LINE>if (directory != null) {<NEW_LINE>snapshotsFolder = FileUtil.toFileObject(directory);<NEW_LINE>} else {<NEW_LINE>snapshotsFolder = ProfilerStorage.getGlobalFolder(false);<NEW_LINE>}<NEW_LINE>if (snapshotsFolder == null) {<NEW_LINE>return new FileObject[0];<NEW_LINE>}<NEW_LINE>snapshotsFolder.refresh();<NEW_LINE>FileObject[] children = snapshotsFolder.getChildren();<NEW_LINE>ArrayList /*<FileObject>*/<NEW_LINE>files = new ArrayList();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>FileObject child = children[i];<NEW_LINE>if (checkHprofFile(FileUtil.toFile(children[i])))<NEW_LINE>files.add(child);<NEW_LINE>}<NEW_LINE>Collections.sort(files, new Comparator() {<NEW_LINE><NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>FileObject f1 = (FileObject) o1;<NEW_LINE>FileObject f2 = (FileObject) o2;<NEW_LINE>return f1.getName().compareTo(f2.getName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return (FileObject[]) files.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>// LOGGER.log(Level.SEVERE, Bundle.ResultsManager_ObtainSavedSnapshotsFailedMsg(e.getMessage()), e);<NEW_LINE>return new FileObject[0];<NEW_LINE>}<NEW_LINE>} | toArray(new FileObject[0]); |
665,542 | public void eval(DenseMatrix data, DenseMatrix output) {<NEW_LINE>int batchSize = data.numRows();<NEW_LINE>for (int ibatch = 0; ibatch < batchSize; ibatch++) {<NEW_LINE>double max = -Double.MAX_VALUE;<NEW_LINE>for (int i = 0; i < data.numCols(); i++) {<NEW_LINE>double v = data.get(ibatch, i);<NEW_LINE>if (v > max) {<NEW_LINE>max = v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double sum = 0.;<NEW_LINE>for (int i = 0; i < data.numCols(); i++) {<NEW_LINE>double res = Math.exp(data.get(ibatch, i) - max);<NEW_LINE>output.set(ibatch, i, res);<NEW_LINE>sum += res;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < data.numCols(); i++) {<NEW_LINE>double v = <MASK><NEW_LINE>output.set(ibatch, i, v / sum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | output.get(ibatch, i); |
1,831,189 | public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) {<NEW_LINE>if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0)<NEW_LINE>return;<NEW_LINE>// if method from parameterized type got found, use the original method at codegen time<NEW_LINE>MethodBinding codegenBinding = this.binding.original();<NEW_LINE>if (this.binding.isPrivate()) {<NEW_LINE>boolean useNesting = currentScope.enclosingSourceType().isNestmateOf(codegenBinding.declaringClass) && !(this.receiver instanceof QualifiedSuperReference);<NEW_LINE>// depth is set for both implicit and explicit access (see MethodBinding#canBeSeenBy)<NEW_LINE>if (!useNesting && TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass)) {<NEW_LINE>this.syntheticAccessor = ((SourceTypeBinding) codegenBinding.declaringClass).addSyntheticMethod(codegenBinding, false);<NEW_LINE>currentScope.problemReporter(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (this.receiver instanceof QualifiedSuperReference) {<NEW_LINE>// qualified super<NEW_LINE>if (this.actualReceiverType.isInterface())<NEW_LINE>// invoking an overridden default method, which is accessible/public by definition<NEW_LINE>return;<NEW_LINE>// qualified super need emulation always<NEW_LINE>SourceTypeBinding destinationType = (SourceTypeBinding) (((QualifiedSuperReference) this.receiver).currentCompatibleType);<NEW_LINE>this.syntheticAccessor = destinationType.addSyntheticMethod(codegenBinding, isSuperAccess());<NEW_LINE>currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this);<NEW_LINE>return;<NEW_LINE>} else if (this.binding.isProtected()) {<NEW_LINE>SourceTypeBinding enclosingSourceType;<NEW_LINE>if (((this.bits & ASTNode.DepthMASK) != 0) && codegenBinding.declaringClass.getPackage() != (enclosingSourceType = currentScope.enclosingSourceType()).getPackage()) {<NEW_LINE>SourceTypeBinding currentCompatibleType = (SourceTypeBinding) enclosingSourceType.enclosingTypeAt((this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT);<NEW_LINE>this.syntheticAccessor = currentCompatibleType.addSyntheticMethod(codegenBinding, isSuperAccess());<NEW_LINE>currentScope.problemReporter().needToEmulateMethodAccess(codegenBinding, this);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).needToEmulateMethodAccess(codegenBinding, this); |
1,376,837 | public Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {<NEW_LINE>String param = exchange.getAttribute(Constants.PARAM_TRANSFORM);<NEW_LINE>ShenyuContext shenyuContext = exchange.getAttribute(Constants.CONTEXT);<NEW_LINE>assert shenyuContext != null;<NEW_LINE>MetaData metaData = exchange.getAttribute(Constants.META_DATA);<NEW_LINE>if (!checkMetaData(metaData)) {<NEW_LINE>LOG.error(" path is : {}, meta data have error : {}", shenyuContext.getPath(), metaData);<NEW_LINE>exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.META_DATA_ERROR, null);<NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>if (Objects.nonNull(metaData) && StringUtils.isNoneBlank(metaData.getParameterTypes()) && StringUtils.isBlank(param)) {<NEW_LINE>exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.DUBBO_HAVE_BODY_PARAM, null);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>this.rpcContext(exchange);<NEW_LINE>return this.doDubboInvoker(exchange, chain, selector, rule, metaData, param);<NEW_LINE>} | WebFluxResultUtils.result(exchange, error); |
1,372,915 | public void addJvmMData(MNode mNode, List<MData> mDatas) {<NEW_LINE>int size = mDatas.size();<NEW_LINE>List<JVMGCDataPo> jvmGCDataPos = new ArrayList<JVMGCDataPo>(size);<NEW_LINE>List<JVMMemoryDataPo> jvmMemoryDataPos = new ArrayList<JVMMemoryDataPo>(size);<NEW_LINE>List<JVMThreadDataPo> jvmThreadDataPos = new ArrayList<JVMThreadDataPo>(size);<NEW_LINE>for (MData mData : mDatas) {<NEW_LINE>JvmMData JVMMData = mData.getJvmMData();<NEW_LINE>Long timestamp = mData.getTimestamp();<NEW_LINE>// gc<NEW_LINE>JVMGCDataPo jvmgcDataPo = getDataPo(JVMMData.getGcMap(), JVMGCDataPo.class, mNode, timestamp);<NEW_LINE>jvmGCDataPos.add(jvmgcDataPo);<NEW_LINE>// memory<NEW_LINE>JVMMemoryDataPo jvmMemoryDataPo = getDataPo(JVMMData.getMemoryMap(), JVMMemoryDataPo.class, mNode, timestamp);<NEW_LINE>jvmMemoryDataPos.add(jvmMemoryDataPo);<NEW_LINE>// thread<NEW_LINE>JVMThreadDataPo jvmThreadDataPo = getDataPo(JVMMData.getThreadMap(), JVMThreadDataPo.class, mNode, timestamp);<NEW_LINE>jvmThreadDataPos.add(jvmThreadDataPo);<NEW_LINE>}<NEW_LINE>appContext.getJvmGCAccess().insert(jvmGCDataPos);<NEW_LINE>appContext.<MASK><NEW_LINE>appContext.getJvmThreadAccess().insert(jvmThreadDataPos);<NEW_LINE>} | getJvmMemoryAccess().insert(jvmMemoryDataPos); |
1,658,579 | static void enumerate(HMONITOR hMonitor) {<NEW_LINE>System.out.println("Found HMONITOR: " + hMonitor.getPointer().toString());<NEW_LINE>MONITORINFOEX info = new MONITORINFOEX();<NEW_LINE>User32.INSTANCE.GetMonitorInfo(hMonitor, info);<NEW_LINE>System.out.println("Screen " + info.rcMonitor);<NEW_LINE>System.out.<MASK><NEW_LINE>boolean isPrimary = (info.dwFlags & WinUser.MONITORINFOF_PRIMARY) != 0;<NEW_LINE>System.out.println("Primary? " + (isPrimary ? "yes" : "no"));<NEW_LINE>System.out.println("Device " + new String(info.szDevice));<NEW_LINE>DWORDByReference pdwNumberOfPhysicalMonitors = new DWORDByReference();<NEW_LINE>Dxva2.INSTANCE.GetNumberOfPhysicalMonitorsFromHMONITOR(hMonitor, pdwNumberOfPhysicalMonitors);<NEW_LINE>int monitorCount = pdwNumberOfPhysicalMonitors.getValue().intValue();<NEW_LINE>System.out.println("HMONITOR is linked to " + monitorCount + " physical monitors");<NEW_LINE>PHYSICAL_MONITOR[] physMons = new PHYSICAL_MONITOR[monitorCount];<NEW_LINE>Dxva2.INSTANCE.GetPhysicalMonitorsFromHMONITOR(hMonitor, monitorCount, physMons);<NEW_LINE>for (int i = 0; i < monitorCount; i++) {<NEW_LINE>HANDLE hPhysicalMonitor = physMons[0].hPhysicalMonitor;<NEW_LINE>System.out.println("Monitor " + i + " - " + new String(physMons[i].szPhysicalMonitorDescription));<NEW_LINE>enumeratePhysicalMonitor(hPhysicalMonitor);<NEW_LINE>}<NEW_LINE>Dxva2.INSTANCE.DestroyPhysicalMonitors(monitorCount, physMons);<NEW_LINE>} | println("Work area " + info.rcWork); |
620,087 | public void tableDataSourceChanged(Object newDataSource) {<NEW_LINE>if (newDataSource instanceof Tag[]) {<NEW_LINE>// neverShowCatButtons = true;<NEW_LINE>setCurrentTags((Tag[]) newDataSource);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newDataSource instanceof Object[]) {<NEW_LINE>Object[] datasources = ((Object[]) newDataSource);<NEW_LINE>Object firstDS = datasources.length > 0 ? datasources[0] : null;<NEW_LINE>if (firstDS instanceof Tag) {<NEW_LINE>Tag[] tags = new Tag[datasources.length];<NEW_LINE>System.arraycopy(datasources, 0, tags, 0, datasources.length);<NEW_LINE>setCurrentTags(tags);<NEW_LINE>return;<NEW_LINE>} else if (firstDS instanceof TagWrapper) {<NEW_LINE>Set<Tag> <MASK><NEW_LINE>for (Object o : datasources) {<NEW_LINE>tags.add(((TagWrapper) o).getTag());<NEW_LINE>}<NEW_LINE>setCurrentTags(tags.toArray(new Tag[0]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newDataSource instanceof Tag) {<NEW_LINE>// neverShowCatButtons = true;<NEW_LINE>// neverShowTagButtons = true;<NEW_LINE>Tag[] tag = new Tag[] { (Tag) newDataSource };<NEW_LINE>hiddenTags = new HashSet<>(Arrays.asList(tag));<NEW_LINE>setCurrentTags(tag);<NEW_LINE>}<NEW_LINE>if (newDataSource instanceof TagGroup) {<NEW_LINE>// neverShowCatButtons = true;<NEW_LINE>TagGroup tg = (TagGroup) newDataSource;<NEW_LINE>setCurrentTagGroup(tg);<NEW_LINE>tg.addListener(new TagGroupListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void tagRemoved(TagGroup group, Tag tag) {<NEW_LINE>setCurrentTagGroup(tg);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void tagAdded(TagGroup group, Tag tag) {<NEW_LINE>setCurrentTagGroup(tg);<NEW_LINE>}<NEW_LINE>}, false);<NEW_LINE>}<NEW_LINE>if (newDataSource == null && isEmptyListOnNullDS) {<NEW_LINE>setCurrentTags(new Tag[] {});<NEW_LINE>}<NEW_LINE>} | tags = new HashSet<>(); |
609,225 | public void initialize(ApplicationInfo appInfo, Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context) {<NEW_LINE>if (appInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>appRegistry.<MASK><NEW_LINE>final ActionReport report = context.getActionReport();<NEW_LINE>ProgressTracker tracker = context.getTransientAppMetaData(ExtendedDeploymentContext.TRACKER, ProgressTracker.class);<NEW_LINE>StructuredDeploymentTracing tracing = StructuredDeploymentTracing.load(context);<NEW_LINE>// now were falling back into the mainstream loading/starting sequence, at this<NEW_LINE>// time the containers are set up, all the modules have been prepared in their<NEW_LINE>// associated engines and the application info is created and registered<NEW_LINE>if (loadOnCurrentInstance(context)) {<NEW_LINE>try (SpanSequence span = tracing.startSequence(DeploymentTracing.AppStage.INITIALIZE)) {<NEW_LINE>notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.START, context);<NEW_LINE>appInfo.initialize();<NEW_LINE>appInfo.getModuleInfos().forEach(moduleInfo -> moduleInfo.getEngineRefs().forEach(engineRef -> tracker.add("initialized", EngineRef.class, engineRef)));<NEW_LINE>span.start(DeploymentTracing.AppStage.START);<NEW_LINE>appInfo.start(context, tracker);<NEW_LINE>notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.START, context);<NEW_LINE>} catch (Throwable loadException) {<NEW_LINE>logger.log(SEVERE, KernelLoggerInfo.lifecycleException, loadException);<NEW_LINE>report.failure(logger, "Exception while loading the app", null);<NEW_LINE>report.setFailureCause(loadException);<NEW_LINE>tracker.actOn(logger);<NEW_LINE>} finally {<NEW_LINE>context.postDeployClean(false);<NEW_LINE>if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE) {<NEW_LINE>// warning status code is not a failure<NEW_LINE>events.send(new Event<>(Deployment.DEPLOYMENT_FAILURE, context));<NEW_LINE>} else {<NEW_LINE>events.send(new Event<>(Deployment.DEPLOYMENT_SUCCESS, appInfo));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentDeploymentContext.get().pop();<NEW_LINE>}<NEW_LINE>} | removeTransient(appInfo.getName()); |
446,824 | protected void receiveTunnelInbound(DHTTransportUDPContact originator, Map data) {<NEW_LINE>log("Received tunnel inbound message from " + originator.getString());<NEW_LINE>try {<NEW_LINE>punch_mon.enter();<NEW_LINE>for (int i = 0; i < oustanding_punches.size(); i++) {<NEW_LINE>Object[] wait_data = (Object[]) oustanding_punches.get(i);<NEW_LINE>DHTTransportContact wait_contact = (DHTTransportContact) wait_data[0];<NEW_LINE>if (originator.getAddress().getAddress().equals(wait_contact.getAddress().getAddress())) {<NEW_LINE>wait_data[2] = new Integer(originator.getTransportAddress().getPort());<NEW_LINE>((AESemaphore) wait_data<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>punch_mon.exit();<NEW_LINE>}<NEW_LINE>} | [1]).release(); |
1,103,186 | protected void doNegatedPropertySet(P_NegPropSet pathNotOneOf, Node node, Collection<Node> output) {<NEW_LINE>List<Node> fwdSteps = pathNotOneOf.getFwdNodes();<NEW_LINE>List<Node> bwkSteps = pathNotOneOf.getBwdNodes();<NEW_LINE>// Flip lists processed - flips calls of stepExcludeForwards/stepExcludeBackwards<NEW_LINE>if (!forwardMode) {<NEW_LINE>List<Node> tmp = fwdSteps;<NEW_LINE>fwdSteps = bwkSteps;<NEW_LINE>bwkSteps = tmp;<NEW_LINE>}<NEW_LINE>if (fwdSteps.size() > 0) {<NEW_LINE>Iterator<Node> nodes1 = stepExcludeForwards(node, fwdSteps);<NEW_LINE>fill(nodes1, output);<NEW_LINE>}<NEW_LINE>if (bwkSteps.size() > 0) {<NEW_LINE>Iterator<Node> <MASK><NEW_LINE>fill(nodes2, output);<NEW_LINE>}<NEW_LINE>} | nodes2 = stepExcludeBackwards(node, bwkSteps); |
693,469 | final CreateOpenIDConnectProviderResult executeCreateOpenIDConnectProvider(CreateOpenIDConnectProviderRequest createOpenIDConnectProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOpenIDConnectProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOpenIDConnectProviderRequest> request = null;<NEW_LINE>Response<CreateOpenIDConnectProviderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateOpenIDConnectProviderRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOpenIDConnectProvider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateOpenIDConnectProviderResult> responseHandler = new StaxResponseHandler<CreateOpenIDConnectProviderResult>(new CreateOpenIDConnectProviderResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(createOpenIDConnectProviderRequest)); |
1,058,457 | public static ListMappCenterWorkspacesResponse unmarshall(ListMappCenterWorkspacesResponse listMappCenterWorkspacesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMappCenterWorkspacesResponse.setRequestId(_ctx.stringValue("ListMappCenterWorkspacesResponse.RequestId"));<NEW_LINE>listMappCenterWorkspacesResponse.setResultMessage(_ctx.stringValue("ListMappCenterWorkspacesResponse.ResultMessage"));<NEW_LINE>listMappCenterWorkspacesResponse.setResultCode(_ctx.stringValue("ListMappCenterWorkspacesResponse.ResultCode"));<NEW_LINE>ListMappCenterWorkspaceResult listMappCenterWorkspaceResult = new ListMappCenterWorkspaceResult();<NEW_LINE>listMappCenterWorkspaceResult.setSuccess(_ctx.booleanValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.Success"));<NEW_LINE>listMappCenterWorkspaceResult.setResultMsg(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.ResultMsg"));<NEW_LINE>listMappCenterWorkspaceResult.setUserId(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.UserId"));<NEW_LINE>List<MappCenterWorkspaceListItem> mappCenterWorkspaceList = new ArrayList<MappCenterWorkspaceListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList.Length"); i++) {<NEW_LINE>MappCenterWorkspaceListItem mappCenterWorkspaceListItem = new MappCenterWorkspaceListItem();<NEW_LINE>mappCenterWorkspaceListItem.setDisplayName(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].DisplayName"));<NEW_LINE>mappCenterWorkspaceListItem.setStatus(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Status"));<NEW_LINE>mappCenterWorkspaceListItem.setType(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Type"));<NEW_LINE>mappCenterWorkspaceListItem.setZones(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Zones"));<NEW_LINE>mappCenterWorkspaceListItem.setUpdateTime(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].UpdateTime"));<NEW_LINE>mappCenterWorkspaceListItem.setCreateTime(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].CreateTime"));<NEW_LINE>mappCenterWorkspaceListItem.setWorkspaceId(_ctx.stringValue<MASK><NEW_LINE>mappCenterWorkspaceListItem.setRegion(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Region"));<NEW_LINE>mappCenterWorkspaceListItem.setCompatibleId(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].CompatibleId"));<NEW_LINE>mappCenterWorkspaceListItem.setId(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Id"));<NEW_LINE>mappCenterWorkspaceListItem.setTenantId(_ctx.stringValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].TenantId"));<NEW_LINE>mappCenterWorkspaceListItem.setUid(_ctx.longValue("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].Uid"));<NEW_LINE>mappCenterWorkspaceList.add(mappCenterWorkspaceListItem);<NEW_LINE>}<NEW_LINE>listMappCenterWorkspaceResult.setMappCenterWorkspaceList(mappCenterWorkspaceList);<NEW_LINE>listMappCenterWorkspacesResponse.setListMappCenterWorkspaceResult(listMappCenterWorkspaceResult);<NEW_LINE>return listMappCenterWorkspacesResponse;<NEW_LINE>} | ("ListMappCenterWorkspacesResponse.ListMappCenterWorkspaceResult.MappCenterWorkspaceList[" + i + "].WorkspaceId")); |
749,968 | private void tryClearingSpoutputOverflow() {<NEW_LINE>BlockState blockState = getBlockState();<NEW_LINE>if (!(blockState.getBlock() instanceof BasinBlock))<NEW_LINE>return;<NEW_LINE>Direction direction = blockState.getValue(BasinBlock.FACING);<NEW_LINE>BlockEntity te = level.getBlockEntity(worldPosition.below().relative(direction));<NEW_LINE>FilteringBehaviour filter = null;<NEW_LINE>InvManipulationBehaviour inserter = null;<NEW_LINE>if (te != null) {<NEW_LINE>filter = TileEntityBehaviour.get(level, te.getBlockPos(), FilteringBehaviour.TYPE);<NEW_LINE>inserter = TileEntityBehaviour.get(level, te.getBlockPos(), InvManipulationBehaviour.TYPE);<NEW_LINE>}<NEW_LINE>IItemHandler targetInv = te == null ? null : te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, direction.getOpposite()).orElse(inserter == null ? null : inserter.getInventory());<NEW_LINE>IFluidHandler targetTank = te == null ? null : te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, direction.getOpposite()).orElse(null);<NEW_LINE>boolean update = false;<NEW_LINE>for (Iterator<ItemStack> iterator = spoutputBuffer.iterator(); iterator.hasNext(); ) {<NEW_LINE>ItemStack itemStack = iterator.next();<NEW_LINE>if (direction == Direction.DOWN) {<NEW_LINE>Block.popResource(level, worldPosition, itemStack);<NEW_LINE>iterator.remove();<NEW_LINE>update = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (targetInv == null)<NEW_LINE>break;<NEW_LINE>if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack, true).isEmpty())<NEW_LINE>continue;<NEW_LINE>if (filter != null && !filter.test(itemStack))<NEW_LINE>continue;<NEW_LINE>update = true;<NEW_LINE>ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), false);<NEW_LINE>iterator.remove();<NEW_LINE>visualizedOutputItems.add(IntAttached.withZero(itemStack));<NEW_LINE>}<NEW_LINE>for (Iterator<FluidStack> iterator = spoutputFluidBuffer.iterator(); iterator.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>if (direction == Direction.DOWN) {<NEW_LINE>iterator.remove();<NEW_LINE>update = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (targetTank == null)<NEW_LINE>break;<NEW_LINE>for (boolean simulate : Iterate.trueAndFalse) {<NEW_LINE>FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE;<NEW_LINE>int fill = targetTank instanceof SmartFluidTankBehaviour.InternalFluidHandler ? ((SmartFluidTankBehaviour.InternalFluidHandler) targetTank).forceFill(fluidStack.copy(), action) : targetTank.fill(fluidStack.copy(), action);<NEW_LINE>if (fill != fluidStack.getAmount())<NEW_LINE>break;<NEW_LINE>if (simulate)<NEW_LINE>continue;<NEW_LINE>update = true;<NEW_LINE>iterator.remove();<NEW_LINE>visualizedOutputFluids.add(IntAttached.withZero(fluidStack));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (update) {<NEW_LINE>notifyChangeOfContents();<NEW_LINE>sendData();<NEW_LINE>}<NEW_LINE>} | FluidStack fluidStack = iterator.next(); |
365,178 | // compiles the element and returns the new entity if successful<NEW_LINE>private CustomElement compile(String code) {<NEW_LINE>saveJavaSource(code);<NEW_LINE>CustomElement entity = null;<NEW_LINE>compilation_errors.clear();<NEW_LINE>try {<NEW_LINE>// catch compiler messages<NEW_LINE>StringWriter compilerErrorMessageSW = new StringWriter();<NEW_LINE>PrintWriter compilerErrorMessagePW = new PrintWriter(compilerErrorMessageSW);<NEW_LINE>// custom elements use Java6 (previously SystemInfo.JAVA_VERSION, but this only works if the compiler.jar supports the system java version which is not guaranteed)<NEW_LINE>String javaVersion = "-\"1.6\"";<NEW_LINE>String classpath = "-classpath \"" + createClasspath() + "\"";<NEW_LINE>String sourcefile = "\"" + this.sourcefile.getAbsolutePath() + "\"";<NEW_LINE>// Compiler Information at http://dev.eclipse.org/viewcvs/index.cgi/jdt-core-home/howto/batch%20compile/batchCompile.html?revision=1.7<NEW_LINE>boolean compilationSuccessful = BatchCompiler.compile(javaVersion + " " + classpath + " " + sourcefile, new PrintWriter(System.out), compilerErrorMessagePW, null);<NEW_LINE>if (compilationSuccessful) {<NEW_LINE>FileClassLoader fcl = new FileClassLoader(Thread.currentThread().getContextClassLoader());<NEW_LINE>// load class by type name<NEW_LINE>Class<?> c = fcl.findClass(classname);<NEW_LINE>if (c != null) {<NEW_LINE>entity = (CustomElement) c.newInstance();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>compilation_errors = CompileError.getListFromString(<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(null, e);<NEW_LINE>}<NEW_LINE>if (entity == null) {<NEW_LINE>entity = new CustomElementWithErrors(compilation_errors);<NEW_LINE>}<NEW_LINE>return entity;<NEW_LINE>} | compilerErrorMessageSW.toString(), beforecodelines); |
91,586 | public EventResource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EventResource eventResource = new EventResource();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eventResource.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eventResource.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eventResource.setArn(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 eventResource;<NEW_LINE>} | class).unmarshall(context)); |
1,320,016 | public static void copyLocalNativeLibraries(final File localNativeLibrariesDirectory, final File destinationDirectory, Set<String> supportAbis, Set<String> removeSoFiles) {<NEW_LINE>sLogger.info(<MASK><NEW_LINE>try {<NEW_LINE>IOFileFilter filter = new NativeSoFilter(supportAbis, removeSoFiles);<NEW_LINE>// First, determine whether there is a file of the same name, if there is a discrepancy<NEW_LINE>Collection<File> files = FileUtils.listFiles(localNativeLibrariesDirectory, filter, TrueFileFilter.TRUE);<NEW_LINE>List<String> dumpFiles = new ArrayList<String>();<NEW_LINE>for (File file : files) {<NEW_LINE>String relativePath = getRelativePath(localNativeLibrariesDirectory, file);<NEW_LINE>File destFile = new File(destinationDirectory, relativePath);<NEW_LINE>if (destFile.exists()) {<NEW_LINE>String orgFileMd5 = MD5Util.getFileMD5(file);<NEW_LINE>String destFileMd5 = MD5Util.getFileMD5(destFile);<NEW_LINE>if (!orgFileMd5.equals(destFileMd5)) {<NEW_LINE>dumpFiles.add(file.getAbsolutePath() + " to " + destFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dumpFiles.size() > 0) {<NEW_LINE>throw new RuntimeException("Copy native so error,duplicate file exist!:\n" + StringUtils.join(dumpFiles, "\n"));<NEW_LINE>}<NEW_LINE>FileUtils.copyDirectory(localNativeLibrariesDirectory, destinationDirectory, filter);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("Could not copy native dependency.", e);<NEW_LINE>}<NEW_LINE>} | "Copying existing native libraries from " + localNativeLibrariesDirectory + " to " + destinationDirectory); |
296,712 | private // }<NEW_LINE>ItemStack slotClickPhantom(Slot slot, int mouseButton, ClickType clickType, EntityPlayer player) {<NEW_LINE>ItemStack stack = null;<NEW_LINE>if (mouseButton == 2) {<NEW_LINE>if (((IPhantomSlot) slot).canAdjustCount()) {<NEW_LINE>slot.putStack(null);<NEW_LINE>}<NEW_LINE>} else if (mouseButton == 0 || mouseButton == 1) {<NEW_LINE>InventoryPlayer playerInv = player.inventory;<NEW_LINE>slot.onSlotChanged();<NEW_LINE>ItemStack stackSlot = slot.getStack();<NEW_LINE>ItemStack stackHeld = playerInv.getItemStack();<NEW_LINE>if (stackSlot != null) {<NEW_LINE>stack = stackSlot.copy();<NEW_LINE>}<NEW_LINE>if (stackSlot == null) {<NEW_LINE>if (stackHeld != null && slot.isItemValid(stackHeld)) {<NEW_LINE>fillPhantomSlot(slot, stackHeld, mouseButton, clickType);<NEW_LINE>}<NEW_LINE>} else if (stackHeld == null) {<NEW_LINE>adjustPhantomSlot(slot, mouseButton, clickType);<NEW_LINE>slot.onPickupFromSlot(player, playerInv.getItemStack());<NEW_LINE>} else if (slot.isItemValid(stackHeld)) {<NEW_LINE>if (StackUtil.canMerge(stackSlot, stackHeld)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>fillPhantomSlot(slot, stackHeld, mouseButton, clickType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stack;<NEW_LINE>} | adjustPhantomSlot(slot, mouseButton, clickType); |
1,233,011 | public List<ApiDescription> read(RequestMappingContext outerContext) {<NEW_LINE>PatternsRequestCondition patternsCondition = outerContext.getPatternsCondition();<NEW_LINE>ApiSelector selector = outerContext.getDocumentationContext().getApiSelector();<NEW_LINE>List<ApiDescription> <MASK><NEW_LINE>for (String path : matchingPaths(selector, patternsCondition)) {<NEW_LINE>String methodName = outerContext.getName();<NEW_LINE>try {<NEW_LINE>RequestMappingContext operationContext = outerContext.copyPatternUsing(path).withKnownModels(outerContext.getModelMap());<NEW_LINE>List<Operation> operations = operationReader.read(operationContext);<NEW_LINE>if (operations.size() > 0) {<NEW_LINE>operationContext.apiDescriptionBuilder().groupName(outerContext.getGroupName()).operations(operations).pathDecorator(pluginsManager.decorator(new PathContext(outerContext, operations.stream().findFirst()))).path(path).description(methodName).hidden(false);<NEW_LINE>ApiDescription apiDescription = operationContext.apiDescriptionBuilder().build();<NEW_LINE>lookup.add(outerContext.key(), apiDescription);<NEW_LINE>apiDescriptionList.add(apiDescription);<NEW_LINE>}<NEW_LINE>} catch (Error e) {<NEW_LINE>String contentMsg = "Skipping process path[" + path + "], method[" + methodName + "] as it has an error.";<NEW_LINE>LOGGER.error(contentMsg, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return apiDescriptionList;<NEW_LINE>} | apiDescriptionList = new ArrayList<>(); |
1,144,904 | // We use reflection to get the methods from WebObjects because the jar is not distribuable publicly<NEW_LINE>// and we want to build witout it.<NEW_LINE>@Init<NEW_LINE>@SuppressWarnings({ "rawtypes", "unchecked" })<NEW_LINE>public void init(PluginConfiguration pluginConfiguration, ClassLoader appClassLoader) {<NEW_LINE>try {<NEW_LINE>Class kvcDefaultImplementationClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation", false, appClassLoader);<NEW_LINE>kvcDefaultImplementation_flushCaches = kvcDefaultImplementationClass.getMethod("_flushCaches");<NEW_LINE>Class kvcReflectionKeyBindingCreationClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$_ReflectionKeyBindingCreation", false, appClassLoader);<NEW_LINE>kvcReflectionKeyBindingCreation_flushCaches = kvcReflectionKeyBindingCreationClass.getMethod("_flushCaches");<NEW_LINE>Class kvcValueAccessorClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$ValueAccessor", false, appClassLoader);<NEW_LINE>kvcValueAccessor_flushCaches = kvcValueAccessorClass.getMethod("_flushCaches");<NEW_LINE>Class nsValidationDefaultImplementationClass = Class.forName("com.webobjects.foundation.NSValidation$DefaultImplementation", false, appClassLoader);<NEW_LINE>nsValidationDefaultImplementation_flushCaches = nsValidationDefaultImplementationClass.getMethod("_flushCaches");<NEW_LINE>Class woApplicationClass = Class.forName("com.webobjects.appserver.WOApplication", false, appClassLoader);<NEW_LINE>woApplication_removeComponentDefinitionCacheContents = woApplicationClass.getMethod("_removeComponentDefinitionCacheContents");<NEW_LINE>woApplicationObject = woApplicationClass.getMethod("application").invoke(null);<NEW_LINE>ClassPool classPool = ClassPool.getDefault();<NEW_LINE>woComponentCtClass = classPool.makeClass("com.webobjects.appserver.WOComponent");<NEW_LINE>nsValidationCtClass = classPool.makeClass("com.webobjects.foundation.NSValidation");<NEW_LINE>woActionCtClass = classPool.makeClass("com.webobjects.appserver.WOAction");<NEW_LINE>Class woActionClass = Class.forName("com.webobjects.appserver.WOAction", false, appClassLoader);<NEW_LINE>Field actionClassesField = woActionClass.getDeclaredField("_actionClasses");<NEW_LINE>actionClassesField.setAccessible(true);<NEW_LINE>actionClassesCacheDictionnary = actionClassesField.get(null);<NEW_LINE>Class nsThreadsafeMutableDictionaryClass = Class.<MASK><NEW_LINE>woApplication_removeComponentDefinitionCacheContents = woApplicationClass.getMethod("_removeComponentDefinitionCacheContents");<NEW_LINE>nsThreadsafeMutableDictionary_removeAllObjects = nsThreadsafeMutableDictionaryClass.getMethod("removeAllObjects");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | forName("com.webobjects.foundation._NSThreadsafeMutableDictionary", false, appClassLoader); |
38,623 | private static void raw(Exchange exchange) throws IOException {<NEW_LINE>DeribitMarketDataService service = (DeribitMarketDataService) exchange.getMarketDataService();<NEW_LINE>String instrumentName = "BTC-PERPETUAL";<NEW_LINE>String currency = "BTC";<NEW_LINE>DeribitTicker ticker = service.getDeribitTicker(instrumentName);<NEW_LINE><MASK><NEW_LINE>DeribitOrderBook orderBook = service.getDeribitOrderBook(instrumentName, null);<NEW_LINE>System.out.println(orderBook);<NEW_LINE>DeribitTrades trades = service.getLastTradesByInstrument(instrumentName, null, null, null, null, null);<NEW_LINE>System.out.println(trades);<NEW_LINE>List<DeribitCurrency> currencies = service.getDeribitCurrencies();<NEW_LINE>System.out.println(currencies);<NEW_LINE>List<DeribitInstrument> instruments = service.getDeribitInstruments(currency, Kind.future, false);<NEW_LINE>System.out.println(instruments);<NEW_LINE>List<DeribitSummary> summaries = service.getSummaryByInstrument(instrumentName);<NEW_LINE>System.out.println(summaries);<NEW_LINE>} | System.out.println(ticker); |
127,553 | public static DescribeSnapshotsResponse unmarshall(DescribeSnapshotsResponse describeSnapshotsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSnapshotsResponse.setRequestId(_ctx.stringValue("DescribeSnapshotsResponse.RequestId"));<NEW_LINE>describeSnapshotsResponse.setNextToken(_ctx.stringValue("DescribeSnapshotsResponse.NextToken"));<NEW_LINE>describeSnapshotsResponse.setPageSize(_ctx.integerValue("DescribeSnapshotsResponse.PageSize"));<NEW_LINE>describeSnapshotsResponse.setPageNumber(_ctx.integerValue("DescribeSnapshotsResponse.PageNumber"));<NEW_LINE>describeSnapshotsResponse.setTotalCount(_ctx.integerValue("DescribeSnapshotsResponse.TotalCount"));<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSnapshotsResponse.Snapshots.Length"); i++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setStatus(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Status"));<NEW_LINE>snapshot.setCreationTime(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].CreationTime"));<NEW_LINE>snapshot.setProgress(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Progress"));<NEW_LINE>snapshot.setInstantAccess(_ctx.booleanValue("DescribeSnapshotsResponse.Snapshots[" + i + "].InstantAccess"));<NEW_LINE>snapshot.setRemainTime(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RemainTime"));<NEW_LINE>snapshot.setSourceDiskSize(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskSize"));<NEW_LINE>snapshot.setRetentionDays(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RetentionDays"));<NEW_LINE>snapshot.setSourceDiskType(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskType"));<NEW_LINE>snapshot.setSourceStorageType(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceStorageType"));<NEW_LINE>snapshot.setUsage(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Usage"));<NEW_LINE>snapshot.setLastModifiedTime(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].LastModifiedTime"));<NEW_LINE>snapshot.setEncrypted(_ctx.booleanValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Encrypted"));<NEW_LINE>snapshot.setSnapshotType(_ctx.stringValue<MASK><NEW_LINE>snapshot.setSourceDiskId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskId"));<NEW_LINE>snapshot.setSnapshotName(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotName"));<NEW_LINE>snapshot.setInstantAccessRetentionDays(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].InstantAccessRetentionDays"));<NEW_LINE>snapshot.setDescription(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Description"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotId"));<NEW_LINE>snapshot.setResourceGroupId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].ResourceGroupId"));<NEW_LINE>snapshot.setCategory(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Category"));<NEW_LINE>snapshot.setKMSKeyId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].KMSKeyId"));<NEW_LINE>snapshot.setSnapshotSN(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotSN"));<NEW_LINE>snapshot.setProductCode(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].ProductCode"));<NEW_LINE>snapshot.setSourceSnapshotId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceSnapshotId"));<NEW_LINE>snapshot.setSourceRegionId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceRegionId"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>snapshot.setTags(tags);<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>describeSnapshotsResponse.setSnapshots(snapshots);<NEW_LINE>return describeSnapshotsResponse;<NEW_LINE>} | ("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotType")); |
914,444 | public void startPublishing() {<NEW_LINE>// We send the start messages before the first packet is received.<NEW_LINE>// This is required so FME actually starts publishing.<NEW_LINE>sendStartNotifications(Red5.getConnectionLocal());<NEW_LINE>IStreamCapableConnection conn = getConnection();<NEW_LINE>IContext context = conn.getScope().getContext();<NEW_LINE>ApplicationContext appCtx = context.getApplicationContext();<NEW_LINE>// force recording if set<NEW_LINE>if (automaticRecording) {<NEW_LINE>log.debug("Starting automatic recording of {}", publishedName);<NEW_LINE>try {<NEW_LINE>saveAs(publishedName, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Start of automatic recording failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MuxAdaptor localMuxAdaptor = MuxAdaptor.initializeMuxAdaptor(this, <MASK><NEW_LINE>try {<NEW_LINE>if (conn == null) {<NEW_LINE>throw new IOException("Stream is no longer connected");<NEW_LINE>}<NEW_LINE>setUpEndPoints(appCtx, publishedName, localMuxAdaptor);<NEW_LINE>localMuxAdaptor.init(conn, publishedName, false);<NEW_LINE>addStreamListener(localMuxAdaptor);<NEW_LINE>this.muxAdaptor = new WeakReference<>(localMuxAdaptor);<NEW_LINE>if (!this.muxAdaptor.get().getStreamHandler().isServerShuttingDown()) {<NEW_LINE>localMuxAdaptor.start();<NEW_LINE>} else {<NEW_LINE>log.warn("Server is shutting down and not accepting the connection for stream: {}", publishedName);<NEW_LINE>stop();<NEW_LINE>IStreamCapableConnection connection = getConnection();<NEW_LINE>if (connection != null) {<NEW_LINE>connection.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>} | false, conn.getScope()); |
740,119 | private Queueable wrapMessageForWLM(SipMessage msg) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Queueable queueable = msg;<NEW_LINE>QueueableTransformer transformer = SipContainerWLMHooksFactory.getSipContainerHooks().getQueueableTransformer();<NEW_LINE>if (transformer != null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "wrapMessageForWLM", "calling WLMHook transformer");<NEW_LINE>}<NEW_LINE>SipServletMessageExt sipServletMsg = null;<NEW_LINE>if (msg.getRequest() != null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "wrapMessageForWLM", "WLMHook - this is request");<NEW_LINE>}<NEW_LINE>sipServletMsg = (SipServletMessageExt) msg.getRequest();<NEW_LINE>} else {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "wrapMessageForWLM", "WLMHook - this is response");<NEW_LINE>}<NEW_LINE>sipServletMsg = (SipServletMessageExt) msg.getResponse();<NEW_LINE>}<NEW_LINE>SipDialogContext ctx = ((SipServletMessageImpl) sipServletMsg).getTransactionUser();<NEW_LINE>queueable = transformer.wrap(ctx, msg, sipServletMsg);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "wrapMessageForWLM", "WLMHook - wrapping done");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "wrapMessageForWLM");<NEW_LINE>}<NEW_LINE>return queueable;<NEW_LINE>} | c_logger.traceEntry(this, "wrapMessageForWLM"); |
1,560,568 | public void launchMpjwt11TCKLauncher_aud_noenv() throws Exception {<NEW_LINE>String port = String.valueOf(server.getBvtPort());<NEW_LINE>String bucketAndTestName = this.getClass().getCanonicalName();<NEW_LINE>Map<String, String> additionalProps = new HashMap<>();<NEW_LINE>// need to pass the correct url for PublicKeyAsPEMLocationURLTest<NEW_LINE>additionalProps.put("mp.jwt.tck.jwks.baseURL", "http://localhost:" + port + "/PublicKeyAsPEMLocationURLTest/");<NEW_LINE>MvnUtils.runTCKMvnCmd(server, bucketAndTestName, bucketAndTestName, "tck_suite_aud_noenv.xml", additionalProps, Collections.emptySet());<NEW_LINE>Map<String, String> <MASK><NEW_LINE>resultInfo.put("results_type", "MicroProfile");<NEW_LINE>resultInfo.put("feature_name", "JWT Auth");<NEW_LINE>resultInfo.put("feature_version", "1.1");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>} | resultInfo = MvnUtils.getResultInfo(server); |
1,838,311 | protected void handleSizeCall(ParserRuleContext ctx) {<NEW_LINE>// Check that this is the size call for processing and not a user defined size method.<NEW_LINE>if (!calledFromGlobalOrSetup(ctx)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ParseTree argsContext = ctx.getChild(2);<NEW_LINE>boolean thisRequiresRewrite = false;<NEW_LINE>boolean isSize = ctx.getChild(0).getText().equals(SIZE_METHOD_NAME);<NEW_LINE>boolean isFullscreen = ctx.getChild(0).getText().equals(FULLSCREEN_METHOD_NAME);<NEW_LINE>if (isSize && argsContext.getChildCount() > 2) {<NEW_LINE>thisRequiresRewrite = true;<NEW_LINE>sketchWidth = argsContext.<MASK><NEW_LINE>boolean invalidWidth = PApplet.parseInt(sketchWidth, -1) == -1;<NEW_LINE>invalidWidth = invalidWidth && !sketchWidth.equals("displayWidth");<NEW_LINE>if (invalidWidth) {<NEW_LINE>thisRequiresRewrite = false;<NEW_LINE>}<NEW_LINE>sketchHeight = argsContext.getChild(2).getText();<NEW_LINE>boolean invalidHeight = PApplet.parseInt(sketchHeight, -1) == -1;<NEW_LINE>invalidHeight = invalidHeight && !sketchHeight.equals("displayHeight");<NEW_LINE>if (invalidHeight) {<NEW_LINE>thisRequiresRewrite = false;<NEW_LINE>}<NEW_LINE>if (argsContext.getChildCount() > 3) {<NEW_LINE>sketchRenderer = argsContext.getChild(4).getText();<NEW_LINE>}<NEW_LINE>if (argsContext.getChildCount() > 5) {<NEW_LINE>sketchOutputFilename = argsContext.getChild(6).getText();<NEW_LINE>}<NEW_LINE>if (argsContext.getChildCount() > 7) {<NEW_LINE>// Uesr may have overloaded size.<NEW_LINE>thisRequiresRewrite = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isFullscreen) {<NEW_LINE>sketchWidth = "displayWidth";<NEW_LINE>sketchHeight = "displayHeight";<NEW_LINE>thisRequiresRewrite = true;<NEW_LINE>sizeIsFullscreen = true;<NEW_LINE>StringJoiner fullscreenArgsBuilder = new StringJoiner(", ");<NEW_LINE>if (argsContext.getChildCount() > 0) {<NEW_LINE>fullscreenArgsBuilder.add(argsContext.getChild(0).getText());<NEW_LINE>}<NEW_LINE>if (argsContext.getChildCount() > 2) {<NEW_LINE>fullscreenArgsBuilder.add(argsContext.getChild(2).getText());<NEW_LINE>}<NEW_LINE>fullscreenArgs = fullscreenArgsBuilder.toString();<NEW_LINE>}<NEW_LINE>if (thisRequiresRewrite) {<NEW_LINE>delete(ctx.getParent().start, ctx.getParent().stop);<NEW_LINE>insertAfter(ctx.stop, "/* size commented out by preprocessor */");<NEW_LINE>sizeRequiresRewrite = true;<NEW_LINE>}<NEW_LINE>} | getChild(0).getText(); |
752,374 | protected Number runThread(AbstractEmulator<?> emulator) {<NEW_LINE>Backend backend = emulator.getBackend();<NEW_LINE>UnidbgPointer stack = allocateStack(emulator);<NEW_LINE>if (emulator.is32Bit()) {<NEW_LINE>Pointer tls = thread.share(0x48);<NEW_LINE>this.errno = tls.share(8);<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_R0, UnidbgPointer.nativeValue(thread));<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_SP, stack.peer);<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_C13_C0_3, UnidbgPointer.nativeValue(tls));<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_LR, until);<NEW_LINE>} else {<NEW_LINE>Pointer tls = thread.share(0xb0);<NEW_LINE>this.errno = tls.share(16);<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_X0, UnidbgPointer.nativeValue(thread));<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_SP, stack.peer);<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_TPIDR_EL0<MASK><NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_LR, until);<NEW_LINE>}<NEW_LINE>return emulator.emulate(this.fn.peer, until);<NEW_LINE>} | , UnidbgPointer.nativeValue(tls)); |
757,563 | Result<List<String>> matchTransactions(Collection<TicketReservationWithTransaction> pendingReservations, List<RevolutTransactionDescriptor> transactions, PaymentContext context, boolean manualReviewRequired) {<NEW_LINE>List<Pair<TicketReservationWithTransaction, RevolutTransactionDescriptor>> matched = pendingReservations.stream().map(reservation -> Pair.of(reservation, transactions.stream().filter(transactionMatches(reservation, context)).findFirst())).filter(pair -> pair.getRight().isPresent()).map(pair -> Pair.of(pair.getLeft(), pair.getRight().orElseThrow())).collect(Collectors.toList());<NEW_LINE>return Result.success(matched.stream().map(pair -> {<NEW_LINE>var reservationId = pair.getLeft().getTicketReservation().getId();<NEW_LINE>var transaction = pair.getLeft().getTransaction();<NEW_LINE>Optional<Transaction> <MASK><NEW_LINE>if (latestTransaction.isEmpty() || latestTransaction.get().getId() != transaction.getId() || latestTransaction.get().getStatus() != transaction.getStatus()) {<NEW_LINE>log.trace("transaction {} has been modified while processing. Current status is: {}", transaction.getId(), latestTransaction.map(t -> t.getStatus().name()).orElse("N/A"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>var revolutTransaction = pair.getRight();<NEW_LINE>transactionRepository.update(transaction.getId(), revolutTransaction.getId(), revolutTransaction.getRequestId(), revolutTransaction.getCompletedAt(), 0L, 0L, manualReviewRequired ? Transaction.Status.OFFLINE_PENDING_REVIEW : Transaction.Status.OFFLINE_MATCHING_PAYMENT_FOUND, revolutTransaction.getMetadata());<NEW_LINE>return reservationId;<NEW_LINE>}).filter(Objects::nonNull).collect(Collectors.toList()));<NEW_LINE>} | latestTransaction = transactionRepository.lockLatestForUpdate(reservationId); |
930,417 | private StoreWorkflowResult storeLocalWorkflowsImpl(String projectName, Revision revision, WorkflowDefinitionList defs, Optional<Instant> currentTimeToSchedule) throws ResourceConflictException {<NEW_LINE>// validate workflow<NEW_LINE>// TODO move this to ProjectControl<NEW_LINE>defs.get().stream().forEach(workflowSource -> compiler.compile(workflowSource.getName(), workflowSource.getConfig()));<NEW_LINE>return projectStore.putAndLockProject(Project.of(projectName), (store, storedProject) -> {<NEW_LINE>ProjectControl lockedProj = new ProjectControl(store, storedProject);<NEW_LINE>StoredRevision <MASK><NEW_LINE>List<StoredWorkflowDefinition> storedDefs;<NEW_LINE>if (currentTimeToSchedule.isPresent()) {<NEW_LINE>storedDefs = lockedProj.insertWorkflowDefinitions(rev, defs.get(), srm, currentTimeToSchedule.get());<NEW_LINE>} else {<NEW_LINE>storedDefs = lockedProj.insertWorkflowDefinitionsWithoutSchedules(rev, defs.get());<NEW_LINE>}<NEW_LINE>return new StoreWorkflowResult(rev, storedDefs);<NEW_LINE>});<NEW_LINE>} | rev = lockedProj.insertRevision(revision); |
1,306,476 | public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int overlay, int normal) {<NEW_LINE>int i = this.writeOffset;<NEW_LINE>ByteBuffer buffer = this.byteBuffer;<NEW_LINE>vertexCount++;<NEW_LINE>midU += u;<NEW_LINE>midV += v;<NEW_LINE>buffer.putFloat(i, x);<NEW_LINE>buffer.putFloat(i + 4, y);<NEW_LINE>buffer.putFloat(i + 8, z);<NEW_LINE>buffer.<MASK><NEW_LINE>buffer.putFloat(i + 16, u);<NEW_LINE>buffer.putFloat(i + 20, v);<NEW_LINE>buffer.putInt(i + 24, overlay);<NEW_LINE>buffer.putInt(i + 28, light);<NEW_LINE>buffer.putInt(i + 32, normal);<NEW_LINE>buffer.putShort(i + 36, (short) -1);<NEW_LINE>buffer.putShort(i + 38, (short) -1);<NEW_LINE>this.advance();<NEW_LINE>if (vertexCount == 4) {<NEW_LINE>this.endQuad(vertexCount, Norm3b.unpackX(normal), Norm3b.unpackY(normal), Norm3b.unpackZ(normal));<NEW_LINE>}<NEW_LINE>} | putInt(i + 12, color); |
1,743,166 | public IoTJobAbortCriteria unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>IoTJobAbortCriteria ioTJobAbortCriteria = new IoTJobAbortCriteria();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("failureType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ioTJobAbortCriteria.setFailureType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("action", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ioTJobAbortCriteria.setAction(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("thresholdPercentage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ioTJobAbortCriteria.setThresholdPercentage(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("minNumberOfExecutedThings", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ioTJobAbortCriteria.setMinNumberOfExecutedThings(context.getUnmarshaller(Integer.<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 ioTJobAbortCriteria;<NEW_LINE>} | class).unmarshall(context)); |
1,366,574 | private Object toJSONInstance(Object object) {<NEW_LINE>if (object == null) {<NEW_LINE>return JSONObject.NULL;<NEW_LINE>}<NEW_LINE>if (object instanceof JSONObject || object instanceof JSONArray || JSONObject.NULL.equals(object) || isJSONString(object) || object instanceof Byte || object instanceof Character || object instanceof Short || object instanceof Integer || object instanceof Long || object instanceof Boolean || object instanceof Float || object instanceof Double || object instanceof String || object instanceof BigInteger || object instanceof BigDecimal || object instanceof Enum) {<NEW_LINE>return object;<NEW_LINE>}<NEW_LINE>if (object instanceof Calendar) {<NEW_LINE>// sets object to date, will be converted in next if-statement:<NEW_LINE>object = ((Calendar) object).getTime();<NEW_LINE>}<NEW_LINE>if (object instanceof Date) {<NEW_LINE>Date date = (Date) object;<NEW_LINE>return DateFormats.formatIso8601(date);<NEW_LINE>}<NEW_LINE>if (object instanceof byte[]) {<NEW_LINE>return Encoders.BASE64.encode<MASK><NEW_LINE>}<NEW_LINE>if (object instanceof char[]) {<NEW_LINE>return new String((char[]) object);<NEW_LINE>}<NEW_LINE>if (object instanceof Map) {<NEW_LINE>Map<?, ?> map = (Map<?, ?>) object;<NEW_LINE>return toJSONObject(map);<NEW_LINE>}<NEW_LINE>if (object instanceof Collection) {<NEW_LINE>Collection<?> coll = (Collection<?>) object;<NEW_LINE>return toJSONArray(coll);<NEW_LINE>}<NEW_LINE>if (Objects.isArray(object)) {<NEW_LINE>Collection c = Collections.arrayToList(object);<NEW_LINE>return toJSONArray(c);<NEW_LINE>}<NEW_LINE>// not an immediately JSON-compatible object and probably a JavaBean (or similar). We can't convert that<NEW_LINE>// directly without using a marshaller of some sort:<NEW_LINE>String msg = "Unable to serialize object of type " + object.getClass().getName() + " to JSON using known heuristics.";<NEW_LINE>throw new SerializationException(msg);<NEW_LINE>} | ((byte[]) object); |
199,914 | private void initFromLines(String[] lines, int minimumItemsInOneLine) {<NEW_LINE>ArrayList<Label> labels <MASK><NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>String[] labelInfos = lines[i].trim().split("\\s+");<NEW_LINE>if (labelInfos.length >= minimumItemsInOneLine && StringUtils.isNumeric(labelInfos[0]) && StringUtils.isNumeric(labelInfos[1])) {<NEW_LINE>Label l = new Label();<NEW_LINE>labels.add(l);<NEW_LINE>if (labelInfos.length > 0)<NEW_LINE>l.time = Float.parseFloat(labelInfos[0]);<NEW_LINE>if (labelInfos.length > 1)<NEW_LINE>l.status = Integer.parseInt(labelInfos[1]);<NEW_LINE>if (labelInfos.length > 2)<NEW_LINE>l.phn = labelInfos[2].trim();<NEW_LINE>int restStartMin = 4;<NEW_LINE>if (labelInfos.length > 3 && StringUtils.isNumeric(labelInfos[3]))<NEW_LINE>l.ll = Float.parseFloat(labelInfos[3]);<NEW_LINE>else {<NEW_LINE>restStartMin = 3;<NEW_LINE>l.ll = Float.NEGATIVE_INFINITY;<NEW_LINE>}<NEW_LINE>// Read additional fields if any in String format<NEW_LINE>// also convert these to double values if they are<NEW_LINE>// numeric<NEW_LINE>if (labelInfos.length > restStartMin) {<NEW_LINE>l.rest = new String[labelInfos.length - restStartMin];<NEW_LINE>l.valuesRest = new double[labelInfos.length - restStartMin];<NEW_LINE>for (int j = 0; j < l.rest.length; j++) {<NEW_LINE>l.rest[j] = labelInfos[j + restStartMin];<NEW_LINE>if (StringUtils.isNumeric(l.rest[j]))<NEW_LINE>l.valuesRest[j] = Double.valueOf(l.rest[j]);<NEW_LINE>else<NEW_LINE>l.valuesRest[j] = Double.NEGATIVE_INFINITY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>items = (Label[]) labels.toArray(new Label[0]);<NEW_LINE>} | = new ArrayList<Label>(); |
547,361 | public void putFloat(long t, float v) {<NEW_LINE>if (writeCurArrayIndex == -1) {<NEW_LINE>if (capacity >= CAPACITY_THRESHOLD) {<NEW_LINE>((LinkedList<long[]>) timeRet).addFirst(new long[capacity]);<NEW_LINE>((LinkedList<float[]>) floatRet).addFirst(new float[capacity]);<NEW_LINE>writeCurListIndex++;<NEW_LINE>writeCurArrayIndex = capacity - 1;<NEW_LINE>} else {<NEW_LINE>int newCapacity = capacity << 1;<NEW_LINE>long[] newTimeData = new long[newCapacity];<NEW_LINE>float[] newValueData = new float[newCapacity];<NEW_LINE>System.arraycopy(timeRet.get(0), 0, newTimeData, newCapacity - capacity, capacity);<NEW_LINE>System.arraycopy(floatRet.get(0), 0, <MASK><NEW_LINE>timeRet.set(0, newTimeData);<NEW_LINE>floatRet.set(0, newValueData);<NEW_LINE>writeCurArrayIndex = newCapacity - capacity - 1;<NEW_LINE>capacity = newCapacity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timeRet.get(0)[writeCurArrayIndex] = t;<NEW_LINE>floatRet.get(0)[writeCurArrayIndex] = v;<NEW_LINE>writeCurArrayIndex--;<NEW_LINE>count++;<NEW_LINE>} | newValueData, newCapacity - capacity, capacity); |
1,734,595 | public AuthenticationMechanism create(String mechanismName, IdentityManager identityManager, FormParserFactory formParserFactory, Map<String, String> properties) {<NEW_LINE>String realm = properties.get(REALM);<NEW_LINE>String silent = properties.get(SILENT);<NEW_LINE>String charsetString = properties.get(CHARSET);<NEW_LINE>Charset charset = charsetString == null ? StandardCharsets.UTF_8 : Charset.forName(charsetString);<NEW_LINE>Map<Pattern, Charset> userAgentCharsets = new HashMap<>();<NEW_LINE>String <MASK><NEW_LINE>if (userAgentString != null) {<NEW_LINE>String[] parts = userAgentString.split(",");<NEW_LINE>if (parts.length % 2 != 0) {<NEW_LINE>throw UndertowMessages.MESSAGES.userAgentCharsetMustHaveEvenNumberOfItems(userAgentString);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parts.length; i += 2) {<NEW_LINE>Pattern pattern = Pattern.compile(parts[i]);<NEW_LINE>Charset c = Charset.forName(parts[i + 1]);<NEW_LINE>userAgentCharsets.put(pattern, c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BasicFixAuthenticationMechanism(realm, mechanismName, silent != null && silent.equals("true"), identityManager, charset, userAgentCharsets);<NEW_LINE>} | userAgentString = properties.get(USER_AGENT_CHARSETS); |
733,494 | protected void consumeBlock() {<NEW_LINE>// Block ::= OpenBlock '{' BlockStatementsopt '}'<NEW_LINE>// LambdaBody ::= NestedType NestedMethod '{' BlockStatementsopt '}'<NEW_LINE>// simpler action for empty blocks<NEW_LINE>int statementsLength = this.astLengthStack[this.astLengthPtr--];<NEW_LINE>Block block;<NEW_LINE>if (statementsLength == 0) {<NEW_LINE>// empty block<NEW_LINE>block = new Block(0);<NEW_LINE>block.sourceStart = this.intStack[this.intPtr--];<NEW_LINE>block.sourceEnd = this.endStatementPosition;<NEW_LINE>// check whether this block at least contains some comment in it<NEW_LINE>if (!containsComment(block.sourceStart, block.sourceEnd)) {<NEW_LINE>block.bits |= ASTNode.UndocumentedEmptyBlock;<NEW_LINE>}<NEW_LINE>// still need to pop the block variable counter<NEW_LINE>this.realBlockPtr--;<NEW_LINE>} else {<NEW_LINE>block = new Block(this.realBlockStack[this.realBlockPtr--]);<NEW_LINE>this.astPtr -= statementsLength;<NEW_LINE>System.arraycopy(this.astStack, this.astPtr + 1, block.statements = new Statement[statementsLength], 0, statementsLength);<NEW_LINE>block.sourceStart = this<MASK><NEW_LINE>block.sourceEnd = this.endStatementPosition;<NEW_LINE>}<NEW_LINE>if (this.currentElement instanceof RecoveredBlock && this.currentElement.getLastStart() == block.sourceStart) {<NEW_LINE>// in assist scenarii we cannot guarantee uniqueness of equal blocks, so simply update the duplicate, too:<NEW_LINE>this.currentElement.updateSourceEndIfNecessary(block.sourceEnd);<NEW_LINE>}<NEW_LINE>pushOnAstStack(block);<NEW_LINE>} | .intStack[this.intPtr--]; |
1,234,980 | private BucketPath prevNonEmptyNode(BucketPath nodePath, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>prevBucketLoop: while (nodePath != null) {<NEW_LINE>final long[] node = directory.getNode(nodePath.nodeIndex, atomicOperation);<NEW_LINE>final int startIndex = 0;<NEW_LINE>final int endIndex = nodePath.itemIndex + nodePath.hashMapOffset;<NEW_LINE>for (int i = endIndex; i >= startIndex; i--) {<NEW_LINE>final long position = node[i];<NEW_LINE>if (position > 0) {<NEW_LINE>final int hashMapSize = 1 << nodePath.nodeLocalDepth;<NEW_LINE>final int hashMapOffset = (i / hashMapSize) * hashMapSize;<NEW_LINE>final int itemIndex = i - hashMapOffset;<NEW_LINE>return new BucketPath(nodePath.parent, hashMapOffset, itemIndex, nodePath.nodeIndex, nodePath.nodeLocalDepth, nodePath.nodeGlobalDepth);<NEW_LINE>}<NEW_LINE>if (position < 0) {<NEW_LINE>final int childNodeIndex = (int) ((position & Long.MAX_VALUE) >> 8);<NEW_LINE>final int childItemOffset = (int) position & 0xFF;<NEW_LINE>final int nodeLocalDepth = directory.getNodeLocalDepth(childNodeIndex, atomicOperation);<NEW_LINE>final int endChildIndex = (1 << nodeLocalDepth) - 1;<NEW_LINE>final BucketPath parent = new BucketPath(nodePath.parent, 0, i, nodePath.nodeIndex, nodePath.nodeLocalDepth, nodePath.nodeGlobalDepth);<NEW_LINE>nodePath = new BucketPath(parent, childItemOffset, endChildIndex, childNodeIndex, <MASK><NEW_LINE>continue prevBucketLoop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nodePath = prevLevelUp(nodePath);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | nodeLocalDepth, parent.nodeGlobalDepth + nodeLocalDepth); |
1,120,418 | public com.amazonaws.services.health.model.UnsupportedLocaleException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.health.model.UnsupportedLocaleException unsupportedLocaleException = new com.amazonaws.services.health.model.UnsupportedLocaleException(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 unsupportedLocaleException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
898,855 | public int encodeString(KrollDict args) {<NEW_LINE>if (!args.containsKey(TiC.PROPERTY_DEST)) {<NEW_LINE>throw new IllegalArgumentException("dest was not specified for encodeString");<NEW_LINE>}<NEW_LINE>if (!args.containsKey(TiC.PROPERTY_SOURCE) || args.get(TiC.PROPERTY_SOURCE) == null) {<NEW_LINE>throw new IllegalArgumentException("source was not specified for encodeString");<NEW_LINE>}<NEW_LINE>BufferProxy dest = (BufferProxy) args.get(TiC.PROPERTY_DEST);<NEW_LINE>String src = (String) args.get(TiC.PROPERTY_SOURCE);<NEW_LINE>int destPosition = 0;<NEW_LINE>if (args.containsKey(TiC.PROPERTY_DEST_POSITION)) {<NEW_LINE>destPosition = TiConvert.toInt(args, TiC.PROPERTY_DEST_POSITION);<NEW_LINE>}<NEW_LINE>int srcPosition = 0;<NEW_LINE>if (args.containsKey(TiC.PROPERTY_SOURCE_POSITION)) {<NEW_LINE>srcPosition = TiConvert.toInt(args, TiC.PROPERTY_SOURCE_POSITION);<NEW_LINE>}<NEW_LINE>int srcLength = src.length();<NEW_LINE>if (args.containsKey(TiC.PROPERTY_SOURCE_LENGTH)) {<NEW_LINE>srcLength = TiConvert.toInt(args, TiC.PROPERTY_SOURCE_LENGTH);<NEW_LINE>}<NEW_LINE>String charset = validateCharset(args);<NEW_LINE>byte[] destBuffer = dest.getBuffer();<NEW_LINE>validatePositionAndLength(srcPosition, srcLength, src.length());<NEW_LINE>if (srcPosition != 0 || srcLength != src.length()) {<NEW_LINE>src = src.substring(srcPosition, srcPosition + srcLength);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>byte[] <MASK><NEW_LINE>System.arraycopy(encoded, 0, destBuffer, destPosition, encoded.length);<NEW_LINE>return destPosition + encoded.length;<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>Log.w(TAG, e.getMessage(), e);<NEW_LINE>throw new IllegalArgumentException("Unsupported Encoding: " + charset);<NEW_LINE>}<NEW_LINE>} | encoded = src.getBytes(charset); |
144,805 | public static DescribeIPv6TranslatorAclListAttributesResponse unmarshall(DescribeIPv6TranslatorAclListAttributesResponse describeIPv6TranslatorAclListAttributesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setRequestId(_ctx.stringValue("DescribeIPv6TranslatorAclListAttributesResponse.RequestId"));<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setAclId(_ctx.stringValue("DescribeIPv6TranslatorAclListAttributesResponse.AclId"));<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setPageNumber(_ctx.integerValue("DescribeIPv6TranslatorAclListAttributesResponse.PageNumber"));<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setPageSize(_ctx.integerValue("DescribeIPv6TranslatorAclListAttributesResponse.PageSize"));<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setTotalCount(_ctx.integerValue("DescribeIPv6TranslatorAclListAttributesResponse.TotalCount"));<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setAclName(_ctx.stringValue("DescribeIPv6TranslatorAclListAttributesResponse.AclName"));<NEW_LINE>List<AclEntry> aclEntries = new ArrayList<AclEntry>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeIPv6TranslatorAclListAttributesResponse.AclEntries.Length"); i++) {<NEW_LINE>AclEntry aclEntry = new AclEntry();<NEW_LINE>aclEntry.setAclEntryComment(_ctx.stringValue("DescribeIPv6TranslatorAclListAttributesResponse.AclEntries[" + i + "].AclEntryComment"));<NEW_LINE>aclEntry.setAclEntryId(_ctx.stringValue("DescribeIPv6TranslatorAclListAttributesResponse.AclEntries[" + i + "].AclEntryId"));<NEW_LINE>aclEntry.setAclEntryIp(_ctx.stringValue<MASK><NEW_LINE>aclEntries.add(aclEntry);<NEW_LINE>}<NEW_LINE>describeIPv6TranslatorAclListAttributesResponse.setAclEntries(aclEntries);<NEW_LINE>return describeIPv6TranslatorAclListAttributesResponse;<NEW_LINE>} | ("DescribeIPv6TranslatorAclListAttributesResponse.AclEntries[" + i + "].AclEntryIp")); |
1,035,352 | private int br(String x, String y) {<NEW_LINE>if (x.length() > y.length()) {<NEW_LINE>String swap = x;<NEW_LINE>x = y;<NEW_LINE>y = swap;<NEW_LINE>}<NEW_LINE>final int m = x.length();<NEW_LINE>final int n = y.length();<NEW_LINE>int ZERO_K = n;<NEW_LINE>if (n + 3 > FKP.ncol())<NEW_LINE>FKP = new IntArray2D(2 * n + 1, n + 3);<NEW_LINE>for (int k = -ZERO_K; k < 0; k++) {<NEW_LINE>int p = -k - 1;<NEW_LINE>FKP.set(k + ZERO_K, p + 1, Math<MASK><NEW_LINE>FKP.set(k + ZERO_K, p, Integer.MIN_VALUE);<NEW_LINE>}<NEW_LINE>FKP.set(ZERO_K, 0, -1);<NEW_LINE>for (int k = 1; k <= ZERO_K; k++) {<NEW_LINE>int p = k - 1;<NEW_LINE>FKP.set(k + ZERO_K, p + 1, -1);<NEW_LINE>FKP.set(k + ZERO_K, p, Integer.MIN_VALUE);<NEW_LINE>}<NEW_LINE>int p = n - m - 1;<NEW_LINE>do {<NEW_LINE>p++;<NEW_LINE>for (int i = (p - (n - m)) / 2; i >= 1; i--) {<NEW_LINE>brf.f(x, y, FKP, ZERO_K, n - m + i, p - i);<NEW_LINE>}<NEW_LINE>for (int i = (n - m + p) / 2; i >= 1; i--) {<NEW_LINE>brf.f(x, y, FKP, ZERO_K, n - m - i, p - i);<NEW_LINE>}<NEW_LINE>brf.f(x, y, FKP, ZERO_K, n - m, p);<NEW_LINE>} while (FKP.get((n - m) + ZERO_K, p) != m);<NEW_LINE>return p - 1;<NEW_LINE>} | .abs(k) - 1); |
657,428 | public void unmanageNics(VirtualMachineProfile vm) {<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("Unmanaging NICs for VM: " + vm.getId());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final List<NicVO> nics = _nicDao.listByVmId(vm.getId());<NEW_LINE>for (final NicVO nic : nics) {<NEW_LINE>removeNic(vm, nic);<NEW_LINE>NetworkVO network = _networksDao.findById(nic.getNetworkId());<NEW_LINE>if (virtualMachine.getState() != VirtualMachine.State.Stopped) {<NEW_LINE>UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, virtualMachine.getAccountId(), virtualMachine.getDataCenterId(), virtualMachine.getId(), Long.toString(nic.getId()), network.getNetworkOfferingId(), null, 0L, virtualMachine.getClass().getName(), virtualMachine.getUuid(), virtualMachine.isDisplay());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | VirtualMachine virtualMachine = vm.getVirtualMachine(); |
961,112 | public static String decode(String html) {<NEW_LINE>if (html.indexOf('&') < 0) {<NEW_LINE>return html;<NEW_LINE>}<NEW_LINE>char[] chars = html.toCharArray();<NEW_LINE>int delta = 0;<NEW_LINE>int n = chars.length;<NEW_LINE>for (int i = 0; i < n; ) {<NEW_LINE>char ch = chars[i];<NEW_LINE>if (chars[i] == '&') {<NEW_LINE>long packedEndAndCodepoint = HtmlEntities.decodeEntityAt(chars, i, n);<NEW_LINE>int end = (int) (packedEndAndCodepoint >>> 32);<NEW_LINE>if (end != i + 1) {<NEW_LINE>int codepoint = ((int) packedEndAndCodepoint) & 0xffffff;<NEW_LINE>delta += end - (i + Character.toChars(codepoint<MASK><NEW_LINE>i = end;<NEW_LINE>} else {<NEW_LINE>chars[i - delta] = ch;<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chars[i - delta] = ch;<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (delta == 0) {<NEW_LINE>return html;<NEW_LINE>}<NEW_LINE>return String.valueOf(chars, 0, n - delta);<NEW_LINE>} | , chars, i - delta)); |
444,976 | private ClusterConfig buildMultiHostClusterConfig(MultiHostConnectionStringConfigure configure) {<NEW_LINE>ClusterConfigWithNoVersion clusterConfig = new ClusterConfigWithNoVersion(configure.getName(), ClusterType.NORMAL, DatabaseCategory.MYSQL);<NEW_LINE>DatabaseShardConfigImpl databaseShardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);<NEW_LINE>List<HostSpec> hosts = configure.getHosts();<NEW_LINE>hosts.forEach(host -> {<NEW_LINE>DatabaseConfigImpl databaseConfig = new DatabaseConfigImpl(databaseShardConfig);<NEW_LINE>databaseConfig.setIp(host.host());<NEW_LINE>databaseConfig.setPort(host.port());<NEW_LINE>databaseConfig.setZone(host.zone());<NEW_LINE>databaseConfig.setDbName(configure.getDbName());<NEW_LINE>databaseConfig.setUid(configure.getUserName());<NEW_LINE>databaseConfig.<MASK><NEW_LINE>databaseShardConfig.addDatabaseConfig(databaseConfig);<NEW_LINE>});<NEW_LINE>clusterConfig.addDatabaseShardConfig(databaseShardConfig);<NEW_LINE>DBModel dbModel = configure.getDbModel();<NEW_LINE>String routeStrategyName = DBModel.MGR == dbModel ? RouteStrategyEnum.WRITE_ORDERED.getAlias() : RouteStrategyEnum.WRITE_CURRENT_ZONE_FIRST.getAlias();<NEW_LINE>DefaultClusterRouteStrategyConfig routeStrategy = new DefaultClusterRouteStrategyConfig(routeStrategyName);<NEW_LINE>if (configure.getZonesPriority() != null)<NEW_LINE>routeStrategy.setProperty(MultiMasterStrategy.ZONES_PRIORITY, configure.getZonesPriority());<NEW_LINE>if (configure.getFailoverTimeMS() != null)<NEW_LINE>routeStrategy.setProperty(MultiMasterStrategy.FAILOVER_TIME_MS, String.valueOf(configure.getFailoverTimeMS()));<NEW_LINE>if (configure.getBlacklistTimeoutMS() != null)<NEW_LINE>routeStrategy.setProperty(MultiMasterStrategy.BLACKLIST_TIMEOUT_MS, String.valueOf(configure.getBlacklistTimeoutMS()));<NEW_LINE>if (configure.getFixedValidatePeriodMS() != null)<NEW_LINE>routeStrategy.setProperty(MultiMasterStrategy.FIXED_VALIDATE_PERIOD_MS, String.valueOf(configure.getFixedValidatePeriodMS()));<NEW_LINE>clusterConfig.setRouteStrategyConfig(routeStrategy);<NEW_LINE>clusterConfig.setCustomizedOption(new DefaultDalConfigCustomizedOption());<NEW_LINE>return clusterConfig;<NEW_LINE>} | setPwd(configure.getPassword()); |
884,480 | public static QueryEventRecordPlanDetailResponse unmarshall(QueryEventRecordPlanDetailResponse queryEventRecordPlanDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryEventRecordPlanDetailResponse.setRequestId(_ctx.stringValue("QueryEventRecordPlanDetailResponse.RequestId"));<NEW_LINE>queryEventRecordPlanDetailResponse.setSuccess(_ctx.booleanValue("QueryEventRecordPlanDetailResponse.Success"));<NEW_LINE>queryEventRecordPlanDetailResponse.setErrorMessage(_ctx.stringValue("QueryEventRecordPlanDetailResponse.ErrorMessage"));<NEW_LINE>queryEventRecordPlanDetailResponse.setCode(_ctx.stringValue("QueryEventRecordPlanDetailResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPreRecordDuration(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.PreRecordDuration"));<NEW_LINE>data.setRecordDuration(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.RecordDuration"));<NEW_LINE>data.setPlanId<MASK><NEW_LINE>data.setName(_ctx.stringValue("QueryEventRecordPlanDetailResponse.Data.Name"));<NEW_LINE>data.setTemplateId(_ctx.stringValue("QueryEventRecordPlanDetailResponse.Data.TemplateId"));<NEW_LINE>TemplateInfo templateInfo = new TemplateInfo();<NEW_LINE>templateInfo.setTemplateId(_ctx.stringValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.TemplateId"));<NEW_LINE>templateInfo.setName(_ctx.stringValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.Name"));<NEW_LINE>templateInfo.set_Default(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.Default"));<NEW_LINE>templateInfo.setAllDay(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.AllDay"));<NEW_LINE>List<TimeSectionListItem> timeSectionList = new ArrayList<TimeSectionListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.TimeSectionList.Length"); i++) {<NEW_LINE>TimeSectionListItem timeSectionListItem = new TimeSectionListItem();<NEW_LINE>timeSectionListItem.setDayOfWeek(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.TimeSectionList[" + i + "].DayOfWeek"));<NEW_LINE>timeSectionListItem.setBegin(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.TimeSectionList[" + i + "].Begin"));<NEW_LINE>timeSectionListItem.setEnd(_ctx.integerValue("QueryEventRecordPlanDetailResponse.Data.TemplateInfo.TimeSectionList[" + i + "].End"));<NEW_LINE>timeSectionList.add(timeSectionListItem);<NEW_LINE>}<NEW_LINE>templateInfo.setTimeSectionList(timeSectionList);<NEW_LINE>data.setTemplateInfo(templateInfo);<NEW_LINE>queryEventRecordPlanDetailResponse.setData(data);<NEW_LINE>return queryEventRecordPlanDetailResponse;<NEW_LINE>} | (_ctx.stringValue("QueryEventRecordPlanDetailResponse.Data.PlanId")); |
1,018,098 | private void paintFixed(RenderingContext c, Layer layer) {<NEW_LINE>layer.positionFixedLayer(c);<NEW_LINE>if (c.getShadowPageNumber() == -1) {<NEW_LINE>SimplePainter painter = new SimplePainter(c.getPage().getMarginBorderPadding(c, CalculatedStyle.LEFT), c.getPage().getMarginBorderPadding(c, CalculatedStyle.TOP));<NEW_LINE>painter.paintLayer(c, layer);<NEW_LINE>} else {<NEW_LINE>Rectangle shadowRect = c.getPage().getDocumentCoordinatesContentBoundsForInsertedPage(c, c.getShadowPageNumber());<NEW_LINE>c.getOutputDevice().<MASK><NEW_LINE>SimplePainter painter = new SimplePainter(shadowRect.x, c.getPage().getMarginBorderPadding(c, CalculatedStyle.TOP));<NEW_LINE>painter.paintLayer(c, layer);<NEW_LINE>c.getOutputDevice().translate(-shadowRect.x, 0);<NEW_LINE>}<NEW_LINE>} | translate(shadowRect.x, 0); |
187,968 | private void updateLocationCache(Iterable<DatabaseAccountLocation> writeLocations, Iterable<DatabaseAccountLocation> readLocations, UnmodifiableList<String> preferenceList, Boolean enableMultipleWriteLocations) {<NEW_LINE>synchronized (this.lockObject) {<NEW_LINE>DatabaseAccountLocationsInfo nextLocationInfo = new DatabaseAccountLocationsInfo(this.locationInfo);<NEW_LINE>logger.debug("updating location cache ..., current readLocations [{}], current writeLocations [{}]", nextLocationInfo.readEndpoints, nextLocationInfo.writeEndpoints);<NEW_LINE>if (preferenceList != null) {<NEW_LINE>nextLocationInfo.preferredLocations = preferenceList;<NEW_LINE>}<NEW_LINE>if (enableMultipleWriteLocations != null) {<NEW_LINE>this.enableMultipleWriteLocations = enableMultipleWriteLocations;<NEW_LINE>}<NEW_LINE>this.clearStaleEndpointUnavailabilityInfo();<NEW_LINE>if (readLocations != null) {<NEW_LINE>Utils.ValueHolder<UnmodifiableList<String>> out = Utils.ValueHolder.initialize(nextLocationInfo.availableReadLocations);<NEW_LINE>Utils.ValueHolder<UnmodifiableMap<URI, String>> outReadRegionMap = Utils.ValueHolder.initialize(nextLocationInfo.regionNameByReadEndpoint);<NEW_LINE>nextLocationInfo.availableReadEndpointByLocation = this.getEndpointByLocation(readLocations, out, outReadRegionMap);<NEW_LINE>nextLocationInfo.availableReadLocations = out.v;<NEW_LINE>nextLocationInfo.regionNameByReadEndpoint = outReadRegionMap.v;<NEW_LINE>}<NEW_LINE>if (writeLocations != null) {<NEW_LINE>Utils.ValueHolder<UnmodifiableList<String>> out = Utils.ValueHolder.initialize(nextLocationInfo.availableWriteLocations);<NEW_LINE>Utils.ValueHolder<UnmodifiableMap<URI, String>> outWriteRegionMap = Utils.ValueHolder.initialize(nextLocationInfo.regionNameByWriteEndpoint);<NEW_LINE>nextLocationInfo.availableWriteEndpointByLocation = this.<MASK><NEW_LINE>nextLocationInfo.availableWriteLocations = out.v;<NEW_LINE>nextLocationInfo.regionNameByWriteEndpoint = outWriteRegionMap.v;<NEW_LINE>}<NEW_LINE>nextLocationInfo.writeEndpoints = this.getPreferredAvailableEndpoints(nextLocationInfo.availableWriteEndpointByLocation, nextLocationInfo.availableWriteLocations, OperationType.Write, this.defaultEndpoint);<NEW_LINE>nextLocationInfo.readEndpoints = this.getPreferredAvailableEndpoints(nextLocationInfo.availableReadEndpointByLocation, nextLocationInfo.availableReadLocations, OperationType.Read, nextLocationInfo.writeEndpoints.get(0));<NEW_LINE>this.lastCacheUpdateTimestamp = Instant.now();<NEW_LINE>logger.debug("updating location cache finished, new readLocations [{}], new writeLocations [{}]", nextLocationInfo.readEndpoints, nextLocationInfo.writeEndpoints);<NEW_LINE>this.locationInfo = nextLocationInfo;<NEW_LINE>}<NEW_LINE>} | getEndpointByLocation(writeLocations, out, outWriteRegionMap); |
99,648 | public List<List<Writable>> next(int num) {<NEW_LINE>List<File> files = new ArrayList<>(num);<NEW_LINE>List<List<ImageObject>> objects = new ArrayList<>(num);<NEW_LINE>for (int i = 0; i < num && hasNext(); i++) {<NEW_LINE>File f = iter.next();<NEW_LINE>this.currentFile = f;<NEW_LINE>if (!f.isDirectory()) {<NEW_LINE>files.add(f);<NEW_LINE>objects.add(labelProvider.getImageObjectsForPath<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int nClasses = labels.size();<NEW_LINE>INDArray outImg = Nd4j.create(files.size(), channels, height, width);<NEW_LINE>INDArray outLabel = Nd4j.create(files.size(), 4 + nClasses, gridH, gridW);<NEW_LINE>int exampleNum = 0;<NEW_LINE>for (int i = 0; i < files.size(); i++) {<NEW_LINE>File imageFile = files.get(i);<NEW_LINE>this.currentFile = imageFile;<NEW_LINE>try {<NEW_LINE>this.invokeListeners(imageFile);<NEW_LINE>Image image = this.imageLoader.asImageMatrix(imageFile);<NEW_LINE>this.currentImage = image;<NEW_LINE>Nd4j.getAffinityManager().ensureLocation(image.getImage(), AffinityManager.Location.DEVICE);<NEW_LINE>outImg.put(new INDArrayIndex[] { point(exampleNum), all(), all(), all() }, image.getImage());<NEW_LINE>List<ImageObject> objectsThisImg = objects.get(exampleNum);<NEW_LINE>label(image, objectsThisImg, outLabel, exampleNum);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>exampleNum++;<NEW_LINE>}<NEW_LINE>if (!nchw) {<NEW_LINE>// NCHW to NHWC<NEW_LINE>outImg = outImg.permute(0, 2, 3, 1);<NEW_LINE>outLabel = outLabel.permute(0, 2, 3, 1);<NEW_LINE>}<NEW_LINE>return new NDArrayRecordBatch(Arrays.asList(outImg, outLabel));<NEW_LINE>} | (f.getPath())); |
1,039,520 | public static Query<NavigableMap<Long, Long>> playtimePerDay(long after, long before, long timeZoneOffset, ServerUUID serverUUID) {<NEW_LINE>return database -> {<NEW_LINE>Sql sql = database.getSql();<NEW_LINE>String selectPlaytimePerDay = SELECT + sql.dateToEpochSecond(sql.dateToDayStamp(sql.epochSecondToDate('(' + SessionsTable.SESSION_START + "+?)/1000"))) + "*1000 as date," + "SUM(" + SessionsTable.SESSION_END + '-' + SessionsTable.SESSION_START + ") as playtime" + FROM + SessionsTable.TABLE_NAME + WHERE + SessionsTable.SESSION_END + "<=?" + AND + SessionsTable.SESSION_START + ">=?" + AND + SessionsTable.SERVER_UUID + "=?" + GROUP_BY + "date";<NEW_LINE>return database.query(new QueryStatement<NavigableMap<Long, Long>>(selectPlaytimePerDay, 100) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setLong(1, timeZoneOffset);<NEW_LINE><MASK><NEW_LINE>statement.setLong(3, after);<NEW_LINE>statement.setString(4, serverUUID.toString());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public NavigableMap<Long, Long> processResults(ResultSet set) throws SQLException {<NEW_LINE>NavigableMap<Long, Long> uniquePerDay = new TreeMap<>();<NEW_LINE>while (set.next()) {<NEW_LINE>uniquePerDay.put(set.getLong("date"), set.getLong("playtime"));<NEW_LINE>}<NEW_LINE>return uniquePerDay;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>};<NEW_LINE>} | statement.setLong(2, before); |
758,496 | public byte[] ntlm_construct_authenticate_target_info() {<NEW_LINE>ByteBuffer buf = new ByteBuffer(4096);<NEW_LINE>writeAVPair(buf, MSV_AV_NETBIOS_DOMAIN_NAME, serverNetbiosDomainName);<NEW_LINE>writeAVPair(buf, MSV_AV_NETBIOS_COMPUTER_NAME, serverNetbiosComputerName);<NEW_LINE>writeAVPair(buf, MSV_AV_DNS_DOMAIN_NAME, serverDnsDomainName);<NEW_LINE>writeAVPair(buf, MSV_AV_DNS_COMPUTER_NAME, serverDnsComputerName);<NEW_LINE>writeAVPair(buf, MSV_AV_DNS_TREE_NAME, serverDnsTreeName);<NEW_LINE><MASK><NEW_LINE>byte[] flags = new byte[] { (byte) MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK, 0, 0, 0 };<NEW_LINE>writeAVPair(buf, MSV_AV_FLAGS, flags);<NEW_LINE>writeAVPair(buf, MSV_AV_CHANNEL_BINDINGS, channelBindingsHash);<NEW_LINE>writeAVPair(buf, MSV_AV_TARGET_NAME, servicePrincipalName);<NEW_LINE>writeAVPair(buf, MSV_AV_EOL, "");<NEW_LINE>// DEBUG: put EOL 4 times, for compatibility with FreeRDP output<NEW_LINE>// *DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");<NEW_LINE>// *DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");<NEW_LINE>// *DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");<NEW_LINE>buf.trimAtCursor();<NEW_LINE>authenticateTargetInfo = buf.toByteArray();<NEW_LINE>buf.unref();<NEW_LINE>return authenticateTargetInfo;<NEW_LINE>} | writeAVPair(buf, MSV_AV_TIMESTAMP, serverTimestamp); |
865,979 | public static String leftPad(String str, int size, String padStr) {<NEW_LINE>if (str == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isNullOrEmpty(padStr)) {<NEW_LINE>padStr = " ";<NEW_LINE>}<NEW_LINE>int padLen = padStr.length();<NEW_LINE>int strLen = str.length();<NEW_LINE>int pads = size - strLen;<NEW_LINE>if (pads <= 0) {<NEW_LINE>// returns original String when possible<NEW_LINE>return str;<NEW_LINE>}<NEW_LINE>if (pads == padLen) {<NEW_LINE>return padStr.concat(str);<NEW_LINE>} else if (pads < padLen) {<NEW_LINE>return padStr.substring(0, pads).concat(str);<NEW_LINE>} else {<NEW_LINE>char[] padding = new char[pads];<NEW_LINE>char[<MASK><NEW_LINE>for (int i = 0; i < pads; i++) {<NEW_LINE>padding[i] = padChars[i % padLen];<NEW_LINE>}<NEW_LINE>return new String(padding).concat(str);<NEW_LINE>}<NEW_LINE>} | ] padChars = padStr.toCharArray(); |
427,527 | public ImmutableSortedBag<T> newWithout(T element) {<NEW_LINE>int index = Arrays.binarySearch(this.elements, element, this.comparator);<NEW_LINE>if (index < 0) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (this.occurrences[index] > 1) {<NEW_LINE>int[] occurrences = this.occurrences.clone();<NEW_LINE>occurrences[index] -= 1;<NEW_LINE>return new ImmutableSortedBagImpl<>(this.elements.clone(), occurrences, this.comparator);<NEW_LINE>}<NEW_LINE>T[] elements = (T[]) new Object[<MASK><NEW_LINE>int[] occurrences = new int[this.occurrences.length - 1];<NEW_LINE>System.arraycopy(this.elements, 0, elements, 0, index);<NEW_LINE>System.arraycopy(this.occurrences, 0, occurrences, 0, index);<NEW_LINE>System.arraycopy(this.elements, index + 1, elements, index, elements.length - index);<NEW_LINE>System.arraycopy(this.occurrences, index + 1, occurrences, index, occurrences.length - index);<NEW_LINE>return new ImmutableSortedBagImpl<>(elements, occurrences, this.comparator);<NEW_LINE>} | this.elements.length - 1]; |
1,703,268 | private void vp8_setup_block_dptrs() {<NEW_LINE>int r, c;<NEW_LINE>for (r = 0; r < 4; ++r) {<NEW_LINE>for (c = 0; c < 4; ++c) {<NEW_LINE>block.setRel(r * 4 + c, new BlockD(predictor.shallowCopyWithPosInc(r * 4 * 16 + c * 4)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (r = 0; r < 2; ++r) {<NEW_LINE>for (c = 0; c < 2; ++c) {<NEW_LINE>block.setRel(16 + r * 2 + c, new BlockD(getFreshUPredPtr().shallowCopyWithPosInc(r * 4 * 8 + c * 4)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (r = 0; r < 2; ++r) {<NEW_LINE>for (c = 0; c < 2; ++c) {<NEW_LINE>block.setRel(20 + r * 2 + c, new BlockD(getFreshVPredPtr().shallowCopyWithPosInc(r * 4 * 8 + c * 4)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>block.setRel(24, new BlockD(null));<NEW_LINE>for (r = 0; r < 25; ++r) {<NEW_LINE>block.getRel(r).qcoeff = qcoeff.shallowCopyWithPosInc(r * 16);<NEW_LINE>block.getRel(r).dqcoeff = <MASK><NEW_LINE>block.getRel(r).eob = eobs.shallowCopyWithPosInc(r);<NEW_LINE>}<NEW_LINE>} | dqcoeff.shallowCopyWithPosInc(r * 16); |
689,953 | public void writeMessages(ProcessContext context) {<NEW_LINE>HL7v2Message msg = context.element();<NEW_LINE>// all fields but data and labels should be null for ingest.<NEW_LINE>Message model = new Message();<NEW_LINE>model.setData(msg.getData());<NEW_LINE>model.setLabels(msg.getLabels());<NEW_LINE>switch(writeMethod) {<NEW_LINE>case BATCH_IMPORT:<NEW_LINE>// TODO: add support for HL7v2 import.<NEW_LINE>throw new UnsupportedOperationException("The batch import API is not supported yet");<NEW_LINE>case INGEST:<NEW_LINE>default:<NEW_LINE>try {<NEW_LINE>long requestTimestamp = Instant.now().getMillis();<NEW_LINE>client.ingestHL7v2Message(hl7v2Store.get(), model);<NEW_LINE>successfulHL7v2MessageWrites.inc();<NEW_LINE>messageIngestLatencyMs.update(Instant.now().getMillis() - requestTimestamp);<NEW_LINE>} catch (Exception e) {<NEW_LINE>failedMessageWrites.inc();<NEW_LINE>LOG.warn(String.format("Failed to ingest message Error: %s Stacktrace: %s", e.getMessage(), Throwables.getStackTraceAsString(e)));<NEW_LINE>HealthcareIOError<HL7v2Message> err = <MASK><NEW_LINE>LOG.warn(String.format("%s %s", err.getErrorMessage(), err.getStackTrace()));<NEW_LINE>context.output(err);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HealthcareIOError.of(msg, e); |
990,345 | public List<SubscriptionBaseWithAddOns> createPlansWithAddOns(final UUID accountId, final Iterable<SubscriptionAndAddOnsSpecifier> subscriptionsAndAddOns, final SubscriptionCatalog kbCatalog, final CallContext context) throws SubscriptionBaseApiException {<NEW_LINE>final Map<UUID, List<SubscriptionBaseEvent>> eventsMap = new HashMap<UUID, List<SubscriptionBaseEvent>>();<NEW_LINE>final Collection<List<SubscriptionBase>> subscriptionBaseAndAddOnsList = new ArrayList<List<SubscriptionBase>>();<NEW_LINE>final InternalCallContext internalCallContext = createCallContextFromAccountId(accountId, context);<NEW_LINE>try {<NEW_LINE>final List<SubscriptionBaseWithAddOns> allSubscriptions = new ArrayList<SubscriptionBaseWithAddOns>();<NEW_LINE>for (final SubscriptionAndAddOnsSpecifier subscriptionAndAddOns : subscriptionsAndAddOns) {<NEW_LINE>final List<SubscriptionBase> subscriptionBaseList = new ArrayList<SubscriptionBase>();<NEW_LINE>createEvents(subscriptionAndAddOns.getSubscriptionSpecifiers(), context, eventsMap, subscriptionBaseList, kbCatalog);<NEW_LINE>subscriptionBaseAndAddOnsList.add(subscriptionBaseList);<NEW_LINE>final SubscriptionBaseWithAddOns subscriptionBaseWithAddOns = new DefaultSubscriptionBaseWithAddOns(subscriptionAndAddOns.getBundle(), subscriptionBaseList);<NEW_LINE>allSubscriptions.add(subscriptionBaseWithAddOns);<NEW_LINE>}<NEW_LINE>final List<SubscriptionBaseEvent> events = dao.createSubscriptionsWithAddOns(<MASK><NEW_LINE>final ListMultimap<UUID, SubscriptionBaseEvent> eventsBySubscription = ArrayListMultimap.<UUID, SubscriptionBaseEvent>create();<NEW_LINE>for (final SubscriptionBaseEvent event : events) {<NEW_LINE>eventsBySubscription.put(event.getSubscriptionId(), event);<NEW_LINE>}<NEW_LINE>for (final List<SubscriptionBase> subscriptions : subscriptionBaseAndAddOnsList) {<NEW_LINE>for (final SubscriptionBase input : subscriptions) {<NEW_LINE>((DefaultSubscriptionBase) input).rebuildTransitions(eventsBySubscription.get(input.getId()), kbCatalog);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return allSubscriptions;<NEW_LINE>} catch (final CatalogApiException e) {<NEW_LINE>throw new SubscriptionBaseApiException(e);<NEW_LINE>}<NEW_LINE>} | allSubscriptions, eventsMap, kbCatalog, internalCallContext); |
53,834 | public void run() {<NEW_LINE>double max = 0;<NEW_LINE>for (MapPack mpack : values) {<NEW_LINE>int objHash = mpack.getInt("objHash");<NEW_LINE>ListValue time = mpack.getList("time");<NEW_LINE>ListValue value = mpack.getList("value");<NEW_LINE>TracePair tp = getTracePair(objType, objHash, (int) ((etime - stime) / (<MASK><NEW_LINE>CircularBufferDataProvider maxProvider = (CircularBufferDataProvider) tp.totalTrace.getDataProvider();<NEW_LINE>CircularBufferDataProvider valueProvider = (CircularBufferDataProvider) tp.activeTrace.getDataProvider();<NEW_LINE>maxProvider.clearTrace();<NEW_LINE>valueProvider.clearTrace();<NEW_LINE>for (int i = 0; time != null && i < time.size(); i++) {<NEW_LINE>long x = time.getLong(i);<NEW_LINE>Value v = value.get(i);<NEW_LINE>if (v != null && v.getValueType() == ValueEnum.LIST) {<NEW_LINE>ListValue lv = (ListValue) v;<NEW_LINE>maxProvider.addSample(new Sample(x, lv.getDouble(0)));<NEW_LINE>valueProvider.addSample(new Sample(x, lv.getDouble(1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>max = Math.max(ChartUtil.getMax(maxProvider.iterator()), max);<NEW_LINE>}<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>}<NEW_LINE>redraw();<NEW_LINE>} | DateUtil.MILLIS_PER_SECOND * 2))); |
1,047,209 | void parseStatusParameters() {<NEW_LINE>LOG.info("Received light ctl status from: " + MeshAddress.formatAddress(mMessage.getSrc(), true));<NEW_LINE>final ByteBuffer buffer = ByteBuffer.wrap(mParameters).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>mPresentCtlLightness = buffer.getShort() & 0xFFFF;<NEW_LINE>mPresentCtlTemperature = buffer.getShort() & 0xFFFF;<NEW_LINE>LOG.info("Present lightness: " + mPresentCtlLightness);<NEW_LINE>LOG.info("Present temperature: " + mPresentCtlTemperature);<NEW_LINE>if (buffer.limit() > LIGHT_CTL_STATUS_MANDATORY_LENGTH) {<NEW_LINE>mTargetCtlLightness <MASK><NEW_LINE>mTargetCtlTemperature = buffer.getShort() & 0xFFFF;<NEW_LINE>final int remainingTime = buffer.get() & 0xFF;<NEW_LINE>mTransitionSteps = (remainingTime & 0x3F);<NEW_LINE>mTransitionResolution = (remainingTime >> 6);<NEW_LINE>LOG.info("Target lightness: " + mTargetCtlLightness);<NEW_LINE>LOG.info("Target temperature: " + mTargetCtlTemperature);<NEW_LINE>LOG.info("Remaining time, transition number of steps: " + mTransitionSteps);<NEW_LINE>LOG.info("Remaining time, transition number of step resolution: " + mTransitionResolution);<NEW_LINE>LOG.info("Remaining time: " + MeshParserUtils.getRemainingTime(remainingTime));<NEW_LINE>}<NEW_LINE>} | = buffer.getShort() & 0xFFFF; |
34,706 | public void logNativeQuery(RequestLogLine requestLogLine) throws IOException {<NEW_LINE>final Map mdc = MDC.getCopyOfContextMap();<NEW_LINE>// MDC must be set during the `LOG.info` call at the end of the try block.<NEW_LINE>try {<NEW_LINE>if (setMDC) {<NEW_LINE>try {<NEW_LINE>final Query query = requestLogLine.getQuery();<NEW_LINE>MDC.put("queryId", query.getId());<NEW_LINE>MDC.put(BaseQuery.SQL_QUERY_ID, StringUtils.nullToEmptyNonDruidDataString(query.getSqlQueryId()));<NEW_LINE>MDC.put("dataSource", String.join(",", query.getDataSource().getTableNames()));<NEW_LINE>MDC.put("queryType", query.getType());<NEW_LINE>MDC.put("isNested", String.valueOf(!(query.getDataSource() instanceof TableDataSource)));<NEW_LINE>MDC.put("hasFilters", Boolean.toString(query.hasFilters()));<NEW_LINE>MDC.put("remoteAddr", requestLogLine.getRemoteAddr());<NEW_LINE>MDC.put("duration", query.getDuration().toString());<NEW_LINE>MDC.put("descending", Boolean.toString(query.isDescending()));<NEW_LINE>if (setContextMDC) {<NEW_LINE>final Iterable<Map.Entry<String, Object>> entries = query.getContext() == null ? ImmutableList.of() : query<MASK><NEW_LINE>for (Map.Entry<String, Object> entry : entries) {<NEW_LINE>MDC.put(entry.getKey(), entry.getValue() == null ? "NULL" : entry.getValue().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException re) {<NEW_LINE>LOG.error(re, "Error preparing MDC");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String line = requestLogLine.getNativeQueryLine(mapper);<NEW_LINE>// MDC must be set here<NEW_LINE>LOG.info("%s", line);<NEW_LINE>} finally {<NEW_LINE>if (setMDC) {<NEW_LINE>if (mdc != null) {<NEW_LINE>MDC.setContextMap(mdc);<NEW_LINE>} else {<NEW_LINE>MDC.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getContext().entrySet(); |
232,982 | public void refreshFields() {<NEW_LINE>ResourceConfigData data = this.helper.getData();<NEW_LINE>for (int i = 0; i < jFields.length; i++) {<NEW_LINE>String item;<NEW_LINE>if (FieldHelper.isList(fields[i])) {<NEW_LINE>item = (String) ((JComboBox) jFields[i]).getSelectedItem();<NEW_LINE>} else {<NEW_LINE>item = (String) ((JTextField) jFields[i]).getText();<NEW_LINE>}<NEW_LINE>String fieldName = fields[i].getName();<NEW_LINE>Object <MASK><NEW_LINE>if (value == null) {<NEW_LINE>value = FieldHelper.getDefaultValue(fields[i]);<NEW_LINE>if (fieldName.equals("jndi-name")) {<NEW_LINE>// NOI18N<NEW_LINE>String helperJndiName = data.getTargetFile();<NEW_LINE>if (helperJndiName != null) {<NEW_LINE>if (getPanelType().equals(TYPE_JDBC_RESOURCE) || getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {<NEW_LINE>value = value + helperJndiName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>data.set(fieldName, value);<NEW_LINE>}<NEW_LINE>String val = (String) value;<NEW_LINE>if (!item.equals(val)) {<NEW_LINE>if (FieldHelper.isList(fields[i])) {<NEW_LINE>((JComboBox) jFields[i]).setSelectedItem(val);<NEW_LINE>} else {<NEW_LINE>((JTextField) jFields[i]).setText(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {<NEW_LINE>Object selPool = (Object) data.getString(__PoolName);<NEW_LINE>existingResourceComboBox.setSelectedItem(selPool);<NEW_LINE>} else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {<NEW_LINE>Object selJDBC = (Object) data.getString(__JdbcResourceJndiName);<NEW_LINE>existingResourceComboBox.setSelectedItem(selJDBC);<NEW_LINE>}<NEW_LINE>} | value = data.get(fieldName); |
89,156 | private RangeIndex createBPTree(FileSet fileset, int order, BlockMgrBuilder blockMgrBuilderNodes, BlockMgrBuilder blockMgrBuilderRecords, RecordFactory factory, IndexParams indexParams) {<NEW_LINE>// ---- Checking<NEW_LINE>{<NEW_LINE>int blockSize = indexParams.getBlockSize();<NEW_LINE>if (blockSize < 0)<NEW_LINE>throw new IllegalArgumentException("Negative blocksize: " + blockSize);<NEW_LINE>if (blockSize < 0 && order < 0)<NEW_LINE>throw new IllegalArgumentException("Neither blocksize nor order specified");<NEW_LINE>if (blockSize >= 0 && order < 0)<NEW_LINE>order = BPlusTreeParams.calcOrder(blockSize, factory.recordLength());<NEW_LINE>if (blockSize >= 0 && order >= 0) {<NEW_LINE>int order2 = BPlusTreeParams.calcOrder(blockSize, factory.recordLength());<NEW_LINE>if (order != order2)<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>BPlusTreeParams params = new BPlusTreeParams(order, factory);<NEW_LINE>BlockMgr blkMgrNodes = blockMgrBuilderNodes.buildBlockMgr(fileset, Names.bptExtTree, indexParams);<NEW_LINE>BlockMgr blkMgrRecords = blockMgrBuilderRecords.buildBlockMgr(fileset, Names.bptExtRecords, indexParams);<NEW_LINE>return BPlusTree.create(params, blkMgrNodes, blkMgrRecords);<NEW_LINE>} | "Wrong order (" + order + "), calculated = " + order2); |
385,243 | public void onEvent(StatisticEvent statisticEvent, long l, boolean b) {<NEW_LINE>if (StatisticManager.getInstance().getSamplingRate() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StatisticEntry entry = statisticEvent.getEntry();<NEW_LINE>if (entry instanceof StatisticTxEntry) {<NEW_LINE>StatisticTxEntry txEntry = (StatisticTxEntry) entry;<NEW_LINE>if (sampleDecisions.get((int) (txEntry.getTxId() % 100))) {<NEW_LINE>if (null == txRecords.get(txEntry.getTxId())) {<NEW_LINE>if (txRecords.size() >= StatisticManager.getInstance().getSqlLogSize()) {<NEW_LINE>txRecords.pollFirstEntry();<NEW_LINE>}<NEW_LINE>txRecords.put(txEntry.getTxId(<MASK><NEW_LINE>} else {<NEW_LINE>txRecords.get(txEntry.getTxId()).addSqls(txEntry.getEntryList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (entry instanceof StatisticFrontendSqlEntry) {<NEW_LINE>StatisticFrontendSqlEntry frontendSqlEntry = (StatisticFrontendSqlEntry) entry;<NEW_LINE>if (!frontendSqlEntry.isNeedToTx()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sampleDecisions.get((int) (frontendSqlEntry.getTxId() % 100))) {<NEW_LINE>if (null == txRecords.get(frontendSqlEntry.getTxId())) {<NEW_LINE>if (txRecords.size() >= StatisticManager.getInstance().getSqlLogSize()) {<NEW_LINE>txRecords.pollFirstEntry();<NEW_LINE>}<NEW_LINE>txRecords.put(frontendSqlEntry.getTxId(), new TxRecord(frontendSqlEntry));<NEW_LINE>} else {<NEW_LINE>txRecords.get(frontendSqlEntry.getTxId()).getSqls().add(new SQLRecord(frontendSqlEntry));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), new TxRecord(txEntry)); |
1,175,007 | private void generateDirectMovement(final DDOrderMoveSchedule schedule) {<NEW_LINE>//<NEW_LINE>// Make sure DD Order is completed<NEW_LINE>final DDOrderId ddOrderId = schedule.getDdOrderId();<NEW_LINE>if (!skipCompletingDDOrder) {<NEW_LINE>final I_DD_Order ddOrder = getDDOrderById(ddOrderId);<NEW_LINE>ddOrderService.completeDDOrderIfNeeded(ddOrder);<NEW_LINE>}<NEW_LINE>schedule.assertNotPickedFrom();<NEW_LINE>schedule.assertNotDroppedTo();<NEW_LINE>final Quantity qtyToMove = schedule.getQtyToPick();<NEW_LINE>final HuId huIdToMove = schedule.getPickFromHUId();<NEW_LINE>final MovementId directMovementId = createDirectMovement(schedule, huIdToMove);<NEW_LINE>schedule.markAsPickedFrom(null, DDOrderMoveSchedulePickedHUs.of(DDOrderMoveSchedulePickedHU.builder().actualHUIdPicked(huIdToMove).qtyPicked(qtyToMove).pickFromMovementId(directMovementId).inTransitLocatorId(<MASK><NEW_LINE>schedule.markAsDroppedTo(directMovementId);<NEW_LINE>ddOrderMoveScheduleService.save(schedule);<NEW_LINE>} | null).build())); |
206,410 | private void deleteManifestFileNodes() throws InterruptedException {<NEW_LINE>if (deleteOption == DeleteOptions.DELETE_OUTPUT || deleteOption == DeleteOptions.DELETE_INPUT_AND_OUTPUT) {<NEW_LINE>boolean allINodesDeleted = true;<NEW_LINE>Iterator<ManifestFileLock> iterator = manifestFileLocks.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>ManifestFileLock manifestFileLock = iterator.next();<NEW_LINE>String manifestFilePath = manifestFileLock.getManifestFilePath().toString();<NEW_LINE>try {<NEW_LINE>progress.progress<MASK><NEW_LINE>logger.log(Level.INFO, String.format("Releasing the lock on the manifest file %s for %s", manifestFilePath, caseNodeData.getDisplayName()));<NEW_LINE>manifestFileLock.release();<NEW_LINE>if (manifestFileLock.isInputDeleted()) {<NEW_LINE>progress.progress(Bundle.DeleteCaseTask_progress_deletingManifestFileNode(manifestFilePath));<NEW_LINE>logger.log(Level.INFO, String.format("Deleting the manifest file znode for %s for %s", manifestFilePath, caseNodeData.getDisplayName()));<NEW_LINE>coordinationService.deleteNode(CoordinationService.CategoryNode.MANIFESTS, manifestFilePath);<NEW_LINE>} else {<NEW_LINE>allINodesDeleted = false;<NEW_LINE>}<NEW_LINE>} catch (CoordinationServiceException ex) {<NEW_LINE>allINodesDeleted = false;<NEW_LINE>logger.log(Level.WARNING, String.format("Error deleting the manifest file znode for %s for %s", manifestFilePath, caseNodeData.getDisplayName()), ex);<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>if (allINodesDeleted) {<NEW_LINE>setDeletedItemFlag(CaseNodeData.DeletedFlags.MANIFEST_FILE_NODES);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Bundle.DeleteCaseTask_progress_releasingManifestLock(manifestFilePath)); |
1,372,941 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>InstrumentClass target = instrumentor.<MASK><NEW_LINE>// Methods<NEW_LINE>InstrumentMethod getExecutionObservable = target.getDeclaredMethod("getExecutionObservable");<NEW_LINE>if (getExecutionObservable != null) {<NEW_LINE>getExecutionObservable.addScopedInterceptor(BasicMethodInterceptor.class, va(HystrixPluginConstants.HYSTRIX_INTERNAL_SERVICE_TYPE), HystrixPluginConstants.HYSTRIX_COMMAND_EXECUTION_SCOPE, ExecutionPolicy.ALWAYS);<NEW_LINE>}<NEW_LINE>InstrumentMethod getFallbackObservable = target.getDeclaredMethod("getFallbackObservable");<NEW_LINE>if (getFallbackObservable != null) {<NEW_LINE>getFallbackObservable.addScopedInterceptor(BasicMethodInterceptor.class, va(HystrixPluginConstants.HYSTRIX_INTERNAL_SERVICE_TYPE), HystrixPluginConstants.HYSTRIX_COMMAND_EXECUTION_SCOPE, ExecutionPolicy.ALWAYS);<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | getInstrumentClass(classLoader, className, classfileBuffer); |
1,352,845 | public static DescribeDomainPvDataResponse unmarshall(DescribeDomainPvDataResponse describeDomainPvDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainPvDataResponse.setRequestId(_ctx.stringValue("DescribeDomainPvDataResponse.RequestId"));<NEW_LINE>describeDomainPvDataResponse.setDomainName(_ctx.stringValue("DescribeDomainPvDataResponse.DomainName"));<NEW_LINE>describeDomainPvDataResponse.setStartTime(_ctx.stringValue("DescribeDomainPvDataResponse.StartTime"));<NEW_LINE>describeDomainPvDataResponse.setEndTime(_ctx.stringValue("DescribeDomainPvDataResponse.EndTime"));<NEW_LINE>describeDomainPvDataResponse.setDataInterval(_ctx.stringValue("DescribeDomainPvDataResponse.DataInterval"));<NEW_LINE>List<UsageData> pvDataInterval <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainPvDataResponse.PvDataInterval.Length"); i++) {<NEW_LINE>UsageData usageData = new UsageData();<NEW_LINE>usageData.setValue(_ctx.stringValue("DescribeDomainPvDataResponse.PvDataInterval[" + i + "].Value"));<NEW_LINE>usageData.setTimeStamp(_ctx.stringValue("DescribeDomainPvDataResponse.PvDataInterval[" + i + "].TimeStamp"));<NEW_LINE>pvDataInterval.add(usageData);<NEW_LINE>}<NEW_LINE>describeDomainPvDataResponse.setPvDataInterval(pvDataInterval);<NEW_LINE>return describeDomainPvDataResponse;<NEW_LINE>} | = new ArrayList<UsageData>(); |
1,635,888 | final BatchUpdateFindingsResult executeBatchUpdateFindings(BatchUpdateFindingsRequest batchUpdateFindingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchUpdateFindingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchUpdateFindingsRequest> request = null;<NEW_LINE>Response<BatchUpdateFindingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchUpdateFindingsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchUpdateFindings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchUpdateFindingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchUpdateFindingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(batchUpdateFindingsRequest)); |
1,231,358 | protected void process_native_annotations(Class<?> nat) throws Exception {<NEW_LINE>for (Field field : nat.getDeclaredFields()) {<NEW_LINE>if (!Modifier.isStatic(field.getModifiers()))<NEW_LINE>continue;<NEW_LINE>Import imp = field.getAnnotation(Import.class);<NEW_LINE>if (imp != null) {<NEW_LINE>field.setAccessible(true);<NEW_LINE><MASK><NEW_LINE>EModuleManager.add_import(f, new FieldBinder(field, f, module_name()));<NEW_LINE>// System.out.println("N import " + f);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for native methods<NEW_LINE>Method[] methods = nat.getDeclaredMethods();<NEW_LINE>next_method: for (Method method : methods) {<NEW_LINE>BIF efun = method.getAnnotation(BIF.class);<NEW_LINE>if (efun != null && efun.type().export()) {<NEW_LINE>String mod = module_name();<NEW_LINE>String name = efun.name();<NEW_LINE>if (name.equals("__SELFNAME__"))<NEW_LINE>name = method.getName();<NEW_LINE>Class<?>[] parameterTypes = method.getParameterTypes();<NEW_LINE>int arity = parameterTypes.length;<NEW_LINE>if (arity > 0 && parameterTypes[0].equals(EProc.class)) {<NEW_LINE>arity -= 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parameterTypes.length; i++) {<NEW_LINE>if (i == 0 && parameterTypes[i].equals(EProc.class))<NEW_LINE>continue;<NEW_LINE>if (parameterTypes[i].equals(EObject.class))<NEW_LINE>continue;<NEW_LINE>// we only allow EProc as zero'th and EObject as other args<NEW_LINE>// in exported functions<NEW_LINE>continue next_method;<NEW_LINE>}<NEW_LINE>FunID f = new FunID(mod, name, arity);<NEW_LINE>// System.out.println("N export " + f);<NEW_LINE>EModuleManager.add_export(this, f, EFunCG.funForMethod(method, mod));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | FunID f = new FunID(imp); |
1,573,684 | private Behavior<Command> broadcast() {<NEW_LINE>spawnPolicyActors();<NEW_LINE>if (policies.isEmpty()) {<NEW_LINE>System.err.println("No active policies in the current configuration");<NEW_LINE>return Behaviors.stopped();<NEW_LINE>}<NEW_LINE>stopwatch.start();<NEW_LINE>long skip = settings.trace().skip();<NEW_LINE>long limit = settings.trace().limit();<NEW_LINE>int batchSize = settings.batchSize();<NEW_LINE>try (Stream<AccessEvent> events = traceReader.events().skip(skip).limit(limit)) {<NEW_LINE>var batch = new MutableObject<>(new ArrayList<AccessEvent>(batchSize));<NEW_LINE>events.forEach(event -> {<NEW_LINE>batch.<MASK><NEW_LINE>if (batch.getValue().size() == batchSize) {<NEW_LINE>route(new AccessEvents(batch.getValue()));<NEW_LINE>batch.setValue(new ArrayList<>(batchSize));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>route(new AccessEvents(batch.getValue()));<NEW_LINE>route(new Finished());<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} | getValue().add(event); |
1,667,946 | public void bind() throws MalformedURLException {<NEW_LINE>InstanceInfo myInfo = ApplicationInfoManager.getInstance().getInfo();<NEW_LINE>String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);<NEW_LINE>String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.availabilityZone);<NEW_LINE>final List<String> ips = getCandidateIps();<NEW_LINE>Ordering<NetworkInterface> ipsOrder = Ordering.natural().onResultOf(new Function<NetworkInterface, Integer>() {<NEW_LINE><NEW_LINE>public Integer apply(NetworkInterface networkInterface) {<NEW_LINE>return ips.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>AmazonEC2 ec2Service = getEC2Service();<NEW_LINE>String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();<NEW_LINE>DescribeNetworkInterfacesResult result = ec2Service.describeNetworkInterfaces(new DescribeNetworkInterfacesRequest().withFilters(new Filter("private-ip-address", ips)).withFilters(new Filter("status", Lists.newArrayList("available"))).withFilters(new Filter("subnet-id", Lists.newArrayList(subnetId))));<NEW_LINE>if (result.getNetworkInterfaces().isEmpty()) {<NEW_LINE>logger.info("No ip is free to be associated with this instance. Candidate ips are: {} for zone: {}", ips, myZone);<NEW_LINE>} else {<NEW_LINE>NetworkInterface selected = ipsOrder.min(result.getNetworkInterfaces());<NEW_LINE>ec2Service.attachNetworkInterface(new AttachNetworkInterfaceRequest().withNetworkInterfaceId(selected.getNetworkInterfaceId()).withDeviceIndex(1).withInstanceId(myInstanceId));<NEW_LINE>}<NEW_LINE>} | indexOf(networkInterface.getPrivateIpAddress()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.