idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
450,056
private void renderListBox() {<NEW_LINE>miniTable.renderAll();<NEW_LINE>List<ListItem> items = miniTable.getItems();<NEW_LINE>Iterator<ListItem<MASK><NEW_LINE>popup = new WEditorPopupMenu(true, false, false);<NEW_LINE>popup.addEventListener(Events.ON_OPEN, this);<NEW_LINE>Menuitem menu = (Menuitem) popup.getChildren().get(0);<NEW_LINE>menu.addEventListener(Events.ON_CLICK, this);<NEW_LINE>boolean flag = true;<NEW_LINE>boolean isAttached = false;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>ListItem item = it.next();<NEW_LINE>if (item.getChildren().size() > 1) {<NEW_LINE>Listcell cell1 = (Listcell) item.getChildren().get(4);<NEW_LINE>Listcell cell2 = (Listcell) item.getChildren().get(5);<NEW_LINE>Listcell cell3 = (Listcell) item.getChildren().get(7);<NEW_LINE>Listcell cell4 = (Listcell) item.getChildren().get(8);<NEW_LINE>cell1.setContext(popup.getId());<NEW_LINE>cell2.setContext(popup.getId());<NEW_LINE>cell3.setContext(popup.getId());<NEW_LINE>cell4.setContext(popup.getId());<NEW_LINE>if (flag) {<NEW_LINE>cell1.setStyle("background-color:#F7F7F7;");<NEW_LINE>cell2.setStyle("background-color:#F7F7F7;");<NEW_LINE>cell3.setStyle("background-color:#F7F7F7;");<NEW_LINE>cell4.setStyle("background-color:#F7F7F7;");<NEW_LINE>flag = false;<NEW_LINE>} else {<NEW_LINE>cell1.setStyle("background-color:#E9E8E5;");<NEW_LINE>cell2.setStyle("background-color:#E9E8E5;");<NEW_LINE>cell3.setStyle("background-color:#E9E8E5;");<NEW_LINE>cell4.setStyle("background-color:#E9E8E5;");<NEW_LINE>flag = true;<NEW_LINE>}<NEW_LINE>if (!isAttached) {<NEW_LINE>cell1.appendChild(popup);<NEW_LINE>isAttached = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Listfoot listfoot = new Listfoot();<NEW_LINE>listfoot.setHeight("25px");<NEW_LINE>// Select<NEW_LINE>Listfooter listfooter = new Listfooter("");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Account No<NEW_LINE>listfooter = new Listfooter("Total:");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Account Name<NEW_LINE>listfooter = new Listfooter("");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// User List 1<NEW_LINE>listfooter = new Listfooter("");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Period Actual<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Period Budget<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Period Variance<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Total Actual<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Total Budget<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>// Total Variance<NEW_LINE>listfooter = new Listfooter("0.0");<NEW_LINE>listfoot.appendChild(listfooter);<NEW_LINE>miniTable.appendChild(listfoot);<NEW_LINE>}
> it = items.iterator();
735,503
public static APIGetCandidateIsoForAttachingVmReply __example__() {<NEW_LINE>APIGetCandidateIsoForAttachingVmReply reply = new APIGetCandidateIsoForAttachingVmReply();<NEW_LINE>ImageInventory inv = new ImageInventory();<NEW_LINE>inv.setUuid(uuid());<NEW_LINE>ImageBackupStorageRefInventory ref = new ImageBackupStorageRefInventory();<NEW_LINE>ref.setBackupStorageUuid(uuid());<NEW_LINE>ref.setImageUuid(inv.getUuid());<NEW_LINE>ref.setInstallPath("ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd");<NEW_LINE>ref.setStatus(ImageStatus.Ready.toString());<NEW_LINE>inv.setName("TinyLinux");<NEW_LINE>inv.setBackupStorageRefs(Collections.singletonList(ref));<NEW_LINE>inv.setUrl("http://192.168.1.20/share/images/tinylinux.qcow2");<NEW_LINE>inv.setFormat(ImageConstant.QCOW2_FORMAT_STRING);<NEW_LINE>inv.setMediaType(ImageConstant.ImageMediaType.RootVolumeTemplate.toString());<NEW_LINE>inv.setPlatform(<MASK><NEW_LINE>reply.setInventories(asList(inv));<NEW_LINE>return reply;<NEW_LINE>}
ImagePlatform.Linux.toString());
904,133
final UpdateSiteResult executeUpdateSite(UpdateSiteRequest updateSiteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSiteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSiteRequest> request = null;<NEW_LINE>Response<UpdateSiteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSiteRequest));<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, "Outposts");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSiteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSiteResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSite");
1,697,989
private void updateModules() {<NEW_LINE>Set<ModuleContext> moduleContextSet = new HashSet<>();<NEW_LINE>for (Map.Entry<ModuleId, ModuleContext> moduleIdModuleContextEntry : moduleContextMap.entrySet()) {<NEW_LINE>ModuleId moduleId = moduleIdModuleContextEntry.getKey();<NEW_LINE>ModuleContext oldModuleContext = moduleIdModuleContextEntry.getValue();<NEW_LINE>PackageDescriptor packageDescriptor <MASK><NEW_LINE>ModuleName moduleName = ModuleName.from(packageDescriptor.name(), oldModuleContext.moduleName().moduleNamePart());<NEW_LINE>ModuleDescriptor moduleDescriptor = ModuleDescriptor.from(moduleName, packageDescriptor);<NEW_LINE>Map<DocumentId, DocumentContext> srcDocContextMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.srcDocumentIds()) {<NEW_LINE>srcDocContextMap.put(documentId, oldModuleContext.documentContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, DocumentContext> testDocContextMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.testSrcDocumentIds()) {<NEW_LINE>testDocContextMap.put(documentId, oldModuleContext.documentContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, ResourceContext> resourceMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.resourceIds()) {<NEW_LINE>resourceMap.put(documentId, oldModuleContext.resourceContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, ResourceContext> testResourceMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.testResourceIds()) {<NEW_LINE>testResourceMap.put(documentId, oldModuleContext.resourceContext(documentId));<NEW_LINE>}<NEW_LINE>moduleContextSet.add(new ModuleContext(this.project, moduleId, moduleDescriptor, oldModuleContext.isDefaultModule(), srcDocContextMap, testDocContextMap, oldModuleContext.moduleMdContext().orElse(null), oldModuleContext.moduleDescDependencies(), resourceMap, testResourceMap));<NEW_LINE>}<NEW_LINE>updateModules(moduleContextSet);<NEW_LINE>}
= this.packageManifest.descriptor();
1,282,626
public IBaseParameters triggerSubscription(List<IPrimitiveType<String>> theResourceIds, List<IPrimitiveType<String>> theSearchUrls, @IdParam IIdType theSubscriptionId) {<NEW_LINE>if (myDaoConfig.getSupportedSubscriptionTypes().isEmpty()) {<NEW_LINE>throw new PreconditionFailedException(Msg.code(22) + "Subscription processing not active on this server");<NEW_LINE>}<NEW_LINE>// Throw a 404 if the subscription doesn't exist<NEW_LINE>if (theSubscriptionId != null) {<NEW_LINE>IFhirResourceDao<?> subscriptionDao = myDaoRegistry.getSubscriptionDao();<NEW_LINE>IIdType subscriptionId = theSubscriptionId;<NEW_LINE>if (!subscriptionId.hasResourceType()) {<NEW_LINE>subscriptionId = subscriptionId.withResourceType(ResourceTypeEnum.SUBSCRIPTION.getCode());<NEW_LINE>}<NEW_LINE>subscriptionDao.read(<MASK><NEW_LINE>}<NEW_LINE>List<IPrimitiveType<String>> resourceIds = ObjectUtils.defaultIfNull(theResourceIds, Collections.emptyList());<NEW_LINE>List<IPrimitiveType<String>> searchUrls = ObjectUtils.defaultIfNull(theSearchUrls, Collections.emptyList());<NEW_LINE>// Make sure we have at least one resource ID or search URL<NEW_LINE>if (resourceIds.size() == 0 && searchUrls.size() == 0) {<NEW_LINE>throw new InvalidRequestException(Msg.code(23) + "No resource IDs or search URLs specified for triggering");<NEW_LINE>}<NEW_LINE>// Resource URLs must be compete<NEW_LINE>for (IPrimitiveType<String> next : resourceIds) {<NEW_LINE>IdType resourceId = new IdType(next.getValue());<NEW_LINE>ValidateUtil.isTrueOrThrowInvalidRequest(resourceId.hasResourceType(), SUBSCRIPTION_TRIGGERING_PARAM_RESOURCE_ID + " parameter must have resource type");<NEW_LINE>ValidateUtil.isTrueOrThrowInvalidRequest(resourceId.hasIdPart(), SUBSCRIPTION_TRIGGERING_PARAM_RESOURCE_ID + " parameter must have resource ID part");<NEW_LINE>}<NEW_LINE>// Search URLs must be valid<NEW_LINE>for (IPrimitiveType<String> next : searchUrls) {<NEW_LINE>if (!next.getValue().contains("?")) {<NEW_LINE>throw new InvalidRequestException(Msg.code(24) + "Search URL is not valid (must be in the form \"[resource type]?[optional params]\")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SubscriptionTriggeringJobDetails jobDetails = new SubscriptionTriggeringJobDetails();<NEW_LINE>jobDetails.setJobId(UUID.randomUUID().toString());<NEW_LINE>jobDetails.setRemainingResourceIds(resourceIds.stream().map(t -> t.getValue()).collect(Collectors.toList()));<NEW_LINE>jobDetails.setRemainingSearchUrls(searchUrls.stream().map(t -> t.getValue()).collect(Collectors.toList()));<NEW_LINE>if (theSubscriptionId != null) {<NEW_LINE>jobDetails.setSubscriptionId(theSubscriptionId.getIdPart());<NEW_LINE>}<NEW_LINE>// Submit job for processing<NEW_LINE>synchronized (myActiveJobs) {<NEW_LINE>myActiveJobs.add(jobDetails);<NEW_LINE>ourLog.info("Subscription triggering requested for {} resource and {} search - Gave job ID: {} and have {} jobs", resourceIds.size(), searchUrls.size(), jobDetails.getJobId(), myActiveJobs.size());<NEW_LINE>}<NEW_LINE>// Create a parameters response<NEW_LINE>IBaseParameters retVal = ParametersUtil.newInstance(myFhirContext);<NEW_LINE>IPrimitiveType<?> value = (IPrimitiveType<?>) myFhirContext.getElementDefinition("string").newInstance();<NEW_LINE>value.setValueAsString("Subscription triggering job submitted as JOB ID: " + jobDetails.myJobId);<NEW_LINE>ParametersUtil.addParameterToParameters(myFhirContext, retVal, "information", value);<NEW_LINE>return retVal;<NEW_LINE>}
subscriptionId, SystemRequestDetails.forAllPartition());
1,124,683
public JsonNode traceTransaction(String transactionHash) throws Exception {<NEW_LINE>logger.trace("trace_transaction({})", transactionHash);<NEW_LINE>byte[] hash = stringHexToByteArray(transactionHash);<NEW_LINE>TransactionInfo txInfo = this.receiptStore.getInMainChain(hash, this<MASK><NEW_LINE>if (txInfo == null) {<NEW_LINE>logger.trace("No transaction info for {}", transactionHash);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Block block = this.blockchain.getBlockByHash(txInfo.getBlockHash());<NEW_LINE>Block parent = this.blockchain.getBlockByHash(block.getParentHash().getBytes());<NEW_LINE>Transaction tx = block.getTransactionsList().get(txInfo.getIndex());<NEW_LINE>txInfo.setTransaction(tx);<NEW_LINE>ProgramTraceProcessor programTraceProcessor = new ProgramTraceProcessor();<NEW_LINE>this.blockExecutor.traceBlock(programTraceProcessor, VmConfig.LIGHT_TRACE, block, parent.getHeader(), false, false);<NEW_LINE>SummarizedProgramTrace programTrace = (SummarizedProgramTrace) programTraceProcessor.getProgramTrace(tx.getHash());<NEW_LINE>if (programTrace == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<TransactionTrace> traces = TraceTransformer.toTraces(programTrace, txInfo, block.getNumber());<NEW_LINE>return OBJECT_MAPPER.valueToTree(traces);<NEW_LINE>}
.blockStore).orElse(null);
1,575,729
public I_M_HU_PI retrieveDefaultLUOrNull(@CacheCtx final Properties ctx, final int adOrgId) {<NEW_LINE>return queryBL.createQueryBuilder(I_M_HU_PI.class, ctx, ITrx.TRXNAME_None).addOnlyActiveRecordsFilter().addOnlyContextClientOrSystem().addEqualsFilter(I_M_HU_PI.COLUMN_IsDefaultLU, true).addInArrayOrAllFilter(I_M_HU_PI.COLUMNNAME_AD_Org_ID, Env.CTXVALUE_AD_Org_ID_System, adOrgId).orderBy().addColumn(I_M_HU_PI.COLUMNNAME_AD_Client_ID, Direction.Descending, Nulls.Last).addColumn(I_M_HU_PI.COLUMNNAME_AD_Org_ID, Direction.Descending, Nulls.Last).endOrderBy().create(<MASK><NEW_LINE>}
).firstOnly(I_M_HU_PI.class);
1,748,875
public ClassLoadingStrategy<ClassLoader> resolveStrategy(Class<?> mockedType, ClassLoader classLoader, boolean localMock) {<NEW_LINE>if (localMock) {<NEW_LINE>try {<NEW_LINE>Object privateLookup;<NEW_LINE>try {<NEW_LINE>privateLookup = privateLookupIn.invoke(null, mockedType, lookup);<NEW_LINE>} catch (InvocationTargetException exception) {<NEW_LINE>if (exception.getCause() instanceof IllegalAccessException) {<NEW_LINE>return ClassLoadingStrategy.Default.WRAPPER.with(mockedType.getProtectionDomain());<NEW_LINE>} else {<NEW_LINE>throw exception.getCause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ClassLoadingStrategy.UsingLookup.of(privateLookup);<NEW_LINE>} catch (Throwable exception) {<NEW_LINE>throw new MockitoException(join("The Java module system prevents Mockito from defining a mock class in the same package as " + mockedType, "", "To overcome this, you must open and export the mocked type to Mockito.", "Remember that you can also do so programmatically if the mocked class is defined by the same module as your test code", exception));<NEW_LINE>}<NEW_LINE>} else if (classLoader == InjectionBase.class.getClassLoader()) {<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>return ClassLoadingStrategy.Default.WRAPPER.with(mockedType.getProtectionDomain());<NEW_LINE>}<NEW_LINE>}
ClassLoadingStrategy.UsingLookup.of(codegenLookup);
635,930
public void onThreadCreated(WebSocket websocket, ThreadType threadType, Thread thread) {<NEW_LINE>final String identifier = getJDA().getIdentifierString();<NEW_LINE>final String guildId = guild.getId();<NEW_LINE>switch(threadType) {<NEW_LINE>case CONNECT_THREAD:<NEW_LINE>thread.setName(identifier + " AudioWS-ConnectThread (guildId: " + guildId + ')');<NEW_LINE>break;<NEW_LINE>case FINISH_THREAD:<NEW_LINE>thread.setName(identifier + " AudioWS-FinishThread (guildId: " + guildId + ')');<NEW_LINE>break;<NEW_LINE>case WRITING_THREAD:<NEW_LINE>thread.setName(identifier + " AudioWS-WriteThread (guildId: " + guildId + ')');<NEW_LINE>break;<NEW_LINE>case READING_THREAD:<NEW_LINE>thread.setName(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>thread.setName(identifier + " AudioWS-" + threadType + " (guildId: " + guildId + ')');<NEW_LINE>}<NEW_LINE>}
identifier + " AudioWS-ReadThread (guildId: " + guildId + ')');
1,198,833
private void handleCoolant() {<NEW_LINE>double temp = heatCapacitor.getTemperature();<NEW_LINE>double heat = getBoilEfficiency() * (temp - HeatUtils.BASE_BOIL_TEMP) * heatCapacitor.getHeatCapacity();<NEW_LINE>long coolantHeated = 0;<NEW_LINE>if (!fluidCoolantTank.isEmpty()) {<NEW_LINE>double caseCoolantHeat = heat * waterConductivity;<NEW_LINE>coolantHeated = (int) (HeatUtils.getSteamEnergyEfficiency() * caseCoolantHeat / HeatUtils.getWaterThermalEnthalpy());<NEW_LINE>coolantHeated = Math.max(0, Math.min(coolantHeated, fluidCoolantTank.getFluidAmount()));<NEW_LINE>if (coolantHeated > 0) {<NEW_LINE>MekanismUtils.logMismatchedStackSize(fluidCoolantTank.shrinkStack((int) coolantHeated, Action.EXECUTE), coolantHeated);<NEW_LINE>// extra steam is dumped<NEW_LINE>heatedCoolantTank.insert(MekanismGases.STEAM.getStack(coolantHeated), <MASK><NEW_LINE>caseCoolantHeat = coolantHeated * HeatUtils.getWaterThermalEnthalpy() / HeatUtils.getSteamEnergyEfficiency();<NEW_LINE>heatCapacitor.handleHeat(-caseCoolantHeat);<NEW_LINE>}<NEW_LINE>} else if (!gasCoolantTank.isEmpty()) {<NEW_LINE>CooledCoolant coolantType = gasCoolantTank.getStack().get(CooledCoolant.class);<NEW_LINE>if (coolantType != null) {<NEW_LINE>double caseCoolantHeat = heat * coolantType.getConductivity();<NEW_LINE>coolantHeated = (int) (caseCoolantHeat / coolantType.getThermalEnthalpy());<NEW_LINE>coolantHeated = Math.max(0, Math.min(coolantHeated, gasCoolantTank.getStored()));<NEW_LINE>if (coolantHeated > 0) {<NEW_LINE>MekanismUtils.logMismatchedStackSize(gasCoolantTank.shrinkStack((int) coolantHeated, Action.EXECUTE), coolantHeated);<NEW_LINE>heatedCoolantTank.insert(coolantType.getHeatedGas().getStack(coolantHeated), Action.EXECUTE, AutomationType.INTERNAL);<NEW_LINE>caseCoolantHeat = coolantHeated * coolantType.getThermalEnthalpy();<NEW_LINE>heatCapacitor.handleHeat(-caseCoolantHeat);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastBoilRate = coolantHeated;<NEW_LINE>}
Action.EXECUTE, AutomationType.INTERNAL);
1,529,467
private void updateFrameConfig(boolean updateResizable) {<NEW_LINE>if (frame == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Update window opacity if the frame is undecorated, translucency capable and not fullscreen<NEW_LINE>if (frame.isUndecorated() && frame.getGraphicsConfiguration().isTranslucencyCapable() && frame.getGraphicsConfiguration().getDevice().getFullScreenWindow() == null) {<NEW_LINE>frame.setOpacity(((float) config.windowOpacity()) / 100.0f);<NEW_LINE>}<NEW_LINE>if (config.usernameInTitle() && (client instanceof Client)) {<NEW_LINE>final Player player = ((Client) client).getLocalPlayer();<NEW_LINE>if (player != null && player.getName() != null) {<NEW_LINE>frame.setTitle(title + <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>frame.setTitle(title);<NEW_LINE>}<NEW_LINE>if (frame.isAlwaysOnTopSupported()) {<NEW_LINE>frame.setAlwaysOnTop(config.gameAlwaysOnTop());<NEW_LINE>}<NEW_LINE>if (updateResizable) {<NEW_LINE>frame.setResizable(!config.lockWindowSize());<NEW_LINE>}<NEW_LINE>frame.setExpandResizeType(config.automaticResizeType());<NEW_LINE>ContainableFrame.Mode containMode = config.containInScreen();<NEW_LINE>if (containMode == ContainableFrame.Mode.ALWAYS && !withTitleBar) {<NEW_LINE>// When native window decorations are enabled we don't have a way to receive window move events<NEW_LINE>// so we can't contain to screen always.<NEW_LINE>containMode = ContainableFrame.Mode.RESIZING;<NEW_LINE>}<NEW_LINE>frame.setContainedInScreen(containMode);<NEW_LINE>if (!config.rememberScreenBounds()) {<NEW_LINE>configManager.unsetConfiguration(CONFIG_GROUP, CONFIG_CLIENT_MAXIMIZED);<NEW_LINE>configManager.unsetConfiguration(CONFIG_GROUP, CONFIG_CLIENT_BOUNDS);<NEW_LINE>}<NEW_LINE>if (client == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The upper bounds are defined by the applet's max size<NEW_LINE>// The lower bounds are defined by the client's fixed size<NEW_LINE>int width = Math.max(Math.min(config.gameSize().width, 7680), Constants.GAME_FIXED_WIDTH);<NEW_LINE>int height = Math.max(Math.min(config.gameSize().height, 2160), Constants.GAME_FIXED_HEIGHT);<NEW_LINE>final Dimension size = new Dimension(width, height);<NEW_LINE>if (!size.equals(lastClientSize)) {<NEW_LINE>lastClientSize = size;<NEW_LINE>client.setSize(size);<NEW_LINE>client.setPreferredSize(size);<NEW_LINE>client.getParent().setPreferredSize(size);<NEW_LINE>client.getParent().setSize(size);<NEW_LINE>if (frame.isVisible()) {<NEW_LINE>frame.pack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
" - " + player.getName());
1,842,458
public Tensor[] merge(Tensor[][] gradients, int size) {<NEW_LINE>Tensor[] output = new Tensor[weights.length];<NEW_LINE>for (int i = 0; i < weights.length; i++) {<NEW_LINE>if (gradients[0][i] instanceof DenseVector) {<NEW_LINE>for (int j = 1; j < size; j++) {<NEW_LINE>gradients[0][i].intersectAndAddInPlace(gradients[j][i]);<NEW_LINE>}<NEW_LINE>output[i] = gradients[0][i];<NEW_LINE>} else if (gradients[0][i] instanceof DenseMatrix) {<NEW_LINE>for (int j = 1; j < size; j++) {<NEW_LINE>gradients[0][i].intersectAndAddInPlace(gradients[j][i]);<NEW_LINE>}<NEW_LINE>output[i] = gradients[0][i];<NEW_LINE>} else if (gradients[0][i] instanceof DenseSparseMatrix) {<NEW_LINE>DenseSparseMatrix[] updates = new DenseSparseMatrix[size];<NEW_LINE>for (int j = 0; j < updates.length; j++) {<NEW_LINE>updates[j] = (DenseSparseMatrix<MASK><NEW_LINE>}<NEW_LINE>DenseSparseMatrix update = merger.merge(updates);<NEW_LINE>output[i] = update;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unexpected gradient type, expected DenseVector, DenseMatrix or DenseSparseMatrix, received " + gradients[0][i].getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
) gradients[j][0];
838,509
private EndpointInfo createEndpointInfo(AbstractServiceFactoryBean serviceFactory, QName portName, PortInfoImpl portInfo) throws BusException {<NEW_LINE>EndpointInfo ei = null;<NEW_LINE>String address = portInfo.getAddress();<NEW_LINE>String bindingID = BindingID.getBindingID(portInfo.getBindingID());<NEW_LINE>DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);<NEW_LINE>try {<NEW_LINE>// the bindingId might be the transportId, just attempt to<NEW_LINE>// load it to force the factory to load<NEW_LINE>dfm.getDestinationFactory(bindingID);<NEW_LINE>} catch (BusException ex) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>DestinationFactory df = dfm.getDestinationFactoryForUri(address);<NEW_LINE>String transportId = null;<NEW_LINE>if (df != null && df.getTransportIds() != null && !df.getTransportIds().isEmpty()) {<NEW_LINE>transportId = df.getTransportIds().get(0);<NEW_LINE>} else {<NEW_LINE>transportId = bindingID;<NEW_LINE>}<NEW_LINE>Object config = null;<NEW_LINE>if (serviceFactory instanceof JaxWsServiceFactoryBean) {<NEW_LINE>config = <MASK><NEW_LINE>}<NEW_LINE>BindingInfo bindingInfo = bus.getExtension(BindingFactoryManager.class).getBindingFactory(bindingID).createBindingInfo(serviceFactory.getService(), bindingID, config);<NEW_LINE>Service service = serviceFactory.getService();<NEW_LINE>service.getServiceInfos().get(0).addBinding(bindingInfo);<NEW_LINE>ei = new EndpointInfo(service.getServiceInfos().get(0), transportId);<NEW_LINE>ei.setName(portName);<NEW_LINE>ei.setAddress(address);<NEW_LINE>ei.setBinding(bindingInfo);<NEW_LINE>service.getServiceInfos().get(0).addEndpoint(ei);<NEW_LINE>return ei;<NEW_LINE>}
new JaxWsSoapBindingConfiguration((JaxWsServiceFactoryBean) serviceFactory);
816,279
protected void validate() throws ContainerInitializationException {<NEW_LINE>List<String> errFields = new ArrayList<>();<NEW_LINE>if (requestTypeClass == null) {<NEW_LINE>errFields.add("request type class");<NEW_LINE>}<NEW_LINE>if (responseTypeClass == null) {<NEW_LINE>errFields.add("response type class");<NEW_LINE>}<NEW_LINE>if (requestReader == null) {<NEW_LINE>errFields.add("request reader");<NEW_LINE>}<NEW_LINE>if (responseWriter == null) {<NEW_LINE>errFields.add("response writer");<NEW_LINE>}<NEW_LINE>if (securityContextWriter == null) {<NEW_LINE>errFields.add("security context writer");<NEW_LINE>}<NEW_LINE>if (exceptionHandler == null) {<NEW_LINE>errFields.add("exception handler");<NEW_LINE>}<NEW_LINE>if (initializationWrapper == null) {<NEW_LINE>errFields.add("initialization wrapper");<NEW_LINE>}<NEW_LINE>if (!errFields.isEmpty()) {<NEW_LINE>throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(<MASK><NEW_LINE>}<NEW_LINE>}
", ", errFields)), null);
1,151,588
public Set<Flow> bddMultipathConsistency(NetworkSnapshot snapshot, MultipathConsistencyParameters parameters) {<NEW_LINE>BDDPacket pkt = new BDDPacket();<NEW_LINE>// TODO add ignoreFilters parameter<NEW_LINE>boolean ignoreFilters = false;<NEW_LINE>BDDReachabilityAnalysisFactory bddReachabilityAnalysisFactory = getBddReachabilityAnalysisFactory(snapshot, pkt, ignoreFilters);<NEW_LINE>IpSpaceAssignment srcIpSpaceAssignment = parameters.getSrcIpSpaceAssignment();<NEW_LINE>Set<String> finalNodes = parameters.getFinalNodes();<NEW_LINE>Set<FlowDisposition> failureDispositions = ImmutableSet.of(FlowDisposition.DENIED_IN, FlowDisposition.DENIED_OUT, FlowDisposition.LOOP, FlowDisposition.INSUFFICIENT_INFO, FlowDisposition.NEIGHBOR_UNREACHABLE, <MASK><NEW_LINE>Set<FlowDisposition> successDispositions = ImmutableSet.of(FlowDisposition.ACCEPTED, FlowDisposition.DELIVERED_TO_SUBNET, FlowDisposition.EXITS_NETWORK);<NEW_LINE>Set<String> forbiddenTransitNodes = parameters.getForbiddenTransitNodes();<NEW_LINE>Set<String> requiredTransitNodes = parameters.getRequiredTransitNodes();<NEW_LINE>Map<IngressLocation, BDD> successBdds = bddReachabilityAnalysisFactory.getAllBDDs(srcIpSpaceAssignment, parameters.getHeaderSpace(), forbiddenTransitNodes, requiredTransitNodes, finalNodes, successDispositions);<NEW_LINE>Map<IngressLocation, BDD> failureBdds = bddReachabilityAnalysisFactory.getAllBDDs(srcIpSpaceAssignment, parameters.getHeaderSpace(), forbiddenTransitNodes, requiredTransitNodes, finalNodes, failureDispositions);<NEW_LINE>return ImmutableSet.copyOf(computeMultipathInconsistencies(pkt, successBdds, failureBdds));<NEW_LINE>}
FlowDisposition.NO_ROUTE, FlowDisposition.NULL_ROUTED);
699,969
public void registerNode(RegisterNodeRequest request, StreamObserver<SimpleResponse> responseObserver) {<NEW_LINE>SimpleResponse.Builder response = SimpleResponse.newBuilder();<NEW_LINE>if (checkVersionError(request.getVersion(), responseObserver)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateRpcLastContact();<NEW_LINE>try {<NEW_LINE>String clientKey = getNodeClientKey(request.getNodeSpec());<NEW_LINE>NodeClient client = nodeClientCache.getOrDefault(clientKey, null);<NEW_LINE>if (null != client) {<NEW_LINE>client.close();<NEW_LINE>}<NEW_LINE>client = new NodeClient(request.getNodeSpec().getIp(), request.getNodeSpec().getClientPort());<NEW_LINE>nodeClientCache.put(clientKey, client);<NEW_LINE>LOG.info("register node:" + clientKey);<NEW_LINE>startHeartBeatMonitor(request.getNodeSpec(), request.getVersion());<NEW_LINE>amStateMachine.handle(new AMEvent(AMEventType.REGISTER_NODE, request, request.getVersion()));<NEW_LINE>response.setCode(RpcCode.OK.ordinal());<NEW_LINE>response.setMessage("");<NEW_LINE>} catch (Exception e) {<NEW_LINE>response.setCode(RpcCode.ERROR.ordinal());<NEW_LINE>response.setMessage(e.getMessage());<NEW_LINE>handleStateTransitionError(request, e);<NEW_LINE>}<NEW_LINE>responseObserver.<MASK><NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}
onNext(response.build());
345,249
void runIfNotProcessed(BatchedTask updateTask) {<NEW_LINE>// if this task is already processed, it shouldn't execute other tasks with same batching key that arrived later,<NEW_LINE>// to give other tasks with different batching key a chance to execute.<NEW_LINE>if (updateTask.processed.get() == false) {<NEW_LINE>final List<BatchedTask> toExecute = new ArrayList<>();<NEW_LINE>final Map<String, List<BatchedTask>> processTasksBySource = new HashMap<>();<NEW_LINE>final Set<BatchedTask> pending = tasksPerBatchingKey.remove(updateTask.batchingKey);<NEW_LINE>if (pending != null) {<NEW_LINE>// pending is a java.util.Collections.SynchronizedSet so we can safely iterate holding its mutex<NEW_LINE>// noinspection SynchronizationOnLocalVariableOrMethodParameter<NEW_LINE>synchronized (pending) {<NEW_LINE>for (BatchedTask task : pending) {<NEW_LINE>if (task.processed.getAndSet(true) == false) {<NEW_LINE><MASK><NEW_LINE>toExecute.add(task);<NEW_LINE>processTasksBySource.computeIfAbsent(task.source, s -> new ArrayList<>()).add(task);<NEW_LINE>} else {<NEW_LINE>logger.trace("skipping {}, already processed", task);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toExecute.isEmpty() == false) {<NEW_LINE>run(updateTask.batchingKey, toExecute, buildTasksDescription(updateTask, toExecute, processTasksBySource));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logger.trace("will process {}", task);
587,428
public void normalizeCifar(File fileName) {<NEW_LINE>DataSet result = new DataSet();<NEW_LINE>result.load(fileName);<NEW_LINE>if (!meanStdStored && train) {<NEW_LINE>uMean = Math.abs(uMean / numExamples);<NEW_LINE>uStd = Math.sqrt(uStd);<NEW_LINE>vMean = Math.abs(vMean / numExamples);<NEW_LINE>vStd = Math.sqrt(vStd);<NEW_LINE>// TODO find cleaner way to store and load (e.g. json or yaml)<NEW_LINE>try {<NEW_LINE>FileUtils.write(meanVarPath, uMean + "," + uStd + "," + vMean + "," + vStd);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("", e);<NEW_LINE>}<NEW_LINE>meanStdStored = true;<NEW_LINE>} else if (uMean == 0 && meanStdStored) {<NEW_LINE>try {<NEW_LINE>String[] values = FileUtils.readFileToString(meanVarPath).split(",");<NEW_LINE>uMean = Double.parseDouble(values[0]);<NEW_LINE>uStd = Double.parseDouble(values[1]);<NEW_LINE>vMean = Double.parseDouble(values[2]);<NEW_LINE>vStd = Double.parseDouble(values[3]);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < result.numExamples(); i++) {<NEW_LINE>INDArray newFeatures = result.get(i).getFeatures();<NEW_LINE>newFeatures.tensorAlongDimension(0, new int[] { 0, 2, 3 }).divi(255);<NEW_LINE>newFeatures.tensorAlongDimension(1, new int[] { 0, 2, 3 }).subi(uMean).divi(uStd);<NEW_LINE>newFeatures.tensorAlongDimension(2, new int[] { 0, 2, 3 }).subi(vMean).divi(vStd);<NEW_LINE>result.get<MASK><NEW_LINE>}<NEW_LINE>result.save(fileName);<NEW_LINE>}
(i).setFeatures(newFeatures);
1,089,497
private IndexedMethod createMethod(String signature, IndexResult map) {<NEW_LINE>String clz = map.getValue(GroovyIndexer.CLASS_NAME);<NEW_LINE>String module = map.getValue(GroovyIndexer.IN);<NEW_LINE>if (clz == null) {<NEW_LINE>// Module method?<NEW_LINE>clz = module;<NEW_LINE>} else if ((module != null) && (module.length() > 0)) {<NEW_LINE>// NOI18N<NEW_LINE>clz = module + "." + clz;<NEW_LINE>}<NEW_LINE>// String fqn = map.getValue(GroovyIndexer.FQN_NAME);<NEW_LINE>int typeIndex = signature.indexOf(';');<NEW_LINE>String methodSignature = signature;<NEW_LINE>String type = "void";<NEW_LINE>if (typeIndex != -1) {<NEW_LINE>int endIndex = signature.<MASK><NEW_LINE>if (endIndex == -1) {<NEW_LINE>endIndex = signature.length();<NEW_LINE>}<NEW_LINE>type = signature.substring(typeIndex + 1, endIndex);<NEW_LINE>methodSignature = signature.substring(0, typeIndex);<NEW_LINE>}<NEW_LINE>// Extract attributes<NEW_LINE>int attributeIndex = signature.indexOf(';', typeIndex + 1);<NEW_LINE>String attributes = null;<NEW_LINE>int flags = 0;<NEW_LINE>if (attributeIndex != -1) {<NEW_LINE>flags = IndexedElement.stringToFlag(signature, attributeIndex + 1);<NEW_LINE>if (signature.length() > attributeIndex + 1) {<NEW_LINE>attributes = signature.substring(attributeIndex + 1, signature.length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new IndexedMethod(map, clz, getMethodName(methodSignature), type, getMethodParameter(methodSignature), attributes, flags);<NEW_LINE>}
indexOf(';', typeIndex + 1);
1,566,385
public Object _reflectiveCallStrict(String className, Object instance, String methodName, ModuleLog L, Object... arguments) {<NEW_LINE>try {<NEW_LINE>Log.d(Countly.TAG, <MASK><NEW_LINE>if (arguments != null && arguments.length % 2 != 0) {<NEW_LINE>L.w("wrong arguments passed to reflectiveCallStrict");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>className = className == null && instance != null ? instance.getClass().getName() : className;<NEW_LINE>Class<?> cls = instance == null ? Class.forName(className) : instance.getClass();<NEW_LINE>Class<?>[] types = arguments != null && arguments.length > 0 ? new Class[arguments.length / 2] : null;<NEW_LINE>Object[] args = new Object[arguments != null ? arguments.length / 2 : 0];<NEW_LINE>if (arguments != null && arguments.length > 0) {<NEW_LINE>for (int i = 0; i < types.length; i += 2) {<NEW_LINE>args[i] = arguments[i * 2];<NEW_LINE>types[i] = (Class<?>) arguments[i * 2 + 1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Method method = cls.getDeclaredMethod(methodName, types);<NEW_LINE>return method.invoke(instance, args);<NEW_LINE>} catch (ClassNotFoundException t) {<NEW_LINE>L.w("Cannot call " + methodName + " of " + className, t);<NEW_LINE>return false;<NEW_LINE>} catch (NoSuchMethodException t) {<NEW_LINE>L.w("Cannot call " + methodName + " of " + className, t);<NEW_LINE>return false;<NEW_LINE>} catch (IllegalAccessException t) {<NEW_LINE>L.w("Cannot call " + methodName + " of " + className, t);<NEW_LINE>return false;<NEW_LINE>} catch (InvocationTargetException t) {<NEW_LINE>L.w("Cannot call " + methodName + " of " + className, t);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
"cls " + className + ", inst " + instance);
117,712
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>descTextArea = new javax.swing.JTextArea();<NEW_LINE>tableScrollPane = new javax.swing.JScrollPane();<NEW_LINE>table = new javax.swing.JTable();<NEW_LINE>// NOI18N<NEW_LINE>setName(NbBundle.getMessage(SAXGeneratorParsletPanel.class, "SAXGeneratorParsletPanel.Form.name"));<NEW_LINE>setPreferredSize(new java.awt.Dimension(480, 350));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>descTextArea.setEditable(false);<NEW_LINE>descTextArea.setFont(javax.swing.UIManager.getFont("Label.font"));<NEW_LINE>descTextArea.setForeground(new java.awt.Color(102, 102, 153));<NEW_LINE>descTextArea.setLineWrap(true);<NEW_LINE>// NOI18N<NEW_LINE>java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/tools/java/generator/Bundle");<NEW_LINE>// NOI18N<NEW_LINE>descTextArea.setText(bundle.getString("DESC_saxw_convertors"));<NEW_LINE>descTextArea.setWrapStyleWord(true);<NEW_LINE>descTextArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));<NEW_LINE>descTextArea.setEnabled(false);<NEW_LINE>descTextArea.setOpaque(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(descTextArea, gridBagConstraints);<NEW_LINE>table.setModel(tableModel);<NEW_LINE>tableScrollPane.setViewportView(table);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(<MASK><NEW_LINE>add(tableScrollPane, gridBagConstraints);<NEW_LINE>}
12, 0, 0, 0);
1,316,200
/*<NEW_LINE>* @see com.sitewhere.grpc.service.DeviceEventManagementGrpc.<NEW_LINE>* DeviceEventManagementImplBase#addMeasurements(com.sitewhere.grpc.service.<NEW_LINE>* GAddMeasurementsRequest, io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addMeasurements(GAddMeasurementsRequest request, StreamObserver<GAddMeasurementsResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceEventManagementGrpc.getAddMeasurementsMethod());<NEW_LINE>List<? extends IDeviceMeasurement> apiResult = getDeviceEventManagement().addDeviceMeasurements(EventModelConverter.asApiDeviceEventContext(request.getContext()), EventModelConverter.asApiDeviceMeasurementCreateRequests(request.getRequestsList()).toArray<MASK><NEW_LINE>GAddMeasurementsResponse.Builder response = GAddMeasurementsResponse.newBuilder();<NEW_LINE>if (apiResult != null) {<NEW_LINE>response.addAllMeasurements(EventModelConverter.asGrpcDeviceMeasurements(apiResult));<NEW_LINE>}<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceEventManagementGrpc.getAddMeasurementsMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceEventManagementGrpc.getAddMeasurementsMethod());<NEW_LINE>}<NEW_LINE>}
(new IDeviceMeasurementCreateRequest[0]));
1,374,698
protected V filterSingleObject(V featureVector) {<NEW_LINE>// generic casts here are not safe, but will do:<NEW_LINE>Norm<? <MASK><NEW_LINE>if (featureVector instanceof SparseNumberVector) {<NEW_LINE>// Special override, as it will be easily used inefficiently otherwise<NEW_LINE>if (EuclideanDistance.STATIC.equals(norm)) {<NEW_LINE>norm = (Norm<? super V>) SparseEuclideanDistance.STATIC;<NEW_LINE>} else if (ManhattanDistance.STATIC.equals(norm)) {<NEW_LINE>norm = (Norm<? super V>) SparseManhattanDistance.STATIC;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final double d = norm.norm(featureVector);<NEW_LINE>final double factor = d > 0 ? 1 / d : 1.;<NEW_LINE>// Optimized codepath when converting sparse vectors<NEW_LINE>if (featureVector instanceof SparseNumberVector && factory instanceof SparseNumberVector.Factory) {<NEW_LINE>SparseNumberVector fv = (SparseNumberVector) featureVector;<NEW_LINE>SparseNumberVector.Factory<?> sfact = (SparseNumberVector.Factory<?>) factory;<NEW_LINE>if (map == null) {<NEW_LINE>map = new Int2DoubleOpenHashMap();<NEW_LINE>}<NEW_LINE>map.clear();<NEW_LINE>for (int j = fv.iter(); fv.iterValid(j); j = fv.iterAdvance(j)) {<NEW_LINE>map.put(fv.iterDim(j), fv.iterDoubleValue(j) * factor);<NEW_LINE>}<NEW_LINE>return (V) sfact.newNumberVector(map, fv.getDimensionality());<NEW_LINE>}<NEW_LINE>return factory.newNumberVector(VMath.timesEquals(featureVector.toArray(), factor));<NEW_LINE>}
super V> norm = this.norm;
591,540
public static GalenActionGenerateArguments parse(String[] args) {<NEW_LINE>args = ArgumentsUtils.processSystemProperties(args);<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption("e", "export", true, "Path to generated spec file");<NEW_LINE>options.addOption("G", "no-galen-extras", false, "Disable galen-extras expressions");<NEW_LINE>CommandLineParser parser = new PosixParser();<NEW_LINE>CommandLine cmd;<NEW_LINE>try {<NEW_LINE>cmd = parser.parse(options, args);<NEW_LINE>} catch (MissingArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("Missing value for " + e.getOption().getLongOpt(), e);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>GalenActionGenerateArguments arguments = new GalenActionGenerateArguments();<NEW_LINE>arguments.setExport(cmd.getOptionValue("e"));<NEW_LINE>arguments.setUseGalenExtras(!cmd.hasOption("G"));<NEW_LINE>if (cmd.getArgs() == null || cmd.getArgs().length < 1) {<NEW_LINE>throw new IllegalArgumentException("Missing page dump file");<NEW_LINE>}<NEW_LINE>arguments.setPath(cmd<MASK><NEW_LINE>return arguments;<NEW_LINE>}
.getArgs()[0]);
1,484,055
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unused, ValueNode object) {<NEW_LINE>ValueNode <MASK><NEW_LINE>LogicNode isArray = b.add(ObjectIsArrayNode.create(objectNonNull));<NEW_LINE>GuardingNode isArrayGuard;<NEW_LINE>if (b.needsExplicitException()) {<NEW_LINE>isArrayGuard = b.emitBytecodeExceptionCheck(isArray, true, BytecodeExceptionKind.ILLEGAL_ARGUMENT_EXCEPTION_ARGUMENT_IS_NOT_AN_ARRAY);<NEW_LINE>} else {<NEW_LINE>isArrayGuard = b.add(new FixedGuardNode(isArray, DeoptimizationReason.RuntimeConstraint, DeoptimizationAction.InvalidateRecompile, false));<NEW_LINE>}<NEW_LINE>ValueNode array;<NEW_LINE>if (isArrayGuard != null) {<NEW_LINE>AbstractObjectStamp alwaysArrayStamp = ((AbstractObjectStamp) objectNonNull.stamp(NodeView.DEFAULT)).asAlwaysArray();<NEW_LINE>array = b.add(new PiNode(objectNonNull, alwaysArrayStamp, isArrayGuard.asNode()));<NEW_LINE>} else {<NEW_LINE>array = objectNonNull;<NEW_LINE>}<NEW_LINE>b.addPush(JavaKind.Int, new ArrayLengthNode(array));<NEW_LINE>return true;<NEW_LINE>}
objectNonNull = b.nullCheckedValue(object);
444,989
private void handleResult(Reconciliation reconciliation, AsyncResult<Void> result, Timer.Sample reconciliationTimerSample) {<NEW_LINE>if (result.succeeded()) {<NEW_LINE>updateResourceState(reconciliation, true, null);<NEW_LINE>successfulReconciliationsCounter(reconciliation.namespace()).increment();<NEW_LINE>reconciliationTimerSample.stop(reconciliationsTimer(reconciliation.namespace()));<NEW_LINE>LOGGER.infoCr(reconciliation, "reconciled");<NEW_LINE>} else {<NEW_LINE>Throwable cause = result.cause();<NEW_LINE>if (cause instanceof InvalidConfigParameterException) {<NEW_LINE>updateResourceState(reconciliation, false, cause);<NEW_LINE>failedReconciliationsCounter(reconciliation.namespace()).increment();<NEW_LINE>reconciliationTimerSample.stop(reconciliationsTimer<MASK><NEW_LINE>LOGGER.warnCr(reconciliation, "Failed to reconcile {}", cause.getMessage());<NEW_LINE>} else if (cause instanceof UnableToAcquireLockException) {<NEW_LINE>lockedReconciliationsCounter(reconciliation.namespace()).increment();<NEW_LINE>} else {<NEW_LINE>updateResourceState(reconciliation, false, cause);<NEW_LINE>failedReconciliationsCounter(reconciliation.namespace()).increment();<NEW_LINE>reconciliationTimerSample.stop(reconciliationsTimer(reconciliation.namespace()));<NEW_LINE>LOGGER.warnCr(reconciliation, "Failed to reconcile", cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(reconciliation.namespace()));
482,643
private RetainedMessage tryGetLocally(@NotNull final String topic, final int retry, final int bucketIndex) throws Exception {<NEW_LINE>checkNotNull(topic, "Topic must not be null");<NEW_LINE>ThreadPreConditions.startsWith(SINGLE_WRITER_THREAD_PREFIX);<NEW_LINE>final RocksDB bucket = buckets[bucketIndex];<NEW_LINE>final byte[] messageAsBytes = bucket.get(serializer.serializeKey(topic));<NEW_LINE>if (messageAsBytes != null) {<NEW_LINE>final RetainedMessage message = serializer.deserializeValue(messageAsBytes);<NEW_LINE>final byte[] payload = payloadPersistence.<MASK><NEW_LINE>if (payload == null) {<NEW_LINE>// In case the payload was just deleted, we return the new retained message for this topic (or null if it was removed).<NEW_LINE>if (retry < 100) {<NEW_LINE>return tryGetLocally(topic, retry + 1, bucketIndex);<NEW_LINE>} else {<NEW_LINE>log.warn("No payload was found for the retained message on topic {}.", topic);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (PublishUtil.checkExpiry(message.getTimestamp(), message.getMessageExpiryInterval())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>message.setMessage(payload);<NEW_LINE>return message;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getPayloadOrNull(message.getPublishId());
1,639,326
public DockerTag tag(DockerTag source, String repository, String tag, boolean force) throws DockerException {<NEW_LINE>if (repository == null) {<NEW_LINE>throw new IllegalArgumentException("Repository can't be empty");<NEW_LINE>}<NEW_LINE>StringBuilder action = new StringBuilder("/images/");<NEW_LINE>action.append(source.getId());<NEW_LINE>action.append("/tag");<NEW_LINE>action.append("?");<NEW_LINE>action.append<MASK><NEW_LINE>if (force) {<NEW_LINE>action.append("&force=1");<NEW_LINE>}<NEW_LINE>if (tag != null) {<NEW_LINE>action.append("&tag=").append(tag);<NEW_LINE>}<NEW_LINE>doPostRequest(action.toString(), false, Collections.singleton(HttpURLConnection.HTTP_CREATED));<NEW_LINE>String tagResult = DockerUtils.getTag(repository, tag);<NEW_LINE>long time = System.currentTimeMillis() / 1000;<NEW_LINE>// XXX we send it as older API does not have the commit event<NEW_LINE>if (emitEvents) {<NEW_LINE>instance.getEventBus().sendEvent(new DockerEvent(instance, DockerEvent.Status.TAG, source.getId(), tagResult, time));<NEW_LINE>}<NEW_LINE>return new DockerTag(source.getImage(), tagResult);<NEW_LINE>}
("repo=").append(repository);
658,274
public BLangNode transform(EnumDeclarationNode enumDeclarationNode) {<NEW_LINE>Boolean publicQualifier = false;<NEW_LINE>if (enumDeclarationNode.qualifier().isPresent() && enumDeclarationNode.qualifier().get().kind() == SyntaxKind.PUBLIC_KEYWORD) {<NEW_LINE>publicQualifier = true;<NEW_LINE>}<NEW_LINE>for (Node member : enumDeclarationNode.enumMemberList()) {<NEW_LINE>EnumMemberNode enumMember = (EnumMemberNode) member;<NEW_LINE>if (enumMember.identifier().isMissing()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addToTop(transformEnumMember(enumMember, publicQualifier));<NEW_LINE>}<NEW_LINE>BLangTypeDefinition bLangTypeDefinition = (BLangTypeDefinition) TreeBuilder.createTypeDefinition();<NEW_LINE>if (publicQualifier) {<NEW_LINE>bLangTypeDefinition.flagSet.add(Flag.PUBLIC);<NEW_LINE>}<NEW_LINE>bLangTypeDefinition.flagSet.add(Flag.ENUM);<NEW_LINE>bLangTypeDefinition.setName((BLangIdentifier) transform(enumDeclarationNode.identifier()));<NEW_LINE>bLangTypeDefinition.pos = getPosition(enumDeclarationNode);<NEW_LINE>BLangUnionTypeNode bLangUnionTypeNode = (BLangUnionTypeNode) TreeBuilder.createUnionTypeNode();<NEW_LINE>bLangUnionTypeNode.pos = bLangTypeDefinition.pos;<NEW_LINE>for (Node member : enumDeclarationNode.enumMemberList()) {<NEW_LINE>Node enumMemberIdentifier = ((EnumMemberNode) member).identifier();<NEW_LINE>if (enumMemberIdentifier.isMissing()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>bLangUnionTypeNode.memberTypeNodes.add(createTypeNode(enumMemberIdentifier));<NEW_LINE>}<NEW_LINE>Collections.reverse(bLangUnionTypeNode.memberTypeNodes);<NEW_LINE>bLangTypeDefinition.setTypeNode(bLangUnionTypeNode);<NEW_LINE>bLangTypeDefinition.annAttachments = applyAll(getAnnotations<MASK><NEW_LINE>bLangTypeDefinition.markdownDocumentationAttachment = createMarkdownDocumentationAttachment(getDocumentationString(enumDeclarationNode.metadata()));<NEW_LINE>return bLangTypeDefinition;<NEW_LINE>}
(enumDeclarationNode.metadata()));
6,462
private void deleteAllDiskCacheFiles() {<NEW_LINE>final String methodName = "deleteAllDiskCacheFiles()";<NEW_LINE>final <MASK><NEW_LINE>final CacheOnDisk cod = this;<NEW_LINE>traceDebug(methodName, "cacheName=" + this.cacheName);<NEW_LINE>AccessController.doPrivileged(new PrivilegedAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object run() {<NEW_LINE>// delete files<NEW_LINE>File[] fd = f.listFiles();<NEW_LINE>for (int i = 0; i < fd.length; i++) {<NEW_LINE>if (fd[i].isDirectory()) {<NEW_LINE>File[] fl = fd[i].listFiles();<NEW_LINE>for (int j = 0; j < fl.length; j++) {<NEW_LINE>try {<NEW_LINE>fl[j].delete();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(t, "com.ibm.ws.cache.CacheOnDisk.deleteAllDiskCacheFiles", "938", cod);<NEW_LINE>traceDebug(methodName, "cacheName=" + cod.cacheName + "\nException: " + ExceptionUtility.getStackTrace(t));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
File f = new File(swapRootDirPath);
810,183
public void show() {<NEW_LINE>JComponent panel = createCenterPanel();<NEW_LINE>MnemonicHelper.init(panel);<NEW_LINE>myTree.addTreeSelectionListener(__ -> {<NEW_LINE>if (myPopup.isVisible()) {<NEW_LINE>PopupUpdateProcessor updateProcessor = myPopup.getUserData(PopupUpdateProcessor.class);<NEW_LINE>if (updateProcessor != null) {<NEW_LINE>AbstractTreeNode node = getSelectedNode();<NEW_LINE>updateProcessor.updatePopup(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myPopup = // .setCancelOnClickOutside(false) //for debug and snapshots<NEW_LINE>JBPopupFactory.getInstance().createComponentPopupBuilder(panel, myTree).setTitle(myTitle).setResizable(true).setModalContext(false).setFocusable(true).setRequestFocus(true).setMovable(true).setBelongsToGlobalPopupStack(true).setCancelOnOtherWindowOpen(true).setCancelKeyEnabled(false).setDimensionServiceKey(null, getDimensionServiceKey(), true).setCancelCallback(() -> myCanClose).setNormalWindowLevel(true).createPopup();<NEW_LINE>Disposer.register(myPopup, this);<NEW_LINE>Disposer.register(myPopup, () -> {<NEW_LINE>if (!myTreeHasBuilt.isDone()) {<NEW_LINE>myTreeHasBuilt.setRejected();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myTree.getEmptyText().setText("Loading...");<NEW_LINE>myPopup.showCenteredInCurrentWindow(myProject);<NEW_LINE>((AbstractPopup<MASK><NEW_LINE>IdeFocusManager.getInstance(myProject).requestFocus(myTree, true);<NEW_LINE>rebuildAndSelect(false, myInitialElement).onProcessed(path -> UIUtil.invokeLaterIfNeeded(() -> {<NEW_LINE>TreeUtil.ensureSelection(myTree);<NEW_LINE>myTreeHasBuilt.setDone();<NEW_LINE>installUpdater();<NEW_LINE>}));<NEW_LINE>}
) myPopup).setShowHints(true);
1,397,061
private Object newInstance(Class<?> clazz) throws Exception {<NEW_LINE>// based on which properties are set, decide which method to use to create a ClientBuilder<NEW_LINE>// as there is no public default constructor, you must decide up front whether to create a ClientBuilder<NEW_LINE>// based on a url or account. If both are specified, account will take precedence<NEW_LINE>Object clientBuilder = null;<NEW_LINE>String account = (<MASK><NEW_LINE>if (account != null && account.length() > 0) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "creating Cloudant client based on account:" + account);<NEW_LINE>}<NEW_LINE>Method m = clazz.getMethod(ACCOUNT, String.class);<NEW_LINE>clientBuilder = m.invoke(null, account);<NEW_LINE>} else {<NEW_LINE>String url = (String) props.get(URL);<NEW_LINE>if (url != null && url.length() > 0) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "creating Cloudant ClientBuilder based on url:" + url);<NEW_LINE>}<NEW_LINE>Method m = clazz.getMethod(URL, URL.class);<NEW_LINE>clientBuilder = m.invoke(null, AccessController.doPrivileged(new ConstructURLAction(url)));<NEW_LINE>} else<NEW_LINE>// one of either an account or url must be specified<NEW_LINE>throw new IllegalArgumentException(Tr.formatMessage(tc, "error.cloudant.config.CWWKD0300E", new Object[] { cloudantConfigIdentifier }));<NEW_LINE>}<NEW_LINE>return clientBuilder;<NEW_LINE>}
String) props.get(ACCOUNT);
1,563,290
private String calcActionQualifiedPath(String id) {<NEW_LINE>for (Object child : myChildren) {<NEW_LINE>if (child instanceof QuickList) {<NEW_LINE>child = ((QuickList) child).getActionId();<NEW_LINE>}<NEW_LINE>if (child instanceof String) {<NEW_LINE>if (id.equals(child)) {<NEW_LINE>AnAction action = ActionManager.getInstance().getActionOrStub(id);<NEW_LINE>String path;<NEW_LINE>if (action != null) {<NEW_LINE>path = action.getTemplatePresentation().getText();<NEW_LINE>} else {<NEW_LINE>path = id;<NEW_LINE>}<NEW_LINE>return !isRoot() ? getName() + " | " + path : path;<NEW_LINE>}<NEW_LINE>} else if (child instanceof Group) {<NEW_LINE>String path = ((Group) child).calcActionQualifiedPath(id);<NEW_LINE>if (path != null) {<NEW_LINE>return !isRoot() ? getName<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
() + " | " + path : path;
441,576
protected synchronized void startCertificateChecker(ScheduledExecutorService service) {<NEW_LINE>cancel(true);<NEW_LINE>if (acmeProviderImpl.getAcmeConfig() == null) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (acmeProviderImpl.getAcmeConfig().getCertCheckerScheduler() == 0 || (!acmeProviderImpl.getAcmeConfig().isAutoRenewOnExpiration() && !acmeProviderImpl.getAcmeConfig().isRevocationCheckerEnabled())) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "ScheduledExecutorService not started for AcmeCertChecker, it is disabled-- getCertCheckerScheduler: " + acmeProviderImpl.getAcmeConfig().getCertCheckerScheduler() + ", isAutoRenewOnExpiration: " + acmeProviderImpl.getAcmeConfig().isAutoRenewOnExpiration() + ", isRevocationCheckerEnabled: " + acmeProviderImpl.getAcmeConfig().isRevocationCheckerEnabled());<NEW_LINE>}<NEW_LINE>Tr.info(tc, "CWPKI2069I");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (service == null) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Provided ScheduledExecutorService is null, cannot start certificate checker");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.service = service;<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "ScheduledExecutorService starting, time: " + acmeProviderImpl.getAcmeConfig().getCertCheckerScheduler());<NEW_LINE>}<NEW_LINE>startRegularSchedule();<NEW_LINE>}
Tr.debug(tc, "Provided acmeProviderImpl.getAcmeConfig() is null, cannot start certificate checker");
330,801
public static ModifyVServerGroupBackendServersResponse unmarshall(ModifyVServerGroupBackendServersResponse modifyVServerGroupBackendServersResponse, UnmarshallerContext _ctx) {<NEW_LINE>modifyVServerGroupBackendServersResponse.setRequestId(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.RequestId"));<NEW_LINE>modifyVServerGroupBackendServersResponse.setVServerGroupId<MASK><NEW_LINE>List<BackendServer> backendServers = new ArrayList<BackendServer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ModifyVServerGroupBackendServersResponse.BackendServers.Length"); i++) {<NEW_LINE>BackendServer backendServer = new BackendServer();<NEW_LINE>backendServer.setVpcId(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].VpcId"));<NEW_LINE>backendServer.setType(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].Type"));<NEW_LINE>backendServer.setWeight(_ctx.integerValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].Weight"));<NEW_LINE>backendServer.setDescription(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].Description"));<NEW_LINE>backendServer.setServerRegionId(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerRegionId"));<NEW_LINE>backendServer.setServerIp(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerIp"));<NEW_LINE>backendServer.setPort(_ctx.integerValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].Port"));<NEW_LINE>backendServer.setVbrId(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].VbrId"));<NEW_LINE>backendServer.setServerId(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.BackendServers[" + i + "].ServerId"));<NEW_LINE>backendServers.add(backendServer);<NEW_LINE>}<NEW_LINE>modifyVServerGroupBackendServersResponse.setBackendServers(backendServers);<NEW_LINE>return modifyVServerGroupBackendServersResponse;<NEW_LINE>}
(_ctx.stringValue("ModifyVServerGroupBackendServersResponse.VServerGroupId"));
491,198
public List<CodeEntity> createAttributes(List<PersistableProductAttribute> attributes, Long productId, MerchantStore store) {<NEW_LINE>Validate.notNull(productId, "Product id must not be null");<NEW_LINE>Validate.notNull(store, "Merchant cannot be null");<NEW_LINE>// convert to model<NEW_LINE>List<ProductAttribute> modelAttributes = attributes.stream().map(attr -> persistableProductAttributeMapper.convert(attr, store, null)).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>productAttributeService.saveAll(modelAttributes);<NEW_LINE>// save to a product<NEW_LINE>Product product = this.product(productId, store);<NEW_LINE>product.<MASK><NEW_LINE>productService.save(product);<NEW_LINE>} catch (ServiceException e) {<NEW_LINE>throw new ServiceRuntimeException("Exception while saving product with attributes", e);<NEW_LINE>}<NEW_LINE>return modelAttributes.stream().map(e -> codeEntity(e)).collect(Collectors.toList());<NEW_LINE>}
getAttributes().addAll(modelAttributes);
1,721,837
private <T> void processStatementObject(ParserState<T> parserState, String predicateAttributeName, RDFNode statementObject) {<NEW_LINE>logger.trace("Entering processStatementObject with state: {}, for attribute {}", parserState, predicateAttributeName);<NEW_LINE>// Push attribute element<NEW_LINE>parserState.enteringNewElement(FHIR_NS, predicateAttributeName);<NEW_LINE>if (statementObject != null) {<NEW_LINE>if (statementObject.isLiteral()) {<NEW_LINE>// If the object is a literal, apply the value directly<NEW_LINE>parserState.attributeValue(VALUE, statementObject.asLiteral().getLexicalForm());<NEW_LINE>} else if (statementObject.isAnon()) {<NEW_LINE>// If the object is a blank node,<NEW_LINE>Resource resourceObject = statementObject.asResource();<NEW_LINE>boolean containedResource = false;<NEW_LINE>if (predicateAttributeName.equals(CONTAINED)) {<NEW_LINE>containedResource = true;<NEW_LINE>parserState.enteringNewElement(FHIR_NS, resourceObject.getProperty(resourceObject.getModel().createProperty(RDF.type.getURI())).getObject().toString()<MASK><NEW_LINE>}<NEW_LINE>List<Statement> objectStatements = resourceObject.listProperties().toList();<NEW_LINE>objectStatements.sort(new FhirIndexStatementComparator());<NEW_LINE>for (Statement objectProperty : objectStatements) {<NEW_LINE>if (objectProperty.getPredicate().hasURI(FHIR_NS + VALUE)) {<NEW_LINE>predicateAttributeName = VALUE;<NEW_LINE>parserState.attributeValue(predicateAttributeName, objectProperty.getObject().asLiteral().getLexicalForm());<NEW_LINE>} else {<NEW_LINE>// Otherwise, process it as a net-new node<NEW_LINE>predicateAttributeName = extractAttributeNameFromPredicate(objectProperty);<NEW_LINE>if (predicateAttributeName != null) {<NEW_LINE>if (predicateAttributeName.equals(EXTENSION)) {<NEW_LINE>processExtension(parserState, objectProperty.getObject(), false);<NEW_LINE>} else if (predicateAttributeName.equals(MODIFIER_EXTENSION)) {<NEW_LINE>processExtension(parserState, objectProperty.getObject(), true);<NEW_LINE>} else {<NEW_LINE>processStatementObject(parserState, predicateAttributeName, objectProperty.getObject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (containedResource) {<NEW_LINE>// Leave the contained resource element we created<NEW_LINE>parserState.endingElement();<NEW_LINE>}<NEW_LINE>} else if (statementObject.isResource()) {<NEW_LINE>Resource innerResource = statementObject.asResource();<NEW_LINE>Statement resourceTypeStatement = innerResource.getProperty(RDF.type);<NEW_LINE>String fhirTypeString = resourceTypeStatement.getObject().toString();<NEW_LINE>if (fhirTypeString.startsWith(FHIR_NS)) {<NEW_LINE>fhirTypeString = fhirTypeString.replace(FHIR_NS, "");<NEW_LINE>}<NEW_LINE>parseResource(parserState, fhirTypeString, innerResource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Pop attribute element<NEW_LINE>parserState.endingElement();<NEW_LINE>}
.replace(FHIR_NS, ""));
428,254
public static void openURL(String url) {<NEW_LINE>try {<NEW_LINE>// Since Java6 this is a much easier method to open the browser<NEW_LINE>if (Desktop.isDesktopSupported()) {<NEW_LINE>Desktop desktop = Desktop.getDesktop();<NEW_LINE>desktop.browse(new URI(url));<NEW_LINE>} else // Only if desktop is not supported we try the old main specific code<NEW_LINE>{<NEW_LINE>if (SystemInfo.OS == Os.MAC) {<NEW_LINE>Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");<NEW_LINE>Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });<NEW_LINE>openURL.invoke(null, new Object[] { url });<NEW_LINE>} else if (SystemInfo.OS == Os.WINDOWS) {<NEW_LINE>Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);<NEW_LINE>} else {<NEW_LINE>// assume Unix or Linux<NEW_LINE>String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };<NEW_LINE>String browser = null;<NEW_LINE>for (int count = 0; count < browsers.length && browser == null; count++) {<NEW_LINE>if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0) {<NEW_LINE>browser = browsers[count];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (browser == null) {<NEW_LINE>throw new Exception("Could not find web browser");<NEW_LINE>} else {<NEW_LINE>Runtime.getRuntime().exec(new String<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error at opening the URL.", e);<NEW_LINE>}<NEW_LINE>}
[] { browser, url });
370,863
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Widget widget = business.widget().pick(id);<NEW_LINE>if (null == widget) {<NEW_LINE>throw new ExceptionWidgetNotExist(id);<NEW_LINE>}<NEW_LINE>Portal portal = business.portal().pick(widget.getPortal());<NEW_LINE>if (null == portal) {<NEW_LINE>throw new ExceptionPortalNotExist(widget.getPortal());<NEW_LINE>}<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(<MASK><NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(widget);<NEW_LINE>wo.setData(widget.getDataOrMobileData());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
), portal.getId());
1,416,808
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>applyColorTheme();<NEW_LINE>setContentView(R.layout.activity_settings_filters);<NEW_LINE>setupAppBar(R.id.toolbar, R.string.settings_title_filter, true, true);<NEW_LINE>title = (EditText) findViewById(R.id.title);<NEW_LINE>text = (EditText) <MASK><NEW_LINE>domain = (EditText) findViewById(R.id.domain);<NEW_LINE>subreddit = (EditText) findViewById(R.id.subreddit);<NEW_LINE>flair = (EditText) findViewById(R.id.flair);<NEW_LINE>user = (EditText) findViewById(R.id.user);<NEW_LINE>title.setOnEditorActionListener(makeOnEditorActionListener(SettingValues.titleFilters::add));<NEW_LINE>text.setOnEditorActionListener(makeOnEditorActionListener(SettingValues.textFilters::add));<NEW_LINE>domain.setOnEditorActionListener(makeOnEditorActionListener(SettingValues.domainFilters::add));<NEW_LINE>subreddit.setOnEditorActionListener(makeOnEditorActionListener(SettingValues.subredditFilters::add));<NEW_LINE>user.setOnEditorActionListener(makeOnEditorActionListener(SettingValues.userFilters::add));<NEW_LINE>flair.setOnEditorActionListener((v, actionId, event) -> {<NEW_LINE>if (actionId == EditorInfo.IME_ACTION_DONE) {<NEW_LINE>String text = v.getText().toString().toLowerCase(Locale.ENGLISH).trim();<NEW_LINE>if (text.matches(".+:.+")) {<NEW_LINE>SettingValues.flairFilters.add(text);<NEW_LINE>v.setText("");<NEW_LINE>updateFilters();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>updateFilters();<NEW_LINE>}
findViewById(R.id.text);
1,796,967
void defaultLocation(List<Editor> editors) {<NEW_LINE>int defaultWidth = Toolkit.zoom<MASK><NEW_LINE>int defaultHeight = Toolkit.zoom(Preferences.getInteger("editor.window.height.default"));<NEW_LINE>defaultWidth = Math.min(defaultWidth, deviceBounds.width);<NEW_LINE>defaultHeight = Math.min(defaultHeight, deviceBounds.height);<NEW_LINE>// System.out.println("default w/h = " + defaultWidth + "/" + defaultHeight);<NEW_LINE>if (editors.size() == 0) {<NEW_LINE>// If no current active editor, use default placement.<NEW_LINE>// Center the window on ths screen, taking into account that the<NEW_LINE>// upper-left corner of the device may have a non (0, 0) origin.<NEW_LINE>int editorX = deviceBounds.x + (deviceBounds.width - defaultWidth) / 2;<NEW_LINE>int editorY = deviceBounds.y + (deviceBounds.height - defaultHeight) / 2;<NEW_LINE>editorBounds = new Rectangle(editorX, editorY, defaultWidth, defaultHeight);<NEW_LINE>dividerLocation = 0;<NEW_LINE>} else {<NEW_LINE>// With a currently active editor, open the new window using the same<NEW_LINE>// dimensions and divider location, but offset slightly.<NEW_LINE>synchronized (editors) {<NEW_LINE>Editor lastOpened = editors.get(editors.size() - 1);<NEW_LINE>isMaximized = (lastOpened.getExtendedState() == Frame.MAXIMIZED_BOTH);<NEW_LINE>editorBounds = lastOpened.getBounds();<NEW_LINE>editorBounds.x += WINDOW_OFFSET;<NEW_LINE>editorBounds.y += WINDOW_OFFSET;<NEW_LINE>dividerLocation = lastOpened.getDividerLocation();<NEW_LINE>if (!deviceBounds.contains(editorBounds)) {<NEW_LINE>// Warp the next window to a randomish location on screen.<NEW_LINE>editorBounds.x = deviceBounds.x + (int) (Math.random() * (deviceBounds.width - defaultWidth));<NEW_LINE>editorBounds.y = deviceBounds.y + (int) (Math.random() * (deviceBounds.height - defaultHeight));<NEW_LINE>}<NEW_LINE>if (isMaximized) {<NEW_LINE>editorBounds.width = defaultWidth;<NEW_LINE>editorBounds.height = defaultHeight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Preferences.getInteger("editor.window.width.default"));
915,758
public int checkRecord(int n) {<NEW_LINE>final int MOD = 1000000007;<NEW_LINE>int[][][] f = new int[n + 1][2][3];<NEW_LINE>f[0] = new int[][] { { 1, 1, 1 }, { 1, 1, 1 } };<NEW_LINE>for (int i = 1; i <= n; i++) {<NEW_LINE>for (int j = 0; j < 2; j++) {<NEW_LINE>for (int k = 0; k < 3; k++) {<NEW_LINE>// ...P<NEW_LINE>int val = f[i - <MASK><NEW_LINE>if (j > 0) {<NEW_LINE>// ...A<NEW_LINE>val = (val + f[i - 1][j - 1][2]) % MOD;<NEW_LINE>}<NEW_LINE>if (k > 0) {<NEW_LINE>// ...L<NEW_LINE>val = (val + f[i - 1][j][k - 1]) % MOD;<NEW_LINE>}<NEW_LINE>f[i][j][k] = val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return f[n][1][2];<NEW_LINE>}
1][j][2];
1,487,918
public void save(File file) throws IOException {<NEW_LINE>PrintStream out = new PrintStream(file, "UTF-8");<NEW_LINE>out.println("font.name=" + fontName);<NEW_LINE>out.println("font.size=" + fontSize);<NEW_LINE>out.println("font.bold=" + bold);<NEW_LINE>out.println("font.italic=" + italic);<NEW_LINE>out.println("font.gamma=" + gamma);<NEW_LINE>out.println("font.mono=" + mono);<NEW_LINE>out.println();<NEW_LINE>out.println("font2.file=" + font2File);<NEW_LINE>out.println("font2.use=" + font2Active);<NEW_LINE>out.println();<NEW_LINE><MASK><NEW_LINE>out.println("pad.right=" + paddingRight);<NEW_LINE>out.println("pad.bottom=" + paddingBottom);<NEW_LINE>out.println("pad.left=" + paddingLeft);<NEW_LINE>out.println("pad.advance.x=" + paddingAdvanceX);<NEW_LINE>out.println("pad.advance.y=" + paddingAdvanceY);<NEW_LINE>out.println();<NEW_LINE>out.println("glyph.native.rendering=" + nativeRendering);<NEW_LINE>out.println("glyph.page.width=" + glyphPageWidth);<NEW_LINE>out.println("glyph.page.height=" + glyphPageHeight);<NEW_LINE>out.println("glyph.text=" + glyphText);<NEW_LINE>out.println();<NEW_LINE>out.println(RENDER_TYPE + "=" + renderType);<NEW_LINE>out.println();<NEW_LINE>for (Iterator iter = effects.iterator(); iter.hasNext(); ) {<NEW_LINE>ConfigurableEffect effect = (ConfigurableEffect) iter.next();<NEW_LINE>out.println("effect.class=" + effect.getClass().getName());<NEW_LINE>for (Iterator iter2 = effect.getValues().iterator(); iter2.hasNext(); ) {<NEW_LINE>Value value = (Value) iter2.next();<NEW_LINE>out.println("effect." + value.getName() + "=" + value.getString());<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>}
out.println("pad.top=" + paddingTop);
1,683,628
private void processLastUpdatedTimeParams(String params) throws Exception {<NEW_LINE>DateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd");<NEW_LINE>if (params.contains(":")) {<NEW_LINE>String[] <MASK><NEW_LINE>this.startLastUpdatedTime = setDayStartForDate(dFormat.parse(parts[0]));<NEW_LINE>this.endLastUpdatedTime = setDayEndForDate(dFormat.parse(parts[1]));<NEW_LINE>} else if (params.contains("<")) {<NEW_LINE>this.lessThanLastUpdatedTime = params.substring(1, params.indexOf("d"));<NEW_LINE>} else if (params.contains(">")) {<NEW_LINE>this.greaterThanLastUpdatedTime = params.substring(1, params.indexOf("d"));<NEW_LINE>} else {<NEW_LINE>// This handles a single date<NEW_LINE>dFormat = new SimpleDateFormat("yyyy-MM-dd");<NEW_LINE>this.specificLastUpdatedTime = dFormat.parse(params);<NEW_LINE>}<NEW_LINE>}
parts = params.split(":");
1,209,581
public SequencedList<byte[]> read(long seqNum, int limit) throws IOException {<NEW_LINE>assert seqNum >= this.minSeqNum : String.format("seqNum=%d < minSeqNum=%d", seqNum, this.minSeqNum);<NEW_LINE>assert seqNum <= maxSeqNum() : String.format("seqNum=%d is > maxSeqNum=%d", seqNum, maxSeqNum());<NEW_LINE>List<byte[]> elements = new ArrayList<>();<NEW_LINE>final LongVector seqNums = new LongVector(limit);<NEW_LINE>int offset = this.offsetMap.get((int) (seqNum - this.minSeqNum));<NEW_LINE>buffer.position(offset);<NEW_LINE>for (int i = 0; i < limit; i++) {<NEW_LINE>long readSeqNum = buffer.getLong();<NEW_LINE>assert readSeqNum == (seqNum + i) : String.format(<MASK><NEW_LINE>int readLength = buffer.getInt();<NEW_LINE>byte[] readBytes = new byte[readLength];<NEW_LINE>buffer.get(readBytes);<NEW_LINE>int checksum = buffer.getInt();<NEW_LINE>int computedChecksum = checksum(readBytes);<NEW_LINE>if (computedChecksum != checksum) {<NEW_LINE>throw new IOException(String.format("computed checksum=%d != checksum for file=%d", computedChecksum, checksum));<NEW_LINE>}<NEW_LINE>elements.add(readBytes);<NEW_LINE>seqNums.add(readSeqNum);<NEW_LINE>if (seqNum + i >= maxSeqNum()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SequencedList<>(elements, seqNums);<NEW_LINE>}
"unmatched seqNum=%d to readSeqNum=%d", seqNum + i, readSeqNum);
16,345
public static KMeans fit(BBDTree bbd, double[][] data, int k, int maxIter, double tol) {<NEW_LINE>if (k < 2) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of clusters: " + k);<NEW_LINE>}<NEW_LINE>if (maxIter <= 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid maximum number of iterations: " + maxIter);<NEW_LINE>}<NEW_LINE>int n = data.length;<NEW_LINE>int d = data[0].length;<NEW_LINE>int[] y = new int[n];<NEW_LINE>double[][] medoids = new double[k][];<NEW_LINE>double distortion = MathEx.sum(seed(data, medoids, y, MathEx::squaredDistance));<NEW_LINE>logger.info(String.format("Distortion after initialization: %.4f", distortion));<NEW_LINE>// Initialize the centroids<NEW_LINE>int[] size = new int[k];<NEW_LINE>double[][] centroids = new double[k][d];<NEW_LINE>updateCentroids(centroids, data, y, size);<NEW_LINE>double[][] sum = new double[k][d];<NEW_LINE>double diff = Double.MAX_VALUE;<NEW_LINE>for (int iter = 1; iter <= maxIter && diff > tol; iter++) {<NEW_LINE>double wcss = bbd.clustering(centroids, sum, size, y);<NEW_LINE>logger.info(String.format("Distortion after %3d iterations: %.4f", iter, wcss));<NEW_LINE>diff = distortion - wcss;<NEW_LINE>distortion = wcss;<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
KMeans(distortion, centroids, y);
568,802
protected ErlangVisitor buildErlangVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {<NEW_LINE>return new ErlangVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitGlobalFunctionCallExpression(@NotNull ErlangGlobalFunctionCallExpression o) {<NEW_LINE>ErlangFunctionCallExpression expression = o.getFunctionCallExpression();<NEW_LINE>List<ErlangExpression> expressionList = expression.getArgumentList().getExpressionList();<NEW_LINE>int size = expressionList.size();<NEW_LINE>if (size < 2)<NEW_LINE>return;<NEW_LINE>ErlangModule module = ObjectUtils.tryCast(o.getModuleRef().getReference().<MASK><NEW_LINE>if (module == null || !MODULE_NAMES.contains(module.getName()))<NEW_LINE>return;<NEW_LINE>PsiReference ref = expression.getReference();<NEW_LINE>ErlangFunction function = ObjectUtils.tryCast(ref.resolve(), ErlangFunction.class);<NEW_LINE>if (function == null || !FUNCTION_NAMES.contains(function.getName()))<NEW_LINE>return;<NEW_LINE>List<ErlangExpression> reverse = ContainerUtil.reverse(expressionList);<NEW_LINE>ErlangListExpression args = ObjectUtils.tryCast(reverse.get(0), ErlangListExpression.class);<NEW_LINE>ErlangStringLiteral formatLiteral = ObjectUtils.tryCast(reverse.get(1), ErlangStringLiteral.class);<NEW_LINE>String formatString = formatLiteral != null ? formatLiteral.getString().getText() : null;<NEW_LINE>if (formatString == null || formatString.length() < 2)<NEW_LINE>return;<NEW_LINE>int expectedArgumentsCount;<NEW_LINE>try {<NEW_LINE>expectedArgumentsCount = getExpectedFormatArgsCount(formatString);<NEW_LINE>} catch (InvalidControlSequenceException e) {<NEW_LINE>registerProblem(holder, formatLiteral, "Invalid control sequence", TextRange.create(e.getInvalidSequenceStartIdx(), formatString.length() - 1), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int passedArgumentsCount = args != null ? args.getExpressionList().size() : -1;<NEW_LINE>if (passedArgumentsCount >= 0 && expectedArgumentsCount != passedArgumentsCount) {<NEW_LINE>String problemDescription = "Wrong number of arguments in format call, should be " + expectedArgumentsCount;<NEW_LINE>registerProblem(holder, formatLiteral, problemDescription);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
resolve(), ErlangModule.class);
1,816,149
Object convertRefs(long[] refs, int skipped) {<NEW_LINE>int nrefs = refs.length - skipped;<NEW_LINE>if (nrefs <= 0)<NEW_LINE>return refs;<NEW_LINE>int[] ri = noCompress() ? null : new int[nrefs];<NEW_LINE>long[] rl = noCompress() ? new long[nrefs] : null;<NEW_LINE>for (int i = 0; i < nrefs; ++i) {<NEW_LINE>long <MASK><NEW_LINE>if (ri != null) {<NEW_LINE>ri[i] = compressAddress(l);<NEW_LINE>if (expandAddress(ri[i]) != l) {<NEW_LINE>// Doesn't fit, use a long array<NEW_LINE>// If no offset, then use the original array<NEW_LINE>// if (skipped == 0) return refs;<NEW_LINE>rl = new long[ri.length];<NEW_LINE>for (int j = 0; j < i; ++j) {<NEW_LINE>rl[j] = expandAddress(ri[j]);<NEW_LINE>}<NEW_LINE>rl[i] = l;<NEW_LINE>ri = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rl[i] = l;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ri != null) {<NEW_LINE>return ri;<NEW_LINE>} else {<NEW_LINE>return rl;<NEW_LINE>}<NEW_LINE>}
l = refs[skipped + i];
751,262
public void addAcceptableReferenceProviders(@Nonnull PsiElement position, @Nonnull List<ProviderInfo<Provider, ProcessingContext>> list, @Nonnull PsiReferenceService.Hints hints) {<NEW_LINE>for (ProviderInfo<Provider, ElementPattern> trinity : myProviderPairs) {<NEW_LINE>if (hints != PsiReferenceService.Hints.NO_HINTS && !((PsiReferenceProvider) trinity.provider).acceptsHints(position, hints)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (hints != PsiReferenceService.Hints.NO_HINTS) {<NEW_LINE>context.put(PsiReferenceService.HINTS, hints);<NEW_LINE>}<NEW_LINE>boolean suitable = false;<NEW_LINE>try {<NEW_LINE>suitable = trinity.processingContext.accepts(position, context);<NEW_LINE>} catch (IndexNotReadyException ignored) {<NEW_LINE>}<NEW_LINE>if (suitable) {<NEW_LINE>list.add(new ProviderInfo<Provider, ProcessingContext>(trinity.provider, context, trinity.priority));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
final ProcessingContext context = new ProcessingContext();
560,653
public void run() {<NEW_LINE>try {<NEW_LINE>log.info("Running {}", getName());<NEW_LINE>// Create the update lambda.<NEW_LINE>Universe.UniverseUpdater updater = universe -> {<NEW_LINE>// If this universe is not being edited, fail the request.<NEW_LINE>UniverseDefinitionTaskParams universeDetails = universe.getUniverseDetails();<NEW_LINE>if (!universeDetails.updateInProgress) {<NEW_LINE>String errMsg = "UserUniverse " + taskParams().universeUUID + " is not being edited.";<NEW_LINE>log.error(errMsg);<NEW_LINE>throw new RuntimeException(errMsg);<NEW_LINE>}<NEW_LINE>UniverseDefinitionTaskParams.UserIntent userIntent = universeDetails.getPrimaryCluster().userIntent;<NEW_LINE>userIntent.enableNodeToNodeEncrypt = taskParams().enableNodeToNodeEncrypt;<NEW_LINE>userIntent.enableClientToNodeEncrypt = taskParams().enableClientToNodeEncrypt;<NEW_LINE>universeDetails.allowInsecure = taskParams().allowInsecure;<NEW_LINE>universeDetails.rootCA = null;<NEW_LINE>universeDetails.clientRootCA = null;<NEW_LINE>universeDetails.rootAndClientRootCASame = taskParams().rootAndClientRootCASame;<NEW_LINE>if (EncryptionInTransitUtil.isRootCARequired(taskParams())) {<NEW_LINE>universeDetails.rootCA = taskParams().rootCA;<NEW_LINE>}<NEW_LINE>if (EncryptionInTransitUtil.isClientRootCARequired(taskParams())) {<NEW_LINE>universeDetails<MASK><NEW_LINE>}<NEW_LINE>universe.setUniverseDetails(universeDetails);<NEW_LINE>};<NEW_LINE>// Perform the update. If unsuccessful, this will throw a runtime<NEW_LINE>// exception which we do not catch as we want to fail.<NEW_LINE>saveUniverseDetails(updater);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = getName() + " failed with exception " + e.getMessage();<NEW_LINE>log.warn(msg, e.getMessage());<NEW_LINE>throw new RuntimeException(msg, e);<NEW_LINE>}<NEW_LINE>}
.clientRootCA = taskParams().clientRootCA;
870,782
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {<NEW_LINE>TreeNodeLabelManager treeNodeLabelManager = contextManager.getTreeNodeLabelManager();<NEW_LINE>LogicalVertex inputVertex = getInputNode().getOutputVertex();<NEW_LINE>LogicalSubQueryPlan logicalQueryPlan = new LogicalSubQueryPlan(contextManager);<NEW_LINE>logicalQueryPlan.addLogicalVertex(inputVertex);<NEW_LINE>LogicalQueryPlan flatMapPlan = TreeNodeUtils.buildSubQueryPlan(flatMapNode, inputVertex, contextManager);<NEW_LINE>logicalQueryPlan.mergeLogicalQueryPlan(flatMapPlan);<NEW_LINE><MASK><NEW_LINE>LogicalVertex inputTargetVertex = flatMapPlan.getTargetVertex(inputVertex);<NEW_LINE>if (inputTargetVertex.getProcessorFunction().getOperatorType() == QueryFlowOuterClass.OperatorType.ENTER_KEY && !(flatOutputVertex instanceof LogicalBinaryVertex)) {<NEW_LINE>flatOutputVertex.getAfterRequirementList().add(QueryFlowOuterClass.RequirementValue.newBuilder().setReqType(QueryFlowOuterClass.RequirementType.KEY_DEL));<NEW_LINE>}<NEW_LINE>addUsedLabelAndRequirement(flatOutputVertex, treeNodeLabelManager);<NEW_LINE>setFinishVertex(flatOutputVertex, treeNodeLabelManager);<NEW_LINE>return logicalQueryPlan;<NEW_LINE>}
LogicalVertex flatOutputVertex = logicalQueryPlan.getOutputVertex();
1,103,427
public static <T, U> PollerFlux<PollResult<T>, U> create(SerializerAdapter serializerAdapter, HttpPipeline pipeline, Type pollResultType, Type finalResultType, Duration defaultPollInterval, Function<PollingContext<PollResult<T>>, Mono<PollResult<T>>> lroInitOperation, Context context) {<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(pipeline, "'pipeline' cannot be null.");<NEW_LINE>Objects.requireNonNull(pollResultType, "'pollResultType' cannot be null.");<NEW_LINE>Objects.requireNonNull(finalResultType, "'finalResultType' cannot be null.");<NEW_LINE>Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");<NEW_LINE>Objects.requireNonNull(lroInitOperation, "'lroInitOperation' cannot be null.");<NEW_LINE>Objects.requireNonNull(context, "'context' cannot be null.");<NEW_LINE>return new PollerFlux<>(defaultPollInterval, lroInitOperation, PollOperation.pollFunction(serializerAdapter, pipeline, pollResultType, context), PollOperation.cancelFunction(context), PollOperation.fetchResultFunction(serializerAdapter, pipeline, finalResultType, context));<NEW_LINE>}
Objects.requireNonNull(serializerAdapter, "'serializerAdapter' cannot be null.");
378,984
public final ClassNameOrInterfaceContext classNameOrInterface() throws RecognitionException {<NEW_LINE>ClassNameOrInterfaceContext _localctx = new ClassNameOrInterfaceContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(136);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = 1;<NEW_LINE>do {<NEW_LINE>switch(_alt) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(135);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << DOT) | (1L << WILDCARD) | (1L << DOTDOT) | (1L << Identifier))) != 0))) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(138);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 18, _ctx);<NEW_LINE>} while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER);<NEW_LINE>setState(144);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 19, _ctx);<NEW_LINE>while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(140);<NEW_LINE>match(LBRACK);<NEW_LINE>setState(141);<NEW_LINE>match(RBRACK);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(146);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 19, _ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 16, RULE_classNameOrInterface);
229,052
private ClickHouseHttpResponse buildResponse(HttpResponse<InputStream> r) throws IOException {<NEW_LINE>HttpHeaders headers = r.headers();<NEW_LINE>String displayName = headers.firstValue("X-ClickHouse-Server-Display-Name").<MASK><NEW_LINE>String queryId = headers.firstValue("X-ClickHouse-Query-Id").orElse("");<NEW_LINE>String summary = headers.firstValue("X-ClickHouse-Summary").orElse("{}");<NEW_LINE>ClickHouseFormat format = config.getFormat();<NEW_LINE>TimeZone timeZone = config.getServerTimeZone();<NEW_LINE>// queryId, format and timeZone are only available for queries<NEW_LINE>if (!ClickHouseChecker.isNullOrEmpty(queryId)) {<NEW_LINE>String value = headers.firstValue("X-ClickHouse-Format").orElse("");<NEW_LINE>format = !ClickHouseChecker.isNullOrEmpty(value) ? ClickHouseFormat.valueOf(value) : format;<NEW_LINE>value = headers.firstValue("X-ClickHouse-Timezone").orElse("");<NEW_LINE>timeZone = !ClickHouseChecker.isNullOrEmpty(value) ? TimeZone.getTimeZone(value) : timeZone;<NEW_LINE>}<NEW_LINE>return new ClickHouseHttpResponse(this, getResponseInputStream(checkResponse(r).body()), displayName, queryId, summary, format, timeZone);<NEW_LINE>}
orElse(server.getHost());
1,516,428
private static TypeBinding toRawType(TypeBinding tb) {<NEW_LINE>if (// tb instanceof WildcardBinding ||<NEW_LINE>tb instanceof RawTypeBinding || tb instanceof BaseTypeBinding || // tb instanceof TypeVariableBinding ||<NEW_LINE>tb instanceof ProblemReferenceBinding) {<NEW_LINE>return tb;<NEW_LINE>} else if (tb instanceof ParameterizedTypeBinding) {<NEW_LINE>LookupEnvironment environment = ((<MASK><NEW_LINE>return environment.convertToRawType(((ParameterizedTypeBinding) tb).genericType(), false);<NEW_LINE>} else if (tb instanceof ArrayBinding) {<NEW_LINE>LookupEnvironment environment = ((ArrayBinding) tb).environment();<NEW_LINE>// handles generics and dimensions<NEW_LINE>return environment.convertToRawType(tb, false);<NEW_LINE>} else if (tb instanceof BinaryTypeBinding || tb instanceof SourceTypeBinding) {<NEW_LINE>if (tb.isGenericType()) {<NEW_LINE>Class<?> cl = tb instanceof BinaryTypeBinding ? BinaryTypeBinding.class : SourceTypeBinding.class;<NEW_LINE>LookupEnvironment environment = ReflectionUtils.getPrivateField(cl, "environment", tb);<NEW_LINE>return environment.convertToRawType(tb, false);<NEW_LINE>} else {<NEW_LINE>return tb;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("nyi " + tb.getClass());<NEW_LINE>}
ParameterizedTypeBinding) tb).environment();
829,483
public void enqueueInstallation() {<NEW_LINE>if (mResolutionResults == null)<NEW_LINE>return;<NEW_LINE>if (mResolutionResults.size() == 1) {<NEW_LINE>enqueueSingleFiltered(mResolutionResults.get(0));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (UriMessResolutionResult resolutionResult : mResolutionResults) {<NEW_LINE>if (!resolutionResult.isSuccessful() && !resolutionResult.error().doesTryingToInstallNonethelessMakeSense())<NEW_LINE>continue;<NEW_LINE>ApkSourceBuilder apkSourceBuilder = null;<NEW_LINE>if (resolutionResult.sourceType().equals(SourceType.ZIP)) {<NEW_LINE>apkSourceBuilder = new ApkSourceBuilder(mContext).fromZipContentUri(resolutionResult.uris<MASK><NEW_LINE>} else if (resolutionResult.sourceType().equals(SourceType.APK_FILES)) {<NEW_LINE>apkSourceBuilder = new ApkSourceBuilder(mContext).fromApkContentUris(resolutionResult.uris());<NEW_LINE>}<NEW_LINE>if (apkSourceBuilder != null) {<NEW_LINE>apkSourceBuilder.setZipExtractionEnabled(mPrefsHelper.shouldExtractArchives()).setReadZipViaZipFileEnabled(mPrefsHelper.shouldUseZipFileApi()).setSigningEnabled(mPrefsHelper.shouldSignApks());<NEW_LINE>install(apkSourceBuilder.build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().get(0));
714,770
protected void initChannel(SocketChannel ch) throws Exception {<NEW_LINE>if (serverSslCtxRefresher != null && this.enableTls) {<NEW_LINE>SslContext sslContext = serverSslCtxRefresher.get();<NEW_LINE>if (sslContext != null) {<NEW_LINE>ch.pipeline().addLast(TLS_HANDLER, sslContext.newHandler(ch.alloc()));<NEW_LINE>}<NEW_LINE>} else if (this.tlsEnabledWithKeyStore && serverSSLContextAutoRefreshBuilder != null) {<NEW_LINE>ch.pipeline().addLast(TLS_HANDLER, new SslHandler(serverSSLContextAutoRefreshBuilder.get().createSSLEngine()));<NEW_LINE>}<NEW_LINE>if (brokerProxyReadTimeoutMs > 0) {<NEW_LINE>ch.pipeline().addLast("readTimeoutHandler", new ReadTimeoutHandler(brokerProxyReadTimeoutMs, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (proxyService.getConfiguration().isHaProxyProtocolEnabled()) {<NEW_LINE>ch.pipeline().addLast(OptionalProxyProtocolDecoder.NAME, new OptionalProxyProtocolDecoder());<NEW_LINE>}<NEW_LINE>ch.pipeline().addLast("frameDecoder", new LengthFieldBasedFrameDecoder(Commands.DEFAULT_MAX_MESSAGE_SIZE + Commands.MESSAGE_SIZE_FRAME_PADDING, 0, 4, 0, 4));<NEW_LINE>Supplier<SslHandler> sslHandlerSupplier = null;<NEW_LINE>if (clientSslCtxRefresher != null) {<NEW_LINE>sslHandlerSupplier = new Supplier<SslHandler>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SslHandler get() {<NEW_LINE>return clientSslCtxRefresher.get().newHandler(ch.alloc());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (clientSSLContextAutoRefreshBuilder != null) {<NEW_LINE>sslHandlerSupplier = new Supplier<SslHandler>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SslHandler get() {<NEW_LINE>return new SslHandler(clientSSLContextAutoRefreshBuilder.get().createSSLEngine());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>ch.pipeline().addLast("handler", <MASK><NEW_LINE>}
new ProxyConnection(proxyService, sslHandlerSupplier));
24,267
public ThreeState deepEqual(@Nonnull final ASTNode oldNode, @Nonnull final LighterASTNode newNode) {<NEW_LINE>ProgressIndicatorProvider.checkCanceled();<NEW_LINE>boolean oldIsErrorElement = oldNode instanceof PsiErrorElement;<NEW_LINE>boolean newIsErrorElement = newNode.getTokenType() == TokenType.ERROR_ELEMENT;<NEW_LINE>if (oldIsErrorElement != newIsErrorElement)<NEW_LINE>return ThreeState.NO;<NEW_LINE>if (oldIsErrorElement) {<NEW_LINE>final PsiErrorElement e1 = (PsiErrorElement) oldNode;<NEW_LINE>return Objects.equals(e1.getErrorDescriptionValue(), getErrorMessage(newNode)) ? ThreeState.UNSURE : ThreeState.NO;<NEW_LINE>}<NEW_LINE>if (custom != null) {<NEW_LINE>ThreeState customResult = custom.fun(oldNode, newNode, myTreeStructure);<NEW_LINE>if (customResult != ThreeState.UNSURE) {<NEW_LINE>return customResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newNode instanceof Token) {<NEW_LINE>final IElementType type = newNode.getTokenType();<NEW_LINE>final Token token = (Token) newNode;<NEW_LINE>if (oldNode instanceof ForeignLeafPsiElement) {<NEW_LINE>return type instanceof ForeignLeafType && StringUtil.equals(((ForeignLeafType) type).getValue(), oldNode.getText()) <MASK><NEW_LINE>}<NEW_LINE>if (oldNode instanceof LeafElement) {<NEW_LINE>if (type instanceof ForeignLeafType)<NEW_LINE>return ThreeState.NO;<NEW_LINE>return ((LeafElement) oldNode).textMatches(token.getText()) ? ThreeState.YES : ThreeState.NO;<NEW_LINE>}<NEW_LINE>if (type instanceof ILightLazyParseableElementType) {<NEW_LINE>return // do not dive into collapsed nodes<NEW_LINE>((TreeElement) oldNode).textMatches(token.getText()) ? // do not dive into collapsed nodes<NEW_LINE>ThreeState.YES : // do not dive into collapsed nodes<NEW_LINE>TreeUtil.isCollapsedChameleon(oldNode) ? ThreeState.NO : ThreeState.UNSURE;<NEW_LINE>}<NEW_LINE>if (oldNode.getElementType() instanceof ILazyParseableElementType && type instanceof ILazyParseableElementType || oldNode.getElementType() instanceof ICustomParsingType && type instanceof ICustomParsingType) {<NEW_LINE>return ((TreeElement) oldNode).textMatches(token.getText()) ? ThreeState.YES : ThreeState.NO;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ThreeState.UNSURE;<NEW_LINE>}
? ThreeState.YES : ThreeState.NO;
1,002,179
public void loadScriptFromFile(String fileName, String sourceURL, boolean loadSynchronously) {<NEW_LINE>mSourceURL = sourceURL;<NEW_LINE>try {<NEW_LINE>final String contents = (String) Class.forName("host.exp.exponent.ReactNativeStaticHelpers").getMethod("getBundleSourceForPath", String.class<MASK><NEW_LINE>if (contents == null) {<NEW_LINE>Log.d("CatalystInstanceImpl", "Loading script from file");<NEW_LINE>jniLoadScriptFromFile(fileName, sourceURL, loadSynchronously);<NEW_LINE>} else {<NEW_LINE>Log.d("CatalystInstanceImpl", "Loading script from string. Length: " + contents.length());<NEW_LINE>jniLoadScriptFromString(contents, sourceURL, loadSynchronously);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.d("CatalystInstanceImpl", "Loading script from file");<NEW_LINE>jniLoadScriptFromFile(fileName, sourceURL, loadSynchronously);<NEW_LINE>}<NEW_LINE>}
).invoke(null, fileName);
779,261
public void writeMethodAnnotations(TWSDLOperation two, JMethod jMethod) {<NEW_LINE>JAnnotationUse actionAnn = null;<NEW_LINE>if (!(two instanceof Operation))<NEW_LINE>return;<NEW_LINE>Operation o = ((Operation) two);<NEW_LINE>// explicit input action<NEW_LINE>if (o.getInput().getAction() != null && !o.getInput().getAction().equals("")) {<NEW_LINE>// explicitly specified<NEW_LINE>actionAnn = jMethod.annotate(Action.class);<NEW_LINE>actionAnn.param("input", o.getInput().getAction());<NEW_LINE>}<NEW_LINE>// explicit output action<NEW_LINE>if (o.getOutput() != null && o.getOutput().getAction() != null && !o.getOutput().getAction().equals("")) {<NEW_LINE>// explicitly specified<NEW_LINE>if (actionAnn == null)<NEW_LINE>actionAnn = jMethod.annotate(Action.class);<NEW_LINE>actionAnn.param("output", o.getOutput().getAction());<NEW_LINE>}<NEW_LINE>// explicit fault action<NEW_LINE>if (o.getFaults() != null && o.getFaults().size() > 0) {<NEW_LINE>Map<String, JClass> map = o.getFaults();<NEW_LINE>JAnnotationArrayMember jam = null;<NEW_LINE>for (Fault f : o.faults()) {<NEW_LINE>if (f.getAction() == null)<NEW_LINE>continue;<NEW_LINE>if (f.getAction().equals(""))<NEW_LINE>continue;<NEW_LINE>if (actionAnn == null) {<NEW_LINE>actionAnn = jMethod.annotate(Action.class);<NEW_LINE>}<NEW_LINE>if (jam == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final JAnnotationUse faAnn = jam.annotate(FaultAction.class);<NEW_LINE>faAnn.param("className", map.get(f.getName()));<NEW_LINE>faAnn.param("value", f.getAction());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jam = actionAnn.paramArray("fault");
1,634,354
public PhysicalPlan generatePhysicalPlan(PhysicalGenerator generator) throws QueryProcessException {<NEW_LINE>int measurementsNum = measurementList.length;<NEW_LINE>if (times.length == 1) {<NEW_LINE>if (measurementsNum != valueLists.get(0).length) {<NEW_LINE>throw new SQLParserException(String.format("the measurementList's size %d is not consistent with the valueList's size %d", measurementsNum, valueLists.<MASK><NEW_LINE>}<NEW_LINE>InsertRowPlan insertRowPlan = new InsertRowPlan(device, times[0], measurementList, valueLists.get(0));<NEW_LINE>insertRowPlan.setAligned(isAligned);<NEW_LINE>return insertRowPlan;<NEW_LINE>}<NEW_LINE>InsertRowsPlan insertRowsPlan = new InsertRowsPlan();<NEW_LINE>for (int i = 0; i < times.length; i++) {<NEW_LINE>if (measurementsNum != valueLists.get(i).length) {<NEW_LINE>throw new SQLParserException(String.format("the measurementList's size %d is not consistent with the valueList's size %d", measurementsNum, valueLists.get(i).length));<NEW_LINE>}<NEW_LINE>InsertRowPlan insertRowPlan = new InsertRowPlan(device, times[i], measurementList.clone(), valueLists.get(i));<NEW_LINE>insertRowPlan.setAligned(isAligned);<NEW_LINE>insertRowsPlan.addOneInsertRowPlan(insertRowPlan, i);<NEW_LINE>}<NEW_LINE>return insertRowsPlan;<NEW_LINE>}
get(0).length));
762,419
public void marshall(WriteCampaignRequest writeCampaignRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (writeCampaignRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getAdditionalTreatments(), ADDITIONALTREATMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getCustomDeliveryConfiguration(), CUSTOMDELIVERYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getHoldoutPercent(), HOLDOUTPERCENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getHook(), HOOK_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getIsPaused(), ISPAUSED_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getMessageConfiguration(), MESSAGECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSchedule(), SCHEDULE_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSegmentId(), SEGMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getSegmentVersion(), SEGMENTVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTemplateConfiguration(), TEMPLATECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTreatmentDescription(), TREATMENTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getTreatmentName(), TREATMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(writeCampaignRequest.getPriority(), PRIORITY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
writeCampaignRequest.getLimits(), LIMITS_BINDING);
738,731
public static Constructor<?> findResourceConstructor(Class<?> resourceClass, boolean perRequest) {<NEW_LINE>List<Constructor<?>> cs = new LinkedList<Constructor<?>>();<NEW_LINE>for (Constructor<?> c : resourceClass.getConstructors()) {<NEW_LINE>// Liberty change start<NEW_LINE>Annotation[<MASK><NEW_LINE>boolean hasInject = hasInjectAnnotation(anna);<NEW_LINE>// Liberty change end<NEW_LINE>Class<?>[] params = c.getParameterTypes();<NEW_LINE>Annotation[][] anns = c.getParameterAnnotations();<NEW_LINE>boolean match = true;<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>if (!perRequest) {<NEW_LINE>// annotation is not null and not equals context<NEW_LINE>if (AnnotationUtils.getAnnotation(anns[i], Context.class) == null && !isInjectionPara(hasInject, anns[i])) {<NEW_LINE>// Liberty change<NEW_LINE>match = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if ((!AnnotationUtils.isValidParamAnnotations(anns[i])) && !isInjectionPara(hasInject, anns[i])) {<NEW_LINE>// Liberty change<NEW_LINE>match = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match) {<NEW_LINE>cs.add(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(cs, new Comparator<Constructor<?>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Constructor<?> c1, Constructor<?> c2) {<NEW_LINE>int p1 = c1.getParameterTypes().length;<NEW_LINE>int p2 = c2.getParameterTypes().length;<NEW_LINE>return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return cs.size() == 0 ? null : cs.get(0);<NEW_LINE>}
] anna = c.getDeclaredAnnotations();
1,042,575
protected void process(String maxMac, ArrayList<String> values) {<NEW_LINE>// # Timestamp, X, Y, HEADING, MAC Address of AP, RSS, FLOOR<NEW_LINE>if (maxMac.equals(args.firstMac.getBssid()) || (args.secondMac != null && maxMac.equals(args.secondMac.getBssid()))) {<NEW_LINE>String[] segs = values.get(0).split(" ");<NEW_LINE>double x = Double.parseDouble(segs[1]);<NEW_LINE>double y = Double<MASK><NEW_LINE>if (bbox == null || (x > bbox[0].dlat && x < bbox[1].dlat && y > bbox[0].dlon && y < bbox[1].dlon)) {<NEW_LINE>double similarity = compare(values);<NEW_LINE>checkScore(similarity, segs[6]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.parseDouble(segs[2]);
615,325
public void render(ShaderProgram shader, int primitiveType, int offset, int count, boolean autoBind) {<NEW_LINE>if (count == 0)<NEW_LINE>return;<NEW_LINE>if (autoBind)<NEW_LINE>bind(shader);<NEW_LINE>if (isVertexArray) {<NEW_LINE>if (indices.getNumIndices() > 0) {<NEW_LINE>ShortBuffer buffer = indices.getBuffer();<NEW_LINE>int oldPosition = buffer.position();<NEW_LINE>int oldLimit = buffer.limit();<NEW_LINE>((Buffer) buffer).position(offset);<NEW_LINE>Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, buffer);<NEW_LINE>((Buffer) buffer).position(oldPosition);<NEW_LINE>} else {<NEW_LINE>Gdx.gl20.glDrawArrays(primitiveType, offset, count);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int numInstances = 0;<NEW_LINE>if (isInstanced)<NEW_LINE>numInstances = instances.getNumInstances();<NEW_LINE>if (indices.getNumIndices() > 0) {<NEW_LINE>if (count + offset > indices.getNumMaxIndices()) {<NEW_LINE>throw new GdxRuntimeException("Mesh attempting to access memory outside of the index buffer (count: " + count + ", offset: " + offset + ", max: " + indices.getNumMaxIndices() + ")");<NEW_LINE>}<NEW_LINE>if (isInstanced && numInstances > 0) {<NEW_LINE>Gdx.gl30.glDrawElementsInstanced(primitiveType, count, GL20.<MASK><NEW_LINE>} else {<NEW_LINE>Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, offset * 2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isInstanced && numInstances > 0) {<NEW_LINE>Gdx.gl30.glDrawArraysInstanced(primitiveType, offset, count, numInstances);<NEW_LINE>} else {<NEW_LINE>Gdx.gl20.glDrawArrays(primitiveType, offset, count);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (autoBind)<NEW_LINE>unbind(shader);<NEW_LINE>}
GL_UNSIGNED_SHORT, offset * 2, numInstances);
1,063,505
int processBroker(Map<Integer, Map<String, DescribeLogDirsResponse.LogDirInfo>> logDirectoriesResponseMap, Node broker, String topic) {<NEW_LINE>int totalPartitionsInBroker = 0;<NEW_LINE>LOGGER.trace("logDirectoriesResponseMap: {}", logDirectoriesResponseMap);<NEW_LINE>Map<String, DescribeLogDirsResponse.LogDirInfo> logDirInfoMap = logDirectoriesResponseMap.get(broker.id());<NEW_LINE>String logDirectoriesKey = logDirInfoMap.keySet()<MASK><NEW_LINE>LOGGER.trace("logDirInfoMap: {}", logDirInfoMap.get(logDirectoriesKey));<NEW_LINE>DescribeLogDirsResponse.LogDirInfo logDirInfo = logDirInfoMap.get(logDirectoriesKey);<NEW_LINE>if (logDirInfo != null && !logDirectoriesResponseMap.isEmpty()) {<NEW_LINE>Map<TopicPartition, DescribeLogDirsResponse.ReplicaInfo> topicPartitionReplicaInfoMap = logDirInfo.replicaInfos;<NEW_LINE>totalPartitionsInBroker += this.processLogDirsWithinBroker(topicPartitionReplicaInfoMap, topic, broker);<NEW_LINE>}<NEW_LINE>return totalPartitionsInBroker;<NEW_LINE>}
.iterator().next();
63,313
protected MethodSource createMethodSource(final Method method) {<NEW_LINE>return new MethodSource() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Body getBody(SootMethod m, String phaseName) {<NEW_LINE>Body b = Jimple.<MASK><NEW_LINE>try {<NEW_LINE>// add the body of this code item<NEW_LINE>DexBody dexBody = new DexBody(dexEntry, method, declaringClass.getType());<NEW_LINE>dexBody.jimplify(b, m);<NEW_LINE>} catch (InvalidDalvikBytecodeException e) {<NEW_LINE>String msg = "Warning: Invalid bytecode in method " + m + ": " + e;<NEW_LINE>logger.debug("" + msg);<NEW_LINE>Util.emptyBody(b);<NEW_LINE>Util.addExceptionAfterUnit(b, "java.lang.RuntimeException", b.getUnits().getLast(), "Soot has detected that this method contains invalid Dalvik bytecode," + " which would have throw an exception at runtime. [" + msg + "]");<NEW_LINE>TypeAssigner.v().transform(b);<NEW_LINE>}<NEW_LINE>m.setActiveBody(b);<NEW_LINE>return m.getActiveBody();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
v().newBody(m);
774,966
public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) {<NEW_LINE>DocBuilderTemplate builderTemplate = new DocBuilderTemplate();<NEW_LINE>builderTemplate.checkAndInit(config, false);<NEW_LINE>config.setParamsDataToTree(false);<NEW_LINE>config.setAdoc(true);<NEW_LINE>ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder);<NEW_LINE>IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework());<NEW_LINE>List<ApiDoc> <MASK><NEW_LINE>if (config.isAllInOne()) {<NEW_LINE>String docName = builderTemplate.allInOneDocName(config, INDEX_DOC, ".adoc");<NEW_LINE>apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config);<NEW_LINE>builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_ADOC_TPL, docName);<NEW_LINE>} else {<NEW_LINE>builderTemplate.buildApiDoc(apiDocList, config, API_DOC_ADOC_TPL, API_EXTENSION);<NEW_LINE>builderTemplate.buildErrorCodeDoc(config, ERROR_CODE_LIST_ADOC_TPL, ERROR_CODE_LIST_ADOC);<NEW_LINE>builderTemplate.buildDirectoryDataDoc(config, javaProjectBuilder, DICT_LIST_ADOC_TPL, DICT_LIST_ADOC);<NEW_LINE>}<NEW_LINE>}
apiDocList = docBuildTemplate.getApiData(configBuilder);
835,459
private RDD<Element> doOperationUsingRFileReaderRDD(final GetRDDOfAllElements operation, final Context context, final AccumuloStore accumuloStore) throws OperationException {<NEW_LINE>final Configuration conf = getConfiguration(operation);<NEW_LINE>// Need to add validation iterator manually (it's not added by the addIterators method as normally the iterator<NEW_LINE>// is present on the table and therefore applied to all scans - here we're bypassing the normal table access<NEW_LINE>// method so it needs to be applied manually)<NEW_LINE>addValidationIterator(accumuloStore, conf);<NEW_LINE>// Need to add aggregation iterator manually for the same reasons as above<NEW_LINE>try {<NEW_LINE>addAggregationIterator(accumuloStore, conf);<NEW_LINE>} catch (final IteratorSettingException e) {<NEW_LINE>throw new OperationException("IteratorSettingException adding aggregation iterator", e);<NEW_LINE>}<NEW_LINE>// Add other iterators<NEW_LINE>addIterators(accumuloStore, conf, context.getUser(), operation);<NEW_LINE>try {<NEW_LINE>// Add view to conf so that any transformations can be applied<NEW_LINE>conf.set(AbstractGetRDDHandler.VIEW, new String(operation.getView().toCompactJson(), CommonConstants.UTF_8));<NEW_LINE>final byte[] serialisedConf = Utils.serialiseConfiguration(conf);<NEW_LINE>final RDD<Map.Entry<Key, Value>> rdd = new RFileReaderRDD(SparkContextUtil.getSparkSession(context, accumuloStore.getProperties()).sparkContext(), accumuloStore.getProperties().getInstance(), accumuloStore.getProperties().getZookeepers(), accumuloStore.getProperties().getUser(), accumuloStore.getProperties().getPassword(), accumuloStore.getTableName(), context.getUser().getDataAuths(), serialisedConf);<NEW_LINE>return rdd.mapPartitions(new EntryIteratorToElementIterator(serialisedConf), true, ELEMENT_CLASS_TAG);<NEW_LINE>} catch (final IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new OperationException("IOException serialising configuration", e);
76,130
private void asyncNextBatch() {<NEW_LINE>if (_rpcRunning) {<NEW_LINE>logger.error("scan rpc already be running, encounter logic error, we just abandon this scan, " + "tableName({}), appId({})", _table.getTableName(<MASK><NEW_LINE>_encounterError = true;<NEW_LINE>_cause = new PException("scan internal error, rpc is already started");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_rpcRunning = true;<NEW_LINE>scan_request request = new scan_request(_contextId);<NEW_LINE>rrdb_scan_operator op = new rrdb_scan_operator(_gpid, _table.getTableName(), request, _hash);<NEW_LINE>Table.ClientOPCallback callback = new Table.ClientOPCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompletion(client_operator clientOP) throws Throwable {<NEW_LINE>rrdb_scan_operator op = (rrdb_scan_operator) (clientOP);<NEW_LINE>scan_response response = op.get_response();<NEW_LINE>synchronized (_promisesLock) {<NEW_LINE>onRecvRpcResponse(op.rpc_error, response);<NEW_LINE>asyncNextInternal();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>_table.asyncOperate(op, callback, _options.timeoutMillis);<NEW_LINE>}
), _table.getAppID());
1,142,469
public void read(org.apache.thrift.protocol.TProtocol prot, knnQueryBatch_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>struct.k = iprot.readI32();<NEW_LINE>struct.setKIsSet(true);<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());<NEW_LINE>struct.queryObj = new java.util.ArrayList<java.nio.ByteBuffer>(_list21.size);<NEW_LINE>java.nio.ByteBuffer _elem22;<NEW_LINE>for (int _i23 = 0; _i23 < _list21.size; ++_i23) {<NEW_LINE>_elem22 = iprot.readBinary();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setQueryObjIsSet(true);<NEW_LINE>struct.retExternId = iprot.readBool();<NEW_LINE>struct.setRetExternIdIsSet(true);<NEW_LINE>struct.retObj = iprot.readBool();<NEW_LINE>struct.setRetObjIsSet(true);<NEW_LINE>struct.numThreads = iprot.readI32();<NEW_LINE>struct.setNumThreadsIsSet(true);<NEW_LINE>}
struct.queryObj.add(_elem22);
1,355,587
private void updateVertexBuffers(List<BlockPos> blocksToHarvest, List<BlockPos> blocksToReplant) {<NEW_LINE>if (WurstClient.MC.getBlockEntityRenderDispatcher().camera == null)<NEW_LINE>return;<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>BlockPos camPos = RenderUtils.getCameraBlockPos();<NEW_LINE>int regionX = (camPos.getX() >> 9) * 512;<NEW_LINE>int regionZ = (camPos.getZ() >> 9) * 512;<NEW_LINE>if (greenBuffer != null)<NEW_LINE>greenBuffer.close();<NEW_LINE>greenBuffer = new VertexBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>double boxMin = 1 / 16.0;<NEW_LINE>double boxMax = 15 / 16.0;<NEW_LINE>Box box = new Box(boxMin, boxMin, boxMin, boxMax, boxMax, boxMax);<NEW_LINE>for (BlockPos pos : blocksToHarvest) {<NEW_LINE>Box renderBox = box.offset(pos).offset(-regionX, 0, -regionZ);<NEW_LINE>RenderUtils.drawOutlinedBox(renderBox, bufferBuilder);<NEW_LINE>}<NEW_LINE>bufferBuilder.end();<NEW_LINE>greenBuffer.upload(bufferBuilder);<NEW_LINE>if (cyanBuffer != null)<NEW_LINE>cyanBuffer.close();<NEW_LINE>cyanBuffer = new VertexBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>Box node = new Box(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);<NEW_LINE>for (BlockPos pos : plants.keySet()) {<NEW_LINE>Box renderNode = node.offset(pos).offset(-regionX, 0, -regionZ);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>bufferBuilder.end();<NEW_LINE>cyanBuffer.upload(bufferBuilder);<NEW_LINE>if (redBuffer != null)<NEW_LINE>redBuffer.close();<NEW_LINE>redBuffer = new VertexBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>for (BlockPos pos : blocksToReplant) {<NEW_LINE>Box renderBox = box.offset(pos).offset(-regionX, 0, -regionZ);<NEW_LINE>RenderUtils.drawOutlinedBox(renderBox, bufferBuilder);<NEW_LINE>}<NEW_LINE>bufferBuilder.end();<NEW_LINE>redBuffer.upload(bufferBuilder);<NEW_LINE>}
RenderUtils.drawNode(renderNode, bufferBuilder);
807,604
public JsonElement serializeProperty(PropertyKey key, Object value, String localPropertyView, int depth) {<NEW_LINE>try {<NEW_LINE>PropertyConverter converter = key.inputConverter(securityContext);<NEW_LINE>if (converter != null) {<NEW_LINE>try {<NEW_LINE>return serializeRoot(converter.revert(value), localPropertyView, depth);<NEW_LINE>} catch (ClassCastException cce) {<NEW_LINE>// try to fix the database property<NEW_LINE>value = key.fixDatabaseProperty(value);<NEW_LINE>return serializeRoot(converter.revert(value), localPropertyView, depth);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return serializeRoot(value, localPropertyView, depth);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("Exception while serializing property {} ({}) of entity {} (value {}) : {}", new Object[] { key.jsonName(), key.getClass(), key.getClass().getDeclaringClass(), value.getClass().getName(), value<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
, t.getMessage() });
685,300
protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>Pack p = null;<NEW_LINE>try {<NEW_LINE>p = tcp.getSingle(RequestCmd.LOAD_APICALL_SUMMARY, param);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>if (p != null) {<NEW_LINE>final List<SummaryData> list = new ArrayList<SummaryData>();<NEW_LINE>MapPack m = (MapPack) p;<NEW_LINE>ListValue idLv = m.getList("id");<NEW_LINE>ListValue <MASK><NEW_LINE>ListValue errorLv = m.getList("error");<NEW_LINE>ListValue elapsedLv = m.getList("elapsed");<NEW_LINE>for (int i = 0; i < idLv.size(); i++) {<NEW_LINE>SummaryData data = new SummaryData();<NEW_LINE>data.hash = idLv.getInt(i);<NEW_LINE>data.count = countLv.getInt(i);<NEW_LINE>data.errorCount = errorLv.getInt(i);<NEW_LINE>data.elapsedSum = elapsedLv.getLong(i);<NEW_LINE>list.add(data);<NEW_LINE>}<NEW_LINE>TextProxy.apicall.load(date, idLv, serverId);<NEW_LINE>ExUtil.exec(viewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>viewer.setInput(list);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
countLv = m.getList("count");
1,165,180
public RankProfile clone() {<NEW_LINE>try {<NEW_LINE>RankProfile clone = (RankProfile) super.clone();<NEW_LINE>clone.rankSettings = new LinkedHashSet<>(this.rankSettings);<NEW_LINE>// hmm?<NEW_LINE>clone.matchPhaseSettings = this.matchPhaseSettings;<NEW_LINE>clone.summaryFeatures = summaryFeatures != null ? new LinkedHashSet<>(this.summaryFeatures) : null;<NEW_LINE>clone.matchFeatures = matchFeatures != null ? new LinkedHashSet<>(this.matchFeatures) : null;<NEW_LINE>clone.rankFeatures = rankFeatures != null ? new LinkedHashSet<>(this.rankFeatures) : null;<NEW_LINE>clone.rankProperties = new LinkedHashMap<>(this.rankProperties);<NEW_LINE>clone.inputFeatures = new LinkedHashMap<>(this.inputFeatures);<NEW_LINE>clone.functions = new LinkedHashMap<>(this.functions);<NEW_LINE>clone.allFunctionsCached = null;<NEW_LINE>clone.filterFields = new HashSet<>(this.filterFields);<NEW_LINE>clone.constants = new HashMap<>(this.constants);<NEW_LINE>return clone;<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new RuntimeException("Won't happen", e);
1,560,985
public JsonOutOfStockResponse handleOutOfStockRequest(@NonNull final String warehouseIdentifier, @NonNull final JsonOutOfStockNoticeRequest outOfStockInfoRequest) {<NEW_LINE>if (!Boolean.TRUE.equals(outOfStockInfoRequest.getClosePendingShipmentSchedules()) && !Boolean.TRUE.equals(outOfStockInfoRequest.getCreateInventory())) {<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: closePendingShipmentSchedules and createInventory are both false! No action is performed!");<NEW_LINE>return JsonOutOfStockResponse.builder().affectedWarehouses(ImmutableList.<MASK><NEW_LINE>}<NEW_LINE>final OrgId orgId = RestUtils.retrieveOrgIdOrDefault(outOfStockInfoRequest.getOrgCode());<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: orgCode resolved to AD_Org_ID {}!", OrgId.toRepoIdOrAny(orgId));<NEW_LINE>final ExternalIdentifier productIdentifier = ExternalIdentifier.of(outOfStockInfoRequest.getProductIdentifier());<NEW_LINE>final ProductId productId = productRestService.resolveProductExternalIdentifier(productIdentifier, orgId).orElseThrow(() -> MissingResourceException.builder().resourceIdentifier(productIdentifier.getRawValue()).resourceName("M_Product").build());<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: productIdentifier resolved to M_Product_ID {}!", ProductId.toRepoId(productId));<NEW_LINE>final AttributeSetInstanceId attributeSetInstanceId = jsonAttributeService.computeAttributeSetInstanceFromJson(outOfStockInfoRequest.getAttributeSetInstance()).orElse(null);<NEW_LINE>Loggables.addLog("WarehouseService.handleOutOfStockRequest: JsonOutOfStockNoticeRequest: attributeSetInstance emerged to asiId: {}!", AttributeSetInstanceId.toRepoId(attributeSetInstanceId));<NEW_LINE>final Optional<WarehouseId> targetWarehouseId = ALL.equals(warehouseIdentifier) ? Optional.empty() : Optional.of(getWarehouseByIdentifier(orgId, warehouseIdentifier));<NEW_LINE>final Map<WarehouseId, String> warehouseId2InventoryDocNo = outOfStockInfoRequest.getCreateInventory() ? emptyWarehouse(productId, attributeSetInstanceId, targetWarehouseId.orElse(null)) : ImmutableMap.of();<NEW_LINE>final Map<WarehouseId, List<ShipmentScheduleId>> warehouseId2ClosedShipmentSchedules = outOfStockInfoRequest.getClosePendingShipmentSchedules() ? handleCloseShipmentSchedulesRequest(targetWarehouseId, productId, attributeSetInstanceId) : ImmutableMap.of();<NEW_LINE>return buildOutOfStockNoticeResponse(warehouseId2InventoryDocNo, warehouseId2ClosedShipmentSchedules);<NEW_LINE>}
of()).build();
1,492,072
public void search3(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>request = wrapRequest(request);<NEW_LINE>Player player = playerService.getPlayer(request, response);<NEW_LINE>String username = securityService.getCurrentUsername(request);<NEW_LINE>Integer musicFolderId = getIntParameter(request, "musicFolderId");<NEW_LINE>List<org.airsonic.player.domain.MusicFolder> musicFolders = mediaFolderService.getMusicFoldersForUser(username, musicFolderId);<NEW_LINE>SearchResult3 searchResult = new SearchResult3();<NEW_LINE>String query = request.getParameter("query");<NEW_LINE>SearchCriteria criteria = new SearchCriteria();<NEW_LINE>criteria.setQuery(StringUtils.trimToEmpty(query));<NEW_LINE>criteria.setCount(getIntParameter(request, "artistCount", 20));<NEW_LINE>criteria.setOffset(getIntParameter(request, "artistOffset", 0));<NEW_LINE>org.airsonic.player.domain.SearchResult result = searchService.search(criteria, musicFolders, IndexType.ARTIST_ID3);<NEW_LINE>for (org.airsonic.player.domain.Artist artist : result.getArtists()) {<NEW_LINE>searchResult.getArtist().add(createJaxbArtist(new ArtistID3<MASK><NEW_LINE>}<NEW_LINE>criteria.setCount(getIntParameter(request, "albumCount", 20));<NEW_LINE>criteria.setOffset(getIntParameter(request, "albumOffset", 0));<NEW_LINE>result = searchService.search(criteria, musicFolders, IndexType.ALBUM_ID3);<NEW_LINE>for (Album album : result.getAlbums()) {<NEW_LINE>searchResult.getAlbum().add(createJaxbAlbum(new AlbumID3(), album, username));<NEW_LINE>}<NEW_LINE>criteria.setCount(getIntParameter(request, "songCount", 20));<NEW_LINE>criteria.setOffset(getIntParameter(request, "songOffset", 0));<NEW_LINE>result = searchService.search(criteria, musicFolders, IndexType.SONG);<NEW_LINE>for (MediaFile song : result.getMediaFiles()) {<NEW_LINE>searchResult.getSong().add(createJaxbChild(player, song, username));<NEW_LINE>}<NEW_LINE>Response res = createResponse();<NEW_LINE>res.setSearchResult3(searchResult);<NEW_LINE>jaxbWriter.writeResponse(request, response, res);<NEW_LINE>}
(), artist, username));
1,470,302
public String toJSONString() {<NEW_LINE>StringBuilder sb = new StringBuilder("{");<NEW_LINE>sb.append("\"time\":" + timeFlag + ",");<NEW_LINE>sb.append("\"id\":\"" + id + "\",");<NEW_LINE>sb.append("\"title\":\"" + title + "\",");<NEW_LINE>sb.append("\"description\":\"" + description + "\",");<NEW_LINE>sb.append("\"host\":\"" + this.host + "\",");<NEW_LINE>sb.append("\"ip\":\"" + this.ip + "\",");<NEW_LINE>Set<Entry<String, String>> sets = args.entrySet();<NEW_LINE>sb.append("\"args\":{");<NEW_LINE>for (Entry<String, String> set : sets) {<NEW_LINE>sb.append("\"" + set.getKey() + "\":\"" + set.getValue() + "\",");<NEW_LINE>}<NEW_LINE>if (!sets.isEmpty()) {<NEW_LINE>sb = sb.deleteCharAt(sb.length() - 1);<NEW_LINE>}<NEW_LINE>sb.append("}");<NEW_LINE>return sb.<MASK><NEW_LINE>}
append("}").toString();
1,279,033
public void encode(int markerID, int cellID, PackedBits8 encodedPacket) {<NEW_LINE>// pre-allocate memory for encoded packet<NEW_LINE>int elementsInGrid = gridBitLength * gridBitLength;<NEW_LINE>encodedPacket.resize(elementsInGrid);<NEW_LINE>// Build the packet<NEW_LINE>bits.resize(0);<NEW_LINE>// Specify the ID numbers<NEW_LINE>bits.append(markerID, markerBitCount, false);<NEW_LINE>bits.append(cellID, cellBitCount, false);<NEW_LINE>// Compute a checksum. Checksum is needed since ECC won't catch everything in smaller packets<NEW_LINE>int checkSum = computeCheckSum();<NEW_LINE>bits.<MASK><NEW_LINE>// Sanity check<NEW_LINE>BoofMiscOps.checkEq(bits.size, messageBitCount);<NEW_LINE>// Concat the message and ecc data together<NEW_LINE>encodedPacket.resize(0);<NEW_LINE>encodedPacket.append(bits, bits.size);<NEW_LINE>int bitsEncoded;<NEW_LINE>if (errorCorrectionLevel > 0) {<NEW_LINE>// Copy packet from the bits workspace into message<NEW_LINE>message.setTo(bits.data, 0, dataWords);<NEW_LINE>// Compute the error correction code<NEW_LINE>rscodes.computeECC(message, ecc);<NEW_LINE>// Copy ECC into the encoded packet. The message data is now implicitly filled with zeros to align with<NEW_LINE>// a word<NEW_LINE>System.arraycopy(ecc.data, 0, encodedPacket.data, dataWords, ecc.size);<NEW_LINE>bitsEncoded = (dataWords + ecc.size) * WORD_BITS;<NEW_LINE>} else {<NEW_LINE>bitsEncoded = bits.size;<NEW_LINE>}<NEW_LINE>// Add padding to the remainder<NEW_LINE>encodedPacket.size = bitsEncoded;<NEW_LINE>for (int i = encodedPacket.size; i < elementsInGrid; i += 32) {<NEW_LINE>encodedPacket.append(paddingBits, Math.min(32, elementsInGrid - i), false);<NEW_LINE>}<NEW_LINE>}
append(checkSum, checksumBitCount, true);
554,797
public RefundInvoiceCandidate createOrDeleteAdditionalAssignments(@NonNull final RefundInvoiceCandidate refundInvoiceCandidate, @NonNull final RefundConfig oldRefundConfig, @NonNull final RefundConfig newRefundConfig) {<NEW_LINE>if (oldRefundConfig.equals(newRefundConfig)) {<NEW_LINE>return refundInvoiceCandidate;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final List<RefundConfig> refundConfigs = refundContract.getRefundConfigs();<NEW_LINE>Check.errorUnless(RefundMode.APPLY_TO_ALL_QTIES.equals(newRefundConfig.getRefundMode()), "Parameter 'newRefundConfig' needs to have refundMode={}", RefundMode.APPLY_TO_ALL_QTIES);<NEW_LINE>Check.errorUnless(refundConfigs.contains(newRefundConfig), "Parameter 'newRefundConfig' needs to be one of the given refundInvoiceCandidate's contract's configs; newRefundConfig={}; refundInvoiceCandidate={}", newRefundConfig, refundInvoiceCandidate);<NEW_LINE>// add new AssignmentToRefundCandidates, or remove existing ones<NEW_LINE>// which reference newRefundConfig and track the additional money that comes with the new refund config.<NEW_LINE>final boolean isHigherRefund = newRefundConfig.getMinQty().compareTo(oldRefundConfig.getMinQty()) > 0;<NEW_LINE>final List<RefundConfig> refundConfigRange = getRefundConfigRange(refundContract, oldRefundConfig, newRefundConfig);<NEW_LINE>Check.assumeNotEmpty(refundConfigRange, "There needs to be at least one refundConfig in the range defined by oldRefundConfig={} and newRefundConfig={}; refundInvoiceCandidate={}", oldRefundConfig, newRefundConfig, refundInvoiceCandidate);<NEW_LINE>final RefundConfigChangeHandler handler = createForConfig(oldRefundConfig);<NEW_LINE>if (isHigherRefund) {<NEW_LINE>for (final RefundConfig currentRangeConfig : refundConfigRange) {<NEW_LINE>handler.changeCurrentRefundConfig(currentRangeConfig);<NEW_LINE>final RefundConfig formerRefundConfig = handler.getFormerRefundConfig();<NEW_LINE>final Stream<AssignmentToRefundCandidate> assignmentsToExtend = streamAssignmentsToExtend(refundInvoiceCandidate, formerRefundConfig, currentRangeConfig);<NEW_LINE>// note: the nice thing here is that we don't need to alter the existing candidate in any way!<NEW_LINE>// the new assignment only assigns *additional* stuff<NEW_LINE>assignmentsToExtend.// the new assignment only assigns *additional* stuff<NEW_LINE>map(handler::createNewAssignment).forEach(assignmentToRefundCandidateRepository::save);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final DeleteAssignmentsRequestBuilder builder = DeleteAssignmentsRequest.builder().removeForRefundCandidateId(refundInvoiceCandidate.getId());<NEW_LINE>for (final RefundConfig currentRangeConfig : refundConfigRange) {<NEW_LINE>builder.refundConfigId(currentRangeConfig.getId());<NEW_LINE>}<NEW_LINE>assignmentToRefundCandidateRepository.deleteAssignments(builder.build());<NEW_LINE>}<NEW_LINE>final RefundInvoiceCandidate endResult = refundInvoiceCandidateService.updateMoneyFromAssignments(refundInvoiceCandidate);<NEW_LINE>return endResult;<NEW_LINE>}
RefundContract refundContract = refundInvoiceCandidate.getRefundContract();
1,692,362
protected Object doInBackground() throws Exception {<NEW_LINE>downloadTaskRunning = true;<NEW_LINE>AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder);<NEW_LINE>FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create();<NEW_LINE>CustomSettings settings = new CustomSettings();<NEW_LINE>Downloader downloader = new LegacyDownloader(fop, settings);<NEW_LINE>RepoManager mRepoManager = mHandler.getSdkManager(progress);<NEW_LINE>mRepoManager.loadSynchronously(0, progress, downloader, settings);<NEW_LINE>List<RemotePackage> remotes = new ArrayList<>();<NEW_LINE>for (String path : settings.getPaths(mRepoManager)) {<NEW_LINE>RemotePackage p = mRepoManager.getPackages().getRemotePackages().get(path);<NEW_LINE>if (p == null) {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_finding_package", path));<NEW_LINE>progress.logWarning("Failed to find package " + path);<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>remotes.add(p);<NEW_LINE>}<NEW_LINE>remotes = InstallerUtil.computeRequiredPackages(remotes, <MASK><NEW_LINE>if (remotes != null) {<NEW_LINE>for (RemotePackage p : remotes) {<NEW_LINE>Installer installer = SdkInstallerUtil.findBestInstallerFactory(p, mHandler).createInstaller(p, mRepoManager, downloader, mHandler.getFileOp());<NEW_LINE>if (!(installer.prepare(progress) && installer.complete(progress))) {<NEW_LINE>// there was an error, abort.<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list"));<NEW_LINE>progress.logWarning("Unable to compute a complete list of dependencies.");<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
mRepoManager.getPackages(), progress);
1,522,752
public DocumentAttributeValueCountPair unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DocumentAttributeValueCountPair documentAttributeValueCountPair = new DocumentAttributeValueCountPair();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DocumentAttributeValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>documentAttributeValueCountPair.setDocumentAttributeValue(DocumentAttributeValueJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Count", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>documentAttributeValueCountPair.setCount(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return documentAttributeValueCountPair;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
787,944
protected Control createContents(Composite parent) {<NEW_LINE>Composite composite = new Composite(parent, SWT.NONE);<NEW_LINE>composite.setLayout(new GridLayout());<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>fProject = (IProject) getElement().getAdapter(IResource.class);<NEW_LINE>try {<NEW_LINE>if (fProject.isOpen()) {<NEW_LINE>// Can only access decription if project exists and is open...<NEW_LINE>fCurrentProjectNatures = fProject.getDescription().getNatureIds();<NEW_LINE>} else {<NEW_LINE>fCurrentProjectNatures = new String[0];<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logError(UIEplPlugin.getDefault(), EplMessages.ProjectNaturesPage_ERR_RetrieveNatures, e);<NEW_LINE>fCurrentProjectNatures = new String[0];<NEW_LINE>}<NEW_LINE>fLabelProvider = new NaturesLabelProvider(fNatureDescriptions);<NEW_LINE>// assumes the first one in the array is the primary nature<NEW_LINE>fInitialPrimaryNature = fCurrentProjectNatures.length == <MASK><NEW_LINE>updatePrimaryNature(fInitialPrimaryNature);<NEW_LINE>setDescription(MessageFormat.format(EplMessages.ProjectNaturesPage_Description, fProject.getName()));<NEW_LINE>Label description = createDescriptionLabel(composite);<NEW_LINE>description.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());<NEW_LINE>Composite tableComposite = new Composite(composite, SWT.NONE);<NEW_LINE>tableComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());<NEW_LINE>tableComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>fTableViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.TOP | SWT.BORDER);<NEW_LINE>Table table = fTableViewer.getTable();<NEW_LINE>table.setLinesVisible(true);<NEW_LINE>table.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>TableColumn column = new TableColumn(table, SWT.LEFT);<NEW_LINE>column.setWidth(350);<NEW_LINE>fTableViewer.setContentProvider(getContentProvider());<NEW_LINE>fTableViewer.setLabelProvider(getLabelProvider());<NEW_LINE>fTableViewer.setComparator(getViewerComperator());<NEW_LINE>fTableViewer.setInput(fProject.getWorkspace());<NEW_LINE>if (!fProject.isAccessible()) {<NEW_LINE>fTableViewer.getControl().setEnabled(false);<NEW_LINE>}<NEW_LINE>fTableViewer.setCheckedElements(fCurrentProjectNatures);<NEW_LINE>fTableViewer.addCheckStateListener(this);<NEW_LINE>fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {<NEW_LINE><NEW_LINE>public void selectionChanged(SelectionChangedEvent event) {<NEW_LINE>updateButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fInitialCheckedItems = fTableViewer.getCheckedElements();<NEW_LINE>table.setMenu(createMenu(table));<NEW_LINE>// Add the buttons<NEW_LINE>Composite buttons = new Composite(tableComposite, SWT.NONE);<NEW_LINE>buttons.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>buttons.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create());<NEW_LINE>fMakePrimaryButton = createButton(EplMessages.ProjectNaturesPage_LBL_MakePrimary, buttons);<NEW_LINE>updateButtons();<NEW_LINE>noDefaultAndApplyButton();<NEW_LINE>return composite;<NEW_LINE>}
0 ? null : fCurrentProjectNatures[0];
885,363
public Request<DescribeEnvironmentHealthRequest> marshall(DescribeEnvironmentHealthRequest describeEnvironmentHealthRequest) {<NEW_LINE>if (describeEnvironmentHealthRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeEnvironmentHealthRequest> request = new DefaultRequest<DescribeEnvironmentHealthRequest>(describeEnvironmentHealthRequest, "AWSElasticBeanstalk");<NEW_LINE>request.addParameter("Action", "DescribeEnvironmentHealth");<NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeEnvironmentHealthRequest.getEnvironmentName() != null) {<NEW_LINE>request.addParameter("EnvironmentName", StringUtils.fromString(describeEnvironmentHealthRequest.getEnvironmentName()));<NEW_LINE>}<NEW_LINE>if (describeEnvironmentHealthRequest.getEnvironmentId() != null) {<NEW_LINE>request.addParameter("EnvironmentId", StringUtils.fromString(describeEnvironmentHealthRequest.getEnvironmentId()));<NEW_LINE>}<NEW_LINE>if (!describeEnvironmentHealthRequest.getAttributeNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) describeEnvironmentHealthRequest.getAttributeNames()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> attributeNamesList = (com.amazonaws.internal.SdkInternalList<String>) describeEnvironmentHealthRequest.getAttributeNames();<NEW_LINE>int attributeNamesListIndex = 1;<NEW_LINE>for (String attributeNamesListValue : attributeNamesList) {<NEW_LINE>if (attributeNamesListValue != null) {<NEW_LINE>request.addParameter("AttributeNames.member." + attributeNamesListIndex<MASK><NEW_LINE>}<NEW_LINE>attributeNamesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
, StringUtils.fromString(attributeNamesListValue));
1,753,265
public MessageCorrelationResultImpl execute(final CommandContext commandContext) {<NEW_LINE>ensureAtLeastOneNotNull("At least one of the following correlation criteria has to be present: " + "messageName, businessKey, correlationKeys, processInstanceId", messageName, builder.getBusinessKey(), builder.getCorrelationProcessInstanceVariables(<MASK><NEW_LINE>final CorrelationHandler correlationHandler = Context.getProcessEngineConfiguration().getCorrelationHandler();<NEW_LINE>final CorrelationSet correlationSet = new CorrelationSet(builder);<NEW_LINE>CorrelationHandlerResult correlationResult = null;<NEW_LINE>if (startMessageOnly) {<NEW_LINE>List<CorrelationHandlerResult> correlationResults = commandContext.runWithoutAuthorization(new Callable<List<CorrelationHandlerResult>>() {<NEW_LINE><NEW_LINE>public List<CorrelationHandlerResult> call() throws Exception {<NEW_LINE>return correlationHandler.correlateStartMessages(commandContext, messageName, correlationSet);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (correlationResults.isEmpty()) {<NEW_LINE>throw new MismatchingMessageCorrelationException(messageName, "No process definition matches the parameters");<NEW_LINE>} else if (correlationResults.size() > 1) {<NEW_LINE>throw LOG.exceptionCorrelateMessageToSingleProcessDefinition(messageName, correlationResults.size(), correlationSet);<NEW_LINE>} else {<NEW_LINE>correlationResult = correlationResults.get(0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>correlationResult = commandContext.runWithoutAuthorization(new Callable<CorrelationHandlerResult>() {<NEW_LINE><NEW_LINE>public CorrelationHandlerResult call() throws Exception {<NEW_LINE>return correlationHandler.correlateMessage(commandContext, messageName, correlationSet);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (correlationResult == null) {<NEW_LINE>throw new MismatchingMessageCorrelationException(messageName, "No process definition or execution matches the parameters");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check authorization<NEW_LINE>checkAuthorization(correlationResult);<NEW_LINE>return createMessageCorrelationResult(commandContext, correlationResult);<NEW_LINE>}
), builder.getProcessInstanceId());
1,558,574
public void dangerPermanentlyRemoveSecretsDeletedBeforeDate(DateTime deletedBefore, int sleepMillis) throws InterruptedException {<NEW_LINE>checkArgument(deletedBefore != null);<NEW_LINE>SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(dslContext.configuration());<NEW_LINE>SecretContentDAO secretContentDAO = secretContentDAOFactory.<MASK><NEW_LINE>// identify the secrets deleted before this date<NEW_LINE>List<Long> ids = secretSeriesDAO.getIdsForSecretSeriesDeletedBeforeDate(deletedBefore);<NEW_LINE>// batch the list of secrets to be removed, to reduce load on the database<NEW_LINE>List<List<Long>> partitionedIds = Lists.partition(ids, MAX_ROWS_REMOVED_PER_TRANSACTION);<NEW_LINE>for (List<Long> idBatch : partitionedIds) {<NEW_LINE>// permanently remove the `secrets_contents` entries originally associated with these secrets<NEW_LINE>secretContentDAO.dangerPermanentlyRemoveRecordsForGivenSecretsIDs(idBatch);<NEW_LINE>// permanently remove the `secrets` entries for these secrets<NEW_LINE>secretSeriesDAO.dangerPermanentlyRemoveRecordsForGivenIDs(idBatch);<NEW_LINE>// sleep<NEW_LINE>Thread.sleep(sleepMillis);<NEW_LINE>}<NEW_LINE>}
using(dslContext.configuration());
352,813
private Wo list(Business business, Wi wi) throws Exception {<NEW_LINE>List<Person> os = business.person().pick(wi.getPersonList());<NEW_LINE>List<String> groupIds = new ArrayList<>();<NEW_LINE>List<String> personIds = new ArrayList<>();<NEW_LINE>List<String> <MASK><NEW_LINE>for (Person person : os) {<NEW_LINE>personIds.add(person.getId());<NEW_LINE>groupIds.addAll(business.group().listSupNestedWithPerson(person.getId()));<NEW_LINE>}<NEW_LINE>groupIds = ListTools.trim(groupIds, true, true);<NEW_LINE>List<Identity> identities = this.identities(business, personIds);<NEW_LINE>for (Identity o : identities) {<NEW_LINE>unitIds.add(o.getUnit());<NEW_LINE>}<NEW_LINE>unitIds = ListTools.trim(unitIds, true, true);<NEW_LINE>groupIds.addAll(this.groupsContainsUnit(business, unitIds));<NEW_LINE>groupIds = ListTools.trim(groupIds, true, true);<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Role.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Role> root = cq.from(Role.class);<NEW_LINE>Predicate p = root.get(Role_.personList).in(personIds);<NEW_LINE>p = cb.or(p, root.get(Role_.groupList).in(groupIds));<NEW_LINE>List<String> roleIds = em.createQuery(cq.select(root.get(Role_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.getRoleList().addAll(business.role().listRoleDistinguishedNameSorted(roleIds));<NEW_LINE>return wo;<NEW_LINE>}
unitIds = new ArrayList<>();
493,250
public StopGameSessionPlacementResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StopGameSessionPlacementResult stopGameSessionPlacementResult = new StopGameSessionPlacementResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return stopGameSessionPlacementResult;<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("GameSessionPlacement", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stopGameSessionPlacementResult.setGameSessionPlacement(GameSessionPlacementJsonUnmarshaller.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 stopGameSessionPlacementResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
899,849
public String toOperationId(String operationId) {<NEW_LINE>// throw exception if method name is empty<NEW_LINE>if (StringUtils.isEmpty(operationId)) {<NEW_LINE>throw new RuntimeException("Empty method/operation name (operationId) not allowed");<NEW_LINE>}<NEW_LINE>operationId = camelize(sanitizeName(operationId), true);<NEW_LINE>// method name cannot use reserved keyword, e.g. return<NEW_LINE>if (isReservedWord(operationId)) {<NEW_LINE>String newOperationId = camelize("call_" + operationId, true);<NEW_LINE>LOGGER.<MASK><NEW_LINE>return newOperationId;<NEW_LINE>}<NEW_LINE>// operationId starts with a number<NEW_LINE>if (operationId.matches("^\\d.*")) {<NEW_LINE>LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize("call_" + operationId), true);<NEW_LINE>operationId = camelize("call_" + operationId, true);<NEW_LINE>}<NEW_LINE>return operationId;<NEW_LINE>}
warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
898,553
public static GetDownloadUrlsResponse unmarshall(GetDownloadUrlsResponse getDownloadUrlsResponse, UnmarshallerContext context) {<NEW_LINE>getDownloadUrlsResponse.setRequestId(context.stringValue("GetDownloadUrlsResponse.RequestId"));<NEW_LINE>getDownloadUrlsResponse.setCode(context.stringValue("GetDownloadUrlsResponse.Code"));<NEW_LINE>getDownloadUrlsResponse.setMessage(context.stringValue("GetDownloadUrlsResponse.Message"));<NEW_LINE>getDownloadUrlsResponse.setAction(context.stringValue("GetDownloadUrlsResponse.Action"));<NEW_LINE>List<Result> results = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetDownloadUrlsResponse.Results.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setCode(context.stringValue<MASK><NEW_LINE>result.setMessage(context.stringValue("GetDownloadUrlsResponse.Results[" + i + "].Message"));<NEW_LINE>result.setPhotoId(context.longValue("GetDownloadUrlsResponse.Results[" + i + "].PhotoId"));<NEW_LINE>result.setPhotoIdStr(context.stringValue("GetDownloadUrlsResponse.Results[" + i + "].PhotoIdStr"));<NEW_LINE>result.setDownloadUrl(context.stringValue("GetDownloadUrlsResponse.Results[" + i + "].DownloadUrl"));<NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>getDownloadUrlsResponse.setResults(results);<NEW_LINE>return getDownloadUrlsResponse;<NEW_LINE>}
("GetDownloadUrlsResponse.Results[" + i + "].Code"));
665,988
private void handleFailure(String text, Throwable e) {<NEW_LINE>ApiRequestException are = e instanceof ApiRequestException ? (ApiRequestException) e : null;<NEW_LINE>boolean isAuthError = are != null && are.getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED;<NEW_LINE>if (isAuthError) {<NEW_LINE>Snackbar.make(mCoordinatorLayout, R.string.load_auth_failure_notice, Snackbar.LENGTH_INDEFINITE).setAction(R.string.login, v -> goToToplevelActivity()).show();<NEW_LINE>Log.d(Gh4Application.LOG_TAG, text, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean exceptionMustBeHandled = e instanceof ApiRequestException || e instanceof JsonDataException;<NEW_LINE>if (!exceptionMustBeHandled && e instanceof RuntimeException) {<NEW_LINE>// If this happens, it means Rx catched a programming error of us. Crash the app<NEW_LINE>// in that case, as that's what would have happened without Rx as well.<NEW_LINE>// In doing so, don't just throw the exception (but instead delegate it right to the<NEW_LINE>// uncaught exception handler) to make sure RX doesn't add its composite exception<NEW_LINE>// which obscures the actual stack trace.<NEW_LINE>Thread currentThread = Thread.currentThread();<NEW_LINE>Thread.<MASK><NEW_LINE>handler.uncaughtException(currentThread, e);<NEW_LINE>}<NEW_LINE>Log.e(Gh4Application.LOG_TAG, text, e);<NEW_LINE>}
UncaughtExceptionHandler handler = currentThread.getUncaughtExceptionHandler();
82,037
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>if ((tileIcons == null) || (tileIcons.length < 2)) {<NEW_LINE>super.paintBorder(c, g, x, y, width, height);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Insets insets = getBorderInsets(c);<NEW_LINE>int clipWidth, clipHeight;<NEW_LINE>// clip to component width or insets<NEW_LINE>clipWidth = Math.min(width, insets.left);<NEW_LINE>// clip to component height or insets<NEW_LINE>clipHeight = Math.min(height, insets.top);<NEW_LINE>if ((clipWidth <= 0) || (clipHeight <= 0)) {<NEW_LINE>// nothing to paint<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We now know that we have at least two icons!<NEW_LINE>// restore before exiting<NEW_LINE>Color oldColor = g.getColor();<NEW_LINE>// restore before exiting<NEW_LINE>g.translate(x, y);<NEW_LINE>for (int i = 0; i < tileIcons.length; i++) {<NEW_LINE>// Make sure we have an icon to paint with<NEW_LINE>if (tileIcons[i] == null) {<NEW_LINE>tileIcons[i] = getDefaultIcon();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paintTopLeft(c, g, 0, 0, insets.left, insets.top);<NEW_LINE>paintTop(c, g, insets.left, 0, width - insets.left - <MASK><NEW_LINE>paintTopRight(c, g, width - insets.right, 0, insets.right, insets.top);<NEW_LINE>paintRight(c, g, width - insets.right, insets.top, insets.right, height - insets.top - insets.bottom);<NEW_LINE>paintBottomRight(c, g, width - insets.right, height - insets.bottom, insets.right, insets.bottom);<NEW_LINE>paintBottom(c, g, insets.left, height - insets.bottom, width - insets.left - insets.right, insets.bottom);<NEW_LINE>paintBottomLeft(c, g, 0, height - insets.bottom, insets.left, insets.bottom);<NEW_LINE>paintLeft(c, g, 0, insets.top, insets.left, height - insets.top - insets.bottom);<NEW_LINE>// restore<NEW_LINE>g.translate(-x, -y);<NEW_LINE>// restore<NEW_LINE>g.setColor(oldColor);<NEW_LINE>}
insets.right, insets.top);
1,199,067
private static <T, U> RoutingPredicate<T> parseCompareRoutingPredicate(String predicateExpr, Function<String, U> nameConverter, BiFunction<U, String, Predicate<T>> equalsPredicate) {<NEW_LINE>final Matcher compareMatcher = COMPARE_PATTERN.matcher(predicateExpr);<NEW_LINE>if (compareMatcher.matches()) {<NEW_LINE>assert compareMatcher.groupCount() == 3;<NEW_LINE>final String name = compareMatcher.group(1);<NEW_LINE>final String comparator = compareMatcher.group(2);<NEW_LINE>final String value = compareMatcher.group(3);<NEW_LINE>final Predicate<T> predicate = equalsPredicate.apply(nameConverter<MASK><NEW_LINE>final String noWsValue = WHITESPACE_PATTERN.matcher(value).replaceAll("_");<NEW_LINE>switch(comparator) {<NEW_LINE>case "=":<NEW_LINE>return eq(name, noWsValue, predicate);<NEW_LINE>case "!=":<NEW_LINE>return notEq(name, noWsValue, predicate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.apply(name), value);
1,127,396
public void reportSyntaxError(final String message) {<NEW_LINE>int index = isValidLookhead() ? this.lookhead.getStartIndex() : this.lexer.getCurrentIndex();<NEW_LINE>if (this.lookhead != null) {<NEW_LINE>this.lexer.pushback(this.lookhead);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String //<NEW_LINE>msg = //<NEW_LINE>"Syntax error: " + message + " at " + index + //<NEW_LINE>", lineNumber: " + //<NEW_LINE>this.lexer.getLineNo() + ", token : " + //<NEW_LINE>this.lookhead + ",\nwhile parsing expression: `\n" + this.lexer.getScanString() + "^^^\n`";<NEW_LINE>ExpressionSyntaxErrorException e = new ExpressionSyntaxErrorException(msg);<NEW_LINE>StackTraceElement[] traces = e.getStackTrace();<NEW_LINE>List<StackTraceElement> <MASK><NEW_LINE>for (StackTraceElement t : traces) {<NEW_LINE>if (!this.instance.getOptionValue(Options.TRACE_EVAL).bool && t.getClassName().equals(this.getClass().getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>filteredTraces.add(t);<NEW_LINE>}<NEW_LINE>e.setStackTrace(filteredTraces.toArray(new StackTraceElement[filteredTraces.size()]));<NEW_LINE>throw e;<NEW_LINE>}
filteredTraces = new ArrayList<>();
160,405
public SmartHomeAppliance unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SmartHomeAppliance smartHomeAppliance = new SmartHomeAppliance();<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("FriendlyName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setFriendlyName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setDescription(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ManufacturerName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>smartHomeAppliance.setManufacturerName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return smartHomeAppliance;<NEW_LINE>}
class).unmarshall(context));
877,521
private void connectPostpositives() {<NEW_LINE>postpRoot_ST.addEmpty(postpZero_S);<NEW_LINE>postpZero_S.addEmpty(nVerb_S);<NEW_LINE>// gibi is kind of special.<NEW_LINE>DictionaryItem gibiGen = lexicon.getItemById("gibi_Postp_PCGen");<NEW_LINE>DictionaryItem gibiNom = lexicon.getItemById("gibi_Postp_PCNom");<NEW_LINE>DictionaryItem sonraAbl = lexicon.getItemById("sonra_Postp_PCAbl");<NEW_LINE>postpZero_S.addEmpty(po2nRoot_S, rootIsAny(gibiGen, gibiNom, sonraAbl));<NEW_LINE>po2nRoot_S.addEmpty(po2nA3sg_S);<NEW_LINE>po2nRoot_S.add(po2nA3pl_S, "lAr");<NEW_LINE>// gibisi, gibim-e, gibi-e, gibi-mize<NEW_LINE>po2nA3sg_S.add(po2nP3sg_S, "+sI");<NEW_LINE>po2nA3sg_S.add(po2nP1sg_S, "m", Conditions.rootIsAny(gibiGen, gibiNom));<NEW_LINE>po2nA3sg_S.add(po2nP2sg_S, "n", Conditions<MASK><NEW_LINE>po2nA3sg_S.add(po2nP1pl_S, "miz", Conditions.rootIsAny(gibiGen, gibiNom));<NEW_LINE>po2nA3sg_S.add(po2nP2pl_S, "niz", Conditions.rootIsAny(gibiGen, gibiNom));<NEW_LINE>// gibileri<NEW_LINE>po2nA3pl_S.add(po2nP3sg_S, "+sI");<NEW_LINE>po2nA3pl_S.addEmpty(po2nPnon_S);<NEW_LINE>po2nP3sg_S.addEmpty(po2nNom_ST).add(po2nDat_ST, "nA").add(po2nLoc_ST, "ndA").add(po2nAbl_ST, "ndAn").add(po2nIns_ST, "ylA").add(po2nGen_ST, "nIn").add(po2nAcc_ST, "nI");<NEW_LINE>po2nPnon_S.addEmpty(po2nNom_ST).add(po2nDat_ST, "A").add(po2nLoc_ST, "dA").add(po2nAbl_ST, "dAn").add(po2nIns_ST, "lA").add(po2nGen_ST, "In").add(po2nEqu_ST, "cA").add(po2nAcc_ST, "I");<NEW_LINE>po2nP1sg_S.add(po2nDat_ST, "e");<NEW_LINE>po2nP2sg_S.add(po2nDat_ST, "e");<NEW_LINE>po2nP1pl_S.add(po2nDat_ST, "e");<NEW_LINE>po2nP2pl_S.add(po2nDat_ST, "e");<NEW_LINE>}
.rootIsAny(gibiGen, gibiNom));
145,324
private void configureCollection(Context context, String collectionID, int type, String oaiSource, String oaiSetId, String mdConfigId) {<NEW_LINE>handler.logInfo("Running: configure collection");<NEW_LINE>Collection collection = resolveCollection(context, collectionID);<NEW_LINE>handler.logInfo(String.valueOf<MASK><NEW_LINE>try {<NEW_LINE>HarvestedCollection hc = harvestedCollectionService.find(context, collection);<NEW_LINE>if (hc == null) {<NEW_LINE>hc = harvestedCollectionService.create(context, collection);<NEW_LINE>}<NEW_LINE>context.turnOffAuthorisationSystem();<NEW_LINE>hc.setHarvestParams(type, oaiSource, oaiSetId, mdConfigId);<NEW_LINE>hc.setHarvestStatus(HarvestedCollection.STATUS_READY);<NEW_LINE>harvestedCollectionService.update(context, hc);<NEW_LINE>context.restoreAuthSystemState();<NEW_LINE>context.complete();<NEW_LINE>} catch (Exception e) {<NEW_LINE>handler.logError("Changes could not be committed");<NEW_LINE>handler.handleException(e);<NEW_LINE>} finally {<NEW_LINE>if (context != null) {<NEW_LINE>context.restoreAuthSystemState();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(collection.getID()));
1,831,824
protected void startBenchmark() {<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(getActivity());<NEW_LINE>TextView textView = (TextView) rootLayout.findViewById(R.id.text);<NEW_LINE>Random random = new Random();<NEW_LINE>final int ITERATIONS = 500;<NEW_LINE>BenchmarkAggregator yogaInflationAggregator = new BenchmarkAggregator("Yoga Layout");<NEW_LINE>BenchmarkAggregator linearInflationAggregator = new BenchmarkAggregator("Linear Layout");<NEW_LINE>View yogaView = <MASK><NEW_LINE>View linearView = inflater.inflate(linearLayout, null);<NEW_LINE>for (int i = 0; i < ITERATIONS; i++) {<NEW_LINE>randomizeText(yogaView);<NEW_LINE>randomizeText(linearView);<NEW_LINE>yogaView.measure(View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));<NEW_LINE>linearView.measure(View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));<NEW_LINE>yogaInflationAggregator.startTrace();<NEW_LINE>yogaView.layout(0, 0, yogaView.getMeasuredWidth(), yogaView.getMeasuredHeight());<NEW_LINE>yogaInflationAggregator.endTrace();<NEW_LINE>linearInflationAggregator.startTrace();<NEW_LINE>linearView.layout(0, 0, linearView.getMeasuredWidth(), linearView.getMeasuredHeight());<NEW_LINE>linearInflationAggregator.endTrace();<NEW_LINE>}<NEW_LINE>textView.setText(yogaInflationAggregator.toString() + "\n" + linearInflationAggregator.toString());<NEW_LINE>Log.i("YogaLayoutBenchmark", yogaInflationAggregator.toString() + "\n" + linearInflationAggregator.toString());<NEW_LINE>}
inflater.inflate(yogaLayout, null);
174,969
private static InstDBAdapter upgrade(DBHandle dbHandle, AddressMap addrMap, InstDBAdapter oldAdapter, TaskMonitor monitor) throws VersionException, IOException, CancelledException {<NEW_LINE>AddressMap oldAddrMap = addrMap.getOldAddressMap();<NEW_LINE>DBHandle tmpHandle = new DBHandle();<NEW_LINE>try {<NEW_LINE>tmpHandle.startTransaction();<NEW_LINE>monitor.setMessage("Upgrading Instructions...");<NEW_LINE>monitor.initialize(oldAdapter.getRecordCount() * 2);<NEW_LINE>int count = 0;<NEW_LINE>InstDBAdapter tmpAdapter = new InstDBAdapterV1(tmpHandle, addrMap, true);<NEW_LINE>RecordIterator iter = oldAdapter.getRecords();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>DBRecord rec = iter.next();<NEW_LINE>Address addr = oldAddrMap.decodeAddress(rec.getKey());<NEW_LINE>rec.setKey(addrMap.getKey(addr, true));<NEW_LINE>tmpAdapter.putRecord(rec);<NEW_LINE>monitor.setProgress(++count);<NEW_LINE>}<NEW_LINE>dbHandle.deleteTable(INSTRUCTION_TABLE_NAME);<NEW_LINE>InstDBAdapter newAdapter = new <MASK><NEW_LINE>iter = tmpAdapter.getRecords();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>DBRecord rec = iter.next();<NEW_LINE>newAdapter.putRecord(rec);<NEW_LINE>monitor.setProgress(++count);<NEW_LINE>}<NEW_LINE>return newAdapter;<NEW_LINE>} finally {<NEW_LINE>tmpHandle.close();<NEW_LINE>}<NEW_LINE>}
InstDBAdapterV1(dbHandle, addrMap, true);
325,781
public void onClick(View v) {<NEW_LINE>PictureAttributes pictureAttributes = Attributes.createPictureAttributes();<NEW_LINE>pictureAttributes.setHeight(500);<NEW_LINE>pictureAttributes.setWidth(500);<NEW_LINE>pictureAttributes.setType(PictureAttributes.PictureType.SQUARE);<NEW_LINE>Profile.Properties properties = new Profile.Properties.Builder().add(Profile.Properties.PICTURE, pictureAttributes).add(Profile.Properties.FIRST_NAME).add(Profile.Properties.LAST_NAME).build();<NEW_LINE>// SimpleFacebook.getInstance().getProfile(new OnProfileListener() {<NEW_LINE>SimpleFacebook.getInstance().getProfile(properties, new OnProfileListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onThinking() {<NEW_LINE>showDialog();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onException(Throwable throwable) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFail(String reason) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(reason);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(Profile response) {<NEW_LINE>hideDialog();<NEW_LINE>String str = Utils.toHtml(response);<NEW_LINE>mResult.setText(Html.fromHtml(str));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setText(throwable.getMessage());