idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
208,811
// kill default signal SIGTERM - 15, SIGKILL -9, SIGQUIT - 3<NEW_LINE>private List<String> prepareKillCommands(String module, String pid, String signal, boolean killWithRoot) {<NEW_LINE>List<String> result;<NEW_LINE>if (pid.isEmpty() || killWithRoot) {<NEW_LINE>String killStringToyBox = "toybox pkill " + module;<NEW_LINE>String killString = "pkill " + module;<NEW_LINE>String killStringBusybox = busyboxPath + "pkill " + module;<NEW_LINE>String killAllStringBusybox = busyboxPath + "kill $(pgrep " + module + ")";<NEW_LINE>if (!signal.isEmpty()) {<NEW_LINE>killStringToyBox = "toybox pkill -" + signal + " " + module;<NEW_LINE>killString = "pkill -" + signal + " " + module;<NEW_LINE>killStringBusybox = busyboxPath + "pkill -" + signal + " " + module;<NEW_LINE>killAllStringBusybox = busyboxPath + "kill -s " + signal + " $(pgrep " + module + ")";<NEW_LINE>}<NEW_LINE>result = new ArrayList<>(Arrays.asList(killStringBusybox, killAllStringBusybox, killStringToyBox, killString));<NEW_LINE>} else {<NEW_LINE>String killAllStringToolBox = "toolbox kill " + pid;<NEW_LINE>String killStringToyBox = "toybox kill " + pid;<NEW_LINE>String killString = "kill " + pid;<NEW_LINE>String killStringBusyBox = busyboxPath + "kill " + pid;<NEW_LINE>if (!signal.isEmpty()) {<NEW_LINE>killAllStringToolBox = "toolbox kill -s " + signal + " " + pid;<NEW_LINE>killStringToyBox = "toybox kill -s " + signal + " " + pid;<NEW_LINE>killString <MASK><NEW_LINE>killStringBusyBox = busyboxPath + "kill -s " + signal + " " + pid;<NEW_LINE>}<NEW_LINE>result = new ArrayList<>(Arrays.asList(killStringBusyBox, killAllStringToolBox, killStringToyBox, killString));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
= "kill -s " + signal + " " + pid;
1,334,188
private void buildPartitionsSequentially(long dbId, OlapTable table, List<Partition> partitions, int numReplicas, int numBackends) throws DdlException {<NEW_LINE>// Try to bundle at least 200 CreateReplicaTask's in a single AgentBatchTask.<NEW_LINE>// The number 200 is just an experiment value that seems to work without obvious problems, feel free to<NEW_LINE>// change it if you have a better choice.<NEW_LINE>int avgReplicasPerPartition = numReplicas / partitions.size();<NEW_LINE>int partitionGroupSize = Math.max(1, numBackends * 200 / Math.max(1, avgReplicasPerPartition));<NEW_LINE>for (int i = 0; i < partitions.size(); i += partitionGroupSize) {<NEW_LINE>int endIndex = Math.min(partitions.<MASK><NEW_LINE>List<CreateReplicaTask> tasks = buildCreateReplicaTasks(dbId, table, partitions.subList(i, endIndex));<NEW_LINE>int partitionCount = endIndex - i;<NEW_LINE>int indexCountPerPartition = partitions.get(i).getVisibleMaterializedIndicesCount();<NEW_LINE>int timeout = Config.tablet_create_timeout_second * countMaxTasksPerBackend(tasks);<NEW_LINE>// Compatible with older versions, `Config.max_create_table_timeout_second` is the timeout time for a single index.<NEW_LINE>// Here we assume that all partitions have the same number of indexes.<NEW_LINE>int maxTimeout = partitionCount * indexCountPerPartition * Config.max_create_table_timeout_second;<NEW_LINE>try {<NEW_LINE>sendCreateReplicaTasksAndWaitForFinished(tasks, Math.min(timeout, maxTimeout));<NEW_LINE>tasks.clear();<NEW_LINE>} finally {<NEW_LINE>for (CreateReplicaTask task : tasks) {<NEW_LINE>AgentTaskQueue.removeTask(task.getBackendId(), TTaskType.CREATE, task.getSignature());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
size(), i + partitionGroupSize);
247,022
protected void linkAttributes(Agent<?, ?, ?> agent, String assetId, Collection<Attribute<?>> attributes) {<NEW_LINE>withLock(getClass().getSimpleName() + "::linkAttributes", () -> {<NEW_LINE>Protocol<?> protocol = <MASK><NEW_LINE>if (protocol == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.info("Linking asset '" + assetId + "' attributes linked to protocol: assetId=" + assetId + ", attributes=" + attributes.size() + ", protocol=" + protocol);<NEW_LINE>attributes.forEach(attribute -> {<NEW_LINE>AttributeRef attributeRef = new AttributeRef(assetId, attribute.getName());<NEW_LINE>try {<NEW_LINE>if (!protocol.getLinkedAttributes().containsKey(attributeRef)) {<NEW_LINE>LOG.finer("Linking attribute '" + attributeRef + "' to protocol: " + protocol);<NEW_LINE>protocol.linkAttribute(assetId, attribute);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.log(Level.SEVERE, "Failed to link attribute '" + attributeRef + "' to protocol: " + protocol, ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
getProtocolInstance(agent.getId());
30,082
public double readDouble(ByteBuffer buffer) {<NEW_LINE>if (!flag) {<NEW_LINE>flag = true;<NEW_LINE>try {<NEW_LINE>int[] buf = new int[8];<NEW_LINE>for (int i = 0; i < 8; i++) {<NEW_LINE>buf[i] = ReadWriteIOUtils.read(buffer);<NEW_LINE>}<NEW_LINE>long res = 0L;<NEW_LINE>for (int i = 0; i < 8; i++) {<NEW_LINE>res += ((long) buf[i] << (i * 8));<NEW_LINE>}<NEW_LINE>preValue = res;<NEW_LINE>double <MASK><NEW_LINE>leadingZeroNum = Long.numberOfLeadingZeros(preValue);<NEW_LINE>tailingZeroNum = Long.numberOfTrailingZeros(preValue);<NEW_LINE>fillBuffer(buffer);<NEW_LINE>getNextValue(buffer);<NEW_LINE>return tmp;<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("DoublePrecisionDecoderV1 cannot read first double number", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>double tmp = Double.longBitsToDouble(preValue);<NEW_LINE>getNextValue(buffer);<NEW_LINE>return tmp;<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("DoublePrecisionDecoderV1 cannot read following double number", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Double.NaN;<NEW_LINE>}
tmp = Double.longBitsToDouble(preValue);
157,135
public IStatus install(String packageName, String displayName, boolean global, char[] password, IPath workingDirectory, IProgressMonitor monitor) {<NEW_LINE>SubMonitor sub = SubMonitor.convert(monitor, 10);<NEW_LINE>String globalPrefixPath = null;<NEW_LINE>try {<NEW_LINE>// If we are doing a global install we will fetch the global prefix and set it back after the install<NEW_LINE>// completes to the original value<NEW_LINE>if (global) {<NEW_LINE>globalPrefixPath = getGlobalPrefix(global, password, workingDirectory, sub, globalPrefixPath);<NEW_LINE>}<NEW_LINE>sub.setWorkRemaining(8);<NEW_LINE>sub.subTask("Running npm install command");<NEW_LINE>IStatus status = runNpmInstaller(packageName, displayName, global, password, workingDirectory, INSTALL, sub.newChild(6));<NEW_LINE>if (status.getSeverity() == IStatus.CANCEL) {<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>if (!status.isOK()) {<NEW_LINE>String message;<NEW_LINE>if (status instanceof ProcessStatus) {<NEW_LINE>message = ((ProcessStatus) status).getStdErr();<NEW_LINE>} else {<NEW_LINE>message = status.getMessage();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>JSCorePlugin.getDefault(), MessageFormat.format<MASK><NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedInstallError, packageName));<NEW_LINE>} else if (status instanceof ProcessStatus) {<NEW_LINE>String error = ((ProcessStatus) status).getStdErr();<NEW_LINE>if (!StringUtil.isEmpty(error)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] lines = error.split("\n");<NEW_LINE>if (lines.length > 0 && lines[lines.length - 1].contains(NPM_ERROR)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>JSCorePlugin.getDefault(), MessageFormat.format("Failed to install {0}.\n\n{1}", packageName, error));<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedInstallError, packageName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} catch (CoreException ce) {<NEW_LINE>return ce.getStatus();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>// Set the global npm prefix path to its original value.<NEW_LINE>if (!StringUtil.isEmpty(globalPrefixPath)) {<NEW_LINE>try {<NEW_LINE>sub.subTask("Resetting global NPM prefix");<NEW_LINE>setGlobalPrefixPath(password, workingDirectory, sub.newChild(1), globalPrefixPath);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>return e.getStatus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sub.done();<NEW_LINE>}<NEW_LINE>}
("Failed to install {0}.\n\n{1}", packageName, message));
610,172
public void testClientBasicSSL_WebTarget(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("hostname");<NEW_LINE>String serverPort = param.get("secport");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testClientBasicSSL_WebTarget: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService <MASK><NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget wt = c.target("https://" + serverIP + ":" + serverPort + "/" + moduleName + "/Test/BasicResource");<NEW_LINE>wt.property("com.ibm.ws.jaxrs.client.ssl.config", "mySSLConfig");<NEW_LINE>wt = wt.path("echo").path(param.get("param"));<NEW_LINE>Builder builder = wt.request();<NEW_LINE>CompletionStageRxInvoker completionStageRxInvoker = builder.rx();<NEW_LINE>CompletionStage<String> completionStage = completionStageRxInvoker.get(String.class);<NEW_LINE>CompletableFuture<String> completableFuture = completionStage.toCompletableFuture();<NEW_LINE>try {<NEW_LINE>String response = completableFuture.get();<NEW_LINE>ret.append(response);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>}
executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);
89,046
public void delete(Iterable<UserProfileRow> rows) {<NEW_LINE>Multimap<UserProfileRow, UserProfileNamedColumnValue<?>> result = getRowsMultimap(rows);<NEW_LINE>deleteCookiesIdx(result);<NEW_LINE>deleteCreatedIdx(result);<NEW_LINE>deleteUserBirthdaysIdx(result);<NEW_LINE>List<byte[]> rowBytes = Persistables.persistAll(rows);<NEW_LINE>Set<Cell> cells = Sets.newHashSetWithExpectedSize(rowBytes.size() * 4);<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("j")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, <MASK><NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("p")));<NEW_LINE>t.delete(tableRef, cells);<NEW_LINE>}
PtBytes.toCachedBytes("m")));
1,348,643
private List<Future> schedule(Settings settings) {<NEW_LINE>List<Future> futures = new LinkedList<>();<NEW_LINE>if (threadPoolExecutor != null) {<NEW_LINE>logger.info("already scheduled");<NEW_LINE>return futures;<NEW_LINE>}<NEW_LINE>String[] schedule = settings.getAsArray("schedule");<NEW_LINE>Long seconds = settings.getAsTime("interval", TimeValue.timeValueSeconds(0)).seconds();<NEW_LINE>if (schedule != null && schedule.length > 0) {<NEW_LINE>Thread thread = new Thread(this);<NEW_LINE>CronThreadPoolExecutor cronThreadPoolExecutor = new CronThreadPoolExecutor(settings.getAsInt("threadpoolsize", 1));<NEW_LINE>for (String cron : schedule) {<NEW_LINE>futures.add(cronThreadPoolExecutor.schedule(thread, new CronExpression(cron)));<NEW_LINE>}<NEW_LINE>this.threadPoolExecutor = cronThreadPoolExecutor;<NEW_LINE>logger.info("scheduled with cron expressions {}", Arrays.asList(schedule));<NEW_LINE>} else if (seconds > 0L) {<NEW_LINE>Thread thread = new Thread(this);<NEW_LINE>ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(settings<MASK><NEW_LINE>futures.add(scheduledThreadPoolExecutor.scheduleAtFixedRate(thread, 0L, seconds, TimeUnit.SECONDS));<NEW_LINE>this.threadPoolExecutor = scheduledThreadPoolExecutor;<NEW_LINE>logger.info("scheduled at fixed rate of {} seconds", seconds);<NEW_LINE>}<NEW_LINE>return futures;<NEW_LINE>}
.getAsInt("threadpoolsize", 1));
141,517
public void publish(@Nonnull List<? extends EventMessage<?>> events) {<NEW_LINE>List<MessageMonitor.MonitorCallback> ingested = events.stream().map(messageMonitor::onMessageIngested).collect(Collectors.toList());<NEW_LINE>if (CurrentUnitOfWork.isStarted()) {<NEW_LINE>UnitOfWork<?> unitOfWork = CurrentUnitOfWork.get();<NEW_LINE>Assert.state(!unitOfWork.phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the current Unit of Work has already been " + "committed. Please start a new Unit of Work before publishing events.");<NEW_LINE>Assert.state(!unitOfWork.root().phase().isAfter(PREPARE_COMMIT), () -> "It is not allowed to publish events when the root Unit of Work has already been " + "committed.");<NEW_LINE>unitOfWork.afterCommit(u -> ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess));<NEW_LINE>unitOfWork.onRollback(uow -> ingested.forEach(message -> message.reportFailure(uow.getExecutionResult().getExceptionResult())));<NEW_LINE>eventsQueue<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>prepareCommit(intercept(events));<NEW_LINE>commit(events);<NEW_LINE>afterCommit(events);<NEW_LINE>ingested.forEach(MessageMonitor.MonitorCallback::reportSuccess);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ingested.forEach(m -> m.reportFailure(e));<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(unitOfWork).addAll(events);
368,233
public ListUserPoolClientsResult listUserPoolClients(ListUserPoolClientsRequest listUserPoolClientsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUserPoolClientsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUserPoolClientsRequest> request = null;<NEW_LINE>Response<ListUserPoolClientsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListUserPoolClientsResult, JsonUnmarshallerContext> unmarshaller = new ListUserPoolClientsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListUserPoolClientsResult> responseHandler = new JsonResponseHandler<ListUserPoolClientsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
ListUserPoolClientsRequestMarshaller().marshall(listUserPoolClientsRequest);
658,886
private void loadWebInfMap(String webInfPath, List loadedLocations) {<NEW_LINE>// No need to search META-INF resources<NEW_LINE>if (ctxt != null) {<NEW_LINE>Set libSet = ctxt.getResourcePaths(webInfPath, false);<NEW_LINE>if (libSet != null) {<NEW_LINE><MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>String resourcePath = (String) it.next();<NEW_LINE>loadWebInfMapHelper(resourcePath, loadedLocations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>boolean directory = false;<NEW_LINE>com.ibm.wsspi.adaptable.module.Entry entry = container.getEntry(webInfPath);<NEW_LINE>if (entry != null) {<NEW_LINE>Container subEntryContainer;<NEW_LINE>try {<NEW_LINE>subEntryContainer = entry.adapt(Container.class);<NEW_LINE>} catch (UnableToAdaptException e1) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>// Do you need FFDC here? Remember FFDC instrumentation and @FFDCIgnore<NEW_LINE>// https://websphere.pok.ibm.com/~liberty/secure/docs/dev/API/com.ibm.ws.ras/com/ibm/ws/ffdc/annotation/FFDCIgnore.html<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process if it's a directory. If webInfPath is a jar, it was already processed by loadTldsFromJar<NEW_LINE>if (subEntryContainer != null && entry.getSize() == 0 && !webInfPath.endsWith(".jar")) {<NEW_LINE>// PI83486<NEW_LINE>directory = true;<NEW_LINE>for (com.ibm.wsspi.adaptable.module.Entry subEntry : subEntryContainer) {<NEW_LINE>loadWebInfMap(subEntry.getPath(), loadedLocations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!directory) {<NEW_LINE>String resourcePath = entry.getPath();<NEW_LINE>loadWebInfMapHelper(resourcePath, loadedLocations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Iterator it = libSet.iterator();
647,337
public ClientStats stats() {<NEW_LINE>final LoadingCache<BufferedIncrement, BufferedIncrement.Amount> cache = increment_buffer;<NEW_LINE>long inflight_rpcs = 0;<NEW_LINE>long pending_rpcs = 0;<NEW_LINE>long pending_batched_rpcs = 0;<NEW_LINE>int dead_region_clients = 0;<NEW_LINE>final Collection<RegionClient> region_clients = client2regions.keySet();<NEW_LINE>for (final RegionClient rc : region_clients) {<NEW_LINE>final <MASK><NEW_LINE>inflight_rpcs += stats.inflightRPCs();<NEW_LINE>pending_rpcs += stats.pendingRPCs();<NEW_LINE>pending_batched_rpcs += stats.pendingBatchedRPCs();<NEW_LINE>if (stats.isDead()) {<NEW_LINE>dead_region_clients++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ClientStats(num_connections_created.get(), root_lookups.get(), meta_lookups_with_permit.get(), meta_lookups_wo_permit.get(), num_flushes.get(), num_nsres.get(), num_nsre_rpcs.get(), num_multi_rpcs.get(), num_gets.get(), num_scanners_opened.get(), num_scans.get(), num_puts.get(), num_appends.get(), num_row_locks.get(), num_deletes.get(), num_atomic_increments.get(), cache != null ? cache.stats() : BufferedIncrement.ZERO_STATS, inflight_rpcs, pending_rpcs, pending_batched_rpcs, dead_region_clients, region_clients.size(), idle_connections_closed.get());<NEW_LINE>}
RegionClientStats stats = rc.stats();
886,470
public StartSelector unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartSelector startSelector = new StartSelector();<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("StartSelectorType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSelector.setStartSelectorType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AfterFragmentNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSelector.setAfterFragmentNumber(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("StartTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSelector.setStartTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ContinuationToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSelector.setContinuationToken(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 startSelector;<NEW_LINE>}
class).unmarshall(context));
540,287
public void apply(Activity activity, FormatItem format, boolean force) {<NEW_LINE>setContext(activity);<NEW_LINE>if (activity == null) {<NEW_LINE>Log.e(TAG, "Activity in null. exiting...");<NEW_LINE>if (mListener != null) {<NEW_LINE>mListener.onCancel();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (format == null) {<NEW_LINE>Log.e(TAG, "Can't apply mode change: format is null");<NEW_LINE>if (mListener != null) {<NEW_LINE>mListener.onCancel();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isSupported()) {<NEW_LINE>Log.e(TAG, "Autoframerate not supported. Exiting...");<NEW_LINE>if (mListener != null) {<NEW_LINE>mListener.onCancel();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (System.currentTimeMillis() - mPrevCall < THROTTLE_INTERVAL_MS) {<NEW_LINE><MASK><NEW_LINE>if (mListener != null) {<NEW_LINE>mListener.onCancel();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>mPrevCall = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>int width = format.getWidth();<NEW_LINE>float frameRate = correctFrameRate(format.getFrameRate());<NEW_LINE>Pair<Integer, Float> currentFormat = new Pair<>(width, frameRate);<NEW_LINE>Log.d(TAG, String.format("Applying mode change... Video fps: %s, width: %s, height: %s", frameRate, width, format.getHeight()));<NEW_LINE>syncMode(activity, width, frameRate, force);<NEW_LINE>}
Log.e(TAG, "Throttling afr calls...");
82,555
private void generateCreateErrorMethods(ClassWriter cw, List<BIRNode.BIRTypeDefinition> errorTypeDefList, String moduleInitClass, String typeOwnerClass, SymbolTable symbolTable) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, CREATE_ERROR_VALUE, CREATE_ERROR, null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>if (errorTypeDefList.isEmpty()) {<NEW_LINE>createDefaultCase(mv, new Label(), 0, "No such error: ");<NEW_LINE>} else {<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE><MASK><NEW_LINE>mv.visitVarInsn(ALOAD, 2);<NEW_LINE>mv.visitVarInsn(ALOAD, 3);<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, typeOwnerClass, CREATE_ERROR_VALUE + 0, CREATE_ERROR, false);<NEW_LINE>mv.visitInsn(ARETURN);<NEW_LINE>generateCreateErrorMethodSplits(cw, errorTypeDefList, moduleInitClass, typeOwnerClass, symbolTable);<NEW_LINE>}<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>}
mv.visitVarInsn(ALOAD, 1);
256,490
public List<Document> bulkFetch(List<DBRef> refs) {<NEW_LINE><MASK><NEW_LINE>Assert.notNull(refs, "DBRef to fetch must not be null!");<NEW_LINE>if (refs.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>String collection = refs.iterator().next().getCollectionName();<NEW_LINE>List<Object> ids = new ArrayList<>(refs.size());<NEW_LINE>for (DBRef ref : refs) {<NEW_LINE>if (!collection.equals(ref.getCollectionName())) {<NEW_LINE>throw new InvalidDataAccessApiUsageException("DBRefs must all target the same collection for bulk fetch operation.");<NEW_LINE>}<NEW_LINE>ids.add(ref.getId());<NEW_LINE>}<NEW_LINE>DBRef databaseSource = refs.iterator().next();<NEW_LINE>MongoCollection<Document> mongoCollection = getCollection(databaseSource);<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace(String.format("Bulk fetching DBRefs %s from %s.%s.", ids, StringUtils.hasText(databaseSource.getDatabaseName()) ? databaseSource.getDatabaseName() : mongoCollection.getNamespace().getDatabaseName(), databaseSource.getCollectionName()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>List<Document> //<NEW_LINE>result = //<NEW_LINE>mongoCollection.//<NEW_LINE>find(new Document(BasicMongoPersistentProperty.ID_FIELD_NAME, new Document("$in", ids))).into(new ArrayList<>());<NEW_LINE>return //<NEW_LINE>//<NEW_LINE>ids.stream().//<NEW_LINE>flatMap(id -> documentWithId(id, result)).collect(Collectors.toList());<NEW_LINE>}
Assert.notNull(mongoDbFactory, "Factory must not be null!");
432,160
public static ListAsrVocabResponse unmarshall(ListAsrVocabResponse listAsrVocabResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAsrVocabResponse.setRequestId(_ctx.stringValue("ListAsrVocabResponse.RequestId"));<NEW_LINE>listAsrVocabResponse.setCode<MASK><NEW_LINE>listAsrVocabResponse.setMessage(_ctx.stringValue("ListAsrVocabResponse.Message"));<NEW_LINE>listAsrVocabResponse.setSuccess(_ctx.booleanValue("ListAsrVocabResponse.Success"));<NEW_LINE>List<AsrVocab> data = new ArrayList<AsrVocab>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAsrVocabResponse.Data.Length"); i++) {<NEW_LINE>AsrVocab asrVocab = new AsrVocab();<NEW_LINE>asrVocab.setVocabularyId(_ctx.stringValue("ListAsrVocabResponse.Data[" + i + "].VocabularyId"));<NEW_LINE>asrVocab.setUpdateTime(_ctx.stringValue("ListAsrVocabResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>asrVocab.setName(_ctx.stringValue("ListAsrVocabResponse.Data[" + i + "].Name"));<NEW_LINE>asrVocab.setCreateTime(_ctx.stringValue("ListAsrVocabResponse.Data[" + i + "].CreateTime"));<NEW_LINE>asrVocab.setId(_ctx.stringValue("ListAsrVocabResponse.Data[" + i + "].Id"));<NEW_LINE>data.add(asrVocab);<NEW_LINE>}<NEW_LINE>listAsrVocabResponse.setData(data);<NEW_LINE>return listAsrVocabResponse;<NEW_LINE>}
(_ctx.stringValue("ListAsrVocabResponse.Code"));
1,117,252
public Object destination(String destPropertyPath) {<NEW_LINE>if (destPropertyPath == null)<NEW_LINE>errors.errorNullArgument("destPropertyPath");<NEW_LINE>String[] propertyNames = DOT_PATTERN.split(destPropertyPath);<NEW_LINE>destinationMutators = new ArrayList<Mutator>(propertyNames.length);<NEW_LINE>ValueWriter<?> valueWriter = configuration.valueMutateStore.getFirstSupportedWriter(destinationType);<NEW_LINE>if (valueWriter != null)<NEW_LINE>for (String propertyName : propertyNames) destinationMutators.add(ValueWriterPropertyInfo.create(valueWriter, propertyName));<NEW_LINE>else {<NEW_LINE>Mutator mutator = null;<NEW_LINE>for (String propertyName : propertyNames) {<NEW_LINE>Class<?> propertyType = mutator == null ? destinationType : mutator.getType();<NEW_LINE>mutator = PropertyInfoRegistry.<MASK><NEW_LINE>if (mutator == null) {<NEW_LINE>errors.errorInvalidDestinationPath(destPropertyPath, propertyType, propertyName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>destinationMutators.add(mutator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
mutatorFor(propertyType, propertyName, configuration);
1,321,723
public void doCollectInformation(@Nonnull ProgressIndicator progress) {<NEW_LINE>final List<LineMarkerInfo<PsiElement>> lineMarkers = new ArrayList<>();<NEW_LINE>FileViewProvider viewProvider = myFile.getViewProvider();<NEW_LINE>for (Language language : viewProvider.getLanguages()) {<NEW_LINE>final PsiFile root = viewProvider.getPsi(language);<NEW_LINE>HighlightingLevelManager highlightingLevelManager = HighlightingLevelManager.getInstance(myProject);<NEW_LINE>if (!highlightingLevelManager.shouldHighlight(root))<NEW_LINE>continue;<NEW_LINE>Divider.divideInsideAndOutsideInOneRoot(root, myRestrictRange, myPriorityBounds, elements -> {<NEW_LINE>Collection<LineMarkerProvider> providers = getMarkerProviders(language, myProject);<NEW_LINE>List<LineMarkerProvider> providersList = new ArrayList<>(providers);<NEW_LINE>queryProviders(elements.inside, root, providersList, (element, info) -> {<NEW_LINE>lineMarkers.add(info);<NEW_LINE>ApplicationManager.getApplication().invokeLater(() -> {<NEW_LINE>if (isValid()) {<NEW_LINE>LineMarkersUtil.addLineMarkerToEditorIncrementally(<MASK><NEW_LINE>}<NEW_LINE>}, myProject.getDisposed());<NEW_LINE>});<NEW_LINE>queryProviders(elements.outside, root, providersList, (element, info) -> lineMarkers.add(info));<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>myMarkers = mergeLineMarkers(lineMarkers, getDocument());<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("LineMarkersPass.doCollectInformation. lineMarkers: " + lineMarkers + "; merged: " + myMarkers);<NEW_LINE>}<NEW_LINE>}
myProject, getDocument(), info);
1,548,054
protected final PutObjectRequest updateInstructionPutRequest(PutObjectRequest req, ContentCryptoMaterial cekMaterial) {<NEW_LINE>byte[] bytes = cekMaterial.toJsonString(cryptoConfig.getCryptoMode()).getBytes(UTF8);<NEW_LINE>ObjectMetadata metadata = req.getMetadata();<NEW_LINE>if (metadata == null) {<NEW_LINE>metadata = new ObjectMetadata();<NEW_LINE>req.setMetadata(metadata);<NEW_LINE>}<NEW_LINE>// Removes the original content MD5 if present from the meta data.<NEW_LINE>metadata.setContentMD5(null);<NEW_LINE>// Set the content-length of the upload<NEW_LINE>metadata.setContentLength(bytes.length);<NEW_LINE>// Set the crypto instruction file header<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_INSTRUCTION_FILE, "");<NEW_LINE>// Update the instruction request<NEW_LINE>req.setMetadata(metadata);<NEW_LINE>req.<MASK><NEW_LINE>// the file attribute in the request is always null before calling this<NEW_LINE>// routine<NEW_LINE>return req;<NEW_LINE>}
setInputStream(new ByteArrayInputStream(bytes));
767,935
protected void updateEntityClient() {<NEW_LINE>if (PersonalConfig.machineParticlesEnabled.get() && isActive()) {<NEW_LINE>double x = getPos().getX() + world.rand.nextFloat();<NEW_LINE>double y = getPos().getY() + world.rand.nextFloat();<NEW_LINE>double z = getPos().getZ() + world.rand.nextFloat();<NEW_LINE>world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x, y, <MASK><NEW_LINE>world.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0.0D, 0.0D, 0.0D);<NEW_LINE>this.prevMobRotation = this.mobRotation;<NEW_LINE>this.mobRotation = (this.mobRotation + 1000.0F / ((1F - getProgress()) * 800F + 200.0F)) % 360.0D;<NEW_LINE>if (cachedEntity == null && hasEntity()) {<NEW_LINE>cachedEntity = capturedMob.getEntity(world, pos, null, false);<NEW_LINE>if (cachedEntity != null) {<NEW_LINE>cachedEntity.setDead();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.updateEntityClient();<NEW_LINE>}
z, 0.0D, 0.0D, 0.0D);
1,844,125
public void marshall(MLModel mLModel, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (mLModel == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(mLModel.getMLModelId(), MLMODELID_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getTrainingDataSourceId(), TRAININGDATASOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getCreatedByIamUser(), CREATEDBYIAMUSER_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getLastUpdatedAt(), LASTUPDATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getSizeInBytes(), SIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getEndpointInfo(), ENDPOINTINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getTrainingParameters(), TRAININGPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getInputDataLocationS3(), INPUTDATALOCATIONS3_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getAlgorithm(), ALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getMLModelType(), MLMODELTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getScoreThreshold(), SCORETHRESHOLD_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getScoreThresholdLastUpdatedAt(), SCORETHRESHOLDLASTUPDATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getMessage(), MESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getComputeTime(), COMPUTETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getFinishedAt(), FINISHEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(mLModel.getStartedAt(), STARTEDAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,832,002
public void deleteAttachmentsByTaskId(String taskId) {<NEW_LINE>checkHistoryEnabled();<NEW_LINE>List<AttachmentEntity> attachments = getDbSqlSession().selectList("selectAttachmentsByTaskId", taskId);<NEW_LINE>boolean dispatchEvents = getProcessEngineConfiguration().getEventDispatcher().isEnabled();<NEW_LINE>String processInstanceId = null;<NEW_LINE>String processDefinitionId = null;<NEW_LINE>String executionId = null;<NEW_LINE>if (dispatchEvents && attachments != null && !attachments.isEmpty()) {<NEW_LINE>// Forced to fetch the task to get hold of the process definition for event-dispatching, if available<NEW_LINE>Task task = getTaskManager().findTaskById(taskId);<NEW_LINE>if (task != null) {<NEW_LINE>processDefinitionId = task.getProcessDefinitionId();<NEW_LINE>processInstanceId = task.getProcessInstanceId();<NEW_LINE>executionId = task.getExecutionId();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (AttachmentEntity attachment : attachments) {<NEW_LINE><MASK><NEW_LINE>if (contentId != null) {<NEW_LINE>getByteArrayManager().deleteByteArrayById(contentId);<NEW_LINE>}<NEW_LINE>getDbSqlSession().delete(attachment);<NEW_LINE>if (dispatchEvents) {<NEW_LINE>getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, attachment, executionId, processInstanceId, processDefinitionId), EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String contentId = attachment.getContentId();
1,344,589
public boolean checkInterveningIfClause(Game game) {<NEW_LINE>Effect effect = <MASK><NEW_LINE>UUID targetId = (UUID) effect.getValue("targetId");<NEW_LINE>GameEvent.EventType eventType = (GameEvent.EventType) effect.getValue("eventType");<NEW_LINE>UUID exileId = (UUID) effect.getValue("exileId");<NEW_LINE>if (targetId != null && eventType != null && exileId != null) {<NEW_LINE>if (eventType == GameEvent.EventType.LAND_PLAYED) {<NEW_LINE>Permanent permanent = game.getPermanent(targetId);<NEW_LINE>return permanent != null && checkCardTypes(permanent.getCardType(game), exileId, game);<NEW_LINE>} else if (eventType == GameEvent.EventType.SPELL_CAST) {<NEW_LINE>Spell spell = game.getSpellOrLKIStack(targetId);<NEW_LINE>return spell != null && checkCardTypes(spell.getCardType(game), exileId, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getEffects().get(0);
1,831,470
public void afterPropertiesSet() throws Exception {<NEW_LINE>TaskTrackerProperties properties = null;<NEW_LINE>if (locations == null || locations.length == 0) {<NEW_LINE>properties = new TaskTrackerProperties();<NEW_LINE>properties.setClusterName(clusterName);<NEW_LINE>properties.setDataPath(dataPath);<NEW_LINE>properties.setNodeGroup(nodeGroup);<NEW_LINE>properties.setRegistryAddress(registryAddress);<NEW_LINE>properties.setBindIp(bindIp);<NEW_LINE>properties.setIdentity(identity);<NEW_LINE>properties.setBizLoggerLevel(bizLoggerLevel);<NEW_LINE>properties.setWorkThreads(workThreads);<NEW_LINE>properties.setConfigs(CollectionUtils.toMap(configs));<NEW_LINE>} else {<NEW_LINE>properties = PropertiesConfigurationFactory.createPropertiesConfiguration(TaskTrackerProperties.class, locations);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>taskTracker.setRunnerFactory(new RunnerFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JobRunner newRunner() {<NEW_LINE>return createJobRunner();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (masterChangeListeners != null) {<NEW_LINE>for (MasterChangeListener masterChangeListener : masterChangeListeners) {<NEW_LINE>taskTracker.addMasterChangeListener(masterChangeListener);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
taskTracker = TaskTrackerBuilder.buildByProperties(properties);
1,209,827
public DnsRuleGroupLimitExceededViolation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DnsRuleGroupLimitExceededViolation dnsRuleGroupLimitExceededViolation = new DnsRuleGroupLimitExceededViolation();<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>if (context.testExpression("ViolationTarget", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dnsRuleGroupLimitExceededViolation.setViolationTarget(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ViolationTargetDescription", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dnsRuleGroupLimitExceededViolation.setViolationTargetDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NumberOfRuleGroupsAlreadyAssociated", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dnsRuleGroupLimitExceededViolation.setNumberOfRuleGroupsAlreadyAssociated(context.getUnmarshaller(Integer.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 dnsRuleGroupLimitExceededViolation;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
144,680
public static RecalibrationReport apply(final JavaPairRDD<GATKRead, Iterable<GATKVariant>> readsWithVariants, final SAMFileHeader header, final String referenceFileName, final RecalibrationArgumentCollection recalArgs) {<NEW_LINE>JavaRDD<RecalibrationTables> unmergedTables = readsWithVariants.mapPartitions(readsWithVariantsIterator -> {<NEW_LINE>String pathOnExecutor = SparkFiles.get(referenceFileName);<NEW_LINE>ReferenceDataSource referenceDataSource = new ReferenceFileSource(IOUtils.getPath(pathOnExecutor));<NEW_LINE>final BaseRecalibrationEngine bqsr = new BaseRecalibrationEngine(recalArgs, header);<NEW_LINE>bqsr.logCovariatesUsed();<NEW_LINE>Utils.stream(readsWithVariantsIterator).forEach(t -> bqsr.processRead(t._1, referenceDataSource, t._2));<NEW_LINE>return Iterators.singletonIterator(bqsr.getRecalibrationTables());<NEW_LINE>});<NEW_LINE>final RecalibrationTables emptyRecalibrationTable = new RecalibrationTables(new StandardCovariateList(recalArgs, header));<NEW_LINE>final RecalibrationTables combinedTables = unmergedTables.treeAggregate(emptyRecalibrationTable, RecalibrationTables::inPlaceCombine, RecalibrationTables::inPlaceCombine, Math.max(1, (int) (Math.log(unmergedTables.partitions().size()) / Math.log(2))));<NEW_LINE>BaseRecalibrationEngine.finalizeRecalibrationTables(combinedTables);<NEW_LINE>final QuantizationInfo quantizationInfo = new QuantizationInfo(combinedTables, recalArgs.QUANTIZING_LEVELS);<NEW_LINE>final StandardCovariateList covariates = new StandardCovariateList(recalArgs, header);<NEW_LINE>return RecalUtils.createRecalibrationReport(recalArgs.generateReportTable(covariates.covariateNames()), quantizationInfo.generateReportTable(), RecalUtils<MASK><NEW_LINE>}
.generateReportTables(combinedTables, covariates));
139,302
public static Result execute(Step step, Actions actions) {<NEW_LINE>String text = step.getText();<NEW_LINE>List<MethodMatch> matches = findMethodsMatching(text);<NEW_LINE>if (matches.isEmpty()) {<NEW_LINE>KarateException e = new KarateException("no step-definition method match found for: " + text);<NEW_LINE>return Result.failed(0, e, step);<NEW_LINE>} else if (matches.size() > 1) {<NEW_LINE>KarateException e = new KarateException("more than one step-definition method matched: " + text + " - " + matches);<NEW_LINE>return Result.failed(0, e, step);<NEW_LINE>}<NEW_LINE>MethodMatch <MASK><NEW_LINE>Object last;<NEW_LINE>if (step.getDocString() != null) {<NEW_LINE>last = step.getDocString();<NEW_LINE>} else if (step.getTable() != null) {<NEW_LINE>last = step.getTable().getRowsAsMaps();<NEW_LINE>} else {<NEW_LINE>last = null;<NEW_LINE>}<NEW_LINE>Object[] args;<NEW_LINE>try {<NEW_LINE>args = match.convertArgs(last);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// edge case where user error causes [request =] to match [request docstring]<NEW_LINE>KarateException e = new KarateException("no step-definition method match found for: " + text);<NEW_LINE>return Result.failed(0, e, step);<NEW_LINE>}<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>try {<NEW_LINE>match.method.invoke(actions, args);<NEW_LINE>if (actions.isAborted()) {<NEW_LINE>return Result.aborted(getElapsedTimeNanos(startTime), match);<NEW_LINE>} else if (actions.isFailed()) {<NEW_LINE>return Result.failed(getElapsedTimeNanos(startTime), actions.getFailedReason(), step, match);<NEW_LINE>} else {<NEW_LINE>return Result.passed(getElapsedTimeNanos(startTime), match);<NEW_LINE>}<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>return Result.failed(getElapsedTimeNanos(startTime), e.getTargetException(), step, match);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return Result.failed(getElapsedTimeNanos(startTime), e, step, match);<NEW_LINE>}<NEW_LINE>}
match = matches.get(0);
1,842,324
final GetMapTileResult executeGetMapTile(GetMapTileRequest getMapTileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMapTileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMapTileRequest> request = null;<NEW_LINE>Response<GetMapTileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMapTileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMapTileRequest));<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, "Location");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMapTile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "maps.";<NEW_LINE>String resolvedHostPrefix = String.format("maps.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMapTileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(false), new GetMapTileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,670,965
private void addActionButtonToFab(@NonNull FloatingActionMenu actionsMenu, @Nullable Integer bgColorOverride, @Nullable Integer iconColorOverride, @NonNull String name, @DrawableRes int icon, @NonNull View.OnClickListener listener) {<NEW_LINE>FloatingActionButton button = new FloatingActionButton(getContext());<NEW_LINE>int buttonColor = bgColorOverride == null ? MaterialColors.getColor(button, R.attr.proton_interaction_weak) : bgColorOverride;<NEW_LINE>button.setColorNormal(buttonColor);<NEW_LINE>button.setColorPressed(buttonColor);<NEW_LINE>button.setButtonSize(1);<NEW_LINE>int iconColor = iconColorOverride == null ? MaterialColors.getColor(button, <MASK><NEW_LINE>// FloatingActionButton is an ImageView but has custom drawing implementation that breaks image<NEW_LINE>// tinting.<NEW_LINE>Drawable iconDrawable = ContextCompat.getDrawable(getContext(), icon);<NEW_LINE>if (iconDrawable != null) {<NEW_LINE>iconDrawable = iconDrawable.mutate();<NEW_LINE>iconDrawable.setTint(iconColor);<NEW_LINE>button.setImageDrawable(iconDrawable);<NEW_LINE>}<NEW_LINE>button.setLabelText(name);<NEW_LINE>button.setOnClickListener(listener);<NEW_LINE>actionsMenu.addMenuButton(button);<NEW_LINE>}
R.attr.proton_icon_norm) : iconColorOverride;
1,310,283
public void notifyResponse(V8Request request, V8Response response) {<NEW_LINE>Pair<JSLineBreakpoint, Location> lbLoc;<NEW_LINE>synchronized (submittingBreakpoints) {<NEW_LINE>lbLoc = submittingBreakpoints.remove(request.getArguments());<NEW_LINE>}<NEW_LINE>if (lbLoc == null) {<NEW_LINE>LOG.log(Level.INFO, "Did not find a submitting breakpoint for response {0}, request was {1}", new Object[] { response, request });<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (response != null) {<NEW_LINE>SetBreakpoint.ResponseBody sbrb = (SetBreakpoint.ResponseBody) response.getBody();<NEW_LINE>long id = sbrb.getBreakpoint();<NEW_LINE>Location bpLoc = lbLoc.second();<NEW_LINE>SubmittedBreakpoint sb = new SubmittedBreakpoint(lb, id, bpLoc, sbrb.getActualLocations(), dbg);<NEW_LINE>boolean removed;<NEW_LINE>synchronized (submittedBreakpoints) {<NEW_LINE>submittedBreakpoints.put(lb, sb);<NEW_LINE>breakpointsById.put(id, sb);<NEW_LINE>removed = removeAfterSubmit.remove(lb);<NEW_LINE>}<NEW_LINE>if (removed) {<NEW_LINE>requestRemove(lb, id);<NEW_LINE>sb.notifyDestroyed();<NEW_LINE>} else {<NEW_LINE>JSBreakpointStatus.setValid(lb, Bundle.MSG_BRKP_Resolved());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>JSBreakpointStatus.setInvalid(lb, response.getErrorMessage());<NEW_LINE>}<NEW_LINE>}
JSLineBreakpoint lb = lbLoc.first();
1,781,489
private void updateVolumeAfterMigration(Answer answer, DataObject srcData, DataObject destData) {<NEW_LINE>VolumeVO destinationVO = volDao.findById(destData.getId());<NEW_LINE>if (!(answer instanceof MigrateVolumeAnswer)) {<NEW_LINE>// OfflineVmwareMigration: reset states and such<NEW_LINE>VolumeVO sourceVO = volDao.findById(srcData.getId());<NEW_LINE>sourceVO.setState(Volume.State.Ready);<NEW_LINE>volDao.update(sourceVO.getId(), sourceVO);<NEW_LINE>if (destinationVO.getId() != sourceVO.getId()) {<NEW_LINE>destinationVO.setState(Volume.State.Expunged);<NEW_LINE>destinationVO.setRemoved(new Date());<NEW_LINE>volDao.update(destinationVO.getId(), destinationVO);<NEW_LINE>}<NEW_LINE>throw new CloudRuntimeException(<MASK><NEW_LINE>}<NEW_LINE>MigrateVolumeAnswer ans = (MigrateVolumeAnswer) answer;<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>String format = "retrieved '%s' as new path for volume(%d)";<NEW_LINE>s_logger.debug(String.format(format, ans.getVolumePath(), destData.getId()));<NEW_LINE>}<NEW_LINE>// OfflineVmwareMigration: update the volume with new pool/volume path<NEW_LINE>destinationVO.setPoolId(destData.getDataStore().getId());<NEW_LINE>destinationVO.setPath(ans.getVolumePath());<NEW_LINE>volDao.update(destinationVO.getId(), destinationVO);<NEW_LINE>}
"unexpected answer from hypervisor agent: " + answer.getDetails());
414,988
final DeleteTableResult executeDeleteTable(DeleteTableRequest deleteTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTableRequest> request = null;<NEW_LINE>Response<DeleteTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTableRequestProtocolMarshaller(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, "Keyspaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTableResultJsonUnmarshaller());<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(deleteTableRequest));
11,744
public void execute(AdminCommandContext context) {<NEW_LINE>final ActionReport report = context.getActionReport();<NEW_LINE>// No duplicate auth realms found. So add one.<NEW_LINE>try {<NEW_LINE>ConfigSupport.apply(new SingleConfigCode<SecurityService>() {<NEW_LINE><NEW_LINE>public Object run(SecurityService param) throws PropertyVetoException, TransactionFailure {<NEW_LINE>JaccProvider newJacc = <MASK><NEW_LINE>newJacc.setName(jaccProviderName);<NEW_LINE>newJacc.setPolicyConfigurationFactoryProvider(polConfFactoryClass);<NEW_LINE>newJacc.setPolicyProvider(polProviderClass);<NEW_LINE>configureProperties(newJacc);<NEW_LINE>param.getJaccProvider().add(newJacc);<NEW_LINE>return newJacc;<NEW_LINE>}<NEW_LINE>}, securityService);<NEW_LINE>} catch (TransactionFailure e) {<NEW_LINE>report.setMessage(localStrings.getLocalString("create.auth.realm.fail", "Creation of Authrealm {0} failed", jaccProviderName) + " " + e.getLocalizedMessage());<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>report.setFailureCause(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.SUCCESS);<NEW_LINE>}
param.createChild(JaccProvider.class);
851,111
public boolean isSame(FilterState other) {<NEW_LINE>Boolean wasEnabled = (Boolean) other.get(ENABLED_KEY);<NEW_LINE>if (!wasEnabled && !isEnabled) {<NEW_LINE>// we were disabled and we are still disabled...so we are considered unchanged<NEW_LINE>// for purposes of filtering<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (wasEnabled && isEnabled) {<NEW_LINE>// our enabled state hasn't changed, so we now must look at the text in our<NEW_LINE>// range fields<NEW_LINE>String oldLowerText = (String) other.get(lowerAddressRangeTextField.getName());<NEW_LINE><MASK><NEW_LINE>if (!currentLowerText.equals(oldLowerText)) {<NEW_LINE>// lower range has changed<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String oldUpperText = (String) other.get(upperAddressRangeTextField.getName());<NEW_LINE>String currentUpperText = upperAddressRangeTextField.getText();<NEW_LINE>if (!currentUpperText.equals(oldUpperText)) {<NEW_LINE>// upper range has changed<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// our enabled states have changed...we are different<NEW_LINE>return false;<NEW_LINE>}
String currentLowerText = lowerAddressRangeTextField.getText();
464,713
private Builder buildArg() {<NEW_LINE>if (this.path.startsWith(TUNNEL)) {<NEW_LINE>String remain = StringUtils.removeStart(path, TUNNEL);<NEW_LINE>String[] tokens = StringUtils.split(remain, '@');<NEW_LINE>if (tokens.length != 2) {<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}<NEW_LINE>String[] idKey = StringUtils.split(tokens[0], ':');<NEW_LINE>if (idKey.length != 2) {<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}<NEW_LINE>Builder odpsConfigBuilder = QueryFlowOuterClass.OdpsOutputConfig.newBuilder().setAccessId(idKey[0]).setAccessKey(idKey[1]);<NEW_LINE>String[] endpointAndOthers = StringUtils.split(tokens[1], '#');<NEW_LINE>if (endpointAndOthers.length != 2) {<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}<NEW_LINE>odpsConfigBuilder.setEndpoint(endpointAndOthers[0]);<NEW_LINE>String[] details = StringUtils.split<MASK><NEW_LINE>for (String detail : details) {<NEW_LINE>String[] keyValue = StringUtils.split(detail, '=');<NEW_LINE>if (keyValue.length != 2) {<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}<NEW_LINE>if (keyValue[0].equalsIgnoreCase("project")) {<NEW_LINE>odpsConfigBuilder.setProject(keyValue[1]);<NEW_LINE>} else if (keyValue[0].equalsIgnoreCase("table")) {<NEW_LINE>odpsConfigBuilder.setTableName(keyValue[1]);<NEW_LINE>} else if (keyValue[0].equalsIgnoreCase("ds")) {<NEW_LINE>odpsConfigBuilder.setDs(keyValue[1]);<NEW_LINE>} else {<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return odpsConfigBuilder;<NEW_LINE>}<NEW_LINE>throw ILLEGAL_TUNNEL_EXCEPTION;<NEW_LINE>}
(endpointAndOthers[1], '&');
1,454,335
public Sheet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Sheet sheet = new Sheet();<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("SheetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sheet.setSheetId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sheet.setName(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 sheet;<NEW_LINE>}
class).unmarshall(context));
1,818,417
public void visit(String name, Object value) {<NEW_LINE>// Skip null<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (value instanceof String) {<NEW_LINE>collector.queries(StringQuery.class).forEach(q -> {<NEW_LINE>q.match((String) value);<NEW_LINE>collector.addMatched(context, q);<NEW_LINE>});<NEW_LINE>} else if (value instanceof Number) {<NEW_LINE>collector.queries(ValueQuery.class).forEach(q -> {<NEW_LINE>q.match(value);<NEW_LINE>collector.addMatched(context, q);<NEW_LINE>});<NEW_LINE>} else if (value instanceof Character) {<NEW_LINE>int cval = (Character) value;<NEW_LINE>collector.queries(ValueQuery.class).forEach(q -> {<NEW_LINE>q.match(cval);<NEW_LINE>collector.addMatched(context, q);<NEW_LINE>});<NEW_LINE>} else if (value.getClass().isArray()) {<NEW_LINE>int length = Array.getLength(value);<NEW_LINE>Object[] array = new Object[length];<NEW_LINE>for (int i = 0; i < length; i++) array[i] = <MASK><NEW_LINE>collector.queries(ValueQuery.class).forEach(q -> {<NEW_LINE>for (Object i : array) q.match(i);<NEW_LINE>collector.addMatched(context, q);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
Array.get(value, i);
589,141
public static DescribeSlowLogRecordsResponse unmarshall(DescribeSlowLogRecordsResponse describeSlowLogRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSlowLogRecordsResponse.setRequestId(_ctx.stringValue("DescribeSlowLogRecordsResponse.RequestId"));<NEW_LINE>describeSlowLogRecordsResponse.setTotalRecordCount(_ctx.integerValue("DescribeSlowLogRecordsResponse.TotalRecordCount"));<NEW_LINE>describeSlowLogRecordsResponse.setPageRecordCount<MASK><NEW_LINE>describeSlowLogRecordsResponse.setPageNumber(_ctx.integerValue("DescribeSlowLogRecordsResponse.PageNumber"));<NEW_LINE>describeSlowLogRecordsResponse.setEngine(_ctx.stringValue("DescribeSlowLogRecordsResponse.Engine"));<NEW_LINE>List<SQLSlowRecord> items = new ArrayList<SQLSlowRecord>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowLogRecordsResponse.Items.Length"); i++) {<NEW_LINE>SQLSlowRecord sQLSlowRecord = new SQLSlowRecord();<NEW_LINE>sQLSlowRecord.setExecutionStartTime(_ctx.stringValue("DescribeSlowLogRecordsResponse.Items[" + i + "].ExecutionStartTime"));<NEW_LINE>sQLSlowRecord.setHostAddress(_ctx.stringValue("DescribeSlowLogRecordsResponse.Items[" + i + "].HostAddress"));<NEW_LINE>sQLSlowRecord.setQueryTimes(_ctx.longValue("DescribeSlowLogRecordsResponse.Items[" + i + "].QueryTimes"));<NEW_LINE>sQLSlowRecord.setSQLText(_ctx.stringValue("DescribeSlowLogRecordsResponse.Items[" + i + "].SQLText"));<NEW_LINE>sQLSlowRecord.setReturnRowCounts(_ctx.longValue("DescribeSlowLogRecordsResponse.Items[" + i + "].ReturnRowCounts"));<NEW_LINE>sQLSlowRecord.setParseRowCounts(_ctx.longValue("DescribeSlowLogRecordsResponse.Items[" + i + "].ParseRowCounts"));<NEW_LINE>sQLSlowRecord.setDBName(_ctx.stringValue("DescribeSlowLogRecordsResponse.Items[" + i + "].DBName"));<NEW_LINE>sQLSlowRecord.setLockTimes(_ctx.longValue("DescribeSlowLogRecordsResponse.Items[" + i + "].LockTimes"));<NEW_LINE>items.add(sQLSlowRecord);<NEW_LINE>}<NEW_LINE>describeSlowLogRecordsResponse.setItems(items);<NEW_LINE>return describeSlowLogRecordsResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeSlowLogRecordsResponse.PageRecordCount"));
1,660,814
final UpdateGlobalSettingsResult executeUpdateGlobalSettings(UpdateGlobalSettingsRequest updateGlobalSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGlobalSettingsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGlobalSettingsRequest> request = null;<NEW_LINE>Response<UpdateGlobalSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGlobalSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGlobalSettingsRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateGlobalSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGlobalSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGlobalSettingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,106,927
public void writeCandlestickChart(JRChart chart) throws IOException {<NEW_LINE>writer.startElement(JRXmlConstants.ELEMENT_candlestickChart, getNamespace());<NEW_LINE>writeChart(chart);<NEW_LINE>writeHighLowDataset((<MASK><NEW_LINE>JRCandlestickPlot plot = (JRCandlestickPlot) chart.getPlot();<NEW_LINE>writer.startElement(JRXmlConstants.ELEMENT_candlestickPlot);<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_isShowVolume, plot.getShowVolume());<NEW_LINE>writePlot(plot);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_timeAxisLabelExpression, plot.getTimeAxisLabelExpression(), false);<NEW_LINE>writeAxisFormat(JRXmlConstants.ELEMENT_timeAxisFormat, plot.getTimeAxisLabelFont(), plot.getOwnTimeAxisLabelColor(), plot.getTimeAxisTickLabelFont(), plot.getOwnTimeAxisTickLabelColor(), plot.getTimeAxisTickLabelMask(), plot.getTimeAxisVerticalTickLabels(), plot.getOwnTimeAxisLineColor());<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_valueAxisLabelExpression, plot.getValueAxisLabelExpression(), false);<NEW_LINE>writeAxisFormat(JRXmlConstants.ELEMENT_valueAxisFormat, plot.getValueAxisLabelFont(), plot.getOwnValueAxisLabelColor(), plot.getValueAxisTickLabelFont(), plot.getOwnValueAxisTickLabelColor(), plot.getValueAxisTickLabelMask(), plot.getValueAxisVerticalTickLabels(), plot.getOwnValueAxisLineColor());<NEW_LINE>if (isNewerVersionOrEqual(JRConstants.VERSION_3_5_0)) {<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_domainAxisMinValueExpression, plot.getDomainAxisMinValueExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_domainAxisMaxValueExpression, plot.getDomainAxisMaxValueExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_rangeAxisMinValueExpression, plot.getRangeAxisMinValueExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_rangeAxisMaxValueExpression, plot.getRangeAxisMaxValueExpression(), false);<NEW_LINE>}<NEW_LINE>writer.closeElement();<NEW_LINE>writer.closeElement();<NEW_LINE>}
JRHighLowDataset) chart.getDataset());
490,994
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {<NEW_LINE>if (!isActive || !allowPan) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (control == null) {<NEW_LINE>isActive = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Point2d newScreenPos = new Point2d(e2.getX(), e2.getY());<NEW_LINE>// New state for pan<NEW_LINE>Point3d hit = mapView.pointOnPlaneFromScreen(newScreenPos, startTransform, control.getViewSize(), false);<NEW_LINE>if (hit != null) {<NEW_LINE>Point3d newPos = new Point3d(startOnPlane.getX() - hit.getX() + startLoc.getX(), startOnPlane.getY() - hit.getY() + startLoc.getY(), control.mapView.getLoc().getZ());<NEW_LINE>mapView.cancelAnimation();<NEW_LINE>// If the point is within bounds, set it<NEW_LINE>Point3d locPos = mapView.coordAdapter.displayToLocal(newPos);<NEW_LINE>if (withinBounds(mapView, control.getViewSize(), locPos, control.viewBounds)) {<NEW_LINE>mapView.setLoc(locPos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
MapController control = mapControl.get();
1,495,001
public DeleteCostCategoryDefinitionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteCostCategoryDefinitionResult deleteCostCategoryDefinitionResult = new DeleteCostCategoryDefinitionResult();<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 deleteCostCategoryDefinitionResult;<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("CostCategoryArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteCostCategoryDefinitionResult.setCostCategoryArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("EffectiveEnd", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteCostCategoryDefinitionResult.setEffectiveEnd(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteCostCategoryDefinitionResult;<NEW_LINE>}
class).unmarshall(context));
1,725,236
public synchronized void clear() {<NEW_LINE>logger.debug("Clearing all items from auto refresh scheduler");<NEW_LINE>ivUpdateQueue.clear();<NEW_LINE>// Restarting schedule executor<NEW_LINE>if (ivScheduledExecutorService != null) {<NEW_LINE>logger.debug("Schedule executor restart.");<NEW_LINE>ivScheduledExecutorService.shutdown();<NEW_LINE>try {<NEW_LINE>if (ivScheduledExecutorService.awaitTermination(cvScheduledExecutorServiceShutdownTimeout, TimeUnit.SECONDS)) {<NEW_LINE>logger.debug("Schedule executor restart: successfully terminated old instance");<NEW_LINE>} else {<NEW_LINE>logger.debug("Schedule executor restart failed: termination timed out.");<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.debug("Schedule executor restart failed: interrupted while waiting for termination.");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>logger.debug("Schedule executor restart: started.");<NEW_LINE>}<NEW_LINE>for (Iterator<Integer> lvIterator = cvScheduleMap.keySet().iterator(); lvIterator.hasNext(); ) {<NEW_LINE>int autoRefreshTimeInSecs = lvIterator.next();<NEW_LINE>List<String> lvItemListe = cvScheduleMap.get(autoRefreshTimeInSecs);<NEW_LINE>synchronized (lvItemListe) {<NEW_LINE>logger.debug("Clearing list {}", autoRefreshTimeInSecs);<NEW_LINE>lvItemListe.clear();<NEW_LINE>}<NEW_LINE>logger.debug("Removing list {} from scheduler", autoRefreshTimeInSecs);<NEW_LINE>lvIterator.remove();<NEW_LINE>}<NEW_LINE>}
ivScheduledExecutorService = Executors.newScheduledThreadPool(cvNumberOfThreads);
1,734,063
public void executeImpl(AndroidGraphics underlying) {<NEW_LINE>if (width != lastWidth || height != lastHeight) {<NEW_LINE>lastWidth = width;<NEW_LINE>lastHeight = height;<NEW_LINE>switch(bgType) {<NEW_LINE>case Style.BACKGROUND_GRADIENT_LINEAR_VERTICAL:<NEW_LINE>paint.setShader(new LinearGradient(0, 0, 0, height, startColor, endColor, Shader.TileMode.MIRROR));<NEW_LINE>break;<NEW_LINE>case Style.BACKGROUND_GRADIENT_LINEAR_HORIZONTAL:<NEW_LINE>paint.setShader(new LinearGradient(0, 0, width, 0, startColor, endColor<MASK><NEW_LINE>break;<NEW_LINE>case Style.BACKGROUND_GRADIENT_RADIAL:<NEW_LINE>paint.setShader(new RadialGradient(x, y, Math.max(width, height), startColor, endColor, Shader.TileMode.MIRROR));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>underlying.canvas.drawRect(x, y, x + width, y + height, paint);<NEW_LINE>}<NEW_LINE>}
, Shader.TileMode.MIRROR));
1,422,005
public List<ExtractResult> expandHalfSuffix(String source, List<ExtractResult> result, List<ExtractResult> numbers) {<NEW_LINE>// Expand Chinese phrase to the `half` patterns when it follows closely origin phrase.<NEW_LINE>if (halfUnitRegex != null) {<NEW_LINE>Match[] match = RegExpUtility.getMatches(halfUnitRegex, source);<NEW_LINE>if (match.length > 0) {<NEW_LINE>List<ExtractResult> res = new ArrayList<>();<NEW_LINE>for (ExtractResult er : result) {<NEW_LINE>int start = er.getStart();<NEW_LINE>int length = er.getLength();<NEW_LINE>List<ExtractResult> matchSuffix = new ArrayList<>();<NEW_LINE>for (Match mr : match) {<NEW_LINE>if (mr.index == (start + length)) {<NEW_LINE>ExtractResult m = new ExtractResult(mr.index, mr.length, mr.value, numbers.get(0).getType(), numbers.get(0).getData());<NEW_LINE>matchSuffix.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchSuffix.size() == 1) {<NEW_LINE>ExtractResult mr = matchSuffix.get(0);<NEW_LINE>er.setLength(er.getLength() + mr.getLength());<NEW_LINE>er.setText(er.getText() + mr.getText());<NEW_LINE>List<ExtractResult> <MASK><NEW_LINE>tmp.add((ExtractResult) er.getData());<NEW_LINE>tmp.add(mr);<NEW_LINE>er.setData(tmp);<NEW_LINE>}<NEW_LINE>res.add(er);<NEW_LINE>}<NEW_LINE>result = res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
tmp = new ArrayList<>();
727,163
private void handleAckTuple(HeronTuples.AckTuple ackTuple, boolean isSuccess) {<NEW_LINE>for (HeronTuples.RootId rt : ackTuple.getRootsList()) {<NEW_LINE>if (rt.getTaskid() != helper.getMyTaskId()) {<NEW_LINE>throw new RuntimeException(String.format("Receiving tuple for task %d in task %d", rt.getTaskid()<MASK><NEW_LINE>} else {<NEW_LINE>long rootId = rt.getKey();<NEW_LINE>RootTupleInfo rootTupleInfo = collector.retireInFlight(rootId);<NEW_LINE>// This tuple has been removed due to time-out<NEW_LINE>if (rootTupleInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object messageId = rootTupleInfo.getMessageId();<NEW_LINE>if (messageId != null) {<NEW_LINE>Duration latency = Duration.ofNanos(System.nanoTime()).minusNanos(rootTupleInfo.getInsertionTime());<NEW_LINE>if (isSuccess) {<NEW_LINE>invokeAck(messageId, rootTupleInfo.getStreamId(), latency);<NEW_LINE>} else {<NEW_LINE>invokeFail(messageId, rootTupleInfo.getStreamId(), latency);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, helper.getMyTaskId()));
546,048
void startServer(ServerSocket serverSocket) {<NEW_LINE>final ConnectionListener connectionListener = new ConnectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onConnection(Connection connection) {<NEW_LINE>if (!connection.isStopped()) {<NEW_LINE>inBoundConnections.add((InboundConnection) connection);<NEW_LINE>printInboundConnections();<NEW_LINE>connectionListeners.stream().forEach(e <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {<NEW_LINE>log.trace("onDisconnect at server socket connectionListener\n\tconnection={}", connection);<NEW_LINE>// noinspection SuspiciousMethodCalls<NEW_LINE>inBoundConnections.remove(connection);<NEW_LINE>printInboundConnections();<NEW_LINE>connectionListeners.stream().forEach(e -> e.onDisconnect(closeConnectionReason, connection));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable throwable) {<NEW_LINE>log.error("server.ConnectionListener.onError " + throwable.getMessage());<NEW_LINE>connectionListeners.stream().forEach(e -> e.onError(throwable));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>server = new Server(serverSocket, NetworkNode.this, connectionListener, networkProtoResolver, networkFilter);<NEW_LINE>executorService.submit(server);<NEW_LINE>}
-> e.onConnection(connection));
1,245,389
public Model preprocessModel(Model model, GoSettings settings) {<NEW_LINE>ServiceShape service = model.expectShape(settings.getService(), ServiceShape.class);<NEW_LINE>if (!S3ModelUtils.isServiceS3(model, service)) {<NEW_LINE>return model;<NEW_LINE>}<NEW_LINE>for (OperationShape operationShape : TopDownIndex.of(model).getContainedOperations(service)) {<NEW_LINE>if (operationShape.getId().getName(service).equalsIgnoreCase("HeadObject")) {<NEW_LINE>Model.Builder modelBuilder = model.toBuilder();<NEW_LINE>OperationShape.<MASK><NEW_LINE>// clear all errors associated with 'HeadObject' operation aws/aws-sdk-go#1208<NEW_LINE>builder.clearErrors();<NEW_LINE>// remove old operation shape and add the updated shape to model<NEW_LINE>return modelBuilder.removeShape(operationShape.getId()).addShape(builder.build()).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
Builder builder = operationShape.toBuilder();
1,139,540
// //////////////////////////////////////////////////////////////////////////<NEW_LINE>// Internals<NEW_LINE>@Override<NEW_LINE>public List<Message> createSpawnMessage() {<NEW_LINE>List<Message> result = new LinkedList<>();<NEW_LINE>// spawn player<NEW_LINE>double x = location.getX();<NEW_LINE>double y = location.getY();<NEW_LINE>double z = location.getZ();<NEW_LINE>int yaw = Position.getIntYaw(location);<NEW_LINE>int <MASK><NEW_LINE>result.add(new SpawnPlayerMessage(entityId, profile.getId(), x, y, z, yaw, pitch, metadata.getEntryList()));<NEW_LINE>// head facing<NEW_LINE>result.add(new EntityHeadRotationMessage(entityId, yaw));<NEW_LINE>// equipment<NEW_LINE>EntityEquipment equipment = getEquipment();<NEW_LINE>result.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.HELD_ITEM, equipment.getItemInMainHand()));<NEW_LINE>result.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.OFF_HAND, equipment.getItemInOffHand()));<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>result.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.BOOTS_SLOT + i, equipment.getArmorContents()[i]));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
pitch = Position.getIntPitch(location);
913,302
public static double min(int[] y1, int[] y2) {<NEW_LINE>ContingencyTable contingency = new ContingencyTable(y1, y2);<NEW_LINE>double n = contingency.n;<NEW_LINE>double[] p1 = Arrays.stream(contingency.a).mapToDouble(a -> a / n).toArray();<NEW_LINE>double[] p2 = Arrays.stream(contingency.b).mapToDouble(b -> b / n).toArray();<NEW_LINE>double h1 = MathEx.entropy(p1);<NEW_LINE>double h2 = MathEx.entropy(p2);<NEW_LINE>double I = MutualInformation.of(contingency.n, p1, p2, contingency.table);<NEW_LINE>double E = E(contingency.n, contingency.a, contingency.b);<NEW_LINE>return (I - E) / (Math.min<MASK><NEW_LINE>}
(h1, h2) - E);
1,045,788
public static void createDevice(String projectId, String cloudRegion, String registryName, String deviceId) throws GeneralSecurityException, IOException {<NEW_LINE>// [START create_device]<NEW_LINE>GoogleCredentials credential = GoogleCredentials.getApplicationDefault().createScoped(CloudIotScopes.all());<NEW_LINE>JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();<NEW_LINE>HttpRequestInitializer init = new HttpCredentialsAdapter(credential);<NEW_LINE>final CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, init).setApplicationName(APP_NAME).build();<NEW_LINE>final String registryPath = String.format("projects/%s/locations/%s/registries/%s", projectId, cloudRegion, registryName);<NEW_LINE>List<Device> devices = service.projects().locations().registries().devices().list(registryPath).setFieldMask("config,gatewayConfig").execute().getDevices();<NEW_LINE>if (devices != null) {<NEW_LINE>System.out.println("Found " + devices.size() + " devices");<NEW_LINE>for (Device d : devices) {<NEW_LINE>if ((d.getId() != null && d.getId().equals(deviceId)) || (d.getName() != null && d.getName().equals(deviceId))) {<NEW_LINE>System.out.println("Device exists, skipping.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Creating device with id: " + deviceId);<NEW_LINE>Device device = new Device();<NEW_LINE>device.setId(deviceId);<NEW_LINE>GatewayConfig gwConfig = new GatewayConfig();<NEW_LINE>gwConfig.setGatewayType("NON_GATEWAY");<NEW_LINE>gwConfig.setGatewayAuthMethod("ASSOCIATION_ONLY");<NEW_LINE>device.setGatewayConfig(gwConfig);<NEW_LINE>Device createdDevice = service.projects().locations().registries().devices().create(registryPath, device).execute();<NEW_LINE>System.out.println(<MASK><NEW_LINE>// [END create_device]<NEW_LINE>}
"Created device: " + createdDevice.toPrettyString());
874,220
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {<NEW_LINE>List<String> <MASK><NEW_LINE>if (canFuelEfficiency) {<NEW_LINE>messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier));<NEW_LINE>}<NEW_LINE>if (canSecondSmelt) {<NEW_LINE>messages.add(getStatMessage(SubSkillType.SMELTING_SECOND_SMELT, str_secondSmeltChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_secondSmeltChanceLucky) : ""));<NEW_LINE>}<NEW_LINE>if (canUnderstandTheArt) {<NEW_LINE>messages.add(getStatMessage(false, true, SubSkillType.SMELTING_UNDERSTANDING_THE_ART, String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getVanillaXpMultiplier())));<NEW_LINE>}<NEW_LINE>return messages;<NEW_LINE>}
messages = new ArrayList<>();
485,705
// injects needs methods as defined by ScriptClassInfo<NEW_LINE>protected void injectNeedsMethods(ScriptScope scriptScope) {<NEW_LINE>Location internalLocation = new Location("$internal$ScriptInjectionPhase$injectNeedsMethods", 0);<NEW_LINE>for (org.objectweb.asm.commons.Method needsMethod : scriptScope.getScriptClassInfo().getNeedsMethods()) {<NEW_LINE>String name = needsMethod.getName();<NEW_LINE>name = name.substring(5);<NEW_LINE>name = Character.toLowerCase(name.charAt(0)) + name.substring(1);<NEW_LINE>FunctionNode irFunctionNode = new FunctionNode(internalLocation);<NEW_LINE>irFunctionNode.attachDecoration(new IRDName(needsMethod.getName()));<NEW_LINE>irFunctionNode.attachDecoration(new IRDReturnType(boolean.class));<NEW_LINE>irFunctionNode.attachDecoration(new IRDTypeParameters<MASK><NEW_LINE>irFunctionNode.attachDecoration(new IRDParameterNames(Collections.emptyList()));<NEW_LINE>irFunctionNode.attachCondition(IRCSynthetic.class);<NEW_LINE>irFunctionNode.attachDecoration(new IRDMaxLoopCounter(0));<NEW_LINE>irClassNode.addFunctionNode(irFunctionNode);<NEW_LINE>BlockNode irBlockNode = new BlockNode(internalLocation);<NEW_LINE>irBlockNode.attachCondition(IRCAllEscape.class);<NEW_LINE>irFunctionNode.setBlockNode(irBlockNode);<NEW_LINE>ReturnNode irReturnNode = new ReturnNode(internalLocation);<NEW_LINE>irBlockNode.addStatementNode(irReturnNode);<NEW_LINE>ConstantNode irConstantNode = new ConstantNode(internalLocation);<NEW_LINE>irConstantNode.attachDecoration(new IRDExpressionType(boolean.class));<NEW_LINE>irConstantNode.attachDecoration(new IRDConstant(scriptScope.getUsedVariables().contains(name)));<NEW_LINE>irReturnNode.setExpressionNode(irConstantNode);<NEW_LINE>}<NEW_LINE>}
(Collections.emptyList()));
252,511
public static Map<String, String> updatePartitionMetadataWithFileNamesAndSizes(PartitionUpdate partitionUpdate, Map<String, String> metadata) {<NEW_LINE>ImmutableMap.Builder<String, String> partitionMetadata = ImmutableMap.builder();<NEW_LINE>List<FileWriteInfo> fileWriteInfos = new ArrayList<>(partitionUpdate.getFileWriteInfos());<NEW_LINE>if (!partitionUpdate.containsNumberedFileNames()) {<NEW_LINE>// Filenames starting with ".tmp.presto" will be renamed in TableFinishOperator. So it doesn't make sense to store the filenames in manifest<NEW_LINE>return metadata;<NEW_LINE>}<NEW_LINE>// Sort the file infos based on fileName<NEW_LINE>fileWriteInfos.sort(Comparator.comparing(info -> Integer.valueOf(info.getWriteFileName())));<NEW_LINE>List<String> fileNames = fileWriteInfos.stream().map(FileWriteInfo::getWriteFileName).collect(toImmutableList());<NEW_LINE>List<Long> fileSizes = fileWriteInfos.stream().map(FileWriteInfo::getFileSize).filter(Optional::isPresent).map(Optional::get<MASK><NEW_LINE>if (fileSizes.size() < fileNames.size()) {<NEW_LINE>if (fileSizes.isEmpty()) {<NEW_LINE>// These files may not have been written by OrcFileWriter. So file sizes not available.<NEW_LINE>return metadata;<NEW_LINE>}<NEW_LINE>throw new PrestoException(MALFORMED_HIVE_FILE_STATISTICS, format("During manifest creation for partition= %s, filename count= %s is not equal to filesizes count= %s", partitionUpdate.getName(), fileNames.size(), fileSizes.size()));<NEW_LINE>}<NEW_LINE>// Compress the file names into a consolidated string<NEW_LINE>partitionMetadata.put(FILE_NAMES, compressFileNames(fileNames));<NEW_LINE>// Compress the file sizes<NEW_LINE>partitionMetadata.put(FILE_SIZES, compressFileSizes(fileSizes));<NEW_LINE>partitionMetadata.put(MANIFEST_VERSION, VERSION_1);<NEW_LINE>partitionMetadata.putAll(metadata);<NEW_LINE>return partitionMetadata.build();<NEW_LINE>}
).collect(toImmutableList());
1,146,868
public void run() {<NEW_LINE>try {<NEW_LINE>File contentFile = new File(getFilesDir(), CONTENT_FILE);<NEW_LINE>if (contentFile.createNewFile()) {<NEW_LINE>// Content file exist did not exist in internal storage and new file was created.<NEW_LINE>// Copy in the default content.<NEW_LINE>InputStream is;<NEW_LINE>is = <MASK><NEW_LINE>int size = is.available();<NEW_LINE>byte[] buffer = new byte[size];<NEW_LINE>is.read(buffer);<NEW_LINE>is.close();<NEW_LINE>FileOutputStream fos = new FileOutputStream(contentFile);<NEW_LINE>fos.write(buffer);<NEW_LINE>fos.close();<NEW_LINE>}<NEW_LINE>FileInputStream fis = new FileInputStream(contentFile);<NEW_LINE>byte[] content = new byte[(int) contentFile.length()];<NEW_LINE>fis.read(content);<NEW_LINE>taskCompletionSource.setResult(new String(content));<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
getAssets().open(DEFAULT_CONTENT_FILE);
1,339,948
private static void replaceWithTernary(MethodNode mth, IfRegion ifRegion, BlockNode block, InsnNode insn) {<NEW_LINE>RegisterArg resArg = insn.getResult();<NEW_LINE>if (resArg.getSVar().getUseList().size() != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PhiInsn phiInsn = resArg.getSVar().getOnlyOneUseInPhi();<NEW_LINE>if (phiInsn == null || phiInsn.getArgsCount() != 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RegisterArg otherArg = null;<NEW_LINE>for (InsnArg arg : phiInsn.getArguments()) {<NEW_LINE>if (arg != resArg && arg instanceof RegisterArg) {<NEW_LINE>otherArg = (RegisterArg) arg;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (otherArg == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// all checks passed<NEW_LINE>BlockNode header = ifRegion.getConditionBlocks().get(0);<NEW_LINE>if (!ifRegion.getParent().replaceSubBlock(ifRegion, header)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TernaryInsn ternInsn = new TernaryInsn(ifRegion.getCondition(), phiInsn.getResult(), InsnArg<MASK><NEW_LINE>InsnRemover.unbindResult(mth, insn);<NEW_LINE>InsnList.remove(block, insn);<NEW_LINE>InsnRemover.unbindAllArgs(mth, phiInsn);<NEW_LINE>header.getInstructions().clear();<NEW_LINE>ternInsn.rebindArgs();<NEW_LINE>header.getInstructions().add(ternInsn);<NEW_LINE>clearConditionBlocks(ifRegion.getConditionBlocks(), header);<NEW_LINE>// shrink method again<NEW_LINE>CodeShrinkVisitor.shrinkMethod(mth);<NEW_LINE>}
.wrapInsnIntoArg(insn), otherArg);
915,021
private List<NameValueCountPair> groupByProcess(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(TaskCompleted.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<TaskCompleted> root = cq.from(TaskCompleted.class);<NEW_LINE>Path<String> pathProcess = root.get(TaskCompleted_.process);<NEW_LINE>Path<String> pathProcessName = <MASK><NEW_LINE>cq.multiselect(pathProcess, pathProcessName, cb.count(root)).where(predicate).groupBy(pathProcess);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathProcessName));<NEW_LINE>pair.setValue(o.get(pathProcess));<NEW_LINE>pair.setCount(o.get(2, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted(Comparator.comparing(NameValueCountPair::getCount).reversed()).collect(Collectors.toList());<NEW_LINE>}
root.get(TaskCompleted_.processName);
1,115,450
private void scanGames(Context context) {<NEW_LINE>gameList.clear();<NEW_LINE>errorList.clear();<NEW_LINE>// Retrieve the games folder<NEW_LINE>Uri gamesFolderURI = SettingsManager.getGamesFolderURI(context);<NEW_LINE>DocumentFile gamesFolder = Helper.getFileFromURI(context, gamesFolderURI);<NEW_LINE>// 1) The folder must exist<NEW_LINE>if (gamesFolder == null || !gamesFolder.isDirectory()) {<NEW_LINE>// TODO Replace the text by a R.string<NEW_LINE>// String msg = context.getString(R.string.creating_dir_failed).replace("$PATH", dir.getName());<NEW_LINE>String msg = "The games folder doesn't exist or isn't a folder";<NEW_LINE>Log.e("EasyRPG", msg);<NEW_LINE>errorList.add(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// 2) The folder must be readable and writable<NEW_LINE>if (!gamesFolder.canRead() || !gamesFolder.canWrite()) {<NEW_LINE>// TODO Replace the text by a R.string<NEW_LINE>// String msg = context.getString(R.string.path_not_readable).replace("$PATH", path);<NEW_LINE>String msg = "The app doesn't have read or write access to the games folder";<NEW_LINE>Log.e("EasyRPG", msg);<NEW_LINE>errorList.add(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Scan the games folder<NEW_LINE>// TODO : Bring back depth (2) when the performance hit will be solved, the problem is linked with slow SAF calls<NEW_LINE>scanFolderRecursive(context, gamesFolder.getUri(), GAME_SCANNING_DEPTH);<NEW_LINE>// If the scan brings nothing in this folder : we notify the errorList<NEW_LINE>if (gameList.size() <= 0) {<NEW_LINE>String error = context.getString(R.string.no_games_found_and_explanation_android_30);<NEW_LINE>errorList.add(error);<NEW_LINE>}<NEW_LINE>Log.i("EasyRPG", <MASK><NEW_LINE>}
gameList.size() + " game(s) found.");
346,520
private static void loadDetails(View dialogLayout, ThemedActivity activity, MediaDetailsMap<String, String> metadata) {<NEW_LINE>LinearLayout detailsTable = dialogLayout.findViewById(R.id.ll_list_details);<NEW_LINE>int tenPxInDp = Measure.pxToDp(10, activity);<NEW_LINE>// more or less an hundred. Did not used weight for a strange bug<NEW_LINE>int hundredPxInDp = Measure.pxToDp(125, activity);<NEW_LINE>for (int index : metadata.getKeySet()) {<NEW_LINE>LinearLayout row = new LinearLayout(activity.getApplicationContext());<NEW_LINE>row.setOrientation(LinearLayout.HORIZONTAL);<NEW_LINE>TextView label = new TextView(activity.getApplicationContext());<NEW_LINE>TextView value = new TextView(activity.getApplicationContext());<NEW_LINE>label.setText<MASK><NEW_LINE>label.setLayoutParams((new LinearLayout.LayoutParams(hundredPxInDp, LinearLayout.LayoutParams.WRAP_CONTENT)));<NEW_LINE>value.setText(metadata.getValue(index));<NEW_LINE>value.setLayoutParams((new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)));<NEW_LINE>label.setTextColor(activity.getTextColor());<NEW_LINE>label.setTypeface(null, Typeface.BOLD);<NEW_LINE>label.setGravity(Gravity.END);<NEW_LINE>label.setTextSize(16);<NEW_LINE>value.setTextColor(activity.getTextColor());<NEW_LINE>value.setTextSize(16);<NEW_LINE>value.setPaddingRelative(tenPxInDp, 0, tenPxInDp, 0);<NEW_LINE>row.addView(label);<NEW_LINE>row.addView(value);<NEW_LINE>detailsTable.addView(row, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>}<NEW_LINE>}
(metadata.getLabel(index));
207,770
public static List<LatLon> parse(final String encoded, double precision) {<NEW_LINE>List<LatLon> track = new ArrayList<LatLon>();<NEW_LINE>int index = 0;<NEW_LINE>int lat = 0, lng = 0;<NEW_LINE>while (index < encoded.length()) {<NEW_LINE>int b, shift = 0, result = 0;<NEW_LINE>do {<NEW_LINE>b = encoded.charAt(index++) - 63;<NEW_LINE>result |= (b & 0x1f) << shift;<NEW_LINE>shift += 5;<NEW_LINE>} while (b >= 0x20);<NEW_LINE>int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));<NEW_LINE>lat += dlat;<NEW_LINE>shift = 0;<NEW_LINE>result = 0;<NEW_LINE>do {<NEW_LINE>b = encoded<MASK><NEW_LINE>result |= (b & 0x1f) << shift;<NEW_LINE>shift += 5;<NEW_LINE>} while (b >= 0x20);<NEW_LINE>int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));<NEW_LINE>lng += dlng;<NEW_LINE>LatLon p = new LatLon((double) lat / precision, (double) lng / precision);<NEW_LINE>track.add(p);<NEW_LINE>}<NEW_LINE>return track;<NEW_LINE>}
.charAt(index++) - 63;
1,376,011
final DeleteApnsVoipSandboxChannelResult executeDeleteApnsVoipSandboxChannel(DeleteApnsVoipSandboxChannelRequest deleteApnsVoipSandboxChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApnsVoipSandboxChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApnsVoipSandboxChannelRequest> request = null;<NEW_LINE>Response<DeleteApnsVoipSandboxChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApnsVoipSandboxChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApnsVoipSandboxChannelRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApnsVoipSandboxChannel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApnsVoipSandboxChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApnsVoipSandboxChannelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint");
123,949
public static Template<?> createTemplate(Context context, MethodTree decl) {<NEW_LINE>MethodSymbol declSym = ASTHelpers.getSymbol(decl);<NEW_LINE>ImmutableClassToInstanceMap<Annotation> annotations = UTemplater.annotationMap(declSym);<NEW_LINE>ImmutableMap<String, VarSymbol> freeExpressionVars = freeExpressionVariables(decl);<NEW_LINE>Context subContext = new SubContext(context);<NEW_LINE>UTemplater templater = new UTemplater(freeExpressionVars, subContext);<NEW_LINE>ImmutableMap<String, UType> expressionVarTypes = ImmutableMap.copyOf(Maps.transformValues(freeExpressionVars, (VarSymbol sym) -> templater.template(sym.type)));<NEW_LINE>UType genericType = templater.template(declSym.type);<NEW_LINE>ImmutableList<UTypeVar> typeParameters;<NEW_LINE>UMethodType methodType;<NEW_LINE>if (genericType instanceof UForAll) {<NEW_LINE>UForAll forAllType = (UForAll) genericType;<NEW_LINE>typeParameters = forAllType.getTypeVars();<NEW_LINE>methodType = (UMethodType) forAllType.getQuantifiedType();<NEW_LINE>} else if (genericType instanceof UMethodType) {<NEW_LINE>typeParameters = ImmutableList.of();<NEW_LINE>methodType = (UMethodType) genericType;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<? extends StatementTree> bodyStatements = decl.getBody().getStatements();<NEW_LINE>if (bodyStatements.size() == 1 && Iterables.getOnlyElement(bodyStatements).getKind() == Kind.RETURN && context.get(REQUIRE_BLOCK_KEY) == null) {<NEW_LINE>ExpressionTree expression = ((ReturnTree) Iterables.getOnlyElement(bodyStatements)).getExpression();<NEW_LINE>return ExpressionTemplate.create(annotations, typeParameters, expressionVarTypes, templater.template(expression), methodType.getReturnType());<NEW_LINE>} else {<NEW_LINE>List<UStatement> templateStatements = new ArrayList<>();<NEW_LINE>for (StatementTree statement : bodyStatements) {<NEW_LINE>templateStatements.add(templater.template(statement));<NEW_LINE>}<NEW_LINE>return BlockTemplate.create(annotations, typeParameters, expressionVarTypes, templateStatements);<NEW_LINE>}<NEW_LINE>}
throw new IllegalArgumentException("Expected genericType to be either a ForAll or a UMethodType, but was " + genericType);
351,397
public static String optimizedPathFor(File path, File optimizedDirectory) {<NEW_LINE>if (ShareTinkerInternals.isAfterAndroidO()) {<NEW_LINE>// dex_location = /foo/bar/baz.jar<NEW_LINE>// odex_location = /foo/bar/oat/<isa>/baz.odex<NEW_LINE>String currentInstructionSet;<NEW_LINE>try {<NEW_LINE>currentInstructionSet = ShareTinkerInternals.getCurrentInstructionSet();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new TinkerRuntimeException("getCurrentInstructionSet fail:", e);<NEW_LINE>}<NEW_LINE>File parentFile = path.getParentFile();<NEW_LINE>String fileName = path.getName();<NEW_LINE>int index = fileName.lastIndexOf('.');<NEW_LINE>if (index > 0) {<NEW_LINE>fileName = fileName.substring(0, index);<NEW_LINE>}<NEW_LINE>String result = parentFile.getAbsolutePath() + "/oat/" + currentInstructionSet <MASK><NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>String fileName = path.getName();<NEW_LINE>if (!fileName.endsWith(ShareConstants.DEX_SUFFIX)) {<NEW_LINE>int lastDot = fileName.lastIndexOf(".");<NEW_LINE>if (lastDot < 0) {<NEW_LINE>fileName += ShareConstants.DEX_SUFFIX;<NEW_LINE>} else {<NEW_LINE>StringBuilder sb = new StringBuilder(lastDot + 4);<NEW_LINE>sb.append(fileName, 0, lastDot);<NEW_LINE>sb.append(ShareConstants.DEX_SUFFIX);<NEW_LINE>fileName = sb.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File result = new File(optimizedDirectory, fileName);<NEW_LINE>return result.getPath();<NEW_LINE>}
+ "/" + fileName + ShareConstants.ODEX_SUFFIX;
271,760
private Content retrieveInheritedDocumentation(TagletWriter writer, ProgramElementDoc ped, Tag holderTag, boolean isFirstSentence) {<NEW_LINE>Content replacement = writer.getOutputInstance();<NEW_LINE>Configuration configuration = writer.configuration();<NEW_LINE>Taglet inheritableTaglet = holderTag == null ? null : configuration.tagletManager.getTaglet(holderTag.name());<NEW_LINE>if (inheritableTaglet != null && !(inheritableTaglet instanceof InheritableTaglet)) {<NEW_LINE>String message = ped.name() + ((ped instanceof ExecutableMemberDoc) ? ((ExecutableMemberDoc) ped).flatSignature() : "");<NEW_LINE>// This tag does not support inheritence.<NEW_LINE>configuration.message.warning(ped.position(), "doclet.noInheritedDoc", message);<NEW_LINE>}<NEW_LINE>DocFinder.Output inheritedDoc = DocFinder.search(new DocFinder.Input(ped, (InheritableTaglet) inheritableTaglet<MASK><NEW_LINE>if (inheritedDoc.isValidInheritDocTag) {<NEW_LINE>if (inheritedDoc.inlineTags.length > 0) {<NEW_LINE>replacement = writer.commentTagsToOutput(inheritedDoc.holderTag, inheritedDoc.holder, inheritedDoc.inlineTags, isFirstSentence);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String message = ped.name() + ((ped instanceof ExecutableMemberDoc) ? ((ExecutableMemberDoc) ped).flatSignature() : "");<NEW_LINE>configuration.message.warning(ped.position(), "doclet.noInheritedDoc", message);<NEW_LINE>}<NEW_LINE>return replacement;<NEW_LINE>}
, holderTag, isFirstSentence, true));
1,415,174
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.vaadin.addon.calendar.ui.CalendarComponentEvents.WeekClickHandler<NEW_LINE>* #weekClick<NEW_LINE>* (com.vaadin.addon.calendar.ui.CalendarComponentEvents.WeekClick)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void weekClick(WeekClick event) {<NEW_LINE>int week = event.getWeek();<NEW_LINE>int year = event.getYear();<NEW_LINE>// set correct year and month<NEW_LINE>Calendar javaCalendar = event.getComponent().getInternalCalendar();<NEW_LINE>javaCalendar.set(GregorianCalendar.YEAR, year);<NEW_LINE>javaCalendar.<MASK><NEW_LINE>// starting at the beginning of the week<NEW_LINE>javaCalendar.set(GregorianCalendar.DAY_OF_WEEK, javaCalendar.getFirstDayOfWeek());<NEW_LINE>Date start = javaCalendar.getTime();<NEW_LINE>// ending at the end of the week<NEW_LINE>javaCalendar.add(GregorianCalendar.DATE, 6);<NEW_LINE>Date end = javaCalendar.getTime();<NEW_LINE>setDates(event, start, end);<NEW_LINE>// times are automatically expanded, no need to worry about them<NEW_LINE>}
set(GregorianCalendar.WEEK_OF_YEAR, week);
435,112
public Status removeLearners(final String groupId, final Configuration conf, final List<PeerId> learners) {<NEW_LINE>checkLearnersOpParams(groupId, conf, learners);<NEW_LINE>final PeerId leaderId = new PeerId();<NEW_LINE>final Status st = getLeader(groupId, conf, leaderId);<NEW_LINE>if (!st.isOk()) {<NEW_LINE>return st;<NEW_LINE>}<NEW_LINE>if (!this.cliClientService.connect(leaderId.getEndpoint())) {<NEW_LINE>return new Status(-1, "Fail to init channel to leader %s", leaderId);<NEW_LINE>}<NEW_LINE>final //<NEW_LINE>RemoveLearnersRequest.Builder //<NEW_LINE>rb = //<NEW_LINE>RemoveLearnersRequest.newBuilder().//<NEW_LINE>setGroupId(groupId).<MASK><NEW_LINE>for (final PeerId peer : learners) {<NEW_LINE>rb.addLearners(peer.toString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Message result = this.cliClientService.removeLearners(leaderId.getEndpoint(), rb.build(), null).get();<NEW_LINE>return processLearnersOpResponse(groupId, result, "removing learners: %s", learners);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>return new Status(-1, e.getMessage());<NEW_LINE>}<NEW_LINE>}
setLeaderId(leaderId.toString());
673,557
private int writeInternal(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {<NEW_LINE>if (size > Integer.MAX_VALUE) {<NEW_LINE>LOG.error("Cannot write more than Integer.MAX_VALUE");<NEW_LINE>return ErrorCodes.EIO();<NEW_LINE>}<NEW_LINE>final int sz = (int) size;<NEW_LINE>final long fd = fi.fh.get();<NEW_LINE>OpenFileEntry oe = mOpenFiles.getFirstByField(ID_INDEX, fd);<NEW_LINE>if (oe == null) {<NEW_LINE>LOG.error("Cannot find fd for {} in table", path);<NEW_LINE>return -ErrorCodes.EBADFD();<NEW_LINE>}<NEW_LINE>if (oe.getOut() == null) {<NEW_LINE>LOG.error("{} already exists in Alluxio and cannot be overwritten." + " Please delete this file first.", path);<NEW_LINE>return -ErrorCodes.EEXIST();<NEW_LINE>}<NEW_LINE>if (offset < oe.getWriteOffset()) {<NEW_LINE>// no op<NEW_LINE>return sz;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final byte[] dest = new byte[sz];<NEW_LINE>buf.get(0, dest, 0, sz);<NEW_LINE>oe.<MASK><NEW_LINE>oe.setWriteOffset(offset + size);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("IOException while writing to {}.", path, e);<NEW_LINE>return -ErrorCodes.EIO();<NEW_LINE>}<NEW_LINE>return sz;<NEW_LINE>}
getOut().write(dest);
780,076
public int compare(Message a, Message b) {<NEW_LINE>MessagePart a0 = firstPartOf(a);<NEW_LINE>MessagePart b0 = firstPartOf(b);<NEW_LINE>InputSource aSrc = toInputSource(a0), bSrc = toInputSource(b0);<NEW_LINE>// Compure by source first.<NEW_LINE>if (aSrc != null && bSrc != null) {<NEW_LINE>int delta = aSrc.getUri().<MASK><NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Sort positionless parts after ones with a position.<NEW_LINE>long aSPos = Integer.MAX_VALUE + 1L, aEPos = Integer.MAX_VALUE + 1L;<NEW_LINE>long bSPos = Integer.MAX_VALUE + 1L, bEPos = Integer.MAX_VALUE + 1L;<NEW_LINE>if (a0 instanceof FilePosition) {<NEW_LINE>FilePosition pos = (FilePosition) a0;<NEW_LINE>aSPos = pos.startCharInFile();<NEW_LINE>aEPos = pos.endCharInFile();<NEW_LINE>} else if (a0 instanceof InputSource) {<NEW_LINE>// sort file level messages before messages within file<NEW_LINE>aSPos = aEPos = -1;<NEW_LINE>}<NEW_LINE>if (b0 instanceof FilePosition) {<NEW_LINE>FilePosition pos = (FilePosition) b0;<NEW_LINE>bSPos = pos.startCharInFile();<NEW_LINE>bEPos = pos.endCharInFile();<NEW_LINE>} else if (b0 instanceof InputSource) {<NEW_LINE>// sort file level messages before messages within file<NEW_LINE>bSPos = bEPos = -1;<NEW_LINE>}<NEW_LINE>int delta = Long.signum(aSPos - bSPos);<NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>delta = Long.signum(aEPos - bEPos);<NEW_LINE>if (delta != 0) {<NEW_LINE>return delta;<NEW_LINE>}<NEW_LINE>StringBuilder aBuf = new StringBuilder(), bBuf = new StringBuilder();<NEW_LINE>MessageContext mc = new MessageContext();<NEW_LINE>try {<NEW_LINE>a0.format(mc, aBuf);<NEW_LINE>b0.format(mc, bBuf);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return aBuf.toString().compareTo(bBuf.toString());<NEW_LINE>}
compareTo(bSrc.getUri());
768,763
protected boolean isFieldDirty(PopulateValueRequest request, Object instance, Object checkValue) throws IllegalAccessException, FieldNotAvailableException {<NEW_LINE>boolean dirty = !(instance == null && checkValue == null) && (<MASK><NEW_LINE>if (!dirty) {<NEW_LINE>Object value = request.getFieldManager().getFieldValue(instance, request.getProperty().getName());<NEW_LINE>if (checkValue instanceof String) {<NEW_LINE>checkValue = ((String) checkValue).replaceAll("\\s+[</]|\\r\\n+[</]", "</").trim();<NEW_LINE>}<NEW_LINE>if (value instanceof String) {<NEW_LINE>value = ((String) value).replaceAll("\\s+[</]|\\r\\n+[</]", "</").trim();<NEW_LINE>}<NEW_LINE>if (value instanceof BigDecimal) {<NEW_LINE>BigDecimal origValue = (BigDecimal) value;<NEW_LINE>BigDecimal newValue = (BigDecimal) checkValue;<NEW_LINE>// set the scale of one of the BigDecimal values to the larger of the two scales<NEW_LINE>if (newValue.scale() < origValue.scale()) {<NEW_LINE>checkValue = newValue.setScale(origValue.scale(), RoundingMode.UNNECESSARY);<NEW_LINE>} else if (origValue.scale() < newValue.scale()) {<NEW_LINE>value = origValue.setScale(newValue.scale(), RoundingMode.UNNECESSARY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dirty = value == null || !value.equals(checkValue);<NEW_LINE>}<NEW_LINE>return dirty;<NEW_LINE>}
instance == null || checkValue == null);
828,214
public CompilationResults compile(Program program, RubyBinding binding) {<NEW_LINE>binding_ = binding;<NEW_LINE>RubyIDClassGenerator.initScript(extra_, script_name_);<NEW_LINE>String className = NameFactory.createClassName(extra_, script_name_, null);<NEW_LINE>cg_ = new ClassGeneratorForRubyProgram(className, script_name_, binding, false, false);<NEW_LINE>// Start compiling<NEW_LINE>program.accept(this);<NEW_LINE>MethodGenerator mg = cg_.getMethodGenerator();<NEW_LINE>// Record the local variables' range, if user enables debug<NEW_LINE>if (enableDebug) {<NEW_LINE>mg.writeLocalVariableInfo();<NEW_LINE>}<NEW_LINE>mg.endMethod();<NEW_LINE>cg_.visitEnd();<NEW_LINE>compilation_results_.add(RubyIDClassGenerator.getCompilationResult());<NEW_LINE>// RubyIDClassGenerator.clear();<NEW_LINE>compilation_results_.<MASK><NEW_LINE>return compilation_results_;<NEW_LINE>}
add(cg_.getCompilationResult());
1,199,955
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String activityId, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>String job = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.fetch(id, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>job = work.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE><MASK><NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>Activity activity = business.element().getActivity(activityId);<NEW_LINE>if (!StringUtils.equals(work.getProcess(), activity.getProcess())) {<NEW_LINE>throw new ExceptionProcessNotMatch();<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Work.class);<NEW_LINE>emc.beginTransaction(Task.class);<NEW_LINE>// work.setForceRoute(true);<NEW_LINE>work.setSplitting(false);<NEW_LINE>work.setSplitToken("");<NEW_LINE>work.getSplitTokenList().clear();<NEW_LINE>work.setSplitValue("");<NEW_LINE>work.setDestinationActivity(activity.getId());<NEW_LINE>work.setDestinationActivityType(activity.getActivityType());<NEW_LINE>work.setDestinationRoute("");<NEW_LINE>work.setDestinationRouteName("");<NEW_LINE>work.getProperties().getManualForceTaskIdentityList().clear();<NEW_LINE>work.getProperties().getManualForceTaskIdentityList().addAll(wi.getManualForceTaskIdentityList());<NEW_LINE>emc.check(work, CheckPersistType.all);<NEW_LINE>removeTask(business, work);<NEW_LINE>removeOtherWork(business, work);<NEW_LINE>removeOtherWorkLog(business, work);<NEW_LINE>emc.commit();<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(job).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>wo = ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("work", id, "processing"), new ProcessingAttributes(), job).getData(Wo.class);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
Business business = new Business(emc);
1,387,340
public static RepositoryConnection parse(String str) throws URISyntaxException {<NEW_LINE>String[] fields = str.split(RC_DELIMITER);<NEW_LINE>int l = fields.length;<NEW_LINE>String url = fields[0];<NEW_LINE>// NOI18N<NEW_LINE>String username = l > 1 && !fields[1].equals(""<MASK><NEW_LINE>// NOI18N<NEW_LINE>String password = l > 2 && !fields[2].equals("") ? Scrambler.getInstance().descramble(fields[2]) : null;<NEW_LINE>// NOI18N<NEW_LINE>String extCmd = l > 3 && !fields[3].equals("") ? fields[3] : null;<NEW_LINE>boolean save = l > 4 && !fields[4].equals("") ? Boolean.parseBoolean(fields[4]) : true;<NEW_LINE>return new RepositoryConnection(url, username, (username != null) ? password : null, extCmd, save);<NEW_LINE>}
) ? fields[1] : null;
1,648,582
/*<NEW_LINE>* When calling the java compiler programmatically, we map import requests to files with a<NEW_LINE>* custom {@link JavaFileManager}. We wrap the system JavaFileManager with one that handles<NEW_LINE>* ResourceFiles then wrap that with phidias, which handles imports based on bundle<NEW_LINE>* requirements.<NEW_LINE>*/<NEW_LINE>private BundleJavaManager createBundleJavaManager(PrintWriter writer, Summary summary, List<String> options) throws IOException, GhidraBundleException {<NEW_LINE>ResourceFileJavaFileManager resourceFileJavaManager = new ResourceFileJavaFileManager(Collections.singletonList(getSourceDirectory()), buildErrors.keySet());<NEW_LINE>BundleJavaManager bundleJavaManager = new MyBundleJavaManager(bundleHost.getHostFramework(), resourceFileJavaManager, options);<NEW_LINE>// The phidias BundleJavaManager is for compiling from within a bundle -- it makes the<NEW_LINE>// bundle dependencies available to the compiler classpath. Here, we are compiling in an<NEW_LINE>// as-yet non-existing bundle, so we forge the wiring based on @importpackage metadata.<NEW_LINE>// get wires for currently active bundles to satisfy all requirements<NEW_LINE>List<BundleRequirement> requirements = getAllRequirements();<NEW_LINE>List<BundleWiring> bundleWirings = bundleHost.resolve(requirements);<NEW_LINE>if (!resolveInternally(requirements)) {<NEW_LINE>writeErrorUnresolved(writer, summary, requirements);<NEW_LINE>}<NEW_LINE>// send the capabilities to phidias<NEW_LINE><MASK><NEW_LINE>return bundleJavaManager;<NEW_LINE>}
bundleWirings.forEach(bundleJavaManager::addBundleWiring);
1,365,017
public void initialize() {<NEW_LINE>logger.config("Initialize VR application...");<NEW_LINE>initialize_internal();<NEW_LINE>cam.setFrustumFar(fFar);<NEW_LINE>cam.setFrustumNear(fNear);<NEW_LINE>dummyCam = cam.clone();<NEW_LINE>if (isInVR()) {<NEW_LINE>logger.config("VR mode enabled.");<NEW_LINE>if (vrHardware != null) {<NEW_LINE>vrHardware.initVRCompositor(compositorAllowed());<NEW_LINE>} else {<NEW_LINE>logger.warning("No VR system found.");<NEW_LINE>}<NEW_LINE>// FIXME: WARNING !!<NEW_LINE>viewManager = new OpenVRViewManager(null);<NEW_LINE>viewManager.setResolutionMultiplier(resMult);<NEW_LINE>inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9));<NEW_LINE>setLostFocusBehavior(LostFocusBehavior.Disabled);<NEW_LINE>} else {<NEW_LINE>logger.config("VR mode disabled.");<NEW_LINE>viewPort.attachScene(rootNode);<NEW_LINE>guiViewPort.attachScene(guiNode);<NEW_LINE>}<NEW_LINE>if (viewManager != null) {<NEW_LINE>viewManager.initialize();<NEW_LINE>}<NEW_LINE>simpleInitApp();<NEW_LINE>// any filters created, move them now<NEW_LINE>if (viewManager != null) {<NEW_LINE>viewManager.moveScreenProcessingToEyes();<NEW_LINE>// print out camera information<NEW_LINE>if (isInVR()) {<NEW_LINE>logger.info("VR Initialization Information");<NEW_LINE>if (viewManager.getLeftCamera() != null) {<NEW_LINE>logger.info("camLeft: " + viewManager.<MASK><NEW_LINE>}<NEW_LINE>if (viewManager.getRightCamera() != null) {<NEW_LINE>logger.info("camRight: " + viewManager.getRightCamera().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getLeftCamera().toString());
664,153
public static RecordFormats selectNewestFormat(Config config, RecordDatabaseLayout databaseLayout, FileSystemAbstraction fs, PageCache pageCache, LogProvider logProvider, PageCacheTracer pageCacheTracer) {<NEW_LINE>boolean formatConfigured = StringUtils<MASK><NEW_LINE>if (formatConfigured) {<NEW_LINE>// format was explicitly configured so select it<NEW_LINE>return selectForConfig(config, logProvider);<NEW_LINE>} else {<NEW_LINE>final RecordFormats result = selectForStore(databaseLayout, fs, pageCache, logProvider, pageCacheTracer);<NEW_LINE>if (result == null) {<NEW_LINE>// format was not explicitly configured and store does not exist, select default format<NEW_LINE>info(logProvider, format("Selected format '%s' for the new store %s", DEFAULT_FORMAT, databaseLayout.databaseDirectory()));<NEW_LINE>return DEFAULT_FORMAT;<NEW_LINE>}<NEW_LINE>Optional<RecordFormats> newestFormatInFamily = findLatestFormatInFamily(result);<NEW_LINE>RecordFormats newestFormat = newestFormatInFamily.orElse(result);<NEW_LINE>info(logProvider, format("Selected format '%s' for existing store %s with format '%s'", newestFormat, databaseLayout.databaseDirectory(), result));<NEW_LINE>return newestFormat;<NEW_LINE>}<NEW_LINE>}
.isNotEmpty(configuredRecordFormat(config));
383,617
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent bountyOfLuxa = game.getPermanent(source.getSourceId());<NEW_LINE>if (bountyOfLuxa != null && bountyOfLuxa.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) {<NEW_LINE>bountyOfLuxa = null;<NEW_LINE>}<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (bountyOfLuxa != null && bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) > 0) {<NEW_LINE>bountyOfLuxa.removeCounters(CounterType.FLOOD.createInstance(bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD)), source, game);<NEW_LINE>if (bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) == 0) {<NEW_LINE>Mana manaToAdd = new Mana();<NEW_LINE>manaToAdd.increaseColorless();<NEW_LINE>manaToAdd.increaseGreen();<NEW_LINE>manaToAdd.increaseBlue();<NEW_LINE>controller.getManaPool().<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (bountyOfLuxa != null) {<NEW_LINE>new AddCountersSourceEffect(CounterType.FLOOD.createInstance()).apply(game, source);<NEW_LINE>}<NEW_LINE>controller.drawCards(1, source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
addMana(manaToAdd, game, source);
225,420
private boolean doLaunch(@Nullable String url, @Nonnull List<String> command, @Nullable final WebBrowser browser, @Nullable final Project project, @Nonnull String[] additionalParameters, @Nullable Runnable launchTask) {<NEW_LINE>if (url != null && url.startsWith("jar:")) {<NEW_LINE>String files = extractFiles(url);<NEW_LINE>if (files == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>url = files;<NEW_LINE>}<NEW_LINE>List<String> commandWithUrl = new ArrayList<>(command);<NEW_LINE>if (url != null) {<NEW_LINE>if (browser != null) {<NEW_LINE>browser.addOpenUrlParameter(commandWithUrl, url);<NEW_LINE>} else {<NEW_LINE>commandWithUrl.add(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GeneralCommandLine commandLine = new GeneralCommandLine(commandWithUrl);<NEW_LINE>addArgs(commandLine, browser == null ? null : browser.getSpecificSettings(), additionalParameters);<NEW_LINE>try {<NEW_LINE>Process process = commandLine.createProcess();<NEW_LINE>checkCreatedProcess(browser, <MASK><NEW_LINE>return true;<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>doShowError(e.getMessage(), browser, project, null, null);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
project, commandLine, process, launchTask);
680,340
private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds, boolean sendCommand) {<NEW_LINE>for (long removedBlockId : removedBlockIds) {<NEW_LINE>try (LockResource r = lockBlock(removedBlockId)) {<NEW_LINE>Optional<BlockMeta> block = mBlockStore.getBlock(removedBlockId);<NEW_LINE>if (block.isPresent()) {<NEW_LINE>LOG.debug("Block {} is removed on worker {}.", removedBlockId, workerInfo.getId());<NEW_LINE>mBlockStore.removeLocation(<MASK><NEW_LINE>if (mBlockStore.getLocations(removedBlockId).size() == 0) {<NEW_LINE>mLostBlocks.add(removedBlockId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove the block even if its metadata has been deleted already.<NEW_LINE>if (sendCommand) {<NEW_LINE>workerInfo.scheduleRemoveFromWorker(removedBlockId);<NEW_LINE>} else {<NEW_LINE>workerInfo.removeBlockFromWorkerMeta(removedBlockId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
removedBlockId, workerInfo.getId());
463,770
public Object buildTree(Relation<? extends NumberVector> relation, int left, int right, ArrayModifiableDBIDs sorted, DBIDArrayMIter iter, VectorUtil.SortDBIDsBySingleDimension comp) {<NEW_LINE>if (right - left <= leafsize) {<NEW_LINE>return new IntIntPair(left, right);<NEW_LINE>}<NEW_LINE>SplitStrategy.Info s = split.findSplit(relation, dims, sorted, iter, left, right, comp);<NEW_LINE>if (s == null || s.pos >= right) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>assert left < s.pos && s.pos < right;<NEW_LINE>KDNode node = new KDNode(s.dim, s.val, buildTree(relation, left, s.pos, sorted, iter, comp), buildTree(relation, s.pos, right, sorted, iter, comp));<NEW_LINE>assert assertSplitConsistent(left, s.pos, right, s.dim, s.val, iter);<NEW_LINE>return node;<NEW_LINE>}
return new IntIntPair(left, right);
304,580
private void startVolleyRequest() {<NEW_LINE>DisposableSubscriber<JSONObject> d = new DisposableSubscriber<JSONObject>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(JSONObject jsonObject) {<NEW_LINE>Log.e(TAG, "onNext " + jsonObject.toString());<NEW_LINE>_log(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>VolleyError cause = (VolleyError) e.getCause();<NEW_LINE>String s = new String(cause.networkResponse.data, Charset.forName("UTF-8"));<NEW_LINE>Log.e(TAG, s);<NEW_LINE>Log.e(TAG, cause.toString());<NEW_LINE>_log("onError " + s);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>Log.e(TAG, "onCompleted");<NEW_LINE>Timber.d("----- onCompleted");<NEW_LINE>_log("onCompleted ");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>newGetRouteData().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(d);<NEW_LINE>_disposables.add(d);<NEW_LINE>}
"onNext " + jsonObject.toString());
717,903
public void observe(final Node node, final NativeObject options) {<NEW_LINE>if (node == null) {<NEW_LINE>throw Context.throwAsScriptRuntimeEx(new IllegalArgumentException("Node is undefined"));<NEW_LINE>}<NEW_LINE>if (options == null) {<NEW_LINE>throw Context.throwAsScriptRuntimeEx(new IllegalArgumentException("Options is undefined"));<NEW_LINE>}<NEW_LINE>node_ = node;<NEW_LINE>attaributes_ = Boolean.TRUE.equals(options.get("attributes"));<NEW_LINE>attributeOldValue_ = Boolean.TRUE.equals(options.get("attributeOldValue"));<NEW_LINE>characterData_ = Boolean.TRUE.equals(options.get("characterData"));<NEW_LINE>characterDataOldValue_ = Boolean.TRUE.equals(options.get("characterDataOldValue"));<NEW_LINE>subtree_ = Boolean.TRUE.equals(options.get("subtree"));<NEW_LINE>attributeFilter_ = (NativeArray) options.get("attributeFilter");<NEW_LINE>final boolean childList = Boolean.TRUE.equals(options.get("childList"));<NEW_LINE>if (!attaributes_ && !childList && !characterData_) {<NEW_LINE>throw Context.throwAsScriptRuntimeEx(new IllegalArgumentException("One of childList, attributes, od characterData must be set"));<NEW_LINE>}<NEW_LINE>if (attaributes_ && node_.getDomNodeOrDie() instanceof HtmlElement) {<NEW_LINE>((HtmlElement) node_.getDomNodeOrDie()).addHtmlAttributeChangeListener(this);<NEW_LINE>}<NEW_LINE>if (characterData_) {<NEW_LINE>node.<MASK><NEW_LINE>}<NEW_LINE>}
getDomNodeOrDie().addCharacterDataChangeListener(this);
1,380,823
public static ListFlowsResponse unmarshall(ListFlowsResponse listFlowsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFlowsResponse.setRequestId(_ctx.stringValue("ListFlowsResponse.RequestId"));<NEW_LINE>listFlowsResponse.setNextToken(_ctx.stringValue("ListFlowsResponse.NextToken"));<NEW_LINE>List<FlowsItem> flows <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFlowsResponse.Flows.Length"); i++) {<NEW_LINE>FlowsItem flowsItem = new FlowsItem();<NEW_LINE>flowsItem.setName(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].Name"));<NEW_LINE>flowsItem.setDescription(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].Description"));<NEW_LINE>flowsItem.setDefinition(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].Definition"));<NEW_LINE>flowsItem.setId(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].Id"));<NEW_LINE>flowsItem.setType(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].Type"));<NEW_LINE>flowsItem.setRoleArn(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].RoleArn"));<NEW_LINE>flowsItem.setCreatedTime(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].CreatedTime"));<NEW_LINE>flowsItem.setLastModifiedTime(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].LastModifiedTime"));<NEW_LINE>flowsItem.setExternalStorageLocation(_ctx.stringValue("ListFlowsResponse.Flows[" + i + "].ExternalStorageLocation"));<NEW_LINE>flows.add(flowsItem);<NEW_LINE>}<NEW_LINE>listFlowsResponse.setFlows(flows);<NEW_LINE>return listFlowsResponse;<NEW_LINE>}
= new ArrayList<FlowsItem>();
697,980
public void marshall(Device device, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (device == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(device.getDeviceId(), DEVICEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getDeviceArn(), DEVICEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getGlobalNetworkId(), GLOBALNETWORKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getAWSLocation(), AWSLOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getVendor(), VENDOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getModel(), MODEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getSerialNumber(), SERIALNUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getSiteId(), SITEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(device.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(device.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
device.getState(), STATE_BINDING);
765,576
public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {<NEW_LINE>LocalDeclaration local = binding.declaration;<NEW_LINE>IJavaElement parent = null;<NEW_LINE>if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {<NEW_LINE>HashSet existingElements = new HashSet();<NEW_LINE>HashMap knownScopes = new HashMap();<NEW_LINE>parent = this.handleFactory.createElement(binding.declaringScope, local.sourceStart, (ICompilationUnit) unit, existingElements, knownScopes);<NEW_LINE>} else {<NEW_LINE>// findLocalElement() cannot find local variable<NEW_LINE>parent = findLocalElement(local.sourceStart, binding.declaringScope.methodScope());<NEW_LINE>}<NEW_LINE>LocalVariable localVar = null;<NEW_LINE>if (parent != null) {<NEW_LINE>String typeSig = null;<NEW_LINE>if (local.type == null || local.type.isTypeNameVar(binding.declaringScope)) {<NEW_LINE>if (local.initialization instanceof CastExpression) {<NEW_LINE>typeSig = Util.typeSignature(((CastExpression) local.initialization).type);<NEW_LINE>} else {<NEW_LINE>typeSig = Signature.createTypeSignature(binding.type.signableName(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>typeSig = <MASK><NEW_LINE>}<NEW_LINE>localVar = new LocalVariable((JavaElement) parent, new String(local.name), local.declarationSourceStart, local.declarationSourceEnd, local.sourceStart, local.sourceEnd, typeSig, local.annotations, local.modifiers, local.getKind() == AbstractVariableDeclaration.PARAMETER);<NEW_LINE>}<NEW_LINE>if (localVar != null) {<NEW_LINE>addElement(localVar);<NEW_LINE>if (SelectionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print("SELECTION - accept local variable(");<NEW_LINE>System.out.print(localVar.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Util.typeSignature(local.type);
232,432
private void createSegment(File dataFile, int sequenceId) throws IOException {<NEW_LINE>LOGGER.info("Creating segment from data file: {} of sequence id: {}", dataFile, sequenceId);<NEW_LINE>_segmentGeneratorConfig.setInputFilePath(dataFile.getPath());<NEW_LINE>_segmentGeneratorConfig.setSequenceId(sequenceId);<NEW_LINE>SegmentIndexCreationDriver driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>try {<NEW_LINE>driver.init(_segmentGeneratorConfig);<NEW_LINE>driver.build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException("Caught exception while creating segment from data file: " + dataFile);<NEW_LINE>}<NEW_LINE>String segmentName = driver.getSegmentName();<NEW_LINE>File indexDir = driver.getOutputDirectory();<NEW_LINE>LOGGER.info("Created segment: {} from data file: {} into directory: {}", segmentName, dataFile, indexDir);<NEW_LINE>File segmentTarFile = new File(_segmentTarDir, segmentName + TarGzCompressionUtils.TAR_GZ_FILE_EXTENSION);<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>TarGzCompressionUtils.createTarGzFile(indexDir, segmentTarFile);<NEW_LINE>Path hdfsSegmentTarPath = new Path(_outputDir, segmentTarFile.getName());<NEW_LINE>LOGGER.info("Copying segment tar file from local: {} to HDFS: {}", segmentTarFile, hdfsSegmentTarPath);<NEW_LINE>_fileSystem.copyFromLocalFile(true, new Path(segmentTarFile.getPath()), hdfsSegmentTarPath);<NEW_LINE>LOGGER.info("Finish creating segment: {} from data file: {} of sequence id: {} into HDFS: {}", segmentName, dataFile, sequenceId, hdfsSegmentTarPath);<NEW_LINE>}
"Tarring segment: {} from directory: {} to: {}", segmentName, indexDir, segmentTarFile);
1,503,596
public void updatePlayback(ExoPlayback playback) {<NEW_LINE><MASK><NEW_LINE>boolean playing = Utils.isPlaying(state);<NEW_LINE>List<Integer> compact = new ArrayList<>();<NEW_LINE>builder.mActions.clear();<NEW_LINE>// Adds the media buttons to the notification<NEW_LINE>addAction(previousAction, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS, compact);<NEW_LINE>addAction(rewindAction, PlaybackStateCompat.ACTION_REWIND, compact);<NEW_LINE>if (playing) {<NEW_LINE>addAction(pauseAction, PlaybackStateCompat.ACTION_PAUSE, compact);<NEW_LINE>} else {<NEW_LINE>addAction(playAction, PlaybackStateCompat.ACTION_PLAY, compact);<NEW_LINE>}<NEW_LINE>addAction(stopAction, PlaybackStateCompat.ACTION_STOP, compact);<NEW_LINE>addAction(forwardAction, PlaybackStateCompat.ACTION_FAST_FORWARD, compact);<NEW_LINE>addAction(nextAction, PlaybackStateCompat.ACTION_SKIP_TO_NEXT, compact);<NEW_LINE>// Prevent the media style from being used in older Huawei devices that don't support custom styles<NEW_LINE>if (!Build.MANUFACTURER.toLowerCase().contains("huawei") || Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>MediaStyle style = new MediaStyle();<NEW_LINE>if (playing) {<NEW_LINE>style.setShowCancelButton(false);<NEW_LINE>} else {<NEW_LINE>// Shows the cancel button on pre-lollipop versions due to a bug<NEW_LINE>style.setShowCancelButton(true);<NEW_LINE>style.setCancelButtonIntent(MediaButtonReceiver.buildMediaButtonPendingIntent(service, PlaybackStateCompat.ACTION_STOP));<NEW_LINE>}<NEW_LINE>// Links the media session<NEW_LINE>style.setMediaSession(session.getSessionToken());<NEW_LINE>// Updates the compact media buttons for the notification<NEW_LINE>if (!compact.isEmpty()) {<NEW_LINE>int[] compactIndexes = new int[compact.size()];<NEW_LINE>for (int i = 0; i < compact.size(); i++) compactIndexes[i] = compact.get(i);<NEW_LINE>style.setShowActionsInCompactView(compactIndexes);<NEW_LINE>}<NEW_LINE>builder.setStyle(style);<NEW_LINE>}<NEW_LINE>updatePlaybackState(playback);<NEW_LINE>updateNotification();<NEW_LINE>}
int state = playback.getState();
1,640,826
final CreateSignalingChannelResult executeCreateSignalingChannel(CreateSignalingChannelRequest createSignalingChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSignalingChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSignalingChannelRequest> request = null;<NEW_LINE>Response<CreateSignalingChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSignalingChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSignalingChannelRequest));<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, "Kinesis Video");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSignalingChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSignalingChannelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSignalingChannel");
1,637,031
public List<String> expendUnitToUnit(List<String> unitList) throws Exception {<NEW_LINE>List<String> unitIds = new ArrayList<>();<NEW_LINE>List<String> expendUnitIds = new ArrayList<>();<NEW_LINE>if (ListTools.isNotEmpty(unitList)) {<NEW_LINE>for (String s : unitList) {<NEW_LINE>Unit u = this.unit().pick(s);<NEW_LINE>if (null != u) {<NEW_LINE>unitIds.add(u.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(unitIds)) {<NEW_LINE>unitIds = ListTools.trim(unitIds, true, true);<NEW_LINE>for (String s : unitIds) {<NEW_LINE>expendUnitIds.add(s);<NEW_LINE>expendUnitIds.addAll(this.unit<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>expendUnitIds = ListTools.trim(expendUnitIds, true, true);<NEW_LINE>return expendUnitIds;<NEW_LINE>}
().listSubNested(s));
146,998
public LocalDate queryFrom(TemporalAccessor temporal) {<NEW_LINE>if (temporal.isSupported(ChronoField.EPOCH_DAY)) {<NEW_LINE>return LocalDate.ofEpochDay(temporal.getLong(ChronoField.EPOCH_DAY));<NEW_LINE>} else if (temporal.isSupported(ChronoField.YEAR_OF_ERA) || temporal.isSupported(ChronoField.YEAR)) {<NEW_LINE>int year = getYear(temporal);<NEW_LINE>if (temporal.isSupported(ChronoField.MONTH_OF_YEAR) && temporal.isSupported(ChronoField.DAY_OF_MONTH)) {<NEW_LINE>return LocalDate.of(year, temporal.get(ChronoField.MONTH_OF_YEAR), temporal<MASK><NEW_LINE>} else if (temporal.isSupported(DAY_OF_YEAR)) {<NEW_LINE>return LocalDate.ofYearDay(year, temporal.get(DAY_OF_YEAR));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.get(ChronoField.DAY_OF_MONTH));
583,016
private static void doOpen(@Nonnull File _dir, @Nullable File _toSelect) throws IOException, ExecutionException {<NEW_LINE>String dir = FileUtil.toSystemDependentName(FileUtil.toCanonicalPath<MASK><NEW_LINE>String toSelect = _toSelect != null ? FileUtil.toSystemDependentName(FileUtil.toCanonicalPath(_toSelect.getPath())) : null;<NEW_LINE>if (SystemInfo.isWindows) {<NEW_LINE>String cmd = toSelect != null ? "explorer /select,\"" + shortPath(toSelect) + '"' : "explorer /root,\"" + shortPath(dir) + '"';<NEW_LINE>LOG.debug(cmd);<NEW_LINE>// no advanced quoting/escaping is needed<NEW_LINE>Process process = Runtime.getRuntime().exec(cmd);<NEW_LINE>new CapturingProcessHandler(process, null, cmd).runProcess().checkSuccess(LOG);<NEW_LINE>} else if (SystemInfo.isMac) {<NEW_LINE>GeneralCommandLine cmd = toSelect != null ? new GeneralCommandLine("open", "-R", toSelect) : new GeneralCommandLine("open", dir);<NEW_LINE>LOG.debug(cmd.toString());<NEW_LINE>ExecUtil.execAndGetOutput(cmd).checkSuccess(LOG);<NEW_LINE>} else if (fileManagerApp.getValue() != null) {<NEW_LINE>schedule(new GeneralCommandLine(fileManagerApp.getValue(), toSelect != null ? toSelect : dir));<NEW_LINE>} else if (SystemInfo.hasXdgOpen()) {<NEW_LINE>schedule(new GeneralCommandLine("xdg-open", dir));<NEW_LINE>} else if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {<NEW_LINE>LOG.debug("opening " + dir + " via desktop API");<NEW_LINE>Desktop.getDesktop().open(new File(dir));<NEW_LINE>} else {<NEW_LINE>Messages.showErrorDialog("This action isn't supported on the current platform", "Cannot Open File");<NEW_LINE>}<NEW_LINE>}
(_dir.getPath()));
1,094,793
public boolean delistResource(Transaction tran, TransactionalResource h, int flag) throws IllegalStateException, SystemException {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "\n\nIn JavaEETransactionManagerSimplified.delistResource, h=" + h + " h.xares=" + h.<MASK><NEW_LINE>}<NEW_LINE>if (!h.isTransactional()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!(tran instanceof JavaEETransaction)) {<NEW_LINE>return delistJTSResource(tran, h, flag);<NEW_LINE>}<NEW_LINE>JavaEETransactionImpl tx = (JavaEETransactionImpl) tran;<NEW_LINE>if (tx.isLocalTx()) {<NEW_LINE>// dissociate resource from tx<NEW_LINE>try {<NEW_LINE>h.getXAResource().end(tx.getLocalXid(), flag);<NEW_LINE>} catch (XAException ex) {<NEW_LINE>throw new RuntimeException(sm.getString("enterprise_distributedtx.xaresource_end_excep", ex), ex);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return delistJTSResource(tran, h, flag);<NEW_LINE>}<NEW_LINE>}
getXAResource() + " tran=" + tran);
1,582,589
public static ChannelConfig defaultChannelConfig(String listenAddressName) {<NEW_LINE>ChannelConfig config = new ChannelConfig();<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.maxConnections, chooseIntChannelProperty(listenAddressName, "connection.max", CommonChannelConfigKeys.maxConnections.defaultValue())));<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.maxRequestsPerConnection, chooseIntChannelProperty(listenAddressName, "connection.max.requests", 20000)));<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout, chooseIntChannelProperty(listenAddressName, "connection.max.requests.brownout", CommonChannelConfigKeys.maxRequestsPerConnectionInBrownout.defaultValue())));<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.connectionExpiry, chooseIntChannelProperty(listenAddressName, "connection.expiry", CommonChannelConfigKeys.connectionExpiry.defaultValue())));<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.httpRequestReadTimeout, chooseIntChannelProperty(listenAddressName, "http.request.read.timeout", CommonChannelConfigKeys.httpRequestReadTimeout.defaultValue())));<NEW_LINE>int connectionIdleTimeout = chooseIntChannelProperty(listenAddressName, "connection.idle.timeout", CommonChannelConfigKeys.idleTimeout.defaultValue());<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.idleTimeout, connectionIdleTimeout));<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.serverTimeout, new ServerTimeout(connectionIdleTimeout)));<NEW_LINE>// For security, default to NEVER allowing XFF/Proxy headers from client.<NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.allowProxyHeadersWhen, StripUntrustedProxyHeadersHandler.AllowWhen.NEVER));<NEW_LINE>config.set(CommonChannelConfigKeys.withProxyProtocol, true);<NEW_LINE>config.<MASK><NEW_LINE>config.add(new ChannelConfigValue<>(CommonChannelConfigKeys.connCloseDelay, chooseIntChannelProperty(listenAddressName, "connection.close.delay", CommonChannelConfigKeys.connCloseDelay.defaultValue())));<NEW_LINE>return config;<NEW_LINE>}
set(CommonChannelConfigKeys.preferProxyProtocolForClientIp, true);
859,238
public void paint(Graphics g) {<NEW_LINE>if (line != null) {<NEW_LINE>int x1 = (int) line.getX1();<NEW_LINE>int x2 = (int) line.getX2();<NEW_LINE>int y1 = (int) line.getY1();<NEW_LINE>int y2 = (int) line.getY2();<NEW_LINE>if (y1 == y2) {<NEW_LINE>// LINE<NEW_LINE>g.drawLine(x1 + 2, y1, x2 - 2, y1);<NEW_LINE>g.drawLine(x1 + 2, y1 + 1, x2 - 2, y1 + 1);<NEW_LINE>// RIGHT<NEW_LINE>g.drawLine(x1, y1 - 2, x1, y1 + 3);<NEW_LINE>g.drawLine(x1 + 1, y2 - 1, x1 + 1, y1 + 2);<NEW_LINE>// LEFT<NEW_LINE>g.drawLine(x2, y1 - 2, x2, y1 + 3);<NEW_LINE>g.drawLine(x2 - 1, y1 - 1, x2 - 1, y1 + 2);<NEW_LINE>} else {<NEW_LINE>// LINE<NEW_LINE>g.drawLine(x1, y1 + 2, x2, y2 - 2);<NEW_LINE>g.drawLine(x1 + 1, y1 + 2, x2 + 1, y2 - 2);<NEW_LINE>// RIGHT<NEW_LINE>g.drawLine(x1 - 2, <MASK><NEW_LINE>g.drawLine(x1 - 1, y1 + 1, x1 + 2, y1 + 1);<NEW_LINE>// LEFT<NEW_LINE>g.drawLine(x2 - 2, y2, x2 + 3, y2);<NEW_LINE>g.drawLine(x2 - 1, y2 - 1, x2 + 2, y2 - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
y1, x1 + 3, y1);
115,713
public static RestClientConfig load(Class<?> interfaceClass) {<NEW_LINE>final RestClientConfig instance = new RestClientConfig();<NEW_LINE>instance.url = getConfigValue(interfaceClass, "url", String.class);<NEW_LINE>instance.uri = getConfigValue(interfaceClass, "uri", String.class);<NEW_LINE>instance.scope = getConfigValue(interfaceClass, "scope", String.class);<NEW_LINE>instance.providers = getConfigValue(interfaceClass, "providers", String.class);<NEW_LINE>instance.connectTimeout = getConfigValue(interfaceClass, "connect-timeout", Long.class);<NEW_LINE>instance.readTimeout = getConfigValue(interfaceClass, "read-timeout", Long.class);<NEW_LINE>instance.followRedirects = getConfigValue(interfaceClass, "follow-redirects", Boolean.class);<NEW_LINE>instance.proxyAddress = getConfigValue(interfaceClass, "proxy-address", String.class);<NEW_LINE>instance.proxyUser = getConfigValue(interfaceClass, "proxy-user", String.class);<NEW_LINE>instance.proxyPassword = getConfigValue(interfaceClass, "proxy-password", String.class);<NEW_LINE>instance.nonProxyHosts = getConfigValue(interfaceClass, "non-proxy-hosts", String.class);<NEW_LINE>instance.queryParamStyle = getConfigValue(interfaceClass, "query-param-style", QueryParamStyle.class);<NEW_LINE>instance.trustStore = getConfigValue(interfaceClass, "trust-store", String.class);<NEW_LINE>instance.trustStorePassword = getConfigValue(interfaceClass, "trust-store-password", String.class);<NEW_LINE>instance.trustStoreType = getConfigValue(interfaceClass, "trust-store-type", String.class);<NEW_LINE>instance.keyStore = getConfigValue(interfaceClass, "key-store", String.class);<NEW_LINE>instance.keyStorePassword = getConfigValue(interfaceClass, "key-store-password", String.class);<NEW_LINE>instance.keyStoreType = getConfigValue(interfaceClass, "key-store-type", String.class);<NEW_LINE>instance.hostnameVerifier = getConfigValue(interfaceClass, "hostname-verifier", String.class);<NEW_LINE>instance.connectionTTL = getConfigValue(interfaceClass, "connection-ttl", Integer.class);<NEW_LINE>instance.connectionPoolSize = getConfigValue(interfaceClass, "connection-pool-size", Integer.class);<NEW_LINE>instance.maxRedirects = getConfigValue(interfaceClass, "max-redirects", Integer.class);<NEW_LINE>instance.headers = getConfigValues(interfaceClass, "headers", <MASK><NEW_LINE>instance.shared = getConfigValue(interfaceClass, "shared", Boolean.class);<NEW_LINE>instance.name = getConfigValue(interfaceClass, "name", String.class);<NEW_LINE>return instance;<NEW_LINE>}
String.class, String.class);
352,310
public static void main(String[] args) {<NEW_LINE>Exercise31_Certification certification = new Exercise31_Certification();<NEW_LINE>BinarySearchTree.Node root = new BinarySearchTree().new Node(10, "Value 10", 7);<NEW_LINE>root.left = new BinarySearchTree().new Node(5, "Value 5", 4);<NEW_LINE>root.left.left = new BinarySearchTree().new Node(2, "Value 2", 1);<NEW_LINE>root.left.right = new BinarySearchTree().new Node(7, "Value 7", 2);<NEW_LINE>root.left.right.right = new BinarySearchTree().new Node(9, "Value 9", 1);<NEW_LINE>root.right = new BinarySearchTree().new Node(14, "Value 14", 2);<NEW_LINE>root.right.left = new BinarySearchTree().new Node(11, "Value 11", 1);<NEW_LINE>StdOut.println(certification.isBST(root) + " Expected: true");<NEW_LINE>BinarySearchTree.Node root2 = new BinarySearchTree().new Node(20, "Value 1", 7);<NEW_LINE>root2.left = new BinarySearchTree().new Node(5, "Value 5", 4);<NEW_LINE>root2.left.left = new BinarySearchTree().new Node(2, "Value 2", 1);<NEW_LINE>// Not a BST<NEW_LINE>root2.left.right = new BinarySearchTree().new Node(1, "Value 1", 2);<NEW_LINE>root2.left.right.right = new BinarySearchTree().new Node(9, "Value 9", 1);<NEW_LINE>root2.right = new BinarySearchTree().new Node(24, "Value 24", 2);<NEW_LINE>root2.right.left = new BinarySearchTree().new Node(21, "Value 21", 1);<NEW_LINE>StdOut.println(certification<MASK><NEW_LINE>}
.isBST(root2) + " Expected: false");
1,545,174
public Hcl visitSplatOperator(Hcl.Splat.Operator splatOperator, PrintOutputCapture<P> p) {<NEW_LINE>visitSpace(splatOperator.getPrefix(), Space.Location.SPLAT_OPERATOR, p);<NEW_LINE>visitMarkers(splatOperator.getMarkers(), p);<NEW_LINE>if (splatOperator.getType().equals(Hcl.Splat.Operator.Type.Full)) {<NEW_LINE>p.out.append('[');<NEW_LINE>} else {<NEW_LINE>p.out.append('.');<NEW_LINE>}<NEW_LINE>visitSpace(splatOperator.getSplat().getElement().getPrefix(), Space.Location.SPLAT_OPERATOR_PREFIX, p);<NEW_LINE><MASK><NEW_LINE>if (splatOperator.getType().equals(Hcl.Splat.Operator.Type.Full)) {<NEW_LINE>visitSpace(splatOperator.getSplat().getAfter(), Space.Location.SPLAT_OPERATOR_SUFFIX, p);<NEW_LINE>p.out.append(']');<NEW_LINE>}<NEW_LINE>return splatOperator;<NEW_LINE>}
p.out.append('*');
524,356
final UpdateUserHierarchyStructureResult executeUpdateUserHierarchyStructure(UpdateUserHierarchyStructureRequest updateUserHierarchyStructureRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserHierarchyStructureRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserHierarchyStructureRequest> request = null;<NEW_LINE>Response<UpdateUserHierarchyStructureResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserHierarchyStructureRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserHierarchyStructureRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateUserHierarchyStructure");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserHierarchyStructureResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserHierarchyStructureResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,704,595
private void checkArgValueMatchesAllowedScalar(List<GraphQLError> errors, Value<?> instanceValue, ScalarTypeDefinition allowedTypeDefinition) {<NEW_LINE>// scalars are allowed to accept ANY literal value - its up to their coercion to decide if its valid or not<NEW_LINE>List<ScalarTypeExtensionDefinition> extensions = typeRegistry.scalarTypeExtensions().getOrDefault(allowedTypeDefinition.getName(), emptyList());<NEW_LINE>ScalarWiringEnvironment environment = new ScalarWiringEnvironment(typeRegistry, allowedTypeDefinition, extensions);<NEW_LINE>WiringFactory wiringFactory = runtimeWiring.getWiringFactory();<NEW_LINE>GraphQLScalarType scalarType;<NEW_LINE>if (wiringFactory.providesScalar(environment)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>scalarType = runtimeWiring.getScalars().get(allowedTypeDefinition.getName());<NEW_LINE>}<NEW_LINE>// scalarType will always be present as<NEW_LINE>// scalar implementation validation has been performed earlier<NEW_LINE>if (!isArgumentValueScalarLiteral(scalarType, instanceValue)) {<NEW_LINE>addValidationError(errors, NOT_A_VALID_SCALAR_LITERAL_MESSAGE, allowedTypeDefinition.getName());<NEW_LINE>}<NEW_LINE>}
scalarType = wiringFactory.getScalar(environment);
1,697,830
public Uni<HttpSecurityPolicy.CheckResult> runBlocking(RoutingContext context, Uni<SecurityIdentity> identity, BiFunction<RoutingContext, SecurityIdentity, HttpSecurityPolicy.CheckResult> function) {<NEW_LINE>if (BlockingOperationControl.isBlockingAllowed()) {<NEW_LINE>try {<NEW_LINE>HttpSecurityPolicy.CheckResult res = function.apply(context, identity.await().indefinitely());<NEW_LINE>return Uni.createFrom().item(res);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Uni.createFrom().failure(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return Uni.createFrom().emitter(new Consumer<UniEmitter<? super HttpSecurityPolicy.CheckResult>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(UniEmitter<? super HttpSecurityPolicy.CheckResult> uniEmitter) {<NEW_LINE>ExecutorRecorder.getCurrent().execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>HttpSecurityPolicy.CheckResult val = function.apply(context, identity.await().indefinitely());<NEW_LINE>uniEmitter.complete(val);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>uniEmitter.fail(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>return Uni.<MASK><NEW_LINE>}<NEW_LINE>}
createFrom().failure(e);