idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
979,532
public Rectangle call() throws Exception {<NEW_LINE>AccessibleComponent acmp = ac.getAccessibleComponent();<NEW_LINE>if (acmp != null) {<NEW_LINE>Rectangle r = acmp.getBounds();<NEW_LINE>if (r != null) {<NEW_LINE>try {<NEW_LINE>Point p = acmp.getLocationOnScreen();<NEW_LINE>if (p != null) {<NEW_LINE>r.x = p.x;<NEW_LINE>r.y = p.y;<NEW_LINE>AffineTransform at = getTransformFromContext(ac);<NEW_LINE>if (at != null) {<NEW_LINE>r.x = (int) Math.floor(r.<MASK><NEW_LINE>r.y = (int) Math.floor(r.y * at.getScaleY());<NEW_LINE>r.width = (int) Math.ceil(r.width * at.getScaleX());<NEW_LINE>r.height = (int) Math.ceil(r.height * at.getScaleY());<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
x * at.getScaleX());
186,560
protected SessionData load(InputStream is, String expectedId) throws Exception {<NEW_LINE>// the actual id from inside the file<NEW_LINE>String id;<NEW_LINE>try {<NEW_LINE>SessionData data;<NEW_LINE>DataInputStream di = new DataInputStream(is);<NEW_LINE>id = di.readUTF();<NEW_LINE>final String contextPath = di.readUTF();<NEW_LINE>final String vhost = di.readUTF();<NEW_LINE>final String lastNode = di.readUTF();<NEW_LINE>final long created = di.readLong();<NEW_LINE>final long accessed = di.readLong();<NEW_LINE>final long lastAccessed = di.readLong();<NEW_LINE>final long cookieSet = di.readLong();<NEW_LINE>final long expiry = di.readLong();<NEW_LINE>final long maxIdle = di.readLong();<NEW_LINE>data = newSessionData(id, created, accessed, lastAccessed, maxIdle);<NEW_LINE>data.setContextPath(contextPath);<NEW_LINE>data.setVhost(vhost);<NEW_LINE>data.setLastNode(lastNode);<NEW_LINE>data.setCookieSet(cookieSet);<NEW_LINE>data.setExpiry(expiry);<NEW_LINE>data.setMaxInactiveMs(maxIdle);<NEW_LINE>// Attributes<NEW_LINE>ClassLoadingObjectInputStream ois = new ClassLoadingObjectInputStream(is);<NEW_LINE><MASK><NEW_LINE>return data;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new UnreadableSessionDataException(expectedId, _context, e);<NEW_LINE>}<NEW_LINE>}
SessionData.deserializeAttributes(data, ois);
1,745,073
public ScoredDocuments rerank(ScoredDocuments docs, RerankerContext context) {<NEW_LINE>// set similarity to BM25PRF<NEW_LINE>IndexSearcher searcher = context.getIndexSearcher();<NEW_LINE>BM25Similarity originalSimilarity = (BM25Similarity) searcher.getSimilarity();<NEW_LINE>searcher.setSimilarity(new BM25PrfSimilarity(k1, b));<NEW_LINE>IndexReader reader = searcher.getIndexReader();<NEW_LINE>List<String> originalQueryTerms = AnalyzerUtils.analyze(analyzer, context.getQueryText());<NEW_LINE>boolean useRf = (context.getSearchArgs().rf_qrels != null);<NEW_LINE>PrfFeatures fv = expandQuery(originalQueryTerms, docs, reader, useRf);<NEW_LINE>Query newQuery = fv.toQuery();<NEW_LINE>if (this.outputQuery) {<NEW_LINE>LOG.info("QID: " + context.getQueryId());<NEW_LINE>LOG.info("Original Query: " + context.getQuery()<MASK><NEW_LINE>LOG.info("Running new query: " + newQuery.toString(this.field));<NEW_LINE>LOG.info("Features: " + fv.toString());<NEW_LINE>}<NEW_LINE>TopDocs rs;<NEW_LINE>try {<NEW_LINE>// Figure out how to break the scoring ties.<NEW_LINE>if (context.getSearchArgs().arbitraryScoreTieBreak) {<NEW_LINE>rs = searcher.search(newQuery, context.getSearchArgs().hits);<NEW_LINE>} else if (context.getSearchArgs().searchtweets) {<NEW_LINE>rs = searcher.search(newQuery, context.getSearchArgs().hits, BREAK_SCORE_TIES_BY_TWEETID, true);<NEW_LINE>} else {<NEW_LINE>rs = searcher.search(newQuery, context.getSearchArgs().hits, BREAK_SCORE_TIES_BY_DOCID, true);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return docs;<NEW_LINE>}<NEW_LINE>// set similarity back<NEW_LINE>searcher.setSimilarity(originalSimilarity);<NEW_LINE>return ScoredDocuments.fromTopDocs(rs, searcher);<NEW_LINE>}
.toString(this.field));
354,184
private TermValueSetConcept saveConcept(String theSystem, String theCode, String theDisplay, Long theSourceConceptPid, String theSourceConceptDirectParentPids, String theSystemVersion) {<NEW_LINE>ValidateUtil.isNotBlankOrThrowInvalidRequest(theSystem, "ValueSet contains a concept with no system value");<NEW_LINE>ValidateUtil.isNotBlankOrThrowInvalidRequest(theCode, "ValueSet contains a concept with no code value");<NEW_LINE>TermValueSetConcept concept = new TermValueSetConcept();<NEW_LINE>concept.setValueSet(myTermValueSet);<NEW_LINE>concept.setOrder(myConceptsSaved);<NEW_LINE>int versionIndex = theSystem.indexOf("|");<NEW_LINE>if (versionIndex >= 0) {<NEW_LINE>concept.setSystem(theSystem.substring(0, versionIndex));<NEW_LINE>concept.setSystemVersion(theSystem<MASK><NEW_LINE>} else {<NEW_LINE>concept.setSystem(theSystem);<NEW_LINE>}<NEW_LINE>concept.setCode(theCode);<NEW_LINE>if (isNotBlank(theDisplay)) {<NEW_LINE>concept.setDisplay(theDisplay);<NEW_LINE>}<NEW_LINE>concept.setSystemVersion(theSystemVersion);<NEW_LINE>concept.setSourceConceptPid(theSourceConceptPid);<NEW_LINE>concept.setSourceConceptDirectParentPids(theSourceConceptDirectParentPids);<NEW_LINE>myValueSetConceptDao.save(concept);<NEW_LINE>myValueSetDao.save(myTermValueSet.incrementTotalConcepts());<NEW_LINE>if (++myConceptsSaved % 250 == 0) {<NEW_LINE>ourLog.info("Have pre-expanded {} concepts in ValueSet[{}]", myConceptsSaved, myTermValueSet.getUrl());<NEW_LINE>}<NEW_LINE>return concept;<NEW_LINE>}
.substring(versionIndex + 1));
96,913
public static void onKeyInput(int key, boolean pressed) {<NEW_LINE>if (key != AllKeys.TOOLBELT.getBoundCode())<NEW_LINE>return;<NEW_LINE>if (COOLDOWN > 0)<NEW_LINE>return;<NEW_LINE>LocalPlayer player = Minecraft.getInstance().player;<NEW_LINE>if (player == null)<NEW_LINE>return;<NEW_LINE>Level level = player.level;<NEW_LINE>List<ToolboxTileEntity> toolboxes = ToolboxHandler.getNearest(player.level, player, 8);<NEW_LINE>if (!toolboxes.isEmpty())<NEW_LINE>Collections.sort(toolboxes, (te1, te2) -> te1.getUniqueId().compareTo(te2.getUniqueId()));<NEW_LINE>CompoundTag compound = player.getPersistentData().getCompound("CreateToolboxData");<NEW_LINE>String slotKey = String.valueOf(player.getInventory().selected);<NEW_LINE>boolean equipped = compound.contains(slotKey);<NEW_LINE>if (equipped) {<NEW_LINE>BlockPos pos = NbtUtils.readBlockPos(compound.getCompound(slotKey).getCompound("Pos"));<NEW_LINE>double max = ToolboxHandler.getMaxRange(player);<NEW_LINE>boolean canReachToolbox = ToolboxHandler.distance(player.position(), pos) < max * max;<NEW_LINE>if (canReachToolbox) {<NEW_LINE>BlockEntity <MASK><NEW_LINE>if (blockEntity instanceof ToolboxTileEntity) {<NEW_LINE>RadialToolboxMenu screen = new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_ITEM_UNEQUIP, (ToolboxTileEntity) blockEntity);<NEW_LINE>screen.prevSlot(compound.getCompound(slotKey).getInt("Slot"));<NEW_LINE>ScreenOpener.open(screen);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ScreenOpener.open(new RadialToolboxMenu(ImmutableList.of(), RadialToolboxMenu.State.DETACH, null));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (toolboxes.isEmpty())<NEW_LINE>return;<NEW_LINE>if (toolboxes.size() == 1)<NEW_LINE>ScreenOpener.open(new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_ITEM, toolboxes.get(0)));<NEW_LINE>else<NEW_LINE>ScreenOpener.open(new RadialToolboxMenu(toolboxes, RadialToolboxMenu.State.SELECT_BOX, null));<NEW_LINE>}
blockEntity = level.getBlockEntity(pos);
988,378
public Object execute(Value... arguments) {<NEW_LINE>Object[] parameters = Arrays.stream(arguments).map(a -> PolyglotWrapper.unwrap(actionContext, a)).toArray();<NEW_LINE>if (parameters.length == 2) {<NEW_LINE>final SecurityContext initialSecurityContext = actionContext.getSecurityContext();<NEW_LINE>try {<NEW_LINE>final Principal user <MASK><NEW_LINE>final ProxyExecutable executable = (ProxyExecutable) parameters[1];<NEW_LINE>final SecurityContext userContext = SecurityContext.getInstance(user, initialSecurityContext.getRequest(), AccessMode.Frontend);<NEW_LINE>userContext.setContextStore(initialSecurityContext.getContextStore());<NEW_LINE>actionContext.setSecurityContext(userContext);<NEW_LINE>executable.execute();<NEW_LINE>initialSecurityContext.setContextStore(userContext.getContextStore());<NEW_LINE>} catch (ClassCastException ex) {<NEW_LINE>throw new RuntimeException(new FrameworkException(422, "Invalid parameters for do_as function. Expected: Principal, Executable"));<NEW_LINE>} finally {<NEW_LINE>actionContext.setSecurityContext(initialSecurityContext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(new FrameworkException(422, "Invalid parameter count for do_as function."));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
= (Principal) parameters[0];
1,022,219
public static DescribeMigrateTasksForSQLServerResponse unmarshall(DescribeMigrateTasksForSQLServerResponse describeMigrateTasksForSQLServerResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeMigrateTasksForSQLServerResponse.setRequestId(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.RequestId"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setDBInstanceID(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.DBInstanceID"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setDBInstanceName(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.DBInstanceName"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setStartTime(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.StartTime"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setEndTime(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.EndTime"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setTotalRecordCount(_ctx.integerValue("DescribeMigrateTasksForSQLServerResponse.TotalRecordCount"));<NEW_LINE>describeMigrateTasksForSQLServerResponse.setPageNumber<MASK><NEW_LINE>describeMigrateTasksForSQLServerResponse.setPageRecordCount(_ctx.integerValue("DescribeMigrateTasksForSQLServerResponse.PageRecordCount"));<NEW_LINE>List<MigrateTask> items = new ArrayList<MigrateTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeMigrateTasksForSQLServerResponse.Items.Length"); i++) {<NEW_LINE>MigrateTask migrateTask = new MigrateTask();<NEW_LINE>migrateTask.setDBName(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].DBName"));<NEW_LINE>migrateTask.setMigrateIaskId(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].MigrateIaskId"));<NEW_LINE>migrateTask.setCreateTime(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].CreateTime"));<NEW_LINE>migrateTask.setEndTime(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].EndTime"));<NEW_LINE>migrateTask.setTaskType(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].TaskType"));<NEW_LINE>migrateTask.setStatus(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].Status"));<NEW_LINE>migrateTask.setIsDBReplaced(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].IsDBReplaced"));<NEW_LINE>migrateTask.setDesc(_ctx.stringValue("DescribeMigrateTasksForSQLServerResponse.Items[" + i + "].Desc"));<NEW_LINE>items.add(migrateTask);<NEW_LINE>}<NEW_LINE>describeMigrateTasksForSQLServerResponse.setItems(items);<NEW_LINE>return describeMigrateTasksForSQLServerResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeMigrateTasksForSQLServerResponse.PageNumber"));
375,150
private void probe() {<NEW_LINE>// First get a sorted list of discovery service nodes that are not present in the SWIM members.<NEW_LINE>// This is necessary to ensure we attempt to probe all nodes that are provided by the discovery<NEW_LINE>// provider.<NEW_LINE>final List<SwimMember> probeMembers = discoveryService.getNodes().stream().map(node -> new SwimMember(MemberId.from(node.id().id()), node.address())).filter(member -> !members.containsKey(member.id())).filter(member -> !member.id().equals(localMember.id())).filter(member -> !member.address().equals(localMember.address())).sorted(Comparator.comparing(Member::id)).collect(Collectors.toList());<NEW_LINE>// Then add the randomly sorted list of SWIM members.<NEW_LINE>probeMembers.addAll(randomMembers);<NEW_LINE>// If there are members to probe, select the next member to probe using a counter for round<NEW_LINE>// robin probes.<NEW_LINE>if (!probeMembers.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>final SwimMember probeMember = probeMembers.get(Math.abs(probeCounter.incrementAndGet() % probeMembers.size()));<NEW_LINE>probe(probeMember.copy());<NEW_LINE>} else {<NEW_LINE>scheduleProbe();<NEW_LINE>}<NEW_LINE>}
LOGGER.trace("Possible members to probe '{}'", probeMembers);
1,754,505
public static void verifyAuthInfo(AuthInfo authInfo, DomainBase domain) throws EppException {<NEW_LINE>final String authRepoId = authInfo.getPw().getRepoId();<NEW_LINE>String authPassword = authInfo.getPw().getValue();<NEW_LINE>if (authRepoId == null) {<NEW_LINE>// If no roid is specified, check the password against the domain's password.<NEW_LINE>String domainPassword = domain.getAuthInfo()<MASK><NEW_LINE>if (!domainPassword.equals(authPassword)) {<NEW_LINE>throw new BadAuthInfoForResourceException();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The roid should match one of the contacts.<NEW_LINE>Optional<VKey<ContactResource>> foundContact = domain.getReferencedContacts().stream().filter(key -> key.getOfyKey().getName().equals(authRepoId)).findFirst();<NEW_LINE>if (!foundContact.isPresent()) {<NEW_LINE>throw new BadAuthInfoForResourceException();<NEW_LINE>}<NEW_LINE>// Check the authInfo against the contact.<NEW_LINE>verifyAuthInfo(authInfo, transactIfJpaTm(() -> tm().loadByKey(foundContact.get())));<NEW_LINE>}
.getPw().getValue();
1,774,757
private DefaultActionGroup createPopupActionGroup() {<NEW_LINE>final LayoutTree tree = myLayoutTreeComponent.getLayoutTree();<NEW_LINE>DefaultActionGroup popupActionGroup = new DefaultActionGroup();<NEW_LINE><MASK><NEW_LINE>final RemovePackagingElementAction removeAction = new RemovePackagingElementAction(this);<NEW_LINE>removeAction.registerCustomShortcutSet(CommonShortcuts.getDelete(), tree);<NEW_LINE>popupActionGroup.add(removeAction);<NEW_LINE>popupActionGroup.add(new ExtractArtifactAction(this));<NEW_LINE>popupActionGroup.add(new InlineArtifactAction(this));<NEW_LINE>popupActionGroup.add(new RenamePackagingElementAction(this));<NEW_LINE>popupActionGroup.add(new SurroundElementWithAction(this));<NEW_LINE>popupActionGroup.add(AnSeparator.getInstance());<NEW_LINE>popupActionGroup.add(new HideContentAction(this));<NEW_LINE>popupActionGroup.add(new LayoutTreeNavigateAction(myLayoutTreeComponent));<NEW_LINE>popupActionGroup.add(new LayoutTreeFindUsagesAction(myLayoutTreeComponent, myContext.getParent()));<NEW_LINE>popupActionGroup.add(AnSeparator.getInstance());<NEW_LINE>CommonActionsManager actionsManager = CommonActionsManager.getInstance();<NEW_LINE>DefaultTreeExpander treeExpander = new DefaultTreeExpander(tree);<NEW_LINE>popupActionGroup.add(actionsManager.createExpandAllAction(treeExpander, tree));<NEW_LINE>popupActionGroup.add(actionsManager.createCollapseAllAction(treeExpander, tree));<NEW_LINE>return popupActionGroup;<NEW_LINE>}
popupActionGroup.add(createAddGroup());
468,041
public EVD eigen(boolean vl, boolean vr, boolean overwrite) {<NEW_LINE>if (m != n) {<NEW_LINE>throw new IllegalArgumentException(String.format("The matrix is not square: %d x %d", m, n));<NEW_LINE>}<NEW_LINE>BigMatrix eig = overwrite ? this : clone();<NEW_LINE>if (isSymmetric()) {<NEW_LINE>DoublePointer w = new DoublePointer(n);<NEW_LINE>int info = LAPACK.engine.syevd(eig.layout(), vr ? EVDJob.VECTORS : EVDJob.NO_VECTORS, eig.uplo, n, eig.A, eig.ld, w);<NEW_LINE>if (info != 0) {<NEW_LINE>logger.error("LAPACK SYEV error code: {}", info);<NEW_LINE>throw new ArithmeticException("LAPACK SYEV error code: " + info);<NEW_LINE>}<NEW_LINE>// Vr is not symmetric<NEW_LINE>eig.uplo = null;<NEW_LINE>return new EVD(w, vr ? eig : null);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>DoublePointer wi = new DoublePointer(n);<NEW_LINE>BigMatrix Vl = vl ? new BigMatrix(n, n) : new BigMatrix(1, 1);<NEW_LINE>BigMatrix Vr = vr ? new BigMatrix(n, n) : new BigMatrix(1, 1);<NEW_LINE>int info = LAPACK.engine.geev(eig.layout(), vl ? EVDJob.VECTORS : EVDJob.NO_VECTORS, vr ? EVDJob.VECTORS : EVDJob.NO_VECTORS, n, eig.A, eig.ld, wr, wi, Vl.A, Vl.ld, Vr.A, Vr.ld);<NEW_LINE>if (info != 0) {<NEW_LINE>logger.error("LAPACK GEEV error code: {}", info);<NEW_LINE>throw new ArithmeticException("LAPACK GEEV error code: " + info);<NEW_LINE>}<NEW_LINE>return new EVD(wr, wi, vl ? Vl : null, vr ? Vr : null);<NEW_LINE>}<NEW_LINE>}
DoublePointer wr = new DoublePointer(n);
259,761
public void fillCustomActions(IContributionManager contributionManager) {<NEW_LINE>super.fillCustomActions(contributionManager);<NEW_LINE>addAction = new Action("Add variable", DBeaverIcons.getImageDescriptor(UIIcon.ADD)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>AssignVariableAction action = new AssignVariableAction(mainEditor, "");<NEW_LINE>action.setEditable(true);<NEW_LINE>action.run();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>contributionManager.add(addAction);<NEW_LINE>deleteAction = new Action("Delete variable", DBeaverIcons.getImageDescriptor(UIIcon.DELETE)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (!varsTable.getSelection().isEmpty()) {<NEW_LINE>final StructuredSelection selection = (StructuredSelection) varsTable.getSelection();<NEW_LINE>List<String> varsList = Arrays.stream(selection.toArray()).map(el -> ((DBCScriptContext.VariableInfo) el).name).collect(Collectors.toList());<NEW_LINE>new RemoveVariablesAction(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>deleteAction.setEnabled(false);<NEW_LINE>contributionManager.add(deleteAction);<NEW_LINE>Action showParamsAction = new Action("Show parameters", Action.AS_CHECK_BOX) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>showParameters = !showParameters;<NEW_LINE>refreshVariables();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>showParamsAction.setChecked(showParameters);<NEW_LINE>showParamsAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.SQL_PARAMETER));<NEW_LINE>showParamsAction.setDescription("Show query parameters");<NEW_LINE>contributionManager.add(ActionUtils.makeActionContribution(showParamsAction, true));<NEW_LINE>}
mainEditor, varsList).run();
161,235
final PutInsightSelectorsResult executePutInsightSelectors(PutInsightSelectorsRequest putInsightSelectorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putInsightSelectorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutInsightSelectorsRequest> request = null;<NEW_LINE>Response<PutInsightSelectorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutInsightSelectorsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutInsightSelectors");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutInsightSelectorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutInsightSelectorsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(putInsightSelectorsRequest));
624,432
public void readFLongArr(int len, long[] arr) throws IOException {<NEW_LINE>int bytelen = arr.length * 8;<NEW_LINE>ensureReadAhead(bytelen);<NEW_LINE>int count = input.pos;<NEW_LINE>final byte[] buf = input.buf;<NEW_LINE>for (int j = 0; j < len; j++) {<NEW_LINE>long ch8 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch7 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch6 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch5 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch4 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch3 = (buf[count++] + 256) & 0xff;<NEW_LINE>long ch2 = (buf[<MASK><NEW_LINE>long ch1 = (buf[count++] + 256) & 0xff;<NEW_LINE>arr[j] = ((ch1 << 56) + (ch2 << 48) + (ch3 << 40) + (ch4 << 32) + (ch5 << 24) + (ch6 << 16) + (ch7 << 8) + (ch8 << 0));<NEW_LINE>}<NEW_LINE>input.pos += bytelen;<NEW_LINE>}
count++] + 256) & 0xff;
836,800
private static void testHttpClientsIsOk() {<NEW_LINE>TestMgr.check(HttpClients.getClient("registry") != null, true);<NEW_LINE>TestMgr.check(HttpClients.getClient("registry-watch") != null, false);<NEW_LINE>TestMgr.check(HttpClients.getClient<MASK><NEW_LINE>TestMgr.check(HttpClients.getClient("http-transport-client") != null, false);<NEW_LINE>TestMgr.check(HttpClients.getClient("http2-transport-client") != null, true);<NEW_LINE>TestMgr.check(HttpClients.getClient("registry", false) != null, true);<NEW_LINE>TestMgr.check(HttpClients.getClient("registry-watch", false) != null, false);<NEW_LINE>TestMgr.check(HttpClients.getClient("config-center", false) != null, false);<NEW_LINE>TestMgr.check(HttpClients.getClient("http-transport-client", false) != null, false);<NEW_LINE>TestMgr.check(HttpClients.getClient("http2-transport-client", false) != null, true);<NEW_LINE>}
("config-center") != null, false);
1,531,420
BoundedState pick() {<NEW_LINE>for (; ; ) {<NEW_LINE>int a = get();<NEW_LINE>if (a == DISPOSED || busyArray == ALL_SHUTDOWN) {<NEW_LINE>// synonym for shutdown, since the underlying executor is shut down<NEW_LINE>return CREATING;<NEW_LINE>}<NEW_LINE>if (!idleQueue.isEmpty()) {<NEW_LINE>// try to find an idle resource<NEW_LINE><MASK><NEW_LINE>if (bs != null && bs.markPicked()) {<NEW_LINE>setBusy(bs);<NEW_LINE>return bs;<NEW_LINE>}<NEW_LINE>// else optimistically retry (implicit continue here)<NEW_LINE>} else if (a < parent.maxThreads) {<NEW_LINE>// try to build a new resource<NEW_LINE>if (compareAndSet(a, a + 1)) {<NEW_LINE>ScheduledExecutorService s = Schedulers.decorateExecutorService(parent, parent.createBoundedExecutorService());<NEW_LINE>BoundedState newState = new BoundedState(this, s);<NEW_LINE>if (newState.markPicked()) {<NEW_LINE>setBusy(newState);<NEW_LINE>return newState;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// else optimistically retry (implicit continue here)<NEW_LINE>} else {<NEW_LINE>BoundedState s = choseOneBusy();<NEW_LINE>if (s != null && s.markPicked()) {<NEW_LINE>return s;<NEW_LINE>}<NEW_LINE>// else optimistically retry (implicit continue here)<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BoundedState bs = idleQueue.pollLast();
1,209,656
public void onProjectsLinked(@Nonnull final Collection linked) {<NEW_LINE>List<VcsDirectoryMapping> newMappings = ContainerUtilRt.newArrayList();<NEW_LINE>final LocalFileSystem fileSystem = LocalFileSystem.getInstance();<NEW_LINE>ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);<NEW_LINE>for (Object o : linked) {<NEW_LINE>final ExternalProjectSettings settings = (ExternalProjectSettings) o;<NEW_LINE>VirtualFile dir = fileSystem.refreshAndFindFileByPath(settings.getExternalProjectPath());<NEW_LINE>if (dir == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!dir.isDirectory()) {<NEW_LINE>dir = dir.getParent();<NEW_LINE>}<NEW_LINE>newMappings.addAll(VcsUtil.findRoots(dir, project));<NEW_LINE>}<NEW_LINE>// There is a possible case that no VCS mappings are configured for the current project. There is a single<NEW_LINE>// mapping like <Project> - <No VCS> then. We want to replace it if only one mapping to the project root dir<NEW_LINE>// has been detected then.<NEW_LINE>List<VcsDirectoryMapping<MASK><NEW_LINE>if (oldMappings.size() == 1 && newMappings.size() == 1 && StringUtil.isEmpty(oldMappings.get(0).getVcs())) {<NEW_LINE>VcsDirectoryMapping newMapping = newMappings.iterator().next();<NEW_LINE>String detectedDirPath = newMapping.getDirectory();<NEW_LINE>VirtualFile detectedDir = fileSystem.findFileByPath(detectedDirPath);<NEW_LINE>if (detectedDir != null && detectedDir.equals(project.getBaseDir())) {<NEW_LINE>newMappings.clear();<NEW_LINE>newMappings.add(new VcsDirectoryMapping("", newMapping.getVcs()));<NEW_LINE>vcsManager.setDirectoryMappings(newMappings);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newMappings.addAll(oldMappings);<NEW_LINE>vcsManager.setDirectoryMappings(newMappings);<NEW_LINE>}
> oldMappings = vcsManager.getDirectoryMappings();
448,265
private boolean updateJobExecutionEventFailure(final JobExecutionEvent jobExecutionEvent) {<NEW_LINE>boolean result = false;<NEW_LINE>try (Connection connection = dataSource.getConnection();<NEW_LINE>PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getUpdateForJobExecutionLogForFailure())) {<NEW_LINE>preparedStatement.setBoolean(<MASK><NEW_LINE>preparedStatement.setTimestamp(2, new Timestamp(jobExecutionEvent.getCompleteTime().getTime()));<NEW_LINE>preparedStatement.setString(3, truncateString(jobExecutionEvent.getFailureCause()));<NEW_LINE>preparedStatement.setString(4, jobExecutionEvent.getId());<NEW_LINE>if (0 == preparedStatement.executeUpdate()) {<NEW_LINE>return insertJobExecutionEventWhenFailure(jobExecutionEvent);<NEW_LINE>}<NEW_LINE>result = true;<NEW_LINE>} catch (final SQLException ex) {<NEW_LINE>// TODO log failure directly to output log, consider to be configurable in the future<NEW_LINE>log.error(ex.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
1, jobExecutionEvent.isSuccess());
510,406
public static void loadConfig() {<NEW_LINE>File coreFile = new File(EnderIO.getConfigHandler().getConfigDirectory(), CORE_FILE_NAME);<NEW_LINE>String defaultVals = null;<NEW_LINE>try {<NEW_LINE>defaultVals = RecipeConfig.readRecipes(coreFile, CORE_FILE_NAME, true);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.error("Could not load painter lists " + coreFile + " from EnderIO jar: " + e.getMessage());<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!coreFile.exists()) {<NEW_LINE>Log.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>parse(defaultVals);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error("Could not parse default lists from " + coreFile + ": " + e);<NEW_LINE>}<NEW_LINE>File userFile = new File(EnderIO.getConfigHandler().getConfigDirectory(), CUSTOM_FILE_NAME);<NEW_LINE>String userConfigStr = null;<NEW_LINE>try {<NEW_LINE>userConfigStr = RecipeConfig.readRecipes(userFile, CUSTOM_FILE_NAME, false);<NEW_LINE>if (userConfigStr.trim().length() == 0) {<NEW_LINE>Log.error("Empty user config file: " + userFile.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>parse(userConfigStr);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error("Could not load user defined painter lists from file: " + CUSTOM_FILE_NAME);<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
error("Could not load default lists from " + coreFile + " as the file does not exist.");
1,624,420
private void add(Point point) throws IllegalStateException {<NEW_LINE>checkState(!_done, "Computation of spherical excess is complete");<NEW_LINE>double phi = toRadians(point.getY());<NEW_LINE>double tan = Math.tan(phi / 2);<NEW_LINE>double longitude = toRadians(point.getX());<NEW_LINE>// We need to check for that specifically<NEW_LINE>// Otherwise calculating the bearing is not deterministic<NEW_LINE>if (longitude == _previousLongitude && phi == _previousPhi) {<NEW_LINE>throw new RuntimeException("Polygon is not valid: it has two identical consecutive vertices");<NEW_LINE>}<NEW_LINE>double deltaLongitude = longitude - _previousLongitude;<NEW_LINE>_sphericalExcess += 2 * Math.atan2(Math.tan(deltaLongitude / 2) * (_previousTan + tan), 1 + _previousTan * tan);<NEW_LINE>double cos = Math.cos(phi);<NEW_LINE>double sin = Math.sin(phi);<NEW_LINE>double sinOfDeltaLongitude = Math.sin(deltaLongitude);<NEW_LINE>double cosOfDeltaLongitude = Math.cos(deltaLongitude);<NEW_LINE>// Initial bearing from previous to current<NEW_LINE>double y = sinOfDeltaLongitude * cos;<NEW_LINE>double x = _previousCos * sin - _previousSin * cos * cosOfDeltaLongitude;<NEW_LINE>double initialBearing = (Math.atan2(y, x) + TWO_PI) % TWO_PI;<NEW_LINE>// Final bearing from previous to current = opposite of bearing from current to previous<NEW_LINE>double finalY = -sinOfDeltaLongitude * _previousCos;<NEW_LINE>double finalX = _previousSin <MASK><NEW_LINE>double finalBearing = (Math.atan2(finalY, finalX) + PI) % TWO_PI;<NEW_LINE>// When processing our first point we don't yet have a _previousFinalBearing<NEW_LINE>if (_firstPoint) {<NEW_LINE>// So keep our initial bearing around, and we'll use it at the end<NEW_LINE>// with the last final bearing<NEW_LINE>_firstInitialBearing = initialBearing;<NEW_LINE>_firstPoint = false;<NEW_LINE>} else {<NEW_LINE>_courseDelta += (initialBearing - _previousFinalBearing + THREE_PI) % TWO_PI - PI;<NEW_LINE>}<NEW_LINE>_courseDelta += (finalBearing - initialBearing + THREE_PI) % TWO_PI - PI;<NEW_LINE>_previousFinalBearing = finalBearing;<NEW_LINE>_previousCos = cos;<NEW_LINE>_previousSin = sin;<NEW_LINE>_previousPhi = phi;<NEW_LINE>_previousTan = tan;<NEW_LINE>_previousLongitude = longitude;<NEW_LINE>}
* cos - _previousCos * sin * cosOfDeltaLongitude;
800,500
public void visit(ClassInstanceCreation node) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ASTNodeInfo<ClassInstanceCreation> <MASK><NEW_LINE>int startOffset = node.getStartOffset();<NEW_LINE>VariableScope variableScope = model.getVariableScope(startOffset);<NEW_LINE>QualifiedName fullyQualifiedName = VariousUtils.getFullyQualifiedName(info.getQualifiedName(), startOffset, variableScope);<NEW_LINE>Set<ClassElement> classes = index.getClasses(NameKind.exact(fullyQualifiedName));<NEW_LINE>if (!classes.isEmpty()) {<NEW_LINE>ClassElement classElement = ModelUtils.getFirst(classes);<NEW_LINE>if (classElement != null && classElement.isAbstract()) {<NEW_LINE>OffsetRange offsetRange = new OffsetRange(startOffset, node.getEndOffset());<NEW_LINE>hints.add(new Hint(AbstractClassInstantiationHintError.this, Bundle.AbstractClassInstantiationDesc(classElement.getFullyQualifiedName().toString()), fileObject, offsetRange, null, 500));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
info = ASTNodeInfo.create(node);
1,598,370
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public FunctionRequirements requirements(T target, Set<Measure> measures, CalculationParameters parameters, ReferenceData refData) {<NEW_LINE>// extract data from product<NEW_LINE><MASK><NEW_LINE>BondFuture future = option.getUnderlyingFuture();<NEW_LINE>// use lookup to build requirements<NEW_LINE>QuoteId optionQuoteId = QuoteId.of(option.getSecurityId().getStandardId(), FieldName.SETTLEMENT_PRICE);<NEW_LINE>FunctionRequirements freqs = FunctionRequirements.builder().valueRequirements(optionQuoteId).outputCurrencies(future.getCurrency(), option.getCurrency()).build();<NEW_LINE>LegalEntityDiscountingMarketDataLookup ledLookup = parameters.getParameter(LegalEntityDiscountingMarketDataLookup.class);<NEW_LINE>for (FixedCouponBond bond : future.getDeliveryBasket()) {<NEW_LINE>freqs = freqs.combinedWith(ledLookup.requirements(bond.getSecurityId(), bond.getLegalEntityId(), bond.getCurrency()));<NEW_LINE>}<NEW_LINE>BondFutureOptionMarketDataLookup optionLookup = parameters.getParameter(BondFutureOptionMarketDataLookup.class);<NEW_LINE>FunctionRequirements optionReqs = optionLookup.requirements(future.getSecurityId());<NEW_LINE>return freqs.combinedWith(optionReqs);<NEW_LINE>}
BondFutureOption option = target.getProduct();
1,372,582
protected ECCurve createCurve() {<NEW_LINE>BigInteger mod_p = fromHex("8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006F");<NEW_LINE>BigInteger mod_q = fromHex("800000000000000000000000000000000000000000000000000000000000000149A1EC142565A545ACFDB77BD9D40CFA8B996712101BEA0EC6346C54374F25BD");<NEW_LINE>return configureCurve(new ECCurve.Fp(mod_p, fromHex("8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C"), fromHex("687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116"), mod_q<MASK><NEW_LINE>}
, ECConstants.ONE, true));
1,258,791
public void write(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetStart()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetStop()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetStartKeyInclusive()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetStopKeyInclusive()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetInfiniteStartKey()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetInfiniteStopKey()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 6);<NEW_LINE>if (struct.isSetStart()) {<NEW_LINE>struct.start.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetStop()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetStartKeyInclusive()) {<NEW_LINE>oprot.writeBool(struct.startKeyInclusive);<NEW_LINE>}<NEW_LINE>if (struct.isSetStopKeyInclusive()) {<NEW_LINE>oprot.writeBool(struct.stopKeyInclusive);<NEW_LINE>}<NEW_LINE>if (struct.isSetInfiniteStartKey()) {<NEW_LINE>oprot.writeBool(struct.infiniteStartKey);<NEW_LINE>}<NEW_LINE>if (struct.isSetInfiniteStopKey()) {<NEW_LINE>oprot.writeBool(struct.infiniteStopKey);<NEW_LINE>}<NEW_LINE>}
struct.stop.write(oprot);
231,679
static List<Element> findSubElements(Element parent) throws IllegalArgumentException {<NEW_LINE>NodeList l = parent.getChildNodes();<NEW_LINE>List<Element> elements = new ArrayList<>(l.getLength());<NEW_LINE>for (int i = 0; i < l.getLength(); i++) {<NEW_LINE>Node n = l.item(i);<NEW_LINE>if (n.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>elements.add((Element) n);<NEW_LINE>} else if (n.getNodeType() == Node.TEXT_NODE) {<NEW_LINE>String text = ((<MASK><NEW_LINE>if (text.trim().length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("non-ws text encountered in " + parent + ": " + text);<NEW_LINE>}<NEW_LINE>} else if (n.getNodeType() == Node.COMMENT_NODE) {<NEW_LINE>// OK, ignore<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("unexpected non-element child of " + parent + ": " + n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return elements;<NEW_LINE>}
Text) n).getNodeValue();
297,659
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.impetus.kundera.query.QueryImpl#populateEntities(com.impetus.kundera<NEW_LINE>* .metadata.model.EntityMetadata, com.impetus.kundera.client.Client)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected List<Object> populateEntities(EntityMetadata m, Client client) {<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().<MASK><NEW_LINE>EntityType entity = metaModel.entity(m.getEntityClazz());<NEW_LINE>Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());<NEW_LINE>QueryBuilder filter = whereExpression == null || whereExpression instanceof NullExpression ? null : esFilterBuilder.populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m);<NEW_LINE>return ((ESClient) client).executeQuery(filter, buildAggregation(kunderaQuery, m, filter), m, getKunderaQuery(), this.firstResult, this.maxResult);<NEW_LINE>}
getMetamodel(m.getPersistenceUnit());
1,023,573
public static Object toJavaType(BsonValue value) {<NEW_LINE>switch(value.getBsonType()) {<NEW_LINE>case INT32:<NEW_LINE>return value.asInt32().getValue();<NEW_LINE>case INT64:<NEW_LINE>return value.asInt64().getValue();<NEW_LINE>case STRING:<NEW_LINE>return value.asString().getValue();<NEW_LINE>case DECIMAL128:<NEW_LINE>return value.asDecimal128().doubleValue();<NEW_LINE>case DOUBLE:<NEW_LINE>return value.asDouble().getValue();<NEW_LINE>case BOOLEAN:<NEW_LINE>return value.asBoolean().getValue();<NEW_LINE>case OBJECT_ID:<NEW_LINE>return value.asObjectId().getValue();<NEW_LINE>case DB_POINTER:<NEW_LINE>return new DBRef(value.asDBPointer().getNamespace(), value.<MASK><NEW_LINE>case BINARY:<NEW_LINE>return value.asBinary().getData();<NEW_LINE>case DATE_TIME:<NEW_LINE>return new Date(value.asDateTime().getValue());<NEW_LINE>case SYMBOL:<NEW_LINE>return value.asSymbol().getSymbol();<NEW_LINE>case ARRAY:<NEW_LINE>return value.asArray().toArray();<NEW_LINE>case DOCUMENT:<NEW_LINE>return Document.parse(value.asDocument().toJson());<NEW_LINE>default:<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}
asDBPointer().getId());
1,016,428
public boolean onTouchEvent(TextView widget, Spannable spannable, MotionEvent event) {<NEW_LINE>int action = event.getAction();<NEW_LINE>if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {<NEW_LINE>int x = (int) event.getX();<NEW_LINE>int y = (int) event.getY();<NEW_LINE>x -= widget.getTotalPaddingLeft();<NEW_LINE>y -= widget.getTotalPaddingTop();<NEW_LINE>x += widget.getScrollX();<NEW_LINE>y += widget.getScrollY();<NEW_LINE>Layout layout = widget.getLayout();<NEW_LINE>int line = layout.getLineForVertical(y);<NEW_LINE>int off = <MASK><NEW_LINE>ClickableSpan[] links = spannable.getSpans(off, off, ClickableSpan.class);<NEW_LINE>if (links.length != 0) {<NEW_LINE>ClickableSpan link = links[0];<NEW_LINE>if (action == MotionEvent.ACTION_UP) {<NEW_LINE>if (link instanceof ClickableSpan) {<NEW_LINE>link.onClick(widget);<NEW_LINE>}<NEW_LINE>} else if (action == MotionEvent.ACTION_DOWN) {<NEW_LINE>Selection.setSelection(spannable, spannable.getSpanStart(link), spannable.getSpanEnd(link));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>Selection.removeSelection(spannable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.onTouchEvent(widget, spannable, event);<NEW_LINE>}
layout.getOffsetForHorizontal(line, x);
558,091
public void execute(EditorAdaptor editorAdaptor) throws CommandExecutionException {<NEW_LINE>UserInterfaceService interfaceService = editorAdaptor.getUserInterfaceService();<NEW_LINE>IWorkbenchPartSite site = getEditorSite();<NEW_LINE>EPartService psvc = (EPartService) site.getService(EPartService.class);<NEW_LINE>MPartStack stack = findAdjacentStack(site, direction);<NEW_LINE>MPart p = (MPart) site.getService(MPart.class);<NEW_LINE>MElementContainer<MUIElement> editorStack = p.getParent();<NEW_LINE>if (stack == null) {<NEW_LINE>interfaceService.setErrorMessage("Couldn't find a split to move into");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mode == SplitMode.CLONE) {<NEW_LINE>try {<NEW_LINE>MPart newPart = cloneEditor();<NEW_LINE>stack.getChildren().add(newPart);<NEW_LINE>// Temporary activate the cloned editor.<NEW_LINE>psvc.activate(p);<NEW_LINE>p = newPart;<NEW_LINE>} catch (PartInitException e) {<NEW_LINE>interfaceService.setErrorMessage("Unable to split editor");<NEW_LINE>VrapperLog.error("Unable to split editor", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>editorStack.getChildren().remove(p);<NEW_LINE>if (editorStack.getChildren().size() > 0) {<NEW_LINE>// Deactivate this tab by activating preceding tab in the current stack.<NEW_LINE>psvc.activate((MPart) editorStack.getSelectedElement());<NEW_LINE>} else {<NEW_LINE>// Temporary activate the split this tab is moving into<NEW_LINE>psvc.activate((MPart) stack.getSelectedElement());<NEW_LINE>}<NEW_LINE>stack.getChildren().add(p);<NEW_LINE>}<NEW_LINE>// Activate the moved part.<NEW_LINE><MASK><NEW_LINE>}
psvc.activate(p, true);
838,210
public void reload() {<NEW_LINE>// remove deleting clients.<NEW_LINE>deletingClients.forEach(client -> {<NEW_LINE>try {<NEW_LINE>client.close();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.error("close client failed, got InterruptedException" + e.getMessage(), e);<NEW_LINE>} catch (ProducerException e) {<NEW_LINE>LOG.error("close client failed, got ProducerException" + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SortTaskConfig newSortTaskConfig = SortClusterConfigHolder.getTaskConfig(taskName);<NEW_LINE>if (this.sortTaskConfig != null && this.sortTaskConfig.equals(newSortTaskConfig)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.info("get new SortTaskConfig:taskName:{}:config:{}", taskName, JSON.toJSONString(newSortTaskConfig));<NEW_LINE>this.sortTaskConfig = newSortTaskConfig;<NEW_LINE>this.sinkContext = new Context(<MASK><NEW_LINE>this.reloadIdParams();<NEW_LINE>this.reloadClients();<NEW_LINE>this.reloadHandler();<NEW_LINE>this.keywordMaxLength = sinkContext.getInteger(KEY_MAX_KEYWORD_LENGTH, DEFAULT_KEYWORD_MAX_LENGTH);<NEW_LINE>}
this.sortTaskConfig.getSinkParams());
472,440
private static List<Gauge> addCounterSuffixesIfAndWhereNeeded(List<Gauge> gauges) {<NEW_LINE>Set<String> nonCounterGaugeNames = Sets.newHashSet();<NEW_LINE>for (Gauge gauge : gauges) {<NEW_LINE>if (!gauge.counter()) {<NEW_LINE>nonCounterGaugeNames.add(gauge.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Gauge> updatedGauges = Lists.newArrayList();<NEW_LINE>for (Gauge gauge : gauges) {<NEW_LINE>if (gauge.counter() && nonCounterGaugeNames.contains(gauge.name().substring(0, gauge.name().length() - "[counter]".length()))) {<NEW_LINE>List<String> displayParts = Lists.newArrayList(gauge.displayParts());<NEW_LINE>displayParts.set(displayParts.size() - 1, displayParts.get(displayParts.size() - 1) + " (Counter)");<NEW_LINE>updatedGauges.add(ImmutableGauge.builder().copyFrom(gauge).display(gauge.display() + " (Counter)").displayParts<MASK><NEW_LINE>} else {<NEW_LINE>updatedGauges.add(gauge);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return updatedGauges;<NEW_LINE>}
(displayParts).build());
238,417
protected void checkType(_Fields setField, Object value) throws ClassCastException {<NEW_LINE>switch(setField) {<NEW_LINE>case FIELDS:<NEW_LINE>if (value instanceof List) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type List<String> for field 'fields', but got " + value.getClass().getSimpleName());<NEW_LINE>case SHUFFLE:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'shuffle', but got " + value.getClass().getSimpleName());<NEW_LINE>case ALL:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'all', but got " + value.<MASK><NEW_LINE>case NONE:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'none', but got " + value.getClass().getSimpleName());<NEW_LINE>case DIRECT:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'direct', but got " + value.getClass().getSimpleName());<NEW_LINE>case CUSTOM_OBJECT:<NEW_LINE>if (value instanceof JavaObject) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type JavaObject for field 'custom_object', but got " + value.getClass().getSimpleName());<NEW_LINE>case CUSTOM_SERIALIZED:<NEW_LINE>if (value instanceof ByteBuffer) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type ByteBuffer for field 'custom_serialized', but got " + value.getClass().getSimpleName());<NEW_LINE>case LOCAL_OR_SHUFFLE:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'local_or_shuffle', but got " + value.getClass().getSimpleName());<NEW_LINE>case LOCAL_FIRST:<NEW_LINE>if (value instanceof NullStruct) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>throw new ClassCastException("Was expecting value of type NullStruct for field 'localFirst', but got " + value.getClass().getSimpleName());<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown field id " + setField);<NEW_LINE>}<NEW_LINE>}
getClass().getSimpleName());
492,172
final SearchSkillGroupsResult executeSearchSkillGroups(SearchSkillGroupsRequest searchSkillGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchSkillGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchSkillGroupsRequest> request = null;<NEW_LINE>Response<SearchSkillGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchSkillGroupsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SearchSkillGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchSkillGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchSkillGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(searchSkillGroupsRequest));
1,215,284
protected ProcessInstanceBatchMigrationPartResult convertFromBatchPart(BatchPart batchPart, ObjectMapper objectMapper) {<NEW_LINE>ProcessInstanceBatchMigrationPartResult partResult = new ProcessInstanceBatchMigrationPartResult();<NEW_LINE>partResult.setBatchId(batchPart.getId());<NEW_LINE>partResult.setProcessInstanceId(batchPart.getScopeId());<NEW_LINE>partResult.setSourceProcessDefinitionId(batchPart.getBatchSearchKey());<NEW_LINE>partResult.setTargetProcessDefinitionId(batchPart.getBatchSearchKey2());<NEW_LINE>if (batchPart.getCompleteTime() != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>partResult.setResult(batchPart.getStatus());<NEW_LINE>ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();<NEW_LINE>if (ProcessInstanceBatchMigrationResult.RESULT_FAIL.equals(batchPart.getStatus()) && batchPart.getResultDocumentJson(processEngineConfiguration.getEngineCfgKey()) != null) {<NEW_LINE>try {<NEW_LINE>JsonNode resultNode = objectMapper.readTree(batchPart.getResultDocumentJson(processEngineConfiguration.getEngineCfgKey()));<NEW_LINE>if (resultNode.has(BATCH_RESULT_MESSAGE_LABEL)) {<NEW_LINE>String resultMessage = resultNode.get(BATCH_RESULT_MESSAGE_LABEL).asText();<NEW_LINE>partResult.setMigrationMessage(resultMessage);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new FlowableException("Error reading batch part " + batchPart.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return partResult;<NEW_LINE>}
partResult.setStatus(ProcessInstanceBatchMigrationResult.STATUS_COMPLETED);
360,461
public static BufferedImage renderLimit(GrayF32 intensity, SelectLimitTypes type) {<NEW_LINE>// Configure how it will select features inside the intensity image<NEW_LINE>var limit = new ConfigSelectLimit(type, 0xBEEF);<NEW_LINE>NonMaxLimiter nonmax = FactoryFeatureExtractor.nonmaxLimiter(new ConfigExtract(NON_MAX_RADIUS, 0), limit, MAX_FEATURES);<NEW_LINE>// Detect the features<NEW_LINE>nonmax.process(intensity);<NEW_LINE>FastAccess<LocalExtreme> features = nonmax.getFeatures();<NEW_LINE>// Visualize the intensity image<NEW_LINE>var output = new BufferedImage(intensity.width, intensity.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>VisualizeImageData.colorizeSign(intensity, output, -1);<NEW_LINE>// render each selected maximum with a circle<NEW_LINE>Graphics2D g2 = output.createGraphics();<NEW_LINE>g2.setColor(Color.blue);<NEW_LINE>for (int i = 0; i < features.size(); i++) {<NEW_LINE>LocalExtreme <MASK><NEW_LINE>VisualizeFeatures.drawCircle(g2, c.location.x, c.location.y, NON_MAX_RADIUS);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
c = features.get(i);
680,821
private // <String, Sequence<String>><NEW_LINE>void // <String, Sequence<String>><NEW_LINE>parseManagedDirectories(Map<String, ?> managedDirectories) throws EvalException {<NEW_LINE>Map<PathFragment, String> nonNormalizedPathsMap = Maps.newHashMap();<NEW_LINE>for (Map.Entry<String, ?> entry : managedDirectories.entrySet()) {<NEW_LINE>RepositoryName repositoryName = createRepositoryName(entry.getKey());<NEW_LINE>List<PathFragment> paths = getManagedDirectoriesPaths(entry.getValue(), nonNormalizedPathsMap);<NEW_LINE>for (PathFragment dir : paths) {<NEW_LINE>PathFragment floorKey = managedDirectoriesMap.floorKey(dir);<NEW_LINE>if (dir.equals(floorKey)) {<NEW_LINE>throw Starlark.errorf("managed_directories attribute should not contain multiple" + " (or duplicate) repository mappings for the same directory ('%s').", nonNormalizedPathsMap.get(dir));<NEW_LINE>}<NEW_LINE>PathFragment <MASK><NEW_LINE>boolean isDescendant = floorKey != null && dir.startsWith(floorKey);<NEW_LINE>if (isDescendant || (ceilingKey != null && ceilingKey.startsWith(dir))) {<NEW_LINE>throw Starlark.errorf("managed_directories attribute value can not contain nested mappings." + " '%s' is a descendant of '%s'.", nonNormalizedPathsMap.get(isDescendant ? dir : ceilingKey), nonNormalizedPathsMap.get(isDescendant ? floorKey : dir));<NEW_LINE>}<NEW_LINE>managedDirectoriesMap.put(dir, repositoryName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ceilingKey = managedDirectoriesMap.ceilingKey(dir);
1,064,696
public <B extends Buffer> B createBuffer(long index) {<NEW_LINE>BytePointer ptr = tensor_data();<NEW_LINE>long size = TotalBytes();<NEW_LINE>switch(dtype()) {<NEW_LINE>case DT_COMPLEX64:<NEW_LINE>case DT_FLOAT:<NEW_LINE>return (B) new FloatPointer(ptr).position(index).capacity(size / 4).asBuffer();<NEW_LINE>case DT_DOUBLE:<NEW_LINE>return (B) new DoublePointer(ptr).position(index).capacity(size / 8).asBuffer();<NEW_LINE>case DT_QINT32:<NEW_LINE>case DT_INT32:<NEW_LINE>return (B) new IntPointer(ptr).position(index).capacity(size / 4).asBuffer();<NEW_LINE>case DT_BOOL:<NEW_LINE>case DT_QUINT8:<NEW_LINE>case DT_UINT8:<NEW_LINE>case DT_QINT8:<NEW_LINE>case DT_INT8:<NEW_LINE>return (B) ptr.position(index).capacity(size).asBuffer();<NEW_LINE>case DT_BFLOAT16:<NEW_LINE>case DT_INT16:<NEW_LINE>return (B) new ShortPointer(ptr).position(index).capacity(<MASK><NEW_LINE>case DT_INT64:<NEW_LINE>return (B) new LongPointer(ptr).position(index).capacity(size / 8).asBuffer();<NEW_LINE>case DT_STRING:<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
size / 2).asBuffer();
612,650
private int writeIndirectArrayLayout(DebugContext context, ArrayTypeEntry arrayTypeEntry, int size, int layoutOffset, byte[] buffer, int p) {<NEW_LINE>int pos = p;<NEW_LINE>log(context, " [0x%08x] indirect class layout", pos);<NEW_LINE>int abbrevCode = DwarfDebugInfo.DW_ABBREV_CODE_indirect_layout;<NEW_LINE>log(context, " [0x%08x] <1> Abbrev Number %d", pos, abbrevCode);<NEW_LINE>pos = writeAbbrevCode(abbrevCode, buffer, pos);<NEW_LINE>String name = arrayTypeEntry.getTypeName();<NEW_LINE>String indirectName = uniqueDebugString(DwarfDebugInfo.INDIRECT_PREFIX + name);<NEW_LINE>log(context, " [0x%08x] name 0x%x (%s)", pos, debugStringIndex(indirectName), name);<NEW_LINE>pos = writeAttrStrp(indirectName, buffer, pos);<NEW_LINE>log(context, " [0x%08x] byte_size 0x%x", pos, size);<NEW_LINE>pos = writeAttrData2((short) size, buffer, pos);<NEW_LINE>pos = writeSuperReference(context, <MASK><NEW_LINE>return writeAttrNull(buffer, pos);<NEW_LINE>}
layoutOffset, name, buffer, pos);
1,284,344
public BinaryColumnStatisticsData unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BinaryColumnStatisticsData binaryColumnStatisticsData = new BinaryColumnStatisticsData();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("MaximumLength", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>binaryColumnStatisticsData.setMaximumLength(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AverageLength", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>binaryColumnStatisticsData.setAverageLength(context.getUnmarshaller(Double.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NumberOfNulls", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>binaryColumnStatisticsData.setNumberOfNulls(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return binaryColumnStatisticsData;<NEW_LINE>}
class).unmarshall(context));
1,396,396
public Collection<PluginGroupsFilter> processResults(ResultSet set) throws SQLException {<NEW_LINE>Map<ProviderIdentifier, List<String>> byProvider = new HashMap<>();<NEW_LINE>while (set.next()) {<NEW_LINE>String plugin = set.getString("plugin_name");<NEW_LINE>String provider = set.getString("provider_name");<NEW_LINE>ServerUUID serverUUID = ServerUUID.fromString<MASK><NEW_LINE>ProviderIdentifier identifier = new ProviderIdentifier(serverUUID, plugin, provider);<NEW_LINE>identifier.setServerName(Server.getIdentifiableName(set.getString("server_name"), set.getInt("server_id")));<NEW_LINE>String group = set.getString("group_name");<NEW_LINE>List<String> groups = byProvider.getOrDefault(identifier, new ArrayList<>());<NEW_LINE>groups.add(group);<NEW_LINE>byProvider.put(identifier, groups);<NEW_LINE>}<NEW_LINE>List<PluginGroupsFilter> filters = new ArrayList<>();<NEW_LINE>for (Map.Entry<ProviderIdentifier, List<String>> groupsOfProvider : byProvider.entrySet()) {<NEW_LINE>filters.add(new PluginGroupsFilter(dbSystem, groupsOfProvider.getKey(), groupsOfProvider.getValue()));<NEW_LINE>}<NEW_LINE>return filters;<NEW_LINE>}
(set.getString("server_uuid"));
1,067,361
private void correctAfterRotation() throws Exception {<NEW_LINE>Log.d(TAG, "correctAfterRotation");<NEW_LINE>canvas.waitUntilInflated();<NEW_LINE>// Its quite common to see NullPointerExceptions here when this function is called<NEW_LINE>// at the point of disconnection. Hence, we catch and ignore the error.<NEW_LINE>float oldScale = canvas.canvasZoomer.getZoomFactor();<NEW_LINE>int x = canvas.absoluteXPosition;<NEW_LINE>int y = canvas.absoluteYPosition;<NEW_LINE>canvas.<MASK><NEW_LINE>float newScale = canvas.canvasZoomer.getZoomFactor();<NEW_LINE>canvas.canvasZoomer.changeZoom(this, oldScale / newScale, 0, 0);<NEW_LINE>newScale = canvas.canvasZoomer.getZoomFactor();<NEW_LINE>if (newScale <= oldScale && canvas.canvasZoomer.getScaleType() != ImageView.ScaleType.FIT_CENTER) {<NEW_LINE>canvas.absoluteXPosition = x;<NEW_LINE>canvas.absoluteYPosition = y;<NEW_LINE>canvas.resetScroll();<NEW_LINE>}<NEW_LINE>// Automatic resolution update request handling<NEW_LINE>if (canvas.isVnc && connection.getRdpResType() == Constants.VNC_GEOM_SELECT_AUTOMATIC) {<NEW_LINE>canvas.rfbconn.requestResolution(canvas.getWidth(), canvas.getHeight());<NEW_LINE>} else if (canvas.isOpaque && connection.isRequestingNewDisplayResolution()) {<NEW_LINE>canvas.spicecomm.requestResolution(canvas.getWidth(), canvas.getHeight());<NEW_LINE>}<NEW_LINE>}
canvasZoomer.setScaleTypeForActivity(RemoteCanvasActivity.this);
896,153
private void upgrade(Channel channel, NettyResponseFuture<?> future, WebSocketUpgradeHandler handler, HttpResponse response, HttpHeaders responseHeaders) throws Exception {<NEW_LINE>boolean validStatus = response.status().equals(SWITCHING_PROTOCOLS);<NEW_LINE>boolean validUpgrade = response.headers(<MASK><NEW_LINE>String connection = response.headers().get(CONNECTION);<NEW_LINE>boolean validConnection = HttpHeaderValues.UPGRADE.contentEqualsIgnoreCase(connection);<NEW_LINE>final boolean headerOK = handler.onHeadersReceived(responseHeaders) == State.CONTINUE;<NEW_LINE>if (!headerOK || !validStatus || !validUpgrade || !validConnection) {<NEW_LINE>requestSender.abort(channel, future, new IOException("Invalid handshake response"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String accept = response.headers().get(SEC_WEBSOCKET_ACCEPT);<NEW_LINE>String key = getAcceptKey(future.getNettyRequest().getHttpRequest().headers().get(SEC_WEBSOCKET_KEY));<NEW_LINE>if (accept == null || !accept.equals(key)) {<NEW_LINE>requestSender.abort(channel, future, new IOException("Invalid challenge. Actual: " + accept + ". Expected: " + key));<NEW_LINE>}<NEW_LINE>// set back the future so the protocol gets notified of frames<NEW_LINE>// removing the HttpClientCodec from the pipeline might trigger a read with a WebSocket message<NEW_LINE>// if it comes in the same frame as the HTTP Upgrade response<NEW_LINE>Channels.setAttribute(channel, future);<NEW_LINE>handler.setWebSocket(new NettyWebSocket(channel, responseHeaders));<NEW_LINE>channelManager.upgradePipelineForWebSockets(channel.pipeline());<NEW_LINE>// We don't need to synchronize as replacing the "ws-decoder" will<NEW_LINE>// process using the same thread.<NEW_LINE>try {<NEW_LINE>handler.onOpen();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warn("onSuccess unexpected exception", ex);<NEW_LINE>}<NEW_LINE>future.done();<NEW_LINE>}
).get(UPGRADE) != null;
70,286
public void run() {<NEW_LINE>if (isCancelled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>progressMonitor.setIndeterminate(true);<NEW_LINE>progressMonitor.setProgress(0);<NEW_LINE>List<Content> dataSources = new ArrayList<>();<NEW_LINE>List<String> errorMessages = new ArrayList<>();<NEW_LINE>boolean criticalErrorOccurred = false;<NEW_LINE>try {<NEW_LINE>Image dataSource = addImageToCase();<NEW_LINE>dataSources.add(dataSource);<NEW_LINE>volatilityProcessor = new VolatilityProcessor(memoryImagePath, dataSource, profile, pluginsToRun, progressMonitor);<NEW_LINE>volatilityProcessor.run();<NEW_LINE>} catch (NoCurrentCaseException | TskCoreException | VolatilityProcessor.VolatilityProcessorException ex) {<NEW_LINE>criticalErrorOccurred = true;<NEW_LINE>errorMessages.add(Bundle.AddMemoryImageTask_errorMessage_criticalException(ex.getLocalizedMessage()));<NEW_LINE>logger.log(Level.SEVERE, String.format("Critical error processing memory image data source at %s for device %s", memoryImagePath, deviceId), ex);<NEW_LINE>}<NEW_LINE>errorMessages.addAll(volatilityProcessor.getErrorMessages());<NEW_LINE>progressMonitor.setProgress(100);<NEW_LINE>DataSourceProcessorCallback.DataSourceProcessorResult result;<NEW_LINE>if (criticalErrorOccurred) {<NEW_LINE>result = DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS;<NEW_LINE>} else if (!errorMessages.isEmpty()) {<NEW_LINE>result = DataSourceProcessorCallback.DataSourceProcessorResult.NONCRITICAL_ERRORS;<NEW_LINE>} else {<NEW_LINE>result = DataSourceProcessorCallback.DataSourceProcessorResult.NO_ERRORS;<NEW_LINE>}<NEW_LINE>callback.<MASK><NEW_LINE>}
done(result, errorMessages, dataSources);
1,673,519
private void deleteParagraphCheck() {<NEW_LINE><MASK><NEW_LINE>// Was the deleted paragraph in the viewport ?<NEW_LINE>if (p >= area.firstVisibleParToAllParIndex() && p <= area.lastVisibleParToAllParIndex()) {<NEW_LINE>int col = area.getCaretColumn();<NEW_LINE>// Delete was pressed on an empty paragraph, and so the cursor is now at the start of the next paragraph.<NEW_LINE>if (col == 0) {<NEW_LINE>// Check if the now current paragraph is folded.<NEW_LINE>if (area.getParagraph(p).getParagraphStyle().isFolded()) {<NEW_LINE>// Adjust to previous paragraph.<NEW_LINE>p = Math.max(p - 1, 0);<NEW_LINE>// Show fold/unfold indicator on previous paragraph.<NEW_LINE>area.recreateParagraphGraphic(p);<NEW_LINE>// Move cursor to previous paragraph.<NEW_LINE>area.moveTo(p, 0);<NEW_LINE>}<NEW_LINE>} else // Backspace was pressed on an empty paragraph, and so the cursor is now at the end of the previous paragraph.<NEW_LINE>if (col == area.getParagraph(p).length()) {<NEW_LINE>// Shows fold/unfold indicator on current paragraph if needed.<NEW_LINE>area.recreateParagraphGraphic(p);<NEW_LINE>}<NEW_LINE>// In all other cases the paragraph graphic is created/updated automatically.<NEW_LINE>}<NEW_LINE>}
int p = area.getCurrentParagraph();
813,054
public static FileCollection generatePathingJar(final Project project, final String taskName, final FileCollection classpath, boolean alwaysUsePathingJar) throws IOException {<NEW_LINE>// There is a bug in the Scala nsc compiler that does not parse the dependencies of JARs in the JAR manifest<NEW_LINE>// As such, we disable pathing for any libraries compiling docs for Scala resources<NEW_LINE>if (!alwaysUsePathingJar && !classpath.filter(f -> f.getAbsolutePath().contains("restli-tools-scala")).isEmpty()) {<NEW_LINE>LOG.info("Compiling Scala resource classes. Disabling pathing jar for " + taskName + " to avoid breaking Scala compilation");<NEW_LINE>return classpath;<NEW_LINE>}<NEW_LINE>// We extract the classpath from the target task here, in the configuration phase<NEW_LINE>// Note that we don't invoke getFiles() here because that would trigger dependency resolution in configuration phase<NEW_LINE>FileCollection filteredClasspath = classpath.filter(f -> !f.isDirectory());<NEW_LINE>File destinationDir = new File(project.getBuildDir(), taskName);<NEW_LINE>destinationDir.mkdirs();<NEW_LINE>File pathingJarPath = new File(destinationDir, project.getName() + "-pathing.jar");<NEW_LINE>OutputStream pathingJar = new FileOutputStream(pathingJarPath);<NEW_LINE>// Classpath manifest does not support directories and needs to contain relative paths<NEW_LINE>String cp = ClasspathManifest.relativeClasspathManifest(<MASK><NEW_LINE>// Create the JAR<NEW_LINE>Manifest manifest = new Manifest();<NEW_LINE>manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");<NEW_LINE>manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, cp);<NEW_LINE>JarOutputStream jarOutputStream = new JarOutputStream(pathingJar, manifest);<NEW_LINE>jarOutputStream.close();<NEW_LINE>return classpath.filter(File::isDirectory).plus(project.files(pathingJarPath));<NEW_LINE>}
destinationDir, filteredClasspath.getFiles());
1,625,175
final CreateLicenseVersionResult executeCreateLicenseVersion(CreateLicenseVersionRequest createLicenseVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLicenseVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLicenseVersionRequest> request = null;<NEW_LINE>Response<CreateLicenseVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLicenseVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLicenseVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLicenseVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLicenseVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLicenseVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,183,866
private void parseSerializationDescriptorObject(Map<String, Object> data, boolean lambdaCapturingType) {<NEW_LINE>if (lambdaCapturingType) {<NEW_LINE>checkAttributes(data, "serialization descriptor object", Collections.singleton(NAME_KEY), Collections.singleton(CONDITIONAL_KEY));<NEW_LINE>} else {<NEW_LINE>checkAttributes(data, "serialization descriptor object", Collections.singleton(NAME_KEY), Arrays.asList(CUSTOM_TARGET_CONSTRUCTOR_CLASS_KEY, CONDITIONAL_KEY));<NEW_LINE>}<NEW_LINE>ConfigurationCondition unresolvedCondition = parseCondition(data);<NEW_LINE>String targetSerializationClass = asString(data.get(NAME_KEY));<NEW_LINE>if (lambdaCapturingType) {<NEW_LINE>serializationSupport.registerLambdaCapturingClass(unresolvedCondition, targetSerializationClass);<NEW_LINE>} else {<NEW_LINE>Object optionalCustomCtorValue = data.get(CUSTOM_TARGET_CONSTRUCTOR_CLASS_KEY);<NEW_LINE>String customTargetConstructorClass = optionalCustomCtorValue != <MASK><NEW_LINE>serializationSupport.registerWithTargetConstructorClass(unresolvedCondition, targetSerializationClass, customTargetConstructorClass);<NEW_LINE>}<NEW_LINE>}
null ? asString(optionalCustomCtorValue) : null;
1,508,323
public static void main(String[] args) throws Exception {<NEW_LINE>GImageFormat format = GImageFormat.GRAY_ALPHA_2BYTE;<NEW_LINE>String img = "~/Mobile_Devices/images/apple_logo_line_1.PNG";<NEW_LINE>String raw = "~/Mobile_Devices/images/apple_logo_line_1.RAW";<NEW_LINE>File imageFile = new File(img);<NEW_LINE>GImageConverter converter = new GImageConverter(imageFile);<NEW_LINE>byte[] imageBytes = converter.toBufferedImage();<NEW_LINE><MASK><NEW_LINE>rawOUT.write(imageBytes);<NEW_LINE>rawOUT.close();<NEW_LINE>File rawFile = new File(raw);<NEW_LINE>InputStream rawIN = new FileInputStream(raw);<NEW_LINE>GImage image = new GImage(converter.getWidth(), converter.getHeight(), format, rawIN, rawFile.length());<NEW_LINE>rawIN.close();<NEW_LINE>final Icon icon = image.toPNG();<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>JOptionPane.showMessageDialog(null, icon, "icon", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
OutputStream rawOUT = new FileOutputStream(raw);
1,391,924
protected void configure() {<NEW_LINE>bind(ManufOrderRepository.class).to(ManufOrderManagementRepository.class);<NEW_LINE>bind(OperationOrderRepository.class).to(OperationOrderManagementRepository.class);<NEW_LINE>bind(ProductionOrderService.class).to(ProductionOrderServiceImpl.class);<NEW_LINE>bind(BillOfMaterialService.class).to(BillOfMaterialServiceImpl.class);<NEW_LINE>bind(ManufOrderService.class).to(ManufOrderServiceImpl.class);<NEW_LINE>bind(OperationOrderService.class).to(OperationOrderServiceImpl.class);<NEW_LINE>bind(ProductionOrderService.class<MASK><NEW_LINE>bind(ProductionOrderWizardService.class).to(ProductionOrderWizardServiceImpl.class);<NEW_LINE>bind(ProductionOrderSaleOrderService.class).to(ProductionOrderSaleOrderServiceImpl.class);<NEW_LINE>bind(MrpLineServiceImpl.class).to(MrpLineServiceProductionImpl.class);<NEW_LINE>bind(MrpServiceImpl.class).to(MrpServiceProductionImpl.class);<NEW_LINE>bind(CostSheetService.class).to(CostSheetServiceImpl.class);<NEW_LINE>bind(CostSheetLineService.class).to(CostSheetLineServiceImpl.class);<NEW_LINE>bind(SaleOrderWorkflowServiceSupplychainImpl.class).to(SaleOrderWorkflowServiceProductionImpl.class);<NEW_LINE>bind(StockRulesServiceSupplychainImpl.class).to(StockRulesServiceProductionImpl.class);<NEW_LINE>bind(BillOfMaterialRepository.class).to(BillOfMaterialManagementRepository.class);<NEW_LINE>bind(StockConfigService.class).to(StockConfigProductionService.class);<NEW_LINE>bind(ConfiguratorBomService.class).to(ConfiguratorBomServiceImpl.class);<NEW_LINE>bind(ConfiguratorProdProcessService.class).to(ConfiguratorProdProcessServiceImpl.class);<NEW_LINE>bind(ConfiguratorProdProcessLineService.class).to(ConfiguratorProdProcessLineServiceImpl.class);<NEW_LINE>bind(ConfiguratorServiceImpl.class).to(ConfiguratorServiceProductionImpl.class);<NEW_LINE>bind(AppProductionService.class).to(AppProductionServiceImpl.class);<NEW_LINE>bind(ProdProcessRepository.class).to(ProdProcessManagementRepository.class);<NEW_LINE>bind(StockMoveLineSupplychainRepository.class).to(StockMoveLineProductionRepository.class);<NEW_LINE>bind(ProdProcessLineService.class).to(ProdProcessLineServiceImpl.class);<NEW_LINE>bind(StockMoveServiceSupplychainImpl.class).to(StockMoveProductionServiceImpl.class);<NEW_LINE>bind(ProdProductRepository.class).to(ProdProductProductionRepository.class);<NEW_LINE>bind(RawMaterialRequirementService.class).to(RawMaterialRequirementServiceImpl.class);<NEW_LINE>bind(RawMaterialRequirementRepository.class).to(RawMaterialRequirementProductionRepository.class);<NEW_LINE>bind(ProductionBatchRepository.class).to(ProductionBatchManagementRepository.class);<NEW_LINE>bind(UnitCostCalculationRepository.class).to(UnitCostCalculationManagementRepository.class);<NEW_LINE>bind(UnitCostCalculationService.class).to(UnitCostCalculationServiceImpl.class);<NEW_LINE>bind(UnitCostCalcLineService.class).to(UnitCostCalcLineServiceImpl.class);<NEW_LINE>bind(ProductStockRepository.class).to(ProductProductionRepository.class);<NEW_LINE>bind(ConfiguratorCreatorImportServiceImpl.class).to(ConfiguratorCreatorImportServiceProductionImpl.class);<NEW_LINE>bind(ProductStockLocationServiceImpl.class).to(ProductionProductStockLocationServiceImpl.class);<NEW_LINE>bind(StockMoveSupplychainRepository.class).to(StockMoveProductionRepository.class);<NEW_LINE>bind(ManufOrderPrintService.class).to(ManufOrderPrintServiceImpl.class);<NEW_LINE>bind(MrpForecastProductionService.class).to(MrpForecastProductionServiceImpl.class);<NEW_LINE>bind(MpsWeeklyScheduleService.class).to(MpsWeeklyScheduleServiceImpl.class);<NEW_LINE>bind(MpsChargeService.class).to(MpsChargeServiceImpl.class);<NEW_LINE>bind(MachineRepository.class).to(MachineToolManagementRepository.class);<NEW_LINE>bind(PurchaseOrderServiceSupplychainImpl.class).to(PurchaseOrderServiceProductionImpl.class);<NEW_LINE>bind(SopService.class).to(SopServiceImpl.class);<NEW_LINE>}
).to(ProductionOrderServiceImpl.class);
963,824
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select window(id) as ids from SupportEventWithLongArray#groupwin(coll)#lastevent";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E1", new long[] { 1, 2 }, "E1");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E2", new long<MASK><NEW_LINE>sendAssertLongArrayIdWindow(env, "E3", new long[] {}, "E1,E2,E3");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E4", null, "E1,E2,E3,E4");<NEW_LINE>env.milestone(0);<NEW_LINE>sendAssertLongArrayIdWindow(env, "E10", new long[] { 1 }, "E1,E3,E4,E10");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E11", new long[] {}, "E1,E4,E10,E11");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E12", new long[] { 1, 2 }, "E4,E10,E11,E12");<NEW_LINE>sendAssertLongArrayIdWindow(env, "E13", null, "E10,E11,E12,E13");<NEW_LINE>env.undeployAll();<NEW_LINE>}
[] { 1 }, "E1,E2");
1,262,735
public void save(@NonNull final SecurPharmProduct product) {<NEW_LINE>I_M_Securpharm_Productdata_Result record = null;<NEW_LINE>if (product.getId() != null) {<NEW_LINE>record = load(product.getId(), I_M_Securpharm_Productdata_Result.class);<NEW_LINE>}<NEW_LINE>if (record == null) {<NEW_LINE>record = newInstance(I_M_Securpharm_Productdata_Result.class);<NEW_LINE>}<NEW_LINE>record.setIsError(product.isError());<NEW_LINE>record.setLastResultCode(product.getResultCode());<NEW_LINE>record.setLastResultMessage(product.getResultMessage());<NEW_LINE>record.setM_HU_ID(product.getHuId().getRepoId());<NEW_LINE>//<NEW_LINE>// Product data<NEW_LINE>final ProductDetails productDetails = product.getProductDetails();<NEW_LINE>record.setExpirationDate(productDetails != null ? productDetails.getExpirationDate().toTimestamp() : null);<NEW_LINE>record.setLotNumber(productDetails != null ? productDetails.getLot() : null);<NEW_LINE>record.setProductCode(productDetails != null ? productDetails.getProductCode() : null);<NEW_LINE>record.setProductCodeType(productDetails != null ? productDetails.getProductCodeType().name() : null);<NEW_LINE>record.setSerialNumber(productDetails != null ? <MASK><NEW_LINE>record.setActiveStatus(productDetails != null ? productDetails.getActiveStatus().toYesNoString() : null);<NEW_LINE>record.setInactiveReason(productDetails != null ? productDetails.getInactiveReason() : null);<NEW_LINE>record.setIsDecommissioned(productDetails != null ? productDetails.isDecommissioned() : false);<NEW_LINE>record.setDecommissionedServerTransactionId(productDetails != null ? productDetails.getDecommissionedServerTransactionId() : null);<NEW_LINE>saveRecord(record);<NEW_LINE>final SecurPharmProductId productId = SecurPharmProductId.ofRepoId(record.getM_Securpharm_Productdata_Result_ID());<NEW_LINE>product.setId(productId);<NEW_LINE>}
productDetails.getSerialNumber() : null);
586,969
static org.batfish.datamodel.eigrp.EigrpProcess toEigrpProcess(EigrpProcess proc, String vrfName, Configuration c, CiscoConfiguration oldConfig) {<NEW_LINE>org.batfish.datamodel.eigrp.EigrpProcess.Builder newProcess = org.batfish.datamodel.eigrp.EigrpProcess.builder();<NEW_LINE>if (proc.getAsn() == null) {<NEW_LINE>oldConfig.getWarnings().redFlag("Invalid EIGRP process");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (firstNonNull(proc.getShutdown(), Boolean.FALSE)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>newProcess.setAsNumber(proc.getAsn());<NEW_LINE>newProcess.setMode(proc.getMode());<NEW_LINE>// TODO set stub process<NEW_LINE>// newProcess.setStub(proc.isStub())<NEW_LINE>// TODO create summary filters<NEW_LINE>// TODO originate default route if configured<NEW_LINE>Ip routerId = proc.getRouterId();<NEW_LINE>if (routerId == null) {<NEW_LINE>routerId = getHighestIp(oldConfig.getInterfaces());<NEW_LINE>if (routerId == Ip.ZERO) {<NEW_LINE>oldConfig.getWarnings().redFlag("No candidates for EIGRP (AS " + proc.getAsn() + ") router-id");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newProcess.setRouterId(routerId).setMetricVersion(EigrpMetricVersion.V1);<NEW_LINE>String redistributionPolicyName = "~EIGRP_EXPORT_POLICY:" + vrfName + ":" <MASK><NEW_LINE>RoutingPolicy redistributionPolicy = new RoutingPolicy(redistributionPolicyName, c);<NEW_LINE>c.getRoutingPolicies().put(redistributionPolicyName, redistributionPolicy);<NEW_LINE>newProcess.setRedistributionPolicy(redistributionPolicyName);<NEW_LINE>redistributionPolicy.getStatements().addAll(eigrpRedistributionPoliciesToStatements(proc.getRedistributionPolicies().values(), proc, oldConfig));<NEW_LINE>return newProcess.build();<NEW_LINE>}
+ proc.getAsn() + "~";
654,372
private void heartBeat() {<NEW_LINE>RequestHeader header = EventMeshClientUtil.buildHeader(clientConfig, EventMeshCommon.EM_MESSAGE_PROTOCOL_NAME);<NEW_LINE>scheduler.scheduleAtFixedRate(() -> {<NEW_LINE>if (subscriptionMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Heartbeat.Builder heartbeatBuilder = Heartbeat.newBuilder().setHeader(header).setConsumerGroup(clientConfig.getConsumerGroup()).setClientType(Heartbeat.ClientType.SUB);<NEW_LINE>for (Map.Entry<String, String> entry : subscriptionMap.entrySet()) {<NEW_LINE>Heartbeat.HeartbeatItem heartbeatItem = Heartbeat.HeartbeatItem.newBuilder().setTopic(entry.getKey()).setUrl(entry.getValue()).build();<NEW_LINE>heartbeatBuilder.addHeartbeatItems(heartbeatItem);<NEW_LINE>}<NEW_LINE>Heartbeat heartbeat = heartbeatBuilder.build();<NEW_LINE>try {<NEW_LINE>Response response = heartbeatClient.heartbeat(heartbeat);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Grpc Consumer Heartbeat response: {}", response);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(<MASK><NEW_LINE>}<NEW_LINE>}, 10000, EventMeshCommon.HEARTBEAT, TimeUnit.MILLISECONDS);<NEW_LINE>logger.info("Grpc Consumer Heartbeat started.");<NEW_LINE>}
"Error in sending out heartbeat. error {}", e.getMessage());
354,857
public void removeNodes(DeleteNodesRequest body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling removeNodes");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
localVarAccept, localVarContentType, localVarAuthNames, null);
970,396
public final Condition equal(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22) {<NEW_LINE>return compare(Comparator.EQUALS, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, <MASK><NEW_LINE>}
t19, t20, t21, t22);
810,353
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {<NEW_LINE>// Do not continue if proxy was released.<NEW_LINE>if (this.proxy == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create date object from selected hour and minute values.<NEW_LINE><MASK><NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);<NEW_LINE>calendar.set(Calendar.MINUTE, minute);<NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>Date dateValue = calendar.getTime();<NEW_LINE>// Update "value" property with selected time.<NEW_LINE>this.proxy.setProperty(TiC.PROPERTY_VALUE, calendar.getTime());<NEW_LINE>// Fire a "change" event.<NEW_LINE>if (!this.suppressChangeEvent) {<NEW_LINE>KrollDict data = new KrollDict();<NEW_LINE>data.put(TiC.PROPERTY_VALUE, calendar.getTime());<NEW_LINE>fireEvent(TiC.EVENT_CHANGE, data);<NEW_LINE>}<NEW_LINE>}
Calendar calendar = Calendar.getInstance();
924,929
private void populateFromSketch(final float[] srcItems, final int[] srcLevels, final int numLevels, final int numItems) {<NEW_LINE>final int offset = srcLevels[0];<NEW_LINE>System.arraycopy(srcItems, offset, items_, 0, numItems);<NEW_LINE>int srcLevel = 0;<NEW_LINE>int dstLevel = 0;<NEW_LINE>long weight = 1;<NEW_LINE>while (srcLevel < numLevels) {<NEW_LINE>final int fromIndex = srcLevels[srcLevel] - offset;<NEW_LINE>// exclusive<NEW_LINE>final int toIndex = srcLevels[srcLevel + 1] - offset;<NEW_LINE>if (fromIndex < toIndex) {<NEW_LINE>// if equal, skip empty level<NEW_LINE>Arrays.fill(<MASK><NEW_LINE>levels_[dstLevel] = fromIndex;<NEW_LINE>levels_[dstLevel + 1] = toIndex;<NEW_LINE>dstLevel++;<NEW_LINE>}<NEW_LINE>srcLevel++;<NEW_LINE>weight *= 2;<NEW_LINE>}<NEW_LINE>weights_[numItems] = 0;<NEW_LINE>numLevels_ = dstLevel;<NEW_LINE>}
weights_, fromIndex, toIndex, weight);
27,326
protected void mergeChilds(ConfigurationChanges diffs, Device prev, Device device, String deviceDN) throws NamingException {<NEW_LINE>AuditLoggerDeviceExtension prevAuditLoggerExt = <MASK><NEW_LINE>AuditLoggerDeviceExtension auditLoggerExt = device.getDeviceExtension(AuditLoggerDeviceExtension.class);<NEW_LINE>if (prevAuditLoggerExt != null)<NEW_LINE>for (String appName : prevAuditLoggerExt.getAuditLoggerNames()) {<NEW_LINE>if (auditLoggerExt == null || !auditLoggerExt.containsAuditLogger(appName)) {<NEW_LINE>String dn = auditLoggerDN(appName, deviceDN);<NEW_LINE>config.destroySubcontextWithChilds(dn);<NEW_LINE>ConfigurationChanges.addModifiedObject(diffs, dn, ConfigurationChanges.ChangeType.D);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (auditLoggerExt == null)<NEW_LINE>return;<NEW_LINE>for (AuditLogger logger : auditLoggerExt.getAuditLoggers()) {<NEW_LINE>String appName = logger.getCommonName();<NEW_LINE>if (prevAuditLoggerExt == null || !prevAuditLoggerExt.containsAuditLogger(appName)) {<NEW_LINE>store(diffs, deviceDN, logger);<NEW_LINE>} else<NEW_LINE>merge(diffs, prevAuditLoggerExt.getAuditLogger(appName), logger, deviceDN);<NEW_LINE>}<NEW_LINE>}
prev.getDeviceExtension(AuditLoggerDeviceExtension.class);
546,598
private // Note that the keys stored in the BatchHolders are not moved around.<NEW_LINE>void resizeAndRehashIfNeeded() {<NEW_LINE>if (numEntries < threshold) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.debug("Hash table numEntries = {}, threshold = {}; resizing the table...", numEntries, threshold);<NEW_LINE>}<NEW_LINE>// If the table size is already MAXIMUM_CAPACITY, don't resize<NEW_LINE>// the table, but set the threshold to Integer.MAX_VALUE such that<NEW_LINE>// future attempts to resize will return immediately.<NEW_LINE>if (tableSize == MAXIMUM_CAPACITY) {<NEW_LINE>threshold = Integer.MAX_VALUE;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newTableSize = 2 * tableSize;<NEW_LINE>newTableSize = roundUpToPowerOf2(newTableSize);<NEW_LINE>// if not enough memory available to allocate the new hash-table, plus the new links and<NEW_LINE>// the new hash-values (to replace the existing ones - inside rehash() ), then OOM<NEW_LINE>if (4 * /* sizeof(int) */<NEW_LINE>(newTableSize + 2 * HashTable.BATCH_SIZE) >= allocator.getLimit() - allocator.getAllocatedMemory()) {<NEW_LINE>throw new OutOfMemoryException("Resize Hash Table");<NEW_LINE>}<NEW_LINE>tableSize = newTableSize;<NEW_LINE>if (tableSize > MAXIMUM_CAPACITY) {<NEW_LINE>tableSize = MAXIMUM_CAPACITY;<NEW_LINE>}<NEW_LINE>long t0 = System.currentTimeMillis();<NEW_LINE>// set the new threshold based on the new table size and load factor<NEW_LINE>threshold = (int) Math.ceil(tableSize * htConfig.getLoadFactor());<NEW_LINE>IntVector newStartIndices = allocMetadataVector(tableSize, EMPTY_SLOT);<NEW_LINE>for (int i = 0; i < batchHolders.size(); i++) {<NEW_LINE>BatchHolder bh = batchHolders.get(i);<NEW_LINE>int batchStartIdx = i * BATCH_SIZE;<NEW_LINE>bh.rehash(tableSize, newStartIndices, batchStartIdx);<NEW_LINE>}<NEW_LINE>startIndices.clear();<NEW_LINE>startIndices = newStartIndices;<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.debug("After resizing and rehashing, dumping the hash table...");<NEW_LINE>logger.debug("Number of buckets = {}.", startIndices.getAccessor().getValueCount());<NEW_LINE>for (int i = 0; i < startIndices.getAccessor().getValueCount(); i++) {<NEW_LINE>logger.debug("Bucket: {}, startIdx[ {} ] = {}.", i, i, startIndices.getAccessor().get(i));<NEW_LINE>int startIdx = startIndices.getAccessor().get(i);<NEW_LINE>BatchHolder bh = batchHolders.get((startIdx >>> 16) & BATCH_MASK);<NEW_LINE>bh.dump(startIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resizingTime <MASK><NEW_LINE>numResizing++;<NEW_LINE>}
+= System.currentTimeMillis() - t0;
777,319
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>final boolean portrait = AndroidUiHelper.isOrientationPortrait(getActivity());<NEW_LINE>View mainView = inflate(R.layout.fragment_wikivoyage_welcome_dialog, container);<NEW_LINE>Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(getContext()));<NEW_LINE>ImageView backBtn = (ImageView) mainView.findViewById(R.id.back_button);<NEW_LINE>backBtn.setImageDrawable(icBack);<NEW_LINE>backBtn.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int imgId = nightMode ? R.drawable.img_start_screen_travel_night : R.drawable.img_start_screen_travel_day;<NEW_LINE>ImageView mainImage = (ImageView) mainView.<MASK><NEW_LINE>mainImage.setScaleType(portrait ? ScaleType.CENTER_CROP : ScaleType.CENTER_INSIDE);<NEW_LINE>mainImage.setImageResource(imgId);<NEW_LINE>mainView.findViewById(R.id.continue_button).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>dismiss();<NEW_LINE>Intent intent = new Intent(activity, WikivoyageExploreActivity.class);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);<NEW_LINE>activity.startActivity(intent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return mainView;<NEW_LINE>}
findViewById(R.id.main_image);
1,082,691
public static Query<Long> averagePlaytimePerPlayer(long after, long before) {<NEW_LINE>return database -> {<NEW_LINE>String selectPlaytimePerPlayer = SELECT + SessionsTable.USER_UUID + "," + "SUM(" + SessionsTable.SESSION_END + '-' + SessionsTable.SESSION_START + ") as playtime" + FROM + SessionsTable.TABLE_NAME + WHERE + SessionsTable.SESSION_END + "<=?" + AND + SessionsTable.SESSION_START <MASK><NEW_LINE>String selectAverage = SELECT + "AVG(playtime) as average" + FROM + '(' + selectPlaytimePerPlayer + ") q1";<NEW_LINE>return database.query(new QueryStatement<Long>(selectAverage, 100) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setLong(1, before);<NEW_LINE>statement.setLong(2, after);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Long processResults(ResultSet set) throws SQLException {<NEW_LINE>return set.next() ? (long) set.getDouble("average") : 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>};<NEW_LINE>}
+ ">=?" + GROUP_BY + SessionsTable.USER_UUID;
867,312
private static int iterateToFixedPoint(List<InstructionBlock> blocks, int frameSize, BlockInfo[] blockInfos, ArrayList<InstructionBlock>[] predecessors) {<NEW_LINE>// by processing the graph bottom-up, we may reach a fixed point more quickly<NEW_LINE>ArrayDeque<InstructionBlock> workList = new ArrayDeque<>(blocks);<NEW_LINE>BitSet blockOnWorkList = new BitSet(blocks.size());<NEW_LINE>blockOnWorkList.set(0, blockOnWorkList.size());<NEW_LINE>BitSet newPredecessorOut = new BitSet(frameSize);<NEW_LINE>BitSet newIn = new BitSet(frameSize);<NEW_LINE>int processedBlocks = 0;<NEW_LINE>while (!workList.isEmpty()) {<NEW_LINE>processedBlocks++;<NEW_LINE>InstructionBlock block = removeBlockFromWorkList(workList, blockOnWorkList);<NEW_LINE>BlockInfo blockInfo = blockInfos[block.getBlockIndex()];<NEW_LINE>newIn.clear();<NEW_LINE>newIn.or(blockInfo.out);<NEW_LINE>newIn.andNot(blockInfo.defs);<NEW_LINE>newIn.or(blockInfo.gen);<NEW_LINE>newIn.or(blockInfo.phiDefs);<NEW_LINE>blockInfo.in.clear();<NEW_LINE>blockInfo.in.or(newIn);<NEW_LINE>for (InstructionBlock predecessor : predecessors[block.getBlockIndex()]) {<NEW_LINE>BlockInfo predecessorBlockInfo = blockInfos[predecessor.getBlockIndex()];<NEW_LINE>newPredecessorOut.clear();<NEW_LINE>newPredecessorOut.or(blockInfo.in);<NEW_LINE>newPredecessorOut.andNot(blockInfo.phiDefs);<NEW_LINE><MASK><NEW_LINE>boolean changed = or(predecessorBlockInfo.out, newPredecessorOut);<NEW_LINE>if (changed) {<NEW_LINE>addBlockToWorkList(workList, blockOnWorkList, predecessor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return processedBlocks;<NEW_LINE>}
newPredecessorOut.or(predecessorBlockInfo.phiUses);
1,384,802
// Since our TileEntity implements ITickableTileEntity, we get an update method which is called once per tick (20 times / second)<NEW_LINE>// When the timer elapses, replace our block with a random one.<NEW_LINE>@Override<NEW_LINE>public void tick() {<NEW_LINE>// prevent crash<NEW_LINE>if (!this.hasWorld())<NEW_LINE>return;<NEW_LINE>World world = this.getWorld();<NEW_LINE>// don't bother doing anything on the client side.<NEW_LINE>if (world.isRemote)<NEW_LINE>return;<NEW_LINE>// we can now be sure world is a ServerWorld<NEW_LINE>ServerWorld serverWorld = (ServerWorld) world;<NEW_LINE>// do nothing until the time is valid<NEW_LINE>if (ticksLeftTillDisappear == INVALID_VALUE)<NEW_LINE>return;<NEW_LINE>--ticksLeftTillDisappear;<NEW_LINE>// this.markDirty(); // if you update a tileentity variable on the server and this should be communicated to the client,<NEW_LINE>// you need to markDirty() to force a resend. In this case, the client doesn't need to know because<NEW_LINE>// nothing happens on the client until the timer expires<NEW_LINE>// not ready yet<NEW_LINE>if (ticksLeftTillDisappear > 0)<NEW_LINE>return;<NEW_LINE>Block[] blockChoices = { Blocks.DIAMOND_BLOCK, Blocks.OBSIDIAN, Blocks.AIR, Blocks.TNT, Blocks.CORNFLOWER, Blocks.OAK_SAPLING, Blocks.WATER };<NEW_LINE>Random random = new Random();<NEW_LINE>Block chosenBlock = blockChoices[random.nextInt(blockChoices.length)];<NEW_LINE>world.setBlockState(this.pos, chosenBlock.getDefaultState());<NEW_LINE>if (chosenBlock == Blocks.TNT) {<NEW_LINE>Blocks.TNT.catchFire(Blocks.TNT.getDefaultState().with(TNTBlock.UNSTABLE, true), world, pos, null, null);<NEW_LINE>world.removeBlock(pos, false);<NEW_LINE>} else if (chosenBlock == Blocks.OAK_SAPLING) {<NEW_LINE>SaplingBlock blockSapling = (SaplingBlock) Blocks.OAK_SAPLING;<NEW_LINE>blockSapling.placeTree(serverWorld, this.pos, <MASK><NEW_LINE>}<NEW_LINE>}
blockSapling.getDefaultState(), random);
1,742,682
public void afterOpcode(int seen) {<NEW_LINE>super.afterOpcode(seen);<NEW_LINE>if (seen == Const.INVOKEINTERFACE || seen == Const.INVOKEVIRTUAL) {<NEW_LINE>if (fieldUnderClone != null) {<NEW_LINE>arrayFieldClones.put(stack.getStackItem(0), fieldUnderClone);<NEW_LINE>}<NEW_LINE>if (paramUnderClone != null) {<NEW_LINE>arrayParamClones.put(stack.getStackItem(0), paramUnderClone);<NEW_LINE>}<NEW_LINE>if (seen == Const.INVOKEVIRTUAL) {<NEW_LINE>if (bufferFieldUnderDuplication != null) {<NEW_LINE>bufferFieldDuplicates.put(stack.getStackItem(0), bufferFieldUnderDuplication);<NEW_LINE>}<NEW_LINE>if (bufferParamUnderDuplication != null) {<NEW_LINE>bufferParamDuplicates.put(stack.getStackItem(0), bufferParamUnderDuplication);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen == Const.INVOKESTATIC) {<NEW_LINE>if (fieldUnderWrapToBuffer != null) {<NEW_LINE>arrayFieldsWrappedToBuffers.put(stack.getStackItem(0), fieldUnderWrapToBuffer);<NEW_LINE>}<NEW_LINE>if (paramUnderWrapToBuffer != null) {<NEW_LINE>arrayParamsWrappedToBuffers.put(stack.getStackItem(0), paramUnderWrapToBuffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen == Const.CHECKCAST) {<NEW_LINE>OpcodeStack.Item item = stack.getStackItem(0);<NEW_LINE>if (fieldCloneUnderCast != null) {<NEW_LINE>arrayFieldClones.put(item, fieldCloneUnderCast);<NEW_LINE>}<NEW_LINE>if (paramCloneUnderCast != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
arrayParamClones.put(item, paramCloneUnderCast);
1,615,459
public Result visit(Sort e) {<NEW_LINE>if (e.getInput() instanceof Aggregate) {<NEW_LINE>final Aggregate aggregate = (Aggregate) e.getInput();<NEW_LINE>if (hasTrickyRollup(e, aggregate)) {<NEW_LINE>// MySQL 5 does not support standard "GROUP BY ROLLUP(x, y)", only<NEW_LINE>// the non-standard "GROUP BY x, y WITH ROLLUP".<NEW_LINE>// It does not allow "WITH ROLLUP" in combination with "ORDER BY",<NEW_LINE>// but "GROUP BY x, y WITH ROLLUP" implicitly sorts by x, y,<NEW_LINE>// so skip the ORDER BY.<NEW_LINE>final Set<Integer> groupList = new LinkedHashSet<>();<NEW_LINE>for (RelFieldCollation fc : e.collation.getFieldCollations()) {<NEW_LINE>groupList.add(aggregate.getGroupSet().nth(fc.getFieldIndex()));<NEW_LINE>}<NEW_LINE>groupList.addAll(Aggregate.Group.getRollup(aggregate.getGroupSets()));<NEW_LINE>return offsetFetch(e, visitAggregate(aggregate, ImmutableList.copyOf(groupList)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e.getInput() instanceof Project) {<NEW_LINE>// Deal with the case Sort(Project(Aggregate ...))<NEW_LINE>// by converting it to Project(Sort(Aggregate ...)).<NEW_LINE>final Project project = (Project) e.getInput();<NEW_LINE>final Permutation permutation = project.getPermutation();<NEW_LINE>if (permutation != null && project.getInput() instanceof Aggregate) {<NEW_LINE>final Aggregate aggregate = (Aggregate) project.getInput();<NEW_LINE>if (hasTrickyRollup(e, aggregate)) {<NEW_LINE>final RelCollation collation = RelCollations.permute(e.collation, permutation);<NEW_LINE>final Sort sort2 = LogicalSort.create(aggregate, collation, e.offset, e.fetch);<NEW_LINE>final Project project2 = LogicalProject.create(sort2, project.getProjects(), project.getRowType());<NEW_LINE>return visit(project2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Result x = visitChild(0, e.getInput());<NEW_LINE>Builder builder = x.builder(e, Clause.ORDER_BY);<NEW_LINE>List<SqlNode<MASK><NEW_LINE>for (RelFieldCollation field : e.getCollation().getFieldCollations()) {<NEW_LINE>builder.addOrderItem(orderByList, field);<NEW_LINE>}<NEW_LINE>if (!orderByList.isEmpty()) {<NEW_LINE>builder.setOrderBy(new SqlNodeList(orderByList, POS));<NEW_LINE>x = builder.result();<NEW_LINE>}<NEW_LINE>x = offsetFetch(e, x);<NEW_LINE>return x;<NEW_LINE>}
> orderByList = Expressions.list();
982,286
final DescribeTrafficMirrorTargetsResult executeDescribeTrafficMirrorTargets(DescribeTrafficMirrorTargetsRequest describeTrafficMirrorTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeTrafficMirrorTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeTrafficMirrorTargetsRequest> request = null;<NEW_LINE>Response<DescribeTrafficMirrorTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeTrafficMirrorTargetsRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTrafficMirrorTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeTrafficMirrorTargetsResult> responseHandler = new StaxResponseHandler<DescribeTrafficMirrorTargetsResult>(new DescribeTrafficMirrorTargetsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(describeTrafficMirrorTargetsRequest));
393,652
public MessageHandler messageReceiver() {<NEW_LINE>return message -> {<NEW_LINE>LOGGER.info("Message arrived! Payload: " + message.getPayload());<NEW_LINE>DfdlDef dfdlDef;<NEW_LINE>try {<NEW_LINE>// Get DFDL Definition Getting from Firestore.<NEW_LINE>dfdlDef = firestoreService.getDfdlDef(dfdlDefName);<NEW_LINE>System.out.println("Definition from Firestore: " + dfdlDef.getDefinition());<NEW_LINE>// Transform message using the dfdl definition.<NEW_LINE>String messageConverted = dfdlService.convertDataMessage((String) <MASK><NEW_LINE>// Republish the message in json format in a new topic<NEW_LINE>messagingGateway.sendToPubsub(pubsubDataJsonTopic, messageConverted);<NEW_LINE>// Acknowledge incoming Pub/Sub message<NEW_LINE>BasicAcknowledgeablePubsubMessage originalMessage = message.getHeaders().get(GcpPubSubHeaders.ORIGINAL_MESSAGE, BasicAcknowledgeablePubsubMessage.class);<NEW_LINE>originalMessage.ack();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
message.getPayload(), dfdlDef);
699,256
final DescribeContinuousExportsResult executeDescribeContinuousExports(DescribeContinuousExportsRequest describeContinuousExportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeContinuousExportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeContinuousExportsRequest> request = null;<NEW_LINE>Response<DescribeContinuousExportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeContinuousExportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeContinuousExportsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Discovery Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeContinuousExports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeContinuousExportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeContinuousExportsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,855,085
public static void rotateCCW(GrayF64 image) {<NEW_LINE>if (image.width != image.height)<NEW_LINE>throw new IllegalArgumentException("Image must be square");<NEW_LINE>int w = image.height / 2 + image.height % 2;<NEW_LINE>int h = image.height / 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, h, y0->{<NEW_LINE>for (int y0 = 0; y0 < h; y0++) {<NEW_LINE>int y1 = image.height - y0 - 1;<NEW_LINE>for (int x0 = 0; x0 < w; x0++) {<NEW_LINE>int x1 = image.width - x0 - 1;<NEW_LINE>int index0 = image.startIndex + y0 * image.stride + x0;<NEW_LINE>int index1 = image.startIndex + x0 * image.stride + y1;<NEW_LINE>int index2 = image.startIndex + y1 * image.stride + x1;<NEW_LINE>int index3 = image.startIndex + x1 * image.stride + y0;<NEW_LINE>double tmp0 = image.data[index0];<NEW_LINE>image.data[index0<MASK><NEW_LINE>image.data[index1] = image.data[index2];<NEW_LINE>image.data[index2] = image.data[index3];<NEW_LINE>image.data[index3] = (double) tmp0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
] = image.data[index1];
1,729,805
public static void callRunnableInitInvoked(Object callRunnableObj, boolean addStepToCtx, boolean isIgnoreIfNoThreaded) {<NEW_LINE>try {<NEW_LINE>TraceContext ctx = TraceContextManager.getContext(true);<NEW_LINE>if (ctx == null)<NEW_LINE>return;<NEW_LINE>if (TransferMap.get(System.identityHashCode(callRunnableObj)) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long gxid = ctx.gxid == 0 ? ctx.txid : ctx.gxid;<NEW_LINE>ctx.gxid = gxid;<NEW_LINE>long callee = KeyGen.next();<NEW_LINE>ThreadCallPossibleStep threadCallPossibleStep = new ThreadCallPossibleStep();<NEW_LINE>threadCallPossibleStep.txid = callee;<NEW_LINE>threadCallPossibleStep.start_time = (int) (System.currentTimeMillis() - ctx.startTime);<NEW_LINE>String threadCallName = (ctx.lastThreadCallName != null) ? ctx.lastThreadCallName : callRunnableObj.toString();<NEW_LINE>threadCallName = AgentCommonConstant.normalizeHashCode(threadCallName);<NEW_LINE>ctx.lastThreadCallName = null;<NEW_LINE>threadCallPossibleStep.hash = DataProxy.sendApicall(threadCallName);<NEW_LINE>threadCallPossibleStep.nameTemp = threadCallName;<NEW_LINE>if (isIgnoreIfNoThreaded) {<NEW_LINE>threadCallPossibleStep.isIgnoreIfNoThreaded = true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (addStepToCtx) {<NEW_LINE>ctx.lastThreadCallPossibleStep = threadCallPossibleStep;<NEW_LINE>}<NEW_LINE>TransferMap.put(System.identityHashCode(callRunnableObj), gxid, ctx.txid, callee, ctx.xType, Thread.currentThread().getId(), threadCallPossibleStep);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Logger.println("B1203", "Exception: callRunnableInitInvoked", t);<NEW_LINE>}<NEW_LINE>}
ctx.profile.add(threadCallPossibleStep);
1,032,895
private List<OperationExt> kotlinRunApp(ParserContext ctx, String prefix, MethodInsnNode node) {<NEW_LINE>List<OperationExt> <MASK><NEW_LINE>Type type = null;<NEW_LINE>for (AbstractInsnNode it : InsnSupport.prev(node).collect(Collectors.toList())) {<NEW_LINE>if (it instanceof FieldInsnNode) {<NEW_LINE>FieldInsnNode getstatic = (FieldInsnNode) it;<NEW_LINE>if (getstatic.getOpcode() == GETSTATIC) {<NEW_LINE>type = Type.getObjectType(getstatic.owner);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (it instanceof LdcInsnNode) {<NEW_LINE>LdcInsnNode e = (LdcInsnNode) it;<NEW_LINE>if (e.cst instanceof Type) {<NEW_LINE>type = (Type) e.cst;<NEW_LINE>ctx.setMainClass(type.getClassName());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>throw new IllegalStateException("io.jooby.runApp(String[]) parsing failure");<NEW_LINE>}<NEW_LINE>ClassNode classNode = ctx.classNode(type);<NEW_LINE>handlerList.addAll(parse(ctx, prefix, classNode));<NEW_LINE>return handlerList;<NEW_LINE>}
handlerList = new ArrayList<>();
1,567,525
final AssociateCustomerGatewayResult executeAssociateCustomerGateway(AssociateCustomerGatewayRequest associateCustomerGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateCustomerGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateCustomerGatewayRequest> request = null;<NEW_LINE>Response<AssociateCustomerGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateCustomerGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateCustomerGatewayRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateCustomerGateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateCustomerGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateCustomerGatewayResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,743,443
private byte[] generateKey(KeyDerivationFunc pbkdAlgorithm, String purpose, char[] password) throws IOException {<NEW_LINE>byte[] encPassword = PBEParametersGenerator.PKCS12PasswordToBytes(password);<NEW_LINE>byte[] differentiator = PBEParametersGenerator.PKCS12PasswordToBytes(purpose.toCharArray());<NEW_LINE>int keySizeInBytes;<NEW_LINE>if (MiscObjectIdentifiers.id_scrypt.equals(pbkdAlgorithm.getAlgorithm())) {<NEW_LINE>ScryptParams params = ScryptParams.getInstance(pbkdAlgorithm.getParameters());<NEW_LINE>return SCrypt.generate(Arrays.concatenate(encPassword, differentiator), params.getSalt(), params.getCostParameter().intValue(), params.getBlockSize().intValue(), params.getBlockSize().intValue(), params.getKeyLength().intValue());<NEW_LINE>} else if (pbkdAlgorithm.getAlgorithm().equals(PKCSObjectIdentifiers.id_PBKDF2)) {<NEW_LINE>PBKDF2Params pbkdf2Params = PBKDF2Params.getInstance(pbkdAlgorithm.getParameters());<NEW_LINE>if (pbkdf2Params.getPrf().getAlgorithm().equals(PKCSObjectIdentifiers.id_hmacWithSHA512)) {<NEW_LINE>PKCS5S2ParametersGenerator pGen = new PKCS5S2ParametersGenerator(new SHA512Digest());<NEW_LINE>pGen.init(Arrays.concatenate(encPassword, differentiator), pbkdf2Params.getSalt(), pbkdf2Params.getIterationCount().intValue());<NEW_LINE>keySizeInBytes = pbkdf2Params.getKeyLength().intValue();<NEW_LINE>return ((KeyParameter) pGen.generateDerivedParameters(keySizeInBytes * 8)).getKey();<NEW_LINE>} else if (pbkdf2Params.getPrf().getAlgorithm().equals(NISTObjectIdentifiers.id_hmacWithSHA3_512)) {<NEW_LINE>PKCS5S2ParametersGenerator pGen = new PKCS5S2ParametersGenerator(new SHA3Digest(512));<NEW_LINE>pGen.init(Arrays.concatenate(encPassword, differentiator), pbkdf2Params.getSalt(), pbkdf2Params.getIterationCount().intValue());<NEW_LINE>keySizeInBytes = pbkdf2Params<MASK><NEW_LINE>return ((KeyParameter) pGen.generateDerivedParameters(keySizeInBytes * 8)).getKey();<NEW_LINE>} else {<NEW_LINE>throw new IOException("BCFKS KeyStore: unrecognized MAC PBKD PRF: " + pbkdf2Params.getPrf().getAlgorithm());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("BCFKS KeyStore: unrecognized MAC PBKD.");<NEW_LINE>}<NEW_LINE>}
.getKeyLength().intValue();
548,197
public void initialize() {<NEW_LINE>createListener();<NEW_LINE>final Tuple3<VBox, Label, AutocompleteComboBox<CurrencyListItem>> currencyComboBoxTuple = addTopLabelAutocompleteComboBox(Res.get("shared.currency"), 0);<NEW_LINE>this.currencyComboBox = currencyComboBoxTuple.third;<NEW_LINE>this.currencyComboBox.setCellFactory(GUIUtil.getCurrencyListItemCellFactory(Res.get("shared.oneOffer"), Res.get("shared.multipleOffers"), model.preferences));<NEW_LINE>createChart();<NEW_LINE>VBox.setMargin(chartPane, new Insets(0<MASK><NEW_LINE>Tuple4<TableView<OfferListItem>, VBox, Button, Label> tupleBuy = getOfferTable(OfferDirection.BUY);<NEW_LINE>Tuple4<TableView<OfferListItem>, VBox, Button, Label> tupleSell = getOfferTable(OfferDirection.SELL);<NEW_LINE>buyOfferTableView = tupleBuy.first;<NEW_LINE>sellOfferTableView = tupleSell.first;<NEW_LINE>leftButton = (AutoTooltipButton) tupleBuy.third;<NEW_LINE>rightButton = (AutoTooltipButton) tupleSell.third;<NEW_LINE>leftHeaderLabel = tupleBuy.fourth;<NEW_LINE>rightHeaderLabel = tupleSell.fourth;<NEW_LINE>bottomHBox = new HBox();<NEW_LINE>// 30<NEW_LINE>bottomHBox.setSpacing(20);<NEW_LINE>bottomHBox.setAlignment(Pos.CENTER);<NEW_LINE>VBox.setMargin(bottomHBox, new Insets(-5, 0, 0, 0));<NEW_LINE>HBox.setHgrow(tupleBuy.second, Priority.ALWAYS);<NEW_LINE>HBox.setHgrow(tupleSell.second, Priority.ALWAYS);<NEW_LINE>tupleBuy.second.setUserData(OfferDirection.BUY.name());<NEW_LINE>tupleSell.second.setUserData(OfferDirection.SELL.name());<NEW_LINE>bottomHBox.getChildren().addAll(tupleBuy.second, tupleSell.second);<NEW_LINE>root.getChildren().addAll(currencyComboBoxTuple.first, chartPane, bottomHBox);<NEW_LINE>}
, 0, 5, 0));
1,371,876
private Map.Entry<Map<Method, String>, Map<WrappedMethod, Method>> tryGetMethods(Class<?> cl) {<NEW_LINE>try {<NEW_LINE>Map<Method, String> names = new HashMap<>();<NEW_LINE>Map<WrappedMethod, Method> types = new HashMap<>();<NEW_LINE>for (Method method : cl.getMethods()) {<NEW_LINE>checkMethodTypes(method);<NEW_LINE>String name = mapMethod(method);<NEW_LINE>names.put(method, name);<NEW_LINE>WrappedMethod wrapped = new WrappedMethod(name, method.getParameterTypes());<NEW_LINE>types.put(wrapped, method);<NEW_LINE>}<NEW_LINE>for (Method method : cl.getDeclaredMethods()) {<NEW_LINE>checkMethodTypes(method);<NEW_LINE>String name = mapMethod(method);<NEW_LINE>names.put(method, name);<NEW_LINE>WrappedMethod wrapped = new WrappedMethod(name, method.getParameterTypes());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return Maps.immutableEntry(names, types);<NEW_LINE>} catch (TypeNotPresentException e) {<NEW_LINE>if (e.getCause() instanceof ClassNotFoundException) {<NEW_LINE>tryDefineClass(e.getCause().getMessage().replace('.', '/'));<NEW_LINE>return tryGetMethods(cl);<NEW_LINE>} else<NEW_LINE>throw e;<NEW_LINE>} catch (NoClassDefFoundError error) {<NEW_LINE>tryDefineClass(error.getMessage());<NEW_LINE>return tryGetMethods(cl);<NEW_LINE>}<NEW_LINE>}
types.put(wrapped, method);
1,547,153
final DBInstance executeStopDBInstance(StopDBInstanceRequest stopDBInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopDBInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopDBInstanceRequest> request = null;<NEW_LINE>Response<DBInstance> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopDBInstanceRequestMarshaller().marshall(super.beforeMarshalling(stopDBInstanceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopDBInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBInstance> responseHandler = new StaxResponseHandler<DBInstance>(new DBInstanceStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,387,823
public String generateTable(Map<String, DataType> schema) {<NEW_LINE>// Generate table name<NEW_LINE>String generateUniqueId = new ObjectId().toString().toUpperCase();<NEW_LINE>// Appending tbl_ before the generated unique id since using the string directly was throwing a SQL error<NEW_LINE>// which I couldnt solve. Just appending a string to it though works perfectly.<NEW_LINE>String tableName = new StringBuilder("tbl_").append(generateUniqueId).toString();<NEW_LINE>StringBuilder sb = new StringBuilder("CREATE TABLE ");<NEW_LINE>sb.append(tableName);<NEW_LINE>sb.append(" (");<NEW_LINE>Boolean columnsAdded = false;<NEW_LINE>for (Map.Entry<String, DataType> entry : schema.entrySet()) {<NEW_LINE>if (columnsAdded) {<NEW_LINE>// If columns have been added before, add a separator<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>String fieldName = entry.getKey();<NEW_LINE>DataType dataType = entry.getValue();<NEW_LINE>String <MASK><NEW_LINE>if (sqlDataType == null) {<NEW_LINE>// the data type recognized does not have a native support in appsmith right now<NEW_LINE>// default to String<NEW_LINE>sqlDataType = SQL_DATATYPE_MAP.get(DataType.STRING);<NEW_LINE>}<NEW_LINE>columnsAdded = true;<NEW_LINE>sb.append("\"" + fieldName + "\"");<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append(sqlDataType);<NEW_LINE>}<NEW_LINE>sb.append(");");<NEW_LINE>String createTableQuery = sb.toString();<NEW_LINE>executeDbQuery(createTableQuery);<NEW_LINE>return tableName;<NEW_LINE>}
sqlDataType = SQL_DATATYPE_MAP.get(dataType);
1,430,624
private static void dumpRow(PrintData pd, int row) {<NEW_LINE>log.info("Row #" + row);<NEW_LINE>if (row < 0 || row >= pd.getRowCount()) {<NEW_LINE>log.warn("- invalid -");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pd.setRowIndex(row);<NEW_LINE>if (pd.getNodeCount() == 0) {<NEW_LINE>log.info("- n/a -");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < pd.getNodeCount(); i++) {<NEW_LINE>Object <MASK><NEW_LINE>if (obj == null)<NEW_LINE>log.info("- NULL -");<NEW_LINE>else if (obj instanceof PrintData) {<NEW_LINE>log.info("- included -");<NEW_LINE>dump((PrintData) obj);<NEW_LINE>} else if (obj instanceof PrintDataElement) {<NEW_LINE>log.info(((PrintDataElement) obj).toStringX());<NEW_LINE>} else<NEW_LINE>log.info("- INVALID: " + obj);<NEW_LINE>}<NEW_LINE>}
obj = pd.getNode(i);
1,227,449
/*<NEW_LINE>* the methods documentIndexRequest, bulkIndexOperation and bulkCreateOperation have nearly<NEW_LINE>* identical code, but the client builders do not have a common accessible base or some reusable parts<NEW_LINE>* so the code needs to be duplicated.<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("DuplicatedCode")<NEW_LINE>private CreateOperation<?> bulkCreateOperation(IndexQuery query, IndexCoordinates indexCoordinates, @Nullable RefreshPolicy refreshPolicy) {<NEW_LINE>CreateOperation.Builder<Object> builder = new CreateOperation.Builder<>();<NEW_LINE>builder.index(indexCoordinates.getIndexName());<NEW_LINE>Object queryObject = query.getObject();<NEW_LINE>if (queryObject != null) {<NEW_LINE>String id = StringUtils.hasText(query.getId()) ? getPersistentEntityId(queryObject) : query.getId();<NEW_LINE>//<NEW_LINE>//<NEW_LINE>builder.//<NEW_LINE>id(id).document(elasticsearchConverter.mapObject(queryObject));<NEW_LINE>} else if (query.getSource() != null) {<NEW_LINE>builder.document(new DefaultStringObjectMap<>().fromJson(query.getSource()));<NEW_LINE>} else {<NEW_LINE>throw new InvalidDataAccessApiUsageException("object or source is null, failed to index the document [id: " + <MASK><NEW_LINE>}<NEW_LINE>if (query.getVersion() != null) {<NEW_LINE>VersionType versionType = retrieveVersionTypeFromPersistentEntity(queryObject != null ? queryObject.getClass() : null);<NEW_LINE>builder.version(query.getVersion()).versionType(versionType);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>//<NEW_LINE>builder.//<NEW_LINE>ifSeqNo(//<NEW_LINE>query.getSeqNo()).//<NEW_LINE>ifPrimaryTerm(//<NEW_LINE>query.getPrimaryTerm()).//<NEW_LINE>routing(query.getRouting());<NEW_LINE>return builder.build();<NEW_LINE>}
query.getId() + ']');
1,008,548
final ListIdentityPoolUsageResult executeListIdentityPoolUsage(ListIdentityPoolUsageRequest listIdentityPoolUsageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIdentityPoolUsageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIdentityPoolUsageRequest> request = null;<NEW_LINE>Response<ListIdentityPoolUsageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIdentityPoolUsageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIdentityPoolUsageRequest));<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, "Cognito Sync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIdentityPoolUsage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIdentityPoolUsageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIdentityPoolUsageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,332,409
private void addPdfToZip(Event event, ZipOutputStream zipOS, TicketReservation reservation, BillingDocument document) {<NEW_LINE>Map<String, Object> reservationModel = document.getModel();<NEW_LINE>Optional<byte[]> pdf;<NEW_LINE>var language = LocaleUtil.forLanguageTag(reservation.getUserLanguage());<NEW_LINE>switch(document.getType()) {<NEW_LINE>case CREDIT_NOTE:<NEW_LINE>pdf = TemplateProcessor.buildCreditNotePdf(event, fileUploadManager, language, templateManager, reservationModel, extensionManager);<NEW_LINE>break;<NEW_LINE>case RECEIPT:<NEW_LINE>pdf = TemplateProcessor.buildReceiptPdf(event, fileUploadManager, <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>pdf = TemplateProcessor.buildInvoicePdf(event, fileUploadManager, language, templateManager, reservationModel, extensionManager);<NEW_LINE>}<NEW_LINE>if (pdf.isPresent()) {<NEW_LINE>String fileName = FileUtil.getBillingDocumentFileName(event.getShortName(), reservation.getId(), document);<NEW_LINE>var entry = new ZipEntry(fileName);<NEW_LINE>entry.setTimeLocal(document.getGenerationTimestamp().withZoneSameInstant(event.getZoneId()).toLocalDateTime());<NEW_LINE>try {<NEW_LINE>zipOS.putNextEntry(entry);<NEW_LINE>StreamUtils.copy(pdf.get(), zipOS);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
language, templateManager, reservationModel, extensionManager);
394,307
private static void comparePlan(String[] expectedCSV) {<NEW_LINE>GroupByRollupPlanDesc plan = SupportGroupRollupPlanHook.getPlan();<NEW_LINE>AggregationGroupByRollupLevelForge[] levels = plan.getRollupDesc().getLevels();<NEW_LINE>String[][] received = new String[levels.length][];<NEW_LINE>for (int i = 0; i < levels.length; i++) {<NEW_LINE>AggregationGroupByRollupLevelForge level = levels[i];<NEW_LINE>if (level.isAggregationTop()) {<NEW_LINE>received[i] = new String[0];<NEW_LINE>} else {<NEW_LINE>received[i] = new String[level.getRollupKeys().length];<NEW_LINE>for (int j = 0; j < received[i].length; j++) {<NEW_LINE>int key = level.getRollupKeys()[j];<NEW_LINE>received[i][j] = ExprNodeUtilityPrint.toExpressionStringMinPrecedenceSafe(plan.getExpressions()[key]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assertEquals("Received: " + toCSV(received), expectedCSV.length, received.length);<NEW_LINE>for (int i = 0; i < expectedCSV.length; i++) {<NEW_LINE>String receivedCSV = toCSV(received[i]);<NEW_LINE>assertEquals("Failed at row " + i<MASK><NEW_LINE>}<NEW_LINE>}
, expectedCSV[i], receivedCSV);
1,591,283
public static CompletionCandidate[] checkForTypes(ASTNode node) {<NEW_LINE>List<VariableDeclarationFragment> vdfs = null;<NEW_LINE>switch(node.getNodeType()) {<NEW_LINE>case ASTNode.TYPE_DECLARATION:<NEW_LINE>return new CompletionCandidate[] { new CompletionCandidate((TypeDeclaration) node) };<NEW_LINE>case ASTNode.METHOD_DECLARATION:<NEW_LINE>MethodDeclaration md = (MethodDeclaration) node;<NEW_LINE>log(getNodeAsString(md));<NEW_LINE>List<ASTNode> params = (List<ASTNode>) md.getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY);<NEW_LINE>CompletionCandidate[] cand = new CompletionCandidate[params.size() + 1];<NEW_LINE>cand[0] = new CompletionCandidate(md);<NEW_LINE>for (int i = 0; i < params.size(); i++) {<NEW_LINE>// cand[i + 1] = new CompletionCandidate(params.get(i).toString(), "", "",<NEW_LINE>// CompletionCandidate.LOCAL_VAR);<NEW_LINE>cand[i + 1] = new CompletionCandidate((SingleVariableDeclaration) params.get(i));<NEW_LINE>}<NEW_LINE>return cand;<NEW_LINE>case ASTNode.SINGLE_VARIABLE_DECLARATION:<NEW_LINE>return new CompletionCandidate[] { new CompletionCandidate((SingleVariableDeclaration) node) };<NEW_LINE>case ASTNode.FIELD_DECLARATION:<NEW_LINE>vdfs = ((FieldDeclaration) node).fragments();<NEW_LINE>break;<NEW_LINE>case ASTNode.VARIABLE_DECLARATION_STATEMENT:<NEW_LINE>vdfs = ((VariableDeclarationStatement) node).fragments();<NEW_LINE>break;<NEW_LINE>case ASTNode.VARIABLE_DECLARATION_EXPRESSION:<NEW_LINE>vdfs = ((VariableDeclarationExpression) node).fragments();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (vdfs != null) {<NEW_LINE>CompletionCandidate[] ret = new <MASK><NEW_LINE>int i = 0;<NEW_LINE>for (VariableDeclarationFragment vdf : vdfs) {<NEW_LINE>// ret[i++] = new CompletionCandidate(getNodeAsString2(vdf), "", "",<NEW_LINE>// CompletionCandidate.LOCAL_VAR);<NEW_LINE>ret[i++] = new CompletionCandidate(vdf);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
CompletionCandidate[vdfs.size()];
1,602,006
private <T> Future<T> doExecuteAsync(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, BodySetter bodySetter, Object bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter) {<NEW_LINE>final AsyncHttpClient.BoundRequestBuilder boundRequestBuilder;<NEW_LINE>switch(httpVerb) {<NEW_LINE>case GET:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case POST:<NEW_LINE>boundRequestBuilder = client.preparePost(completeUrl);<NEW_LINE>break;<NEW_LINE>case PUT:<NEW_LINE>boundRequestBuilder = client.preparePut(completeUrl);<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>boundRequestBuilder = client.prepareDelete(completeUrl);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("message build error: unknown verb type");<NEW_LINE>}<NEW_LINE>if (httpVerb.isPermitBody()) {<NEW_LINE>if (!headers.containsKey(CONTENT_TYPE)) {<NEW_LINE>boundRequestBuilder.addHeader(CONTENT_TYPE, DEFAULT_CONTENT_TYPE);<NEW_LINE>}<NEW_LINE>bodySetter.setBody(boundRequestBuilder, bodyContents);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> header : headers.entrySet()) {<NEW_LINE>boundRequestBuilder.addHeader(header.getKey(), header.getValue());<NEW_LINE>}<NEW_LINE>if (userAgent != null) {<NEW_LINE>boundRequestBuilder.setHeader(OAuthConstants.USER_AGENT_HEADER_NAME, userAgent);<NEW_LINE>}<NEW_LINE>return boundRequestBuilder.execute(new OAuthAsyncCompletionHandler<>(callback, converter));<NEW_LINE>}
boundRequestBuilder = client.prepareGet(completeUrl);
1,534,468
public void progressEvent(String taskId, String statusMsg) {<NEW_LINE>STS4LanguageClient client = SimpleLanguageServer.this.client;<NEW_LINE>if (client != null) {<NEW_LINE>if (statusMsg == null) {<NEW_LINE>progressDone(taskId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isNew = activeTaskIDs.put(taskId, true) == null;<NEW_LINE>if (isNew) {<NEW_LINE>// New taskId, new progress<NEW_LINE>WorkDoneProgressCreateParams params = new WorkDoneProgressCreateParams();<NEW_LINE>params.setToken(taskId);<NEW_LINE>SimpleLanguageServer.this.client.createProgress(params).thenAccept((p) -> {<NEW_LINE>ProgressParams progressParams = new ProgressParams();<NEW_LINE>progressParams.setToken(taskId);<NEW_LINE>WorkDoneProgressBegin report = new WorkDoneProgressBegin();<NEW_LINE>report.setCancellable(false);<NEW_LINE>progressParams.setValue(Either.forLeft(report));<NEW_LINE>report.setMessage(statusMsg);<NEW_LINE>SimpleLanguageServer.this.client.notifyProgress(progressParams);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>// Already exists<NEW_LINE>ProgressParams progressParams = new ProgressParams();<NEW_LINE>progressParams.setToken(taskId);<NEW_LINE>WorkDoneProgressReport report = new WorkDoneProgressReport();<NEW_LINE>progressParams.setValue<MASK><NEW_LINE>report.setMessage(statusMsg);<NEW_LINE>SimpleLanguageServer.this.client.notifyProgress(progressParams);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Either.forLeft(report));
75,886
private void registerClassedJob(final String jobName, final String jobBootstrapBeanName, final SingletonBeanRegistry singletonBeanRegistry, final CoordinatorRegistryCenter registryCenter, final TracingConfiguration<?> tracingConfig, final ElasticJobConfigurationProperties jobConfigurationProperties) {<NEW_LINE>JobConfiguration jobConfig = jobConfigurationProperties.toJobConfiguration(jobName);<NEW_LINE>jobExtraConfigurations(jobConfig, tracingConfig);<NEW_LINE>ElasticJob elasticJob = applicationContext.<MASK><NEW_LINE>if (Strings.isNullOrEmpty(jobConfig.getCron())) {<NEW_LINE>Preconditions.checkArgument(!Strings.isNullOrEmpty(jobBootstrapBeanName), "The property [jobBootstrapBeanName] is required for One-off job.");<NEW_LINE>singletonBeanRegistry.registerSingleton(jobBootstrapBeanName, new OneOffJobBootstrap(registryCenter, elasticJob, jobConfig));<NEW_LINE>} else {<NEW_LINE>String beanName = !Strings.isNullOrEmpty(jobBootstrapBeanName) ? jobBootstrapBeanName : jobConfig.getJobName() + "ScheduleJobBootstrap";<NEW_LINE>singletonBeanRegistry.registerSingleton(beanName, new ScheduleJobBootstrap(registryCenter, elasticJob, jobConfig));<NEW_LINE>}<NEW_LINE>}
getBean(jobConfigurationProperties.getElasticJobClass());
1,076,627
public void start() throws Exception {<NEW_LINE>LOG.info("Process starting.");<NEW_LINE>mRunning = true;<NEW_LINE>startCommonServices();<NEW_LINE>mJournalSystem.start();<NEW_LINE>startMasters(false);<NEW_LINE>startJvmMonitorProcess();<NEW_LINE>// Perform the initial catchup before joining leader election,<NEW_LINE>// to avoid potential delay if this master is selected as leader<NEW_LINE>if (ServerConfiguration.getBoolean(PropertyKey.MASTER_JOURNAL_CATCHUP_PROTECT_ENABLED)) {<NEW_LINE>LOG.info("Waiting for journals to catch up.");<NEW_LINE>mJournalSystem.waitForCatchup();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LOG.info("Starting leader selector.");<NEW_LINE>mLeaderSelector.start(getRpcAddress());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>while (!Thread.interrupted()) {<NEW_LINE>if (!mRunning) {<NEW_LINE>LOG.info("FT is not running. Breaking out");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (ServerConfiguration.getBoolean(PropertyKey.MASTER_JOURNAL_CATCHUP_PROTECT_ENABLED)) {<NEW_LINE>LOG.info("Waiting for journals to catch up.");<NEW_LINE>mJournalSystem.waitForCatchup();<NEW_LINE>}<NEW_LINE>LOG.info("Started in stand-by mode.");<NEW_LINE><MASK><NEW_LINE>if (!mRunning) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (gainPrimacy()) {<NEW_LINE>mLeaderSelector.waitForState(State.STANDBY);<NEW_LINE>if (ServerConfiguration.getBoolean(PropertyKey.MASTER_JOURNAL_EXIT_ON_DEMOTION)) {<NEW_LINE>stop();<NEW_LINE>} else {<NEW_LINE>if (!mRunning) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>losePrimacy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mLeaderSelector.waitForState(State.PRIMARY);
1,632,718
public Pair<Long, Object> peekNextNotNullValue(long nextStartTime, long nextEndTime) throws IOException {<NEW_LINE>ByteBuffer aggrBuffer;<NEW_LINE>try {<NEW_LINE>if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {<NEW_LINE>AsyncDataClient client = ClusterIoTDB.getInstance().getAsyncDataClient(source, ClusterConstant.getReadOperationTimeoutMS());<NEW_LINE>aggrBuffer = SyncClientAdaptor.peekNextNotNullValue(client, header, executorId, nextStartTime, nextEndTime);<NEW_LINE>} else {<NEW_LINE>SyncDataClient syncDataClient = null;<NEW_LINE>try {<NEW_LINE>syncDataClient = ClusterIoTDB.getInstance().getSyncDataClient(source, ClusterConstant.getReadOperationTimeoutMS());<NEW_LINE>aggrBuffer = syncDataClient.peekNextNotNullValue(header, executorId, nextStartTime, nextEndTime);<NEW_LINE>} catch (TException e) {<NEW_LINE>// the connection may be broken, close it to avoid it being reused<NEW_LINE>syncDataClient.close();<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>if (syncDataClient != null) {<NEW_LINE>syncDataClient.returnSelf();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (TException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread<MASK><NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>Pair<Long, Object> result = null;<NEW_LINE>if (aggrBuffer != null) {<NEW_LINE>long time = aggrBuffer.getLong();<NEW_LINE>Object o = SerializeUtils.deserializeObject(aggrBuffer);<NEW_LINE>if (o != null) {<NEW_LINE>result = new Pair<>(time, o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("Fetched peekNextNotNullValue from {} of [{}, {}]: {}", source, nextStartTime, nextEndTime, result);<NEW_LINE>return result;<NEW_LINE>}
.currentThread().interrupt();
388,553
public void execute(ProcessEngine engine, String scenarioName) {<NEW_LINE>String sourceProcessDefinitionId = engine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/qa/upgrade/gson/oneTaskProcessMigrationV1.bpmn20.xml").deployWithResult().getDeployedProcessDefinitions().get(0).getId();<NEW_LINE>List<String> processInstanceIds = new ArrayList<>();<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>String processInstanceId = engine.getRuntimeService().startProcessInstanceById(sourceProcessDefinitionId, "MigrationBatchScenario").getId();<NEW_LINE>processInstanceIds.add(processInstanceId);<NEW_LINE>}<NEW_LINE>String targetProcessDefinitionId = engine.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/qa/upgrade/gson/oneTaskProcessMigrationV2.bpmn20.xml").deployWithResult().getDeployedProcessDefinitions().get(0).getId();<NEW_LINE>MigrationPlan migrationPlan = engine.getRuntimeService().createMigrationPlan(sourceProcessDefinitionId, targetProcessDefinitionId).mapActivities("userTask1", "userTask1").mapActivities("conditional", "conditional").updateEventTrigger().build();<NEW_LINE>Batch batch = engine.getRuntimeService().newMigration(migrationPlan).processInstanceIds(processInstanceIds).skipIoMappings().skipCustomListeners().executeAsync();<NEW_LINE>engine.getManagementService().setProperty(<MASK><NEW_LINE>}
"MigrationBatchScenario.batchId", batch.getId());
880,061
public static <Strategy extends ColumnSelectorStrategy> ColumnSelectorPlus<Strategy>[] createColumnSelectorPluses(ColumnSelectorStrategyFactory<Strategy> strategyFactory, List<DimensionSpec> dimensionSpecs, ColumnSelectorFactory columnSelectorFactory) {<NEW_LINE>int dimCount = dimensionSpecs.size();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ColumnSelectorPlus<Strategy>[] dims = new ColumnSelectorPlus[dimCount];<NEW_LINE>for (int i = 0; i < dimCount; i++) {<NEW_LINE>final DimensionSpec dimSpec = dimensionSpecs.get(i);<NEW_LINE>final String dimName = dimSpec.getDimension();<NEW_LINE>final ColumnValueSelector<?> selector = getColumnValueSelectorFromDimensionSpec(dimSpec, columnSelectorFactory);<NEW_LINE>Strategy strategy = makeStrategy(strategyFactory, dimSpec, columnSelectorFactory.getColumnCapabilities(dimSpec.getDimension()), selector);<NEW_LINE>final ColumnSelectorPlus<Strategy> selectorPlus = new ColumnSelectorPlus<>(dimName, dimSpec.<MASK><NEW_LINE>dims[i] = selectorPlus;<NEW_LINE>}<NEW_LINE>return dims;<NEW_LINE>}
getOutputName(), strategy, selector);
37,275
final AssociateAssessmentReportEvidenceFolderResult executeAssociateAssessmentReportEvidenceFolder(AssociateAssessmentReportEvidenceFolderRequest associateAssessmentReportEvidenceFolderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateAssessmentReportEvidenceFolderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateAssessmentReportEvidenceFolderRequest> request = null;<NEW_LINE>Response<AssociateAssessmentReportEvidenceFolderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateAssessmentReportEvidenceFolderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateAssessmentReportEvidenceFolderRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateAssessmentReportEvidenceFolder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateAssessmentReportEvidenceFolderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateAssessmentReportEvidenceFolderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
210,439
public void sendRequestToServiceUsingEureka(EurekaClient eurekaClient) {<NEW_LINE>// initialize the client<NEW_LINE>// this is the vip address for the example service to talk to as defined in conf/sample-eureka-service.properties<NEW_LINE>String vipAddress = "sampleservice.mydomain.net";<NEW_LINE>InstanceInfo nextServerInfo = null;<NEW_LINE>try {<NEW_LINE>nextServerInfo = eurekaClient.getNextServerFromEureka(vipAddress, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Cannot get an instance of example service to talk to from eureka");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>System.out.println("Found an instance of example service to talk to from eureka: " + nextServerInfo.getVIPAddress() + ":" + nextServerInfo.getPort());<NEW_LINE>System.out.println("healthCheckUrl: " + nextServerInfo.getHealthCheckUrl());<NEW_LINE>System.out.println("override: " + nextServerInfo.getOverriddenStatus());<NEW_LINE>Socket s = new Socket();<NEW_LINE>int serverPort = nextServerInfo.getPort();<NEW_LINE>try {<NEW_LINE>s.connect(new InetSocketAddress(nextServerInfo.getHostName(), serverPort));<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Could not connect to the server :" + nextServerInfo.getHostName() + " at port " + serverPort);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Could not connect to the server :" + nextServerInfo.getHostName() + " at port " + serverPort + "due to Exception " + e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String request = "FOO " + new Date();<NEW_LINE>System.out.println("Connected to server. Sending a sample request: " + request);<NEW_LINE>PrintStream out = new PrintStream(s.getOutputStream());<NEW_LINE>out.println(request);<NEW_LINE><MASK><NEW_LINE>BufferedReader rd = new BufferedReader(new InputStreamReader(s.getInputStream()));<NEW_LINE>String str = rd.readLine();<NEW_LINE>if (str != null) {<NEW_LINE>System.out.println("Received response from server: " + str);<NEW_LINE>System.out.println("Exiting the client. Demo over..");<NEW_LINE>}<NEW_LINE>rd.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
System.out.println("Waiting for server response..");
699,306
public PCollection<Row> expand(PCollection<Row> input) {<NEW_LINE>return input.apply("join_as_lookup", ParDo.of(new DoFn<Row, Row>() {<NEW_LINE><NEW_LINE>@Setup<NEW_LINE>public void setup() {<NEW_LINE>seekableTable.setUp();<NEW_LINE>}<NEW_LINE><NEW_LINE>@ProcessElement<NEW_LINE>public void processElement(ProcessContext context) {<NEW_LINE>Row factRow = context.element();<NEW_LINE>Row joinSubRow = extractJoinSubRow(factRow);<NEW_LINE>List<Row> lookupRows = seekableTable.seekRow(joinSubRow);<NEW_LINE>for (Row lr : lookupRows) {<NEW_LINE>context.output(combineTwoRowsIntoOne(factRow, lr<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Teardown<NEW_LINE>public void teardown() {<NEW_LINE>seekableTable.tearDown();<NEW_LINE>}<NEW_LINE><NEW_LINE>private Row extractJoinSubRow(Row factRow) {<NEW_LINE>List<Object> joinSubsetValues = factJoinIdx.stream().map(i -> factRow.getBaseValue(i, Object.class)).collect(toList());<NEW_LINE>return Row.withSchema(joinSubsetType).addValues(joinSubsetValues).build();<NEW_LINE>}<NEW_LINE>})).setRowSchema(joinSubsetType);<NEW_LINE>}
, factColOffset != 0, outputSchema));
97,742
private void flushConfig() {<NEW_LINE>File configFile = DBWorkbench.getPlatform().getConfigurationFile(COLUMNS_CONFIG_FILE);<NEW_LINE>try (OutputStream out = new FileOutputStream(configFile)) {<NEW_LINE>XMLBuilder xml = new XMLBuilder(out, GeneralUtils.UTF8_ENCODING);<NEW_LINE>xml.setButify(true);<NEW_LINE>try (final XMLBuilder.Element e = xml.startElement("folders")) {<NEW_LINE>for (Map.Entry<String, TabbedFolderState> entry : savedStates.entrySet()) {<NEW_LINE>try (final XMLBuilder.Element e2 = xml.startElement("folder")) {<NEW_LINE>xml.addAttribute("id", entry.getKey());<NEW_LINE>for (Map.Entry<String, TabbedFolderState.TabState> tab : entry.getValue().getTabStates().entrySet()) {<NEW_LINE>try (final XMLBuilder.Element e3 = xml.startElement("tab")) {<NEW_LINE>xml.addAttribute(<MASK><NEW_LINE>xml.addAttribute("height", tab.getValue().height);<NEW_LINE>xml.addAttribute("width", tab.getValue().width);<NEW_LINE>xml.addAttribute("embedded", tab.getValue().embedded);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>xml.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error saving tabs configuration", e);<NEW_LINE>}<NEW_LINE>}
"id", tab.getKey());
320,571
public NinjaRule parseNinjaRule() throws GenericParsingException {<NEW_LINE>parseExpected(NinjaToken.RULE);<NEW_LINE>String name = asString(parseExpected(NinjaToken.IDENTIFIER));<NEW_LINE>parseAndIgnoreWhitespace();<NEW_LINE>ImmutableSortedMap.Builder<NinjaRuleVariable, NinjaVariableValue> variablesBuilder = ImmutableSortedMap.naturalOrder();<NEW_LINE>parseExpected(NinjaToken.NEWLINE);<NEW_LINE>lexer.interpretPoolAsVariable();<NEW_LINE>while (parseIndentOrFinishDeclaration()) {<NEW_LINE>String variableName = asString(parseExpected(NinjaToken.IDENTIFIER));<NEW_LINE>parseExpected(NinjaToken.EQUALS);<NEW_LINE>NinjaVariableValue value = parseVariableValue();<NEW_LINE>NinjaRuleVariable <MASK><NEW_LINE>if (ninjaRuleVariable == null) {<NEW_LINE>throw new GenericParsingException(String.format("Unexpected variable '%s'", variableName));<NEW_LINE>}<NEW_LINE>variablesBuilder.put(ninjaRuleVariable, value);<NEW_LINE>if (lexer.hasNextToken()) {<NEW_LINE>parseExpected(NinjaToken.NEWLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new NinjaRule(nameInterner.intern(name), variablesBuilder.buildOrThrow());<NEW_LINE>}
ninjaRuleVariable = NinjaRuleVariable.nullOrValue(variableName);
748,418
default void validateTypeAndInterfaces(Object value, List<String> parentPath, String key, boolean strict) {<NEW_LINE>Class<?> cls = value.getClass();<NEW_LINE>if (!getType().isAssignableFrom(cls)) {<NEW_LINE>String path = key == null ? null : PathUtils.toString(PathUtils.extend(parentPath, key));<NEW_LINE>String msg = path == null ? "Value " + value + " does not conform to required type " + getType() + " of schema " + this : "Value " + value + " for " + path + " does not conform to required type " <MASK><NEW_LINE>Msg.error(this, msg);<NEW_LINE>if (strict) {<NEW_LINE>throw new AssertionError(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Class<? extends TargetObject> iface : getInterfaces()) {<NEW_LINE>if (!iface.isAssignableFrom(cls)) {<NEW_LINE>// TODO: Should this throw an exception, eventually?<NEW_LINE>String msg = "Value " + value + " does not implement required interface " + iface + " of schema " + this;<NEW_LINE>Msg.error(this, msg);<NEW_LINE>if (strict) {<NEW_LINE>throw new AssertionError(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ getType() + " of schema " + this;
1,497,249
/*<NEW_LINE>* Enum type extensions have the potential to be invalid if incorrectly defined.<NEW_LINE>*<NEW_LINE>* The named type must already be defined and must be an Enum type.<NEW_LINE>* All values of an Enum type extension must be unique.<NEW_LINE>* All values of an Enum type extension must not already be a value of the original Enum.<NEW_LINE>* Any directives provided must not already apply to the original Enum type.<NEW_LINE>*/<NEW_LINE>private void checkEnumTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Map<String, DirectiveDefinition> directiveDefinitionMap) {<NEW_LINE>typeRegistry.enumTypeExtensions().forEach((name, extensions) -> {<NEW_LINE>checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, EnumTypeDefinition.class);<NEW_LINE>checkTypeExtensionDirectiveRedefinition(errors, typeRegistry, name, extensions, EnumTypeDefinition.class, directiveDefinitionMap);<NEW_LINE>extensions.forEach(extension -> {<NEW_LINE>// field unique ness<NEW_LINE>List<EnumValueDefinition> enumValueDefinitions = extension.getEnumValueDefinitions();<NEW_LINE>checkNamedUniqueness(errors, enumValueDefinitions, EnumValueDefinition::getName, (namedField, enumValue) -> new NonUniqueNameError(extension, enumValue));<NEW_LINE>//<NEW_LINE>// enum values must be unique within a type extension<NEW_LINE>forEachBut(extension, extensions, otherTypeExt -> checkForEnumValueRedefinition(errors, otherTypeExt, otherTypeExt.getEnumValueDefinitions(), enumValueDefinitions));<NEW_LINE>//<NEW_LINE>// then check for field re-defs from the base type<NEW_LINE>Optional<EnumTypeDefinition> baseTypeOpt = typeRegistry.getType(extension.<MASK><NEW_LINE>baseTypeOpt.ifPresent(baseTypeDef -> checkForEnumValueRedefinition(errors, extension, enumValueDefinitions, baseTypeDef.getEnumValueDefinitions()));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
getName(), EnumTypeDefinition.class);
487,515
public DataPoint transform(DataPoint dp) {<NEW_LINE>Vec orig = dp.getNumericalValues();<NEW_LINE>final int nnz = orig.nnz();<NEW_LINE>if (// /make sparse<NEW_LINE>nnz / (double) orig.length() < factor) {<NEW_LINE>if (// already sparse, just return<NEW_LINE>orig.isSparse())<NEW_LINE>return dp;<NEW_LINE>// else, make sparse<NEW_LINE>// TODO create a constructor for this<NEW_LINE>SparseVector sv = new SparseVector(orig.length(), nnz);<NEW_LINE>for (int i = 0; i < orig.length(); i++) if (orig.get(i) != 0)<NEW_LINE>sv.set(i<MASK><NEW_LINE>return new DataPoint(sv, dp.getCategoricalValues(), dp.getCategoricalData());<NEW_LINE>} else // make dense<NEW_LINE>{<NEW_LINE>if (// already dense, just return<NEW_LINE>!orig.isSparse())<NEW_LINE>return dp;<NEW_LINE>DenseVector dv = new DenseVector(orig.length());<NEW_LINE>Iterator<IndexValue> iter = orig.getNonZeroIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>IndexValue indexValue = iter.next();<NEW_LINE>dv.set(indexValue.getIndex(), indexValue.getValue());<NEW_LINE>}<NEW_LINE>return new DataPoint(dv, dp.getCategoricalValues(), dp.getCategoricalData());<NEW_LINE>}<NEW_LINE>}
, orig.get(i));
1,094,183
public SidewalkDevice unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SidewalkDevice sidewalkDevice = new SidewalkDevice();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AmazonId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkDevice.setAmazonId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SidewalkId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkDevice.setSidewalkId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SidewalkManufacturingSn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkDevice.setSidewalkManufacturingSn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DeviceCertificates", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkDevice.setDeviceCertificates(new ListUnmarshaller<CertificateList>(CertificateListJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return sidewalkDevice;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
154,917
final GetDistributionMetricDataResult executeGetDistributionMetricData(GetDistributionMetricDataRequest getDistributionMetricDataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDistributionMetricDataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDistributionMetricDataRequest> request = null;<NEW_LINE>Response<GetDistributionMetricDataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDistributionMetricDataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDistributionMetricDataRequest));<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, "Lightsail");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDistributionMetricDataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDistributionMetricDataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDistributionMetricData");