idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,540,484
public ExtensionJson toExtensionJson() {<NEW_LINE>var json = new ExtensionJson();<NEW_LINE>var extension = this.getExtension();<NEW_LINE>json.namespace = extension.getNamespace().getName();<NEW_LINE>json.name = extension.getName();<NEW_LINE>json.averageRating = extension.getAverageRating();<NEW_LINE>json.downloadCount = extension.getDownloadCount();<NEW_LINE>json.version = this.getVersion();<NEW_LINE>json.preRelease = this.isPreRelease();<NEW_LINE>if (this.getTimestamp() != null) {<NEW_LINE>json.timestamp = TimeUtil.toUTCString(this.getTimestamp());<NEW_LINE>}<NEW_LINE>json.displayName = this.getDisplayName();<NEW_LINE>json.description = this.getDescription();<NEW_LINE>json.engines = this.getEnginesMap();<NEW_LINE>json.categories = this.getCategories();<NEW_LINE>json.extensionKind = this.getExtensionKind();<NEW_LINE>json.tags = this.getTags();<NEW_LINE>json.license = this.getLicense();<NEW_LINE>json.homepage = this.getHomepage();<NEW_LINE>json.repository = this.getRepository();<NEW_LINE>json.bugs = this.getBugs();<NEW_LINE>json.markdown = this.getMarkdown();<NEW_LINE>json.galleryColor = this.getGalleryColor();<NEW_LINE>json<MASK><NEW_LINE>json.qna = this.getQna();<NEW_LINE>if (this.getPublishedWith() != null) {<NEW_LINE>json.publishedBy = this.getPublishedWith().getUser().toUserJson();<NEW_LINE>}<NEW_LINE>if (this.getDependencies() != null) {<NEW_LINE>json.dependencies = toExtensionReferenceJson(this.getDependencies());<NEW_LINE>}<NEW_LINE>if (this.getBundledExtensions() != null) {<NEW_LINE>json.bundledExtensions = toExtensionReferenceJson(this.getBundledExtensions());<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>}
.galleryTheme = this.getGalleryTheme();
673,842
public static DescribeParametersResponse unmarshall(DescribeParametersResponse describeParametersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeParametersResponse.setRequestId(_ctx.stringValue("DescribeParametersResponse.RequestId"));<NEW_LINE>describeParametersResponse.setEngine(_ctx.stringValue("DescribeParametersResponse.Engine"));<NEW_LINE>describeParametersResponse.setEngineVersion(_ctx.stringValue("DescribeParametersResponse.EngineVersion"));<NEW_LINE>List<Parameter> configParameters = new ArrayList<Parameter>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParametersResponse.ConfigParameters.Length"); i++) {<NEW_LINE>Parameter parameter = new Parameter();<NEW_LINE>parameter.setParameterName(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterName"));<NEW_LINE>parameter.setParameterValue(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterValue"));<NEW_LINE>parameter.setModifiableStatus(_ctx.booleanValue("DescribeParametersResponse.ConfigParameters[" + i + "].ModifiableStatus"));<NEW_LINE>parameter.setForceRestart(_ctx.booleanValue("DescribeParametersResponse.ConfigParameters[" + i + "].ForceRestart"));<NEW_LINE>parameter.setCheckingCode(_ctx.stringValue<MASK><NEW_LINE>parameter.setParameterDescription(_ctx.stringValue("DescribeParametersResponse.ConfigParameters[" + i + "].ParameterDescription"));<NEW_LINE>configParameters.add(parameter);<NEW_LINE>}<NEW_LINE>describeParametersResponse.setConfigParameters(configParameters);<NEW_LINE>List<Parameter> runningParameters = new ArrayList<Parameter>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParametersResponse.RunningParameters.Length"); i++) {<NEW_LINE>Parameter parameter1 = new Parameter();<NEW_LINE>parameter1.setParameterName(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterName"));<NEW_LINE>parameter1.setParameterValue(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterValue"));<NEW_LINE>parameter1.setModifiableStatus(_ctx.booleanValue("DescribeParametersResponse.RunningParameters[" + i + "].ModifiableStatus"));<NEW_LINE>parameter1.setForceRestart(_ctx.booleanValue("DescribeParametersResponse.RunningParameters[" + i + "].ForceRestart"));<NEW_LINE>parameter1.setCheckingCode(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].CheckingCode"));<NEW_LINE>parameter1.setParameterDescription(_ctx.stringValue("DescribeParametersResponse.RunningParameters[" + i + "].ParameterDescription"));<NEW_LINE>runningParameters.add(parameter1);<NEW_LINE>}<NEW_LINE>describeParametersResponse.setRunningParameters(runningParameters);<NEW_LINE>return describeParametersResponse;<NEW_LINE>}
("DescribeParametersResponse.ConfigParameters[" + i + "].CheckingCode"));
442,090
void customizeDescriptor(Context context, Context modelContext, FieldDescriptor descriptor, DataKind kind) {<NEW_LINE>int hintId = kind.hintId;<NEW_LINE>if (hintId != -1) {<NEW_LINE>descriptor.setHint<MASK><NEW_LINE>}<NEW_LINE>if (mDetailsLayout != -1) {<NEW_LINE>LayoutDescriptor ld = new LayoutDescriptor(mDetailsLayout);<NEW_LINE>if (mDetailsLayoutOptions != null) {<NEW_LINE>for (Entry<String, Object> entry : mDetailsLayoutOptions.entrySet()) {<NEW_LINE>ld.setOption(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>descriptor.setViewLayout(ld);<NEW_LINE>}<NEW_LINE>if (mEditLayout != -1) {<NEW_LINE>LayoutDescriptor ld = new LayoutDescriptor(mEditLayout);<NEW_LINE>if (mEditLayoutOptions != null) {<NEW_LINE>for (Entry<String, Object> entry : mEditLayoutOptions.entrySet()) {<NEW_LINE>ld.setOption(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>descriptor.setEditorLayout(ld);<NEW_LINE>}<NEW_LINE>}
(modelContext.getString(hintId));
1,639,185
final DescribeRulesetResult executeDescribeRuleset(DescribeRulesetRequest describeRulesetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRulesetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRulesetRequest> request = null;<NEW_LINE>Response<DescribeRulesetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRulesetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRulesetRequest));<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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRuleset");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRulesetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRulesetResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
1,641,635
private void text(double x, double y, double w, double h, String str, TextAlign align, TextBaseline valign, boolean clip, double rotation) {<NEW_LINE>if (state.fillColor == null) {<NEW_LINE>state.fillColor = convertColor(state.fillColorValue);<NEW_LINE>}<NEW_LINE>if (state.fillColor != null) {<NEW_LINE>x = (state.dx + x) * state.scale;<NEW_LINE>y = (state.dy + y) * state.scale;<NEW_LINE>w *= state.scale;<NEW_LINE>h *= state.scale;<NEW_LINE>// Font-metrics needed below this line<NEW_LINE>Graphics2D g2 = createTextGraphics(x, y, w, h, rotation, clip, align, valign);<NEW_LINE>FontMetrics fm = g2.getFontMetrics();<NEW_LINE>String[] lines = str.split("\n");<NEW_LINE>int[] stringWidths = new int[lines.length];<NEW_LINE>int textWidth = 0;<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>stringWidths[i] = fm.stringWidth(lines[i]);<NEW_LINE>textWidth = Math.max(textWidth, stringWidths[i]);<NEW_LINE>}<NEW_LINE>int textHeight = Math.round(lines.length * (fm.getFont().getSize() * mxConstants.LINE_HEIGHT));<NEW_LINE>if (clip && textHeight > h && h > 0) {<NEW_LINE>textHeight = (int) h;<NEW_LINE>}<NEW_LINE>Point2D margin = getMargin(align, valign);<NEW_LINE>x += margin.getX() * textWidth;<NEW_LINE>y += margin.getY() * textHeight;<NEW_LINE>g2.setColor(state.fillColor);<NEW_LINE>y += fm.getHeight() - fm.getDescent() - (<MASK><NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>double dx = 0;<NEW_LINE>if (align != null) {<NEW_LINE>if (align == TextAlign.center) {<NEW_LINE>dx = (textWidth - stringWidths[i]) / 2;<NEW_LINE>} else if (align == TextAlign.right) {<NEW_LINE>dx = textWidth - stringWidths[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!lines[i].isEmpty()) {<NEW_LINE>g2.drawString(lines[i], (int) Math.round(x + dx), (int) Math.round(y));<NEW_LINE>}<NEW_LINE>y += Math.round(fm.getFont().getSize() * mxConstants.LINE_HEIGHT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
margin.getY() + 0.5);
454,047
public Map<String, Object> mapObject() {<NEW_LINE>try {<NEW_LINE>final Field field = from();<NEW_LINE>final Map<String, Object> fieldMap = mapper.convertValue(field, HashMap.class);<NEW_LINE>fieldMap.put("fieldVariables", new JsonFieldVariableTransformer(field.fieldVariables()).mapList());<NEW_LINE>fieldMap.remove("acceptedDataTypes");<NEW_LINE>fieldMap.remove("dbColumn");<NEW_LINE>if (ImmutableCategoryField.class.getName().equals(fieldMap.get("clazz"))) {<NEW_LINE>try {<NEW_LINE>final Object values = fieldMap.get(VALUES);<NEW_LINE>if (UtilMethods.isSet(values)) {<NEW_LINE>final Category category = APILocator.getCategoryAPI().find(values.toString(), APILocator.getLoginServiceAPI(<MASK><NEW_LINE>if (null == category) {<NEW_LINE>Logger.warn(JsonFieldTransformer.class, () -> String.format("Unable to find category with id '%s' for field named %s. ", values.toString(), field.name()));<NEW_LINE>} else {<NEW_LINE>fieldMap.put(CATEGORIES_PROPERTY_NAME, category.getMap());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final DotSecurityException e) {<NEW_LINE>Logger.error(JsonFieldTransformer.class, e.getMessage());<NEW_LINE>}<NEW_LINE>} else if (ImmutableRelationshipField.class.getName().equals(fieldMap.get("clazz"))) {<NEW_LINE>final String cardinality = fieldMap.remove(VALUES).toString();<NEW_LINE>final String relationType = fieldMap.remove("relationType").toString();<NEW_LINE>fieldMap.put(ContentTypeFieldProperties.RELATIONSHIPS.getName(), map("cardinality", Integer.parseInt(cardinality), "velocityVar", relationType));<NEW_LINE>}<NEW_LINE>fieldMap.put("fieldTypeLabel", LanguageUtil.get(APILocator.getLoginServiceAPI().getLoggedInUser(), field.getContentTypeFieldLabelKey()));<NEW_LINE>fieldMap.put("fieldType", field.getContentTypeFieldLabelKey());<NEW_LINE>return fieldMap;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotStateException(e);<NEW_LINE>}<NEW_LINE>}
).getLoggedInUser(), false);
745,083
public Node activate() {<NEW_LINE>if (!lifecycle.moveToStarted()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>logger.info("activating ...");<NEW_LINE>transportService = injector.getInstance(TransportService.class);<NEW_LINE>transportService.getTaskManager().setTaskResultsService(injector.getInstance(TaskResultsService.class));<NEW_LINE>transportService.start();<NEW_LINE>discovery = (CassandraDiscovery) injector.getInstance(Discovery.class);<NEW_LINE>final ClusterState initialClusterState = discovery.initClusterState(transportService.getLocalNode());<NEW_LINE>final NodeConnectionsService nodeConnectionsService = <MASK><NEW_LINE>nodeConnectionsService.start();<NEW_LINE>clusterService.setNodeConnectionsService(nodeConnectionsService);<NEW_LINE>clusterService.start();<NEW_LINE>injector.getInstance(IndicesService.class).start();<NEW_LINE>injector.getInstance(IndicesClusterStateService.class).start();<NEW_LINE>// gateway should start after disco, so it can try and recovery from gateway on "start"<NEW_LINE>// block until recovery done from cassandra schema.<NEW_LINE>gatewayService().start();<NEW_LINE>logger.info("activated ...");<NEW_LINE>return this;<NEW_LINE>}
injector.getInstance(NodeConnectionsService.class);
108,118
public void onAnalog(String name, float value, float tpf) {<NEW_LINE>if (name.equals("sampleRadiusUp")) {<NEW_LINE>filter.setSampleRadius(filter.getSampleRadius() + 0.01f);<NEW_LINE>System.out.println("Sample Radius : " + filter.getSampleRadius());<NEW_LINE>}<NEW_LINE>if (name.equals("sampleRadiusDown")) {<NEW_LINE>filter.setSampleRadius(filter.getSampleRadius() - 0.01f);<NEW_LINE>System.out.println("Sample Radius : " + filter.getSampleRadius());<NEW_LINE>}<NEW_LINE>if (name.equals("intensityUp")) {<NEW_LINE>filter.setIntensity(filter.getIntensity() + 0.01f);<NEW_LINE>System.out.println("Intensity : " + filter.getIntensity());<NEW_LINE>}<NEW_LINE>if (name.equals("intensityDown")) {<NEW_LINE>filter.setIntensity(filter.getIntensity() - 0.01f);<NEW_LINE>System.out.println("Intensity : " + filter.getIntensity());<NEW_LINE>}<NEW_LINE>if (name.equals("scaleUp")) {<NEW_LINE>filter.setScale(filter.getScale() + 0.01f);<NEW_LINE>System.out.println("scale : " + filter.getScale());<NEW_LINE>}<NEW_LINE>if (name.equals("scaleDown")) {<NEW_LINE>filter.setScale(filter.getScale() - 0.01f);<NEW_LINE>System.out.println("scale : " + filter.getScale());<NEW_LINE>}<NEW_LINE>if (name.equals("biasUp")) {<NEW_LINE>filter.setBias(filter.getBias() + 0.001f);<NEW_LINE>System.out.println(<MASK><NEW_LINE>}<NEW_LINE>if (name.equals("biasDown")) {<NEW_LINE>filter.setBias(filter.getBias() - 0.001f);<NEW_LINE>System.out.println("bias : " + filter.getBias());<NEW_LINE>}<NEW_LINE>}
"bias : " + filter.getBias());
1,190,023
public AsyncFuture<List<URI>> find() {<NEW_LINE>final ImmutableList.Builder<AsyncFuture<List<URI>>> lookups = ImmutableList.builder();<NEW_LINE>for (final String record : records) {<NEW_LINE>lookups.add(async.call(() -> {<NEW_LINE>log.info("Resolving SRV records for: {}", record);<NEW_LINE>final Lookup lookup = new Lookup(record, Type.SRV, DClass.IN);<NEW_LINE>final Record[] result = lookup.run();<NEW_LINE>if (lookup.getResult() != Lookup.SUCCESSFUL) {<NEW_LINE>log.error("Failed to lookup record: {}: {}", record, lookup.getErrorString());<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>final ImmutableList.Builder<URI> results = ImmutableList.builder();<NEW_LINE>if (result != null) {<NEW_LINE>for (final Record a : result) {<NEW_LINE>final SRVRecord srv = (SRVRecord) a;<NEW_LINE>results.add(new URI(protocol.orElse(DEFAULT_PROTOCOL) + "://" + srv.getTarget().canonicalize() + ":" + port.orElse(srv.getPort())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results.build();<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>return async.collect(lookups.build()).directTransform(all -> {<NEW_LINE>final ImmutableList.Builder<URI> results = ImmutableList.builder();<NEW_LINE>all.forEach(results::addAll);<NEW_LINE>return results.build();<NEW_LINE>});<NEW_LINE>}
ImmutableList.<URI>of();
985,208
public String normalize(String path, int normalizationLevel) {<NEW_LINE>if (normalizationLevel == NORMALIZED) {<NEW_LINE>return path;<NEW_LINE>}<NEW_LINE>if (normalizationLevel == NEEDS_SHORT_PATH_NORMALIZATION) {<NEW_LINE>String resolvedPath = shortPathResolver.resolveShortPath(path);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>path = resolvedPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] segments = Iterables.toArray(WINDOWS_PATH_SPLITTER.splitToList<MASK><NEW_LINE>int driveStrLength = getDriveStrLength(path);<NEW_LINE>boolean isAbsolute = driveStrLength > 0;<NEW_LINE>int segmentSkipCount = isAbsolute && driveStrLength > 1 ? 1 : 0;<NEW_LINE>StringBuilder sb = new StringBuilder(path.length());<NEW_LINE>if (isAbsolute) {<NEW_LINE>char c = path.charAt(0);<NEW_LINE>if (isSeparator(c)) {<NEW_LINE>sb.append('/');<NEW_LINE>} else {<NEW_LINE>sb.append(Character.toUpperCase(c));<NEW_LINE>sb.append(":/");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int segmentCount = Utils.removeRelativePaths(segments, segmentSkipCount, isAbsolute);<NEW_LINE>for (int i = 0; i < segmentCount; ++i) {<NEW_LINE>sb.append(segments[i]);<NEW_LINE>sb.append('/');<NEW_LINE>}<NEW_LINE>if (segmentCount > 0) {<NEW_LINE>sb.deleteCharAt(sb.length() - 1);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(path), String.class);
247,648
public void configure() {<NEW_LINE>// @formatter:off<NEW_LINE>errorHandler(defaultErrorHandler());<NEW_LINE>onException(Exception.class).log("Exception thrown inside the error reporting route! ");<NEW_LINE>from(direct(MF_ERROR_ROUTE_ID)).routeId(MF_ERROR_ROUTE_ID).streamCaching().multicast().parallelProcessing(true).to(direct(ERROR_WRITE_TO_FILE), direct(ERROR_SEND_LOG_MESSAGE)).end();<NEW_LINE>from(direct(ERROR_WRITE_TO_FILE)).routeId(ERROR_WRITE_TO_FILE).log("Route invoked").process(this::prepareErrorFile).to("{{metasfresh.error-report.folder}}");<NEW_LINE>from(direct(ERROR_WRITE_TO_ADISSUE)).routeId(ERROR_WRITE_TO_ADISSUE).log("Route invoked").process(this::prepareJsonErrorRequest).marshal(CamelRouteHelper.setupJacksonDataFormatFor(getContext(), JsonError.class)).removeHeaders("CamelHttp*").setHeader(CoreConstants.AUTHORIZATION, simple(CoreConstants.AUTHORIZATION_TOKEN)).setHeader(Exchange.HTTP_METHOD, constant(HttpEndpointBuilderFactory.HttpMethods.POST)).toD("{{" + <MASK><NEW_LINE>from(direct(ERROR_SEND_LOG_MESSAGE)).routeId(ERROR_SEND_LOG_MESSAGE).log("Route invoked").process(this::prepareErrorLogMessage).to(direct(MF_LOG_MESSAGE_ROUTE_ID));<NEW_LINE>// @formatter:on<NEW_LINE>}
MF_EXTERNAL_SYSTEM_V2_URI + "}}/externalstatus/${header." + HEADER_PINSTANCE_ID + "}/error");
71,034
// The tested deployment exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC<NEW_LINE>public void launchTck() throws Exception {<NEW_LINE>// disable tests for Java versions 11.0.0 - 11.0.3 since there's a bug in TLS 1.3 implementation<NEW_LINE>JavaInfo javaInfo = JavaInfo.forServer(server);<NEW_LINE>assumeTrue(!(javaInfo.majorVersion() == 11 && javaInfo.minorVersion() == 0 && javaInfo<MASK><NEW_LINE>String protocol = "https";<NEW_LINE>String host = server.getHostname();<NEW_LINE>String port = Integer.toString(server.getHttpDefaultSecurePort());<NEW_LINE>Map<String, String> additionalProps = new HashMap<>();<NEW_LINE>additionalProps.put("test.url", protocol + "://" + host + ":" + port);<NEW_LINE>additionalProps.put("test.user", "theUser");<NEW_LINE>additionalProps.put("test.pwd", "thePassword");<NEW_LINE>MvnUtils.runTCKMvnCmd(server, "com.ibm.ws.microprofile.metrics.2.2_fat_tck", "launchTck", additionalProps);<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE>resultInfo.put("results_type", "MicroProfile");<NEW_LINE>resultInfo.put("feature_name", "Metrics");<NEW_LINE>resultInfo.put("feature_version", "2.2");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>}
.microVersion() <= 3));
458,980
private Map<String, Set<String>> listPortNames(Archive archive) {<NEW_LINE>try (URLClassLoader moduleClassLoader = new BootClassLoaderFactory(archive, parent).createClassLoader()) {<NEW_LINE>Set<String> inboundPorts = new HashSet<>();<NEW_LINE>Set<String> outboundPorts = new HashSet<>();<NEW_LINE>Map<String, Set<String>> portsMap = new HashMap<>();<NEW_LINE>for (Resource resource : visibleConfigurationMetadataResources(moduleClassLoader)) {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.load(resource.getInputStream());<NEW_LINE>inboundPorts.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_INBOUND_PORTS), ",", " ")));<NEW_LINE>portsMap.put("inbound", inboundPorts);<NEW_LINE>outboundPorts.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(properties.getProperty(CONFIGURATION_PROPERTIES_OUTBOUND_PORTS), ",", " ")));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return portsMap;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AppMetadataResolutionException("Exception trying to list configuration properties for application " + archive, e);<NEW_LINE>}<NEW_LINE>}
portsMap.put("outbound", outboundPorts);
579,264
public void notify(@NonNull final CamelEvent event) {<NEW_LINE>try {<NEW_LINE>if (event instanceof CamelEvent.ExchangeSendingEvent) {<NEW_LINE>final CamelEvent.ExchangeSendingEvent sendingEvent = (CamelEvent.ExchangeSendingEvent) event;<NEW_LINE>final Exchange exchange = ExchangeHelper.createCopy(sendingEvent.getExchange(), false);<NEW_LINE>handleEvent(exchange, EP_INVOKED_PREFIX + extractEndpointURI<MASK><NEW_LINE>} else if (event instanceof CamelEvent.ExchangeSentEvent) {<NEW_LINE>final CamelEvent.ExchangeSentEvent sentEvent = (CamelEvent.ExchangeSentEvent) event;<NEW_LINE>final Exchange exchange = ExchangeHelper.createCopy(sentEvent.getExchange(), false);<NEW_LINE>handleEvent(exchange, EP_INVOCATION_DONE_PREFIX + extractEndpointURI(sentEvent.getEndpoint()));<NEW_LINE>}<NEW_LINE>} catch (final Exception exception) {<NEW_LINE>final Exchange sourceExchange = ((CamelEvent.ExchangeEvent) event).getExchange();<NEW_LINE>if (sourceExchange == null || sourceExchange.getIn() == null || sourceExchange.getIn().getHeader(HEADER_PINSTANCE_ID) == null) {<NEW_LINE>logger.log(Level.SEVERE, "Audit failed! and no pInstance could be obtained from source exchange!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Map<String, Object> headers = new HashMap<>();<NEW_LINE>headers.put(HEADER_PINSTANCE_ID, sourceExchange.getIn().getHeader(HEADER_PINSTANCE_ID, Object.class));<NEW_LINE>headers.put(Exchange.EXCEPTION_CAUGHT, exception);<NEW_LINE>producerTemplate.sendBodyAndHeaders("direct:" + ERROR_WRITE_TO_ADISSUE, null, headers);<NEW_LINE>}<NEW_LINE>}
(sendingEvent.getEndpoint()));
510,735
private void collectItems(JSONObject json) throws IllegalArgumentException, JSONException {<NEW_LINE>JSONArray itemsJson = json.getJSONArray("items");<NEW_LINE>int version = json.has("version") ? json.getInt("version") : 1;<NEW_LINE>if (version > SettingsHelper.VERSION) {<NEW_LINE>throw new IllegalArgumentException("Unsupported osf version: " + version);<NEW_LINE>}<NEW_LINE>Map<String, List<SettingsItem>> pluginItems = new HashMap<>();<NEW_LINE>for (int i = 0; i < itemsJson.length(); i++) {<NEW_LINE>JSONObject itemJson = itemsJson.getJSONObject(i);<NEW_LINE>SettingsItem item;<NEW_LINE>try {<NEW_LINE>item = createItem(itemJson);<NEW_LINE>// unknown type<NEW_LINE>if (item == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>items.add(item);<NEW_LINE><MASK><NEW_LINE>if (pluginId != null && item.getType() != SettingsItemType.PLUGIN) {<NEW_LINE>List<SettingsItem> items = pluginItems.get(pluginId);<NEW_LINE>if (items != null) {<NEW_LINE>items.add(item);<NEW_LINE>} else {<NEW_LINE>items = new ArrayList<>();<NEW_LINE>items.add(item);<NEW_LINE>pluginItems.put(pluginId, items);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>SettingsHelper.LOG.error("Error creating item from json: " + itemJson, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (SettingsItem item : items) {<NEW_LINE>if (item instanceof PluginSettingsItem) {<NEW_LINE>PluginSettingsItem pluginSettingsItem = ((PluginSettingsItem) item);<NEW_LINE>List<SettingsItem> pluginDependentItems = pluginItems.get(pluginSettingsItem.getName());<NEW_LINE>if (!Algorithms.isEmpty(pluginDependentItems)) {<NEW_LINE>pluginSettingsItem.getPluginDependentItems().addAll(pluginDependentItems);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String pluginId = item.getPluginId();
190,149
private void addItemsInRange(AssetInfo asset, List<FeeItem> feeItems, FeeItemsAlgorithm algorithm, int txSize, int scale) {<NEW_LINE>for (int i = algorithm.getMinPosition(); i < algorithm.getMaxPosition(); i++) {<NEW_LINE>FeeItem currFeeItem = createFeeItem(asset, txSize, algorithm<MASK><NEW_LINE>FeeItem prevFeeItem = !feeItems.isEmpty() ? feeItems.get(feeItems.size() - 1) : null;<NEW_LINE>boolean canAdd = prevFeeItem == null || prevFeeItem.feePerKb < currFeeItem.feePerKb;<NEW_LINE>if (currFeeItem.value != null && prevFeeItem != null && prevFeeItem.value != null && currFeeItem.fiatValue != null && prevFeeItem.fiatValue != null) {<NEW_LINE>String currFiatFee = currFeeItem.fiatValue.toString();<NEW_LINE>String prevFiatFee = prevFeeItem.fiatValue.toString();<NEW_LINE>// if we reached this, then we can override canAdd<NEW_LINE>canAdd = (float) currFeeItem.feePerKb / prevFeeItem.feePerKb >= MIN_FEE_INCREMENT && !currFiatFee.equals(prevFiatFee);<NEW_LINE>}<NEW_LINE>if (canAdd) {<NEW_LINE>feeItems.add(currFeeItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.computeValue(i), scale);
1,061,144
public boolean performOk() {<NEW_LINE>IPreferenceStore store = getPreferenceStore();<NEW_LINE>store.setValue(ICorePreferenceConstants.PREF_DEBUG_LEVEL, StatusLevel.values()[debugCombo.getSelectionIndex()].toString());<NEW_LINE>String[] currentOptions = EclipseUtil.getCurrentDebuggableComponents();<NEW_LINE>EclipseUtil.setBundleDebugOptions(currentOptions, false);<NEW_LINE>List<String> al <MASK><NEW_LINE>Object[] elements = categoryViewer.getCheckedElements();<NEW_LINE>for (Object i : elements) {<NEW_LINE>al.add((String) i);<NEW_LINE>}<NEW_LINE>String[] newOptions = al.toArray(new String[al.size()]);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>store.setValue(ICorePreferenceConstants.PREF_DEBUG_COMPONENT_LIST, StringUtil.join(",", newOptions));<NEW_LINE>EclipseUtil.setBundleDebugOptions(newOptions, true);<NEW_LINE>EclipseUtil.setPlatformDebugging(toggleComponents.getBooleanValue());<NEW_LINE>return super.performOk();<NEW_LINE>}
= new ArrayList<String>();
942,573
private void sortTable(Table table) {<NEW_LINE>TableItem[] items = table.getItems();<NEW_LINE>Collator collator = Collator.getInstance(Locale.getDefault());<NEW_LINE>for (int i = 1; i < items.length; i++) {<NEW_LINE>String value1 = items[i].getText(0);<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>String value2 = items<MASK><NEW_LINE>if (collator.compare(value1, value2) < 0) {<NEW_LINE>String text = items[i].getText(0);<NEW_LINE>boolean checked = items[i].getChecked();<NEW_LINE>Object data = items[i].getData();<NEW_LINE>items[i].dispose();<NEW_LINE>TableItem item = new TableItem(table, SWT.NONE, j);<NEW_LINE>item.setText(text);<NEW_LINE>item.setChecked(checked);<NEW_LINE>item.setData(data);<NEW_LINE>items = table.getItems();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[j].getText(0);
1,277,152
private void validateConverterTypes(InternalIndex index, String mapName, List<QueryDataType> expectedConverterTypes, List<QueryDataType> actualConverterTypes) {<NEW_LINE>for (int i = 0; i < Math.min(expectedConverterTypes.size(), actualConverterTypes.size()); i++) {<NEW_LINE>QueryDataType expected = expectedConverterTypes.get(i);<NEW_LINE>QueryDataType actual = actualConverterTypes.get(i);<NEW_LINE>if (!expected.equals(actual)) {<NEW_LINE>String component = index.getComponents()[i];<NEW_LINE>throw QueryException.error(SqlErrorCode.INDEX_INVALID, "Cannot use the index \"" + index.getName() + "\" of the IMap \"" + mapName + "\" because it has component \"" + component + "\" of type " + actual.getTypeFamily() + ", but " + expected.getTypeFamily() + " was expected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expectedConverterTypes.size() > actualConverterTypes.size()) {<NEW_LINE>QueryDataType expected = expectedConverterTypes.<MASK><NEW_LINE>String component = index.getComponents()[actualConverterTypes.size()];<NEW_LINE>throw QueryException.error(SqlErrorCode.INDEX_INVALID, "Cannot use the index \"" + index.getName() + "\" of the IMap \"" + mapName + "\" because it does not have suitable converter for component \"" + component + "\" (expected " + expected.getTypeFamily() + ")");<NEW_LINE>}<NEW_LINE>}
get(actualConverterTypes.size());
1,675,914
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('T0') create table TableZero(k0 string primary key, v0 int);\n" + "@name('T1') create table TableOne(k1 string primary key, v1 int);\n" + "on SupportBean merge TableZero " + " where theString = k0 when not matched " + " then insert select theString as k0, intPrimitive as v0" + " then insert into TableOne(k1, v1) select theString, intPrimitive;\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>assertTables(env, new Object[][] { { "E1", 1 } });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 3));<NEW_LINE>assertTables(env, new Object[][] { { "E1", 1 }, { "E2", 2 } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E1", 1));
89,641
int removeUsagesBulk(@Nonnull Set<UsageNode> usages, @Nonnull DefaultTreeModel treeModel) {<NEW_LINE>ApplicationManager<MASK><NEW_LINE>int removed = 0;<NEW_LINE>synchronized (this) {<NEW_LINE>List<MutableTreeNode> removedNodes = new SmartList<>();<NEW_LINE>for (UsageNode usage : usages) {<NEW_LINE>if (myChildren.remove(usage)) {<NEW_LINE>removedNodes.add(usage);<NEW_LINE>removed++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (removed == 0) {<NEW_LINE>for (GroupNode groupNode : getSubGroups()) {<NEW_LINE>int delta = groupNode.removeUsagesBulk(usages, treeModel);<NEW_LINE>if (delta > 0) {<NEW_LINE>if (groupNode.getRecursiveUsageCount() == 0) {<NEW_LINE>myChildren.remove(groupNode);<NEW_LINE>removedNodes.add(groupNode);<NEW_LINE>}<NEW_LINE>removed += delta;<NEW_LINE>if (removed == usages.size())<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!myChildren.isEmpty()) {<NEW_LINE>removeNodesFromParent(treeModel, this, removedNodes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (removed > 0) {<NEW_LINE>myRecursiveUsageCount -= removed;<NEW_LINE>if (myRecursiveUsageCount != 0) {<NEW_LINE>treeModel.nodeChanged(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return removed;<NEW_LINE>}
.getApplication().assertIsDispatchThread();
727,342
private Set<Symbol> notAssignedInAnyInitializer(FieldInitEntities entities, Set<Symbol> notInitializedInConstructors, VisitorState state) {<NEW_LINE>Trees trees = getTreesInstance(state);<NEW_LINE>Symbol.ClassSymbol classSymbol = entities.classSymbol();<NEW_LINE>ImmutableSet.Builder<Element> initInSomeInitializerBuilder = ImmutableSet.builder();<NEW_LINE>for (MethodTree initMethodTree : entities.instanceInitializerMethods()) {<NEW_LINE>if (initMethodTree.getBody() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>addInitializedFieldsForBlock(state, trees, classSymbol, initInSomeInitializerBuilder, initMethodTree.getBody(), new TreePath(state.getPath(), initMethodTree));<NEW_LINE>}<NEW_LINE>for (BlockTree block : entities.instanceInitializerBlocks()) {<NEW_LINE>addInitializedFieldsForBlock(state, trees, classSymbol, initInSomeInitializerBuilder, block, new TreePath(state<MASK><NEW_LINE>}<NEW_LINE>Set<Symbol> result = new LinkedHashSet<>();<NEW_LINE>ImmutableSet<Element> initInSomeInitializer = initInSomeInitializerBuilder.build();<NEW_LINE>for (Symbol fieldSymbol : notInitializedInConstructors) {<NEW_LINE>if (!initInSomeInitializer.contains(fieldSymbol)) {<NEW_LINE>result.add(fieldSymbol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.getPath(), block));
932,652
public void run() {<NEW_LINE>if (null == socket)<NEW_LINE>return;<NEW_LINE>DataInputStream input = null;<NEW_LINE>DataOutputStream output = null;<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Client connected from " + socket.getRemoteSocketAddress());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>input = new DataInputStream(socket.getInputStream());<NEW_LINE>output = new DataOutputStream(socket.getOutputStream());<NEW_LINE>// read the message length<NEW_LINE>int msgLen = input.readInt();<NEW_LINE>// create a buffer<NEW_LINE>byte[] data = new byte[msgLen];<NEW_LINE>// read the entire message (blocks until complete)<NEW_LINE>input.readFully(data);<NEW_LINE>if (data.length < 1) {<NEW_LINE>throw new Exception("Client did not send data.");<NEW_LINE>}<NEW_LINE>// now convert the raw bytes to utf-8<NEW_LINE>String tmp = new String(data, "UTF-8");<NEW_LINE>StringReader reader = new StringReader(tmp);<NEW_LINE>// get the realisation<NEW_LINE>String result = doRealisation(reader).trim();<NEW_LINE>// convert the string to raw bytes<NEW_LINE>byte[] <MASK><NEW_LINE>// write the length<NEW_LINE>output.writeInt(tmp2.length);<NEW_LINE>// write the data<NEW_LINE>output.write(tmp2);<NEW_LINE>if (DEBUG) {<NEW_LINE>String text = "The following realisation was sent to client:";<NEW_LINE>System.out.println(text + "\n\t" + result);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>try {<NEW_LINE>// attempt to send the error message to the client<NEW_LINE>byte[] tmp = ("Exception: " + e.getMessage()).getBytes("UTF-8");<NEW_LINE>output.writeInt(tmp.length);<NEW_LINE>output.write(tmp);<NEW_LINE>} catch (IOException e1) {<NEW_LINE>}<NEW_LINE>} catch (XMLRealiserException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>try {<NEW_LINE>// attempt to send the error message to the client<NEW_LINE>byte[] tmp = ("Exception: " + e.getMessage()).getBytes("UTF-8");<NEW_LINE>output.writeInt(tmp.length);<NEW_LINE>output.write(tmp);<NEW_LINE>} catch (IOException e1) {<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>socket.close();<NEW_LINE>socket = null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Could not close client socket!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
tmp2 = result.getBytes("UTF-8");
1,073,026
private Object toCommon(Class srcClass, Class targetClass, BigDecimal value) {<NEW_LINE>if (targetClass == srcClass) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (targetClass == Double.class || targetClass == double.class || targetClass == Float.class || targetClass == float.class) {<NEW_LINE>return toCommon(srcClass, targetClass, value.doubleValue());<NEW_LINE>}<NEW_LINE>if (targetClass == Decimal.class) {<NEW_LINE>return Decimal.fromBigDecimal(value);<NEW_LINE>}<NEW_LINE>if (value.precision() - value.scale() > 100) {<NEW_LINE>throw new ConvertorException("BigDecimal overflow: [" + <MASK><NEW_LINE>}<NEW_LINE>if (targetClass == BigInteger.class) {<NEW_LINE>return value.setScale(0, BigDecimal.ROUND_HALF_UP).toBigInteger();<NEW_LINE>}<NEW_LINE>BigDecimal rounded = value.setScale(0, BigDecimal.ROUND_HALF_UP);<NEW_LINE>return toCommon(srcClass, targetClass, rounded.longValue());<NEW_LINE>}
value.toString() + "]");
914,329
private static void downloadFile(URL assetDownloadURL, long assetDownloadSize) {<NEW_LINE>final JFileChooser chooser = MapTool.getFrame().getSaveFileChooser();<NEW_LINE>chooser.setSelectedFile(new File(assetDownloadURL.getFile()));<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>File chosenLocation = null;<NEW_LINE>while (chosenLocation == null) {<NEW_LINE>// Last chance to "cancel" but canceling out of JFileChooser<NEW_LINE>if (chooser.showSaveDialog(MapTool.getFrame()) != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>chosenLocation = chooser.getSelectedFile();<NEW_LINE>try {<NEW_LINE>boolean newFile = chosenLocation.createNewFile();<NEW_LINE>if (!newFile) {<NEW_LINE>MapTool.showError(I18N.getText("msg.error.fileAlreadyExists", chosenLocation));<NEW_LINE>chosenLocation = null;<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>MapTool.showError(I18N.getText("msg.error.directoryNotWriteable", chosenLocation));<NEW_LINE>chosenLocation = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final File saveLocation = chooser.getSelectedFile();<NEW_LINE>log.info("URL: " + assetDownloadURL.toString());<NEW_LINE>log.info("assetDownloadSize: " + assetDownloadSize);<NEW_LINE>Runnable updatethread = () -> {<NEW_LINE>try (InputStream stream = assetDownloadURL.openStream()) {<NEW_LINE>ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(MapTool.getFrame(), "Downloading...\n", stream);<NEW_LINE>UIManager.put("ProgressMonitor.progressText", "New Update");<NEW_LINE>ProgressMonitor pm = pmis.getProgressMonitor();<NEW_LINE>pm.setMillisToDecideToPopup(500);<NEW_LINE>pm.setMillisToPopup(500);<NEW_LINE>pm.<MASK><NEW_LINE>pm.setMinimum(0);<NEW_LINE>pm.setMaximum((int) assetDownloadSize);<NEW_LINE>FileUtils.copyInputStreamToFile(pmis, saveLocation);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>MapTool.showError("msg.error.failedSavingNewVersion", ioe);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>new Thread(updatethread).start();<NEW_LINE>}
setNote(assetDownloadURL.toString());
1,260,936
protected JSONObject _lapseConf(@NonNull Card card) {<NEW_LINE>DeckConfig conf = _cardConf(card);<NEW_LINE>if (!card.isInDynamicDeck()) {<NEW_LINE>return conf.getJSONObject("lapse");<NEW_LINE>}<NEW_LINE>// dynamic deck; override some attributes, use original deck for others<NEW_LINE>DeckConfig oconf = mCol.getDecks().confForDid(card.getODid());<NEW_LINE>JSONArray delays = conf.optJSONArray("delays");<NEW_LINE>if (delays == null) {<NEW_LINE>delays = oconf.getJSONObject("lapse").getJSONArray("delays");<NEW_LINE>}<NEW_LINE>JSONObject dict = new JSONObject();<NEW_LINE>// original deck<NEW_LINE>dict.put("minInt", oconf.getJSONObject("lapse").getInt("minInt"));<NEW_LINE>dict.put("leechFails", oconf.getJSONObject("lapse").getInt("leechFails"));<NEW_LINE>dict.put("leechAction", oconf.getJSONObject("lapse").getInt("leechAction"));<NEW_LINE>dict.put("mult", oconf.getJSONObject(<MASK><NEW_LINE>// overrides<NEW_LINE>dict.put("delays", delays);<NEW_LINE>dict.put("resched", conf.getBoolean("resched"));<NEW_LINE>return dict;<NEW_LINE>}
"lapse").getDouble("mult"));
199,640
public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement lookupElement, @NotNull TwigExtension twigExtension) {<NEW_LINE>// {{ form_javasc|() }}<NEW_LINE>// {{ form_javasc| }}<NEW_LINE>if (PhpInsertHandlerUtil.isStringAtCaret(context.getEditor(), "(")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FunctionInsertHandler.getInstance().handleInsert(context, lookupElement);<NEW_LINE>// if first parameter is a string type; add quotes<NEW_LINE>for (PsiElement psiElement : PhpElementsUtil.getPsiElementsBySignature(context.getProject(), twigExtension.getSignature())) {<NEW_LINE>if (!(psiElement instanceof Function)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Parameter[] parameters = ((Function) psiElement).getParameters();<NEW_LINE>// skip Twig parameter, we need first function parameter<NEW_LINE>int parameter = 0;<NEW_LINE>if (twigExtension.getOption("needs_context") != null) {<NEW_LINE>parameter++;<NEW_LINE>}<NEW_LINE>if (twigExtension.getOption("needs_environment") != null) {<NEW_LINE>parameter++;<NEW_LINE>}<NEW_LINE>if (parameters.length <= parameter) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!isString(parameters[parameter].getType())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// wrap caret with '' so we have foobar('<caret>')<NEW_LINE>PhpInsertHandlerUtil.insertStringAtCaret(<MASK><NEW_LINE>context.getEditor().getCaretModel().moveCaretRelatively(-1, 0, false, false, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
context.getEditor(), "''");
172,944
private void createElevatorHopEdges(ArrayList<Vertex> onboardVertices, boolean wheelchairAccessible, boolean bicycleAllowed, int levels, int travelTime) {<NEW_LINE>// -1 because we loop over onboardVertices two at a time<NEW_LINE>for (int i = 0, vSize = onboardVertices.size() - 1; i < vSize; i++) {<NEW_LINE>Vertex from = onboardVertices.get(i);<NEW_LINE>Vertex to = <MASK><NEW_LINE>// default permissions: pedestrian, wheelchair, check tag bicycle=yes<NEW_LINE>StreetTraversalPermission permission = bicycleAllowed ? StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE : StreetTraversalPermission.PEDESTRIAN;<NEW_LINE>ElevatorHopEdge foreEdge;<NEW_LINE>ElevatorHopEdge backEdge;<NEW_LINE>if (travelTime > -1 && levels > 0) {<NEW_LINE>foreEdge = new ElevatorHopEdge(from, to, permission, levels, travelTime);<NEW_LINE>backEdge = new ElevatorHopEdge(to, from, permission, levels, travelTime);<NEW_LINE>} else {<NEW_LINE>foreEdge = new ElevatorHopEdge(from, to, permission);<NEW_LINE>backEdge = new ElevatorHopEdge(to, from, permission);<NEW_LINE>}<NEW_LINE>foreEdge.wheelchairAccessible = wheelchairAccessible;<NEW_LINE>backEdge.wheelchairAccessible = wheelchairAccessible;<NEW_LINE>}<NEW_LINE>}
onboardVertices.get(i + 1);
1,838,342
public ConfigService nacosConfigService(final NacosProperties nacosProp) throws Exception {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>if (Objects.nonNull(nacosProp.getAcm()) && nacosProp.getAcm().isEnabled()) {<NEW_LINE>// Use aliyun ACM service<NEW_LINE>properties.put(PropertyKeyConst.ENDPOINT, nacosProp.getAcm().getEndpoint());<NEW_LINE>properties.put(PropertyKeyConst.NAMESPACE, nacosProp.getAcm().getNamespace());<NEW_LINE>// Use subaccount ACM administrative authority<NEW_LINE>properties.put(PropertyKeyConst.ACCESS_KEY, nacosProp.<MASK><NEW_LINE>properties.put(PropertyKeyConst.SECRET_KEY, nacosProp.getAcm().getSecretKey());<NEW_LINE>} else {<NEW_LINE>properties.put(PropertyKeyConst.SERVER_ADDR, nacosProp.getUrl());<NEW_LINE>if (StringUtils.isNotBlank(nacosProp.getNamespace())) {<NEW_LINE>properties.put(PropertyKeyConst.NAMESPACE, nacosProp.getNamespace());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(nacosProp.getUsername())) {<NEW_LINE>properties.put(PropertyKeyConst.USERNAME, nacosProp.getUsername());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(nacosProp.getPassword())) {<NEW_LINE>properties.put(PropertyKeyConst.PASSWORD, nacosProp.getPassword());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NacosFactory.createConfigService(properties);<NEW_LINE>}
getAcm().getAccessKey());
1,166,710
private static int toggleSubscription(CommandSourceStack source, String player_name, String logName) {<NEW_LINE>Player player = source.getServer().getPlayerList().getPlayerByName(player_name);<NEW_LINE>if (player == null) {<NEW_LINE>Messenger.m(source, "r No player specified");<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (LoggerRegistry.getLogger(logName) == null) {<NEW_LINE>Messenger.m(<MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>boolean subscribed = LoggerRegistry.togglePlayerSubscription(player_name, logName);<NEW_LINE>if (subscribed) {<NEW_LINE>Messenger.m(source, "gi " + player_name + " subscribed to " + logName + ".");<NEW_LINE>} else {<NEW_LINE>Messenger.m(source, "gi " + player_name + " unsubscribed from " + logName + ".");<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}
source, "r Unknown logger: ", "rb " + logName);
768,190
private void processType(ResolvableType type, InspectionCache cache, Consumer<TypeModel> callback) {<NEW_LINE>if (ResolvableType.NONE.equals(type) || cache.contains(type.toClass()) || !typeFilter.test(type.toClass())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeModel result = new TypeModel(type.toClass());<NEW_LINE>cache.put(result.getType(), result);<NEW_LINE>Set<Type> additionalTypes = new LinkedHashSet<>();<NEW_LINE>additionalTypes.addAll(TypeUtils.resolveTypesInSignature(type));<NEW_LINE>additionalTypes.addAll(visitConstructorsOfType(type, result));<NEW_LINE>additionalTypes.addAll(visitMethodsOfType(type, result));<NEW_LINE>additionalTypes.addAll(visitFieldsOfType(type, result));<NEW_LINE>if (result.hasDeclaredClasses()) {<NEW_LINE>additionalTypes.addAll(Arrays.asList(result.getType().getDeclaredClasses()));<NEW_LINE>}<NEW_LINE>callback.accept(result);<NEW_LINE>for (Type discoveredType : additionalTypes) {<NEW_LINE>processType(ResolvableType.forType(discoveredType<MASK><NEW_LINE>}<NEW_LINE>}
, type), cache, callback);
1,691,682
public void updateClob(int i, Reader x, long length) throws SQLException {<NEW_LINE>try {<NEW_LINE>rsetImpl.updateClob(i, x, length);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".updateClob", "3828", this);<NEW_LINE>throw WSJdbcUtil.mapException(this, sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level.<NEW_LINE>throw AdapterUtil.notSupportedX("ResultSet.updateClob", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".updateClob", "4458", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(<MASK><NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".updateClob", "4465", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateClob", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>}
this, tc, "updateClob", runX);
832,745
public int compare(@Nullable String currentVersion, String v1, String v2) {<NEW_LINE>StringBuilder nv1 = new StringBuilder(normalizeVersion(v1));<NEW_LINE>StringBuilder nv2 = new StringBuilder(normalizeVersion(v2));<NEW_LINE>long vp1 = countVersionParts(nv1.toString());<NEW_LINE>long vp2 = countVersionParts(nv2.toString());<NEW_LINE>long abs = Math.abs(vp1 - vp2);<NEW_LINE>if (vp1 > vp2) {<NEW_LINE>for (int i = 1; i <= abs; i++) {<NEW_LINE>nv2.append(".0");<NEW_LINE>}<NEW_LINE>} else if (vp2 > vp1) {<NEW_LINE>for (int i = 1; i <= abs; i++) {<NEW_LINE>nv1.append(".0");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matcher v1Gav = VersionComparator.RELEASE_PATTERN.matcher(nv1.toString());<NEW_LINE>Matcher v2Gav = VersionComparator.RELEASE_PATTERN.matcher(nv2.toString());<NEW_LINE>v1Gav.matches();<NEW_LINE>v2Gav.matches();<NEW_LINE>// Remove the metadata pattern from the normalized versions, this only impacts the comparison when all version<NEW_LINE>// parts are the same:<NEW_LINE>//<NEW_LINE>// HyphenRange [25-28] should include "28-jre" and "28-android" as possible candidates.<NEW_LINE>String normalized1 = metadataPattern == null ? nv1.toString() : nv1.toString().replace(metadataPattern, "");<NEW_LINE>String normalized2 = metadataPattern == null ? nv2.toString() : nv1.toString().replace(metadataPattern, "");<NEW_LINE>for (int i = 1; i < nv1.length(); i++) {<NEW_LINE>String v1Part = v1Gav.group(i);<NEW_LINE>String v2Part = v2Gav.group(i);<NEW_LINE>if (v1Part == null) {<NEW_LINE>return v2Part == null ? normalized1.compareTo(normalized2) : -1;<NEW_LINE>} else if (v2Part == null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>int diff = parseInt<MASK><NEW_LINE>if (diff != 0) {<NEW_LINE>return diff;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return normalized1.compareTo(normalized2);<NEW_LINE>}
(v1Part) - parseInt(v2Part);
1,464,242
public boolean rangeCanBeVisible(int startOffset, int endOffset) {<NEW_LINE>assert startOffset >= 0;<NEW_LINE>assert startOffset <= endOffset;<NEW_LINE>assert endOffset <= myEditor.getDocument().getTextLength();<NEW_LINE>if (myEditor.getSettings().isUseSoftWraps())<NEW_LINE>return true;<NEW_LINE>if (startOffset < myVisualLineStartOffset || startOffset > myVisualLineEndOffset) {<NEW_LINE>myVisualLineStartOffset = EditorUtil.getNotFoldedLineStartOffset(myEditor, startOffset);<NEW_LINE>myVisualLineEndOffset = EditorUtil.getNotFoldedLineEndOffset(myEditor, startOffset);<NEW_LINE>int visualLine = myEditor.offsetToVisualLine(startOffset);<NEW_LINE>int <MASK><NEW_LINE>myVisualLineClipStartOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(myClipRectangle.x, y)));<NEW_LINE>myVisualLineClipEndOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(myClipRectangle.x + myClipRectangle.width, y)));<NEW_LINE>}<NEW_LINE>return endOffset > myVisualLineEndOffset || startOffset <= myVisualLineClipEndOffset && endOffset >= myVisualLineClipStartOffset;<NEW_LINE>}
y = myEditor.visualLineToY(visualLine);
214,040
public void onItemLongClick(int position, View v, TimelineModel item) {<NEW_LINE>if (getView() == null)<NEW_LINE>return;<NEW_LINE>if (item.getType() == TimelineModel.COMMENT || item.getType() == TimelineModel.HEADER) {<NEW_LINE>if (v.getId() == R.id.commentMenu && item.getType() == TimelineModel.COMMENT) {<NEW_LINE>Comment comment = item.getComment();<NEW_LINE>if (getView() != null)<NEW_LINE>getView().onReply(comment.getUser(), comment.getBody());<NEW_LINE>} else {<NEW_LINE>if (getView().getIssue() == null)<NEW_LINE>return;<NEW_LINE>Issue issue = getView().getIssue();<NEW_LINE><MASK><NEW_LINE>String repoId = issue.getRepoId();<NEW_LINE>if (!InputHelper.isEmpty(login) && !InputHelper.isEmpty(repoId)) {<NEW_LINE>ReactionTypes type = ReactionTypes.get(v.getId());<NEW_LINE>if (type != null) {<NEW_LINE>if (item.getType() == TimelineModel.HEADER) {<NEW_LINE>getView().showReactionsPopup(type, login, repoId, item.getIssue().getNumber(), true);<NEW_LINE>} else {<NEW_LINE>getView().showReactionsPopup(type, login, repoId, item.getComment().getId(), false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>onItemClick(position, v, item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>onItemClick(position, v, item);<NEW_LINE>}<NEW_LINE>}
String login = issue.getLogin();
1,232,761
protected Map<String, FieldReader> assignReaders(boolean useIndexOnSingleReturn) {<NEW_LINE>Map<String, FieldReader> readers = new HashMap<>();<NEW_LINE>JRField[] fields = queryExecuter.getDataset().getFields();<NEW_LINE>Type[] returnTypes = queryExecuter.getReturnTypes();<NEW_LINE>String[<MASK><NEW_LINE>Map<String, Integer> aliasesMap = new HashMap<>();<NEW_LINE>if (aliases != null) {<NEW_LINE>for (int i = 0; i < aliases.length; i++) {<NEW_LINE>aliasesMap.put(aliases[i], i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (returnTypes.length == 1) {<NEW_LINE>if (returnTypes[0].isEntityType() || returnTypes[0].isComponentType()) {<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>JRField field = fields[i];<NEW_LINE>readers.put(field.getName(), getFieldReaderSingleReturn(aliasesMap, field, useIndexOnSingleReturn));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (fields.length > 1) {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_MANY_FIELDS_DETECTED, (Object[]) null);<NEW_LINE>}<NEW_LINE>if (fields.length == 1) {<NEW_LINE>JRField field = fields[0];<NEW_LINE>if (useIndexOnSingleReturn) {<NEW_LINE>readers.put(field.getName(), new IndexFieldReader(0));<NEW_LINE>} else {<NEW_LINE>readers.put(field.getName(), new IdentityFieldReader());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>JRField field = fields[i];<NEW_LINE>readers.put(field.getName(), getFieldReader(returnTypes, aliasesMap, field));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return readers;<NEW_LINE>}
] aliases = queryExecuter.getReturnAliases();
805,856
public void cleanUpState(VirtualConnection vc) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "cleanUpState");<NEW_LINE>}<NEW_LINE>// Remove the discriminator state from the state map.<NEW_LINE>SSLDiscriminatorState discState = (SSLDiscriminatorState) vc.<MASK><NEW_LINE>// PK13349 - close the discrimination engine<NEW_LINE>closeEngine(discState.getEngine());<NEW_LINE>WsByteBuffer decryptedNetBuffer = discState.getDecryptedNetBuffer();<NEW_LINE>// Release the decrypted network buffer back to the pool. This shouldn't<NEW_LINE>// ever be null, but check anyhow.<NEW_LINE>if (decryptedNetBuffer != null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Releasing decryptedNetworkBuffer");<NEW_LINE>}<NEW_LINE>decryptedNetBuffer.release();<NEW_LINE>decryptedNetBuffer = null;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "cleanUpState");<NEW_LINE>}<NEW_LINE>}
getStateMap().remove(SSL_DISCRIMINATOR_STATE);
60,378
private <T> CompletableFuture<T> retryWithCleanup(Supplier<CompletableFuture<T>> toTry) {<NEW_LINE>CompletableFuture<T> result = new CompletableFuture<>();<NEW_LINE>toTry.get().thenAccept(result::complete).exceptionally(ex -> {<NEW_LINE>// Check if the exception indicates the Metadata has reached capacity. In that case, force a cleanup<NEW_LINE>// and try again, exactly once.<NEW_LINE>try {<NEW_LINE>if (Exceptions.unwrap(ex) instanceof TooManyActiveSegmentsException) {<NEW_LINE>log.debug("{}: Forcing metadata cleanup due to capacity exceeded ({}).", this.traceObjectId, Exceptions.unwrap<MASK><NEW_LINE>CompletableFuture<T> f = this.connector.getMetadataCleanup().get().thenComposeAsync(v -> toTry.get(), this.executor);<NEW_LINE>f.thenAccept(result::complete);<NEW_LINE>Futures.exceptionListener(f, result::completeExceptionally);<NEW_LINE>} else {<NEW_LINE>result.completeExceptionally(ex);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>result.completeExceptionally(t);<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>}
(ex).getMessage());
1,120,940
private void restoreState(@NonNull Bundle savedInstanceState) {<NEW_LINE>boolean isInMultiSelectMode = savedInstanceState.getBoolean(BUNDLE_IN_MULTI_SELECT_MODE);<NEW_LINE>if (isInMultiSelectMode) {<NEW_LINE>getAdapter().setInMultiSelect(true);<NEW_LINE>if (savedInstanceState.containsKey(BUNDLE_SELECTED_STATES)) {<NEW_LINE>ArrayList<Integer> selectedItems = ListUtils.fromIntArray<MASK><NEW_LINE>getAdapter().setSelectedItems(selectedItems);<NEW_LINE>setSwipeToRefreshEnabled(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mFetchedFilters = savedInstanceState.getBooleanArray(BUNDLE_FETCHED_FILTERS);<NEW_LINE>mFetchedAllFilters = savedInstanceState.getBooleanArray(BUNDLE_RETRIEVED_ALL_FILTERS);<NEW_LINE>EmptyViewMessageType emptyType = EmptyViewMessageType.getEnumFromString(savedInstanceState.getString(BUNDLE_EMPTY_VIEW_MESSAGE));<NEW_LINE>updateEmptyView(emptyType);<NEW_LINE>}
(savedInstanceState.getIntArray(BUNDLE_SELECTED_STATES));
792,340
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {<NEW_LINE>Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(<MASK><NEW_LINE>boolean useJdkProxy = Boolean.parseBoolean(annotationAttributes.get(ATTRIBUTE_KEY_USE_JDK_PROXY).toString());<NEW_LINE>String[] excludes = (String[]) annotationAttributes.get(ATTRIBUTE_KEY_EXCLUDES);<NEW_LINE>String dataSourceProxyMode = (String) annotationAttributes.get(ATTRIBUTE_KEY_DATA_SOURCE_PROXY_MODE);<NEW_LINE>// register seataAutoDataSourceProxyCreator bean def<NEW_LINE>if (!registry.containsBeanDefinition(BEAN_NAME_SEATA_AUTO_DATA_SOURCE_PROXY_CREATOR)) {<NEW_LINE>AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(SeataAutoDataSourceProxyCreator.class).addConstructorArgValue(useJdkProxy).addConstructorArgValue(excludes).addConstructorArgValue(dataSourceProxyMode).getBeanDefinition();<NEW_LINE>registry.registerBeanDefinition(BEAN_NAME_SEATA_AUTO_DATA_SOURCE_PROXY_CREATOR, beanDefinition);<NEW_LINE>}<NEW_LINE>}
EnableAutoDataSourceProxy.class.getName());
1,684,784
public void fillPadding() {<NEW_LINE>if (padding < 1)<NEW_LINE>return;<NEW_LINE>fillPadding(HillshadingBitmap.Border.EAST);<NEW_LINE>fillPadding(HillshadingBitmap.Border.WEST);<NEW_LINE>fillPadding(HillshadingBitmap.Border.NORTH);<NEW_LINE>fillPadding(HillshadingBitmap.Border.SOUTH);<NEW_LINE>// fill diagonal padding (this won't be blended with neighbors but the artifacts of that are truely minimal)<NEW_LINE>int lineLen = padding * 2 + width;<NEW_LINE>int widthOncePadded = width + padding;<NEW_LINE>int heightOncePadded = height + padding;<NEW_LINE>byte nw = bytes[lineLen * padding + padding];<NEW_LINE>byte ne = bytes[lineLen * padding + widthOncePadded - 1];<NEW_LINE>byte se = bytes[lineLen * (heightOncePadded - 1) + padding];<NEW_LINE>byte sw = bytes[lineLen * (heightOncePadded - 1) + (widthOncePadded - 1)];<NEW_LINE>int seOffset = lineLen * heightOncePadded;<NEW_LINE>int swOffset = seOffset + widthOncePadded;<NEW_LINE>for (int y = 0; y < padding; y++) {<NEW_LINE>int yoff = lineLen * y;<NEW_LINE>for (int x = 0; x < padding; x++) {<NEW_LINE><MASK><NEW_LINE>bytes[x + yoff + widthOncePadded] = ne;<NEW_LINE>bytes[x + yoff + seOffset] = se;<NEW_LINE>bytes[x + yoff + swOffset] = sw;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
bytes[x + yoff] = nw;
1,199,857
protected void load(String fileName) throws IOException, MaryConfigurationException {<NEW_LINE>super.load(fileName);<NEW_LINE>// Now make sense of the processing header<NEW_LINE>Properties props = new Properties();<NEW_LINE>ByteArrayInputStream bais = new ByteArrayInputStream(procHdr.getString().getBytes("latin1"));<NEW_LINE>props.load(bais);<NEW_LINE>ensurePresent(props, "hnm.noiseModel");<NEW_LINE>analysisParams = new HntmAnalyzerParams();<NEW_LINE>analysisParams.noiseModel = Integer.parseInt(props.getProperty("hnm.noiseModel"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.numFilteringStages = Integer.parseInt(props.getProperty("hnm.numFiltStages"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.medianFilterLength = Integer.parseInt(props.getProperty("hnm.medianFiltLen"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.movingAverageFilterLength = Integer.parseInt(props.getProperty("hnm.maFiltLen"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.cumulativeAmpThreshold = Float.parseFloat(props.getProperty("hnm.cumAmpTh"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.maximumAmpThresholdInDB = Float.parseFloat(props.getProperty("hnm.maxAmpTh"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.harmonicDeviationPercent = Float.parseFloat(props.getProperty("hnm.harmDevPercent"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.sharpPeakAmpDiffInDB = Float.parseFloat(props.getProperty("hnm.sharpPeakAmpDiff"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.minimumTotalHarmonics = Integer.parseInt(props.getProperty("hnm.minHarmonics"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.maximumTotalHarmonics = Integer.parseInt(props.getProperty("hnm.maxHarmonics"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.minimumVoicedFrequencyOfVoicing = Float.parseFloat(props.getProperty("hnm.minVoicedFreq"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.maximumVoicedFrequencyOfVoicing = Float.parseFloat(props.getProperty("hnm.maxVoicedFreq"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.maximumFrequencyOfVoicingFinalShift = Float.parseFloat(props.getProperty("hnm.maxFreqVoicingFinalShift"));<NEW_LINE>analysisParams.hnmPitchVoicingAnalyzerParams.neighsPercent = Float.parseFloat(props.getProperty("hnm.neighsPercent"));<NEW_LINE>analysisParams.harmonicPartCepstrumOrder = Integer.parseInt(props.getProperty("hnm.harmCepsOrder"));<NEW_LINE>analysisParams.regularizedCepstrumWarpingMethod = Integer.parseInt(props.getProperty("hnm.regCepWarpMethod"));<NEW_LINE>analysisParams.regularizedCepstrumLambdaHarmonic = Float.parseFloat(props.getProperty("hnm.regCepsLambda"));<NEW_LINE>analysisParams.noisePartLpOrder = Integer.parseInt(props.getProperty("hnm.noiseLpOrder"));<NEW_LINE>analysisParams.preemphasisCoefNoise = Float.parseFloat(props.getProperty("hnm.preCoefNoise"));<NEW_LINE>analysisParams.hpfBeforeNoiseAnalysis = Boolean.parseBoolean<MASK><NEW_LINE>analysisParams.numPeriodsHarmonicsExtraction = Float.parseFloat(props.getProperty("hnm.harmNumPer"));<NEW_LINE>}
(props.getProperty("hnm.hpfBeforeNoiseAnalysis"));
829,481
// eg.<NEW_LINE>// before:<NEW_LINE>// Limit 1, 5 (hit line range: 1 ~ 6, output line range: 6 ~ 11)<NEW_LINE>// |<NEW_LINE>// Limit 5, 2 (hit line range: 5 ~ 7, output line range: 5 ~ 7)<NEW_LINE>//<NEW_LINE>// after:<NEW_LINE>// Limit 6, 1 (hit line range: 6 ~ 7, output line range: 6 ~ 7)<NEW_LINE>@Override<NEW_LINE>public List<OptExpression> transform(OptExpression input, OptimizerContext context) {<NEW_LINE>LogicalLimitOperator l1 = (LogicalLimitOperator) input.getOp();<NEW_LINE>LogicalLimitOperator l2 = (LogicalLimitOperator) input.getInputs().get(0).getOp();<NEW_LINE>// l2 range<NEW_LINE>long l2Min = l2.hasOffset() ? l2.getOffset() : Operator.DEFAULT_OFFSET;<NEW_LINE>long l2Max = l2Min + l2.getLimit();<NEW_LINE>// l1 range<NEW_LINE>long l1Min = l1.hasOffset() ? l2Min + l1.getOffset() : l2Min;<NEW_LINE>long l1Max = l1Min + l1.getLimit();<NEW_LINE>long offset = Math.max(l2Min, l1Min);<NEW_LINE>long limit = Math.min(l2Max, l1Max) - offset;<NEW_LINE>if (limit <= 0) {<NEW_LINE>limit = 0;<NEW_LINE>offset = Operator.DEFAULT_OFFSET;<NEW_LINE>}<NEW_LINE>if (offset <= 0) {<NEW_LINE>offset = Operator.DEFAULT_OFFSET;<NEW_LINE>}<NEW_LINE>return Lists.newArrayList(OptExpression.create(new LogicalLimitOperator(limit, offset), input.getInputs().get(<MASK><NEW_LINE>}
0).getInputs()));
1,799,193
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<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 ExceptionEntityNotExist(id, Work.class);<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 <MASK><NEW_LINE>}<NEW_LINE>wo.setId(work.getId());<NEW_LINE>deleteData(business, work, path0);<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,443,163
private BulkDataExportOptions buildBulkDataExportOptions(IPrimitiveType<String> theOutputFormat, IPrimitiveType<String> theType, IPrimitiveType<Date> theSince, List<IPrimitiveType<String>> theTypeFilter, BulkDataExportOptions.ExportStyle theExportStyle) {<NEW_LINE>String outputFormat = theOutputFormat != null <MASK><NEW_LINE>Set<String> resourceTypes = null;<NEW_LINE>if (theType != null) {<NEW_LINE>resourceTypes = ArrayUtil.commaSeparatedListToCleanSet(theType.getValueAsString());<NEW_LINE>}<NEW_LINE>Date since = null;<NEW_LINE>if (theSince != null) {<NEW_LINE>since = theSince.getValue();<NEW_LINE>}<NEW_LINE>Set<String> typeFilters = splitTypeFilters(theTypeFilter);<NEW_LINE>BulkDataExportOptions bulkDataExportOptions = new BulkDataExportOptions();<NEW_LINE>bulkDataExportOptions.setFilters(typeFilters);<NEW_LINE>bulkDataExportOptions.setExportStyle(theExportStyle);<NEW_LINE>bulkDataExportOptions.setSince(since);<NEW_LINE>bulkDataExportOptions.setResourceTypes(resourceTypes);<NEW_LINE>bulkDataExportOptions.setOutputFormat(outputFormat);<NEW_LINE>return bulkDataExportOptions;<NEW_LINE>}
? theOutputFormat.getValueAsString() : null;
1,342,330
private byte[] genCheckImage(int width, int height, int checkSize) {<NEW_LINE>int x, y;<NEW_LINE>byte[] pixels = new byte[width * height * 3];<NEW_LINE>for (y = 0; y < height; y++) for (x = 0; x < width; x++) {<NEW_LINE>byte rColor = 0;<NEW_LINE>byte bColor = 0;<NEW_LINE>if ((x / checkSize) % 2 == 0) {<NEW_LINE>rColor = (byte) (127 * ((<MASK><NEW_LINE>bColor = (byte) (127 * (1 - ((y / checkSize) % 2)));<NEW_LINE>} else {<NEW_LINE>bColor = (byte) (127 * ((y / checkSize) % 2));<NEW_LINE>rColor = (byte) (127 * (1 - ((y / checkSize) % 2)));<NEW_LINE>}<NEW_LINE>pixels[(y * width + x) * 3] = rColor;<NEW_LINE>pixels[(y * width + x) * 3 + 1] = 0;<NEW_LINE>pixels[(y * width + x) * 3 + 2] = bColor;<NEW_LINE>}<NEW_LINE>return pixels;<NEW_LINE>}
y / checkSize) % 2));
150,744
static void sortByMinZ(int leftTid, int rightTid, int[] triangleIndices, float[] minZBuffer) {<NEW_LINE>// swap pivot to the front<NEW_LINE>swap(triangleIndices, leftTid, ((<MASK><NEW_LINE>int k = leftTid;<NEW_LINE>float leftMinZ = minZBuffer[triangleIndices[leftTid]];<NEW_LINE>// sort by min z<NEW_LINE>for (int tid = leftTid + 1; tid <= rightTid; tid++) {<NEW_LINE>float minZ = minZBuffer[triangleIndices[tid]];<NEW_LINE>if (minZ < leftMinZ) {<NEW_LINE>swap(triangleIndices, ++k, tid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// swap pivot back to the middle<NEW_LINE>swap(triangleIndices, leftTid, k);<NEW_LINE>if (leftTid < k - 1)<NEW_LINE>sortByMinZ(leftTid, k - 1, triangleIndices, minZBuffer);<NEW_LINE>if (k + 1 < rightTid)<NEW_LINE>sortByMinZ(k + 1, rightTid, triangleIndices, minZBuffer);<NEW_LINE>}
leftTid + rightTid) / 2));
1,199,244
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>GutenbergPropsBuilder gutenbergPropsBuilder = getArguments().getParcelable(ARG_GUTENBERG_PROPS_BUILDER);<NEW_LINE>Consumer<Exception> exceptionLogger = null;<NEW_LINE>Consumer<String> breadcrumbLogger = null;<NEW_LINE>if (getActivity() instanceof ExceptionLogger) {<NEW_LINE>ExceptionLogger exceptionLoggingActivity = ((ExceptionLogger) getActivity());<NEW_LINE>exceptionLogger = exceptionLoggingActivity.getExceptionLogger();<NEW_LINE>breadcrumbLogger = exceptionLoggingActivity.getBreadcrumbLogger();<NEW_LINE>}<NEW_LINE>mWPAndroidGlueCode = new WPAndroidGlueCode();<NEW_LINE><MASK><NEW_LINE>mWPAndroidGlueCode.onCreateView(getContext(), getActivity().getApplication(), BuildConfig.DEBUG, getContext().getResources().getColor(R.color.background_color), exceptionLogger, breadcrumbLogger, gutenbergPropsBuilder.build(getActivity(), mHtmlModeEnabled));<NEW_LINE>// clear the content initialization flag since a new ReactRootView has been created;<NEW_LINE>mHasReceivedAnyContent = false;<NEW_LINE>}
mWPAndroidGlueCode.onCreate(getContext());
728,149
final ListHealthChecksResult executeListHealthChecks(ListHealthChecksRequest listHealthChecksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listHealthChecksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListHealthChecksRequest> request = null;<NEW_LINE>Response<ListHealthChecksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListHealthChecksRequestMarshaller().marshall(super.beforeMarshalling(listHealthChecksRequest));<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, "ListHealthChecks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListHealthChecksResult> responseHandler = new StaxResponseHandler<ListHealthChecksResult>(new ListHealthChecksResultStaxUnmarshaller());<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, "Route 53");
1,089,247
private Mono<Response<PolicyDefinitionInner>> createOrUpdateAtManagementGroupWithResponseAsync(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (policyDefinitionName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (managementGroupId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.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.createOrUpdateAtManagementGroup(this.client.getEndpoint(), policyDefinitionName, apiVersion, managementGroupId, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null."));
943,028
public AirbyteConnectionStatus check(final JsonNode config) {<NEW_LINE>try {<NEW_LINE>final String datasetId = BigQueryUtils.getDatasetId(config);<NEW_LINE>final String datasetLocation = BigQueryUtils.getDatasetLocation(config);<NEW_LINE>final BigQuery bigquery = getBigQuery(config);<NEW_LINE>final UploadingMethod uploadingMethod = BigQueryUtils.getLoadingMethod(config);<NEW_LINE>BigQueryUtils.createSchemaTable(bigquery, datasetId, datasetLocation);<NEW_LINE>final QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(String.format("SELECT * FROM `%s.INFORMATION_SCHEMA.TABLES` LIMIT 1;", datasetId)).setUseLegacySql(false).build();<NEW_LINE>if (UploadingMethod.GCS.equals(uploadingMethod)) {<NEW_LINE>// TODO: use GcsDestination::check instead of writing our own custom logic to check perms<NEW_LINE>// this is not currently possible because using the Storage class to check perms requires<NEW_LINE>// a service account key, and the GCS destination does not accept a Service Account Key,<NEW_LINE>// only an HMAC key<NEW_LINE>final AirbyteConnectionStatus airbyteConnectionStatus = checkStorageIamPermissions(config);<NEW_LINE>if (Status.FAILED == airbyteConnectionStatus.getStatus()) {<NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.FAILED).withMessage(airbyteConnectionStatus.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ImmutablePair<Job, String> result = BigQueryUtils.executeQuery(bigquery, queryConfig);<NEW_LINE>if (result.getLeft() != null) {<NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.SUCCEEDED);<NEW_LINE>} else {<NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.FAILED).withMessage(result.getRight());<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>return new AirbyteConnectionStatus().withStatus(Status.FAILED).withMessage(e.getMessage() != null ? e.getMessage() : e.toString());<NEW_LINE>}<NEW_LINE>}
LOGGER.info("Check failed.", e);
341,730
private void specialCompletion() {<NEW_LINE>// instance documents with neither schemaLocation nor<NEW_LINE>// noNamespaceSchemaLocation attribute, e.g. project.xml<NEW_LINE>if (primaryFile == null)<NEW_LINE>return;<NEW_LINE>// specialCompletion = true;<NEW_LINE>for (String temp : declaredNamespaces.values()) {<NEW_LINE>try {<NEW_LINE>if (nsModelMap.containsKey(temp)) {<NEW_LINE>// ignore, was added from specific location<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (schemaLocationMap.get(temp) != null) {<NEW_LINE>// ignore; already processed by default provider from schemaLocation attribute<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (temp.equals(targetNamespace)) {<NEW_LINE>// ignore: the NS is a targetNamespace defined by this schema<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>CompletionModel cm = DefaultModelProvider.getCompletionModel(new java.net.URI<MASK><NEW_LINE>if (cm != null) {<NEW_LINE>populateModelMap(cm);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>_logger.log(Level.INFO, ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(temp), true, this);
1,441,678
protected void applyPrior(double[] x, double batchScale) {<NEW_LINE>// incorporate priors<NEW_LINE>if (prior == QUADRATIC_PRIOR) {<NEW_LINE>double lambda = batchScale / (sigma * sigma);<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>double w = x[i], wlambda = w * lambda;<NEW_LINE>value += w * wlambda * 0.5;<NEW_LINE>derivative[i] += wlambda;<NEW_LINE>}<NEW_LINE>} else if (prior == HUBER_PRIOR) {<NEW_LINE>double batchScaleSigmaSq = batchScale / (sigma * sigma);<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>double w = x[i], wabs = w < 0 ? -w : w;<NEW_LINE>if (wabs < epsilon) {<NEW_LINE>double weps = batchScaleSigmaSq * w / epsilon;<NEW_LINE>value += w * .5 * weps;<NEW_LINE>derivative[i] += weps;<NEW_LINE>} else {<NEW_LINE>value += batchScaleSigmaSq <MASK><NEW_LINE>derivative[i] += w < 0 ? -batchScaleSigmaSq : batchScaleSigmaSq;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (prior == QUARTIC_PRIOR) {<NEW_LINE>double sigmasq = sigma * sigma, batchScaleSigmaQu = batchScale / (sigmasq * sigmasq);<NEW_LINE>double lambda = .5 * batchScaleSigmaQu;<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>double w = x[i], ww = w * w;<NEW_LINE>value += ww * ww * lambda;<NEW_LINE>derivative[i] += batchScaleSigmaQu * w;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
* (wabs - epsilon * .5);
139,175
public static void collectMemoryInfo(Metrics metrics) {<NEW_LINE>if (metrics != null && Boolean.getBoolean("collect-memory")) {<NEW_LINE>MemoryMXBean memBean = ManagementFactory.getMemoryMXBean();<NEW_LINE>MemoryUsage heap = memBean.getHeapMemoryUsage();<NEW_LINE>MemoryUsage nonHeap = memBean.getNonHeapMemoryUsage();<NEW_LINE><MASK><NEW_LINE>long nonHeapUsed = nonHeap.getUsed();<NEW_LINE>getProcessInfo(metrics);<NEW_LINE>metrics.addMetric("Heap", heapUsed, "bytes");<NEW_LINE>metrics.addMetric("NonHeap", nonHeapUsed, "bytes");<NEW_LINE>int gpuCount = CudaUtils.getGpuCount();<NEW_LINE>// CudaUtils.getGpuMemory() will allocates memory on GPUs if CUDA runtime is not<NEW_LINE>// initialized.<NEW_LINE>for (int i = 0; i < gpuCount; ++i) {<NEW_LINE>Device device = Device.gpu(i);<NEW_LINE>MemoryUsage mem = CudaUtils.getGpuMemory(device);<NEW_LINE>metrics.addMetric("GPU-" + i, mem.getCommitted(), "bytes");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
long heapUsed = heap.getUsed();
34,292
public // hbase_rest("http://example. com:8000/table/scanner/","POST/GET/PUT/DELETE","UTF-8","xml or json","Accept: text/xml","Content-Type: text/xml")<NEW_LINE>Object calculate(Context ctx) {<NEW_LINE>m_ctx = ctx;<NEW_LINE>IParam param = this.param;<NEW_LINE>try {<NEW_LINE>if (param.getType() == ';') {<NEW_LINE>ArrayList<Expression> list1 = new ArrayList<Expression>();<NEW_LINE>ArrayList<Expression> list2 = new ArrayList<Expression>();<NEW_LINE>param.getSub(0).getAllLeafExpression(list1);<NEW_LINE>param.getSub(1).getAllLeafExpression(list2);<NEW_LINE>IParam param0 = param.getSub(0);<NEW_LINE>IParam param00 = param0.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().<MASK><NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param0.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param0.getSubSize() > 2)<NEW_LINE>content = param0.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>IParam param1 = param.getSub(1);<NEW_LINE>if (param1.isLeaf()) {<NEW_LINE>headers.add(param1.getLeafExpression().calculate(ctx).toString());<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < param1.getSubSize(); i++) headers.add(param1.getSub(i).getLeafExpression().calculate(ctx).toString());<NEW_LINE>}<NEW_LINE>} else if (param.getType() == ',') {<NEW_LINE>IParam param00 = param.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().calculate(ctx).toString();<NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param.getSubSize() > 2)<NEW_LINE>content = param.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new RQException("influx rest param error" + mm.getMessage(Integer.toString(param.getSubSize())));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (url.indexOf("https:") >= 0)<NEW_LINE>return Http4SPL.downLoadFromHttps(url, charset, method, content, headers);<NEW_LINE>else<NEW_LINE>return Http4SPL.downLoadFromHttp(url, charset, method, content, headers);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
calculate(ctx).toString();
480,396
public static void commonInit() {<NEW_LINE>register(CokeOvenTileEntity.class, Lib.GUIID_CokeOven, CokeOvenContainer::new);<NEW_LINE>register(AlloySmelterTileEntity.class, Lib.GUIID_AlloySmelter, AlloySmelterContainer::new);<NEW_LINE>register(BlastFurnaceTileEntity.class, Lib.GUIID_BlastFurnace, BlastFurnaceContainer::new);<NEW_LINE>useSameContainerTile(BlastFurnaceTileEntity.class, BlastFurnaceAdvancedTileEntity.class);<NEW_LINE>register(CraftingTableTileEntity.class, Lib.GUIID_CraftingTable, CraftingTableContainer::new);<NEW_LINE>register(WoodenCrateTileEntity.class, Lib.GUIID_WoodenCrate, CrateContainer::new);<NEW_LINE>register(ModWorkbenchTileEntity.class, Lib.GUIID_Workbench, ModWorkbenchContainer::new);<NEW_LINE>register(CircuitTableTileEntity.class, Lib.GUIID_CircuitTable, CircuitTableContainer::new);<NEW_LINE>register(AssemblerTileEntity.class, Lib.GUIID_Assembler, AssemblerContainer::new);<NEW_LINE>register(SorterTileEntity.class, Lib.GUIID_Sorter, SorterContainer::new);<NEW_LINE>register(ItemBatcherTileEntity.class, <MASK><NEW_LINE>register(LogicUnitTileEntity.class, Lib.GUIID_LogicUnit, LogicUnitContainer::new);<NEW_LINE>register(SqueezerTileEntity.class, Lib.GUIID_Squeezer, SqueezerContainer::new);<NEW_LINE>register(FermenterTileEntity.class, Lib.GUIID_Fermenter, FermenterContainer::new);<NEW_LINE>register(RefineryTileEntity.class, Lib.GUIID_Refinery, RefineryContainer::new);<NEW_LINE>register(ArcFurnaceTileEntity.class, Lib.GUIID_ArcFurnace, ArcFurnaceContainer::new);<NEW_LINE>register(AutoWorkbenchTileEntity.class, Lib.GUIID_AutoWorkbench, AutoWorkbenchContainer::new);<NEW_LINE>register(MixerTileEntity.class, Lib.GUIID_Mixer, MixerContainer::new);<NEW_LINE>register(TurretGunTileEntity.class, Lib.GUIID_Turret_Gun, TurretContainer::new);<NEW_LINE>register(TurretChemTileEntity.class, Lib.GUIID_Turret_Chem, TurretContainer::new);<NEW_LINE>register(FluidSorterTileEntity.class, Lib.GUIID_FluidSorter, FluidSorterContainer::new);<NEW_LINE>register(ClocheTileEntity.class, Lib.GUIID_Cloche, ClocheContainer::new);<NEW_LINE>register(ToolboxTileEntity.class, Lib.GUIID_ToolboxBlock, ToolboxBlockContainer::new);<NEW_LINE>register(ToolboxItem.class, Lib.GUIID_Toolbox, ToolboxContainer::new);<NEW_LINE>register(RevolverItem.class, Lib.GUIID_Revolver, RevolverContainer::new);<NEW_LINE>register(MaintenanceKitItem.class, Lib.GUIID_MaintenanceKit, MaintenanceKitContainer::new);<NEW_LINE>useSameContainerItem(RevolverItem.class, SpeedloaderItem.class);<NEW_LINE>register(CrateMinecartEntity.class, Lib.GUIID_CartCrate, (EntityContainerConstructor<CrateMinecartEntity, AbstractContainerMenu>) (windowId, inventoryPlayer, entity) -> new CrateEntityContainer(windowId, inventoryPlayer, entity.getContainedTileEntity(), entity));<NEW_LINE>register(ReinforcedCrateMinecartEntity.class, Lib.GUIID_CartReinforcedCrate, (EntityContainerConstructor<CrateMinecartEntity, AbstractContainerMenu>) (windowId, inventoryPlayer, entity) -> new CrateEntityContainer(windowId, inventoryPlayer, entity.getContainedTileEntity(), entity));<NEW_LINE>}
Lib.GUIID_ItemBatcher, ItemBatcherContainer::new);
541,996
final CreateLagResult executeCreateLag(CreateLagRequest createLagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLagRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLagRequest> request = null;<NEW_LINE>Response<CreateLagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLagRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLagResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLagResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
521,642
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new EPLSpatialPREventIndexUnindexed());<NEW_LINE>execs.add(new EPLSpatialPREventIndexUnusedOnTrigger());<NEW_LINE>execs.add(new EPLSpatialPREventIndexUnusedNamedWindowFireAndForget());<NEW_LINE>execs.add(new EPLSpatialPREventIndexOnTriggerNWInsertRemove(false));<NEW_LINE>execs.add(new EPLSpatialPREventIndexOnTriggerNWInsertRemove(true));<NEW_LINE>execs.add(new EPLSpatialPREventIndexOnTriggerTable());<NEW_LINE>execs.add(new EPLSpatialPREventIndexChoiceOfTwo());<NEW_LINE>execs.add(new EPLSpatialPREventIndexUnique());<NEW_LINE>execs.add(new EPLSpatialPREventIndexPerformance());<NEW_LINE>execs.add(new EPLSpatialPREventIndexChoiceBetweenIndexTypes());<NEW_LINE>execs.add(new EPLSpatialPREventIndexNWFireAndForgetPerformance());<NEW_LINE>execs.add(new EPLSpatialPREventIndexTableFireAndForget());<NEW_LINE>execs.add(new EPLSpatialPREventIndexOnTriggerContextParameterized());<NEW_LINE>execs.add(new EPLSpatialPREventIndexExpression());<NEW_LINE>execs.add(new EPLSpatialPREventIndexEdgeSubdivide());<NEW_LINE>execs.add(new EPLSpatialPREventIndexRandomDoublePointsWRandomQuery());<NEW_LINE>execs.add(new EPLSpatialPREventIndexRandomIntPointsInSquareUnique());<NEW_LINE>execs.add(new EPLSpatialPREventIndexRandomMovingPoints());<NEW_LINE>execs.add(new EPLSpatialPREventIndexTableSimple());<NEW_LINE>execs.add(new EPLSpatialPREventIndexTableSubdivideDeepAddDestroy());<NEW_LINE>execs.add(new EPLSpatialPREventIndexTableSubdivideDestroy());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new EPLSpatialPREventIndexSubqNamedWindowIndexShare());<NEW_LINE>return execs;<NEW_LINE>}
.add(new EPLSpatialPREventIndexTableSubdivideMergeDestroy());
902,209
final GetMLTaskRunsResult executeGetMLTaskRuns(GetMLTaskRunsRequest getMLTaskRunsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMLTaskRunsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMLTaskRunsRequest> request = null;<NEW_LINE>Response<GetMLTaskRunsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMLTaskRunsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMLTaskRunsRequest));<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, "GetMLTaskRuns");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMLTaskRunsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new GetMLTaskRunsResultJsonUnmarshaller());
81,086
private void checkTooManyError(ISingleConsole singleConsole, PerfTest perfTest, IPerfTestService perfTestService, ImmutableStatisticsSet cumulativeStatistics) {<NEW_LINE>StatisticsIndexMap statisticsIndexMap = singleConsole.getStatisticsIndexMap();<NEW_LINE>long testSum = cumulativeStatistics.getCount(statisticsIndexMap.getLongSampleIndex("timedTests"));<NEW_LINE>long errors = cumulativeStatistics.getValue<MASK><NEW_LINE>if (((double) (testSum + errors)) / 2 < errors) {<NEW_LINE>if (lastMomentWhenErrorsMoreThanHalfOfTotalTPSValue == 0) {<NEW_LINE>lastMomentWhenErrorsMoreThanHalfOfTotalTPSValue = System.currentTimeMillis();<NEW_LINE>} else if (isOverLowTpsThreshold()) {<NEW_LINE>log.warn(format(perfTest, "Stop the test because the count of test error is more than" + " half of total tps for last {} seconds.", TOO_MANY_ERROR_TIME / 1000));<NEW_LINE>if (perfTest.getStatus() != Status.ABNORMAL_TESTING) {<NEW_LINE>perfTestService.markStatusAndProgress(perfTest, Status.ABNORMAL_TESTING, "Too many errors");<NEW_LINE>}<NEW_LINE>lastMomentWhenErrorsMoreThanHalfOfTotalTPSValue = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(statisticsIndexMap.getLongIndex("errors"));
124,383
public Builder mergeFrom(org.mlflow.api.proto.ModelRegistry.GetLatestVersions.Response other) {<NEW_LINE>if (other == org.mlflow.api.proto.ModelRegistry.GetLatestVersions.Response.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (modelVersionsBuilder_ == null) {<NEW_LINE>if (!other.modelVersions_.isEmpty()) {<NEW_LINE>if (modelVersions_.isEmpty()) {<NEW_LINE>modelVersions_ = other.modelVersions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureModelVersionsIsMutable();<NEW_LINE>modelVersions_.addAll(other.modelVersions_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.modelVersions_.isEmpty()) {<NEW_LINE>if (modelVersionsBuilder_.isEmpty()) {<NEW_LINE>modelVersionsBuilder_.dispose();<NEW_LINE>modelVersionsBuilder_ = null;<NEW_LINE>modelVersions_ = other.modelVersions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>modelVersionsBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>modelVersionsBuilder_.addAllMessages(other.modelVersions_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
.alwaysUseFieldBuilders ? getModelVersionsFieldBuilder() : null;
428,084
public List<ActiveUser> list(String username) {<NEW_LINE>String currentSessionId = (String) SecurityUtils.getSubject().getSession().getId();<NEW_LINE>List<ActiveUser> list = new ArrayList<>();<NEW_LINE>Collection<Session<MASK><NEW_LINE>for (Session session : sessions) {<NEW_LINE>ActiveUser activeUser = new ActiveUser();<NEW_LINE>User user;<NEW_LINE>SimplePrincipalCollection principalCollection;<NEW_LINE>if (session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY) == null) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>principalCollection = (SimplePrincipalCollection) session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);<NEW_LINE>user = (User) principalCollection.getPrimaryPrincipal();<NEW_LINE>activeUser.setUsername(user.getUsername());<NEW_LINE>activeUser.setUserId(user.getUserId().toString());<NEW_LINE>}<NEW_LINE>activeUser.setId((String) session.getId());<NEW_LINE>activeUser.setHost(session.getHost());<NEW_LINE>activeUser.setStartTimestamp(DateUtil.getDateFormat(session.getStartTimestamp(), DateUtil.FULL_TIME_SPLIT_PATTERN));<NEW_LINE>activeUser.setLastAccessTime(DateUtil.getDateFormat(session.getLastAccessTime(), DateUtil.FULL_TIME_SPLIT_PATTERN));<NEW_LINE>long timeout = session.getTimeout();<NEW_LINE>activeUser.setStatus(timeout == 0L ? OFFLINE : ONLINE);<NEW_LINE>String address = AddressUtil.getCityInfo(activeUser.getHost());<NEW_LINE>activeUser.setLocation(address);<NEW_LINE>activeUser.setTimeout(timeout);<NEW_LINE>if (StringUtils.equals(currentSessionId, activeUser.getId())) {<NEW_LINE>activeUser.setCurrent(true);<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(username) || StringUtils.equalsIgnoreCase(activeUser.getUsername(), username)) {<NEW_LINE>list.add(activeUser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
> sessions = sessionDAO.getActiveSessions();
81,778
private static Predicate<? super Throwable> createAbortedExecutionPredicate() {<NEW_LINE>Predicate<Throwable> otaPredicate = TestAbortedException.class::isInstance;<NEW_LINE>// Additionally support JUnit 4's AssumptionViolatedException?<NEW_LINE>try {<NEW_LINE>Class<?> clazz = ReflectionUtils.tryToLoadClass(ASSUMPTION_VIOLATED_EXCEPTION).get();<NEW_LINE>if (clazz != null) {<NEW_LINE>return otaPredicate.or(clazz::isInstance);<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>UnrecoverableExceptions.rethrowIfUnrecoverable(throwable);<NEW_LINE>Supplier<String> messageSupplier = (throwable instanceof NoClassDefFoundError) ? () -> COMMON_FAILURE_MESSAGE + " Note that " + <MASK><NEW_LINE>logger.debug(throwable, messageSupplier);<NEW_LINE>}<NEW_LINE>// Else just OTA's TestAbortedException<NEW_LINE>return otaPredicate;<NEW_LINE>}
ASSUMPTION_VIOLATED_EXCEPTION + " requires that Hamcrest is on the classpath." : () -> COMMON_FAILURE_MESSAGE;
1,015,250
public void deleteById(String id) {<NEW_LINE>String vaultName = Utils.getValueFromIdByName(id, "backupVaults");<NEW_LINE>if (vaultName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));<NEW_LINE>}<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 backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies");<NEW_LINE>if (backupPolicyName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
432,012
private UserDashboardItemId createUserDashboardItemAndSave(@NonNull final UserDashboardId dashboardId, @NonNull final UserDashboardItemAddRequest request) {<NEW_LINE>//<NEW_LINE>// Get the KPI<NEW_LINE>final int kpiId = request.getKpiId();<NEW_LINE>if (kpiId <= 0) {<NEW_LINE>throw new AdempiereException("kpiId is not set").setParameter("request", request);<NEW_LINE>}<NEW_LINE>final I_WEBUI_KPI kpi = InterfaceWrapperHelper.loadOutOfTrx(kpiId, I_WEBUI_KPI.class);<NEW_LINE>final DashboardWidgetType widgetType = request.getWidgetType();<NEW_LINE>final int seqNo = retrieveLastSeqNo(dashboardId, widgetType) + 10;<NEW_LINE>//<NEW_LINE>final I_WEBUI_DashboardItem webuiDashboardItem = InterfaceWrapperHelper.newInstance(I_WEBUI_DashboardItem.class);<NEW_LINE>webuiDashboardItem.setWEBUI_Dashboard_ID(dashboardId.getRepoId());<NEW_LINE>webuiDashboardItem.setIsActive(true);<NEW_LINE>webuiDashboardItem.<MASK><NEW_LINE>webuiDashboardItem.setSeqNo(seqNo);<NEW_LINE>webuiDashboardItem.setWEBUI_KPI_ID(kpiId);<NEW_LINE>webuiDashboardItem.setWEBUI_DashboardWidgetType(widgetType.getCode());<NEW_LINE>// will be set by change request:<NEW_LINE>// webuiDashboardItem.setES_TimeRange(esTimeRange);<NEW_LINE>// webuiDashboardItem.setES_TimeRange_End(esTimeRangeEnd);<NEW_LINE>InterfaceWrapperHelper.save(webuiDashboardItem);<NEW_LINE>logger.trace("Created {} for dashboard {}", webuiDashboardItem, dashboardId);<NEW_LINE>// TODO: copy trl but also consider the request.getCaption() and use it only for the current language trl.<NEW_LINE>//<NEW_LINE>// Apply the change request<NEW_LINE>if (request.getChangeRequest() != null) {<NEW_LINE>changeUserDashboardItemAndSave(webuiDashboardItem, request.getChangeRequest());<NEW_LINE>}<NEW_LINE>return UserDashboardItemId.ofRepoId(webuiDashboardItem.getWEBUI_DashboardItem_ID());<NEW_LINE>}
setName(kpi.getName());
603,515
public static <T, BT extends ObjectIntProcedure<? super T>> void forEachWithIndexInListOnExecutor(List<T> list, ObjectIntProcedureFactory<BT> procedureFactory, Combiner<BT> combiner, int minForkSize, int taskCount, Executor executor) {<NEW_LINE><MASK><NEW_LINE>if (size < minForkSize) {<NEW_LINE>BT procedure = procedureFactory.create();<NEW_LINE>Iterate.forEachWithIndex(list, procedure);<NEW_LINE>if (combiner.useCombineOne()) {<NEW_LINE>combiner.combineOne(procedure);<NEW_LINE>} else {<NEW_LINE>combiner.combineAll(iList(procedure));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int threadCount = Math.min(size, taskCount);<NEW_LINE>ObjectIntProcedureFJTaskRunner<T, BT> runner = new ObjectIntProcedureFJTaskRunner<T, BT>(combiner, threadCount);<NEW_LINE>runner.executeAndCombine(executor, procedureFactory, list);<NEW_LINE>}<NEW_LINE>}
int size = list.size();
1,705,956
private RwSplitUser transformRowToUser(LinkedHashMap<String, String> map) {<NEW_LINE>if (null == map || map.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>check(map);<NEW_LINE>RwSplitUser rwSplitUser = new RwSplitUser();<NEW_LINE>for (Map.Entry<String, String> entry : map.entrySet()) {<NEW_LINE>switch(entry.getKey()) {<NEW_LINE>case COLUMN_USERNAME:<NEW_LINE>rwSplitUser.setName(entry.getValue());<NEW_LINE>break;<NEW_LINE>case COLUMN_PASSWORD_ENCRYPT:<NEW_LINE>rwSplitUser.setPassword(entry.getValue());<NEW_LINE>break;<NEW_LINE>case COLUMN_ENCRYPT_CONFIGURED:<NEW_LINE>rwSplitUser.setUsingDecrypt(entry.getValue());<NEW_LINE>break;<NEW_LINE>case COLUMN_CONN_ATTR_VALUE:<NEW_LINE>rwSplitUser.setTenant(entry.getValue());<NEW_LINE>break;<NEW_LINE>case COLUMN_WHITE_IPS:<NEW_LINE>rwSplitUser.setWhiteIPs(entry.getValue());<NEW_LINE>break;<NEW_LINE>case COLUMN_MAX_CONN_COUNT:<NEW_LINE>if (!StringUtil.isBlank(entry.getValue())) {<NEW_LINE>rwSplitUser.setMaxCon(IntegerUtil.parseInt(entry.getValue().replace(CONSTANT_NO_LIMIT, "0")));<NEW_LINE>}<NEW_LINE>if (rwSplitUser.getMaxCon() < 0) {<NEW_LINE>throw new ConfigException("Column 'max_conn_count' value cannot be less than 0.");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case COLUMN_DB_GROUP:<NEW_LINE>rwSplitUser.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rwSplitUser;<NEW_LINE>}
setDbGroup(entry.getValue());
152,525
public static void beforeSuite() throws Exception {<NEW_LINE>// Delete the Infinispan jars that might have been left around by previous test buckets.<NEW_LINE>LibertyServer server = LibertyServerFactory.getLibertyServer("com.ibm.ws.session.cache.fat.infinispan.container.server");<NEW_LINE>Machine machine = server.getMachine();<NEW_LINE>String installRoot = server.getInstallRoot();<NEW_LINE>LibertyFileManager.deleteLibertyDirectoryAndContents(machine, installRoot + "/usr/shared/resources/infinispan");<NEW_LINE>if (JakartaEE9Action.isActive()) {<NEW_LINE>LibertyFileManager.<MASK><NEW_LINE>RemoteFile jakartaResourceDir = LibertyFileManager.createRemoteFile(machine, installRoot + "/usr/shared/resources/infinispan-jakarta");<NEW_LINE>jakartaResourceDir.mkdirs();<NEW_LINE>}<NEW_LINE>}
deleteLibertyDirectoryAndContents(machine, installRoot + "/usr/shared/resources/infinispan-jakarta");
98,609
protected void updateStyle(@Nonnull JEditorPane editorPane, @Nullable JTree tree, Object value, boolean selected, boolean hasFocus) {<NEW_LINE>final HTMLDocument htmlDocument = (HTMLDocument) editorPane.getDocument();<NEW_LINE>final Style style = htmlDocument.getStyleSheet().getStyle(MSG_STYLE);<NEW_LINE>if (value instanceof LoadingNode) {<NEW_LINE>StyleConstants.<MASK><NEW_LINE>} else {<NEW_LINE>if (selected) {<NEW_LINE>StyleConstants.setForeground(style, hasFocus ? UIUtil.getTreeSelectionForeground() : UIUtil.getTreeTextForeground());<NEW_LINE>} else {<NEW_LINE>StyleConstants.setForeground(style, UIUtil.getTreeTextForeground());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (UIUtil.isUnderGTKLookAndFeel() || UIUtil.isUnderNimbusLookAndFeel() && selected && hasFocus || tree != null && WideSelectionTreeUI.isWideSelection(tree)) {<NEW_LINE>editorPane.setOpaque(false);<NEW_LINE>} else {<NEW_LINE>editorPane.setOpaque(selected && hasFocus);<NEW_LINE>}<NEW_LINE>htmlDocument.setCharacterAttributes(0, htmlDocument.getLength(), style, false);<NEW_LINE>}
setForeground(style, JBColor.GRAY);
246,662
/* (non-Javadoc)<NEW_LINE>* @see org.netbeans.modules.web.common.websocket.WebSocketChanelHandler#sendHandshake()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void sendHandshake() throws IOException {<NEW_LINE>String acceptKey = createAcceptKey(getKey());<NEW_LINE>if (acceptKey == null) {<NEW_LINE>close();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder builder <MASK><NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.WS_UPGRADE);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.CONN_UPGRADE);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>// NOI18N<NEW_LINE>builder.append("Sec-WebSocket-Origin: ");<NEW_LINE>// NOI18N<NEW_LINE>String origin = getWebSocketPoint().getContext(myKey).getHeaders().get("Sec-WebSocket-Origin");<NEW_LINE>if (origin == null) {<NEW_LINE>// NOI18N<NEW_LINE>origin = getWebSocketPoint().getContext(myKey).getHeaders().get("Origin");<NEW_LINE>}<NEW_LINE>if (origin != null) {<NEW_LINE>builder.append(origin);<NEW_LINE>}<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.ACCEPT);<NEW_LINE>builder.append(": ");<NEW_LINE>builder.append(acceptKey);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>builder.append(Utils.CRLF);<NEW_LINE>getWebSocketPoint().send(builder.toString().getBytes(Charset.forName(Utils.UTF_8)), myKey);<NEW_LINE>}
= new StringBuilder(Utils.HTTP_RESPONSE);
1,062,508
private void addScanProduct() {<NEW_LINE>String upc = upcField.getDisplay();<NEW_LINE>if (upc == null || upc.isEmpty())<NEW_LINE>return;<NEW_LINE>MProduct product = getMProduct(upc);<NEW_LINE>if (product == null) {<NEW_LINE>FDialog.error(form.getWindowNo(), form, Msg.parseTranslation(Env.getCtx(), "@M_Product_ID@ @NotFound@"), upc);<NEW_LINE>upcField.setValue("");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setProduct(product);<NEW_LINE>productValueField.setValue(product.getValue());<NEW_LINE>productField.setValue(product.getName());<NEW_LINE>UOMField.setValue(product.<MASK><NEW_LINE>if (isLot()) {<NEW_LINE>lotField.setVisible(true);<NEW_LINE>}<NEW_LINE>if (isSerNo()) {<NEW_LINE>serNoField.setVisible(true);<NEW_LINE>} else {<NEW_LINE>qtyCountField.setVisible(true);<NEW_LINE>}<NEW_LINE>addProductLine();<NEW_LINE>}
getC_UOM().getName());
188,358
public int Call(lua_State thread) {<NEW_LINE>int base = LuaAPI.luaL_optinteger(thread, 2, 10);<NEW_LINE>if (base == 10) {<NEW_LINE>LuaAPI.luaL_checkany(thread, 1);<NEW_LINE>if (LuaAPI.lua_isnumber(thread, 1)) {<NEW_LINE>LuaAPI.lua_pushnumber(thread, LuaAPI.lua_tonumber(thread, 1));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String s1 = LuaAPI.luaL_checkstring(thread, 1);<NEW_LINE>LuaAPI.luaL_argcheck(thread, 2 <= base && <MASK><NEW_LINE>long n = strtoul(s1, base);<NEW_LINE>if (s1.equals(endptr) == false) {<NEW_LINE>// at least one valid digit?<NEW_LINE>LuaAPI.lua_pushnumber(thread, n);<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LuaAPI.lua_pushnil(thread);<NEW_LINE>return 1;<NEW_LINE>}
base <= 36, 2, "base out of range");
1,268,670
public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {<NEW_LINE>String clientId = authorizationRequest.getClientId();<NEW_LINE>Collection<String> requestedScopes = authorizationRequest.getScope();<NEW_LINE>Set<String> approvedScopes = new HashSet<String>();<NEW_LINE>Set<String> validUserApprovedScopes = new HashSet<String>();<NEW_LINE>if (clientDetailsService != null) {<NEW_LINE>try {<NEW_LINE>ClientDetails client = clientDetailsService.loadClientByClientId(clientId);<NEW_LINE>for (String scope : requestedScopes) {<NEW_LINE>if (client.isAutoApprove(scope)) {<NEW_LINE>approvedScopes.add(scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (approvedScopes.containsAll(requestedScopes)) {<NEW_LINE>// gh-877 - if all scopes are auto approved, approvals still need to be added to the approval store.<NEW_LINE>Set<Approval> approvals = new HashSet<Approval>();<NEW_LINE>Date expiry = computeExpiry();<NEW_LINE>for (String approvedScope : approvedScopes) {<NEW_LINE>approvals.add(new Approval(userAuthentication.getName(), authorizationRequest.getClientId(), approvedScope, expiry, ApprovalStatus.APPROVED));<NEW_LINE>}<NEW_LINE>approvalStore.addApprovals(approvals);<NEW_LINE>authorizationRequest.setApproved(true);<NEW_LINE>return authorizationRequest;<NEW_LINE>}<NEW_LINE>} catch (ClientRegistrationException e) {<NEW_LINE>logger.warn("Client registration problem prevent autoapproval check for client");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>StringBuilder builder = new StringBuilder("Looking up user approved authorizations for ");<NEW_LINE>builder.append("client_id=" + clientId);<NEW_LINE>builder.append(<MASK><NEW_LINE>logger.debug(builder.toString());<NEW_LINE>}<NEW_LINE>// Find the stored approvals for that user and client<NEW_LINE>Collection<Approval> userApprovals = approvalStore.getApprovals(userAuthentication.getName(), clientId);<NEW_LINE>// Look at the scopes and see if they have expired<NEW_LINE>Date today = new Date();<NEW_LINE>for (Approval approval : userApprovals) {<NEW_LINE>if (approval.getExpiresAt().after(today)) {<NEW_LINE>if (approval.getStatus() == ApprovalStatus.APPROVED) {<NEW_LINE>validUserApprovedScopes.add(approval.getScope());<NEW_LINE>approvedScopes.add(approval.getScope());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Valid user approved/denied scopes are " + validUserApprovedScopes);<NEW_LINE>}<NEW_LINE>// If the requested scopes have already been acted upon by the user,<NEW_LINE>// this request is approved<NEW_LINE>if (validUserApprovedScopes.containsAll(requestedScopes)) {<NEW_LINE>approvedScopes.retainAll(requestedScopes);<NEW_LINE>// Set only the scopes that have been approved by the user<NEW_LINE>authorizationRequest.setScope(approvedScopes);<NEW_LINE>authorizationRequest.setApproved(true);<NEW_LINE>}<NEW_LINE>return authorizationRequest;<NEW_LINE>}
" and username=" + userAuthentication.getName());
1,125,898
private void parseHeaderExtension() {<NEW_LINE>pesScratch.setPosition(0);<NEW_LINE>timeUs = C.TIME_UNSET;<NEW_LINE>if (ptsFlag) {<NEW_LINE>// '0010' or '0011'<NEW_LINE>pesScratch.skipBits(4);<NEW_LINE>long pts = (long) <MASK><NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>pts |= pesScratch.readBits(15) << 15;<NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>pts |= pesScratch.readBits(15);<NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>if (!seenFirstDts && dtsFlag) {<NEW_LINE>// '0011'<NEW_LINE>pesScratch.skipBits(4);<NEW_LINE>long dts = (long) pesScratch.readBits(3) << 30;<NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>dts |= pesScratch.readBits(15) << 15;<NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>dts |= pesScratch.readBits(15);<NEW_LINE>// marker_bit<NEW_LINE>pesScratch.skipBits(1);<NEW_LINE>// Subsequent PES packets may have earlier presentation timestamps than this one, but they<NEW_LINE>// should all be greater than or equal to this packet's decode timestamp. We feed the<NEW_LINE>// decode timestamp to the adjuster here so that in the case that this is the first to be<NEW_LINE>// fed, the adjuster will be able to compute an offset to apply such that the adjusted<NEW_LINE>// presentation timestamps of all future packets are non-negative.<NEW_LINE>timestampAdjuster.adjustTsTimestamp(dts);<NEW_LINE>seenFirstDts = true;<NEW_LINE>}<NEW_LINE>timeUs = timestampAdjuster.adjustTsTimestamp(pts);<NEW_LINE>}<NEW_LINE>}
pesScratch.readBits(3) << 30;
423,819
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {<NEW_LINE>initRequest(request, response);<NEW_LINE>SecurityContext securityContext = null;<NEW_LINE>setCustomResponseHeaders(response);<NEW_LINE>try (final Tx tx = StructrApp.getInstance().tx()) {<NEW_LINE>try {<NEW_LINE>securityContext = getConfig().getAuthenticator().initializeAndExamineRequest(request, response);<NEW_LINE>} catch (final AuthenticationException ae) {<NEW_LINE>response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);<NEW_LINE>response.getOutputStream().write("ERROR (401): Invalid user or password.\n".getBytes("UTF-8"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!securityContext.isSuperUser()) {<NEW_LINE>response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);<NEW_LINE>response.getOutputStream().write("ERROR (401): Download of export ZIP file only allowed for admins.\n".getBytes("UTF-8"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Exception while processing request", t);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String name = request.getParameter(NAME_PARAMETER);<NEW_LINE>final String mode = StringUtils.defaultIfBlank(request.getParameter(MODE_PARAMETER), "app");<NEW_LINE>if ("test".equals(mode)) {<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(name)) {<NEW_LINE>final String message = "ERROR (400): Empty name parameter.\n";<NEW_LINE>logger.error(message);<NEW_LINE>response.setStatus(HttpServletResponse.SC_BAD_REQUEST);<NEW_LINE>response.getOutputStream().write(message.getBytes("UTF-8"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ("app".equals(mode)) {<NEW_LINE>handleAppDownloadAsZip(response, securityContext, name);<NEW_LINE>} else if ("data".equals(mode)) {<NEW_LINE>final String types = request.getParameter(TYPES_PARAMETER);<NEW_LINE>handleDataDownloadAsZip(<MASK><NEW_LINE>} else {<NEW_LINE>final String message = "ERROR (400): Unknown mode.\n";<NEW_LINE>logger.error(message);<NEW_LINE>response.setStatus(HttpServletResponse.SC_BAD_REQUEST);<NEW_LINE>response.getOutputStream().write(message.getBytes("UTF-8"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Exception while processing request", t);<NEW_LINE>}<NEW_LINE>}
response, securityContext, name, types);
718,613
public static void parseComment(Executor executor, Handler handler, String response, ArrayList<Comment> commentData, boolean expandChildren, ParseCommentListener parseCommentListener) {<NEW_LINE>executor.execute(() -> {<NEW_LINE>try {<NEW_LINE>JSONArray childrenArray = new JSONArray(response);<NEW_LINE>String parentId = childrenArray.getJSONObject(0).getJSONObject(JSONUtils.DATA_KEY).getJSONArray(JSONUtils.CHILDREN_KEY).getJSONObject(0).getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.NAME_KEY);<NEW_LINE>childrenArray = childrenArray.getJSONObject(1).getJSONObject(JSONUtils.DATA_KEY).getJSONArray(JSONUtils.CHILDREN_KEY);<NEW_LINE>ArrayList<Comment> expandedNewComments = new ArrayList<>();<NEW_LINE>ArrayList<String> moreChildrenFullnames = new ArrayList<>();<NEW_LINE>ArrayList<Comment> newComments = new ArrayList<>();<NEW_LINE>parseCommentRecursion(<MASK><NEW_LINE>expandChildren(newComments, expandedNewComments, expandChildren);<NEW_LINE>if (expandChildren) {<NEW_LINE>commentData.addAll(expandedNewComments);<NEW_LINE>} else {<NEW_LINE>commentData.addAll(newComments);<NEW_LINE>}<NEW_LINE>handler.post(() -> parseCommentListener.onParseCommentSuccess(commentData, parentId, moreChildrenFullnames));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>handler.post(parseCommentListener::onParseCommentFailed);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
childrenArray, newComments, moreChildrenFullnames, 0);
602,878
protected void drawForegroundText(@Nonnull PoseStack matrix, int mouseX, int mouseY) {<NEW_LINE>renderTitleText(matrix);<NEW_LINE>TurbineMultiblockData multiblock = tile.getMultiblock();<NEW_LINE>if (multiblock.isFormed()) {<NEW_LINE>Component limiting = GeneratorsLang.IS_LIMITING.translateColored(EnumColor.DARK_RED);<NEW_LINE>int lowerVolume = multiblock.lowerVolume;<NEW_LINE>int dispersers = multiblock.getDispersers();<NEW_LINE>int vents = multiblock.vents;<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_TANK_VOLUME.translate(lowerVolume), <MASK><NEW_LINE>boolean dispersersLimiting = lowerVolume * dispersers * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get() < vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get();<NEW_LINE>boolean ventsLimiting = lowerVolume * dispersers * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get() > vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get();<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_STEAM_FLOW.translate(), 8, 40, subheadingTextColor());<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_DISPERSERS.translate(dispersers, dispersersLimiting ? limiting : ""), 14, 49, titleTextColor());<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_VENTS.translate(vents, ventsLimiting ? limiting : ""), 14, 58, titleTextColor());<NEW_LINE>int coils = multiblock.coils;<NEW_LINE>int blades = multiblock.blades;<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_PRODUCTION.translate(), 8, 72, subheadingTextColor());<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_BLADES.translate(blades, coils * 4 > blades ? limiting : ""), 14, 81, titleTextColor());<NEW_LINE>drawString(matrix, GeneratorsLang.TURBINE_COILS.translate(coils, coils * 4 < blades ? limiting : ""), 14, 90, titleTextColor());<NEW_LINE>drawTextScaledBound(matrix, GeneratorsLang.TURBINE_MAX_PRODUCTION.translate(EnergyDisplay.of(multiblock.getMaxProduction())), 8, 104, titleTextColor(), 164);<NEW_LINE>drawTextScaledBound(matrix, GeneratorsLang.TURBINE_MAX_WATER_OUTPUT.translate(TextUtils.format(multiblock.getMaxWaterOutput())), 8, 113, titleTextColor(), 164);<NEW_LINE>}<NEW_LINE>super.drawForegroundText(matrix, mouseX, mouseY);<NEW_LINE>}
8, 26, titleTextColor());
1,418,722
public static void register(Application application) {<NEW_LINE>Desktop desktop = Desktop.getDesktop();<NEW_LINE>if (desktop.isSupported(Desktop.Action.APP_ABOUT)) {<NEW_LINE>desktop.setAboutHandler(e -> {<NEW_LINE>DataManager dataManager = DataManager.getInstance();<NEW_LINE>Window window = WindowManager.getInstance().suggestParentWindow(dataManager.getDataContext().getData(CommonDataKeys.PROJECT));<NEW_LINE>AboutManager aboutManager = application.getComponent(AboutManager.class);<NEW_LINE>aboutManager.showAsync(window);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (desktop.isSupported(Desktop.Action.APP_PRINT_FILE)) {<NEW_LINE>desktop.setPreferencesHandler(e -> {<NEW_LINE>final Project project = getNotNullProject();<NEW_LINE>final ShowSettingsUtil showSettingsUtil = ShowSettingsUtil.getInstance();<NEW_LINE>if (!showSettingsUtil.isAlreadyShown()) {<NEW_LINE>TransactionGuard.submitTransaction(project, () -> showSettingsUtil.showSettingsDialog(project));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (desktop.isSupported(Desktop.Action.APP_QUIT_HANDLER)) {<NEW_LINE>desktop.setQuitHandler((e, response) -> {<NEW_LINE>final Application app = Application.get();<NEW_LINE>TransactionGuard.submitTransaction(app, app::exit);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (desktop.isSupported(Desktop.Action.APP_OPEN_FILE)) {<NEW_LINE>desktop.setOpenFileHandler(e -> {<NEW_LINE>List<File> files = e.getFiles();<NEW_LINE>if (files != null) {<NEW_LINE>File file = files.get(0);<NEW_LINE>TransactionGuard.submitTransaction(Application.get(), () -> {<NEW_LINE>CommandLineArgs args = new CommandLineArgs();<NEW_LINE>args.setFile(file.getPath());<NEW_LINE>CommandLineProcessor.processExternalCommandLine(args, null).doWhenDone(project1 -> {<NEW_LINE>ApplicationStarter.<MASK><NEW_LINE>});<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
getInstance().setPerformProjectLoad(false);
607,125
final DeleteNetworkInterfaceResult executeDeleteNetworkInterface(DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteNetworkInterfaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteNetworkInterfaceRequest> request = null;<NEW_LINE>Response<DeleteNetworkInterfaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteNetworkInterfaceRequestMarshaller().marshall(super.beforeMarshalling(deleteNetworkInterfaceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteNetworkInterface");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteNetworkInterfaceResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
DeleteNetworkInterfaceResult>(new DeleteNetworkInterfaceResultStaxUnmarshaller());
717,799
private void hanleExceptHook(Object exceptHook, Object type, Object val, Object tb, ExcInfoNode excInfoNode, TupleBuiltins.GetItemNode getItemNode, PythonModule sys, PyErrDisplayNode errDisplayNode) {<NEW_LINE>try {<NEW_LINE>CallNode.getUncached().execute(exceptHook, type, val, tb);<NEW_LINE>} catch (PException e) {<NEW_LINE>PTuple sysInfo = excInfoNode.execute(null);<NEW_LINE>Object type1 = getItemNode.execute(null, sysInfo, 0);<NEW_LINE>Object val1 = getItemNode.execute(null, sysInfo, 1);<NEW_LINE>Object tb1 = getItemNode.execute(null, sysInfo, 2);<NEW_LINE>// not quite the same as 'PySys_WriteStderr' but close<NEW_LINE>Object stdErr = ((SysModuleBuiltins) sys.getBuiltins()).getStdErr();<NEW_LINE>Object writeMethod = PyObjectGetAttr.getUncached().<MASK><NEW_LINE>CallNode.getUncached().execute(null, writeMethod, PyObjectStrAsObjectNode.getUncached().execute(null, "Error in sys.excepthook:\n"));<NEW_LINE>errDisplayNode.execute(null, type1, val1, tb1);<NEW_LINE>CallNode.getUncached().execute(null, writeMethod, PyObjectStrAsObjectNode.getUncached().execute(null, "\nOriginal exception was:\n"));<NEW_LINE>errDisplayNode.execute(null, type, val, tb);<NEW_LINE>PyObjectCallMethodObjArgs.getUncached().execute(null, stdErr, "flush");<NEW_LINE>}<NEW_LINE>}
execute(null, stdErr, "write");
1,452,662
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {<NEW_LINE>if (args.length == 2) {<NEW_LINE>if (UserManager.getPlayer((Player) sender) == null) {<NEW_LINE>sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Player player = (Player) sender;<NEW_LINE>McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);<NEW_LINE>Party party = mcMMOPlayer.getParty();<NEW_LINE>if (party.getAlly() == null) {<NEW_LINE>sender.sendMessage<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>PartyManager.disbandAlliance(player, party, party.getAlly());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "alliance", "disband"));<NEW_LINE>return true;<NEW_LINE>}
(LocaleLoader.getString("Commands.Party.Alliance.None"));
810,339
public void readDesign(Element design, DesignContext context) {<NEW_LINE>super.readDesign(design, context);<NEW_LINE>if (design.hasAttr("center")) {<NEW_LINE>center();<NEW_LINE>}<NEW_LINE>if (design.hasAttr("position")) {<NEW_LINE>String[] position = design.attr("position").split(",");<NEW_LINE>setPositionX(Integer.parseInt(position[0]));<NEW_LINE>setPositionY(Integer.parseInt(position[1]));<NEW_LINE>}<NEW_LINE>// Parse shortcuts if defined, otherwise rely on default behavior<NEW_LINE>if (design.hasAttr("close-shortcut")) {<NEW_LINE>// Parse shortcuts<NEW_LINE>String[] shortcutStrings = DesignAttributeHandler.readAttribute("close-shortcut", design.attributes(), String.class).split("\\s+");<NEW_LINE>removeAllCloseShortcuts();<NEW_LINE>for (String part : shortcutStrings) {<NEW_LINE>if (!part.isEmpty()) {<NEW_LINE>ShortcutAction shortcut = DesignAttributeHandler.getFormatter().parse(part.<MASK><NEW_LINE>addCloseShortcut(shortcut.getKeyCode(), shortcut.getModifiers());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
trim(), ShortcutAction.class);
1,346,973
public void refreshUpdate(final ReadDB pDB) {<NEW_LINE>mDb = checkNotNull(pDB);<NEW_LINE>mSunburstGUI.mDone = false;<NEW_LINE>mSunburstGUI.mUseDiffView = ViewType.NODIFF;<NEW_LINE>mModel = new SunburstModel(mSunburstGUI.mParent, mSunburstGUI.mDb);<NEW_LINE>final SunburstContainer container = new SunburstContainer(mSunburstGUI, mModel).setNewStartKey(mDb.getNodeKey());<NEW_LINE>if (mSunburstGUI.mUsePruning) {<NEW_LINE>container.setPruning(Pruning.DEPTH);<NEW_LINE>} else {<NEW_LINE>container.setPruning(Pruning.NO);<NEW_LINE>}<NEW_LINE>container.setOldRevision(mDb.getRevisionNumber());<NEW_LINE>if (mSunburstGUI.mSelectedRev > 0) {<NEW_LINE>container.setRevision(mSunburstGUI.mSelectedRev);<NEW_LINE>}<NEW_LINE>if (mHitTestIndex > 0) {<NEW_LINE>final SunburstItem item = mModel.getItem(mHitTestIndex);<NEW_LINE>container.setDepth(item.getDepth()).setModWeight(mSunburstGUI.getModificationWeight()).setNewStartKey(item.getKey());<NEW_LINE>} else {<NEW_LINE>container.<MASK><NEW_LINE>}<NEW_LINE>mModel.updateDb(mDb, container);<NEW_LINE>mSunburstGUI.updateDb(mDb);<NEW_LINE>}
setModWeight(mSunburstGUI.getModificationWeight());
1,572,372
private XML buildJREOptions(final boolean embedJava, final boolean setMemory, final Arch arch) {<NEW_LINE>log("Building JRE options.");<NEW_LINE>final <MASK><NEW_LINE>if (embedJava) {<NEW_LINE>// note that "Path" is relative to the output executable at runtime<NEW_LINE>// "java" folder is next to the<NEW_LINE>jre.addChild("path").setContent("\"%EXEDIR%\\java\"");<NEW_LINE>// executable?<NEW_LINE>// TODO check<NEW_LINE>}<NEW_LINE>// We always add the minVersion tag, which means that the sketch will always try to look for<NEW_LINE>// Java on the system - by default when java isn't embedded, as a fallback when it is<NEW_LINE>jre.addChild("minVersion").setContent("1.7.0_40");<NEW_LINE>switch(arch) {<NEW_LINE>case AMD64:<NEW_LINE>jre.addChild("runtimeBits").setContent("64");<NEW_LINE>break;<NEW_LINE>case X86:<NEW_LINE>jre.addChild("runtimeBits").setContent("32");<NEW_LINE>}<NEW_LINE>if (setMemory) {<NEW_LINE>jre.addChild("initialHeapSize").setContent(Preferences.get("run.options.memory.initial"));<NEW_LINE>jre.addChild("maxHeapSize").setContent(Preferences.get("run.options.memory.maximum"));<NEW_LINE>}<NEW_LINE>// https://github.com/processing/processing/issues/2239<NEW_LINE>jre.addChild("opt").setContent("-Djna.nosys=true");<NEW_LINE>// Set library path; NOT including environment variable %PATH%, since it will include that<NEW_LINE>// anyway:<NEW_LINE>// https://github.com/processing/processing/pull/2622<NEW_LINE>// https://github.com/processing/processing/commit/b951614<NEW_LINE>jre.addChild("opt").setContent("-Djava.library.path=\".\\lib\"");<NEW_LINE>// Enable assertions<NEW_LINE>jre.addChild("opt").setContent("-ea");<NEW_LINE>// Add splash screen<NEW_LINE>jre.addChild("opt").setContent("-splash:\"./lib/jycessing/splash.png\"");<NEW_LINE>if (PythonMode.VERBOSE) {<NEW_LINE>// If we're in debug mode, assume we want our exports to be, too<NEW_LINE>jre.addChild("opt").setContent("-Dverbose=true");<NEW_LINE>}<NEW_LINE>return jre;<NEW_LINE>}
XML jre = new XML("jre");
588,856
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>int primaryColor = themeColorUtils.primaryColor(getContext());<NEW_LINE>user = getArguments().getParcelable(ARG_USER);<NEW_LINE>arbitraryDataProvider = new ArbitraryDataProvider(<MASK><NEW_LINE>// Inflate the layout for the dialog<NEW_LINE>LayoutInflater inflater = getActivity().getLayoutInflater();<NEW_LINE>// Setup layout<NEW_LINE>View v = inflater.inflate(R.layout.setup_encryption_dialog, null);<NEW_LINE>textView = v.findViewById(R.id.encryption_status);<NEW_LINE>passphraseTextView = v.findViewById(R.id.encryption_passphrase);<NEW_LINE>passwordField = v.findViewById(R.id.encryption_passwordInput);<NEW_LINE>passwordField.getBackground().setColorFilter(primaryColor, PorterDuff.Mode.SRC_ATOP);<NEW_LINE>Drawable wrappedDrawable = DrawableCompat.wrap(passwordField.getBackground());<NEW_LINE>DrawableCompat.setTint(wrappedDrawable, primaryColor);<NEW_LINE>passwordField.setBackgroundDrawable(wrappedDrawable);<NEW_LINE>return createDialog(v);<NEW_LINE>}
getContext().getContentResolver());
1,582,154
private JPAQuery<FeedEntry> buildQuery(User user, FeedSubscription sub, boolean unreadOnly, List<FeedEntryKeyword> keywords, Date newerThan, int offset, int limit, ReadingOrder order, FeedEntryStatus last, String tag) {<NEW_LINE>JPAQuery<FeedEntry> query = query().selectFrom(entry).where(entry.feed.eq(sub.getFeed()));<NEW_LINE>if (CollectionUtils.isNotEmpty(keywords)) {<NEW_LINE>query.join(entry.content, content);<NEW_LINE>for (FeedEntryKeyword keyword : keywords) {<NEW_LINE>BooleanBuilder or = new BooleanBuilder();<NEW_LINE>or.or(content.content.containsIgnoreCase(keyword.getKeyword()));<NEW_LINE>or.or(content.title.containsIgnoreCase(keyword.getKeyword()));<NEW_LINE>if (keyword.getMode() == Mode.EXCLUDE) {<NEW_LINE>or.not();<NEW_LINE>}<NEW_LINE>query.where(or);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>query.leftJoin(entry.statuses, status).on(status.subscription.id.eq(sub.getId()));<NEW_LINE>if (unreadOnly && tag == null) {<NEW_LINE>BooleanBuilder or = new BooleanBuilder();<NEW_LINE>or.or(status.read.isNull());<NEW_LINE>or.or(<MASK><NEW_LINE>query.where(or);<NEW_LINE>Date unreadThreshold = config.getApplicationSettings().getUnreadThreshold();<NEW_LINE>if (unreadThreshold != null) {<NEW_LINE>query.where(entry.updated.goe(unreadThreshold));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tag != null) {<NEW_LINE>BooleanBuilder and = new BooleanBuilder();<NEW_LINE>and.and(entryTag.user.id.eq(user.getId()));<NEW_LINE>and.and(entryTag.name.eq(tag));<NEW_LINE>query.join(entry.tags, entryTag).on(and);<NEW_LINE>}<NEW_LINE>if (newerThan != null) {<NEW_LINE>query.where(entry.inserted.goe(newerThan));<NEW_LINE>}<NEW_LINE>if (last != null) {<NEW_LINE>if (order == ReadingOrder.desc) {<NEW_LINE>query.where(entry.updated.gt(last.getEntryUpdated()));<NEW_LINE>} else {<NEW_LINE>query.where(entry.updated.lt(last.getEntryUpdated()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (order != null) {<NEW_LINE>if (order == ReadingOrder.asc) {<NEW_LINE>query.orderBy(entry.updated.asc(), entry.id.asc());<NEW_LINE>} else {<NEW_LINE>query.orderBy(entry.updated.desc(), entry.id.desc());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (offset > -1) {<NEW_LINE>query.offset(offset);<NEW_LINE>}<NEW_LINE>if (limit > -1) {<NEW_LINE>query.limit(limit);<NEW_LINE>}<NEW_LINE>setTimeout(query, config.getApplicationSettings().getQueryTimeout());<NEW_LINE>return query;<NEW_LINE>}
status.read.isFalse());
130,411
public void onCreation(PartTreeMongoQuery query) {<NEW_LINE>PartTree tree = query.getTree();<NEW_LINE>if (!tree.hasPredicate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Index index = new Index();<NEW_LINE>index.named(query.getQueryMethod().getName());<NEW_LINE>Sort sort = tree.getSort();<NEW_LINE>for (Part part : tree.getParts()) {<NEW_LINE>if (GEOSPATIAL_TYPES.contains(part.getType())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isIndexOnUnwrappedType(part)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String property = part.getProperty().toDotPath();<NEW_LINE>Direction order = toDirection(sort, property);<NEW_LINE>index.on(property, order);<NEW_LINE>}<NEW_LINE>// Add fixed sorting criteria to index<NEW_LINE>if (sort.isSorted()) {<NEW_LINE>for (Order order : sort) {<NEW_LINE>index.on(order.getProperty(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (query.getQueryMethod().hasAnnotatedCollation()) {<NEW_LINE>String collation = query.getQueryMethod().getAnnotatedCollation();<NEW_LINE>if (!collation.contains("?")) {<NEW_LINE>index = index.collation(Collation.parse(collation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MongoEntityMetadata<?> metadata = query.getQueryMethod().getEntityInformation();<NEW_LINE>try {<NEW_LINE>indexOperationsProvider.indexOps(metadata.getCollectionName(), metadata.getJavaType()).ensureIndex(index);<NEW_LINE>} catch (UncategorizedMongoDbException e) {<NEW_LINE>if (e.getCause() instanceof MongoException) {<NEW_LINE>if (((MongoException) e.getCause()).getCode() != 85) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(String.format("Created %s!", index));<NEW_LINE>}<NEW_LINE>}
), order.getDirection());
193,158
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>setSupportActionBar((Toolbar) findViewById(R.id.toolbar));<NEW_LINE>mImageView = findViewById(R.id.image);<NEW_LINE>mToolbarView = findViewById(R.id.toolbar);<NEW_LINE>mToolbarView.setBackgroundColor(ScrollUtils.getColorWithAlpha(0, getResources().getColor(R.color.primary)));<NEW_LINE>mParallaxImageHeight = getResources().getDimensionPixelSize(R.dimen.parallax_image_height);<NEW_LINE>mGridView = (ObservableGridView) findViewById(R.id.list);<NEW_LINE>mGridView.setScrollViewCallbacks(this);<NEW_LINE>// Set padding view for ListView. This is the flexible space.<NEW_LINE>View paddingView = new View(this);<NEW_LINE>AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, mParallaxImageHeight);<NEW_LINE>paddingView.setLayoutParams(lp);<NEW_LINE>// This is required to disable header's list selector effect<NEW_LINE>paddingView.setClickable(true);<NEW_LINE>mGridView.addHeaderView(paddingView);<NEW_LINE>setDummyData(mGridView);<NEW_LINE>// mListBackgroundView makes ListView's background except header view.<NEW_LINE>mListBackgroundView = findViewById(R.id.list_background);<NEW_LINE>}
setContentView(R.layout.activity_parallaxtoolbargridview);
1,209,950
public static void writeAccessRightsElement(XMLStreamWriter xmlw, DatasetVersionDTO datasetVersionDTO, String language) throws XMLStreamException {<NEW_LINE>// rightsList -> rights with rightsURI attribute<NEW_LINE>// <rightsList><NEW_LINE>xmlw.writeStartElement("rightsList");<NEW_LINE>// set terms from the info:eu-repo-Access-Terms vocabulary<NEW_LINE>writeRightsHeader(xmlw, language);<NEW_LINE>boolean restrict = false;<NEW_LINE>boolean closed = false;<NEW_LINE>if (datasetVersionDTO.isFileAccessRequest()) {<NEW_LINE>restrict = true;<NEW_LINE>}<NEW_LINE>if (datasetVersionDTO.getFiles() != null) {<NEW_LINE>for (int i = 0; i < datasetVersionDTO.getFiles().size(); i++) {<NEW_LINE>if (datasetVersionDTO.getFiles().get(i).isRestricted()) {<NEW_LINE>closed = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (restrict && closed) {<NEW_LINE>xmlw.writeAttribute("rightsURI", "info:eu-repo/semantics/restrictedAccess");<NEW_LINE>} else if (!restrict && closed) {<NEW_LINE>xmlw.writeAttribute("rightsURI", "info:eu-repo/semantics/closedAccess");<NEW_LINE>} else {<NEW_LINE>xmlw.writeAttribute("rightsURI", "info:eu-repo/semantics/openAccess");<NEW_LINE>}<NEW_LINE>// </rights><NEW_LINE>xmlw.writeEndElement();<NEW_LINE>writeRightsHeader(xmlw, language);<NEW_LINE>if (datasetVersionDTO.getLicense() != null) {<NEW_LINE>xmlw.writeAttribute("rightsURI", datasetVersionDTO.<MASK><NEW_LINE>xmlw.writeCharacters(datasetVersionDTO.getLicense().getName());<NEW_LINE>}<NEW_LINE>// </rights><NEW_LINE>xmlw.writeEndElement();<NEW_LINE>// </rightsList><NEW_LINE>xmlw.writeEndElement();<NEW_LINE>}
getLicense().getUri());
1,160,194
static public void intensityE(GrayS32 derivX, GrayS32 derivY, GrayF32 intensity) {<NEW_LINE>final int w = derivX.width;<NEW_LINE>final int h = derivY.height;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0,h,y->{<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexX = derivX.startIndex + y * derivX.stride;<NEW_LINE>int indexY = derivY<MASK><NEW_LINE>int indexI = intensity.startIndex + y * intensity.stride;<NEW_LINE>int end = indexX + w;<NEW_LINE>for (; indexX < end; indexX++, indexY++, indexI++) {<NEW_LINE>int dx = derivX.data[indexX];<NEW_LINE>int dy = derivY.data[indexY];<NEW_LINE>intensity.data[indexI] = (float) Math.sqrt(dx * dx + dy * dy);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
.startIndex + y * derivY.stride;
1,377,251
public static DescribeNatGatewaysResponse unmarshall(DescribeNatGatewaysResponse describeNatGatewaysResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNatGatewaysResponse.setRequestId(_ctx.stringValue("DescribeNatGatewaysResponse.RequestId"));<NEW_LINE>describeNatGatewaysResponse.setPageSize(_ctx.integerValue("DescribeNatGatewaysResponse.PageSize"));<NEW_LINE>describeNatGatewaysResponse.setPageNumber(_ctx.integerValue("DescribeNatGatewaysResponse.PageNumber"));<NEW_LINE>describeNatGatewaysResponse.setTotalCount(_ctx.integerValue("DescribeNatGatewaysResponse.TotalCount"));<NEW_LINE>List<NatGateway> natGateways = new ArrayList<NatGateway>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNatGatewaysResponse.NatGateways.Length"); i++) {<NEW_LINE>NatGateway natGateway = new NatGateway();<NEW_LINE>natGateway.setStatus(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].Status"));<NEW_LINE>natGateway.setCreationTime(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].CreationTime"));<NEW_LINE>natGateway.setVpcId(_ctx.stringValue<MASK><NEW_LINE>natGateway.setSpec(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].Spec"));<NEW_LINE>natGateway.setDescription(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].Description"));<NEW_LINE>natGateway.setNatGatewayId(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].NatGatewayId"));<NEW_LINE>natGateway.setBusinessStatus(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].BusinessStatus"));<NEW_LINE>natGateway.setName(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].Name"));<NEW_LINE>natGateway.setInstanceChargeType(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].InstanceChargeType"));<NEW_LINE>natGateway.setRegionId(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].RegionId"));<NEW_LINE>List<String> forwardTableIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].ForwardTableIds.Length"); j++) {<NEW_LINE>forwardTableIds.add(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].ForwardTableIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>natGateway.setForwardTableIds(forwardTableIds);<NEW_LINE>List<String> bandwidthPackageIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].BandwidthPackageIds.Length"); j++) {<NEW_LINE>bandwidthPackageIds.add(_ctx.stringValue("DescribeNatGatewaysResponse.NatGateways[" + i + "].BandwidthPackageIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>natGateway.setBandwidthPackageIds(bandwidthPackageIds);<NEW_LINE>natGateways.add(natGateway);<NEW_LINE>}<NEW_LINE>describeNatGatewaysResponse.setNatGateways(natGateways);<NEW_LINE>return describeNatGatewaysResponse;<NEW_LINE>}
("DescribeNatGatewaysResponse.NatGateways[" + i + "].VpcId"));
380,109
public void initialize(Server server, Injector injector) {<NEW_LINE>final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);<NEW_LINE>root.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");<NEW_LINE>root.addServlet(new ServletHolder(new DefaultServlet()), "/*");<NEW_LINE>ServletHolder queryServletHolder = buildServletHolder(asyncQueryForwardingServlet, routerHttpClientConfig);<NEW_LINE>root.addServlet(queryServletHolder, "/druid/v2/*");<NEW_LINE>root.addServlet(queryServletHolder, "/druid/v1/lookups/*");<NEW_LINE>if (managementProxyConfig.isEnabled()) {<NEW_LINE>ServletHolder managementForwardingServletHolder = buildServletHolder(asyncManagementForwardingServlet, globalHttpClientConfig);<NEW_LINE>root.addServlet(managementForwardingServletHolder, "/druid/coordinator/*");<NEW_LINE>root.addServlet(managementForwardingServletHolder, "/druid/indexer/*");<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final ObjectMapper jsonMapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));<NEW_LINE>final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class);<NEW_LINE>AuthenticationUtils.addSecuritySanityCheckFilter(root, jsonMapper);<NEW_LINE>// perform no-op authorization/authentication for these resources<NEW_LINE>AuthenticationUtils.addNoopAuthenticationAndAuthorizationFilters(root, UNSECURED_PATHS);<NEW_LINE>WebConsoleJettyServerInitializer.intializeServerForWebConsoleRoot(root);<NEW_LINE>AuthenticationUtils.addNoopAuthenticationAndAuthorizationFilters(root, authConfig.getUnsecuredPaths());<NEW_LINE>final List<Authenticator> authenticators = authenticatorMapper.getAuthenticatorChain();<NEW_LINE>AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);<NEW_LINE>AuthenticationUtils.addAllowOptionsFilter(root, authConfig.isAllowUnauthenticatedHttpOptions());<NEW_LINE>JettyServerInitUtils.addAllowHttpMethodsFilter(root, serverConfig.getAllowedHttpMethods());<NEW_LINE>JettyServerInitUtils.addExtensionFilters(root, injector);<NEW_LINE>// Check that requests were authorized before sending responses<NEW_LINE>AuthenticationUtils.addPreResponseAuthorizationCheckFilter(root, authenticators, jsonMapper);<NEW_LINE>// Can't use '/*' here because of Guice conflicts with AsyncQueryForwardingServlet path<NEW_LINE>root.addFilter(GuiceFilter.class, "/status/*", null);<NEW_LINE>root.addFilter(GuiceFilter.class, "/druid/router/*", null);<NEW_LINE>root.addFilter(GuiceFilter.class, "/druid-ext/*", null);<NEW_LINE>final HandlerList handlerList = new HandlerList();<NEW_LINE>handlerList.setHandlers(new Handler[] { WebConsoleJettyServerInitializer.createWebConsoleRewriteHandler(), JettyServerInitUtils.getJettyRequestLogHandler(), JettyServerInitUtils.wrapWithDefaultGzipHandler(root, serverConfig.getInflateBufferSize(), serverConfig.getCompressionLevel()) });<NEW_LINE>server.setHandler(handlerList);<NEW_LINE>}
root.addServlet(managementForwardingServletHolder, "/proxy/*");
32,232
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {<NEW_LINE>ItemStack item = player.getItemInHand(hand);<NEW_LINE>CompoundTag nbt = item.getOrCreateTag();<NEW_LINE>boolean mainHand = hand == InteractionHand.MAIN_HAND;<NEW_LINE>// Shift -> Open GUI<NEW_LINE>if (player.isShiftKeyDown()) {<NEW_LINE>if (world.isClientSide) {<NEW_LINE>DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {<NEW_LINE>openHandgunGUI(item, hand);<NEW_LINE>});<NEW_LINE>player.getCooldowns().addCooldown(item.getItem(), 10);<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>if (ShootableGadgetItemMethods.shouldSwap(player, item, hand, this::isZapper))<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, item);<NEW_LINE>// Check if can be used<NEW_LINE>Component msg = validateUsage(item);<NEW_LINE>if (msg != null) {<NEW_LINE>AllSoundEvents.DENY.play(world, player, player.blockPosition());<NEW_LINE>player.displayClientMessage(msg.plainCopy().withStyle(ChatFormatting.RED), true);<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, item);<NEW_LINE>}<NEW_LINE>BlockState stateToUse = Blocks.AIR.defaultBlockState();<NEW_LINE>if (nbt.contains("BlockUsed"))<NEW_LINE>stateToUse = NbtUtils.readBlockState(nbt.getCompound("BlockUsed"));<NEW_LINE><MASK><NEW_LINE>CompoundTag data = null;<NEW_LINE>if (AllBlockTags.SAFE_NBT.matches(stateToUse) && nbt.contains("BlockData", Tag.TAG_COMPOUND)) {<NEW_LINE>data = nbt.getCompound("BlockData");<NEW_LINE>}<NEW_LINE>// Raytrace - Find the target<NEW_LINE>Vec3 start = player.position().add(0, player.getEyeHeight(), 0);<NEW_LINE>Vec3 range = player.getLookAngle().scale(getZappingRange(item));<NEW_LINE>BlockHitResult raytrace = world.clip(new ClipContext(start, start.add(range), Block.OUTLINE, Fluid.NONE, player));<NEW_LINE>BlockPos pos = raytrace.getBlockPos();<NEW_LINE>BlockState stateReplaced = world.getBlockState(pos);<NEW_LINE>// No target<NEW_LINE>if (pos == null || stateReplaced.getBlock() == Blocks.AIR) {<NEW_LINE>ShootableGadgetItemMethods.applyCooldown(player, item, hand, this::isZapper, getCooldownDelay(item));<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>// Find exact position of gun barrel for VFX<NEW_LINE>Vec3 barrelPos = ShootableGadgetItemMethods.getGunBarrelVec(player, mainHand, new Vec3(.35f, -0.1f, 1));<NEW_LINE>// Client side<NEW_LINE>if (world.isClientSide) {<NEW_LINE>CreateClient.ZAPPER_RENDER_HANDLER.dontAnimateItem(hand);<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>// Server side<NEW_LINE>if (activate(world, player, item, stateToUse, raytrace, data)) {<NEW_LINE>ShootableGadgetItemMethods.applyCooldown(player, item, hand, this::isZapper, getCooldownDelay(item));<NEW_LINE>ShootableGadgetItemMethods.sendPackets(player, b -> new ZapperBeamPacket(barrelPos, raytrace.getLocation(), hand, b));<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}
stateToUse = BlockHelper.setZeroAge(stateToUse);
280,071
public static void init() {<NEW_LINE>// Metrics registries will be initialized only if enabled<NEW_LINE>if (!Configuration.root().getBoolean("metrics", false)) {<NEW_LINE>logger.debug("Metrics not enabled in the conf file.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Metrics & healthcheck registries will be initialized only once<NEW_LINE>if (_metricRegistry != null) {<NEW_LINE>logger.debug("Metric registries already initialized.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_metricRegistry = new MetricRegistry();<NEW_LINE>String autoTunerClassName = AutoTuner.class.getSimpleName();<NEW_LINE>String apiClassName = Application.class.getSimpleName();<NEW_LINE>// API timer and failed counts<NEW_LINE>_getCurrentRunParametersTimer = _metricRegistry.timer(name(apiClassName, "getCurrentRunParametersResponses"));<NEW_LINE>_getCurrentRunParametersFailures = _metricRegistry.meter(name(apiClassName, "getCurrentRunParametersFailures", "count"));<NEW_LINE>// Daemon counters<NEW_LINE>_fitnessComputedExecutions = _metricRegistry.meter(name(autoTunerClassName, "fitnessComputedExecutions", "count"));<NEW_LINE>_successfulExecutions = _metricRegistry.meter(name(autoTunerClassName, "successfulExecutions", "count"));<NEW_LINE>_failedExecutions = _metricRegistry.meter(name(autoTunerClassName, "failedExecutions", "count"));<NEW_LINE>_paramSetGenerated = _metricRegistry.meter(name(autoTunerClassName, "paramSetGenerated", "count"));<NEW_LINE>_baselineComputed = _metricRegistry.meter(name<MASK><NEW_LINE>_paramSetNotFound = _metricRegistry.meter(name(autoTunerClassName, "paramSetNotFound", "count"));<NEW_LINE>_newAutoTuningJob = _metricRegistry.meter(name(autoTunerClassName, "newAutoTuningJob", "count"));<NEW_LINE>_metricRegistry.register(name(autoTunerClassName, "fitnessComputeWaitExecutions", "size"), new Gauge<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer getValue() {<NEW_LINE>return _fitnessComputeWaitExecutions;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_metricRegistry.register(name(autoTunerClassName, "baselineComputeWaitJobs", "size"), new Gauge<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer getValue() {<NEW_LINE>return _baselineComputeWaitJobs;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_metricRegistry.register(name(autoTunerClassName, "azkabanStatusUpdateWaitExecutions", "size"), new Gauge<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer getValue() {<NEW_LINE>return _azkabanStatusUpdateWaitExecutions;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_metricRegistry.register(name(autoTunerClassName, "paramSetGenerateWaitJobs", "size"), new Gauge<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer getValue() {<NEW_LINE>return _paramSetGenerateWaitJobs;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(autoTunerClassName, "baselineComputed", "count"));
1,826,724
final BatchCreateTableRowsResult executeBatchCreateTableRows(BatchCreateTableRowsRequest batchCreateTableRowsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchCreateTableRowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchCreateTableRowsRequest> request = null;<NEW_LINE>Response<BatchCreateTableRowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchCreateTableRowsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchCreateTableRowsRequest));<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, "BatchCreateTableRows");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchCreateTableRowsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchCreateTableRowsResultJsonUnmarshaller());<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, "Honeycode");
299,852
protected void prepare() {<NEW_LINE>// Get parameters<NEW_LINE>ProcessInfoParameter[] para = getParametersAsArray();<NEW_LINE>for (int i = 0; i < para.length; i++) {<NEW_LINE>String name = para[i].getParameterName();<NEW_LINE>if (para[i].getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals("M_Product_Category_ID")) {<NEW_LINE>m_productCategoryId = para[i].getParameterAsInt();<NEW_LINE>} else if (name.equals("C_AcctSchema_ID")) {<NEW_LINE>m_acctSchemaId = para[i].getParameterAsInt();<NEW_LINE>} else if (name.equals("M_PriceList_ID")) {<NEW_LINE>m_priceListId = para[i].getParameterAsInt();<NEW_LINE>} else if (name.equals("C_UOM_ID")) {<NEW_LINE>m_uomId = para[i].getParameterAsInt();<NEW_LINE>} else if (name.equals("C_TaxCategory_ID")) {<NEW_LINE>m_taxCategoryId = <MASK><NEW_LINE>} else if (name.equals("ProductValuePrefix")) {<NEW_LINE>m_productValuePrefix = para[i].getParameter().toString();<NEW_LINE>} else if (name.equals("ProductValueSuffix")) {<NEW_LINE>m_productValueSuffix = para[i].getParameter().toString();<NEW_LINE>} else if (name.equals("StartElement")) {<NEW_LINE>m_startElement = para[i].getParameter().toString();<NEW_LINE>} else if (name.equals("EndElement")) {<NEW_LINE>m_endElement = para[i].getParameter().toString();<NEW_LINE>} else {<NEW_LINE>log.error("Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
para[i].getParameterAsInt();
15,400
public void synchronizeKeyToPassive(PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel, int concurrencyKey) {<NEW_LINE>LOGGER.info("Sync started for concurrency key {}.", concurrencyKey);<NEW_LINE>if (concurrencyKey == DEFAULT_KEY) {<NEW_LINE>stateService.getStateRepositoryManager().syncMessageFor(storeIdentifier).forEach(syncChannel::synchronizeToPassive);<NEW_LINE>} else if (concurrencyKey == TRACKER_SYNC_KEY) {<NEW_LINE>sendMessageTrackerReplication(syncChannel);<NEW_LINE>} else {<NEW_LINE>boolean interrupted = false;<NEW_LINE>BlockingQueue<DataSyncMessageHandler> messageQ = new SynchronousQueue<>();<NEW_LINE>int segmentId = concurrencyKey - DEFAULT_KEY - 1;<NEW_LINE>Thread thisThread = Thread.currentThread();<NEW_LINE>CompletableFuture<Void> asyncGet = CompletableFuture.runAsync(() -> doGetsForSync(segmentId, messageQ, syncChannel, thisThread), syncGetsExecutor);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>while (messageQ.take().execute()) ;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>interrupted = true;<NEW_LINE>}<NEW_LINE>if (interrupted) {<NEW_LINE>// here we may have been interrupted due to a genuine exception on the async get thread<NEW_LINE>// let us try and not loose that exception as it takes precedence over the interrupt<NEW_LINE>asyncGet.get(10, TimeUnit.SECONDS);<NEW_LINE>// we received a genuine interrupt<NEW_LINE>throw new InterruptedException();<NEW_LINE>} else {<NEW_LINE>asyncGet.get();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
LOGGER.info("Sync complete for concurrency key {}.", concurrencyKey);
1,027,419
public Set<ModeStructureSnapshot.SlidingModeSnapshot> createSlidingModeSnapshots() {<NEW_LINE>Set<ModeStructureSnapshot.SlidingModeSnapshot> result = new HashSet<ModeStructureSnapshot.SlidingModeSnapshot>();<NEW_LINE>for (Map.Entry<ModeImpl, String> curEntry : slidingModes2Sides.entrySet()) {<NEW_LINE>final ModeImpl key = curEntry.getKey();<NEW_LINE>AbstractMap<TopComponent, Integer> lazy = new AbstractMap<TopComponent, Integer>() {<NEW_LINE><NEW_LINE>Map<TopComponent, Integer> delegate;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Set<Entry<TopComponent, Integer>> entrySet() {<NEW_LINE>if (delegate == null) {<NEW_LINE>delegate = getSlideInSizes(key);<NEW_LINE>}<NEW_LINE>return delegate.entrySet();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>result.add(new ModeStructureSnapshot.SlidingModeSnapshot(curEntry.getKey(), curEntry<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.getValue(), lazy));
1,427,509
public void spawnTracks() {<NEW_LINE>// If there are no tracks then associate is not called. Reset() could have been called at associate is<NEW_LINE>// in an undefined state<NEW_LINE>if (tracksAll.size == 0) {<NEW_LINE>for (int i = 0; i < dstDesc.size; i++) {<NEW_LINE>Point2D_F64 loc = dstPixels.get(i);<NEW_LINE>addNewTrack(dstSet.get(i), loc.x, loc.y<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// create new tracks from latest unassociated detected features<NEW_LINE>DogArray_I32 unassociated = associate.getUnassociatedDestination();<NEW_LINE>for (int i = 0; i < unassociated.size; i++) {<NEW_LINE>int indexDst = unassociated.get(i);<NEW_LINE>Point2D_F64 loc = dstPixels.get(indexDst);<NEW_LINE>addNewTrack(dstSet.get(i), loc.x, loc.y, dstDesc.get(indexDst));<NEW_LINE>}<NEW_LINE>}
, dstDesc.get(i));
447,767
private void loadNode135() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageCount, new QualifiedName(0, "RepublishMessageCount"), new LocalizedText("en", "RepublishMessageCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_RepublishMessageCount, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));