idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
186,225 | final AdminRemoveUserFromGroupResult executeAdminRemoveUserFromGroup(AdminRemoveUserFromGroupRequest adminRemoveUserFromGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminRemoveUserFromGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AdminRemoveUserFromGroupRequest> request = null;<NEW_LINE>Response<AdminRemoveUserFromGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminRemoveUserFromGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(adminRemoveUserFromGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AdminRemoveUserFromGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AdminRemoveUserFromGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AdminRemoveUserFromGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,268,829 | public void init() {<NEW_LINE>RhoBluetoothManager.logi(TAG, "init()");<NEW_LINE>// constructor<NEW_LINE>mActivity = RhodesActivity.getInstance();<NEW_LINE>if (mActivity == null)<NEW_LINE>throw new IllegalStateException("No rhodes activity instance at this moment");<NEW_LINE>mDeviceName = "NONAME";<NEW_LINE>mInputBuffer = new byte[1024];<NEW_LINE>mInputBufferSize = 0;<NEW_LINE>mBluetoothIsEnabled = false;<NEW_LINE>// check feature<NEW_LINE>PackageManager pm = RhodesService.getInstance().getPackageManager();<NEW_LINE>FeatureInfo[] fs = pm.getSystemAvailableFeatures();<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < fs.length; i++) {<NEW_LINE>if (fs[i] != null)<NEW_LINE>if (fs[i].name != null)<NEW_LINE>if (fs[i].name.equals(PackageManager.FEATURE_BLUETOOTH)) {<NEW_LINE>RhoBluetoothManager.logi(TAG, "sharedInstance - found Bluetooth feature in device !");<NEW_LINE>mBluetoothIsEnabled = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check permission<NEW_LINE>// if (pm.checkPermission(android.Manifest.permission.BLUETOOTH, RhodesService.getInstance().getMainActivity().getPackageName()) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>try {<NEW_LINE>BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();<NEW_LINE>if (bluetoothAdapter != null) {<NEW_LINE>if (!bluetoothAdapter.isEnabled()) {<NEW_LINE>RhoBluetoothManager.logi(TAG, "sharedInstance - Bluetooth is not enabled !");<NEW_LINE>mBluetoothIsEnabled = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RhoBluetoothManager.logi(TAG, "sharedInstance - Bluetooth permission is active !");<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>RhoBluetoothManager.logi(TAG, "sharedInstance - Bluetooth permission is INACTIVE !");<NEW_LINE>mBluetoothIsEnabled = false;<NEW_LINE>}<NEW_LINE>// mInput = new StringBuffer("");<NEW_LINE>// Get local Bluetooth adapter<NEW_LINE>if (mBluetoothIsEnabled) {<NEW_LINE>RhoBluetoothManager.logi(TAG, "bluetooth is enabled");<NEW_LINE>mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();<NEW_LINE>if (mBluetoothAdapter != null) {<NEW_LINE>if (mBluetoothAdapter.isEnabled()) {<NEW_LINE>if (mSession == null) {<NEW_LINE>setupSession();<NEW_LINE>}<NEW_LINE>mDeviceName = mBluetoothAdapter.getName();<NEW_LINE>RhoBluetoothManager.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RhoBluetoothManager.logi(TAG, "bluetooth is disabled");<NEW_LINE>}<NEW_LINE>RhoExtManager.getInstance().addRhoListener(this);<NEW_LINE>} | logi(TAG, "Bluetooth device name = " + mDeviceName); |
433,845 | public static void subscriptionAction(final CacheManager cm, final APIResponseHandler.ActionResponseHandler responseHandler, final RedditAccount user, final SubredditCanonicalId subredditId, @RedditSubredditAction final int action, final Context context) {<NEW_LINE>RedditSubredditManager.getInstance(context, user).getSubreddit(subredditId, TimestampBound.ANY, new RequestResponseHandler<RedditSubreddit, SubredditRequestFailure>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestFailed(final SubredditRequestFailure failureReason) {<NEW_LINE>responseHandler.notifyFailure(failureReason.requestFailureType, failureReason.t, failureReason.statusLine, failureReason.readableMessage, Optional.empty());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestSuccess(final RedditSubreddit subreddit, final long timeCached) {<NEW_LINE>final LinkedList<PostField> <MASK><NEW_LINE>postFields.add(new PostField("sr", subreddit.name));<NEW_LINE>final URI url = subscriptionPrepareActionUri(action, postFields);<NEW_LINE>cm.makeRequest(createPostRequest(url, user, postFields, context, new GenericResponseHandler(responseHandler)));<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>} | postFields = new LinkedList<>(); |
237,356 | protected void zkInit() throws Exception {<NEW_LINE>bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));<NEW_LINE>orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));<NEW_LINE>shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", false));<NEW_LINE>rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));<NEW_LINE>Borderlayout parameterLayout = new Borderlayout();<NEW_LINE>parameterLayout.setHeight("110px");<NEW_LINE>parameterLayout.setWidth("100%");<NEW_LINE>Panel parameterPanel = v_CreateFromPanel.getParameterPanel();<NEW_LINE>parameterPanel.appendChild(parameterLayout);<NEW_LINE>Grid parameterStdLayout = GridFactory.newGridLayout();<NEW_LINE>Panel parameterStdPanel = new Panel();<NEW_LINE>parameterStdPanel.appendChild(parameterStdLayout);<NEW_LINE>Center center = new Center();<NEW_LINE>parameterLayout.appendChild(center);<NEW_LINE>center.appendChild(parameterStdPanel);<NEW_LINE>Rows rows = (Rows) parameterStdLayout.newRows();<NEW_LINE>Row row = rows.newRow();<NEW_LINE>row.appendChild(bPartnerLabel.rightAlign());<NEW_LINE>if (bPartnerField != null)<NEW_LINE>row.appendChild(bPartnerField.getComponent());<NEW_LINE>row.appendChild(orderLabel.rightAlign());<NEW_LINE>row.appendChild(orderField);<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(new Space());<NEW_LINE>row.appendChild(new Space());<NEW_LINE>row.appendChild(shipmentLabel.rightAlign());<NEW_LINE>row.appendChild(shipmentField);<NEW_LINE>// Add RMA document selection to panel<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(new Space());<NEW_LINE>row.appendChild(new Space());<NEW_LINE>row.<MASK><NEW_LINE>row.appendChild(rmaField);<NEW_LINE>// Add to Main<NEW_LINE>v_CreateFromPanel.setWidth("100%");<NEW_LINE>v_CreateFromPanel.setHeight("100%");<NEW_LINE>v_Container.appendChild(v_CreateFromPanel);<NEW_LINE>} | appendChild(rmaLabel.rightAlign()); |
1,069,605 | protected XContentBuilder internalXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(SearchSourceBuilder.FROM_FIELD.getPreferredName(), from);<NEW_LINE>builder.field(SearchSourceBuilder.<MASK><NEW_LINE>builder.field(SearchSourceBuilder.VERSION_FIELD.getPreferredName(), version);<NEW_LINE>builder.field(SearchSourceBuilder.SEQ_NO_PRIMARY_TERM_FIELD.getPreferredName(), seqNoAndPrimaryTerm);<NEW_LINE>builder.field(SearchSourceBuilder.EXPLAIN_FIELD.getPreferredName(), explain);<NEW_LINE>if (fetchSourceContext != null) {<NEW_LINE>builder.field(SearchSourceBuilder._SOURCE_FIELD.getPreferredName(), fetchSourceContext);<NEW_LINE>}<NEW_LINE>if (storedFieldsContext != null) {<NEW_LINE>storedFieldsContext.toXContent(SearchSourceBuilder.STORED_FIELDS_FIELD.getPreferredName(), builder);<NEW_LINE>}<NEW_LINE>if (docValueFields != null) {<NEW_LINE>builder.startArray(SearchSourceBuilder.DOCVALUE_FIELDS_FIELD.getPreferredName());<NEW_LINE>for (FieldAndFormat docValueField : docValueFields) {<NEW_LINE>docValueField.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>if (fetchFields != null) {<NEW_LINE>builder.startArray(SearchSourceBuilder.FETCH_FIELDS_FIELD.getPreferredName());<NEW_LINE>for (FieldAndFormat docValueField : fetchFields) {<NEW_LINE>docValueField.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>if (scriptFields != null) {<NEW_LINE>builder.startObject(SearchSourceBuilder.SCRIPT_FIELDS_FIELD.getPreferredName());<NEW_LINE>for (ScriptField scriptField : scriptFields) {<NEW_LINE>scriptField.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>if (sorts != null) {<NEW_LINE>builder.startArray(SearchSourceBuilder.SORT_FIELD.getPreferredName());<NEW_LINE>for (SortBuilder<?> sort : sorts) {<NEW_LINE>sort.toXContent(builder, params);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>if (trackScores) {<NEW_LINE>builder.field(SearchSourceBuilder.TRACK_SCORES_FIELD.getPreferredName(), true);<NEW_LINE>}<NEW_LINE>if (highlightBuilder != null) {<NEW_LINE>builder.field(SearchSourceBuilder.HIGHLIGHT_FIELD.getPreferredName(), highlightBuilder);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | SIZE_FIELD.getPreferredName(), size); |
179,378 | public static <T1, T2, T3, R1, R2, R3, R> Mono<R> forEach4(Mono<? extends T1> value1, Function<? super T1, ? extends Mono<R1>> value2, BiFunction<? super T1, ? super R1, ? extends Mono<R2>> value3, Function3<? super T1, ? super R1, ? super R2, ? extends Mono<R3>> value4, Function4<? super T1, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {<NEW_LINE>Future<? extends R> res = Future.fromPublisher(value1).flatMap(in -> {<NEW_LINE>Future<R1> a = Future.fromPublisher<MASK><NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>Future<R2> b = Future.fromPublisher(value3.apply(in, ina));<NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>Future<R3> c = Future.fromPublisher(value4.apply(in, ina, inb));<NEW_LINE>return c.map(in2 -> yieldingFunction.apply(in, ina, inb, in2));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return Mono.from(res);<NEW_LINE>} | (value2.apply(in)); |
1,334 | public <T extends IRecipeRoot> T readRoot(T target, String rootElement) throws XMLStreamException, InvalidRecipeConfigException {<NEW_LINE>T result = null;<NEW_LINE>while (eventReader.hasNext()) {<NEW_LINE>XMLEvent event = eventReader.nextEvent();<NEW_LINE>switch(event.getEventType()) {<NEW_LINE>case XMLStreamConstants.NAMESPACE:<NEW_LINE>case XMLStreamConstants.PROCESSING_INSTRUCTION:<NEW_LINE>case XMLStreamConstants.COMMENT:<NEW_LINE>case XMLStreamConstants.DTD:<NEW_LINE>case XMLStreamConstants.START_DOCUMENT:<NEW_LINE>case XMLStreamConstants.END_DOCUMENT:<NEW_LINE>break;<NEW_LINE>case XMLStreamConstants.START_ELEMENT:<NEW_LINE>if (result == null) {<NEW_LINE><MASK><NEW_LINE>if (rootElement.equals(startElement.getName().getLocalPart())) {<NEW_LINE>result = read(target, startElement);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>throw new InvalidRecipeConfigException("Unexpected tag '" + startElement.getName() + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case XMLStreamConstants.END_ELEMENT:<NEW_LINE>case XMLStreamConstants.CHARACTERS:<NEW_LINE>case XMLStreamConstants.ATTRIBUTE:<NEW_LINE>default:<NEW_LINE>throw new InvalidRecipeConfigException("Unexpected element '" + event + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw new InvalidRecipeConfigException("Missing top-level tag '" + rootElement + "'");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | StartElement startElement = event.asStartElement(); |
52,139 | public void onTextureStitchPre(ResourceLocation modelLocation, Set<ResourceLocation> toRegisterSprites) {<NEW_LINE>if (ModelHolderRegistry.DEBUG) {<NEW_LINE>BCLog.logger.info("[lib.model] The model " + modelLocation + " requires these sprites:");<NEW_LINE>}<NEW_LINE>ReloadSource srcModel = new ReloadSource(modelLocation, SourceType.MODEL);<NEW_LINE>for (Entry<String, JsonTexture> entry : textures.entrySet()) {<NEW_LINE>JsonTexture lookup = entry.getValue();<NEW_LINE>String location = lookup.location;<NEW_LINE>if (location.startsWith("#") || location.startsWith("~")) {<NEW_LINE>// its somewhere else in the map so we don't need to register it twice<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ResourceLocation textureLoc = new ResourceLocation(location);<NEW_LINE>toRegisterSprites.add(textureLoc);<NEW_LINE>// Allow transitive deps<NEW_LINE>ReloadSource srcSprite = new ReloadSource(SpriteUtil.transformLocation<MASK><NEW_LINE>ReloadManager.INSTANCE.addDependency(srcSprite, srcModel);<NEW_LINE>if (ModelHolderRegistry.DEBUG) {<NEW_LINE>BCLog.logger.info("[lib.model] - " + location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (textureLoc), SourceType.SPRITE); |
1,441,555 | private void handleServiceInfo(ServiceInfo info) throws UnsupportedEncodingException {<NEW_LINE>Inet4Address[] v4Addrs = info.getInet4Addresses();<NEW_LINE>Inet6Address[] v6Addrs = info.getInet6Addresses();<NEW_LINE>LimeLog.info("mDNS: " + info.getName() + " has " + v4Addrs.length + " IPv4 addresses");<NEW_LINE>LimeLog.info("mDNS: " + info.getName() + <MASK><NEW_LINE>Inet6Address v6GlobalAddr = getBestIpv6Address(v6Addrs);<NEW_LINE>// Add a computer object for each IPv4 address reported by the PC<NEW_LINE>for (Inet4Address v4Addr : v4Addrs) {<NEW_LINE>synchronized (computers) {<NEW_LINE>MdnsComputer computer = new MdnsComputer(info.getName(), v4Addr, v6GlobalAddr);<NEW_LINE>if (computers.put(computer.getLocalAddress(), computer) == null) {<NEW_LINE>// This was a new entry<NEW_LINE>listener.notifyComputerAdded(computer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If there were no IPv4 addresses, use IPv6 for registration<NEW_LINE>if (v4Addrs.length == 0) {<NEW_LINE>Inet6Address v6LocalAddr = getLocalAddress(v6Addrs);<NEW_LINE>if (v6LocalAddr != null || v6GlobalAddr != null) {<NEW_LINE>MdnsComputer computer = new MdnsComputer(info.getName(), v6LocalAddr, v6GlobalAddr);<NEW_LINE>if (computers.put(v6LocalAddr != null ? computer.getLocalAddress() : computer.getIpv6Address(), computer) == null) {<NEW_LINE>// This was a new entry<NEW_LINE>listener.notifyComputerAdded(computer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | " has " + v6Addrs.length + " IPv6 addresses"); |
449,478 | // Get the public key associated with an asymmetric key.<NEW_LINE>public void signAsymmetric(String projectId, String locationId, String keyRingId, String keyId, String keyVersionId, String message) throws IOException, GeneralSecurityException {<NEW_LINE>// Initialize client that will be used to send requests. This client only<NEW_LINE>// needs to be created once, and can be reused for multiple requests. After<NEW_LINE>// completing all of your requests, call the "close" method on the client to<NEW_LINE>// safely clean up any remaining background resources.<NEW_LINE>try (KeyManagementServiceClient client = KeyManagementServiceClient.create()) {<NEW_LINE>// Build the key version name from the project, location, key ring, key,<NEW_LINE>// and key version.<NEW_LINE>CryptoKeyVersionName keyVersionName = CryptoKeyVersionName.of(projectId, <MASK><NEW_LINE>// Convert the message into bytes. Cryptographic plaintexts and<NEW_LINE>// ciphertexts are always byte arrays.<NEW_LINE>byte[] plaintext = message.getBytes(StandardCharsets.UTF_8);<NEW_LINE>// Calculate the digest.<NEW_LINE>MessageDigest sha256 = MessageDigest.getInstance("SHA-256");<NEW_LINE>byte[] hash = sha256.digest(plaintext);<NEW_LINE>// Build the digest object.<NEW_LINE>Digest digest = Digest.newBuilder().setSha256(ByteString.copyFrom(hash)).build();<NEW_LINE>// Optional, but recommended: compute digest's CRC32C. See helper below.<NEW_LINE>long digestCrc32c = getCrc32cAsLong(hash);<NEW_LINE>// Sign the digest.<NEW_LINE>AsymmetricSignRequest request = AsymmetricSignRequest.newBuilder().setName(keyVersionName.toString()).setDigest(digest).setDigestCrc32C(Int64Value.newBuilder().setValue(digestCrc32c).build()).build();<NEW_LINE>AsymmetricSignResponse response = client.asymmetricSign(request);<NEW_LINE>// Optional, but recommended: perform integrity verification on response.<NEW_LINE>// For more details on ensuring E2E in-transit integrity to and from Cloud KMS visit:<NEW_LINE>// https://cloud.google.com/kms/docs/data-integrity-guidelines<NEW_LINE>if (!response.getVerifiedDigestCrc32C()) {<NEW_LINE>throw new IOException("AsymmetricSign: request to server corrupted");<NEW_LINE>}<NEW_LINE>// See helper below.<NEW_LINE>if (!crcMatches(response.getSignatureCrc32C().getValue(), response.getSignature().toByteArray())) {<NEW_LINE>throw new IOException("AsymmetricSign: response from server corrupted");<NEW_LINE>}<NEW_LINE>// Get the signature.<NEW_LINE>byte[] signature = response.getSignature().toByteArray();<NEW_LINE>System.out.printf("Signature %s%n", signature);<NEW_LINE>}<NEW_LINE>} | locationId, keyRingId, keyId, keyVersionId); |
508,257 | private void waitUntilDownloadStarted(FileReferenceDownload fileReferenceDownload) {<NEW_LINE>Instant end = Instant.now().plus(downloadTimeout);<NEW_LINE>FileReference fileReference = fileReferenceDownload.fileReference();<NEW_LINE>int retryCount = 0;<NEW_LINE><MASK><NEW_LINE>do {<NEW_LINE>backoff(retryCount);<NEW_LINE>if (FileDownloader.fileReferenceExists(fileReference, downloadDirectory))<NEW_LINE>return;<NEW_LINE>if (startDownloadRpc(fileReferenceDownload, retryCount, connection))<NEW_LINE>return;<NEW_LINE>retryCount++;<NEW_LINE>// There might not be one connection that works for all file references (each file reference might<NEW_LINE>// exist on just one config server, and which one could be different for each file reference), so<NEW_LINE>// switch to a new connection for every retry<NEW_LINE>connection = connectionPool.switchConnection(connection);<NEW_LINE>} while (retryCount < 5 || Instant.now().isAfter(end));<NEW_LINE>fileReferenceDownload.future().completeExceptionally(new RuntimeException("Failed getting " + fileReference));<NEW_LINE>downloads.remove(fileReference);<NEW_LINE>} | Connection connection = connectionPool.getCurrent(); |
858,501 | private void buildGetWikipediaBanner(ViewGroup viewGroup) {<NEW_LINE>OsmAndFeature feature = OsmAndFeature.WIKIPEDIA;<NEW_LINE>LinearLayout view = buildCollapsableContentView(app, false, true);<NEW_LINE>View banner = UiUtilities.getInflater(app, !light).inflate(R.layout.get_wikipedia_context_menu_banner, view, false);<NEW_LINE>ImageView ivIcon = banner.findViewById(R.id.icon);<NEW_LINE>ivIcon.setImageResource(<MASK><NEW_LINE>View btnGet = banner.findViewById(R.id.button_get);<NEW_LINE>UiUtilities.setupDialogButton(!light, btnGet, DialogButtonType.PRIMARY, R.string.get_plugin);<NEW_LINE>btnGet.setOnClickListener(v -> {<NEW_LINE>if (mapActivity != null) {<NEW_LINE>ChoosePlanFragment.showInstance(mapActivity, feature);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>View row = createRowContainer(app, NEAREST_WIKI_KEY);<NEW_LINE>view.addView(banner);<NEW_LINE>String text = app.getString(R.string.wiki_around);<NEW_LINE>CollapsableView collapsableView = new CollapsableView(view, this, false);<NEW_LINE>buildRow(row, R.drawable.ic_action_wikipedia, null, text, 0, true, collapsableView, false, 0, false, null, false);<NEW_LINE>viewGroup.addView(row);<NEW_LINE>} | feature.getIconId(!light)); |
613,995 | static String builtClassesDirsForBootClassPath(FileObject testFile) {<NEW_LINE>File buildDir = BuildUtils.getBuildTargetDir(testFile);<NEW_LINE>Project prj = FileOwnerQuery.getOwner(testFile);<NEW_LINE>Settings settings = prj.getLookup(<MASK><NEW_LINE>boolean useLangtoolsBuild = settings == null || settings.isUseAntBuild();<NEW_LINE>List<FileObject> roots = new ArrayList<>();<NEW_LINE>if (buildDir != null) {<NEW_LINE>FileObject repo = prj.getProjectDirectory().getParent().getParent();<NEW_LINE>if (repo.getNameExt().equals("langtools") && ShortcutUtils.getDefault().shouldUseCustomTest(repo.getNameExt(), FileUtil.getRelativePath(repo, testFile)) && useLangtoolsBuild) {<NEW_LINE>listAllRoots(BuildUtils.getFileObject(prj.getProjectDirectory(), "../.."), new LinkedList<>(Arrays.asList("build", "classes")), roots);<NEW_LINE>listAllRoots(BuildUtils.getFileObject(prj.getProjectDirectory(), "../.."), new LinkedList<>(Arrays.asList("build", "*", "classes")), roots);<NEW_LINE>} else {<NEW_LINE>listAllRoots(FileUtil.toFileObject(buildDir), new LinkedList<>(Arrays.asList("jdk", "modules", "*")), roots);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>listAllRoots(BuildUtils.getFileObject(prj.getProjectDirectory(), "../../.."), new LinkedList<>(Arrays.asList("build", "classes")), roots);<NEW_LINE>listAllRoots(BuildUtils.getFileObject(prj.getProjectDirectory(), "../../.."), new LinkedList<>(Arrays.asList("build", "*", "classes")), roots);<NEW_LINE>}<NEW_LINE>StringBuilder built = new StringBuilder();<NEW_LINE>String sep = "";<NEW_LINE>for (FileObject fo : roots) {<NEW_LINE>built.append(sep);<NEW_LINE>built.append(FileUtil.toFile(fo).getAbsoluteFile());<NEW_LINE>sep = File.pathSeparator;<NEW_LINE>}<NEW_LINE>return built.toString();<NEW_LINE>} | ).lookup(Settings.class); |
1,646,803 | public static GetSmsConfigResponse unmarshall(GetSmsConfigResponse getSmsConfigResponse, UnmarshallerContext context) {<NEW_LINE>getSmsConfigResponse.setRequestId(context.stringValue("GetSmsConfigResponse.RequestId"));<NEW_LINE>getSmsConfigResponse.setSuccess(context.booleanValue("GetSmsConfigResponse.Success"));<NEW_LINE>getSmsConfigResponse.setCode(context.stringValue("GetSmsConfigResponse.Code"));<NEW_LINE>getSmsConfigResponse.setMessage(context.stringValue("GetSmsConfigResponse.Message"));<NEW_LINE>getSmsConfigResponse.setHttpStatusCode(context.integerValue("GetSmsConfigResponse.HttpStatusCode"));<NEW_LINE>List<SmsConfig> smsConfigs = new ArrayList<SmsConfig>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetSmsConfigResponse.SmsConfigs.Length"); i++) {<NEW_LINE>SmsConfig smsConfig = new SmsConfig();<NEW_LINE>smsConfig.setId(context.longValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Id"));<NEW_LINE>smsConfig.setInstance(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Instance"));<NEW_LINE>smsConfig.setSignName(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].SignName"));<NEW_LINE>smsConfig.setTemplateCode(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].TemplateCode"));<NEW_LINE>smsConfig.setScenario(context.integerValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Scenario"));<NEW_LINE>smsConfig.setName(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Name"));<NEW_LINE>smsConfig.setDescription(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Description"));<NEW_LINE>smsConfig.setExtra(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].Extra"));<NEW_LINE>smsConfig.setGmtCreate(context.stringValue("GetSmsConfigResponse.SmsConfigs[" + i + "].GmtCreate"));<NEW_LINE>smsConfig.setGmtModified(context.stringValue<MASK><NEW_LINE>smsConfigs.add(smsConfig);<NEW_LINE>}<NEW_LINE>getSmsConfigResponse.setSmsConfigs(smsConfigs);<NEW_LINE>return getSmsConfigResponse;<NEW_LINE>} | ("GetSmsConfigResponse.SmsConfigs[" + i + "].GmtModified")); |
925,632 | public static void handleArchiveFileException(DataTypeManagerPlugin plugin, ResourceFile archiveFile, Throwable t) {<NEW_LINE>if (t instanceof FileNotFoundException) {<NEW_LINE>Msg.showError(plugin, plugin.getProvider().getComponent(), "File Not Found", archiveFile.getAbsolutePath() + " not found!");<NEW_LINE>} else if (t instanceof IOException) {<NEW_LINE>Throwable cause = t.getCause();<NEW_LINE>if (cause instanceof VersionException) {<NEW_LINE>VersionExceptionHandler.showVersionError(null, archiveFile.getName(), "Archive"<MASK><NEW_LINE>} else {<NEW_LINE>Msg.showError(plugin, plugin.getProvider().getComponent(), "Open Archive Failed", t.getMessage() + ": " + archiveFile.getName());<NEW_LINE>}<NEW_LINE>} else if (t instanceof DuplicateIdException) {<NEW_LINE>DuplicateIdException dupIdExc = (DuplicateIdException) t;<NEW_LINE>Msg.showError(plugin, plugin.getProvider().getComponent(), "Duplicate Archive ID Error", "Attempted to open a datatype archive with the same ID as datatype archive that is " + "already open. " + dupIdExc.getNewArchiveName() + " has same id as " + dupIdExc.getExistingArchiveName());<NEW_LINE>} else {<NEW_LINE>Msg.showError(plugin, plugin.getProvider().getComponent(), "Open Archive Failed", "Unexpected exception opening archive: " + archiveFile.getName(), t);<NEW_LINE>}<NEW_LINE>} | , "open", (VersionException) cause); |
379,106 | private boolean updateBound(boolean lb) throws ContradictionException {<NEW_LINE>boolean hasFiltered = false;<NEW_LINE>ISetIterator iterator;<NEW_LINE>for (int k = 0; k < topologicalTraversal.length; k++) {<NEW_LINE>int var = lb ? topologicalTraversal[k] : topologicalTraversal[topologicalTraversal.length - 1 - k];<NEW_LINE>iterator = lb ? precGraph.getSuccessorsOf(var).iterator() : precGraph.<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>int rel = iterator.nextInt();<NEW_LINE>if (lb) {<NEW_LINE>// rel is a successor of var<NEW_LINE>if (variables[rel].updateLowerBound(variables[var].getLB() + 1, this)) {<NEW_LINE>hasFiltered = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// rel is a predecessor of var<NEW_LINE>if (variables[rel].updateUpperBound(variables[var].getUB() - 1, this)) {<NEW_LINE>hasFiltered = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasFiltered;<NEW_LINE>} | getPredecessorsOf(var).iterator(); |
818,524 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.roleId, convLabelName("Role Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.roleKey, convLabelName("Role Key"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.roleKey, convLabelName("Role Key"), 12);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.roleName, convLabelName("Role Name"), 50);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.rowId, convLabelName("Row Id"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | .deleteFlag, convLabelName("Delete Flag")); |
1,650,491 | final DeleteBackendStorageResult executeDeleteBackendStorage(DeleteBackendStorageRequest deleteBackendStorageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBackendStorageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteBackendStorageRequest> request = null;<NEW_LINE>Response<DeleteBackendStorageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBackendStorageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBackendStorageRequest));<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, "AmplifyBackend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBackendStorage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBackendStorageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBackendStorageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
395,104 | private void init() {<NEW_LINE>LinearLayoutCompat container = new LinearLayoutCompat(getContext());<NEW_LINE>container.setOrientation(LinearLayoutCompat.VERTICAL);<NEW_LINE>MaterialCardView.LayoutParams containerLayoutParams = new MaterialCardView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>containerLayoutParams.gravity = Gravity.CENTER;<NEW_LINE>addView(container, containerLayoutParams);<NEW_LINE>mThemeTitle = new AppCompatTextView(getContext());<NEW_LINE>mThemeTitle.setGravity(Gravity.CENTER);<NEW_LINE>mThemeTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);<NEW_LINE>LinearLayoutCompat.LayoutParams titleLayoutParams = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>container.addView(mThemeTitle, titleLayoutParams);<NEW_LINE>mThemeMessage = new AppCompatTextView(getContext());<NEW_LINE>mThemeMessage.setGravity(Gravity.CENTER);<NEW_LINE>mThemeMessage.setVisibility(GONE);<NEW_LINE>LinearLayoutCompat.LayoutParams messageLayoutParams = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE><MASK><NEW_LINE>} | container.addView(mThemeMessage, messageLayoutParams); |
1,712,629 | public void onPageSelected(int position) {<NEW_LINE>logDebug("onTabChanged TabId: " + position);<NEW_LINE>if (position == CLOUD_TAB) {<NEW_LINE>tabShown = CLOUD_TAB;<NEW_LINE>cloudDriveProviderFragment = (CloudDriveProviderFragment) getSupportFragmentManager().findFragmentByTag(getFragmentTag(R.id.provider_tabs_pager, CLOUD_TAB));<NEW_LINE>if (cloudDriveProviderFragment != null) {<NEW_LINE>if (cloudDriveProviderFragment.getParentHandle() == INVALID_HANDLE || cloudDriveProviderFragment.getParentHandle() == megaApi.getRootNode().getHandle()) {<NEW_LINE>aB.setTitle(getString(R.string<MASK><NEW_LINE>} else {<NEW_LINE>aB.setTitle(megaApi.getNodeByHandle(cloudDriveProviderFragment.getParentHandle()).getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (position == INCOMING_TAB) {<NEW_LINE>tabShown = INCOMING_TAB;<NEW_LINE>incomingSharesProviderFragment = (IncomingSharesProviderFragment) getSupportFragmentManager().findFragmentByTag(getFragmentTag(R.id.provider_tabs_pager, INCOMING_TAB));<NEW_LINE>if (incomingSharesProviderFragment != null) {<NEW_LINE>if (incomingSharesProviderFragment.getDeepBrowserTree() == 0) {<NEW_LINE>aB.setTitle(getString(R.string.file_provider_title).toUpperCase());<NEW_LINE>} else {<NEW_LINE>aB.setTitle(incomingSharesProviderFragment.name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .file_provider_title).toUpperCase()); |
253,497 | final DeleteRouteTableResult executeDeleteRouteTable(DeleteRouteTableRequest deleteRouteTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRouteTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRouteTableRequest> request = null;<NEW_LINE>Response<DeleteRouteTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRouteTableRequestMarshaller().marshall(super.beforeMarshalling(deleteRouteTableRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRouteTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteRouteTableResult> responseHandler = new StaxResponseHandler<DeleteRouteTableResult>(new DeleteRouteTableResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
286,045 | public boolean execute(Object state, CircuitState cState) {<NEW_LINE>if (!valid)<NEW_LINE>return false;<NEW_LINE>RV32imState.ProcessorState cpuState = (RV32imState.ProcessorState) state;<NEW_LINE>int val1 = cpuState.getRegisterValue(source1);<NEW_LINE>int val2 = cpuState.getRegisterValue(source2);<NEW_LINE>BigInteger opp1, opp2, res;<NEW_LINE>BigInteger mask = BigInteger.valueOf(1).shiftLeft(32).subtract(BigInteger.valueOf(1));<NEW_LINE>int result = 0;<NEW_LINE>switch(operation) {<NEW_LINE>case INSTR_MULH:<NEW_LINE>case INSTR_MUL:<NEW_LINE>opp1 = BigInteger.valueOf(val1);<NEW_LINE>opp2 = BigInteger.valueOf(val2);<NEW_LINE>res = opp1.multiply(opp2);<NEW_LINE>result = (operation == INSTR_MUL) ? res.and(mask).intValue() : res.shiftRight(32).and(mask).intValue();<NEW_LINE>break;<NEW_LINE>case INSTR_MULHSU:<NEW_LINE>opp1 = BigInteger.valueOf(val1);<NEW_LINE>opp2 = BigInteger.valueOf(ElfHeader.getLongValue(val2));<NEW_LINE>res = opp1.multiply(opp2);<NEW_LINE>result = res.shiftRight(32).and(mask).intValue();<NEW_LINE>break;<NEW_LINE>case INSTR_MULHU:<NEW_LINE>opp1 = BigInteger.valueOf(ElfHeader.getLongValue(val1));<NEW_LINE>opp2 = BigInteger.valueOf(ElfHeader.getLongValue(val2));<NEW_LINE>res = opp1.multiply(opp2);<NEW_LINE>result = res.shiftRight(32).and(mask).intValue();<NEW_LINE>break;<NEW_LINE>case INSTR_DIV:<NEW_LINE>case INSTR_REM:<NEW_LINE>opp1 = BigInteger.valueOf(val1);<NEW_LINE><MASK><NEW_LINE>res = (operation == INSTR_REM) ? opp1.remainder(opp2) : opp1.divide(opp2);<NEW_LINE>result = res.and(mask).intValue();<NEW_LINE>break;<NEW_LINE>case INSTR_DIVU:<NEW_LINE>case INSTR_REMU:<NEW_LINE>opp1 = BigInteger.valueOf(ElfHeader.getLongValue(val1));<NEW_LINE>opp2 = BigInteger.valueOf(ElfHeader.getLongValue(val2));<NEW_LINE>res = (operation == INSTR_REMU) ? opp1.remainder(opp2) : opp1.divide(opp2);<NEW_LINE>result = res.and(mask).intValue();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>cpuState.writeRegister(destination, result);<NEW_LINE>return true;<NEW_LINE>} | opp2 = BigInteger.valueOf(val2); |
376,970 | private Position decodeBinary(ByteBuf buf, Channel channel, SocketAddress remoteAddress) {<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>boolean longId = buf.readableBytes() == 42;<NEW_LINE>// marker<NEW_LINE>buf.readByte();<NEW_LINE>String id;<NEW_LINE>if (longId) {<NEW_LINE>id = ByteBufUtil.hexDump(buf.readSlice(8)).substring(0, 15);<NEW_LINE>} else {<NEW_LINE>id = ByteBufUtil.hexDump(buf.readSlice(5));<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id);<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>DateBuilder dateBuilder = new DateBuilder().setHour(BcdUtil.readInteger(buf, 2)).setMinute(BcdUtil.readInteger(buf, 2)).setSecond(BcdUtil.readInteger(buf, 2)).setDay(BcdUtil.readInteger(buf, 2)).setMonth(BcdUtil.readInteger(buf, 2)).setYear(BcdUtil.readInteger(buf, 2));<NEW_LINE>position.setTime(dateBuilder.getDate());<NEW_LINE>double latitude = readCoordinate(buf, false);<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, decodeBattery(buf.readUnsignedByte()));<NEW_LINE>double longitude = readCoordinate(buf, true);<NEW_LINE>int flags = buf.readUnsignedByte() & 0x0f;<NEW_LINE>position.setValid(<MASK><NEW_LINE>if ((flags & 0x04) == 0) {<NEW_LINE>latitude = -latitude;<NEW_LINE>}<NEW_LINE>if ((flags & 0x08) == 0) {<NEW_LINE>longitude = -longitude;<NEW_LINE>}<NEW_LINE>position.setLatitude(latitude);<NEW_LINE>position.setLongitude(longitude);<NEW_LINE>position.setSpeed(BcdUtil.readInteger(buf, 3));<NEW_LINE>position.setCourse((buf.readUnsignedByte() & 0x0f) * 100.0 + BcdUtil.readInteger(buf, 2));<NEW_LINE>processStatus(position, buf.readUnsignedInt());<NEW_LINE>return position;<NEW_LINE>} | (flags & 0x02) != 0); |
1,475,056 | public <MT extends IBaseMetaType> MT metaAddOperation(IIdType theResourceId, MT theMetaAdd, RequestDetails theRequest) {<NEW_LINE>TransactionDetails transactionDetails = new TransactionDetails();<NEW_LINE>// Notify interceptors<NEW_LINE>if (theRequest != null) {<NEW_LINE>ActionRequestDetails requestDetails = new ActionRequestDetails(theRequest, getResourceName(), theResourceId);<NEW_LINE>notifyInterceptors(RestOperationTypeEnum.META_ADD, requestDetails);<NEW_LINE>}<NEW_LINE>StopWatch w = new StopWatch();<NEW_LINE>BaseHasResource entity = readEntity(theResourceId, theRequest);<NEW_LINE>if (entity == null) {<NEW_LINE>throw new ResourceNotFoundException(Msg.code(1993) + theResourceId);<NEW_LINE>}<NEW_LINE>ResourceTable latestVersion = readEntityLatestVersion(theResourceId, theRequest, transactionDetails);<NEW_LINE>if (latestVersion.getVersion() != entity.getVersion()) {<NEW_LINE>doMetaAdd(theMetaAdd, entity, theRequest, transactionDetails);<NEW_LINE>} else {<NEW_LINE>doMetaAdd(theMetaAdd, latestVersion, theRequest, transactionDetails);<NEW_LINE>// Also update history entry<NEW_LINE>ResourceHistoryTable history = myResourceHistoryTableDao.findForIdAndVersionAndFetchProvenance(entity.getId(), entity.getVersion());<NEW_LINE>doMetaAdd(<MASK><NEW_LINE>}<NEW_LINE>ourLog.debug("Processed metaAddOperation on {} in {}ms", theResourceId, w.getMillisAndRestart());<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>MT retVal = (MT) metaGetOperation(theMetaAdd.getClass(), theResourceId, theRequest);<NEW_LINE>return retVal;<NEW_LINE>} | theMetaAdd, history, theRequest, transactionDetails); |
299,185 | public void start() throws LifecycleException {<NEW_LINE>// Validate and update our current component state<NEW_LINE>if (started) {<NEW_LINE>if (log.isLoggable(Level.INFO)) {<NEW_LINE>log.log(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!initialized)<NEW_LINE>init();<NEW_LINE>lifecycle.fireLifecycleEvent(START_EVENT, null);<NEW_LINE>started = true;<NEW_LINE>// Force initialization of the random number generator<NEW_LINE>if (log.isLoggable(Level.FINEST))<NEW_LINE>log.log(Level.FINEST, "Force random number initialization starting");<NEW_LINE>generateSessionId();<NEW_LINE>if (log.isLoggable(Level.FINEST))<NEW_LINE>log.log(Level.FINEST, "Force random number initialization completed");<NEW_LINE>if (store == null)<NEW_LINE>log.log(Level.SEVERE, LogFacade.NO_STORE_CONFIG_EXCEPTION);<NEW_LINE>else if (store instanceof Lifecycle)<NEW_LINE>((Lifecycle) store).start();<NEW_LINE>} | Level.INFO, LogFacade.MANAGER_STARTED_INFO); |
1,274,224 | private static String assignFromBuilder(CNode child) {<NEW_LINE>final String name = child.getName();<NEW_LINE>final String className = nodeClass(child);<NEW_LINE>final boolean isArray = child.isArray;<NEW_LINE>final boolean isMap = child.isMap;<NEW_LINE>if (child instanceof FileLeaf && isArray) {<NEW_LINE><MASK><NEW_LINE>} else if (child instanceof PathLeaf && isArray) {<NEW_LINE>return name + " = LeafNodeVector.createPathNodeVector(builder." + name + ");";<NEW_LINE>} else if (child instanceof UrlLeaf && isArray) {<NEW_LINE>return name + " = LeafNodeVector.createUrlNodeVector(builder." + name + ");";<NEW_LINE>} else if (child instanceof LeafCNode && isArray) {<NEW_LINE>return name + " = new LeafNodeVector<>(builder." + name + ", new " + className + "());";<NEW_LINE>} else if (child instanceof FileLeaf && isMap) {<NEW_LINE>return name + " = LeafNodeMaps.asFileNodeMap(builder." + name + ");";<NEW_LINE>} else if (child instanceof PathLeaf && isMap) {<NEW_LINE>return name + " = LeafNodeMaps.asPathNodeMap(builder." + name + ");";<NEW_LINE>} else if (child instanceof UrlLeaf && isMap) {<NEW_LINE>return name + " = LeafNodeMaps.asUrlNodeMap(builder." + name + ");";<NEW_LINE>} else if (child instanceof LeafCNode && isMap) {<NEW_LINE>return name + " = LeafNodeMaps.asNodeMap(builder." + name + ", new " + className + "());";<NEW_LINE>} else if (child instanceof InnerCNode && isArray) {<NEW_LINE>return name + " = " + className + ".createVector(builder." + name + ");";<NEW_LINE>} else if (child instanceof InnerCNode && isMap) {<NEW_LINE>return name + " = " + className + ".createMap(builder." + name + ");";<NEW_LINE>} else if (child instanceof InnerCNode) {<NEW_LINE>return name + " = new " + className + "(builder." + name + ", throwIfUninitialized);";<NEW_LINE>} else if (child instanceof LeafCNode) {<NEW_LINE>return name + " = (builder." + name + " == null) ?\n" + " new " + className + "(" + scalarDefault((LeafCNode) child) + ") : new " + className + "(builder." + name + ");";<NEW_LINE>} else {<NEW_LINE>// should not happen<NEW_LINE>throw new IllegalStateException("Cannot create assignment for node");<NEW_LINE>}<NEW_LINE>} | return name + " = LeafNodeVector.createFileNodeVector(builder." + name + ");"; |
351,397 | public static String optimizedPathFor(File path, File optimizedDirectory) {<NEW_LINE>if (ShareTinkerInternals.isAfterAndroidO()) {<NEW_LINE>// dex_location = /foo/bar/baz.jar<NEW_LINE>// odex_location = /foo/bar/oat/<isa>/baz.odex<NEW_LINE>String currentInstructionSet;<NEW_LINE>try {<NEW_LINE>currentInstructionSet = ShareTinkerInternals.getCurrentInstructionSet();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new TinkerRuntimeException("getCurrentInstructionSet fail:", e);<NEW_LINE>}<NEW_LINE>File parentFile = path.getParentFile();<NEW_LINE>String fileName = path.getName();<NEW_LINE>int index = fileName.lastIndexOf('.');<NEW_LINE>if (index > 0) {<NEW_LINE>fileName = <MASK><NEW_LINE>}<NEW_LINE>String result = parentFile.getAbsolutePath() + "/oat/" + currentInstructionSet + "/" + fileName + ShareConstants.ODEX_SUFFIX;<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>String fileName = path.getName();<NEW_LINE>if (!fileName.endsWith(ShareConstants.DEX_SUFFIX)) {<NEW_LINE>int lastDot = fileName.lastIndexOf(".");<NEW_LINE>if (lastDot < 0) {<NEW_LINE>fileName += ShareConstants.DEX_SUFFIX;<NEW_LINE>} else {<NEW_LINE>StringBuilder sb = new StringBuilder(lastDot + 4);<NEW_LINE>sb.append(fileName, 0, lastDot);<NEW_LINE>sb.append(ShareConstants.DEX_SUFFIX);<NEW_LINE>fileName = sb.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File result = new File(optimizedDirectory, fileName);<NEW_LINE>return result.getPath();<NEW_LINE>} | fileName.substring(0, index); |
997,909 | public void deleteById(String id) {<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 workspaceName = Utils.getValueFromIdByName(id, "workspaces");<NEW_LINE>if (workspaceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));<NEW_LINE>}<NEW_LINE>String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");<NEW_LINE>if (privateEndpointConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE).getValue();<NEW_LINE>} | Utils.getValueFromIdByName(id, "resourceGroups"); |
1,324,661 | public void doSubSidebarNoLoad(final String subOverride) {<NEW_LINE>findViewById(R.id.loader).setVisibility(View.GONE);<NEW_LINE>invalidateOptionsMenu();<NEW_LINE>if (!subOverride.equalsIgnoreCase("all") && !subOverride.equalsIgnoreCase("frontpage") && !subOverride.equalsIgnoreCase("friends") && !subOverride.equalsIgnoreCase("mod") && !subOverride.contains("+") && !subOverride.contains(".") && !subOverride.contains("/m/")) {<NEW_LINE>if (drawerLayout != null) {<NEW_LINE>drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, GravityCompat.END);<NEW_LINE>}<NEW_LINE>findViewById(R.id.sidebar_text).setVisibility(View.GONE);<NEW_LINE>findViewById(R.id.sub_title).setVisibility(View.GONE);<NEW_LINE>findViewById(R.id.subscribers).setVisibility(View.GONE);<NEW_LINE>findViewById(R.id.active_users).setVisibility(View.GONE);<NEW_LINE>findViewById(R.id.header_sub).setBackgroundColor(Palette.getColor(subOverride));<NEW_LINE>((TextView) findViewById(R.id.sub_infotitle)).setText(subOverride);<NEW_LINE>// Sidebar buttons should use subOverride's accent color<NEW_LINE>int subColor = new ColorPreferences(this).getColor(subOverride);<NEW_LINE>((TextView) findViewById(R.id.theme_text)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.wiki_text)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.post_text)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.mods_text)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.flair_text)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.sorting).findViewById(R.id.sort)).setTextColor(subColor);<NEW_LINE>((TextView) findViewById(R.id.<MASK><NEW_LINE>} else {<NEW_LINE>if (drawerLayout != null) {<NEW_LINE>drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, GravityCompat.END);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | sync)).setTextColor(subColor); |
1,323,698 | private void fetchData() {<NEW_LINE>boolean portrait = <MASK><NEW_LINE>osmEdits = new ArrayList<>();<NEW_LINE>List<OpenstreetmapPoint> l1 = plugin.getDBPOI().getOpenstreetmapPoints();<NEW_LINE>List<OsmNotesPoint> l2 = plugin.getDBBug().getOsmbugsPoints();<NEW_LINE>osmEdits.addAll(l1);<NEW_LINE>osmEdits.addAll(l2);<NEW_LINE>ListView listView = getListView();<NEW_LINE>listView.setDivider(null);<NEW_LINE>listView.setEmptyView(emptyView);<NEW_LINE>if (osmEdits.size() > 0 && footerView == null && portrait) {<NEW_LINE>footerView = getActivity().getLayoutInflater().inflate(R.layout.list_shadow_footer, listView, false);<NEW_LINE>listView.addFooterView(footerView);<NEW_LINE>}<NEW_LINE>List<Object> items = createItemsList();<NEW_LINE>listAdapter = new OsmEditsAdapter(getMyApplication(), items);<NEW_LINE>listAdapter.setSelectedOsmEdits(osmEditsSelected);<NEW_LINE>listAdapter.setAdapterListener(new OsmEditsAdapter.OsmEditsAdapterListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onHeaderCheckboxClick(boolean checked) {<NEW_LINE>if (checked) {<NEW_LINE>selectAll();<NEW_LINE>} else {<NEW_LINE>deselectAll();<NEW_LINE>}<NEW_LINE>updateSelectionTitle(actionMode);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelect(OsmPoint point, boolean checked) {<NEW_LINE>if (checked) {<NEW_LINE>osmEditsSelected.add(point);<NEW_LINE>} else {<NEW_LINE>osmEditsSelected.remove(point);<NEW_LINE>}<NEW_LINE>updateSelectionMode(actionMode);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemShowMap(OsmPoint point, int position) {<NEW_LINE>showOnMap(point, position);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onOptionsClick(OsmPoint note) {<NEW_LINE>openPopUpMenu(note);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listAdapter.setPortrait(portrait);<NEW_LINE>listView.setAdapter(listAdapter);<NEW_LINE>} | AndroidUiHelper.isOrientationPortrait(getActivity()); |
1,312,001 | public String[] listPreparedTransactions() {<NEW_LINE>if (isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "getPreparedTransactions");<NEW_LINE>String[] col = null;<NEW_LINE>if (_manager != null) {<NEW_LINE>// Obtain array of in-doubt xids from the XidManager<NEW_LINE>Xid[] xids = null;<NEW_LINE>xids = _manager.listRemoteInDoubts();<NEW_LINE>if (xids != null) {<NEW_LINE>// Get the string representation of each xid<NEW_LINE>// and add to the collection<NEW_LINE>col = new String[xids.length];<NEW_LINE>for (int i = 0; i < xids.length; i++) {<NEW_LINE>col[i] = ((PersistentTranId) xids[i]).toString();<NEW_LINE>if (isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "xid " + col[i] + " in-doubt");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>return col;<NEW_LINE>} | exit(this, tc, "getPreparedTransactions"); |
839,778 | private Process convertProcess(ProcessTraffic traffic) {<NEW_LINE>final Process process = new Process();<NEW_LINE>process.setId(traffic.id());<NEW_LINE>process.setName(traffic.getName());<NEW_LINE>final String serviceId = traffic.getServiceId();<NEW_LINE>process.setServiceId(serviceId);<NEW_LINE>process.setServiceName(IDManager.ServiceID.analysisId<MASK><NEW_LINE>final String instanceId = traffic.getInstanceId();<NEW_LINE>process.setInstanceId(instanceId);<NEW_LINE>process.setInstanceName(IDManager.ServiceInstanceID.analysisId(instanceId).getName());<NEW_LINE>process.setLayer(Layer.valueOf(traffic.getLayer()).name());<NEW_LINE>process.setAgentId(traffic.getAgentId());<NEW_LINE>process.setDetectType(ProcessDetectType.valueOf(traffic.getDetectType()).name());<NEW_LINE>if (traffic.getProperties() != null) {<NEW_LINE>for (String key : traffic.getProperties().keySet()) {<NEW_LINE>process.getAttributes().add(new Attribute(key, traffic.getProperties().get(key).getAsString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return process;<NEW_LINE>} | (serviceId).getName()); |
405,942 | public static void main(String[] args) {<NEW_LINE>Exercise27_OneDimensionalIntervals oneDimensionalIntervals = new Exercise27_OneDimensionalIntervals();<NEW_LINE>Interval1D interval1 = oneDimensionalIntervals<MASK><NEW_LINE>Interval1D interval2 = oneDimensionalIntervals.new Interval1D(90, 95);<NEW_LINE>Interval1D interval3 = oneDimensionalIntervals.new Interval1D(-10, 30);<NEW_LINE>Interval1D interval4 = oneDimensionalIntervals.new Interval1D(30, 45.2);<NEW_LINE>Interval1D interval5 = oneDimensionalIntervals.new Interval1D(22.34, 22.38);<NEW_LINE>Interval1D[] interval1Ds = { interval1, interval2, interval3, interval4, interval5 };<NEW_LINE>// Order by left endpoint<NEW_LINE>StdOut.println("Order by left endpoint");<NEW_LINE>Arrays.sort(interval1Ds, oneDimensionalIntervals.comparatorByLeftEndpoint());<NEW_LINE>for (Interval1D interval1D : interval1Ds) {<NEW_LINE>StdOut.print(interval1D + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: (-10.0, 30.0) (22.34, 22.38) (30.0, 45.2) (40.0, 100.0) (90.0, 95.0)");<NEW_LINE>// Order by right endpoint<NEW_LINE>StdOut.println("\nOrder by right endpoint");<NEW_LINE>Arrays.sort(interval1Ds, oneDimensionalIntervals.comparatorByRightEndpoint());<NEW_LINE>for (Interval1D interval1D : interval1Ds) {<NEW_LINE>StdOut.print(interval1D + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: (22.34, 22.38) (-10.0, 30.0) (30.0, 45.2) (90.0, 95.0) (40.0, 100.0)");<NEW_LINE>// Order by length<NEW_LINE>StdOut.println("\nOrder by length");<NEW_LINE>Arrays.sort(interval1Ds, oneDimensionalIntervals.comparatorByLength());<NEW_LINE>for (Interval1D interval1D : interval1Ds) {<NEW_LINE>StdOut.print(interval1D + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: (22.34, 22.38) (90.0, 95.0) (30.0, 45.2) (-10.0, 30.0) (40.0, 100.0)");<NEW_LINE>} | .new Interval1D(40, 100); |
1,224,910 | public TiTableInfo copyTableWithRowId() {<NEW_LINE>// Support cluster index: need to exclude isPkHandle and isCommonHandle for they need not<NEW_LINE>// _tidb_rowid<NEW_LINE>if (!isPkHandle() && !isCommonHandle) {<NEW_LINE>ImmutableList.Builder<TiColumnInfo> newColumns = ImmutableList.builder();<NEW_LINE>for (TiColumnInfo col : getColumns(true)) {<NEW_LINE>newColumns.add(copyColumn(col));<NEW_LINE>}<NEW_LINE>newColumns.add(TiColumnInfo.getRowIdColumn(getColumns(<MASK><NEW_LINE>return new TiTableInfo(getId(), CIStr.newCIStr(getName()), getCharset(), getCollate(), true, isCommonHandle, newColumns.build(), getIndices(true), getComment(), getAutoIncId(), getMaxColumnId(), getMaxIndexId(), getOldSchemaId(), partitionInfo, null, getTiflashReplicaInfo(), version, updateTimestamp, maxShardRowIDBits, null, autoRandomBits);<NEW_LINE>} else {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} | true).size())); |
798,806 | public Map<ServerUUID, List<UserInfo>> processResults(ResultSet set) throws SQLException {<NEW_LINE>Map<ServerUUID, List<UserInfo>> serverMap = new HashMap<>();<NEW_LINE>while (set.next()) {<NEW_LINE>ServerUUID serverUUID = ServerUUID.fromString(set<MASK><NEW_LINE>UUID uuid = UUID.fromString(set.getString(UserInfoTable.USER_UUID));<NEW_LINE>List<UserInfo> userInfos = serverMap.computeIfAbsent(serverUUID, Lists::create);<NEW_LINE>long registered = set.getLong(UserInfoTable.REGISTERED);<NEW_LINE>boolean banned = set.getBoolean(UserInfoTable.BANNED);<NEW_LINE>boolean op = set.getBoolean(UserInfoTable.OP);<NEW_LINE>String joinAddress = set.getString(UserInfoTable.JOIN_ADDRESS);<NEW_LINE>userInfos.add(new UserInfo(uuid, serverUUID, registered, op, joinAddress, banned));<NEW_LINE>}<NEW_LINE>return serverMap;<NEW_LINE>} | .getString(UserInfoTable.SERVER_UUID)); |
686,524 | public static void generateRelayConfig(String schemaRegistryLocation, String dbName, String uri, String outputDir, List<String> srcNames, SchemaMetaDataManager manager) throws Exception {<NEW_LINE>PhysicalSourceConfig config = new PhysicalSourceConfig();<NEW_LINE>FileSystemSchemaRegistryService s = FileSystemSchemaRegistryService.build(new FileSystemSchemaRegistryService.StaticConfig(new File(schemaRegistryLocation), 0, false, false));<NEW_LINE>dbName = dbName.trim().toLowerCase();<NEW_LINE>config.setName(dbName);<NEW_LINE>config.setUri(uri);<NEW_LINE>for (String srcName : srcNames) {<NEW_LINE>VersionedSchema schema = null;<NEW_LINE>schema = s.fetchLatestVersionedSchemaBySourceName(srcName);<NEW_LINE>String dbObjectName = SchemaHelper.getMetaField(schema.getSchema(), "dbFieldName");<NEW_LINE>LogicalSourceConfig c = new LogicalSourceConfig();<NEW_LINE>c.setId(manager.getSrcId(srcName));<NEW_LINE>c.setName(srcName);<NEW_LINE>c.<MASK><NEW_LINE>c.setPartitionFunction("constant:1");<NEW_LINE>config.addSource(c);<NEW_LINE>}<NEW_LINE>DatabusRelaySourcesInFiles relaySourcesInFiles = new DatabusRelaySourcesInFiles(outputDir);<NEW_LINE>relaySourcesInFiles.add(dbName, config);<NEW_LINE>boolean success = relaySourcesInFiles.save();<NEW_LINE>if (!success)<NEW_LINE>throw new RuntimeException("Unable to create the dev relay config for DB :" + dbName);<NEW_LINE>} | setUri(dbName + "." + dbObjectName); |
249,768 | public static int findLongestSubarrayLessEqualK(List<Integer> A, int k) {<NEW_LINE>// Build the prefix sum according to A.<NEW_LINE>List<Integer> prefixSum = new ArrayList<>();<NEW_LINE>A.stream().reduce(0, (left, right) -> {<NEW_LINE>prefixSum.add(left + right);<NEW_LINE>return left + right;<NEW_LINE>});<NEW_LINE>// Early returns if the sum of A is smaller than or equal to k.<NEW_LINE>if (prefixSum.get(prefixSum.size() - 1) <= k) {<NEW_LINE>return A.size();<NEW_LINE>}<NEW_LINE>// Builds minPrefixSum.<NEW_LINE>List<Integer> minPrefixSum = new ArrayList<>(prefixSum);<NEW_LINE>for (int i = minPrefixSum.size() - 2; i >= 0; --i) {<NEW_LINE>minPrefixSum.set(i, Math.min(minPrefixSum.get(i), minPrefixSum.get(i + 1)));<NEW_LINE>}<NEW_LINE>int a = 0<MASK><NEW_LINE>while (a < A.size() && b < A.size()) {<NEW_LINE>int minCurrSum = a > 0 ? minPrefixSum.get(b) - prefixSum.get(a - 1) : minPrefixSum.get(b);<NEW_LINE>if (minCurrSum <= k) {<NEW_LINE>int currLength = b - a + 1;<NEW_LINE>if (currLength > maxLength) {<NEW_LINE>maxLength = currLength;<NEW_LINE>}<NEW_LINE>++b;<NEW_LINE>} else {<NEW_LINE>// minCurrSum > k.<NEW_LINE>++a;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return maxLength;<NEW_LINE>} | , b = 0, maxLength = 0; |
1,499,494 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('ctx') @public create context MyCtx as initiated by SupportBean_S0 s0 terminated after 24 hours", path);<NEW_LINE>String[] fields = "mycontextvar".split(",");<NEW_LINE>env.compileDeploy("@name('var') @public context MyCtx create variable int mycontextvar = 5", path);<NEW_LINE>env.milestone(0);<NEW_LINE><MASK><NEW_LINE>env.addListener("var").addListener("upd");<NEW_LINE>env.milestone(1);<NEW_LINE>// allocate partition P1<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "P1"));<NEW_LINE>env.milestone(2);<NEW_LINE>// update<NEW_LINE>env.sendEventBean(new SupportBean("P1", 100));<NEW_LINE>env.assertPropsNew("upd", fields, new Object[] { 100 });<NEW_LINE>env.assertPropsPerRowIterator("upd", fields, new Object[][] { { 100 } });<NEW_LINE>env.assertPropsIRPair("var", fields, new Object[] { 100 }, new Object[] { 5 });<NEW_LINE>env.milestone(3);<NEW_LINE>// allocate partition P1<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "P2"));<NEW_LINE>env.milestone(4);<NEW_LINE>// update<NEW_LINE>env.sendEventBean(new SupportBean("P2", 101));<NEW_LINE>env.assertPropsNew("upd", fields, new Object[] { 101 });<NEW_LINE>env.assertPropsPerRowIterator("upd", fields, new Object[][] { { 100 }, { 101 } });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("var", fields, new Object[][] { { 100 }, { 101 } });<NEW_LINE>env.assertPropsIRPair("var", fields, new Object[] { 101 }, new Object[] { 5 });<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy("@name('upd') context MyCtx on SupportBean(theString = context.s0.p00) set mycontextvar = intPrimitive", path); |
1,598,055 | private List<DriverLibraryMavenArtifact> parseGradle() throws DBException {<NEW_LINE>final List<DriverLibraryMavenArtifact> artifacts = new ArrayList<>();<NEW_LINE>final Matcher matcher = REGEX_FOR_GRADLE.matcher(fieldText.getText());<NEW_LINE>while (matcher.find()) {<NEW_LINE>String <MASK><NEW_LINE>String name = matcher.group(2);<NEW_LINE>String version = matcher.group(3);<NEW_LINE>if (CommonUtils.isNotEmpty(group) && CommonUtils.isNotEmpty(name)) {<NEW_LINE>DriverLibraryMavenArtifact lib = new DriverLibraryMavenArtifact(EditMavenArtifactDialog.this.driver, DBPDriverLibrary.FileType.jar, "", version);<NEW_LINE>lib.setReference(new MavenArtifactReference(CommonUtils.notEmpty(group), CommonUtils.notEmpty(name), null, MavenArtifactReference.VERSION_PATTERN_RELEASE));<NEW_LINE>lib.setPreferredVersion(version);<NEW_LINE>artifacts.add(lib);<NEW_LINE>} else {<NEW_LINE>throw new DBException("Wrong Gradle configuration: " + matcher.group());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return artifacts;<NEW_LINE>} | group = matcher.group(1); |
702,345 | public CodegenExpression makeCodegen(CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>CodegenMethod method = parent.makeChild(ViewableActivatorFilter.EPTYPE, this.getClass(), classScope);<NEW_LINE>CodegenMethod makeFilter = filterSpecCompiled.makeCodegen(method, symbols, classScope);<NEW_LINE>method.getBlock().declareVar(FilterSpecActivatable.EPTYPE<MASK><NEW_LINE>CodegenExpression initializer = exprDotMethodChain(symbols.getAddInitSvc(method)).add(EPStatementInitServices.GETVIEWABLEACTIVATORFACTORY).add("createFilter");<NEW_LINE>CodegenSetterBuilder builder = new CodegenSetterBuilder(ViewableActivatorFilter.EPTYPE, ViewableActivatorFilterForge.class, "activator", classScope, method, initializer).expression("filterSpec", ref("filterSpecCompiled")).constantDefaultChecked("canIterate", canIterate).constantDefaultChecked("streamNumFromClause", streamNumFromClause).constantDefaultChecked("subSelect", isSubSelect).constantDefaultChecked("subselectNumber", subselectNumber);<NEW_LINE>method.getBlock().methodReturn(builder.getRefName());<NEW_LINE>return localMethod(method);<NEW_LINE>} | , "filterSpecCompiled", localMethod(makeFilter)); |
1,449,728 | private static void generateEditJsp(Project project, CompilationController controller, String entityClass, String simpleEntityName, String managedBean, String fieldName, String linkToIndex, BaseDocument doc, final FileObject jsfRoot, EmbeddedPkSupport embeddedPkSupport, String controllerClass, String styleAndScriptTags, String controllerPackage) throws FileStateInvalidException, IOException {<NEW_LINE>final Charset encoding = JpaControllerUtil.getProjectEncoding(project, jsfRoot);<NEW_LINE>// NOI18N<NEW_LINE>String content = JSFFrameworkProvider.readResource(JSFClientGenerator.class.getClassLoader().getResourceAsStream(TEMPLATE_FOLDER + EDIT_JSP_TEMPLATE), "UTF-8");<NEW_LINE>content = content.replaceAll(ENCODING_VAR, Matcher.quoteReplacement(encoding.name()));<NEW_LINE>content = content.replaceAll(ENTITY_NAME_VAR, Matcher.quoteReplacement(simpleEntityName));<NEW_LINE>content = content.replaceAll(LINK_TO_SS_VAR, Matcher.quoteReplacement(styleAndScriptTags));<NEW_LINE>content = content.replaceAll(MANAGED_BEAN_NAME_VAR, Matcher.quoteReplacement(managedBean));<NEW_LINE>StringBuffer formBody = new StringBuffer();<NEW_LINE>String utilPackage = controllerPackage == null || controllerPackage.length() == 0 ? PersistenceClientIterator.UTIL_FOLDER_NAME : controllerPackage + "." + PersistenceClientIterator.UTIL_FOLDER_NAME;<NEW_LINE>String jsfUtilClass = utilPackage + "." + PersistenceClientIterator.UTIL_CLASS_NAMES[1];<NEW_LINE>TypeElement typeElement = controller.<MASK><NEW_LINE>JsfForm.createForm(controller, typeElement, JsfForm.FORM_TYPE_EDIT, managedBean + "." + fieldName, formBody, entityClass, embeddedPkSupport, controllerClass, jsfUtilClass);<NEW_LINE>content = content.replaceAll(FORM_BODY_VAR, Matcher.quoteReplacement(formBody.toString()));<NEW_LINE>content = content.replaceAll(FIELD_NAME_VAR, Matcher.quoteReplacement(fieldName));<NEW_LINE>content = content.replaceAll(JSF_UTIL_CLASS_VAR, Matcher.quoteReplacement(jsfUtilClass));<NEW_LINE>content = content.replaceAll(LINK_TO_INDEX_VAR, Matcher.quoteReplacement(linkToIndex));<NEW_LINE>try {<NEW_LINE>content = reformat(content, doc);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>Logger.getLogger(JSFClientGenerator.class.getName()).log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>final String editText = content;<NEW_LINE>createFile(jsfRoot, editText, EDIT_JSP, encoding);<NEW_LINE>} | getElements().getTypeElement(entityClass); |
844,724 | public static void multiplyComplex(InterleavedF64 complexA, InterleavedF64 complexB, InterleavedF64 complexC) {<NEW_LINE>InputSanityCheck.<MASK><NEW_LINE>for (int y = 0; y < complexA.height; y++) {<NEW_LINE>int indexA = complexA.startIndex + y * complexA.stride;<NEW_LINE>int indexB = complexB.startIndex + y * complexB.stride;<NEW_LINE>int indexC = complexC.startIndex + y * complexC.stride;<NEW_LINE>for (int x = 0; x < complexA.width; x++, indexA += 2, indexB += 2, indexC += 2) {<NEW_LINE>double realA = complexA.data[indexA];<NEW_LINE>double imgA = complexA.data[indexA + 1];<NEW_LINE>double realB = complexB.data[indexB];<NEW_LINE>double imgB = complexB.data[indexB + 1];<NEW_LINE>complexC.data[indexC] = realA * realB - imgA * imgB;<NEW_LINE>complexC.data[indexC + 1] = realA * imgB + imgA * realB;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | checkSameShape(complexA, complexB, complexC); |
1,207,651 | private void processDisconnectedJvmstat(Host host, JvmstatConnection listener) {<NEW_LINE>HostIdentifier hostId = listener.monitoredHost.getHostIdentifier();<NEW_LINE>try {<NEW_LINE>listener.monitoredHost.removeHostListener(listener);<NEW_LINE>} catch (MonitorException ex) {<NEW_LINE>}<NEW_LINE>unregisterHostListener(host, hostId);<NEW_LINE>Set<JvmstatApplication> jvmstatApplications = host.getRepository(<MASK><NEW_LINE>Iterator<JvmstatApplication> appIt = jvmstatApplications.iterator();<NEW_LINE>while (appIt.hasNext()) {<NEW_LINE>JvmstatApplication application = appIt.next();<NEW_LINE>if (application.getHostIdentifier().equals(hostId)) {<NEW_LINE>application.setStateImpl(Stateful.STATE_UNAVAILABLE);<NEW_LINE>if (application.handleControlledRemove())<NEW_LINE>appIt.remove();<NEW_LINE>} else {<NEW_LINE>appIt.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>host.getRepository().removeDataSources(jvmstatApplications);<NEW_LINE>} | ).getDataSources(JvmstatApplication.class); |
1,248,873 | public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {<NEW_LINE>// first sift through and get all the methods<NEW_LINE>// then get all the annotations<NEW_LINE>// then build the metadata and register the metadata<NEW_LINE>final Class<?> targetClass = AopUtils.getTargetClass(bean);<NEW_LINE>final org.camunda.bpm.engine.spring.annotations.ProcessEngineComponent component = targetClass.getAnnotation(org.camunda.bpm.engine.spring.annotations.ProcessEngineComponent.class);<NEW_LINE>ReflectionUtils.doWithMethods(targetClass, new ReflectionUtils.MethodCallback() {<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {<NEW_LINE>State state = AnnotationUtils.getAnnotation(method, State.class);<NEW_LINE>String processName = component.processKey();<NEW_LINE>if (StringUtils.hasText(state.process())) {<NEW_LINE>processName = state.process();<NEW_LINE>}<NEW_LINE>String stateName = state.state();<NEW_LINE>if (!StringUtils.hasText(stateName)) {<NEW_LINE>stateName = state.value();<NEW_LINE>}<NEW_LINE>Assert.notNull(stateName, "You must provide a stateName!");<NEW_LINE>Map<Integer, String> vars = new <MASK><NEW_LINE>Annotation[][] paramAnnotationsArray = method.getParameterAnnotations();<NEW_LINE>int ctr = 0;<NEW_LINE>int pvMapIndex = -1;<NEW_LINE>int procIdIndex = -1;<NEW_LINE>for (Annotation[] paramAnnotations : paramAnnotationsArray) {<NEW_LINE>ctr += 1;<NEW_LINE>for (Annotation pa : paramAnnotations) {<NEW_LINE>if (pa instanceof ProcessVariable) {<NEW_LINE>ProcessVariable pv = (ProcessVariable) pa;<NEW_LINE>String pvName = pv.value();<NEW_LINE>vars.put(ctr, pvName);<NEW_LINE>} else if (pa instanceof ProcessVariables) {<NEW_LINE>pvMapIndex = ctr;<NEW_LINE>} else if (pa instanceof ProcessId) {<NEW_LINE>procIdIndex = ctr;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ActivitiStateHandlerRegistration registration = new ActivitiStateHandlerRegistration(vars, method, bean, stateName, beanName, pvMapIndex, procIdIndex, processName);<NEW_LINE>registry.registerActivitiStateHandler(registration);<NEW_LINE>}<NEW_LINE>}, new ReflectionUtils.MethodFilter() {<NEW_LINE><NEW_LINE>public boolean matches(Method method) {<NEW_LINE>return null != AnnotationUtils.getAnnotation(method, State.class);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return bean;<NEW_LINE>} | HashMap<Integer, String>(); |
376,041 | public static SpawnEggRefl fromItemStack(final ItemStack item) throws Exception {<NEW_LINE>if (item == null)<NEW_LINE>throw new IllegalArgumentException("Item cannot be null");<NEW_LINE>if (item.getType() != Material.MONSTER_EGG)<NEW_LINE>throw new IllegalArgumentException("Item is not a monster egg");<NEW_LINE>final Class<?> NMSItemStackClass = ReflUtil.getNMSClass("ItemStack");<NEW_LINE>final Class<?> craftItemStackClass = ReflUtil.getOBCClass("inventory.CraftItemStack");<NEW_LINE>final Method asNMSCopyMethod = ReflUtil.getMethodCached(craftItemStackClass, "asNMSCopy", ItemStack.class);<NEW_LINE>final Object stack = asNMSCopyMethod.invoke(null, item);<NEW_LINE>final Object tagCompound = ReflUtil.getMethodCached(NMSItemStackClass, "getTag").invoke(stack);<NEW_LINE>if (tagCompound != null) {<NEW_LINE>final Method tagGetCompound = ReflUtil.getMethodCached(tagCompound.getClass(<MASK><NEW_LINE>final Object entityTag = tagGetCompound.invoke(tagCompound, "EntityTag");<NEW_LINE>final Method tagGetString = ReflUtil.getMethodCached(entityTag.getClass(), "getString", String.class);<NEW_LINE>String idString = (String) tagGetString.invoke(entityTag, "id");<NEW_LINE>if (ReflUtil.getNmsVersionObject().isHigherThanOrEqualTo(ReflUtil.V1_11_R1)) {<NEW_LINE>idString = idString.split("minecraft:")[1];<NEW_LINE>}<NEW_LINE>// noinspection deprecation<NEW_LINE>final EntityType type = EntityType.fromName(idString);<NEW_LINE>if (type != null) {<NEW_LINE>return new SpawnEggRefl(type);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unable to parse type from item");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Item is lacking tag compound");<NEW_LINE>}<NEW_LINE>} | ), "getCompound", String.class); |
884,154 | void contextPropagationExample_WithoutContextPropagator() {<NEW_LINE>ThreadPoolBulkheadConfig config = ThreadPoolBulkheadConfig.custom().maxThreadPoolSize(2).coreThreadPoolSize(1).queueCapacity(1).build();<NEW_LINE>ThreadPoolBulkheadRegistry registry = ThreadPoolBulkheadRegistry.of(config);<NEW_LINE>ThreadPoolBulkhead bulkhead = registry.bulkhead("flightSearchService");<NEW_LINE>FlightSearchService service = new FlightSearchService();<NEW_LINE>SearchRequest request = new SearchRequest("NYC", "LAX", "09/30/2020");<NEW_LINE>Supplier<List<Flight>> flightsSupplier = () -> service.searchFlightsTakingOneSecond_PrintCorrelationId(request);<NEW_LINE>Supplier<CompletionStage<List<Flight>>> decoratedFlightsSupplier = ThreadPoolBulkhead.decorateSupplier(bulkhead, flightsSupplier);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>String trackingId = UUID<MASK><NEW_LINE>System.out.println("Setting trackingId " + trackingId + " on parent, main thread before calling flight search");<NEW_LINE>RequestTrackingIdHolder.setRequestTrackingId(trackingId);<NEW_LINE>decoratedFlightsSupplier.get().whenComplete((r, t) -> {<NEW_LINE>if (r != null) {<NEW_LINE>System.out.println("Received results");<NEW_LINE>}<NEW_LINE>if (t != null) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | .randomUUID().toString(); |
922,959 | // ===================================================================================<NEW_LINE>// Basic Override<NEW_LINE>// ==============<NEW_LINE>@Override<NEW_LINE>protected String doBuildColumnString(String dm) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(dm).append(available);<NEW_LINE>sb.append(dm).append(boost);<NEW_LINE>sb.append(dm).append(configParameter);<NEW_LINE>sb.append(dm).append(createdBy);<NEW_LINE>sb.append(dm).append(createdTime);<NEW_LINE>sb.append(dm).append(depth);<NEW_LINE>sb.append(dm).append(description);<NEW_LINE>sb.append(dm).append(excludedDocPaths);<NEW_LINE>sb.append(dm).append(excludedPaths);<NEW_LINE>sb.append(dm).append(includedDocPaths);<NEW_LINE>sb.append(dm).append(includedPaths);<NEW_LINE>sb.append(dm).append(intervalTime);<NEW_LINE>sb.append(dm).append(maxAccessCount);<NEW_LINE>sb.append(dm).append(name);<NEW_LINE>sb.append(dm).append(numOfThread);<NEW_LINE>sb.append(dm).append(paths);<NEW_LINE>sb.append(dm).append(permissions);<NEW_LINE>sb.append(dm).append(sortOrder);<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append(dm).append(updatedBy);<NEW_LINE>sb.append(dm).append(updatedTime);<NEW_LINE>sb.append(dm).append(virtualHosts);<NEW_LINE>if (sb.length() > dm.length()) {<NEW_LINE>sb.delete(0, dm.length());<NEW_LINE>}<NEW_LINE>sb.insert(0, "{").append("}");<NEW_LINE>return sb.toString();<NEW_LINE>} | (dm).append(timeToLive); |
338,680 | protected WeightedDiscreteUncertainObject filterSingleObject(NumberVector vec) {<NEW_LINE>final int dim = vec.getDimensionality();<NEW_LINE>if (dim % mod != 0) {<NEW_LINE>throw new AbortException("Vector length " + dim + " not divisible by the number of dimensions + 1 (for probability): " + mod);<NEW_LINE>}<NEW_LINE>final int num = dim / mod;<NEW_LINE>final DoubleVector[<MASK><NEW_LINE>final double[] weights = new double[dims];<NEW_LINE>final double[] buf = new double[dims];<NEW_LINE>for (int i = 0, j = 0, k = 0, l = 0; i < mod; i++) {<NEW_LINE>if (l++ == probcol) {<NEW_LINE>weights[k] = vec.doubleValue(i);<NEW_LINE>} else {<NEW_LINE>buf[j++] = vec.doubleValue(i);<NEW_LINE>}<NEW_LINE>if (l == mod) {<NEW_LINE>samples[k] = DoubleVector.copy(buf);<NEW_LINE>j = 0;<NEW_LINE>l = 0;<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new WeightedDiscreteUncertainObject(samples, weights);<NEW_LINE>} | ] samples = new DoubleVector[num]; |
1,086,971 | private PartialPath mergeSamePathFilter(QueryFilter filter) throws StatementAnalyzeException {<NEW_LINE>if (filter.isLeaf()) {<NEW_LINE>return filter.getSinglePath();<NEW_LINE>}<NEW_LINE>List<QueryFilter> children = filter.getChildren();<NEW_LINE>checkInnerFilterLen(children);<NEW_LINE>PartialPath childPath = mergeSamePathFilter(children.get(0));<NEW_LINE>PartialPath tempPath;<NEW_LINE>for (int i = 1; i < children.size(); i++) {<NEW_LINE>tempPath = mergeSamePathFilter(children.get(i));<NEW_LINE>// if one of children differs from others or is not single node(seriesPath = null), filter's<NEW_LINE>// seriesPath is null<NEW_LINE>if (tempPath == null || !tempPath.equals(childPath)) {<NEW_LINE>childPath = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (childPath != null) {<NEW_LINE>filter.setIsSingle(true);<NEW_LINE>filter.setSinglePath(childPath);<NEW_LINE>return childPath;<NEW_LINE>}<NEW_LINE>// sort paths of BasicFunction by their single seriesPath. We don't sort children on non-leaf<NEW_LINE>// layer.<NEW_LINE>if (!children.isEmpty() && allIsBasic(children)) {<NEW_LINE>children.sort(Comparator.comparing(o -> o.getSinglePath().getFullPath()));<NEW_LINE>}<NEW_LINE>List<QueryFilter> <MASK><NEW_LINE>int firstNonSingleIndex = mergeSingleFilters(ret, filter);<NEW_LINE>// add last null child<NEW_LINE>return addLastNullChild(ret, filter, firstNonSingleIndex, childPath);<NEW_LINE>} | ret = new ArrayList<>(); |
144,989 | public static RubyClass createThreadClass(Ruby runtime) {<NEW_LINE>// FIXME: In order for Thread to play well with the standard 'new' behavior,<NEW_LINE>// it must provide an allocator that can create empty object instances which<NEW_LINE>// initialize then fills with appropriate data.<NEW_LINE>RubyClass threadClass = runtime.defineClass("Thread", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>threadClass.setClassIndex(ClassIndex.THREAD);<NEW_LINE>threadClass.setReifiedClass(RubyThread.class);<NEW_LINE>threadClass.defineAnnotatedMethods(RubyThread.class);<NEW_LINE>// main thread is considered adopted, since it is initiated by the JVM<NEW_LINE>RubyThread rubyThread = new RubyThread(runtime, threadClass, true);<NEW_LINE>// TODO: need to isolate the "current" thread from class creation<NEW_LINE>rubyThread.threadImpl = new AdoptedNativeThread(rubyThread, Thread.currentThread());<NEW_LINE>runtime.getThreadService().setMainThread(Thread.currentThread(), rubyThread);<NEW_LINE>// set to default thread group<NEW_LINE>runtime.<MASK><NEW_LINE>threadClass.setMarshal(ObjectMarshal.NOT_MARSHALABLE_MARSHAL);<NEW_LINE>// set up Thread::Backtrace::Location class<NEW_LINE>RubyClass backtrace = threadClass.defineClassUnder("Backtrace", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>RubyClass location = backtrace.defineClassUnder("Location", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>location.defineAnnotatedMethods(Location.class);<NEW_LINE>runtime.setLocation(location);<NEW_LINE>return threadClass;<NEW_LINE>} | getDefaultThreadGroup().addDirectly(rubyThread); |
284,254 | Optional<Candidate> fromCandidateRecord(final I_MD_Candidate candidateRecordOrNull) {<NEW_LINE>if (candidateRecordOrNull == null || isNew(candidateRecordOrNull) || candidateRecordOrNull.getMD_Candidate_ID() <= 0) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final CandidateBuilder builder = createAndInitializeBuilder(candidateRecordOrNull);<NEW_LINE>final CandidateBusinessCase businessCase = getBusinesCaseOrNull(candidateRecordOrNull);<NEW_LINE>builder.businessCase(businessCase);<NEW_LINE>final ProductionDetail productionDetailOrNull = createProductionDetailOrNull(candidateRecordOrNull);<NEW_LINE>final DistributionDetail distributionDetailOrNull = createDistributionDetailOrNull(candidateRecordOrNull);<NEW_LINE>final PurchaseDetail purchaseDetailOrNull = PurchaseDetailRepoHelper.getSingleForCandidateRecordOrNull(candidateRecordOrNull);<NEW_LINE>final StockChangeDetail stockChangeDetailOrNull = stockChangeDetailRepo.getSingleForCandidateRecordOrNull(candidateRecordOrNull);<NEW_LINE>final int hasProductionDetail = productionDetailOrNull == null ? 0 : 1;<NEW_LINE>final int hasDistributionDetail <MASK><NEW_LINE>final int hasPurchaseDetail = purchaseDetailOrNull == null ? 0 : 1;<NEW_LINE>final int hasStockChangeDetail = stockChangeDetailOrNull == null ? 0 : 1;<NEW_LINE>Check.errorIf(hasProductionDetail + hasDistributionDetail + hasPurchaseDetail + hasStockChangeDetail > 1, "A candidate may not have both a distribution, production, production detail and a hasStockChangeDetail; candidateRecord={}", candidateRecordOrNull);<NEW_LINE>final DemandDetail demandDetailOrNull = createDemandDetailOrNull(candidateRecordOrNull);<NEW_LINE>final BusinessCaseDetail businessCaseDetail = CoalesceUtil.coalesce(productionDetailOrNull, distributionDetailOrNull, purchaseDetailOrNull, demandDetailOrNull, stockChangeDetailOrNull);<NEW_LINE>builder.businessCaseDetail(businessCaseDetail);<NEW_LINE>if (hasProductionDetail > 0 || hasDistributionDetail > 0 || hasPurchaseDetail > 0) {<NEW_LINE>builder.additionalDemandDetail(demandDetailOrNull);<NEW_LINE>}<NEW_LINE>builder.transactionDetails(createTransactionDetails(candidateRecordOrNull));<NEW_LINE>final Dimension candidateDimension = dimensionService.getFromRecord(candidateRecordOrNull);<NEW_LINE>builder.dimension(candidateDimension);<NEW_LINE>return Optional.of(builder.build());<NEW_LINE>} | = distributionDetailOrNull == null ? 0 : 1; |
226,785 | private void loadOrgAccess(boolean reload) {<NEW_LINE>if (!(reload || m_orgAccess == null))<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>ArrayList<OrgAccess> list = new ArrayList<OrgAccess>();<NEW_LINE>if (isUseUserOrgAccess())<NEW_LINE>loadOrgAccessUser(list);<NEW_LINE>else<NEW_LINE>loadOrgAccessRole(list);<NEW_LINE>m_orgAccess = new OrgAccess[list.size()];<NEW_LINE>list.toArray(m_orgAccess);<NEW_LINE>log.fine("#" + m_orgAccess.length + <MASK><NEW_LINE>if (Ini.isClient()) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (int i = 0; i < m_orgAccess.length; i++) {<NEW_LINE>if (i > 0)<NEW_LINE>sb.append(",");<NEW_LINE>sb.append(m_orgAccess[i].AD_Org_ID);<NEW_LINE>}<NEW_LINE>Env.setContext(Env.getCtx(), "#User_Org", sb.toString());<NEW_LINE>}<NEW_LINE>} | (reload ? " - reload" : "")); |
814,789 | private SpHost buildSpHost(CodeGenContext context, GenTaskByTableViewSp tableViewSp, String spName) throws Exception {<NEW_LINE>JavaCodeGenContext ctx = (JavaCodeGenContext) context;<NEW_LINE>String schema = "dbo";<NEW_LINE>String realSpName = spName;<NEW_LINE>if (spName.contains(".")) {<NEW_LINE>String[] splitSp = StringUtils.split(spName, '.');<NEW_LINE>schema = splitSp[0];<NEW_LINE>realSpName = splitSp[1];<NEW_LINE>}<NEW_LINE>StoredProcedure sp = new StoredProcedure();<NEW_LINE>sp.setSchema(schema);<NEW_LINE>sp.setName(realSpName);<NEW_LINE>if (!DbUtils.spExists(tableViewSp.getAllInOneName(), sp)) {<NEW_LINE>throw new Exception(String.format("The store procedure[%s, %s] doesn't exist, pls check", tableViewSp.getAllInOneName(), sp.getName()));<NEW_LINE>}<NEW_LINE>SpHost host = new SpHost();<NEW_LINE>String className = realSpName.replace("_", "");<NEW_LINE>className = getPojoClassName(tableViewSp.getPrefix(), tableViewSp.getSuffix(), className);<NEW_LINE>host.setPackageName(ctx.getNamespace());<NEW_LINE>host.setDatabaseCategory(getDatabaseCategory<MASK><NEW_LINE>host.setDbName(tableViewSp.getDatabaseSetName());<NEW_LINE>host.setPojoClassName(className);<NEW_LINE>host.setSpName(spName);<NEW_LINE>// host.setLength(tableViewSp.getLength());<NEW_LINE>List<AbstractParameterHost> params = DbUtils.getSpParams(tableViewSp.getAllInOneName(), sp, new JavaSpParamResultSetExtractor(tableViewSp.getAllInOneName(), sp.getName()));<NEW_LINE>List<JavaParameterHost> realParams = new ArrayList<>();<NEW_LINE>String callParams = "";<NEW_LINE>if (params == null) {<NEW_LINE>throw new Exception(String.format("The sp[%s, %s] parameters is null", tableViewSp.getAllInOneName(), sp.getName()));<NEW_LINE>}<NEW_LINE>for (AbstractParameterHost p : params) {<NEW_LINE>callParams += "?,";<NEW_LINE>realParams.add((JavaParameterHost) p);<NEW_LINE>}<NEW_LINE>host.setCallParameters(StringUtils.removeEnd(callParams, ","));<NEW_LINE>host.setFields(realParams);<NEW_LINE>return host;<NEW_LINE>} | (tableViewSp.getAllInOneName())); |
117,887 | public void put(Collection<Map.Entry<Cell, byte[]>> data, long ts) {<NEW_LINE>List<Object[]> args = new ArrayList<<MASK><NEW_LINE>List<Object[]> overflowArgs = new ArrayList<>();<NEW_LINE>for (Map.Entry<Cell, byte[]> entry : data) {<NEW_LINE>Cell cell = entry.getKey();<NEW_LINE>byte[] val = entry.getValue();<NEW_LINE>if (val.length <= AtlasDbConstants.ORACLE_OVERFLOW_THRESHOLD) {<NEW_LINE>args.add(new Object[] { cell.getRowName(), cell.getColumnName(), ts, val, null });<NEW_LINE>} else {<NEW_LINE>long overflowId = config.overflowIds().orElse(overflowSequenceSupplier).get();<NEW_LINE>overflowArgs.add(new Object[] { overflowId, val });<NEW_LINE>args.add(new Object[] { cell.getRowName(), cell.getColumnName(), ts, null, overflowId });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>put(args, overflowArgs);<NEW_LINE>} | >(data.size()); |
103,731 | private List<RegionDescriptor> analyzeSection(MemoryBlock curMemBlock) throws MemoryAccessException, AddressOutOfBoundsException, ExceptionHandlerFrameException {<NEW_LINE>monitor.setMessage("Analyzing " + curMemBlock.getName() + " section");<NEW_LINE>monitor.setShowProgressValue(true);<NEW_LINE>monitor.setIndeterminate(false);<NEW_LINE>ProgramLocation loc = new ProgramLocation(program, curMemBlock.getStart());<NEW_LINE>Address curAddress = loc.getAddress();<NEW_LINE>List<RegionDescriptor> regions = new ArrayList<>();<NEW_LINE>if (curAddress != null) {<NEW_LINE>monitor.setMaximum(curMemBlock.getEnd().subtract(curAddress));<NEW_LINE>}<NEW_LINE>while (curAddress != null && curAddress.compareTo(curMemBlock.getEnd()) < 0) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return regions;<NEW_LINE>}<NEW_LINE>if (cie.isEndOfFrame()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>curAddress = cie.getNextAddress();<NEW_LINE>List<RegionDescriptor> newRegions = new ArrayList<>();<NEW_LINE>while (curAddress != null && (curAddress.compareTo(curMemBlock.getEnd()) < 0)) {<NEW_LINE>monitor.setProgress(curAddress.subtract(loc.getAddress()));<NEW_LINE>Address currFdeAddr = curAddress;<NEW_LINE>try {<NEW_LINE>FrameDescriptionEntry fde = new <MASK><NEW_LINE>RegionDescriptor region = fde.create(curAddress);<NEW_LINE>if (fde.isEndOfFrame()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (region != null) {<NEW_LINE>newRegions.add(region);<NEW_LINE>createFdeComment(curAddress);<NEW_LINE>}<NEW_LINE>// This can be null.<NEW_LINE>curAddress = fde.getNextAddress();<NEW_LINE>} catch (ExceptionHandlerFrameException efe) {<NEW_LINE>// May have run into another CIE.<NEW_LINE>curAddress = currFdeAddr;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>createAugmentationData(newRegions, cie);<NEW_LINE>regions.addAll(newRegions);<NEW_LINE>}<NEW_LINE>return regions;<NEW_LINE>} | FrameDescriptionEntry(monitor, program, this); |
699,591 | private void releaseIrrelevantSearchContext(QuerySearchResult queryResult) {<NEW_LINE>// we only release search context that we did not fetch from, if we are not scrolling<NEW_LINE>// or using a PIT and if it has at least one hit that didn't make it to the global topDocs<NEW_LINE>if (queryResult.hasSearchContext() && context.getRequest().scroll() == null && (context.isPartOfPointInTime(queryResult.getContextId()) == false)) {<NEW_LINE>try {<NEW_LINE>SearchShardTarget shardTarget = queryResult.getSearchShardTarget();<NEW_LINE>Transport.Connection connection = context.getConnection(shardTarget.getClusterAlias(), shardTarget.getNodeId());<NEW_LINE>context.sendReleaseSearchContext(queryResult.getContextId(), connection, context.getOriginalIndices<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>context.getLogger().trace("failed to release context", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (queryResult.getShardIndex())); |
1,768,769 | public Promise<OneResult<?>, OneReject<Throwable>, Void> race(DeferredCallable<?, ?> callableV1, DeferredCallable<?, ?> callableV2, DeferredCallable<?, ?>... callables) {<NEW_LINE>assertNotNull(callableV1, CALLABLE_V1);<NEW_LINE>assertNotNull(callableV2, CALLABLE_V2);<NEW_LINE>DeferredFutureTask<?, ?>[] allTasks = new DeferredFutureTask[2 + (callables != null ? callables.length : 0)];<NEW_LINE>allTasks[0] = new DeferredFutureTask<Object, Object>((DeferredCallable<MASK><NEW_LINE>allTasks[1] = new DeferredFutureTask<Object, Object>((DeferredCallable<Object, Object>) callableV2);<NEW_LINE>if (callables != null) {<NEW_LINE>for (int i = 0; i < callables.length; i++) {<NEW_LINE>allTasks[2 + i] = new DeferredFutureTask<Object, Object>((DeferredCallable<Object, Object>) callables[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return submitForSingle(allTasks);<NEW_LINE>} | <Object, Object>) callableV1); |
940,891 | void paintSeriesText(Graphics2D g, Map<String, Rectangle2D> seriesTextBounds, int markerSize, double x, double starty) {<NEW_LINE>g.setColor(chart.<MASK><NEW_LINE>g.setFont(chart.getStyler().getLegendFont());<NEW_LINE>double multiLineOffset = 0.0;<NEW_LINE>for (Map.Entry<String, Rectangle2D> entry : seriesTextBounds.entrySet()) {<NEW_LINE>double height = entry.getValue().getHeight();<NEW_LINE>double centerOffsetY = (Math.max(markerSize, height) - height) / 2.0;<NEW_LINE>FontRenderContext frc = g.getFontRenderContext();<NEW_LINE>TextLayout tl = new TextLayout(entry.getKey(), chart.getStyler().getLegendFont(), frc);<NEW_LINE>Shape shape = tl.getOutline(null);<NEW_LINE>AffineTransform orig = g.getTransform();<NEW_LINE>AffineTransform at = new AffineTransform();<NEW_LINE>at.translate(x, starty + height + centerOffsetY + multiLineOffset);<NEW_LINE>g.transform(at);<NEW_LINE>g.fill(shape);<NEW_LINE>g.setTransform(orig);<NEW_LINE>// // debug box<NEW_LINE>// Rectangle2D boundsTemp = new Rectangle2D.Double(x, starty + centerOffsetY,<NEW_LINE>// entry.getValue().getWidth(), height);<NEW_LINE>// g.setColor(Color.blue);<NEW_LINE>// g.draw(boundsTemp);<NEW_LINE>multiLineOffset += height + MULTI_LINE_SPACE;<NEW_LINE>}<NEW_LINE>} | getStyler().getChartFontColor()); |
739,579 | <T extends OutputStream> EventBinding<T> addOutputBinding(EventBinding<T> binding, boolean errorOutput) {<NEW_LINE>if (TRACE) {<NEW_LINE>String kind = (errorOutput) ? "error" : "standard";<NEW_LINE>trace("BEGIN: Adding " + kind + " output binding %s%n", binding.getElement());<NEW_LINE>}<NEW_LINE>if (errorOutput) {<NEW_LINE>this.outputErrBindings.add(binding);<NEW_LINE>InstrumentAccessor.engineAccess().attachOutputConsumer(this.err, binding.getElement());<NEW_LINE>} else {<NEW_LINE>this.outputStdBindings.add(binding);<NEW_LINE>InstrumentAccessor.engineAccess().attachOutputConsumer(this.out, binding.getElement());<NEW_LINE>}<NEW_LINE>if (TRACE) {<NEW_LINE>String kind = (errorOutput) ? "error" : "standard";<NEW_LINE>trace("END: Added " + kind + <MASK><NEW_LINE>}<NEW_LINE>return binding;<NEW_LINE>} | " output binding %s%n", binding.getElement()); |
627,906 | public Certificate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Certificate certificate = new Certificate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("certificateArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>certificate.setCertificateArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("certificateData", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>certificate.setCertificateData(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return certificate;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,666,070 | /*<NEW_LINE>* @see com.sitewhere.grpc.service.BatchManagementGrpc.BatchManagementImplBase#<NEW_LINE>* listBatchElements(com.sitewhere.grpc.service.GListBatchElementsRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listBatchElements(GListBatchElementsRequest request, StreamObserver<GListBatchElementsResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, BatchManagementGrpc.getListBatchElementsMethod());<NEW_LINE>IBatchElementSearchCriteria criteria = BatchModelConverter.asApiBatchElementSearchCriteria(request.getCriteria());<NEW_LINE>getMicroservice().getLogger().info("Batch element search criteria:\n" + MarshalUtils.marshalJsonAsPrettyString(criteria));<NEW_LINE>ISearchResults<? extends IBatchElement> apiResult = getBatchManagement().listBatchElements(CommonModelConverter.asApiUuid(request.getBatchOperationId()), criteria);<NEW_LINE>GListBatchElementsResponse.Builder response = GListBatchElementsResponse.newBuilder();<NEW_LINE>GBatchElementSearchResults.Builder results = GBatchElementSearchResults.newBuilder();<NEW_LINE>for (IBatchElement api : apiResult.getResults()) {<NEW_LINE>results.addBatchElements(BatchModelConverter.asGrpcBatchElement(api));<NEW_LINE>}<NEW_LINE>results.setCount(apiResult.getNumResults());<NEW_LINE>response.<MASK><NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(BatchManagementGrpc.getListBatchElementsMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(BatchManagementGrpc.getListBatchElementsMethod());<NEW_LINE>}<NEW_LINE>} | setResults(results.build()); |
1,477,516 | public ListRoutingProfileQueuesResult listRoutingProfileQueues(ListRoutingProfileQueuesRequest listRoutingProfileQueuesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRoutingProfileQueuesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRoutingProfileQueuesRequest> request = null;<NEW_LINE>Response<ListRoutingProfileQueuesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRoutingProfileQueuesRequestMarshaller().marshall(listRoutingProfileQueuesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListRoutingProfileQueuesResult, JsonUnmarshallerContext> unmarshaller = new ListRoutingProfileQueuesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListRoutingProfileQueuesResult> responseHandler = new JsonResponseHandler<ListRoutingProfileQueuesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
229,620 | /*<NEW_LINE>* private static String[] shift(String args[]) { if ((args == null) ||<NEW_LINE>* (args.length == 0)) return args; else { String[] newArgs = new<NEW_LINE>* String[args.length-1]; System.arraycopy(args, 1, newArgs, 0,<NEW_LINE>* args.length-1); return newArgs; } } public boolean JAR() { //Sun<NEW_LINE>* proprietary API may be removed in a future Java release<NEW_LINE>* sun.tools.jar.Main.main(shift(cmd)); return true; }<NEW_LINE>*/<NEW_LINE>public boolean JJENCODE() {<NEW_LINE>if (this.cmd.length != 2) {<NEW_LINE>log.warn("Syntax: JJENCODE <path>");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final String path = this.cmd[1];<NEW_LINE>final File dir = new File(path);<NEW_LINE>final File newPath = dir.isAbsolute() ? dir : new File(this.currentLocalPath, path);<NEW_LINE>if (newPath.exists()) {<NEW_LINE>if (newPath.isDirectory()) {<NEW_LINE>// exec("cd \"" + remote + "\";lmkdir \"" + remote + "\";lcd \""<NEW_LINE>// + remote + "\"",true);<NEW_LINE>String s = "";<NEW_LINE>final String[] l = newPath.list();<NEW_LINE>for (final String element : l) {<NEW_LINE>s = s + " \"" + element + "\"";<NEW_LINE>}<NEW_LINE>exec("cd \"" + path + "\";jar -cfM0 ../\"" + path + ".jar\"" + s, true);<NEW_LINE>exec("cd ..;jar -cfM \"" + path + ".jj\" \"" + path + ".jar\"", true);<NEW_LINE>exec(<MASK><NEW_LINE>} else {<NEW_LINE>log.warn("Error: local path " + newPath.toString() + " denotes not to a directory.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("Error: local path " + newPath.toString() + " does not exist.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | "rm \"" + path + ".jar\"", true); |
1,012,025 | public static MatchHighlighter.FieldValueHighlighter maxLeadingCharacters(int maxLeadingCharacters, String ellipsis, Set<String> fields) {<NEW_LINE>PassageSelector passageSelector = defaultPassageSelector();<NEW_LINE>PassageFormatter passageFormatter = new PassageFormatter(ellipsis, "", "");<NEW_LINE>return new AbstractFieldValueHighlighter((field, hasMatches) -> fields.contains(field)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<String> format(String field, String[] values, String contiguousValue, List<OffsetRange> valueRanges, List<MatchHighlighter.QueryOffsetRange> matchOffsets) {<NEW_LINE>List<Passage> bestPassages = passageSelector.pickBest(contiguousValue, Collections.emptyList(), maxLeadingCharacters, 1, valueRanges);<NEW_LINE>return passageFormatter.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Collection<String> alwaysFetchedFields() {<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | format(contiguousValue, bestPassages, valueRanges); |
474,954 | protected List<List<YTypedProperty>> sortIntoTiers(List<YTypedProperty> properties) {<NEW_LINE>boolean tieredOptionals = typeUtil.tieredOptionalPropertyProposals();<NEW_LINE>if (properties.isEmpty()) {<NEW_LINE>// Nothing to sort<NEW_LINE>return ImmutableList.of();<NEW_LINE>} else {<NEW_LINE>ImmutableList.Builder<YTypedProperty> primary = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<YTypedProperty> tier2 = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<YTypedProperty> tier3 = ImmutableList.builder();<NEW_LINE>for (YTypedProperty p : properties) {<NEW_LINE>if (p.isPrimary()) {<NEW_LINE>primary.add(p);<NEW_LINE>} else if (!tieredOptionals || p.isRequired()) {<NEW_LINE>tier2.add(p);<NEW_LINE>} else {<NEW_LINE>tier3.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tieredOptionals) {<NEW_LINE>return ImmutableList.of(primary.build(), tier2.build(), tier3.build());<NEW_LINE>} else {<NEW_LINE>return ImmutableList.of(primary.build(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), tier2.build()); |
707,987 | private void doAppNamesWork(String m, io.grpc.stub.StreamObserver<com.ibm.test.g3store.grpc.NameResponse> responseObserver) {<NEW_LINE>log.info(m + " ------------------------------------------------------------");<NEW_LINE>log.<MASK><NEW_LINE>log.info(m + " ----- request received by StoreConsumer grpcService to return the app names ");<NEW_LINE>try {<NEW_LINE>AppCache cacheInstance = AppCacheFactory.getInstance();<NEW_LINE>if (cacheInstance.getAllKeys().size() > 0) {<NEW_LINE>NameResponse response = NameResponse.newBuilder().addAllNames(cacheInstance.getAllKeys()).build();<NEW_LINE>log.info(m + " ----- StoreConsumer grpcService is returning the list of app names, count = [" + response.getNamesCount() + "]");<NEW_LINE>responseObserver.onNext(response);<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} else {<NEW_LINE>log.severe(m + "----- StoreConsumer grpcService is returning with NOTFOUND status ");<NEW_LINE>responseObserver.onError(Status.NOT_FOUND.withDescription("There are no apps in the cache.").augmentDescription("First run the producerService to create the apps.").asRuntimeException());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>log.info(" -----------------------" + m + " FINISH-----------------------");<NEW_LINE>log.info(m + " ------------------------------------------------------------");<NEW_LINE>}<NEW_LINE>} | info(" -----------------------" + m + " START-----------------------"); |
929,694 | public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new EPLOtherNullPrimitive());<NEW_LINE>execs.add(new EPLOtherChainedInstance());<NEW_LINE>execs.add(new EPLOtherChainedStatic());<NEW_LINE>execs.add(new EPLOtherEscape());<NEW_LINE>execs.add(new EPLOtherReturnsMapIndexProperty());<NEW_LINE>execs.add(new EPLOtherPattern());<NEW_LINE>execs.add(new EPLOtherRuntimeException());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new EPLOtherNoParameters());<NEW_LINE>execs.add(new EPLOtherPerfConstantParameters());<NEW_LINE>execs.add(new EPLOtherPerfConstantParametersNested());<NEW_LINE>execs.add(new EPLOtherSingleParameterOM());<NEW_LINE>execs.add(new EPLOtherSingleParameterCompile());<NEW_LINE>execs.add(new EPLOtherSingleParameter());<NEW_LINE>execs.add(new EPLOtherTwoParameters());<NEW_LINE>execs.add(new EPLOtherUserDefined());<NEW_LINE>execs.add(new EPLOtherComplexParameters());<NEW_LINE>execs.add(new EPLOtherMultipleMethodInvocations());<NEW_LINE>execs.add(new EPLOtherOtherClauses());<NEW_LINE>execs.add(new EPLOtherNestedFunction());<NEW_LINE>execs.add(new EPLOtherPassthru());<NEW_LINE>execs.add(new EPLOtherPrimitiveConversion());<NEW_LINE>execs.add(new EPLOtherStaticFuncWCurrentTimeStamp());<NEW_LINE>execs.add(new EPLOtherStaticFuncEnumConstant());<NEW_LINE>return execs;<NEW_LINE>} | .add(new EPLOtherArrayParameter()); |
1,247,429 | public void marshall(StartSnapshotRequest startSnapshotRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startSnapshotRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getVolumeSize(), VOLUMESIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getParentSnapshotId(), PARENTSNAPSHOTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getEncrypted(), ENCRYPTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(startSnapshotRequest.getKmsKeyArn(), KMSKEYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | startSnapshotRequest.getTimeout(), TIMEOUT_BINDING); |
1,281,886 | public void showAtNotifications(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>if (null == currentUser) {<NEW_LINE>context.sendError(403);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/notifications/at.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.NOTIFICATION_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.NOTIFICATION_LIST_WIN_SIZE;<NEW_LINE>final JSONObject result = notificationQueryService.getAtNotifications(userId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> atNotifications = (List<JSONObject>) result.get(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.AT_NOTIFICATIONS, atNotifications);<NEW_LINE>final List<JSONObject> articleFollowAndWatchNotifications = new ArrayList<>();<NEW_LINE>for (final JSONObject notification : atNotifications) {<NEW_LINE>if (Notification.DATA_TYPE_C_AT != notification.optInt(Notification.NOTIFICATION_DATA_TYPE)) {<NEW_LINE>articleFollowAndWatchNotifications.add(notification);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>notificationMgmtService.makeRead(articleFollowAndWatchNotifications);<NEW_LINE>fillNotificationCount(userId, dataModel);<NEW_LINE>final int recordCnt = result.getInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil((double<MASK><NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>} | ) recordCnt / (double) pageSize); |
324,263 | private static Documentation documentIndexedElement(final PhpElement indexedElement) {<NEW_LINE>PhpDocumentation phpDocumentation = PhpDocumentation.NONE;<NEW_LINE>final CCDocHtmlFormatter locationHeader = new CCDocHtmlFormatter();<NEW_LINE>CCDocHtmlFormatter header = new CCDocHtmlFormatter();<NEW_LINE>final String location = getLocation(indexedElement);<NEW_LINE>final <MASK><NEW_LINE>if (location != null) {<NEW_LINE>// NOI18N<NEW_LINE>locationHeader.appendHtml(String.format("<div align=\"right\"><font size=-1>%s</font></div>", location));<NEW_LINE>}<NEW_LINE>if (canBeProcessed(indexedElement)) {<NEW_LINE>phpDocumentation = getPhpDocumentation(indexedElement, header);<NEW_LINE>if (phpDocumentation == PhpDocumentation.NONE) {<NEW_LINE>if (indexedElement instanceof MethodElement) {<NEW_LINE>ElementFilter forName = ElementFilter.forName(NameKind.exact(indexedElement.getName()));<NEW_LINE>ElementQuery.Index index = elementQuery.getQueryScope().isIndexScope() ? (Index) elementQuery : ElementQueryFactory.createIndexQuery(QuerySupportFactory.get(indexedElement.getFileObject()));<NEW_LINE>final Set<TypeElement> inheritedTypes = index.getInheritedTypes(((MethodElement) indexedElement).getType());<NEW_LINE>for (Iterator<TypeElement> typeIt = inheritedTypes.iterator(); phpDocumentation == PhpDocumentation.NONE && typeIt.hasNext(); ) {<NEW_LINE>final Set<MethodElement> inheritedMethods = forName.filter(index.getDeclaredMethods(typeIt.next()));<NEW_LINE>for (Iterator<MethodElement> methodIt = inheritedMethods.iterator(); phpDocumentation == PhpDocumentation.NONE && methodIt.hasNext(); ) {<NEW_LINE>header = new CCDocHtmlFormatter();<NEW_LINE>phpDocumentation = getPhpDocumentation(methodIt.next(), header);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return phpDocumentation.createDocumentation(locationHeader);<NEW_LINE>} | ElementQuery elementQuery = indexedElement.getElementQuery(); |
787,544 | private String determineContextRoot(Hk2TargetModuleID root, String moduleName) {<NEW_LINE>// incorrect falback<NEW_LINE>String retVal = "/" + moduleName;<NEW_LINE>int dex = moduleName.lastIndexOf('.');<NEW_LINE>if (dex > -1) {<NEW_LINE>retVal = "/" + moduleName.substring(0, dex);<NEW_LINE>}<NEW_LINE>// look for the application.xml<NEW_LINE>File appxml = new File(root.getLocation(), "META-INF" + File.separator + "application.xml");<NEW_LINE>if (appxml.exists()) {<NEW_LINE>try {<NEW_LINE>// TODO read the entries<NEW_LINE>DDProvider ddp = DDProvider.getDefault();<NEW_LINE>Application app = ddp.getDDRoot(FileUtil.createData(FileUtil.normalizeFile(appxml)));<NEW_LINE>// TODO build a map<NEW_LINE>Module[] mods = app.getModule();<NEW_LINE>for (Module m : mods) {<NEW_LINE>Web w = m.getWeb();<NEW_LINE>if (null != w && moduleName.equals(w.getWebUri())) {<NEW_LINE>retVal = w.getContextRoot();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Logger.getLogger("glassfish-javaee").log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | Level.INFO, null, ex); |
1,047,426 | public void deploy(@Nonnull final DeploymentTask<D> task, @Nonnull final ParameterizedRunnable<String> onDeploymentStarted) {<NEW_LINE>connectIfNeeded(new ConnectionCallbackBase<D>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void connected(@Nonnull ServerRuntimeInstance<D> instance) {<NEW_LINE>DeploymentSource source = task.getSource();<NEW_LINE>String deploymentName = instance.getDeploymentName(source);<NEW_LINE>DeploymentImpl deployment;<NEW_LINE>synchronized (myLocalDeployments) {<NEW_LINE>deployment = new DeploymentImpl(deploymentName, DeploymentStatus.<MASK><NEW_LINE>myLocalDeployments.put(deploymentName, deployment);<NEW_LINE>}<NEW_LINE>DeploymentLogManagerImpl logManager = new DeploymentLogManagerImpl(task.getProject(), new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>myEventDispatcher.queueDeploymentsChanged(ServerConnectionImpl.this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LoggingHandlerImpl handler = logManager.getMainLoggingHandler();<NEW_LINE>myLogManagers.put(deploymentName, logManager);<NEW_LINE>handler.printlnSystemMessage("Deploying '" + deploymentName + "'...");<NEW_LINE>onDeploymentStarted.run(deploymentName);<NEW_LINE>instance.deploy(task, logManager, new DeploymentOperationCallbackImpl(deploymentName, (DeploymentTaskImpl<D>) task, handler, deployment));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | DEPLOYING, null, null, task); |
484,567 | public int appendUnfragmentedMessage(final int termId, final int termOffset, final HeaderWriter header, final DirectBuffer bufferOne, final int offsetOne, final int lengthOne, final DirectBuffer bufferTwo, final int offsetTwo, final int lengthTwo, final ReservedValueSupplier reservedValueSupplier) {<NEW_LINE>final int frameLength = lengthOne + lengthTwo + HEADER_LENGTH;<NEW_LINE>final int alignedLength = align(frameLength, FRAME_ALIGNMENT);<NEW_LINE>final UnsafeBuffer termBuffer = this.termBuffer;<NEW_LINE>final int termLength = termBuffer.capacity();<NEW_LINE>int resultingOffset = termOffset + alignedLength;<NEW_LINE>putRawTailOrdered(termId, resultingOffset);<NEW_LINE>if (resultingOffset > termLength) {<NEW_LINE>resultingOffset = handleEndOfLogCondition(termBuffer, termOffset, header, termLength, termId);<NEW_LINE>} else {<NEW_LINE>header.write(termBuffer, termOffset, frameLength, termId);<NEW_LINE>termBuffer.putBytes(termOffset + HEADER_LENGTH, bufferOne, offsetOne, lengthOne);<NEW_LINE>termBuffer.putBytes(termOffset + HEADER_LENGTH + <MASK><NEW_LINE>if (null != reservedValueSupplier) {<NEW_LINE>final long reservedValue = reservedValueSupplier.get(termBuffer, termOffset, frameLength);<NEW_LINE>termBuffer.putLong(termOffset + RESERVED_VALUE_OFFSET, reservedValue, LITTLE_ENDIAN);<NEW_LINE>}<NEW_LINE>frameLengthOrdered(termBuffer, termOffset, frameLength);<NEW_LINE>}<NEW_LINE>return resultingOffset;<NEW_LINE>} | lengthOne, bufferTwo, offsetTwo, lengthTwo); |
1,035,919 | private static void generateAnnotationFileSingleSplit(Path vocab) throws IOException {<NEW_LINE>List<String> words = Files.readAllLines(vocab, StandardCharsets.UTF_8);<NEW_LINE>TurkishMorphology morphology = TurkishMorphology.createWithDefaults();<NEW_LINE>List<String> annotations = new ArrayList<>();<NEW_LINE>for (String word : words) {<NEW_LINE>WordAnalysis analysis = morphology.analyze(word);<NEW_LINE>if (!analysis.isCorrect()) {<NEW_LINE>Log.warn("Cannot analyze %s", word);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LinkedHashSet<String> stemEndings = new LinkedHashSet<>();<NEW_LINE>for (SingleAnalysis s : analysis) {<NEW_LINE>if (s.getDictionaryItem().secondaryPos == SecondaryPos.ProperNoun || s.getDictionaryItem().secondaryPos == SecondaryPos.Abbreviation) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<String> stems = s.getStems();<NEW_LINE>for (String stem : stems) {<NEW_LINE>String ending = word.substring(stem.length());<NEW_LINE>if (!(stem + ending).equals(word)) {<NEW_LINE>Log.warn(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (ending.length() > 0) {<NEW_LINE>stemEndings.add(word + " " + stem + " " + ending);<NEW_LINE>} else {<NEW_LINE>stemEndings.add(word + " " + stem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotations.add(String.join(",", stemEndings));<NEW_LINE>}<NEW_LINE>Files.write(Paths.get("data/vocabulary/annonations.txt"), annotations, StandardCharsets.UTF_8);<NEW_LINE>} | "Stem + Ending %s+%s does not match word %s", stem, ending, word); |
1,613,779 | private boolean nullSPNTest2(StringBuffer sb) {<NEW_LINE>boolean pass = false;<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>String token = SpnegoTokenHelper.buildSpnegoAuthorizationFromCallerSubject("", lifetime, delegate);<NEW_LINE>writeLine(sb, "Null SPN Test #2 failed. Expected exception was not thrown");<NEW_LINE>} catch (WSSecurityException e) {<NEW_LINE>writeLine(sb, "Null SPN Test #2 failed. Unexpected WSSecurityException thrown " + e.getMessage());<NEW_LINE>} catch (GSSException e) {<NEW_LINE>int major = e.getMajor();<NEW_LINE>if (major == GSSException.BAD_NAME) {<NEW_LINE>pass = true;<NEW_LINE>writeLine(sb, "Null SPN Test #2 Succeeded - GSSException.major=" + major);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (PrivilegedActionException e) {<NEW_LINE>writeLine(sb, "Null SPN Test #2 failed. Unexpected PrivilegedActionException thrown " + e.getMessage());<NEW_LINE>}<NEW_LINE>return pass;<NEW_LINE>} | writeLine(sb, "Null SPN Test #2 failed. Unexpected GSSException thrown Major=" + major); |
26,387 | private static String compoundSuggestion(@Nonnull String prefix, boolean upperCaseStyle, @Nonnull String[] words, int wordCount, @Nonnull String startWord, char c, boolean isArray, boolean skip_) {<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>buffer.append(prefix);<NEW_LINE>if (upperCaseStyle) {<NEW_LINE>startWord = StringUtil.toUpperCase(startWord);<NEW_LINE>} else {<NEW_LINE>if (prefix.isEmpty() || StringUtil.endsWithChar(prefix, '_')) {<NEW_LINE>startWord = StringUtil.toLowerCase(startWord);<NEW_LINE>} else {<NEW_LINE>startWord = Character.toUpperCase(c) + startWord.substring(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer.append(startWord);<NEW_LINE>for (int i = words.length - wordCount + 1; i < words.length; i++) {<NEW_LINE>String word = words[i];<NEW_LINE>String prevWord = words[i - 1];<NEW_LINE>if (upperCaseStyle) {<NEW_LINE>word = StringUtil.toUpperCase(word);<NEW_LINE>if (prevWord.charAt(prevWord.length() - 1) != '_' && word.charAt(0) != '_') {<NEW_LINE>word = "_" + word;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (prevWord.charAt(prevWord.length() - 1) == '_') {<NEW_LINE>word = StringUtil.toLowerCase(word);<NEW_LINE>}<NEW_LINE>if (skip_) {<NEW_LINE>if (word.equals("_"))<NEW_LINE>continue;<NEW_LINE>if (prevWord.equals("_")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buffer.append(word);<NEW_LINE>}<NEW_LINE>String suggestion = buffer.toString();<NEW_LINE>if (isArray) {<NEW_LINE>suggestion = StringUtil.pluralize(suggestion);<NEW_LINE>if (upperCaseStyle) {<NEW_LINE>suggestion = StringUtil.toUpperCase(suggestion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return suggestion;<NEW_LINE>} | word = StringUtil.capitalize(word); |
1,425,172 | public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices");<NEW_LINE>if (deviceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id)));<NEW_LINE>}<NEW_LINE>String name = Utils.getValueFromIdByName(id, "bandwidthSchedules");<NEW_LINE>if (name == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", id)));<NEW_LINE>}<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<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>this.delete(<MASK><NEW_LINE>} | deviceName, name, resourceGroupName, context); |
670,631 | public CreateAliasResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateAliasResult createAliasResult = new CreateAliasResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createAliasResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Alias", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAliasResult.setAlias(AliasJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createAliasResult;<NEW_LINE>} | ().unmarshall(context)); |
964,432 | public void marshall(UpdateIncidentRecordRequest updateIncidentRecordRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateIncidentRecordRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getChatChannel(), CHATCHANNEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getNotificationTargets(), NOTIFICATIONTARGETS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getSummary(), SUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateIncidentRecordRequest.getTitle(), TITLE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateIncidentRecordRequest.getImpact(), IMPACT_BINDING); |
472,977 | public static void interleavedToBuffered(InterleavedF32 src, DataBufferByte buffer, WritableRaster dst) {<NEW_LINE>if (src.getNumBands() != dst.getNumBands())<NEW_LINE>throw new IllegalArgumentException("Unequal number of bands src = " + src.getNumBands() + " dst = " + dst.getNumBands());<NEW_LINE>final byte[<MASK><NEW_LINE>final int numBands = dst.getNumBands();<NEW_LINE>final int length = src.width * numBands;<NEW_LINE>int dstStride = stride(dst);<NEW_LINE>int dstOffset = getOffset(dst);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y;<NEW_LINE>int indexDst = dstOffset + dstStride * y;<NEW_LINE>int indexSrcEnd = indexSrc + length;<NEW_LINE>while (indexSrc < indexSrcEnd) {<NEW_LINE>dstData[indexDst++] = (byte) src.data[indexSrc++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | ] dstData = buffer.getData(); |
75,710 | private void readHeaders(ByteBuffer byteBuffer, StompHeaderAccessor headerAccessor, StompCommand command) {<NEW_LINE>boolean shouldUnescape = (command != StompCommand.CONNECT && command != StompCommand.CONNECTED && command != StompCommand.STOMP);<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>boolean headerComplete = false;<NEW_LINE>while (byteBuffer.hasRemaining()) {<NEW_LINE>if (tryConsumeEndOfLine(byteBuffer)) {<NEW_LINE>headerComplete = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>headerStream.write(byteBuffer.get());<NEW_LINE>}<NEW_LINE>if (headerStream.size() > 0 && headerComplete) {<NEW_LINE>String header = StreamUtils.copyToString(headerStream, StandardCharsets.UTF_8);<NEW_LINE>int colonIndex = header.indexOf(':');<NEW_LINE>if (colonIndex <= 0) {<NEW_LINE>if (byteBuffer.remaining() > 0) {<NEW_LINE>throw new StompConversionException("Illegal header: '" + header + "'. A header must be of the form <name>:[<value>].");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String headerName = shouldUnescape ? unescape(header.substring(0, colonIndex)) : header.substring(0, colonIndex);<NEW_LINE>String headerValue = shouldUnescape ? unescape(header.substring(colonIndex + 1)) : header.substring(colonIndex + 1);<NEW_LINE>try {<NEW_LINE>headerAccessor.addNativeHeader(headerName, headerValue);<NEW_LINE>} catch (InvalidMimeTypeException ex) {<NEW_LINE>if (byteBuffer.remaining() > 0) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ByteArrayOutputStream headerStream = new ByteArrayOutputStream(256); |
690,045 | public Void call(LocalDateTimePicker.LocalDateTimeRange viewedRange) {<NEW_LINE>startPicker.disabledLocalDateTimes().clear();<NEW_LINE>endPicker.disabledLocalDateTimes().clear();<NEW_LINE>try {<NEW_LINE>// all events in the case are contained in this interval<NEW_LINE>Interval spanningInterval = filteredEvents.getSpanningInterval();<NEW_LINE>long spanStartMillis = spanningInterval.getStartMillis();<NEW_LINE>long spaneEndMillis = spanningInterval.getEndMillis();<NEW_LINE>LocalDate rangeStartLocalDate = viewedRange.getStartLocalDateTime().toLocalDate();<NEW_LINE>LocalDate rangeEndLocalDate = viewedRange.getEndLocalDateTime().toLocalDate().plusDays(1);<NEW_LINE>// iterate over days of the displayed range and disable ones not in spanning interval<NEW_LINE>for (LocalDate dt = rangeStartLocalDate; false == dt.isAfter(rangeEndLocalDate); dt = dt.plusDays(1)) {<NEW_LINE>long startOfDay = dt.atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli();<NEW_LINE>long endOfDay = dt.plusDays(1).atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli();<NEW_LINE>// if no part of day is within spanning interval, add that date the list of disabled dates.<NEW_LINE>if (endOfDay < spanStartMillis || startOfDay > spaneEndMillis) {<NEW_LINE>startPicker.disabledLocalDateTimes().add(dt.atStartOfDay());<NEW_LINE>endPicker.disabledLocalDateTimes().add(dt.atStartOfDay());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>Notifications.create().owner(getScene().getWindow()).text(Bundle.<MASK><NEW_LINE>logger.log(Level.SEVERE, "Error getting spanning interval.", ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ViewFrame_localDateDisabler_errorMessage()).showError(); |
703,908 | public OutlierResult run(Database database, Relation<O> relation) {<NEW_LINE>StepProgress stepprog = LOG.isVerbose() ? new StepProgress("CBLOF", 3) : null;<NEW_LINE>DBIDs ids = relation.getDBIDs();<NEW_LINE>LOG.beginStep(stepprog, 1, "Computing clustering.");<NEW_LINE>Clustering<MeanModel> clustering = clusteringAlgorithm.autorun(database);<NEW_LINE>LOG.beginStep(stepprog, 2, "Computing boundary between large and small clusters.");<NEW_LINE>List<? extends Cluster<MeanModel>> clusters = clustering.getAllClusters();<NEW_LINE>Collections.sort(clusters, new Comparator<Cluster<MeanModel>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Cluster<MeanModel> o1, Cluster<MeanModel> o2) {<NEW_LINE>// Sort in descending order by size<NEW_LINE>return Integer.compare(o2.size(), o1.size());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int clusterBoundary = getClusterBoundary(relation, clusters);<NEW_LINE>List<? extends Cluster<MeanModel>> largeClusters = clusters.subList(0, clusterBoundary + 1);<NEW_LINE>List<? extends Cluster<MeanModel>> smallClusters = clusters.subList(clusterBoundary + 1, clusters.size());<NEW_LINE>LOG.beginStep(stepprog, 3, "Computing Cluster-Based Local Outlier Factors (CBLOF).");<NEW_LINE>WritableDoubleDataStore cblofs = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_DB);<NEW_LINE>DoubleMinMax cblofMinMax = new DoubleMinMax();<NEW_LINE>computeCBLOFs(relation, cblofs, cblofMinMax, largeClusters, smallClusters);<NEW_LINE>LOG.setCompleted(stepprog);<NEW_LINE>DoubleRelation scoreResult = new <MASK><NEW_LINE>OutlierScoreMeta scoreMeta = new QuotientOutlierScoreMeta(cblofMinMax.getMin(), cblofMinMax.getMax(), 0.0, Double.POSITIVE_INFINITY, 1.0);<NEW_LINE>return new OutlierResult(scoreMeta, scoreResult);<NEW_LINE>} | MaterializedDoubleRelation("Cluster-Based Local Outlier Factor", ids, cblofs); |
603,831 | public static void main(String[] args) {<NEW_LINE>for (int i = 0; i < 1; i++) {<NEW_LINE>// final int f_i = i;<NEW_LINE>new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>long cstart = SystemTime.getCurrentTime();<NEW_LINE><MASK><NEW_LINE>System.out.println("alter system clock to see differences between monotonous and current time");<NEW_LINE>long cLastRound = cstart;<NEW_LINE>long mLastRound = mstart;<NEW_LINE>while (true) {<NEW_LINE>long mnow = SystemTime.getMonotonousTime();<NEW_LINE>long cnow = SystemTime.getCurrentTime();<NEW_LINE>// if(mLastRound > mnow)<NEW_LINE>System.out.println("current: " + (cnow - cstart) + " monotonous:" + (mnow - mstart) + " delta current:" + (cnow - cLastRound) + " delta monotonous:" + (mnow - mLastRound));<NEW_LINE>cLastRound = cnow;<NEW_LINE>mLastRound = mnow;<NEW_LINE>try {<NEW_LINE>Thread.sleep(15);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>}<NEW_LINE>} | long mstart = SystemTime.getMonotonousTime(); |
306,300 | public static ListTaskResponse unmarshall(ListTaskResponse listTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTaskResponse.setRequestId(_ctx.stringValue("ListTaskResponse.RequestId"));<NEW_LINE>listTaskResponse.setTotalCount(_ctx.integerValue("ListTaskResponse.TotalCount"));<NEW_LINE>listTaskResponse.setPageNumber<MASK><NEW_LINE>listTaskResponse.setPageSize(_ctx.integerValue("ListTaskResponse.PageSize"));<NEW_LINE>List<TasksItem> tasks = new ArrayList<TasksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTaskResponse.Tasks.Length"); i++) {<NEW_LINE>TasksItem tasksItem = new TasksItem();<NEW_LINE>tasksItem.setId(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].Id"));<NEW_LINE>tasksItem.setTaskName(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskName"));<NEW_LINE>tasksItem.setTaskType(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskType"));<NEW_LINE>tasksItem.setTaskOwner(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskOwner"));<NEW_LINE>tasksItem.setTaskAdder(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskAdder"));<NEW_LINE>tasksItem.setTaskRunner(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskRunner"));<NEW_LINE>tasksItem.setTaskProgress(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskProgress"));<NEW_LINE>tasksItem.setTaskProgressDescription(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskProgressDescription"));<NEW_LINE>tasksItem.setTaskStatus(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskStatus"));<NEW_LINE>tasksItem.setClientToken(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].ClientToken"));<NEW_LINE>tasksItem.setCreatedTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].CreatedTime"));<NEW_LINE>tasksItem.setCompletionTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].CompletionTime"));<NEW_LINE>tasksItem.setPriority(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].Priority"));<NEW_LINE>tasksItem.setMaxRetry(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].MaxRetry"));<NEW_LINE>tasksItem.setNextExecutionTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].NextExecutionTime"));<NEW_LINE>tasksItem.setTaskExecutionCounts(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskExecutionCounts"));<NEW_LINE>tasksItem.setTaskErrorReason(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskErrorReason"));<NEW_LINE>tasksItem.setTaskStatusCode(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskStatusCode"));<NEW_LINE>tasks.add(tasksItem);<NEW_LINE>}<NEW_LINE>listTaskResponse.setTasks(tasks);<NEW_LINE>return listTaskResponse;<NEW_LINE>} | (_ctx.integerValue("ListTaskResponse.PageNumber")); |
6,194 | /*<NEW_LINE>* Flow go through a node, the output will be put into edgeMap, and also the changed succ will be in a list to return back.<NEW_LINE>*/<NEW_LINE>private List<Object> flowThrough(Object inValue, Object unit) {<NEW_LINE>ArrayList<Object> changedSuccs = new ArrayList<Object>();<NEW_LINE>WeightedDirectedSparseGraph ingraph = (WeightedDirectedSparseGraph) inValue;<NEW_LINE>Block block = (Block) unit;<NEW_LINE>List succs = block.getSuccs();<NEW_LINE>// leave out the last element.<NEW_LINE><MASK><NEW_LINE>Unit nexts = block.getSuccOf(s);<NEW_LINE>while (nexts != null) {<NEW_LINE>assertNormalExpr(ingraph, s);<NEW_LINE>s = nexts;<NEW_LINE>nexts = block.getSuccOf(nexts);<NEW_LINE>}<NEW_LINE>// at the end of block, it should update the out edges.<NEW_LINE>if (s instanceof IfStmt) {<NEW_LINE>if (!assertBranchStmt(ingraph, s, block, succs, changedSuccs)) {<NEW_LINE>updateOutEdges(ingraph, block, succs, changedSuccs);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>assertArrayRef(ingraph, s);<NEW_LINE>assertNormalExpr(ingraph, s);<NEW_LINE>updateOutEdges(ingraph, block, succs, changedSuccs);<NEW_LINE>}<NEW_LINE>return changedSuccs;<NEW_LINE>} | Unit s = block.getHead(); |
842,756 | public void find_Breaks(SETNode prev, SETNode cur) {<NEW_LINE>IterableSet naturalPreds = prev.get_NaturalExits();<NEW_LINE>Iterator pit = cur.get_EntryStmt().bpreds.iterator();<NEW_LINE>while (pit.hasNext()) {<NEW_LINE>AugmentedStmt pas = (AugmentedStmt) pit.next();<NEW_LINE>if (prev.get_Body().contains(pas) == false) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (naturalPreds.contains(pas) == false) {<NEW_LINE>Object temp = pas.myNode;<NEW_LINE>// System.out.println();<NEW_LINE>// ((SETNode)temp).dump();<NEW_LINE>// System.out.println("Statement is"+pas);<NEW_LINE>((SETStatementSequenceNode) temp).insert_AbruptStmt(new DAbruptStmt("break"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , prev.get_Label())); |
481,119 | private VirtualFile resolveAbsolutePath(@NotNull String path) {<NEW_LINE>VirtualFile asIsFile = pathToVirtualFile(path);<NEW_LINE>if (asIsFile != null) {<NEW_LINE>return asIsFile;<NEW_LINE>}<NEW_LINE>String projectBasePath = myProject.getBasePath();<NEW_LINE>if (projectBasePath != null) {<NEW_LINE>String projectBasedPath = path.startsWith(projectBasePath) ? path : new File(projectBasePath, path).getAbsolutePath();<NEW_LINE>VirtualFile projectBasedFile = pathToVirtualFile(projectBasedPath);<NEW_LINE>if (projectBasedFile != null) {<NEW_LINE>return projectBasedFile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matcher <MASK><NEW_LINE>if (filenameMatcher.find()) {<NEW_LINE>String filename = filenameMatcher.group(1);<NEW_LINE>GlobalSearchScope projectScope = ProjectScope.getProjectScope(myProject);<NEW_LINE>PsiFile[] projectFiles = FilenameIndex.getFilesByName(myProject, filename, projectScope);<NEW_LINE>if (projectFiles.length > 0) {<NEW_LINE>return projectFiles[0].getVirtualFile();<NEW_LINE>}<NEW_LINE>GlobalSearchScope libraryScope = ProjectScope.getLibrariesScope(myProject);<NEW_LINE>PsiFile[] libraryFiles = FilenameIndex.getFilesByName(myProject, filename, libraryScope);<NEW_LINE>if (libraryFiles.length > 0) {<NEW_LINE>return libraryFiles[0].getVirtualFile();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | filenameMatcher = PATTERN_FILENAME.matcher(path); |
988,662 | public HtmlResponse delete(final EditForm form) {<NEW_LINE>verifyCrudMode(<MASK><NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asDetailsHtml);<NEW_LINE>verifyToken(this::asDetailsHtml);<NEW_LINE>final String id = form.id;<NEW_LINE>roleService.getRole(id).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>roleService.delete(entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed to delete {}", entity, e);<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), this::asDetailsHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), this::asDetailsHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>} | form.crudMode, CrudMode.DETAILS); |
1,356,417 | private int run(PrioritySearcher<DBIDRef> priQuery, Relation<O> relation, Duration dur, MeanVariance mv, MeanVariance mvdist) {<NEW_LINE>int hash = 0;<NEW_LINE>final DBIDs sample = DBIDUtil.randomSample(relation.getDBIDs(), sampling, random);<NEW_LINE>FiniteProgress prog = LOG.isVeryVerbose() ? new FiniteProgress("kNN queries", sample.size(), LOG) : null;<NEW_LINE>dur.begin();<NEW_LINE>KNNHeap heap = DBIDUtil.newHeap(k);<NEW_LINE>for (DBIDIter iditer = sample.iter(); iditer.valid(); iditer.advance()) {<NEW_LINE>heap.clear();<NEW_LINE>for (priQuery.search(iditer); priQuery.valid(); priQuery.advance()) {<NEW_LINE>heap.insert(priQuery.computeExactDistance(), priQuery);<NEW_LINE>if (heap.size() >= k) {<NEW_LINE>priQuery.decreaseCutoff(heap.getKNNDistance());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>KNNList knns = heap.toKNNList();<NEW_LINE>int ichecksum = 0;<NEW_LINE>for (DBIDIter it = knns.iter(); it.valid(); it.advance()) {<NEW_LINE>ichecksum += DBIDUtil.asInteger(it);<NEW_LINE>}<NEW_LINE>hash = Util.mixHashCodes(hash, ichecksum);<NEW_LINE>mv.put(knns.size());<NEW_LINE>mvdist.<MASK><NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>dur.end();<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>return hash;<NEW_LINE>} | put(knns.getKNNDistance()); |
157,224 | public static void convolveSmooth(final Kernel1D_F32 kernel, final float[] src, final float[] dst, final int length) {<NEW_LINE>int idx0 = kernel.offset;<NEW_LINE>int idx1 = length - kernel.width + kernel.offset;<NEW_LINE>// Convolve the inner array first where we don't need to worry about the border<NEW_LINE>for (int i = idx0; i < idx1; i++) {<NEW_LINE>float sum = 0;<NEW_LINE>int loc = i - kernel.offset;<NEW_LINE>for (int j = 0; j < kernel.width; j++, loc++) {<NEW_LINE>sum += kernel.data[j] * src[loc];<NEW_LINE>}<NEW_LINE>dst[i] = sum;<NEW_LINE>}<NEW_LINE>// Now handle the border by normalizing the kernel<NEW_LINE>for (int i = 0; i < idx0; i++) {<NEW_LINE>float weight = 0;<NEW_LINE>float sum = 0;<NEW_LINE><MASK><NEW_LINE>for (int j = 0; j < kernel.width; j++, loc++) {<NEW_LINE>if (loc > 0 && loc < length) {<NEW_LINE>sum += kernel.data[j] * src[loc];<NEW_LINE>weight += kernel.data[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dst[i] = sum / weight;<NEW_LINE>}<NEW_LINE>for (int i = idx1; i < length; i++) {<NEW_LINE>float weight = 0;<NEW_LINE>float sum = 0;<NEW_LINE>int loc = i - kernel.offset;<NEW_LINE>for (int j = 0; j < kernel.width; j++, loc++) {<NEW_LINE>if (loc > 0 && loc < length) {<NEW_LINE>sum += kernel.data[j] * src[loc];<NEW_LINE>weight += kernel.data[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dst[i] = sum / weight;<NEW_LINE>}<NEW_LINE>} | int loc = i - kernel.offset; |
1,283,848 | // Show transaction statement.<NEW_LINE>private void handleShowTransaction() throws AnalysisException {<NEW_LINE>ShowTransactionStmt showStmt = (ShowTransactionStmt) stmt;<NEW_LINE>Database db = ctx.getCatalog().getDbOrAnalysisException(showStmt.getDbName());<NEW_LINE>TransactionStatus status = showStmt.getStatus();<NEW_LINE>GlobalTransactionMgr transactionMgr = Catalog.getCurrentGlobalTransactionMgr();<NEW_LINE>if (status != TransactionStatus.UNKNOWN) {<NEW_LINE>resultSet = new ShowResultSet(showStmt.getMetaData(), transactionMgr.getDbTransInfoByStatus(db.getId(), status));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>String label = showStmt.getLabel();<NEW_LINE>if (!label.isEmpty()) {<NEW_LINE>txnId = transactionMgr.getTransactionId(db.getId(), label);<NEW_LINE>if (txnId == null) {<NEW_LINE>throw new AnalysisException("transaction with label " + label + " does not exist");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resultSet = new ShowResultSet(showStmt.getMetaData(), transactionMgr.getSingleTranInfo(db.getId(), txnId));<NEW_LINE>}<NEW_LINE>} | Long txnId = showStmt.getTxnId(); |
1,087,396 | private static IpAccessList generateCrossZoneFilter(InterfaceOrZone fromZoneOrIface, InterfaceOrZone toZoneOrIface, Map<String, Policy> policies, Map<String, AclLine> convertedPolicies, String filename) {<NEW_LINE>checkArgument(fromZoneOrIface instanceof Interface || fromZoneOrIface instanceof Zone, String.format("Cannot generate cross-zone filter for source type %s", fromZoneOrIface.getClass().getTypeName()));<NEW_LINE>checkArgument(toZoneOrIface instanceof Interface || toZoneOrIface instanceof Zone, String.format("Cannot generate cross-zone filter for destination type %s", toZoneOrIface.getClass().getTypeName()));<NEW_LINE>String crossZoneFilterName = Names.zoneToZoneFilter(fromZoneOrIface.getName(), toZoneOrIface.getName());<NEW_LINE>ImmutableList.Builder<AclLine<MASK><NEW_LINE>policies.values().stream().filter(p -> policyMatchesFrom(p, fromZoneOrIface) && policyMatchesTo(p, toZoneOrIface)).map(Policy::getNumber).map(convertedPolicies::get).filter(Objects::nonNull).forEach(lines::add);<NEW_LINE>// Add a line to apply the default action. All cross-zone policies default-deny; intrazone<NEW_LINE>// policies can allow by default if configured to do so.<NEW_LINE>ExprAclLine.Builder defaultLine = fromZoneOrIface == toZoneOrIface && getDefaultIntrazoneAction(fromZoneOrIface) == Zone.IntrazoneAction.ALLOW ? ExprAclLine.accepting() : ExprAclLine.rejecting();<NEW_LINE>defaultLine.setMatchCondition(TRUE).setTraceElement(zoneToZoneDefaultTraceElement(fromZoneOrIface, toZoneOrIface, filename));<NEW_LINE>lines.add(defaultLine.build());<NEW_LINE>return IpAccessList.builder().setName(crossZoneFilterName).setLines(lines.build()).build();<NEW_LINE>} | > lines = ImmutableList.builder(); |
1,742,167 | private RubyArray outputInfo(final ThreadContext context) {<NEW_LINE>final RubyArray result = context.runtime.newArray();<NEW_LINE>final IRubyObject outputs = <MASK><NEW_LINE>final Iterable<IRubyObject> outputIterable;<NEW_LINE>if (outputs instanceof Iterable) {<NEW_LINE>outputIterable = (Iterable<IRubyObject>) outputs;<NEW_LINE>} else {<NEW_LINE>outputIterable = (Iterable<IRubyObject>) outputs.toJava(Iterable.class);<NEW_LINE>}<NEW_LINE>outputIterable.forEach(output -> {<NEW_LINE>final AbstractOutputDelegatorExt delegator = (AbstractOutputDelegatorExt) output;<NEW_LINE>final RubyHash hash = RubyHash.newHash(context.runtime);<NEW_LINE>hash.op_aset(context, TYPE_KEY, delegator.configName(context));<NEW_LINE>hash.op_aset(context, ID_KEY, delegator.getId());<NEW_LINE>hash.op_aset(context, CONCURRENCY_KEY, delegator.concurrency(context));<NEW_LINE>result.add(hash);<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | pipeline.callMethod(context, "outputs"); |
1,680,766 | public void invokeSenderScript(ScriptWrapper script, HttpMessage msg, int initiator, HttpSender sender, boolean request) {<NEW_LINE>validateScriptType(script, TYPE_HTTP_SENDER);<NEW_LINE>Writer writer = getWriters(script);<NEW_LINE>try {<NEW_LINE>HttpSenderScript senderScript = this.getInterface(script, HttpSenderScript.class);<NEW_LINE>if (senderScript != null) {<NEW_LINE>recordScriptCalledStats(script);<NEW_LINE>if (request) {<NEW_LINE>senderScript.sendingRequest(msg, initiator, new HttpSenderScriptHelper(sender));<NEW_LINE>} else {<NEW_LINE>senderScript.responseReceived(msg, initiator, new HttpSenderScriptHelper(sender));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleUnspecifiedScriptError(script, writer, Constant.messages.getString("script.interface.httpsender.error"));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | handleScriptException(script, writer, e); |
698,227 | private void updateCatalogAfterCommitted(TransactionState transactionState, Database db) {<NEW_LINE>Set<Long> errorReplicaIds = transactionState.getErrorReplicas();<NEW_LINE>for (TableCommitInfo tableCommitInfo : transactionState.getIdToTableCommitInfos().values()) {<NEW_LINE>long tableId = tableCommitInfo.getTableId();<NEW_LINE>OlapTable table = (<MASK><NEW_LINE>for (PartitionCommitInfo partitionCommitInfo : tableCommitInfo.getIdToPartitionCommitInfo().values()) {<NEW_LINE>long partitionId = partitionCommitInfo.getPartitionId();<NEW_LINE>Partition partition = table.getPartition(partitionId);<NEW_LINE>if (!partition.isUseStarOS()) {<NEW_LINE>List<MaterializedIndex> allIndices = partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL);<NEW_LINE>for (MaterializedIndex index : allIndices) {<NEW_LINE>for (Tablet tablet : index.getTablets()) {<NEW_LINE>for (Replica replica : ((LocalTablet) tablet).getReplicas()) {<NEW_LINE>if (errorReplicaIds.contains(replica.getId())) {<NEW_LINE>// should get from transaction state<NEW_LINE>replica.updateLastFailedVersion(partitionCommitInfo.getVersion());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>partition.setNextVersion(partition.getNextVersion() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OlapTable) db.getTable(tableId); |
1,692,879 | public void initialize(boolean parsingCompilationUnit) {<NEW_LINE>// positioning the parser for a new compilation unit<NEW_LINE>// avoiding stack reallocation and all that....<NEW_LINE>this.javadoc = null;<NEW_LINE>this.astPtr = -1;<NEW_LINE>this.astLengthPtr = -1;<NEW_LINE>this.expressionPtr = -1;<NEW_LINE>this.expressionLengthPtr = -1;<NEW_LINE>this.typeAnnotationLengthPtr = -1;<NEW_LINE>this.typeAnnotationPtr = -1;<NEW_LINE>this.identifierPtr = -1;<NEW_LINE>this.identifierLengthPtr = -1;<NEW_LINE>this.intPtr = -1;<NEW_LINE>// need to reset for further reuse<NEW_LINE>this.nestedMethod[this.nestedType = 0] = 0;<NEW_LINE>this.variablesCounter[this.nestedType] = 0;<NEW_LINE>this.dimensions = 0;<NEW_LINE>this.realBlockPtr = -1;<NEW_LINE>this.compilationUnit = null;<NEW_LINE>this.referenceContext = null;<NEW_LINE>this.endStatementPosition = 0;<NEW_LINE>this.valueLambdaNestDepth = -1;<NEW_LINE>// remove objects from stack too, while the same parser/compiler couple is<NEW_LINE>// re-used between two compilations ....<NEW_LINE>int astLength = this.astStack.length;<NEW_LINE>if (this.noAstNodes.length < astLength) {<NEW_LINE>this.noAstNodes = new ASTNode[astLength];<NEW_LINE>// System.out.println("Resized AST stacks : "+ astLength);<NEW_LINE>}<NEW_LINE>System.arraycopy(this.noAstNodes, 0, this.astStack, 0, astLength);<NEW_LINE>int expressionLength = this.expressionStack.length;<NEW_LINE>if (this.noExpressions.length < expressionLength) {<NEW_LINE>this.noExpressions = new Expression[expressionLength];<NEW_LINE>// System.out.println("Resized EXPR stacks : "+ expressionLength);<NEW_LINE>}<NEW_LINE>System.arraycopy(this.noExpressions, 0, this.expressionStack, 0, expressionLength);<NEW_LINE>// reset this.scanner state<NEW_LINE>this.scanner.commentPtr = -1;<NEW_LINE>this.scanner.foundTaskCount = 0;<NEW_LINE>this.scanner.eofPosition = Integer.MAX_VALUE;<NEW_LINE>this.recordStringLiterals = true;<NEW_LINE>final boolean checkNLS = this.options.getSeverity(<MASK><NEW_LINE>this.checkExternalizeStrings = checkNLS;<NEW_LINE>this.scanner.checkNonExternalizedStringLiterals = parsingCompilationUnit && checkNLS;<NEW_LINE>this.scanner.checkUninternedIdentityComparison = parsingCompilationUnit && this.options.complainOnUninternedIdentityComparison;<NEW_LINE>this.scanner.lastPosition = -1;<NEW_LINE>resetModifiers();<NEW_LINE>// recovery<NEW_LINE>this.lastCheckPoint = -1;<NEW_LINE>this.currentElement = null;<NEW_LINE>this.restartRecovery = false;<NEW_LINE>this.hasReportedError = false;<NEW_LINE>this.recoveredStaticInitializerStart = 0;<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>this.lastErrorEndPosition = -1;<NEW_LINE>this.lastErrorEndPositionBeforeRecovery = -1;<NEW_LINE>this.lastJavadocEnd = -1;<NEW_LINE>this.listLength = 0;<NEW_LINE>this.listTypeParameterLength = 0;<NEW_LINE>this.lastPosistion = -1;<NEW_LINE>this.rBraceStart = 0;<NEW_LINE>this.rBraceEnd = 0;<NEW_LINE>this.rBraceSuccessorStart = 0;<NEW_LINE>this.rBracketPosition = 0;<NEW_LINE>this.genericsIdentifiersLengthPtr = -1;<NEW_LINE>this.genericsLengthPtr = -1;<NEW_LINE>this.genericsPtr = -1;<NEW_LINE>} | CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore; |
251,686 | public void endVisit(JsReturn x, JsContext ctx) {<NEW_LINE>if (outerFinallyBlock != null) {<NEW_LINE>// There is a finally block, so we need to set the early-exit flag<NEW_LINE>JsBinaryOperation asg = new JsBinaryOperation(x.getSourceInfo(), JsBinaryOperator.ASG, earlyExitRef(outerFinallyBlock), JsBooleanLiteral.get(true));<NEW_LINE>if (x.getExpr() == null) {<NEW_LINE>if (ctx.canInsert()) {<NEW_LINE>// exitingEarly = true; return;<NEW_LINE>ctx.insertBefore(asg.makeStmt());<NEW_LINE>} else {<NEW_LINE>// {exitingEarly = true; return;}<NEW_LINE>JsBlock block = new JsBlock(x.getSourceInfo());<NEW_LINE>block.getStatements().add(asg.makeStmt());<NEW_LINE>block.<MASK><NEW_LINE>ctx.replaceMe(block);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// return (exitingEarly = true, expr);<NEW_LINE>JsBinaryOperation op = new JsBinaryOperation(x.getSourceInfo(), JsBinaryOperator.COMMA, asg, x.getExpr());<NEW_LINE>x.setExpr(op);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (x.getExpr() != null && x.getExpr().hasSideEffects()) {<NEW_LINE>// temp = expr; pop(); return temp;<NEW_LINE>SourceInfo info = x.getSourceInfo();<NEW_LINE>JsBinaryOperation asg = new JsBinaryOperation(info, JsBinaryOperator.ASG, returnTempRef(info), x.getExpr());<NEW_LINE>x.setExpr(returnTempRef(info));<NEW_LINE>pop(x, asg, ctx);<NEW_LINE>} else {<NEW_LINE>// Otherwise, pop the stack frame<NEW_LINE>pop(x, null, ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getStatements().add(x); |
1,349,053 | public List<ColumnMetadata> extractColumnMetadata(TopicName topicName, SchemaInfo schemaInfo, PulsarColumnHandle.HandleKeyValueType handleKeyValueType) {<NEW_LINE>List<ColumnMetadata> columnMetadata;<NEW_LINE>String schemaJson = new String(schemaInfo.getSchema());<NEW_LINE>if (StringUtils.isBlank(schemaJson)) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Topic " + <MASK><NEW_LINE>}<NEW_LINE>Descriptors.Descriptor schema;<NEW_LINE>try {<NEW_LINE>schema = ((GenericProtobufNativeSchema) GenericProtobufNativeSchema.of(schemaInfo)).getProtobufNativeSchema();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.error(ex);<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Topic " + topicName.toString() + " does not have a valid schema");<NEW_LINE>}<NEW_LINE>// Protobuf have not yet supported Cyclic Objects.<NEW_LINE>columnMetadata = schema.getFields().stream().map(field -> new PulsarColumnMetadata(PulsarColumnMetadata.getColumnName(handleKeyValueType, field.getName()), parseProtobufPrestoType(field), field.getType().toString(), null, false, false, handleKeyValueType, new PulsarColumnMetadata.DecoderExtraInfo(field.getName(), null, null))).collect(toList());<NEW_LINE>return columnMetadata;<NEW_LINE>} | topicName.toString() + " does not have a valid schema"); |
86,377 | void deleteSecret(final DeleteSecretForm form, final User user) throws DotSecurityException, DotDataException {<NEW_LINE>final String key = form.getKey();<NEW_LINE>if (!UtilMethods.isSet(key)) {<NEW_LINE>throw new IllegalArgumentException("Required param Key isn't set.");<NEW_LINE>}<NEW_LINE>final String siteId = form.getSiteId();<NEW_LINE>if (!UtilMethods.isSet(siteId)) {<NEW_LINE>throw new IllegalArgumentException("Required Param siteId isn't set.");<NEW_LINE>}<NEW_LINE>final Host host = hostAPI.find(siteId, user, false);<NEW_LINE>if (null == host) {<NEW_LINE>throw new IllegalArgumentException(String.format(" Couldn't find any site with identifier `%s` ", siteId));<NEW_LINE>}<NEW_LINE>final Optional<AppDescriptor> optionalAppDescriptor = <MASK><NEW_LINE>if (!optionalAppDescriptor.isPresent()) {<NEW_LINE>throw new DoesNotExistException(String.format("Unable to find an app descriptor bound to the Key `%s`. You must upload a yml descriptor.", key));<NEW_LINE>}<NEW_LINE>final Set<String> params = form.getParams();<NEW_LINE>if (!UtilMethods.isSet(params)) {<NEW_LINE>throw new IllegalArgumentException("Required Params aren't set.");<NEW_LINE>}<NEW_LINE>final AppDescriptor appDescriptor = optionalAppDescriptor.get();<NEW_LINE>validateFormForDelete(params, appDescriptor);<NEW_LINE>final Optional<AppSecrets> appSecretsOptional = appsAPI.getSecrets(key, host, user);<NEW_LINE>if (!appSecretsOptional.isPresent()) {<NEW_LINE>throw new DoesNotExistException(String.format("Unable to find a secret for app with Key `%s`.", key));<NEW_LINE>} else {<NEW_LINE>appsAPI.deleteSecret(key, params, host, user);<NEW_LINE>}<NEW_LINE>} | appsAPI.getAppDescriptor(key, user); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.