idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
586,331 | protected static void parseCellAttributes(XMLElement cellElem, String fieldName, FieldWriter childField, UiBinderWriter writer) throws UnableToCompleteException {<NEW_LINE>JClassType hAlignConstantType = writer.getOracle().findType(HorizontalAlignmentConstant.class.getCanonicalName());<NEW_LINE>JClassType vAlignConstantType = writer.getOracle().findType(VerticalAlignmentConstant.class.getCanonicalName());<NEW_LINE>// Parse horizontal and vertical alignment attributes.<NEW_LINE>if (cellElem.hasAttribute(HALIGN_ATTR)) {<NEW_LINE>String value = cellElem.consumeAttribute(HALIGN_ATTR, hAlignConstantType);<NEW_LINE>writer.addStatement("%1$s.setCellHorizontalAlignment(%2$s, %3$s);", fieldName, childField.getNextReference(), value);<NEW_LINE>}<NEW_LINE>if (cellElem.hasAttribute(VALIGN_ATTR)) {<NEW_LINE>String value = cellElem.consumeAttribute(VALIGN_ATTR, vAlignConstantType);<NEW_LINE>writer.addStatement("%1$s.setCellVerticalAlignment(%2$s, %3$s);", fieldName, <MASK><NEW_LINE>}<NEW_LINE>// Parse width and height attributes.<NEW_LINE>if (cellElem.hasAttribute(WIDTH_ATTR)) {<NEW_LINE>String value = cellElem.consumeStringAttribute(WIDTH_ATTR);<NEW_LINE>writer.addStatement("%1$s.setCellWidth(%2$s, %3$s);", fieldName, childField.getNextReference(), value);<NEW_LINE>}<NEW_LINE>if (cellElem.hasAttribute(HEIGHT_ATTR)) {<NEW_LINE>String value = cellElem.consumeStringAttribute(HEIGHT_ATTR);<NEW_LINE>writer.addStatement("%1$s.setCellHeight(%2$s, %3$s);", fieldName, childField.getNextReference(), value);<NEW_LINE>}<NEW_LINE>} | childField.getNextReference(), value); |
383,181 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>_shareUtil = new ShareUtil(this);<NEW_LINE>setContentView(R.layout.main__activity);<NEW_LINE>ButterKnife.bind(this);<NEW_LINE>setSupportActionBar(findViewById<MASK><NEW_LINE>optShowRate();<NEW_LINE>try {<NEW_LINE>if (_appSettings.isAppCurrentVersionFirstStart(true)) {<NEW_LINE>SimpleMarkdownParser smp = SimpleMarkdownParser.get().setDefaultSmpFilter(SimpleMarkdownParser.FILTER_ANDROID_TEXTVIEW);<NEW_LINE>String html = "";<NEW_LINE>html += smp.parse(getString(R.string.copyright_license_text_official).replace("\n", " \n"), "").getHtml();<NEW_LINE>html += "<br/><br/><br/><big><big>" + getString(R.string.changelog) + "</big></big><br/>" + smp.parse(getResources().openRawResource(R.raw.changelog), "", SimpleMarkdownParser.FILTER_ANDROID_TEXTVIEW);<NEW_LINE>html += "<br/><br/><br/><big><big>" + getString(R.string.licenses) + "</big></big><br/>" + smp.parse(getResources().openRawResource(R.raw.licenses_3rd_party), "").getHtml();<NEW_LINE>ActivityUtils _au = new ActivityUtils(this);<NEW_LINE>_au.showDialogWithHtmlTextView(0, html);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>IntroActivity.optStart(this);<NEW_LINE>// Setup viewpager<NEW_LINE>_viewPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());<NEW_LINE>_viewPager.setAdapter(_viewPagerAdapter);<NEW_LINE>_viewPager.setOffscreenPageLimit(4);<NEW_LINE>_bottomNav.setOnNavigationItemSelectedListener(this);<NEW_LINE>// noinspection PointlessBooleanExpression - Send Test intent<NEW_LINE>if (BuildConfig.IS_TEST_BUILD && false) {<NEW_LINE>DocumentActivity.launch(this, new File("/sdcard/Documents/mordor/aa-beamer.md"), true, null, null);<NEW_LINE>}<NEW_LINE>(new ActivityUtils(this)).applySpecialLaunchersVisibility(_appSettings.isSpecialFileLaunchersEnabled());<NEW_LINE>// Switch to tab if specific folder _not_ requested, and not recreating from saved instance<NEW_LINE>final int startTab = _appSettings.getAppStartupTab();<NEW_LINE>if (startTab != R.id.nav_notebook && savedInstanceState == null && getIntentDir(getIntent(), null) == null) {<NEW_LINE>_bottomNav.postDelayed(() -> _bottomNav.setSelectedItemId(startTab), 10);<NEW_LINE>}<NEW_LINE>} | (R.id.toolbar)); |
187,774 | protected void bind(final ViewHolder holder, final Object item, boolean isSelected, final ImageLoader imageLoader, final View.OnClickListener onMessageClickListener, final View.OnLongClickListener onMessageLongClickListener, final DateFormatter.Formatter dateHeadersFormatter, final SparseArray<MessagesListAdapter.OnMessageViewClickListener> clickListenersArray) {<NEW_LINE>if (item instanceof IMessage) {<NEW_LINE>((MessageHolders.BaseMessageViewHolder) holder).isSelected = isSelected;<NEW_LINE>((MessageHolders.<MASK><NEW_LINE>holder.itemView.setOnLongClickListener(onMessageLongClickListener);<NEW_LINE>holder.itemView.setOnClickListener(onMessageClickListener);<NEW_LINE>for (int i = 0; i < clickListenersArray.size(); i++) {<NEW_LINE>final int key = clickListenersArray.keyAt(i);<NEW_LINE>final View view = holder.itemView.findViewById(key);<NEW_LINE>if (view != null) {<NEW_LINE>view.setOnClickListener(v -> clickListenersArray.get(key).onMessageViewClick(view, (IMessage) item));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (item instanceof Date) {<NEW_LINE>((MessageHolders.DefaultDateHeaderViewHolder) holder).dateHeadersFormatter = dateHeadersFormatter;<NEW_LINE>}<NEW_LINE>holder.onBind(item);<NEW_LINE>} | BaseMessageViewHolder) holder).imageLoader = imageLoader; |
948,934 | public static HttpURLConnection loginAuthenticatedURL(final URL url, final String keytabPrincipal, final String keytabPath) throws Exception {<NEW_LINE>logger.info("Logging in URL: " + url.toString() + " using Principal: " + keytabPrincipal + ", Keytab: " + keytabPath);<NEW_LINE>UserGroupInformation loginUser = UserGroupInformation.getLoginUser();<NEW_LINE>if (loginUser == null) {<NEW_LINE>UserGroupInformation.loginUserFromKeytab(keytabPrincipal, keytabPath);<NEW_LINE>loginUser = UserGroupInformation.getLoginUser();<NEW_LINE>logger.info("Logged in with user " + loginUser);<NEW_LINE>} else {<NEW_LINE>logger.info("Login user (" + loginUser + ") already created, refreshing tgt.");<NEW_LINE>loginUser.checkTGTAndReloginFromKeytab();<NEW_LINE>}<NEW_LINE>final HttpURLConnection connection = loginUser.doAs((PrivilegedExceptionAction<HttpURLConnection>) () -> {<NEW_LINE>final Token token = new Token();<NEW_LINE>return new AuthenticatedURL(<MASK><NEW_LINE>});<NEW_LINE>return connection;<NEW_LINE>} | ).openConnection(url, token); |
600,850 | protected void appendTable(final HtmlSerializerTextBuilder builder, final HtmlTable htmlTable) {<NEW_LINE>builder.appendBlockSeparator();<NEW_LINE>final String caption = htmlTable.getCaptionText();<NEW_LINE>if (caption != null) {<NEW_LINE>builder.append(caption, Mode.NORMALIZE);<NEW_LINE>builder.appendBlockSeparator();<NEW_LINE>}<NEW_LINE>boolean first = true;<NEW_LINE>// first thead has to be displayed first and first tfoot has to be displayed last<NEW_LINE>final HtmlTableHeader tableHeader = htmlTable.getHeader();<NEW_LINE>if (tableHeader != null) {<NEW_LINE>first = appendTableRows(builder, tableHeader.getRows(), true, null, null);<NEW_LINE>}<NEW_LINE>final HtmlTableFooter tableFooter = htmlTable.getFooter();<NEW_LINE>final List<HtmlTableRow<MASK><NEW_LINE>first = appendTableRows(builder, tableRows, first, tableHeader, tableFooter);<NEW_LINE>if (tableFooter != null) {<NEW_LINE>first = appendTableRows(builder, tableFooter.getRows(), first, null, null);<NEW_LINE>} else if (tableRows.isEmpty()) {<NEW_LINE>final DomNode firstChild = htmlTable.getFirstChild();<NEW_LINE>if (firstChild != null) {<NEW_LINE>appendNode(builder, firstChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.appendBlockSeparator();<NEW_LINE>} | > tableRows = htmlTable.getRows(); |
1,055,496 | public void executionResult(RunConfig config, ExecutionContext res, int resultCode) {<NEW_LINE>if (NbmActionGoalProvider.NBMRELOAD.equals(config.getActionName()) && resultCode == 0) {<NEW_LINE>DirectoryScanner scanner = new DirectoryScanner();<NEW_LINE>NbMavenProject prj = project.getLookup().lookup(NbMavenProject.class);<NEW_LINE>// NOI18N<NEW_LINE>File basedir = new File(prj.getMavenProject().getBuild().getDirectory(), "nbm");<NEW_LINE>scanner.setBasedir(basedir);<NEW_LINE>scanner.setIncludes(new String[] { // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>"**/modules/*.jar", // NOI18N<NEW_LINE>"**/modules/eager/*.jar", "**/modules/autoload/*.jar" });<NEW_LINE>scanner.scan();<NEW_LINE>String[] incl = scanner.getIncludedFiles();<NEW_LINE>if (incl != null && incl.length > 0) {<NEW_LINE>if (incl[0].indexOf("eager") > -1 || incl[0].indexOf("autoload") > -1) {<NEW_LINE>// NOI18N<NEW_LINE>res.getInputOutput().getErr().println("NetBeans: Cannot reload 'autoload' or 'eager' modules.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>res.getInputOutput().getOut().println("NetBeans: Deploying NBM module in development IDE...");<NEW_LINE>TestModuleDeployer.deployTestModule(FileUtil.normalizeFile(new File(basedir<MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>res.getInputOutput().getOut().println("NetBeans: Error redeploying NBM module in development IDE.");<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(ExecutionChecker.class.getName()).log(Level.INFO, "Error reloading netbeans module in development IDE.", ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>res.getInputOutput().getErr().println("NetBeans: Cannot find any built NetBeans Module artifacts for reload.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , incl[0]))); |
602,560 | public static DescribeUidWhiteListGroupResponse unmarshall(DescribeUidWhiteListGroupResponse describeUidWhiteListGroupResponse, UnmarshallerContext context) {<NEW_LINE>describeUidWhiteListGroupResponse.setRequestId(context.stringValue("DescribeUidWhiteListGroupResponse.RequestId"));<NEW_LINE>describeUidWhiteListGroupResponse.setModule(context.stringValue("DescribeUidWhiteListGroupResponse.module"));<NEW_LINE>List<String> productList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeUidWhiteListGroupResponse.ProductList.Length"); i++) {<NEW_LINE>productList.add(context.stringValue("DescribeUidWhiteListGroupResponse.ProductList[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeUidWhiteListGroupResponse.setProductList(productList);<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setTotal(context.integerValue("DescribeUidWhiteListGroupResponse.PageInfo.total"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("DescribeUidWhiteListGroupResponse.PageInfo.pageSize"));<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("DescribeUidWhiteListGroupResponse.PageInfo.currentPage"));<NEW_LINE>describeUidWhiteListGroupResponse.setPageInfo(pageInfo);<NEW_LINE>List<Data> dataList = new ArrayList<Data>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeUidWhiteListGroupResponse.DataList.Length"); i++) {<NEW_LINE>Data data = new Data();<NEW_LINE>data.setStatus(context.stringValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].Status"));<NEW_LINE>data.setGmtCreate(context.stringValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].GmtCreate"));<NEW_LINE>data.setGmtRealExpire(context.stringValue<MASK><NEW_LINE>data.setSrcUid(context.stringValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].SrcUid"));<NEW_LINE>data.setAutoConfig(context.integerValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].AutoConfig"));<NEW_LINE>data.setGroupId(context.integerValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].GroupId"));<NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].Items.Length"); j++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setIP(context.stringValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].Items[" + j + "].IP"));<NEW_LINE>item.setRegionId(context.stringValue("DescribeUidWhiteListGroupResponse.DataList[" + i + "].Items[" + j + "].RegionId"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>dataList.add(data);<NEW_LINE>}<NEW_LINE>describeUidWhiteListGroupResponse.setDataList(dataList);<NEW_LINE>return describeUidWhiteListGroupResponse;<NEW_LINE>} | ("DescribeUidWhiteListGroupResponse.DataList[" + i + "].GmtRealExpire")); |
1,828,082 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@public @buseventtype create schema OrderDetail(itemId string);\n" + "@public @buseventtype create schema OrderEvent(details OrderDetail[]);\n" + "@name('s0') select details.where(i => i.itemId = '001') as c0 from OrderEvent;\n";<NEW_LINE>env.compileDeploy(epl, new RegressionPath()).addListener("s0");<NEW_LINE>Map<String, Object> detailOne = CollectionUtil.populateNameValueMap("itemId", "002");<NEW_LINE>Map<String, Object> detailTwo = CollectionUtil.populateNameValueMap("itemId", "001");<NEW_LINE>env.sendEventMap(CollectionUtil.populateNameValueMap("details", new Map[] { <MASK><NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>Collection c = (Collection) event.get("c0");<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(c.toArray(), new Map[] { detailTwo });<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | detailOne, detailTwo }), "OrderEvent"); |
1,556,531 | public Change unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Change change = new Change();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ChangeType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>change.setChangeType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Entity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>change.setEntity(EntityJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Details", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>change.setDetails(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ChangeName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>change.setChangeName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return change;<NEW_LINE>} | class).unmarshall(context)); |
796,068 | public FunctionalIterator<Unifier> unify(Rule.Conclusion.Relation relationConclusion, ConceptManager conceptMgr) {<NEW_LINE>if (relation().players().size() > relationConclusion.relation().players().size())<NEW_LINE>return Iterators.empty();<NEW_LINE>Unifier.Builder unifierBuilder = Unifier.builder();<NEW_LINE>ThingVariable relVar = relation().owner();<NEW_LINE>ThingVariable unifiedRelVar = relationConclusion.relation().owner();<NEW_LINE>if (unificationSatisfiable(relVar, unifiedRelVar)) {<NEW_LINE>unifierBuilder.addThing(relVar, unifiedRelVar.id());<NEW_LINE>} else<NEW_LINE>return Iterators.empty();<NEW_LINE>if (relVar.isa().isPresent()) {<NEW_LINE>if (relVar.isa().get().type().id().isLabel()) {<NEW_LINE>// require the unification target type variable satisfies a set of labels<NEW_LINE>Set<Label> allowedTypes = iterate(relVar.isa().get().type().inferredTypes()).flatMap(label -> subtypeLabels(label, conceptMgr)).toSet();<NEW_LINE>assert allowedTypes.containsAll(relVar.inferredTypes()) && unificationSatisfiable(relVar.isa().get().type(), unifiedRelVar.isa().get().type(), conceptMgr);<NEW_LINE>unifierBuilder.addLabelType(relVar.isa().get().type().id().asLabel(), allowedTypes, unifiedRelVar.isa().get().type().id());<NEW_LINE>} else {<NEW_LINE>unifierBuilder.addVariableType(relVar.isa().get().type(), unifiedRelVar.isa().get().type().id());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<RolePlayer> conjRolePlayers = list(relation().players());<NEW_LINE>Set<RolePlayer> thenRolePlayers = relationConclusion.relation().players();<NEW_LINE>return matchRolePlayers(conjRolePlayers, thenRolePlayers, new HashMap<>(), conceptMgr).map(mapping -> convertRPMappingToUnifier(mapping, unifierBuilder<MASK><NEW_LINE>} | .clone(), conceptMgr)); |
853,371 | protected void updateViewFromSelected() {<NEW_LINE>if (selected == null)<NEW_LINE>return;<NEW_LINE>super.commonUpdateViewFromSelected();<NEW_LINE>sshServer.setText(selected.getSshServer());<NEW_LINE>sshPort.setText(Integer.toString<MASK><NEW_LINE>sshUser.setText(selected.getSshUser());<NEW_LINE>checkboxUseSshPubkey.setChecked(selected.getUseSshPubKey());<NEW_LINE>portText.setText(Integer.toString(selected.getPort()));<NEW_LINE>if (selected.getKeepPassword() || selected.getPassword().length() > 0) {<NEW_LINE>passwordText.setText(selected.getPassword());<NEW_LINE>}<NEW_LINE>checkboxKeepPassword.setChecked(selected.getKeepPassword());<NEW_LINE>checkboxUseDpadAsArrows.setChecked(selected.getUseDpadAsArrows());<NEW_LINE>checkboxRotateDpad.setChecked(selected.getRotateDpad());<NEW_LINE>checkboxUseLastPositionToolbar.setChecked((!isNewConnection) ? selected.getUseLastPositionToolbar() : this.useLastPositionToolbarDefault());<NEW_LINE>textNickname.setText(selected.getNickname());<NEW_LINE>textUsername.setText(selected.getUserName());<NEW_LINE>rdpDomain.setText(selected.getRdpDomain());<NEW_LINE>spinnerRdpGeometry.setSelection(selected.getRdpResType());<NEW_LINE>rdpWidth.setText(Integer.toString(selected.getRdpWidth()));<NEW_LINE>rdpHeight.setText(Integer.toString(selected.getRdpHeight()));<NEW_LINE>setRemoteWidthAndHeight();<NEW_LINE>setRemoteSoundTypeFromSettings(selected.getRemoteSoundType());<NEW_LINE>checkboxEnableRecording.setChecked(selected.getEnableRecording());<NEW_LINE>checkboxConsoleMode.setChecked(selected.getConsoleMode());<NEW_LINE>checkboxRedirectSdCard.setChecked(selected.getRedirectSdCard());<NEW_LINE>checkboxRemoteFx.setChecked(selected.getRemoteFx());<NEW_LINE>checkboxDesktopBackground.setChecked(selected.getDesktopBackground());<NEW_LINE>checkboxFontSmoothing.setChecked(selected.getFontSmoothing());<NEW_LINE>checkboxDesktopComposition.setChecked(selected.getDesktopComposition());<NEW_LINE>checkboxWindowContents.setChecked(selected.getWindowContents());<NEW_LINE>checkboxMenuAnimation.setChecked(selected.getMenuAnimation());<NEW_LINE>checkboxVisualStyles.setChecked(selected.getVisualStyles());<NEW_LINE>checkboxEnableGfx.setChecked(selected.getEnableGfx());<NEW_LINE>checkboxEnableGfxH264.setChecked(selected.getEnableGfxH264());<NEW_LINE>checkboxPreferSendingUnicode.setChecked(selected.getPreferSendingUnicode());<NEW_LINE>} | (selected.getSshPort())); |
1,124,011 | public static void vertical9(Kernel1D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (y - radius) * input.stride;<NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k8;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc<MASK><NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [indexSrc] & 0xFF) * k9; |
1,509,243 | private Composite createBasicInfoGroup(Composite parent, IFileStore fileStore, IFileInfo fileInfo) {<NEW_LINE>Composite container = new Composite(parent, SWT.NULL);<NEW_LINE>container.setLayout(GridLayoutFactory.swtDefaults().numColumns(2).margins(0, 0).create());<NEW_LINE>Label label = new Label(container, SWT.NONE);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_path);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text pathText = new Text(container, <MASK><NEW_LINE>pathText.setText(fileStore.toURI().getPath());<NEW_LINE>pathText.setBackground(pathText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>pathText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_type);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text typeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>typeText.setText(fileInfo.isDirectory() ? Messages.FileInfoPropertyPage_Folder : Messages.FileInfoPropertyPage_File);<NEW_LINE>typeText.setBackground(typeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>typeText.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_location);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text locationText = new Text(container, SWT.WRAP | SWT.READ_ONLY);<NEW_LINE>locationText.setText(fileStore.toString());<NEW_LINE>locationText.setBackground(locationText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>locationText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>if (!fileInfo.isDirectory()) {<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_size);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>Text sizeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>sizeText.setText(MessageFormat.format(Messages.FileInfoPropertyPage_Bytes, Long.toString(fileInfo.getLength())));<NEW_LINE>sizeText.setBackground(sizeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>sizeText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>} | SWT.WRAP | SWT.READ_ONLY); |
232,676 | private Map<Haplotype, Haplotype> trimDownHaplotypes(final Locatable span, final List<Haplotype> haplotypeList) {<NEW_LINE>final Map<Haplotype, Haplotype> <MASK><NEW_LINE>for (final Haplotype h : haplotypeList) {<NEW_LINE>final Haplotype trimmed = h.trim(span);<NEW_LINE>if (trimmed != null) {<NEW_LINE>if (originalByTrimmedHaplotypes.containsKey(trimmed)) {<NEW_LINE>if (trimmed.isReference()) {<NEW_LINE>originalByTrimmedHaplotypes.remove(trimmed);<NEW_LINE>originalByTrimmedHaplotypes.put(trimmed, h);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>originalByTrimmedHaplotypes.put(trimmed, h);<NEW_LINE>}<NEW_LINE>} else if (h.isReference()) {<NEW_LINE>throw new IllegalStateException("trimming eliminates the reference haplotype");<NEW_LINE>} else if (debug) {<NEW_LINE>logger.info("Throwing out haplotype " + h + " with cigar " + h.getCigar() + " because it starts with or ends with an insertion or deletion when trimmed to " + span);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return originalByTrimmedHaplotypes;<NEW_LINE>} | originalByTrimmedHaplotypes = new HashMap<>(); |
1,723,328 | protected RemoteOperationResult run(OwnCloudClient client) {<NEW_LINE>RemoteOperationResult result;<NEW_LINE>Utf8PostMethod postMethod = null;<NEW_LINE>try {<NEW_LINE>postMethod = new Utf8PostMethod(client.getBaseUri() + DOCUMENT_URL + JSON_FORMAT);<NEW_LINE>postMethod.setParameter(FILE_ID, fileID);<NEW_LINE>// remote request<NEW_LINE>postMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);<NEW_LINE>int status = client.executeMethod(postMethod, SYNC_READ_TIMEOUT, SYNC_CONNECTION_TIMEOUT);<NEW_LINE>if (status == HttpStatus.SC_OK) {<NEW_LINE>String response = postMethod.getResponseBodyAsString();<NEW_LINE>// Parse the response<NEW_LINE>JSONObject respJSON = new JSONObject(response);<NEW_LINE>String url = respJSON.getJSONObject(NODE_OCS).getJSONObject<MASK><NEW_LINE>result = new RemoteOperationResult(true, postMethod);<NEW_LINE>result.setSingleData(url);<NEW_LINE>} else {<NEW_LINE>result = new RemoteOperationResult(false, postMethod);<NEW_LINE>client.exhaustResponse(postMethod.getResponseBodyAsStream());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>result = new RemoteOperationResult(e);<NEW_LINE>Log_OC.e(TAG, "Get rich document url for file with id " + fileID + " failed: " + result.getLogMessage(), result.getException());<NEW_LINE>} finally {<NEW_LINE>if (postMethod != null) {<NEW_LINE>postMethod.releaseConnection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (NODE_DATA).getString(NODE_URL); |
545,566 | public boolean removeRealm(String id) {<NEW_LINE>RealmEntity realm = em.find(RealmEntity.class, id, LockModeType.PESSIMISTIC_WRITE);<NEW_LINE>if (realm == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>em.refresh(realm);<NEW_LINE>final RealmAdapter adapter = new RealmAdapter(session, em, realm);<NEW_LINE>session.users().preRemove(adapter);<NEW_LINE>realm.getDefaultGroupIds().clear();<NEW_LINE>em.flush();<NEW_LINE>int num = em.createNamedQuery("deleteGroupRoleMappingsByRealm").setParameter("realm", realm.getId()).executeUpdate();<NEW_LINE>session.<MASK><NEW_LINE>num = em.createNamedQuery("deleteDefaultClientScopeRealmMappingByRealm").setParameter("realm", realm).executeUpdate();<NEW_LINE>session.clientScopes().removeClientScopes(adapter);<NEW_LINE>session.roles().removeRoles(adapter);<NEW_LINE>adapter.getTopLevelGroupsStream().forEach(adapter::removeGroup);<NEW_LINE>num = em.createNamedQuery("removeClientInitialAccessByRealm").setParameter("realm", realm).executeUpdate();<NEW_LINE>em.remove(realm);<NEW_LINE>em.flush();<NEW_LINE>em.clear();<NEW_LINE>session.getKeycloakSessionFactory().publish(new RealmModel.RealmRemovedEvent() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RealmModel getRealm() {<NEW_LINE>return adapter;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public KeycloakSession getKeycloakSession() {<NEW_LINE>return session;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>} | clients().removeClients(adapter); |
1,513,890 | public static // raw_text | magic_comment | comment | environment | pseudocode_block | math_environment | COMMAND_IFNEXTCHAR | commands | group | parameter_text | BACKSLASH | COMMA | EQUALS | OPEN_BRACKET | CLOSE_BRACKET<NEW_LINE>boolean angle_param_content(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "angle_param_content"))<NEW_LINE>return false;<NEW_LINE>boolean r;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ANGLE_PARAM_CONTENT, "<angle param content>");<NEW_LINE>r = raw_text(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = magic_comment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = comment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = <MASK><NEW_LINE>if (!r)<NEW_LINE>r = math_environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, COMMAND_IFNEXTCHAR);<NEW_LINE>if (!r)<NEW_LINE>r = commands(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = group(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = parameter_text(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, BACKSLASH);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, COMMA);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, EQUALS);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_BRACKET);<NEW_LINE>exit_section_(b, l, m, r, false, null);<NEW_LINE>return r;<NEW_LINE>} | pseudocode_block(b, l + 1); |
486,547 | public String arrayTypeList(String s, ArrayTypeAccess typeAccess) {<NEW_LINE>char <MASK><NEW_LINE>switch(c) {<NEW_LINE>case 'B':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("byte"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'C':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("char"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'D':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("double"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'F':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("float"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'I':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("int"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'J':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("long"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'S':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("short"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'Z':<NEW_LINE>typeAccess.setAccess(new PrimitiveTypeAccess("boolean"));<NEW_LINE>return s.substring(1);<NEW_LINE>case 'L':<NEW_LINE>// String[] strings = s.substring(1).split("\\;", 2);<NEW_LINE>// typeAccess.setAccess(this.p.fromClassName(strings[0]));<NEW_LINE>// return strings[1];<NEW_LINE>int pos = s.indexOf(';');<NEW_LINE>String s1 = s.substring(1, pos);<NEW_LINE>String s2 = s.substring(pos + 1, s.length());<NEW_LINE>typeAccess.setAccess(this.p.fromClassName(s1));<NEW_LINE>return s2;<NEW_LINE>default:<NEW_LINE>this.p.println("Error: unknown Type in TypeDescriptor");<NEW_LINE>throw new Error("Error: unknown Type in TypeDescriptor: " + s);<NEW_LINE>}<NEW_LINE>// return null;<NEW_LINE>} | c = s.charAt(0); |
985,763 | protected MultiGetResult<K, V> do_GET_ALL(Set<? extends K> keys) {<NEW_LINE>HashMap<K, CacheGetResult<V>> resultMap = new HashMap<>();<NEW_LINE>Set<K> restKeys = new HashSet<>(keys);<NEW_LINE>for (int i = 0; i < caches.length; i++) {<NEW_LINE>if (restKeys.size() == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Cache<K, CacheValueHolder<V>> c = caches[i];<NEW_LINE>MultiGetResult<K, CacheValueHolder<V>> allResult = c.GET_ALL(restKeys);<NEW_LINE>if (allResult.isSuccess() && allResult.getValues() != null) {<NEW_LINE>for (Map.Entry<K, CacheGetResult<CacheValueHolder<V>>> en : allResult.getValues().entrySet()) {<NEW_LINE><MASK><NEW_LINE>CacheGetResult result = en.getValue();<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>CacheValueHolder<V> holder = unwrapHolder(result.getHolder());<NEW_LINE>checkResultAndFillUpperCache(key, i, holder);<NEW_LINE>resultMap.put(key, new CacheGetResult(CacheResultCode.SUCCESS, null, holder));<NEW_LINE>restKeys.remove(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (K k : restKeys) {<NEW_LINE>resultMap.put(k, CacheGetResult.NOT_EXISTS_WITHOUT_MSG);<NEW_LINE>}<NEW_LINE>return new MultiGetResult<>(CacheResultCode.SUCCESS, null, resultMap);<NEW_LINE>} | K key = en.getKey(); |
1,682,949 | final GetStudioComponentResult executeGetStudioComponent(GetStudioComponentRequest getStudioComponentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStudioComponentRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetStudioComponentRequest> request = null;<NEW_LINE>Response<GetStudioComponentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetStudioComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getStudioComponentRequest));<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, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStudioComponent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetStudioComponentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetStudioComponentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,162,872 | public void export(Person person, long time) throws IOException {<NEW_LINE>String <MASK><NEW_LINE>String payerId = "";<NEW_LINE>String payerName = "";<NEW_LINE>String type = COVERAGE_TYPES[(int) randomLongWithBounds(0, COVERAGE_TYPES.length - 1)];<NEW_LINE>int groupSelect = (int) randomLongWithBounds(0, GROUPIDS.length - 1);<NEW_LINE>UUID groupId = GROUPIDS[groupSelect];<NEW_LINE>String groupName = GROUP_NAMES[groupSelect];<NEW_LINE>int planSelect = (int) randomLongWithBounds(0, PLAN_NAMES.length - 1);<NEW_LINE>String planName = PLAN_NAMES[planSelect];<NEW_LINE>String planId = PLAN_IDS[planSelect];<NEW_LINE>long start = 999999999999999999L;<NEW_LINE>long end = 0;<NEW_LINE>for (Encounter encounter : person.record.encounters) {<NEW_LINE>String encounterID = person.randUUID().toString();<NEW_LINE>UUID medRecordNumber = person.randUUID();<NEW_LINE>CPCDSAttributes encounterAttributes = new CPCDSAttributes(encounter);<NEW_LINE>if (Config.getAsBoolean("exporter.cpcds.single_payer")) {<NEW_LINE>payerId = "b1c428d6-4f07-31e0-90f0-68ffa6ff8c76";<NEW_LINE>payerName = clean(Config.get("single_payer.name"));<NEW_LINE>} else {<NEW_LINE>payerId = encounter.claim.payer.uuid.toString();<NEW_LINE>payerName = encounter.claim.payer.getName();<NEW_LINE>}<NEW_LINE>for (CarePlan careplan : encounter.careplans) {<NEW_LINE>if (careplan.start < start) {<NEW_LINE>start = careplan.start;<NEW_LINE>}<NEW_LINE>if (careplan.stop > end) {<NEW_LINE>end = careplan.stop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (start == 999999999999999999L) {<NEW_LINE>start = end;<NEW_LINE>}<NEW_LINE>String coverageID = coverage(person, personID, start, end, payerId, type, groupId, groupName, planName, planId);<NEW_LINE>claim(person, encounter, personID, encounterID, medRecordNumber, encounterAttributes, payerId, coverageID);<NEW_LINE>hospital(encounter, encounterAttributes, payerName);<NEW_LINE>}<NEW_LINE>patients.flush();<NEW_LINE>coverages.flush();<NEW_LINE>claims.flush();<NEW_LINE>practitioners.flush();<NEW_LINE>hospitals.flush();<NEW_LINE>} | personID = patient(person, time); |
1,752,021 | // Call on EDT<NEW_LINE>private void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {<NEW_LINE>// NOI18N<NEW_LINE>String border = Resources.getText("LBL_MBeanInfo");<NEW_LINE>// NOI18N<NEW_LINE>String text = Resources.getText("LBL_Info");<NEW_LINE>DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();<NEW_LINE>Object[] rowData = new Object[2];<NEW_LINE>rowData[0] = new TableRowDivider(border, lightSalmon);<NEW_LINE>// NOI18N<NEW_LINE>rowData[1] = new TableRowDivider("", lightSalmon);<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = new TableRowDivider(text + ":", lightYellow);<NEW_LINE>// NOI18N<NEW_LINE>rowData[1] = new TableRowDivider("", lightYellow);<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = Resources.getText("LBL_ObjectName");<NEW_LINE>rowData[1] = mbean.getObjectName();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0<MASK><NEW_LINE>rowData[1] = mbeanInfo.getClassName();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = Resources.getText("LBL_Description");<NEW_LINE>rowData[1] = mbeanInfo.getDescription();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>addDescriptor(mbeanInfo.getDescriptor(), text);<NEW_LINE>// MBeanConstructorInfo<NEW_LINE>//<NEW_LINE>int i = 0;<NEW_LINE>for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {<NEW_LINE>// NOI18N<NEW_LINE>addMBeanConstructorInfo(// NOI18N<NEW_LINE>mbci, Resources.getText("LBL_Constructor") + "-" + i);<NEW_LINE>// MBeanParameterInfo<NEW_LINE>//<NEW_LINE>int j = 0;<NEW_LINE>for (MBeanParameterInfo mbpi : mbci.getSignature()) {<NEW_LINE>// NOI18N<NEW_LINE>addMBeanParameterInfo(// NOI18N<NEW_LINE>mbpi, Resources.getText("LBL_Parameter") + "-" + i + "-" + j);<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>tableModel.newDataAvailable(new TableModelEvent(tableModel));<NEW_LINE>} | ] = Resources.getText("LBL_ClassName"); |
837,491 | private void migrateExistingAllTimeSucceededFromJobStatsToMetadataAndDropJobStats(MongoDatabase jobrunrDatabase, MongoCollection<Document> metadataCollection) {<NEW_LINE>if (!collectionExists(jobrunrDatabase, JobStats.NAME))<NEW_LINE>return;<NEW_LINE>MongoCollection<Document> jobStatsCollection = jobrunrDatabase.getCollection(JobStats.NAME, Document.class);<NEW_LINE>final Document jobStats = jobStatsCollection.find(eq(toMongoId(JobStats.FIELD_ID), JobStats<MASK><NEW_LINE>long existingAmount = jobStats != null ? jobStats.getInteger(StateName.SUCCEEDED.name()) : 0;<NEW_LINE>metadataCollection.updateOne(eq(toMongoId(Metadata.FIELD_ID), Metadata.STATS_ID), Updates.inc(Metadata.FIELD_VALUE, existingAmount), new UpdateOptions().upsert(true));<NEW_LINE>jobStatsCollection.drop();<NEW_LINE>} | .FIELD_STATS)).first(); |
1,404,831 | public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {<NEW_LINE>if (beanName.startsWith(DataSourceBeanFactoryPostProcessor.SOFA_TRACER_DATASOURCE) || bean instanceof SmartDataSource || !(bean instanceof DataSource)) {<NEW_LINE>return bean;<NEW_LINE>}<NEW_LINE>String getUrlMethodName;<NEW_LINE>String url;<NEW_LINE>if (DataSourceUtils.isDruidDataSource(bean) || DataSourceUtils.isDbcpDataSource(bean) || DataSourceUtils.isTomcatDataSource(bean)) {<NEW_LINE>getUrlMethodName = DataSourceUtils.METHOD_GET_URL;<NEW_LINE>} else if (DataSourceUtils.isC3p0DataSource(bean) || DataSourceUtils.isHikariDataSource(bean)) {<NEW_LINE>getUrlMethodName = DataSourceUtils.METHOD_GET_JDBC_URL;<NEW_LINE>} else {<NEW_LINE>return bean;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method urlMethod = ReflectionUtils.findMethod(bean.getClass(), getUrlMethodName);<NEW_LINE>urlMethod.setAccessible(true);<NEW_LINE>url = (String) urlMethod.invoke(bean);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>throw new BeanCreationException(String.format("Can not find method: %s in class %s.", getUrlMethodName, bean.getClass().getCanonicalName()), throwable);<NEW_LINE>}<NEW_LINE>SmartDataSource proxiedDataSource = new SmartDataSource((DataSource) bean);<NEW_LINE>String <MASK><NEW_LINE>Assert.isTrue(!StringUtils.isBlank(appName), TRACER_APPNAME_KEY + " must be configured!");<NEW_LINE>proxiedDataSource.setAppName(appName);<NEW_LINE>proxiedDataSource.setDbType(DataSourceUtils.resolveDbTypeFromUrl(url));<NEW_LINE>proxiedDataSource.setDatabase(DataSourceUtils.resolveDatabaseFromUrl(url));<NEW_LINE>// execute proxied datasource init-method<NEW_LINE>proxiedDataSource.init();<NEW_LINE>return proxiedDataSource;<NEW_LINE>} | appName = environment.getProperty(TRACER_APPNAME_KEY); |
408,639 | public boolean isHidden(Context context, String schema, String element, String qualifier) throws SQLException {<NEW_LINE>boolean hidden = false;<NEW_LINE>// for schema.element, just check schema->elementSet<NEW_LINE>if (!isInitialized()) {<NEW_LINE>init();<NEW_LINE>}<NEW_LINE>if (qualifier == null) {<NEW_LINE>Set<String> elts = hiddenElementSets.get(schema);<NEW_LINE>hidden = elts != <MASK><NEW_LINE>} else {<NEW_LINE>// for schema.element.qualifier, just schema->eltMap->qualSet<NEW_LINE>Map<String, Set<String>> elts = hiddenElementMaps.get(schema);<NEW_LINE>if (elts == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> quals = elts.get(element);<NEW_LINE>hidden = quals != null && quals.contains(qualifier);<NEW_LINE>}<NEW_LINE>if (hidden && context != null) {<NEW_LINE>// the administrator's override<NEW_LINE>hidden = !authorizeService.isAdmin(context);<NEW_LINE>}<NEW_LINE>return hidden;<NEW_LINE>} | null && elts.contains(element); |
1,491,939 | public final BetweenAndStep14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> notBetween(Field<T1> t1, Field<T2> t2, Field<T3> t3, Field<T4> t4, Field<T5> t5, Field<T6> t6, Field<T7> t7, Field<T8> t8, Field<T9> t9, Field<T10> t10, Field<T11> t11, Field<T12> t12, Field<T13> t13, Field<T14> t14) {<NEW_LINE>return notBetween(row(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11<MASK><NEW_LINE>} | , t12, t13, t14)); |
37,705 | private IEditorPart openEditorForMarker(final IWorkbench workbench, final IWorkbenchPage page, IFile markedFile) throws CommandExecutionException {<NEW_LINE>IEditorPart editor;<NEW_LINE>IEditorInput editorInput = new FileEditorInput(markedFile);<NEW_LINE>String fileName = markedFile.getName();<NEW_LINE>IEditorDescriptor desc = workbench.<MASK><NEW_LINE>try {<NEW_LINE>if (desc == null) {<NEW_LINE>// use default because file doesn't have file extension, Eclipse can't guess its type<NEW_LINE>editor = page.openEditor(editorInput, "org.eclipse.ui.DefaultTextEditor");<NEW_LINE>} else {<NEW_LINE>editor = page.openEditor(editorInput, desc.getId());<NEW_LINE>}<NEW_LINE>} catch (PartInitException e) {<NEW_LINE>VrapperLog.error("Failed to open file " + markedFile.getFullPath(), e);<NEW_LINE>throw new CommandExecutionException("Could not open editor for " + markedFile.getProjectRelativePath());<NEW_LINE>}<NEW_LINE>return editor;<NEW_LINE>} | getEditorRegistry().getDefaultEditor(fileName); |
1,691,672 | public ProcessExecutionResult invokeExternalSystem(@NonNull final InvokeExternalSystemProcessRequest invokeExternalSystemProcessRequest) {<NEW_LINE>final ExternalSystemParentConfig externalSystemParentConfig = externalSystemConfigRepo.getByTypeAndValue(invokeExternalSystemProcessRequest.getExternalSystemType(), invokeExternalSystemProcessRequest.getChildSystemConfigValue()).orElseThrow(() -> new AdempiereException("ExternalSystemParentConfig @NotFound@").appendParametersToMessage().setParameter("invokeExternalSystemProcessRequest", invokeExternalSystemProcessRequest));<NEW_LINE>final AdProcessId processId = adProcessDAO.retrieveProcessIdByClassIfUnique(invokeExternalSystemProcessRequest.<MASK><NEW_LINE>// note: when the AD_PInstance is created by the schedule, it's also stored as string<NEW_LINE>final String configIdAsString = Integer.toString(externalSystemParentConfig.getChildConfig().getId().getRepoId());<NEW_LINE>final ProcessInfo.ProcessInfoBuilder processInfoBuilder = ProcessInfo.builder();<NEW_LINE>processInfoBuilder.setAD_Process_ID(processId.getRepoId());<NEW_LINE>processInfoBuilder.addParameter(PARAM_EXTERNAL_REQUEST, invokeExternalSystemProcessRequest.getRequest());<NEW_LINE>processInfoBuilder.addParameter(PARAM_CHILD_CONFIG_ID, configIdAsString);<NEW_LINE>processInfoBuilder.setRecord(externalSystemParentConfig.getTableRecordReference());<NEW_LINE>final ProcessExecutionResult processExecutionResult = processInfoBuilder.buildAndPrepareExecution().executeSync().getResult();<NEW_LINE>adPInstanceDAO.unlockAndSaveResult(processExecutionResult);<NEW_LINE>return processExecutionResult;<NEW_LINE>} | getExternalSystemType().getExternalSystemProcessClassName()); |
1,210,451 | public void unregisterGovernanceServiceFromEngine(String userId, String governanceEngineGUID, String governanceServiceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException {<NEW_LINE>final String methodName = "unregisterGovernanceServiceFromEngine";<NEW_LINE>final String governanceEngineGUIDParameter = "governanceEngineGUID";<NEW_LINE>final String governanceServiceGUIDParameter = "governanceServiceGUID";<NEW_LINE>final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services/{3}/delete";<NEW_LINE>invalidParameterHandler.validateUserId(userId, methodName);<NEW_LINE>invalidParameterHandler.validateGUID(governanceEngineGUID, governanceEngineGUIDParameter, methodName);<NEW_LINE>invalidParameterHandler.validateGUID(governanceServiceGUID, governanceServiceGUIDParameter, methodName);<NEW_LINE>restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + urlTemplate, nullRequestBody, <MASK><NEW_LINE>} | serverName, userId, governanceEngineGUID, governanceServiceGUID); |
1,114,978 | public StringBuilder generateWhiteSpace(final CommonCodeStyleSettings.IndentOptions indentOptions, final int offset, final IndentInfo indent) {<NEW_LINE>final StringBuilder result = new StringBuilder();<NEW_LINE>int currentOffset = getStartOffset();<NEW_LINE>CharSequence[] lines = getInitialLines();<NEW_LINE>int currentLine = 0;<NEW_LINE>for (int i = 0; i < lines.length - 1 && currentOffset + lines[i].length() <= offset; i++) {<NEW_LINE>result.append(lines[i]);<NEW_LINE>currentOffset += lines[i].length();<NEW_LINE>result.append(LINE_FEED);<NEW_LINE>currentOffset++;<NEW_LINE>currentLine++;<NEW_LINE>if (currentOffset == offset) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String newIndentSpaces = indent.generateNewWhiteSpace(indentOptions);<NEW_LINE>result.append(newIndentSpaces);<NEW_LINE><MASK><NEW_LINE>if (currentLine + 1 < lines.length) {<NEW_LINE>result.append(LINE_FEED);<NEW_LINE>for (int i = currentLine + 1; i < lines.length - 1; i++) {<NEW_LINE>result.append(lines[i]);<NEW_LINE>result.append(LINE_FEED);<NEW_LINE>}<NEW_LINE>appendNonWhitespaces(result, lines, lines.length - 1);<NEW_LINE>result.append(lines[lines.length - 1]);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | appendNonWhitespaces(result, lines, currentLine); |
952,683 | public static void horizontal(GrayF32 input, GrayF32 output, int offset, int length) {<NEW_LINE>final float divisor = length;<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 + input.stride * y;<NEW_LINE>int indexOut = output.startIndex <MASK><NEW_LINE>float total = 0;<NEW_LINE>int indexEnd = indexIn + length;<NEW_LINE>for (; indexIn < indexEnd; indexIn++) {<NEW_LINE>total += input.data[indexIn];<NEW_LINE>}<NEW_LINE>output.data[indexOut++] = (total / divisor);<NEW_LINE>indexEnd = indexIn + input.width - length;<NEW_LINE>for (; indexIn < indexEnd; indexIn++) {<NEW_LINE>total -= input.data[indexIn - length];<NEW_LINE>total += input.data[indexIn];<NEW_LINE>output.data[indexOut++] = (total / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | + output.stride * y + offset; |
1,147,069 | public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {<NEW_LINE>final <MASK><NEW_LINE>if (methodName.startsWith("with") && method.getReturnType() != null && MongoCollection.class.isAssignableFrom(method.getReturnType())) {<NEW_LINE>// inutile de monitorer withDocumentClass(...), etc<NEW_LINE>// mais il faut monitorer la nouvelle instance de MongoCollection en retour<NEW_LINE>MongoCollection<?> result = (MongoCollection<?>) method.invoke(collection, args);<NEW_LINE>final MongoNamespace namespace = collection.getNamespace();<NEW_LINE>final String name;<NEW_LINE>if (namespace != null) {<NEW_LINE>name = namespace.getFullName();<NEW_LINE>} else {<NEW_LINE>name = methodName;<NEW_LINE>}<NEW_LINE>result = createCollectionProxy(result, name);<NEW_LINE>return result;<NEW_LINE>} else if (methodName.startsWith("get")) {<NEW_LINE>// inutile de monitorer getDocumentClass(), getNamespace(), etc<NEW_LINE>return method.invoke(collection, args);<NEW_LINE>}<NEW_LINE>final String requestName = collectionName + '.' + method.getName();<NEW_LINE>return doInvoke(collection, method, args, requestName);<NEW_LINE>} | String methodName = method.getName(); |
1,694,175 | public R invoke(Object... arguments) {<NEW_LINE>ConversionService<?> conversionService = this.conversionService;<NEW_LINE><MASK><NEW_LINE>if (targetArguments.length == 0) {<NEW_LINE>return executableMethod.invoke();<NEW_LINE>} else {<NEW_LINE>List<Object> argumentList = new ArrayList<>(arguments.length);<NEW_LINE>Map<String, Object> variables = getVariableValues();<NEW_LINE>Iterator<Object> valueIterator = variables.values().iterator();<NEW_LINE>int i = 0;<NEW_LINE>for (Argument<?> targetArgument : targetArguments) {<NEW_LINE>String name = targetArgument.getName();<NEW_LINE>Object value = variables.get(name);<NEW_LINE>if (value != null) {<NEW_LINE>Optional<?> result = conversionService.convert(value, targetArgument.getType());<NEW_LINE>argumentList.add(result.orElseThrow(() -> new IllegalArgumentException("Wrong argument types to method: " + executableMethod)));<NEW_LINE>} else if (valueIterator.hasNext()) {<NEW_LINE>Optional<?> result = conversionService.convert(valueIterator.next(), targetArgument.getType());<NEW_LINE>argumentList.add(result.orElseThrow(() -> new IllegalArgumentException("Wrong argument types to method: " + executableMethod)));<NEW_LINE>} else if (i < arguments.length) {<NEW_LINE>Optional<?> result = conversionService.convert(arguments[i++], targetArgument.getType());<NEW_LINE>argumentList.add(result.orElseThrow(() -> new IllegalArgumentException("Wrong argument types to method: " + executableMethod)));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Wrong number of arguments to method: " + executableMethod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return executableMethod.invoke(argumentList.toArray());<NEW_LINE>}<NEW_LINE>} | Argument[] targetArguments = getArguments(); |
25,455 | private Mono<PagedResponse<VpnGatewayInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)).<PagedResponse<VpnGatewayInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
196,581 | public final long checkFPs() {<NEW_LINE>long dis = Long.MAX_VALUE;<NEW_LINE>for (int i = 0; i < this.table.length; i++) {<NEW_LINE>long low = i & 0xffffffL;<NEW_LINE>byte[] bucket = this.table[i];<NEW_LINE>if (bucket != null) {<NEW_LINE>int j = 0;<NEW_LINE>while (j < bucket.length) {<NEW_LINE>long b1 = (bucket[j++] & 0xffL) << 24;<NEW_LINE>long b2 = (bucket[j++] & 0xffL) << 32;<NEW_LINE>long b3 = (bucket[j++] & 0xffL) << 40;<NEW_LINE>long b4 = (bucket[j++] & 0xffL) << 48;<NEW_LINE>long b5 = (bucket[j++] & 0xffL) << 56;<NEW_LINE>long fp = b5 | b4 | b3 | b2 | b1 | low;<NEW_LINE>int k = j;<NEW_LINE>while (k < bucket.length) {<NEW_LINE>b1 = (bucket[k++] & 0xffL) << 24;<NEW_LINE>b2 = (bucket[k++] & 0xffL) << 32;<NEW_LINE>b3 = (bucket[k++] & 0xffL) << 40;<NEW_LINE>b4 = (bucket[k++] & 0xffL) << 48;<NEW_LINE>b5 = (bucket[k++] & 0xffL) << 56;<NEW_LINE>long fp1 = b5 | b4 | b3 | b2 | b1 | low;<NEW_LINE>long dis1 = (fp > fp1) ? fp - fp1 : fp1 - fp;<NEW_LINE>if (dis1 >= 0) {<NEW_LINE>dis = Math.min(dis, dis1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (k = i + 1; k < this.table.length; k++) {<NEW_LINE>byte[] <MASK><NEW_LINE>if (bucket1 != null) {<NEW_LINE>long low1 = k & 0xffffffL;<NEW_LINE>int k1 = 0;<NEW_LINE>while (k1 < bucket.length) {<NEW_LINE>b1 = (bucket[k1++] & 0xffL) << 24;<NEW_LINE>b2 = (bucket[k1++] & 0xffL) << 32;<NEW_LINE>b3 = (bucket[k1++] & 0xffL) << 40;<NEW_LINE>b4 = (bucket[k1++] & 0xffL) << 48;<NEW_LINE>b5 = (bucket[k1++] & 0xffL) << 56;<NEW_LINE>long fp1 = b5 | b4 | b3 | b2 | b1 | low1;<NEW_LINE>long dis1 = (fp > fp1) ? fp - fp1 : fp1 - fp;<NEW_LINE>if (dis1 >= 0) {<NEW_LINE>dis = Math.min(dis, dis1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dis;<NEW_LINE>} | bucket1 = this.table[k]; |
504,011 | public StructureEntry incomingReferences(final String hosthash) {<NEW_LINE>final String hostname = hostHash2hostName(hosthash);<NEW_LINE>if (hostname == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// collect the references<NEW_LINE>WebStructureGraph.StructureEntry sentry;<NEW_LINE>final HashMap<String, Integer> hosthashes = new HashMap<String, Integer>();<NEW_LINE>Iterator<WebStructureGraph.StructureEntry> i = new StructureIterator(false);<NEW_LINE>while (i.hasNext()) {<NEW_LINE>sentry = i.next();<NEW_LINE>if (sentry.references.containsKey(hosthash)) {<NEW_LINE>hosthashes.put(sentry.hosthash, sentry.references.get(hosthash));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>i = new StructureIterator(true);<NEW_LINE>while (i.hasNext()) {<NEW_LINE>sentry = i.next();<NEW_LINE>if (sentry.references.containsKey(hosthash)) {<NEW_LINE>hosthashes.put(sentry.hosthash, sentry.references.get(hosthash));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// construct a new structureEntry Object<NEW_LINE>return new StructureEntry(hosthash, hostname, GenericFormatter.<MASK><NEW_LINE>} | SHORT_DAY_FORMATTER.format(), hosthashes); |
1,735,673 | public void handleInterrupt(Status status) {<NEW_LINE>if (unit.getCurrentAction() == Action.IDLE) {<NEW_LINE>int a = getCpu().getRegisterSet().getRegister("A").getValue();<NEW_LINE>int b = getCpu().getRegisterSet().getRegister("B").getValue();<NEW_LINE>if (a == LEGS_SET_DIR) {<NEW_LINE>Direction dir = Direction.getDirection(b);<NEW_LINE>if (dir != null) {<NEW_LINE>if (unit.spendEnergy(20)) {<NEW_LINE>unit.setDirection(Direction.getDirection(b));<NEW_LINE>status.setErrorFlag(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>status.setErrorFlag(true);<NEW_LINE>}<NEW_LINE>} else if (a == LEGS_SET_DIR_AND_WALK) {<NEW_LINE>if (unit.getMaxEnergy() >= 100) {<NEW_LINE>Direction dir = Direction.getDirection(b);<NEW_LINE>if (dir != null) {<NEW_LINE>unit.setDirection(Direction.getDirection(b));<NEW_LINE>status.setErrorFlag(false);<NEW_LINE>} else {<NEW_LINE>status.setErrorFlag(true);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | unit.setCurrentAction(Action.WALKING); |
1,779,790 | public static DescribeDBInstanceNetInfoResponse unmarshall(DescribeDBInstanceNetInfoResponse describeDBInstanceNetInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBInstanceNetInfoResponse.setRequestId(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.RequestId"));<NEW_LINE>describeDBInstanceNetInfoResponse.setInstanceNetworkType(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.InstanceNetworkType"));<NEW_LINE>List<DBInstanceNetInfo> dBInstanceNetInfos = new ArrayList<DBInstanceNetInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos.Length"); i++) {<NEW_LINE>DBInstanceNetInfo dBInstanceNetInfo = new DBInstanceNetInfo();<NEW_LINE>dBInstanceNetInfo.setVSwitchId(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].VSwitchId"));<NEW_LINE>dBInstanceNetInfo.setConnectionString(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].ConnectionString"));<NEW_LINE>dBInstanceNetInfo.setIPType(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].IPType"));<NEW_LINE>dBInstanceNetInfo.setPort(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].Port"));<NEW_LINE>dBInstanceNetInfo.setVpcInstanceId(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].VpcInstanceId"));<NEW_LINE>dBInstanceNetInfo.setVPCId(_ctx.stringValue<MASK><NEW_LINE>dBInstanceNetInfo.setIPAddress(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].IPAddress"));<NEW_LINE>dBInstanceNetInfo.setAddressType(_ctx.stringValue("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].AddressType"));<NEW_LINE>dBInstanceNetInfos.add(dBInstanceNetInfo);<NEW_LINE>}<NEW_LINE>describeDBInstanceNetInfoResponse.setDBInstanceNetInfos(dBInstanceNetInfos);<NEW_LINE>return describeDBInstanceNetInfoResponse;<NEW_LINE>} | ("DescribeDBInstanceNetInfoResponse.DBInstanceNetInfos[" + i + "].VPCId")); |
1,091,796 | final GetPullRequestApprovalStatesResult executeGetPullRequestApprovalStates(GetPullRequestApprovalStatesRequest getPullRequestApprovalStatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPullRequestApprovalStatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPullRequestApprovalStatesRequest> request = null;<NEW_LINE>Response<GetPullRequestApprovalStatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPullRequestApprovalStatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPullRequestApprovalStatesRequest));<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, "CodeCommit");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPullRequestApprovalStatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPullRequestApprovalStatesResultJsonUnmarshaller());<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, "GetPullRequestApprovalStates"); |
1,390,200 | public String sqlAD_getTranslatedTables(String vendorName, String catalogName, String schemaName) {<NEW_LINE>// table name<NEW_LINE>String tableName = "AD_Table";<NEW_LINE>// column names<NEW_LINE>ArrayList<String> columnNames = new ArrayList<String>();<NEW_LINE>columnNames.add("SUBSTR(TableName, 1, LENGTH(TableName)-4)");<NEW_LINE>// aliases<NEW_LINE>ArrayList<String> aliasNames = new ArrayList<String>();<NEW_LINE>aliasNames.add("TableName");<NEW_LINE>// conditions<NEW_LINE>ArrayList<String> conditions = new ArrayList<String>();<NEW_LINE>conditions.add("UPPER(TableName) LIKE '%\\_TRL'");<NEW_LINE>conditions.add("IsActive = 'Y'");<NEW_LINE>conditions.add("IsView = 'N'");<NEW_LINE>// sort order<NEW_LINE>ArrayList<String> sortColumns <MASK><NEW_LINE>sortColumns.add("1");<NEW_LINE>// get SQL command<NEW_LINE>return sql_select(vendorName, catalogName, schemaName, tableName, null, columnNames, aliasNames, conditions, sortColumns, false);<NEW_LINE>} | = new ArrayList<String>(); |
718,526 | private void init() {<NEW_LINE>// WARNING: called from ctor so must not be overridden (i.e. must be private or final)<NEW_LINE>this.setLayout(new BorderLayout());<NEW_LINE>// MAIN PANEL<NEW_LINE>JPanel mainPanel = new JPanel();<NEW_LINE>Border margin = new EmptyBorder(10, 10, 5, 10);<NEW_LINE>mainPanel.setBorder(margin);<NEW_LINE>mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));<NEW_LINE>mainPanel.add(makeTitlePanel());<NEW_LINE>myJTable = new JTable(model);<NEW_LINE>myJTable.setRowSorter(new ObjectTableSorter(model).fixLastRow());<NEW_LINE>JMeterUtils.applyHiDPI(myJTable);<NEW_LINE>HeaderAsPropertyRendererWrapper.setupDefaultRenderer(myJTable);<NEW_LINE>myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70));<NEW_LINE>RendererUtils.applyRenderers(myJTable, RENDERERS);<NEW_LINE>myScrollPane = new JScrollPane(myJTable);<NEW_LINE>this.add(mainPanel, BorderLayout.NORTH);<NEW_LINE>this.add(myScrollPane, BorderLayout.CENTER);<NEW_LINE>saveTable.addActionListener(this);<NEW_LINE>JPanel opts = new JPanel();<NEW_LINE>opts.add(useGroupName, BorderLayout.WEST);<NEW_LINE>opts.add(saveTable, BorderLayout.CENTER);<NEW_LINE>opts.<MASK><NEW_LINE>this.add(opts, BorderLayout.SOUTH);<NEW_LINE>} | add(saveHeaders, BorderLayout.EAST); |
507,848 | @Consumes(MediaType.MULTIPART_FORM_DATA)<NEW_LINE>public Response uploadFile(@FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail) {<NEW_LINE>Config config = createConfig();<NEW_LINE>if (uploadedInputStream == null) {<NEW_LINE>String msg = "input stream is null";<NEW_LINE>LOG.error(msg);<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).type(MediaType.APPLICATION_JSON).entity(Utils.createMessage(msg)).build();<NEW_LINE>}<NEW_LINE>if (fileDetail == null) {<NEW_LINE>String msg = "form data content disposition is null";<NEW_LINE>LOG.error(msg);<NEW_LINE>return Response.status(Response.Status.BAD_REQUEST).type(MediaType.APPLICATION_JSON).entity(Utils.createMessage(msg)).build();<NEW_LINE>}<NEW_LINE>String uploadDir = config.getStringValue(FILE_SYSTEM_DIRECTORY);<NEW_LINE>final String fileName = UUID.randomUUID() + "-" + fileDetail.getFileName();<NEW_LINE>final String uploadedFileLocation = uploadDir + "/" + fileName;<NEW_LINE>// save it<NEW_LINE>try {<NEW_LINE>FileHelper.writeToFile(uploadedInputStream, uploadedFileLocation);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("error uploading file {}", <MASK><NEW_LINE>return Response.serverError().type(MediaType.APPLICATION_JSON).entity(Utils.createMessage(e.getMessage())).build();<NEW_LINE>}<NEW_LINE>String uri = String.format("http://%s:%s/api/v1/file/download/%s", getHostNameOrIP(), getPort(), fileName);<NEW_LINE>return Response.status(Response.Status.OK).entity(uri).build();<NEW_LINE>} | fileDetail.getFileName(), e); |
1,122,253 | public void selectMapOfInt32(Blackhole blackhole, DriverState state) throws Throwable {<NEW_LINE>int num = state.getRandomNumber();<NEW_LINE>int rows <MASK><NEW_LINE>ConsumeValueFunction func = state.getConsumeFunction((b, r, l, i) -> b.consume(r.getObject(i)));<NEW_LINE>int l = 0;<NEW_LINE>try (Statement stmt = executeQuery(state, "select cast((arrayMap(x->x+1000, range(1, number % 100)), arrayMap(x->x+10000, range(1, number %100))) as Map(Int32, Int32)) as v from numbers(?)", rows)) {<NEW_LINE>ResultSet rs = stmt.getResultSet();<NEW_LINE>while (rs.next()) {<NEW_LINE>func.consume(blackhole, rs, l++, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (l != rows) {<NEW_LINE>throw new IllegalStateException(String.format(Locale.ROOT, "Expected %d rows but got %d", rows, l));<NEW_LINE>}<NEW_LINE>} | = state.getSampleSize() + num; |
1,557,754 | public void run() {<NEW_LINE>String dn;<NEW_LINE>File f = new File((String) o);<NEW_LINE>if (f.exists()) {<NEW_LINE>FileObject fo = FileUtil.toFileObject(f);<NEW_LINE>Project p = FileOwnerQuery.getOwner(fo);<NEW_LINE>if (p != null) {<NEW_LINE>ProjectInformation pi = (ProjectInformation) ProjectUtils.getInformation(p);<NEW_LINE>if (pi != null) {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, "CTL_SourcesModel_Column_Name_ProjectSources", f.getPath(<MASK><NEW_LINE>} else {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, "CTL_SourcesModel_Column_Name_LibrarySources", f.getPath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dn = NbBundle.getMessage(SourcesNodeModel.class, "CTL_SourcesModel_Column_Name_LibrarySources", f.getPath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dn = (String) o;<NEW_LINE>}<NEW_LINE>synchronized (pathWithProject) {<NEW_LINE>pathWithProject.put(o, dn);<NEW_LINE>}<NEW_LINE>fireNodeChanged(o);<NEW_LINE>} | ), pi.getDisplayName()); |
734,390 | public void channelRead(ChannelHandlerContext ctx, Object msg) {<NEW_LINE>if (msg instanceof StreamResponseBuilder) {<NEW_LINE><MASK><NEW_LINE>final Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>headers.putAll(builder.getHeaders());<NEW_LINE>final Map<String, String> wireAttrs = WireAttributeHelper.removeWireAttributes(headers);<NEW_LINE>final StreamWriter writer = new StreamWriter(ctx, _maxContentLength);<NEW_LINE>ctx.channel().attr(NettyChannelAttributes.RESPONSE_WRITER).set(writer);<NEW_LINE>final StreamResponse response = builder.unsafeSetHeaders(headers).build(EntityStreams.newEntityStream(writer));<NEW_LINE>final TransportCallback<StreamResponse> callback = ctx.channel().attr(NettyChannelAttributes.RESPONSE_CALLBACK).getAndSet(null);<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onResponse(TransportResponseImpl.success(response, wireAttrs));<NEW_LINE>}<NEW_LINE>} else if (msg instanceof ByteString) {<NEW_LINE>final StreamWriter writer = msg == StreamWriter.EOF ? ctx.channel().attr(NettyChannelAttributes.RESPONSE_WRITER).getAndSet(null) : ctx.channel().attr(NettyChannelAttributes.RESPONSE_WRITER).get();<NEW_LINE>if (writer != null) {<NEW_LINE>writer.onDataAvailable((ByteString) msg);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>}<NEW_LINE>} | final StreamResponseBuilder builder = (StreamResponseBuilder) msg; |
655,824 | protected ExtensionSearch toSearchEntry(Extension extension, SearchStats stats) {<NEW_LINE>var entry = extension.toSearch();<NEW_LINE>var ratingValue = 0.0;<NEW_LINE>if (entry.averageRating != null) {<NEW_LINE>var reviewCount = repositories.countActiveReviews(extension);<NEW_LINE>// Reduce the rating relevance if there are only few reviews<NEW_LINE>var countRelevance = saturate(reviewCount, 0.25);<NEW_LINE>ratingValue = (entry.averageRating / 5.0) * countRelevance;<NEW_LINE>}<NEW_LINE>var downloadsValue = entry.downloadCount / stats.downloadRef;<NEW_LINE>var timestamp = extension.getLatest().getTimestamp();<NEW_LINE>var timestampValue = Duration.between(stats.oldest, timestamp)<MASK><NEW_LINE>entry.relevance = ratingRelevance * limit(ratingValue) + downloadsRelevance * limit(downloadsValue) + timestampRelevance * limit(timestampValue);<NEW_LINE>// Reduce the relevance value of unverified extensions<NEW_LINE>if (!isVerified(extension.getLatest())) {<NEW_LINE>entry.relevance *= unverifiedRelevance;<NEW_LINE>}<NEW_LINE>if (Double.isNaN(entry.relevance) || Double.isInfinite(entry.relevance)) {<NEW_LINE>var message = "Invalid relevance for entry " + entry.namespace + "." + entry.name;<NEW_LINE>try {<NEW_LINE>message += " " + new ObjectMapper().writeValueAsString(stats);<NEW_LINE>} catch (JsonProcessingException exc) {<NEW_LINE>// Ignore exception<NEW_LINE>}<NEW_LINE>logger.error(message);<NEW_LINE>entry.relevance = 0.0;<NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>} | .toSeconds() / stats.timestampRef; |
1,518,842 | private MTableScrollPane<HeapHistogram.ClassInfo> createScrollPane(long totalInstances, long totalBytes, boolean sourceDisplayed) {<NEW_LINE>final MTableScrollPane<HeapHistogram.ClassInfo> tableScrollPane = new MTableScrollPane<>();<NEW_LINE>final MTable<ClassInfo> myTable = tableScrollPane.getTable();<NEW_LINE>myTable.addColumn("name", getString("Classe"));<NEW_LINE>myTable.addColumn("bytes", getString("Taille"));<NEW_LINE>final TableColumn pctTailleColumn = new TableColumn(myTable.getColumnCount());<NEW_LINE>pctTailleColumn.setIdentifier(myTable.getColumnCount());<NEW_LINE>pctTailleColumn<MASK><NEW_LINE>myTable.addColumn(pctTailleColumn);<NEW_LINE>myTable.addColumn("instancesCount", getString("Instances"));<NEW_LINE>final TableColumn pctInstancesColumn = new TableColumn(myTable.getColumnCount());<NEW_LINE>pctInstancesColumn.setIdentifier(myTable.getColumnCount());<NEW_LINE>pctInstancesColumn.setHeaderValue(getString("pct_instances"));<NEW_LINE>myTable.addColumn(pctInstancesColumn);<NEW_LINE>if (sourceDisplayed) {<NEW_LINE>myTable.addColumn("source", getString("Source"));<NEW_LINE>}<NEW_LINE>myTable.setColumnCellRenderer("bytes", new BytesTableCellRenderer());<NEW_LINE>pctTailleColumn.setCellRenderer(new PctTailleTableCellRenderer(totalBytes));<NEW_LINE>pctInstancesColumn.setCellRenderer(new PctInstancesTableCellRenderer(totalInstances));<NEW_LINE>return tableScrollPane;<NEW_LINE>} | .setHeaderValue(getString("pct_taille")); |
452,623 | private void updateColors() {<NEW_LINE>FontColorSettings fcs = fontsColors.allInstances().iterator().next();<NEW_LINE>String namePrefix <MASK><NEW_LINE>// Update colors.<NEW_LINE>Coloring keyColoring = Coloring.fromAttributeSet(fcs.getTokenFontColors(namePrefix + PropertiesTokenContext.KEY.getName()));<NEW_LINE>keyColor = keyColoring.getForeColor();<NEW_LINE>keyBackground = keyColoring.getBackColor();<NEW_LINE>Coloring valueColoring = Coloring.fromAttributeSet(fcs.getTokenFontColors(namePrefix + PropertiesTokenContext.VALUE.getName()));<NEW_LINE>valueColor = valueColoring.getForeColor();<NEW_LINE>valueBackground = valueColoring.getBackColor();<NEW_LINE>Coloring highlightColoring = Coloring.fromAttributeSet(fcs.getFontColors(FontColorNames.HIGHLIGHT_SEARCH_COLORING));<NEW_LINE>highlightColor = highlightColoring.getForeColor();<NEW_LINE>highlightBackground = highlightColoring.getBackColor();<NEW_LINE>// If there is not the colors specified use default inherited colors.<NEW_LINE>Coloring defaultColoring = Coloring.fromAttributeSet(fcs.getFontColors(FontColorNames.DEFAULT_COLORING));<NEW_LINE>font = defaultColoring.getFont();<NEW_LINE>Color defaultForeground = defaultColoring.getForeColor();<NEW_LINE>Color defaultBackground = defaultColoring.getBackColor();<NEW_LINE>if (keyColor == null)<NEW_LINE>keyColor = defaultForeground;<NEW_LINE>if (keyBackground == null)<NEW_LINE>keyBackground = defaultBackground;<NEW_LINE>if (valueColor == null)<NEW_LINE>valueColor = defaultForeground;<NEW_LINE>if (valueBackground == null)<NEW_LINE>valueBackground = defaultBackground;<NEW_LINE>if (highlightColor == null)<NEW_LINE>highlightColor = new Color(SystemColor.textHighlightText.getRGB());<NEW_LINE>if (highlightBackground == null)<NEW_LINE>highlightBackground = new Color(SystemColor.textHighlight.getRGB());<NEW_LINE>if (shadowColor == null)<NEW_LINE>shadowColor = new Color(SystemColor.controlHighlight.getRGB());<NEW_LINE>} | = PropertiesTokenContext.context.getNamePrefix(); |
1,649,488 | public void load(int AD_Workflow_ID, boolean readWrite) {<NEW_LINE>log.fine("RW=" + readWrite + " - AD_Workflow_ID=" + AD_Workflow_ID);<NEW_LINE>if (AD_Workflow_ID == 0)<NEW_LINE>return;<NEW_LINE>int AD_Client_ID = Env.<MASK><NEW_LINE>// Get Workflow<NEW_LINE>m_wf = new MWorkflow(Env.getCtx(), AD_Workflow_ID, null);<NEW_LINE>centerPanel.removeAll();<NEW_LINE>centerPanel.setReadWrite(readWrite);<NEW_LINE>if (readWrite)<NEW_LINE>centerPanel.setWorkflow(m_wf);<NEW_LINE>// Add Nodes for Paint<NEW_LINE>MWFNode[] nodes = m_wf.getNodes(true, AD_Client_ID);<NEW_LINE>for (int i = 0; i < nodes.length; i++) {<NEW_LINE>WFNode wfn = new WFNode(nodes[i]);<NEW_LINE>wfn.addPropertyChangeListener(WFNode.PROPERTY_SELECTED, this);<NEW_LINE>// in editor mode & owned<NEW_LINE>boolean // in editor mode & owned<NEW_LINE>rw = readWrite && (AD_Client_ID == nodes[i].getAD_Client_ID());<NEW_LINE>centerPanel.add(wfn, rw);<NEW_LINE>// Add Lines<NEW_LINE>MWFNodeNext[] nexts = nodes[i].getTransitions(AD_Client_ID);<NEW_LINE>for (int j = 0; j < nexts.length; j++) centerPanel.add(new WFLine(nexts[j]), false);<NEW_LINE>}<NEW_LINE>// Info Text<NEW_LINE>StringBuffer msg = new StringBuffer("<HTML>");<NEW_LINE>msg.append("<H2>").append(m_wf.getName(true)).append("</H2>");<NEW_LINE>String s = m_wf.getDescription(true);<NEW_LINE>if (s != null && s.length() > 0)<NEW_LINE>msg.append("<B>").append(s).append("</B>");<NEW_LINE>s = m_wf.getHelp(true);<NEW_LINE>if (s != null && s.length() > 0)<NEW_LINE>msg.append("<BR>").append(s);<NEW_LINE>msg.append("</HTML>");<NEW_LINE>infoTextPane.setText(msg.toString());<NEW_LINE>infoTextPane.setCaretPosition(0);<NEW_LINE>// Layout<NEW_LINE>centerPanel.validate();<NEW_LINE>centerPanel.repaint();<NEW_LINE>validate();<NEW_LINE>} | getAD_Client_ID(Env.getCtx()); |
524,745 | void load(List<TabletMetadata> tablets, Files files) {<NEW_LINE>for (TabletMetadata tablet : tablets) {<NEW_LINE>// send files to tablet sever<NEW_LINE>// ideally there should only be one tablet location to send all the files<NEW_LINE>TabletMetadata.Location location = tablet.getLocation();<NEW_LINE>HostAndPort server = null;<NEW_LINE>if (location == null) {<NEW_LINE>locationLess++;<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>server = location.getHostAndPort();<NEW_LINE>}<NEW_LINE>Set<TabletFile> loadedFiles = tablet.getLoaded().keySet();<NEW_LINE>Map<String, MapFileInfo> thriftImports = new HashMap<>();<NEW_LINE>for (final Bulk.FileInfo fileInfo : files) {<NEW_LINE>Path fullPath = new Path(<MASK><NEW_LINE>TabletFile bulkFile = new TabletFile(fullPath);<NEW_LINE>if (!loadedFiles.contains(bulkFile)) {<NEW_LINE>thriftImports.put(fileInfo.getFileName(), new MapFileInfo(fileInfo.getEstFileSize()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addToQueue(server, tablet.getExtent(), thriftImports);<NEW_LINE>}<NEW_LINE>sendQueued(4 * 1024 * 1024);<NEW_LINE>} | bulkDir, fileInfo.getFileName()); |
752,835 | public void sawOpcode(int seen) {<NEW_LINE>if (getStack().getStackDepth() == 0) {<NEW_LINE>this.lastEmptyStackPC = getPC();<NEW_LINE>}<NEW_LINE>if ((seen == Const.DCMPG || seen == Const.DCMPL || seen == Const.FCMPL || seen == Const.FCMPG) && getStack().getStackDepth() == 2) {<NEW_LINE>int[] startEnd = new int[] { this.lastEmptyStackPC, getPC() };<NEW_LINE>for (Iterator<int[]> iterator = twoDoublesInStack.iterator(); iterator.hasNext(); ) {<NEW_LINE>int[] oldStartEnd = iterator.next();<NEW_LINE>if (codeEquals(oldStartEnd, startEnd)) {<NEW_LINE>Item item1 = getStack().getStackItem(0);<NEW_LINE>Item item2 = getStack().getStackItem(1);<NEW_LINE>accumulator.accumulateBug(new BugInstance("CO_COMPARETO_INCORRECT_FLOATING", NORMAL_PRIORITY).addClassAndMethod(this).addType(item1.getSignature()).addMethod(item1.getSignature().equals("D") ? DOUBLE_DESCRIPTOR : FLOAT_DESCRIPTOR).describe(MethodAnnotation.SHOULD_CALL).addValueSource(item1, this).addValueSource<MASK><NEW_LINE>iterator.remove();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>twoDoublesInStack.add(startEnd);<NEW_LINE>}<NEW_LINE>if (seen == Const.IRETURN) {<NEW_LINE>OpcodeStack.Item top = stack.getStackItem(0);<NEW_LINE>Object o = top.getConstant();<NEW_LINE>if (o instanceof Integer && ((Integer) o).intValue() == Integer.MIN_VALUE) {<NEW_LINE>accumulator.accumulateBug(new BugInstance(this, "CO_COMPARETO_RESULTS_MIN_VALUE", NORMAL_PRIORITY).addClassAndMethod(this), this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (item2, this), this); |
1,610,219 | public ApiResponse<Void> addPetWithHttpInfo(Pet pet) throws ApiException {<NEW_LINE>Object localVarPostBody = pet;<NEW_LINE>// verify the required parameter 'pet' is set<NEW_LINE>if (pet == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/xml" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };<NEW_LINE>return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false);<NEW_LINE>} | HashMap<String, String>(); |
1,356,400 | static IBaseResource parseResourceFromRequest(RequestDetails theRequest, @Nonnull BaseMethodBinding<?> theMethodBinding, Class<? extends IBaseResource> theResourceType) {<NEW_LINE>if (theRequest.getResource() != null) {<NEW_LINE>return theRequest.getResource();<NEW_LINE>}<NEW_LINE>IBaseResource retVal = null;<NEW_LINE>if (theResourceType != null && IBaseBinary.class.isAssignableFrom(theResourceType)) {<NEW_LINE>String ct = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);<NEW_LINE>if (EncodingEnum.forContentTypeStrict(ct) == null) {<NEW_LINE>FhirContext ctx = theRequest.getServer().getFhirContext();<NEW_LINE>IBaseBinary binary = BinaryUtil.newBinary(ctx);<NEW_LINE>binary.<MASK><NEW_LINE>binary.setContentType(ct);<NEW_LINE>binary.setContent(theRequest.loadRequestContents());<NEW_LINE>retVal = binary;<NEW_LINE>if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {<NEW_LINE>String securityContext = theRequest.getHeader(Constants.HEADER_X_SECURITY_CONTEXT);<NEW_LINE>if (isNotBlank(securityContext)) {<NEW_LINE>BinaryUtil.setSecurityContext(ctx, binary, securityContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isNonFhirPatch = false;<NEW_LINE>if (theRequest.getRequestType() == RequestTypeEnum.PATCH) {<NEW_LINE>EncodingEnum requestEncoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequest, true);<NEW_LINE>if (requestEncoding == null) {<NEW_LINE>isNonFhirPatch = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (retVal == null && !isNonFhirPatch) {<NEW_LINE>retVal = loadResourceFromRequest(theRequest, theMethodBinding, theResourceType);<NEW_LINE>}<NEW_LINE>theRequest.setResource(retVal);<NEW_LINE>return retVal;<NEW_LINE>} | setId(theRequest.getId()); |
607,515 | public static void dissectReplayNewLeadershipTerm(final ClusterEventCode eventCode, final MutableDirectBuffer buffer, final int offset, final StringBuilder builder) {<NEW_LINE>int absoluteOffset = offset;<NEW_LINE>absoluteOffset += dissectLogHeader(CONTEXT, eventCode, buffer, absoluteOffset, builder);<NEW_LINE>final int memberId = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>final boolean isInElection = 0 != buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>final long leadershipTermId = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_LONG;<NEW_LINE>final long logPosition = <MASK><NEW_LINE>absoluteOffset += SIZE_OF_LONG;<NEW_LINE>final long timestamp = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_LONG;<NEW_LINE>final long termBaseLogPosition = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_LONG;<NEW_LINE>final int appVersion = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>final int timeUnitLength = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);<NEW_LINE>absoluteOffset += SIZE_OF_INT;<NEW_LINE>builder.append(": memberId=").append(memberId);<NEW_LINE>builder.append(" isInElection=").append(isInElection);<NEW_LINE>builder.append(" leadershipTermId=").append(leadershipTermId);<NEW_LINE>builder.append(" logPosition=").append(logPosition);<NEW_LINE>builder.append(" termBaseLogPosition=").append(termBaseLogPosition);<NEW_LINE>builder.append(" appVersion=").append(appVersion);<NEW_LINE>builder.append(" timestamp=").append(timestamp);<NEW_LINE>builder.append(" timeUnit=");<NEW_LINE>buffer.getStringWithoutLengthAscii(absoluteOffset, timeUnitLength, builder);<NEW_LINE>} | buffer.getLong(absoluteOffset, LITTLE_ENDIAN); |
441,785 | private void playBreakOrPickupSound() {<NEW_LINE>SoundEvent soundEvent;<NEW_LINE>float volume;<NEW_LINE>float pitch;<NEW_LINE>if (soundMode == SoundMode.FLUID) {<NEW_LINE>// This code is based on what BucketItem does<NEW_LINE>Fluid rawFluid = blockState.getFluidState().getType();<NEW_LINE>if (rawFluid.is(FluidTags.LAVA)) {<NEW_LINE>soundEvent = SoundEvents.BUCKET_FILL_LAVA;<NEW_LINE>} else {<NEW_LINE>soundEvent = SoundEvents.BUCKET_FILL;<NEW_LINE>}<NEW_LINE>volume = 1;<NEW_LINE>pitch = 1;<NEW_LINE>} else if (soundMode == SoundMode.BLOCK) {<NEW_LINE>SoundType soundType = blockState.getSoundType();<NEW_LINE>soundEvent = soundType.getBreakSound();<NEW_LINE>volume = soundType.volume;<NEW_LINE>pitch = soundType.pitch;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SimpleSoundInstance sound = new SimpleSoundInstance(soundEvent, SoundSource.BLOCKS, (volume + 1.0F) / 2.0F, pitch * 0.8F, pos);<NEW_LINE>Minecraft.getInstance().<MASK><NEW_LINE>} | getSoundManager().play(sound); |
1,796,391 | final GetSegmentVersionsResult executeGetSegmentVersions(GetSegmentVersionsRequest getSegmentVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSegmentVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSegmentVersionsRequest> request = null;<NEW_LINE>Response<GetSegmentVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSegmentVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSegmentVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSegmentVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSegmentVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSegmentVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint"); |
38,996 | public static QueryEdgeDriverResponse unmarshall(QueryEdgeDriverResponse queryEdgeDriverResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryEdgeDriverResponse.setRequestId(_ctx.stringValue("QueryEdgeDriverResponse.RequestId"));<NEW_LINE>queryEdgeDriverResponse.setSuccess(_ctx.booleanValue("QueryEdgeDriverResponse.Success"));<NEW_LINE>queryEdgeDriverResponse.setCode(_ctx.stringValue("QueryEdgeDriverResponse.Code"));<NEW_LINE>queryEdgeDriverResponse.setErrorMessage(_ctx.stringValue("QueryEdgeDriverResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("QueryEdgeDriverResponse.Data.Total"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryEdgeDriverResponse.Data.PageSize"));<NEW_LINE>data.setCurrentPage(_ctx.integerValue("QueryEdgeDriverResponse.Data.CurrentPage"));<NEW_LINE>List<Driver> driverList = new ArrayList<Driver>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryEdgeDriverResponse.Data.DriverList.Length"); i++) {<NEW_LINE>Driver driver = new Driver();<NEW_LINE>driver.setDriverId(_ctx.stringValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].DriverId"));<NEW_LINE>driver.setDriverName(_ctx.stringValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].DriverName"));<NEW_LINE>driver.setDriverProtocol(_ctx.stringValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].DriverProtocol"));<NEW_LINE>driver.setRuntime(_ctx.stringValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].Runtime"));<NEW_LINE>driver.setCpuArch(_ctx.stringValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].CpuArch"));<NEW_LINE>driver.setType(_ctx.integerValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].Type"));<NEW_LINE>driver.setIsBuiltIn(_ctx.booleanValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].IsBuiltIn"));<NEW_LINE>driver.setGmtCreateTimestamp(_ctx.longValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].GmtCreateTimestamp"));<NEW_LINE>driver.setGmtModifiedTimestamp(_ctx.longValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].GmtModifiedTimestamp"));<NEW_LINE>driver.setIsApply(_ctx.booleanValue<MASK><NEW_LINE>driver.setUseOfficialConfig(_ctx.integerValue("QueryEdgeDriverResponse.Data.DriverList[" + i + "].UseOfficialConfig"));<NEW_LINE>driverList.add(driver);<NEW_LINE>}<NEW_LINE>data.setDriverList(driverList);<NEW_LINE>queryEdgeDriverResponse.setData(data);<NEW_LINE>return queryEdgeDriverResponse;<NEW_LINE>} | ("QueryEdgeDriverResponse.Data.DriverList[" + i + "].IsApply")); |
1,712,140 | public <T> String predicate(UnboundPredicate<T> pred) {<NEW_LINE>switch(pred.op()) {<NEW_LINE>case IS_NULL:<NEW_LINE>return pred.ref().name() + " IS NULL";<NEW_LINE>case NOT_NULL:<NEW_LINE>return pred.ref().name() + " IS NOT NULL";<NEW_LINE>case IS_NAN:<NEW_LINE>return "is_nan(" + pred.ref().name() + ")";<NEW_LINE>case NOT_NAN:<NEW_LINE>return "not_nan(" + pred.ref().name() + ")";<NEW_LINE>case LT:<NEW_LINE>return pred.ref().name() + " < " + sqlString(pred.literal());<NEW_LINE>case LT_EQ:<NEW_LINE>return pred.ref().name() + " <= " + sqlString(pred.literal());<NEW_LINE>case GT:<NEW_LINE>return pred.ref().name() + " > " + sqlString(pred.literal());<NEW_LINE>case GT_EQ:<NEW_LINE>return pred.ref().name() + " >= " + sqlString(pred.literal());<NEW_LINE>case EQ:<NEW_LINE>return pred.ref().name() + " = " + <MASK><NEW_LINE>case NOT_EQ:<NEW_LINE>return pred.ref().name() + " != " + sqlString(pred.literal());<NEW_LINE>case STARTS_WITH:<NEW_LINE>return pred.ref().name() + " LIKE '" + pred.literal() + "%'";<NEW_LINE>case NOT_STARTS_WITH:<NEW_LINE>return pred.ref().name() + " NOT LIKE '" + pred.literal() + "%'";<NEW_LINE>case IN:<NEW_LINE>return pred.ref().name() + " IN (" + sqlString(pred.literals()) + ")";<NEW_LINE>case NOT_IN:<NEW_LINE>return pred.ref().name() + " NOT IN (" + sqlString(pred.literals()) + ")";<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Cannot convert predicate to SQL: " + pred);<NEW_LINE>}<NEW_LINE>} | sqlString(pred.literal()); |
1,145,013 | public static GetQualityResultResponse unmarshall(GetQualityResultResponse getQualityResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQualityResultResponse.setRequestId(_ctx.stringValue("GetQualityResultResponse.RequestId"));<NEW_LINE>getQualityResultResponse.setMessage(_ctx.stringValue("GetQualityResultResponse.Message"));<NEW_LINE>getQualityResultResponse.setCode(_ctx.stringValue("GetQualityResultResponse.Code"));<NEW_LINE>getQualityResultResponse.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.ChannelTypeName"));<NEW_LINE>getQualityResultResponse.setSuccess(_ctx.booleanValue("GetQualityResultResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNo(_ctx.integerValue("GetQualityResultResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.integerValue("GetQualityResultResponse.Data.PageSize"));<NEW_LINE>data.setTotalNum(_ctx.integerValue("GetQualityResultResponse.Data.TotalNum"));<NEW_LINE>List<QualityResultResponseListItem> qualityResultResponseList = new ArrayList<QualityResultResponseListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQualityResultResponse.Data.QualityResultResponseList.Length"); i++) {<NEW_LINE>QualityResultResponseListItem qualityResultResponseListItem = new QualityResultResponseListItem();<NEW_LINE>qualityResultResponseListItem.setTouchId(_ctx.stringValue<MASK><NEW_LINE>qualityResultResponseListItem.setServicerName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerName"));<NEW_LINE>qualityResultResponseListItem.setMemberName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].MemberName"));<NEW_LINE>qualityResultResponseListItem.setProjectName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectName"));<NEW_LINE>qualityResultResponseListItem.setProjectId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectId"));<NEW_LINE>qualityResultResponseListItem.setChannelType(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelType"));<NEW_LINE>qualityResultResponseListItem.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelTypeName"));<NEW_LINE>qualityResultResponseListItem.setTouchStartTime(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchStartTime"));<NEW_LINE>qualityResultResponseListItem.setServicerId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerId"));<NEW_LINE>qualityResultResponseListItem.setRuleName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleName"));<NEW_LINE>qualityResultResponseListItem.setRuleId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleId"));<NEW_LINE>qualityResultResponseListItem.setGroupName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupName"));<NEW_LINE>qualityResultResponseListItem.setGroupId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupId"));<NEW_LINE>qualityResultResponseListItem.setInstanceName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].InstanceName"));<NEW_LINE>qualityResultResponseListItem.setHitStatus(_ctx.booleanValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitStatus"));<NEW_LINE>qualityResultResponseListItem.setHitDetail(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitDetail"));<NEW_LINE>qualityResultResponseList.add(qualityResultResponseListItem);<NEW_LINE>}<NEW_LINE>data.setQualityResultResponseList(qualityResultResponseList);<NEW_LINE>getQualityResultResponse.setData(data);<NEW_LINE>return getQualityResultResponse;<NEW_LINE>} | ("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchId")); |
1,407,150 | public DomainResponse createDomainResponse(Domain domain) {<NEW_LINE>DomainResponse domainResponse = new DomainResponse();<NEW_LINE>domainResponse.setDomainName(domain.getName());<NEW_LINE>domainResponse.setId(domain.getUuid());<NEW_LINE>domainResponse.setLevel(domain.getLevel());<NEW_LINE>domainResponse.setCreated(domain.getCreated());<NEW_LINE>domainResponse.<MASK><NEW_LINE>Domain parentDomain = ApiDBUtils.findDomainById(domain.getParent());<NEW_LINE>if (parentDomain != null) {<NEW_LINE>domainResponse.setParentDomainId(parentDomain.getUuid());<NEW_LINE>}<NEW_LINE>StringBuilder domainPath = new StringBuilder("ROOT");<NEW_LINE>(domainPath.append(domain.getPath())).deleteCharAt(domainPath.length() - 1);<NEW_LINE>domainResponse.setPath(domainPath.toString());<NEW_LINE>if (domain.getParent() != null) {<NEW_LINE>domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());<NEW_LINE>}<NEW_LINE>if (domain.getChildCount() > 0) {<NEW_LINE>domainResponse.setHasChild(true);<NEW_LINE>}<NEW_LINE>domainResponse.setObjectName("domain");<NEW_LINE>return domainResponse;<NEW_LINE>} | setNetworkDomain(domain.getNetworkDomain()); |
598,509 | public String toStringk() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("(");<NEW_LINE><MASK><NEW_LINE>List<Config> l = getOrigins(true);<NEW_LINE>if (l.size() > 0) {<NEW_LINE>sb.append(" ->");<NEW_LINE>boolean first = true;<NEW_LINE>for (Config c : l) {<NEW_LINE>if (c.inState == null)<NEW_LINE>continue;<NEW_LINE>if (!first)<NEW_LINE>sb.append(";");<NEW_LINE>first = false;<NEW_LINE>sb.append(c.id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append(" q:");<NEW_LINE>sb.append(this.q.number);<NEW_LINE>if (this.x != null && this.x.length() != 0)<NEW_LINE>sb.append(",x:" + this.x);<NEW_LINE>if (this.y != null && this.y.length() != 0)<NEW_LINE>sb.append(",y:" + this.y);<NEW_LINE>if (this.origin != null)<NEW_LINE>sb.append(", origin:" + this.origin.number);<NEW_LINE>sb.append(", order:" + this.order);<NEW_LINE>if (xcomp) {<NEW_LINE>sb.append(", path:" + this.x);<NEW_LINE>} else {<NEW_LINE>sb.append(", path:" + new Tstring(this.path));<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>return sb.toString();<NEW_LINE>} | sb.append(this.id); |
303,001 | public final Object execute(VirtualFrame frame) {<NEW_LINE>final Object self = RubyArguments.getSelf(frame);<NEW_LINE>// Execute the arguments<NEW_LINE>Object[] superArguments = (Object[]) arguments.execute(frame);<NEW_LINE>ArgumentsDescriptor descriptor = this.descriptor;<NEW_LINE>boolean ruby2KeywordsHash = false;<NEW_LINE>if (isSplatted) {<NEW_LINE>// superArguments already splatted<NEW_LINE>ruby2KeywordsHash = isRuby2KeywordsHash(superArguments, superArguments.length);<NEW_LINE>if (ruby2KeywordsHash) {<NEW_LINE>descriptor = KeywordArgumentsDescriptorManager.EMPTY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove empty kwargs in the caller, so the callee does not need to care about this special case<NEW_LINE>if (descriptor instanceof KeywordArgumentsDescriptor && emptyKeywordArguments(superArguments)) {<NEW_LINE>superArguments = removeEmptyKeywordArguments(superArguments);<NEW_LINE>descriptor = EmptyArgumentsDescriptor.INSTANCE;<NEW_LINE>}<NEW_LINE>// Execute the block<NEW_LINE>final Object blockObject = block.execute(frame);<NEW_LINE>final InternalMethod superMethod = executeLookupSuperMethod(frame, self);<NEW_LINE>if (callSuperMethodNode == null) {<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>callSuperMethodNode = <MASK><NEW_LINE>}<NEW_LINE>return callSuperMethodNode.execute(frame, self, superMethod, descriptor, superArguments, blockObject, ruby2KeywordsHash ? this : null);<NEW_LINE>} | insert(CallSuperMethodNode.create()); |
1,732,739 | protected Widget createMainWidget() {<NEW_LINE>SimplePanel wrapper = new SimplePanel();<NEW_LINE>wrapper.setStyleName(RES.styles().wrapper());<NEW_LINE>LayoutGrid connGrid = new LayoutGrid(initialConfig_.size(), 2);<NEW_LINE>connGrid.addStyleName(RES.styles().grid());<NEW_LINE>for (int idxParams = 0; idxParams < initialConfig_.size(); idxParams++) {<NEW_LINE>final String key = initialConfig_.get(idxParams).getKey();<NEW_LINE>FormLabel label = new FormLabel(key + ":");<NEW_LINE>label.addStyleName(RES.styles().label());<NEW_LINE>connGrid.setWidget(idxParams, 0, label);<NEW_LINE>connGrid.getRowFormatter().setVerticalAlign(idxParams, HasVerticalAlignment.ALIGN_TOP);<NEW_LINE>final TextBox textbox = new TextBox();<NEW_LINE>label.setFor(textbox);<NEW_LINE>textbox.setText(initialConfig_.get(idxParams).getValue());<NEW_LINE>textbox.addStyleName(RES.styles().textbox());<NEW_LINE>connGrid.setWidget(idxParams, 1, textbox);<NEW_LINE>textbox.addChangeHandler(new ChangeHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onChange(ChangeEvent arg0) {<NEW_LINE>partsKeyValues_.put(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>wrapper.add(connGrid);<NEW_LINE>return wrapper;<NEW_LINE>} | key, textbox.getValue()); |
1,100,935 | public NodeExecutorResult executeCommand(final ExecutionContext context, final String[] command, final INodeEntry node) {<NEW_LINE>StringBuilder preview = new StringBuilder();<NEW_LINE>for (final String aCommand : command) {<NEW_LINE>preview.append("'").append(aCommand).append("'");<NEW_LINE>}<NEW_LINE>context.getExecutionLogger().log(5, "NewLocalNodeExecutor, running command (" + command.length + "): " + preview.toString());<NEW_LINE>Map<String, String> env = DataContextUtils.generateEnvVarsFromContext(context.getDataContext());<NEW_LINE>final int result;<NEW_LINE>try {<NEW_LINE>result = ScriptExecUtil.runLocalCommand(command, env, null, System.out, System.err);<NEW_LINE>if (result != 0) {<NEW_LINE>return NodeExecutorResultImpl.createFailure(NodeStepFailureReason.NonZeroResultCode, "Result code was " + result, node, result);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>return NodeExecutorResultImpl.createFailure(StepFailureReason.IOFailure, e.getMessage(), node);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>return NodeExecutorResultImpl.createFailure(StepFailureReason.Interrupted, e.getMessage(), node);<NEW_LINE>}<NEW_LINE>if (null != context.getOutputContext()) {<NEW_LINE>context.getOutputContext().addOutput("exec", "exitCode"<MASK><NEW_LINE>}<NEW_LINE>return NodeExecutorResultImpl.createSuccess(node);<NEW_LINE>} | , String.valueOf(result)); |
1,811,220 | public static void main(String[] args) throws Exception {<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(System.getProperty("user.dir") + "/BookmarksDeleter.docx"));<NEW_LINE>MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();<NEW_LINE>// Before..<NEW_LINE>// System.out.println(XmlUtils.marshaltoString(documentPart.getJaxbElement(), true, true));<NEW_LINE>org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml<MASK><NEW_LINE>Body body = wmlDocumentEl.getBody();<NEW_LINE>fixRange(body.getContent(), "CTBookmark", "CTMarkupRange");<NEW_LINE>// After<NEW_LINE>// System.out.println(XmlUtils.marshaltoString(documentPart.getJaxbElement(), true, true));<NEW_LINE>// or save the docx...<NEW_LINE>Docx4J.save(wordMLPackage, new java.io.File(System.getProperty("user.dir") + "/OUT_BookmarksDeleter.docx"));<NEW_LINE>} | .Document) documentPart.getJaxbElement(); |
328,155 | public Mono<Response<Void>> syncFunctionsWithResponseAsync(String resourceGroupName, String name) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.syncFunctions(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
313,799 | public GetFirewallRuleGroupAssociationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetFirewallRuleGroupAssociationResult getFirewallRuleGroupAssociationResult = new GetFirewallRuleGroupAssociationResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getFirewallRuleGroupAssociationResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("FirewallRuleGroupAssociation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getFirewallRuleGroupAssociationResult.setFirewallRuleGroupAssociation(FirewallRuleGroupAssociationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getFirewallRuleGroupAssociationResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,108,701 | protected void processExtension(SchemaRep.Extension el) throws Schema2BeansException {<NEW_LINE>if (debug)<NEW_LINE>config.messageOut.println("extension el=" + el);<NEW_LINE>String uniqueName = (String) parentUniqueNames.peek();<NEW_LINE>String name = (String) parentTypes.peek();<NEW_LINE>String base = el.getBase();<NEW_LINE>SchemaRep.ElementExpr baseDef = schema.getSchemaTypeDef(base);<NEW_LINE>// config.messageOut.println("baseDef="+baseDef);<NEW_LINE>SchemaRep.Restriction[] restrict = null;<NEW_LINE>if (baseDef instanceof SchemaRep.ContainsSubElements) {<NEW_LINE>restrict = lookForRestriction((SchemaRep.ContainsSubElements) baseDef);<NEW_LINE>// We're extending something defined internally.<NEW_LINE>if (!config.isRespectExtension())<NEW_LINE>processContainsSubElementsAndAttributes((SchemaRep.ContainsSubElements) baseDef, name);<NEW_LINE>}<NEW_LINE>addExtraDataForType(uniqueName, name, baseDef);<NEW_LINE>if (baseDef instanceof SchemaRep.ComplexType) {<NEW_LINE>SchemaRep.ComplexType complexType = (SchemaRep.ComplexType) baseDef;<NEW_LINE>String resolvedExtendsName = schema.resolveNamespace(complexType.getTypeName());<NEW_LINE>// config.messageOut.println("resolvedExtendsName="+resolvedExtendsName);<NEW_LINE>handler.setExtension(uniqueName, name, resolvedExtendsName);<NEW_LINE>}<NEW_LINE>String javaType = el.getJavaTypeName();<NEW_LINE>if (javaType != null) {<NEW_LINE>if (debug)<NEW_LINE>config.messageOut.println("Setting javatype of " + name + " to " + javaType);<NEW_LINE>handler.javaType(uniqueName, name, javaType);<NEW_LINE>if (restrict != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>processContainsSubElementsAndAttributes(el, name);<NEW_LINE>} | addExtraDataNode(uniqueName, name, restrict); |
931,381 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static java.util.List<com.sun.jdi.request.ClassUnloadRequest> classUnloadRequests0(com.sun.jdi.request.EventRequestManager a) {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.request.EventRequestManager", "classUnloadRequests", "JDI CALL: com.sun.jdi.request.EventRequestManager({0}).classUnloadRequests()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>java.util.List<com.sun.jdi.request.ClassUnloadRequest> ret;<NEW_LINE>ret = a.classUnloadRequests();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.<MASK><NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.request.EventRequestManager", "classUnloadRequests", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.JDIExceptionReporter.report(ex); |
762,667 | public RegularStatement call() throws Exception {<NEW_LINE>Selection select = QueryBuilder.select();<NEW_LINE>for (int i = 0; i < allPrimayKeyCols.length; i++) {<NEW_LINE>select.column(allPrimayKeyCols[i]);<NEW_LINE>}<NEW_LINE>for (ColumnDefinition colDef : regularCols) {<NEW_LINE>String colName = colDef.getName();<NEW_LINE>select.column(colName).ttl(colName).writeTime(colName);<NEW_LINE>}<NEW_LINE>Where stmt = select.from(keyspace, cfDef.getName()).where(eq(partitionKeyCol, BIND_MARKER));<NEW_LINE>List<RangeQueryRecord> records = rowQuery.getCompositeRange().getRecords();<NEW_LINE>int componentIndex = 0;<NEW_LINE>for (RangeQueryRecord record : records) {<NEW_LINE>for (RangeQueryOp op : record.getOps()) {<NEW_LINE>String columnName = clusteringKeyCols.get(componentIndex).getName();<NEW_LINE>switch(op.getOperator()) {<NEW_LINE>case EQUAL:<NEW_LINE>stmt.and(eq(columnName, BIND_MARKER));<NEW_LINE>componentIndex++;<NEW_LINE>break;<NEW_LINE>case LESS_THAN:<NEW_LINE>stmt.and(lt(columnName, BIND_MARKER));<NEW_LINE>break;<NEW_LINE>case LESS_THAN_EQUALS:<NEW_LINE>stmt.and(lte(columnName, BIND_MARKER));<NEW_LINE>break;<NEW_LINE>case GREATER_THAN:<NEW_LINE>stmt.and(gt(columnName, BIND_MARKER));<NEW_LINE>break;<NEW_LINE>case GREATER_THAN_EQUALS:<NEW_LINE>stmt.and<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Cannot recognize operator: " + op.getOperator().name());<NEW_LINE>}<NEW_LINE>// end of switch stmt<NEW_LINE>;<NEW_LINE>}<NEW_LINE>// end of inner for for ops for each range query record<NEW_LINE>}<NEW_LINE>return stmt;<NEW_LINE>} | (gte(columnName, BIND_MARKER)); |
203,889 | private void statInit() {<NEW_LINE>labelValue.setText(Msg.getMsg(Env.getCtx(), "Value"));<NEW_LINE>fieldValue.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldValue.addActionListener(this);<NEW_LINE>labelName.setText(Msg.getMsg(Env.getCtx(), "Name"));<NEW_LINE>fieldName.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldName.addActionListener(this);<NEW_LINE>// start: metas: c.ghita@metas.ro : 01436<NEW_LINE>labelName2.setText(Msg.getMsg(Env.getCtx(), "Name2"));<NEW_LINE>fieldName2.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldName2.addActionListener(this);<NEW_LINE>// end: metas: c.ghita@metas.ro : 01436<NEW_LINE>labelContact.setText(Msg.getMsg(Env.getCtx(), "Contact"));<NEW_LINE>fieldContact.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldContact.addActionListener(this);<NEW_LINE>labelEMail.setText(Msg.getMsg(Env.getCtx(), "EMail"));<NEW_LINE>fieldEMail.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldEMail.addActionListener(this);<NEW_LINE>labelPostal.setText(Msg.getMsg(Env.getCtx(), "Postal"));<NEW_LINE>fieldPostal.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldPostal.addActionListener(this);<NEW_LINE>labelPhone.setText(Msg.translate(Env.getCtx(), "Phone"));<NEW_LINE>fieldPhone.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldPhone.addActionListener(this);<NEW_LINE>labelSearch.setText(Msg.translate(Env.getCtx(), "search"));<NEW_LINE>fieldSearch.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fieldSearch.addActionListener(this);<NEW_LINE>// metas<NEW_LINE>// labelSponsorNo.setText(Msg.translate(Env.getCtx(), "Sponsor"));<NEW_LINE>// fieldSponsorNo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>// fieldSponsorNo.addActionListener(this);<NEW_LINE>// metas end<NEW_LINE>checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));<NEW_LINE>checkAND.setToolTipText(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));<NEW_LINE>checkAND.setSelected(true);<NEW_LINE>checkAND.addActionListener(this);<NEW_LINE>if (m_isSOTrx) {<NEW_LINE>checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyCustomers"));<NEW_LINE>} else {<NEW_LINE>checkCustomer.setText(Msg.getMsg(Env.getCtx(), "OnlyVendors"));<NEW_LINE>}<NEW_LINE>checkCustomer.setSelected(true);<NEW_LINE>checkCustomer.setFocusable(false);<NEW_LINE>checkCustomer.setRequestFocusEnabled(false);<NEW_LINE>checkCustomer.addActionListener(this);<NEW_LINE>//<NEW_LINE>parameterPanel.setLayout(new ALayout());<NEW_LINE>parameterPanel.setPreferredSize(new Dimension(1200, 100));<NEW_LINE>//<NEW_LINE>parameterPanel.add(labelValue, new ALayoutConstraint(0, 0));<NEW_LINE>parameterPanel.add(fieldValue, null);<NEW_LINE>parameterPanel.add(labelContact, null);<NEW_LINE><MASK><NEW_LINE>parameterPanel.add(labelPhone, null);<NEW_LINE>parameterPanel.add(fieldPhone, null);<NEW_LINE>parameterPanel.add(checkCustomer, null);<NEW_LINE>//<NEW_LINE>parameterPanel.add(labelName, new ALayoutConstraint(1, 0));<NEW_LINE>parameterPanel.add(fieldName, null);<NEW_LINE>// start: metas: c.ghita@metas.ro : 01436<NEW_LINE>parameterPanel.add(labelName2, null);<NEW_LINE>parameterPanel.add(fieldName2, null);<NEW_LINE>// end: metas: c.ghita@metas.ro : 01436<NEW_LINE>parameterPanel.add(labelEMail, null);<NEW_LINE>parameterPanel.add(fieldEMail, null);<NEW_LINE>parameterPanel.add(checkAND, null);<NEW_LINE>// metas-2009_0017_AP1_G42<NEW_LINE>InfoBPartner_RadiusSearch.customize(this);<NEW_LINE>parameterPanel.add(labelPostal, new ALayoutConstraint(3, 0));<NEW_LINE>parameterPanel.add(fieldPostal, null);<NEW_LINE>parameterPanel.add(labelSearch, null);<NEW_LINE>parameterPanel.add(fieldSearch, null);<NEW_LINE>} | parameterPanel.add(fieldContact, null); |
956,697 | private void initializeConverters() {<NEW_LINE>conversionService.addConverter(ObjectIdToStringConverter.INSTANCE);<NEW_LINE>conversionService.addConverter(StringToObjectIdConverter.INSTANCE);<NEW_LINE>if (!conversionService.canConvert(ObjectId.class, BigInteger.class)) {<NEW_LINE>conversionService.addConverter(ObjectIdToBigIntegerConverter.INSTANCE);<NEW_LINE>}<NEW_LINE>if (!conversionService.canConvert(BigInteger.class, ObjectId.class)) {<NEW_LINE>conversionService.addConverter(BigIntegerToObjectIdConverter.INSTANCE);<NEW_LINE>}<NEW_LINE>if (!conversionService.canConvert(Date.class, Long.class)) {<NEW_LINE>conversionService.addConverter(ConverterBuilder.writing(Date.class, Long.class, Date::getTime).getWritingConverter());<NEW_LINE>}<NEW_LINE>if (!conversionService.canConvert(Long.class, Date.class)) {<NEW_LINE>conversionService.addConverter(ConverterBuilder.reading(Long.class, Date.class, Date<MASK><NEW_LINE>}<NEW_LINE>if (!conversionService.canConvert(ObjectId.class, Date.class)) {<NEW_LINE>conversionService.addConverter(ConverterBuilder.reading(ObjectId.class, Date.class, objectId -> new Date(objectId.getTimestamp())).getReadingConverter());<NEW_LINE>}<NEW_LINE>conversionService.addConverter(ConverterBuilder.reading(Code.class, String.class, Code::getCode).getReadingConverter());<NEW_LINE>conversions.registerConvertersIn(conversionService);<NEW_LINE>} | ::new).getReadingConverter()); |
702,065 | private Mono<PagedResponse<ServerInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-12-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value<MASK><NEW_LINE>} | (), null, null)); |
1,149,943 | public int updateHmilyTransactionStatus(final Long transId, final Integer status) throws HmilyRepositoryException {<NEW_LINE>String <MASK><NEW_LINE>try {<NEW_LINE>KeyValue keyValue = getKeyValue(path);<NEW_LINE>if (null == keyValue) {<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>}<NEW_LINE>HmilyTransaction hmilyTransaction = hmilySerializer.deSerialize(keyValue.getValue().getBytes(), HmilyTransaction.class);<NEW_LINE>hmilyTransaction.setStatus(status);<NEW_LINE>hmilyTransaction.setVersion(hmilyTransaction.getVersion() + 1);<NEW_LINE>hmilyTransaction.setUpdateTime(new Date());<NEW_LINE>client.getKVClient().put(ByteSequence.from(path, StandardCharsets.UTF_8), ByteSequence.from(hmilySerializer.serialize(hmilyTransaction)));<NEW_LINE>return HmilyRepository.ROWS;<NEW_LINE>} catch (ExecutionException | InterruptedException e) {<NEW_LINE>log.error("updateHmilyTransactionStatus occur a exception", e);<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>}<NEW_LINE>} | path = node.getHmilyTransactionRealPath(transId); |
76,700 | // Driver function<NEW_LINE>public static void main(String[] args) {<NEW_LINE>int[] wt = { 6, 10, 3, 5, 1, 2 };<NEW_LINE>int[] val = { 12, 30, 15, 20, 5, 12 };<NEW_LINE>// storing number of items<NEW_LINE>int nItems = wt.length;<NEW_LINE>Item[] arr = new Item[nItems];<NEW_LINE>for (int i = 0; i < nItems; i++) arr[i] = new Item(val[i], wt[i]);<NEW_LINE>// Knapsack Capacity<NEW_LINE>int Capacity = 12;<NEW_LINE>// Call to Knapsack function<NEW_LINE>FractionalKnapsack obj = new FractionalKnapsack();<NEW_LINE>double value = obj.<MASK><NEW_LINE>System.out.println("The maximum profit that can be obtained is :" + value);<NEW_LINE>} | fractionalKnapsackProblem(arr, nItems, Capacity); |
649,280 | private JToggleButton createPlacesSelectedNodeToggleButton() {<NEW_LINE>final JToggleButton checkBoxOnlySpecificNodes = createToggleButtonWithIconAndLabel("PlaceSelectedNodeOnSlide.icon", "slide.placenode");<NEW_LINE>checkBoxOnlySpecificNodes.setAlignmentX(Component.CENTER_ALIGNMENT);<NEW_LINE>checkBoxOnlySpecificNodes.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final String centeredNodeId = slide.getPlacedNodeId();<NEW_LINE>final IMapSelection selection = Controller.getCurrentController().getSelection();<NEW_LINE>if (centeredNodeId == null) {<NEW_LINE>final NodeModel selected = selection.getSelected();<NEW_LINE>if (selected != null) {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(selected.getID());<NEW_LINE>setNodePlacementControlsEnabled(true, slide.getPlacedNodePosition());<NEW_LINE>} else {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(null);<NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(null);<NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>final NodeModel node = map.getNodeForID(centeredNodeId);<NEW_LINE>if (node != null)<NEW_LINE>selection.selectAsTheOnlyOneSelected(node);<NEW_LINE>}<NEW_LINE>checkBoxOnlySpecificNodes.setSelected(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return checkBoxOnlySpecificNodes;<NEW_LINE>} | slide.getPlacedNodeId() != null); |
817,883 | public void drawBackgroundLayer(float partialTicks, int mouseX, int mouseY, Runnable menuBackgroundRenderer) {<NEW_LINE>// FIX FOR MC-121719 // https://bugs.mojang.com/browse/MC-121719<NEW_LINE>partialTicks = mc.getRenderPartialTicks();<NEW_LINE>// END FIX<NEW_LINE>RenderHelper.disableStandardItemLighting();<NEW_LINE>this.lastPartialTicks = partialTicks;<NEW_LINE>mouse.setMousePosition(mouseX, mouseY);<NEW_LINE>if (currentMenu == null || !currentMenu.shouldFullyOverride()) {<NEW_LINE>menuBackgroundRenderer.run();<NEW_LINE>}<NEW_LINE>GlStateManager.color(<MASK><NEW_LINE>if (isDebuggingShown.evaluate()) {<NEW_LINE>SPRITE_DEBUG.drawAt(0, 0);<NEW_LINE>if (isDebuggingEnabled.evaluate()) {<NEW_LINE>Gui.drawRect(0, 0, 16, 16, 0x33_FF_FF_FF);<NEW_LINE>if (rootElement != screenElement) {<NEW_LINE>// draw the outer resizing edges<NEW_LINE>int w = 320;<NEW_LINE>int h = 240;<NEW_LINE>int sx = (int) ((rootElement.getWidth() - w) / 2);<NEW_LINE>int sy = (int) ((rootElement.getHeight() - h) / 2);<NEW_LINE>int ex = sx + w + 1;<NEW_LINE>int ey = sy + h + 1;<NEW_LINE>sx--;<NEW_LINE>sy--;<NEW_LINE>Gui.drawRect(sx, sy, ex + 1, sy + 1, -1);<NEW_LINE>Gui.drawRect(sx, ey, ex + 1, ey + 1, -1);<NEW_LINE>Gui.drawRect(sx, sy, sx + 1, ey + 1, -1);<NEW_LINE>Gui.drawRect(ex, sy, ex + 1, ey + 1, -1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 1, 1, 1, 1); |
446,887 | protected Result[][] multisearch(String id, int k, int d) throws IOException {<NEW_LINE>List<Result[]> results = new ArrayList<>();<NEW_LINE>TopDocs wordDocs = searcher.search(new TermQuery(new Term(IndexVectors.FIELD_ID, id)), k);<NEW_LINE>for (ScoreDoc scoreDoc : wordDocs.scoreDocs) {<NEW_LINE>Document doc = searcher.doc(scoreDoc.doc);<NEW_LINE>String vector = doc.get(IndexVectors.FIELD_VECTOR);<NEW_LINE>CommonTermsQuery simQuery = new CommonTermsQuery(SHOULD, SHOULD, 0.999f);<NEW_LINE>List<String> tokens = AnalyzerUtils.analyze(analyzer, vector);<NEW_LINE>for (String token : tokens) {<NEW_LINE>simQuery.add(new Term(IndexVectors.FIELD_VECTOR, token));<NEW_LINE>}<NEW_LINE>TopDocs nearest = searcher.search(simQuery, d);<NEW_LINE>Result[] neighbors = new <MASK><NEW_LINE>int i = 0;<NEW_LINE>for (ScoreDoc nn : nearest.scoreDocs) {<NEW_LINE>Document ndoc = searcher.doc(nn.doc);<NEW_LINE>neighbors[i] = new Result(ndoc.get(IndexVectors.FIELD_ID), nn.score);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>results.add(neighbors);<NEW_LINE>}<NEW_LINE>return results.toArray(new Result[0][0]);<NEW_LINE>} | Result[nearest.scoreDocs.length]; |
1,726,613 | void slide(TopComponent tc, ModeImpl source, String targetSide) {<NEW_LINE>ModeImpl targetMode = model.getSlidingMode(targetSide);<NEW_LINE>if (targetMode == null) {<NEW_LINE>targetMode = WindowManagerImpl.getInstance().createModeImpl(ModeImpl.getUnusedModeName(), Constants.MODE_KIND_SLIDING, false);<NEW_LINE>model.addSlidingMode(targetMode, targetSide, null);<NEW_LINE>model.setModeBounds(targetMode, new Rectangle<MASK><NEW_LINE>}<NEW_LINE>ModeImpl oldActive = getActiveMode();<NEW_LINE>moveTopComponentIntoMode(targetMode, tc);<NEW_LINE>ModeImpl newActive = getActiveMode();<NEW_LINE>if (isVisible()) {<NEW_LINE>viewRequestor.scheduleRequest(new ViewRequest(null, View.CHANGE_TOPCOMPONENT_AUTO_HIDE_ENABLED, null, null));<NEW_LINE>}<NEW_LINE>if (oldActive != newActive) {<NEW_LINE>WindowManagerImpl.getInstance().doFirePropertyChange(WindowManagerImpl.PROP_ACTIVE_MODE, oldActive, newActive);<NEW_LINE>}<NEW_LINE>// Notify new active.<NEW_LINE>if (newActive != null) {<NEW_LINE>// Notify registry.<NEW_LINE>WindowManagerImpl.notifyRegistryTopComponentActivated(newActive.getSelectedTopComponent());<NEW_LINE>} else {<NEW_LINE>WindowManagerImpl.notifyRegistryTopComponentActivated(null);<NEW_LINE>}<NEW_LINE>} | (tc.getBounds())); |
1,736,264 | private If convertOspfRedistributionPolicy(OspfRedistributionPolicy policy, OspfProcess proc) {<NEW_LINE>RedistributionSourceProtocol protocol = policy.getSourceProtocol();<NEW_LINE>// All redistribution must match the specified protocol.<NEW_LINE>Conjunction ospfExportConditions = new Conjunction();<NEW_LINE>ospfExportConditions.getConjuncts().add(new MatchProtocol(toOspfRedistributionProtocols(protocol)));<NEW_LINE>ImmutableList.Builder<Statement> ospfExportStatements = ImmutableList.builder();<NEW_LINE>// Set the metric type and value.<NEW_LINE>ospfExportStatements.add(new SetOspfMetricType<MASK><NEW_LINE>long metric = policy.getMetric() != null ? policy.getMetric() : proc.getEffectiveDefaultMetric();<NEW_LINE>// On Arista, the default route gets a special metric of 1.<NEW_LINE>// https://www.arista.com/en/um-eos/eos-section-30-5-ospfv2-commands#ww1153059<NEW_LINE>ospfExportStatements.add(new If(Common.matchDefaultRoute(), ImmutableList.of(new SetMetric(new LiteralLong(1L))), ImmutableList.of(new SetMetric(new LiteralLong(metric)))));<NEW_LINE>// If a route-map filter is present, honor it.<NEW_LINE>String exportRouteMapName = policy.getRouteMap();<NEW_LINE>if (exportRouteMapName != null) {<NEW_LINE>RouteMap exportRouteMap = _routeMaps.get(exportRouteMapName);<NEW_LINE>if (exportRouteMap != null) {<NEW_LINE>ospfExportConditions.getConjuncts().add(new CallExpr(exportRouteMapName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ospfExportStatements.add(Statements.ExitAccept.toStaticStatement());<NEW_LINE>// Construct the policy and add it before returning.<NEW_LINE>return new If("OSPF export routes for " + protocol.protocolName(), ospfExportConditions, ospfExportStatements.build(), ImmutableList.of());<NEW_LINE>} | (policy.getMetricType())); |
1,290,116 | public void visitSourcePath(SourcePath value) throws IOException {<NEW_LINE>if (value instanceof DefaultBuildTargetSourcePath) {<NEW_LINE>value = ruleFinder.getRule(value).get().getSourcePathToOutput();<NEW_LINE>Objects.requireNonNull(value);<NEW_LINE>}<NEW_LINE>if (value instanceof ExplicitBuildTargetSourcePath) {<NEW_LINE>stream.writeBoolean(true);<NEW_LINE>ExplicitBuildTargetSourcePath buildTargetSourcePath = (ExplicitBuildTargetSourcePath) value;<NEW_LINE>writeValue(buildTargetSourcePath.getTarget(), new TypeToken<BuildTarget>() {<NEW_LINE>});<NEW_LINE>writeRelativePath(buildTargetSourcePath.getResolvedPath());<NEW_LINE>} else if (value instanceof ForwardingBuildTargetSourcePath) {<NEW_LINE>visitSourcePath(((ForwardingBuildTargetSourcePath) value).getDelegate());<NEW_LINE>} else if (value instanceof PathSourcePath) {<NEW_LINE>PathSourcePath pathSourcePath = (PathSourcePath) value;<NEW_LINE>stream.writeBoolean(false);<NEW_LINE>writeValue(getCellName(pathSourcePath.getFilesystem()), new TypeToken<Optional<String>>() {<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Cannot serialize SourcePath of type %s.", value.getClass().getName()));<NEW_LINE>}<NEW_LINE>} | writeRelativePath(pathSourcePath.getRelativePath()); |
1,339,755 | public void onPrivateAtomicCookieFetched(OnPrivateAtomicCookieFetched event) {<NEW_LINE>if (event.isError()) {<NEW_LINE>AppLog.e(AppLog.T.MAIN, "Failed to load private AT cookie. " + event.error.type + " - " + event.error.message);<NEW_LINE>WPSnackbar.make(findViewById(R.id.webview_wrapper), R.string.media_accessing_failed, Snackbar.LENGTH_LONG).show();<NEW_LINE>} else {<NEW_LINE>CookieManager.getInstance().setCookie(mPrivateAtomicCookie.getDomain(<MASK><NEW_LINE>}<NEW_LINE>// if the dialog is not showing by the time cookie fetched it means that it was dismissed and content was loaded<NEW_LINE>if (PrivateAtCookieRefreshProgressDialog.Companion.isShowing(getSupportFragmentManager())) {<NEW_LINE>loadWebContent();<NEW_LINE>PrivateAtCookieRefreshProgressDialog.Companion.dismissIfNecessary(getSupportFragmentManager());<NEW_LINE>}<NEW_LINE>} | ), mPrivateAtomicCookie.getCookieContent()); |
642,365 | public synchronized boolean unwrapInput() {<NEW_LINE>boolean success = false;<NEW_LINE>boolean shouldUnwrap = true;<NEW_LINE>while (!isClosed() && shouldUnwrap && netIn.position() > 0) {<NEW_LINE>debug("- UNWRAP");<NEW_LINE>// prepare for reading<NEW_LINE>netIn.flip();<NEW_LINE>// backup, to rollback in case of underflow<NEW_LINE>netIn.mark();<NEW_LINE>SSLEngineResult result = unwrap(netIn, appIn);<NEW_LINE>boolean underflow = result.getStatus().equals(SSLEngineResult.Status.BUFFER_UNDERFLOW);<NEW_LINE>if (!underflow) {<NEW_LINE>// prepare for writing<NEW_LINE>netIn.compact();<NEW_LINE>} else {<NEW_LINE>// rollback<NEW_LINE>netIn.reset();<NEW_LINE>netIn.compact();<NEW_LINE>}<NEW_LINE>appIn.flip();<NEW_LINE><MASK><NEW_LINE>appIn.clear();<NEW_LINE>reactToResult(result);<NEW_LINE>shouldUnwrap = !result.getStatus().equals(SSLEngineResult.Status.BUFFER_UNDERFLOW) && !result.getHandshakeStatus().equals(SSLEngineResult.HandshakeStatus.NEED_TASK) && !result.getHandshakeStatus().equals(SSLEngineResult.HandshakeStatus.NEED_WRAP);<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | conn.input.append(appIn); |
164,048 | public boolean writeAttributeName(FSTClazzInfo.FSTFieldInfo subInfo, Object outerObjectToWrite) {<NEW_LINE>try {<NEW_LINE>SerializedString bufferedName = (SerializedString) subInfo.getBufferedName();<NEW_LINE>if (bufferedName == null) {<NEW_LINE>bufferedName = new <MASK><NEW_LINE>subInfo.setBufferedName(bufferedName);<NEW_LINE>}<NEW_LINE>if (gen.getOutputContext().inArray()) {<NEW_LINE>gen.writeString(bufferedName);<NEW_LINE>} else {<NEW_LINE>gen.writeFieldName(bufferedName);<NEW_LINE>}<NEW_LINE>if (subInfo.getField().isAnnotationPresent(JSONAsString.class)) {<NEW_LINE>// fixme: optimize<NEW_LINE>try {<NEW_LINE>Object objectValue = subInfo.getObjectValue(outerObjectToWrite);<NEW_LINE>if (objectValue instanceof byte[]) {<NEW_LINE>String stringVal = new String((byte[]) objectValue, "UTF-8");<NEW_LINE>writeStringUTF(stringVal);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>FSTUtil.<RuntimeException>rethrow(e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | SerializedString(subInfo.getName()); |
1,824,995 | protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String jspName = ServletRequestUtils.getStringParameter(request, "source", null);<NEW_LINE>ServletContext sctx = context.getServletContext();<NEW_LINE>ServletConfig scfg = (ServletConfig) context.findChild("jsp");<NEW_LINE>Options opt = new EmbeddedServletOptions(scfg, sctx);<NEW_LINE>String encoding = opt.getJavaEncoding();<NEW_LINE>String content = null;<NEW_LINE>if (jspName != null) {<NEW_LINE>String servletName = getContainerWrapper().getTomcatContainer(<MASK><NEW_LINE>if (servletName != null) {<NEW_LINE>File servletFile = new File(servletName);<NEW_LINE>if (servletFile.exists()) {<NEW_LINE>try (InputStream fis = Files.newInputStream(servletFile.toPath())) {<NEW_LINE>content = Utils.highlightStream(jspName, fis, "java", encoding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ModelAndView(getViewName(), "content", content);<NEW_LINE>} | ).getServletFileNameForJsp(context, jspName); |
1,522,376 | public static void logLoginInfo(RepositoryConnectionList logininfo, String logLable) {<NEW_LINE>Logger logger = getInstallLogger();<NEW_LINE>if (null == logLable) {<NEW_LINE>logLable = "";<NEW_LINE>} else if (!logLable.isEmpty()) {<NEW_LINE>logLable += " ";<NEW_LINE>}<NEW_LINE>for (RepositoryConnection c : logininfo) {<NEW_LINE>if (c instanceof RestRepositoryConnection) {<NEW_LINE>RestRepositoryConnection l = (RestRepositoryConnection) c;<NEW_LINE>String repURL = l.getRepositoryUrl();<NEW_LINE>if (null != repURL && !repURL.isEmpty()) {<NEW_LINE>logger.log(Level.FINEST, logLable + "Repository URL: " + repURL);<NEW_LINE>}<NEW_LINE>String apiKey = l.getApiKey();<NEW_LINE>if (null != apiKey && !apiKey.isEmpty()) {<NEW_LINE>logger.log(Level.<MASK><NEW_LINE>}<NEW_LINE>String userAgent = l.getUserAgent();<NEW_LINE>if (null != userAgent && !userAgent.isEmpty()) {<NEW_LINE>logger.log(Level.FINEST, logLable + "User Agent: " + userAgent);<NEW_LINE>}<NEW_LINE>} else if (c instanceof DirectoryRepositoryConnection || c instanceof ZipRepositoryConnection) {<NEW_LINE>logger.log(Level.FINEST, logLable + "Directory Repository: " + c.getRepositoryLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | FINEST, logLable + "API Key: " + apiKey); |
481,535 | private void recursivelySetFinalFlag(BLangVariable variable) {<NEW_LINE>if (variable == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(variable.getKind()) {<NEW_LINE>case VARIABLE:<NEW_LINE>if (variable.symbol == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>variable.symbol.flags |= Flags.FINAL;<NEW_LINE>break;<NEW_LINE>case TUPLE_VARIABLE:<NEW_LINE>BLangTupleVariable tupleVariable = (BLangTupleVariable) variable;<NEW_LINE>tupleVariable.memberVariables.forEach(this::recursivelySetFinalFlag);<NEW_LINE>recursivelySetFinalFlag(tupleVariable.restVariable);<NEW_LINE>break;<NEW_LINE>case RECORD_VARIABLE:<NEW_LINE>BLangRecordVariable recordVariable = (BLangRecordVariable) variable;<NEW_LINE>recordVariable.variableList.forEach(value -> recursivelySetFinalFlag(value.valueBindingPattern));<NEW_LINE>recursivelySetFinalFlag(recordVariable.restParam);<NEW_LINE>break;<NEW_LINE>case ERROR_VARIABLE:<NEW_LINE>BLangErrorVariable errorVariable = (BLangErrorVariable) variable;<NEW_LINE>recursivelySetFinalFlag(errorVariable.message);<NEW_LINE>recursivelySetFinalFlag(errorVariable.restDetail);<NEW_LINE>errorVariable.detail.forEach(bLangErrorDetailEntry <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | -> recursivelySetFinalFlag(bLangErrorDetailEntry.valueBindingPattern)); |
1,465,713 | public void applicationStopped() {<NEW_LINE>try {<NEW_LINE>infoUpdateTimer.cancel();<NEW_LINE>infoUpdateTimer.purge();<NEW_LINE>log.trace("Updating server information in the database");<NEW_LINE><MASK><NEW_LINE>Object tsObj = types.getSqlObject(timeSource.currentTimestamp());<NEW_LINE>int tsType = types.getSqlType(Date.class);<NEW_LINE>Object falseObj = types.getSqlObject(Boolean.FALSE);<NEW_LINE>int boolType = types.getSqlType(Boolean.class);<NEW_LINE>QueryRunner runner = new QueryRunner(persistence.getDataSource());<NEW_LINE>runner.update("update SYS_SERVER set UPDATE_TS = ?, IS_RUNNING = ? where NAME = ?", new Object[] { tsObj, falseObj, getServerId() }, new int[] { tsType, boolType, Types.VARCHAR });<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Unable to update SYS_SERVER: {}", e);<NEW_LINE>}<NEW_LINE>} | DbTypeConverter types = persistence.getDbTypeConverter(); |
443,603 | private Map<String, Object> buildMongoDbInput(final String title, final String type, final boolean global, final Map<String, Object> configuration, final String userName, final DateTime createdAt) {<NEW_LINE>final ImmutableMap.Builder<String, Object> inputData = ImmutableMap.builder();<NEW_LINE>inputData.put(MessageInput.FIELD_TITLE, title);<NEW_LINE>inputData.put(MessageInput.FIELD_TYPE, type);<NEW_LINE>inputData.put(MessageInput.FIELD_CREATOR_USER_ID, userName);<NEW_LINE>inputData.put(MessageInput.FIELD_CONFIGURATION, configuration);<NEW_LINE>inputData.put(MessageInput.FIELD_CREATED_AT, createdAt);<NEW_LINE>if (global) {<NEW_LINE>inputData.put(MessageInput.FIELD_GLOBAL, true);<NEW_LINE>} else {<NEW_LINE>inputData.put(MessageInput.FIELD_NODE_ID, serverStatus.<MASK><NEW_LINE>}<NEW_LINE>return inputData.build();<NEW_LINE>} | getNodeId().toString()); |
1,188,160 | public void reloadFromDisk(@Nonnull final Document document) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>final VirtualFile file = getFile(document);<NEW_LINE>assert file != null;<NEW_LINE>if (!fireBeforeFileContentReload(file, document)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Project project = ProjectLocator.getInstance().guessProjectForFile(file);<NEW_LINE>boolean[] isReloadable = { isReloadable(file, document, project) };<NEW_LINE>if (isReloadable[0]) {<NEW_LINE>CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(new ExternalChangeAction.ExternalDocumentChange(document, project) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (!isBinaryWithoutDecompiler(file)) {<NEW_LINE>LoadTextUtil.clearCharsetAutoDetectionReason(file);<NEW_LINE>// reset BOM in case we had one and the external change stripped it away<NEW_LINE>file.setBOM(null);<NEW_LINE>file.setCharset(null, null, false);<NEW_LINE>boolean wasWritable = document.isWritable();<NEW_LINE>document.setReadOnly(false);<NEW_LINE>boolean tooLarge = FileUtilRt.isTooLarge(file.getLength());<NEW_LINE>isReloadable[0] = <MASK><NEW_LINE>if (isReloadable[0]) {<NEW_LINE>CharSequence reloaded = tooLarge ? LoadTextUtil.loadText(file, getPreviewCharCount(file)) : LoadTextUtil.loadText(file);<NEW_LINE>((DocumentEx) document).replaceText(reloaded, file.getModificationStamp());<NEW_LINE>document.putUserData(BIG_FILE_PREVIEW, tooLarge ? Boolean.TRUE : null);<NEW_LINE>}<NEW_LINE>document.setReadOnly(!wasWritable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}), UIBundle.message("file.cache.conflict.action"), null, UndoConfirmationPolicy.REQUEST_CONFIRMATION);<NEW_LINE>}<NEW_LINE>if (isReloadable[0]) {<NEW_LINE>myMultiCaster.fileContentReloaded(file, document);<NEW_LINE>} else {<NEW_LINE>unbindFileFromDocument(file, document);<NEW_LINE>myMultiCaster.fileWithNoDocumentChanged(file);<NEW_LINE>}<NEW_LINE>myUnsavedDocuments.remove(document);<NEW_LINE>} | isReloadable(file, document, project); |
175,850 | public List<ComparablePair<Long, KeyExtent>> computeBusiest(Collection<Tablet> tablets) {<NEW_LINE>HashMap<KeyExtent, Long> counts = new HashMap<>();<NEW_LINE>ArrayList<ComparablePair<Long, KeyExtent>> tabletsWithDelta = new ArrayList<>();<NEW_LINE>for (Tablet tablet : tablets) {<NEW_LINE>KeyExtent extent = tablet.getExtent();<NEW_LINE>// only get the count once to ensure consistency in the case of multiple threads<NEW_LINE>long count = extractCount(tablet);<NEW_LINE>if (count == 0)<NEW_LINE>continue;<NEW_LINE>counts.put(extent, count);<NEW_LINE>long lastCount = lastCounts.getOrDefault(extent, 0L);<NEW_LINE>// if a tablet leaves a tserver and comes back, then its count will be reset. This could make<NEW_LINE>// lastCount higher than the current count. That is why lastCount > count is checked below.<NEW_LINE>long delta = (lastCount > count) ? count : count - lastCount;<NEW_LINE>// handle case where tablet had no activity<NEW_LINE>if (delta > 0)<NEW_LINE>tabletsWithDelta.add(new ComparablePair<>(delta, extent));<NEW_LINE>}<NEW_LINE>lastCounts = counts;<NEW_LINE>return Ordering.natural(<MASK><NEW_LINE>} | ).greatestOf(tabletsWithDelta, numBusiestTabletsToLog); |
347,564 | public boolean acceptIndexMatch(String documentPath, SearchPattern indexRecord, SearchParticipant participant, AccessRuleSet access) {<NEW_LINE>// Filter unexpected types<NEW_LINE>TypeDeclarationPattern record = (TypeDeclarationPattern) indexRecord;<NEW_LINE>if (record.enclosingTypeNames == IIndexConstants.ONE_ZERO_CHAR) {<NEW_LINE>// filter out local and anonymous classes<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>switch(copiesLength) {<NEW_LINE>case 0:<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>if (singleWkcpPath.equals(documentPath)) {<NEW_LINE>// filter out *the* working copy<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (workingCopyPaths.contains(documentPath)) {<NEW_LINE>// filter out working copies<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Accept document path<NEW_LINE>AccessRestriction accessRestriction = null;<NEW_LINE>if (access != null) {<NEW_LINE>// Compute document relative path<NEW_LINE>int pkgLength = (record.pkg == null || record.pkg.length == 0) ? 0 : record.pkg.length + 1;<NEW_LINE>int nameLength = record.simpleName == null ? 0 : record.simpleName.length;<NEW_LINE>char[] path = new char[pkgLength + nameLength];<NEW_LINE>int pos = 0;<NEW_LINE>if (pkgLength > 0) {<NEW_LINE>System.arraycopy(record.pkg, 0, path, pos, pkgLength - 1);<NEW_LINE>CharOperation.replace(path, '.', '/');<NEW_LINE>path[pkgLength - 1] = '/';<NEW_LINE>pos += pkgLength;<NEW_LINE>}<NEW_LINE>if (nameLength > 0) {<NEW_LINE>System.arraycopy(record.simpleName, 0, path, pos, nameLength);<NEW_LINE>pos += nameLength;<NEW_LINE>}<NEW_LINE>// Update access restriction if path is not empty<NEW_LINE>if (pos > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match(record.typeSuffix, record.modifiers)) {<NEW_LINE>nameRequestor.acceptType(record.modifiers, record.pkg, record.simpleName, record.enclosingTypeNames, documentPath, accessRestriction);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | accessRestriction = access.getViolatedRestriction(path); |
1,482,843 | public boolean markPresent(Map<Integer, Set<String>> paths, Instant lastScanned) {<NEW_LINE>if (!paths.isEmpty()) {<NEW_LINE>return paths.entrySet().parallelStream().map(e -> {<NEW_LINE>int batches = (e.getValue().size() - 1) / 30000;<NEW_LINE>List<String> pList = new ArrayList<>(e.getValue());<NEW_LINE>return IntStream.rangeClosed(0, batches).parallel().map(b -> {<NEW_LINE>List<String> batch = pList.subList(b * 30000, Math.min(e.getValue().size(), b * 30000 + 30000));<NEW_LINE>return namedUpdate("update media_file set present=true, last_scanned = :lastScanned where path in (:paths) and folder_id=:folderId", ImmutableMap.of("lastScanned", lastScanned, "paths", batch, "folderId"<MASK><NEW_LINE>}).sum() == e.getValue().size();<NEW_LINE>}).reduce(true, (a, b) -> a && b);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | , e.getKey())); |
120,268 | @ConditionalOnMissingBean<NEW_LINE>public ApiHttpSecurityCustomizer delegatingApiHttpSecurityCustomizer() {<NEW_LINE>JwtAuthenticationConverter converter = new JwtAuthenticationConverter();<NEW_LINE>FlowableCommonAppProperties.OAuth2 oAuth2 = commonAppProperties.getSecurity().getOAuth2();<NEW_LINE>String authoritiesAttribute = oAuth2.getAuthoritiesAttribute();<NEW_LINE>String groupsAttribute = oAuth2.getGroupsAttribute();<NEW_LINE>Collection<String> defaultAuthorities = oAuth2.getDefaultAuthorities();<NEW_LINE>Collection<String> defaultGroups = oAuth2.getDefaultGroups();<NEW_LINE>converter.setJwtGrantedAuthoritiesConverter(new FlowableJwtGrantedAuthoritiesMapper(authoritiesAttribute, groupsAttribute, defaultAuthorities, defaultGroups));<NEW_LINE>JwtApiHttpSecurityCustomizer jwtApiHttpSecurityCustomizer = new JwtApiHttpSecurityCustomizer(converter);<NEW_LINE>String username = commonAppProperties.getIdmAdmin().getUser();<NEW_LINE>String password = commonAppProperties.getIdmAdmin().getPassword();<NEW_LINE>FixUserApiHttpSecurityCustomizer fixUserApiHttpSecurityCustomizer = new FixUserApiHttpSecurityCustomizer(username, deducePassword(password));<NEW_LINE>return new DelegatingApiHttpSecurityCustomizer(Arrays<MASK><NEW_LINE>} | .asList(fixUserApiHttpSecurityCustomizer, jwtApiHttpSecurityCustomizer)); |
263,752 | private void expandSupertypes(Map<String, Set<String>> subTypesStore, Map<String, Set<String>> typesAnnotatedStore, String key, Class<?> type) {<NEW_LINE>Set<Annotation> typeAnnotations = ReflectionUtils.getAnnotations(type);<NEW_LINE>if (typesAnnotatedStore != null && !typeAnnotations.isEmpty()) {<NEW_LINE>String typeName = type.getName();<NEW_LINE>for (Annotation typeAnnotation : typeAnnotations) {<NEW_LINE>String annotationName = typeAnnotation.annotationType().getName();<NEW_LINE>typesAnnotatedStore.computeIfAbsent(annotationName, s -> new HashSet<><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Class<?> supertype : ReflectionUtils.getSuperTypes(type)) {<NEW_LINE>String supertypeName = supertype.getName();<NEW_LINE>if (subTypesStore.containsKey(supertypeName)) {<NEW_LINE>subTypesStore.get(supertypeName).add(key);<NEW_LINE>} else {<NEW_LINE>subTypesStore.computeIfAbsent(supertypeName, s -> new HashSet<>()).add(key);<NEW_LINE>expandSupertypes(subTypesStore, typesAnnotatedStore, supertypeName, supertype);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).add(typeName); |
1,575,278 | public void enterPoplt_apply_path(Poplt_apply_pathContext ctx) {<NEW_LINE>HierarchyPath applyPathPath = new HierarchyPath();<NEW_LINE>String pathQuoted <MASK><NEW_LINE>int line = ctx.path.getLine();<NEW_LINE>String pathWithoutQuotes = pathQuoted.substring(1, pathQuoted.length() - 1);<NEW_LINE>String[] pathComponents = pathWithoutQuotes.split("\\s+");<NEW_LINE>for (String pathComponent : pathComponents) {<NEW_LINE>boolean isWildcard = pathComponent.charAt(0) == '<';<NEW_LINE>if (isWildcard) {<NEW_LINE>applyPathPath.addWildcardNode(pathComponent, line);<NEW_LINE>} else {<NEW_LINE>applyPathPath.addNode(pathComponent, line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int insertionIndex = _newConfigurationLines.indexOf(_currentSetLine);<NEW_LINE>List<ParseTree> newLines = null;<NEW_LINE>try {<NEW_LINE>newLines = _hierarchy.getApplyPathLines(_currentPath, applyPathPath, _configurationContext);<NEW_LINE>} catch (BatfishException e) {<NEW_LINE>_w.redFlag("Could not apply path: " + pathQuoted + ": make sure path is terminated by wildcard (e.g. <*>) representing ip(v6) " + "addresses or prefixes");<NEW_LINE>}<NEW_LINE>if (newLines != null) {<NEW_LINE>_newConfigurationLines.addAll(insertionIndex + 1, newLines);<NEW_LINE>}<NEW_LINE>// TODO: removing this removes definition lines. _newConfigurationLines.remove(insertionIndex);<NEW_LINE>} | = ctx.path.getText(); |
1,780,513 | private static boolean randomSamplingRunner(TimedExecutor executor, int k, List<Integer> A) throws Exception {<NEW_LINE>List<List<Integer>> results = new ArrayList<>();<NEW_LINE>executor.run(() -> {<NEW_LINE>for (int i = 0; i < 1000000; ++i) {<NEW_LINE>randomSampling(k, A);<NEW_LINE>results.add(new ArrayList<>(A.subList(0, k)));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int totalPossibleOutcomes = RandomSequenceChecker.binomialCoefficient(A.size(), k);<NEW_LINE>Collections.sort(A);<NEW_LINE>List<List<Integer>> combinations = new ArrayList<>();<NEW_LINE>for (int i = 0; i < RandomSequenceChecker.binomialCoefficient(A.size(), k); ++i) {<NEW_LINE>combinations.add(RandomSequenceChecker.computeCombinationIdx(A, A.size<MASK><NEW_LINE>}<NEW_LINE>List<Integer> sequence = new ArrayList<>();<NEW_LINE>for (List<Integer> result : results) {<NEW_LINE>Collections.sort(result);<NEW_LINE>sequence.add(combinations.indexOf(result));<NEW_LINE>}<NEW_LINE>return RandomSequenceChecker.checkSequenceIsUniformlyRandom(sequence, totalPossibleOutcomes, 0.01);<NEW_LINE>} | (), k, i)); |
276,017 | private static BundleEntryComponent observation(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, BundleEntryComponent encounterEntry, Observation observation) {<NEW_LINE>org.hl7.fhir.dstu3.model.Observation observationResource = new org.hl7.fhir.dstu3.model.Observation();<NEW_LINE>observationResource.setSubject(new Reference(personEntry.getFullUrl()));<NEW_LINE>observationResource.setContext(new Reference(encounterEntry.getFullUrl()));<NEW_LINE>observationResource.setStatus(ObservationStatus.FINAL);<NEW_LINE>Code code = observation.codes.get(0);<NEW_LINE>observationResource.setCode(mapCodeToCodeableConcept(code, LOINC_URI));<NEW_LINE>observationResource.addCategory().addCoding().setCode(observation.category).setSystem("http://hl7.org/fhir/observation-category").setDisplay(observation.category);<NEW_LINE>if (observation.value != null) {<NEW_LINE>Type value = mapValueToFHIRType(observation.value, observation.unit);<NEW_LINE>observationResource.setValue(value);<NEW_LINE>} else if (observation.observations != null && !observation.observations.isEmpty()) {<NEW_LINE>// multi-observation (ex blood pressure)<NEW_LINE>for (Observation subObs : observation.observations) {<NEW_LINE>ObservationComponentComponent comp = new ObservationComponentComponent();<NEW_LINE>comp.setCode(mapCodeToCodeableConcept(subObs.codes.get(0), LOINC_URI));<NEW_LINE>Type value = mapValueToFHIRType(subObs.value, subObs.unit);<NEW_LINE>comp.setValue(value);<NEW_LINE>observationResource.addComponent(comp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>observationResource.setEffective(convertFhirDateTime(observation.start, true));<NEW_LINE>observationResource.setIssued(new Date(observation.start));<NEW_LINE>if (USE_SHR_EXTENSIONS) {<NEW_LINE>Meta meta = new Meta();<NEW_LINE>// all Observations are Observations<NEW_LINE><MASK><NEW_LINE>if ("vital-signs".equals(observation.category)) {<NEW_LINE>meta.addProfile(SHR_EXT + "shr-vital-VitalSign");<NEW_LINE>}<NEW_LINE>// add the specific profile based on code<NEW_LINE>String codeMappingUri = SHR_MAPPING.get(LOINC_URI, code.code);<NEW_LINE>if (codeMappingUri != null) {<NEW_LINE>meta.addProfile(codeMappingUri);<NEW_LINE>}<NEW_LINE>observationResource.setMeta(meta);<NEW_LINE>}<NEW_LINE>BundleEntryComponent entry = newEntry(rand, bundle, observationResource);<NEW_LINE>observation.fullUrl = entry.getFullUrl();<NEW_LINE>return entry;<NEW_LINE>} | meta.addProfile(SHR_EXT + "shr-finding-Observation"); |
1,057,815 | public StartCelebrityRecognitionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartCelebrityRecognitionResult startCelebrityRecognitionResult = new StartCelebrityRecognitionResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return startCelebrityRecognitionResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("JobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startCelebrityRecognitionResult.setJobId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startCelebrityRecognitionResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
310,382 | private Mono<Response<OrchestratorVersionProfileListResultInner>> listOrchestratorsWithResponseAsync(String location, String resourceType, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-04-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listOrchestrators(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, resourceType, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.