idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
414,450 | public static ListInstancesResponse unmarshall(ListInstancesResponse listInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listInstancesResponse.setRequestId(_ctx.stringValue("ListInstancesResponse.RequestId"));<NEW_LINE>listInstancesResponse.setTotalCount(_ctx.integerValue("ListInstancesResponse.TotalCount"));<NEW_LINE>listInstancesResponse.setPageNumber(_ctx.integerValue("ListInstancesResponse.PageNumber"));<NEW_LINE>listInstancesResponse.setPageSize(_ctx.integerValue("ListInstancesResponse.PageSize"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setName(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].Name"));<NEW_LINE>instance.setDescription(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].Description"));<NEW_LINE>instance.setStatus(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].Status"));<NEW_LINE>instance.setConcurrency(_ctx.longValue("ListInstancesResponse.Instances[" + i + "].Concurrency"));<NEW_LINE>instance.setModifyTime(_ctx.longValue("ListInstancesResponse.Instances[" + i + "].ModifyTime"));<NEW_LINE>instance.setModifyUserName(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].ModifyUserName"));<NEW_LINE>instance.setNluServiceType(_ctx.stringValue("ListInstancesResponse.Instances[" + i + "].NluServiceType"));<NEW_LINE>List<String> applicableOperations = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListInstancesResponse.Instances[" + i + "].ApplicableOperations.Length"); j++) {<NEW_LINE>applicableOperations.add(_ctx.stringValue("ListInstancesResponse.Instances[" + i <MASK><NEW_LINE>}<NEW_LINE>instance.setApplicableOperations(applicableOperations);<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>listInstancesResponse.setInstances(instances);<NEW_LINE>return listInstancesResponse;<NEW_LINE>} | + "].ApplicableOperations[" + j + "]")); |
101,280 | private boolean validateFields() {<NEW_LINE>String tname = teamnameField.getText();<NEW_LINE>if (StringUtils.isEmpty(tname)) {<NEW_LINE>error("Please enter a team name!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean rename = false;<NEW_LINE>// verify teamname uniqueness on create<NEW_LINE>if (isCreate) {<NEW_LINE>if (teamnames.contains(tname.toLowerCase())) {<NEW_LINE>error(MessageFormat.format("Team name ''{0}'' is unavailable.", tname));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// check rename collision<NEW_LINE>rename = !StringUtils.isEmpty(teamname) && !teamname.equalsIgnoreCase(tname);<NEW_LINE>if (rename) {<NEW_LINE>if (teamnames.contains(tname.toLowerCase())) {<NEW_LINE>error(MessageFormat.format("Failed to rename ''{0}'' because ''{1}'' already exists.", teamname, tname));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>team.name = tname;<NEW_LINE>team.canAdmin = canAdminCheckbox.isSelected();<NEW_LINE>team<MASK><NEW_LINE>team.canCreate = canCreateCheckbox.isSelected();<NEW_LINE>String ml = mailingListsField.getText();<NEW_LINE>if (!StringUtils.isEmpty(ml)) {<NEW_LINE>Set<String> list = new HashSet<String>();<NEW_LINE>for (String address : ml.split("(,|\\s)")) {<NEW_LINE>if (StringUtils.isEmpty(address)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>list.add(address.toLowerCase());<NEW_LINE>}<NEW_LINE>team.mailingLists.clear();<NEW_LINE>team.mailingLists.addAll(list);<NEW_LINE>}<NEW_LINE>for (RegistrantAccessPermission rp : repositoryPalette.getPermissions()) {<NEW_LINE>team.setRepositoryPermission(rp.registrant, rp.permission);<NEW_LINE>}<NEW_LINE>team.users.clear();<NEW_LINE>team.users.addAll(userPalette.getSelections());<NEW_LINE>team.preReceiveScripts.clear();<NEW_LINE>team.preReceiveScripts.addAll(preReceivePalette.getSelections());<NEW_LINE>team.postReceiveScripts.clear();<NEW_LINE>team.postReceiveScripts.addAll(postReceivePalette.getSelections());<NEW_LINE>return true;<NEW_LINE>} | .canFork = canForkCheckbox.isSelected(); |
1,519,253 | public void run(WorkingCopy workingCopy) throws Exception {<NEW_LINE>workingCopy.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>Element elem = elementHandle.resolve(workingCopy);<NEW_LINE>if (elem != null) {<NEW_LINE>Tree tree = workingCopy.getTrees().getTree(elem);<NEW_LINE>TreeMaker make = workingCopy.getTreeMaker();<NEW_LINE>ModifiersTree modifiersTree = null;<NEW_LINE>if (tree.getKind() == Tree.Kind.VARIABLE) {<NEW_LINE>modifiersTree = ((VariableTree) tree).getModifiers();<NEW_LINE>} else if (tree.getKind() == Tree.Kind.METHOD) {<NEW_LINE>modifiersTree = ((MethodTree) tree).getModifiers();<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>TypeElement temporalAnnType = workingCopy.getElements(<MASK><NEW_LINE>Tree annType = make.QualIdent(temporalAnnType);<NEW_LINE>AnnotationTree temporalAnn = make.Annotation(annType, Collections.singletonList(make.Identifier("javax.persistence.TemporalType.DATE")));<NEW_LINE>List<AnnotationTree> newAnnots = new ArrayList<AnnotationTree>();<NEW_LINE>newAnnots.addAll(modifiersTree.getAnnotations());<NEW_LINE>newAnnots.add(temporalAnn);<NEW_LINE>ModifiersTree newModifiers = make.Modifiers(modifiersTree, newAnnots);<NEW_LINE>workingCopy.rewrite(modifiersTree, newModifiers);<NEW_LINE>}<NEW_LINE>} | ).getTypeElement(JPAAnnotations.TEMPORAL); |
1,437,352 | public void actionPerformed(ActionEvent e) {<NEW_LINE>if (e.getSource() instanceof JComponent) {<NEW_LINE>JComponent btn = (JComponent) e.getSource();<NEW_LINE>String name = btn.getName();<NEW_LINE>switch(name) {<NEW_LINE>case "CLOSE":<NEW_LINE>onClosed();<NEW_LINE>break;<NEW_LINE>case "FORMAT_SELECT":<NEW_LINE>fmtWnd.setVisible(true);<NEW_LINE>if (fmtWnd.isApproveOption()) {<NEW_LINE>MediaFormat fmt = fmtWnd.getFormat();<NEW_LINE>btnOutFormat.setText(fmt.getDescription());<NEW_LINE>setDetails(fmt.getResolution(), fmt.getVideo_codec(), fmt.getAudio_codec());<NEW_LINE>lblImg.setFormat(fmt.getFormat());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "STOP":<NEW_LINE>stop();<NEW_LINE>break;<NEW_LINE>case "CONVERT":<NEW_LINE>for (int i = 0; i < model.size(); i++) {<NEW_LINE>ConversionItem <MASK><NEW_LINE>String file = XDMUtils.getFileNameWithoutExtension(item.inputFileName);<NEW_LINE>String ext = fmtWnd.getFormat().getFormat();<NEW_LINE>item.outFileName = file + "." + ext;<NEW_LINE>}<NEW_LINE>System.out.println("starting convert");<NEW_LINE>mode = 1;<NEW_LINE>t = new Thread(this);<NEW_LINE>t.start();<NEW_LINE>break;<NEW_LINE>case "BROWSE_FOLDER":<NEW_LINE>JFileChooser jfc = new JFileChooser();<NEW_LINE>jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>if (jfc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {<NEW_LINE>txtOutFolder.setText(jfc.getSelectedFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | item = model.getElementAt(i); |
174,265 | protected Enumeration<URL> findResources(String res) throws IOException {<NEW_LINE>List<URL> resources = new ArrayList<URL>();<NEW_LINE><MASK><NEW_LINE>res = deslashResource(res);<NEW_LINE>String entryRes = res;<NEW_LINE>if (File.separatorChar != SLASH_CHAR) {<NEW_LINE>res = res.replace(SLASH_CHAR, File.separatorChar);<NEW_LINE>entryRes = entryRes.replace(File.separatorChar, SLASH_CHAR);<NEW_LINE>}<NEW_LINE>PyList path = sys.path;<NEW_LINE>for (int i = 0; i < path.__len__(); i++) {<NEW_LINE>PyObject entry = replacePathItem(sys, i, path);<NEW_LINE>if (entry instanceof SyspathArchive) {<NEW_LINE>SyspathArchive archive = (SyspathArchive) entry;<NEW_LINE>ZipEntry ze = archive.getEntry(entryRes);<NEW_LINE>if (ze != null) {<NEW_LINE>try {<NEW_LINE>resources.add(new URL("jar:file:" + archive.asUriCompatibleString() + "!/" + entryRes));<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String dir = sys.getPath(Py.fileSystemDecode(entry));<NEW_LINE>try {<NEW_LINE>File resource = new File(dir, res);<NEW_LINE>if (!resource.exists()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>resources.add(resource.toURI().toURL());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.enumeration(resources);<NEW_LINE>} | PySystemState sys = Py.getSystemState(); |
322,698 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>OsmandApplication app = requiredMyApplication();<NEW_LINE>plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);<NEW_LINE>LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode);<NEW_LINE>View sendGpxView = themedInflater.inflate(R.layout.send_gpx_fragment, null);<NEW_LINE>sendGpxView.getViewTreeObserver().addOnGlobalLayoutListener(getShadowLayoutListener());<NEW_LINE>if (selectedUploadVisibility == null) {<NEW_LINE>selectedUploadVisibility = plugin.OSM_UPLOAD_VISIBILITY.get();<NEW_LINE>}<NEW_LINE>tagsField = sendGpxView.findViewById(R.id.tags_field);<NEW_LINE>messageField = sendGpxView.findViewById(R.id.message_field);<NEW_LINE>TextView accountName = sendGpxView.findViewById(R.id.user_name);<NEW_LINE>if (!Algorithms.isEmpty(plugin.OSM_USER_DISPLAY_NAME.get())) {<NEW_LINE>accountName.setText(plugin.OSM_USER_DISPLAY_NAME.get());<NEW_LINE>} else {<NEW_LINE>accountName.setText(plugin.OSM_USER_NAME_OR_EMAIL.get());<NEW_LINE>}<NEW_LINE>final TextView visibilityName = sendGpxView.findViewById(R.id.visibility_name);<NEW_LINE>final TextView visibilityDescription = sendGpxView.findViewById(R.id.visibility_description);<NEW_LINE>visibilityName.setText(selectedUploadVisibility.getTitleId());<NEW_LINE>visibilityDescription.setText(selectedUploadVisibility.getDescriptionId());<NEW_LINE>List<ChipItem> itemsVisibility = new ArrayList<>();<NEW_LINE>for (UploadVisibility visibilityType : UploadVisibility.values()) {<NEW_LINE>String title = getString(visibilityType.getTitleId());<NEW_LINE>ChipItem item = new ChipItem(title);<NEW_LINE>item.title = title;<NEW_LINE>item.tag = visibilityType;<NEW_LINE>itemsVisibility.add(item);<NEW_LINE>}<NEW_LINE>HorizontalChipsView chipsView = sendGpxView.findViewById(R.id.selector_view);<NEW_LINE>chipsView.setItems(itemsVisibility);<NEW_LINE>ChipItem selected = chipsView.getChipById(getString(selectedUploadVisibility.getTitleId()));<NEW_LINE>chipsView.setSelected(selected);<NEW_LINE>chipsView.setOnSelectChipListener(chip -> {<NEW_LINE>selectedUploadVisibility = (UploadVisibility) chip.tag;<NEW_LINE>plugin.OSM_UPLOAD_VISIBILITY.set(selectedUploadVisibility);<NEW_LINE>visibilityName.<MASK><NEW_LINE>visibilityDescription.setText(selectedUploadVisibility.getDescriptionId());<NEW_LINE>chipsView.smoothScrollTo(chip);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>chipsView.notifyDataSetChanged();<NEW_LINE>LinearLayout account = sendGpxView.findViewById(R.id.account_container);<NEW_LINE>account.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>showOpenStreetMapScreen(activity);<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder().setCustomView(sendGpxView).create();<NEW_LINE>items.add(titleItem);<NEW_LINE>} | setText(selectedUploadVisibility.getTitleId()); |
843,614 | public JSONObject jsonSerialise() {<NEW_LINE>JSONObject json = super.jsonSerialise();<NEW_LINE>json.put("direction", getDirection().ordinal());<NEW_LINE>CubotInventory inv = (<MASK><NEW_LINE>int heldItem = inv.getInventory().getOrDefault(inv.getPosition(), new ItemVoid()).getId();<NEW_LINE>json.put("heldItem", heldItem);<NEW_LINE>json.put("hp", hp);<NEW_LINE>json.put("shield", shield);<NEW_LINE>json.put("action", lastAction.ordinal());<NEW_LINE>if (parent != null) {<NEW_LINE>// Only used client-side for now<NEW_LINE>json.put("parent", parent.getUsername());<NEW_LINE>}<NEW_LINE>for (HardwareModule module : hardwareAddresses.values()) {<NEW_LINE>JSONObject hwJson = module.jsonSerialise();<NEW_LINE>if (hwJson != null) {<NEW_LINE>json.put(module.getClass().getName(), hwJson);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>} | CubotInventory) getHardware(CubotInventory.class); |
1,684,744 | private void fillContentValues(ContentValues contentValues) {<NEW_LINE>contentValues.put(JobStorage.COLUMN_ID, mId);<NEW_LINE>contentValues.put(JobStorage.COLUMN_TAG, mTag);<NEW_LINE>contentValues.put(JobStorage.COLUMN_START_MS, mStartMs);<NEW_LINE>contentValues.put(JobStorage.COLUMN_END_MS, mEndMs);<NEW_LINE>contentValues.put(JobStorage.COLUMN_BACKOFF_MS, mBackoffMs);<NEW_LINE>contentValues.put(JobStorage.COLUMN_BACKOFF_POLICY, mBackoffPolicy.toString());<NEW_LINE>contentValues.put(JobStorage.COLUMN_INTERVAL_MS, mIntervalMs);<NEW_LINE>contentValues.put(JobStorage.COLUMN_FLEX_MS, mFlexMs);<NEW_LINE>contentValues.put(JobStorage.COLUMN_REQUIREMENTS_ENFORCED, mRequirementsEnforced);<NEW_LINE>contentValues.put(JobStorage.COLUMN_REQUIRES_CHARGING, mRequiresCharging);<NEW_LINE>contentValues.put(JobStorage.COLUMN_REQUIRES_DEVICE_IDLE, mRequiresDeviceIdle);<NEW_LINE>contentValues.put(JobStorage.COLUMN_REQUIRES_BATTERY_NOT_LOW, mRequiresBatteryNotLow);<NEW_LINE>contentValues.put(JobStorage.COLUMN_REQUIRES_STORAGE_NOT_LOW, mRequiresStorageNotLow);<NEW_LINE>contentValues.put(JobStorage.COLUMN_EXACT, mExact);<NEW_LINE>contentValues.put(JobStorage.COLUMN_NETWORK_TYPE, mNetworkType.toString());<NEW_LINE>if (mExtras != null) {<NEW_LINE>contentValues.put(JobStorage.COLUMN_EXTRAS, mExtras.saveToXml());<NEW_LINE>} else if (!TextUtils.isEmpty(mExtrasXml)) {<NEW_LINE>contentValues.<MASK><NEW_LINE>}<NEW_LINE>contentValues.put(JobStorage.COLUMN_TRANSIENT, mTransient);<NEW_LINE>} | put(JobStorage.COLUMN_EXTRAS, mExtrasXml); |
1,086,111 | public void submitTicket(LotteryService service, Scanner scanner) {<NEW_LINE>logger.info("What is your email address?");<NEW_LINE>var email = readString(scanner);<NEW_LINE>logger.info("What is your bank account number?");<NEW_LINE>var account = readString(scanner);<NEW_LINE>logger.info("What is your phone number?");<NEW_LINE>var phone = readString(scanner);<NEW_LINE>var details = new PlayerDetails(email, account, phone);<NEW_LINE>logger.info("Give 4 comma separated lottery numbers?");<NEW_LINE>var numbers = readString(scanner);<NEW_LINE>try {<NEW_LINE>var chosen = Arrays.stream(numbers.split(",")).map(Integer::parseInt).collect(Collectors.toSet());<NEW_LINE>var lotteryNumbers = LotteryNumbers.create(chosen);<NEW_LINE>var lotteryTicket = new LotteryTicket(new <MASK><NEW_LINE>service.submitTicket(lotteryTicket).ifPresentOrElse((id) -> logger.info("Submitted lottery ticket with id: {}", id), () -> logger.info("Failed submitting lottery ticket - please try again."));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.info("Failed submitting lottery ticket - please try again.");<NEW_LINE>}<NEW_LINE>} | LotteryTicketId(), details, lotteryNumbers); |
1,742,832 | public VanityUrl fromContentlet(final Contentlet contentlet) {<NEW_LINE>if (contentlet == null) {<NEW_LINE>throw new DotStateException("Contentlet cannot be null");<NEW_LINE>}<NEW_LINE>if (!contentlet.isVanityUrl()) {<NEW_LINE>throw new DotStateException(String.format("Contentlet with Inode '%s' is not a Vanity Url", contentlet.getInode()));<NEW_LINE>}<NEW_LINE>if (contentlet instanceof VanityUrl) {<NEW_LINE>return (VanityUrl) contentlet;<NEW_LINE>}<NEW_LINE>validateVanityUrl(contentlet);<NEW_LINE>final DefaultVanityUrl vanityUrl = new DefaultVanityUrl();<NEW_LINE>vanityUrl.setContentTypeId(contentlet.getContentTypeId());<NEW_LINE>try {<NEW_LINE>this.contentletAPI.copyProperties(<MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new DotStateException(String.format("Failed to copy properties for Vanity Url with ID '%s': %s", contentlet.getIdentifier(), e.getMessage()), e);<NEW_LINE>}<NEW_LINE>vanityUrl.setHost(contentlet.getHost());<NEW_LINE>vanityUrl.setFolder(contentlet.getFolder());<NEW_LINE>CacheLocator.getContentletCache().add(vanityUrl);<NEW_LINE>return vanityUrl;<NEW_LINE>} | vanityUrl, contentlet.getMap()); |
1,589,838 | public static Bitmap hookDecodeFileDescriptor(FileDescriptor fd, @Nullable Rect outPadding, @Nullable BitmapFactory.Options opts) {<NEW_LINE>StaticWebpNativeLoader.ensure();<NEW_LINE>Bitmap bitmap;<NEW_LINE>long originalSeekPosition = nativeSeek(fd, 0, false);<NEW_LINE>if (originalSeekPosition != -1) {<NEW_LINE>InputStream inputStream = wrapToMarkSupportedStream(new FileInputStream(fd));<NEW_LINE>try {<NEW_LINE>byte[] <MASK><NEW_LINE>if (WebpSupportStatus.sIsWebpSupportRequired && header != null && isWebpHeader(header, 0, HEADER_SIZE)) {<NEW_LINE>bitmap = nativeDecodeStream(inputStream, opts, getScaleFromOptions(opts), getInTempStorageFromOptions(opts));<NEW_LINE>// We send error if the direct decode failed<NEW_LINE>if (bitmap == null) {<NEW_LINE>sendWebpErrorLog("webp_direct_decode_fd");<NEW_LINE>}<NEW_LINE>setPaddingDefaultValues(outPadding);<NEW_LINE>setWebpBitmapOptions(bitmap, opts);<NEW_LINE>} else {<NEW_LINE>nativeSeek(fd, originalSeekPosition, true);<NEW_LINE>bitmap = originalDecodeFileDescriptor(fd, outPadding, opts);<NEW_LINE>if (bitmap == null) {<NEW_LINE>sendWebpErrorLog("webp_direct_decode_fd_failed_on_no_webp");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>inputStream.close();<NEW_LINE>} catch (Throwable t) { | header = getWebpHeader(inputStream, opts); |
1,021,439 | final GetOriginRequestPolicyConfigResult executeGetOriginRequestPolicyConfig(GetOriginRequestPolicyConfigRequest getOriginRequestPolicyConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getOriginRequestPolicyConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetOriginRequestPolicyConfigRequest> request = null;<NEW_LINE>Response<GetOriginRequestPolicyConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetOriginRequestPolicyConfigRequestMarshaller().marshall(super.beforeMarshalling(getOriginRequestPolicyConfigRequest));<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, "CloudFront");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetOriginRequestPolicyConfigResult> responseHandler = new StaxResponseHandler<GetOriginRequestPolicyConfigResult>(new GetOriginRequestPolicyConfigResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetOriginRequestPolicyConfig"); |
711,347 | private void trySendEscToDialog() {<NEW_LINE>if (isTableUI()) {<NEW_LINE>// let the table decide, don't be preemptive<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// System.err.println("SendEscToDialog");<NEW_LINE>EventObject ev = EventQueue.getCurrentEvent();<NEW_LINE>if (ev instanceof KeyEvent && (((KeyEvent) ev).getKeyCode() == KeyEvent.VK_ESCAPE)) {<NEW_LINE>if (ev.getSource() instanceof JComboBox && ((JComboBox) ev.getSource()).isPopupVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ev.getSource() instanceof JTextComponent && ((JTextComponent) ev.getSource()).getParent() instanceof JComboBox && ((JComboBox) ((JTextComponent) ev.getSource()).getParent()).isPopupVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>ActionMap am = getRootPane().getActionMap();<NEW_LINE>KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);<NEW_LINE>Object key = imp.get(escape);<NEW_LINE>if (key != null) {<NEW_LINE>Action a = am.get(key);<NEW_LINE>if (a != null) {<NEW_LINE>if (Boolean.getBoolean("netbeans.proppanel.logDialogActions")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>String commandKey = (String) a.getValue(Action.ACTION_COMMAND_KEY);<NEW_LINE>if (commandKey == null) {<NEW_LINE>// NOI18N<NEW_LINE>commandKey = "cancel";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | err.println("Action bound to escape key is " + a); |
1,245,321 | private void uploadParts() {<NEW_LINE>// exit if multipart has not been initiated<NEW_LINE>if (multipartUploadId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// do not upload the file currently being written<NEW_LINE>stagingFiles.stream().filter(// do not upload any files that have already been processed<NEW_LINE>f -> closed || !f.file().equals(currentStagingFile)).filter(Predicates.not(f -> multiPartMap.containsKey(f.file()))).forEach(fileAndDigest -> {<NEW_LINE>File f = fileAndDigest.file();<NEW_LINE>UploadPartRequest.Builder requestBuilder = UploadPartRequest.builder().bucket(location.bucket()).key(location.key()).uploadId(multipartUploadId).partNumber(stagingFiles.indexOf(fileAndDigest) + 1).contentLength(f.length());<NEW_LINE>if (fileAndDigest.hasDigest()) {<NEW_LINE>requestBuilder.contentMD5(BinaryUtils.toBase64(fileAndDigest.digest()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>UploadPartRequest uploadRequest = requestBuilder.build();<NEW_LINE>CompletableFuture<CompletedPart> future = CompletableFuture.supplyAsync(() -> {<NEW_LINE>UploadPartResponse response = s3.uploadPart(uploadRequest, RequestBody.fromFile(f));<NEW_LINE>return CompletedPart.builder().eTag(response.eTag()).partNumber(uploadRequest.partNumber()).build();<NEW_LINE>}, executorService).whenComplete((result, thrown) -> {<NEW_LINE>try {<NEW_LINE>Files.deleteIfExists(f.toPath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("Failed to delete staging file: {}", f, e);<NEW_LINE>}<NEW_LINE>if (thrown != null) {<NEW_LINE>LOG.error("Failed to upload part: {}", uploadRequest, thrown);<NEW_LINE>abortUpload();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>multiPartMap.put(f, future);<NEW_LINE>});<NEW_LINE>} | S3RequestUtil.configureEncryption(awsProperties, requestBuilder); |
1,521,766 | public final JMenuItem createCopyMenuItem() {<NEW_LINE>final int row = getSelectedRow();<NEW_LINE>// NOI118N<NEW_LINE>JMenu copyItem = new JMenu(BUNDLE().getString("ProfilerTable_CopyMenu"));<NEW_LINE>JMenuItem copyRowItem = new // NOI118N<NEW_LINE>// NOI118N<NEW_LINE>JMenuItem(BUNDLE().getString("ProfilerTable_CopyRowItem")) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>StringBuilder val = new StringBuilder();<NEW_LINE>List<TableColumn> columns = Collections.list(_getColumnModel().getColumns());<NEW_LINE>for (int col = 0; col < columns.size(); col++) if (columns.get(col).getWidth() > 0)<NEW_LINE>// NOI118N<NEW_LINE>val.append("\t").append(getStringValue(row, col));<NEW_LINE>StringSelection s = new StringSelection(val.toString().trim());<NEW_LINE>Toolkit.getDefaultToolkit().getSystemClipboard(<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>copyItem.add(copyRowItem);<NEW_LINE>copyItem.addSeparator();<NEW_LINE>// NOI118N<NEW_LINE>String genericItemName = BUNDLE().getString("ProfilerTable_CopyColumnItem");<NEW_LINE>List<TableColumn> columns = Collections.list(_getColumnModel().getColumns());<NEW_LINE>for (int col = 0; col < columns.size(); col++) {<NEW_LINE>final int _col = col;<NEW_LINE>TableColumn column = columns.get(col);<NEW_LINE>if (column.getWidth() > 0) {<NEW_LINE>String columnName = column.getHeaderValue().toString();<NEW_LINE>// NOI118N<NEW_LINE>if (columnName.toLowerCase(Locale.ENGLISH).startsWith("<html>"))<NEW_LINE>columnName = columnName.replaceAll("<[^>]*>", "");<NEW_LINE>copyItem.add(new JMenuItem(MessageFormat.format(genericItemName, columnName)) {<NEW_LINE><NEW_LINE>protected void fireActionPerformed(ActionEvent e) {<NEW_LINE>StringSelection s = new StringSelection(getStringValue(row, _col));<NEW_LINE>Toolkit.getDefaultToolkit().getSystemClipboard().setContents(s, s);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copyItem;<NEW_LINE>} | ).setContents(s, s); |
814,676 | protected String constructCacheFileName(StaticAsset staticAsset, Map<String, String> parameterMap) {<NEW_LINE>String fileName = staticAsset.getFullUrl();<NEW_LINE>StringBuilder sb = new StringBuilder(200);<NEW_LINE>sb.append(fileName.substring(0, fileName.lastIndexOf('.')));<NEW_LINE>sb.append("---");<NEW_LINE>StringBuilder sb2 = new StringBuilder(200);<NEW_LINE>SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");<NEW_LINE>if (staticAsset instanceof Auditable) {<NEW_LINE>Auditable auditableStaticAsset = (Auditable) staticAsset;<NEW_LINE>sb2.append(format.format(auditableStaticAsset.getDateUpdated() == null ? auditableStaticAsset.getDateCreated() : auditableStaticAsset.getDateUpdated()));<NEW_LINE>}<NEW_LINE>if (parameterMap != null) {<NEW_LINE>for (Map.Entry<String, String> entry : parameterMap.entrySet()) {<NEW_LINE>sb2.append('-');<NEW_LINE>sb2.append(entry.getKey());<NEW_LINE>sb2.append('-');<NEW_LINE>sb2.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String digest;<NEW_LINE>try {<NEW_LINE>MessageDigest md = MessageDigest.getInstance("MD5");<NEW_LINE>byte[] messageDigest = md.digest(sb2.toString().getBytes());<NEW_LINE>BigInteger number = new BigInteger(1, messageDigest);<NEW_LINE>digest = number.toString(16);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>sb.append(pad(digest, 32, '0'));<NEW_LINE>sb.append(fileName.substring(fileName.lastIndexOf('.')));<NEW_LINE>return sb.toString();<NEW_LINE>} | append(entry.getValue()); |
433,208 | public void handle(Callback[] callbacks) throws UnsupportedCallbackException {<NEW_LINE>NameCallback nc = null;<NEW_LINE>PasswordCallback pc = null;<NEW_LINE>RealmCallback rc = null;<NEW_LINE>for (Callback callback : callbacks) {<NEW_LINE>if (callback instanceof RealmChoiceCallback) {<NEW_LINE>continue;<NEW_LINE>} else if (callback instanceof NameCallback) {<NEW_LINE>nc = (NameCallback) callback;<NEW_LINE>} else if (callback instanceof PasswordCallback) {<NEW_LINE>pc = (PasswordCallback) callback;<NEW_LINE>} else if (callback instanceof RealmCallback) {<NEW_LINE>rc = (RealmCallback) callback;<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedCallbackException(callback, "Unrecognized SASL client callback");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nc != null) {<NEW_LINE>log.debug("SASL client callback: setting username: {}", userName);<NEW_LINE>nc.setName(userName);<NEW_LINE>}<NEW_LINE>if (pc != null) {<NEW_LINE>log.debug("SASL client callback: setting userPassword");<NEW_LINE>pc.setPassword(userPassword);<NEW_LINE>}<NEW_LINE>if (rc != null) {<NEW_LINE>log.debug(<MASK><NEW_LINE>rc.setText(rc.getDefaultText());<NEW_LINE>}<NEW_LINE>} | "SASL client callback: setting realm: {}", rc.getDefaultText()); |
793,880 | private View createCurrentMemberRow(String name, String value) {<NEW_LINE>LinearLayout row = (LinearLayout) getLayoutInflater().inflate(R.layout.widget_icon_text_button_row, null);<NEW_LINE>ImageView icon = (ImageView) row.findViewById(R.id.widget_itbr_icon);<NEW_LINE>TextView label = (TextView) row.findViewById(R.id.widget_itbr_text);<NEW_LINE>Button button = (Button) row.findViewById(R.id.widget_itbr_button);<NEW_LINE>icon.setImageResource(R.drawable.smartphone_grey600);<NEW_LINE>label.setText(name + ": " <MASK><NEW_LINE>button.setText(R.string.group_remove_member);<NEW_LINE>button.setTag(R.id.tag_action, ACTION_REMOVE_MEMBER);<NEW_LINE>button.setTag(R.id.tag_token, name);<NEW_LINE>button.setOnClickListener(this);<NEW_LINE>return row;<NEW_LINE>} | + AbstractFragment.truncateToShortString(value)); |
1,573,773 | static void autoboxArguments(List<Type> types, List<Value> argVals, ThreadReference evaluationThread, EvaluationContext evaluationContext) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException {<NEW_LINE>if (types.size() != argVals.size()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int n = types.size();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>Type t = types.get(i);<NEW_LINE>Value <MASK><NEW_LINE>if (v instanceof ObjectReference && t instanceof PrimitiveType) {<NEW_LINE>argVals.set(i, unbox((ObjectReference) v, (PrimitiveType) t, evaluationThread, evaluationContext));<NEW_LINE>}<NEW_LINE>if (v instanceof PrimitiveValue && t instanceof ReferenceType) {<NEW_LINE>argVals.set(i, box((PrimitiveValue) v, (ReferenceType) t, evaluationThread, evaluationContext));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | v = argVals.get(i); |
1,225,777 | public void secureDeployment(DeploymentInfo deploymentInfo) {<NEW_LINE>LoginConfig loginConfig = new LoginConfig("OpenRemote");<NEW_LINE>// Make it silent to prevent 401 WWW-Authenticate modal dialog<NEW_LINE>deploymentInfo.addAuthenticationMechanism("BASIC-FIX", BasicFixAuthenticationMechanism.FACTORY);<NEW_LINE>loginConfig.addFirstAuthMethod(new AuthMethodConfig("BASIC-FIX", Collections.<MASK><NEW_LINE>deploymentInfo.setLoginConfig(loginConfig);<NEW_LINE>deploymentInfo.setIdentityManager(new IdentityManager() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Account verify(Account account) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Account verify(String id, Credential credential) {<NEW_LINE>if (credential instanceof PasswordCredential) {<NEW_LINE>PasswordCredential passwordCredential = (PasswordCredential) credential;<NEW_LINE>return verifyAccount(id, passwordCredential.getPassword());<NEW_LINE>} else {<NEW_LINE>LOG.fine("Verification of '" + id + "' failed, no password credentials found, but: " + credential);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Account verify(Credential credential) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | singletonMap("silent", "true"))); |
930,190 | protected void encodeMessage(ResponseWriter writer, Messages uiMessages, FacesMessage message, String styleClassPrefix, boolean escape) throws IOException {<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.writeAttribute("role", "alert", null);<NEW_LINE>writer.writeAttribute(HTML.ARIA_ATOMIC, "true", null);<NEW_LINE>String summary = message.getSummary() != null ? message.getSummary() : "";<NEW_LINE>String detail = message.getDetail() != null ? message.getDetail() : summary;<NEW_LINE>if (uiMessages.isSkipDetailIfEqualsSummary() && Objects.equals(summary, detail)) {<NEW_LINE>detail = "";<NEW_LINE>}<NEW_LINE>if (uiMessages.isShowSummary()) {<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", styleClassPrefix + "-summary", null);<NEW_LINE>if (escape) {<NEW_LINE>writer.writeText(summary, null);<NEW_LINE>} else {<NEW_LINE>writer.write(summary);<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>if (uiMessages.isShowDetail()) {<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute(<MASK><NEW_LINE>if (escape) {<NEW_LINE>writer.writeText(detail, null);<NEW_LINE>} else {<NEW_LINE>writer.write(detail);<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>writer.endElement("li");<NEW_LINE>} | "class", styleClassPrefix + "-detail", null); |
832,755 | private void addHttp1Handlers(ChannelPipeline p) {<NEW_LINE>p.addLast(ChannelPipelineCustomizer.HANDLER_HTTP_CLIENT_CODEC, new HttpClientCodec());<NEW_LINE>p.addLast(ChannelPipelineCustomizer<MASK><NEW_LINE>int maxContentLength = configuration.getMaxContentLength();<NEW_LINE>if (!stream) {<NEW_LINE>p.addLast(ChannelPipelineCustomizer.HANDLER_HTTP_AGGREGATOR, new HttpObjectAggregator(maxContentLength) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void finishAggregation(FullHttpMessage aggregated) throws Exception {<NEW_LINE>if (!HttpUtil.isContentLengthSet(aggregated)) {<NEW_LINE>if (aggregated.content().readableBytes() > 0) {<NEW_LINE>super.finishAggregation(aggregated);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>addEventStreamHandlerIfNecessary(p);<NEW_LINE>addFinalHandler(p);<NEW_LINE>for (ChannelPipelineListener pipelineListener : pipelineListeners) {<NEW_LINE>pipelineListener.onConnect(p);<NEW_LINE>}<NEW_LINE>} | .HANDLER_HTTP_DECODER, new HttpContentDecompressor()); |
1,255,323 | public ImmutableSet<BPartnerId> retrieveBPartnerIdsBy(@NonNull final BPartnerQuery query) {<NEW_LINE>final IQueryBuilder<I_C_BPartner> queryBuilder = createQueryBuilder(I_C_BPartner.class);<NEW_LINE>if (!query.getOnlyOrgIds().isEmpty()) {<NEW_LINE>queryBuilder.addInArrayFilter(I_C_BPartner.COLUMNNAME_AD_Org_ID, query.getOnlyOrgIds());<NEW_LINE>}<NEW_LINE>if (query.getBPartnerId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_C_BPartner_ID, query.getBPartnerId());<NEW_LINE>}<NEW_LINE>// ..BPartner external-id<NEW_LINE>if (query.getExternalId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_ExternalId, query.getExternalId().getValue());<NEW_LINE>}<NEW_LINE>// ..BPartner code (aka value)<NEW_LINE>if (!isEmpty(query.getBpartnerValue(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_Value, query.getBpartnerValue());<NEW_LINE>}<NEW_LINE>// ..BPartner Name<NEW_LINE>if (!isEmpty(query.getBpartnerName(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_Name, query.getBpartnerName());<NEW_LINE>}<NEW_LINE>// BPLocation's GLN<NEW_LINE>if (!query.getGlns().isEmpty()) {<NEW_LINE>final ImmutableSet<BPartnerId> bpartnerIdsForGLN = glnsLoadingCache.getBPartnerIds(toGLNQuery(query));<NEW_LINE>if (bpartnerIdsForGLN.isEmpty()) {<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}<NEW_LINE>queryBuilder.<MASK><NEW_LINE>}<NEW_LINE>// UserSalesRepSet<NEW_LINE>if (BooleanUtils.isTrue(query.getUserSalesRepSet())) {<NEW_LINE>queryBuilder.addNotEqualsFilter(I_C_BPartner.COLUMNNAME_SalesRep_ID, null);<NEW_LINE>} else if (BooleanUtils.isFalse(query.getUserSalesRepSet())) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_SalesRep_ID, null);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Execute<NEW_LINE>final ImmutableSet<BPartnerId> bpartnerIds = queryBuilder.create().listIds(BPartnerId::ofRepoId);<NEW_LINE>if (bpartnerIds.isEmpty() && query.isFailIfNotExists()) {<NEW_LINE>throw new AdempiereException("@NotFound@ @C_BPartner_ID@").setParameter("query", query);<NEW_LINE>}<NEW_LINE>return bpartnerIds;<NEW_LINE>} | addInArrayFilter(I_C_BPartner.COLUMN_C_BPartner_ID, bpartnerIdsForGLN); |
117,810 | private void teleport(final IUser teleportee, final ITarget target, final Trade chargeFor, final TeleportCause cause) throws Exception {<NEW_LINE>double delay = ess.getSettings().getTeleportDelay();<NEW_LINE>final TeleportWarmupEvent event = new TeleportWarmupEvent(teleportee, cause, target, delay);<NEW_LINE>Bukkit.getServer().getPluginManager().callEvent(event);<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>delay = event.getDelay();<NEW_LINE>Trade cashCharge = chargeFor;<NEW_LINE>if (chargeFor != null) {<NEW_LINE>chargeFor.isAffordableFor(teleportOwner);<NEW_LINE>// This code is to make sure that commandcosts are checked in the initial world, and not in the resulting world.<NEW_LINE>if (!chargeFor.getCommandCost(teleportOwner).equals(BigDecimal.ZERO)) {<NEW_LINE>// By converting a command cost to a regular cost, the command cost permission isn't checked when executing the charge after teleport.<NEW_LINE>cashCharge = new Trade(chargeFor.getCommandCost(teleportOwner), ess);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cooldown(true);<NEW_LINE>if (delay <= 0 || teleportOwner.isAuthorized("essentials.teleport.timer.bypass") || teleportee.isAuthorized("essentials.teleport.timer.bypass")) {<NEW_LINE>cooldown(false);<NEW_LINE>now(teleportee, target, cause);<NEW_LINE>if (cashCharge != null) {<NEW_LINE>cashCharge.charge(teleportOwner);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>cancel(false);<NEW_LINE>warnUser(teleportee, delay);<NEW_LINE>initTimer((long) (delay * 1000.0), teleportee, <MASK><NEW_LINE>} | target, cashCharge, cause, false); |
1,244,527 | private void assertEqualsAndHashCodeRelyOnSameFields(boolean equalsChanged, boolean hashCodeChanged, T reference, T changed, String fieldName) {<NEW_LINE>if (equalsChanged != hashCodeChanged) {<NEW_LINE>boolean skipEqualsHasMoreThanHashCodeTest = warningsToSuppress.contains(Warning.STRICT_HASHCODE) || skipCertainTestsThatDontMatterWhenValuesAreNull;<NEW_LINE>if (!skipEqualsHasMoreThanHashCodeTest) {<NEW_LINE>Formatter formatter = Formatter.of("Significant fields: equals relies on %%, but hashCode does not." + "\n %% has hashCode %%\n %% has hashCode %%", fieldName, reference, reference.hashCode(), <MASK><NEW_LINE>assertFalse(formatter, equalsChanged);<NEW_LINE>}<NEW_LINE>Formatter formatter = Formatter.of("Significant fields: hashCode relies on %%, but equals does not.\n" + "These objects are equal, but probably shouldn't be:\n %%\nand\n %%", fieldName, reference, changed);<NEW_LINE>assertFalse(formatter, hashCodeChanged);<NEW_LINE>}<NEW_LINE>} | changed, changed.hashCode()); |
932,633 | public void saveLatestSystemStateVersion(DatabaseContext databaseContext, int version) throws InterruptedException {<NEW_LINE>fleetControllerContext.log(logger, Level.FINE, () -> "Checking if latest system state version has been updated and need to be stored.");<NEW_LINE>// Schedule a write if one of the following is true:<NEW_LINE>// - There is already a pending vote to be written, that may have been written already without our knowledge<NEW_LINE>// - We don't know what is actually stored now<NEW_LINE>// - The value is different from the value we know is stored.<NEW_LINE>if (pendingStore.lastSystemStateVersion != null || currentlyStored.lastSystemStateVersion == null || currentlyStored.lastSystemStateVersion != version) {<NEW_LINE>fleetControllerContext.log(logger, Level.FINE, (<MASK><NEW_LINE>pendingStore.lastSystemStateVersion = version;<NEW_LINE>doNextZooKeeperTask(databaseContext);<NEW_LINE>}<NEW_LINE>} | ) -> "Scheduling new last system state version " + version + " to be stored in zookeeper."); |
424,549 | public void annotate(Annotation annotation) {<NEW_LINE>if (verbose) {<NEW_LINE>Redwood.log(Redwood.DBG, "Adding TokensRegexAnnotator annotation...");<NEW_LINE>}<NEW_LINE>if (options.setTokenOffsets) {<NEW_LINE>addTokenOffsets(annotation);<NEW_LINE>}<NEW_LINE>// just do nothing if no extractor is specified<NEW_LINE>if (extractor != null) {<NEW_LINE>List<CoreMap> allMatched;<NEW_LINE>if (annotation.containsKey(CoreAnnotations.SentencesAnnotation.class)) {<NEW_LINE>allMatched = new ArrayList<>();<NEW_LINE>List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>List<CoreMap> matched = extract(sentence);<NEW_LINE>if (matched != null && options.matchedExpressionsAnnotationKey != null) {<NEW_LINE>allMatched.addAll(matched);<NEW_LINE>sentence.set(options.matchedExpressionsAnnotationKey, matched);<NEW_LINE>for (CoreMap cm : matched) {<NEW_LINE>cm.set(CoreAnnotations.SentenceIndexAnnotation.class, sentence.get(CoreAnnotations.SentenceIndexAnnotation.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>allMatched = extract(annotation);<NEW_LINE>}<NEW_LINE>if (options.matchedExpressionsAnnotationKey != null) {<NEW_LINE>annotation.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (verbose) {<NEW_LINE>Redwood.log(Redwood.DBG, "done.");<NEW_LINE>}<NEW_LINE>} | set(options.matchedExpressionsAnnotationKey, allMatched); |
1,734,495 | private String initialize() {<NEW_LINE>int defaultRefresh = GlobalPreferences.sharedInstance<MASK><NEW_LINE>processor = getTimer();<NEW_LINE>heapTimer = new Timer(defaultRefresh, new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>heapRefresher.refresh();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>heapRefresher = new Refresher() {<NEW_LINE><NEW_LINE>public final boolean checkRefresh() {<NEW_LINE>if (!heapTimer.isRunning())<NEW_LINE>return false;<NEW_LINE>return heapView.isShowing();<NEW_LINE>}<NEW_LINE><NEW_LINE>public final void doRefresh() {<NEW_LINE>if (heapView.isShowing()) {<NEW_LINE>doRefreshImpl(heapTimer, heapView);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public final void setRefreshRate(int refreshRate) {<NEW_LINE>heapTimer.setDelay(refreshRate);<NEW_LINE>heapTimer.setInitialDelay(refreshRate);<NEW_LINE>heapTimer.restart();<NEW_LINE>}<NEW_LINE><NEW_LINE>public final int getRefreshRate() {<NEW_LINE>return heapTimer.getDelay();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return null;<NEW_LINE>} | ().getMonitoredDataPoll() * 1000; |
1,645,255 | public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {<NEW_LINE>Constant cst = this.left.optimizedBooleanConstant();<NEW_LINE>boolean isLeftOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;<NEW_LINE>boolean isLeftOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;<NEW_LINE>if (isLeftOptimizedTrue) {<NEW_LINE>// TRUE && anything<NEW_LINE>// need to be careful of scenario:<NEW_LINE>// (x && y) && !z, if passing the left info to the right, it would<NEW_LINE>// be swapped by the !<NEW_LINE>FlowInfo mergedInfo = this.left.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();<NEW_LINE>mergedInfo = this.right.analyseCode(currentScope, flowContext, mergedInfo);<NEW_LINE>this.mergedInitStateIndex = currentScope.<MASK><NEW_LINE>return mergedInfo;<NEW_LINE>}<NEW_LINE>FlowInfo leftInfo = this.left.analyseCode(currentScope, flowContext, flowInfo);<NEW_LINE>if ((flowContext.tagBits & FlowContext.INSIDE_NEGATION) != 0)<NEW_LINE>flowContext.expireNullCheckedFieldInfo();<NEW_LINE>// need to be careful of scenario:<NEW_LINE>// (x && y) && !z, if passing the left info to the right, it would be<NEW_LINE>// swapped by the !<NEW_LINE>FlowInfo rightInfo = leftInfo.initsWhenTrue().unconditionalCopy();<NEW_LINE>this.rightInitStateIndex = currentScope.methodScope().recordInitializationStates(rightInfo);<NEW_LINE>int previousMode = rightInfo.reachMode();<NEW_LINE>if (isLeftOptimizedFalse) {<NEW_LINE>if ((rightInfo.reachMode() & FlowInfo.UNREACHABLE) == 0) {<NEW_LINE>currentScope.problemReporter().fakeReachable(this.right);<NEW_LINE>rightInfo.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rightInfo = this.right.analyseCode(currentScope, flowContext, rightInfo);<NEW_LINE>if ((flowContext.tagBits & FlowContext.INSIDE_NEGATION) != 0)<NEW_LINE>flowContext.expireNullCheckedFieldInfo();<NEW_LINE>this.left.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);<NEW_LINE>this.right.checkNPEbyUnboxing(currentScope, flowContext, leftInfo.initsWhenTrue());<NEW_LINE>FlowInfo mergedInfo = FlowInfo.conditional(rightInfo.safeInitsWhenTrue(), leftInfo.initsWhenFalse().unconditionalInits().mergedWith(rightInfo.initsWhenFalse().setReachMode(previousMode).unconditionalInits()));<NEW_LINE>// reset after trueMergedInfo got extracted<NEW_LINE>this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);<NEW_LINE>return mergedInfo;<NEW_LINE>} | methodScope().recordInitializationStates(mergedInfo); |
349,913 | public static String toStringHadoopFileStatus(FileStatus fs) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("HadoopFileStatus: Path: ").append(fs.getPath());<NEW_LINE>sb.append(" , Length: ").append(fs.getLen());<NEW_LINE>// Use isDir instead of isDirectory for compatibility with hadoop 1.<NEW_LINE>sb.append(" , IsDir: ").append(fs.isDir());<NEW_LINE>sb.append(" , BlockReplication: ").append(fs.getReplication());<NEW_LINE>sb.append(" , BlockSize: ").<MASK><NEW_LINE>sb.append(" , ModificationTime: ").append(fs.getModificationTime());<NEW_LINE>sb.append(" , AccessTime: ").append(fs.getAccessTime());<NEW_LINE>sb.append(" , Permission: ").append(fs.getPermission());<NEW_LINE>sb.append(" , Owner: ").append(fs.getOwner());<NEW_LINE>sb.append(" , Group: ").append(fs.getGroup());<NEW_LINE>return sb.toString();<NEW_LINE>} | append(fs.getBlockSize()); |
113,197 | boolean match(Matcher matcher, int i, CharSequence seq) {<NEW_LINE>int savedFrom = matcher.from;<NEW_LINE>boolean conditionMatched = false;<NEW_LINE>int startIndex = (!matcher.transparentBounds) ? matcher.from : 0;<NEW_LINE>int from = Math.max(i - rmax, startIndex);<NEW_LINE>// Set end boundary<NEW_LINE>int savedLBT = matcher.lookbehindTo;<NEW_LINE>matcher.lookbehindTo = i;<NEW_LINE>// Relax transparent region boundaries for lookbehind<NEW_LINE>if (matcher.transparentBounds)<NEW_LINE>matcher.from = 0;<NEW_LINE>for (int j = i - rmin; !conditionMatched && j >= from; j--) {<NEW_LINE>conditionMatched = cond.match(matcher, j, seq);<NEW_LINE>}<NEW_LINE>matcher.from = savedFrom;<NEW_LINE>matcher.lookbehindTo = savedLBT;<NEW_LINE>return conditionMatched && next.<MASK><NEW_LINE>} | match(matcher, i, seq); |
1,155,168 | public // snippet-start:[s3.java1.s3_encrypt.kms_authenticated_encryption]<NEW_LINE>void authenticatedEncryption_KmsManagedKey() throws NoSuchAlgorithmException {<NEW_LINE>// snippet-start:[s3.java1.s3_encrypt.kms_authenticated_encryption_builder]<NEW_LINE>AmazonS3Encryption s3Encryption = // Can either be Key ID or alias (prefixed with 'alias/')<NEW_LINE>AmazonS3EncryptionClientBuilder.standard().withRegion(Regions.US_WEST_2).withCryptoConfiguration(new CryptoConfiguration(CryptoMode.AuthenticatedEncryption).withAwsKmsRegion(Region.getRegion(Regions.US_WEST_2))).withEncryptionMaterials(new KMSEncryptionMaterialsProvider<MASK><NEW_LINE>AmazonS3 s3NonEncrypt = AmazonS3ClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build();<NEW_LINE>// snippet-end:[s3.java1.s3_encrypt.kms_authenticated_encryption_builder]<NEW_LINE>// snippet-start:[s3.java1.s3_encrypt.kms_authenticated_encryption_put_object]<NEW_LINE>s3Encryption.putObject(BUCKET_NAME, ENCRYPTED_KEY, "some contents");<NEW_LINE>s3NonEncrypt.putObject(BUCKET_NAME, NON_ENCRYPTED_KEY, "some other contents");<NEW_LINE>System.out.println(s3Encryption.getObjectAsString(BUCKET_NAME, ENCRYPTED_KEY));<NEW_LINE>System.out.println(s3Encryption.getObjectAsString(BUCKET_NAME, NON_ENCRYPTED_KEY));<NEW_LINE>// snippet-end:[s3.java1.s3_encrypt.kms_authenticated_encryption_put_object]<NEW_LINE>} | ("alias/s3-kms-key")).build(); |
1,809,374 | public static void main(String[] args) throws IOException {<NEW_LINE>Exchange krakenExchange = KrakenExampleUtils.createTestExchange();<NEW_LINE>KrakenAccountServiceRaw rawKrakenAcctService = (KrakenAccountServiceRaw) krakenExchange.getAccountService();<NEW_LINE>KrakenTradeBalanceInfo balanceInfo = rawKrakenAcctService.getKrakenTradeBalance();<NEW_LINE>System.out.println(balanceInfo);<NEW_LINE>Map<String, KrakenLedger> ledgerInfo = rawKrakenAcctService.getKrakenLedgerInfo();<NEW_LINE>System.out.println(ledgerInfo);<NEW_LINE>KrakenTradeVolume tradeVolume = rawKrakenAcctService.getTradeVolume();<NEW_LINE>System.out.println(tradeVolume);<NEW_LINE>tradeVolume = rawKrakenAcctService.getTradeVolume(CurrencyPair.BTC_USD);<NEW_LINE><MASK><NEW_LINE>} | System.out.println(tradeVolume); |
215,303 | public void incLiveness(final String userId, final String field) {<NEW_LINE>Stopwatchs.start("Inc liveness");<NEW_LINE>final String date = DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd");<NEW_LINE>try {<NEW_LINE>JSONObject liveness = livenessRepository.getByUserAndDate(userId, date);<NEW_LINE>if (null == liveness) {<NEW_LINE>liveness = new JSONObject();<NEW_LINE>liveness.put(Liveness.LIVENESS_USER_ID, userId);<NEW_LINE>liveness.put(Liveness.LIVENESS_DATE, date);<NEW_LINE>liveness.put(Liveness.LIVENESS_POINT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ACTIVITY, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ARTICLE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_COMMENT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_PV, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_REWARD, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_THANK, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_VOTE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_VOTE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ACCEPT_ANSWER, 0);<NEW_LINE>livenessRepository.add(liveness);<NEW_LINE>}<NEW_LINE>liveness.put(field, liveness.optInt(field) + 1);<NEW_LINE>livenessRepository.update(liveness.optString<MASK><NEW_LINE>} catch (final RepositoryException e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Updates a liveness [" + date + "] field [" + field + "] failed", e);<NEW_LINE>} finally {<NEW_LINE>Stopwatchs.end();<NEW_LINE>}<NEW_LINE>} | (Keys.OBJECT_ID), liveness); |
172,862 | public void widgetSelected(SelectionEvent event) {<NEW_LINE>final TableItem[] selection = buddy_table.getSelection();<NEW_LINE>UIInputReceiver prompter = ui_instance.getInputReceiver();<NEW_LINE>prompter.setLocalisedTitle(lu.getLocalisedMessageText("azbuddy.ui.menu.send"));<NEW_LINE>prompter.setLocalisedMessage(lu.getLocalisedMessageText("azbuddy.ui.menu.send_msg"));<NEW_LINE>try {<NEW_LINE>prompter.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver prompter) {<NEW_LINE>String text = prompter.getSubmittedInput();<NEW_LINE>if (text != null) {<NEW_LINE>for (int i = 0; i < selection.length; i++) {<NEW_LINE>BuddyPluginBuddy buddy = (BuddyPluginBuddy) selection[i].getData();<NEW_LINE>buddy.getPluginNetwork().getAZ2Handler(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>} | ).sendAZ2Message(buddy, text); |
1,550,634 | private static void testAnnotationInjectedEMF(final EntityManagerFactory emf, final String testqualifier) throws Throwable {<NEW_LINE>System.out.println(EYECATCHER + " Starting testAnnotationInjectedEMF_" + testqualifier + "...");<NEW_LINE>EntityManager em = null;<NEW_LINE>try {<NEW_LINE>em = emf.createEntityManager();<NEW_LINE>System.out.println(EYECATCHER + "em=" + em);<NEW_LINE>if (em == null) {<NEW_LINE>fail(" em is null");<NEW_LINE>}<NEW_LINE>System.out.println(EYECATCHER + " Beginning transaction ...");<NEW_LINE>em<MASK><NEW_LINE>System.out.println(EYECATCHER + " Creating new AppClientEntity ...");<NEW_LINE>final AppClientEntity newEntity = new AppClientEntity();<NEW_LINE>newEntity.setStrData("Simple String");<NEW_LINE>em.persist(newEntity);<NEW_LINE>System.out.println(EYECATCHER + " Commmitting transaction ...");<NEW_LINE>em.getTransaction().commit();<NEW_LINE>em.clear();<NEW_LINE>final AppClientEntity findEntity = em.find(AppClientEntity.class, newEntity.getId());<NEW_LINE>if (findEntity == null) {<NEW_LINE>fail(" em.find() returned null.");<NEW_LINE>}<NEW_LINE>boolean entityIsEnhanced = verifyClassEnhancement(findEntity);<NEW_LINE>if (entityIsEnhanced) {<NEW_LINE>System.out.println(EYECATCHER + " Entity AppClientEntity is enhanced.");<NEW_LINE>} else {<NEW_LINE>fail(" Entity AppClientEntity is not enhanced.");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>System.out.println(FAIL_EYECATCHER + " Caught unexpected Exception " + t.toString());<NEW_LINE>t.printStackTrace();<NEW_LINE>throw t;<NEW_LINE>} finally {<NEW_LINE>System.out.println(EYECATCHER + " Exiting testAnnotationInjectedEMF_" + testqualifier + " ...");<NEW_LINE>if (em != null) {<NEW_LINE>em.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getTransaction().begin(); |
1,054,071 | public static void main(String[] argv) throws Exception {<NEW_LINE>if (argv.length < 1) {<NEW_LINE>System.err.println("Usage: " + JUnitJarRunner.class.getName() + " [-textui|-swingui]" + " <test suite jar file> [<classpath with code to test>]");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String how = "-textui";<NEW_LINE>int arg = 0;<NEW_LINE>if (argv[arg].startsWith("-")) {<NEW_LINE>how = argv[arg++];<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>JUnitJarRunner runner = new JUnitJarRunner(jarFileName);<NEW_LINE>if (arg < argv.length) {<NEW_LINE>runner.setClassPath(argv[arg++]);<NEW_LINE>}<NEW_LINE>TestSuite suite = runner.buildTestSuite();<NEW_LINE>runner.run(suite, how);<NEW_LINE>} | String jarFileName = argv[arg++]; |
318,574 | private List<SingleRangePartitionDesc> buildNumberTypePartition(Map<String, String> properties) throws AnalysisException {<NEW_LINE>if (this.getTimeUnit() != null) {<NEW_LINE>throw new AnalysisException("Batch build partition EVERY is date type " + "but START or END does not type match.");<NEW_LINE>}<NEW_LINE>long beginNum, endNum;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>endNum = Long.parseLong(partitionEnd);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new AnalysisException("Batch build partition EVERY is number type " + "but START or END does not type match.");<NEW_LINE>}<NEW_LINE>if (beginNum >= endNum) {<NEW_LINE>throw new AnalysisException("Batch build partition start value should less then end value.");<NEW_LINE>}<NEW_LINE>Long step = this.getStep();<NEW_LINE>List<SingleRangePartitionDesc> singleRangePartitionDescs = Lists.newArrayList();<NEW_LINE>long currentLoopNum = 0;<NEW_LINE>long maxAllowedLimit = Config.max_partitions_in_one_batch;<NEW_LINE>while (beginNum < endNum) {<NEW_LINE>String partitionName = DEFAULT_PREFIX + beginNum;<NEW_LINE>PartitionValue lowerPartitionValue = new PartitionValue(Long.toString(beginNum));<NEW_LINE>beginNum += step;<NEW_LINE>PartitionValue upperPartitionValue = new PartitionValue(Long.toString(beginNum));<NEW_LINE>PartitionKeyDesc partitionKeyDesc = new PartitionKeyDesc(Lists.newArrayList(lowerPartitionValue), Lists.newArrayList(upperPartitionValue));<NEW_LINE>SingleRangePartitionDesc singleRangePartitionDesc = new SingleRangePartitionDesc(false, partitionName, partitionKeyDesc, properties);<NEW_LINE>singleRangePartitionDescs.add(singleRangePartitionDesc);<NEW_LINE>currentLoopNum++;<NEW_LINE>if (currentLoopNum > maxAllowedLimit) {<NEW_LINE>throw new AnalysisException("The number of batch partitions should not exceed:" + maxAllowedLimit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return singleRangePartitionDescs;<NEW_LINE>} | beginNum = Long.parseLong(partitionBegin); |
154,359 | public static void partialReduceFloatMin(float[] inputArray, float[] outputArray, int gidx) {<NEW_LINE>int localIdx = PTXIntrinsics.get_local_id(0);<NEW_LINE>int localGroupSize = PTXIntrinsics.get_local_size(0);<NEW_LINE>int groupID = PTXIntrinsics.get_group_id(0);<NEW_LINE>float[] localArray = (float[]) NewArrayNode.newUninitializedArray(float.class, LOCAL_WORK_GROUP_SIZE);<NEW_LINE>localArray[localIdx] = inputArray[gidx];<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>PTXIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] = TornadoMath.min(localArray[localIdx]<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>PTXIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID + 1] = localArray[0];<NEW_LINE>}<NEW_LINE>} | , localArray[localIdx + stride]); |
940,211 | TruffleString utf32TranscodeUTF16(AbstractTruffleString a, Object arrayA, int codePointLengthA, int codeRangeA, @SuppressWarnings("unused") int targetEncoding, @Cached @Shared("iteratorNextNode") TruffleStringIterator.NextNode iteratorNextNode) {<NEW_LINE>assert containsAstralCodePoint(a, arrayA, codeRangeA);<NEW_LINE>TruffleStringIterator it = AbstractTruffleString.forwardIterator(a, arrayA, codeRangeA);<NEW_LINE>byte[] buffer <MASK><NEW_LINE>int length = 0;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>writeToByteArray(buffer, 2, length++, iteratorNextNode.execute(it));<NEW_LINE>TStringConstants.truffleSafePointPoll(this, length);<NEW_LINE>}<NEW_LINE>assert length == codePointLengthA;<NEW_LINE>boolean isBroken = isBrokenMultiByte(codeRangeA);<NEW_LINE>return create(a, buffer, length, 2, Encodings.getUTF32(), codePointLengthA, isBroken ? TSCodeRange.getBrokenFixedWidth() : TSCodeRange.getValidFixedWidth(), isBroken);<NEW_LINE>} | = new byte[codePointLengthA << 2]; |
1,005,803 | private static void defineRealBody(SkinnyMethodAdapter mv, final String pathName, final String simpleName, final Class[] paramTypes, final Class returnType, final int baseIndex, final int cacheIndex, final Set<String> nameSet) {<NEW_LINE>final int rubyIndex = baseIndex + 1;<NEW_LINE>mv.line(5);<NEW_LINE>// prepare temp locals<NEW_LINE>mv.aload(0);<NEW_LINE>mv.invokeinterface(p(IRubyObject.class), "getRuntime"<MASK><NEW_LINE>mv.astore(rubyIndex);<NEW_LINE>// get method from cache<NEW_LINE>mv.getstatic(pathName, "$runtimeCache", ci(RuntimeCache.class));<NEW_LINE>mv.aload(0);<NEW_LINE>mv.ldc(cacheIndex);<NEW_LINE>for (String eachName : nameSet) {<NEW_LINE>mv.ldc(eachName);<NEW_LINE>}<NEW_LINE>mv.invokevirtual(p(RuntimeCache.class), "searchWithCache", sig(DynamicMethod.class, params(IRubyObject.class, int.class, String.class, nameSet.size())));<NEW_LINE>// get current context<NEW_LINE>mv.aload(rubyIndex);<NEW_LINE>mv.invokevirtual(p(Ruby.class), "getCurrentContext", sig(ThreadContext.class));<NEW_LINE>// load self, class, and name<NEW_LINE>mv.aloadMany(0, 0);<NEW_LINE>mv.invokeinterface(p(IRubyObject.class), "getMetaClass", sig(RubyClass.class));<NEW_LINE>mv.ldc(simpleName);<NEW_LINE>// coerce arguments<NEW_LINE>coerceArgumentsToRuby(mv, paramTypes, rubyIndex);<NEW_LINE>// load null block<NEW_LINE>mv.getstatic(p(Block.class), "NULL_BLOCK", ci(Block.class));<NEW_LINE>// invoke method<NEW_LINE>mv.line(13);<NEW_LINE>mv.invokevirtual(p(DynamicMethod.class), "call", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class, RubyModule.class, String.class, IRubyObject[].class, Block.class));<NEW_LINE>coerceResultAndReturn(mv, returnType);<NEW_LINE>} | , sig(Ruby.class)); |
610,444 | private Predicate toFilterPredicate(EffectivePerson effectivePerson, Business business, Wi wi) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Message.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Message> root = cq.from(Message.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (StringUtils.isNotEmpty(wi.getPerson())) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(Message_.person), wi.getPerson()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(wi.getType())) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(Message_.type), wi.getType()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(wi.getConsume())) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(Message_.consumer), wi.getConsume()));<NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getStartTime())) {<NEW_LINE>p = cb.and(p, cb.greaterThan(root.get(Message_.createTime), DateTools.parse(<MASK><NEW_LINE>}<NEW_LINE>if (DateTools.isDateTimeOrDate(wi.getEndTime())) {<NEW_LINE>p = cb.and(p, cb.lessThan(root.get(Message_.createTime), DateTools.parse(wi.getEndTime())));<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>} | wi.getStartTime()))); |
1,031,403 | private static void patchLombokizeAST(ScriptManager sm) {<NEW_LINE>sm.addScript(ScriptBuilder.addField().targetClass("org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration").fieldName("$lombokAST").fieldType("Ljava/lang/Object;").setPublic().setTransient().build());<NEW_LINE>final String PARSER_SIG = "org.eclipse.jdt.internal.compiler.parser.Parser";<NEW_LINE>final String CUD_SIG = "org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration";<NEW_LINE>final String OBJECT_SIG = "java.lang.Object";<NEW_LINE>sm.addScript(ScriptBuilder.wrapReturnValue().target(new MethodTarget(PARSER_SIG, "getMethodBodies", "void", CUD_SIG)).wrapMethod(new Hook("lombok.launch.PatchFixesHider$Transform", "transform", "void", OBJECT_SIG, OBJECT_SIG)).request(StackRequest.THIS, StackRequest<MASK><NEW_LINE>sm.addScript(ScriptBuilder.wrapReturnValue().target(new MethodTarget(PARSER_SIG, "endParse", CUD_SIG, "int")).wrapMethod(new Hook("lombok.launch.PatchFixesHider$Transform", "transform_swapped", "void", OBJECT_SIG, OBJECT_SIG)).request(StackRequest.THIS, StackRequest.RETURN_VALUE).build());<NEW_LINE>} | .PARAM1).build()); |
1,480,264 | public void loadScript(File script, boolean fireEvent, List<String> loadPaths) {<NEW_LINE>if (script == null) {<NEW_LINE>ScriptLogger.logError(Messages.BundleManager_Executed_Null_Script);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!script.canRead()) {<NEW_LINE>ScriptLogger.logError(MessageFormat.format(Messages.BundleManager_UNREADABLE_SCRIPT<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.showBundleLoadInfo(MessageFormat.format("Loading script: {0}, fire event={1}", script, fireEvent));<NEW_LINE>getScriptingEngine().runScript(script.getAbsolutePath(), loadPaths);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.showBundleLoadInfo(MessageFormat.format("Loading complete: {0}", script));<NEW_LINE>if (fireEvent) {<NEW_LINE>this.fireScriptLoadedEvent(script);<NEW_LINE>}<NEW_LINE>} | , script.getAbsolutePath())); |
1,036,155 | public <T extends TransformParameters> void registerTransform(Class<? extends TransformAction<T>> actionType, Action<? super TransformSpec<T>> registrationAction) {<NEW_LINE>try {<NEW_LINE>Class<T> parameterType = isolationScheme.parameterTypeFor(actionType);<NEW_LINE>T parameterObject = parameterType == null ? null : parametersInstantiationScheme.withServices(services).instantiator().newInstance(parameterType);<NEW_LINE>TypedRegistration<T> registration = Cast.uncheckedNonnullCast(instantiatorFactory.decorateLenient().newInstance(TypedRegistration.class, parameterObject, immutableAttributesFactory));<NEW_LINE>registrationAction.execute(registration);<NEW_LINE><MASK><NEW_LINE>} catch (VariantTransformConfigurationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>TreeFormatter formatter = new TreeFormatter();<NEW_LINE>formatter.node("Could not register artifact transform ");<NEW_LINE>formatter.appendType(actionType);<NEW_LINE>formatter.append(".");<NEW_LINE>throw new VariantTransformConfigurationException(formatter.toString(), e);<NEW_LINE>}<NEW_LINE>} | register(registration, actionType, parameterObject); |
964,321 | private static void registerUnsignedMathPlugins(InvocationPlugins plugins) {<NEW_LINE>Registration r = new Registration(plugins, UnsignedMath.class);<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.AT, "aboveThan", int.class, int.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.AT, "aboveThan", long.class, long.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.BT, "belowThan", int.class, int.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.BT, "belowThan", long.class, long.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.AE, "aboveOrEqual", int.class, int.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.AE, "aboveOrEqual", long<MASK><NEW_LINE>r.register(new UnsignedMathPlugin(Condition.BE, "belowOrEqual", int.class, int.class));<NEW_LINE>r.register(new UnsignedMathPlugin(Condition.BE, "belowOrEqual", long.class, long.class));<NEW_LINE>} | .class, long.class)); |
1,407,226 | public static DescribeFabricChannelMembersResponse unmarshall(DescribeFabricChannelMembersResponse describeFabricChannelMembersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricChannelMembersResponse.setRequestId(_ctx.stringValue("DescribeFabricChannelMembersResponse.RequestId"));<NEW_LINE>describeFabricChannelMembersResponse.setSuccess(_ctx.booleanValue("DescribeFabricChannelMembersResponse.Success"));<NEW_LINE>describeFabricChannelMembersResponse.setErrorCode(_ctx.integerValue("DescribeFabricChannelMembersResponse.ErrorCode"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricChannelMembersResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setWithPeer(_ctx.booleanValue<MASK><NEW_LINE>resultItem.setAcceptTime(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].AcceptTime"));<NEW_LINE>resultItem.setOrganizationDomain(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].OrganizationDomain"));<NEW_LINE>resultItem.setState(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].State"));<NEW_LINE>resultItem.setInviteTime(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].InviteTime"));<NEW_LINE>resultItem.setChannelId(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].ChannelId"));<NEW_LINE>resultItem.setOrganizationName(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].OrganizationName"));<NEW_LINE>resultItem.setOrganizationDescription(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].OrganizationDescription"));<NEW_LINE>resultItem.setOrganizationId(_ctx.stringValue("DescribeFabricChannelMembersResponse.Result[" + i + "].OrganizationId"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeFabricChannelMembersResponse.setResult(result);<NEW_LINE>return describeFabricChannelMembersResponse;<NEW_LINE>} | ("DescribeFabricChannelMembersResponse.Result[" + i + "].WithPeer")); |
1,187,106 | private void updateData() {<NEW_LINE>data.setPackageName(comPackageName.getEditor().getItem().toString());<NEW_LINE>String icon = txtIcon.getText().trim();<NEW_LINE>data.setIcon(icon.length() == 0 ? (String) null : icon);<NEW_LINE>data.setName(txtPrefix.getText().trim());<NEW_LINE>HTMLIterator.generateFileChanges(data);<NEW_LINE>createdFilesValue.setText(WizardUtils.generateTextAreaContent(data.getCreatedModifiedFiles<MASK><NEW_LINE>modifiedFilesValue.setText(WizardUtils.generateTextAreaContent(data.getCreatedModifiedFiles().getModifiedPaths()));<NEW_LINE>// #68294 check if the paths for newly created files are valid or not..<NEW_LINE>String[] invalid = data.getCreatedModifiedFiles().getInvalidPaths();<NEW_LINE>if (invalid.length > 0) {<NEW_LINE>setError(NbBundle.getMessage(NameAndLocationPanel.class, "ERR_ToBeCreateFileExists", invalid[0]));<NEW_LINE>}<NEW_LINE>} | ().getCreatedPaths())); |
553,049 | public void loginAsync(long accountId, String passwordTemp, long providerId, boolean retry) {<NEW_LINE>mAccountId = accountId;<NEW_LINE>mPassword = passwordTemp;<NEW_LINE>mProviderId = providerId;<NEW_LINE>mRetryLogin = retry;<NEW_LINE>ContentResolver contentResolver = mContext.getContentResolver();<NEW_LINE>if (mPassword == null)<NEW_LINE>mPassword = Imps.Account.getPassword(contentResolver, mAccountId);<NEW_LINE>mIsGoogleAuth = mPassword.startsWith(GTalkOAuth2.NAME);<NEW_LINE>if (mIsGoogleAuth) {<NEW_LINE>mPassword = mPassword.split(":")[1];<NEW_LINE>}<NEW_LINE>Cursor cursor = contentResolver.query(Imps.ProviderSettings.CONTENT_URI, new String[] { Imps.ProviderSettings.NAME, Imps.ProviderSettings.VALUE }, Imps.ProviderSettings.PROVIDER + "=?", new String[] { Long.toString(mProviderId) }, null);<NEW_LINE>if (cursor == null)<NEW_LINE>return;<NEW_LINE>Imps.ProviderSettings.QueryMap providerSettings = new Imps.ProviderSettings.QueryMap(cursor, <MASK><NEW_LINE>mUser = makeUser(providerSettings, contentResolver);<NEW_LINE>providerSettings.close();<NEW_LINE>execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>do_login();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | contentResolver, mProviderId, false, null); |
128,444 | private final void drawLineOrPoints(boolean xIsDescription, Double[][] values, int sourceAxisPos, int valueAxisPos, Double valueSegment, int descSegment, List<String> colors, boolean line) {<NEW_LINE>Theme currentTheme = ThemeFactory.getCurrentTheme();<NEW_LINE>int cIndex = 0;<NEW_LINE>for (int valueIndex = 0; valueIndex < values.length; valueIndex++) {<NEW_LINE>Double[] vArray = values[valueIndex];<NEW_LINE>int actualValPos;<NEW_LINE>int lineIterator = valueAxisPos + descSegment / 2;<NEW_LINE>List<Point> points = new ArrayList<Point>();<NEW_LINE>for (Double v : vArray) {<NEW_LINE>actualValPos = (int) calculateValuePos(v, valueSegment);<NEW_LINE>if (xIsDescription) {<NEW_LINE>points.add(new Point(lineIterator, sourceAxisPos - actualValPos));<NEW_LINE>} else {<NEW_LINE>points.add(new Point(sourceAxisPos + actualValPos, lineIterator));<NEW_LINE>}<NEW_LINE>lineIterator += descSegment;<NEW_LINE>}<NEW_LINE>if (cIndex >= colors.size()) {<NEW_LINE>// Restart with first color if all colors in the array has been used<NEW_LINE>cIndex = 0;<NEW_LINE>}<NEW_LINE>base.setForegroundColor(currentTheme.forStringOrNull(colors.get(cIndex), Transparency.FOREGROUND));<NEW_LINE>base.setBackgroundColor(currentTheme.forStringOrNull(colors.get(cIndex), Transparency.FOREGROUND));<NEW_LINE>if (line) {<NEW_LINE>for (int i = 0; i < points.size() - 1; i++) {<NEW_LINE>Point point1 = points.get(i);<NEW_LINE>Point point2 = <MASK><NEW_LINE>base.drawLine(point1.x, point1.y, point2.x, point2.y);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Point point : points) {<NEW_LINE>base.drawCircle(point.x, point.y, 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// print titleCol<NEW_LINE>base.setForegroundColor(currentTheme.forStringOrNull(colors.get(cIndex), Transparency.FOREGROUND).darken(75));<NEW_LINE>base.print(title[valueIndex], points.get(points.size() - 1).x, points.get(points.size() - 1).y, AlignHorizontal.CENTER);<NEW_LINE>cIndex++;<NEW_LINE>}<NEW_LINE>base.resetColorSettings();<NEW_LINE>} | points.get(i + 1); |
542,217 | private ConfigCenterConfig registryAsConfigCenter(RegistryConfig registryConfig) {<NEW_LINE>String protocol = registryConfig.getProtocol();<NEW_LINE>Integer port = registryConfig.getPort();<NEW_LINE>URL url = URL.valueOf(registryConfig.getAddress(), registryConfig.getScopeModel());<NEW_LINE>String id = "config-center-" + protocol + "-" + url.getHost() + "-" + port;<NEW_LINE>ConfigCenterConfig cc = new ConfigCenterConfig();<NEW_LINE>cc.setId(id);<NEW_LINE>cc.setScopeModel(applicationModel);<NEW_LINE>if (cc.getParameters() == null) {<NEW_LINE>cc.setParameters(new HashMap<>());<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isNotEmptyMap(registryConfig.getParameters())) {<NEW_LINE>// copy the parameters<NEW_LINE>cc.getParameters().putAll(registryConfig.getParameters());<NEW_LINE>}<NEW_LINE>cc.getParameters().put(CLIENT_KEY, registryConfig.getClient());<NEW_LINE>cc.setProtocol(protocol);<NEW_LINE>cc.setPort(port);<NEW_LINE>if (StringUtils.isNotEmpty(registryConfig.getGroup())) {<NEW_LINE>cc.setGroup(registryConfig.getGroup());<NEW_LINE>}<NEW_LINE>cc.setAddress(getRegistryCompatibleAddress(registryConfig));<NEW_LINE>cc.setNamespace(registryConfig.getGroup());<NEW_LINE>cc.setUsername(registryConfig.getUsername());<NEW_LINE>cc.<MASK><NEW_LINE>if (registryConfig.getTimeout() != null) {<NEW_LINE>cc.setTimeout(registryConfig.getTimeout().longValue());<NEW_LINE>}<NEW_LINE>cc.setHighestPriority(false);<NEW_LINE>return cc;<NEW_LINE>} | setPassword(registryConfig.getPassword()); |
1,331,472 | public static GrayU8 localMean(GrayF32 input, GrayU8 output, ConfigLength width, float scale, boolean down, GrayF32 storage1, GrayF32 storage2, @Nullable GrowArray<DogArray_F32> storage3) {<NEW_LINE>int radius = width.computeI(Math.min(input.width, input.height)) / 2;<NEW_LINE>GrayF32 mean = storage1;<NEW_LINE>BlurImageOps.mean(input, mean, radius, storage2, storage3);<NEW_LINE>if (down) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexIn = input.startIndex + y * input.stride;<NEW_LINE>int indexOut = output.startIndex + y * output.stride;<NEW_LINE>int indexMean = mean.startIndex + y * mean.stride;<NEW_LINE>int end = indexIn + input.width;<NEW_LINE>while (indexIn < end) {<NEW_LINE>float threshold = (mean.data[indexMean++]) * scale;<NEW_LINE>output.data[indexOut++] = (input.data[indexIn++]) <= threshold ? (byte) 1 : 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexIn = input.startIndex + y * input.stride;<NEW_LINE>int indexOut = output.startIndex + y * output.stride;<NEW_LINE>int indexMean = mean.startIndex + y * mean.stride;<NEW_LINE>int end = indexIn + input.width;<NEW_LINE>while (indexIn < end) {<NEW_LINE>float threshold = (mean.data[indexMean++]);<NEW_LINE>output.data[indexOut++] = (input.data[indexIn++]) * scale > <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | threshold ? (byte) 1 : 0; |
450,284 | private void loadContent() {<NEW_LINE>if (content == null) {<NEW_LINE>throw new NullPointerException("The content is accessed after the zip file is closed: " + path());<NEW_LINE>}<NEW_LINE>if (contentLoaded) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>contentLoaded = true;<NEW_LINE>// We support both gzip and unzipped files when reading.<NEW_LINE>try (ZipInputStream zis = new ZipInputStream(delegate.asInputStream())) {<NEW_LINE>for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()) {<NEW_LINE>// we only support flat ZIP files<NEW_LINE>if (entry.isDirectory()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>zis.transferTo(buf);<NEW_LINE>byte[] bArray = buf.toByteArray();<NEW_LINE>content.add(new ByteArrayDataSource(entry.getName() + " (" + path() + ")", entry.getName(), type(), bArray.length, entry.getLastModifiedTime().toMillis(), false).withBytes(bArray));<NEW_LINE>}<NEW_LINE>} catch (ZipException ex) {<NEW_LINE>throw new RuntimeException("Can not read zip file " + path() + ": " + ex.getLocalizedMessage(), ex);<NEW_LINE>} catch (IOException ie) {<NEW_LINE>throw new RuntimeException("Failed to load " + path() + ": " + ie.getLocalizedMessage(), ie);<NEW_LINE>}<NEW_LINE>} | ByteArrayOutputStream buf = new ByteArrayOutputStream(4048); |
449,038 | public Parent createContent() {<NEW_LINE>xAxis = new NumberAxis(0, 24, 3);<NEW_LINE>final NumberAxis yAxis = new NumberAxis(0, 100, 10);<NEW_LINE>chart = new LineChart<>(xAxis, yAxis);<NEW_LINE>// setup chart<NEW_LINE>final String stockLineChartCss = getClass().getResource("StockLineChart.css").toExternalForm();<NEW_LINE>chart.getStylesheets().add(stockLineChartCss);<NEW_LINE>chart.setCreateSymbols(false);<NEW_LINE>chart.setAnimated(false);<NEW_LINE>chart.setLegendVisible(false);<NEW_LINE>chart.setTitle("ACME Company Stock");<NEW_LINE>xAxis.setLabel("Time");<NEW_LINE>xAxis.setForceZeroInRange(false);<NEW_LINE>yAxis.setLabel("Share Price");<NEW_LINE>yAxis.setTickLabelFormatter(new DefaultFormatter(yAxis, "$", null));<NEW_LINE>// add starting data<NEW_LINE>hourDataSeries = new Series<>();<NEW_LINE>hourDataSeries.setName("Hourly Data");<NEW_LINE><MASK><NEW_LINE>minuteDataSeries.setName("Minute Data");<NEW_LINE>// create some starting data<NEW_LINE>hourDataSeries.getData().add(new Data<Number, Number>(timeInHours, prevY));<NEW_LINE>minuteDataSeries.getData().add(new Data<Number, Number>(timeInHours, prevY));<NEW_LINE>for (double m = 0; m < (60); m++) {<NEW_LINE>nextTime();<NEW_LINE>plotTime();<NEW_LINE>}<NEW_LINE>chart.getData().add(minuteDataSeries);<NEW_LINE>chart.getData().add(hourDataSeries);<NEW_LINE>return chart;<NEW_LINE>} | minuteDataSeries = new Series<>(); |
1,312,869 | private void exportSites(final Path target) throws FrameworkException {<NEW_LINE>logger.info("Exporting sites");<NEW_LINE>final List<Map<String, Object>> sites = new LinkedList<>();<NEW_LINE>final App app = StructrApp.getInstance();<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>for (final Site site : app.nodeQuery(Site.class).sort(Site.name).getAsList()) {<NEW_LINE>final Map<String, Object> entry = new TreeMap<>();<NEW_LINE>sites.add(entry);<NEW_LINE>entry.put("id", site.getProperty(Site.id));<NEW_LINE>entry.put("name", site.getName());<NEW_LINE>entry.put("hostname", site.getHostname());<NEW_LINE>entry.put("port", site.getPort());<NEW_LINE>entry.put("visibleToAuthenticatedUsers", site.getProperty(Site.visibleToAuthenticatedUsers));<NEW_LINE>entry.put("visibleToPublicUsers", site.getProperty(Site.visibleToPublicUsers));<NEW_LINE>final List<String> pageNames = new LinkedList<>();<NEW_LINE>for (final Page page : (Iterable<Page>) site.getProperty(StructrApp.key(Site.class, "pages"))) {<NEW_LINE>pageNames.add(page.getName());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>exportOwnershipAndSecurity(site, entry);<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>}<NEW_LINE>writeJsonToFile(target, sites);<NEW_LINE>} | entry.put("pages", pageNames); |
813,481 | protected Map<String, String> extractExternalSystemParameters(@NonNull final ExternalSystemParentConfig externalSystemParentConfig) {<NEW_LINE>final ExternalSystemWooCommerceConfig woocommerceConfig = ExternalSystemWooCommerceConfig.<MASK><NEW_LINE>if (EmptyUtil.isEmpty(woocommerceConfig.getCamelHttpResourceAuthKey())) {<NEW_LINE>throw new AdempiereException("camelHttpResourceAuthKey for childConfig should not be empty at this point").appendParametersToMessage().setParameter("childConfigId", woocommerceConfig.getId());<NEW_LINE>}<NEW_LINE>final Map<String, String> parameters = new HashMap<>();<NEW_LINE>parameters.put(PARAM_CAMEL_HTTP_RESOURCE_AUTH_KEY, woocommerceConfig.getCamelHttpResourceAuthKey());<NEW_LINE>parameters.put(PARAM_CHILD_CONFIG_VALUE, woocommerceConfig.getValue());<NEW_LINE>return parameters;<NEW_LINE>} | cast(externalSystemParentConfig.getChildConfig()); |
13,788 | public void attach(@NonNull final String mode, @NonNull final ClusteredIndexables ci) {<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("mode", mode);<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("ci", ci);<NEW_LINE>if (TransientUpdateSupport.isTransientUpdate()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (DELETE.equals(mode)) {<NEW_LINE>ensureNotReBound(this.deleteIndexables, ci);<NEW_LINE>if (!ci.equals(this.deleteIndexables)) {<NEW_LINE>this.deleteIndexables = ci;<NEW_LINE>attachDeleteStackTrace = Pair.<Long, StackTraceElement[]>of(System.nanoTime(), Thread.<MASK><NEW_LINE>detachDeleteStackTrace = null;<NEW_LINE>}<NEW_LINE>} else if (INDEX.equals(mode)) {<NEW_LINE>ensureNotReBound(this.indexIndexables, ci);<NEW_LINE>if (!ci.equals(this.indexIndexables)) {<NEW_LINE>this.indexIndexables = ci;<NEW_LINE>attachIndexStackTrace = Pair.<Long, StackTraceElement[]>of(System.nanoTime(), Thread.currentThread().getStackTrace());<NEW_LINE>detachIndexStackTrace = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(mode);<NEW_LINE>}<NEW_LINE>} | currentThread().getStackTrace()); |
1,379,396 | public String treeString() {<NEW_LINE>Function<Object, String> toString = obj -> {<NEW_LINE>if (obj instanceof Group) {<NEW_LINE>return obj.toString();<NEW_LINE>} else if (obj instanceof GroupExpression) {<NEW_LINE>return ((GroupExpression) obj).getPlan().toString();<NEW_LINE>} else if (obj instanceof Pair) {<NEW_LINE>// print logicalExpressions or physicalExpressions<NEW_LINE>// first is name, second is group expressions<NEW_LINE>return ((Pair<?, ?>) obj).first.toString();<NEW_LINE>} else {<NEW_LINE>return obj.toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Function<Object, List<Object>> getChildren = obj -> {<NEW_LINE>if (obj instanceof Group) {<NEW_LINE>Group group = (Group) obj;<NEW_LINE>List children = new ArrayList<>();<NEW_LINE>// to <name, children> pair<NEW_LINE>if (!group.getLogicalExpressions().isEmpty()) {<NEW_LINE>children.add(Pair.of("logicalExpressions", group.getLogicalExpressions()));<NEW_LINE>}<NEW_LINE>if (!group.getPhysicalExpressions().isEmpty()) {<NEW_LINE>children.add(Pair.of("physicalExpressions", group.getLogicalExpressions()));<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>} else if (obj instanceof GroupExpression) {<NEW_LINE>return (List) ((GroupExpression) obj).children();<NEW_LINE>} else if (obj instanceof Pair) {<NEW_LINE>return (List) ((Pair<String, List<<MASK><NEW_LINE>} else {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return TreeStringUtils.treeString(this, toString, getChildren);<NEW_LINE>} | GroupExpression>>) obj).second; |
1,581,391 | public Result create(UUID customerUUID) throws IOException {<NEW_LINE>JsonNode requestBody = request().body().asJson();<NEW_LINE>Provider reqProvider = formFactory.getFormDataOrBadRequest(requestBody, Provider.class);<NEW_LINE>Customer customer = Customer.getOrBadRequest(customerUUID);<NEW_LINE>reqProvider.customerUUID = customerUUID;<NEW_LINE>CloudType providerCode = CloudType.valueOf(reqProvider.code);<NEW_LINE>Provider providerEbean;<NEW_LINE>if (providerCode.equals(CloudType.kubernetes)) {<NEW_LINE>providerEbean = cloudProviderHandler.createKubernetesNew(customer, reqProvider);<NEW_LINE>} else {<NEW_LINE>providerEbean = cloudProviderHandler.createProvider(customer, providerCode, reqProvider.name, reqProvider.getUnmaskedConfig<MASK><NEW_LINE>}<NEW_LINE>if (providerCode.isRequiresBootstrap()) {<NEW_LINE>UUID taskUUID = null;<NEW_LINE>try {<NEW_LINE>CloudBootstrap.Params taskParams = CloudBootstrap.Params.fromProvider(reqProvider);<NEW_LINE>taskUUID = cloudProviderHandler.bootstrap(customer, providerEbean, taskParams);<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.CloudProvider, Objects.toString(providerEbean.uuid, null), Audit.ActionType.Create, requestBody, taskUUID);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.warn("Bootstrap failed. Deleting provider");<NEW_LINE>providerEbean.delete();<NEW_LINE>Throwables.propagate(e);<NEW_LINE>}<NEW_LINE>return new YBPTask(taskUUID, providerEbean.uuid).asResult();<NEW_LINE>} else {<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.CloudProvider, Objects.toString(providerEbean.uuid, null), Audit.ActionType.Create, requestBody, null);<NEW_LINE>return new YBPTask(null, providerEbean.uuid).asResult();<NEW_LINE>}<NEW_LINE>} | (), getFirstRegionCode(reqProvider)); |
1,241,603 | public void processReInvite(ServerTransaction serverTransaction) {<NEW_LINE>Request invite = serverTransaction.getRequest();<NEW_LINE>setLatestInviteTransaction(serverTransaction);<NEW_LINE>// SDP description may be in ACKs - bug report Laurent Michel<NEW_LINE>String sdpOffer = null;<NEW_LINE>ContentLengthHeader cl = invite.getContentLength();<NEW_LINE>if (cl != null && cl.getContentLength() > 0)<NEW_LINE>sdpOffer = SdpUtils.getContentAsString(invite);<NEW_LINE>Response response = null;<NEW_LINE>try {<NEW_LINE>response = messageFactory.createResponse(Response.OK, invite);<NEW_LINE>processExtraHeaders(response);<NEW_LINE>String sdpAnswer;<NEW_LINE>if (sdpOffer != null)<NEW_LINE>sdpAnswer = <MASK><NEW_LINE>else<NEW_LINE>sdpAnswer = getMediaHandler().createOffer();<NEW_LINE>response.setContent(sdpAnswer, getProtocolProvider().getHeaderFactory().createContentTypeHeader("application", "sdp"));<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("will send an OK response: " + response);<NEW_LINE>serverTransaction.sendResponse(response);<NEW_LINE>if (logger.isDebugEnabled())<NEW_LINE>logger.debug("OK response sent");<NEW_LINE>} catch (// no need to distinguish among exceptions.<NEW_LINE>Exception ex) {<NEW_LINE>logger.error("Error while trying to send a response", ex);<NEW_LINE>setState(CallPeerState.FAILED, "Internal Error: " + ex.getMessage());<NEW_LINE>getProtocolProvider().sayErrorSilently(serverTransaction, Response.SERVER_INTERNAL_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>reevalRemoteHoldStatus();<NEW_LINE>fireRequestProcessed(invite, response);<NEW_LINE>} | getMediaHandler().processOffer(sdpOffer); |
654,448 | public void translate(Properties ctx) {<NEW_LINE>if (m_originalString == null)<NEW_LINE>return;<NEW_LINE>String inText = Msg.parseTranslation(ctx, m_originalString);<NEW_LINE>// log.fine( "StringElement.translate", inText);<NEW_LINE>String[] lines = Pattern.compile("$", Pattern.MULTILINE).split(inText);<NEW_LINE>m_string_paper <MASK><NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>String line = Util.removeCRLF(lines[i]);<NEW_LINE>m_string_paper[i] = new AttributedString(line);<NEW_LINE>if (line.length() > 0) {<NEW_LINE>m_string_paper[i].addAttribute(TextAttribute.FONT, m_font);<NEW_LINE>m_string_paper[i].addAttribute(TextAttribute.FOREGROUND, m_paint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m_string_view = m_string_paper;<NEW_LINE>} | = new AttributedString[lines.length]; |
1,395,697 | RangeMap<Integer, Range<Integer>> parsePartitions(final List<? extends Number> gqPartitions) {<NEW_LINE>Utils.nonEmpty(gqPartitions);<NEW_LINE>Utils.containsNoNull(gqPartitions, "The list of GQ partitions contains a null integer");<NEW_LINE>final RangeMap<Integer, Range<Integer>> result = TreeRangeMap.create();<NEW_LINE>int lastThreshold = 0;<NEW_LINE>for (final Number num : gqPartitions) {<NEW_LINE>final int value = num.intValue();<NEW_LINE>if (value < 0) {<NEW_LINE>throw new IllegalArgumentException("The list of GQ partitions contains a non-positive integer.");<NEW_LINE>} else if (value > MAX_GENOTYPE_QUAL + 1) {<NEW_LINE>throw new IllegalArgumentException(String.format("The value %d in the list of GQ partitions is greater than VCFConstants.MAX_GENOTYPE_QUAL + 1 = %d.", value, MAX_GENOTYPE_QUAL + 1));<NEW_LINE>} else if (value < lastThreshold) {<NEW_LINE>throw new IllegalArgumentException(String.format("The list of GQ partitions is out of order. Previous value is %d but the next is %d.", lastThreshold, value));<NEW_LINE>} else if (value == lastThreshold) {<NEW_LINE>throw new IllegalArgumentException(String.format("The value %d appears more than once in the list of GQ partitions.", value));<NEW_LINE>}<NEW_LINE>result.put(Range.closedOpen(lastThreshold, value), Range.closedOpen(lastThreshold, value));<NEW_LINE>lastThreshold = value;<NEW_LINE>}<NEW_LINE>if (lastThreshold <= MAX_GENOTYPE_QUAL) {<NEW_LINE>result.put(Range.closedOpen(lastThreshold, MAX_GENOTYPE_QUAL + 1), Range.closedOpen<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (lastThreshold, MAX_GENOTYPE_QUAL + 1)); |
221,411 | static ByteBuf encodeFirstFragment(ByteBufAllocator allocator, int mtu, long initialRequestN, FrameType frameType, int streamId, boolean hasMetadata, ByteBuf metadata, ByteBuf data) {<NEW_LINE>// subtract the header bytes + frame length bytes + initial requestN bytes<NEW_LINE>int remaining = mtu - FRAME_OFFSET_WITH_INITIAL_REQUEST_N;<NEW_LINE>ByteBuf metadataFragment = hasMetadata ? Unpooled.EMPTY_BUFFER : null;<NEW_LINE>if (hasMetadata) {<NEW_LINE>// subtract the metadata frame length<NEW_LINE>remaining -= FrameLengthCodec.FRAME_LENGTH_SIZE;<NEW_LINE>if (metadata.isReadable()) {<NEW_LINE>int r = Math.min(remaining, metadata.readableBytes());<NEW_LINE>remaining -= r;<NEW_LINE>metadataFragment = metadata.readRetainedSlice(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ByteBuf dataFragment = Unpooled.EMPTY_BUFFER;<NEW_LINE>try {<NEW_LINE>if (remaining > 0 && data.isReadable()) {<NEW_LINE>int r = Math.min(remaining, data.readableBytes());<NEW_LINE>dataFragment = data.readRetainedSlice(r);<NEW_LINE>}<NEW_LINE>} catch (IllegalReferenceCountException | NullPointerException e) {<NEW_LINE>if (metadataFragment != null) {<NEW_LINE>metadataFragment.release();<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>switch(frameType) {<NEW_LINE>// Requester Side<NEW_LINE>case REQUEST_STREAM:<NEW_LINE>return RequestStreamFrameCodec.encode(allocator, streamId, <MASK><NEW_LINE>case REQUEST_CHANNEL:<NEW_LINE>return RequestChannelFrameCodec.encode(allocator, streamId, true, false, initialRequestN, metadataFragment, dataFragment);<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("unsupported fragment type: " + frameType);<NEW_LINE>}<NEW_LINE>} | true, initialRequestN, metadataFragment, dataFragment); |
1,143,684 | private void atWhileStmnt(Stmnt st, boolean notDo) throws CompileError {<NEW_LINE>List<Integer> prevBreakList = breakList;<NEW_LINE>List<Integer> prevContList = continueList;<NEW_LINE>breakList = new ArrayList<Integer>();<NEW_LINE>continueList = new ArrayList<Integer>();<NEW_LINE>ASTree expr = st.head();<NEW_LINE>Stmnt body = (Stmnt) st.tail();<NEW_LINE>int pc = 0;<NEW_LINE>if (notDo) {<NEW_LINE>bytecode.addOpcode(Opcode.GOTO);<NEW_LINE>pc = bytecode.currentPc();<NEW_LINE>bytecode.addIndex(0);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (body != null)<NEW_LINE>body.accept(this);<NEW_LINE>int pc3 = bytecode.currentPc();<NEW_LINE>if (notDo)<NEW_LINE>bytecode.write16bit(pc, pc3 - pc + 1);<NEW_LINE>boolean alwaysBranch = compileBooleanExpr(true, expr);<NEW_LINE>if (alwaysBranch) {<NEW_LINE>bytecode.addOpcode(Opcode.GOTO);<NEW_LINE>alwaysBranch = breakList.size() == 0;<NEW_LINE>}<NEW_LINE>bytecode.addIndex(pc2 - bytecode.currentPc() + 1);<NEW_LINE>patchGoto(breakList, bytecode.currentPc());<NEW_LINE>patchGoto(continueList, pc3);<NEW_LINE>continueList = prevContList;<NEW_LINE>breakList = prevBreakList;<NEW_LINE>hasReturned = alwaysBranch;<NEW_LINE>} | int pc2 = bytecode.currentPc(); |
1,809,265 | private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {<NEW_LINE>byte[] sa = src.array();<NEW_LINE>int sp = src.arrayOffset() + src.position();<NEW_LINE>int sl = src.arrayOffset() + src.limit();<NEW_LINE>assert (sp <= sl);<NEW_LINE>sp = (sp <= sl ? sp : sl);<NEW_LINE>char[] da = dst.array();<NEW_LINE>int dp = dst.arrayOffset() + dst.position();<NEW_LINE>int dl = dst.arrayOffset() + dst.limit();<NEW_LINE>assert (dp <= dl);<NEW_LINE>dp = (dp <= dl ? dp : dl);<NEW_LINE>try {<NEW_LINE>while (sp < sl) {<NEW_LINE>byte b = sa[sp];<NEW_LINE>if (dp >= dl)<NEW_LINE>return CoderResult.OVERFLOW;<NEW_LINE>da[dp++] = (char) (b & 0xff);<NEW_LINE>sp++;<NEW_LINE>}<NEW_LINE>return CoderResult.UNDERFLOW;<NEW_LINE>} finally {<NEW_LINE>src.position(<MASK><NEW_LINE>dst.position(dp - dst.arrayOffset());<NEW_LINE>}<NEW_LINE>} | sp - src.arrayOffset()); |
461,058 | final CopyPackageVersionsResult executeCopyPackageVersions(CopyPackageVersionsRequest copyPackageVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(copyPackageVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CopyPackageVersionsRequest> request = null;<NEW_LINE>Response<CopyPackageVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CopyPackageVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(copyPackageVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CopyPackageVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CopyPackageVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CopyPackageVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,557,945 | public void render(final Tag parent) {<NEW_LINE>final Map<String, List<Setting>> mapped = new LinkedHashMap<>();<NEW_LINE>final List<Setting> otherSettings = new LinkedList<>();<NEW_LINE>final Tag div = parent.block("div");<NEW_LINE>// sort / categorize settings<NEW_LINE>for (final Setting setting : settings) {<NEW_LINE>final String group = setting.getCategory();<NEW_LINE>// ignore hidden settings<NEW_LINE>if ("hidden".equals(group)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (group != null) {<NEW_LINE>List<Setting> list = mapped.get(group);<NEW_LINE>if (list == null) {<NEW_LINE>list = new LinkedList<>();<NEW_LINE>mapped.put(group, list);<NEW_LINE>}<NEW_LINE>list.add(setting);<NEW_LINE>} else {<NEW_LINE>otherSettings.add(setting);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// display grouped settings<NEW_LINE>for (final Entry<String, List<Setting>> entry : mapped.entrySet()) {<NEW_LINE>final String name = entry.getKey();<NEW_LINE>final Tag groupContainer = div.block<MASK><NEW_LINE>groupContainer.block("h1").text(name);<NEW_LINE>for (final Setting setting : entry.getValue()) {<NEW_LINE>setting.render(groupContainer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// display settings w/o group<NEW_LINE>if (!otherSettings.isEmpty()) {<NEW_LINE>final Tag groupContainer = div.block("div").css("config-group");<NEW_LINE>// display title only if other groups exist<NEW_LINE>if (!mapped.isEmpty()) {<NEW_LINE>groupContainer.block("h1").text("Custom");<NEW_LINE>}<NEW_LINE>otherSettings.stream().sorted(Comparator.comparing(Setting::getKey)).forEach((Setting setting) -> setting.render(groupContainer));<NEW_LINE>}<NEW_LINE>} | ("div").css("config-group"); |
977,434 | public EvaluationResult evaluate(Bean bean, CalculationFunctions functions, String firstToken, List<String> remainingTokens) {<NEW_LINE>Optional<String> propertyName = bean.propertyNames().stream().filter(p -> p.equalsIgnoreCase<MASK><NEW_LINE>if (propertyName.isPresent()) {<NEW_LINE>Object propertyValue = bean.property(propertyName.get()).get();<NEW_LINE>return propertyValue != null ? EvaluationResult.success(propertyValue, remainingTokens) : EvaluationResult.failure("No value available for property '{}'", firstToken);<NEW_LINE>}<NEW_LINE>// The bean has a single property which doesn't match the token.<NEW_LINE>// Return the property value without consuming any tokens.<NEW_LINE>// This allows skipping over properties when the bean only has a single property.<NEW_LINE>if (bean.propertyNames().size() == 1) {<NEW_LINE>String singlePropertyName = Iterables.getOnlyElement(bean.propertyNames());<NEW_LINE>Object propertyValue = bean.property(singlePropertyName).get();<NEW_LINE>List<String> tokens = ImmutableList.<String>builder().add(firstToken).addAll(remainingTokens).build();<NEW_LINE>return propertyValue != null ? EvaluationResult.success(propertyValue, tokens) : EvaluationResult.failure("No value available for property '{}'", firstToken);<NEW_LINE>}<NEW_LINE>return invalidTokenFailure(bean, firstToken);<NEW_LINE>} | (firstToken)).findFirst(); |
843,412 | private SegmentsAndCommitMetadata pushAndClear(Collection<String> sequenceNames, long pushAndClearTimeoutMs) throws InterruptedException, ExecutionException, TimeoutException {<NEW_LINE>final Set<SegmentIdWithShardSpec> requestedSegmentIdsForSequences = getAppendingSegments(sequenceNames);<NEW_LINE>final ListenableFuture<SegmentsAndCommitMetadata> future = Futures.transform(pushInBackground(null, requestedSegmentIdsForSequences, false), (AsyncFunction<SegmentsAndCommitMetadata, SegmentsAndCommitMetadata>) this::dropInBackground);<NEW_LINE>final SegmentsAndCommitMetadata segmentsAndCommitMetadata = pushAndClearTimeoutMs == 0L ? future.get() : future.get(pushAndClearTimeoutMs, TimeUnit.MILLISECONDS);<NEW_LINE>// Sanity check<NEW_LINE>final Map<SegmentIdWithShardSpec, DataSegment> pushedSegmentIdToSegmentMap = segmentsAndCommitMetadata.getSegments().stream().collect(Collectors.toMap(SegmentIdWithShardSpec::fromDataSegment, Function.identity()));<NEW_LINE>if (!pushedSegmentIdToSegmentMap.keySet().equals(requestedSegmentIdsForSequences)) {<NEW_LINE>throw new ISE("Pushed segments[%s] are different from the requested ones[%s]", pushedSegmentIdToSegmentMap.keySet(), requestedSegmentIdsForSequences);<NEW_LINE>}<NEW_LINE>synchronized (segments) {<NEW_LINE>for (String sequenceName : sequenceNames) {<NEW_LINE>final SegmentsForSequence segmentsForSequence = segments.get(sequenceName);<NEW_LINE>if (segmentsForSequence == null) {<NEW_LINE>throw new ISE("Can't find segmentsForSequence for sequence[%s]", sequenceName);<NEW_LINE>}<NEW_LINE>segmentsForSequence.getAllSegmentsOfInterval().forEach(segmentsOfInterval -> {<NEW_LINE>final SegmentWithState appendingSegment = segmentsOfInterval.getAppendingSegment();<NEW_LINE>if (appendingSegment != null) {<NEW_LINE>final DataSegment pushedSegment = pushedSegmentIdToSegmentMap.get(appendingSegment.getSegmentIdentifier());<NEW_LINE>if (pushedSegment == null) {<NEW_LINE>throw new ISE(<MASK><NEW_LINE>}<NEW_LINE>segmentsOfInterval.finishAppendingToCurrentActiveSegment(segmentWithState -> segmentWithState.pushAndDrop(pushedSegment));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return segmentsAndCommitMetadata;<NEW_LINE>} | "Can't find pushedSegments for segment[%s]", appendingSegment.getSegmentIdentifier()); |
1,350,551 | final DescribeDashboardPermissionsResult executeDescribeDashboardPermissions(DescribeDashboardPermissionsRequest describeDashboardPermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDashboardPermissionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDashboardPermissionsRequest> request = null;<NEW_LINE>Response<DescribeDashboardPermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDashboardPermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDashboardPermissionsRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDashboardPermissions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDashboardPermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDashboardPermissionsResultJsonUnmarshaller());<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); |
57,303 | protected Authentication doInternalAuthenticate(LoginCredential loginCredential) {<NEW_LINE>_logger.debug("authentication " + loginCredential);<NEW_LINE>sessionValid(loginCredential.getSessionId());<NEW_LINE>// jwtTokenValid(j_jwtToken);<NEW_LINE>authTypeValid(loginCredential.getAuthType());<NEW_LINE>Institutions inst = (Institutions) WebContext.getAttribute(WebConstants.CURRENT_INST);<NEW_LINE>if (inst.getCaptcha().equalsIgnoreCase("YES")) {<NEW_LINE>captchaValid(loginCredential.getCaptcha(), loginCredential.getAuthType());<NEW_LINE>}<NEW_LINE>emptyPasswordValid(loginCredential.getPassword());<NEW_LINE>UserInfo userInfo = null;<NEW_LINE>emptyUsernameValid(loginCredential.getUsername());<NEW_LINE>userInfo = loadUserInfo(loginCredential.getUsername(), loginCredential.getPassword());<NEW_LINE>statusValid(loginCredential, userInfo);<NEW_LINE>// mfa<NEW_LINE>tftcaptchaValid(loginCredential.getOtpCaptcha(), loginCredential.getAuthType(), userInfo);<NEW_LINE>// Validate PasswordPolicy<NEW_LINE>authenticationRealm.getPasswordPolicyValidator().passwordPolicyValid(userInfo);<NEW_LINE>if (loginCredential.getAuthType().equalsIgnoreCase(AuthType.MOBILE)) {<NEW_LINE>mobilecaptchaValid(loginCredential.getPassword(), loginCredential.getAuthType(), userInfo);<NEW_LINE>} else {<NEW_LINE>// Match password<NEW_LINE>authenticationRealm.passwordMatches(userInfo, loginCredential.getPassword());<NEW_LINE>}<NEW_LINE>// apply PasswordSetType and resetBadPasswordCount<NEW_LINE>authenticationRealm.getPasswordPolicyValidator().applyPasswordPolicy(userInfo);<NEW_LINE>UsernamePasswordAuthenticationToken <MASK><NEW_LINE>// RemeberMe Config check then set RemeberMe cookies<NEW_LINE>if (applicationConfig.getLoginConfig().isRemeberMe()) {<NEW_LINE>if (loginCredential.getRemeberMe() != null && loginCredential.getRemeberMe().equals("remeberMe")) {<NEW_LINE>WebContext.getSession().setAttribute(WebConstants.REMEBER_ME_SESSION, loginCredential.getUsername());<NEW_LINE>_logger.debug("do Remeber Me");<NEW_LINE>remeberMeService.createRemeberMe(userInfo.getUsername(), WebContext.getRequest(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return authenticationToken;<NEW_LINE>} | authenticationToken = createOnlineSession(loginCredential, userInfo); |
1,835,295 | public void populateItem(final Item<SshKey> item) {<NEW_LINE>final SshKey key = item.getModelObject();<NEW_LINE>item.add(new Label("comment", key.getComment()));<NEW_LINE>item.add(new Label("fingerprint"<MASK><NEW_LINE>item.add(new Label("permission", key.getPermission().toString()));<NEW_LINE>item.add(new Label("algorithm", key.getAlgorithm()));<NEW_LINE>AjaxLink<Void> delete = new AjaxLink<Void>("delete") {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(AjaxRequestTarget target) {<NEW_LINE>if (app().keys().removeKey(user.username, key)) {<NEW_LINE>// reset the keys list<NEW_LINE>keys.clear();<NEW_LINE>keys.addAll(app().keys().getKeys(user.username));<NEW_LINE>// update the panel<NEW_LINE>target.addComponent(SshKeysPanel.this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (!canWriteKeys) {<NEW_LINE>delete.setVisibilityAllowed(false);<NEW_LINE>}<NEW_LINE>item.add(delete);<NEW_LINE>} | , key.getFingerprint())); |
875,199 | protected <T extends RemoteFile> Map<String, T> addAndFilterFilesInTransaction(Class<T> remoteFileClass, Map<String, T> remoteFiles) throws StorageException {<NEW_LINE>Map<String, T> filteredFiles = new HashMap<String, T>();<NEW_LINE>Set<TransactionTO> transactions = new HashSet<TransactionTO>();<NEW_LINE>Set<RemoteFile> dummyDeletedFiles <MASK><NEW_LINE>Set<RemoteFile> filesToIgnore = new HashSet<RemoteFile>();<NEW_LINE>// Ignore files currently listed in a transaction,<NEW_LINE>// unless we are listing transaction files<NEW_LINE>boolean ignoreFilesInTransactions = !remoteFileClass.equals(TransactionRemoteFile.class);<NEW_LINE>if (ignoreFilesInTransactions) {<NEW_LINE>transactions = retrieveRemoteTransactions().keySet();<NEW_LINE>filesToIgnore = getFilesInTransactions(transactions);<NEW_LINE>dummyDeletedFiles = getDummyDeletedFiles(transactions);<NEW_LINE>}<NEW_LINE>for (RemoteFile deletedFile : dummyDeletedFiles) {<NEW_LINE>if (deletedFile.getClass().equals(remoteFileClass)) {<NEW_LINE>T concreteDeletedFile = remoteFileClass.cast(deletedFile);<NEW_LINE>filteredFiles.put(concreteDeletedFile.getName(), concreteDeletedFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String fileName : remoteFiles.keySet()) {<NEW_LINE>if (!filesToIgnore.contains(remoteFiles.get(fileName))) {<NEW_LINE>filteredFiles.put(fileName, remoteFiles.get(fileName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredFiles;<NEW_LINE>} | = new HashSet<RemoteFile>(); |
1,490,722 | JSONObject writeItemsToJson(@NonNull JSONObject json) {<NEW_LINE>JSONArray jsonArray = new JSONArray();<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>try {<NEW_LINE>for (ITileSource template : items) {<NEW_LINE>JSONObject jsonObject = new JSONObject();<NEW_LINE>boolean sql = template instanceof SQLiteTileSource;<NEW_LINE>jsonObject.put("sql", sql);<NEW_LINE>jsonObject.put("name", template.getName());<NEW_LINE>jsonObject.put(<MASK><NEW_LINE>jsonObject.put("maxZoom", template.getMaximumZoomSupported());<NEW_LINE>jsonObject.put("url", template.getUrlTemplate());<NEW_LINE>jsonObject.put("randoms", template.getRandoms());<NEW_LINE>jsonObject.put("ellipsoid", template.isEllipticYTile());<NEW_LINE>jsonObject.put("inverted_y", template.isInvertedYTile());<NEW_LINE>jsonObject.put("referer", template.getReferer());<NEW_LINE>jsonObject.put("userAgent", template.getUserAgent());<NEW_LINE>jsonObject.put("timesupported", template.isTimeSupported());<NEW_LINE>jsonObject.put("expire", template.getExpirationTimeMinutes());<NEW_LINE>jsonObject.put("inversiveZoom", template.getInversiveZoom());<NEW_LINE>jsonObject.put("ext", template.getTileFormat());<NEW_LINE>jsonObject.put("tileSize", template.getTileSize());<NEW_LINE>jsonObject.put("bitDensity", template.getBitDensity());<NEW_LINE>jsonObject.put("avgSize", template.getAvgSize());<NEW_LINE>jsonObject.put("rule", template.getRule());<NEW_LINE>jsonArray.put(jsonObject);<NEW_LINE>}<NEW_LINE>json.put("items", jsonArray);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));<NEW_LINE>SettingsHelper.LOG.error("Failed write to json", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>} | "minZoom", template.getMinimumZoomSupported()); |
1,583,560 | private static JSDynamicObject createErrorPrototype(JSRealm realm, JSErrorType errorType) {<NEW_LINE>JSContext ctx = realm.getContext();<NEW_LINE>JSDynamicObject proto = errorType == JSErrorType.Error ? realm.getObjectPrototype() : realm.getErrorPrototype(JSErrorType.Error);<NEW_LINE>JSObject errorPrototype;<NEW_LINE>if (ctx.getEcmaScriptVersion() < 6) {<NEW_LINE>errorPrototype = JSErrorObject.create(JSShape.createPrototypeShape(ctx, INSTANCE, proto));<NEW_LINE>JSObjectUtil.setOrVerifyPrototype(ctx, errorPrototype, proto);<NEW_LINE>} else {<NEW_LINE>errorPrototype = JSObjectUtil.createOrdinaryPrototypeObject(realm, proto);<NEW_LINE>}<NEW_LINE>JSObjectUtil.putDataProperty(ctx, errorPrototype, <MASK><NEW_LINE>if (errorType == JSErrorType.Error) {<NEW_LINE>JSObjectUtil.putFunctionsFromContainer(realm, errorPrototype, ErrorPrototypeBuiltins.BUILTINS);<NEW_LINE>if (ctx.isOptionNashornCompatibilityMode()) {<NEW_LINE>JSObjectUtil.putFunctionsFromContainer(realm, errorPrototype, ErrorPrototypeBuiltins.ErrorPrototypeNashornCompatBuiltins.BUILTINS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return errorPrototype;<NEW_LINE>} | MESSAGE, Strings.EMPTY_STRING, MESSAGE_ATTRIBUTES); |
51,653 | private static String printTypeModifiers(int modifiers) {<NEW_LINE>java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();<NEW_LINE>java.io.PrintWriter print = new <MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccPublic) != 0)<NEW_LINE>print.print("public ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccPrivate) != 0)<NEW_LINE>print.print("private ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccFinal) != 0)<NEW_LINE>print.print("final ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccSuper) != 0)<NEW_LINE>print.print("super ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccInterface) != 0)<NEW_LINE>print.print("interface ");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if ((modifiers & ClassFileConstants.AccAbstract) != 0)<NEW_LINE>print.print("abstract ");<NEW_LINE>print.flush();<NEW_LINE>return out.toString();<NEW_LINE>} | java.io.PrintWriter(out); |
1,445,468 | protected TypeBinding findMethodBinding(BlockScope scope) {<NEW_LINE>ReferenceContext referenceContext = scope.methodScope().referenceContext;<NEW_LINE>if (referenceContext instanceof LambdaExpression) {<NEW_LINE>this.outerInferenceContext = ((LambdaExpression) referenceContext).inferenceContext;<NEW_LINE>}<NEW_LINE>if (this.expectedType != null && this.binding instanceof PolyParameterizedGenericMethodBinding) {<NEW_LINE>this.binding = this.solutionsPerTargetType.get(this.expectedType);<NEW_LINE>}<NEW_LINE>if (this.binding == null) {<NEW_LINE>// first look up or a "cache miss" somehow.<NEW_LINE>this.binding = this.receiver.isImplicitThis() ? scope.getImplicitMethod(this.selector, this.argumentTypes, this) : scope.getMethod(this.actualReceiverType, this.selector, this.argumentTypes, this);<NEW_LINE>if (this.binding instanceof PolyParameterizedGenericMethodBinding) {<NEW_LINE>this.solutionsPerTargetType = new <MASK><NEW_LINE>return new PolyTypeBinding(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);<NEW_LINE>return this.binding.returnType;<NEW_LINE>} | HashMap<TypeBinding, MethodBinding>(); |
463,345 | public static AsyncServerResponse create(Object o, @Nullable Duration timeout) {<NEW_LINE>Assert.notNull(o, "Argument to async must not be null");<NEW_LINE>if (o instanceof CompletableFuture) {<NEW_LINE>CompletableFuture<ServerResponse> futureResponse = (CompletableFuture<ServerResponse>) o;<NEW_LINE>return new DefaultAsyncServerResponse(futureResponse, timeout);<NEW_LINE>} else if (reactiveStreamsPresent) {<NEW_LINE>ReactiveAdapterRegistry registry = ReactiveAdapterRegistry.getSharedInstance();<NEW_LINE>ReactiveAdapter publisherAdapter = registry.getAdapter(o.getClass());<NEW_LINE>if (publisherAdapter != null) {<NEW_LINE>Publisher<ServerResponse> publisher = publisherAdapter.toPublisher(o);<NEW_LINE>ReactiveAdapter futureAdapter = registry.getAdapter(CompletableFuture.class);<NEW_LINE>if (futureAdapter != null) {<NEW_LINE>CompletableFuture<ServerResponse> futureResponse = (CompletableFuture<ServerResponse>) futureAdapter.fromPublisher(publisher);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Asynchronous type not supported: " + o.getClass());<NEW_LINE>} | return new DefaultAsyncServerResponse(futureResponse, timeout); |
1,664,849 | public void begin() throws ResourceException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "begin", new Object[] { this, ivMC });<NEW_LINE>ResourceException re;<NEW_LINE>synchronized (ivMC) {<NEW_LINE>re = ivStateManager.isValid(StateManager.LT_BEGIN);<NEW_LINE>if (re == null) {<NEW_LINE>try {<NEW_LINE>prevAutoCommit = ivMC.getAutoCommit();<NEW_LINE>ivMC.setAutoCommit(false);<NEW_LINE>} catch (SQLException sqle) {<NEW_LINE>throw new ResourceException(sqle.getMessage());<NEW_LINE>}<NEW_LINE>ivStateManager.transtate = StateManager.LOCAL_TRANSACTION_ACTIVE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (re != null) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Cannot start local transaction: " + re.getMessage());<NEW_LINE>if (// 138037<NEW_LINE>tc.isEntryEnabled())<NEW_LINE>// 138037<NEW_LINE>Tr.exit(tc, "begin", "Exception");<NEW_LINE>throw re;<NEW_LINE>}<NEW_LINE>if (tc.isEventEnabled())<NEW_LINE>Tr.event(tc, <MASK><NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "begin");<NEW_LINE>} | "SpiLocalTransaction started. ManagedConnection state is " + ivMC.getTransactionStateAsString()); |
1,065,261 | public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {<NEW_LINE>final View view = inflater.inflate(R.layout.dd_debug_drawer_module_device, parent, false);<NEW_LINE>view.setClickable(false);<NEW_LINE>view.setEnabled(false);<NEW_LINE>final TextView deviceMakeLabel = view.findViewById(R.id.dd_debug_device_make);<NEW_LINE>final TextView deviceModelLabel = view.findViewById(R.id.dd_debug_device_model);<NEW_LINE>final TextView deviceResolutionLabel = view.findViewById(R.id.dd_debug_device_resolution);<NEW_LINE>final TextView deviceDensityLabel = view.findViewById(R.id.dd_debug_device_density);<NEW_LINE>final TextView deviceReleaseLabel = view.findViewById(R.id.dd_debug_device_release);<NEW_LINE>final TextView deviceApiLabel = view.findViewById(R.id.dd_debug_device_api);<NEW_LINE>final DisplayMetrics displayMetrics = parent.getContext()<MASK><NEW_LINE>final String densityBucket = getDensityString(displayMetrics);<NEW_LINE>final String deviceMake = truncateAt(Build.MANUFACTURER, 20);<NEW_LINE>final String deviceModel = truncateAt(Build.MODEL, 20);<NEW_LINE>final String deviceResolution = displayMetrics.heightPixels + "x" + displayMetrics.widthPixels;<NEW_LINE>final String deviceDensity = displayMetrics.densityDpi + "dpi (" + densityBucket + ")";<NEW_LINE>final String deviceRelease = Build.VERSION.RELEASE;<NEW_LINE>final String deviceApi = String.valueOf(Build.VERSION.SDK_INT);<NEW_LINE>deviceModelLabel.setText(deviceModel);<NEW_LINE>deviceMakeLabel.setText(deviceMake);<NEW_LINE>deviceResolutionLabel.setText(deviceResolution);<NEW_LINE>deviceDensityLabel.setText(deviceDensity);<NEW_LINE>deviceApiLabel.setText(deviceApi);<NEW_LINE>deviceReleaseLabel.setText(deviceRelease);<NEW_LINE>return view;<NEW_LINE>} | .getResources().getDisplayMetrics(); |
85,960 | private static String validate(SyntheticMonitorConfig config) throws Exception {<NEW_LINE>if (config.getKind() == SyntheticMonitorKind.JAVA) {<NEW_LINE>// only used by central<NEW_LINE>Class<?> javaSource;<NEW_LINE>try {<NEW_LINE>javaSource = Compilations.compile(config.getJavaSource());<NEW_LINE>} catch (CompilationException e) {<NEW_LINE>return buildCompilationErrorResponse(e.getCompilationErrors());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>javaSource.getConstructor();<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>return buildCompilationErrorResponse<MASK><NEW_LINE>}<NEW_LINE>// since synthetic monitors are only used in central, this class is present<NEW_LINE>Class<?> httpClientClass = Class.forName("org.apache.http.impl.client.CloseableHttpClient");<NEW_LINE>try {<NEW_LINE>javaSource.getMethod("test", httpClientClass);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>// since synthetic monitors are only used in central, this class is present<NEW_LINE>Class<?> webDriverClass = Class.forName("org.openqa.selenium.WebDriver");<NEW_LINE>try {<NEW_LINE>javaSource.getMethod("test", webDriverClass);<NEW_LINE>} catch (NoSuchMethodException f) {<NEW_LINE>return buildCompilationErrorResponse(ImmutableList.of("Class must have a" + " \"public void test(HttpClient httpClient) { ... }\" or" + " \"public void test(WebDriver driver) { ... }\" method"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (ImmutableList.of("Class must have a public default constructor")); |
754,497 | public void listIncidentsForAlert() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listIncidentsForAlert#String-String<NEW_LINE>final String alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299";<NEW_LINE>final String alertId = "1746b031c00";<NEW_LINE>metricsAdvisorAsyncClient.listIncidentsForAlert(alertConfigurationId, alertId).subscribe(incident -> {<NEW_LINE>System.out.printf("Data Feed Metric Id: %s%n", incident.getMetricId());<NEW_LINE>System.out.printf("Detection Configuration Id: %s%n", incident.getDetectionConfigurationId());<NEW_LINE>System.out.printf("Anomaly Incident Id: %s%n", incident.getId());<NEW_LINE>System.out.printf("Anomaly Incident Start Time: %s%n", incident.getStartTime());<NEW_LINE>System.out.printf("Anomaly Incident AnomalySeverity: %s%n", incident.getSeverity());<NEW_LINE>System.out.printf("Anomaly Incident Status: %s%n", incident.getStatus());<NEW_LINE><MASK><NEW_LINE>DimensionKey rootDimension = incident.getRootDimensionKey();<NEW_LINE>for (Map.Entry<String, String> dimension : rootDimension.asMap().entrySet()) {<NEW_LINE>System.out.printf("DimensionName: %s DimensionValue:%s%n", dimension.getKey(), dimension.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listIncidentsForAlert#String-String<NEW_LINE>} | System.out.printf("Root DataFeedDimension Key:"); |
1,399,492 | private void refreshViews() {<NEW_LINE>View scrollView = findViewById(R.id.scroll_view);<NEW_LINE>if (scrollView.getVisibility() != View.VISIBLE) {<NEW_LINE>AniUtils.fadeIn(scrollView, AniUtils.Duration.MEDIUM);<NEW_LINE>}<NEW_LINE>mTitleTextView.setText(mPlugin.getDisplayName());<NEW_LINE>mImageManager.load(mImageBanner, ImageType.PHOTO, StringUtils.notNullStr(mPlugin.getBanner()), ScaleType.CENTER_CROP);<NEW_LINE>mImageManager.load(mImageIcon, ImageType.PLUGIN, StringUtils.notNullStr(mPlugin.getIcon()));<NEW_LINE>if (mPlugin.doesHaveWPOrgPluginDetails()) {<NEW_LINE>mWPOrgPluginDetailsContainer.setVisibility(View.VISIBLE);<NEW_LINE>setCollapsibleHtmlText(mDescriptionTextView, mPlugin.getDescriptionAsHtml());<NEW_LINE>setCollapsibleHtmlText(mInstallationTextView, mPlugin.getInstallationInstructionsAsHtml());<NEW_LINE>setCollapsibleHtmlText(mWhatsNewTextView, mPlugin.getWhatsNewAsHtml());<NEW_LINE>setCollapsibleHtmlText(mFaqTextView, mPlugin.getFaqAsHtml());<NEW_LINE>} else {<NEW_LINE>mWPOrgPluginDetailsContainer.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mByLineTextView.setMovementMethod(WPLinkMovementMethod.getInstance());<NEW_LINE>if (!TextUtils.isEmpty(mPlugin.getAuthorAsHtml())) {<NEW_LINE>mByLineTextView.setText(Html.fromHtml<MASK><NEW_LINE>} else {<NEW_LINE>String authorName = mPlugin.getAuthorName();<NEW_LINE>String authorUrl = mPlugin.getAuthorUrl();<NEW_LINE>if (TextUtils.isEmpty(authorUrl)) {<NEW_LINE>mByLineTextView.setText(String.format(getString(R.string.plugin_byline), authorName));<NEW_LINE>} else {<NEW_LINE>String authorLink = "<a href='" + authorUrl + "'>" + authorName + "</a>";<NEW_LINE>String byline = String.format(getString(R.string.plugin_byline), authorLink);<NEW_LINE>mByLineTextView.setMovementMethod(WPLinkMovementMethod.getInstance());<NEW_LINE>mByLineTextView.setText(Html.fromHtml(byline));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>findViewById(R.id.plugin_card_site).setVisibility(mPlugin.isInstalled() && isNotAutoManaged() ? View.VISIBLE : View.GONE);<NEW_LINE>findViewById(R.id.plugin_state_active_container).setVisibility(canPluginBeDisabledOrRemoved() ? View.VISIBLE : View.GONE);<NEW_LINE>findViewById(R.id.plugin_state_autoupdates_container).setVisibility(mSite.isAutomatedTransfer() ? View.GONE : View.VISIBLE);<NEW_LINE>mSwitchActive.setChecked(mIsActive);<NEW_LINE>mSwitchAutoupdates.setChecked(mIsAutoUpdateEnabled);<NEW_LINE>refreshPluginVersionViews();<NEW_LINE>refreshRatingsViews();<NEW_LINE>} | (mPlugin.getAuthorAsHtml())); |
85,444 | public void flush(final long targetCounter) throws IOException, JournalClosedException {<NEW_LINE>// Return if flushed.<NEW_LINE>if (targetCounter <= mFlushCounter.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Submit the ticket for flush thread to process.<NEW_LINE>FlushTicket ticket = new FlushTicket(targetCounter);<NEW_LINE>mTicketSet.add(ticket);<NEW_LINE>try {<NEW_LINE>// Give a permit for flush thread to run.<NEW_LINE>mFlushSemaphore.release();<NEW_LINE>// Wait on the ticket until completed.<NEW_LINE>ticket.waitCompleted();<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>// Interpret interruption as cancellation.<NEW_LINE>throw new AlluxioStatusException(Status.CANCELLED.withCause(ie));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// Filter, journal specific exception codes.<NEW_LINE>if (e instanceof IOException) {<NEW_LINE>throw (IOException) e;<NEW_LINE>}<NEW_LINE>if (e instanceof JournalClosedException) {<NEW_LINE>throw (JournalClosedException) e;<NEW_LINE>}<NEW_LINE>// Not expected. throw internal error.<NEW_LINE>throw new AlluxioStatusException(Status<MASK><NEW_LINE>} finally {<NEW_LINE>mFlushSemaphore.tryAcquire();<NEW_LINE>}<NEW_LINE>} | .INTERNAL.withCause(e)); |
144,240 | public void dealOutParam(String result) {<NEW_LINE>if (CollectionUtils.isEmpty(localParams)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Property> outProperty = getOutProperty(localParams);<NEW_LINE>if (CollectionUtils.isEmpty(outProperty)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(result)) {<NEW_LINE>varPool.addAll(outProperty);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Map<String, String>> sqlResult = getListMapByString(result);<NEW_LINE>if (CollectionUtils.isEmpty(sqlResult)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if sql return more than one line<NEW_LINE>if (sqlResult.size() > 1) {<NEW_LINE>Map<String, List<String>> <MASK><NEW_LINE>// init sqlResultFormat<NEW_LINE>Set<String> keySet = sqlResult.get(0).keySet();<NEW_LINE>for (String key : keySet) {<NEW_LINE>sqlResultFormat.put(key, new ArrayList<>());<NEW_LINE>}<NEW_LINE>for (Map<String, String> info : sqlResult) {<NEW_LINE>for (String key : info.keySet()) {<NEW_LINE>sqlResultFormat.get(key).add(String.valueOf(info.get(key)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Property info : outProperty) {<NEW_LINE>if (info.getType() == DataType.LIST) {<NEW_LINE>info.setValue(JSONUtils.toJsonString(sqlResultFormat.get(info.getProp())));<NEW_LINE>varPool.add(info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// result only one line<NEW_LINE>Map<String, String> firstRow = sqlResult.get(0);<NEW_LINE>for (Property info : outProperty) {<NEW_LINE>info.setValue(String.valueOf(firstRow.get(info.getProp())));<NEW_LINE>varPool.add(info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | sqlResultFormat = new HashMap<>(); |
1,436,717 | public void testOrderColumnBi(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail("OrderColumnTestLogic.testOrderColumnBi(): Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fetch JPA Resources<NEW_LINE>JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Identify the target entity type verified by this test case.<NEW_LINE>String entityTypeStr = (String) testExecCtx.getProperties().get("EntityType");<NEW_LINE>EntityType <MASK><NEW_LINE>Hashtable<String, java.io.Serializable> testData = new Hashtable<String, java.io.Serializable>(testExecCtx.getProperties());<NEW_LINE>switch(entityType) {<NEW_LINE>case Annotated:<NEW_LINE>doTestOrderColumn(jpaResource, testData, OrderColumnEntityClasses.OrderColumnEntity, BOrderNameEntity.class);<NEW_LINE>break;<NEW_LINE>case XML:<NEW_LINE>doTestOrderColumn(jpaResource, testData, OrderColumnEntityClasses.XMLOrderColumnEntity, BOrderNameXMLEntity.class);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Assert.fail("Invalid entity type specified ('" + entityType + "'). Cannot execute the test.");<NEW_LINE>}<NEW_LINE>} | entityType = EntityType.valueOf(entityTypeStr); |
1,234,650 | private T collectReduceUnordered(Function<Batch<T>, T> map, Function2<T, T, T> function2) {<NEW_LINE>LazyIterable<? extends Batch<T>> chunks = this.split();<NEW_LINE>MutableList<Callable<T>> callables = chunks.collect((Function<Batch<T>, Callable<T>>) chunk -> () -> map.valueOf(chunk)).toList();<NEW_LINE>ExecutorCompletionService<T> completionService = new ExecutorCompletionService<>(this.getExecutorService());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>T result = completionService.take().get();<NEW_LINE>int numTasks = callables.size() - 1;<NEW_LINE>while (numTasks > 0) {<NEW_LINE>T next = completionService.take().get();<NEW_LINE>if (next != null) {<NEW_LINE>if (result == null) {<NEW_LINE>result = next;<NEW_LINE>} else {<NEW_LINE>result = function2.value(result, next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>numTasks--;<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause() instanceof NullPointerException) {<NEW_LINE>throw (NullPointerException) e.getCause();<NEW_LINE>}<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | callables.each(completionService::submit); |
1,132,641 | private void paintBackgroundStack(RenderingContext c, Rectangle bounds) {<NEW_LINE>Rectangle imageContainer;<NEW_LINE>BorderPropertySet border = getStyle().getBorder(c);<NEW_LINE>TableColumn column = getTable().colElement(getCol());<NEW_LINE>if (column != null) {<NEW_LINE>c.getOutputDevice().paintBackground(c, column.getStyle(), bounds, getTable().getColumnBounds(c, getCol()), border);<NEW_LINE>}<NEW_LINE>Box row = getParent();<NEW_LINE>Box section = row.getParent();<NEW_LINE>CalculatedStyle tableStyle = getTable().getStyle();<NEW_LINE>CalculatedStyle sectionStyle = section.getStyle();<NEW_LINE><MASK><NEW_LINE>imageContainer.y += tableStyle.getBorderVSpacing(c);<NEW_LINE>imageContainer.height -= tableStyle.getBorderVSpacing(c);<NEW_LINE>imageContainer.x += tableStyle.getBorderHSpacing(c);<NEW_LINE>imageContainer.width -= 2 * tableStyle.getBorderHSpacing(c);<NEW_LINE>c.getOutputDevice().paintBackground(c, sectionStyle, bounds, imageContainer, border);<NEW_LINE>CalculatedStyle rowStyle = row.getStyle();<NEW_LINE>imageContainer = row.getPaintingBorderEdge(c);<NEW_LINE>imageContainer.x += tableStyle.getBorderHSpacing(c);<NEW_LINE>imageContainer.width -= 2 * tableStyle.getBorderHSpacing(c);<NEW_LINE>c.getOutputDevice().paintBackground(c, rowStyle, bounds, imageContainer, border);<NEW_LINE>BorderPropertySet cellBorder = _collapsedLayoutBorder != null ? _collapsedLayoutBorder : border;<NEW_LINE>c.getOutputDevice().paintBackground(c, getStyle(), bounds, getPaintingBorderEdge(c), cellBorder);<NEW_LINE>} | imageContainer = section.getPaintingBorderEdge(c); |
1,676,552 | private synchronized void init() throws IOException {<NEW_LINE>// Need the extra test, to avoid throwing an IOException from the Transcoder<NEW_LINE>if (imageInput == null) {<NEW_LINE>throw new IllegalStateException("input == null");<NEW_LINE>}<NEW_LINE>if (reader == null) {<NEW_LINE>WMFTranscoder transcoder = new WMFTranscoder();<NEW_LINE>ByteArrayOutputStream output = new ByteArrayOutputStream();<NEW_LINE>Writer writer = new OutputStreamWriter(output, "UTF8");<NEW_LINE>try {<NEW_LINE>TranscoderInput in = new TranscoderInput(IIOUtil.createStreamAdapter(imageInput));<NEW_LINE><MASK><NEW_LINE>// TODO: Transcodinghints?<NEW_LINE>transcoder.transcode(in, out);<NEW_LINE>} catch (TranscoderException e) {<NEW_LINE>throw new IIOException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>reader = new SVGImageReader(getOriginatingProvider());<NEW_LINE>reader.setInput(ImageIO.createImageInputStream(new ByteArrayInputStream(output.toByteArray())));<NEW_LINE>}<NEW_LINE>} | TranscoderOutput out = new TranscoderOutput(writer); |
631,053 | public String creditCard(CreditCardType creditCardType) {<NEW_LINE>final String key = String.format("finance.credit_card.%s", creditCardType.toString().toLowerCase());<NEW_LINE>String value = faker.fakeValuesService().resolve(key, this, faker);<NEW_LINE>final String template = faker.numerify(value);<NEW_LINE>String[] split = template.replaceAll("[^0-9]", "").split("");<NEW_LINE>List<Integer> reversedAsInt = new ArrayList<Integer>();<NEW_LINE>for (int i = 0; i < split.length; i++) {<NEW_LINE>final String current = split[split.length - 1 - i];<NEW_LINE>if (!current.isEmpty()) {<NEW_LINE>reversedAsInt.add<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int luhnSum = 0;<NEW_LINE>int multiplier = 1;<NEW_LINE>for (Integer digit : reversedAsInt) {<NEW_LINE>multiplier = (multiplier == 2 ? 1 : 2);<NEW_LINE>luhnSum += sum(String.valueOf(digit * multiplier).split(""));<NEW_LINE>}<NEW_LINE>int luhnDigit = (10 - (luhnSum % 10)) % 10;<NEW_LINE>return template.replace('\\', ' ').replace('/', ' ').trim().replace('L', String.valueOf(luhnDigit).charAt(0));<NEW_LINE>} | (Integer.valueOf(current)); |
348,389 | // the price without discounting<NEW_LINE>private double undiscountedPrice(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities) {<NEW_LINE>double timeToExpiry = volatilities.relativeTime(option.getExpiry());<NEW_LINE>if (timeToExpiry < 0d) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>FxRate forward = fxPricer.forwardFxRate(underlying, ratesProvider);<NEW_LINE>CurrencyPair strikePair = underlying.getCurrencyPair();<NEW_LINE>double forwardRate = forward.fxRate(strikePair);<NEW_LINE>double strikeRate = option.getStrike();<NEW_LINE>boolean isCall = option.getPutCall().isCall();<NEW_LINE>if (timeToExpiry == 0d) {<NEW_LINE>return isCall ? Math.max(forwardRate - strikeRate, 0d) : Math.max(0d, strikeRate - forwardRate);<NEW_LINE>}<NEW_LINE>double volatility = volatilities.volatility(strikePair, option.getExpiry(), strikeRate, forwardRate);<NEW_LINE>return BlackFormulaRepository.price(forwardRate, strikeRate, timeToExpiry, volatility, isCall);<NEW_LINE>} | ResolvedFxSingle underlying = option.getUnderlying(); |
1,527,588 | static // repeat x = y / y.norm(); y = A * x; end<NEW_LINE>GraphDef CreateGraphDef() throws Exception {<NEW_LINE>// TODO(jeff,opensource): This should really be a more interesting<NEW_LINE>// computation. Maybe turn this into an mnist model instead?<NEW_LINE>Scope root = Scope.NewRootScope();<NEW_LINE>// a = [3 2; -1 0]<NEW_LINE>Output a = Const(root, Tensor.create(new float[] { 3.f, 2.f, -1.f, 0.f }, new TensorShape(2, 2)));<NEW_LINE>// x = [1.0; 1.0]<NEW_LINE>Output x = Const(root.WithOpName("x"), Tensor.create(new float[] { 1.f, 1.f }, new TensorShape(2, 1)));<NEW_LINE>// y = a * x<NEW_LINE>MatMul y = new MatMul(root.WithOpName("y"), new Input(a<MASK><NEW_LINE>// y2 = y.^2<NEW_LINE>Square y2 = new Square(root, y.asInput());<NEW_LINE>// y2_sum = sum(y2)<NEW_LINE>Sum y2_sum = new Sum(root, y2.asInput(), new Input(0));<NEW_LINE>// y_norm = sqrt(y2_sum)<NEW_LINE>Sqrt y_norm = new Sqrt(root, y2_sum.asInput());<NEW_LINE>// y_normalized = y ./ y_norm<NEW_LINE>new Div(root.WithOpName("y_normalized"), y.asInput(), y_norm.asInput());<NEW_LINE>GraphDef def = new GraphDef();<NEW_LINE>Status s = root.ToGraphDef(def);<NEW_LINE>if (!s.ok()) {<NEW_LINE>throw new Exception(s.error_message().getString());<NEW_LINE>}<NEW_LINE>return def;<NEW_LINE>} | ), new Input(x)); |
1,827,215 | public Credentials fetch() {<NEW_LINE>String filename = this.filename;<NEW_LINE>if (filename == null) {<NEW_LINE>filename = getProperty("MINIO_SHARED_CREDENTIALS_FILE");<NEW_LINE>}<NEW_LINE>if (filename == null) {<NEW_LINE>String mcDir = ".mc";<NEW_LINE>if (System.getProperty("os.name").toLowerCase(Locale.US).contains("windows")) {<NEW_LINE>mcDir = "mc";<NEW_LINE>}<NEW_LINE>filename = Paths.get(System.getProperty("user.home"), mcDir, "config.json").toString();<NEW_LINE>}<NEW_LINE>String alias = this.alias;<NEW_LINE>if (alias == null) {<NEW_LINE>alias = getProperty("MINIO_ALIAS");<NEW_LINE>}<NEW_LINE>if (alias == null) {<NEW_LINE>alias = "s3";<NEW_LINE>}<NEW_LINE>try (InputStream is = new FileInputStream(filename)) {<NEW_LINE>McConfig config = mapper.readValue(new InputStreamReader(is, StandardCharsets.UTF_8), McConfig.class);<NEW_LINE>Map<String, String> values = config.get(alias);<NEW_LINE>if (values == null) {<NEW_LINE>throw new ProviderException("Alias " + alias + " does not exist in MinioClient configuration file");<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>String secretKey = values.get("secretKey");<NEW_LINE>if (accessKey == null) {<NEW_LINE>throw new ProviderException("Access key does not exist in alias " + alias + " in MinioClient configuration file");<NEW_LINE>}<NEW_LINE>if (secretKey == null) {<NEW_LINE>throw new ProviderException("Secret key does not exist in alias " + alias + " in MinioClient configuration file");<NEW_LINE>}<NEW_LINE>return new Credentials(accessKey, secretKey, null, null);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ProviderException("Unable to read MinioClient configuration file", e);<NEW_LINE>}<NEW_LINE>} | accessKey = values.get("accessKey"); |
1,837,738 | private static void create_tuple_nth(int n_cells, ClassVisitor cw, String this_class_name) {<NEW_LINE>MethodVisitor mv;<NEW_LINE>mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "elm", "(I)" + ETERM_TYPE.getDescriptor(), null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>Label dflt = new Label();<NEW_LINE>Label[] labels = new Label[n_cells];<NEW_LINE>for (int i = 0; i < n_cells; i++) {<NEW_LINE>labels[i] = new Label();<NEW_LINE>}<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, 1);<NEW_LINE>mv.visitTableSwitchInsn(1, n_cells, dflt, labels);<NEW_LINE>for (int zbase = 0; zbase < n_cells; zbase++) {<NEW_LINE>mv.visitLabel(labels[zbase]);<NEW_LINE>// load this<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>String field = "elem" + (zbase + 1);<NEW_LINE>mv.visitFieldInsn(Opcodes.GETFIELD, this_class_name, field, ETERM_TYPE.getDescriptor());<NEW_LINE>mv.visitInsn(Opcodes.ARETURN);<NEW_LINE>}<NEW_LINE>mv.visitLabel(dflt);<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 0);<NEW_LINE>mv.visitVarInsn(Opcodes.ILOAD, 1);<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, ETUPLE_NAME, "bad_nth", "(I)" + ETERM_TYPE.getDescriptor());<NEW_LINE>// make compiler happy<NEW_LINE>mv.visitInsn(Opcodes.ARETURN);<NEW_LINE><MASK><NEW_LINE>mv.visitEnd();<NEW_LINE>} | mv.visitMaxs(3, 2); |
870,935 | final CreateInterconnectResult executeCreateInterconnect(CreateInterconnectRequest createInterconnectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createInterconnectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateInterconnectRequest> request = null;<NEW_LINE>Response<CreateInterconnectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateInterconnectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createInterconnectRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateInterconnect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateInterconnectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateInterconnectResultJsonUnmarshaller()); |
158,626 | public IpRangeInventory createIpRange(IpRangeInventory ipr, APICreateMessage msg) {<NEW_LINE>AddressPoolVO vo = new SQLBatchWithReturn<AddressPoolVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected AddressPoolVO scripts() {<NEW_LINE>AddressPoolVO vo = new AddressPoolVO();<NEW_LINE>vo.setUuid(ipr.getUuid() == null ? Platform.getUuid() : ipr.getUuid());<NEW_LINE>vo.setDescription(ipr.getDescription());<NEW_LINE>vo.setEndIp(ipr.getEndIp());<NEW_LINE>vo.setGateway(ipr.getStartIp());<NEW_LINE>vo.<MASK><NEW_LINE>vo.setName(ipr.getName());<NEW_LINE>vo.setNetmask(ipr.getNetmask());<NEW_LINE>vo.setStartIp(ipr.getStartIp());<NEW_LINE>vo.setNetworkCidr(ipr.getNetworkCidr());<NEW_LINE>vo.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>vo.setIpVersion(ipr.getIpVersion());<NEW_LINE>vo.setAddressMode(ipr.getAddressMode());<NEW_LINE>vo.setPrefixLen(ipr.getPrefixLen());<NEW_LINE>dbf.getEntityManager().persist(vo);<NEW_LINE>dbf.getEntityManager().flush();<NEW_LINE>dbf.getEntityManager().refresh(vo);<NEW_LINE>return vo;<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>return AddressPoolInventory.valueOf1(vo);<NEW_LINE>} | setL3NetworkUuid(ipr.getL3NetworkUuid()); |
428,535 | protected final void handleReceiptScheduleEvent(@NonNull final AbstractReceiptScheduleEvent event) {<NEW_LINE>final Candidate existingSupplyCandidate = retrieveExistingSupplyCandidateOrNull(event);<NEW_LINE>final CandidateBuilder supplyCandidateBuilder = existingSupplyCandidate != null ? existingSupplyCandidate.toBuilder() : prepareInitialSupplyCandidate(event);<NEW_LINE>final PurchaseDetail purchaseDetail = createPurchaseDetail(event);<NEW_LINE>// for the "effective quantity" we need to subtract "UNEXPECTED_INSCREASES" (different AttributesKeys/Dates) that are related to the receipt schedule in question<NEW_LINE>final List<Candidate> receiptScheduleRecordsWithDifferentAttributes = candidateRepositoryRetrieval.retrieveOrderedByDateAndSeqNo(// get all purchaseDetail-candidates that are *not* the *actual* receipt schedule's candidate that we are updating in here<NEW_LINE>CandidatesQuery.builder().// get all purchaseDetail-candidates that are *not* the *actual* receipt schedule's candidate that we are updating in here<NEW_LINE>type(CandidateType.UNEXPECTED_INCREASE).purchaseDetailsQuery(PurchaseDetailsQuery.ofPurchaseDetailOrNull(<MASK><NEW_LINE>final BigDecimal qtySumWithDifferentAttributes = receiptScheduleRecordsWithDifferentAttributes.stream().map(Candidate::getQuantity).reduce(ZERO, BigDecimal::add);<NEW_LINE>final Candidate supplyCandidate = supplyCandidateBuilder.businessCaseDetail(purchaseDetail).quantity(event.getMaterialDescriptor().getQuantity().subtract(qtySumWithDifferentAttributes)).build();<NEW_LINE>candidateChangeHandler.onCandidateNewOrChange(supplyCandidate);<NEW_LINE>} | purchaseDetail)).build()); |
309,069 | public T execute() {<NEW_LINE>Map<String, List<String>> params = new HashMap<String, List<String>>();<NEW_LINE>if (myResources != null) {<NEW_LINE>ResourceListResponseHandler binding = new ResourceListResponseHandler();<NEW_LINE>BaseHttpClientInvocation invocation = TransactionMethodBinding.createTransactionInvocation(myResources, myContext);<NEW_LINE>return (T) invoke(params, binding, invocation);<NEW_LINE>} else if (myBaseBundle != null) {<NEW_LINE>ResourceResponseHandler binding = new ResourceResponseHandler(myBaseBundle.getClass(), getPreferResponseTypes());<NEW_LINE>BaseHttpClientInvocation invocation = TransactionMethodBinding.createTransactionInvocation(myBaseBundle, myContext);<NEW_LINE>return (T) invoke(params, binding, invocation);<NEW_LINE>// } else if (myRawBundle != null) {<NEW_LINE>} else {<NEW_LINE>StringResponseHandler binding = new StringResponseHandler();<NEW_LINE>if (getParamEncoding() != null) {<NEW_LINE>if (EncodingEnum.detectEncodingNoDefault(myRawBundle) != getParamEncoding()) {<NEW_LINE>IBaseResource parsed = parseResourceBody(myRawBundle);<NEW_LINE>myRawBundle = getParamEncoding().newParser(getFhirContext()).encodeResourceToString(parsed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BaseHttpClientInvocation invocation = TransactionMethodBinding.createTransactionInvocation(myRawBundle, myContext);<NEW_LINE>return (T) <MASK><NEW_LINE>}<NEW_LINE>} | invoke(params, binding, invocation); |
1,412,361 | private void restoreGameButon() {<NEW_LINE>mGameButton.setKeyName(this.originalKeyName);<NEW_LINE>mGameButton.setKeySize(this.originalKeySize[0], this.originalKeySize[1]);<NEW_LINE>mGameButton.setKeyPos(this.originalKeyPos[0], this.originalKeyPos[1]);<NEW_LINE>mGameButton.setKeyMaps(this.originalMaps);<NEW_LINE>mGameButton.setBackColor(this.originalBackColorHex);<NEW_LINE>mGameButton.setTextColor(this.originalTextColorHex);<NEW_LINE>mGameButton.setAlphaSize(this.originalAlpha);<NEW_LINE>mGameButton.setTextSize(this.originalTextSize);<NEW_LINE>mGameButton.setCornerRadius(this.originalCornerSize);<NEW_LINE>mGameButton.setKeep(this.originalKeep);<NEW_LINE><MASK><NEW_LINE>mGameButton.setShow(this.originalShow);<NEW_LINE>mGameButton.setViewerFollow(this.originalViewerFollow);<NEW_LINE>mGameButton.setDesignIndex(originalDesignIndex);<NEW_LINE>mGameButton.setChars(originalChars);<NEW_LINE>mGameButton.setInputChars(originalIsChars);<NEW_LINE>} | mGameButton.setHide(this.originalHide); |
753,804 | private JavaScriptNode desugarForInOrOfBody(ForNode forNode, JavaScriptNode iterator, JumpTargetCloseable<ContinueTarget> jumpTarget) {<NEW_LINE>assert forNode.isForInOrOf();<NEW_LINE>VarRef iteratorVar = environment.createTempVar();<NEW_LINE>JavaScriptNode iteratorInit = iteratorVar.createWriteNode(iterator);<NEW_LINE>VarRef nextResultVar = environment.createTempVar();<NEW_LINE>JavaScriptNode iteratorNext = factory.createIteratorNext(iteratorVar.createReadNode());<NEW_LINE>// nextResult = IteratorNext(iterator)<NEW_LINE>// while(!(done = IteratorComplete(nextResult)))<NEW_LINE>JavaScriptNode condition = factory.createDual(context, factory.createIteratorSetDone(iteratorVar.createReadNode(), factory.createConstantBoolean(true)), factory.createUnary(UnaryOperation.NOT, factory.createIteratorComplete(context, nextResultVar<MASK><NEW_LINE>JavaScriptNode wrappedBody;<NEW_LINE>try (EnvironmentCloseable blockEnv = new EnvironmentCloseable(needsPerIterationScope(forNode) ? newPerIterationEnvironment(lc.getCurrentBlock().getScope()) : environment)) {<NEW_LINE>// var nextValue = IteratorValue(nextResult);<NEW_LINE>VarRef nextResultVar2 = environment.findTempVar(nextResultVar.getFrameSlot());<NEW_LINE>VarRef nextValueVar = environment.createTempVar();<NEW_LINE>VarRef iteratorVar2 = environment.findTempVar(iteratorVar.getFrameSlot());<NEW_LINE>JavaScriptNode nextResult = nextResultVar2.createReadNode();<NEW_LINE>JavaScriptNode nextValue = factory.createIteratorValue(context, nextResult);<NEW_LINE>JavaScriptNode writeNextValue = nextValueVar.createWriteNode(nextValue);<NEW_LINE>JavaScriptNode writeNext = tagStatement(desugarForHeadAssignment(forNode, nextValueVar.createReadNode()), forNode);<NEW_LINE>JavaScriptNode body = transform(forNode.getBody());<NEW_LINE>wrappedBody = blockEnv.wrapBlockScope(createBlock(writeNextValue, factory.createIteratorSetDone(iteratorVar2.createReadNode(), factory.createConstantBoolean(false)), writeNext, body));<NEW_LINE>}<NEW_LINE>wrappedBody = jumpTarget.wrapContinueTargetNode(wrappedBody);<NEW_LINE>RepeatingNode repeatingNode = factory.createWhileDoRepeatingNode(condition, wrappedBody);<NEW_LINE>LoopNode loopNode = factory.createLoopNode(repeatingNode);<NEW_LINE>JavaScriptNode whileNode = forNode.isForOf() ? factory.createDesugaredForOf(loopNode) : factory.createDesugaredForIn(loopNode);<NEW_LINE>JavaScriptNode wrappedWhile = factory.createIteratorCloseIfNotDone(context, jumpTarget.wrapBreakTargetNode(whileNode), iteratorVar.createReadNode());<NEW_LINE>JavaScriptNode resetIterator = iteratorVar.createWriteNode(factory.createConstant(JSFrameUtil.DEFAULT_VALUE));<NEW_LINE>wrappedWhile = factory.createTryFinally(wrappedWhile, resetIterator);<NEW_LINE>ensureHasSourceSection(whileNode, forNode);<NEW_LINE>return createBlock(iteratorInit, wrappedWhile);<NEW_LINE>} | .createWriteNode(iteratorNext)))); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.