idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
532,283
public static void save(Properties properties, MetalTheme theme) {<NEW_LINE>log.config(CompiereColor.getDefaultBackground().toString());<NEW_LINE>//<NEW_LINE>properties.setProperty(P_Primary1, getColorAsString(theme.getPrimaryControlDarkShadow()));<NEW_LINE>properties.setProperty(P_Primary2, getColorAsString(theme.getPrimaryControlShadow()));<NEW_LINE>properties.setProperty(P_Primary3, getColorAsString(theme.getPrimaryControl()));<NEW_LINE>properties.setProperty(P_Secondary1, getColorAsString(theme.getControlDarkShadow()));<NEW_LINE>properties.setProperty(P_Secondary2, getColorAsString(theme.getControlShadow()));<NEW_LINE>properties.setProperty(P_Secondary3, getColorAsString(theme.getControl()));<NEW_LINE>properties.setProperty(P_Txt_OK, getColorAsString(theme.getUserTextColor()));<NEW_LINE>if (theme instanceof ExtendedTheme) {<NEW_LINE>ExtendedTheme e = (ExtendedTheme) theme;<NEW_LINE>properties.setProperty(P_Error, getColorAsString(e.getErrorBackground()));<NEW_LINE>properties.setProperty(P_Txt_Error, getColorAsString(e.getErrorForeground()));<NEW_LINE>properties.setProperty(P_Mandatory, getColorAsString(e.getMandatoryBackground()));<NEW_LINE>properties.setProperty(P_Inactive, getColorAsString(e.getInactiveBackground()));<NEW_LINE>properties.setProperty(P_White, getColorAsString<MASK><NEW_LINE>properties.setProperty(P_Black, getColorAsString(e.getBlack()));<NEW_LINE>properties.setProperty(P_Info, getColorAsString(e.getInfoBackground()));<NEW_LINE>} else {<NEW_LINE>properties.setProperty(P_White, getColorAsString(Color.white));<NEW_LINE>properties.setProperty(P_Black, getColorAsString(Color.black));<NEW_LINE>properties.setProperty(P_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_BG));<NEW_LINE>properties.setProperty(P_Txt_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_FG));<NEW_LINE>properties.setProperty(P_Mandatory, getColorAsString(ExtendedTheme.DEFAULT_MANDATORY_BG));<NEW_LINE>properties.setProperty(P_Inactive, getColorAsString(ExtendedTheme.DEFAULT_INACTIVE_BG));<NEW_LINE>properties.setProperty(P_Info, getColorAsString(theme.getPrimaryControl()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>properties.setProperty(P_Control, (theme.getControlTextFont()).toString());<NEW_LINE>properties.setProperty(P_System, (theme.getSystemTextFont()).toString());<NEW_LINE>properties.setProperty(P_User, (theme.getUserTextFont()).toString());<NEW_LINE>properties.setProperty(P_Small, (theme.getSubTextFont()).toString());<NEW_LINE>properties.setProperty(P_Window, (theme.getWindowTitleFont()).toString());<NEW_LINE>properties.setProperty(P_Menu, (theme.getMenuTextFont()).toString());<NEW_LINE>}
(e.getWhite()));
1,429,945
final UpdateUserResult executeUpdateUser(UpdateUserRequest updateUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserRequest> request = null;<NEW_LINE>Response<UpdateUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserRequest));<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, "finspace data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
209,828
Mono<Response<PageBlobItem>> createWithResponse(PageBlobCreateOptions options, Context context) {<NEW_LINE>StorageImplUtils.assertNotNull("options", options);<NEW_LINE>BlobRequestConditions requestConditions = options.getRequestConditions() == null ? new BlobRequestConditions() : options.getRequestConditions();<NEW_LINE>if (options.getSize() % PAGE_BYTES != 0) {<NEW_LINE>// Throwing is preferred to Single.error because this will error out immediately instead of waiting until<NEW_LINE>// subscription.<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("size must be a multiple of PageBlobAsyncClient.PAGE_BYTES."));<NEW_LINE>}<NEW_LINE>if (options.getSequenceNumber() != null && options.getSequenceNumber() < 0) {<NEW_LINE>// Throwing is preferred to Single.error because this will error out immediately instead of waiting until<NEW_LINE>// subscription.<NEW_LINE>throw LOGGER.<MASK><NEW_LINE>}<NEW_LINE>context = context == null ? Context.NONE : context;<NEW_LINE>BlobImmutabilityPolicy immutabilityPolicy = options.getImmutabilityPolicy() == null ? new BlobImmutabilityPolicy() : options.getImmutabilityPolicy();<NEW_LINE>return this.azureBlobStorage.getPageBlobs().createWithResponseAsync(containerName, blobName, 0, options.getSize(), null, null, options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), options.getSequenceNumber(), null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)).map(rb -> {<NEW_LINE>PageBlobsCreateHeaders hd = rb.getDeserializedHeaders();<NEW_LINE>PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), hd.getXMsEncryptionScope(), null, hd.getXMsVersionId());<NEW_LINE>return new SimpleResponse<>(rb, item);<NEW_LINE>});<NEW_LINE>}
logExceptionAsError(new IllegalArgumentException("SequenceNumber must be greater than or equal to 0."));
755,156
public static void main(final String[] args) throws Exception {<NEW_LINE>if (args.length != 2) {<NEW_LINE>System.out.println("Please provide command line arguments: configPath topic");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final String topic = args[1];<NEW_LINE>// Load properties from a local configuration file<NEW_LINE>// Create the configuration file (e.g. at '$HOME/.confluent/java.config') with configuration parameters<NEW_LINE>// to connect to your Kafka cluster, which can be on your local host, Confluent Cloud, or any other cluster.<NEW_LINE>// Follow these instructions to create this file: https://docs.confluent.io/platform/current/tutorials/examples/clients/docs/java.html<NEW_LINE>final Properties props = loadConfig(args[0]);<NEW_LINE>// Add additional properties.<NEW_LINE>props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");<NEW_LINE>props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "io.confluent.kafka.serializers.KafkaJsonDeserializer");<NEW_LINE>props.put(KafkaJsonDeserializerConfig.JSON_VALUE_TYPE, PageviewRecord.class);<NEW_LINE>props.put(ConsumerConfig.GROUP_ID_CONFIG, "demo-cloud-observability-1");<NEW_LINE>props.<MASK><NEW_LINE>// Create consumer<NEW_LINE>final Consumer<String, PageviewRecord> consumer = new KafkaConsumer<String, PageviewRecord>(props);<NEW_LINE>consumer.subscribe(Arrays.asList(topic));<NEW_LINE>// Poll for messages<NEW_LINE>Long total_count = 0L;<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>ConsumerRecords<String, PageviewRecord> records = consumer.poll(100);<NEW_LINE>for (ConsumerRecord<String, PageviewRecord> record : records) {<NEW_LINE>total_count++;<NEW_LINE>if (total_count % 1000 == 0) {<NEW_LINE>System.out.printf("Consumer reached %d, sleep to simulate consumer skip heartbeat", total_count);<NEW_LINE>Thread.sleep(3000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>consumer.close();<NEW_LINE>}<NEW_LINE>}
put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
120,160
public void onException(NestedContainer container, String errCode, String msg) {<NEW_LINE>if (TextUtils.equals(errCode, WXErrorCode.WX_DEGRAD_ERR_NETWORK_BUNDLE_DOWNLOAD_FAILED.getErrorCode()) && container instanceof WXEmbed) {<NEW_LINE>final WXEmbed comp = ((WXEmbed) container);<NEW_LINE>final ImageView imageView = new ImageView(comp.getContext());<NEW_LINE>imageView.setImageResource(R.drawable.weex_error);<NEW_LINE>FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ERROR_IMG_WIDTH, ERROR_IMG_HEIGHT);<NEW_LINE>layoutParams.gravity = Gravity.CENTER;<NEW_LINE>imageView.setLayoutParams(layoutParams);<NEW_LINE>imageView.setScaleType(ImageView.ScaleType.FIT_XY);<NEW_LINE>imageView.setAdjustViewBounds(true);<NEW_LINE>imageView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>imageView.setOnClickListener(null);<NEW_LINE>imageView.setEnabled(false);<NEW_LINE>comp.loadContent();<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>hostView.removeAllViews();<NEW_LINE>hostView.addView(imageView);<NEW_LINE>WXLogUtils.e("WXEmbed", "NetWork failure :" + errCode + ",\n error message :" + msg);<NEW_LINE>}<NEW_LINE>}
FrameLayout hostView = comp.getHostView();
863,431
public void init(Properties props) {<NEW_LINE>_port = (<MASK><NEW_LINE>_zkStr = props.getProperty(ZOOKEEPER_CONNECT);<NEW_LINE>_logDirPath = props.getProperty(LOG_DIRS);<NEW_LINE>// Create the ZK nodes for Kafka, if needed<NEW_LINE>int indexOfFirstSlash = _zkStr.indexOf('/');<NEW_LINE>if (indexOfFirstSlash != -1) {<NEW_LINE>String bareZkUrl = _zkStr.substring(0, indexOfFirstSlash);<NEW_LINE>String zkNodePath = _zkStr.substring(indexOfFirstSlash);<NEW_LINE>ZkClient client = new ZkClient(bareZkUrl);<NEW_LINE>client.createPersistent(zkNodePath, true);<NEW_LINE>client.close();<NEW_LINE>}<NEW_LINE>File logDir = new File(_logDirPath);<NEW_LINE>logDir.mkdirs();<NEW_LINE>props.put("zookeeper.session.timeout.ms", "60000");<NEW_LINE>_serverStartable = new KafkaServer(new KafkaConfig(props), Time.SYSTEM, Option.empty(), false);<NEW_LINE>final Map<String, Object> config = new HashMap<>();<NEW_LINE>config.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + _port);<NEW_LINE>config.put(AdminClientConfig.CLIENT_ID_CONFIG, "Kafka2AdminClient-" + UUID.randomUUID().toString());<NEW_LINE>config.put(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, 15000);<NEW_LINE>_adminClient = KafkaAdminClient.create(config);<NEW_LINE>}
int) props.get(PORT);
161,764
public static JsonNode readYamlTree(String contents, ParseOptions parseOptions, SwaggerParseResult deserializationUtilsResult) {<NEW_LINE>if (parseOptions != null && parseOptions.isLegacyYamlDeserialization()) {<NEW_LINE>org.yaml.snakeyaml.Yaml yaml = new org.yaml.snakeyaml.Yaml(new SafeConstructor());<NEW_LINE>return Json.mapper().convertValue(yaml.load(contents), JsonNode.class);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>org.yaml.snakeyaml.Yaml yaml = null;<NEW_LINE>if (options.isValidateYamlInput()) {<NEW_LINE>yaml = buildSnakeYaml(new CustomSnakeYamlConstructor());<NEW_LINE>} else {<NEW_LINE>yaml = buildSnakeYaml(new SafeConstructor());<NEW_LINE>}<NEW_LINE>Object o = yaml.load(contents);<NEW_LINE>if (options.isValidateYamlInput()) {<NEW_LINE>boolean res = exceedsLimits(o, null, new Integer(0), new IdentityHashMap<Object, Long>(), deserializationUtilsResult);<NEW_LINE>if (res) {<NEW_LINE>LOGGER.warn("Error converting snake-parsed yaml to JsonNode");<NEW_LINE>return Yaml.mapper().readTree(contents);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String objAsJsonStr = JSON_MAPPER_FOR_YAML.writeValueAsString(o);<NEW_LINE>return JSON_MAPPER_FOR_YAML.readTree(objAsJsonStr);<NEW_LINE>} catch (Exception e) {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>return Json.mapper().<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOGGER.warn("Error snake-parsing yaml content", e);<NEW_LINE>if (deserializationUtilsResult != null) {<NEW_LINE>deserializationUtilsResult.message(e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return Yaml.mapper().readTree(contents);<NEW_LINE>} catch (Exception ee) {<NEW_LINE>LOGGER.error("Error parsing content", ee);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
convertValue(o, JsonNode.class);
800,623
Mono<Response<ReleaseKeyResult>> releaseKeyWithResponse(String name, String version, String targetAttestationToken, ReleaseKeyOptions releaseKeyOptions, Context context) {<NEW_LINE>try {<NEW_LINE>if (CoreUtils.isNullOrEmpty(name)) {<NEW_LINE>return monoError(logger, new IllegalArgumentException("'name' cannot be null or empty"));<NEW_LINE>}<NEW_LINE>if (CoreUtils.isNullOrEmpty(targetAttestationToken)) {<NEW_LINE>return monoError(logger, new IllegalArgumentException("'targetAttestationToken' cannot be null or empty"));<NEW_LINE>}<NEW_LINE>releaseKeyOptions = releaseKeyOptions == null ? new ReleaseKeyOptions() : releaseKeyOptions;<NEW_LINE>KeyReleaseParameters keyReleaseParameters = new KeyReleaseParameters().setTargetAttestationToken(targetAttestationToken).setAlgorithm(releaseKeyOptions.getAlgorithm()).setNonce(releaseKeyOptions.getNonce());<NEW_LINE>return service.release(vaultUrl, name, version, keyServiceVersion.getVersion(), keyReleaseParameters, "application/json", context.addData(AZ_TRACING_NAMESPACE_KEY, KEYVAULT_TRACING_NAMESPACE_VALUE)).doOnRequest(ignored -> logger.verbose("Releasing key with name %s and version %s.", name, version)).doOnSuccess(response -> logger.verbose("Released key with name %s and version %s.", name, version)).doOnError(error -> logger<MASK><NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>return monoError(logger, e);<NEW_LINE>}<NEW_LINE>}
.warning("Failed to release key - {}", error));
1,270,348
private boolean handleRoute(boolean checkFirstRoute, SipServletRequestImpl request, String route, SipApplicationRouterInfo appInfo) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceEntry(this, "handleRoute", new Object[] { checkFirstRoute, request, route, appInfo });<NEW_LINE>}<NEW_LINE>Address routeAddress = null;<NEW_LINE>SipURIImpl sipRouteUri = null;<NEW_LINE>try {<NEW_LINE>SipFactory sipFactory = SipServletsFactoryImpl.getInstance();<NEW_LINE>routeAddress = sipFactory.createAddress(route);<NEW_LINE>if (!(routeAddress.getURI() instanceof SipURIImpl)) {<NEW_LINE>throw new IllegalArgumentException("Application router info is invalid. Route doesn't contain valid SIP URI " + routeAddress);<NEW_LINE>}<NEW_LINE>sipRouteUri = (SipURIImpl) routeAddress.getURI();<NEW_LINE>if (checkFirstRoute) {<NEW_LINE>return handleFirstRoute(sipRouteUri, request, routeAddress);<NEW_LINE>}<NEW_LINE>// If first route was external, all routes (including other internals), needs to be pushed<NEW_LINE>request.pushRoute(sipRouteUri);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "handleRoute", "External Route: " + sipRouteUri + " pushed to top route of request callID=" + request.getCallId() + ", method= " + request.getMethod() + ", request object= \n" + this);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (ServletParseException e) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "handleRoute", "Unable to construct URI from the route URI string " + sipRouteUri);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "handleRoute");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
throw new IllegalArgumentException("Application router info is invalid. Route doesn't contain valid SIP URI " + routeAddress);
674,415
public void internalReceiveCommand(String itemName, Command command) {<NEW_LINE>Set<String> usedKeys = new HashSet<String>();<NEW_LINE>for (ComfoAirBindingProvider provider : providers) {<NEW_LINE>usedKeys.addAll(provider.getConfiguredKeys());<NEW_LINE>}<NEW_LINE>for (ComfoAirBindingProvider provider : providers) {<NEW_LINE>String eventType = provider.getConfiguredKeyForItem(itemName);<NEW_LINE>ComfoAirCommand changeCommand = ComfoAirCommandType.getChangeCommand<MASK><NEW_LINE>if (changeCommand != null) {<NEW_LINE>sendCommand(changeCommand);<NEW_LINE>} else {<NEW_LINE>logger.debug("Failure while creating COMMAND: {} assigned to the ITEM: {}", command, itemName);<NEW_LINE>}<NEW_LINE>Collection<ComfoAirCommand> affectedReadCommands = ComfoAirCommandType.getAffectedReadCommands(eventType, usedKeys);<NEW_LINE>if (affectedReadCommands.size() > 0) {<NEW_LINE>// refresh 3 seconds later all affected items<NEW_LINE>Runnable updateThread = new AffectedItemsUpdateThread(affectedReadCommands);<NEW_LINE>scheduler.schedule(updateThread, 3, TimeUnit.SECONDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(eventType, (DecimalType) command);
69,671
private void fillHorizontalEdge(Picture pic, int comp, int mbAddr, int[][] bs) {<NEW_LINE>SliceHeader sh = di.shs[mbAddr];<NEW_LINE>int mbWidth = sh.sps.picWidthInMbsMinus1 + 1;<NEW_LINE>int alpha = sh.sliceAlphaC0OffsetDiv2 << 1;<NEW_LINE><MASK><NEW_LINE>int mbX = mbAddr % mbWidth;<NEW_LINE>int mbY = mbAddr / mbWidth;<NEW_LINE>boolean topAvailable = mbY > 0 && (sh.disableDeblockingFilterIdc != 2 || di.shs[mbAddr - mbWidth] == sh);<NEW_LINE>int curQp = di.mbQps[comp][mbAddr];<NEW_LINE>int cW = 2 - pic.getColor().compWidth[comp];<NEW_LINE>int cH = 2 - pic.getColor().compHeight[comp];<NEW_LINE>if (topAvailable) {<NEW_LINE>int topQp = di.mbQps[comp][mbAddr - mbWidth];<NEW_LINE>int avgQp = (topQp + curQp + 1) >> 1;<NEW_LINE>for (int blkX = 0; blkX < 4; blkX++) {<NEW_LINE>int thisBlkX = (mbX << 2) + blkX;<NEW_LINE>int thisBlkY = (mbY << 2);<NEW_LINE>filterBlockEdgeHoris(pic, comp, thisBlkX << cW, thisBlkY << cH, getIdxAlpha(alpha, avgQp), getIdxBeta(beta, avgQp), bs[0][blkX], 1 << cW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean skip4x4 = comp == 0 && di.tr8x8Used[mbAddr] || cH == 1;<NEW_LINE>for (int blkY = 1; blkY < 4; blkY++) {<NEW_LINE>if (skip4x4 && (blkY & 1) == 1)<NEW_LINE>continue;<NEW_LINE>for (int blkX = 0; blkX < 4; blkX++) {<NEW_LINE>int thisBlkX = (mbX << 2) + blkX;<NEW_LINE>int thisBlkY = (mbY << 2) + blkY;<NEW_LINE>filterBlockEdgeHoris(pic, comp, thisBlkX << cW, thisBlkY << cH, getIdxAlpha(alpha, curQp), getIdxBeta(beta, curQp), bs[blkY][blkX], 1 << cW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int beta = sh.sliceBetaOffsetDiv2 << 1;
914,059
public void writeExcel() throws IOException {<NEW_LINE>Workbook workbook = new XSSFWorkbook();<NEW_LINE>try {<NEW_LINE>Sheet sheet = workbook.createSheet("Persons");<NEW_LINE>sheet.setColumnWidth(0, 6000);<NEW_LINE>sheet.setColumnWidth(1, 4000);<NEW_LINE>Row header = sheet.createRow(0);<NEW_LINE>CellStyle headerStyle = workbook.createCellStyle();<NEW_LINE>headerStyle.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());<NEW_LINE>headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);<NEW_LINE>XSSFFont font = ((XSSFWorkbook) workbook).createFont();<NEW_LINE>font.setFontName("Arial");<NEW_LINE>font.setFontHeightInPoints((short) 16);<NEW_LINE>font.setBold(true);<NEW_LINE>headerStyle.setFont(font);<NEW_LINE>Cell <MASK><NEW_LINE>headerCell.setCellValue("Name");<NEW_LINE>headerCell.setCellStyle(headerStyle);<NEW_LINE>headerCell = header.createCell(1);<NEW_LINE>headerCell.setCellValue("Age");<NEW_LINE>headerCell.setCellStyle(headerStyle);<NEW_LINE>CellStyle style = workbook.createCellStyle();<NEW_LINE>style.setWrapText(true);<NEW_LINE>Row row = sheet.createRow(2);<NEW_LINE>Cell cell = row.createCell(0);<NEW_LINE>cell.setCellValue("John Smith");<NEW_LINE>cell.setCellStyle(style);<NEW_LINE>cell = row.createCell(1);<NEW_LINE>cell.setCellValue(20);<NEW_LINE>cell.setCellStyle(style);<NEW_LINE>File currDir = new File(".");<NEW_LINE>String path = currDir.getAbsolutePath();<NEW_LINE>String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";<NEW_LINE>FileOutputStream outputStream = new FileOutputStream(fileLocation);<NEW_LINE>workbook.write(outputStream);<NEW_LINE>} finally {<NEW_LINE>if (workbook != null) {<NEW_LINE>workbook.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
headerCell = header.createCell(0);
17,079
public <T extends Object> T load(T keyObject, DynamoDBMapperConfig config) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Class<T> clazz = (Class<<MASK><NEW_LINE>config = mergeConfig(config);<NEW_LINE>final ItemConverter converter = getConverter(config);<NEW_LINE>final String tableName = getTableName(clazz, keyObject, config);<NEW_LINE>final GetItemRequest rq = new GetItemRequest().withRequestMetricCollector(config.getRequestMetricCollector());<NEW_LINE>final Map<String, AttributeValue> key = getKey(converter, keyObject, clazz);<NEW_LINE>rq.setKey(key);<NEW_LINE>rq.setTableName(tableName);<NEW_LINE>rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);<NEW_LINE>final GetItemResult item = db.getItem(applyUserAgent(rq));<NEW_LINE>final Map<String, AttributeValue> itemAttributes = item.getItem();<NEW_LINE>if (itemAttributes == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final T object = privateMarshallIntoObject(converter, toParameters(itemAttributes, clazz, tableName, config));<NEW_LINE>return object;<NEW_LINE>}
T>) keyObject.getClass();
725,996
protected void createMapViews() {<NEW_LINE>mapView = getMapView();<NEW_LINE>mapView.getModel().frameBufferModel.setOverdrawFactor(1.0d);<NEW_LINE>mapView.getModel().init(this.preferencesFacade);<NEW_LINE>// Use external scale bar<NEW_LINE>mapView.getMapScaleBar().setVisible(false);<NEW_LINE>MapScaleBarImpl mapScaleBar = new MapScaleBarImpl(mapView.getModel().mapViewPosition, mapView.getModel().mapViewDimension, AndroidGraphicFactory.INSTANCE, <MASK><NEW_LINE>mapScaleBar.setVisible(true);<NEW_LINE>mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);<NEW_LINE>mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);<NEW_LINE>mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);<NEW_LINE>MapScaleBarView mapScaleBarView = (MapScaleBarView) findViewById(R.id.mapScaleBarView);<NEW_LINE>mapScaleBarView.setMapScaleBar(mapScaleBar);<NEW_LINE>mapView.getModel().mapViewPosition.addObserver(mapScaleBarView);<NEW_LINE>mapView.setBuiltInZoomControls(hasZoomControls());<NEW_LINE>mapView.getMapZoomControls().setZoomLevelMin(getZoomLevelMin());<NEW_LINE>mapView.getMapZoomControls().setZoomLevelMax(getZoomLevelMax());<NEW_LINE>initializePosition(mapView.getModel().mapViewPosition);<NEW_LINE>}
mapView.getModel().displayModel);
939,640
public void run(RegressionEnvironment env) {<NEW_LINE>// test single-event return<NEW_LINE>String[] fieldsSingleEvent = "c0,c1,c2,c3,c4".split(",");<NEW_LINE>String eplSingleEvent = "@name('s0') select " + "se1() as c0, " + "se1().allOf(v => v.theString = 'E1') as c1, " <MASK><NEW_LINE>env.compileDeploy(eplSingleEvent).addListener("s0");<NEW_LINE>Object[][] expectedSingleEvent = new Object[][] { { "c0", SupportBean.class, SupportBean.class.getName(), false }, { "c1", Boolean.class, null, null }, { "c2", Boolean.class, null, null }, { "c3", String.class, null, null }, { "c4", Integer.class, null, null } };<NEW_LINE>env.assertStatement("s0", statement -> SupportEventTypeAssertionUtil.assertEventTypeProperties(expectedSingleEvent, statement.getEventType(), SupportEventTypeAssertionEnum.getSetWithFragment()));<NEW_LINE>SupportBean eventOne = new SupportBean("E1", 1);<NEW_LINE>env.sendEventBean(eventOne);<NEW_LINE>env.assertPropsNew("s0", fieldsSingleEvent, new Object[] { eventOne, true, true, "E1", 1 });<NEW_LINE>env.milestone(0);<NEW_LINE>SupportBean eventTwo = new SupportBean("E2", 2);<NEW_LINE>env.sendEventBean(eventTwo);<NEW_LINE>env.assertPropsNew("s0", fieldsSingleEvent, new Object[] { eventTwo, false, false, "E2", 2 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
+ "se1().allOf(v => v.intPrimitive = 1) as c2, " + "se1().theString as c3, " + "se1().intPrimitive as c4 " + "from SupportBean";
758,745
private JCMethodDecl generateCleanMethod(BuilderJob job) {<NEW_LINE>JavacTreeMaker maker = job.getTreeMaker();<NEW_LINE>ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();<NEW_LINE>for (BuilderFieldData bfd : job.builderFields) {<NEW_LINE>if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) {<NEW_LINE>bfd.singularData.getSingularizer().appendCleaningCode(bfd.singularData, job.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>statements.append(maker.Exec(maker.Assign(maker.Select(maker.Ident(job.toName("this")), job.toName(CLEAN_FIELD_NAME)), maker.Literal(CTC_BOOLEAN, 0))));<NEW_LINE>JCBlock body = maker.Block(0, statements.toList());<NEW_LINE>JCMethodDecl method = maker.MethodDef(maker.Modifiers(toJavacModifier(AccessLevel.PRIVATE)), job.toName(CLEAN_METHOD_NAME), maker.Type(Javac.createVoidType(job.builderType.getSymbolTable(), CTC_VOID)), List.<JCTypeParameter>nil(), List.<JCVariableDecl>nil(), List.<JCExpression>nil(), body, null);<NEW_LINE>recursiveSetGeneratedBy(method, job.sourceNode);<NEW_LINE>return method;<NEW_LINE>}
builderType, job.sourceNode, statements);
589,560
public static void save(Collection<? extends CallSiteDescriptor> descriptors, AnnotationContainer annotations) {<NEW_LINE>List<AnnotationValue> descriptorsValue = new ArrayList<>();<NEW_LINE>for (CallSiteDescriptor descriptor : descriptors) {<NEW_LINE>AnnotationHolder descriptorAnnot = new AnnotationHolder(CallSiteDescriptorAnnot.class.getName());<NEW_LINE>descriptorAnnot.getValues().put("id", new AnnotationValue(descriptor.id));<NEW_LINE>descriptorAnnot.getValues().put("location", new AnnotationValue(CallSiteLocation.saveMany(Arrays.asList(descriptor.locations))));<NEW_LINE>List<AnnotationValue> handlersValue = descriptor.handlers.stream().map(h -> new AnnotationValue(h.save())).collect(Collectors.toList());<NEW_LINE>descriptorAnnot.getValues().put("handlers", new AnnotationValue(handlersValue));<NEW_LINE>descriptorsValue.<MASK><NEW_LINE>}<NEW_LINE>AnnotationHolder descriptorsAnnot = new AnnotationHolder(CallSiteDescriptorsAnnot.class.getName());<NEW_LINE>descriptorsAnnot.getValues().put("value", new AnnotationValue(descriptorsValue));<NEW_LINE>annotations.add(descriptorsAnnot);<NEW_LINE>}
add(new AnnotationValue(descriptorAnnot));
463,897
public void build(Task<Void> task) throws CompileExceptionError, IOException {<NEW_LINE>IResource input = task.getInputs().get(0);<NEW_LINE>PrototypeDesc.Builder protoBuilder = loadPrototype(input);<NEW_LINE>for (ComponentDesc c : protoBuilder.getComponentsList()) {<NEW_LINE>String component = c.getComponent();<NEW_LINE>BuilderUtil.checkResource(this.project, input, "component", component);<NEW_LINE>}<NEW_LINE>for (EmbeddedComponentDesc ec : protoBuilder.getEmbeddedComponentsList()) {<NEW_LINE>if (ec.getId().length() == 0) {<NEW_LINE>throw new CompileExceptionError(input, 0, "missing required field 'id'");<NEW_LINE>}<NEW_LINE>byte[] data = ec.getData().getBytes();<NEW_LINE>long hash = MurmurHash.hash64(data, data.length);<NEW_LINE>IResource genResource = project.getGeneratedResource(<MASK><NEW_LINE>// TODO: We have to set content again here as distclean might have removed everything at this point (according to CollectionBuilder.java)<NEW_LINE>genResource.setContent(data);<NEW_LINE>int buildDirLen = project.getBuildDirectory().length();<NEW_LINE>String path = genResource.getPath().substring(buildDirLen);<NEW_LINE>ComponentDesc c = ComponentDesc.newBuilder().setId(ec.getId()).setPosition(ec.getPosition()).setRotation(ec.getRotation()).setComponent(path).build();<NEW_LINE>protoBuilder.addComponents(c);<NEW_LINE>}<NEW_LINE>protoBuilder = transformGo(input, protoBuilder);<NEW_LINE>protoBuilder.clearEmbeddedComponents();<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream(4 * 1024);<NEW_LINE>PrototypeDesc proto = protoBuilder.build();<NEW_LINE>proto.writeTo(out);<NEW_LINE>out.close();<NEW_LINE>task.output(0).setContent(out.toByteArray());<NEW_LINE>}
hash, ec.getType());
351,605
private void updateData() {<NEW_LINE>progressBar.setVisibility(View.VISIBLE);<NEW_LINE>contentView.setVisibility(View.GONE);<NEW_LINE>XTokenManager.getInstance().requestSessions(accountItem.getConnectionSettings().getXToken().getUid(), accountItem.getConnection(), new XTokenManager.SessionsListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResult(SessionVO currentSession, List<SessionVO> sessions) {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE><MASK><NEW_LINE>setCurrentSession(currentSession);<NEW_LINE>adapter.setItems(sessions);<NEW_LINE>terminateAll.setVisibility(sessions.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>tvActiveSessions.setVisibility(sessions.isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError() {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>Toast.makeText(ActiveSessionsActivity.this, R.string.account_active_sessions_error, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
contentView.setVisibility(View.VISIBLE);
355,204
private Map<JobId, List<Job>> jobsToRun(Map<InstanceName, Change> changes, boolean eagerTests) {<NEW_LINE>Map<JobId, List<Job>> productionJobs = new LinkedHashMap<>();<NEW_LINE>changes.forEach((instance, change) -> productionJobs.putAll(productionJobs(instance, change, eagerTests)));<NEW_LINE>Map<JobId, List<Job>> testJobs = testJobs(productionJobs);<NEW_LINE>Map<JobId, List<Job>> jobs = new LinkedHashMap<>(testJobs);<NEW_LINE>jobs.putAll(productionJobs);<NEW_LINE>// Add runs for idle, declared test jobs if they have no successes on their instance's change's versions.<NEW_LINE>jobSteps.forEach((job, step) -> {<NEW_LINE>if (!step.isDeclared() || job.type().isProduction() || jobs.containsKey(job))<NEW_LINE>return;<NEW_LINE>Change change = changes.get(job.application().instance());<NEW_LINE>if (change == null || !change.hasTargets())<NEW_LINE>return;<NEW_LINE>Optional<JobId> firstProductionJobWithDeployment = jobSteps.keySet().stream().filter(jobId -> jobId.type().isProduction() && jobId.type().isDeployment()).filter(jobId -> deploymentFor(jobId).isPresent()).findFirst();<NEW_LINE>Versions versions = Versions.from(change, application, firstProductionJobWithDeployment.flatMap(this::deploymentFor), systemVersion);<NEW_LINE>if (step.completedAt(change, Optional.empty()).isEmpty())<NEW_LINE>jobs.merge(job, List.of(new Job(job.type(), versions, step.readyAt(change), <MASK><NEW_LINE>});<NEW_LINE>return Collections.unmodifiableMap(jobs);<NEW_LINE>}
change)), DeploymentStatus::union);
125,421
public synchronized void addVariable(String deploymentId, VariableMetaData metaData, String optionalDeploymentIdContext, DataInputOutputSerde optionalSerde) {<NEW_LINE>// check if already exists<NEW_LINE>VariableDeployment deploymentEntry = deploymentsWithVariables.get(deploymentId);<NEW_LINE>if (deploymentEntry != null) {<NEW_LINE>Variable variable = deploymentEntry.getVariable(metaData.getVariableName());<NEW_LINE>if (variable != null) {<NEW_LINE>throw new IllegalArgumentException("Variable already exists by name '" + metaData.getVariableName() + "' and deployment '" + deploymentId + "'");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>deploymentEntry = new VariableDeployment();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// find empty spot<NEW_LINE>int emptySpot = -1;<NEW_LINE>int count = 0;<NEW_LINE>for (Map<Integer, VariableReader> entry : variableVersionsPerCP) {<NEW_LINE>if (entry == null) {<NEW_LINE>emptySpot = count;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>int variableNumber;<NEW_LINE>if (emptySpot != -1) {<NEW_LINE>variableNumber = emptySpot;<NEW_LINE>variableVersionsPerCP.set(emptySpot, new ConcurrentHashMap<>());<NEW_LINE>changeCallbacksPerCP.set(emptySpot, null);<NEW_LINE>} else {<NEW_LINE>variableNumber = currentVariableNumber;<NEW_LINE>variableVersionsPerCP.add(new ConcurrentHashMap<>());<NEW_LINE>changeCallbacksPerCP.add(null);<NEW_LINE>currentVariableNumber++;<NEW_LINE>}<NEW_LINE>Variable variable = new Variable(variableNumber, deploymentId, metaData, optionalDeploymentIdContext);<NEW_LINE>deploymentEntry.addVariable(metaData.getVariableName(), variable);<NEW_LINE>if (optionalStateHandler != null && !metaData.isConstant()) {<NEW_LINE>optionalStateHandler.addVariable(deploymentId, metaData.getVariableName(), variable, optionalSerde);<NEW_LINE>}<NEW_LINE>}
deploymentsWithVariables.put(deploymentId, deploymentEntry);
719,638
private Mono<Response<Flux<ByteBuffer>>> replaceAllWithResponseAsync(String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (request == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>request.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.replaceAll(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, workspaceName, request, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
393,591
public static void downloadCodeFromBlobStore(Map conf, String localRoot, String topologyId) throws IOException, KeyNotFoundException {<NEW_LINE>ClientBlobStore blobStore = BlobStoreUtils.getClientBlobStoreForSupervisor(conf);<NEW_LINE>FileUtils.forceMkdir(new File(localRoot));<NEW_LINE>String localStormJarPath = StormConfig.stormjar_path(localRoot);<NEW_LINE>String masterStormJarKey = StormConfig.master_stormjar_key(topologyId);<NEW_LINE>BlobStoreUtils.downloadResourcesAsSupervisor(masterStormJarKey, localStormJarPath, blobStore, conf);<NEW_LINE>String localStormCodePath = StormConfig.stormcode_path(localRoot);<NEW_LINE>String masterStormCodeKey = StormConfig.master_stormcode_key(topologyId);<NEW_LINE>BlobStoreUtils.downloadResourcesAsSupervisor(masterStormCodeKey, localStormCodePath, blobStore, conf);<NEW_LINE>String localStormConfPath = StormConfig.stormconf_path(localRoot);<NEW_LINE>String <MASK><NEW_LINE>BlobStoreUtils.downloadResourcesAsSupervisor(masterStormConfKey, localStormConfPath, blobStore, conf);<NEW_LINE>Map stormConf = (Map) StormConfig.readLocalObject(topologyId, localStormConfPath);<NEW_LINE>if (stormConf == null)<NEW_LINE>throw new IOException("Get topology conf error: " + topologyId);<NEW_LINE>List<String> libs = (List<String>) stormConf.get(GenericOptionsParser.TOPOLOGY_LIB_NAME);<NEW_LINE>if (libs != null) {<NEW_LINE>for (String libName : libs) {<NEW_LINE>String localStormLibPath = StormConfig.stormlib_path(localRoot, libName);<NEW_LINE>String masterStormLibKey = StormConfig.master_stormlib_key(topologyId, libName);<NEW_LINE>// make sure the parent lib dir is exist<NEW_LINE>new File(localStormLibPath).getParentFile().mkdir();<NEW_LINE>BlobStoreUtils.downloadResourcesAsSupervisor(masterStormLibKey, localStormLibPath, blobStore, conf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>blobStore.shutdown();<NEW_LINE>}
masterStormConfKey = StormConfig.master_stormconf_key(topologyId);
100,166
public void startElement(String uri, String localName, String qName, Attributes elementAttributes) throws SAXException {<NEW_LINE>tag = qName.trim();<NEW_LINE>if (ENTRY_ELEMENT_NAME.equals(qName)) {<NEW_LINE>values = new HashMap<String, String>();<NEW_LINE>String path = elementAttributes.getValue(PATH_ATTRIBUTE);<NEW_LINE>path = Paths.get(path).toAbsolutePath().normalize().toString();<NEW_LINE>values.put(PATH_ATTRIBUTE, path);<NEW_LINE>} else if (WC_ST_ELEMENT_NAME.equals(qName)) {<NEW_LINE>values.put(WC_ITEM_ATTR, elementAttributes.getValue(ITEM_ATTRIBUTE));<NEW_LINE>values.put(WC_PROPS_ATTR, elementAttributes.getValue(PROPS_ATTRIBUTE));<NEW_LINE>values.put(WC_REVISION_ATTR, elementAttributes.getValue(REVISION_ATTRIBUTE));<NEW_LINE>values.put(WC_LOCKED_ATTR, elementAttributes.getValue(WC_LOCKED_ATTRIBUTE));<NEW_LINE>values.put(WC_COPIED_ATTR<MASK><NEW_LINE>values.put(WC_SWITCHED_ATTR, elementAttributes.getValue(SWITCHED_ATTRIBUTE));<NEW_LINE>values.put(WC_TREE_CONFLICT_ATTR, elementAttributes.getValue(TREE_CONFLICT_ATTRIBUTE));<NEW_LINE>} else if (REPO_ST_ELEMENT_NAME.equals(qName)) {<NEW_LINE>values.put(REPO_ITEM_ATTR, elementAttributes.getValue(ITEM_ATTRIBUTE));<NEW_LINE>values.put(REPO_PROPS_ATTR, elementAttributes.getValue(PROPS_ATTRIBUTE));<NEW_LINE>} else if (COMMIT_ELEMENT_NAME.equals(qName)) {<NEW_LINE>values.put(CI_REVISION_ATTR, elementAttributes.getValue(REVISION_ATTRIBUTE));<NEW_LINE>}<NEW_LINE>if (values != null) {<NEW_LINE>values.put(tag, "");<NEW_LINE>}<NEW_LINE>}
, elementAttributes.getValue(COPIED_ATTRIBUTE));
1,752,350
protected <E extends Entity> void handleSelectionWithField(@SuppressWarnings("unused") LookupBuilder<E> builder, HasValue<E> field, Collection<E> itemsFromLookup) {<NEW_LINE>if (itemsFromLookup.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<E> <MASK><NEW_LINE>Entity newValue = selectedItems.iterator().next();<NEW_LINE>View viewForField = clientConfig.getReloadUnfetchedAttributesFromLookupScreens() && metadataTools.isPersistent(newValue.getClass()) ? getViewForField(field) : null;<NEW_LINE>if (viewForField != null && !entityStates.isLoadedWithView(newValue, viewForField)) {<NEW_LINE>newValue = dataManager.reload(newValue, viewForField);<NEW_LINE>}<NEW_LINE>if (field instanceof LookupPickerField) {<NEW_LINE>LookupPickerField lookupPickerField = (LookupPickerField) field;<NEW_LINE>Options options = lookupPickerField.getOptions();<NEW_LINE>if (options instanceof EntityOptions) {<NEW_LINE>EntityOptions entityOptions = (EntityOptions) options;<NEW_LINE>if (entityOptions.containsItem(newValue)) {<NEW_LINE>entityOptions.updateItem(newValue);<NEW_LINE>}<NEW_LINE>if (lookupPickerField.isRefreshOptionsOnLookupClose()) {<NEW_LINE>entityOptions.refresh();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// In case of PickerField set the value as if the user had set it<NEW_LINE>if (field instanceof SupportsUserAction) {<NEW_LINE>((SupportsUserAction<E>) field).setValueFromUser((E) newValue);<NEW_LINE>} else {<NEW_LINE>field.setValue((E) newValue);<NEW_LINE>}<NEW_LINE>}
selectedItems = transform(itemsFromLookup, builder);
1,323,239
public static void normalize() {<NEW_LINE>if (getDebugLookahead() && !getDebugParser()) {<NEW_LINE>if (cmdLineSetting.contains(USEROPTION__DEBUG_PARSER) || inputFileSetting.contains(USEROPTION__DEBUG_PARSER)) {<NEW_LINE>JavaCCErrors.warning("True setting of option DEBUG_LOOKAHEAD overrides " + "false setting of option DEBUG_PARSER.");<NEW_LINE>}<NEW_LINE>optionValues.put(USEROPTION__DEBUG_PARSER, Boolean.TRUE);<NEW_LINE>}<NEW_LINE>// Now set the "GENERATE" options from the supplied (or default) JDK<NEW_LINE>// version.<NEW_LINE>optionValues.put(USEROPTION__GENERATE_CHAINED_EXCEPTION, Boolean.valueOf(jdkVersionAtLeast(1.4)));<NEW_LINE>optionValues.put(USEROPTION__GENERATE_GENERICS, Boolean.<MASK><NEW_LINE>optionValues.put(USEROPTION__GENERATE_STRING_BUILDER, Boolean.valueOf(jdkVersionAtLeast(1.5)));<NEW_LINE>optionValues.put(USEROPTION__GENERATE_ANNOTATIONS, Boolean.valueOf(jdkVersionAtLeast(1.5)));<NEW_LINE>}
valueOf(jdkVersionAtLeast(1.5)));
480,571
final DescribeEventsResult executeDescribeEvents(DescribeEventsRequest describeEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEventsRequest> request = null;<NEW_LINE>Response<DescribeEventsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEventsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEventsRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEventsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEventsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,096,920
private Properties needBrokerProprties(Properties properties) {<NEW_LINE>Properties newProperties = new Properties();<NEW_LINE>newProperties.setProperty("brokerClusterName", properties.getProperty("brokerClusterName"));<NEW_LINE>newProperties.setProperty("brokerId", properties.getProperty("brokerId"));<NEW_LINE>newProperties.setProperty("brokerName", properties.getProperty("brokerName"));<NEW_LINE>newProperties.setProperty("brokerRole", properties.getProperty("brokerRole"));<NEW_LINE>newProperties.setProperty("fileReservedTime", properties.getProperty("fileReservedTime"));<NEW_LINE>newProperties.setProperty("filterServerNums"<MASK><NEW_LINE>newProperties.setProperty("flushDiskType", properties.getProperty("flushDiskType"));<NEW_LINE>newProperties.setProperty("maxMessageSize", properties.getProperty("maxMessageSize"));<NEW_LINE>newProperties.setProperty("messageDelayLevel", properties.getProperty("messageDelayLevel"));<NEW_LINE>newProperties.setProperty("msgTraceTopicName", properties.getProperty("msgTraceTopicName"));<NEW_LINE>newProperties.setProperty("slaveReadEnable", properties.getProperty("slaveReadEnable"));<NEW_LINE>newProperties.setProperty("traceOn", properties.getProperty("traceOn"));<NEW_LINE>newProperties.setProperty("traceTopicEnable", properties.getProperty("traceTopicEnable"));<NEW_LINE>newProperties.setProperty("useTLS", properties.getProperty("useTLS"));<NEW_LINE>newProperties.setProperty("autoCreateTopicEnable", properties.getProperty("autoCreateTopicEnable"));<NEW_LINE>newProperties.setProperty("autoCreateSubscriptionGroup", properties.getProperty("autoCreateSubscriptionGroup"));<NEW_LINE>return newProperties;<NEW_LINE>}
, properties.getProperty("filterServerNums"));
365,989
private boolean ungrabWindowFX(ThreadReference tr) {<NEW_LINE>// javafx.stage.Window.impl_getWindows() - Iterator<Window><NEW_LINE>// while (iterator.hasNext()) {<NEW_LINE>// Window w = iterator.next();<NEW_LINE>// ungrabWindowFX(w);<NEW_LINE>// }<NEW_LINE>try {<NEW_LINE>VirtualMachine vm = MirrorWrapper.virtualMachine(tr);<NEW_LINE>List<ReferenceType> windowClassesByName = VirtualMachineWrapper.classesByName(vm, "javafx.stage.Window");<NEW_LINE>if (windowClassesByName.isEmpty()) {<NEW_LINE>logger.info("Unable to release FX X grab, no javafx.stage.Window class in target VM " + VirtualMachineWrapper.description(vm));<NEW_LINE>// We do not know whether there was any grab<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ClassType WindowClass = (ClassType) windowClassesByName.get(0);<NEW_LINE>Method getWindowsMethod = WindowClass.concreteMethodByName("impl_getWindows", "()Ljava/util/Iterator;");<NEW_LINE>if (getWindowsMethod == null) {<NEW_LINE>logger.info("Unable to release FX X grab, no impl_getWindows() method in " + WindowClass);<NEW_LINE>// We do not know whether there was any grab<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ObjectReference windowsIterator = (ObjectReference) WindowClass.invokeMethod(tr, getWindowsMethod, Collections.<Value>emptyList(), ObjectReference.INVOKE_SINGLE_THREADED);<NEW_LINE>if (windowsIterator == null) {<NEW_LINE>// We do not know whether there was any grab<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>InterfaceType IteratorClass = (InterfaceType) VirtualMachineWrapper.classesByName(vm, Iterator.class.getName()).get(0);<NEW_LINE>Method hasNext = IteratorClass.methodsByName("hasNext", "()Z").get(0);<NEW_LINE>Method next = IteratorClass.methodsByName("next", "()Ljava/lang/Object;").get(0);<NEW_LINE>while (hasNext(hasNext, tr, windowsIterator)) {<NEW_LINE>ObjectReference w = <MASK><NEW_LINE>ungrabWindowFX(WindowClass, w, tr);<NEW_LINE>}<NEW_LINE>} catch (VMDisconnectedExceptionWrapper vmdex) {<NEW_LINE>// Disconnected, all is good.<NEW_LINE>return true;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.log(Level.INFO, "Unable to release FX X grab (if any).", ex);<NEW_LINE>// We do not know whether there was any grab<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
next(next, tr, windowsIterator);
534,519
static void write(DiagnosticsLogWriter writer, ConcurrentMap<Class, LatencyDistribution> opLatencyDistribution) {<NEW_LINE>for (Map.Entry<Class, LatencyDistribution> entry : opLatencyDistribution.entrySet()) {<NEW_LINE>LatencyDistribution distribution = entry.getValue();<NEW_LINE>if (distribution.count() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>writer.startSection(entry.getKey().getName());<NEW_LINE>writer.writeKeyValueEntry("count", distribution.count());<NEW_LINE>writer.writeKeyValueEntry(<MASK><NEW_LINE>writer.writeKeyValueEntry("avg(us)", distribution.avgMicros());<NEW_LINE>writer.writeKeyValueEntry("max(us)", distribution.maxMicros());<NEW_LINE>writer.startSection("latency-distribution");<NEW_LINE>for (int bucket = 0; bucket < distribution.bucketCount(); bucket++) {<NEW_LINE>long value = distribution.bucket(bucket);<NEW_LINE>if (value > 0) {<NEW_LINE>writer.writeKeyValueEntry(LatencyDistribution.LATENCY_KEYS[bucket], value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endSection();<NEW_LINE>writer.endSection();<NEW_LINE>}<NEW_LINE>}
"totalTime(us)", distribution.totalMicros());
487,210
private double[] determineMinMaxDistance(Relation<ParameterizationFunction> relation, int dimensionality) {<NEW_LINE>double[] min <MASK><NEW_LINE>double[] max = new double[dimensionality - 1];<NEW_LINE>Arrays.fill(max, Math.PI);<NEW_LINE>HyperBoundingBox box = new HyperBoundingBox(min, max);<NEW_LINE>double d_min = Double.POSITIVE_INFINITY, d_max = Double.NEGATIVE_INFINITY;<NEW_LINE>for (DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {<NEW_LINE>ParameterizationFunction f = relation.get(iditer);<NEW_LINE>HyperBoundingBox minMax = f.determineAlphaMinMax(box);<NEW_LINE>double f_min = f.function(SpatialUtil.getMin(minMax));<NEW_LINE>double f_max = f.function(SpatialUtil.getMax(minMax));<NEW_LINE>d_min = Math.min(d_min, f_min);<NEW_LINE>d_max = Math.max(d_max, f_max);<NEW_LINE>}<NEW_LINE>return new double[] { d_min, d_max };<NEW_LINE>}
= new double[dimensionality - 1];
1,522,872
private TypeDefPatch updateMetadataServerClassification() {<NEW_LINE>final String typeName = "MetadataServer";<NEW_LINE>TypeDefPatch <MASK><NEW_LINE>typeDefPatch.setUpdatedBy(originatorName);<NEW_LINE>typeDefPatch.setUpdateTime(creationDate);<NEW_LINE>List<TypeDefAttribute> properties = new ArrayList<>();<NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute1Name = "type";<NEW_LINE>final String attribute1Description = "Deprecated attribute. Use the deployedImplementationType attribute to describe the type of metadata server.";<NEW_LINE>final String attribute1DescriptionGUID = null;<NEW_LINE>final String attribute1ReplacedBy = "deployedImplementationType";<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);<NEW_LINE>property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE);<NEW_LINE>property.setReplacedByAttribute(attribute1ReplacedBy);<NEW_LINE>properties.add(property);<NEW_LINE>final String attribute2Name = "deployedImplementationType";<NEW_LINE>final String attribute2Description = "Type of implemented or deployed metadata server.";<NEW_LINE>final String attribute2DescriptionGUID = null;<NEW_LINE>property = archiveHelper.getStringTypeDefAttribute(attribute2Name, attribute2Description, attribute2DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>typeDefPatch.setPropertyDefinitions(properties);<NEW_LINE>return typeDefPatch;<NEW_LINE>}
typeDefPatch = archiveBuilder.getPatchForType(typeName);
1,110,248
private void receiveMessage(@NonNull final RequestToProcurementWeb event) {<NEW_LINE>auditService.logReceivedFromMetasfresh(Constants.QUEUE_NAME_MF_TO_PW, event);<NEW_LINE>if (event instanceof PutBPartnersRequest) {<NEW_LINE>handler.handlePutBPartnersRequest((PutBPartnersRequest) event);<NEW_LINE>} else if (event instanceof PutProductsRequest) {<NEW_LINE>handler.handlePutProductsRequest((PutProductsRequest) event);<NEW_LINE>} else if (event instanceof PutRfQsRequest) {<NEW_LINE>handler.handlePutRfQsRequest((PutRfQsRequest) event);<NEW_LINE>} else if (event instanceof PutInfoMessageRequest) {<NEW_LINE>handler<MASK><NEW_LINE>} else if (event instanceof PutConfirmationToProcurementWebRequest) {<NEW_LINE>handler.handlePutConfirmationToProcurementWebRequest((PutConfirmationToProcurementWebRequest) event);<NEW_LINE>} else if (event instanceof PutRfQCloseEventsRequest) {<NEW_LINE>handler.handlePutRfQCloseEventsRequest((PutRfQCloseEventsRequest) event);<NEW_LINE>} else {<NEW_LINE>throw new ReceiveSyncException(event, "Unsupported event type " + event.getClass().getName());<NEW_LINE>}<NEW_LINE>}
.handlePutInfoMessageRequest((PutInfoMessageRequest) event);
209,307
private void fillBuffer(boolean block) throws IOException {<NEW_LINE>int maxFill = Math.min(workingBuffer.length, buffer.length - bytesInBuffer);<NEW_LINE>int oldTimeout = socket.getSoTimeout();<NEW_LINE>if (!block) {<NEW_LINE>socket.setSoTimeout(1);<NEW_LINE>}<NEW_LINE>int readBytes;<NEW_LINE>try {<NEW_LINE>readBytes = inputStream.read(workingBuffer, 0, maxFill);<NEW_LINE>} catch (java.net.SocketTimeoutException ste) {<NEW_LINE>readBytes = 0;<NEW_LINE>}<NEW_LINE>if (!block) {<NEW_LINE>socket.setSoTimeout(oldTimeout);<NEW_LINE>}<NEW_LINE>if (readBytes == -1) {<NEW_LINE>bytesInBuffer = -1;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < readBytes; i++) {<NEW_LINE>if (workingBuffer[i] == COMMAND_IAC) {<NEW_LINE>i++;<NEW_LINE>if (Arrays.asList(COMMAND_DO, COMMAND_DONT, COMMAND_WILL, COMMAND_WONT).contains(workingBuffer[i])) {<NEW_LINE>parseCommand(workingBuffer, i, readBytes);<NEW_LINE>++i;<NEW_LINE>continue;<NEW_LINE>} else if (workingBuffer[i] == COMMAND_SUBNEGOTIATION) {<NEW_LINE>// 0xFA = SB = Subnegotiation<NEW_LINE>i += parseSubNegotiation(workingBuffer, ++i, readBytes);<NEW_LINE>continue;<NEW_LINE>} else if (workingBuffer[i] != COMMAND_IAC) {<NEW_LINE>// Double IAC = 255<NEW_LINE>System.err.println("Unknown Telnet command: " + workingBuffer[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer[<MASK><NEW_LINE>}<NEW_LINE>}
bytesInBuffer++] = workingBuffer[i];
468,039
public Boolean checkHeartbeat(final String hostuuid) {<NEW_LINE>final com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(<MASK><NEW_LINE>try {<NEW_LINE>sshConnection.connect(null, 60000, 60000);<NEW_LINE>if (!sshConnection.authenticateWithPassword(_username, _password.peek())) {<NEW_LINE>throw new CloudRuntimeException("Unable to authenticate");<NEW_LINE>}<NEW_LINE>final String shcmd = "/opt/cloud/bin/check_heartbeat.sh " + hostuuid + " " + Integer.toString(_heartbeatInterval * 2);<NEW_LINE>if (!SSHCmdHelper.sshExecuteCmd(sshConnection, shcmd)) {<NEW_LINE>s_logger.debug("Heart beat is gone so dead.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>s_logger.debug("Heart beat is still going");<NEW_LINE>return true;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.debug("health check failed due to catch exception " + e.toString());<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>sshConnection.close();<NEW_LINE>}<NEW_LINE>}
_host.getIp(), 22);
440,326
public Callback traverseCallback(String key, Callback callback) {<NEW_LINE>if (isTraversed(callback)) {<NEW_LINE>return callback;<NEW_LINE>}<NEW_LINE>if (previsit) {<NEW_LINE>callback = visitor.visitCallback(this, key, callback);<NEW_LINE>if (callback == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ancestors.push(callback);<NEW_LINE>final Map<String, Object> extensions = callback.getExtensions();<NEW_LINE>if (extensions != null) {<NEW_LINE>processExtensions(extensions);<NEW_LINE>}<NEW_LINE>Map<String, PathItem> pathItems = callback.getPathItems();<NEW_LINE>if (pathItems != null) {<NEW_LINE>final Map<String, PathItem> updates = map();<NEW_LINE>pathItems.forEach((k, v) -> {<NEW_LINE>pathSegments.push(k);<NEW_LINE>final PathItem p = traversePathItem(k, v);<NEW_LINE>if (p != v) {<NEW_LINE>updates.put(k, p);<NEW_LINE>}<NEW_LINE>pathSegments.pop();<NEW_LINE>});<NEW_LINE>for (Entry<String, PathItem> entry : updates.entrySet()) {<NEW_LINE>if (entry.getValue() != null) {<NEW_LINE>callback.addPathItem(entry.getKey(), entry.getValue());<NEW_LINE>} else {<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// FOR<NEW_LINE>}<NEW_LINE>ancestors.pop();<NEW_LINE>if (!previsit) {<NEW_LINE>callback = visitor.visitCallback(this, key, callback);<NEW_LINE>}<NEW_LINE>return callback;<NEW_LINE>}
removePathItem(entry.getKey());
401,025
protected List<Unit> collectDefinitionsWithAliases(Local l, LocalDefs localDefs, LocalUses localUses, Body body) {<NEW_LINE>Set<Local> seenLocals = new HashSet<Local>();<NEW_LINE>List<Local> newLocals = new ArrayList<Local>();<NEW_LINE>List<Unit> defs = new ArrayList<Unit>();<NEW_LINE>newLocals.add(l);<NEW_LINE>seenLocals.add(l);<NEW_LINE>while (!newLocals.isEmpty()) {<NEW_LINE>Local local = newLocals.remove(0);<NEW_LINE>for (Unit u : collectDefinitions(local, localDefs)) {<NEW_LINE>if (u instanceof AssignStmt) {<NEW_LINE>Value r = ((AssignStmt) u).getRightOp();<NEW_LINE>if (r instanceof Local && seenLocals.add((Local) r)) {<NEW_LINE>newLocals.add((Local) r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>defs.add(u);<NEW_LINE>//<NEW_LINE>List<UnitValueBoxPair> <MASK><NEW_LINE>for (UnitValueBoxPair pair : usesOf) {<NEW_LINE>Unit unit = pair.getUnit();<NEW_LINE>if (unit instanceof AssignStmt) {<NEW_LINE>AssignStmt assignStmt = ((AssignStmt) unit);<NEW_LINE>Value right = assignStmt.getRightOp();<NEW_LINE>Value left = assignStmt.getLeftOp();<NEW_LINE>if (right == local && left instanceof Local && seenLocals.add((Local) left)) {<NEW_LINE>newLocals.add((Local) left);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return defs;<NEW_LINE>}
usesOf = localUses.getUsesOf(u);
538,087
final GetWorkflowResult executeGetWorkflow(GetWorkflowRequest getWorkflowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWorkflowRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWorkflowRequest> request = null;<NEW_LINE>Response<GetWorkflowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWorkflowRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWorkflowRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWorkflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWorkflowResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWorkflowResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
447,693
private static Class<?> validateLocationAndFrame(Node location, Frame frame, Object value) {<NEW_LINE>InteropLibrary interop = InteropLibrary.getUncached(value);<NEW_LINE>assert interop.hasLanguage(value) : String.format("The value '%s' is not associated with any language.", value);<NEW_LINE>Class<? extends TruffleLanguage<?>> valueLanguage;<NEW_LINE>try {<NEW_LINE>valueLanguage = interop.getLanguage(value);<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere(e);<NEW_LINE>}<NEW_LINE>RootNode rootNode = location.getRootNode();<NEW_LINE>assert rootNode != null : <MASK><NEW_LINE>LanguageInfo nodeLanguageInfo = rootNode.getLanguageInfo();<NEW_LINE>assert nodeLanguageInfo != null : String.format("The location '%s' does not have a language associated.", location);<NEW_LINE>Class<?> nodeLanguage = InteropAccessor.ACCESSOR.languageSupport().getSPI(InteropAccessor.ACCESSOR.engineSupport().getEnvForInstrument(nodeLanguageInfo)).getClass();<NEW_LINE>assert nodeLanguage == valueLanguage : String.format("The value language '%s' must match the language of the location %s.", valueLanguage, nodeLanguage);<NEW_LINE>assert frame != null : "Frame argument must not be null.";<NEW_LINE>assert rootNode.getFrameDescriptor().equals(frame.getFrameDescriptor()) : String.format("The frame provided does not originate from the location. " + "Expected frame descriptor '%s' but was '%s'.", rootNode.getFrameDescriptor(), frame.getFrameDescriptor());<NEW_LINE>return nodeLanguage;<NEW_LINE>}
String.format("The location '%s' does not have a RootNode.", location);
1,715,121
protected Void doInBackground() throws Exception {<NEW_LINE>try {<NEW_LINE>// 0 page count means it's already been processed (or PDF if empty)<NEW_LINE>if (pageCount > 0 || forceRescan) {<NEW_LINE>assetPanel.showImagePanelProgress(true);<NEW_LINE>for (int pageNumber = 1; pageNumber < pageCount + 1; pageNumber++) {<NEW_LINE>ExtractImagesTask task = new ExtractImagesTask(pageNumber, pageCount, dir, forceRescan);<NEW_LINE>// When the PDF get to the larger modules (50-100 pages) it can overload the pool...<NEW_LINE>extractThreadPool.schedule(task, 100 * pageNumber, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>extractThreadPool.shutdown();<NEW_LINE>extractThreadPool.<MASK><NEW_LINE>} else {<NEW_LINE>dir = new PdfAsDirectory(extractor.getTempDir(), AppConstants.IMAGE_FILE_FILTER);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
awaitTermination(3, TimeUnit.MINUTES);
580,049
public void controlChanged(Object source) {<NEW_LINE>if (source == spinnerN) {<NEW_LINE>int v = (Integer) spinnerN.getValue();<NEW_LINE>if (v == config.numberOfNeighborsN)<NEW_LINE>return;<NEW_LINE>config.numberOfNeighborsN = v;<NEW_LINE>} else if (source == spinnerM) {<NEW_LINE>int v = <MASK><NEW_LINE>if (v == config.sizeOfCombinationM)<NEW_LINE>return;<NEW_LINE>config.sizeOfCombinationM = v;<NEW_LINE>} else if (source == spinnerK) {<NEW_LINE>int v = (Integer) spinnerK.getValue();<NEW_LINE>if (v == config.quantizationK)<NEW_LINE>return;<NEW_LINE>config.quantizationK = v;<NEW_LINE>} else if (source == cInvariant) {<NEW_LINE>int ordinal = cInvariant.getSelectedIndex();<NEW_LINE>if (config.hashType.ordinal() == ordinal)<NEW_LINE>return;<NEW_LINE>config.hashType = ConfigLlah.HashType.values()[ordinal];<NEW_LINE>} else if (source == cEnable) {<NEW_LINE>if (cEnable.isSelected()) {<NEW_LINE>JOptionPane.showMessageDialog(this, "You can easily freeze the app by changing these settings");<NEW_LINE>}<NEW_LINE>spinnerN.setEnabled(cEnable.isSelected());<NEW_LINE>spinnerM.setEnabled(cEnable.isSelected());<NEW_LINE>spinnerK.setEnabled(cEnable.isSelected());<NEW_LINE>cInvariant.setEnabled(cEnable.isEnabled());<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>System.err.println("Unknown command");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>listener.configLlahChanged();<NEW_LINE>}
(Integer) spinnerM.getValue();
603,599
public void marshall(RequestCertificateRequest requestCertificateRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (requestCertificateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getDomainName(), DOMAINNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getValidationMethod(), VALIDATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getSubjectAlternativeNames(), SUBJECTALTERNATIVENAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getDomainValidationOptions(), DOMAINVALIDATIONOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getOptions(), OPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(requestCertificateRequest.getCertificateAuthorityArn(), CERTIFICATEAUTHORITYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
requestCertificateRequest.getTags(), TAGS_BINDING);
512,200
public <T extends Event> T callEvent(T event) {<NEW_LINE>if (event.getHandlers().getRegisteredListeners().length == 0) {<NEW_LINE>return event;<NEW_LINE>}<NEW_LINE>Server server = ServerProvider.getServer();<NEW_LINE>if (event.isAsynchronous()) {<NEW_LINE>server.getPluginManager().callEvent(event);<NEW_LINE>return event;<NEW_LINE>} else {<NEW_LINE>FutureTask<T> task = new FutureTask<>(() -> server.getPluginManager().callEvent(event), event);<NEW_LINE><MASK><NEW_LINE>((GlowScheduler) scheduler).scheduleInTickExecution(task);<NEW_LINE>try {<NEW_LINE>return task.get();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>ConsoleMessages.Warn.Event.INTERRUPTED.log(e, event.getClass().getSimpleName());<NEW_LINE>return event;<NEW_LINE>} catch (CancellationException e) {<NEW_LINE>ConsoleMessages.Warn.Event.SHUTDOWN.log(event.getClass().getSimpleName());<NEW_LINE>return event;<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>// No checked exceptions declared for callEvent<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BukkitScheduler scheduler = server.getScheduler();
1,201,221
private void stopHandle(ProcessHandle processHandle, boolean forcibly) {<NEW_LINE>// Stop all children first, ES could actually be a child when there's some wrapper process like on Windows.<NEW_LINE>if (processHandle.isAlive() == false) {<NEW_LINE>logger.info("Process was not running when we tried to terminate it.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Stop all children first, ES could actually be a child when there's some wrapper process like on Windows.<NEW_LINE>processHandle.children().forEach(each -> stopHandle(each, forcibly));<NEW_LINE>logProcessInfo("Terminating elasticsearch process" + (forcibly ? " forcibly " : "gracefully") + ":", processHandle.info());<NEW_LINE>if (forcibly) {<NEW_LINE>processHandle.destroyForcibly();<NEW_LINE>} else {<NEW_LINE>processHandle.destroy();<NEW_LINE>waitForProcessToExit(processHandle);<NEW_LINE>if (processHandle.isAlive() == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.<MASK><NEW_LINE>processHandle.destroyForcibly();<NEW_LINE>}<NEW_LINE>waitForProcessToExit(processHandle);<NEW_LINE>if (processHandle.isAlive()) {<NEW_LINE>throw new TestClustersException("Was not able to terminate elasticsearch process");<NEW_LINE>}<NEW_LINE>}
info("process did not terminate after {} {}, stopping it forcefully", ES_DESTROY_TIMEOUT, ES_DESTROY_TIMEOUT_UNIT);
928,394
private ExportResult<VideosContainerResource> exportVideos(TokensAndUrlAuthData authData, Optional<StringPaginationToken> paginationData) throws CopyExceptionWithFailureReason {<NEW_LINE>Optional<String> paginationToken = paginationData.map(StringPaginationToken::getToken);<NEW_LINE>try {<NEW_LINE>Connection<Video> videoConnection = getOrCreateVideosInterface(authData).getVideos(paginationToken);<NEW_LINE>List<Video> videos = videoConnection.getData();<NEW_LINE>if (videos.isEmpty()) {<NEW_LINE>return new ExportResult<>(<MASK><NEW_LINE>}<NEW_LINE>ArrayList<VideoModel> exportVideos = new ArrayList<>();<NEW_LINE>for (Video video : videos) {<NEW_LINE>final String url = video.getSource();<NEW_LINE>final String fbid = video.getId();<NEW_LINE>if (null == url || url.isEmpty()) {<NEW_LINE>monitor.severe(() -> String.format("Source was missing or empty for video %s", fbid));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>exportVideos.add(new VideoModel(String.format("%s.mp4", fbid), url, video.getDescription(), "video/mp4", fbid, null, false));<NEW_LINE>}<NEW_LINE>String token = videoConnection.getAfterCursor();<NEW_LINE>if (Strings.isNullOrEmpty(token)) {<NEW_LINE>return new ExportResult<>(ExportResult.ResultType.END, new VideosContainerResource(null, exportVideos));<NEW_LINE>} else {<NEW_LINE>PaginationData nextPageData = new StringPaginationToken(token);<NEW_LINE>ContinuationData continuationData = new ContinuationData(nextPageData);<NEW_LINE>return new ExportResult<>(ExportResult.ResultType.CONTINUE, new VideosContainerResource(null, exportVideos), continuationData);<NEW_LINE>}<NEW_LINE>} catch (FacebookGraphException e) {<NEW_LINE>String message = e.getMessage();<NEW_LINE>// This error means the object we are trying to copy does not exist any more.<NEW_LINE>// In such case, we should skip this object and continue with the rest of the transfer.<NEW_LINE>if (message != null && message.contains("code 100, subcode 33")) {<NEW_LINE>monitor.info(() -> "Cannot find videos to export, skipping to the next bunch", e);<NEW_LINE>return new ExportResult<>(ExportResult.ResultType.END, null);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
ExportResult.ResultType.END, null);
1,413,217
protected final Boolean isDLMTable(final IProcessPreconditionsContext context) {<NEW_LINE>if (Check.equals(context.getTableName(), I_DLM_Partition_Config_Line.Table_Name)) {<NEW_LINE>final I_DLM_Partition_Config_Line configLine = <MASK><NEW_LINE>final I_AD_Table table = InterfaceWrapperHelper.create(configLine.getDLM_Referencing_Table(), I_AD_Table.class);<NEW_LINE>// if the table is already DLMed, then return false<NEW_LINE>return table.isDLM();<NEW_LINE>} else if (Check.equals(context.getTableName(), org.compiere.model.I_AD_Table.Table_Name)) {<NEW_LINE>final I_AD_Table table = context.getSelectedModel(I_AD_Table.class);<NEW_LINE>// if the table is already DLMed, then return false<NEW_LINE>return table.isDLM();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
context.getSelectedModel(I_DLM_Partition_Config_Line.class);
1,054,263
public void init(String name) {<NEW_LINE>Properties p = new Properties();<NEW_LINE>ClassLoader classLoader = getClass().getClassLoader();<NEW_LINE>try {<NEW_LINE>URL url = classLoader.getResource(name + ".properties");<NEW_LINE>if (url != null) {<NEW_LINE><MASK><NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>Logger.info(this, "Loading " + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>URL url = classLoader.getResource(name + "-ext.properties");<NEW_LINE>if (url != null) {<NEW_LINE>InputStream is = url.openStream();<NEW_LINE>p.load(is);<NEW_LINE>is.close();<NEW_LINE>Logger.info(this, "Loading " + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>// Use a fast synchronized hash map implementation instead of the slower<NEW_LINE>// java.util.Properties<NEW_LINE>PropertiesUtil.fromProperties(p, _props);<NEW_LINE>}
InputStream is = url.openStream();
1,292,974
private ExtractedJarEntry extractJarEntry(URL url) {<NEW_LINE>try {<NEW_LINE>JarURLConnection jarUrlConnection = (JarURLConnection) url.openConnection();<NEW_LINE>JarFile jarFile = jarUrlConnection.getJarFile();<NEW_LINE><MASK><NEW_LINE>if (jarEntry.isDirectory()) {<NEW_LINE>// a directory<NEW_LINE>return new ExtractedJarEntry(jarEntry.getName());<NEW_LINE>}<NEW_LINE>Instant lastModified = getLastModified(jarFile.getName());<NEW_LINE>// Extract JAR entry to file<NEW_LINE>try (InputStream is = jarFile.getInputStream(jarEntry)) {<NEW_LINE>Path tempFile = tmpFile.apply("ws", ".je");<NEW_LINE>Files.copy(is, tempFile, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>return new ExtractedJarEntry(tempFile, lastModified, jarEntry.getName());<NEW_LINE>} finally {<NEW_LINE>if (!jarUrlConnection.getUseCaches()) {<NEW_LINE>jarFile.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new HttpException("Cannot load JAR file!", Http.Status.INTERNAL_SERVER_ERROR_500, ioe);<NEW_LINE>}<NEW_LINE>}
JarEntry jarEntry = jarUrlConnection.getJarEntry();
1,244,146
private Mono<Response<SecurityContactInner>> updateWithResponseAsync(String securityContactName, SecurityContactInner securityContact, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (securityContactName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (securityContact == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter securityContact is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>securityContact.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-08-01-preview";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), securityContactName, securityContact, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
379,133
private Result<Map<com.google.cloud.datastore.Key, Entity>> fetchPending() {<NEW_LINE>// We don't need to fetch anything that has been stuffed<NEW_LINE>final Map<com.google.cloud.datastore.Key, Entity> combined = new HashMap<>();<NEW_LINE>Set<com.google.cloud.datastore.Key> <MASK><NEW_LINE>for (com.google.cloud.datastore.Key key : pending) {<NEW_LINE>Entity ent = stuffed.get(key);<NEW_LINE>if (ent == null)<NEW_LINE>fetch.add(key);<NEW_LINE>else<NEW_LINE>combined.put(key, ent);<NEW_LINE>}<NEW_LINE>if (fetch.isEmpty()) {<NEW_LINE>return new ResultNow<>(combined);<NEW_LINE>} else {<NEW_LINE>final Result<Map<com.google.cloud.datastore.Key, Entity>> fetched = loadEngine.fetch(fetch);<NEW_LINE>return () -> {<NEW_LINE>combined.putAll(fetched.now());<NEW_LINE>return combined;<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
fetch = new HashSet<>();
1,194,499
public void jsConstructor(final String type, final ScriptableObject details) {<NEW_LINE>super.jsConstructor(ScriptRuntime.toString(type), details);<NEW_LINE>if (details != null && !Undefined.isUndefined(details)) {<NEW_LINE>final Object screenX = details.get("screenX", details);<NEW_LINE>if (NOT_FOUND != screenX) {<NEW_LINE>screenX_ = ScriptRuntime.toInt32(screenX);<NEW_LINE>}<NEW_LINE>final Object screenY = details.get("screenY", details);<NEW_LINE>if (NOT_FOUND != screenX) {<NEW_LINE>screenY_ = ScriptRuntime.toInt32(screenY);<NEW_LINE>}<NEW_LINE>final Object clientX = details.get("clientX", details);<NEW_LINE>if (NOT_FOUND != clientX) {<NEW_LINE>clientX_ = ScriptRuntime.toInt32(clientX);<NEW_LINE>}<NEW_LINE>final Object clientY = details.get("clientY", details);<NEW_LINE>if (NOT_FOUND != clientX) {<NEW_LINE>clientY_ = ScriptRuntime.toInt32(clientY);<NEW_LINE>}<NEW_LINE>final Object button = <MASK><NEW_LINE>if (NOT_FOUND != button) {<NEW_LINE>button_ = ScriptRuntime.toInt32(button);<NEW_LINE>}<NEW_LINE>final Object buttons = details.get("buttons", details);<NEW_LINE>if (NOT_FOUND != buttons) {<NEW_LINE>buttons_ = ScriptRuntime.toInt32(buttons);<NEW_LINE>}<NEW_LINE>setAltKey(ScriptRuntime.toBoolean(details.get("altKey")));<NEW_LINE>setCtrlKey(ScriptRuntime.toBoolean(details.get("ctrlKey")));<NEW_LINE>setMetaKey(ScriptRuntime.toBoolean(details.get("metaKey")));<NEW_LINE>setShiftKey(ScriptRuntime.toBoolean(details.get("shiftKey")));<NEW_LINE>}<NEW_LINE>}
details.get("button", details);
1,598,287
public void renderSummaryTo(ClassDoc classDoc, Element parent) {<NEW_LINE>Document document = parent.getOwnerDocument();<NEW_LINE>Element summarySection = document.createElement("section");<NEW_LINE>parent.appendChild(summarySection);<NEW_LINE>Element title = document.createElement("title");<NEW_LINE>summarySection.appendChild(title);<NEW_LINE>title.appendChild<MASK><NEW_LINE>Collection<BlockDoc> classBlocks = classDoc.getClassBlocks();<NEW_LINE>if (!classBlocks.isEmpty()) {<NEW_LINE>Element table = document.createElement("table");<NEW_LINE>summarySection.appendChild(table);<NEW_LINE>title = document.createElement("title");<NEW_LINE>table.appendChild(title);<NEW_LINE>title.appendChild(document.createTextNode("Script blocks - " + classDoc.getSimpleName()));<NEW_LINE>blockTableRenderer.renderTo(classBlocks, table);<NEW_LINE>}<NEW_LINE>for (ClassExtensionDoc extensionDoc : classDoc.getClassExtensions()) {<NEW_LINE>extensionBlocksSummaryRenderer.renderTo(extensionDoc, summarySection);<NEW_LINE>}<NEW_LINE>if (!hasBlocks(classDoc)) {<NEW_LINE>Element para = document.createElement("para");<NEW_LINE>summarySection.appendChild(para);<NEW_LINE>para.appendChild(document.createTextNode("No script blocks"));<NEW_LINE>}<NEW_LINE>}
(document.createTextNode("Script blocks"));
824,757
private static Polygon removeInteriorRings(Polygon polygon, double minArea, List<LinearRing> removedRings) {<NEW_LINE>int nRings = polygon.getNumInteriorRing();<NEW_LINE>if (nRings == 0)<NEW_LINE>return polygon;<NEW_LINE>var holes = new ArrayList<LinearRing>();<NEW_LINE>for (int i = 0; i < nRings; i++) {<NEW_LINE>var ring = polygon.getInteriorRingN(i);<NEW_LINE>var coords = ring.getCoordinates();<NEW_LINE>if (org.locationtech.jts.algorithm.Area.ofRing(coords) >= minArea) {<NEW_LINE>holes.add(ring);<NEW_LINE>} else if (removedRings != null)<NEW_LINE>removedRings.add(ring);<NEW_LINE>}<NEW_LINE>if (holes.size() == nRings)<NEW_LINE>return polygon;<NEW_LINE><MASK><NEW_LINE>if (holes.isEmpty())<NEW_LINE>return factory.createPolygon(polygon.getExteriorRing());<NEW_LINE>return factory.createPolygon(polygon.getExteriorRing(), holes.toArray(LinearRing[]::new));<NEW_LINE>}
var factory = polygon.getFactory();
465,583
public JobAlbumArt unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>JobAlbumArt jobAlbumArt = new JobAlbumArt();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("MergePolicy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobAlbumArt.setMergePolicy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Artwork", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>jobAlbumArt.setArtwork(new ListUnmarshaller<Artwork>(ArtworkJsonUnmarshaller.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 jobAlbumArt;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
265,101
private WasmExpression negate(WasmExpression expr) {<NEW_LINE>if (expr instanceof WasmIntBinary) {<NEW_LINE>WasmIntBinary binary = (WasmIntBinary) expr;<NEW_LINE>if (binary.getType() == WasmIntType.INT32 && binary.getOperation() == WasmIntBinaryOperation.XOR) {<NEW_LINE>if (isOne(binary.getFirst())) {<NEW_LINE>return binary.getSecond();<NEW_LINE>}<NEW_LINE>if (isOne(binary.getSecond())) {<NEW_LINE>return binary.getFirst();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WasmIntBinaryOperation negatedOp = negate(binary.getOperation());<NEW_LINE>if (negatedOp != null) {<NEW_LINE>return new WasmIntBinary(binary.getType(), negatedOp, binary.getFirst(), binary.getSecond());<NEW_LINE>}<NEW_LINE>} else if (expr instanceof WasmFloatBinary) {<NEW_LINE>WasmFloatBinary binary = (WasmFloatBinary) expr;<NEW_LINE>WasmFloatBinaryOperation negatedOp = <MASK><NEW_LINE>if (negatedOp != null) {<NEW_LINE>return new WasmFloatBinary(binary.getType(), negatedOp, binary.getFirst(), binary.getSecond());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.EQ, expr, new WasmInt32Constant(0));<NEW_LINE>}
negate(binary.getOperation());
744,417
public String readServerId() {<NEW_LINE>// once set this should never change<NEW_LINE>if (SERVER_ID == null) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (SERVER_ID == null) {<NEW_LINE>try {<NEW_LINE>final File serverFile = serverIdFile();<NEW_LINE>if (!serverFile.exists()) {<NEW_LINE>writeServerIdToDisk(UUIDUtil.uuid());<NEW_LINE>}<NEW_LINE>try (BufferedReader br = Files.newBufferedReader(serverFile.toPath())) {<NEW_LINE>SERVER_ID = br.readLine();<NEW_LINE>Logger.debug(<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new DotStateException("Unable to read server id at " + serverIdFile() + " please make sure that the directory exists and is readable and writeable. If problems" + " persist, try deleting the file. The system will recreate a new one on startup", ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return SERVER_ID;<NEW_LINE>}
ServerAPIImpl.class, "ServerID: " + SERVER_ID);
1,000,870
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, JsonElement jsonElement) throws Exception {<NEW_LINE>Wo wo = new Wo();<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>String executorSeed = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.fetch(id, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>executorSeed = work.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>createData(business, work, jsonElement, path0, path1, path2, path3);<NEW_LINE>wo.setId(work.getId());<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
ExceptionEntityNotExist(id, Work.class);
1,696,262
public boolean isNeedLoadUrl(WebView view, ResourceRequest request) {<NEW_LINE>String urlString = request.getRequestUrl().toString();<NEW_LINE>try {<NEW_LINE>URI uri = new URI(request.getRequestUrl().toString());<NEW_LINE>if (uri.getScheme().equals(mJSScheme)) {<NEW_LINE>CocosHelper.runOnGameThreadAtForeground(() -> CocosWebViewHelper._onJsCallback(mViewTag, urlString));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>FutureTask<Boolean> shouldStartLoadingCB = new FutureTask<>(() -> CocosWebViewHelper._shouldStartLoading(mViewTag, urlString));<NEW_LINE>// run worker on cocos thread<NEW_LINE>CocosHelper.runOnGameThreadAtForeground(shouldStartLoadingCB);<NEW_LINE>// wait for result from cocos thread<NEW_LINE>try {<NEW_LINE>return shouldStartLoadingCB.get();<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>HiLog.debug(TAG, "'shouldOverrideUrlLoading' failed");<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
HiLog.debug(TAG, "Failed to create URI from url");
1,421,791
private CodeBlock signingRegionsByPartition(Partitions partitions) {<NEW_LINE>Map<Partition, Service> services = getServiceData(partitions);<NEW_LINE>CodeBlock.Builder builder = CodeBlock.builder().add("$T.<$T, $T>builder()", ImmutableMap.class, byPartitionKeyClass(), String.class);<NEW_LINE>services.forEach((partition, service) -> {<NEW_LINE><MASK><NEW_LINE>if (partitionDefaults != null && partitionDefaults.getCredentialScope() != null && partitionDefaults.getCredentialScope().getRegion() != null) {<NEW_LINE>builder.add(".put($T.of($S, ", Pair.class, partition.getPartition()).add(partitionEndpointKey(emptyList())).add("), $S)\n", partitionDefaults.getCredentialScope().getRegion());<NEW_LINE>partitionDefaults.getVariants().forEach(variant -> {<NEW_LINE>builder.add(".put($T.of($S, ", Pair.class, partition.getPartition()).add(partitionEndpointKey(variant.getTags())).add("), $S)\n", partitionDefaults.getCredentialScope().getRegion());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return builder.add(".build()").build();<NEW_LINE>}
Endpoint partitionDefaults = service.getDefaults();
260,633
protected EInteger select_delete(final EMatchSpec matcher) {<NEW_LINE>int delete_count = in_tx(new WithMap<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Integer run(IPersistentMap map) {<NEW_LINE>ESeq vals = ERT.NIL;<NEW_LINE>int initial_count = sizeRef.get();<NEW_LINE>EObject key = matcher.getTupleKey(keypos1);<NEW_LINE>if (key == null) {<NEW_LINE>vals = matcher.matching_values_bag(vals, (Map<EObject, IPersistentCollection>) map);<NEW_LINE>} else {<NEW_LINE>IPersistentCollection coll = (IPersistentCollection) map.valAt(key);<NEW_LINE>if (coll != null) {<NEW_LINE>vals = matcher.matching_values_coll(vals, coll.seq());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>for (; !vals.isNil(); vals = vals.tail()) {<NEW_LINE>try {<NEW_LINE>ETuple val = (ETuple) vals.head();<NEW_LINE>key = val.elm(keypos1);<NEW_LINE>IPersistentCollection coll = (IPersistentCollection) map.valAt(key);<NEW_LINE>if (coll instanceof IPersistentSet) {<NEW_LINE>IPersistentSet set = (IPersistentSet) coll;<NEW_LINE>set = set.disjoin(val);<NEW_LINE>if (set != coll) {<NEW_LINE>count += 1;<NEW_LINE>if (set.count() == 0) {<NEW_LINE>map = map.without(key);<NEW_LINE>} else {<NEW_LINE>map = map.assoc(key, set);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (coll instanceof IPersistentBag) {<NEW_LINE>IPersistentBag bag = (IPersistentBag) coll;<NEW_LINE>bag = bag.disjoin(val);<NEW_LINE>if (bag != coll) {<NEW_LINE>count += 1;<NEW_LINE>if (bag.count() == 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>map = map.assoc(key, bag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// should not happen!<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>set(map);<NEW_LINE>sizeRef.set(initial_count - count);<NEW_LINE>return count;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ERT.box(delete_count);<NEW_LINE>}
map = map.without(key);
644,754
// @checkstyle-disable-check : AbbreviationAsWordInNameCheck<NEW_LINE>protected // @checkstyle-enable-check : AbbreviationAsWordInNameCheck<NEW_LINE>PKIXBuilderParameters // @checkstyle-enable-check : AbbreviationAsWordInNameCheck<NEW_LINE>newPKIXBuilderParameters(// @checkstyle-enable-check : AbbreviationAsWordInNameCheck<NEW_LINE>KeyStore trustStore, // @checkstyle-enable-check : AbbreviationAsWordInNameCheck<NEW_LINE>Collection<? extends CRL> crls) throws // @checkstyle-enable-check : AbbreviationAsWordInNameCheck<NEW_LINE>Exception {<NEW_LINE>PKIXBuilderParameters pbParams = new PKIXBuilderParameters(trustStore, new X509CertSelector());<NEW_LINE>// Set maximum certification path length<NEW_LINE>pbParams.setMaxPathLength(_maxCertPathLength);<NEW_LINE>// Make sure revocation checking is enabled<NEW_LINE>pbParams.setRevocationEnabled(true);<NEW_LINE>if (_pkixCertPathChecker != null)<NEW_LINE>pbParams.addCertPathChecker(_pkixCertPathChecker);<NEW_LINE>if (crls != null && !crls.isEmpty()) {<NEW_LINE>pbParams.addCertStore(getCertStoreInstance(crls));<NEW_LINE>}<NEW_LINE>if (_enableCRLDP) {<NEW_LINE>// Enable Certificate Revocation List Distribution Points (CRLDP) support<NEW_LINE>System.setProperty("com.sun.security.enableCRLDP", "true");<NEW_LINE>}<NEW_LINE>if (_enableOCSP) {<NEW_LINE>// Enable On-Line Certificate Status Protocol (OCSP) support<NEW_LINE>Security.setProperty("ocsp.enable", "true");<NEW_LINE>if (_ocspResponderURL != null) {<NEW_LINE>// Override location of OCSP Responder<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pbParams;<NEW_LINE>}
Security.setProperty("ocsp.responderURL", _ocspResponderURL);
1,372,574
public GatewayFilter apply(Config config) {<NEW_LINE>return new GatewayFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {<NEW_LINE>ServerHttpRequest request = exchange.getRequest();<NEW_LINE>addOriginalRequestUrl(exchange, request.getURI());<NEW_LINE>String path = request.getURI().getRawPath();<NEW_LINE>String[] originalParts = StringUtils.tokenizeToStringArray(path, "/");<NEW_LINE>// all new paths start with /<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < originalParts.length; i++) {<NEW_LINE>if (i >= config.getParts()) {<NEW_LINE>// only append slash if this is the second part or greater<NEW_LINE>if (newPath.length() > 1) {<NEW_LINE>newPath.append('/');<NEW_LINE>}<NEW_LINE>newPath.append(originalParts[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newPath.length() > 1 && path.endsWith("/")) {<NEW_LINE>newPath.append('/');<NEW_LINE>}<NEW_LINE>ServerHttpRequest newRequest = request.mutate().path(newPath.toString()).build();<NEW_LINE>exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, newRequest.getURI());<NEW_LINE>return chain.filter(exchange.mutate().request(newRequest).build());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return filterToStringCreator(StripPrefixGatewayFilterFactory.this).append("parts", config.getParts()).toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
StringBuilder newPath = new StringBuilder("/");
40,218
private boolean buildNodeMap(JoinNode joinNode) {<NEW_LINE>PlanNode leftNode = joinNode.getLeftNode();<NEW_LINE>PlanNode rightNode = joinNode.getRightNode();<NEW_LINE>if (jn.isNotIn() || jn.getJoinFilter().isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if ((leftNode.type() != PlanNode.PlanNodeType.TABLE && !(leftNode instanceof JoinNode)) || rightNode.type() != PlanNode.PlanNodeType.TABLE) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (leftNode instanceof JoinNode) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>((TableNode) leftNode).setHintNestLoopHelper(hintNestLoopHelper);<NEW_LINE>nodeMap.put(getTableName((TableNode) leftNode), leftNode);<NEW_LINE>}<NEW_LINE>((TableNode) rightNode).setHintNestLoopHelper(hintNestLoopHelper);<NEW_LINE>nodeMap.put(getTableName((TableNode) rightNode), rightNode);<NEW_LINE>return true;<NEW_LINE>}
return buildNodeMap((JoinNode) leftNode);
1,040,447
private void templateDetailsInitIfNotExist(long id, String name, String value) {<NEW_LINE>TransactionLegacy txn = TransactionLegacy.currentTxn();<NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>PreparedStatement stmtInsert = null;<NEW_LINE>boolean insert = false;<NEW_LINE>try {<NEW_LINE>txn.start();<NEW_LINE>stmt = txn.prepareAutoCloseStatement("SELECT id FROM vm_template_details WHERE template_id=? and name=?");<NEW_LINE>stmt.setLong(1, id);<NEW_LINE>stmt.setString(2, name);<NEW_LINE>ResultSet rs = stmt.executeQuery();<NEW_LINE>if (rs == null || !rs.next()) {<NEW_LINE>insert = true;<NEW_LINE>}<NEW_LINE>stmt.close();<NEW_LINE>if (insert) {<NEW_LINE>stmtInsert = txn.prepareAutoCloseStatement("INSERT INTO vm_template_details(template_id, name, value) VALUES(?, ?, ?)");<NEW_LINE>stmtInsert.setLong(1, id);<NEW_LINE>stmtInsert.setString(2, name);<NEW_LINE>stmtInsert.setString(3, value);<NEW_LINE>if (stmtInsert.executeUpdate() < 1) {<NEW_LINE>throw new CloudRuntimeException("Unable to init template " + id + " datails: " + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>txn.commit();<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Unable to init template " + id + " datails: " + name, e);<NEW_LINE>throw new CloudRuntimeException(<MASK><NEW_LINE>}<NEW_LINE>}
"Unable to init template " + id + " datails: " + name);
409,402
private void testListFilesInMultipleDirectories() throws Exception {<NEW_LINE>LOGGER.info("========= List Files in Multiple Directories ==========");<NEW_LINE>long prepareTime = System.currentTimeMillis();<NEW_LINE>URI listTestUri = combinePath(_baseDirectoryUri, "listTestMultipleFile");<NEW_LINE>_pinotFS.mkdir(listTestUri);<NEW_LINE>LOGGER.info("Created {} for list test...", listTestUri);<NEW_LINE>int numSegments = 1;<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>String directoryPath = "directory_" + i;<NEW_LINE>File tmpDirectory = new File(_localTempDir.getPath(), directoryPath);<NEW_LINE>URI directoryUri = combinePath(listTestUri, directoryPath);<NEW_LINE>tmpDirectory.mkdir();<NEW_LINE>for (int j = 0; j < numSegments; j++) {<NEW_LINE>String relativePath = "segment_" + j;<NEW_LINE>File tmpFile = new File(tmpDirectory, relativePath);<NEW_LINE>tmpFile.createNewFile();<NEW_LINE>_pinotFS.copyFromLocalFile(tmpFile<MASK><NEW_LINE>}<NEW_LINE>LOGGER.info("Took {} ms to create {} segments for directory_{}", System.currentTimeMillis() - prepareTime, numSegments, i);<NEW_LINE>numSegments *= 10;<NEW_LINE>}<NEW_LINE>// reset numSegments<NEW_LINE>numSegments = 1;<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>for (int j = 0; j < _numOps; j++) {<NEW_LINE>URI directoryUri = combinePath(listTestUri, "directory_" + i);<NEW_LINE>long listFilesStart = System.currentTimeMillis();<NEW_LINE>String[] lists = _pinotFS.listFiles(directoryUri, true);<NEW_LINE>LOGGER.info("{}: took {} ms to listFiles. directory_{} ({} segments)", j, System.currentTimeMillis() - listFilesStart, i, lists.length);<NEW_LINE>Preconditions.checkState(lists.length == numSegments);<NEW_LINE>}<NEW_LINE>numSegments *= 10;<NEW_LINE>}<NEW_LINE>}
, combinePath(directoryUri, relativePath));
1,354,887
private List<FhirVersionIndependentConcept> extractValueSetCodes(IBaseResource theValueSet) {<NEW_LINE>List<FhirVersionIndependentConcept> retVal = new ArrayList<>();<NEW_LINE>RuntimeResourceDefinition vsDef = myContext.getResourceDefinition("ValueSet");<NEW_LINE>BaseRuntimeChildDefinition expansionChild = vsDef.getChildByName("expansion");<NEW_LINE>Optional<IBase> expansionOpt = expansionChild.<MASK><NEW_LINE>if (expansionOpt.isPresent()) {<NEW_LINE>IBase expansion = expansionOpt.get();<NEW_LINE>BaseRuntimeElementCompositeDefinition<?> expansionDef = (BaseRuntimeElementCompositeDefinition<?>) myContext.getElementDefinition(expansion.getClass());<NEW_LINE>BaseRuntimeChildDefinition containsChild = expansionDef.getChildByName("contains");<NEW_LINE>List<IBase> contains = containsChild.getAccessor().getValues(expansion);<NEW_LINE>BaseRuntimeChildDefinition.IAccessor systemAccessor = null;<NEW_LINE>BaseRuntimeChildDefinition.IAccessor codeAccessor = null;<NEW_LINE>for (IBase nextContains : contains) {<NEW_LINE>if (systemAccessor == null) {<NEW_LINE>systemAccessor = myContext.getElementDefinition(nextContains.getClass()).getChildByName("system").getAccessor();<NEW_LINE>}<NEW_LINE>if (codeAccessor == null) {<NEW_LINE>codeAccessor = myContext.getElementDefinition(nextContains.getClass()).getChildByName("code").getAccessor();<NEW_LINE>}<NEW_LINE>String system = systemAccessor.getFirstValueOrNull(nextContains).map(t -> (IPrimitiveType<?>) t).map(t -> t.getValueAsString()).orElse(null);<NEW_LINE>String code = codeAccessor.getFirstValueOrNull(nextContains).map(t -> (IPrimitiveType<?>) t).map(t -> t.getValueAsString()).orElse(null);<NEW_LINE>if (isNotBlank(system) && isNotBlank(code)) {<NEW_LINE>retVal.add(new FhirVersionIndependentConcept(system, code));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
getAccessor().getFirstValueOrNull(theValueSet);
2,842
public static void main(String[] args) throws IOException {<NEW_LINE>List<PainlessContextInfo> contextInfos = getContextInfos();<NEW_LINE>Set<Object> sharedStaticInfos = createSharedStatics(contextInfos);<NEW_LINE>Set<PainlessContextClassInfo> sharedClassInfos = createSharedClasses(contextInfos);<NEW_LINE>Path rootDir = resetRootDir();<NEW_LINE>Path sharedDir = createSharedDir(rootDir);<NEW_LINE>List<Object> staticInfos = sortStaticInfos(Collections.emptySet(), new ArrayList<>(sharedStaticInfos));<NEW_LINE>List<PainlessContextClassInfo> classInfos = sortClassInfos(Collections.emptySet(), new ArrayList<>(sharedClassInfos));<NEW_LINE>Map<String, String> javaNamesToDisplayNames = getDisplayNames(classInfos);<NEW_LINE>printSharedIndexPage(<MASK><NEW_LINE>printSharedPackagesPages(sharedDir, javaNamesToDisplayNames, classInfos);<NEW_LINE>Set<PainlessContextInfo> isSpecialized = new HashSet<>();<NEW_LINE>for (PainlessContextInfo contextInfo : contextInfos) {<NEW_LINE>staticInfos = createContextStatics(contextInfo);<NEW_LINE>staticInfos = sortStaticInfos(sharedStaticInfos, staticInfos);<NEW_LINE>classInfos = sortClassInfos(sharedClassInfos, new ArrayList<>(contextInfo.getClasses()));<NEW_LINE>if (staticInfos.isEmpty() == false || classInfos.isEmpty() == false) {<NEW_LINE>Path contextDir = createContextDir(rootDir, contextInfo);<NEW_LINE>isSpecialized.add(contextInfo);<NEW_LINE>javaNamesToDisplayNames = getDisplayNames(contextInfo.getClasses());<NEW_LINE>printContextIndexPage(contextDir, javaNamesToDisplayNames, contextInfo, staticInfos, classInfos);<NEW_LINE>printContextPackagesPages(contextDir, javaNamesToDisplayNames, sharedClassInfos, contextInfo, classInfos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>printRootIndexPage(rootDir, contextInfos, isSpecialized);<NEW_LINE>}
sharedDir, javaNamesToDisplayNames, staticInfos, classInfos);
907,428
public void run() {<NEW_LINE>try {<NEW_LINE>final JSONObject result = actFmInvoker.authenticate(email, firstName, lastName, provider, secret);<NEW_LINE>final String token = actFmInvoker.getToken();<NEW_LINE>if (result.optBoolean("new")) {<NEW_LINE>// Report new user statistic<NEW_LINE>StatisticsService.reportEvent(StatisticsConstants.ACTFM_NEW_USER, "provider", provider);<NEW_LINE>}<NEW_LINE>// Successful login, create outstanding entries<NEW_LINE>// Preferences.getLong(ActFmPreferenceService.PREF_USER_ID, 0);<NEW_LINE>String lastId = ActFmPreferenceService.userId();<NEW_LINE>if (!TextUtils.isEmpty(token) && !RemoteModel.isValidUuid(lastId)) {<NEW_LINE>constructOutstandingTables();<NEW_LINE>}<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>DialogUtilities.dismissDialog(ActFmLoginActivity.this, progressDialog);<NEW_LINE>progressDialog = null;<NEW_LINE>postAuthenticate(result, token);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>handleError(e);<NEW_LINE>} finally {<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (progressDialog != null) {<NEW_LINE>DialogUtilities.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
dismissDialog(ActFmLoginActivity.this, progressDialog);
695,106
public Trainer<Label> wrapTrainer(Trainer<Label> trainer) {<NEW_LINE>if ((ensembleSize > 0) && (type != null)) {<NEW_LINE>switch(type) {<NEW_LINE>case ADABOOST:<NEW_LINE>logger.info("Using Adaboost with " + ensembleSize + " members.");<NEW_LINE>return new AdaBoostTrainer(trainer, ensembleSize, seed);<NEW_LINE>case BAGGING:<NEW_LINE>logger.info("Using Bagging with " + ensembleSize + " members.");<NEW_LINE>return new BaggingTrainer<>(trainer, new <MASK><NEW_LINE>case EXTRA_TREES:<NEW_LINE>if (trainer instanceof DecisionTreeTrainer) {<NEW_LINE>logger.info("Using Extra Trees with " + ensembleSize + " members.");<NEW_LINE>return new ExtraTreesTrainer<>((DecisionTreeTrainer<Label>) trainer, new VotingCombiner(), ensembleSize, seed);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("ExtraTreesTrainer requires a DecisionTreeTrainer");<NEW_LINE>}<NEW_LINE>case RF:<NEW_LINE>if (trainer instanceof DecisionTreeTrainer) {<NEW_LINE>logger.info("Using Random Forests with " + ensembleSize + " members.");<NEW_LINE>return new RandomForestTrainer<>((DecisionTreeTrainer<Label>) trainer, new VotingCombiner(), ensembleSize, seed);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("RandomForestTrainer requires a DecisionTreeTrainer");<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown ensemble type :" + type);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return trainer;<NEW_LINE>}<NEW_LINE>}
VotingCombiner(), ensembleSize, seed);
183,218
final ListTemplateAliasesResult executeListTemplateAliases(ListTemplateAliasesRequest listTemplateAliasesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTemplateAliasesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTemplateAliasesRequest> request = null;<NEW_LINE>Response<ListTemplateAliasesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTemplateAliasesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTemplateAliasesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTemplateAliases");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTemplateAliasesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTemplateAliasesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");
1,216,180
public Object execute(ODistributedRequestId requestId, OServer iServer, ODistributedServerManager iManager, ODatabaseDocumentInternal database) throws Exception {<NEW_LINE>ODistributedDatabase db = iManager.getMessageService().getDatabase(database.getName());<NEW_LINE>db.checkReverseSync(lastState);<NEW_LINE>List<OTransactionId> missing = db.missingTransactions(lastState);<NEW_LINE>if (!missing.isEmpty()) {<NEW_LINE>Optional<OBackgroundNewDelta> delta = ((OAbstractPaginatedStorage) database.getStorage<MASK><NEW_LINE>if (delta.isPresent()) {<NEW_LINE>((ODistributedDatabaseImpl) db).setLastValidBackup(delta.get());<NEW_LINE>return new ONewDeltaTaskResponse(new ODistributedDatabaseChunk(delta.get(), CHUNK_MAX_SIZE));<NEW_LINE>} else {<NEW_LINE>return new ONewDeltaTaskResponse(ONewDeltaTaskResponse.ResponseType.FULL_SYNC);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return new ONewDeltaTaskResponse(ONewDeltaTaskResponse.ResponseType.NO_CHANGES);<NEW_LINE>}<NEW_LINE>}
()).extractTransactionsFromWal(missing);
398,114
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String integrationAccountName = Utils.getValueFromIdByName(id, "integrationAccounts");<NEW_LINE>if (integrationAccountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'integrationAccounts'.", id)));<NEW_LINE>}<NEW_LINE>String mapName = Utils.getValueFromIdByName(id, "maps");<NEW_LINE>if (mapName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'maps'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, integrationAccountName, mapName, context);<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
1,596,708
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {<NEW_LINE>if (replacementOngoing(allocation) == false) {<NEW_LINE>return NO_REPLACEMENTS;<NEW_LINE>} else if (replacementFromSourceToTarget(allocation, shardRouting.currentNodeId(), node.node().getName())) {<NEW_LINE>return Decision.single(Decision.Type.YES, NAME, "node [%s] is replacing node [%s], and may receive shards from it", shardRouting.currentNodeId(), node.nodeId());<NEW_LINE>} else if (isReplacementSource(allocation, shardRouting.currentNodeId())) {<NEW_LINE>return Decision.single(Decision.Type.NO, NAME, "node [%s] is being replaced, and its shards may only be allocated to the replacement target [%s]", shardRouting.currentNodeId(), getReplacementName(allocation, shardRouting.currentNodeId()));<NEW_LINE>} else if (isReplacementSource(allocation, node.nodeId())) {<NEW_LINE>return Decision.single(Decision.Type.NO, NAME, "node [%s] is being replaced by [%s], so no data may be allocated to it", node.nodeId(), getReplacementName(allocation, node.nodeId()<MASK><NEW_LINE>} else if (isReplacementTargetName(allocation, node.node().getName())) {<NEW_LINE>final SingleNodeShutdownMetadata shutdown = allocation.replacementTargetShutdowns().get(node.node().getName());<NEW_LINE>return Decision.single(Decision.Type.NO, NAME, "node [%s] is replacing the vacating node [%s], only data currently allocated to the source node " + "may be allocated to it until the replacement is complete", node.nodeId(), shutdown == null ? null : shutdown.getNodeId(), shardRouting.currentNodeId());<NEW_LINE>} else {<NEW_LINE>return Decision.single(Decision.Type.YES, NAME, "neither the source nor target node are part of an ongoing node replacement");<NEW_LINE>}<NEW_LINE>}
), shardRouting.currentNodeId());
57,848
public MethodHandle findShadowMethodHandle(Class<?> definingClass, String name, MethodType methodType, boolean isStatic) throws IllegalAccessException {<NEW_LINE>return PerfStatsCollector.getInstance().measure("find shadow method handle", () -> {<NEW_LINE>MethodType actualType = isStatic ? methodType : methodType.dropParameterTypes(0, 1);<NEW_LINE>Class<?>[<MASK><NEW_LINE>Method shadowMethod = pickShadowMethod(definingClass, name, paramTypes);<NEW_LINE>if (shadowMethod == CALL_REAL_CODE) {<NEW_LINE>return null;<NEW_LINE>} else if (shadowMethod == DO_NOTHING_METHOD) {<NEW_LINE>return DO_NOTHING;<NEW_LINE>}<NEW_LINE>shadowMethod.setAccessible(true);<NEW_LINE>MethodHandle mh;<NEW_LINE>if (name.equals(ShadowConstants.CONSTRUCTOR_METHOD_NAME)) {<NEW_LINE>if (Modifier.isStatic(shadowMethod.getModifiers())) {<NEW_LINE>throw new UnsupportedOperationException("static __constructor__ shadow methods are not supported");<NEW_LINE>}<NEW_LINE>// Use invokespecial to call constructor shadow methods. If invokevirtual is used,<NEW_LINE>// the wrong constructor may be called in situations where constructors with<NEW_LINE>// identical signatures are shadowed in object hierarchies.<NEW_LINE>mh = MethodHandles.privateLookupIn(shadowMethod.getDeclaringClass(), LOOKUP).unreflectSpecial(shadowMethod, shadowMethod.getDeclaringClass());<NEW_LINE>} else {<NEW_LINE>mh = LOOKUP.unreflect(shadowMethod);<NEW_LINE>}<NEW_LINE>// Robolectric doesn't actually look for static, this for example happens<NEW_LINE>// in MessageQueue.nativeInit() which used to be void non-static in 4.2.<NEW_LINE>if (!isStatic && Modifier.isStatic(shadowMethod.getModifiers())) {<NEW_LINE>return dropArguments(mh, 0, Object.class);<NEW_LINE>} else {<NEW_LINE>return mh;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
] paramTypes = actualType.parameterArray();
1,204,828
public void onError(Throwable t) {<NEW_LINE>if (this.done) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Subscription currentSubscription = this.s;<NEW_LINE>if (currentSubscription == Operators.cancelledSubscription() || !S.compareAndSet(this, currentSubscription, Operators.cancelledSubscription())) {<NEW_LINE>logger.debug("Dropped error", t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.done = true;<NEW_LINE>final int streamId = this.streamId;<NEW_LINE>this.requesterResponderSupport.remove(streamId, this);<NEW_LINE>final ByteBuf errorFrame = ErrorFrameCodec.encode(this.allocator, streamId, t);<NEW_LINE>this.connection.sendFrame(streamId, errorFrame);<NEW_LINE>final RequestInterceptor requestInterceptor = this.requestInterceptor;<NEW_LINE>if (requestInterceptor != null) {<NEW_LINE>requestInterceptor.onTerminate(streamId, FrameType.REQUEST_RESPONSE, t);<NEW_LINE>}<NEW_LINE>}
logger.debug("Dropped error", t);
751,038
private void initComponents() {<NEW_LINE>// This class is a refactored copy of ArtifactsListPanel so lacks the form however the init method still constructs the proper UI elements.<NEW_LINE>javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jTable1 = <MASK><NEW_LINE>setOpaque(false);<NEW_LINE>setPreferredSize(new java.awt.Dimension(200, 10));<NEW_LINE>jScrollPane1.setPreferredSize(new java.awt.Dimension(200, 10));<NEW_LINE>jScrollPane1.setBorder(null);<NEW_LINE>jScrollPane1.setMinimumSize(new java.awt.Dimension(0, 0));<NEW_LINE>jTable1.setAutoCreateRowSorter(true);<NEW_LINE>jTable1.setModel(tableModel);<NEW_LINE>jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>jScrollPane1.setViewportView(jTable1);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE));<NEW_LINE>}
new javax.swing.JTable();
601,245
public static void vertical5(Kernel1D_S32 kernel, GrayS32 src, GrayS32 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(total + halfDivisor) / divisor);
8,387
public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>logger.warn(String.format("unable to check state of the vm[uuid:%s] on the host[uuid:%s], %s;" + "put the VM into the Unknown state", self.getUuid(), hostUuid<MASK><NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.unknown);<NEW_LINE>completion.done();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CheckVmStateOnHypervisorReply r = reply.castReply();<NEW_LINE>String state = r.getStates().get(self.getUuid());<NEW_LINE>if (state == null) {<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.unknown);<NEW_LINE>completion.done();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (VmInstanceState.Running.toString().equals(state)) {<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.running, () -> self.setHostUuid(hostUuid));<NEW_LINE>} else if (VmInstanceState.Stopped.toString().equals(state) && self.getState().equals(VmInstanceState.Destroying)) {<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.destroyed);<NEW_LINE>} else if (VmInstanceState.Stopped.toString().equals(state)) {<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.stopped);<NEW_LINE>} else if (VmInstanceState.Paused.toString().equals(state)) {<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.paused);<NEW_LINE>} else {<NEW_LINE>throw new CloudRuntimeException(String.format("CheckVmStateOnHypervisorMsg should only report states[Running, Paused or Stopped]," + "but it reports %s for the vm[uuid:%s] on the host[uuid:%s]", state, self.getUuid(), hostUuid));<NEW_LINE>}<NEW_LINE>completion.done();<NEW_LINE>}
, reply.getError()));
1,482,575
public Optional<SimpleLock> lock(@NonNull LockConfiguration lockConfiguration) {<NEW_LINE>String transactionId = null;<NEW_LINE>try {<NEW_LINE>StreamTransactionEntity streamTransactionEntity = arangoCollection.db().beginStreamTransaction(new StreamTransactionOptions().exclusiveCollections<MASK><NEW_LINE>transactionId = streamTransactionEntity.getId();<NEW_LINE>BaseDocument existingDocument = arangoCollection.getDocument(lockConfiguration.getName(), BaseDocument.class, new DocumentReadOptions().streamTransactionId(transactionId));<NEW_LINE>// 1. case<NEW_LINE>if (existingDocument == null) {<NEW_LINE>BaseDocument newDocument = insertNewLock(transactionId, lockConfiguration.getName(), lockConfiguration.getLockAtMostUntil());<NEW_LINE>return Optional.of(new ArangoLock(arangoCollection, newDocument, lockConfiguration));<NEW_LINE>}<NEW_LINE>// 2. case<NEW_LINE>Instant lockUntil = Instant.parse(existingDocument.getAttribute(LOCK_UNTIL).toString());<NEW_LINE>if (lockUntil.compareTo(ClockProvider.now()) <= 0) {<NEW_LINE>updateLockAtMostUntil(transactionId, existingDocument, lockConfiguration.getLockAtMostUntil());<NEW_LINE>return Optional.of(new ArangoLock(arangoCollection, existingDocument, lockConfiguration));<NEW_LINE>}<NEW_LINE>// 3. case<NEW_LINE>return Optional.empty();<NEW_LINE>} catch (ArangoDBException e) {<NEW_LINE>if (transactionId != null) {<NEW_LINE>arangoCollection.db().abortStreamTransaction(transactionId);<NEW_LINE>}<NEW_LINE>throw new LockException("Unexpected error occured", e);<NEW_LINE>} finally {<NEW_LINE>if (transactionId != null) {<NEW_LINE>arangoCollection.db().commitStreamTransaction(transactionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(arangoCollection.name()));
1,573,668
private void loadOrgAccessAdd(ArrayList<OrgAccess> list, OrgAccess oa) {<NEW_LINE>if (list.contains(oa))<NEW_LINE>return;<NEW_LINE>list.add(oa);<NEW_LINE>// Do we look for trees?<NEW_LINE>if (getAD_Tree_Org_ID() == 0)<NEW_LINE>return;<NEW_LINE>MOrg org = MOrg.get(getCtx(), oa.AD_Org_ID);<NEW_LINE>if (!org.isSummary())<NEW_LINE>return;<NEW_LINE>// Summary Org - Get Dependents<NEW_LINE>MTree tree = MTree.get(getCtx(), getAD_Tree_Org_ID(), get_TrxName());<NEW_LINE>String sql = "SELECT AD_Client_ID, AD_Org_ID FROM AD_Org " + "WHERE IsActive='Y' AND AD_Org_ID IN (SELECT Node_ID FROM " + tree.getNodeTableName() + " WHERE AD_Tree_ID=? AND Parent_ID=? AND IsActive='Y')";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, tree.getAD_Tree_ID());<NEW_LINE>pstmt.setInt(2, org.getAD_Org_ID());<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>int AD_Client_ID = rs.getInt(1);<NEW_LINE>int AD_Org_ID = rs.getInt(2);<NEW_LINE>loadOrgAccessAdd(list, new OrgAccess(AD_Client_ID, AD_Org_ID, oa.readOnly));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}
DB.close(rs, pstmt);
159,504
public boolean install(final String name, final String version, final ProgressHandle progressHandle) throws OperationException {<NEW_LINE>final CompositeProgress composite = new CompositeProgress(new ProgressHandleAdapter(progressHandle));<NEW_LINE>final Progress logicProgress = new Progress();<NEW_LINE><MASK><NEW_LINE>final Progress installProgress = new Progress();<NEW_LINE>composite.addChild(logicProgress, 10);<NEW_LINE>composite.addChild(dataProgress, 60);<NEW_LINE>composite.addChild(installProgress, 30);<NEW_LINE>try {<NEW_LINE>final List<WizardComponent> components = new LinkedList<WizardComponent>();<NEW_LINE>components.add(new CacheEngineAction());<NEW_LINE>components.add(new ProductWizardSequence(product));<NEW_LINE>final Wizard wizard = new Wizard(null, components, -1);<NEW_LINE>wizard.setFinishHandler(new FinishHandler() {<NEW_LINE><NEW_LINE>public void cancel() {<NEW_LINE>throw new UnsupportedOperationException("Not supported yet.");<NEW_LINE>}<NEW_LINE><NEW_LINE>public void finish() {<NEW_LINE>wizard.close();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void criticalExit() {<NEW_LINE>throw new UnsupportedOperationException("Not supported yet.");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>wizard.openBlocking();<NEW_LINE>product.downloadLogic(logicProgress);<NEW_LINE>product.downloadData(dataProgress);<NEW_LINE>product.install(installProgress);<NEW_LINE>} catch (DownloadException e) {<NEW_LINE>throw new OperationException(ERROR_TYPE.INSTALL, e);<NEW_LINE>} catch (InstallationException e) {<NEW_LINE>throw new OperationException(ERROR_TYPE.INSTALL, e);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
final Progress dataProgress = new Progress();
1,148,436
public void start(BundleContext context) throws Exception {<NEW_LINE>super.start(context);<NEW_LINE>Version.registerApplication("SpotBugs-Eclipse", Version.VERSION_STRING);<NEW_LINE>// configure debugging<NEW_LINE>configurePluginDebugOptions();<NEW_LINE>// initialize resource strings<NEW_LINE>try {<NEW_LINE>// this is correct //$NON-NLS-1$<NEW_LINE>resourceBundle = ResourceBundle.getBundle("de.tobject.findbugs.messages");<NEW_LINE>} catch (MissingResourceException x) {<NEW_LINE>resourceBundle = null;<NEW_LINE>}<NEW_LINE>if (System.getProperty("findbugs.home") == null) {<NEW_LINE>// TODO workaround for findbugs home property<NEW_LINE>// - see de.tobject.findbugs.builder.FindBugsWorker.work() too<NEW_LINE>String findBugsHome = getFindBugsEnginePluginLocation();<NEW_LINE>if (DEBUG) {<NEW_LINE>logInfo("SpotBugs home is: " + findBugsHome);<NEW_LINE>}<NEW_LINE>System.setProperty("findbugs.home", findBugsHome);<NEW_LINE>}<NEW_LINE>if (System.getProperty("findbugs.cloud.default") == null) {<NEW_LINE>// TODO workaround for findbugs default cloud property<NEW_LINE>// - see edu.umd.cs.findbugs.cloud.CloudFactory and messages.xml<NEW_LINE>String defCloud = DEFAULT_CLOUD_ID;<NEW_LINE>if (DEBUG) {<NEW_LINE>logInfo("Using default cloud: " + defCloud);<NEW_LINE>}<NEW_LINE>System.setProperty("findbugs.cloud.default", defCloud);<NEW_LINE>}<NEW_LINE>FindBugs.setNoMains();<NEW_LINE>// enable source searching for "fall" (ignore case) in switch statements<NEW_LINE>SystemProperties.setProperty("findbugs.sf.comment", "true");<NEW_LINE>// Register our save participant<NEW_LINE>FindbugsSaveParticipant saveParticipant = new FindbugsSaveParticipant();<NEW_LINE>ResourcesPlugin.getWorkspace(<MASK><NEW_LINE>}
).addSaveParticipant(PLUGIN_ID, saveParticipant);
979,837
/*<NEW_LINE>* ************************** INVOICE CBA REBALANCING ********************************<NEW_LINE>*/<NEW_LINE>@TimedResource<NEW_LINE>@PUT<NEW_LINE>@Path("/{accountId:" + UUID_PATTERN + "}/" + CBA_REBALANCING)<NEW_LINE>@Consumes(APPLICATION_JSON)<NEW_LINE>@Produces(APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Rebalance account CBA")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 204, message = "Successful operation"), @ApiResponse(code = 400, message = "Invalid account id supplied") })<NEW_LINE>public Response rebalanceExistingCBAOnAccount(@PathParam("accountId") final UUID accountId, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {<NEW_LINE>final CallContext callContext = context.createCallContextWithAccountId(accountId, createdBy, reason, comment, request);<NEW_LINE><MASK><NEW_LINE>return Response.status(Status.NO_CONTENT).build();<NEW_LINE>}
invoiceApi.consumeExistingCBAOnAccountWithUnpaidInvoices(accountId, callContext);
1,418,207
final UpdateAlarmModelResult executeUpdateAlarmModel(UpdateAlarmModelRequest updateAlarmModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAlarmModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAlarmModelRequest> request = null;<NEW_LINE>Response<UpdateAlarmModelResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateAlarmModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAlarmModelRequest));<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, "IoT Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAlarmModel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAlarmModelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAlarmModelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,273,970
// The dialog box that appears when menu item is selected.<NEW_LINE>private JPanel buildDialogPanel() {<NEW_LINE>JPanel contents = new JPanel(new BorderLayout(20, 20));<NEW_LINE>contents.setBorder(new EmptyBorder(10, 10, 10, 10));<NEW_LINE>// Top row - the check box for setting...<NEW_LINE>exceptionHandlerSetting = new JCheckBox("Include this exception handler file in all assemble operations");<NEW_LINE>exceptionHandlerSetting.setSelected(Globals.getSettings().getBooleanSetting(Settings.Bool.EXCEPTION_HANDLER_ENABLED));<NEW_LINE>exceptionHandlerSetting.addActionListener(new ExceptionHandlerSettingAction());<NEW_LINE>contents.<MASK><NEW_LINE>// Middle row - the button and text field for exception handler file selection<NEW_LINE>JPanel specifyHandlerFile = new JPanel();<NEW_LINE>exceptionHandlerSelectionButton = new JButton("Browse");<NEW_LINE>exceptionHandlerSelectionButton.setEnabled(exceptionHandlerSetting.isSelected());<NEW_LINE>exceptionHandlerSelectionButton.addActionListener(new ExceptionHandlerSelectionAction());<NEW_LINE>exceptionHandlerDisplay = new JTextField(Globals.getSettings().getExceptionHandler(), 30);<NEW_LINE>exceptionHandlerDisplay.setEditable(false);<NEW_LINE>exceptionHandlerDisplay.setEnabled(exceptionHandlerSetting.isSelected());<NEW_LINE>specifyHandlerFile.add(exceptionHandlerSelectionButton);<NEW_LINE>specifyHandlerFile.add(exceptionHandlerDisplay);<NEW_LINE>contents.add(specifyHandlerFile, BorderLayout.CENTER);<NEW_LINE>// Bottom row - the control buttons for OK and Cancel<NEW_LINE>Box controlPanel = Box.createHorizontalBox();<NEW_LINE>JButton okButton = new JButton("OK");<NEW_LINE>okButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>performOK();<NEW_LINE>closeDialog();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JButton cancelButton = new JButton("Cancel");<NEW_LINE>cancelButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>closeDialog();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>controlPanel.add(Box.createHorizontalGlue());<NEW_LINE>controlPanel.add(okButton);<NEW_LINE>controlPanel.add(Box.createHorizontalGlue());<NEW_LINE>controlPanel.add(cancelButton);<NEW_LINE>controlPanel.add(Box.createHorizontalGlue());<NEW_LINE>contents.add(controlPanel, BorderLayout.SOUTH);<NEW_LINE>return contents;<NEW_LINE>}
add(exceptionHandlerSetting, BorderLayout.NORTH);
55,098
public void findTypes(String prefix, ISearchRequestor storage, int type) {<NEW_LINE>CompletionResultRequestor requestor = new CompletionResultRequestor(storage, this.unitToSkip, this.project, this.nameLookup);<NEW_LINE>int index = prefix.lastIndexOf('.');<NEW_LINE>if (index == -1) {<NEW_LINE>this.nameLookup.seekTypes(prefix, null, true, type, requestor);<NEW_LINE>} else {<NEW_LINE>String packageName = prefix.substring(0, index);<NEW_LINE>JavaElementRequestor elementRequestor = new JavaElementRequestor();<NEW_LINE>this.nameLookup.<MASK><NEW_LINE>IPackageFragment[] fragments = elementRequestor.getPackageFragments();<NEW_LINE>if (fragments != null) {<NEW_LINE>String className = prefix.substring(index + 1);<NEW_LINE>for (IPackageFragment fragment : fragments) {<NEW_LINE>if (fragment != null) {<NEW_LINE>this.nameLookup.seekTypes(className, fragment, true, type, requestor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
seekPackageFragments(packageName, false, elementRequestor);
1,370,672
public void run() {<NEW_LINE>logger.info("run() started.");<NEW_LINE>ZookeeperJob<K> latestHeadJob = null;<NEW_LINE>// Things to consider<NEW_LINE>// spinLock possible when events are not deleted<NEW_LINE>// may lead to PinpointServer leak when events are left unresolved<NEW_LINE>while (workerState.isStarted()) {<NEW_LINE>try {<NEW_LINE>List<ZookeeperJob<<MASK><NEW_LINE>if (CollectionUtils.isEmpty(zookeeperJobList)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ZookeeperJob<K> headJob = CollectionUtils.firstElement(zookeeperJobList);<NEW_LINE>if (latestHeadJob != null && latestHeadJob == headJob) {<NEW_LINE>// for defence spinLock (zookeeper problem, etc..)<NEW_LINE>Thread.sleep(500);<NEW_LINE>}<NEW_LINE>latestHeadJob = headJob;<NEW_LINE>boolean completed = handle(zookeeperJobList);<NEW_LINE>if (!completed) {<NEW_LINE>// rollback<NEW_LINE>for (int i = zookeeperJobList.size() - 1; i >= 0; i--) {<NEW_LINE>jobDeque.addFirst(zookeeperJobList.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.info("{} thread interrupted", workerThread.getName());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("run() completed.");<NEW_LINE>}
K>> zookeeperJobList = poll();
1,038,951
public void activate(ComponentContext context) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Dictionary<String, Object> properties = context.getProperties();<NEW_LINE>path = (String) properties.get("path");<NEW_LINE>rootUri = (String) properties.get("rootUri");<NEW_LINE>String indexName = (String) properties.get("indexName");<NEW_LINE>if (indexName != null)<NEW_LINE>this.indexName = indexName;<NEW_LINE>Boolean deeplyAccessible = (Boolean) properties.get("deeplyAccessible");<NEW_LINE>if (deeplyAccessible != null)<NEW_LINE>this.deeplyAccessible = deeplyAccessible;<NEW_LINE>Boolean modifiable = (<MASK><NEW_LINE>if (modifiable != null)<NEW_LINE>this.modifiable = modifiable;<NEW_LINE>Boolean negotiatingContent = (Boolean) properties.get("negotiatingContent");<NEW_LINE>if (negotiatingContent != null)<NEW_LINE>this.negotiatingContent = negotiatingContent;<NEW_LINE>}
Boolean) properties.get("modifiable");
340,714
public Map<String, ParameterDescription<?>> computeParameters() {<NEW_LINE>HashMap<String, ParameterDescription<?>> map = new HashMap<String, ParameterDescription<?>>();<NEW_LINE>ParameterDescription<Boolean> e_calls = ParameterDescription.create(Boolean.class, "EventCall", true, true, "event=call", "CALL instruction");<NEW_LINE>ParameterDescription<Boolean> e_ret = ParameterDescription.create(Boolean.class, "EventRet", true, false, "event=ret", "RET instructions");<NEW_LINE>ParameterDescription<Boolean> e_exec = ParameterDescription.create(Boolean.class, "EventExec", true, false, "event=exec", "all instructions (not recommended)");<NEW_LINE>ParameterDescription<Boolean> e_block = ParameterDescription.create(Boolean.class, "EventBlock", true, false, "event=block", "block executed");<NEW_LINE>ParameterDescription<Boolean> e_compile = ParameterDescription.create(Boolean.class, "EventCompile", true, false, "event=compile", "block compiled");<NEW_LINE>ParameterDescription<String> onReceive = ParameterDescription.create(String.class, "OnReceive", false, "", "onRecv file", "JS file with onReceive implemenation");<NEW_LINE>ParameterDescription<String> onCallSummary = ParameterDescription.create(String.class, "OnCallSummary", false, "", "onCall file", "JS file with onCallSummary implementation");<NEW_LINE>ParameterDescription<String> name = ParameterDescription.create(String.class, "Name", false, "stalk", "name", "name for future unload");<NEW_LINE>ParameterDescription<String> script = ParameterDescription.create(String.class, "Script", false, "", "script", "script to execute on result");<NEW_LINE>map.put("EventCall", e_calls);<NEW_LINE>map.put("EventRet", e_ret);<NEW_LINE><MASK><NEW_LINE>map.put("EventBlock", e_block);<NEW_LINE>map.put("EventCompile", e_compile);<NEW_LINE>map.put("OnReceive", onReceive);<NEW_LINE>map.put("OnCallSummary", onCallSummary);<NEW_LINE>map.put("Name", name);<NEW_LINE>map.put("Script", script);<NEW_LINE>return map;<NEW_LINE>}
map.put("EventExec", e_exec);
1,639,414
public void saveParam(Object obj) throws Exception {<NEW_LINE>OptionsParam options = (OptionsParam) obj;<NEW_LINE>ScannerParam param = options.getParamSet(ScannerParam.class);<NEW_LINE>param.setHostPerScan(getSliderHostPerScan().getValue());<NEW_LINE>param.setThreadPerHost(getSliderThreadsPerHost().getValue());<NEW_LINE>param.setDelayInMs(getDelayInMs());<NEW_LINE>param.setMaxResultsToList(this.getSpinnerMaxResultsList().getValue());<NEW_LINE>param.setMaxRuleDurationInMins(this.getSpinnerMaxRuleDuration().getValue());<NEW_LINE>param.setMaxScanDurationInMins(this.getSpinnerMaxScanDuration().getValue());<NEW_LINE>param.setInjectPluginIdInHeader(getChkInjectPluginIdInHeader().isSelected());<NEW_LINE>param.setHandleAntiCSRFTokens(getChkHandleAntiCSRFTokens().isSelected());<NEW_LINE>param.setPromptInAttackMode(getChkPromptInAttackMode().isSelected());<NEW_LINE>param.setRescanInAttackMode(getChkRescanInAttackMode().isSelected());<NEW_LINE>param.setDefaultPolicy((String) this.<MASK><NEW_LINE>param.setAttackPolicy((String) this.getDefaultAttackPolicyPulldown().getSelectedItem());<NEW_LINE>param.setAllowAttackOnStart(this.getAllowAttackModeOnStart().isSelected());<NEW_LINE>param.setMaxChartTimeInMins(this.getSpinnerMaxChartTime().getValue());<NEW_LINE>}
getDefaultAscanPolicyPulldown().getSelectedItem());
586,571
final Snapshot executeDeleteSnapshot(DeleteSnapshotRequest deleteSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSnapshotRequest> request = null;<NEW_LINE>Response<Snapshot> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSnapshotRequestMarshaller().marshall(super.beforeMarshalling(deleteSnapshotRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ElastiCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<Snapshot> responseHandler = new StaxResponseHandler<Snapshot>(new SnapshotStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,520,712
public void registerMap() {<NEW_LINE>handler(wrapper -> {<NEW_LINE>int id = wrapper.read(Type.INT);<NEW_LINE>// Check extra bit for fast dismissal<NEW_LINE>if ((id & (1 << 30)) != 0 && wrapper.user().get(InventoryAcknowledgements.class).removeId(id)) {<NEW_LINE>// Decode our requested inventory acknowledgement<NEW_LINE>short inventoryId = (short) ((id >> 16) & 0xFF);<NEW_LINE>short confirmationId = (short) (id & 0xFFFF);<NEW_LINE>PacketWrapper packet = wrapper.create(ServerboundPackets1_16_2.WINDOW_CONFIRMATION);<NEW_LINE>packet.<MASK><NEW_LINE>packet.write(Type.SHORT, confirmationId);<NEW_LINE>// Accept<NEW_LINE>packet.write(Type.BOOLEAN, true);<NEW_LINE>packet.sendToServer(Protocol1_17To1_16_4.class);<NEW_LINE>}<NEW_LINE>wrapper.cancel();<NEW_LINE>});<NEW_LINE>}
write(Type.UNSIGNED_BYTE, inventoryId);
757,095
private static void syncRoleDefaultOptionToDb(Connection conn, List<PolarAccountInfo> accounts, List<PolarAccountInfo> roles) throws SQLException {<NEW_LINE>final String sql = String.format("update %s set %s = true where %s = ? and %s = ?;", <MASK><NEW_LINE>try (PreparedStatement stmt = conn.prepareStatement(sql)) {<NEW_LINE>for (PolarAccountInfo account : accounts) {<NEW_LINE>for (PolarAccountInfo role : roles) {<NEW_LINE>stmt.setLong(1, account.getAccount().getAccountId());<NEW_LINE>stmt.setLong(2, role.getAccount().getAccountId());<NEW_LINE>stmt.executeUpdate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Start to update default role option from metadb.");<NEW_LINE>int expectedRowCount = accounts.size() * roles.size();<NEW_LINE>int updatedCount = Arrays.stream(stmt.executeBatch()).sum();<NEW_LINE>LOG.info("Finished upating default role option in metadb, expected row count: " + expectedRowCount + ", " + "actual row count: " + updatedCount);<NEW_LINE>}<NEW_LINE>}
TABLE_ROLE_PRIV, COL_IS_DEFAULT_ROLE, COL_RECEIVER_ID, COL_ROLE_ID);
412,136
protected void processRepositories(CombinedIndexBuildItem index, BuildProducer<BytecodeTransformerBuildItem> transformers, BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy, BuildProducer<PropertyMappingClassBuildStep> propertyMappingClass, PanacheRepositoryEnhancer repositoryEnhancer, TypeBundle typeBundle) {<NEW_LINE>Set<String> daoClasses = new HashSet<>();<NEW_LINE>Set<Type> <MASK><NEW_LINE>DotName dotName = typeBundle.repositoryBase().dotName();<NEW_LINE>for (ClassInfo classInfo : index.getIndex().getAllKnownImplementors(dotName)) {<NEW_LINE>// Skip PanacheMongoRepository and abstract repositories<NEW_LINE>if (classInfo.name().equals(typeBundle.repository().dotName()) || repositoryEnhancer.skipRepository(classInfo)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>daoClasses.add(classInfo.name().toString());<NEW_LINE>daoTypeParameters.addAll(resolveTypeParameters(classInfo.name(), typeBundle.repositoryBase().dotName(), index.getIndex()));<NEW_LINE>}<NEW_LINE>for (ClassInfo classInfo : index.getIndex().getAllKnownImplementors(typeBundle.repository().dotName())) {<NEW_LINE>if (repositoryEnhancer.skipRepository(classInfo)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>daoClasses.add(classInfo.name().toString());<NEW_LINE>daoTypeParameters.addAll(resolveTypeParameters(classInfo.name(), typeBundle.repositoryBase().dotName(), index.getIndex()));<NEW_LINE>}<NEW_LINE>for (String daoClass : daoClasses) {<NEW_LINE>transformers.produce(new BytecodeTransformerBuildItem(daoClass, repositoryEnhancer));<NEW_LINE>}<NEW_LINE>for (Type parameterType : daoTypeParameters) {<NEW_LINE>// Register for reflection the type parameters of the repository: this should be the entity class and the ID class<NEW_LINE>reflectiveHierarchy.produce(new ReflectiveHierarchyBuildItem.Builder().type(parameterType).build());<NEW_LINE>// Register for building the property mapping cache<NEW_LINE>propertyMappingClass.produce(new PropertyMappingClassBuildStep(parameterType.name().toString()));<NEW_LINE>}<NEW_LINE>}
daoTypeParameters = new HashSet<>();
1,853,176
private void prepareMount(LayoutState layoutState, @Nullable PerfEvent perfEvent) {<NEW_LINE>final boolean isTracing = RenderCoreSystrace.isEnabled();<NEW_LINE>if (isTracing) {<NEW_LINE>RenderCoreSystrace.beginSection("MountState.prepareMount");<NEW_LINE>}<NEW_LINE>final PrepareMountStats stats = unmountOrMoveOldItems(layoutState);<NEW_LINE>if (perfEvent != null) {<NEW_LINE>perfEvent.markerAnnotate(PARAM_UNMOUNTED_COUNT, stats.unmountedCount);<NEW_LINE>perfEvent.<MASK><NEW_LINE>perfEvent.markerAnnotate(PARAM_UNCHANGED_COUNT, stats.unchangedCount);<NEW_LINE>}<NEW_LINE>if (mIndexToItemMap.get(ROOT_HOST_ID) == null || mHostsByMarker.get(ROOT_HOST_ID) == null) {<NEW_LINE>// Mounting always starts with the root host.<NEW_LINE>registerHost(ROOT_HOST_ID, mLithoView);<NEW_LINE>// Root host is implicitly marked as mounted.<NEW_LINE>mIndexToItemMap.put(ROOT_HOST_ID, mRootHostMountItem);<NEW_LINE>}<NEW_LINE>final int outputCount = layoutState.getMountableOutputCount();<NEW_LINE>if (mLayoutOutputsIds == null || outputCount != mLayoutOutputsIds.length) {<NEW_LINE>mLayoutOutputsIds = new long[outputCount];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < outputCount; i++) {<NEW_LINE>mLayoutOutputsIds[i] = layoutState.getMountableOutputAt(i).getRenderUnit().getId();<NEW_LINE>}<NEW_LINE>if (isTracing) {<NEW_LINE>RenderCoreSystrace.endSection();<NEW_LINE>}<NEW_LINE>}
markerAnnotate(PARAM_MOVED_COUNT, stats.movedCount);
133,751
public Object invokeMethod(String className, String methodName, String methodDesc, JavaValue targetObject, List<JavaValue> args, Context context) {<NEW_LINE>ClassNode classNode = classpath.get(className);<NEW_LINE>if (classNode != null) {<NEW_LINE>MethodNode methodNode = classNode.methods.stream().filter(mn -> mn.name.equals(methodName) && mn.desc.equals(methodDesc)).findFirst().orElse(null);<NEW_LINE>if (methodNode != null) {<NEW_LINE>List<JavaValue> argsClone = new ArrayList<>();<NEW_LINE>for (JavaValue arg : args) {<NEW_LINE>argsClone.add(arg.copy());<NEW_LINE>}<NEW_LINE>return MethodExecutor.execute(classNode, methodNode, argsClone, targetObject == null ? new JavaObject(null, "java/lang/Object") : targetObject, context);<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Could not find class " + className);<NEW_LINE>}
IllegalArgumentException("Could not find method " + methodName + methodDesc);
1,237,855
public void handle(RoutingContext routingContext) {<NEW_LINE>try {<NEW_LINE>RequestParametersImpl parsedParameters = new RequestParametersImpl();<NEW_LINE>parsedParameters.setPathParameters(validatePathParams(routingContext));<NEW_LINE>parsedParameters.setQueryParameters(validateQueryParams(routingContext));<NEW_LINE>parsedParameters.setHeaderParameters(validateHeaderParams(routingContext));<NEW_LINE>parsedParameters.setCookieParameters(validateCookieParams(routingContext));<NEW_LINE>// Run custom validators<NEW_LINE>for (CustomValidator customValidator : customValidators) {<NEW_LINE>customValidator.validate(routingContext);<NEW_LINE>}<NEW_LINE>String contentType = routingContext.request(<MASK><NEW_LINE>if (contentType != null && contentType.length() != 0) {<NEW_LINE>boolean isMultipart = contentType.contains("multipart/form-data");<NEW_LINE>if (multipartFileRules.size() != 0 && !isMultipart) {<NEW_LINE>throw ValidationException.ValidationExceptionFactory.generateWrongContentTypeExpected(contentType, "multipart/form-data");<NEW_LINE>}<NEW_LINE>if (contentType.contains("application/x-www-form-urlencoded")) {<NEW_LINE>parsedParameters.setFormParameters(validateFormParams(routingContext));<NEW_LINE>} else if (isMultipart) {<NEW_LINE>parsedParameters.setFormParameters(validateFormParams(routingContext));<NEW_LINE>validateFileUpload(routingContext);<NEW_LINE>} else if (Utils.isJsonContentType(contentType) || Utils.isXMLContentType(contentType)) {<NEW_LINE>parsedParameters.setBody(validateEntireBody(routingContext));<NEW_LINE>} else if (bodyRequired && !checkContentType(contentType)) {<NEW_LINE>throw ValidationException.ValidationExceptionFactory.generateWrongContentTypeExpected(contentType, null);<NEW_LINE>}<NEW_LINE>// If content type is valid or body is not required, do nothing!<NEW_LINE>} else if (bodyRequired) {<NEW_LINE>throw ValidationException.ValidationExceptionFactory.generateWrongContentTypeExpected(contentType, null);<NEW_LINE>}<NEW_LINE>if (routingContext.data().containsKey("parsedParameters")) {<NEW_LINE>((RequestParametersImpl) routingContext.get("parsedParameters")).merge(parsedParameters);<NEW_LINE>} else {<NEW_LINE>routingContext.put("parsedParameters", parsedParameters);<NEW_LINE>}<NEW_LINE>routingContext.next();<NEW_LINE>} catch (ValidationException e) {<NEW_LINE>routingContext.fail(400, e);<NEW_LINE>}<NEW_LINE>}
).getHeader(HttpHeaders.CONTENT_TYPE);
145,836
/*<NEW_LINE>* Performs deferred logging. Call only if logging at this level is enabled.<NEW_LINE>*<NEW_LINE>* @param logLevel sets the logging level<NEW_LINE>* @param args Arguments for the message, if an exception is being logged last argument is the throwable.<NEW_LINE>*/<NEW_LINE>private void performDeferredLogging(LogLevel logLevel, Supplier<String> messageSupplier, Throwable throwable) {<NEW_LINE>if (hasGlobalContext) {<NEW_LINE>// LoggingEventBuilder writes log messages as json and performs all necessary escaping, i.e. no<NEW_LINE>// sanitization needed<NEW_LINE>LoggingEventBuilder.create(logger, logLevel, globalContextSerialized, true).log(messageSupplier, throwable);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String message = removeNewLinesFromLogMessage(messageSupplier.get());<NEW_LINE>String throwableMessage = (throwable != null) ? throwable.getMessage() : "";<NEW_LINE>switch(logLevel) {<NEW_LINE>case VERBOSE:<NEW_LINE>if (throwable != null) {<NEW_LINE>logger.debug(message, throwable);<NEW_LINE>} else {<NEW_LINE>logger.debug(message);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case INFORMATIONAL:<NEW_LINE>logger.info(message);<NEW_LINE>break;<NEW_LINE>case WARNING:<NEW_LINE>if (!CoreUtils.isNullOrEmpty(throwableMessage)) {<NEW_LINE>message <MASK><NEW_LINE>}<NEW_LINE>logger.warn(message);<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>if (!CoreUtils.isNullOrEmpty(throwableMessage)) {<NEW_LINE>message += System.lineSeparator() + throwableMessage;<NEW_LINE>}<NEW_LINE>logger.error(message);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Don't do anything, this state shouldn't be possible.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
+= System.lineSeparator() + throwableMessage;
192,881
public RepositorySummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RepositorySummary repositorySummary = new RepositorySummary();<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("arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositorySummary.setArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositorySummary.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("provider", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositorySummary.setProvider(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 repositorySummary;<NEW_LINE>}
class).unmarshall(context));
415,012
public double[] process(final double[] input) {<NEW_LINE>if (input.length != this.inputSize) {<NEW_LINE>throw new AnalystError("Invalid input size: " + input.<MASK><NEW_LINE>}<NEW_LINE>this.buffer.add(0, EngineArray.arrayCopy(input));<NEW_LINE>// are we ready yet?<NEW_LINE>if (this.buffer.size() < this.totalDepth) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// create output<NEW_LINE>final double[] output = new double[this.outputSize];<NEW_LINE>int outputIndex = 0;<NEW_LINE>for (final AnalystField field : this.analyst.getScript().getNormalize().getNormalizedFields()) {<NEW_LINE>if (!field.isIgnored()) {<NEW_LINE>if (!this.headingMap.containsKey(field.getName())) {<NEW_LINE>throw new AnalystError("Undefined field: " + field.getName());<NEW_LINE>}<NEW_LINE>final int headingIndex = this.headingMap.get(field.getName());<NEW_LINE>final int timeslice = translateTimeSlice(field.getTimeSlice());<NEW_LINE>final double[] row = this.buffer.get(timeslice);<NEW_LINE>final double d = row[headingIndex];<NEW_LINE>output[outputIndex++] = d;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// keep the buffer at a good size<NEW_LINE>while (this.buffer.size() > this.totalDepth) {<NEW_LINE>this.buffer.remove(this.buffer.size() - 1);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
length + ", should be " + this.inputSize);