idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,412,001
// Suppress high Cognitive Complexity warning<NEW_LINE>@SuppressWarnings("squid:S3776")<NEW_LINE>private SingleQuery constructSelectPlan(FilterOperator filterOperator, List<String> columnNames) throws QueryOperatorException {<NEW_LINE>FilterOperator timeFilter = null;<NEW_LINE>FilterOperator valueFilter = null;<NEW_LINE>List<FilterOperator> columnFilterOperators = new ArrayList<>();<NEW_LINE>List<FilterOperator> singleFilterList = null;<NEW_LINE>if (filterOperator.isSingle()) {<NEW_LINE>singleFilterList = new ArrayList<>();<NEW_LINE>singleFilterList.add(filterOperator);<NEW_LINE>} else if (filterOperator.getTokenIntType() == SQLConstant.KW_AND) {<NEW_LINE>// original query plan has been dealt with merge optimizer, thus all nodes with same<NEW_LINE>// path have been merged to one node<NEW_LINE>singleFilterList = filterOperator.getChildren();<NEW_LINE>}<NEW_LINE>if (singleFilterList == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<FilterOperator> valueList = new ArrayList<>();<NEW_LINE>for (FilterOperator child : singleFilterList) {<NEW_LINE>if (!child.isSingle()) {<NEW_LINE>valueList.add(child);<NEW_LINE>} else {<NEW_LINE>String singlePath = child.getSinglePath();<NEW_LINE>if (columnNames.contains(singlePath)) {<NEW_LINE>if (!columnFilterOperators.contains(child)) {<NEW_LINE>columnFilterOperators.add(child);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(child.getSinglePath()) {<NEW_LINE>case SQLConstant.RESERVED_TIME:<NEW_LINE>if (timeFilter != null) {<NEW_LINE>throw new QueryOperatorException("time filter has been specified more than once");<NEW_LINE>}<NEW_LINE>timeFilter = child;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>valueList.add(child);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (valueList.size() == 1) {<NEW_LINE>valueFilter = valueList.get(0);<NEW_LINE>} else if (valueList.size() > 1) {<NEW_LINE>valueFilter = new FilterOperator(SQLConstant.KW_AND, false);<NEW_LINE>valueFilter.childOperators = valueList;<NEW_LINE>}<NEW_LINE>return new SingleQuery(columnFilterOperators, timeFilter, valueFilter);<NEW_LINE>}
throw new QueryOperatorException("The same key filter has been specified more than once: " + singlePath);
1,124,216
protected Locale resolveLocale() {<NEW_LINE>Locale appLocale;<NEW_LINE>String lastLocale = this.loginProperties.loadLastLocale();<NEW_LINE>if (StringUtils.isNotEmpty(lastLocale)) {<NEW_LINE>appLocale = LocaleResolver.resolve(lastLocale);<NEW_LINE>} else {<NEW_LINE>appLocale = Locale.getDefault();<NEW_LINE>}<NEW_LINE>for (Locale locale : locales.values()) {<NEW_LINE>if (locale.equals(appLocale)) {<NEW_LINE>return locale;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if not found and application locale contains country, try to match by language only<NEW_LINE>if (StringUtils.isNotEmpty(appLocale.getCountry())) {<NEW_LINE>Locale languageTagLocale = Locale.forLanguageTag(appLocale.getLanguage());<NEW_LINE>for (Locale locale : locales.values()) {<NEW_LINE>if (Locale.forLanguageTag(locale.getLanguage()).equals(languageTagLocale)) {<NEW_LINE>return locale;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// return first locale set in the cuba.availableLocales app property<NEW_LINE>return locales.values()<MASK><NEW_LINE>}
.iterator().next();
683,626
// Pending https://github.com/SpongePowered/Mixin/issues/312<NEW_LINE>// @Group(name = "org.spongepowered.tracker:bonemeal", min = 1, max = 1)<NEW_LINE>@Redirect(method = "applyBonemeal(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/EnumHand;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/IGrowable;grow(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;)V"), require = 1, expect = 0)<NEW_LINE>private static void forgeImpl$wrapGrowWithPhase(final IGrowable iGrowable, final World worldIn, final Random rand, final BlockPos pos, final IBlockState blockState, final ItemStack stack, final World sameWorld, final BlockPos target, final EntityPlayer player, @Nullable final EnumHand hand) {<NEW_LINE>if (((WorldBridge) worldIn).bridge$isFake() || !ShouldFire.CHANGE_BLOCK_EVENT_GROW) {<NEW_LINE>iGrowable.grow(worldIn, rand, pos, blockState);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PhaseContext<?> current = PhaseTracker.getInstance().getCurrentContext();<NEW_LINE>final IPhaseState state = current.state;<NEW_LINE>final boolean doesBulk = state.doesBulkBlockCapture(current);<NEW_LINE>final boolean <MASK><NEW_LINE>if (doesBulk || doesEvent) {<NEW_LINE>// We can enter the new phase state.<NEW_LINE>try (final GrowablePhaseContext context = BlockPhase.State.GROWING.createPhaseContext().provideItem(stack).world(worldIn).block(blockState).pos(pos)) {<NEW_LINE>context.buildAndSwitch();<NEW_LINE>iGrowable.grow(worldIn, rand, pos, blockState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
doesEvent = state.doesBlockEventTracking(current);
1,164,528
public final void start(MatchedEventMap beginState) {<NEW_LINE>AgentInstanceContext agentInstanceContext = evalEveryNode.getContext().getAgentInstanceContext();<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qPatternEveryStart(evalEveryNode.factoryNode, beginState);<NEW_LINE>agentInstanceContext.getAuditProvider().patternInstance(true, evalEveryNode.factoryNode, agentInstanceContext);<NEW_LINE>this.beginState = beginState.shallowCopy();<NEW_LINE>EvalStateNode childState = evalEveryNode.getChildNode().newState(this);<NEW_LINE>spawnedNodes.add(childState);<NEW_LINE>// During the start of the child we need to use the temporary evaluator to catch any event created during a start.<NEW_LINE>// Events created during the start would likely come from the "not" operator.<NEW_LINE>// Quit the new child again if<NEW_LINE>EvalEveryStateSpawnEvaluator spawnEvaluator = new EvalEveryStateSpawnEvaluator(evalEveryNode.<MASK><NEW_LINE>childState.setParentEvaluator(spawnEvaluator);<NEW_LINE>childState.start(beginState);<NEW_LINE>// If the spawned expression turned true already, just quit it<NEW_LINE>if (spawnEvaluator.isEvaluatedTrue()) {<NEW_LINE>childState.quit();<NEW_LINE>} else {<NEW_LINE>childState.setParentEvaluator(this);<NEW_LINE>}<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aPatternEveryStart();<NEW_LINE>}
getContext().getStatementName());
592,891
public void run(RegressionEnvironment env) {<NEW_LINE>Module module = makeModule("com.testit", "@Name('A') select SupportStaticMethodLib.plusOne(intPrimitive) as val from SupportBean");<NEW_LINE>module.getImports().add(SupportStaticMethodLib.class.getPackage().getName() + ".*");<NEW_LINE>EPCompiled compiled = compileModule(env, module);<NEW_LINE>env.deploy(compiled).addListener("A");<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>assertEquals(5, env.listener("A").assertOneGetNewAndReset().get("val"));<NEW_LINE>env.undeployAll();<NEW_LINE>String epl = "import " + SupportStaticMethodLib.class.getName() + ";\n" + "@Name('A') select SupportStaticMethodLib.plusOne(intPrimitive) as val from SupportBean;\n";<NEW_LINE>env.compileDeploy(epl).addListener("A");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 6));<NEW_LINE>assertEquals(7, env.listener("A").assertOneGetNewAndReset().get("val"));<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E1", 4));
584,391
public void onServiceConnected(ComponentName name, IBinder service) {<NEW_LINE>if (isDisposed())<NEW_LINE>return;<NEW_LINE>logDebug("Billing service connected.");<NEW_LINE>mService = getInAppBillingService(service);<NEW_LINE>String packageName = mContext.getPackageName();<NEW_LINE>IabResult result = new IabResult(OK);<NEW_LINE>try {<NEW_LINE>logDebug("Checking for in-app billing 3 support.");<NEW_LINE>int response = mService.isBillingSupported(API_VERSION, <MASK><NEW_LINE>if (response == OK.code) {<NEW_LINE>logDebug("In-app billing version 3 supported for " + packageName);<NEW_LINE>mInAppSupported = true;<NEW_LINE>logDebug("Checking for in-app billing 3 subscription support.");<NEW_LINE>response = mService.isBillingSupported(API_VERSION, packageName, SUBS.toString());<NEW_LINE>if (response == OK.code) {<NEW_LINE>logDebug("Subscriptions AVAILABLE.");<NEW_LINE>mSubscriptionsSupported = true;<NEW_LINE>} else {<NEW_LINE>logDebug("Subscriptions NOT AVAILABLE. Response: " + response + " " + Response.getDescription(response));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = new IabResult(response, null);<NEW_LINE>}<NEW_LINE>} catch (RemoteException e) {<NEW_LINE>result = new IabResult(IABHELPER_REMOTE_EXCEPTION);<NEW_LINE>Log.e(mDebugTag, "RemoteException while setting up in-app billing.", e);<NEW_LINE>} finally {<NEW_LINE>mSetupDone = true;<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onIabSetupFinished(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
packageName, INAPP.toString());
473,122
public PrincipalPermissions unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PrincipalPermissions principalPermissions = new PrincipalPermissions();<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("Principal", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>principalPermissions.setPrincipal(DataLakePrincipalJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Permissions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>principalPermissions.setPermissions(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return principalPermissions;<NEW_LINE>}
)).unmarshall(context));
592,601
public static void destroy(String userName, String password, String appId) throws SaturnJobConsoleException {<NEW_LINE>String urlStr = SaturnEnvProperties.VIP_SATURN_DCOS_REST_URI + API_VERSION_DES + appId;<NEW_LINE>CloseableHttpClient httpClient = HttpClients.createDefault();<NEW_LINE>try {<NEW_LINE>HttpDelete httpDelete = new HttpDelete(urlStr);<NEW_LINE>httpDelete.setHeader(AUTHORIZATION_DES, BASIC_DES + Base64.encodeBase64String((userName + ":" + password).getBytes(UTF8_DES)));<NEW_LINE>CloseableHttpResponse <MASK><NEW_LINE>StatusLine statusLine = httpResponse.getStatusLine();<NEW_LINE>if (statusLine != null) {<NEW_LINE>int statusCode = statusLine.getStatusCode();<NEW_LINE>String reasonPhrase = statusLine.getReasonPhrase();<NEW_LINE>if (statusCode != 200) {<NEW_LINE>HttpEntity entity = httpResponse.getEntity();<NEW_LINE>if (entity != null) {<NEW_LINE>String entityContent = getEntityContent(entity);<NEW_LINE>throw new SaturnJobConsoleException(entityContent);<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("statusCode is " + statusCode + ", reasonPhrase is " + reasonPhrase);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("Not status returned, url is " + urlStr);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>throw new SaturnJobConsoleException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>httpClient.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
httpResponse = httpClient.execute(httpDelete);
1,852,015
private void o3SortFixColumn(int columnIndex, final int columnType, long mergedTimestampsAddr, long valueCount) {<NEW_LINE>final int columnOffset = getPrimaryColumnIndex(columnIndex);<NEW_LINE>final MemoryCARW mem = o3Columns.getQuick(columnOffset);<NEW_LINE>final MemoryCARW mem2 = o3Columns2.getQuick(columnOffset);<NEW_LINE>final long src = mem.addressOf(0);<NEW_LINE>final long srcSize = mem.size();<NEW_LINE>final int shl = ColumnType.pow2SizeOf(columnType);<NEW_LINE><MASK><NEW_LINE>final long tgtDataAddr = mem2.addressOf(0);<NEW_LINE>final long tgtDataSize = mem2.size();<NEW_LINE>switch(shl) {<NEW_LINE>case 0:<NEW_LINE>Vect.indexReshuffle8Bit(src, tgtDataAddr, mergedTimestampsAddr, valueCount);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>Vect.indexReshuffle16Bit(src, tgtDataAddr, mergedTimestampsAddr, valueCount);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>Vect.indexReshuffle32Bit(src, tgtDataAddr, mergedTimestampsAddr, valueCount);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>Vect.indexReshuffle64Bit(src, tgtDataAddr, mergedTimestampsAddr, valueCount);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>Vect.indexReshuffle256Bit(src, tgtDataAddr, mergedTimestampsAddr, valueCount);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false : "col type is unsupported";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>mem.replacePage(tgtDataAddr, tgtDataSize);<NEW_LINE>mem2.replacePage(src, srcSize);<NEW_LINE>}
mem2.jumpTo(valueCount << shl);
551,155
public static List<MatchedEventMap> generateMatchEvents(MatchedEventMap matchEvent, Object[] eventsPerChild, int indexFrom) {<NEW_LINE>// Place event list for each child state node into an array, excluding the node where the event came from<NEW_LINE>ArrayList<List<MatchedEventMap>> listArray = new ArrayList<MASK><NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < eventsPerChild.length; i++) {<NEW_LINE>Object eventsChild = eventsPerChild[i];<NEW_LINE>if (indexFrom != i && eventsChild != null) {<NEW_LINE>if (eventsChild instanceof MatchedEventMap) {<NEW_LINE>listArray.add(index++, Collections.singletonList((MatchedEventMap) eventsChild));<NEW_LINE>} else {<NEW_LINE>listArray.add(index++, (List<MatchedEventMap>) eventsChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Recusively generate MatchedEventMap instances for all accumulated events<NEW_LINE>List<MatchedEventMap> results = new ArrayList<MatchedEventMap>();<NEW_LINE>generateMatchEvents(listArray, 0, results, matchEvent);<NEW_LINE>return results;<NEW_LINE>}
<List<MatchedEventMap>>();
1,334,204
public static DescribeHanaInstancesResponse unmarshall(DescribeHanaInstancesResponse describeHanaInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHanaInstancesResponse.setRequestId(_ctx.stringValue("DescribeHanaInstancesResponse.RequestId"));<NEW_LINE>describeHanaInstancesResponse.setSuccess(_ctx.booleanValue("DescribeHanaInstancesResponse.Success"));<NEW_LINE>describeHanaInstancesResponse.setCode(_ctx.stringValue("DescribeHanaInstancesResponse.Code"));<NEW_LINE>describeHanaInstancesResponse.setMessage(_ctx.stringValue("DescribeHanaInstancesResponse.Message"));<NEW_LINE>describeHanaInstancesResponse.setTotalCount(_ctx.integerValue("DescribeHanaInstancesResponse.TotalCount"));<NEW_LINE>describeHanaInstancesResponse.setPageSize(_ctx.integerValue("DescribeHanaInstancesResponse.PageSize"));<NEW_LINE>describeHanaInstancesResponse.setPageNumber(_ctx.integerValue("DescribeHanaInstancesResponse.PageNumber"));<NEW_LINE>List<Hana> hanas = new ArrayList<Hana>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHanaInstancesResponse.Hanas.Length"); i++) {<NEW_LINE>Hana hana = new Hana();<NEW_LINE>hana.setClusterId(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].ClusterId"));<NEW_LINE>hana.setHanaName(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].HanaName"));<NEW_LINE>hana.setVaultId(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].VaultId"));<NEW_LINE>hana.setHost(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].Host"));<NEW_LINE>hana.setInstanceNumber(_ctx.integerValue("DescribeHanaInstancesResponse.Hanas[" + i + "].InstanceNumber"));<NEW_LINE>hana.setUserName(_ctx.stringValue<MASK><NEW_LINE>hana.setUseSsl(_ctx.booleanValue("DescribeHanaInstancesResponse.Hanas[" + i + "].UseSsl"));<NEW_LINE>hana.setValidateCertificate(_ctx.booleanValue("DescribeHanaInstancesResponse.Hanas[" + i + "].ValidateCertificate"));<NEW_LINE>hana.setAlertSetting(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].AlertSetting"));<NEW_LINE>hana.setContactId(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].ContactId"));<NEW_LINE>hana.setStatus(_ctx.longValue("DescribeHanaInstancesResponse.Hanas[" + i + "].Status"));<NEW_LINE>hana.setStatusMessage(_ctx.stringValue("DescribeHanaInstancesResponse.Hanas[" + i + "].StatusMessage"));<NEW_LINE>hanas.add(hana);<NEW_LINE>}<NEW_LINE>describeHanaInstancesResponse.setHanas(hanas);<NEW_LINE>return describeHanaInstancesResponse;<NEW_LINE>}
("DescribeHanaInstancesResponse.Hanas[" + i + "].UserName"));
632,720
private HttpResponse tenantInvoice(RestApi.RequestContext requestContext) {<NEW_LINE>var tenantName = TenantName.from(requestContext.pathParameters().getStringOrThrow("tenant"));<NEW_LINE>var tenant = tenants.require(tenantName, CloudTenant.class);<NEW_LINE>var invoiceId = requestContext.pathParameters().getStringOrThrow("invoice");<NEW_LINE>var format = requestContext.queryParameters().getString("format").orElse("json");<NEW_LINE>var invoice = billing.getBillsForTenant(tenant.name()).stream().filter(inv -> inv.id().value().equals(invoiceId)).findAny().orElseThrow(RestApiException.NotFound::new);<NEW_LINE>if (format.equals("json")) {<NEW_LINE>var slime = new Slime();<NEW_LINE>toSlime(slime.setObject(), invoice);<NEW_LINE>return new SlimeJsonResponse(slime);<NEW_LINE>}<NEW_LINE>if (format.equals("csv")) {<NEW_LINE>var csv = toCsv(invoice);<NEW_LINE>return new CsvResponse(CSV_INVOICE_HEADER, csv);<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}
RestApiException.BadRequest("Unknown format: " + format);
1,534,950
public static Observable<TwoDataBean<BookShelfBean, List<BookChapterBean>>> changeBookSource(SearchBookBean searchBook, BookShelfBean oldBook) {<NEW_LINE>BookShelfBean bookShelfBean = BookshelfHelp.getBookFromSearchBook(searchBook);<NEW_LINE>bookShelfBean.<MASK><NEW_LINE>bookShelfBean.setLastChapterName(oldBook.getLastChapterName());<NEW_LINE>bookShelfBean.setDurChapterName(oldBook.getDurChapterName());<NEW_LINE>bookShelfBean.setDurChapter(oldBook.getDurChapter());<NEW_LINE>bookShelfBean.setDurChapterPage(oldBook.getDurChapterPage());<NEW_LINE>bookShelfBean.setReplaceEnable(oldBook.getReplaceEnable());<NEW_LINE>bookShelfBean.setAllowUpdate(oldBook.getAllowUpdate());<NEW_LINE>return WebBookModel.getInstance().getBookInfo(bookShelfBean).flatMap(book -> WebBookModel.getInstance().getChapterList(book)).flatMap(chapterBeanList -> saveChangedBook(bookShelfBean, oldBook, chapterBeanList)).compose(RxUtils::toSimpleSingle);<NEW_LINE>}
setSerialNumber(oldBook.getSerialNumber());
1,389,605
public FeedbackResponseAttributes updateFeedbackResponseCascade(FeedbackResponseAttributes.UpdateOptions updateOptions) throws InvalidParametersException, EntityDoesNotExistException, EntityAlreadyExistsException {<NEW_LINE>FeedbackResponseAttributes oldResponse = frDb.getFeedbackResponse(updateOptions.getFeedbackResponseId());<NEW_LINE>FeedbackResponseAttributes newResponse = frDb.updateFeedbackResponse(updateOptions);<NEW_LINE>boolean isResponseIdChanged = !oldResponse.getId().equals(newResponse.getId());<NEW_LINE>boolean isGiverSectionChanged = !oldResponse.getGiverSection().equals(newResponse.getGiverSection());<NEW_LINE>boolean isRecipientSectionChanged = !oldResponse.getRecipientSection().equals(newResponse.getRecipientSection());<NEW_LINE>if (isResponseIdChanged || isGiverSectionChanged || isRecipientSectionChanged) {<NEW_LINE>List<FeedbackResponseCommentAttributes> responseComments = frcLogic.getFeedbackResponseCommentForResponse(oldResponse.getId());<NEW_LINE>for (FeedbackResponseCommentAttributes responseComment : responseComments) {<NEW_LINE>FeedbackResponseCommentAttributes.UpdateOptions.Builder updateOptionsBuilder = FeedbackResponseCommentAttributes.<MASK><NEW_LINE>if (isResponseIdChanged) {<NEW_LINE>updateOptionsBuilder.withFeedbackResponseId(newResponse.getId());<NEW_LINE>}<NEW_LINE>if (isGiverSectionChanged) {<NEW_LINE>updateOptionsBuilder.withGiverSection(newResponse.getGiverSection());<NEW_LINE>}<NEW_LINE>if (isRecipientSectionChanged) {<NEW_LINE>updateOptionsBuilder.withReceiverSection(newResponse.getRecipientSection());<NEW_LINE>}<NEW_LINE>frcLogic.updateFeedbackResponseComment(updateOptionsBuilder.build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newResponse;<NEW_LINE>}
updateOptionsBuilder(responseComment.getId());
1,653,779
public BlobServiceSasQueryParameters generateSasQueryParameters(UserDelegationKey delegationKey, String accountName) {<NEW_LINE>StorageImplUtils.assertNotNull("delegationKey", delegationKey);<NEW_LINE>StorageImplUtils.assertNotNull("accountName", accountName);<NEW_LINE>ensureState();<NEW_LINE>// Signature is generated on the un-url-encoded values.<NEW_LINE>final String canonicalName = getCanonicalName(accountName);<NEW_LINE>String signature = StorageImplUtils.computeHMac256(delegationKey.getValue(), stringToSign(delegationKey, canonicalName));<NEW_LINE>return new BlobServiceSasQueryParameters(VERSION_DEPRECATED_USER_DELEGATION_SAS_STRING_TO_SIGN, this.protocol, this.startTime, this.expiryTime, this.sasIpRange, null, /* identifier */<NEW_LINE>this.resource, this.permissions, signature, this.cacheControl, this.contentDisposition, this.contentEncoding, this.<MASK><NEW_LINE>}
contentLanguage, this.contentType, delegationKey);
1,166,505
public static void main(String[] args) {<NEW_LINE>StaticBinding obj = new StaticBinding();<NEW_LINE>// "Adding integers" due to auto-boxing from int to Integer<NEW_LINE>obj.sum(2, 3);<NEW_LINE>// "Adding integers" due to exact parameter types<NEW_LINE>obj.sum(Integer.valueOf(2), Integer.valueOf(3));<NEW_LINE>// "Adding integers" due to type promotion from byte to int<NEW_LINE>obj.sum(2, 0x1);<NEW_LINE>// "Adding numbers" due to explicit cast to Number<NEW_LINE>obj.sum((Number) 2, (Number) 3);<NEW_LINE>// "Adding numbers" due to auto-boxing from double to Double<NEW_LINE>obj.sum(2.0d, 3.0d);<NEW_LINE>// "Adding numbers" due to polimorphism<NEW_LINE>obj.sum(Float.valueOf(2), Float.valueOf(3));<NEW_LINE>// "Adding objects" due to explicit cast to Object<NEW_LINE>obj.sum((Object<MASK><NEW_LINE>// "Adding objects" due to polimorphism<NEW_LINE>obj.sum(2, "John");<NEW_LINE>// "Adding variable arguments 2"<NEW_LINE>obj.sum(new Object(), new Object(), new Object());<NEW_LINE>// "Adding variable arguments 1"<NEW_LINE>obj.sum(new Object(), new Object[] { new Object() });<NEW_LINE>}
) 2, (Object) 3);
1,780,350
private static InputOutputFormatCatalog createCatalog(Params params, ClassLoader classLoader) {<NEW_LINE>String catalogName = params.get(OdpsCatalogParams.CATALOG_NAME);<NEW_LINE>CatalogFactory factory = createCatalogFactory(classLoader);<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put(CATALOG_ODPS_ACCESS_ID, params<MASK><NEW_LINE>properties.put(CATALOG_ODPS_ACCESS_KEY, params.get(OdpsCatalogParams.ACCESS_KEY));<NEW_LINE>properties.put(CATALOG_ODPS_ENDPOINT, params.get(OdpsCatalogParams.END_POINT));<NEW_LINE>properties.put(CATALOG_ODPS_PROJECT, params.get(OdpsCatalogParams.PROJECT));<NEW_LINE>if (params.get(OdpsCatalogParams.RUNNING_PROJECT) != null) {<NEW_LINE>properties.put(CATALOG_ODPS_RUNNING_PROJECT, params.get(OdpsCatalogParams.RUNNING_PROJECT));<NEW_LINE>}<NEW_LINE>Context context = new DefaultCatalogContext(catalogName, properties, null, null);<NEW_LINE>return (InputOutputFormatCatalog) factory.createCatalog(context);<NEW_LINE>}
.get(OdpsCatalogParams.ACCESS_ID));
128,108
private LightData createLightData() {<NEW_LINE>BitSet skyMask = new BitSet();<NEW_LINE>BitSet blockMask = new BitSet();<NEW_LINE>BitSet emptySkyMask = new BitSet();<NEW_LINE>BitSet emptyBlockMask = new BitSet();<NEW_LINE>List<byte[]> skyLights = new ArrayList<>();<NEW_LINE>List<byte[]> blockLights = new ArrayList<>();<NEW_LINE>int index = 0;<NEW_LINE>for (Section section : sections) {<NEW_LINE>index++;<NEW_LINE>final byte[] skyLight = section.getSkyLight();<NEW_LINE>final byte[<MASK><NEW_LINE>if (skyLight.length != 0) {<NEW_LINE>skyLights.add(skyLight);<NEW_LINE>skyMask.set(index);<NEW_LINE>} else {<NEW_LINE>emptySkyMask.set(index);<NEW_LINE>}<NEW_LINE>if (blockLight.length != 0) {<NEW_LINE>blockLights.add(blockLight);<NEW_LINE>blockMask.set(index);<NEW_LINE>} else {<NEW_LINE>emptyBlockMask.set(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LightData(true, skyMask, blockMask, emptySkyMask, emptyBlockMask, skyLights, blockLights);<NEW_LINE>}
] blockLight = section.getBlockLight();
1,217,849
public boolean addAll(Collection c) {<NEW_LINE>if (!allowNulls && c.contains(null)) {<NEW_LINE>throw new JDOUserException(// NOI18N<NEW_LINE>I18NHelper.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>messages, "sco.nulls_not_allowed"));<NEW_LINE>}<NEW_LINE>java.util.Vector errc = <MASK><NEW_LINE>if (elementType != null) {<NEW_LINE>// iterate the collection and make a list of wrong elements.<NEW_LINE>Iterator i = c.iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>Object o = i.next();<NEW_LINE>if (!elementType.isAssignableFrom(o.getClass()))<NEW_LINE>errc.add(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!errc.isEmpty()) {<NEW_LINE>throw new JDOUserException(// NOI18N<NEW_LINE>I18NHelper.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>messages, // NOI18N<NEW_LINE>"sco.classcastexception", (elementType != null ? elementType.getName() : "")), new ClassCastException(), errc.toArray());<NEW_LINE>}<NEW_LINE>// Mark the field as dirty<NEW_LINE>StateManager stateManager = this.makeDirty();<NEW_LINE>removed.removeAll(c);<NEW_LINE>added.addAll(c);<NEW_LINE>boolean modified = super.addAll(c);<NEW_LINE>// Apply updates<NEW_LINE>this.applyUpdates(stateManager, modified);<NEW_LINE>return modified;<NEW_LINE>}
new java.util.Vector();
510,292
public void emit() {<NEW_LINE>if (!isAvailable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cueSet.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mute && requestFocus()) {<NEW_LINE>for (Entry e : cueList) {<NEW_LINE>final String utId = getId(e.text);<NEW_LINE>outstanding.add(utId);<NEW_LINE>HashMap<String<MASK><NEW_LINE>if (params == null) {<NEW_LINE>params = new HashMap<>();<NEW_LINE>}<NEW_LINE>params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, utId);<NEW_LINE>int res = textToSpeech.speak(e.text, TextToSpeech.QUEUE_ADD, params);<NEW_LINE>if (res == TextToSpeech.ERROR) {<NEW_LINE>Log.e(getClass().getName(), "res == ERROR emit() text: " + e.text + ", utId: " + utId + ") outstanding.size(): " + outstanding.size());<NEW_LINE>outstanding.remove(utId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outstanding.isEmpty()) {<NEW_LINE>audioManager.abandonAudioFocus(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Entry e : cueList) {<NEW_LINE>textToSpeech.speak(e.text, TextToSpeech.QUEUE_ADD, e.params);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cueSet.clear();<NEW_LINE>cueList.clear();<NEW_LINE>}
, String> params = e.params;
1,520,127
protected void updatePartnerAddress(Partner partner) throws AxelorException {<NEW_LINE><MASK><NEW_LINE>if (!partner.getIsContact() && !partner.getIsEmployee()) {<NEW_LINE>if (partner.getPartnerAddressList() != null) {<NEW_LINE>partner.setMainAddress(checkDefaultAddress(partner));<NEW_LINE>}<NEW_LINE>} else if (address == null) {<NEW_LINE>partner.removePartnerAddressListItem(JPA.all(PartnerAddress.class).filter("self.partner = :partnerId AND self.isDefaultAddr = 't'").bind("partnerId", partner.getId()).fetchOne());<NEW_LINE>} else if (partner.getPartnerAddressList() != null && partner.getPartnerAddressList().stream().map(PartnerAddress::getAddress).noneMatch(address::equals)) {<NEW_LINE>PartnerAddress mainAddress = new PartnerAddress();<NEW_LINE>mainAddress.setAddress(address);<NEW_LINE>mainAddress.setIsDefaultAddr(true);<NEW_LINE>mainAddress.setIsDeliveryAddr(true);<NEW_LINE>mainAddress.setIsInvoicingAddr(true);<NEW_LINE>partner.addPartnerAddressListItem(mainAddress);<NEW_LINE>}<NEW_LINE>}
Address address = partner.getMainAddress();
131,370
public boolean evaluate(HttpServletRequest request, HttpServletResponse response, Instance instance) {<NEW_LINE>boolean result;<NEW_LINE>try {<NEW_LINE>Optional<Visitor> <MASK><NEW_LINE>if (opt.isPresent()) {<NEW_LINE>Visitor visitor = opt.get();<NEW_LINE>Persona currentPersona = (Persona) visitor.getPersona();<NEW_LINE>User user = userAPI.getSystemUser();<NEW_LINE>Persona inputPersona = personaAPI.find(instance.personaId, user, false);<NEW_LINE>if (inputPersona == null) {<NEW_LINE>Logger.warn(this, "Persona with id '" + instance.personaId + "' not be found. Could not evaluate condition.");<NEW_LINE>result = false;<NEW_LINE>} else if (currentPersona == null) {<NEW_LINE>Logger.warn(this, "Persona is not set in Visitor object. Could not evaluate condition.");<NEW_LINE>result = false;<NEW_LINE>} else {<NEW_LINE>result = instance.comparison.perform(currentPersona, inputPersona);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Logger.warn(this, "No visitor was available. Could not evaluate condition.");<NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuleEvaluationFailedException(e, "Could not evaluate condition %s", this.getClass().getName());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
opt = visitorAPI.getVisitor(request);
219,574
public void confirmClose(Command onConfirmed) {<NEW_LINE>List<Job> jobs = pJobManager_.get().getJobs();<NEW_LINE>// if there are no jobs, go ahead and let the tab close<NEW_LINE>if (jobs.isEmpty()) {<NEW_LINE>display_.setShowTabPref(false);<NEW_LINE>onConfirmed.execute();<NEW_LINE>}<NEW_LINE>// count the number of running session jobs<NEW_LINE>long running = jobs.stream().filter(t -> t.type == JobConstants.JOB_TYPE_SESSION && t.state == JobConstants.STATE_RUNNING).count();<NEW_LINE>if (running > 0) {<NEW_LINE>globalDisplay_.showMessage(GlobalDisplay.MSG_INFO, constants_.localJobsRunningCaption(), constants_.localJobsRunningMessage(running > 1 ? constants_.localJobsUnfinished() <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// done, okay to close<NEW_LINE>display_.setShowTabPref(false);<NEW_LINE>onConfirmed.execute();<NEW_LINE>}
: constants_.localJobUnfinished()));
1,285,988
public void close() throws DocumentException, IOException {<NEW_LINE>if (!hasSignature) {<NEW_LINE>if (cleanMetadata && stamper.xmpMetadata == null) {<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>XmpWriter writer = new XmpWriter(baos, moreInfo);<NEW_LINE>writer.close();<NEW_LINE>stamper.setXmpMetadata(baos.toByteArray());<NEW_LINE>} catch (IOException ignore) {<NEW_LINE>// ignore exception<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stamper.close(moreInfo);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sigApp.preClose();<NEW_LINE><MASK><NEW_LINE>PdfLiteral lit = (PdfLiteral) sig.get(PdfName.CONTENTS);<NEW_LINE>int totalBuf = (lit.getPosLength() - 2) / 2;<NEW_LINE>byte[] buf = new byte[8192];<NEW_LINE>int n;<NEW_LINE>InputStream inp = sigApp.getRangeStream();<NEW_LINE>try {<NEW_LINE>while ((n = inp.read(buf)) > 0) {<NEW_LINE>sig.getSigner().update(buf, 0, n);<NEW_LINE>}<NEW_LINE>} catch (SignatureException se) {<NEW_LINE>throw new ExceptionConverter(se);<NEW_LINE>}<NEW_LINE>buf = new byte[totalBuf];<NEW_LINE>byte[] bsig = sig.getSignerContents();<NEW_LINE>System.arraycopy(bsig, 0, buf, 0, bsig.length);<NEW_LINE>PdfString str = new PdfString(buf);<NEW_LINE>str.setHexWriting(true);<NEW_LINE>PdfDictionary dic = new PdfDictionary();<NEW_LINE>dic.put(PdfName.CONTENTS, str);<NEW_LINE>sigApp.close(dic);<NEW_LINE>stamper.reader.close();<NEW_LINE>}
PdfSigGenericPKCS sig = sigApp.getSigStandard();
715,266
protected void paintIcon(Component c, Graphics2D g) {<NEW_LINE>boolean indeterminate = isIndeterminate(c);<NEW_LINE>boolean selected = indeterminate || isSelected(c);<NEW_LINE>boolean isFocused = FlatUIUtils.isPermanentFocusOwner(c);<NEW_LINE>float bw = selected ? (disabledSelectedBorderWidth != Float.MIN_VALUE && !c.isEnabled() ? disabledSelectedBorderWidth : (selectedBorderWidth != Float.MIN_VALUE ? selectedBorderWidth : borderWidth)) : borderWidth;<NEW_LINE>// paint focused border<NEW_LINE>if (isFocused && focusWidth > 0 && FlatButtonUI.isFocusPainted(c)) {<NEW_LINE>g.setColor(getFocusColor(c));<NEW_LINE>paintFocusBorder(c, g);<NEW_LINE>}<NEW_LINE>// paint border<NEW_LINE>g.setColor(getBorderColor(c, selected));<NEW_LINE>paintBorder(c, g, bw);<NEW_LINE>// paint background<NEW_LINE>Color bg = FlatUIUtils.deriveColor(getBackground(c, selected), selected ? selectedBackground : background);<NEW_LINE>if (bg.getAlpha() < 255) {<NEW_LINE>// fill background with default color before filling with non-opaque background<NEW_LINE>g.setColor(selected ? selectedBackground : background);<NEW_LINE>paintBackground(c, g, bw);<NEW_LINE>}<NEW_LINE>g.setColor(bg);<NEW_LINE>paintBackground(c, g, bw);<NEW_LINE>// paint checkmark<NEW_LINE>if (selected) {<NEW_LINE>g<MASK><NEW_LINE>if (indeterminate)<NEW_LINE>paintIndeterminate(c, g);<NEW_LINE>else<NEW_LINE>paintCheckmark(c, g);<NEW_LINE>}<NEW_LINE>}
.setColor(getCheckmarkColor(c));
1,633,483
public SortDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SortDefinition sortDefinition = new SortDefinition();<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("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sortDefinition.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SortOrder", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sortDefinition.setSortOrder(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return sortDefinition;<NEW_LINE>}
class).unmarshall(context));
927,848
public Identifier findFromInode(final String inodeOrIdentifier) throws DotDataException {<NEW_LINE>Identifier identifier = identifierFactory.loadFromCache(inodeOrIdentifier);<NEW_LINE>if (identifier == null || !InodeUtils.isSet(identifier.getInode())) {<NEW_LINE>identifier = identifierFactory.loadFromCacheFromInode(inodeOrIdentifier);<NEW_LINE>}<NEW_LINE>if (identifier == null || !InodeUtils.isSet(identifier.getInode())) {<NEW_LINE>try {<NEW_LINE>Contentlet con = contentletAPI.find(inodeOrIdentifier, APILocator.getUserAPI().getSystemUser(), false);<NEW_LINE>if (con != null && InodeUtils.isSet(con.getInode())) {<NEW_LINE>identifier = identifierFactory.find(con.getIdentifier());<NEW_LINE>return identifier;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.debug(this, "Unable to find inodeOrIdentifier as content : ", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return identifier;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>identifier = identifierFactory.find(inodeOrIdentifier);<NEW_LINE>} catch (DotHibernateException e) {<NEW_LINE>Logger.<MASK><NEW_LINE>}<NEW_LINE>if (identifier == null || !InodeUtils.isSet(identifier.getInode())) {<NEW_LINE>identifier = identifierFactory.find(InodeFactory.getInode(inodeOrIdentifier, Inode.class));<NEW_LINE>}<NEW_LINE>if (identifier != null && InodeUtils.isSet(identifier.getId())) {<NEW_LINE>CacheLocator.getIdentifierCache().addIdentifierToCache(identifier.getId(), inodeOrIdentifier);<NEW_LINE>}<NEW_LINE>return identifier;<NEW_LINE>}
debug(this, "Unable to find inodeOrIdentifier as identifier : ", e);
1,095,450
public void paintTrack(Graphics g) {<NEW_LINE>boolean enabled = slider.isEnabled();<NEW_LINE>float tw = UIScale.scale((float) trackWidth);<NEW_LINE>float arc = tw;<NEW_LINE>// get rectangle of second thumb<NEW_LINE>Point p = adjustThumbForHighValue();<NEW_LINE>Rectangle thumbRect2 = new Rectangle(thumbRect);<NEW_LINE>restoreThumbForLowValue(p);<NEW_LINE>RoundRectangle2D coloredTrack = null;<NEW_LINE>RoundRectangle2D track;<NEW_LINE>if (slider.getOrientation() == JSlider.HORIZONTAL) {<NEW_LINE>float y = trackRect.y + (trackRect.height - tw) / 2f;<NEW_LINE>if (enabled) {<NEW_LINE>Rectangle thumbRect1 = thumbRect;<NEW_LINE>if (!slider.getComponentOrientation().isLeftToRight()) {<NEW_LINE>Rectangle temp = thumbRect1;<NEW_LINE>thumbRect1 = thumbRect2;<NEW_LINE>thumbRect2 = temp;<NEW_LINE>}<NEW_LINE>int cx = thumbRect1.x + (thumbRect1.width / 2);<NEW_LINE>int cw = thumbRect2.x - thumbRect1.x;<NEW_LINE>coloredTrack = new RoundRectangle2D.Float(cx, y, cw, tw, arc, arc);<NEW_LINE>}<NEW_LINE>track = new RoundRectangle2D.Float(trackRect.x, y, trackRect.width, tw, arc, arc);<NEW_LINE>} else {<NEW_LINE>float x = trackRect.x + (trackRect.width - tw) / 2f;<NEW_LINE>if (enabled) {<NEW_LINE>int cy = thumbRect2.y + (thumbRect2.height / 2);<NEW_LINE>int ch = thumbRect.y - thumbRect2.y;<NEW_LINE>coloredTrack = new RoundRectangle2D.Float(x, cy, tw, ch, arc, arc);<NEW_LINE>}<NEW_LINE>track = new RoundRectangle2D.Float(x, trackRect.y, tw, trackRect.height, arc, arc);<NEW_LINE>}<NEW_LINE>g.setColor(enabled ? getTrackColor() : disabledTrackColor);<NEW_LINE>((Graphics2D<MASK><NEW_LINE>if (coloredTrack != null) {<NEW_LINE>boolean trackHover = hover && rollover1 && rollover2;<NEW_LINE>boolean trackPressed = pressed1 && pressed2;<NEW_LINE>Color trackValueColor = getTrackValueColor();<NEW_LINE>Color color = FlatSliderUI.stateColor(slider, trackHover, trackPressed, trackValueColor, null, null, hoverTrackColor, pressedTrackColor);<NEW_LINE>g.setColor(FlatUIUtils.deriveColor(color, trackValueColor));<NEW_LINE>((Graphics2D) g).fill(coloredTrack);<NEW_LINE>}<NEW_LINE>}
) g).fill(track);
608,057
public boolean checkInclusion(String s1, String s2) {<NEW_LINE>if (s1.length() > s2.length()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int[] count = new int[26];<NEW_LINE>for (char c : s1.toCharArray()) {<NEW_LINE>count[c - 'a']++;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < s1.length(); i++) {<NEW_LINE>count[s2.charAt(i) - 'a']--;<NEW_LINE>}<NEW_LINE>for (int i = s1.length(), j = 0; i < s2.length(); i++, j++) {<NEW_LINE>if (isPermutation(count)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>count[s2.<MASK><NEW_LINE>count[s2.charAt(i) - 'a']--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isPermutation(count);<NEW_LINE>}
charAt(j) - 'a']++;
882,434
private static Map<String, List<String>> gatherActiveFeatures(ImmutableFeatureMap fMap, Map<String, Node<Regressor>> roots) {<NEW_LINE>HashMap<String, List<String>> outputMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Node<Regressor>> e : roots.entrySet()) {<NEW_LINE>Set<String> activeFeatures = new LinkedHashSet<>();<NEW_LINE>Queue<Node<Regressor>> nodeQueue = new LinkedList<>();<NEW_LINE>nodeQueue.offer(e.getValue());<NEW_LINE>while (!nodeQueue.isEmpty()) {<NEW_LINE>Node<Regressor> node = nodeQueue.poll();<NEW_LINE>if ((node != null) && (!node.isLeaf())) {<NEW_LINE>SplitNode<Regressor> splitNode = (SplitNode<Regressor>) node;<NEW_LINE>String featureName = fMap.get(splitNode.getFeatureID()).getName();<NEW_LINE>activeFeatures.add(featureName);<NEW_LINE>nodeQueue.<MASK><NEW_LINE>nodeQueue.offer(splitNode.getLessThanOrEqual());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outputMap.put(e.getKey(), new ArrayList<>(activeFeatures));<NEW_LINE>}<NEW_LINE>return outputMap;<NEW_LINE>}
offer(splitNode.getGreaterThan());
993,386
private // and put here a jar?<NEW_LINE>void putWebInfLibraries(FileObject webInf, Map<URL, URL> tomcatTable, Map<URL, URL> loadingTable) {<NEW_LINE>if (webInf == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>FileObject libDir = webInf.getFileObject("lib");<NEW_LINE>if (libDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>URL helpurl;<NEW_LINE>Enumeration<? extends FileObject> <MASK><NEW_LINE>while (libDirKids.hasMoreElements()) {<NEW_LINE>FileObject elem = libDirKids.nextElement();<NEW_LINE>if (elem.getExt().equals("jar")) {<NEW_LINE>// NOI18N<NEW_LINE>helpurl = findInternalURL(elem);<NEW_LINE>if (!isUnexpectedLibrary(helpurl)) {<NEW_LINE>tomcatTable.put(helpurl, helpurl);<NEW_LINE>loadingTable.put(helpurl, helpurl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
libDirKids = libDir.getChildren(false);
1,286,902
public static void applyMagnet(LivingEntity entity, int amplifier) {<NEW_LINE>// super magnetic - inspired by botanias code<NEW_LINE><MASK><NEW_LINE>double y = entity.getY();<NEW_LINE>double z = entity.getZ();<NEW_LINE>float range = 3f + 1f * amplifier;<NEW_LINE>List<ItemEntity> items = entity.level.getEntitiesOfClass(ItemEntity.class, new AABB(x - range, y - range, z - range, x + range, y + range, z + range));<NEW_LINE>// only pull up to 200 items<NEW_LINE>int pulled = 0;<NEW_LINE>for (ItemEntity item : items) {<NEW_LINE>if (item.getItem().isEmpty() || !item.isAlive()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// calculate direction: item -> player<NEW_LINE>Vec3 vec = entity.position().subtract(item.getX(), item.getY(), item.getZ()).normalize().scale(0.05f + amplifier * 0.05f);<NEW_LINE>if (!item.isNoGravity()) {<NEW_LINE>vec = vec.add(0, 0.04f, 0);<NEW_LINE>}<NEW_LINE>// we calculated the movement vector and set it to the correct strength.. now we apply it \o/<NEW_LINE>item.setDeltaMovement(item.getDeltaMovement().add(vec));<NEW_LINE>// use stack size as limiting factor<NEW_LINE>pulled += item.getItem().getCount();<NEW_LINE>if (pulled > 200) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
double x = entity.getX();
354,327
private void configureVM(VirtualMachineTO vmTO, LibvirtVMDef vm, Map<String, String> customParams, boolean isUefiEnabled, boolean isSecureBoot, String bootMode, Map<String, String> extraConfig, String uuid) {<NEW_LINE>s_logger.debug(String.format("Configuring VM with UUID [%s].", uuid));<NEW_LINE>GuestDef guest = createGuestFromSpec(vmTO, vm, uuid, customParams);<NEW_LINE>if (isUefiEnabled) {<NEW_LINE>configureGuestIfUefiEnabled(isSecureBoot, bootMode, guest);<NEW_LINE>}<NEW_LINE>vm.addComp(guest);<NEW_LINE>vm.addComp(createGuestResourceDef(vmTO));<NEW_LINE>int vcpus = vmTO.getCpus();<NEW_LINE>if (!extraConfig.containsKey(DpdkHelper.DPDK_NUMA)) {<NEW_LINE>vm.addComp(createCpuModeDef(vmTO, vcpus));<NEW_LINE>}<NEW_LINE>if (_hypervisorLibvirtVersion >= MIN_LIBVIRT_VERSION_FOR_GUEST_CPU_TUNE) {<NEW_LINE>vm.addComp(createCpuTuneDef(vmTO));<NEW_LINE>}<NEW_LINE>FeaturesDef features = createFeaturesDef(customParams, isUefiEnabled, isSecureBoot);<NEW_LINE>enlightenWindowsVm(vmTO, features);<NEW_LINE>vm.addComp(features);<NEW_LINE>vm.addComp(createTermPolicy());<NEW_LINE>vm.addComp(createClockDef(vmTO));<NEW_LINE>vm.addComp(createDevicesDef(vmTO<MASK><NEW_LINE>addExtraConfigsToVM(vmTO, vm, extraConfig);<NEW_LINE>}
, guest, vcpus, isUefiEnabled));
805,857
private org.batfish.datamodel.Interface toInterface(Bond bond) {<NEW_LINE>String name = bond.getName();<NEW_LINE>org.batfish.datamodel.Interface newIface = org.batfish.datamodel.Interface.builder().setName(name).setOwner(_c).setType(InterfaceType.AGGREGATED).build();<NEW_LINE>Set<String> validSlaves = bond.getSlaves().stream().filter(slave -> isValidSlave(name, slave)).collect(ImmutableSet.toImmutableSet());<NEW_LINE>validSlaves.forEach(slave -> _c.getAllInterfaces().get(slave).setChannelGroup(name));<NEW_LINE>newIface.setChannelGroupMembers(validSlaves);<NEW_LINE>newIface.setDependencies(validSlaves.stream().map(slave -> new Dependency(slave, DependencyType.AGGREGATE)).collect(ImmutableSet.toImmutableSet()));<NEW_LINE>applyBridgeSettings(<MASK><NEW_LINE>if (!bond.getIpAddresses().isEmpty()) {<NEW_LINE>newIface.setAddress(bond.getIpAddresses().get(0));<NEW_LINE>}<NEW_LINE>newIface.setAllAddresses(bond.getIpAddresses());<NEW_LINE>newIface.setMlagId(bond.getClagId());<NEW_LINE>return newIface;<NEW_LINE>}
bond.getBridge(), newIface);
1,155,865
public static DescribeGlobalDistributeCacheResponse unmarshall(DescribeGlobalDistributeCacheResponse describeGlobalDistributeCacheResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGlobalDistributeCacheResponse.setRequestId(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.RequestId"));<NEW_LINE>describeGlobalDistributeCacheResponse.setPageSize(_ctx.integerValue("DescribeGlobalDistributeCacheResponse.PageSize"));<NEW_LINE>describeGlobalDistributeCacheResponse.setPageNumber(_ctx.integerValue("DescribeGlobalDistributeCacheResponse.PageNumber"));<NEW_LINE>describeGlobalDistributeCacheResponse.setTotalRecordCount(_ctx.integerValue("DescribeGlobalDistributeCacheResponse.TotalRecordCount"));<NEW_LINE>List<GlobalDistributeCache> globalDistributeCaches = new ArrayList<GlobalDistributeCache>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches.Length"); i++) {<NEW_LINE>GlobalDistributeCache globalDistributeCache = new GlobalDistributeCache();<NEW_LINE>globalDistributeCache.setStatus(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].Status"));<NEW_LINE>globalDistributeCache.setGlobalInstanceName(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].GlobalInstanceName"));<NEW_LINE>globalDistributeCache.setGlobalInstanceId(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].GlobalInstanceId"));<NEW_LINE>List<SubInstance> subInstances = new ArrayList<SubInstance>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].SubInstances.Length"); j++) {<NEW_LINE>SubInstance subInstance = new SubInstance();<NEW_LINE>subInstance.setInstanceStatus(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].SubInstances[" + j + "].InstanceStatus"));<NEW_LINE>subInstance.setInstanceID(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].SubInstances[" + j + "].InstanceID"));<NEW_LINE>subInstance.setInstanceClass(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i <MASK><NEW_LINE>subInstance.setGlobalInstanceId(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].SubInstances[" + j + "].GlobalInstanceId"));<NEW_LINE>subInstance.setRegionId(_ctx.stringValue("DescribeGlobalDistributeCacheResponse.GlobalDistributeCaches[" + i + "].SubInstances[" + j + "].RegionId"));<NEW_LINE>subInstances.add(subInstance);<NEW_LINE>}<NEW_LINE>globalDistributeCache.setSubInstances(subInstances);<NEW_LINE>globalDistributeCaches.add(globalDistributeCache);<NEW_LINE>}<NEW_LINE>describeGlobalDistributeCacheResponse.setGlobalDistributeCaches(globalDistributeCaches);<NEW_LINE>return describeGlobalDistributeCacheResponse;<NEW_LINE>}
+ "].SubInstances[" + j + "].InstanceClass"));
256,192
public Set<DataObject> instantiate() throws IOException {<NEW_LINE>FileObject targetFolder = Templates.getTargetFolder(wiz);<NEW_LINE>TestNGSupport.findTestNGSupport(FileOwnerQuery.getOwner(targetFolder)).configureProject(targetFolder);<NEW_LINE>String targetName = Templates.getTargetName(wiz);<NEW_LINE>DataFolder df = DataFolder.findFolder(targetFolder);<NEW_LINE>FileObject template = Templates.getTemplate(wiz);<NEW_LINE>DataObject <MASK><NEW_LINE>String pkgName = getSelectedPackageName(targetFolder);<NEW_LINE>String suiteName = pkgName + " suite";<NEW_LINE>String projectName = ProjectUtils.getInformation(FileOwnerQuery.getOwner(targetFolder)).getName();<NEW_LINE>if (pkgName == null || pkgName.trim().length() < 1) {<NEW_LINE>// NOI18N<NEW_LINE>pkgName = ".*";<NEW_LINE>suiteName = "All tests for " + projectName;<NEW_LINE>}<NEW_LINE>Map<String, String> props = new HashMap<String, String>();<NEW_LINE>props.put("suiteName", projectName);<NEW_LINE>props.put("testName", suiteName);<NEW_LINE>props.put("pkg", pkgName);<NEW_LINE>DataObject dobj = dTemplate.createFromTemplate(df, targetName, props);<NEW_LINE>return Collections.singleton(dobj);<NEW_LINE>}
dTemplate = DataObject.find(template);
645,337
public void configure() throws Exception {<NEW_LINE>errorHandler(noErrorHandler());<NEW_LINE>from(direct(MF_RETRIEVE_HU_V2_CAMEL_ROUTE_ID)).routeId(MF_RETRIEVE_HU_V2_CAMEL_ROUTE_ID).streamCaching().process(this::validateAndAttachHeaders).removeHeaders("CamelHttp*").setHeader(CoreConstants.AUTHORIZATION, simple(CoreConstants.AUTHORIZATION_TOKEN)).setHeader(Exchange.HTTP_METHOD, constant(HttpEndpointBuilderFactory.HttpMethods.GET)).toD("{{" + MF_RETRIEVE_HU_V2_CAMEL_URI + "}}/${header.M_HU_ID}").to(direct(UNPACK_V2_API_RESPONSE));<NEW_LINE>from(direct(MF_UPDATE_HU_ATTRIBUTES_V2_CAMEL_ROUTE_ID)).routeId(MF_UPDATE_HU_ATTRIBUTES_V2_CAMEL_ROUTE_ID).streamCaching().process(this::validateHUUpdateRequest).marshal(CamelRouteHelper.setupJacksonDataFormatFor(getContext(), JsonHUAttributeCodeAndValues.class)).removeHeaders("CamelHttp*").setHeader(CoreConstants.AUTHORIZATION, simple(CoreConstants.AUTHORIZATION_TOKEN)).setHeader(Exchange.HTTP_METHOD, constant(HttpEndpointBuilderFactory.HttpMethods.PUT)).toD("{{" + MF_UPDATE_HU_ATTRIBUTES_V2_CAMEL_URI + "}}").to(direct(UNPACK_V2_API_RESPONSE));<NEW_LINE>from(direct(MF_CLEAR_HU_V2_CAMEL_ROUTE_ID)).routeId(MF_CLEAR_HU_V2_CAMEL_ROUTE_ID).streamCaching().log("Route invoked!").process(this::processClearHUCamelRequest).marshal(CamelRouteHelper.setupJacksonDataFormatFor(getContext(), JsonSetClearanceStatusRequest.class)).removeHeaders("CamelHttp*").setHeader(CoreConstants.AUTHORIZATION, simple(CoreConstants.AUTHORIZATION_TOKEN)).setHeader(Exchange.HTTP_METHOD, constant(HttpEndpointBuilderFactory.HttpMethods.PUT)).toD("{{" + MF_CLEAR_HU_V2_URI + "}}/byId/${header." + HEADER_HU_ID + "}/clearance")<MASK><NEW_LINE>}
.to(direct(UNPACK_V2_API_RESPONSE));
1,722,608
private URLClassLoader buildClassLoader() throws PluginException {<NEW_LINE>ClassLoader parent = JarPluginProviderLoader.class.getClassLoader();<NEW_LINE>try {<NEW_LINE>final URL url = getCachedJar().toURI().toURL();<NEW_LINE>final URL[] urlarray;<NEW_LINE>if (null != getDepLibs() && getDepLibs().size() > 0) {<NEW_LINE>final ArrayList<URL> urls = new ArrayList<URL>();<NEW_LINE>urls.add(url);<NEW_LINE>for (final File extlib : getDepLibs()) {<NEW_LINE>urls.add(extlib.toURI().toURL());<NEW_LINE>}<NEW_LINE>urlarray = urls.toArray(new URL<MASK><NEW_LINE>} else {<NEW_LINE>urlarray = new URL[] { url };<NEW_LINE>}<NEW_LINE>URLClassLoader loaded = loadLibsFirst ? LocalFirstClassLoader.newInstance(urlarray, parent) : URLClassLoader.newInstance(urlarray, parent);<NEW_LINE>return loaded;<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new PluginException("Error creating classloader for " + cachedJar, e);<NEW_LINE>}<NEW_LINE>}
[urls.size()]);
358,642
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context MyContext initiated by distinct(array) SupportEventWithIntArray as se", path);<NEW_LINE>env.compileDeploy("@name('s0') context MyContext select context.se.id as id, sum(intPrimitive) as thesum from SupportBean", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>String[] fields = "id,thesum".split(",");<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE1", new int[] { 1, 2 }, 0));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s0", fields, new Object[][] { { "SE1", 1 } });<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE2", new int[] { 1 }, 0));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE2", new int[] { 1 }, 0));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE1", new int[] { 1, 2 }, 0));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s0", fields, new Object[][] { { "SE1", 3 }, { "SE2", 2 } });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE1", new int[] { 1, 2 }, 0));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE2", new int[] { 1 }, 0));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("SE3", new int[] {}, 0));<NEW_LINE>env.sendEventBean(new SupportBean("E3", 4));<NEW_LINE>env.assertPropsPerRowLastNewAnyOrder("s0", fields, new Object[][] { { "SE1", 7 }, { "SE2", 6 }<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>}
, { "SE3", 4 } });
615,806
private static <T> T textDecodeArrayElement(DataType type, int index, int len, ByteBuf buff) {<NEW_LINE>if (len == 4 && Character.toUpperCase(buff.getByte(index)) == 'N' && Character.toUpperCase(buff.getByte(index + 1)) == 'U' && Character.toUpperCase(buff.getByte(index + 2)) == 'L' && Character.toUpperCase(buff.getByte(index + 3)) == 'L') {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>boolean escaped = buff.getByte(index) == '"';<NEW_LINE>if (escaped) {<NEW_LINE>// Some escaping - improve that later...<NEW_LINE>String s = buff.toString(index + 1, len - 2, StandardCharsets.UTF_8);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int i = 0; i < s.length(); i++) {<NEW_LINE>char c = s.charAt(i);<NEW_LINE>if (c == '\\') {<NEW_LINE>c = s.charAt(++i);<NEW_LINE>}<NEW_LINE>sb.append(c);<NEW_LINE>}<NEW_LINE>buff = Unpooled.<MASK><NEW_LINE>index = 0;<NEW_LINE>len = buff.readableBytes();<NEW_LINE>}<NEW_LINE>return (T) decodeText(type, index, len, buff);<NEW_LINE>}<NEW_LINE>}
copiedBuffer(sb, StandardCharsets.UTF_8);
1,662,683
public FileAsset fromContentlet(final Contentlet con) throws DotStateException {<NEW_LINE>if (con == null || con.getInode() == null) {<NEW_LINE>throw new DotStateException("Contentlet is null");<NEW_LINE>}<NEW_LINE>if (!con.isFileAsset()) {<NEW_LINE>throw new DotStateException("Contentlet : " + con.getInode() + " is not a FileAsset");<NEW_LINE>}<NEW_LINE>if (con instanceof FileAsset) {<NEW_LINE>return (FileAsset) con;<NEW_LINE>}<NEW_LINE>final FileAsset fileAsset = new FileAsset();<NEW_LINE>fileAsset.setContentTypeId(con.getContentTypeId());<NEW_LINE>try {<NEW_LINE>contAPI.copyProperties(fileAsset, con.getMap());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotStateException("Content -> FileAsset Copy Failed :" + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>fileAsset.setHost(con.getHost());<NEW_LINE>if (UtilMethods.isSet(con.getFolder())) {<NEW_LINE>try {<NEW_LINE>final Identifier ident = APILocator.getIdentifierAPI().find(con);<NEW_LINE>final Host host = APILocator.getHostAPI().find(con.getHost(), <MASK><NEW_LINE>final Folder folder = APILocator.getFolderAPI().findFolderByPath(ident.getParentPath(), host, APILocator.systemUser(), false);<NEW_LINE>fileAsset.setFolder(folder.getInode());<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>final Folder folder = APILocator.getFolderAPI().find(con.getFolder(), APILocator.systemUser(), false);<NEW_LINE>fileAsset.setFolder(folder.getInode());<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Logger.warn(this, "Unable to convert contentlet to file asset " + con, e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.contentletCache.add(fileAsset);<NEW_LINE>return fileAsset;<NEW_LINE>}
APILocator.systemUser(), false);
577,135
public void subdivide(CubicCurve2D left, CubicCurve2D right) {<NEW_LINE>double x1 = this.getX1();<NEW_LINE>double y1 = this.getY1();<NEW_LINE>double ctrlx1 = this.getCtrlX1();<NEW_LINE>double ctrly1 = this.getCtrlY1();<NEW_LINE>double ctrlx2 = this.getCtrlX2();<NEW_LINE>double ctrly2 = this.getCtrlY2();<NEW_LINE>double x2 = this.getX2();<NEW_LINE>double y2 = this.getY2();<NEW_LINE>double centerx = (ctrlx1 + ctrlx2) / 2.0;<NEW_LINE>double centery <MASK><NEW_LINE>ctrlx1 = (x1 + ctrlx1) / 2.0;<NEW_LINE>ctrly1 = (y1 + ctrly1) / 2.0;<NEW_LINE>ctrlx2 = (x2 + ctrlx2) / 2.0;<NEW_LINE>ctrly2 = (y2 + ctrly2) / 2.0;<NEW_LINE>double ctrlx12 = (ctrlx1 + centerx) / 2.0;<NEW_LINE>double ctrly12 = (ctrly1 + centery) / 2.0;<NEW_LINE>double ctrlx21 = (ctrlx2 + centerx) / 2.0;<NEW_LINE>double ctrly21 = (ctrly2 + centery) / 2.0;<NEW_LINE>centerx = (ctrlx12 + ctrlx21) / 2.0;<NEW_LINE>centery = (ctrly12 + ctrly21) / 2.0;<NEW_LINE>if (left != null)<NEW_LINE>left.setCurve(x1, y1, ctrlx1, ctrly1, ctrlx12, ctrly12, centerx, centery);<NEW_LINE>if (right != null)<NEW_LINE>right.setCurve(centerx, centery, ctrlx21, ctrly21, ctrlx2, ctrly2, x2, y2);<NEW_LINE>}
= (ctrly1 + ctrly2) / 2.0;
1,222,972
public void start() {<NEW_LINE>logger.info("Registering Mantis Worker with Mesos executor callbacks");<NEW_LINE>mesosDriver = new MesosExecutorDriver(new MesosExecutorCallbackHandler(executeStageRequestObserver));<NEW_LINE>// launch driver on background thread<NEW_LINE>executor.execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>mesosDriver.run();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to register Mantis Worker with Mesos executor callbacks", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// subscribe to vm task updates on current thread<NEW_LINE>vmTaskStatusObservable.subscribe(new Action1<VirtualMachineTaskStatus>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(VirtualMachineTaskStatus vmTaskStatus) {<NEW_LINE>TYPE type = vmTaskStatus.getType();<NEW_LINE>if (type == TYPE.COMPLETED) {<NEW_LINE>Protos.Status status = mesosDriver.sendStatusUpdate(TaskStatus.newBuilder().setTaskId(TaskID.newBuilder().setValue(vmTaskStatus.getTaskId()).build()).setState(TaskState.TASK_FINISHED).build());<NEW_LINE>logger.info("Sent COMPLETED state to mesos, driver status=" + status);<NEW_LINE>} else if (type == TYPE.STARTED) {<NEW_LINE>Protos.Status status = mesosDriver.sendStatusUpdate(TaskStatus.newBuilder().setTaskId(TaskID.newBuilder().setValue(vmTaskStatus.getTaskId()).build()).setState(TaskState.TASK_RUNNING).build());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
logger.info("Sent RUNNING state to mesos, driver status=" + status);
1,768,797
private void createFileNameBrowseButtons(Composite parent) {<NEW_LINE>new Label(parent, SWT.NONE);<NEW_LINE>Composite buttonComposite = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout(2, false);<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>buttonComposite.setLayout(layout);<NEW_LINE>GridData gd = new GridData(SWT.END, SWT.CENTER, false, false);<NEW_LINE>buttonComposite.setLayoutData(gd);<NEW_LINE>buttonComposite.setFont(parent.getFont());<NEW_LINE>btnBrowseWorkplace = new Button(buttonComposite, SWT.NONE);<NEW_LINE>btnBrowseWorkplace.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>IResource chosenFile = chooseFileFromWorkspace();<NEW_LINE>if (chosenFile != null) {<NEW_LINE>IPath path = chosenFile.getFullPath();<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>txtFileName.setText("${workspace_loc:" + <MASK><NEW_LINE>javaProjectName = GeneratorLaunchShortcut.getJavaProjectNameFromResource(chosenFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>btnBrowseWorkplace.setText(Messages.FILE_PICKER_BROWSE_WORKSPACE);<NEW_LINE>btnBrowseFileSystem = new Button(buttonComposite, SWT.NONE);<NEW_LINE>btnBrowseFileSystem.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>chooseFileFromFileSystem();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>btnBrowseFileSystem.setText(Messages.FILE_PICKER_BROWSE_FILE_SYSTEM);<NEW_LINE>}
path.toString() + "}");
121,948
private Map<String, List<OffsetRange>> foldsJson(ParserResult info) {<NEW_LINE>final Map<String, List<OffsetRange>> folds = new HashMap<String, List<OffsetRange>>();<NEW_LINE>TokenHierarchy th = info.getSnapshot().getTokenHierarchy();<NEW_LINE>TokenSequence <MASK><NEW_LINE>List<TokenSequence<?>> list = th.tokenSequenceList(ts.languagePath(), 0, info.getSnapshot().getText().length());<NEW_LINE>List<FoldingItem> stack = new ArrayList<FoldingItem>();<NEW_LINE>for (TokenSequenceIterator tsi = new TokenSequenceIterator(list, false); tsi.hasMore(); ) {<NEW_LINE>ts = tsi.getSequence();<NEW_LINE>TokenId tokenId;<NEW_LINE>ts.moveStart();<NEW_LINE>while (ts.moveNext()) {<NEW_LINE>tokenId = ts.token().id();<NEW_LINE>if (tokenId == JsTokenId.BRACKET_LEFT_CURLY) {<NEW_LINE>stack.add(new FoldingItem(JsonFoldTypeProvider.OBJECT.code(), ts.offset()));<NEW_LINE>} else if (tokenId == JsTokenId.BRACKET_RIGHT_CURLY && !stack.isEmpty()) {<NEW_LINE>FoldingItem fromStack = stack.remove(stack.size() - 1);<NEW_LINE>appendFold(folds, fromStack.kind, info.getSnapshot().getOriginalOffset(fromStack.start), info.getSnapshot().getOriginalOffset(ts.offset() + 1));<NEW_LINE>} else if (tokenId == JsTokenId.BRACKET_LEFT_BRACKET) {<NEW_LINE>stack.add(new FoldingItem(JsonFoldTypeProvider.ARRAY.code(), ts.offset()));<NEW_LINE>} else if (tokenId == JsTokenId.BRACKET_RIGHT_BRACKET && !stack.isEmpty()) {<NEW_LINE>FoldingItem fromStack = stack.remove(stack.size() - 1);<NEW_LINE>appendFold(folds, fromStack.kind, info.getSnapshot().getOriginalOffset(fromStack.start), info.getSnapshot().getOriginalOffset(ts.offset() + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return folds;<NEW_LINE>}
ts = th.tokenSequence(language);
447,058
public int compareTo(rpc_column other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetTypeId()).<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTypeId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type_id, other.type_id);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetTypeSize()).compareTo(other.isSetTypeSize());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTypeSize()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type_size, other.type_size);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetName()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
compareTo(other.isSetTypeId());
1,253,405
final CreateCommentResult executeCreateComment(CreateCommentRequest createCommentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCommentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCommentRequest> request = null;<NEW_LINE>Response<CreateCommentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCommentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCommentRequest));<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, "WorkDocs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateComment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCommentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCommentResultJsonUnmarshaller());<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());
590,108
private List<String> generateDropStatementsForRoutines() throws SQLException {<NEW_LINE>// #2193: PostgreSQL 11 removed the 'proisagg' column and replaced it with 'prokind'.<NEW_LINE>String isAggregate = database.getVersion().<MASK><NEW_LINE>// PROCEDURE is only available from PostgreSQL 11<NEW_LINE>String isProcedure = database.getVersion().isAtLeast("11") ? "pg_proc.prokind = 'p'" : "FALSE";<NEW_LINE>List<Map<String, String>> rows = // Search for all functions<NEW_LINE>jdbcTemplate.// Search for all functions<NEW_LINE>queryForList(// that don't depend on an extension<NEW_LINE>"SELECT proname, oidvectortypes(proargtypes) AS args, " + isAggregate + " as agg, " + isProcedure + " as proc " + "FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid) " + "LEFT JOIN pg_depend dep ON dep.objid = pg_proc.oid AND dep.deptype = 'e' " + "WHERE ns.nspname = ? AND dep.objid IS NULL", name);<NEW_LINE>List<String> statements = new ArrayList<>();<NEW_LINE>for (Map<String, String> row : rows) {<NEW_LINE>String type = "FUNCTION";<NEW_LINE>if (isTrue(row.get("agg"))) {<NEW_LINE>type = "AGGREGATE";<NEW_LINE>} else if (isTrue(row.get("proc"))) {<NEW_LINE>type = "PROCEDURE";<NEW_LINE>}<NEW_LINE>statements.add("DROP " + type + " IF EXISTS " + database.quote(name, row.get("proname")) + "(" + row.get("args") + ") CASCADE");<NEW_LINE>}<NEW_LINE>return statements;<NEW_LINE>}
isAtLeast("11") ? "pg_proc.prokind = 'a'" : "pg_proc.proisagg";
1,083,621
// BenchMark IntQueue vs ArrayDeque.<NEW_LINE>private static void benchMarkTest() {<NEW_LINE>int n = 10000000;<NEW_LINE>IntQueue intQ = new IntQueue(n);<NEW_LINE>// IntQueue times at around 0.0324 seconds<NEW_LINE>long start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) intQ.offer(i);<NEW_LINE>for (int i = 0; i < n; i++) intQ.poll();<NEW_LINE>long end = System.nanoTime();<NEW_LINE>System.out.println("IntQueue Time: " + (end - start) / 1e9);<NEW_LINE>// ArrayDeque times at around 1.438 seconds<NEW_LINE>java.util.ArrayDeque<Integer> arrayDeque = new java<MASK><NEW_LINE>// java.util.ArrayDeque <Integer> arrayDeque = new java.util.ArrayDeque<>(n); // strangely the<NEW_LINE>// ArrayQueue is slower when you give it an initial capacity.<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) arrayDeque.offer(i);<NEW_LINE>for (int i = 0; i < n; i++) arrayDeque.poll();<NEW_LINE>end = System.nanoTime();<NEW_LINE>System.out.println("ArrayDeque Time: " + (end - start) / 1e9);<NEW_LINE>}
.util.ArrayDeque<>();
1,364,644
final GetInAppMessagesResult executeGetInAppMessages(GetInAppMessagesRequest getInAppMessagesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getInAppMessagesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetInAppMessagesRequest> request = null;<NEW_LINE>Response<GetInAppMessagesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetInAppMessagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getInAppMessagesRequest));<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, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetInAppMessages");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetInAppMessagesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetInAppMessagesResultJsonUnmarshaller());<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());
91,525
public Future<Boolean> deployModule(DeployedModuleInfo deployedMod, DeployedAppInfo deployedApp) {<NEW_LINE>this.firstFailure = null;<NEW_LINE>ExtendedModuleInfo moduleInfo = deployedMod.getModuleInfo();<NEW_LINE>ModuleMetaData mmd = moduleInfo.getMetaData();<NEW_LINE>if (mmd == null) {<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(false);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metaDataService.fireModuleMetaDataCreated(mmd, moduleInfo.getContainer());<NEW_LINE>for (ModuleMetaData nestedMMD : moduleInfo.getNestedMetaData()) {<NEW_LINE>metaDataService.fireModuleMetaDataCreated(<MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>deployedMod.setIsStarting();<NEW_LINE>try {<NEW_LINE>stateChangeService.fireModuleStarting(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>Future<Boolean> started;<NEW_LINE>try {<NEW_LINE>started = moduleRuntimeContainer.startModule(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>deployedMod.setIsStarted();<NEW_LINE>try {<NEW_LINE>stateChangeService.fireModuleStarted(moduleInfo);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>this.firstFailure = ex;<NEW_LINE>deployedApp.uninstallApp();<NEW_LINE>return futureMonitor.createFutureWithResult(Boolean.class, ex);<NEW_LINE>}<NEW_LINE>return started;<NEW_LINE>}
nestedMMD, moduleInfo.getContainer());
67,976
final CreateApplicationResult executeCreateApplication(CreateApplicationRequest createApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateApplicationRequest> request = null;<NEW_LINE>Response<CreateApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createApplicationRequest));<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, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateApplicationResultJsonUnmarshaller());<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);
558,544
public T readFrom(Class<T> type, Type type1, Annotation[] antns, MediaType mt, MultivaluedMap<String, String> mm, InputStream entityStream) throws WebApplicationException, IOException {<NEW_LINE>try (BufferedReader in = new BufferedReader(new InputStreamReader(entityStream));<NEW_LINE>JsonParser parser = Json.createParser(in)) {<NEW_LINE>final Locale locale = CompositeUtil.instance().getLocale(mm);<NEW_LINE>JsonObject o;<NEW_LINE>if (parser.hasNext()) {<NEW_LINE>parser.next();<NEW_LINE>o = parser.getObject();<NEW_LINE>} else {<NEW_LINE>o = JsonValue.EMPTY_JSON_OBJECT;<NEW_LINE>}<NEW_LINE>T model = CompositeUtil.instance().unmarshallClass(locale, type, o);<NEW_LINE>Set<ConstraintViolation<T>> cv = CompositeUtil.instance().validateRestModel(locale, model);<NEW_LINE>if (!cv.isEmpty()) {<NEW_LINE>final Response response = Response.status(Status.BAD_REQUEST).entity(CompositeUtil.instance().getValidationFailureMessages(locale, cv<MASK><NEW_LINE>throw new WebApplicationException(response);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>} catch (JsonException ex) {<NEW_LINE>throw new WebApplicationException(Response.status(Status.INTERNAL_SERVER_ERROR).entity(ex.getLocalizedMessage()).build());<NEW_LINE>}<NEW_LINE>}
, model)).build();
1,550,693
public void filterByLatestVersion(Function<URL, String> getCurrentVersion) {<NEW_LINE>log.trace("Checking the latest version using URL list {}", candidateUrls);<NEW_LINE>List<URL> <MASK><NEW_LINE>List<URL> copyOfList = new ArrayList<>(candidateUrls);<NEW_LINE>String foundFriverVersion = null;<NEW_LINE>for (URL url : copyOfList) {<NEW_LINE>try {<NEW_LINE>if (isNotStable(url)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String currentVersion = getCurrentVersion.apply(url);<NEW_LINE>if (isNullOrEmpty(foundFriverVersion)) {<NEW_LINE>foundFriverVersion = currentVersion;<NEW_LINE>}<NEW_LINE>if (versionCompare(currentVersion, foundFriverVersion) > 0) {<NEW_LINE>foundFriverVersion = currentVersion;<NEW_LINE>out.clear();<NEW_LINE>}<NEW_LINE>if (url.getFile().contains(foundFriverVersion)) {<NEW_LINE>out.add(url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.trace("There was a problem with URL {} : {}", url, e.getMessage());<NEW_LINE>candidateUrls.remove(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.driverVersion = foundFriverVersion;<NEW_LINE>this.candidateUrls = out;<NEW_LINE>}
out = new ArrayList<>();
749,574
public boolean put(final Connection connection) {<NEW_LINE>if (connection != null) {<NEW_LINE>if (!connection.isExecuting()) {<NEW_LINE>throw new IllegalStateException("Connection is not executing!");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (connectionId == null) {<NEW_LINE>if (connectionIdGenerator == null) {<NEW_LINE>throw new IllegalStateException("Connection id generator must be attached before!");<NEW_LINE>}<NEW_LINE>connectionId = newConnectionId();<NEW_LINE>if (connectionId == null) {<NEW_LINE>throw new IllegalStateException("Connection ids exhausted!");<NEW_LINE>}<NEW_LINE>connection.setConnectionId(connectionId);<NEW_LINE>} else if (connectionId.isEmpty()) {<NEW_LINE>throw new IllegalStateException("Connection must have a none empty connection id!");<NEW_LINE>} else if (connections.get(connectionId) != null) {<NEW_LINE>throw new IllegalStateException("Connection id already used! " + connectionId);<NEW_LINE>}<NEW_LINE>DTLSSession session = connection.getEstablishedSession();<NEW_LINE>boolean success = false;<NEW_LINE>synchronized (this) {<NEW_LINE>if (connections.put(connectionId, connection)) {<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("{}connection: add {} (size {})", tag, connection, connections.size(), new Throwable("connection added!"));<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("{}connection: add {} (size {})", tag, connectionId, connections.size());<NEW_LINE>}<NEW_LINE>addToAddressConnections(connection);<NEW_LINE>if (session != null) {<NEW_LINE>addToEstablishedConnections(session.getSessionIdentifier(), connection);<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>} else {<NEW_LINE>WARN_FILTER.debug("{}connection store is full! {} max. entries.", tag, connections.getCapacity());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (success && sessionStore != null && session != null) {<NEW_LINE>sessionStore.put(session);<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
ConnectionId connectionId = connection.getConnectionId();
234,050
private <T> ConfigValue<List<T>> toNodeList() {<NEW_LINE>Type nodeType = type();<NEW_LINE>if (nodeType == Type.MISSING || nodeType == Type.VALUE) {<NEW_LINE>return ConfigValues.empty();<NEW_LINE>}<NEW_LINE>// this is an object or a list<NEW_LINE>List<T> result = new LinkedList<>();<NEW_LINE>Set<String> children = new HashSet<>();<NEW_LINE>for (String propertyName : delegate.getPropertyNames()) {<NEW_LINE>if (stringKey.isEmpty()) {<NEW_LINE>String noSuffix = propertyName;<NEW_LINE>int dot = noSuffix.indexOf('.');<NEW_LINE>if (dot > 0) {<NEW_LINE>noSuffix = noSuffix.substring(0, dot);<NEW_LINE>}<NEW_LINE>children.add(noSuffix);<NEW_LINE>} else {<NEW_LINE>if (propertyName.equals(stringKey)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (propertyName.startsWith(stringKey + ".")) {<NEW_LINE>String noSuffix = propertyName.substring(stringKey.length() + 1);<NEW_LINE>int <MASK><NEW_LINE>if (dot > 0) {<NEW_LINE>noSuffix = noSuffix.substring(0, dot);<NEW_LINE>}<NEW_LINE>children.add(noSuffix);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String child : children) {<NEW_LINE>result.add((T) get(child));<NEW_LINE>}<NEW_LINE>return ConfigValues.simpleValue(result);<NEW_LINE>}
dot = noSuffix.indexOf('.');
1,054,616
public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Row14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> row(SelectField<T1> field1, SelectField<T2> field2, SelectField<T3> field3, SelectField<T4> field4, SelectField<T5> field5, SelectField<T6> field6, SelectField<T7> field7, SelectField<T8> field8, SelectField<T9> field9, SelectField<T10> field10, SelectField<T11> field11, SelectField<T12> field12, SelectField<T13> field13, SelectField<T14> field14) {<NEW_LINE>return new RowImpl14<>(field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, <MASK><NEW_LINE>}
field11, field12, field13, field14);
1,068,646
public void dropIndex(String... fieldNames) {<NEW_LINE>notNull(fieldNames, "fieldNames cannot be null");<NEW_LINE>Fields fields = Fields.withNames(fieldNames);<NEW_LINE>try {<NEW_LINE>writeLock.lock();<NEW_LINE>checkOpened();<NEW_LINE>collectionOperations.dropIndex(fields);<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>final AtomicReference<IndexDescriptor> <MASK><NEW_LINE>JournalEntry journalEntry = new JournalEntry();<NEW_LINE>journalEntry.setChangeType(ChangeType.DropIndex);<NEW_LINE>journalEntry.setCommit(() -> {<NEW_LINE>for (IndexDescriptor entry : primary.listIndices()) {<NEW_LINE>if (entry.getIndexFields().equals(fields)) {<NEW_LINE>indexEntry.set(entry);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>primary.dropIndex(fieldNames);<NEW_LINE>});<NEW_LINE>journalEntry.setRollback(() -> {<NEW_LINE>if (indexEntry.get() != null) {<NEW_LINE>primary.createIndex(indexOptions(indexEntry.get().getIndexType()), fieldNames);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>transactionContext.getJournal().add(journalEntry);<NEW_LINE>}
indexEntry = new AtomicReference<>();
806,880
public void marshall(Authorizer authorizer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (authorizer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerCredentialsArn(), AUTHORIZERCREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerId(), AUTHORIZERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerPayloadFormatVersion(), AUTHORIZERPAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerResultTtlInSeconds(), AUTHORIZERRESULTTTLINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerType(), AUTHORIZERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(authorizer.getEnableSimpleResponses(), ENABLESIMPLERESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getIdentitySource(), IDENTITYSOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getIdentityValidationExpression(), IDENTITYVALIDATIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getJwtConfiguration(), JWTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getName(), NAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
authorizer.getAuthorizerUri(), AUTHORIZERURI_BINDING);
1,194,879
public static RelDataType createJoinOriginalType(RelDataTypeFactory typeFactory, RelDataType leftType, RelDataType rightType, List<String> fieldNameList, List<RelDataTypeField> systemFieldList) {<NEW_LINE>assert (fieldNameList == null) || (fieldNameList.size() == (systemFieldList.size() + leftType.getFieldCount() <MASK><NEW_LINE>List<String> nameList = new ArrayList<>();<NEW_LINE>final List<RelDataType> typeList = new ArrayList<>();<NEW_LINE>addOriginalFields(systemFieldList, typeList, nameList);<NEW_LINE>addOriginalFields(leftType.getFieldList(), typeList, nameList);<NEW_LINE>if (rightType != null) {<NEW_LINE>addOriginalFields(rightType.getFieldList(), typeList, nameList);<NEW_LINE>}<NEW_LINE>if (fieldNameList != null) {<NEW_LINE>assert fieldNameList.size() == nameList.size();<NEW_LINE>nameList = fieldNameList;<NEW_LINE>}<NEW_LINE>return typeFactory.createStructType(typeList, nameList);<NEW_LINE>}
+ rightType.getFieldCount()));
799,408
private Map<String, Set<String>> populateLimitedTagsToValuesMap(OptionalLimit groupLimit, int requestLimit, Stream<Series> seriesStream) {<NEW_LINE>// TODO find alternative as this is slow since it flushes processor core caches<NEW_LINE>// and synchronizes them<NEW_LINE>AtomicLong totalNumValues = new AtomicLong();<NEW_LINE>var allTagsToValuesMap = new HashMap<String, Set<String>>();<NEW_LINE>seriesStream.forEach(series -> {<NEW_LINE>for (final Map.Entry<String, String> tagValuePair : series.getTags().entrySet()) {<NEW_LINE>Set<String> values = allTagsToValuesMap.get(tagValuePair.getKey());<NEW_LINE>// If you've not seen this tag before, create a holder for its<NEW_LINE>// values<NEW_LINE>if (values == null) {<NEW_LINE>values = new HashSet<>();<NEW_LINE>allTagsToValuesMap.put(tagValuePair.getKey(), values);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (groupLimit.isGreaterOrEqual(numValues)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (totalNumValues.incrementAndGet() > requestLimit) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Add the value to the collection of values for this tag<NEW_LINE>values.add(tagValuePair.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return allTagsToValuesMap;<NEW_LINE>}
int numValues = values.size();
1,553,429
String decodeString(int offset, int length) {<NEW_LINE>try {<NEW_LINE>final ByteBuffer wrappedBuffer = ByteBuffer.wrap(m_strings, offset, length);<NEW_LINE>return (m_isUTF8 ? UTF8_DECODER : UTF16LE_DECODER).decode(wrappedBuffer).toString();<NEW_LINE>} catch (CharacterCodingException ex) {<NEW_LINE>if (!m_isUTF8) {<NEW_LINE>LOGGER.warning(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ByteBuffer wrappedBufferRetry = ByteBuffer.wrap(m_strings, offset, length);<NEW_LINE>// in some places, Android uses 3-byte UTF-8 sequences instead of 4-bytes.<NEW_LINE>// If decoding failed, we try to use CESU-8 decoder, which is closer to what Android actually uses.<NEW_LINE>return CESU8_DECODER.decode(wrappedBufferRetry).toString();<NEW_LINE>} catch (CharacterCodingException e) {<NEW_LINE>LOGGER.warning("Failed to decode a string with CESU-8 decoder.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
"Failed to decode a string at offset " + offset + " of length " + length);
1,149,665
public List<RecordId> xClaimJustId(byte[] key, String group, String newOwner, XClaimOptions options) {<NEW_LINE>Assert.notNull(key, "Key must not be null!");<NEW_LINE>Assert.notNull(group, "Group name must not be null!");<NEW_LINE>Assert.notNull(newOwner, "NewOwner must not be null!");<NEW_LINE>Assert.notEmpty(options.getIds(), "Ids collection must not be empty!");<NEW_LINE>List<Object> <MASK><NEW_LINE>params.add(key);<NEW_LINE>params.add(group);<NEW_LINE>params.add(newOwner);<NEW_LINE>params.add(Objects.requireNonNull(options.getIdleTime()).toMillis());<NEW_LINE>params.addAll(Arrays.asList(options.getIdsAsStringArray()));<NEW_LINE>params.add("JUSTID");<NEW_LINE>return connection.write(key, StringCodec.INSTANCE, XCLAIM_JUSTID, params.toArray());<NEW_LINE>}
params = new ArrayList<>();
1,256,442
public CharSequence toDisplay() {<NEW_LINE>List<String> segments = new ArrayList<>();<NEW_LINE>if (open) {<NEW_LINE>segments.add("Open issues");<NEW_LINE>} else {<NEW_LINE>segments.add("Closed issues");<NEW_LINE>}<NEW_LINE>if (assignee != null) {<NEW_LINE>segments.add("Assignee: " + assignee.login());<NEW_LINE>}<NEW_LINE>if (milestone != null) {<NEW_LINE>segments.add("Milestone: " + milestone.title());<NEW_LINE>}<NEW_LINE>if (labels != null && !labels.isEmpty()) {<NEW_LINE>StringBuilder builder = new StringBuilder("Labels: ");<NEW_LINE>for (Label label : labels) {<NEW_LINE>builder.append(label.name()).append(',').append(' ');<NEW_LINE>}<NEW_LINE>builder.deleteCharAt(builder.length() - 1);<NEW_LINE>builder.deleteCharAt(builder.length() - 1);<NEW_LINE>segments.add(builder.toString());<NEW_LINE>}<NEW_LINE>if (segments.isEmpty()) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>StringBuilder all = new StringBuilder();<NEW_LINE>for (String segment : segments) {<NEW_LINE>all.append(segment).append<MASK><NEW_LINE>}<NEW_LINE>all.deleteCharAt(all.length() - 1);<NEW_LINE>all.deleteCharAt(all.length() - 1);<NEW_LINE>return all;<NEW_LINE>}
(',').append(' ');
511,800
public void paint(Graphics2D g, int x, int y, int w, int h) {<NEW_LINE>float scale = (float) h / (float) mMax;<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>int by1 = h - (int) (y + minimum * scale);<NEW_LINE>int by2 = h - (int) (y + maximum * scale);<NEW_LINE>g.drawLine(x, by1, x + w, by1);<NEW_LINE>g.drawLine(x, by2, x + w, by2);<NEW_LINE>int q1 = h - (int) (y + Q1 * scale);<NEW_LINE>int q2 = h - (int) (y + median * scale);<NEW_LINE>int q3 = h - (int) (y + Q3 * scale);<NEW_LINE>int bh = (int) ((Q3 - Q1) * scale);<NEW_LINE>g.drawLine(x + w / 2, by1, <MASK><NEW_LINE>g.drawLine(x + w / 2, q3, x + w / 2, by2);<NEW_LINE>if (isReference) {<NEW_LINE>g.setColor(new Color(115, 118, 255));<NEW_LINE>} else if (isOptimized) {<NEW_LINE>g.setColor(new Color(197, 255, 153));<NEW_LINE>} else {<NEW_LINE>g.setColor(new Color(255, 88, 119));<NEW_LINE>}<NEW_LINE>g.fillRect(x, q3, w, bh);<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.drawRect(x, q3, w, bh);<NEW_LINE>g.drawLine(x, q2, x + w, q2);<NEW_LINE>}
x + w / 2, q1);
854,749
private String makeMatch(String sql) {<NEW_LINE>Matcher matcher = escapePattern.matcher(sql);<NEW_LINE>if (matcher.find()) {<NEW_LINE>if (this == EscapeFunctions.ESC_DATE || this == EscapeFunctions.ESC_TIME || this == EscapeFunctions.ESC_TIMESTAMP) {<NEW_LINE>matcher = argPattern.matcher(sql);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String new_sql = this.<MASK><NEW_LINE>return new_sql;<NEW_LINE>}<NEW_LINE>} else if (this == EscapeFunctions.ESC_FUNCTION) {<NEW_LINE>String fn_name = matcher.group(1);<NEW_LINE>Method method = HeavyAIEscapeFunctions.getFunction(fn_name);<NEW_LINE>matcher = argPattern.matcher(sql);<NEW_LINE>if (matcher.find()) {<NEW_LINE>if (method == null) {<NEW_LINE>String new_sql = fn_name + '(' + matcher.group(1) + ')';<NEW_LINE>return new_sql;<NEW_LINE>} else {<NEW_LINE>return call_escape_fn(matcher.group(1), method);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
replacementKeyword + matcher.group(1);
796,475
private void handleSnapshotMigration(Long srcDataStoreId, Date start, Date end, MigrationPolicy policy, List<Future<AsyncCallFuture<DataObjectResult>>> futures, Map<Long, Pair<Long, Long>> storageCapacities, ThreadPoolExecutor executor) {<NEW_LINE>DataStore srcDatastore = dataStoreManager.getDataStore(srcDataStoreId, DataStoreRole.Image);<NEW_LINE>List<SnapshotDataStoreVO> snaps = snapshotDataStoreDao.<MASK><NEW_LINE>if (!snaps.isEmpty()) {<NEW_LINE>for (SnapshotDataStoreVO snap : snaps) {<NEW_LINE>SnapshotVO snapshotVO = snapshotDao.findById(snap.getSnapshotId());<NEW_LINE>SnapshotInfo snapshotInfo = snapshotFactory.getSnapshot(snapshotVO.getSnapshotId(), DataStoreRole.Image);<NEW_LINE>SnapshotInfo parentSnapshot = snapshotInfo.getParent();<NEW_LINE>if (parentSnapshot == null && policy == MigrationPolicy.COMPLETE) {<NEW_LINE>List<Long> dstores = migrationHelper.sortDataStores(storageCapacities);<NEW_LINE>Long storeId = dstores.get(0);<NEW_LINE>if (storeId.equals(srcDataStoreId)) {<NEW_LINE>storeId = dstores.get(1);<NEW_LINE>}<NEW_LINE>DataStore datastore = dataStoreManager.getDataStore(storeId, DataStoreRole.Image);<NEW_LINE>futures.add(executor.submit(new MigrateDataTask(snapshotInfo, srcDatastore, datastore)));<NEW_LINE>}<NEW_LINE>if (parentSnapshot != null) {<NEW_LINE>DataStore parentDS = dataStoreManager.getDataStore(parentSnapshot.getDataStore().getId(), DataStoreRole.Image);<NEW_LINE>if (parentDS.getId() != snapshotInfo.getDataStore().getId()) {<NEW_LINE>futures.add(executor.submit(new MigrateDataTask(snapshotInfo, srcDatastore, parentDS)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
findSnapshots(srcDataStoreId, start, end);
1,428,038
void read(WizardDescriptor settings) {<NEW_LINE>FileObject targetFolder = Templates.getTargetFolder(settings);<NEW_LINE>projectTextField.setText(ProjectUtils.getInformation(project).getDisplayName());<NEW_LINE>SourceGroup[] <MASK><NEW_LINE>if (sourceGroups.length > 0) {<NEW_LINE>SourceGroupUISupport.connect(locationComboBox, sourceGroups);<NEW_LINE>packageComboBox.setRenderer(PackageView.listRenderer());<NEW_LINE>updateSourceGroupPackages();<NEW_LINE>// set default source group and package cf. targetFolder<NEW_LINE>SourceGroup targetSourceGroup = targetFolder != null ? SourceGroups.getFolderSourceGroup(sourceGroups, targetFolder) : sourceGroups[0];<NEW_LINE>if (targetSourceGroup != null) {<NEW_LINE>locationComboBox.setSelectedItem(targetSourceGroup);<NEW_LINE>if (targetFolder != null) {<NEW_LINE>String targetPackage = SourceGroups.getPackageForFolder(targetSourceGroup, targetFolder);<NEW_LINE>if (targetPackage != null) {<NEW_LINE>packageComboBoxEditor.setText(targetPackage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateCheckboxes();<NEW_LINE>}<NEW_LINE>}
sourceGroups = SourceGroups.getJavaSourceGroups(project);
1,089,671
public Object doTaskChat(@PathParam("id") String handlerId, @Context HttpHeaders headers) {<NEW_LINE>if (taskId != null) {<NEW_LINE>final List<String> requestTaskIds = headers.getRequestHeader(TASK_ID_HEADER);<NEW_LINE>final String requestTaskId = requestTaskIds != null && !requestTaskIds.isEmpty() ? Iterables.getOnlyElement(requestTaskIds) : null;<NEW_LINE>// Sanity check: Callers set TASK_ID_HEADER to our taskId (URL-encoded, if >= 0.14.0) if they want to be<NEW_LINE>// assured of talking to the correct task, and not just some other task running on the same port.<NEW_LINE>if (requestTaskId != null && !requestTaskId.equals(taskId) && !StringUtils.urlDecode(requestTaskId).equals(taskId)) {<NEW_LINE>throw new BadRequestException(StringUtils.format("Requested taskId[%s] doesn't match with taskId[%s]", requestTaskId, taskId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Optional<ChatHandler> handler = handlers.get(handlerId);<NEW_LINE>if (handler.isPresent()) {<NEW_LINE>return handler.get();<NEW_LINE>}<NEW_LINE>throw new BadRequestException(StringUtils<MASK><NEW_LINE>}
.format("Can't find chatHandler for handler[%s]", handlerId));
99,686
synchronized boolean removeRef(Address deleteAddr, int opIndex) throws IOException {<NEW_LINE>LongField addrField = new LongField(addrMap.getKey(deleteAddr, false));<NEW_LINE>for (Field id : table.findRecords(addrField, ADDRESS_COL)) {<NEW_LINE>DBRecord rec = table.getRecord(id);<NEW_LINE>if (rec.getByteValue(OPINDEX_COL) == (byte) opIndex) {<NEW_LINE>table.deleteRecord(id);<NEW_LINE>if (table.getRecordCount() == 0) {<NEW_LINE>removeAll();<NEW_LINE>} else {<NEW_LINE>if (!isFrom) {<NEW_LINE>byte level = getRefLevel(RefTypeFactory.get(<MASK><NEW_LINE>if (refLevel <= level) {<NEW_LINE>// get the new highest ref level<NEW_LINE>refLevel = findHighestRefLevel(refLevel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateRecord();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
rec.getByteValue(TYPE_COL)));
265,182
public boolean execute(final OHttpRequest iRequest, final OHttpResponse iResponse) throws Exception {<NEW_LINE>checkSyntax(iRequest.getUrl(), 1, "Syntax error: server");<NEW_LINE>iRequest.getData().commandInfo = "Server status";<NEW_LINE>final ODocument result = new ODocument();<NEW_LINE>// We copy the returned set so that we can modify it, and we use a LinkedHashSet to preserve the<NEW_LINE>// ordering.<NEW_LINE>java.util.Set<String> storageNames = new java.util.LinkedHashSet(server.getAvailableStorageNames().keySet());<NEW_LINE>// This just adds the system database if the guest user has the specified permission<NEW_LINE>// (server.listDatabases.system).<NEW_LINE>if (server.getSecurity() != null && server.getSecurity().isAuthorized(OServerConfiguration.GUEST_USER, "server.listDatabases.system")) {<NEW_LINE>storageNames.add(OSystemDatabase.SYSTEM_DB_NAME);<NEW_LINE>}<NEW_LINE>// ORDER DATABASE NAMES (CASE INSENSITIVE)<NEW_LINE>final List<String> orderedStorages = new ArrayList<String>(storageNames);<NEW_LINE>Collections.sort(orderedStorages, new Comparator<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(final String o1, final String o2) {<NEW_LINE>return o1.toLowerCase().compareTo(o2.toLowerCase());<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>iResponse.writeRecord(result);<NEW_LINE>return false;<NEW_LINE>}
result.field("databases", orderedStorages);
328,523
protected void encodeButton(FacesContext context, MenuButton button, String buttonId, boolean disabled) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>boolean isIconLeft = button.getIconPos().equals("left");<NEW_LINE><MASK><NEW_LINE>String buttonClass = getStyleClassBuilder(context).add(button.getButtonStyleClass()).add(isIconLeft, HTML.BUTTON_TEXT_ICON_LEFT_BUTTON_CLASS, HTML.BUTTON_TEXT_ICON_RIGHT_BUTTON_CLASS).add(isValueBlank(value), HTML.BUTTON_ICON_ONLY_BUTTON_CLASS).add(disabled, "ui-state-disabled").build();<NEW_LINE>writer.startElement("button", null);<NEW_LINE>writer.writeAttribute("id", buttonId, null);<NEW_LINE>writer.writeAttribute("name", buttonId, null);<NEW_LINE>writer.writeAttribute("type", "button", null);<NEW_LINE>writer.writeAttribute("class", buttonClass, null);<NEW_LINE>if (LangUtils.isNotEmpty(button.getButtonStyle())) {<NEW_LINE>writer.writeAttribute("style", button.getButtonStyle(), null);<NEW_LINE>}<NEW_LINE>writer.writeAttribute(HTML.ARIA_LABEL, button.getAriaLabel(), "ariaLabel");<NEW_LINE>if (button.isDisabled()) {<NEW_LINE>writer.writeAttribute("disabled", "disabled", null);<NEW_LINE>}<NEW_LINE>// button icon<NEW_LINE>String iconClass = isValueBlank(button.getIcon()) ? MenuButton.ICON_CLASS : button.getIcon();<NEW_LINE>// button icon pos<NEW_LINE>String iconPosClass = isIconLeft ? HTML.BUTTON_LEFT_ICON_CLASS : HTML.BUTTON_RIGHT_ICON_CLASS;<NEW_LINE>iconClass = iconPosClass + " " + iconClass;<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", iconClass, null);<NEW_LINE>writer.endElement("span");<NEW_LINE>// text<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", HTML.BUTTON_TEXT_CLASS, null);<NEW_LINE>if (isValueBlank(value)) {<NEW_LINE>writer.write("ui-button");<NEW_LINE>} else {<NEW_LINE>writer.writeText(value, "value");<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.endElement("button");<NEW_LINE>}
String value = button.getValue();
1,122,008
public void addUncheckedStandardDefaults() {<NEW_LINE>QualifierHierarchy qualHierarchy <MASK><NEW_LINE>Set<? extends AnnotationMirror> tops = qualHierarchy.getTopAnnotations();<NEW_LINE>Set<? extends AnnotationMirror> bottoms = qualHierarchy.getBottomAnnotations();<NEW_LINE>for (TypeUseLocation loc : STANDARD_UNCHECKED_DEFAULTS_TOP) {<NEW_LINE>// Only add standard defaults in locations where a default has not be specified<NEW_LINE>for (AnnotationMirror top : tops) {<NEW_LINE>if (!conflictsWithExistingDefaults(uncheckedCodeDefaults, top, loc)) {<NEW_LINE>addUncheckedCodeDefault(top, loc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TypeUseLocation loc : STANDARD_UNCHECKED_DEFAULTS_BOTTOM) {<NEW_LINE>for (AnnotationMirror bottom : bottoms) {<NEW_LINE>// Only add standard defaults in locations where a default has not be specified<NEW_LINE>if (!conflictsWithExistingDefaults(uncheckedCodeDefaults, bottom, loc)) {<NEW_LINE>addUncheckedCodeDefault(bottom, loc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= this.atypeFactory.getQualifierHierarchy();
264,078
public static Object callScript(String scriptName) throws ScriptExecutionException {<NEW_LINE>ModelRepository repo = ScriptServiceUtil.getModelRepository();<NEW_LINE>if (repo != null) {<NEW_LINE>String scriptNameWithExt = scriptName;<NEW_LINE>if (!scriptName.endsWith(Script.SCRIPT_FILEEXT)) {<NEW_LINE>scriptNameWithExt = scriptName + "." + Script.SCRIPT_FILEEXT;<NEW_LINE>}<NEW_LINE>XExpression expr = (XExpression) repo.getModel(scriptNameWithExt);<NEW_LINE>if (expr != null) {<NEW_LINE>ScriptEngine scriptEngine = ScriptServiceUtil.getScriptEngine();<NEW_LINE>if (scriptEngine != null) {<NEW_LINE>Script script = scriptEngine.newScriptFromXExpression(expr);<NEW_LINE>return script.execute();<NEW_LINE>} else {<NEW_LINE>throw new ScriptExecutionException("Script engine is not available.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ScriptExecutionException("Model repository is not available.");<NEW_LINE>}<NEW_LINE>}
ScriptExecutionException("Script '" + scriptName + "' cannot be found.");
1,240,356
public VirtualMachineTO implement(VirtualMachineProfile vm) {<NEW_LINE>BootloaderType bt = BootloaderType.PyGrub;<NEW_LINE>if (vm.getBootLoaderType() == BootloaderType.CD) {<NEW_LINE>bt = vm.getBootLoaderType();<NEW_LINE>}<NEW_LINE>VirtualMachineTO to = toVirtualMachineTO(vm);<NEW_LINE>UserVmVO userVmVO = userVmDao.findById(vm.getId());<NEW_LINE>if (userVmVO != null) {<NEW_LINE>HostVO host = hostDao.findById(userVmVO.getHostId());<NEW_LINE>if (host != null) {<NEW_LINE>List<HostVO> clusterHosts = hostDao.listByClusterAndHypervisorType(host.getClusterId(), host.getHypervisorType());<NEW_LINE>HostVO hostWithMinSocket = clusterHosts.stream().min(Comparator.comparing(HostVO::getCpuSockets)).orElse(null);<NEW_LINE>Integer vCpus = MaxNumberOfVCPUSPerVM.<MASK><NEW_LINE>if (hostWithMinSocket != null && hostWithMinSocket.getCpuSockets() != null && hostWithMinSocket.getCpuSockets() < vCpus) {<NEW_LINE>vCpus = hostWithMinSocket.getCpuSockets();<NEW_LINE>}<NEW_LINE>to.setVcpuMaxLimit(vCpus);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>to.setBootloader(bt);<NEW_LINE>// Determine the VM's OS description<NEW_LINE>GuestOSVO guestOS = guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());<NEW_LINE>Map<String, String> guestOsDetails = guestOsDetailsDao.listDetailsKeyPairs(vm.getVirtualMachine().getGuestOSId());<NEW_LINE>to.setGuestOsDetails(guestOsDetails);<NEW_LINE>to.setOs(guestOS.getDisplayName());<NEW_LINE>HostVO host = hostDao.findById(vm.getVirtualMachine().getHostId());<NEW_LINE>GuestOSHypervisorVO guestOsMapping = null;<NEW_LINE>if (host != null) {<NEW_LINE>guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion());<NEW_LINE>}<NEW_LINE>if (guestOsMapping == null || host == null) {<NEW_LINE>to.setPlatformEmulator(null);<NEW_LINE>} else {<NEW_LINE>to.setPlatformEmulator(guestOsMapping.getGuestOsName());<NEW_LINE>}<NEW_LINE>return to;<NEW_LINE>}
valueIn(host.getClusterId());
74,965
public InternalFuture<QueryFilterContext> processSort(String key, boolean ascending) {<NEW_LINE>if (key == null || key.isEmpty()) {<NEW_LINE>key = "date_updated";<NEW_LINE>}<NEW_LINE>switch(key) {<NEW_LINE>case "date_updated":<NEW_LINE>case "date_created":<NEW_LINE>case "name":<NEW_LINE>return InternalFuture.completedInternalFuture(new QueryFilterContext().addOrderItem(new OrderColumn(key, ascending)));<NEW_LINE>default:<NEW_LINE>// Do nothing<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String[] names = key.split("\\.");<NEW_LINE>// TODO: check length is 2<NEW_LINE>switch(names[0]) {<NEW_LINE>case ModelDBConstants.METRICS:<NEW_LINE>return InternalFuture.completedInternalFuture(processKeyValueSort(names[<MASK><NEW_LINE>case ModelDBConstants.ATTRIBUTES:<NEW_LINE>return InternalFuture.completedInternalFuture(processAttributeSort(names[1], ascending, "attributes"));<NEW_LINE>case ModelDBConstants.HYPERPARAMETERS:<NEW_LINE>final var hyperparameterSoryPredicate = processKeyValueSort(names[1], ascending, "hyperparameters");<NEW_LINE>final var configHyperparameterSoryPredicate = processConfigHyperparametersSort(names[1], ascending);<NEW_LINE>List<QueryFilterContext> queryFilterContexts = new ArrayList<>();<NEW_LINE>queryFilterContexts.add(hyperparameterSoryPredicate);<NEW_LINE>queryFilterContexts.add(configHyperparameterSoryPredicate);<NEW_LINE>return InternalFuture.completedInternalFuture(QueryFilterContext.combine(queryFilterContexts));<NEW_LINE>default:<NEW_LINE>// Do nothing<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return InternalFuture.failedStage(new InvalidArgumentException("Sort key cannot be handled"));<NEW_LINE>}
1], ascending, "metrics"));
1,246,201
private String uploadWork(Business business, EffectivePerson effectivePerson, Work work, String site, String fileName, byte[] bytes, FormDataContentDisposition disposition) throws Exception {<NEW_LINE>WoControl control = business.getControl(effectivePerson, work, WoControl.class);<NEW_LINE>if (BooleanUtils.isNotTrue(control.getAllowSave())) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(fileName)) {<NEW_LINE>fileName = this.fileName(disposition);<NEW_LINE>}<NEW_LINE>// fileName = this.adjustFileName(business, work.getJob(), fileName);<NEW_LINE>this.verifyConstraint(bytes.length, fileName, null);<NEW_LINE>Attachment attachment = business.entityManagerContainer().firstEqualAndEqualAndEqual(Attachment.class, Attachment.job_FIELDNAME, work.getJob(), Attachment.name_FIELDNAME, fileName, Attachment.site_FIELDNAME, site);<NEW_LINE>if (null != attachment) {<NEW_LINE>StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class, attachment.getStorage());<NEW_LINE>attachment.updateContent(mapping, bytes);<NEW_LINE>attachment.setType((new Tika()).detect(bytes));<NEW_LINE>this.updateText(attachment, bytes);<NEW_LINE>business.entityManagerContainer().beginTransaction(Attachment.class);<NEW_LINE>business.entityManagerContainer().check(attachment, CheckPersistType.all);<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>} else {<NEW_LINE>StorageMapping mapping = ThisApplication.context().storageMappings().random(Attachment.class);<NEW_LINE>attachment = this.concreteAttachmentOfWork(work, effectivePerson, site);<NEW_LINE>attachment.saveContent(mapping, bytes, fileName);<NEW_LINE>attachment.setType((new Tika()).detect(bytes, fileName));<NEW_LINE>this.updateText(attachment, bytes);<NEW_LINE>business.entityManagerContainer().beginTransaction(Attachment.class);<NEW_LINE>business.entityManagerContainer().persist(attachment, CheckPersistType.all);<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>}<NEW_LINE>return attachment.getId();<NEW_LINE>}
throw new ExceptionAccessDenied(effectivePerson, work);
1,089,661
public TimeValuePair composeLastTimeValuePair(int measurementIndex) {<NEW_LINE>if (measurementIndex >= columns.length) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// get non-null value<NEW_LINE>int lastIdx = rowCount - 1;<NEW_LINE>if (bitMaps != null && bitMaps[measurementIndex] != null) {<NEW_LINE>BitMap bitMap = bitMaps[measurementIndex];<NEW_LINE>while (lastIdx >= 0) {<NEW_LINE>if (!bitMap.isMarked(lastIdx)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lastIdx--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastIdx < 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TsPrimitiveType value;<NEW_LINE>switch(dataTypes[measurementIndex]) {<NEW_LINE>case INT32:<NEW_LINE>int[] intValues = (int[]) columns[measurementIndex];<NEW_LINE>value = new TsInt(intValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>long[] longValues = (long[]) columns[measurementIndex];<NEW_LINE>value = new TsLong(longValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>float[] floatValues = (float[]) columns[measurementIndex];<NEW_LINE>value = new TsFloat(floatValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>double[] doubleValues = (double[]) columns[measurementIndex];<NEW_LINE>value = new TsDouble(doubleValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>boolean[] boolValues = (<MASK><NEW_LINE>value = new TsBoolean(boolValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>Binary[] binaryValues = (Binary[]) columns[measurementIndex];<NEW_LINE>value = new TsBinary(binaryValues[lastIdx]);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnSupportedDataTypeException(String.format(DATATYPE_UNSUPPORTED, dataTypes[measurementIndex]));<NEW_LINE>}<NEW_LINE>return new TimeValuePair(times[lastIdx], value);<NEW_LINE>}
boolean[]) columns[measurementIndex];
1,704,206
private List<DalGroup> sortGroups(List<DalGroup> groups, String userNo) throws SQLException {<NEW_LINE>List<DalGroup> result = new ArrayList<DalGroup>(groups.size());<NEW_LINE>LoginUser user = BeanGetter.<MASK><NEW_LINE>List<UserGroup> joinedGroups = BeanGetter.getDalUserGroupDao().getUserGroupByUserId(user.getId());<NEW_LINE>if (joinedGroups != null && joinedGroups.size() > 0) {<NEW_LINE>for (UserGroup joinedGroup : joinedGroups) {<NEW_LINE>Iterator<DalGroup> ite = groups.iterator();<NEW_LINE>while (ite.hasNext()) {<NEW_LINE>DalGroup group = ite.next();<NEW_LINE>if (group.getId() == joinedGroup.getGroup_id()) {<NEW_LINE>result.add(group);<NEW_LINE>ite.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.addAll(groups);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getDaoOfLoginUser().getUserByNo(userNo);
281,052
private void initLocator() {<NEW_LINE>log.fine("");<NEW_LINE>// Load Warehouse<NEW_LINE>String sql = "SELECT M_Warehouse_ID, Name FROM M_Warehouse";<NEW_LINE>if (m_only_Warehouse_ID != 0)<NEW_LINE>sql += " WHERE M_Warehouse_ID=" + m_only_Warehouse_ID;<NEW_LINE>String SQL = MRole.getDefault().addAccessSQL(sql, "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) + " ORDER BY 2";<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(SQL, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair key = new KeyNamePair(rs.getInt(1), rs.getString(2));<NEW_LINE>lstWarehouse.appendItem(key.getName(), key);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, SQL, e);<NEW_LINE>}<NEW_LINE>log.fine("Warehouses=" + lstWarehouse.getItemCount());<NEW_LINE>// Load existing Locators<NEW_LINE>m_mLocator.fillComboBox(m_mandatory, true, true, false);<NEW_LINE>log.fine(m_mLocator.toString());<NEW_LINE>for (int i = 0; i < m_mLocator.getSize(); i++) {<NEW_LINE>Object obj = m_mLocator.getElementAt(i);<NEW_LINE>lstLocator.appendItem(obj.toString(), obj);<NEW_LINE>}<NEW_LINE>// lstLocator.setModel(m_mLocator);<NEW_LINE>// lstLocator.setValue(m_M_Locator_ID);<NEW_LINE>lstLocator.setSelectedIndex(0);<NEW_LINE>lstLocator.addEventListener(Events.ON_SELECT, this);<NEW_LINE>displayLocator();<NEW_LINE>chkCreateNew.setChecked(false);<NEW_LINE>chkCreateNew.addEventListener(Events.ON_CHECK, this);<NEW_LINE>enableNew();<NEW_LINE>lstWarehouse.<MASK><NEW_LINE>txtAisleX.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>txtBinY.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>txtLevelZ.addEventListener(Events.ON_CHANGE, this);<NEW_LINE>// Update UI<NEW_LINE>// pack();<NEW_LINE>}
addEventListener(Events.ON_SELECT, this);
755,218
public void resultChanged(org.openide.util.LookupEvent ev) {<NEW_LINE>Collection<? extends ActionMap> ams = result.allInstances();<NEW_LINE>if (err.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>err.fine("changed maps : " + ams);<NEW_LINE>// NOI18N<NEW_LINE>err.fine("previous maps: " + actionMaps);<NEW_LINE>}<NEW_LINE>// do nothing if maps are actually the same<NEW_LINE>if (ams.size() == actionMaps.size()) {<NEW_LINE>boolean theSame = true;<NEW_LINE>int i = 0;<NEW_LINE>for (Iterator<? extends ActionMap> newMaps = ams.iterator(); newMaps.hasNext(); i++) {<NEW_LINE>ActionMap oldMap = actionMaps.<MASK><NEW_LINE>if (oldMap == null || oldMap != newMaps.next()) {<NEW_LINE>theSame = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (theSame) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update actionMaps<NEW_LINE>List<Reference<ActionMap>> tempActionMaps = new ArrayList<Reference<ActionMap>>(2);<NEW_LINE>for (ActionMap actionMap : ams) {<NEW_LINE>tempActionMaps.add(new WeakReference<ActionMap>(actionMap));<NEW_LINE>}<NEW_LINE>actionMaps = tempActionMaps;<NEW_LINE>if (err.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>err.fine("clearActionPerformers");<NEW_LINE>}<NEW_LINE>Mutex.EVENT.readAccess(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>clearActionPerformers();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
get(i).get();
566,883
Component addComponent() throws IOException {<NEW_LINE>Component component;<NEW_LINE>long readable = readableBytes(data);<NEW_LINE>long offset = position.getAndUpdate(p -> readable);<NEW_LINE>int length = (int) (readable - offset);<NEW_LINE>if (length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>component = new Component(length, offset);<NEW_LINE>components.add(component);<NEW_LINE>if (!data.isInMemory()) {<NEW_LINE>AtomicReference<IOException> <MASK><NEW_LINE>fileAccess.getAndUpdate(channel -> {<NEW_LINE>if (channel == null) {<NEW_LINE>try {<NEW_LINE>return new RandomAccessFile(data.getFile(), "r");<NEW_LINE>} catch (IOException e) {<NEW_LINE>error.set(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return channel;<NEW_LINE>});<NEW_LINE>IOException exception = error.get();<NEW_LINE>if (exception != null) {<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return component;<NEW_LINE>}
error = new AtomicReference<>();
121,488
public List<RoleAssignmentRow> initRoleAssignments() {<NEW_LINE>List<RoleAssignmentRow> raList = null;<NEW_LINE>if (dvObject != null && dvObject.getId() != null) {<NEW_LINE>Set<RoleAssignment> ras = roleService.rolesAssignments(dvObject);<NEW_LINE>List<DataverseRole> availableRoles = getAvailableRoles();<NEW_LINE>raList = new ArrayList<>(ras.size());<NEW_LINE>for (RoleAssignment roleAssignment : ras) {<NEW_LINE>// only show roles that are available for this DVObject<NEW_LINE>if (availableRoles.contains(roleAssignment.getRole())) {<NEW_LINE>RoleAssignee roleAssignee = roleAssigneeService.<MASK><NEW_LINE>if (roleAssignee != null) {<NEW_LINE>raList.add(new RoleAssignmentRow(roleAssignment, roleAssignee.getDisplayInfo()));<NEW_LINE>} else {<NEW_LINE>logger.info("Could not find role assignee based on role assignment id " + roleAssignment.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return raList;<NEW_LINE>}
getRoleAssignee(roleAssignment.getAssigneeIdentifier());
447,050
public Geometry union() {<NEW_LINE>if (inputPolys.isEmpty())<NEW_LINE>return null;<NEW_LINE>geomFactory = ((Geometry) inputPolys.iterator().next()).getFactory();<NEW_LINE>loadIndex(inputPolys);<NEW_LINE>// --- cluster the geometries<NEW_LINE>for (PolygonNode queryNode : nodes) {<NEW_LINE>index.query(queryNode.getEnvelope(), new ItemVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitItem(Object item) {<NEW_LINE>PolygonNode node = (PolygonNode) item;<NEW_LINE>if (item == queryNode)<NEW_LINE>return;<NEW_LINE>// avoid duplicate intersections<NEW_LINE>if (node.id() > queryNode.id())<NEW_LINE>return;<NEW_LINE>if (queryNode.isInSameCluster(node))<NEW_LINE>return;<NEW_LINE>if (!queryNode.intersects(node))<NEW_LINE>return;<NEW_LINE>queryNode<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// --- compute union of each cluster<NEW_LINE>List<Geometry> clusterGeom = new ArrayList<Geometry>();<NEW_LINE>for (PolygonNode node : nodes) {<NEW_LINE>Geometry geom = node.union();<NEW_LINE>if (geom == null)<NEW_LINE>continue;<NEW_LINE>clusterGeom.add(geom);<NEW_LINE>}<NEW_LINE>return geomFactory.buildGeometry(clusterGeom);<NEW_LINE>}
.merge((PolygonNode) item);
776,757
public Long sumAbsenteeismUnitForDayWithMonth(String year, String month, String unit) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(StatisticDingdingUnitForDay.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> query = cb.createQuery(Long.class);<NEW_LINE>Root<StatisticDingdingUnitForDay> root = <MASK><NEW_LINE>Predicate p = cb.equal(root.get(StatisticDingdingUnitForDay_.statisticYear), year);<NEW_LINE>p = cb.and(p, cb.equal(root.get(StatisticDingdingUnitForDay_.statisticMonth), month));<NEW_LINE>p = cb.and(p, cb.equal(root.get(StatisticDingdingUnitForDay_.o2Unit), unit));<NEW_LINE>query.select(cb.sum(root.get(StatisticDingdingUnitForDay_.absenteeismTimes))).where(p);<NEW_LINE>return em.createQuery(query).getSingleResult();<NEW_LINE>}
query.from(StatisticDingdingUnitForDay.class);
858,662
public void analyze() {<NEW_LINE>AnalysisScope scope = myForwardScope;<NEW_LINE>final DependenciesBuilder builder = new ForwardDependenciesBuilder(getProject(), scope, getScopeOfInterest());<NEW_LINE>builder.setTotalFileCount(myTotalFileCount);<NEW_LINE>builder.analyze();<NEW_LINE>subtractScope(builder, getScope());<NEW_LINE>final PsiManager psiManager = PsiManager.getInstance(getProject());<NEW_LINE>psiManager.startBatchFilesProcessingMode();<NEW_LINE>try {<NEW_LINE>final int fileCount = getScope().getFileCount();<NEW_LINE>getScope().accept(new PsiRecursiveElementVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitFile(final PsiFile file) {<NEW_LINE>ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();<NEW_LINE>if (indicator != null) {<NEW_LINE>if (indicator.isCanceled()) {<NEW_LINE>throw new ProcessCanceledException();<NEW_LINE>}<NEW_LINE>indicator.setText(AnalysisScopeBundle.message("package.dependencies.progress.text"));<NEW_LINE>final VirtualFile virtualFile = file.getVirtualFile();<NEW_LINE>if (virtualFile != null) {<NEW_LINE>indicator.setText2(ProjectUtil.calcRelativeToProjectPath(virtualFile, getProject()));<NEW_LINE>}<NEW_LINE>if (fileCount > 0) {<NEW_LINE>indicator.setFraction(((double) ++myFileCount) / myTotalFileCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<PsiFile, Set<PsiFile><MASK><NEW_LINE>for (final PsiFile psiFile : dependencies.keySet()) {<NEW_LINE>if (dependencies.get(psiFile).contains(file)) {<NEW_LINE>Set<PsiFile> fileDeps = getDependencies().get(file);<NEW_LINE>if (fileDeps == null) {<NEW_LINE>fileDeps = new HashSet<PsiFile>();<NEW_LINE>getDependencies().put(file, fileDeps);<NEW_LINE>}<NEW_LINE>fileDeps.add(psiFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>psiManager.dropResolveCaches();<NEW_LINE>InjectedLanguageManager.getInstance(file.getProject()).dropFileCaches(file);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>psiManager.finishBatchFilesProcessingMode();<NEW_LINE>}<NEW_LINE>}
> dependencies = builder.getDependencies();
26,795
public void commandStarted(CommandStartedEvent event) {<NEW_LINE>String databaseName = event.getDatabaseName();<NEW_LINE>// don't trace commands like "endSessions"<NEW_LINE>if ("admin".equals(databaseName))<NEW_LINE>return;<NEW_LINE>Span span = threadLocalSpan.next();<NEW_LINE>if (span == null || span.isNoop())<NEW_LINE>return;<NEW_LINE>String commandName = event.getCommandName();<NEW_LINE>BsonDocument command = event.getCommand();<NEW_LINE>String collectionName = getCollectionName(command, commandName);<NEW_LINE>span.name(getSpanName(commandName, collectionName)).kind(CLIENT).remoteServiceName("mongodb-" + databaseName).tag("mongodb.command", commandName);<NEW_LINE>if (collectionName != null) {<NEW_LINE>span.tag("mongodb.collection", collectionName);<NEW_LINE>}<NEW_LINE>ConnectionDescription connectionDescription = event.getConnectionDescription();<NEW_LINE>if (connectionDescription != null) {<NEW_LINE>ConnectionId connectionId = connectionDescription.getConnectionId();<NEW_LINE>if (connectionId != null) {<NEW_LINE>span.tag("mongodb.cluster_id", connectionId.getServerId().getClusterId().getValue());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InetSocketAddress socketAddress = connectionDescription.getServerAddress().getSocketAddress();<NEW_LINE>span.remoteIpAndPort(socketAddress.getAddress().getHostAddress(<MASK><NEW_LINE>} catch (MongoSocketException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>span.start();<NEW_LINE>}
), socketAddress.getPort());
1,726,510
private String fixQuery(boolean isSPARUL, String query, Dataset dataset, boolean includeInferred, BindingSet bindings, List<Value> pstmtParams, String baseURI) throws RepositoryException {<NEW_LINE>boolean added_def_graph = false;<NEW_LINE>Set<URI> list;<NEW_LINE>String removeGraph = null;<NEW_LINE>String insertGraph = null;<NEW_LINE>if (dataset != null) {<NEW_LINE>// TODO update later, when support of new defines will be added<NEW_LINE>list = dataset.getDefaultRemoveGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>if (list.size() > 1)<NEW_LINE>throw new RepositoryException("Only ONE DefaultRemoveGraph is supported");<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>removeGraph = " <" + it.next().toString() + "> ";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URI g = dataset.getDefaultInsertGraph();<NEW_LINE>if (g != null)<NEW_LINE>insertGraph = " <" + g.toString() + "> ";<NEW_LINE>}<NEW_LINE>query = SubstGraphs(query, insertGraph, removeGraph);<NEW_LINE>StringBuffer ret = new StringBuffer("sparql\n ");<NEW_LINE>if (includeInferred && ruleSet != null && ruleSet.length() > 0)<NEW_LINE>ret.append("define input:inference '" + ruleSet + "'\n ");<NEW_LINE>if (dataset != null) {<NEW_LINE>list = dataset.getDefaultGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>URI v = it.next();<NEW_LINE>ret.append(" define input:default-graph-uri <" + <MASK><NEW_LINE>added_def_graph = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>list = dataset.getNamedGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>URI v = it.next();<NEW_LINE>ret.append(" define input:named-graph-uri <" + v.toString() + "> \n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!added_def_graph && useDefGraphForQueries)<NEW_LINE>ret.append(" define input:default-graph-uri <" + defGraph + "> \n");<NEW_LINE>if (baseURI != null && baseURI.length() > 0)<NEW_LINE>ret.append(" BASE <" + baseURI + "> \n");<NEW_LINE>ret.append(substBindings(query, bindings, pstmtParams, isSPARUL));<NEW_LINE>return ret.toString();<NEW_LINE>}
v.toString() + "> \n");
1,307,340
private void print(StringBuffer sb, List<Integer> maxColumnWidths, String prefix, boolean root, boolean last) {<NEW_LINE>StringBuffer column = new StringBuffer();<NEW_LINE>if (!root) {<NEW_LINE>column.append(prefix);<NEW_LINE>column.append(last ? BRANCH_LAST : BRANCH);<NEW_LINE>prefix += last ? INDENT_LAST : INDENT;<NEW_LINE>}<NEW_LINE>for (int i = 0, c = columns.length; i < c; i++) {<NEW_LINE>column.append(columns[i]);<NEW_LINE>if (i < c - 1) {<NEW_LINE>if (maxColumnWidths != null) {<NEW_LINE>// Align columns<NEW_LINE>while (column.length() < maxColumnWidths.get(i)) {<NEW_LINE>column.append(' ');<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Separate columns with whitespace.<NEW_LINE>column.append(' ');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(column.toString());<NEW_LINE>column.setLength(0);<NEW_LINE>}<NEW_LINE>sb.append("\n");<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < childCount; i++) {<NEW_LINE>children.get(i).print(sb, maxColumnWidths, prefix, false, i == childCount - 1);<NEW_LINE>}<NEW_LINE>}
int childCount = children.size();
318,383
private void removeSymbolsByProject(IJavaProject project) {<NEW_LINE>// If project name is null it cannot be in the cache<NEW_LINE>if (project.getElementName() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<EnhancedSymbolInformation> oldSymbols = symbolsByProject.remove(project.getElementName());<NEW_LINE>if (oldSymbols != null) {<NEW_LINE>List<EnhancedSymbolInformation> copy = null;<NEW_LINE>synchronized (oldSymbols) {<NEW_LINE>copy = new ArrayList<>(oldSymbols);<NEW_LINE>}<NEW_LINE>synchronized (this.symbols) {<NEW_LINE>symbols.removeAll(copy);<NEW_LINE>}<NEW_LINE>Set<String> keySet = symbolsByDoc.keySet();<NEW_LINE>Iterator<String> docIter = keySet.iterator();<NEW_LINE>while (docIter.hasNext()) {<NEW_LINE>String docURI = docIter.next();<NEW_LINE>List<EnhancedSymbolInformation> <MASK><NEW_LINE>synchronized (docSymbols) {<NEW_LINE>docSymbols.removeAll(copy);<NEW_LINE>if (docSymbols.isEmpty()) {<NEW_LINE>docIter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
docSymbols = symbolsByDoc.get(docURI);
532,252
private Mono<PagedResponse<PerfMonResponseInner>> listPerfMonCountersSlotNextSinglePageAsync(String nextLink) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listPerfMonCountersSlotNext(nextLink, this.client.getEndpoint(), accept, context)).<PagedResponse<PerfMonResponseInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>}
)).readOnly()));
1,688,812
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmExtensionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
this.client.mergeContext(context);
1,771,277
protected synchronized void createQuery(String queryString) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("EJBQL query: " + queryString);<NEW_LINE>}<NEW_LINE>query = em.createQuery(queryString);<NEW_LINE>// Set parameters.<NEW_LINE>List<String> parameterNames = getCollectedParameterNames();<NEW_LINE>if (!parameterNames.isEmpty()) {<NEW_LINE>// Use set to prevent the parameter to be set multiple times.<NEW_LINE>Set<String> namesSet = new HashSet<>();<NEW_LINE>for (Iterator<String> iter = parameterNames.iterator(); iter.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>if (namesSet.add(parameterName)) {<NEW_LINE>JRValueParameter parameter = getValueParameter(parameterName);<NEW_LINE>String ejbParamName = getEjbqlParameterName(parameterName);<NEW_LINE>Object paramValue = parameter.getValue();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Parameter " + ejbParamName + ": " + paramValue);<NEW_LINE>}<NEW_LINE>query.setParameter(ejbParamName, paramValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Set query hints.<NEW_LINE>// First, set query hints supplied by the JPA_QUERY_HINTS_MAP parameter.<NEW_LINE>Map<String, Object> queryHintsMap = (Map<String, Object>) getParameterValue(JRJpaQueryExecuterFactory.PARAMETER_JPA_QUERY_HINTS_MAP);<NEW_LINE>if (queryHintsMap != null) {<NEW_LINE>for (Iterator<Map.Entry<String, Object>> i = queryHintsMap.entrySet().iterator(); i.hasNext(); ) {<NEW_LINE>Map.Entry<String, Object> pairs = i.next();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("EJBQL query hint [" + pairs.getKey() + "] set.");<NEW_LINE>}<NEW_LINE>query.setHint(pairs.getKey(), pairs.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Second, set query hints supplied by report properties which start with JREjbPersistenceQueryExecuterFactory.PROPERTY_JPA_PERSISTENCE_QUERY_HINT_PREFIX<NEW_LINE>// Example: net.sf.jasperreports.ejbql.query.hint.fetchSize<NEW_LINE>// This property will result in a query hint set with the name: fetchSize<NEW_LINE>List<PropertySuffix> properties = JRPropertiesUtil.getProperties(dataset, JRJpaQueryExecuterFactory.PROPERTY_JPA_QUERY_HINT_PREFIX);<NEW_LINE>for (Iterator<PropertySuffix> it = properties.iterator(); it.hasNext(); ) {<NEW_LINE>PropertySuffix property = it.next();<NEW_LINE>String queryHint = property.getSuffix();<NEW_LINE>if (queryHint.length() > 0) {<NEW_LINE>String value = property.getValue();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("EJBQL query hint [" + queryHint + "] set to: " + value);<NEW_LINE>}<NEW_LINE>query.setHint(queryHint, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String parameterName = iter.next();
1,631,291
static <// / @Generated("This method was generated using jOOQ-tools")<NEW_LINE>T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Seq<Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>> crossApply(Stream<? extends T1> stream, Function<? super T1, ? extends Stream<? extends T2>> function2, Function<? super T2, ? extends Stream<? extends T3>> function3, Function<? super T3, ? extends Stream<? extends T4>> function4, Function<? super T4, ? extends Stream<? extends T5>> function5, Function<? super T5, ? extends Stream<? extends T6>> function6, Function<? super T6, ? extends Stream<? extends T7>> function7, Function<? super T7, ? extends Stream<? extends T8>> function8, Function<? super T8, ? extends Stream<? extends T9>> function9, Function<? super T9, ? extends Stream<? extends T10>> function10, Function<? super T10, ? extends Stream<? extends T11>> function11, Function<? super T11, ? extends Stream<? extends T12>> function12) {<NEW_LINE>return crossApply(seq(stream), t -> seq(function2.apply(t)), t -> seq(function3.apply(t)), t -> seq(function4.apply(t)), t -> seq(function5.apply(t)), t -> seq(function6.apply(t)), t -> seq(function7.apply(t)), t -> seq(function8.apply(t)), t -> seq(function9.apply(t)), t -> seq(function10.apply(t)), t -> seq(function11.apply(t)), t -> seq(<MASK><NEW_LINE>}
function12.apply(t)));
36,575
private Object calculateLocal(OResult currentRecord, Object target, OCommandContext ctx) {<NEW_LINE>if (methodCall != null) {<NEW_LINE>return <MASK><NEW_LINE>} else if (suffix != null) {<NEW_LINE>return suffix.execute(target, ctx);<NEW_LINE>} else if (arrayRange != null) {<NEW_LINE>return arrayRange.execute(currentRecord, target, ctx);<NEW_LINE>} else if (condition != null) {<NEW_LINE>if (target instanceof OResult || target instanceof OIdentifiable || target instanceof Map) {<NEW_LINE>if (condition.evaluate(target, ctx)) {<NEW_LINE>return target;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (OMultiValue.isMultiValue(target)) {<NEW_LINE>List<Object> result = new ArrayList<>();<NEW_LINE>for (Object o : OMultiValue.getMultiValueIterable(target)) {<NEW_LINE>if (condition.evaluate(o, ctx)) {<NEW_LINE>result.add(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (arraySingleValues != null) {<NEW_LINE>return arraySingleValues.execute(currentRecord, target, ctx);<NEW_LINE>} else if (rightBinaryCondition != null) {<NEW_LINE>return rightBinaryCondition.execute(currentRecord, target, ctx);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
methodCall.execute(target, ctx);
956,097
public AppsListDataSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AppsListDataSummary appsListDataSummary = new AppsListDataSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ListArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appsListDataSummary.setListArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ListId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appsListDataSummary.setListId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ListName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appsListDataSummary.setListName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AppsList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>appsListDataSummary.setAppsList(new ListUnmarshaller<App>(AppJsonUnmarshaller.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 appsListDataSummary;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,020,755
final ListAccessesResult executeListAccesses(ListAccessesRequest listAccessesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAccessesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAccessesRequest> request = null;<NEW_LINE>Response<ListAccessesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAccessesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAccessesRequest));<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, "Transfer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAccesses");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAccessesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListAccessesResultJsonUnmarshaller());
1,429,959
private AppendRequest buildAppendEntriesRequest(final RaftMemberContext member, final long lastIndex) {<NEW_LINE>final IndexedRaftLogEntry prevEntry = member.getCurrentEntry();<NEW_LINE>final DefaultRaftMember leader = raft.getLeader();<NEW_LINE>final AppendRequest.Builder builder = builderWithPreviousEntry(prevEntry).withTerm(raft.getTerm()).withLeader(leader.memberId()).withCommitIndex(raft.getCommitIndex());<NEW_LINE>// Build a list of entries to send to the member.<NEW_LINE>final List<PersistedRaftRecord> entries = new ArrayList<>();<NEW_LINE>// Build a list of entries up to the MAX_BATCH_SIZE. Note that entries in the log may<NEW_LINE>// be null if they've been compacted and the member to which we're sending entries is just<NEW_LINE>// joining the cluster or is otherwise far behind. Null entries are simply skipped and not<NEW_LINE>// counted towards the size of the batch.<NEW_LINE>// If there exists an entry in the log with size >= MAX_BATCH_SIZE the logic ensures that<NEW_LINE>// entry will be sent in a batch of size one<NEW_LINE>int size = 0;<NEW_LINE>// Iterate through the log until the last index or the end of the log is reached.<NEW_LINE>while (member.hasNextEntry()) {<NEW_LINE>// Otherwise, read the next entry and add it to the batch.<NEW_LINE>final <MASK><NEW_LINE>final var replicatableRecord = entry.getPersistedRaftRecord();<NEW_LINE>entries.add(replicatableRecord);<NEW_LINE>size += replicatableRecord.approximateSize();<NEW_LINE>if (entry.index() == lastIndex || size >= maxBatchSizePerAppend) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add the entries to the request builder and build the request.<NEW_LINE>return builder.withEntries(entries).build();<NEW_LINE>}
IndexedRaftLogEntry entry = member.nextEntry();
55,856
private void loadRatesCurves(ImmutableMarketDataBuilder builder, LocalDate marketDataDate) {<NEW_LINE>if (!subdirectoryExists(CURVES_DIR)) {<NEW_LINE>log.debug("No rates curves directory found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResourceLocator curveGroupsResource = getResource(CURVES_DIR, CURVES_GROUPS_FILE);<NEW_LINE>if (curveGroupsResource == null) {<NEW_LINE>log.error("Unable to load rates curves: curve groups file not found at {}/{}", CURVES_DIR, CURVES_GROUPS_FILE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResourceLocator curveSettingsResource = getResource(CURVES_DIR, CURVES_SETTINGS_FILE);<NEW_LINE>if (curveSettingsResource == null) {<NEW_LINE>log.error("Unable to load rates curves: curve settings file not found at {}/{}", CURVES_DIR, CURVES_SETTINGS_FILE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Collection<ResourceLocator> curvesResources = getRatesCurvesResources();<NEW_LINE>List<RatesCurveGroup> ratesCurves = RatesCurvesCsvLoader.load(<MASK><NEW_LINE>for (RatesCurveGroup group : ratesCurves) {<NEW_LINE>// add entry for higher level discount curve name<NEW_LINE>group.getDiscountCurves().forEach((ccy, curve) -> builder.addValue(CurveId.of(group.getName(), curve.getName()), curve));<NEW_LINE>// add entry for higher level forward curve name<NEW_LINE>group.getForwardCurves().forEach((idx, curve) -> builder.addValue(CurveId.of(group.getName(), curve.getName()), curve));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error loading rates curves", e);<NEW_LINE>}<NEW_LINE>}
marketDataDate, curveGroupsResource, curveSettingsResource, curvesResources);
1,834,627
public Map<String, List<SystemActionWorkflowActionMapping>> findSystemActionsMapByContentType(final List<ContentType> contentTypes, final User user) throws DotDataException, DotSecurityException {<NEW_LINE>final Map<String, List<Map<String, Object>>> mappingsMap = this.workFlowFactory.findSystemActionsMapByContentType(contentTypes);<NEW_LINE>final ImmutableMap.Builder<String, List<SystemActionWorkflowActionMapping>> actionsMapBuilder = new ImmutableMap.Builder<>();<NEW_LINE>final Map<String, ContentType> contentTypeMap = contentTypes.stream().collect(Collectors.toMap(contentType -> contentType.variable(), contentType -> contentType));<NEW_LINE>for (final Map.Entry<String, List<Map<String, Object>>> entry : mappingsMap.entrySet()) {<NEW_LINE>final ImmutableList.Builder<SystemActionWorkflowActionMapping> mappingListBuilder = <MASK><NEW_LINE>for (final Map<String, Object> rowMap : entry.getValue()) {<NEW_LINE>mappingListBuilder.add(this.toSystemActionWorkflowActionMapping(rowMap, contentTypeMap.get(entry.getKey()), user));<NEW_LINE>}<NEW_LINE>actionsMapBuilder.put(entry.getKey(), mappingListBuilder.build());<NEW_LINE>}<NEW_LINE>return actionsMapBuilder.build();<NEW_LINE>}
new ImmutableList.Builder<>();