idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
825,879
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, (DomainValue.REGULAR).calculate(game, source, this)));<NEW_LINE>controller.lookAtCards(source, null, cards, game);<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>if (cards.size() == 1) {<NEW_LINE>controller.moveCards(cards, Zone.HAND, source, game);<NEW_LINE>} else {<NEW_LINE>TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));<NEW_LINE>if (controller.choose(Outcome.DrawCard, cards, target, game)) {<NEW_LINE>Card card = cards.get(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>cards.remove(card);<NEW_LINE>controller.moveCards(card, Zone.HAND, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.putCardsOnBottomOfLibrary(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
cards, game, source, true);
545,696
public okhttp3.Call systemScopesGetCall(final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/system-scopes";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
String[] localVarAccepts = { "application/json" };
758,911
public void add(final ServiceComponent service) {<NEW_LINE>final Document doc = new Document();<NEW_LINE>addField(doc, IndexConstants.SERVICECOMPONENT_UUID, service.getUuid().toString(), Field.Store.YES, false);<NEW_LINE>addField(doc, IndexConstants.SERVICECOMPONENT_NAME, service.getName(), Field.Store.YES, true);<NEW_LINE>addField(doc, IndexConstants.SERVICECOMPONENT_GROUP, service.getGroup(), Field.Store.YES, true);<NEW_LINE>addField(doc, IndexConstants.SERVICECOMPONENT_VERSION, service.getVersion(), Field.Store.YES, false);<NEW_LINE>// TODO: addField(doc, IndexConstants.SERVICECOMPONENT_URL, service.getUrl(), Field.Store.YES, true);<NEW_LINE>addField(doc, IndexConstants.SERVICECOMPONENT_DESCRIPTION, service.getDescription(), Field.Store.YES, true);<NEW_LINE>try {<NEW_LINE>getIndexWriter().addDocument(doc);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("An error occurred while adding service to index", e);<NEW_LINE>Notification.dispatch(new Notification().scope(NotificationScope.SYSTEM).group(NotificationGroup.INDEXING_SERVICE).title(NotificationConstants.Title.SERVICECOMPONENT_INDEXER).content("An error occurred while adding service to index. Check log for details. " + e.getMessage())<MASK><NEW_LINE>}<NEW_LINE>}
.level(NotificationLevel.ERROR));
525,511
final DescribeSpotDatafeedSubscriptionResult executeDescribeSpotDatafeedSubscription(DescribeSpotDatafeedSubscriptionRequest describeSpotDatafeedSubscriptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeSpotDatafeedSubscriptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeSpotDatafeedSubscriptionRequest> request = null;<NEW_LINE>Response<DescribeSpotDatafeedSubscriptionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeSpotDatafeedSubscriptionRequestMarshaller().marshall(super.beforeMarshalling(describeSpotDatafeedSubscriptionRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeSpotDatafeedSubscription");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeSpotDatafeedSubscriptionResult> responseHandler = new StaxResponseHandler<DescribeSpotDatafeedSubscriptionResult>(new DescribeSpotDatafeedSubscriptionResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
602,998
public synchronized void startMatch() {<NEW_LINE>if (table.getState() == TableState.STARTING) {<NEW_LINE>try {<NEW_LINE>if (table.isTournamentSubTable()) {<NEW_LINE>logger.info("Tourn. match started id:" + match.getId() + " tournId: " + table.getTournament().getId());<NEW_LINE>} else {<NEW_LINE>managerFactory.userManager().getUser(userId).ifPresent(user -> {<NEW_LINE>logger.info("MATCH started [" + match.getName() + "] " + match.getId() + '(' + <MASK><NEW_LINE>logger.debug("- " + match.getOptions().getGameType() + " - " + match.getOptions().getDeckType());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>match.startMatch();<NEW_LINE>startGame(null);<NEW_LINE>} catch (GameException ex) {<NEW_LINE>logger.fatal("Error starting match ", ex);<NEW_LINE>match.endGame();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
user.getName() + ')');
965,308
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {<NEW_LINE>LayoutInflater inflater <MASK><NEW_LINE>@SuppressLint("InflateParams")<NEW_LINE>View view = inflater.inflate(R.layout.fragment_installer, null);<NEW_LINE>tvMessage = view.findViewById(R.id.tvMidletInfo);<NEW_LINE>tvStatus = view.findViewById(R.id.tvStatus);<NEW_LINE>progress = view.findViewById(R.id.progress);<NEW_LINE>btnOk = view.findViewById(R.id.btnOk);<NEW_LINE>btnClose = view.findViewById(R.id.btnClose);<NEW_LINE>btnRun = view.findViewById(R.id.btnRun);<NEW_LINE>mDialog = new AlertDialog.Builder(requireActivity(), getTheme()).setIcon(R.mipmap.ic_launcher).setView(view).setTitle("MIDlet installer").setCancelable(false).create();<NEW_LINE>return mDialog;<NEW_LINE>}
= requireActivity().getLayoutInflater();
1,733,822
public boolean hasNext() {<NEW_LINE>if (getNext()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>resetToLastKey();<NEW_LINE>// Fail if there is no node anymore.<NEW_LINE>if (!mHasNext) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Setup everything.<NEW_LINE>mDiffCont = mDiffs.get(mIndex + mPrunedNodes + 1);<NEW_LINE>mDiff = mDiffCont.getDiff();<NEW_LINE>final boolean isOldTransaction = (mDiff == DiffType.DELETED || mDiff == DiffType.MOVEDFROM || mDiff == DiffType.REPLACEDOLD);<NEW_LINE>final long nodeKey = isOldTransaction ? mDiffCont.getOldNodeKey() : mDiffCont.getNewNodeKey();<NEW_LINE>final DiffDepth depthCont = mDiffCont.getDepth();<NEW_LINE>mOrigDepth = isOldTransaction ? depthCont.getOldDepth() : depthCont.getNewDepth();<NEW_LINE>setTransaction(isOldTransaction ? mOldRtx : mNewRtx);<NEW_LINE>// Move to next key.<NEW_LINE>getTransaction().moveTo(nodeKey);<NEW_LINE>if (mDiff == DiffType.UPDATED) {<NEW_LINE>mOldRtx.<MASK><NEW_LINE>}<NEW_LINE>if (mDiff == DiffType.REPLACEDOLD) {<NEW_LINE>mNewRtx.moveTo(mDiffCont.getNewNodeKey());<NEW_LINE>}<NEW_LINE>if (mIndex + mPrunedNodes + 2 < mSize) {<NEW_LINE>final DiffTuple nextDiffCont = mDiffs.get(mIndex + mPrunedNodes + 2);<NEW_LINE>final DiffType nextDiff = nextDiffCont.getDiff();<NEW_LINE>final boolean nextIsOldTransaction = (nextDiff == DiffType.DELETED || nextDiff == DiffType.MOVEDFROM || nextDiff == DiffType.REPLACEDOLD);<NEW_LINE>final DiffDepth nextDepthCont = nextDiffCont.getDepth();<NEW_LINE>final int nextDepth = nextIsOldTransaction ? nextDepthCont.getOldDepth() : nextDepthCont.getNewDepth();<NEW_LINE>// Always follow first child if there is one.<NEW_LINE>if (nextDepth > mOrigDepth) {<NEW_LINE>return processFirstChild(mOrigDepth, nextDepth);<NEW_LINE>}<NEW_LINE>// Then follow right sibling if there is one.<NEW_LINE>if (mOrigDepth == nextDepth) {<NEW_LINE>return processRightSibling(nextDepth);<NEW_LINE>}<NEW_LINE>// Then follow right sibling on stack.<NEW_LINE>if (nextDepth < mOrigDepth) {<NEW_LINE>return processNextFollowing(mOrigDepth, nextDepth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Then end.<NEW_LINE>processLastItem(1);<NEW_LINE>mHasNext = false;<NEW_LINE>return true;<NEW_LINE>}
moveTo(mDiffCont.getOldNodeKey());
14,793
final AuthorizeSecurityGroupEgressResult executeAuthorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(authorizeSecurityGroupEgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AuthorizeSecurityGroupEgressRequest> request = null;<NEW_LINE>Response<AuthorizeSecurityGroupEgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AuthorizeSecurityGroupEgressRequestMarshaller().marshall(super.beforeMarshalling(authorizeSecurityGroupEgressRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AuthorizeSecurityGroupEgress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AuthorizeSecurityGroupEgressResult> responseHandler = new StaxResponseHandler<AuthorizeSecurityGroupEgressResult>(new AuthorizeSecurityGroupEgressResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
87,702
public Reservation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>Reservation reservation = new Reservation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return reservation;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("reservationId", targetDepth)) {<NEW_LINE>reservation.setReservationId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ownerId", targetDepth)) {<NEW_LINE>reservation.setOwnerId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("requesterId", targetDepth)) {<NEW_LINE>reservation.setRequesterId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("groupSet/item", targetDepth)) {<NEW_LINE>reservation.getGroups().add(GroupIdentifierStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("groupSet/item/groupName", targetDepth)) {<NEW_LINE>reservation.getGroupNames().add(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("instancesSet/item", targetDepth)) {<NEW_LINE>reservation.getInstances().add(InstanceStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return reservation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
10,999
private void resize() {<NEW_LINE>// can grow or shrink<NEW_LINE>final byte[] oldKeysArr = keysArr_;<NEW_LINE>final short[] oldCouponsArr = couponsArr_;<NEW_LINE>final byte[] oldStateArr = stateArr_;<NEW_LINE>final int oldSizeKeys = tableEntries_;<NEW_LINE>tableEntries_ = Math.max(nextPrime((int) (numActiveKeys_ / COUPON_MAP_TARGET_FILL_FACTOR)), COUPON_MAP_MIN_NUM_ENTRIES);<NEW_LINE>capacityEntries_ = (int) (tableEntries_ * COUPON_MAP_GROW_TRIGGER_FACTOR);<NEW_LINE>numActiveKeys_ = 0;<NEW_LINE>numDeletedKeys_ = 0;<NEW_LINE>entrySizeBytes_ = <MASK><NEW_LINE>keysArr_ = new byte[tableEntries_ * keySizeBytes_];<NEW_LINE>couponsArr_ = new short[tableEntries_ * maxCouponsPerKey_];<NEW_LINE>stateArr_ = new byte[(int) Math.ceil(tableEntries_ / 8.0)];<NEW_LINE>// move data<NEW_LINE>for (int i = 0; i < oldSizeKeys; i++) {<NEW_LINE>if (isBitSet(oldStateArr, i) && (oldCouponsArr[i * maxCouponsPerKey_] != 0)) {<NEW_LINE>final byte[] key = Arrays.copyOfRange(oldKeysArr, i * keySizeBytes_, (i * keySizeBytes_) + keySizeBytes_);<NEW_LINE>final int index = insertKey(key);<NEW_LINE>System.arraycopy(oldCouponsArr, i * maxCouponsPerKey_, couponsArr_, index * maxCouponsPerKey_, maxCouponsPerKey_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
updateEntrySizeBytes(tableEntries_, keySizeBytes_, maxCouponsPerKey_);
1,665,000
private static EnumMap<Shape, Rational> buildShapeDurations() {<NEW_LINE>EnumMap<Shape, Rational> map = new <MASK><NEW_LINE>// 4 measures<NEW_LINE>map.put(Shape.LONG_REST, new Rational(4, 1));<NEW_LINE>// 2 measures<NEW_LINE>map.put(Shape.BREVE_REST, new Rational(2, 1));<NEW_LINE>map.put(Shape.BREVE, new Rational(2, 1));<NEW_LINE>// 1 measure, unless partialWholeRests is on<NEW_LINE>map.put(Shape.WHOLE_REST, Rational.ONE);<NEW_LINE>map.put(Shape.WHOLE_NOTE, Rational.ONE);<NEW_LINE>map.put(Shape.HALF_REST, new Rational(1, 2));<NEW_LINE>map.put(Shape.NOTEHEAD_VOID, new Rational(1, 2));<NEW_LINE>map.put(Shape.NOTEHEAD_VOID_SMALL, new Rational(1, 2));<NEW_LINE>map.put(Shape.QUARTER_REST, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_CROSS, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_BLACK, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_BLACK_SMALL, QUARTER_DURATION);<NEW_LINE>map.put(Shape.EIGHTH_REST, new Rational(1, 8));<NEW_LINE>map.put(Shape.ONE_16TH_REST, new Rational(1, 16));<NEW_LINE>map.put(Shape.ONE_32ND_REST, new Rational(1, 32));<NEW_LINE>map.put(Shape.ONE_64TH_REST, new Rational(1, 64));<NEW_LINE>map.put(Shape.ONE_128TH_REST, new Rational(1, 128));<NEW_LINE>return map;<NEW_LINE>}
EnumMap<>(Shape.class);
183,036
static Iterable<Path> findAbsolutePaths(Object val) {<NEW_LINE>if (val instanceof Path) {<NEW_LINE>Path path = (Path) val;<NEW_LINE>if (path.isAbsolute()) {<NEW_LINE>return Collections.singleton(path);<NEW_LINE>}<NEW_LINE>} else if (val instanceof PathSourcePath) {<NEW_LINE>return findAbsolutePaths(((PathSourcePath) val).getRelativePath());<NEW_LINE>} else if (val instanceof Iterable) {<NEW_LINE>return FluentIterable.from((Iterable<?>) val).transformAndConcat(StringifyAlterRuleKey::findAbsolutePaths);<NEW_LINE>} else if (val instanceof Map) {<NEW_LINE>Map<?, ?> map = (<MASK><NEW_LINE>Iterable<?> allSubValues = Iterables.concat(map.keySet(), map.values());<NEW_LINE>return FluentIterable.from(allSubValues).transformAndConcat(StringifyAlterRuleKey::findAbsolutePaths);<NEW_LINE>} else if (val instanceof Optional) {<NEW_LINE>Optional<?> optional = (Optional<?>) val;<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>return findAbsolutePaths(optional.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ImmutableList.of();<NEW_LINE>}
Map<?, ?>) val;
374,537
// Use invokeAll where the group of tasks to invoke is a single task and where it is no tasks at all.<NEW_LINE>// When a single task is invoked, it runs on the current thread if a permit is available, and otherwise on a separate thread.<NEW_LINE>// However, if using CallerRuns, then it always runs on the current thread regardless of whether a permit is available.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAllOfOneAndNone() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAllOfOneAndNone").maxConcurrency(1).maxPolicy(MaxPolicy.strict).maxQueueSize(2).maxWaitForEnqueue(TimeUnit.SECONDS.toMillis(10));<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>List<Future<Long>> futures;<NEW_LINE>// Invoke group of none<NEW_LINE>futures = executor.invokeAll(Collections.<Callable<Long>>emptySet());<NEW_LINE>assertEquals(0, futures.size());<NEW_LINE>// Invoke group of one, where a maxConcurrency permit is available<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>assertEquals(1, futures.size());<NEW_LINE>assertEquals(Long.valueOf(threadId), futures.get(0).get(0, TimeUnit.MINUTES));<NEW_LINE>// Use up the maxConcurrency permit<NEW_LINE>CountDownLatch blockingLatch = new CountDownLatch(1);<NEW_LINE>Future<Boolean> blockingFuture = executor.submit(new CountDownTask(new CountDownLatch(1), blockingLatch, TimeUnit.<MASK><NEW_LINE>// Invoke group of one, where a maxConcurrency permit is unavailable.<NEW_LINE>// Because no threads are available to run the task, invokeAll will be blocked, and we will need to interrupt it<NEW_LINE>testThreads.submit(new InterrupterTask(Thread.currentThread(), blockingLatch, 1, TimeUnit.SECONDS));<NEW_LINE>try {<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>fail("Able to invoke task despite maximum concurrency. " + futures);<NEW_LINE>} catch (InterruptedException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>// If using maxConcurrencyAppliesToCallerThread=false, we don't need a permit<NEW_LINE>executor.maxPolicy(MaxPolicy.loose);<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>assertEquals(1, futures.size());<NEW_LINE>assertEquals(Long.valueOf(threadId), futures.get(0).get(0, TimeUnit.MINUTES));<NEW_LINE>// Release the blocker and let the blocking task finish normally<NEW_LINE>blockingLatch.countDown();<NEW_LINE>assertTrue(blockingFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(0, canceledFromQueue.size());<NEW_LINE>}
MINUTES.toNanos(15)));
575,455
protected <T> T retryIfEnabled(String locator, Supplier<T> action) {<NEW_LINE>if (options.isRetryEnabled()) {<NEW_LINE>// will throw exception if not found<NEW_LINE>waitFor(locator);<NEW_LINE>}<NEW_LINE>if (options.highlight) {<NEW_LINE>highlight(locator, options.highlightDuration);<NEW_LINE>}<NEW_LINE>String before = options.getPreSubmitHash();<NEW_LINE>if (before != null) {<NEW_LINE>logger.trace("submit requested, will wait for page load after next action on : {}", locator);<NEW_LINE>// clear the submit flag<NEW_LINE>options.setPreSubmitHash(null);<NEW_LINE>T result = action.get();<NEW_LINE><MASK><NEW_LINE>// reduce retry interval for this special case<NEW_LINE>options.setRetryInterval(500);<NEW_LINE>options.retry(() -> getSubmitHash(), hash -> !before.equals(hash), "waiting for document to change", false);<NEW_LINE>// restore<NEW_LINE>options.setRetryInterval(retryInterval);<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return action.get();<NEW_LINE>}<NEW_LINE>}
Integer retryInterval = options.getRetryInterval();
183,176
protected boolean init() {<NEW_LINE>if (!Skript.classExists("com.sk89q.worldguard.WorldGuard")) {<NEW_LINE>// Assume WorldGuard 6<NEW_LINE>try {<NEW_LINE>Class<?> oldHook = Class.forName("ch.njol.skript.module.worldguard6.WorldGuard6Hook", true, <MASK><NEW_LINE>oldHook.getDeclaredConstructor().newInstance();<NEW_LINE>return true;<NEW_LINE>} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {<NEW_LINE>Skript.error("An error occurred while trying to enable support for WorldGuard 6. WorldGuard region support has been disabled!");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else if (!Skript.classExists("com.sk89q.worldedit.math.BlockVector3")) {<NEW_LINE>Skript.error("WorldEdit you're using is not compatible with Skript. Disabling WorldGuard support!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return super.init();<NEW_LINE>}
getClass().getClassLoader());
1,166,805
private void populateFrrInterfaceProperties(Configuration c, FrrInterface iface) {<NEW_LINE>org.batfish.datamodel.Interface viIface = c.getAllInterfaces().get(iface.getName());<NEW_LINE>checkArgument(viIface != null, "VI interface object not found for interface %s", iface.getName());<NEW_LINE>if (iface.getAlias() != null) {<NEW_LINE>viIface.setDescription(iface.getAlias());<NEW_LINE>}<NEW_LINE>if (iface.getShutdown()) {<NEW_LINE>viIface.adminDown();<NEW_LINE>}<NEW_LINE>// ip addresses<NEW_LINE>String vrf = iface.getVrfName();<NEW_LINE>ImmutableList.Builder<ConcreteInterfaceAddress<MASK><NEW_LINE>for (ConcreteInterfaceAddress address : iface.getIpAddresses()) {<NEW_LINE>Prefix prefix = address.getPrefix();<NEW_LINE>if (ownedPrefixesByVrf().containsEntry(vrf, prefix)) {<NEW_LINE>viIface.setAdditionalArpIps(AclIpSpace.union(viIface.getAdditionalArpIps(), address.getIp().toIpSpace()));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ownedPrefixesByVrf().put(vrf, prefix);<NEW_LINE>ownedIpAddressesBuilder.add(address);<NEW_LINE>}<NEW_LINE>List<ConcreteInterfaceAddress> ownedIpAddresses = ownedIpAddressesBuilder.build();<NEW_LINE>if (!ownedIpAddresses.isEmpty()) {<NEW_LINE>viIface.setAddress(ownedIpAddresses.get(0));<NEW_LINE>viIface.setAllAddresses(ImmutableSet.<InterfaceAddress>builder().addAll(viIface.getAllAddresses()).addAll(ownedIpAddresses).build());<NEW_LINE>}<NEW_LINE>}
> ownedIpAddressesBuilder = ImmutableList.builder();
156,207
protected GridPointers pointerizeOp(Op op, int... dimensions) {<NEW_LINE>GridPointers pointers = new GridPointers(op, dimensions);<NEW_LINE><MASK><NEW_LINE>val context = allocator.getDeviceContext();<NEW_LINE>pointers.setX(allocator.getPointer(op.x(), context));<NEW_LINE>pointers.setXShapeInfo(allocator.getPointer(op.x().shapeInfoDataBuffer(), context));<NEW_LINE>pointers.setZ(allocator.getPointer(op.z(), context));<NEW_LINE>pointers.setZShapeInfo(allocator.getPointer(op.z().shapeInfoDataBuffer(), context));<NEW_LINE>pointers.setZLength(op.z().length());<NEW_LINE>if (op.y() != null) {<NEW_LINE>pointers.setY(allocator.getPointer(op.y(), context));<NEW_LINE>pointers.setYShapeInfo(allocator.getPointer(op.y().shapeInfoDataBuffer(), context));<NEW_LINE>}<NEW_LINE>if (dimensions != null && dimensions.length > 0) {<NEW_LINE>DataBuffer dimensionBuffer = Nd4j.getConstantHandler().getConstantBuffer(dimensions, DataType.INT);<NEW_LINE>pointers.setDimensions(allocator.getPointer(dimensionBuffer, context));<NEW_LINE>pointers.setDimensionsLength(dimensions.length);<NEW_LINE>}<NEW_LINE>// we build TADs<NEW_LINE>if (dimensions != null && dimensions.length > 0) {<NEW_LINE>Pair<DataBuffer, DataBuffer> tadBuffers = tadManager.getTADOnlyShapeInfo(op.x(), dimensions);<NEW_LINE>Pointer devTadShapeInfo = AtomicAllocator.getInstance().getPointer(tadBuffers.getFirst(), context);<NEW_LINE>Pointer devTadOffsets = tadBuffers.getSecond() == null ? null : AtomicAllocator.getInstance().getPointer(tadBuffers.getSecond(), context);<NEW_LINE>// we don't really care, if tadOffsets will be nulls<NEW_LINE>pointers.setTadShape(devTadShapeInfo);<NEW_LINE>pointers.setTadOffsets(devTadOffsets);<NEW_LINE>}<NEW_LINE>return pointers;<NEW_LINE>}
AtomicAllocator allocator = AtomicAllocator.getInstance();
1,181,198
public Statistics estimateStatistics() {<NEW_LINE>// its a fresh table, no data<NEW_LINE>if (table.currentSnapshot() == null) {<NEW_LINE>return new Stats(0L, 0L);<NEW_LINE>}<NEW_LINE>// estimate stats using snapshot summary only for partitioned tables (metadata tables are unpartitioned)<NEW_LINE>if (!table.spec().isUnpartitioned() && filterExpression() == Expressions.alwaysTrue()) {<NEW_LINE>long totalRecords = PropertyUtil.propertyAsLong(table.currentSnapshot().summary(), SnapshotSummary.TOTAL_RECORDS_PROP, Long.MAX_VALUE);<NEW_LINE>return new Stats(SparkSchemaUtil.estimateSize(lazyType(), totalRecords), totalRecords);<NEW_LINE>}<NEW_LINE>long numRows = 0L;<NEW_LINE>for (CombinedScanTask task : tasks()) {<NEW_LINE>for (FileScanTask file : task.files()) {<NEW_LINE>numRows += file.file().recordCount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long sizeInBytes = SparkSchemaUtil.<MASK><NEW_LINE>return new Stats(sizeInBytes, numRows);<NEW_LINE>}
estimateSize(lazyType(), numRows);
1,846,194
private boolean evaluateIsoSurface(VecD up, VecD direction) {<NEW_LINE>VecD pos = getFirstIntersectionWithHint(direction);<NEW_LINE>if (pos == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>VecD right = direction.cross(up).normalize(<MASK><NEW_LINE>up = up.multiply(SMOOTHNESS_ROTATION / SMOOTHNESS_GRID_SIZE);<NEW_LINE>// Generate the samples to compute the normal.<NEW_LINE>VecD[] grid = new VecD[SMOOTHNESS_GRID_SIZE * SMOOTHNESS_GRID_SIZE];<NEW_LINE>int size = (SMOOTHNESS_GRID_SIZE - 1) / 2;<NEW_LINE>for (int y = -size, index = 0; y <= size; y++) {<NEW_LINE>for (int x = -size; x <= size; x++, index++) {<NEW_LINE>grid[index] = pos.addScaled(up, y).addScaled(right, x);<NEW_LINE>VecD dir = grid[index].multiply(-1).normalize();<NEW_LINE>if ((grid[index] = rayCaster.getIntersection(grid[index], dir)) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Compute the normal based on the sampling grid.<NEW_LINE>VecD normal = new VecD();<NEW_LINE>for (int y = 0; y < SMOOTHNESS_GRID_SIZE - 1; y++) {<NEW_LINE>for (int x = 0; x < SMOOTHNESS_GRID_SIZE - 1; x++) {<NEW_LINE>int p0 = y * SMOOTHNESS_GRID_SIZE + x;<NEW_LINE>int p1 = (y + 1) * SMOOTHNESS_GRID_SIZE + x;<NEW_LINE>int p2 = y * SMOOTHNESS_GRID_SIZE + x + 1;<NEW_LINE>VecD upOffset = grid[p1].subtract(grid[p0]);<NEW_LINE>VecD rightOffset = grid[p2].subtract(grid[p0]);<NEW_LINE>normal = normal.add(rightOffset.cross(upOffset).normalize());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>normal = normal.normalize();<NEW_LINE>up = grid[INDEX_OF_Y1_X0].subtract(pos).normalize();<NEW_LINE>pos = pos.addScaled(normal, inflation);<NEW_LINE>// Interpolate the isosurface position & direction with the base's based on the zoom amount.<NEW_LINE>double zoom = getZoom();<NEW_LINE>normal = normal.multiply(-1).lerp(direction, zoom);<NEW_LINE>pos = pos.lerp(direction.multiply(-MAX_DISTANCE), zoom);<NEW_LINE>viewTransform = MatD.lookAt(pos, pos.add(normal), up);<NEW_LINE>return true;<NEW_LINE>}
).multiply(SMOOTHNESS_ROTATION / SMOOTHNESS_GRID_SIZE);
1,356,713
public void handle(HttpExchange t) throws IOException {<NEW_LINE>try {<NEW_LINE>LOGGER.debug("root req " + t.getRequestURI());<NEW_LINE>if (WebInterfaceServerUtil.deny(t)) {<NEW_LINE>throw new IOException("Access denied");<NEW_LINE>}<NEW_LINE>if (t.getRequestURI().getPath().contains("favicon")) {<NEW_LINE>WebInterfaceServerUtil.sendLogo(t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> vars = new HashMap<>();<NEW_LINE>vars.put<MASK><NEW_LINE>if (CONFIGURATION.getUseCache()) {<NEW_LINE>vars.put("cache", MediaServer.getURL() + "/console/home");<NEW_LINE>}<NEW_LINE>String response = parent.getResources().getTemplate("doc.html").execute(vars);<NEW_LINE>WebInterfaceServerUtil.respond(t, response, 200, "text/html");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (MustacheException e) {<NEW_LINE>// Nothing should get here, this is just to avoid crashing the thread<NEW_LINE>LOGGER.error("Unexpected error in DocHandler.handle(): {}", e.getMessage());<NEW_LINE>LOGGER.trace("", e);<NEW_LINE>}<NEW_LINE>}
("logs", getLogs(true));
918,811
public static <T> void assertEqualCollections(@Nonnull String message, @Nonnull Collection<T> actual, @Nonnull Collection<T> expected) {<NEW_LINE>if (!StringUtil.isEmptyOrSpaces(message) && !message.endsWith(":") && !message.endsWith(": ")) {<NEW_LINE>message += ": ";<NEW_LINE>}<NEW_LINE>if (actual.size() != expected.size()) {<NEW_LINE>fail(message + "Collections don't have the same size. " + stringifyActualExpected(actual, expected));<NEW_LINE>}<NEW_LINE>for (T act : actual) {<NEW_LINE>if (!expected.contains(act)) {<NEW_LINE>fail(message + "Unexpected object " + act + stringifyActualExpected(actual, expected));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// backwards is needed for collections which may contain duplicates, e.g. Lists.<NEW_LINE>for (T exp : expected) {<NEW_LINE>if (!actual.contains(exp)) {<NEW_LINE>fail(message + "Object " + exp + " not found in actual collection." <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ stringifyActualExpected(actual, expected));
72,600
private TExecPlanFragmentParams streamLoadPutImpl(TStreamLoadPutRequest request) throws UserException {<NEW_LINE>String cluster = request.getCluster();<NEW_LINE>if (Strings.isNullOrEmpty(cluster)) {<NEW_LINE>cluster = SystemInfoService.DEFAULT_CLUSTER;<NEW_LINE>}<NEW_LINE>Catalog catalog = Catalog.getCurrentCatalog();<NEW_LINE>String fullDbName = ClusterNamespace.getFullName(cluster, request.getDb());<NEW_LINE>Database db = catalog.getDb(fullDbName);<NEW_LINE>if (db == null) {<NEW_LINE>String dbName = fullDbName;<NEW_LINE>if (Strings.isNullOrEmpty(request.getCluster())) {<NEW_LINE>dbName = request.getDb();<NEW_LINE>}<NEW_LINE>throw new UserException("unknown database, database=" + dbName);<NEW_LINE>}<NEW_LINE>long timeoutMs = request.isSetThrift_rpc_timeout_ms() ? request.getThrift_rpc_timeout_ms() : 5000;<NEW_LINE>if (!db.tryReadLock(timeoutMs, TimeUnit.MILLISECONDS)) {<NEW_LINE>throw new UserException("get database read lock timeout, database=" + fullDbName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Table table = db.getTable(request.getTbl());<NEW_LINE>if (table == null) {<NEW_LINE>throw new UserException("unknown table, table=" + request.getTbl());<NEW_LINE>}<NEW_LINE>if (!(table instanceof OlapTable)) {<NEW_LINE>throw new UserException("load table type is not OlapTable, type=" + table.getClass());<NEW_LINE>}<NEW_LINE>StreamLoadTask streamLoadTask = StreamLoadTask.fromTStreamLoadPutRequest(request, db);<NEW_LINE>StreamLoadPlanner planner = new StreamLoadPlanner(db, (OlapTable) table, streamLoadTask);<NEW_LINE>TExecPlanFragmentParams plan = planner.plan(streamLoadTask.getId());<NEW_LINE>// add table indexes to transaction state<NEW_LINE>TransactionState txnState = Catalog.getCurrentGlobalTransactionMgr().getTransactionState(db.getId(<MASK><NEW_LINE>if (txnState == null) {<NEW_LINE>throw new UserException("txn does not exist: " + request.getTxnId());<NEW_LINE>}<NEW_LINE>txnState.addTableIndexes((OlapTable) table);<NEW_LINE>return plan;<NEW_LINE>} finally {<NEW_LINE>db.readUnlock();<NEW_LINE>}<NEW_LINE>}
), request.getTxnId());
1,025,547
public static void generateTargetGroupFiles(Map<String, List<TargetGroupVH>> targetGrpMap) throws IOException {<NEW_LINE>String fieldNames;<NEW_LINE>String keys;<NEW_LINE>fieldNames = "trgtGrp.TargetGroupArn`trgtGrp.TargetGroupName`trgtGrp.vpcid`trgtGrp.protocol`trgtGrp.port`trgtGrp.HealthyThresholdCount`trgtGrp.UnhealthyThresholdCount`trgtGrp.HealthCheckIntervalSeconds`trgtGrp.HealthCheckTimeoutSeconds`trgtGrp.LoadBalancerArns";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`targetgrouparn`targetgroupname`vpcid`protocol`port`healthythresholdcount`unhealthythresholdcount`healthcheckintervalseconds`healthchecktimeoutseconds`loadbalancerarns";<NEW_LINE>FileGenerator.generateJson(targetGrpMap, fieldNames, "aws-targetgroup.data", keys);<NEW_LINE>fieldNames = "trgtGrp.TargetGroupName`targets.target.id";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`targetgrouparn`targetgroupid";<NEW_LINE>FileGenerator.generateJson(<MASK><NEW_LINE>Map<String, List<LoadBalancerVH>> appElbInstanceMap = new HashMap<>();<NEW_LINE>Iterator<Entry<String, List<TargetGroupVH>>> it = targetGrpMap.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<String, List<TargetGroupVH>> entry = it.next();<NEW_LINE>String accntId = entry.getKey();<NEW_LINE>List<TargetGroupVH> trgtList = entry.getValue();<NEW_LINE>appElbInstanceMap.putIfAbsent(accntId, new ArrayList<LoadBalancerVH>());<NEW_LINE>for (TargetGroupVH trgtGrp : trgtList) {<NEW_LINE>List<String> elbList = trgtGrp.getTrgtGrp().getLoadBalancerArns();<NEW_LINE>for (String elbarn : elbList) {<NEW_LINE>LoadBalancer elb = new LoadBalancer();<NEW_LINE>elb.setLoadBalancerArn(elbarn);<NEW_LINE>Matcher appMatcher = Pattern.compile("(?<=loadbalancer/(app|net)/)(.*)(?=/)").matcher(elbarn);<NEW_LINE>if (appMatcher.find()) {<NEW_LINE>elb.setLoadBalancerName(appMatcher.group());<NEW_LINE>LoadBalancerVH elbVH = new LoadBalancerVH(elb);<NEW_LINE>List<com.amazonaws.services.elasticloadbalancing.model.Instance> instances = new ArrayList<>();<NEW_LINE>elbVH.setInstances(instances);<NEW_LINE>trgtGrp.getTargets().forEach(trgtHealth -> {<NEW_LINE>instances.add(new com.amazonaws.services.elasticloadbalancing.model.Instance(trgtHealth.getTarget().getId()));<NEW_LINE>});<NEW_LINE>appElbInstanceMap.get(accntId).add(elbVH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldNames = "lb.LoadBalancerName`Instances.InstanceId";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`loadbalancername`instanceid";<NEW_LINE>FileGenerator.generateJson(appElbInstanceMap, fieldNames, "aws-appelb-instances.data", keys);<NEW_LINE>}
targetGrpMap, fieldNames, "aws-targetgroup-instances.data", keys);
1,477,209
public boolean visit(AssertStatement node) {<NEW_LINE>Expression message = node.getMessage();<NEW_LINE>if (message != null) {<NEW_LINE>int atColon = this.tm.firstIndexBefore(message, TokenNameCOLON);<NEW_LINE>int afterColon = this.tm.firstIndexIn(message, -1);<NEW_LINE>if (this.options.wrap_before_assertion_message_operator) {<NEW_LINE>this.wrapIndexes.add(atColon);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>this.wrapIndexes.add(afterColon);<NEW_LINE>this.secondaryWrapIndexes.add(atColon);<NEW_LINE>}<NEW_LINE>this.wrapParentIndex = this.tm.firstIndexIn(node, -1);<NEW_LINE>this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);<NEW_LINE>handleWrap(this.options.alignment_for_assertion_message);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
this.secondaryWrapIndexes.add(afterColon);
609,323
public void process(ComplexEventChunk complexEventChunk) {<NEW_LINE>complexEventChunk.reset();<NEW_LINE>ComplexEventChunk<ComplexEvent> outputEventChunk = new ComplexEventChunk<>();<NEW_LINE>RateLimiterState state = stateHolder.getState();<NEW_LINE>try {<NEW_LINE>synchronized (state) {<NEW_LINE>while (complexEventChunk.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (event.getType() == ComplexEvent.Type.CURRENT || event.getType() == ComplexEvent.Type.EXPIRED) {<NEW_LINE>complexEventChunk.remove();<NEW_LINE>state.allComplexEventChunk.add(event);<NEW_LINE>state.counter++;<NEW_LINE>if (state.counter == value) {<NEW_LINE>outputEventChunk.add(state.allComplexEventChunk.getFirst());<NEW_LINE>state.allComplexEventChunk.clear();<NEW_LINE>state.counter = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stateHolder.returnState(state);<NEW_LINE>}<NEW_LINE>outputEventChunk.reset();<NEW_LINE>if (outputEventChunk.hasNext()) {<NEW_LINE>sendToCallBacks(outputEventChunk);<NEW_LINE>}<NEW_LINE>}
ComplexEvent event = complexEventChunk.next();
814,193
public void read(org.apache.thrift.protocol.TProtocol iprot, adhoc_filter_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.<MASK><NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // MID<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.I64) {<NEW_LINE>struct.mid = iprot.readI64();<NEW_LINE>struct.setMidIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // FILTER_EX<NEW_LINE>2:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.filter_ex = iprot.readString();<NEW_LINE>struct.setFilterExIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
apache.thrift.protocol.TField schemeField;
1,021,428
public static void runMain(IFindBugsEngine findBugs, TextUICommandLine commandLine) throws IOException {<NEW_LINE>boolean verbose = !commandLine.quiet();<NEW_LINE>try {<NEW_LINE>findBugs.execute();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// should not occur<NEW_LINE>assert false;<NEW_LINE>checkExitCodeFail(commandLine, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (RuntimeException | IOException e) {<NEW_LINE>checkExitCodeFail(commandLine, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>int bugCount = findBugs.getBugCount();<NEW_LINE>int missingClassCount = findBugs.getMissingClassCount();<NEW_LINE>int errorCount = findBugs.getErrorCount();<NEW_LINE>if (verbose || commandLine.setExitCode()) {<NEW_LINE>LOG.log(FINE, "Warnings generated: {0}", bugCount);<NEW_LINE>LOG.log(FINE, "Missing classes: {0}", missingClassCount);<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>if (commandLine.setExitCode()) {<NEW_LINE>int exitCode = ExitCodes.from(errorCount, missingClassCount, bugCount);<NEW_LINE>System.exit(exitCode);<NEW_LINE>}<NEW_LINE>}
log(FINE, "Analysis errors: {0}", errorCount);
1,642,553
public static ClientCompactionIntervalSpec fromSegments(List<DataSegment> segments, @Nullable Granularity segmentGranularity) {<NEW_LINE>Interval interval = JodaUtils.umbrellaInterval(segments.stream().map(DataSegment::getInterval).collect(Collectors.toList()));<NEW_LINE>LOGGER.info("Original umbrella interval %s in compaction task for datasource %s", interval, segments.get<MASK><NEW_LINE>if (segmentGranularity != null) {<NEW_LINE>// If segmentGranularity is set, then the segmentGranularity of the segments may not align with the configured segmentGranularity<NEW_LINE>// We must adjust the interval of the compaction task to fully cover and align with the segmentGranularity<NEW_LINE>// For example,<NEW_LINE>// - The umbrella interval of the segments is 2015-04-11/2015-04-12 but configured segmentGranularity is YEAR,<NEW_LINE>// if the compaction task's interval is 2015-04-11/2015-04-12 then we can run into race condition where after submitting<NEW_LINE>// the compaction task, a new segment outside of the interval (i.e. 2015-02-11/2015-02-12) got created will be lost as it is<NEW_LINE>// overshadowed by the compacted segment (compacted segment has interval 2015-01-01/2016-01-01.<NEW_LINE>// Hence, in this case, we must adjust the compaction task interval to 2015-01-01/2016-01-01.<NEW_LINE>// - The segment to be compacted has MONTH segmentGranularity with the interval 2015-02-01/2015-03-01 but configured<NEW_LINE>// segmentGranularity is WEEK. If the compaction task's interval is 2015-02-01/2015-03-01 then compacted segments created will be<NEW_LINE>// 2015-01-26/2015-02-02, 2015-02-02/2015-02-09, 2015-02-09/2015-02-16, 2015-02-16/2015-02-23, 2015-02-23/2015-03-02.<NEW_LINE>// This is because Druid's WEEK segments alway start and end on Monday. In the above example, 2015-01-26 and 2015-03-02<NEW_LINE>// are Mondays but 2015-02-01 and 2015-03-01 are not. Hence, the WEEK segments have to start and end on 2015-01-26 and 2015-03-02.<NEW_LINE>// If the compaction task's interval is 2015-02-01/2015-03-01, then the compacted segment would cause existing data<NEW_LINE>// from 2015-01-26 to 2015-02-01 and 2015-03-01 to 2015-03-02 to be lost. Hence, in this case,<NEW_LINE>// we must adjust the compaction task interval to 2015-01-26/2015-03-02<NEW_LINE>interval = JodaUtils.umbrellaInterval(segmentGranularity.getIterable(interval));<NEW_LINE>LOGGER.info("Interval adjusted to %s in compaction task for datasource %s with configured segmentGranularity %s", interval, segments.get(0).getDataSource(), segmentGranularity);<NEW_LINE>}<NEW_LINE>return new ClientCompactionIntervalSpec(interval, null);<NEW_LINE>}
(0).getDataSource());
496,047
public static APIQueryPortForwardingRuleReply __example__() {<NEW_LINE>APIQueryPortForwardingRuleReply reply = new APIQueryPortForwardingRuleReply();<NEW_LINE>PortForwardingRuleInventory rule = new PortForwardingRuleInventory();<NEW_LINE>rule.setUuid(uuid());<NEW_LINE>rule.setName("TestAttachRule");<NEW_LINE>rule.setDescription("test atatch rule");<NEW_LINE>rule.setAllowedCidr("0.0.0.0/0");<NEW_LINE>rule.setGuestIp("10.0.0.244");<NEW_LINE>rule.setPrivatePortStart(33);<NEW_LINE>rule.setPrivatePortEnd(33);<NEW_LINE>rule.setProtocolType("TCP");<NEW_LINE>rule.setState(<MASK><NEW_LINE>rule.setVipPortStart(33);<NEW_LINE>rule.setVipPortEnd(33);<NEW_LINE>rule.setVipIp("192.168.0.187");<NEW_LINE>rule.setVipUuid(uuid());<NEW_LINE>rule.setVmNicUuid(uuid());<NEW_LINE>rule.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>rule.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>reply.setInventories(asList(rule));<NEW_LINE>reply.setSuccess(true);<NEW_LINE>return reply;<NEW_LINE>}
PortForwardingRuleState.Enabled.toString());
1,016,214
void assign(TaskRequest request) {<NEW_LINE>final TaskRequest.AssignedResources assignedResources = request.getAssignedResources();<NEW_LINE>if (assignedResources != null) {<NEW_LINE>final List<ConsumeResult<MASK><NEW_LINE>if (consumedNamedResources != null && !consumedNamedResources.isEmpty()) {<NEW_LINE>for (PreferentialNamedConsumableResourceSet.ConsumeResult consumeResult : consumedNamedResources) {<NEW_LINE>if (name.equals(consumeResult.getAttrName())) {<NEW_LINE>final int index = consumeResult.getIndex();<NEW_LINE>if (index < 0 || index > usageBy.size())<NEW_LINE>throw new IllegalStateException("Illegal assignment of namedResource " + name + ": has " + usageBy.size() + " resource sets, can't assign to index " + index);<NEW_LINE>usageBy.get(index).consume(consumeResult.getResName(), request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> consumedNamedResources = assignedResources.getConsumedNamedResources();
1,794,798
public static void main(String[] args) {<NEW_LINE>String text = "barcelona";<NEW_LINE>SuffixArray suffixArray = new Exercise28().new SuffixArray(text);<NEW_LINE>StdOut.println(" i index lcp rank select");<NEW_LINE>StdOut.println("------------------------------");<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>int index = suffixArray.index(i);<NEW_LINE>String suffix = "\"" + text.substring(index) + "\"";<NEW_LINE>assert text.substring(index).equals(suffixArray.select(i));<NEW_LINE>int rank = suffixArray.rank(text.substring(index));<NEW_LINE>if (i == 0) {<NEW_LINE>StdOut.printf("%3d %5d %3s %4d %s\n", i, index, "-", rank, suffix);<NEW_LINE>} else {<NEW_LINE>int longestCommonPrefix = suffixArray.longestCommonPrefix(i);<NEW_LINE>StdOut.printf("%3d %5d %3d %4d %s\n", i, index, longestCommonPrefix, rank, suffix);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StdOut.println("\n*** Longest common prefix tests ***");<NEW_LINE>int lcp1 = suffixArray.longestCommonPrefix(1);<NEW_LINE>StdOut.<MASK><NEW_LINE>int lcp2 = suffixArray.longestCommonPrefix(2);<NEW_LINE>StdOut.println("LCP 2: " + lcp2 + " Expected: 0");<NEW_LINE>StdOut.println("\n*** Rank tests ***");<NEW_LINE>int rank1 = suffixArray.rank("algorithms");<NEW_LINE>StdOut.println("Rank algorithms: " + rank1 + " Expected: 1");<NEW_LINE>int rank2 = suffixArray.rank("fenwick");<NEW_LINE>StdOut.println("Rank fenwick: " + rank2 + " Expected: 5");<NEW_LINE>int rank3 = suffixArray.rank("rene argento");<NEW_LINE>StdOut.println("Rank rene argento: " + rank3 + " Expected: 9");<NEW_LINE>}
println("LCP 1: " + lcp1 + " Expected: 1");
1,716,047
public void assignPoint(Person person, String cityName) {<NEW_LINE>List<Place> zipsForCity;<NEW_LINE>if (cityName == null) {<NEW_LINE>int size = zipCodes.keySet().size();<NEW_LINE>cityName = (String) zipCodes.keySet().toArray()[person.randInt(size)];<NEW_LINE>}<NEW_LINE>zipsForCity = zipCodes.get(cityName);<NEW_LINE>if (zipsForCity == null) {<NEW_LINE>zipsForCity = zipCodes.get(cityName + " Town");<NEW_LINE>}<NEW_LINE>Place place;<NEW_LINE>if (zipsForCity.size() == 1) {<NEW_LINE>place = zipsForCity.get(0);<NEW_LINE>} else {<NEW_LINE>String personZip = (String) person.<MASK><NEW_LINE>if (personZip == null) {<NEW_LINE>place = zipsForCity.get(person.randInt(zipsForCity.size()));<NEW_LINE>} else {<NEW_LINE>place = zipsForCity.stream().filter(c -> personZip.equals(c.postalCode)).findFirst().orElse(zipsForCity.get(person.randInt(zipsForCity.size())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (place != null) {<NEW_LINE>// Get the coordinate of the city/town<NEW_LINE>Point2D.Double coordinate = new Point2D.Double();<NEW_LINE>coordinate.setLocation(place.coordinate);<NEW_LINE>// And now perturbate it slightly.<NEW_LINE>// Precision within 0.001 degree is more or less a neighborhood or street.<NEW_LINE>// Precision within 0.01 is a village or town<NEW_LINE>// Precision within 0.1 is a large city<NEW_LINE>double dx = person.rand(-0.05, 0.05);<NEW_LINE>double dy = person.rand(-0.05, 0.05);<NEW_LINE>coordinate.setLocation(coordinate.x + dx, coordinate.y + dy);<NEW_LINE>person.attributes.put(Person.COORDINATE, coordinate);<NEW_LINE>}<NEW_LINE>}
attributes.get(Person.ZIP);
1,396,015
public static RawTx fromProto(protobuf.BaseTx protoBaseTx) {<NEW_LINE>ImmutableList<TxInput> txInputs = protoBaseTx.getTxInputsList().isEmpty() ? ImmutableList.copyOf(new ArrayList<>()) : ImmutableList.copyOf(protoBaseTx.getTxInputsList().stream().map(TxInput::fromProto).collect<MASK><NEW_LINE>protobuf.RawTx protoRawTx = protoBaseTx.getRawTx();<NEW_LINE>ImmutableList<RawTxOutput> outputs = protoRawTx.getRawTxOutputsList().isEmpty() ? ImmutableList.copyOf(new ArrayList<>()) : ImmutableList.copyOf(protoRawTx.getRawTxOutputsList().stream().map(RawTxOutput::fromProto).collect(Collectors.toList()));<NEW_LINE>return new RawTx(protoBaseTx.getTxVersion(), protoBaseTx.getId(), protoBaseTx.getBlockHeight(), protoBaseTx.getBlockHash(), protoBaseTx.getTime(), txInputs, outputs);<NEW_LINE>}
(Collectors.toList()));
505,429
private void initComponents() {<NEW_LINE>// GEN-BEGIN:initComponents<NEW_LINE>jSplitPane1 = new javax.swing.JSplitPane();<NEW_LINE>documentTabs = new javax.swing.JTabbedPane();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>fileTree = new javax.swing.JTree();<NEW_LINE>toolbarPanel = new javax.swing.JPanel();<NEW_LINE>setTitle("MiniEdit");<NEW_LINE>addWindowListener(new java.awt.event.WindowAdapter() {<NEW_LINE><NEW_LINE>public void windowClosing(java.awt.event.WindowEvent evt) {<NEW_LINE>exitForm(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>documentTabs.setMinimumSize(new java.awt<MASK><NEW_LINE>jSplitPane1.setRightComponent(documentTabs);<NEW_LINE>jScrollPane1.setMinimumSize(new java.awt.Dimension(200, 200));<NEW_LINE>fileTree.addKeyListener(new java.awt.event.KeyAdapter() {<NEW_LINE><NEW_LINE>public void keyReleased(java.awt.event.KeyEvent evt) {<NEW_LINE>fileTreeKeyReleased(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileTree.addMouseListener(new java.awt.event.MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseClicked(java.awt.event.MouseEvent evt) {<NEW_LINE>fileTreeMouseClicked(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {<NEW_LINE><NEW_LINE>public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {<NEW_LINE>fileTreeValueChanged(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jScrollPane1.setViewportView(fileTree);<NEW_LINE>jSplitPane1.setLeftComponent(jScrollPane1);<NEW_LINE>getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);<NEW_LINE>getContentPane().add(toolbarPanel, java.awt.BorderLayout.NORTH);<NEW_LINE>}
.Dimension(400, 200));
1,321,361
protected T constructMappedInstance(ResultSet rs, TypeConverter tc) throws SQLException {<NEW_LINE>Assert.state(this.mappedConstructor != null, "Mapped constructor was not initialized");<NEW_LINE>Object[] args;<NEW_LINE>if (this.constructorParameterNames != null && this.constructorParameterTypes != null) {<NEW_LINE>args = new Object[this.constructorParameterNames.length];<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>String name = this.constructorParameterNames[i];<NEW_LINE>int index;<NEW_LINE>try {<NEW_LINE>// Try direct name match first<NEW_LINE>index = rs.findColumn(lowerCaseName(name));<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>// Try underscored name match instead<NEW_LINE>index = rs.findColumn(underscoreName(name));<NEW_LINE>}<NEW_LINE>TypeDescriptor td = this.constructorParameterTypes[i];<NEW_LINE>Object value = getColumnValue(rs, <MASK><NEW_LINE>args[i] = tc.convertIfNecessary(value, td.getType(), td);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>args = new Object[0];<NEW_LINE>}<NEW_LINE>return BeanUtils.instantiateClass(this.mappedConstructor, args);<NEW_LINE>}
index, td.getType());
582,326
private void updatePoolSize() {<NEW_LINE>DeviceProfile grid = BaseDraggingActivity.fromContext(getContext()).getDeviceProfile();<NEW_LINE><MASK><NEW_LINE>int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);<NEW_LINE>pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);<NEW_LINE>pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1);<NEW_LINE>pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1);<NEW_LINE>pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows * (mNumAppsPerRow + 1));<NEW_LINE>pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_FOLDER, approxRows * (mNumAppsPerRow + 1));<NEW_LINE>mViewHeights.clear();<NEW_LINE>mViewHeights.put(AllAppsGridAdapter.VIEW_TYPE_ICON, grid.allAppsCellHeightPx);<NEW_LINE>mViewHeights.put(AllAppsGridAdapter.VIEW_TYPE_FOLDER, grid.allAppsCellHeightPx);<NEW_LINE>}
RecyclerView.RecycledViewPool pool = getRecycledViewPool();
1,742,652
public void processResource(String resource, InputStream inputStream, List<Relocator> relocators, long time) throws IOException {<NEW_LINE>Attributes attributes;<NEW_LINE>if (shadedManifest == null) {<NEW_LINE>shadedManifest = new Manifest(inputStream);<NEW_LINE>attributes = shadedManifest.getMainAttributes();<NEW_LINE>} else {<NEW_LINE>Manifest manifest = new Manifest(inputStream);<NEW_LINE>attributes = manifest.getMainAttributes();<NEW_LINE>}<NEW_LINE>String importPackages = attributes.getValue(IMPORT_PACKAGE);<NEW_LINE>if (importPackages != null) {<NEW_LINE>List<String> definitions = ElementParser.parseDelimitedString(importPackages, ',', true);<NEW_LINE>for (String definition : definitions) {<NEW_LINE>PackageDefinition packageDefinition = new PackageDefinition(definition);<NEW_LINE>String packageName = packageDefinition.packageName;<NEW_LINE>PackageDefinition oldPackageDefinition = importedPackages.get(packageName);<NEW_LINE>importedPackages.put(packageName<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String exportPackages = attributes.getValue(EXPORT_PACKAGE);<NEW_LINE>if (exportPackages != null) {<NEW_LINE>List<String> definitions = ElementParser.parseDelimitedString(exportPackages, ',', true);<NEW_LINE>for (String definition : definitions) {<NEW_LINE>PackageDefinition packageDefinition = new PackageDefinition(definition);<NEW_LINE>String packageName = packageDefinition.packageName;<NEW_LINE>PackageDefinition oldPackageDefinition = exportedPackages.get(packageName);<NEW_LINE>exportedPackages.put(packageName, mergeExportUsesConstraint(packageDefinition, oldPackageDefinition));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>close(inputStream);<NEW_LINE>}
, findStrongerDefinition(packageDefinition, oldPackageDefinition));
1,035,630
public LayoutAlgorithm.Builder<AttributedVertex, ?, ?> apply(String name) {<NEW_LINE>switch(name) {<NEW_LINE>case GEM:<NEW_LINE>return GEMLayoutAlgorithm.edgeAwareBuilder();<NEW_LINE>case FORCED_BALANCED:<NEW_LINE>return KKLayoutAlgorithm.<AttributedVertex>builder().preRelaxDuration(1000);<NEW_LINE>case FORCE_DIRECTED:<NEW_LINE>return FRLayoutAlgorithm.<AttributedVertex>builder().repulsionContractBuilder(BarnesHutFRRepulsion.builder());<NEW_LINE>case CIRCLE:<NEW_LINE>return CircleLayoutAlgorithm.<AttributedVertex>builder().reduceEdgeCrossing(false);<NEW_LINE>case COMPACT_RADIAL:<NEW_LINE>return TidierRadialTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator);<NEW_LINE>case MIN_CROSS_TOP_DOWN:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.TOP_DOWN);<NEW_LINE>case MIN_CROSS_LONGEST_PATH:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.LONGEST_PATH);<NEW_LINE>case MIN_CROSS_NETWORK_SIMPLEX:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator<MASK><NEW_LINE>case MIN_CROSS_COFFMAN_GRAHAM:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.COFFMAN_GRAHAM);<NEW_LINE>case VERT_MIN_CROSS_TOP_DOWN:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.TOP_DOWN);<NEW_LINE>case VERT_MIN_CROSS_LONGEST_PATH:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.LONGEST_PATH);<NEW_LINE>case VERT_MIN_CROSS_NETWORK_SIMPLEX:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.NETWORK_SIMPLEX);<NEW_LINE>case VERT_MIN_CROSS_COFFMAN_GRAHAM:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.COFFMAN_GRAHAM);<NEW_LINE>case RADIAL:<NEW_LINE>return RadialTreeLayoutAlgorithm.<AttributedVertex>builder().verticalVertexSpacing(300);<NEW_LINE>case BALLOON:<NEW_LINE>return BalloonLayoutAlgorithm.<AttributedVertex>builder().verticalVertexSpacing(300);<NEW_LINE>case HIERACHICAL:<NEW_LINE>return EdgeAwareTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder();<NEW_LINE>case COMPACT_HIERARCHICAL:<NEW_LINE>default:<NEW_LINE>return TidierTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator);<NEW_LINE>}<NEW_LINE>}
).layering(Layering.NETWORK_SIMPLEX);
252,658
private static boolean processCompositeIndexDelete(final OIndex index, final Set<String> dirtyFields, final ODocument iRecord, List<IndexChange> changes) {<NEW_LINE>final OCompositeIndexDefinition indexDefinition = (OCompositeIndexDefinition) index.getDefinition();<NEW_LINE>final String multiValueField = indexDefinition.getMultiValueField();<NEW_LINE>final List<String> indexFields = indexDefinition.getFields();<NEW_LINE>for (final String indexField : indexFields) {<NEW_LINE>// REMOVE IT<NEW_LINE>if (dirtyFields.contains(indexField)) {<NEW_LINE>final List<Object> origValues = new ArrayList<>(indexFields.size());<NEW_LINE>for (final String field : indexFields) {<NEW_LINE>if (!field.equals(multiValueField))<NEW_LINE>if (dirtyFields.contains(field)) {<NEW_LINE>origValues.add(iRecord.getOriginalValue(field));<NEW_LINE>} else<NEW_LINE>origValues.add<MASK><NEW_LINE>}<NEW_LINE>if (multiValueField != null) {<NEW_LINE>final OMultiValueChangeTimeLine<?, ?> multiValueChangeTimeLine = iRecord.getCollectionTimeLine(multiValueField);<NEW_LINE>if (multiValueChangeTimeLine != null) {<NEW_LINE>final OTrackedMultiValue fieldValue = iRecord.field(multiValueField);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Object restoredMultiValue = fieldValue.returnOriginalState(multiValueChangeTimeLine.getMultiValueChangeEvents());<NEW_LINE>origValues.add(indexDefinition.getMultiValueDefinitionIndex(), restoredMultiValue);<NEW_LINE>} else if (dirtyFields.contains(multiValueField))<NEW_LINE>origValues.add(indexDefinition.getMultiValueDefinitionIndex(), iRecord.getOriginalValue(multiValueField));<NEW_LINE>else<NEW_LINE>origValues.add(indexDefinition.getMultiValueDefinitionIndex(), iRecord.field(multiValueField));<NEW_LINE>}<NEW_LINE>final Object origValue = indexDefinition.createValue(origValues);<NEW_LINE>deleteIndexKey(index, iRecord, origValue, changes);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
(iRecord.field(field));
293,088
private static void pointAddVar(boolean negate, PointExt p, PointExt r) {<NEW_LINE>int[] a = F.create();<NEW_LINE>int[] b = F.create();<NEW_LINE>int[] c = F.create();<NEW_LINE>int[] d = F.create();<NEW_LINE>int[] e = F.create();<NEW_LINE>int[] f = F.create();<NEW_LINE>int[] g = F.create();<NEW_LINE>int[] h = F.create();<NEW_LINE>int[] nb, ne, nf, ng;<NEW_LINE>if (negate) {<NEW_LINE>nb = e;<NEW_LINE>ne = b;<NEW_LINE>nf = g;<NEW_LINE>ng = f;<NEW_LINE>F.sub(p.y, p.x, h);<NEW_LINE>} else {<NEW_LINE>nb = b;<NEW_LINE>ne = e;<NEW_LINE>nf = f;<NEW_LINE>ng = g;<NEW_LINE>F.add(p.<MASK><NEW_LINE>}<NEW_LINE>F.mul(p.z, r.z, a);<NEW_LINE>F.sqr(a, b);<NEW_LINE>F.mul(p.x, r.x, c);<NEW_LINE>F.mul(p.y, r.y, d);<NEW_LINE>F.mul(c, d, e);<NEW_LINE>F.mul(e, -C_d, e);<NEW_LINE>// F.apm(b, e, f, g);<NEW_LINE>F.add(b, e, nf);<NEW_LINE>F.sub(b, e, ng);<NEW_LINE>F.add(r.x, r.y, e);<NEW_LINE>F.mul(h, e, h);<NEW_LINE>// F.apm(d, c, b, e);<NEW_LINE>F.add(d, c, nb);<NEW_LINE>F.sub(d, c, ne);<NEW_LINE>F.carry(nb);<NEW_LINE>F.sub(h, b, h);<NEW_LINE>F.mul(h, a, h);<NEW_LINE>F.mul(e, a, e);<NEW_LINE>F.mul(f, h, r.x);<NEW_LINE>F.mul(e, g, r.y);<NEW_LINE>F.mul(f, g, r.z);<NEW_LINE>}
y, p.x, h);
623,017
public void warm(LeafReader reader) throws IOException {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int indexedCount = 0;<NEW_LINE>int docValuesCount = 0;<NEW_LINE>int normsCount = 0;<NEW_LINE>for (FieldInfo info : reader.getFieldInfos()) {<NEW_LINE>if (info.getIndexOptions() != IndexOptions.NONE) {<NEW_LINE>reader.terms(info.name);<NEW_LINE>indexedCount++;<NEW_LINE>if (info.hasNorms()) {<NEW_LINE>reader.getNormValues(info.name);<NEW_LINE>normsCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (info.getDocValuesType() != DocValuesType.NONE) {<NEW_LINE>switch(info.getDocValuesType()) {<NEW_LINE>case NUMERIC:<NEW_LINE>reader.getNumericDocValues(info.name);<NEW_LINE>break;<NEW_LINE>case BINARY:<NEW_LINE>reader.getBinaryDocValues(info.name);<NEW_LINE>break;<NEW_LINE>case SORTED:<NEW_LINE>reader.getSortedDocValues(info.name);<NEW_LINE>break;<NEW_LINE>case SORTED_NUMERIC:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case SORTED_SET:<NEW_LINE>reader.getSortedSetDocValues(info.name);<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>default:<NEW_LINE>// unknown dv type<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>docValuesCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.document(0);<NEW_LINE>reader.getTermVectors(0);<NEW_LINE>if (infoStream.isEnabled("SMSW")) {<NEW_LINE>infoStream.message("SMSW", "Finished warming segment: " + reader + ", indexed=" + indexedCount + ", docValues=" + docValuesCount + ", norms=" + normsCount + ", time=" + (System.currentTimeMillis() - startTime));<NEW_LINE>}<NEW_LINE>}
reader.getSortedNumericDocValues(info.name);
393,101
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static void addInstanceFilter(com.sun.jdi.request.MethodExitRequest a, com.sun.jdi.ObjectReference b) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.request.MethodExitRequest", "addInstanceFilter", "JDI CALL: com.sun.jdi.request.MethodExitRequest({0}).addInstanceFilter({1})", new Object[] { a, b });<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>a.addInstanceFilter(b);<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.<MASK><NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.request.MethodExitRequest", "addInstanceFilter", org.netbeans.modules.debugger.jpda.JDIExceptionReporter.RET_VOID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Mirror) a).virtualMachine();
847,408
private void updateComponents() {<NEW_LINE>boolean state;<NEW_LINE>if (updating) {<NEW_LINE>log.debug("Ignoring updateComponents");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("Running updateComponents()");<NEW_LINE>updating = true;<NEW_LINE>// First enable all components if optimization not running<NEW_LINE>if (!running) {<NEW_LINE>log.debug("Initially enabling all components");<NEW_LINE>for (JComponent c : disableComponents) {<NEW_LINE>c.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// "Add" button<NEW_LINE>SimulationModifier mod = getSelectedAvailableModifier();<NEW_LINE>state = (mod != null && !selectedModifiers.contains(mod));<NEW_LINE>log.debug("addButton enabled: " + state);<NEW_LINE>addButton.setEnabled(state);<NEW_LINE>// "Remove" button<NEW_LINE>state = (selectedModifierTable.getSelectedRow() >= 0);<NEW_LINE>log.debug("removeButton enabled: " + state);<NEW_LINE>removeButton.setEnabled(state);<NEW_LINE>// "Remove all" button<NEW_LINE>state = (!selectedModifiers.isEmpty());<NEW_LINE>log.debug("removeAllButton enabled: " + state);<NEW_LINE>removeAllButton.setEnabled(state);<NEW_LINE>// Optimization goal<NEW_LINE>String selected = (String) optimizationGoalCombo.getSelectedItem();<NEW_LINE>state = GOAL_SEEK.equals(selected);<NEW_LINE>log.debug("optimizationGoalSpinner & UnitSelector enabled: " + state);<NEW_LINE>optimizationGoalSpinner.setVisible(state);<NEW_LINE>optimizationGoalUnitSelector.setVisible(state);<NEW_LINE>// Minimum/maximum stability options<NEW_LINE>state = minimumStabilitySelected.isSelected();<NEW_LINE>log.debug("minimumStabilitySpinner & UnitSelector enabled: " + state);<NEW_LINE>minimumStabilitySpinner.setEnabled(state);<NEW_LINE>minimumStabilityUnitSelector.setEnabled(state);<NEW_LINE>state = maximumStabilitySelected.isSelected();<NEW_LINE><MASK><NEW_LINE>maximumStabilitySpinner.setEnabled(state);<NEW_LINE>maximumStabilityUnitSelector.setEnabled(state);<NEW_LINE>// Plot button (enabled if path exists and dimensionality is 1 or 2)<NEW_LINE>state = (!optimizationPath.isEmpty() && (selectedModifiers.size() == 1 || selectedModifiers.size() == 2));<NEW_LINE>log.debug("plotButton enabled: " + state + " optimizationPath.isEmpty=" + optimizationPath.isEmpty() + " selectedModifiers.size=" + selectedModifiers.size());<NEW_LINE>plotButton.setEnabled(state);<NEW_LINE>// Save button (enabled if path exists)<NEW_LINE>state = (!evaluationHistory.isEmpty());<NEW_LINE>log.debug("saveButton enabled: " + state);<NEW_LINE>saveButton.setEnabled(state);<NEW_LINE>// Last disable all components if optimization is running<NEW_LINE>if (running) {<NEW_LINE>log.debug("Disabling all components because optimization is running");<NEW_LINE>for (JComponent c : disableComponents) {<NEW_LINE>c.setEnabled(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Update description text<NEW_LINE>mod = getSelectedModifier();<NEW_LINE>if (mod != null) {<NEW_LINE>selectedModifierDescription.setText(mod.getDescription());<NEW_LINE>} else {<NEW_LINE>selectedModifierDescription.setText("");<NEW_LINE>}<NEW_LINE>updating = false;<NEW_LINE>}
log.debug("maximumStabilitySpimmer & UnitSelector enabled: " + state);
1,231,635
public void fitToSuppliedMarkers(ReadableArray markerIDsArray, ReadableMap edgePadding, boolean animated) {<NEW_LINE>if (map == null)<NEW_LINE>return;<NEW_LINE>LatLngBounds.Builder builder = new LatLngBounds.Builder();<NEW_LINE>String[] markerIDs = new String[markerIDsArray.size()];<NEW_LINE>for (int i = 0; i < markerIDsArray.size(); i++) {<NEW_LINE>markerIDs[i] = markerIDsArray.getString(i);<NEW_LINE>}<NEW_LINE>boolean addedPosition = false;<NEW_LINE>List<String> markerIDList = Arrays.asList(markerIDs);<NEW_LINE>for (AirMapFeature feature : features) {<NEW_LINE>if (feature instanceof AirMapMarker) {<NEW_LINE>String identifier = ((AirMapMarker) feature).getIdentifier();<NEW_LINE>Marker marker = (Marker) feature.getFeature();<NEW_LINE>if (markerIDList.contains(identifier)) {<NEW_LINE>builder.include(marker.getPosition());<NEW_LINE>addedPosition = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addedPosition) {<NEW_LINE>LatLngBounds bounds = builder.build();<NEW_LINE>CameraUpdate cu = <MASK><NEW_LINE>if (edgePadding != null) {<NEW_LINE>map.setPadding(edgePadding.getInt("left"), edgePadding.getInt("top"), edgePadding.getInt("right"), edgePadding.getInt("bottom"));<NEW_LINE>}<NEW_LINE>if (animated) {<NEW_LINE>map.animateCamera(cu);<NEW_LINE>} else {<NEW_LINE>map.moveCamera(cu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
CameraUpdateFactory.newLatLngBounds(bounds, baseMapPadding);
724,424
public String addScheduledJobAfterDelay(int interval, IScheduledJob job, int delay) {<NEW_LINE>String name = getJobName();<NEW_LINE>// Store reference to applications job and service<NEW_LINE>JobDataMap jobData = new JobDataMap();<NEW_LINE>jobData.put(QuartzSchedulingServiceJob.SCHEDULING_SERVICE, this);<NEW_LINE>jobData.put(QuartzSchedulingServiceJob.SCHEDULED_JOB, job);<NEW_LINE>// detail<NEW_LINE>JobDetail jobDetail = JobBuilder.newJob(QuartzSchedulingServiceJob.class).withIdentity(name, null).usingJobData(jobData).build();<NEW_LINE>// Create trigger that fires indefinitely every <interval> milliseconds<NEW_LINE>Trigger trigger = TriggerBuilder.newTrigger().withIdentity(String.format("Trigger_%s", name)).startAt(DateBuilder.futureDate(delay, IntervalUnit.MILLISECOND)).forJob(jobDetail).withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInMilliseconds(interval).<MASK><NEW_LINE>// store keys by name<NEW_LINE>TriggerKey tKey = trigger.getKey();<NEW_LINE>JobKey jKey = trigger.getJobKey();<NEW_LINE>log.debug("Job key: {} Trigger key: {}", jKey, tKey);<NEW_LINE>ScheduledJobKey key = new ScheduledJobKey(tKey, jKey);<NEW_LINE>keyMap.put(name, key);<NEW_LINE>// schedule<NEW_LINE>scheduleJob(trigger, jobDetail);<NEW_LINE>return name;<NEW_LINE>}
repeatForever()).build();
846,095
private static void populateFindOnDemandQueryRuntime(FindOnDemandQueryRuntime findOnDemandQueryRuntime, MatchingMetaInfoHolder metaStreamInfoHolder, Selector selector, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, Map<String, Window> windowMap, int metaPosition, boolean groupBy, LockWrapper lockWrapper, SiddhiQueryContext siddhiQueryContext) {<NEW_LINE>ReturnStream returnStream = new ReturnStream(OutputStream.OutputEventType.CURRENT_EVENTS);<NEW_LINE>QuerySelector querySelector = SelectorParser.parse(selector, returnStream, metaStreamInfoHolder.getMetaStateEvent(), tableMap, variableExpressionExecutors, metaPosition, ProcessingMode.BATCH, false, siddhiQueryContext);<NEW_LINE>PassThroughOutputRateLimiter rateLimiter = new PassThroughOutputRateLimiter(siddhiQueryContext.getName());<NEW_LINE>rateLimiter.init(lockWrapper, groupBy, siddhiQueryContext);<NEW_LINE>OutputCallback outputCallback = OutputParser.constructOutputCallback(returnStream, metaStreamInfoHolder.getMetaStateEvent().getOutputStreamDefinition(), tableMap, windowMap, true, siddhiQueryContext);<NEW_LINE>rateLimiter.setOutputCallback(outputCallback);<NEW_LINE>querySelector.setNextProcessor(rateLimiter);<NEW_LINE>QueryParserHelper.reduceMetaComplexEvent(metaStreamInfoHolder.getMetaStateEvent());<NEW_LINE>QueryParserHelper.updateVariablePosition(metaStreamInfoHolder.getMetaStateEvent(), variableExpressionExecutors);<NEW_LINE>querySelector.setEventPopulator(StateEventPopulatorFactory.constructEventPopulator(metaStreamInfoHolder.getMetaStateEvent()));<NEW_LINE>findOnDemandQueryRuntime.setStateEventFactory(new StateEventFactory<MASK><NEW_LINE>findOnDemandQueryRuntime.setSelector(querySelector);<NEW_LINE>findOnDemandQueryRuntime.setOutputAttributes(metaStreamInfoHolder.getMetaStateEvent().getOutputStreamDefinition().getAttributeList());<NEW_LINE>}
(metaStreamInfoHolder.getMetaStateEvent()));
604,931
private static void checkSELinux() {<NEW_LINE>if (!DaemonUtils.hasSELinux()) {<NEW_LINE>System.out.println("- This device does not have SELinux");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!SELinux.isSELinuxEnabled()) {<NEW_LINE>System.out.println("- SELinux is disabled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!SELinux.isSELinuxEnforced()) {<NEW_LINE><MASK><NEW_LINE>System.out.println("! If your ROM runs Android 10+ and has SELinux permissive (it will disable seccomp), ANY app can escalate itself to uid 0, this is extremely dangerous");<NEW_LINE>System.out.println("- Just a kind reminder, continue installation...");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean file = SELinux.checkSELinuxAccess("u:r:init:s0", "u:object_r:system_file:s0", "file", "relabelfrom");<NEW_LINE>boolean dir = SELinux.checkSELinuxAccess("u:r:init:s0", "u:object_r:system_file:s0", "dir", "relabelfrom");<NEW_LINE>if (file || dir) {<NEW_LINE>System.out.println("!!!!!!!!! PLEASE READ !!!!!!!!!!");<NEW_LINE>if (file) {<NEW_LINE>System.out.println("! Your ROM allows init to relabel Magisk module files");<NEW_LINE>}<NEW_LINE>if (dir) {<NEW_LINE>System.out.println("! Your ROM allows init to relabel Magisk module files");<NEW_LINE>}<NEW_LINE>System.out.println("- Riru will try to reset the context of modules files, but not guaranteed to always work");<NEW_LINE>} else {<NEW_LINE>System.out.println("- No problem found");<NEW_LINE>}<NEW_LINE>}
System.out.println("! SELinux is permissive");
28,456
public static OpenSearchStatusException errorFromXContent(XContentParser parser) throws IOException {<NEW_LINE>XContentParser.<MASK><NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>OpenSearchException exception = null;<NEW_LINE>RestStatus status = null;<NEW_LINE>String currentFieldName = null;<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>currentFieldName = parser.currentName();<NEW_LINE>}<NEW_LINE>if (STATUS.equals(currentFieldName)) {<NEW_LINE>if (token != XContentParser.Token.FIELD_NAME) {<NEW_LINE>ensureExpectedToken(XContentParser.Token.VALUE_NUMBER, token, parser);<NEW_LINE>status = RestStatus.fromCode(parser.intValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>exception = OpenSearchException.failureFromXContent(parser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exception == null) {<NEW_LINE>throw new IllegalStateException("Failed to parse opensearch status exception: no exception was found");<NEW_LINE>}<NEW_LINE>OpenSearchStatusException result = new OpenSearchStatusException(exception.getMessage(), status, exception.getCause());<NEW_LINE>for (String header : exception.getHeaderKeys()) {<NEW_LINE>result.addHeader(header, exception.getHeader(header));<NEW_LINE>}<NEW_LINE>for (String metadata : exception.getMetadataKeys()) {<NEW_LINE>result.addMetadata(metadata, exception.getMetadata(metadata));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
Token token = parser.nextToken();
1,450,740
private void detachVipForPrivateL3(VmNicInventory nic, Completion completion) {<NEW_LINE>VirtualRouterVmInventory vr = VirtualRouterVmInventory.valueOf((VirtualRouterVmVO) Q.New(VirtualRouterVmVO.class).eq(VirtualRouterVmVO_.uuid, nic.getVmInstanceUuid<MASK><NEW_LINE>List<VipVO> vips = SQL.New("select vip from VipVO vip, VipPeerL3NetworkRefVO ref " + "where ref.vipUuid = vip.uuid and ref.l3NetworkUuid in (:routerNetworks) " + "and vip.l3NetworkUuid = :l3Uuid and vip.system=false").param("l3Uuid", nic.getL3NetworkUuid()).param("routerNetworks", vr.getAllL3Networks()).list();<NEW_LINE>if (vips.isEmpty()) {<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>releaseVipOnVirtualRouterVm(vr, VipInventory.valueOf(vips), completion);<NEW_LINE>}
()).find());
940,865
protected IndexImporter indexImporter(IndexConfig indexConfig, IndexImporterFactory importerFactory, BatchingNeoStores neoStores, EntityType entityType, MemoryTracker memoryTracker, CursorContext cursorContext, Function<CursorContext, StoreCursors> storeCursorsFactory) {<NEW_LINE>var schemaStore = neoStores.getNeoStores().getSchemaStore();<NEW_LINE>var metaDataStore = neoStores.getNeoStores().getMetaDataStore();<NEW_LINE>var tokenHolders = neoStores.getTokenHolders();<NEW_LINE>var schemaRuleAccess = <MASK><NEW_LINE>try (var storeCursors = storeCursorsFactory.apply(cursorContext)) {<NEW_LINE>var index = findIndex(entityType, schemaRuleAccess, storeCursors).orElseGet(() -> createIndex(entityType, indexConfig, schemaRuleAccess, schemaStore, memoryTracker, cursorContext, storeCursors));<NEW_LINE>return importerFactory.getImporter(index, neoStores.databaseLayout(), neoStores.fileSystem(), neoStores.getPageCache(), cursorContext);<NEW_LINE>}<NEW_LINE>}
getSchemaRuleAccess(schemaStore, tokenHolders, metaDataStore);
1,350,864
// Asynchronous Send Statement<NEW_LINE>@Override<NEW_LINE>public void visit(BLangWorkerSend workerSendNode, AnalyzerData data) {<NEW_LINE>BSymbol receiver = symResolver.lookupSymbolInMainSpace(data.env, names.fromIdNode(workerSendNode.workerIdentifier));<NEW_LINE>if ((receiver.tag & SymTag.VARIABLE) != SymTag.VARIABLE) {<NEW_LINE>receiver = symTable.notFoundSymbol;<NEW_LINE>}<NEW_LINE>verifyPeerCommunication(workerSendNode.pos, receiver, workerSendNode.workerIdentifier.value, data.env);<NEW_LINE>WorkerActionSystem was = data.workerActionSystemStack.peek();<NEW_LINE>BType type = workerSendNode.expr.getBType();<NEW_LINE>if (type == symTable.semanticError) {<NEW_LINE>// Error of this is already printed as undef-var<NEW_LINE>was.hasErrors = true;<NEW_LINE>} else if (workerSendNode.expr instanceof ActionNode) {<NEW_LINE>this.dlog.error(workerSendNode.<MASK><NEW_LINE>} else if (!types.isAssignable(type, symTable.cloneableType)) {<NEW_LINE>this.dlog.error(workerSendNode.pos, DiagnosticErrorCode.INVALID_TYPE_FOR_SEND, type);<NEW_LINE>}<NEW_LINE>String workerName = workerSendNode.workerIdentifier.getValue();<NEW_LINE>if (!isCommunicationAllowedLocation(data.env) && !data.inInternallyDefinedBlockStmt) {<NEW_LINE>this.dlog.error(workerSendNode.pos, DiagnosticErrorCode.UNSUPPORTED_WORKER_SEND_POSITION);<NEW_LINE>was.hasErrors = true;<NEW_LINE>}<NEW_LINE>if (!this.workerExists(workerSendNode.getBType(), workerName, data.env) || (!isWorkerFromFunction(data.env, names.fromString(workerName)) && !workerName.equals("function"))) {<NEW_LINE>this.dlog.error(workerSendNode.pos, DiagnosticErrorCode.UNDEFINED_WORKER, workerName);<NEW_LINE>was.hasErrors = true;<NEW_LINE>}<NEW_LINE>workerSendNode.setBType(createAccumulatedErrorTypeForMatchingReceive(workerSendNode.pos, workerSendNode.expr.getBType(), data));<NEW_LINE>was.addWorkerAction(workerSendNode);<NEW_LINE>analyzeExpr(workerSendNode.expr, data);<NEW_LINE>validateActionParentNode(workerSendNode.pos, workerSendNode.expr);<NEW_LINE>}
expr.pos, DiagnosticErrorCode.INVALID_SEND_EXPR);
649,954
private void actionAcctSchema() {<NEW_LINE>KeyNamePair keyNamePair = (KeyNamePair) selAcctSchema.getSelectedItem();<NEW_LINE>if (keyNamePair == null)<NEW_LINE>return;<NEW_LINE>accountViewerData.C_AcctSchema_ID = keyNamePair.getKey();<NEW_LINE>accountViewerData.ASchema = MAcctSchema.get(Env.getCtx(), accountViewerData.C_AcctSchema_ID);<NEW_LINE>log.info(accountViewerData.ASchema.toString());<NEW_LINE>//<NEW_LINE>// Sort Options<NEW_LINE>sortBy1.removeAllItems();<NEW_LINE>sortBy2.removeAllItems();<NEW_LINE>sortBy3.removeAllItems();<NEW_LINE>sortBy4.removeAllItems();<NEW_LINE>sortAddItem(new ValueNamePair("", ""));<NEW_LINE>sortAddItem(new ValueNamePair("DateAcct", Msg.translate(Env.getCtx(), "DateAcct")));<NEW_LINE>sortAddItem(new ValueNamePair("DateTrx", Msg.translate(Env.getCtx(), "DateTrx")));<NEW_LINE>sortAddItem(new ValueNamePair("C_Period_ID", Msg.translate(Env.getCtx(), "C_Period_ID")));<NEW_LINE>//<NEW_LINE>CLabel[] labels = new CLabel[] { lsel1, lsel2, lsel3, lsel4, lsel5, lsel6, lsel7, lsel8, lsel9, lsel10, lsel11, lsel12, lsel13 };<NEW_LINE>CButton[] buttons = new CButton[] { sel1, sel2, sel3, sel4, sel5, sel6, sel7, sel8, sel9, sel10, sel11, sel12, sel13 };<NEW_LINE>int selectionIndex = 0;<NEW_LINE>MAcctSchemaElement[] elements = accountViewerData.ASchema.getAcctSchemaElements();<NEW_LINE>for (int i = 0; i < elements.length && selectionIndex < labels.length; i++) {<NEW_LINE>MAcctSchemaElement acctSchemaElement = elements[i];<NEW_LINE>String columnName = acctSchemaElement.getColumnName();<NEW_LINE>String displayColumnName = acctSchemaElement.getDisplayColumnName();<NEW_LINE>if (columnName.equals("User1_ID") || columnName.equals("User2_ID") || columnName.equals("User3_ID") || columnName.equals("User4_ID"))<NEW_LINE>displayColumnName = acctSchemaElement.getName();<NEW_LINE>else<NEW_LINE>displayColumnName = acctSchemaElement.getDisplayColumnName();<NEW_LINE>// Add Sort Option<NEW_LINE>sortAddItem(new ValueNamePair(columnName, Msg.translate(Env.getCtx(), displayColumnName)));<NEW_LINE>// Additional Elements<NEW_LINE>if (!acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Organization) && !acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Account)) {<NEW_LINE>labels[selectionIndex].setText(Msg.translate(Env.getCtx(), displayColumnName));<NEW_LINE>labels[selectionIndex].setVisible(true);<NEW_LINE>buttons<MASK><NEW_LINE>buttons[selectionIndex].addActionListener(this);<NEW_LINE>buttons[selectionIndex].setIcon(findIcon);<NEW_LINE>buttons[selectionIndex].setText("");<NEW_LINE>buttons[selectionIndex].setVisible(true);<NEW_LINE>selectionIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// don't show remaining<NEW_LINE>while (selectionIndex < labels.length) {<NEW_LINE>labels[selectionIndex].setVisible(false);<NEW_LINE>buttons[selectionIndex++].setVisible(false);<NEW_LINE>}<NEW_LINE>}
[selectionIndex].setActionCommand(columnName);
105,830
private void generateFrameClassForFunction(PackageID packageID, BIRNode.BIRFunction func, Map<String, byte[]> pkgEntries, BType attachedType) {<NEW_LINE>String frameClassName = MethodGenUtils.getFrameClassName(JvmCodeGenUtil.getPackageName(packageID), func.name.value, attachedType);<NEW_LINE><MASK><NEW_LINE>if (func.pos != null && func.pos.lineRange().filePath() != null) {<NEW_LINE>cw.visitSource(func.pos.lineRange().filePath(), null);<NEW_LINE>}<NEW_LINE>cw.visit(V1_8, Opcodes.ACC_PUBLIC + ACC_SUPER, frameClassName, null, OBJECT, null);<NEW_LINE>JvmCodeGenUtil.generateDefaultConstructor(cw, OBJECT);<NEW_LINE>int k = 0;<NEW_LINE>List<BIRNode.BIRVariableDcl> localVars = func.localVars;<NEW_LINE>while (k < localVars.size()) {<NEW_LINE>BIRNode.BIRVariableDcl localVar = localVars.get(k);<NEW_LINE>if (localVar.onlyUsedInSingleBB) {<NEW_LINE>k = k + 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BType bType = localVar.type;<NEW_LINE>String fieldName = localVar.jvmVarName;<NEW_LINE>String typeSig = JvmCodeGenUtil.getFieldTypeSignature(bType);<NEW_LINE>cw.visitField(Opcodes.ACC_PUBLIC, fieldName, typeSig, null, null).visitEnd();<NEW_LINE>k = k + 1;<NEW_LINE>}<NEW_LINE>FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, "state", "I", null, null);<NEW_LINE>fv.visitEnd();<NEW_LINE>cw.visitEnd();<NEW_LINE>// panic if there are errors in the frame class. These cannot be logged, since<NEW_LINE>// frame classes are internal implementation details.<NEW_LINE>pkgEntries.put(frameClassName + ".class", cw.toByteArray());<NEW_LINE>}
ClassWriter cw = new BallerinaClassWriter(COMPUTE_FRAMES);
289,828
// -------------------------------------------------------------------------<NEW_LINE>// XXX: QueryPart API<NEW_LINE>// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public final void accept(Context<?> ctx) {<NEW_LINE>switch(ctx.family()) {<NEW_LINE>case CUBRID:<NEW_LINE>case FIREBIRD:<NEW_LINE>case SQLITE:<NEW_LINE>ctx.visit(inline(""));<NEW_LINE>break;<NEW_LINE>case DERBY:<NEW_LINE>ctx.visit(K_CURRENT).sql(' ').visit(K_SCHEMA);<NEW_LINE>break;<NEW_LINE>case H2:<NEW_LINE>ctx.visit(K_SCHEMA).sql("()");<NEW_LINE>break;<NEW_LINE>case MARIADB:<NEW_LINE>case MYSQL:<NEW_LINE>ctx.visit<MASK><NEW_LINE>break;<NEW_LINE>case HSQLDB:<NEW_LINE>case POSTGRES:<NEW_LINE>case YUGABYTEDB:<NEW_LINE>ctx.visit(K_CURRENT_SCHEMA);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>ctx.visit(K_CURRENT_SCHEMA).sql("()");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
(K_DATABASE).sql("()");
1,697,197
final GetMinuteUsageResult executeGetMinuteUsage(GetMinuteUsageRequest getMinuteUsageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMinuteUsageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetMinuteUsageRequest> request = null;<NEW_LINE>Response<GetMinuteUsageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMinuteUsageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMinuteUsageRequest));<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, "GroundStation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMinuteUsage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMinuteUsageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMinuteUsageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,319,578
public CodegenExpression codegen(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope, CodegenExpressionRef left, CodegenExpressionRef right, EPTypeClass ltype, EPTypeClass rtype) {<NEW_LINE>if (!divisionByZeroReturnsNull) {<NEW_LINE>return op(codegenAsDouble(left, ltype), "/", codegenAsDouble(right, rtype));<NEW_LINE>}<NEW_LINE>CodegenMethod method = codegenMethodScope.makeChild(EPTypePremade.DOUBLEBOXED.getEPType(), DivideDouble.class, codegenClassScope).addParam(ltype, "d1").addParam(rtype, "d2").getBlock().declareVar(EPTypePremade.DOUBLEPRIMITIVE.getEPType(), "d2Double", codegenAsDouble(ref("d2"), rtype)).ifCondition(equalsIdentity(ref("d2Double"), constant(0))).blockReturn(constantNull()).methodReturn(op(codegenAsDouble(ref("d1"), ltype), <MASK><NEW_LINE>return localMethodBuild(method).pass(left).pass(right).call();<NEW_LINE>}
"/", ref("d2Double")));
830,623
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteBlob_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // KEY<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.key = iprot.readString();<NEW_LINE>struct.set_key_isSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
490,880
private int assignReplicasForTier(final String tier, final int targetReplicantsInTier, final int currentReplicantsInTier, final DruidCoordinatorRuntimeParams params, final Predicate<ServerHolder> predicate, final DataSegment segment) {<NEW_LINE>final int numToAssign = targetReplicantsInTier - currentReplicantsInTier;<NEW_LINE>// if nothing to assign<NEW_LINE>if (numToAssign <= 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>String noAvailability = StringUtils.format("No available [%s] servers or node capacity to assign segment[%s]! Expected Replicants[%d]", tier, segment.getId(), targetReplicantsInTier);<NEW_LINE>final List<ServerHolder> holders = getFilteredHolders(tier, params.getDruidCluster(), predicate);<NEW_LINE>// if no holders available for assignment<NEW_LINE>if (holders.isEmpty()) {<NEW_LINE>log.warn(noAvailability);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final ReplicationThrottler throttler = params.getReplicationManager();<NEW_LINE>for (int numAssigned = 0; numAssigned < numToAssign; numAssigned++) {<NEW_LINE>if (!throttler.canCreateReplicant(tier)) {<NEW_LINE>log.info("Throttling replication for segment [%s] in tier [%s]", segment.getId(), tier);<NEW_LINE>return numAssigned;<NEW_LINE>}<NEW_LINE>// Retrieves from cache if available<NEW_LINE>ServerHolder holder = strategyCache.remove(tier);<NEW_LINE>// Does strategy call if not in cache<NEW_LINE>if (holder == null) {<NEW_LINE>holder = params.getBalancerStrategy().findNewSegmentHomeReplicator(segment, holders);<NEW_LINE>}<NEW_LINE>if (holder == null) {<NEW_LINE>log.warn(noAvailability);<NEW_LINE>return numAssigned;<NEW_LINE>}<NEW_LINE>holders.remove(holder);<NEW_LINE>final SegmentId segmentId = segment.getId();<NEW_LINE>final String holderHost = holder.getServer().getHost();<NEW_LINE>throttler.registerReplicantCreation(tier, segmentId, holderHost);<NEW_LINE>log.info("Assigning 'replica' for segment [%s] to server [%s] in tier [%s]", segment.getId(), holder.getServer().getName(), holder.<MASK><NEW_LINE>holder.getPeon().loadSegment(segment, () -> throttler.unregisterReplicantCreation(tier, segmentId));<NEW_LINE>}<NEW_LINE>return numToAssign;<NEW_LINE>}
getServer().getTier());
510,681
public static DataSourceProxyConfig parseConfig(String url, Properties info) throws SQLException {<NEW_LINE>String restUrl = url.substring(DEFAULT_PREFIX.length());<NEW_LINE>DataSourceProxyConfig config = new DataSourceProxyConfig();<NEW_LINE>if (restUrl.startsWith(DRIVER_PREFIX)) {<NEW_LINE>int pos = restUrl.indexOf(':', DRIVER_PREFIX.length());<NEW_LINE>String driverText = restUrl.substring(DRIVER_PREFIX.length(), pos);<NEW_LINE>if (driverText.length() > 0) {<NEW_LINE>config.<MASK><NEW_LINE>}<NEW_LINE>restUrl = restUrl.substring(pos + 1);<NEW_LINE>}<NEW_LINE>if (restUrl.startsWith(FILTERS_PREFIX)) {<NEW_LINE>int pos = restUrl.indexOf(':', FILTERS_PREFIX.length());<NEW_LINE>String filtersText = restUrl.substring(FILTERS_PREFIX.length(), pos);<NEW_LINE>for (String filterItem : filtersText.split(",")) {<NEW_LINE>FilterManager.loadFilter(config.getFilters(), filterItem);<NEW_LINE>}<NEW_LINE>restUrl = restUrl.substring(pos + 1);<NEW_LINE>}<NEW_LINE>if (restUrl.startsWith(NAME_PREFIX)) {<NEW_LINE>int pos = restUrl.indexOf(':', NAME_PREFIX.length());<NEW_LINE>String name = restUrl.substring(NAME_PREFIX.length(), pos);<NEW_LINE>config.setName(name);<NEW_LINE>restUrl = restUrl.substring(pos + 1);<NEW_LINE>}<NEW_LINE>if (restUrl.startsWith(JMX_PREFIX)) {<NEW_LINE>int pos = restUrl.indexOf(':', JMX_PREFIX.length());<NEW_LINE>String jmxOption = restUrl.substring(JMX_PREFIX.length(), pos);<NEW_LINE>config.setJmxOption(jmxOption);<NEW_LINE>restUrl = restUrl.substring(pos + 1);<NEW_LINE>}<NEW_LINE>String rawUrl = restUrl;<NEW_LINE>config.setRawUrl(rawUrl);<NEW_LINE>if (config.getRawDriverClassName() == null) {<NEW_LINE>String rawDriverClassname = JdbcUtils.getDriverClassName(rawUrl);<NEW_LINE>config.setRawDriverClassName(rawDriverClassname);<NEW_LINE>}<NEW_LINE>config.setUrl(url);<NEW_LINE>return config;<NEW_LINE>}
setRawDriverClassName(driverText.trim());
402,019
private static List<Entry> readEntries(String annotatorName, Set<String> noDefaultOverwriteLabels, List<Boolean> ignoreCaseList, List<String[]> headerList, Map<Entry, Integer> entryToMappingFileNumber, boolean verbose, String[] annotationFieldnames, String... mappings) {<NEW_LINE>// Unlike RegexNERClassifier, we don't bother sorting the entries.<NEW_LINE>// We leave it to TokensRegex NER to sort out the priorities and matches<NEW_LINE>// (typically after all the matches has been made since for some TokensRegex expressions,<NEW_LINE>// we don't know how many tokens are matched until after the matching is done).<NEW_LINE>List<Entry> entries = new ArrayList<>();<NEW_LINE>TrieMap<String, Entry> seenRegexes = new TrieMap<>();<NEW_LINE>// Arrays.sort(mappings);<NEW_LINE>for (int mappingFileIndex = 0; mappingFileIndex < mappings.length; mappingFileIndex++) {<NEW_LINE>String mapping = mappings[mappingFileIndex];<NEW_LINE>try (BufferedReader rd = IOUtils.readerFromString(mapping)) {<NEW_LINE>readEntries(annotatorName, headerList.get(mappingFileIndex), annotationFieldnames, entries, seenRegexes, mapping, rd, noDefaultOverwriteLabels, ignoreCaseList.get(mappingFileIndex<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeIOException("Couldn't read TokensRegexNER from " + mapping, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mappings.length != 1) {<NEW_LINE>logger.log(annotatorName + ": Read " + entries.size() + " unique entries from " + mappings.length + " files");<NEW_LINE>}<NEW_LINE>return entries;<NEW_LINE>}
), mappingFileIndex, entryToMappingFileNumber, verbose);
1,251,255
public void reset() {<NEW_LINE>if (!isEmpty_) {<NEW_LINE>isEmpty_ = true;<NEW_LINE>mem_.setBits(FLAGS_BYTE, (byte) (1 << Flags.IS_EMPTY.ordinal()));<NEW_LINE>}<NEW_LINE>final int lgResizeFactor = mem_.getByte(LG_RESIZE_FACTOR_BYTE);<NEW_LINE>final float samplingProbability = mem_.getFloat(SAMPLING_P_FLOAT);<NEW_LINE>final int startingCapacity = Util.<MASK><NEW_LINE>thetaLong_ = (long) (Long.MAX_VALUE * (double) samplingProbability);<NEW_LINE>mem_.putLong(THETA_LONG, thetaLong_);<NEW_LINE>mem_.putByte(LG_CUR_CAPACITY_BYTE, (byte) Integer.numberOfTrailingZeros(startingCapacity));<NEW_LINE>mem_.putInt(RETAINED_ENTRIES_INT, 0);<NEW_LINE>keysOffset_ = ENTRIES_START;<NEW_LINE>valuesOffset_ = keysOffset_ + (SIZE_OF_KEY_BYTES * startingCapacity);<NEW_LINE>// clear keys only<NEW_LINE>mem_.clear(keysOffset_, (long) SIZE_OF_KEY_BYTES * startingCapacity);<NEW_LINE>lgCurrentCapacity_ = Integer.numberOfTrailingZeros(startingCapacity);<NEW_LINE>setRebuildThreshold();<NEW_LINE>}
getStartingCapacity(getNominalEntries(), lgResizeFactor);
613,539
private int convertTypeName(StringBuilder strB, int pos, String signature) {<NEW_LINE>final char[] chars = signature.toCharArray();<NEW_LINE>int k = 0;<NEW_LINE>while (chars[pos] == '[') {<NEW_LINE>k++;<NEW_LINE>pos++;<NEW_LINE>}<NEW_LINE>int nextPos = pos + 1;<NEW_LINE>switch(chars[pos]) {<NEW_LINE>case 'B':<NEW_LINE>strB.append("byte");<NEW_LINE>break;<NEW_LINE>case 'C':<NEW_LINE>strB.append("char");<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>strB.append("double");<NEW_LINE>break;<NEW_LINE>case 'F':<NEW_LINE>strB.append("float");<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>strB.append("int");<NEW_LINE>break;<NEW_LINE>case 'J':<NEW_LINE>strB.append("long");<NEW_LINE>break;<NEW_LINE>case 'L':<NEW_LINE>nextPos = signature.indexOf(';', pos) + 1;<NEW_LINE>strB.append(formatClassName(signature.<MASK><NEW_LINE>break;<NEW_LINE>case 'S':<NEW_LINE>strB.append("short");<NEW_LINE>break;<NEW_LINE>case 'V':<NEW_LINE>strB.append("void");<NEW_LINE>break;<NEW_LINE>case 'Z':<NEW_LINE>strB.append("boolean");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>while (k > 0) {<NEW_LINE>strB.append("[]");<NEW_LINE>k--;<NEW_LINE>}<NEW_LINE>return nextPos;<NEW_LINE>}
substring(pos, nextPos)));
38,989
public FrameGrabber createFrameGrabber() throws FrameGrabber.Exception {<NEW_LINE>try {<NEW_LINE>settings.getFrameGrabber().getMethod("tryLoad").invoke(null);<NEW_LINE>FrameGrabber f;<NEW_LINE>if (settings.getDeviceFile() != null) {<NEW_LINE>f = settings.getFrameGrabber().getConstructor(File.class).newInstance(settings.getDeviceFile());<NEW_LINE>} else if (settings.getDevicePath() != null && settings.getDevicePath().length() > 0) {<NEW_LINE>f = settings.getFrameGrabber().getConstructor(String.class).newInstance(settings.getDevicePath());<NEW_LINE>} else {<NEW_LINE>int number = settings.getDeviceNumber() == null <MASK><NEW_LINE>try {<NEW_LINE>f = settings.getFrameGrabber().getConstructor(int.class).newInstance(number);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>f = settings.getFrameGrabber().getConstructor(Integer.class).newInstance(number);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>f.setFormat(settings.getFormat());<NEW_LINE>f.setImageWidth(settings.getImageWidth());<NEW_LINE>f.setImageHeight(settings.getImageHeight());<NEW_LINE>f.setFrameRate(settings.getFrameRate());<NEW_LINE>f.setTriggerMode(settings.isTriggerMode());<NEW_LINE>f.setBitsPerPixel(settings.getBitsPerPixel());<NEW_LINE>f.setImageMode(settings.getImageMode());<NEW_LINE>f.setTimeout(settings.getTimeout());<NEW_LINE>f.setNumBuffers(settings.getNumBuffers());<NEW_LINE>f.setGamma(settings.getResponseGamma());<NEW_LINE>f.setDeinterlace(settings.isDeinterlace());<NEW_LINE>return f;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (t instanceof InvocationTargetException) {<NEW_LINE>t = ((InvocationTargetException) t).getCause();<NEW_LINE>}<NEW_LINE>if (t instanceof FrameGrabber.Exception) {<NEW_LINE>throw (FrameGrabber.Exception) t;<NEW_LINE>} else {<NEW_LINE>throw new FrameGrabber.Exception("Failed to create " + settings.getFrameGrabber(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
? 0 : settings.getDeviceNumber();
911,412
private static ByteBuf encodeReasonCodePlusPropertiesMessage(ChannelHandlerContext ctx, MqttMessage message) {<NEW_LINE>if (message.variableHeader() instanceof MqttReasonCodeAndPropertiesVariableHeader) {<NEW_LINE>MqttVersion mqttVersion = getMqttVersion(ctx);<NEW_LINE>MqttFixedHeader mqttFixedHeader = message.fixedHeader();<NEW_LINE>MqttReasonCodeAndPropertiesVariableHeader variableHeader = (MqttReasonCodeAndPropertiesVariableHeader) message.variableHeader();<NEW_LINE>final ByteBuf propertiesBuf;<NEW_LINE>final boolean includeReasonCode;<NEW_LINE>final int variableHeaderBufferSize;<NEW_LINE>if (mqttVersion == MqttVersion.MQTT_5 && (variableHeader.reasonCode() != MqttReasonCodeAndPropertiesVariableHeader.REASON_CODE_OK || !variableHeader.properties().isEmpty())) {<NEW_LINE>propertiesBuf = encodeProperties(ctx.alloc(), variableHeader.properties());<NEW_LINE>includeReasonCode = true;<NEW_LINE>variableHeaderBufferSize = 1 + propertiesBuf.readableBytes();<NEW_LINE>} else {<NEW_LINE>propertiesBuf = Unpooled.EMPTY_BUFFER;<NEW_LINE>includeReasonCode = false;<NEW_LINE>variableHeaderBufferSize = 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final int fixedHeaderBufferSize = 1 + getVariableLengthInt(variableHeaderBufferSize);<NEW_LINE>ByteBuf buf = ctx.alloc().buffer(fixedHeaderBufferSize + variableHeaderBufferSize);<NEW_LINE>buf.writeByte(getFixedHeaderByte1(mqttFixedHeader));<NEW_LINE>writeVariableLengthInt(buf, variableHeaderBufferSize);<NEW_LINE>if (includeReasonCode) {<NEW_LINE>buf.<MASK><NEW_LINE>}<NEW_LINE>buf.writeBytes(propertiesBuf);<NEW_LINE>return buf;<NEW_LINE>} finally {<NEW_LINE>propertiesBuf.release();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return encodeMessageWithOnlySingleByteFixedHeader(ctx.alloc(), message);<NEW_LINE>}<NEW_LINE>}
writeByte(variableHeader.reasonCode());
1,117,325
private void processFunction(@NotNull final Project project, @NotNull final ErlangFunction function, @Nullable Editor editor) {<NEW_LINE>if (!(function.getContainingFile() instanceof ErlangFile))<NEW_LINE>return;<NEW_LINE>ErlangFile file = (ErlangFile) function.getContainingFile();<NEW_LINE>List<ErlangExport> exports = getExportPsiElements(file);<NEW_LINE>if (exports.isEmpty()) {<NEW_LINE>createNewExport(project, file, function);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (exports.size() == 1) {<NEW_LINE>updateExport(project, function, exports.get(0));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (editor == null || ApplicationManager.getApplication().isUnitTestMode()) {<NEW_LINE>ErlangExport first = ContainerUtil.getFirstItem(exports);<NEW_LINE>assert first != null;<NEW_LINE>updateExport(project, function, first);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<ErlangExport> notEmptyExports = getNotEmptyExports(exports);<NEW_LINE>if (notEmptyExports.size() == 1) {<NEW_LINE>updateExport(project, function, notEmptyExports.get(0));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JBList <MASK><NEW_LINE>new HintUpdateSupply(exportPopupList) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected PsiElement getPsiElementForHint(Object selectedValue) {<NEW_LINE>return (PsiElement) selectedValue;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JBPopupFactory.getInstance().createListPopupBuilder(exportPopupList).setTitle("Choose Export").setMovable(false).setResizable(false).addListener(new JBPopupListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClosed(@NotNull LightweightWindowEvent event) {<NEW_LINE>dropHighlighters();<NEW_LINE>}<NEW_LINE>}).setItemChoosenCallback(() -> CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> {<NEW_LINE>PsiDocumentManager.getInstance(project).commitAllDocuments();<NEW_LINE>updateExport(project, function, (ErlangExport) exportPopupList.getSelectedValue());<NEW_LINE>}), "Export function", null)).setRequestFocus(true).createPopup().showInBestPositionFor(editor);<NEW_LINE>}
exportPopupList = createExportJBList(editor, notEmptyExports);
149,904
public void start() throws Exception {<NEW_LINE>final ConnectionPool connectionPool = createPool();<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "active"), (Gauge<Integer>) connectionPool::getActive);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "idle"), (Gauge<Integer>) connectionPool::getIdle);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "waiting"), (Gauge<Integer>) connectionPool::getWaitCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "size"), (Gauge<MASK><NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "created"), (Gauge<Long>) connectionPool::getCreatedCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "borrowed"), (Gauge<Long>) connectionPool::getBorrowedCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "reconnected"), (Gauge<Long>) connectionPool::getReconnectedCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "released"), (Gauge<Long>) connectionPool::getReleasedCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "releasedIdle"), (Gauge<Long>) connectionPool::getReleasedIdleCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "returned"), (Gauge<Long>) connectionPool::getReturnedCount);<NEW_LINE>metricRegistry.register(name(getClass(), connectionPool.getName(), "removeAbandoned"), (Gauge<Long>) connectionPool::getRemoveAbandonedCount);<NEW_LINE>}
<Integer>) connectionPool::getSize);
192,047
private HBox createEntry(Environment environment) {<NEW_LINE>JFXButton renameButton = new JFXButton();<NEW_LINE>renameButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.PENCIL, "1.5em"));<NEW_LINE>renameButton.setOnAction<MASK><NEW_LINE>JFXButton editButton = new JFXButton();<NEW_LINE>editButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.LIST, "1.5em"));<NEW_LINE>editButton.setOnAction(e -> triggerEditEnvDialog(environment));<NEW_LINE>JFXToggleNode global = new JFXToggleNode(new FontAwesomeIconView(FontAwesomeIcon.GLOBE, "1.5em"));<NEW_LINE>global.setSelected(environment.isGlobal());<NEW_LINE>global.selectedProperty().addListener((obs, o, n) -> {<NEW_LINE>if (n != null) {<NEW_LINE>environment.setGlobal(n);<NEW_LINE>if (n)<NEW_LINE>environment.setActive(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JFXButton colorButton = new JFXButton();<NEW_LINE>FontAwesomeIconView icon = new FontAwesomeIconView(FontAwesomeIcon.PAINT_BRUSH, "1.5em");<NEW_LINE>primaryIconFill = icon.getFill();<NEW_LINE>colorButton.setGraphic(icon);<NEW_LINE>if (environment.getColor() != null) {<NEW_LINE>icon.setFill(Color.web(environment.getColor()));<NEW_LINE>}<NEW_LINE>colorButton.setOnAction(e -> triggerEditEnvColorDialog(environment, icon));<NEW_LINE>JFXButton deleteButton = new JFXButton();<NEW_LINE>deleteButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.TIMES, "1.5em"));<NEW_LINE>deleteButton.setOnAction(e -> {<NEW_LINE>onCommand.invoke(new DeleteEnvironment(environment));<NEW_LINE>refresh();<NEW_LINE>});<NEW_LINE>Label envName = new Label(environment.getName());<NEW_LINE>HBox.setHgrow(envName, Priority.ALWAYS);<NEW_LINE>return new HBox(envName, renameButton, editButton, global, colorButton, deleteButton);<NEW_LINE>}
(e -> triggerRenameDialog(environment));
70,615
private synchronized void markSupportedPids(int obdService, int start, long bitmask, PvList pvList) {<NEW_LINE>currSupportedPid = 0;<NEW_LINE>// Clear PID list on initial bitmask (offset 0)<NEW_LINE>if (start == 0) {<NEW_LINE>pidSupported.clear();<NEW_LINE>}<NEW_LINE>// loop through bits and mark corresponding PIDs as supported<NEW_LINE>for (int i = 0; i < 0x1F; i++) {<NEW_LINE>if ((bitmask & (0x80000000L >> i)) != 0) {<NEW_LINE>pidSupported.add(i + start + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.fine(Long.toHexString(bitmask).toUpperCase() + "(" + Long.toHexString(start) + "):" + pidSupported);<NEW_LINE>// if next block may be requested<NEW_LINE>if ((bitmask & 1) != 0) {<NEW_LINE>// request next block<NEW_LINE>cmdQueue.add(String.format("%02X%02X"<MASK><NEW_LINE>} else {<NEW_LINE>// setup PID PVs<NEW_LINE>preparePidPvs(obdService, pvList);<NEW_LINE>}<NEW_LINE>}
, obdService, start + 0x20));
289,296
public static void printRow(List<List<String>> lists, int i, List<Integer> maxSizeList) {<NEW_LINE>printf("|");<NEW_LINE>int count;<NEW_LINE>int maxSize;<NEW_LINE>String element;<NEW_LINE>StringBuilder paddingStr;<NEW_LINE>for (int j = 0; j < maxSizeList.size(); j++) {<NEW_LINE><MASK><NEW_LINE>element = lists.get(j).get(i);<NEW_LINE>count = computeHANCount(element);<NEW_LINE>if (count > 0) {<NEW_LINE>int remain = maxSize - (element.length() + count);<NEW_LINE>if (remain > 0) {<NEW_LINE>paddingStr = padding(remain);<NEW_LINE>maxSize = maxSize - count;<NEW_LINE>element = paddingStr.append(element).toString();<NEW_LINE>} else if (remain == 0) {<NEW_LINE>maxSize = maxSize - count;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>printf("%" + maxSize + "s|", element);<NEW_LINE>}<NEW_LINE>println();<NEW_LINE>}
maxSize = maxSizeList.get(j);
276,258
public void onInit() {<NEW_LINE>if (this.initialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.onInit();<NEW_LINE>if (this.maxSubscribers == null) {<NEW_LINE>setMaxSubscribers(getIntegrationProperty(IntegrationProperties.CHANNELS_MAX_BROADCAST_SUBSCRIBERS, Integer.class));<NEW_LINE>}<NEW_LINE>if (this.messageConverter == null) {<NEW_LINE>this.messageConverter = new SimpleMessageConverter();<NEW_LINE>}<NEW_LINE>BeanFactory beanFactory = getBeanFactory();<NEW_LINE>if (this.messageConverter instanceof BeanFactoryAware) {<NEW_LINE>((BeanFactoryAware) this.messageConverter).setBeanFactory(beanFactory);<NEW_LINE>}<NEW_LINE>this.container.setConnectionFactory(this.connectionFactory);<NEW_LINE>if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) {<NEW_LINE>ErrorHandler errorHandler = ChannelUtils.getErrorHandler(beanFactory);<NEW_LINE>this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, errorHandler);<NEW_LINE>}<NEW_LINE>this.container.setTaskExecutor(this.taskExecutor);<NEW_LINE>MessageListenerAdapter adapter = new MessageListenerAdapter(new MessageListenerDelegate());<NEW_LINE>adapter.setSerializer(this.serializer);<NEW_LINE>adapter.afterPropertiesSet();<NEW_LINE>this.container.addMessageListener(adapter, <MASK><NEW_LINE>this.container.afterPropertiesSet();<NEW_LINE>this.dispatcher.setBeanFactory(beanFactory);<NEW_LINE>this.initialized = true;<NEW_LINE>}
new ChannelTopic(this.topicName));
1,190,152
private static NotificationCompat.Builder createNotification(Context context, Intent intent) {<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, /* Request code */<NEW_LINE>intent, PendingIntent.FLAG_ONE_SHOT);<NEW_LINE>String channelId = context.<MASK><NEW_LINE>Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);<NEW_LINE>NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, channelId).setSmallIcon(R.drawable.ic_status_bar).setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_notification)).setAutoCancel(true).setDefaults(NotificationCompat.DEFAULT_SOUND | NotificationCompat.DEFAULT_VIBRATE).setSound(defaultSoundUri).setContentIntent(pendingIntent);<NEW_LINE>// Since android Oreo notification channel is needed.<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>createNotificationChannel(context);<NEW_LINE>}<NEW_LINE>return notificationBuilder;<NEW_LINE>}
getString(R.string.default_notification_channel_id);
627,976
public List<OptExpression> transform(OptExpression input, OptimizerContext context) {<NEW_LINE>LogicalEsScanOperator operator = (LogicalEsScanOperator) input.getOp();<NEW_LINE>EsTablePartitions esTablePartitions = operator.getEsTablePartitions();<NEW_LINE>Collection<Long> partitionIds = null;<NEW_LINE>try {<NEW_LINE>partitionIds = partitionPrune(esTablePartitions.getPartitionInfo(), operator.getColumnFilters());<NEW_LINE>} catch (AnalysisException e) {<NEW_LINE>LOG.warn("Es Table partition prune failed. " + e);<NEW_LINE>}<NEW_LINE>ArrayList<String> unPartitionedIndices = Lists.newArrayList();<NEW_LINE>ArrayList<String> partitionedIndices = Lists.newArrayList();<NEW_LINE>for (EsShardPartitions esShardPartitions : esTablePartitions.getUnPartitionedIndexStates().values()) {<NEW_LINE>operator.getSelectedIndex().add(esShardPartitions);<NEW_LINE>unPartitionedIndices.<MASK><NEW_LINE>}<NEW_LINE>if (partitionIds != null) {<NEW_LINE>for (Long partitionId : partitionIds) {<NEW_LINE>EsShardPartitions indexState = esTablePartitions.getEsShardPartitions(partitionId);<NEW_LINE>operator.getSelectedIndex().add(indexState);<NEW_LINE>partitionedIndices.add(indexState.getIndexName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("partition prune finished, unpartitioned index [{}], " + "partitioned index [{}]", String.join(",", unPartitionedIndices), String.join(",", partitionedIndices));<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
add(esShardPartitions.getIndexName());
509,186
CssTokens build() {<NEW_LINE>// Close any still open brackets.<NEW_LINE>{<NEW_LINE>int startOfCloseBrackets = sb.length();<NEW_LINE>closeBrackets(0);<NEW_LINE>emitMergedTokens(startOfCloseBrackets, sb.length());<NEW_LINE>}<NEW_LINE>if (tokenTypes == null) {<NEW_LINE>return EMPTY;<NEW_LINE>}<NEW_LINE>int[] bracketsTrunc = truncateOrShare(brackets, bracketsLimit);<NEW_LINE>// Strip any trailing space off, since it may have been inserted by a<NEW_LINE>// breakAfter call anyway.<NEW_LINE>int cssEnd = sb.length();<NEW_LINE>if (cssEnd > 0 && sb.charAt(cssEnd - 1) == ' ') {<NEW_LINE>--cssEnd;<NEW_LINE>tokenTypes.remove(--tokenBreaksLimit);<NEW_LINE>}<NEW_LINE>String normalizedCss = <MASK><NEW_LINE>// Store the last character on the tokenBreaksList to simplify finding the<NEW_LINE>// end of a token.<NEW_LINE>tokenBreaks = expandIfNecessary(tokenBreaks, tokenBreaksLimit, 1);<NEW_LINE>tokenBreaks[tokenBreaksLimit++] = normalizedCss.length();<NEW_LINE>int[] tokenBreaksTrunc = truncateOrShare(tokenBreaks, tokenBreaksLimit);<NEW_LINE>TokenType[] tokenTypesArr = tokenTypes.toArray(ZERO_TYPES);<NEW_LINE>return new CssTokens(normalizedCss, new Brackets(bracketsTrunc), tokenBreaksTrunc, tokenTypesArr);<NEW_LINE>}
sb.substring(0, cssEnd);
1,472,171
private void updateBottomBar() {<NEW_LINE>int position = mPager.getCurrentItem();<NEW_LINE>final Resources res = getResources();<NEW_LINE>if (position == mCurrentPageSequence.size()) {<NEW_LINE>mNextButton.setText(R.string.btn_wizard_finish);<NEW_LINE>mNextButton.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.theme_accent)));<NEW_LINE>mNextButton.setTextColor(ContextCompat.getColor(this, android.R.color.white));<NEW_LINE>} else {<NEW_LINE>mNextButton.setText(mEditingAfterReview ? R.string.review : R.string.btn_wizard_next);<NEW_LINE>mNextButton.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, android.R.color.transparent)));<NEW_LINE>mNextButton.setTextColor(ContextCompat.getColor(this, R.color.theme_accent));<NEW_LINE>mNextButton.setEnabled(<MASK><NEW_LINE>}<NEW_LINE>mPrevButton.setVisibility(position <= 0 ? View.INVISIBLE : View.VISIBLE);<NEW_LINE>}
position != mPagerAdapter.getCutOffPage());
141,861
public static List<StoreDefinition> dropZone(List<StoreDefinition> currentStoreDefs, int dropZoneId) {<NEW_LINE>List<StoreDefinition> adjustedStoreDefList = new ArrayList<StoreDefinition>();<NEW_LINE>for (StoreDefinition storeDef : currentStoreDefs) {<NEW_LINE>HashMap<Integer, Integer> zoneRepFactorMap = storeDef.getZoneReplicationFactor();<NEW_LINE>if (!zoneRepFactorMap.containsKey(dropZoneId)) {<NEW_LINE>throw new VoldemortException("Store " + storeDef.getName() + " does not have replication factor for zone " + dropZoneId);<NEW_LINE>}<NEW_LINE>StoreDefinitionBuilder <MASK><NEW_LINE>if (!storeDef.hasPreferredReads()) {<NEW_LINE>adjustedStoreDefBuilder.setPreferredReads(null);<NEW_LINE>}<NEW_LINE>if (!storeDef.hasPreferredWrites()) {<NEW_LINE>adjustedStoreDefBuilder.setPreferredWrites(null);<NEW_LINE>}<NEW_LINE>// Copy all zone replication factor entries except for dropped zone<NEW_LINE>HashMap<Integer, Integer> adjustedZoneRepFactorMap = new HashMap<Integer, Integer>();<NEW_LINE>for (Integer zoneId : zoneRepFactorMap.keySet()) {<NEW_LINE>if (zoneId != dropZoneId) {<NEW_LINE>adjustedZoneRepFactorMap.put(zoneId, zoneRepFactorMap.get(zoneId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>adjustedStoreDefBuilder.setZoneReplicationFactor(adjustedZoneRepFactorMap);<NEW_LINE>// adjust the replication factor<NEW_LINE>int zoneRepFactor = zoneRepFactorMap.get(dropZoneId);<NEW_LINE>adjustedStoreDefBuilder.setReplicationFactor(adjustedStoreDefBuilder.getReplicationFactor() - zoneRepFactor);<NEW_LINE>adjustedStoreDefList.add(adjustedStoreDefBuilder.build());<NEW_LINE>}<NEW_LINE>return adjustedStoreDefList;<NEW_LINE>}
adjustedStoreDefBuilder = StoreDefinitionUtils.getBuilderForStoreDef(storeDef);
886,444
public ExecutionTimeValue<? extends C> calculateExecutionTimeValue() {<NEW_LINE>List<ExecutionTimeValue<? extends Iterable<? extends T>>> values = new ArrayList<>();<NEW_LINE>value.calculateExecutionTimeValue(values::add);<NEW_LINE>boolean fixed = true;<NEW_LINE>boolean changingContent = false;<NEW_LINE>for (ExecutionTimeValue<? extends Iterable<? extends T>> value : values) {<NEW_LINE>if (value.isMissing()) {<NEW_LINE>return ExecutionTimeValue.missing();<NEW_LINE>}<NEW_LINE>if (value.isChangingValue()) {<NEW_LINE>fixed = false;<NEW_LINE>}<NEW_LINE>changingContent |= value.hasChangingContent();<NEW_LINE>}<NEW_LINE>if (fixed) {<NEW_LINE>ImmutableCollection.Builder<T> builder = collectionFactory.get();<NEW_LINE>for (ExecutionTimeValue<? extends Iterable<? extends T>> value : values) {<NEW_LINE>builder.addAll(value.getFixedValue());<NEW_LINE>}<NEW_LINE>ExecutionTimeValue<C> mergedValue = ExecutionTimeValue.fixedValue(Cast.uncheckedNonnullCast(builder.build()));<NEW_LINE>if (changingContent) {<NEW_LINE>return mergedValue.withChangingContent();<NEW_LINE>} else {<NEW_LINE>return mergedValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At least one of the values is a changing value<NEW_LINE>List<ProviderInternal<? extends Iterable<? extends T>>> providers = new ArrayList<<MASK><NEW_LINE>for (ExecutionTimeValue<? extends Iterable<? extends T>> value : values) {<NEW_LINE>providers.add(value.toProvider());<NEW_LINE>}<NEW_LINE>// TODO - CollectionSupplier could be replaced with ProviderInternal, so this type and the collection provider can be merged<NEW_LINE>return ExecutionTimeValue.changingValue(new CollectingProvider<>(AbstractCollectionProperty.this.getType(), providers, collectionFactory));<NEW_LINE>}
>(values.size());
180,714
public void createStreamMarker(String userId, String description, String token, StreamMarkerResult listener) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>data.put("user_id", userId);<NEW_LINE>if (description != null && !description.isEmpty()) {<NEW_LINE>data.put("description", description);<NEW_LINE>}<NEW_LINE>newApi.add("https://api.twitch.tv/helix/streams/markers", "POST", data, token, (result, responseCode) -> {<NEW_LINE>if (responseCode == 200) {<NEW_LINE>listener.streamMarkerResult(null);<NEW_LINE>} else if (responseCode == 401) {<NEW_LINE>listener.streamMarkerResult("Required access not available (please check <Main - Login..> for 'Edit broadcast')");<NEW_LINE>} else if (responseCode == 404) {<NEW_LINE>listener.streamMarkerResult("No stream");<NEW_LINE>} else if (responseCode == 403) {<NEW_LINE>listener.streamMarkerResult("Access denied");<NEW_LINE>} else {<NEW_LINE>listener.streamMarkerResult("Unknown error (" + responseCode + ")");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
data = new HashMap<>();
944,622
public Collection<EventObject> findLastMessagesBefore(MetaContact contact, Date date, int count) throws RuntimeException {<NEW_LINE>LinkedList<EventObject> result = new LinkedList<EventObject>();<NEW_LINE>Iterator<Contact> iter = contact.getContacts();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Contact item = iter.next();<NEW_LINE>try {<NEW_LINE>History history = this.getHistory(null, item);<NEW_LINE>HistoryReader reader = history.getReader();<NEW_LINE>Iterator<HistoryRecord> recs = reader.findLastRecordsBefore(date, count);<NEW_LINE>while (recs.hasNext()) {<NEW_LINE>result.add(convertHistoryRecordToMessageEvent(recs.next(), item));<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(result, new MessageEventComparator<EventObject>());<NEW_LINE>int startIndex = result.size() - count;<NEW_LINE>if (startIndex < 0)<NEW_LINE>startIndex = 0;<NEW_LINE>return result.subList(startIndex, result.size());<NEW_LINE>}
logger.error("Could not read history", e);
1,025,392
public boolean updateContext(final Properties ctx) {<NEW_LINE>final int sessionId = getAD_Session_ID();<NEW_LINE>if (sessionId <= 0) {<NEW_LINE>log.warn("Cannot update context because session is not saved yet");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!sessionPO.isActive()) {<NEW_LINE>log.debug("Cannot update context because session is not active");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (isDestroyed()) {<NEW_LINE>log.debug("Cannot update context because session is destroyed");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If not force, update the context only if the context #AD_Session_ID is same as our session ID.<NEW_LINE>// Even if there is no value in context, the session won't be updated.<NEW_LINE>// Keep this logic because we are calling this method on afterSave too.<NEW_LINE>final int ctxSessionId = Env.<MASK><NEW_LINE>if (ctxSessionId > 0 && ctxSessionId != sessionId) {<NEW_LINE>log.debug("Different AD_Session_ID found in context and force=false.");<NEW_LINE>}<NEW_LINE>Env.setContext(ctx, Env.CTXNAME_AD_Session_ID, sessionId);<NEW_LINE>final PO po = InterfaceWrapperHelper.getStrictPO(sessionPO);<NEW_LINE>final int cols = po.get_ColumnCount();<NEW_LINE>for (int i = 0; i < cols; i++) {<NEW_LINE>if (!isContextAttribute(i)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String columnName = po.get_ColumnName(i);<NEW_LINE>final String value = po.get_ValueAsString(columnName);<NEW_LINE>Env.setContext(ctx, CTX_Prefix + columnName, value);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getContextAsInt(ctx, Env.CTXNAME_AD_Session_ID);
1,560,022
/* View action functions */<NEW_LINE>public void onButtonClick(View view) {<NEW_LINE>assert view.getClass().isInstance(Button.class);<NEW_LINE>Button button = (Button) view;<NEW_LINE>switch(button.getId()) {<NEW_LINE>case R.id.buttonCancel:<NEW_LINE>finish();<NEW_LINE>break;<NEW_LINE>case R.id.buttonSave:<NEW_LINE>DatePicker datePicker = (DatePicker) this.<MASK><NEW_LINE>TimePicker timePicker = (TimePicker) this.findViewById(R.id.timePicker);<NEW_LINE>Settings.pickedDate.setYear(datePicker.getYear() - 1900);<NEW_LINE>Settings.pickedDate.setMonth(datePicker.getMonth());<NEW_LINE>Settings.pickedDate.setDate(datePicker.getDayOfMonth());<NEW_LINE>Settings.pickedDate.setHours(timePicker.getCurrentHour());<NEW_LINE>Settings.pickedDate.setMinutes(timePicker.getCurrentMinute());<NEW_LINE>Settings.pickedDate.setSeconds(0);<NEW_LINE>finish();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
findViewById(R.id.datePicker);
273,881
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "rbin");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,468,254
public void actionPerformed(ActionContext context) {<NEW_LINE>GTree gTree = (GTree) context.getContextObject();<NEW_LINE>TreePath[] selectionPaths = gTree.getSelectionPaths();<NEW_LINE>TreePath treePath = selectionPaths[0];<NEW_LINE>final DataTypeNode dataTypeNode = (DataTypeNode) treePath.getLastPathComponent();<NEW_LINE>DataType dataType = dataTypeNode.getDataType();<NEW_LINE><MASK><NEW_LINE>if (dataTypeManager == null) {<NEW_LINE>Msg.error(this, "Can't pack data type " + dataType.getName() + " without a data type manager.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NumberInputDialog numberInputDialog = new NumberInputDialog("explicit pack value", 0, 0, 16);<NEW_LINE>if (!numberInputDialog.show()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int packSize = numberInputDialog.getValue();<NEW_LINE>int transactionID = -1;<NEW_LINE>boolean commit = false;<NEW_LINE>try {<NEW_LINE>// start a transaction<NEW_LINE>transactionID = dataTypeManager.startTransaction("pack(" + packSize + ") of " + dataType.getName());<NEW_LINE>packDataType(dataType, packSize);<NEW_LINE>commit = true;<NEW_LINE>} catch (IllegalArgumentException iie) {<NEW_LINE>Msg.showError(this, null, "Invalid Pack Value", iie.getMessage());<NEW_LINE>} finally {<NEW_LINE>// commit the changes<NEW_LINE>dataTypeManager.endTransaction(transactionID, commit);<NEW_LINE>}<NEW_LINE>}
DataTypeManager dataTypeManager = dataType.getDataTypeManager();
1,036,253
public void init() {<NEW_LINE>model = new DefaultDiagramModel();<NEW_LINE>model.setMaxConnections(-1);<NEW_LINE>FlowChartConnector connector = new FlowChartConnector();<NEW_LINE>connector.setPaintStyle("{stroke:'#C7B097',strokeWidth:3}");<NEW_LINE>model.setDefaultConnector(connector);<NEW_LINE>Element start = new Element("Fight for your dream", "20em", "6em");<NEW_LINE>start.addEndPoint(new BlankEndPoint(EndPointAnchor.BOTTOM));<NEW_LINE>start.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>Element trouble = new Element("Do you meet some trouble?", "20em", "18em");<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.TOP));<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.BOTTOM));<NEW_LINE>trouble.addEndPoint(new BlankEndPoint(EndPointAnchor.RIGHT));<NEW_LINE>Element giveup = new Element("Do you give up?", "20em", "30em");<NEW_LINE>giveup.addEndPoint(new BlankEndPoint(EndPointAnchor.TOP));<NEW_LINE>giveup.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>giveup.addEndPoint(new BlankEndPoint(EndPointAnchor.RIGHT));<NEW_LINE>Element succeed = new Element("Succeed", "50em", "18em");<NEW_LINE>succeed.addEndPoint(<MASK><NEW_LINE>succeed.setStyleClass("ui-diagram-success");<NEW_LINE>Element fail = new Element("Fail", "50em", "30em");<NEW_LINE>fail.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));<NEW_LINE>fail.setStyleClass("ui-diagram-fail");<NEW_LINE>model.addElement(start);<NEW_LINE>model.addElement(trouble);<NEW_LINE>model.addElement(giveup);<NEW_LINE>model.addElement(succeed);<NEW_LINE>model.addElement(fail);<NEW_LINE>model.connect(createConnection(start.getEndPoints().get(0), trouble.getEndPoints().get(0), null));<NEW_LINE>model.connect(createConnection(trouble.getEndPoints().get(1), giveup.getEndPoints().get(0), "Yes"));<NEW_LINE>model.connect(createConnection(giveup.getEndPoints().get(1), start.getEndPoints().get(1), "No"));<NEW_LINE>model.connect(createConnection(trouble.getEndPoints().get(2), succeed.getEndPoints().get(0), "No"));<NEW_LINE>model.connect(createConnection(giveup.getEndPoints().get(2), fail.getEndPoints().get(0), "Yes"));<NEW_LINE>}
new BlankEndPoint(EndPointAnchor.LEFT));
170,240
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListTagsForResourceResultJsonUnmarshaller());
1,588,432
public final ExpressionListContext expressionList() throws RecognitionException {<NEW_LINE>ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 432, RULE_expressionList);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(2911);<NEW_LINE>expression();<NEW_LINE>setState(2916);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == COMMA) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(2912);<NEW_LINE>match(COMMA);<NEW_LINE>setState(2913);<NEW_LINE>expression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2918);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
750,061
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View v = inflater.inflate(R.layout.available_gpx, container, false);<NEW_LINE>listView = v.findViewById(android.R.id.list);<NEW_LINE>setHasOptionsMenu(true);<NEW_LINE>if (OsmandPlugin.isActive(OsmandMonitoringPlugin.class)) {<NEW_LINE>currentGpxView = inflater.inflate(R.layout.current_gpx_item, null, false);<NEW_LINE>createCurrentTrackView();<NEW_LINE>currentGpxView.findViewById(R.id.current_track_info).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>openTrack(activity, null, storeState(), getString(R.string.shared_string_tracks));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listView.addHeaderView(currentGpxView);<NEW_LINE>}<NEW_LINE>footerView = inflater.inflate(R.<MASK><NEW_LINE>listView.addFooterView(footerView);<NEW_LINE>emptyView = v.findViewById(android.R.id.empty);<NEW_LINE>ImageView emptyImageView = emptyView.findViewById(R.id.empty_state_image_view);<NEW_LINE>emptyImageView.setImageResource(nightMode ? R.drawable.ic_empty_state_trip_night : R.drawable.ic_empty_state_trip_day);<NEW_LINE>Button importButton = emptyView.findViewById(R.id.import_button);<NEW_LINE>importButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>addTrack();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (this.adapter != null) {<NEW_LINE>listView.setAdapter(this.adapter);<NEW_LINE>}<NEW_LINE>listView.setOnScrollListener(new AbsListView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrollStateChanged(AbsListView absListView, int i) {<NEW_LINE>View currentFocus = getActivity().getCurrentFocus();<NEW_LINE>if (currentFocus != null) {<NEW_LINE>InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);<NEW_LINE>imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScroll(AbsListView absListView, int i, int i1, int i2) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return v;<NEW_LINE>}
layout.list_shadow_footer, null, false);
539,499
public void SetData(Buffer data) {<NEW_LINE>if (data instanceof ByteBuffer) {<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.allocateDirect(data.capacity());<NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.put((ByteBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else if (data instanceof FloatBuffer) {<NEW_LINE>if (GetType() != Type.FLOAT32) {<NEW_LINE>throw new IllegalArgumentException("Can't set a float buffer to the non-float blob.");<NEW_LINE>}<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.allocateDirect(data.capacity() * (Float<MASK><NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.asFloatBuffer().put((FloatBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else if (data instanceof IntBuffer) {<NEW_LINE>if (GetType() != Type.INT32) {<NEW_LINE>throw new IllegalArgumentException("Can't set an int buffer to the non-int blob.");<NEW_LINE>}<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.allocateDirect(data.capacity() * (Integer.SIZE / Byte.SIZE));<NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.asIntBuffer().put((IntBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected buffer type: " + data);<NEW_LINE>}<NEW_LINE>setData(nativeHandle, data);<NEW_LINE>}
.SIZE / Byte.SIZE));
967,619
public void serialize(ColumnDef def, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {<NEW_LINE>jgen.writeStartObject();<NEW_LINE>jgen.writeStringField("type", def.getType());<NEW_LINE>jgen.writeStringField(<MASK><NEW_LINE>if (def instanceof StringColumnDef) {<NEW_LINE>jgen.writeStringField("charset", ((StringColumnDef) def).getCharset());<NEW_LINE>} else if (def instanceof IntColumnDef) {<NEW_LINE>jgen.writeBooleanField("signed", ((IntColumnDef) def).isSigned());<NEW_LINE>} else if (def instanceof BigIntColumnDef) {<NEW_LINE>jgen.writeBooleanField("signed", ((BigIntColumnDef) def).isSigned());<NEW_LINE>} else if (def instanceof EnumeratedColumnDef) {<NEW_LINE>jgen.writeArrayFieldStart("enum-values");<NEW_LINE>for (String s : ((EnumeratedColumnDef) def).getEnumValues()) jgen.writeString(s);<NEW_LINE>jgen.writeEndArray();<NEW_LINE>} else if (def instanceof ColumnDefWithLength) {<NEW_LINE>// columnLength is a long but technically, it' not that long. It it were, we could<NEW_LINE>// need to use a string to represent it, instead of an integer, to avoid issues<NEW_LINE>// with Javascript when parsing long integers.<NEW_LINE>Long columnLength = ((ColumnDefWithLength) def).getColumnLength();<NEW_LINE>if (columnLength != null)<NEW_LINE>jgen.writeNumberField("column-length", columnLength);<NEW_LINE>}<NEW_LINE>jgen.writeEndObject();<NEW_LINE>}
"name", def.getName());
929,806
private void notifyLayout(DomNode domStyle) {<NEW_LINE>if (mContext.getModuleManager().getJavaScriptModule(EventDispatcher.class) != null) {<NEW_LINE>if (!Float.isNaN(domStyle.getLayoutX()) && !Float.isNaN(domStyle.getLayoutY()) && !Float.isNaN(domStyle.getLayoutWidth()) && !Float.isNaN(domStyle.getLayoutHeight())) {<NEW_LINE>HippyMap onLayoutMap = new HippyMap();<NEW_LINE>onLayoutMap.pushObject("x", (int) PixelUtil.px2dp(domStyle.getLayoutX()));<NEW_LINE>onLayoutMap.pushObject("y", (int) PixelUtil.px2dp(domStyle.getLayoutY()));<NEW_LINE>onLayoutMap.pushObject("width", (int) PixelUtil.px2dp(domStyle.getLayoutWidth()));<NEW_LINE>onLayoutMap.pushObject("height", (int) PixelUtil.px2dp(domStyle.getLayoutHeight()));<NEW_LINE>HippyMap event = new HippyMap();<NEW_LINE><MASK><NEW_LINE>event.pushInt("target", domStyle.getId());<NEW_LINE>mContext.getModuleManager().getJavaScriptModule(EventDispatcher.class).receiveUIComponentEvent(domStyle.getId(), "onLayout", event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
event.pushMap("layout", onLayoutMap);
1,368,123
public Operand buildDXStr(Variable result, DXStrNode node) {<NEW_LINE>Node[] nodePieces = node.children();<NEW_LINE>Operand[] pieces = new Operand[nodePieces.length];<NEW_LINE>int estimatedSize = 0;<NEW_LINE>for (int i = 0; i < pieces.length; i++) {<NEW_LINE>estimatedSize += dynamicPiece(pieces, i, nodePieces[i]);<NEW_LINE>}<NEW_LINE>Variable stringResult = createTemporaryVariable();<NEW_LINE>if (result == null)<NEW_LINE>result = createTemporaryVariable();<NEW_LINE>boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral();<NEW_LINE>addInstr(new BuildCompoundStringInstr(stringResult, pieces, node.getEncoding(), estimatedSize, false, debuggingFrozenStringLiteral, getFileName(), node.getLine()));<NEW_LINE>return addResultInstr(CallInstr.create(scope, FUNCTIONAL, result, manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[<MASK><NEW_LINE>}
] { stringResult }, null));
379,677
public void loadTable(ResultSet rs) {<NEW_LINE>if (m_layout == null)<NEW_LINE>throw new UnsupportedOperationException("Layout not defined");<NEW_LINE>// Clear Table<NEW_LINE>setRowCount(0);<NEW_LINE>//<NEW_LINE>try {<NEW_LINE>while (rs.next()) {<NEW_LINE>int row = getRowCount();<NEW_LINE>setRowCount(row + 1);<NEW_LINE>// columns start with 1<NEW_LINE>int colOffset = 1;<NEW_LINE>for (int col = 0; col < m_layout.length; col++) {<NEW_LINE>Object data = null;<NEW_LINE>Class<?> c = m_layout[col].getColClass();<NEW_LINE>int colIndex = col + colOffset;<NEW_LINE>if (c == IDColumn.class)<NEW_LINE>data = new IDColumn(rs.getInt(colIndex));<NEW_LINE>else if (c == Boolean.class)<NEW_LINE>data = new Boolean("Y".equals(rs.getString(colIndex)));<NEW_LINE>else if (c == Timestamp.class)<NEW_LINE>data = rs.getTimestamp(colIndex);<NEW_LINE>else if (c == BigDecimal.class)<NEW_LINE>data = rs.getBigDecimal(colIndex);<NEW_LINE>else if (c == Double.class)<NEW_LINE><MASK><NEW_LINE>else if (c == Integer.class)<NEW_LINE>data = rs.getInt(colIndex);<NEW_LINE>else if (c == KeyNamePair.class) {<NEW_LINE>String display = rs.getString(colIndex);<NEW_LINE>int key = rs.getInt(colIndex + 1);<NEW_LINE>data = new KeyNamePair(key, display);<NEW_LINE>colOffset++;<NEW_LINE>} else {<NEW_LINE>String s = rs.getString(colIndex);<NEW_LINE>if (s != null)<NEW_LINE>// problems with NCHAR<NEW_LINE>data = s.trim();<NEW_LINE>}<NEW_LINE>// store<NEW_LINE>setValueAt(data, row, col);<NEW_LINE>// log.fine( "r=" + row + ", c=" + col + " " + m_layout[col].getColHeader(),<NEW_LINE>// "data=" + data.toString() + " " + data.getClass().getName() + " * " + m_table.getCellRenderer(row, col));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, "", e);<NEW_LINE>}<NEW_LINE>if (getShowTotals())<NEW_LINE>addTotals(m_layout);<NEW_LINE>autoSize();<NEW_LINE>log.config("Row(rs)=" + getRowCount());<NEW_LINE>}
data = rs.getDouble(colIndex);
1,228,902
public Optional<ImmutableSet<PreemptionVictim>> filterPreemptionVictims(ITaskConfig pendingTask, Iterable<PreemptionVictim> possibleVictims, AttributeAggregate jobState, Optional<HostOffer> offer, StoreProvider storeProvider) {<NEW_LINE>List<PreemptionVictim> sortedVictims = StreamSupport.stream(possibleVictims.spliterator(), false).filter(preemptionFilter(pendingTask)).sorted(resourceOrder).collect(ImmutableList.toImmutableList());<NEW_LINE>if (sortedVictims.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// This enforces the precondition that all of the resources are from the same host. We need to<NEW_LINE>// get the host for the schedulingFilter.<NEW_LINE>Set<String> hosts = ImmutableSet.<String>builder().addAll(Iterables.transform(possibleVictims, VICTIM_TO_HOST)).addAll(offer.map(OFFER_TO_HOST).map(ImmutableSet::of).orElse(ImmutableSet.of())).build();<NEW_LINE>ResourceBag slackResources = offer.map(o -> bagFromMesosResources(getNonRevocableOfferResources(o.getOffer()))).orElse(EMPTY);<NEW_LINE>Optional<IHostAttributes> attributes = storeProvider.getAttributeStore().getHostAttributes(Iterables.getOnlyElement(hosts));<NEW_LINE>if (!attributes.isPresent()) {<NEW_LINE>metrics.recordMissingAttributes();<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>ResourceRequest requiredResources = ResourceRequest.fromTask(pendingTask, executorSettings, jobState, tierManager);<NEW_LINE>Optional<Instant> unavailability = offer.flatMap(HostOffer::getUnavailabilityStart);<NEW_LINE>ResourceBag totalResource = slackResources;<NEW_LINE>Set<PreemptionVictim> toPreemptTasks = Sets.newHashSet();<NEW_LINE>for (PreemptionVictim victim : sortedVictims) {<NEW_LINE>toPreemptTasks.add(victim);<NEW_LINE>totalResource = totalResource.add(victimToResources.apply(victim));<NEW_LINE>Set<Veto> vetoes = schedulingFilter.filter(new UnusedResource(totalResource, attributes.get(), unavailability), requiredResources);<NEW_LINE>if (vetoes.isEmpty()) {<NEW_LINE>return Optional.of<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
(ImmutableSet.copyOf(toPreemptTasks));
1,179,547
private boolean passesFilterCheck(BuildContext context, SpringFactory factory) {<NEW_LINE>String factoryName = factory.getFactory().getName();<NEW_LINE>// TODO shame no ConditionalOnClass on these providers<NEW_LINE>if (factoryName.endsWith("FreeMarkerTemplateAvailabilityProvider")) {<NEW_LINE>return ClassUtils.isPresent("freemarker.template.Configuration", context.getClassLoader());<NEW_LINE>} else if (factoryName.endsWith("MustacheTemplateAvailabilityProvider")) {<NEW_LINE>return ClassUtils.isPresent(<MASK><NEW_LINE>} else if (factoryName.endsWith("GroovyTemplateAvailabilityProvider")) {<NEW_LINE>return ClassUtils.isPresent("groovy.text.TemplateEngine", context.getClassLoader());<NEW_LINE>} else if (factoryName.endsWith("ThymeleafTemplateAvailabilityProvider")) {<NEW_LINE>return ClassUtils.isPresent("org.thymeleaf.spring5.SpringTemplateEngine", context.getClassLoader());<NEW_LINE>} else if (factoryName.endsWith("JspTemplateAvailabilityProvider")) {<NEW_LINE>return ClassUtils.isPresent("org.apache.jasper.compiler.JspConfig", context.getClassLoader());<NEW_LINE>} else if (factoryName.equals("org.springframework.boot.autoconfigure.BackgroundPreinitializer")) {<NEW_LINE>return false;<NEW_LINE>} else if (factoryName.equals("org.springframework.boot.env.YamlPropertySourceLoader")) {<NEW_LINE>return !aotOptions.isRemoveYamlSupport();<NEW_LINE>} else if (factoryName.startsWith("org.springframework.boot.devtools")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
"com.samskivert.mustache.Mustache", context.getClassLoader());
345,449
private static Long toLong(String value) {<NEW_LINE>final String lowerSValue = value.toLowerCase(Locale.ROOT).trim();<NEW_LINE>if (lowerSValue.endsWith("k")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 1)) * C1);<NEW_LINE>} else if (lowerSValue.endsWith("kb")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 2)) * C1);<NEW_LINE>} else if (lowerSValue.endsWith("m")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 1)) * C2);<NEW_LINE>} else if (lowerSValue.endsWith("mb")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 2)) * C2);<NEW_LINE>} else if (lowerSValue.endsWith("g")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 1)) * C3);<NEW_LINE>} else if (lowerSValue.endsWith("gb")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length(<MASK><NEW_LINE>} else if (lowerSValue.endsWith("t")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 1)) * C4);<NEW_LINE>} else if (lowerSValue.endsWith("tb")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 2)) * C4);<NEW_LINE>} else if (lowerSValue.endsWith("p")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 1)) * C5);<NEW_LINE>} else if (lowerSValue.endsWith("pb")) {<NEW_LINE>return (long) (Double.parseDouble(lowerSValue.substring(0, lowerSValue.length() - 2)) * C5);<NEW_LINE>} else if (lowerSValue.endsWith("b")) {<NEW_LINE>return Long.parseLong(lowerSValue.substring(0, lowerSValue.length() - 1).trim());<NEW_LINE>} else if (lowerSValue.equals("-1")) {<NEW_LINE>// Allow this special value to be unit-less:<NEW_LINE>return -1L;<NEW_LINE>} else if (lowerSValue.equals("0")) {<NEW_LINE>// Allow this special value to be unit-less:<NEW_LINE>return 0L;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
) - 2)) * C3);
409,029
public void actionPerformed(AnActionEvent e) {<NEW_LINE>final <MASK><NEW_LINE>final LayoutTreeSelection selection = treeComponent.getSelection();<NEW_LINE>final CompositePackagingElement<?> parent = selection.getCommonParentElement();<NEW_LINE>if (parent == null)<NEW_LINE>return;<NEW_LINE>final PackagingElementNode<?> parentNode = selection.getNodes().get(0).getParentNode();<NEW_LINE>if (parentNode == null)<NEW_LINE>return;<NEW_LINE>if (!treeComponent.checkCanModifyChildren(parent, parentNode, selection.getNodes())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final CompositePackagingElementType<?>[] types = PackagingElementFactory.getInstance(e.getProject()).getCompositeElementTypes();<NEW_LINE>final List<PackagingElement<?>> selected = selection.getElements();<NEW_LINE>if (types.length == 1) {<NEW_LINE>surroundWith(types[0], parent, selected, treeComponent);<NEW_LINE>} else {<NEW_LINE>JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<CompositePackagingElementType>("Surround With...", types) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Image getIconFor(CompositePackagingElementType aValue) {<NEW_LINE>return aValue.getIcon();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public String getTextFor(CompositePackagingElementType value) {<NEW_LINE>return value.getPresentableName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public PopupStep onChosen(final CompositePackagingElementType selectedValue, boolean finalChoice) {<NEW_LINE>ApplicationManager.getApplication().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>surroundWith(selectedValue, parent, selected, treeComponent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return FINAL_CHOICE;<NEW_LINE>}<NEW_LINE>}).showInBestPositionFor(e.getDataContext());<NEW_LINE>}<NEW_LINE>}
LayoutTreeComponent treeComponent = myArtifactEditor.getLayoutTreeComponent();
633,744
private void appendCardsStyle(AppDialogPresenter settingsPresenter) {<NEW_LINE>List<OptionItem> options = new ArrayList<>();<NEW_LINE>OptionItem animatedPreviewsOption = UiOptionItem.from(getContext().getString(R.string.card_animated_previews), option -> mMainUIData.enableCardAnimatedPreviews(option.isSelected()<MASK><NEW_LINE>OptionItem multilineTitle = UiOptionItem.from(getContext().getString(R.string.card_multiline_title), option -> mMainUIData.enableCardMultilineTitle(option.isSelected()), mMainUIData.isCardMultilineTitleEnabled());<NEW_LINE>OptionItem autoScrolledTitle = UiOptionItem.from(getContext().getString(R.string.card_auto_scrolled_title), option -> mMainUIData.enableCardTextAutoScroll(option.isSelected()), mMainUIData.isCardTextAutoScrollEnabled());<NEW_LINE>options.add(animatedPreviewsOption);<NEW_LINE>options.add(multilineTitle);<NEW_LINE>options.add(autoScrolledTitle);<NEW_LINE>settingsPresenter.appendCheckedCategory(getContext().getString(R.string.cards_style), options);<NEW_LINE>}
), mMainUIData.isCardAnimatedPreviewsEnabled());
829,364
private void createReport(IBundleCoverage bundleCoverage) throws IOException {<NEW_LINE>Set<String> unknownFormats = Sets.difference(reportFormats, KNOWN_REPORT_FORMATS);<NEW_LINE>if (!unknownFormats.isEmpty()) {<NEW_LINE>throw new RuntimeException("Unable to parse formats: " + String.join(",", reportFormats));<NEW_LINE>}<NEW_LINE>// Create a concrete report visitors based on some supplied<NEW_LINE>// configuration. In this case we use the defaults<NEW_LINE>List<IReportVisitor> visitors = new ArrayList<>();<NEW_LINE>if (reportFormats.contains("csv")) {<NEW_LINE>reportDirectory.mkdirs();<NEW_LINE>CSVFormatter csvFormatter = new CSVFormatter();<NEW_LINE>visitors.add(csvFormatter.createVisitor(new FileOutputStream(new File(reportDirectory, "coverage.csv"))));<NEW_LINE>}<NEW_LINE>if (reportFormats.contains("html")) {<NEW_LINE>HTMLFormatter htmlFormatter = new HTMLFormatter();<NEW_LINE>visitors.add(htmlFormatter.createVisitor<MASK><NEW_LINE>}<NEW_LINE>if (reportFormats.contains("xml")) {<NEW_LINE>reportDirectory.mkdirs();<NEW_LINE>XMLFormatter xmlFormatter = new XMLFormatter();<NEW_LINE>visitors.add(xmlFormatter.createVisitor(new FileOutputStream(new File(reportDirectory, "coverage.xml"))));<NEW_LINE>}<NEW_LINE>IReportVisitor visitor = new MultiReportVisitor(visitors);<NEW_LINE>// Initialize the report with all of the execution and session<NEW_LINE>// information. At this point the report doesn't know about the<NEW_LINE>// structure of the report being created<NEW_LINE>visitor.visitInfo(execFileLoader.getSessionInfoStore().getInfos(), execFileLoader.getExecutionDataStore().getContents());<NEW_LINE>// Populate the report structure with the bundle coverage information.<NEW_LINE>// Call visitGroup if you need groups in your report.<NEW_LINE>visitor.visitBundle(bundleCoverage, createSourceFileLocator());<NEW_LINE>// Signal end of structure information to allow report to write all<NEW_LINE>// information out<NEW_LINE>visitor.visitEnd();<NEW_LINE>}
(new FileMultiReportOutput(reportDirectory)));
289,867
public static ListGroupsForUserResponse unmarshall(ListGroupsForUserResponse listGroupsForUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>listGroupsForUserResponse.setCode(_ctx.stringValue("ListGroupsForUserResponse.Code"));<NEW_LINE>listGroupsForUserResponse.setMessage(_ctx.stringValue("ListGroupsForUserResponse.Message"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCurrentPage<MASK><NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("ListGroupsForUserResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotal(_ctx.integerValue("ListGroupsForUserResponse.PageInfo.Total"));<NEW_LINE>pageInfo.setTotalPage(_ctx.integerValue("ListGroupsForUserResponse.PageInfo.TotalPage"));<NEW_LINE>pageInfo.setNextPageToken(_ctx.stringValue("ListGroupsForUserResponse.PageInfo.NextPageToken"));<NEW_LINE>listGroupsForUserResponse.setPageInfo(pageInfo);<NEW_LINE>List<OamGroup> data = new ArrayList<OamGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListGroupsForUserResponse.Data.Length"); i++) {<NEW_LINE>OamGroup oamGroup = new OamGroup();<NEW_LINE>oamGroup.setGroupName(_ctx.stringValue("ListGroupsForUserResponse.Data[" + i + "].GroupName"));<NEW_LINE>oamGroup.setDescription(_ctx.stringValue("ListGroupsForUserResponse.Data[" + i + "].Description"));<NEW_LINE>oamGroup.setOwnerName(_ctx.stringValue("ListGroupsForUserResponse.Data[" + i + "].OwnerName"));<NEW_LINE>oamGroup.setGmtCreated(_ctx.stringValue("ListGroupsForUserResponse.Data[" + i + "].GmtCreated"));<NEW_LINE>oamGroup.setGmtModified(_ctx.stringValue("ListGroupsForUserResponse.Data[" + i + "].GmtModified"));<NEW_LINE>data.add(oamGroup);<NEW_LINE>}<NEW_LINE>listGroupsForUserResponse.setData(data);<NEW_LINE>return listGroupsForUserResponse;<NEW_LINE>}
(_ctx.integerValue("ListGroupsForUserResponse.PageInfo.CurrentPage"));
1,699,681
public static ListAvailableEcsTypesResponse unmarshall(ListAvailableEcsTypesResponse listAvailableEcsTypesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAvailableEcsTypesResponse.setRequestId(_ctx.stringValue("ListAvailableEcsTypesResponse.RequestId"));<NEW_LINE>listAvailableEcsTypesResponse.setSupportSpotInstance(_ctx.booleanValue("ListAvailableEcsTypesResponse.SupportSpotInstance"));<NEW_LINE>List<InstanceTypeFamilyInfo> instanceTypeFamilies = new ArrayList<InstanceTypeFamilyInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies.Length"); i++) {<NEW_LINE>InstanceTypeFamilyInfo instanceTypeFamilyInfo = new InstanceTypeFamilyInfo();<NEW_LINE>instanceTypeFamilyInfo.setInstanceTypeFamilyId(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].InstanceTypeFamilyId"));<NEW_LINE>instanceTypeFamilyInfo.setGeneration(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Generation"));<NEW_LINE>List<TypesInfo> types <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types.Length"); j++) {<NEW_LINE>TypesInfo typesInfo = new TypesInfo();<NEW_LINE>typesInfo.setCpuCoreCount(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].CpuCoreCount"));<NEW_LINE>typesInfo.setMemorySize(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].MemorySize"));<NEW_LINE>typesInfo.setGPUAmount(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].GPUAmount"));<NEW_LINE>typesInfo.setInstanceBandwidthRx(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].InstanceBandwidthRx"));<NEW_LINE>typesInfo.setInstancePpsRx(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].InstancePpsRx"));<NEW_LINE>typesInfo.setInstancePpsTx(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].InstancePpsTx"));<NEW_LINE>typesInfo.setEniQuantity(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].EniQuantity"));<NEW_LINE>typesInfo.setInstanceBandwidthTx(_ctx.integerValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].InstanceBandwidthTx"));<NEW_LINE>typesInfo.setInstanceTypeId(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].InstanceTypeId"));<NEW_LINE>typesInfo.setGPUSpec(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].GPUSpec"));<NEW_LINE>typesInfo.setStatus(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].Status"));<NEW_LINE>List<String> zoneIds = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].ZoneIds.Length"); k++) {<NEW_LINE>zoneIds.add(_ctx.stringValue("ListAvailableEcsTypesResponse.InstanceTypeFamilies[" + i + "].Types[" + j + "].ZoneIds[" + k + "]"));<NEW_LINE>}<NEW_LINE>typesInfo.setZoneIds(zoneIds);<NEW_LINE>types.add(typesInfo);<NEW_LINE>}<NEW_LINE>instanceTypeFamilyInfo.setTypes(types);<NEW_LINE>instanceTypeFamilies.add(instanceTypeFamilyInfo);<NEW_LINE>}<NEW_LINE>listAvailableEcsTypesResponse.setInstanceTypeFamilies(instanceTypeFamilies);<NEW_LINE>return listAvailableEcsTypesResponse;<NEW_LINE>}
= new ArrayList<TypesInfo>();
784,382
public void onComplete(FacebookDialog.PendingCall pendingCall, Bundle data) {<NEW_LINE>if (data == null || !data.containsKey(LIKE_DIALOG_RESPONSE_OBJECT_IS_LIKED_KEY)) {<NEW_LINE>// This is an empty result that we can't handle.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isObjectLiked = data.getBoolean(LIKE_DIALOG_RESPONSE_OBJECT_IS_LIKED_KEY);<NEW_LINE>// Default to known/cached state, if properties are missing.<NEW_LINE><MASK><NEW_LINE>String likeCountStringWithoutLike = LikeActionController.this.likeCountStringWithoutLike;<NEW_LINE>if (data.containsKey(LIKE_DIALOG_RESPONSE_LIKE_COUNT_STRING_KEY)) {<NEW_LINE>likeCountStringWithLike = data.getString(LIKE_DIALOG_RESPONSE_LIKE_COUNT_STRING_KEY);<NEW_LINE>likeCountStringWithoutLike = likeCountStringWithLike;<NEW_LINE>}<NEW_LINE>String socialSentenceWithLike = LikeActionController.this.socialSentenceWithLike;<NEW_LINE>String socialSentenceWithoutWithoutLike = LikeActionController.this.socialSentenceWithoutLike;<NEW_LINE>if (data.containsKey(LIKE_DIALOG_RESPONSE_SOCIAL_SENTENCE_KEY)) {<NEW_LINE>socialSentenceWithLike = data.getString(LIKE_DIALOG_RESPONSE_SOCIAL_SENTENCE_KEY);<NEW_LINE>socialSentenceWithoutWithoutLike = socialSentenceWithLike;<NEW_LINE>}<NEW_LINE>String unlikeToken = data.containsKey(LIKE_DIALOG_RESPONSE_OBJECT_IS_LIKED_KEY) ? data.getString(LIKE_DIALOG_RESPONSE_UNLIKE_TOKEN_KEY) : LikeActionController.this.unlikeToken;<NEW_LINE>Bundle logParams = (analyticsParameters == null) ? new Bundle() : analyticsParameters;<NEW_LINE>logParams.putString(AnalyticsEvents.PARAMETER_CALL_ID, pendingCall.getCallId().toString());<NEW_LINE>appEventsLogger.logSdkEvent(AnalyticsEvents.EVENT_LIKE_VIEW_DIALOG_DID_SUCCEED, null, logParams);<NEW_LINE>updateState(isObjectLiked, likeCountStringWithLike, likeCountStringWithoutLike, socialSentenceWithLike, socialSentenceWithoutWithoutLike, unlikeToken);<NEW_LINE>}
String likeCountStringWithLike = LikeActionController.this.likeCountStringWithLike;