idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
804,400 | public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, Parameters params) {<NEW_LINE>DataFrame dataFrame = params.dataFrame;<NEW_LINE>java.util.List<MarkupTableColumn> columnSpecs = dataFrame.getColumns().map(column -> {<NEW_LINE>Integer widthRatio = Integer.valueOf(column.getMetaData().get(<MASK><NEW_LINE>return new MarkupTableColumn(column.getId().getName()).withWidthRatio(widthRatio).withHeaderColumn(Boolean.parseBoolean(column.getMetaData().get(HEADER_COLUMN).getOrElse("false"))).withMarkupSpecifiers(MarkupLanguage.ASCIIDOC, ".^" + widthRatio + "a");<NEW_LINE>}).toJavaList();<NEW_LINE>IndexedSeq<IndexedSeq<String>> columnValues = dataFrame.getColumns().map(column -> ((StringColumn) column).getValues());<NEW_LINE>java.util.List<java.util.List<String>> cells = Array.range(0, dataFrame.getRowCount()).map(rowNumber -> columnValues.map(values -> values.get(rowNumber)).toJavaList()).toJavaList();<NEW_LINE>return markupDocBuilder.tableWithColumnSpecs(columnSpecs, cells);<NEW_LINE>} | WIDTH_RATIO).getOrElse("0")); |
799,781 | public void refresh() {<NEW_LINE>int level = SettingsStore.getInstance(getApplication().<MASK><NEW_LINE>boolean isEnabled = level != ContentBlocking.EtpLevel.NONE;<NEW_LINE>isTrackingProtectionEnabled.postValue(new ObservableBoolean(isEnabled));<NEW_LINE>boolean drmEnabled = SettingsStore.getInstance(getApplication().getBaseContext()).isDrmContentPlaybackEnabled();<NEW_LINE>isDRMEnabled.postValue(new ObservableBoolean(drmEnabled));<NEW_LINE>boolean popupBlockingEnabled = SettingsStore.getInstance(getApplication().getBaseContext()).isPopUpsBlockingEnabled();<NEW_LINE>isPopupBlockingEnabled.postValue(new ObservableBoolean(popupBlockingEnabled));<NEW_LINE>boolean webxrEnabled = SettingsStore.getInstance(getApplication().getBaseContext()).isWebXREnabled();<NEW_LINE>isWebXREnabled.postValue(new ObservableBoolean(webxrEnabled));<NEW_LINE>String appVersionName = SettingsStore.getInstance(getApplication().getBaseContext()).getRemotePropsVersionName();<NEW_LINE>propsVersionName.postValue(appVersionName);<NEW_LINE>} | getBaseContext()).getTrackingProtectionLevel(); |
1,321,097 | /*<NEW_LINE>static public void addTools(JMenu menu, List<Tool> tools) {<NEW_LINE>Map<String, JMenuItem> toolItems = new <MASK><NEW_LINE><NEW_LINE>for (final Tool tool : tools) {<NEW_LINE>// If init() fails, the item won't be added to the menu<NEW_LINE>addToolItem(tool, toolItems);<NEW_LINE>}<NEW_LINE><NEW_LINE>List<String> toolList = new ArrayList<String>(toolItems.keySet());<NEW_LINE>if (toolList.size() > 0) {<NEW_LINE>if (menu.getItemCount() != 0) {<NEW_LINE>menu.addSeparator();<NEW_LINE>}<NEW_LINE>Collections.sort(toolList);<NEW_LINE>for (String title : toolList) {<NEW_LINE>menu.add(toolItems.get(title));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>JMenuItem createToolItem(final Tool tool) {<NEW_LINE>// , Map<String, JMenuItem> toolItems) {<NEW_LINE>String title = tool.getMenuTitle();<NEW_LINE>final JMenuItem item = new JMenuItem(title);<NEW_LINE>item.addActionListener(e -> {<NEW_LINE>try {<NEW_LINE>tool.run();<NEW_LINE>} catch (NoSuchMethodError | NoClassDefFoundError ne) {<NEW_LINE>Messages.showWarning("Tool out of date", tool.getMenuTitle() + " is not compatible with this version of Processing.\n" + "Try updating the Mode or contact its author for a new version.", ne);<NEW_LINE>Messages.err("Incompatible tool found during tool.run()", ne);<NEW_LINE>item.setEnabled(false);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>activeEditor.statusError("An error occurred inside \"" + tool.getMenuTitle() + "\"");<NEW_LINE>ex.printStackTrace();<NEW_LINE>item.setEnabled(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// toolItems.put(title, item);<NEW_LINE>return item;<NEW_LINE>} | HashMap<String, JMenuItem>(); |
828,405 | protected Boolean doInBackground(Void... params) {<NEW_LINE>switch(getBlogType()) {<NEW_LINE>case FOLLOWED:<NEW_LINE>mTmpFollowedBlogs = new ReaderBlogList();<NEW_LINE>ReaderBlogList allFollowedBlogs = ReaderBlogTable.getFollowedBlogs();<NEW_LINE>if (hasSearchFilter()) {<NEW_LINE>String query = mSearchFilter.<MASK><NEW_LINE>for (ReaderBlog blog : allFollowedBlogs) {<NEW_LINE>if (blog.getName().toLowerCase(Locale.getDefault()).contains(query)) {<NEW_LINE>mTmpFollowedBlogs.add(blog);<NEW_LINE>} else if (UrlUtils.getHost(blog.getUrl()).toLowerCase(Locale.ROOT).contains(query)) {<NEW_LINE>mTmpFollowedBlogs.add(blog);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mTmpFollowedBlogs.addAll(allFollowedBlogs);<NEW_LINE>}<NEW_LINE>// sort followed blogs by name/domain to match display<NEW_LINE>Collections.sort(mTmpFollowedBlogs, new Comparator<ReaderBlog>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(ReaderBlog thisBlog, ReaderBlog thatBlog) {<NEW_LINE>String thisName = getBlogNameForComparison(thisBlog);<NEW_LINE>String thatName = getBlogNameForComparison(thatBlog);<NEW_LINE>return thisName.compareToIgnoreCase(thatName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return !mFollowedBlogs.isSameList(mTmpFollowedBlogs);<NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | toLowerCase(Locale.getDefault()); |
694,639 | private // name of parent file<NEW_LINE>String createErrorMsg(JspLineId jspLineId, int errorLineNr) {<NEW_LINE>StringBuffer compilerOutput = new StringBuffer();<NEW_LINE>if (jspLineId.getSourceLineCount() <= 1) {<NEW_LINE>Object[] objArray = new Object[] { new Integer(jspLineId.getStartSourceLineNum()), jspLineId.getFilePath() };<NEW_LINE>if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.append(separatorString + JspCoreException.getMsg("jsp.error.single.line.number", objArray));<NEW_LINE>} else {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.append(separatorString + JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// compute exact JSP line number<NEW_LINE>int actualLineNum = jspLineId.getStartSourceLineNum() + (errorLineNr - jspLineId.getStartGeneratedLineNum());<NEW_LINE>if (actualLineNum >= jspLineId.getStartSourceLineNum() && actualLineNum <= (jspLineId.getStartSourceLineNum() + jspLineId.getSourceLineCount() - 1)) {<NEW_LINE>Object[] objArray = new Object[] { new Integer(actualLineNum), jspLineId.getFilePath() };<NEW_LINE>if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.append(separatorString + JspCoreException.getMsg("jsp.error.single.line.number", objArray));<NEW_LINE>} else {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.append(separatorString + JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object[] objArray = new Object[] { new Integer(jspLineId.getStartSourceLineNum()), new Integer((jspLineId.getStartSourceLineNum()) + jspLineId.getSourceLineCount() - 1<MASK><NEW_LINE>if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.// Defect 211450<NEW_LINE>append(separatorString + JspCoreException.getMsg("jsp.error.multiple.line.number", objArray));<NEW_LINE>} else {<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.// Defect 211450<NEW_LINE>append(separatorString + JspCoreException.getMsg("jsp.error.multiple.line.number.included.file", objArray));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Defect 211450<NEW_LINE>compilerOutput.append(separatorString + JspCoreException.getMsg("jsp.error.corresponding.servlet", new Object[] { jspLineId.getParentFile() }));<NEW_LINE>// 152470 starts<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, "createErrorMsg", "The value of the JSP attribute jdkSourceLevel is [" + jdkSourceLevel + "]");<NEW_LINE>}<NEW_LINE>// 152470 ends<NEW_LINE>return compilerOutput.toString();<NEW_LINE>} | ), jspLineId.getFilePath() }; |
1,770,056 | public File putFilesIdUpdateSharedLink(String fields, String fileId, FilesFileIdupdateSharedLinkBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'fields' is set<NEW_LINE>if (fields == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'fileId' is set<NEW_LINE>if (fileId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'fileId' when calling putFilesIdUpdateSharedLink");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/files/{file_id}#update_shared_link".replaceAll("\\{" + "file_id" + "\\}", apiClient.escapeString(fileId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields", fields));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<File> localVarReturnType = new GenericType<File>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'fields' when calling putFilesIdUpdateSharedLink"); |
1,520,230 | private static void fillFromPortfolioTransaction(TransactionPair<PortfolioTransaction> transaction, JTransaction jtx) {<NEW_LINE>jtx.portfolio = transaction.getOwner().toString();<NEW_LINE>PortfolioTransaction.Type type = transaction.getTransaction().getType();<NEW_LINE>switch(type) {<NEW_LINE>case BUY:<NEW_LINE>jtx.type = JTransaction.Type.PURCHASE;<NEW_LINE>jtx.account = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.<MASK><NEW_LINE>break;<NEW_LINE>case SELL:<NEW_LINE>jtx.type = JTransaction.Type.SALE;<NEW_LINE>jtx.account = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case TRANSFER_OUT:<NEW_LINE>jtx.type = JTransaction.Type.SECURITY_TRANSFER;<NEW_LINE>jtx.otherPortfolio = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case TRANSFER_IN:<NEW_LINE>jtx.type = JTransaction.Type.SECURITY_TRANSFER;<NEW_LINE>jtx.otherPortfolio = jtx.portfolio;<NEW_LINE>jtx.portfolio = transaction.getTransaction().getCrossEntry().getCrossOwner(transaction.getTransaction()).toString();<NEW_LINE>break;<NEW_LINE>case DELIVERY_INBOUND:<NEW_LINE>jtx.type = JTransaction.Type.INBOUND_DELIVERY;<NEW_LINE>break;<NEW_LINE>case DELIVERY_OUTBOUND:<NEW_LINE>jtx.type = JTransaction.Type.OUTBOUND_DELIVERY;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} | getTransaction()).toString(); |
1,375,173 | void updateAccountsWithMySqlStore(Collection<Account> accounts) throws SQLException {<NEW_LINE>long startTimeMs = System.currentTimeMillis();<NEW_LINE>logger.trace("Start updating accounts={} into MySql DB", accounts);<NEW_LINE>// Get account and container changes info<NEW_LINE>List<AccountUpdateInfo> accountsUpdateInfo = new ArrayList<>();<NEW_LINE>for (Account account : accounts) {<NEW_LINE>boolean isAccountAdded = false, isAccountUpdated = false;<NEW_LINE>List<Container> addedContainers;<NEW_LINE>List<Container> updatedContainers = new ArrayList<>();<NEW_LINE>Account accountInCache = getAccountById(account.getId());<NEW_LINE>if (accountInCache == null) {<NEW_LINE>isAccountAdded = true;<NEW_LINE>addedContainers = new ArrayList<>(account.getAllContainers());<NEW_LINE>} else {<NEW_LINE>if (!accountInCache.equalsWithoutContainers(account)) {<NEW_LINE>isAccountUpdated = true;<NEW_LINE>}<NEW_LINE>// Get list of added and updated containers in the account.<NEW_LINE>Pair<List<Container>, List<Container>> addedOrUpdatedContainers = getUpdatedContainers(account, account.getAllContainers());<NEW_LINE>addedContainers = addedOrUpdatedContainers.getFirst();<NEW_LINE>updatedContainers = addedOrUpdatedContainers.getSecond();<NEW_LINE>}<NEW_LINE>accountsUpdateInfo.add(new AccountUpdateInfo(account, isAccountAdded, isAccountUpdated, addedContainers, updatedContainers));<NEW_LINE>}<NEW_LINE>// Write changes to MySql db.<NEW_LINE>mySqlAccountStore.updateAccounts(accountsUpdateInfo);<NEW_LINE>long timeForUpdate = System.currentTimeMillis() - startTimeMs;<NEW_LINE>logger.<MASK><NEW_LINE>accountServiceMetrics.updateAccountTimeInMs.update(timeForUpdate);<NEW_LINE>} | trace("Completed updating accounts={} in MySql DB, took time={} ms", accounts, timeForUpdate); |
795,508 | public StockAvailabilityResponse checkAvailability(final StockAvailabilityQuery query) {<NEW_LINE>final BPartnerId bpartner = query.getBpartner();<NEW_LINE>final StockAvailabilityResponseBuilder responseBuilder = StockAvailabilityResponse.builder().id(query.getId()).availabilityType(AvailabilityType.SPECIFIC);<NEW_LINE>for (final StockAvailabilityQueryItem queryItem : query.getItems()) {<NEW_LINE>final PZN pzn = queryItem.getPzn();<NEW_LINE>final Quantity qtyRequired = queryItem.getQtyRequired();<NEW_LINE>final Quantity qtyOnHand = getQtyAvailable(pzn, bpartner).orElse(Quantity.ZERO);<NEW_LINE>final StockAvailabilityResponseItem item;<NEW_LINE>if (qtyRequired.compareTo(qtyOnHand) <= 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>item = createStockAvailabilityResponseItem_NotAvailable(pzn, qtyRequired);<NEW_LINE>}<NEW_LINE>responseBuilder.item(item);<NEW_LINE>}<NEW_LINE>return responseBuilder.build();<NEW_LINE>} | item = createStockAvailabilityResponseItem_Available(pzn, qtyRequired); |
1,118,578 | public Dashboard apply(@Nonnull final EntityResponse entityResponse) {<NEW_LINE>final Dashboard result = new Dashboard();<NEW_LINE>result.setUrn(entityResponse.getUrn().toString());<NEW_LINE>result.setType(EntityType.DASHBOARD);<NEW_LINE>EnvelopedAspectMap aspectMap = entityResponse.getAspects();<NEW_LINE>MappingHelper<Dashboard> mappingHelper = new <MASK><NEW_LINE>mappingHelper.mapToResult(DASHBOARD_KEY_ASPECT_NAME, this::mapDashboardKey);<NEW_LINE>mappingHelper.mapToResult(DASHBOARD_INFO_ASPECT_NAME, this::mapDashboardInfo);<NEW_LINE>mappingHelper.mapToResult(EDITABLE_DASHBOARD_PROPERTIES_ASPECT_NAME, this::mapEditableDashboardProperties);<NEW_LINE>mappingHelper.mapToResult(OWNERSHIP_ASPECT_NAME, (dashboard, dataMap) -> dashboard.setOwnership(OwnershipMapper.map(new Ownership(dataMap))));<NEW_LINE>mappingHelper.mapToResult(STATUS_ASPECT_NAME, (dashboard, dataMap) -> dashboard.setStatus(StatusMapper.map(new Status(dataMap))));<NEW_LINE>mappingHelper.mapToResult(INSTITUTIONAL_MEMORY_ASPECT_NAME, (dashboard, dataMap) -> dashboard.setInstitutionalMemory(InstitutionalMemoryMapper.map(new InstitutionalMemory(dataMap))));<NEW_LINE>mappingHelper.mapToResult(GLOSSARY_TERMS_ASPECT_NAME, (dashboard, dataMap) -> dashboard.setGlossaryTerms(GlossaryTermsMapper.map(new GlossaryTerms(dataMap))));<NEW_LINE>mappingHelper.mapToResult(CONTAINER_ASPECT_NAME, this::mapContainers);<NEW_LINE>mappingHelper.mapToResult(DOMAINS_ASPECT_NAME, this::mapDomains);<NEW_LINE>mappingHelper.mapToResult(DEPRECATION_ASPECT_NAME, (dashboard, dataMap) -> dashboard.setDeprecation(DeprecationMapper.map(new Deprecation(dataMap))));<NEW_LINE>return mappingHelper.getResult();<NEW_LINE>} | MappingHelper<>(aspectMap, result); |
1,182,814 | ActionResult<List<JsonObject>> execute(EffectivePerson effectivePerson, String tableFlag, String id, Integer count) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<JsonObject>> <MASK><NEW_LINE>logger.debug(effectivePerson, "table:{}, id:{}, count:{}.", tableFlag, id, count);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Table table = emc.flag(tableFlag, Table.class);<NEW_LINE>if (null == table) {<NEW_LINE>throw new ExceptionEntityNotExist(tableFlag, Table.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, table)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>DynamicEntity dynamicEntity = new DynamicEntity(table.getName());<NEW_LINE>Class<? extends JpaObject> cls = dynamicEntity.getObjectClass();<NEW_LINE>EntityManager em = emc.get(cls);<NEW_LINE>Object sequence = null;<NEW_LINE>if (!StringUtils.equals(EMPTY_SYMBOL, id)) {<NEW_LINE>JpaObject o = emc.fetch(id, cls, ListTools.toList(JpaObject.sequence_FIELDNAME));<NEW_LINE>if (null != o) {<NEW_LINE>sequence = o.getSequence();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> fields = JpaObject.singularAttributeField(cls, true, false);<NEW_LINE>fields.add(JpaObject.sequence_FIELDNAME);<NEW_LINE>List<String> selects = new ArrayList<>();<NEW_LINE>for (String str : fields) {<NEW_LINE>selects.add("o." + str);<NEW_LINE>}<NEW_LINE>String sql = "select " + StringUtils.join(selects, ", ") + " from " + cls.getName() + " o";<NEW_LINE>Long rank = 0L;<NEW_LINE>if (null != sequence) {<NEW_LINE>sql += " where o." + JpaObject.sequence_FIELDNAME + " < ?1";<NEW_LINE>rank = emc.countGreaterThanOrEqualTo(cls, JpaObject.sequence_FIELDNAME, sequence);<NEW_LINE>}<NEW_LINE>sql += " order by o." + JpaObject.sequence_FIELDNAME + " DESC";<NEW_LINE>Query query = em.createQuery(sql, Object[].class);<NEW_LINE>if (null != sequence) {<NEW_LINE>query.setParameter(1, sequence);<NEW_LINE>}<NEW_LINE>List<Object[]> list = query.setMaxResults(Math.max(Math.min(count, list_max), list_min)).getResultList();<NEW_LINE>List<JsonObject> wos = new ArrayList<>();<NEW_LINE>result.setCount(emc.count(cls));<NEW_LINE>for (Object[] os : list) {<NEW_LINE>JsonObject jsonObject = XGsonBuilder.instance().toJsonTree(JpaObject.cast(cls, fields, os)).getAsJsonObject();<NEW_LINE>jsonObject.getAsJsonObject().addProperty("rank", ++rank);<NEW_LINE>wos.add(jsonObject);<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | result = new ActionResult<>(); |
1,395,183 | public void addGetterMethod(final String methodName, final ASMFieldNodeAdapter fieldNode) {<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(fieldNode, "fieldNode");<NEW_LINE>// no argument is ().<NEW_LINE>final String desc = "()" + fieldNode.getDesc();<NEW_LINE>final MethodNode methodNode = new MethodNode(Opcodes.ACC_PUBLIC, methodName, desc, null, null);<NEW_LINE>final InsnList instructions = getInsnList(methodNode);<NEW_LINE>// load this.<NEW_LINE>instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));<NEW_LINE>// get fieldNode.<NEW_LINE>instructions.add(new FieldInsnNode(Opcodes.GETFIELD, classNode.name, fieldNode.getName(), fieldNode.getDesc()));<NEW_LINE>// return of type.<NEW_LINE>final Type type = Type.getType(fieldNode.getDesc());<NEW_LINE>instructions.add(new InsnNode(type.getOpcode(Opcodes.IRETURN)));<NEW_LINE>addMethodNode0(methodNode);<NEW_LINE>} | Objects.requireNonNull(methodName, "methodName"); |
626,973 | public KinesisStreamsInputUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>KinesisStreamsInputUpdate kinesisStreamsInputUpdate = new KinesisStreamsInputUpdate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceARNUpdate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kinesisStreamsInputUpdate.setResourceARNUpdate(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 kinesisStreamsInputUpdate;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,318,986 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>LayoutInflater inflater = getLayoutInflater();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>// Remove the status bar color. The DrawerLayout is responsible for drawing it from now on.<NEW_LINE>setStatusBarColor(getWindow());<NEW_LINE>}<NEW_LINE>// Explicitly reference the application object since we don't want to match our own injector.<NEW_LINE>ObjectGraph appGraph = Injector.obtain(getApplication());<NEW_LINE>appGraph.inject(this);<NEW_LINE>activityGraph = appGraph.plus(new MainActivityModule(this));<NEW_LINE>ViewGroup container = viewContainer.forActivity(this);<NEW_LINE>inflater.inflate(R.layout.main_activity, container);<NEW_LINE><MASK><NEW_LINE>drawerLayout.setStatusBarBackgroundColor(statusBarColor);<NEW_LINE>drawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);<NEW_LINE>drawer.setNavigationItemSelectedListener(item -> {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case R.id.nav_search:<NEW_LINE>Toast.makeText(MainActivity.this, "Search!", LENGTH_SHORT).show();<NEW_LINE>break;<NEW_LINE>case R.id.nav_trending:<NEW_LINE>Toast.makeText(MainActivity.this, "Trending!", LENGTH_SHORT).show();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown navigation item: " + item.getTitle());<NEW_LINE>}<NEW_LINE>drawerLayout.closeDrawers();<NEW_LINE>// If we supported actual navigation, we would change what was checked and navigate there.<NEW_LINE>// item.setChecked(true);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>inflater.inflate(R.layout.trending_view, content);<NEW_LINE>} | ButterKnife.bind(this, container); |
1,450,714 | private Prediction<T> innerPredictThreadPool(ExecutorService pool, ThreadLocal<PriorityQueue<OutputDoublePair<T>>> queuePool, DistanceType distType, Example<T> example) {<NEW_LINE>SparseVector vector = SparseVector.createSparseVector(example, featureIDMap, false);<NEW_LINE>List<Future<List<OutputDoublePair<T>>>> futures = new ArrayList<>();<NEW_LINE>for (int i = 0; i < numThreads; i++) {<NEW_LINE>int start = i * (vectors.length / numThreads);<NEW_LINE>int end = (i + 1) * (vectors.length / numThreads);<NEW_LINE>futures.add(pool.submit(() -> innerPredictChunk(queuePool, vectors, start, end, distType, k, vector)));<NEW_LINE>}<NEW_LINE>PriorityQueue<OutputDoublePair<T>> queue = new PriorityQueue<>(k, (a, b) -> Double.compare(b.value, a.value));<NEW_LINE>try {<NEW_LINE>for (Future<List<OutputDoublePair<T>>> f : futures) {<NEW_LINE>List<OutputDoublePair<T><MASK><NEW_LINE>for (OutputDoublePair<T> curOutputPair : chunkOutputs) {<NEW_LINE>if (queue.size() < k) {<NEW_LINE>queue.offer(curOutputPair);<NEW_LINE>} else if (Double.compare(curOutputPair.value, queue.peek().value) < 0) {<NEW_LINE>queue.poll();<NEW_LINE>queue.offer(curOutputPair);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>throw new IllegalStateException("Thread pool went bang", e);<NEW_LINE>}<NEW_LINE>List<Prediction<T>> predictions = new ArrayList<>();<NEW_LINE>for (OutputDoublePair<T> pair : queue) {<NEW_LINE>predictions.add(new Prediction<>(pair.output, vector.numActiveElements(), example));<NEW_LINE>}<NEW_LINE>return combiner.combine(outputIDInfo, predictions);<NEW_LINE>} | > chunkOutputs = f.get(); |
690,618 | /*<NEW_LINE>The "diameter" of a given subtree is the longest path between "any two<NEW_LINE>nodes in the tree". If we want a maximal diameter, we want to know the<NEW_LINE>deepest depth of the left & right subtree of a node (this maximizes the<NEW_LINE>path) and we then add 1 to account for the subtree root.<NEW_LINE>*/<NEW_LINE>private RecursiveAnswer subtreeMaxDiameter(TreeNode root) {<NEW_LINE>if (root == null) {<NEW_LINE>return new RecursiveAnswer(0, 0);<NEW_LINE>}<NEW_LINE>RecursiveAnswer left = subtreeMaxDiameter(root.left);<NEW_LINE>RecursiveAnswer right = subtreeMaxDiameter(root.right);<NEW_LINE>int leftAndRightMax = Math.max(left.bestDiameterSeenSoFar, right.bestDiameterSeenSoFar);<NEW_LINE>int bestDiameterSeenSoFar = Math.max(leftAndRightMax, <MASK><NEW_LINE>// +1 to include the root itself along with the deeper subtree height<NEW_LINE>int subtreeHeight = Math.max(left.subtreeHeight, right.subtreeHeight) + 1;<NEW_LINE>return new RecursiveAnswer(bestDiameterSeenSoFar, subtreeHeight);<NEW_LINE>} | left.subtreeHeight + right.subtreeHeight); |
1,538,273 | public void parse(String result, Object data) {<NEW_LINE>JsonObject jobj = JsonParser.parseString(result).getAsJsonObject();<NEW_LINE>if (jobj.has("type")) {<NEW_LINE>String type = jobj.get("type").getAsString();<NEW_LINE>if (type.equals("error")) {<NEW_LINE>String desc = jobj.get("description").getAsString();<NEW_LINE>manager.getEventListeners().fire.consoleOutput(desc + "\n", 0);<NEW_LINE>Msg.error(this, desc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jobj.has("payload")) {<NEW_LINE>Object object = jobj.get("payload");<NEW_LINE>if (!(object instanceof JsonPrimitive)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + " not a String\n", 0);<NEW_LINE>Msg.error(this, object);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String value = ((JsonPrimitive) object).getAsString();<NEW_LINE>if (!value.startsWith("{")) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JsonElement res = JsonParser.parseString(value);<NEW_LINE>if (res instanceof JsonObject) {<NEW_LINE>JsonObject keyValue = (JsonObject) res;<NEW_LINE>JsonElement element = keyValue.get("key");<NEW_LINE>if (element != null) {<NEW_LINE><MASK><NEW_LINE>String key = element.getAsString();<NEW_LINE>if (!key.equals(name)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(res + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>if (res.equals("[]")) {<NEW_LINE>Msg.error(this, "nothing returned for " + this);<NEW_LINE>}<NEW_LINE>if (res instanceof JsonArray) {<NEW_LINE>JsonArray arr = (JsonArray) res;<NEW_LINE>for (JsonElement l : arr) {<NEW_LINE>parseSpecifics(l);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parseSpecifics(res);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cleanup();<NEW_LINE>} | res = keyValue.get("value"); |
950,146 | private void updateSelectedContent() {<NEW_LINE>TableRowCore[<MASK><NEW_LINE>ArrayList<ISelectedContent> valid = new ArrayList<>();<NEW_LINE>last_selected_content.clear();<NEW_LINE>for (int i = 0; i < rows.length; i++) {<NEW_LINE>SBC_SearchResult rc = (SBC_SearchResult) rows[i].getDataSource();<NEW_LINE>last_selected_content.add(rc);<NEW_LINE>byte[] hash = rc.getHash();<NEW_LINE>if (hash != null && hash.length > 0) {<NEW_LINE>SelectedContent sc = new SelectedContent(Base32.encode(hash), rc.getName());<NEW_LINE>sc.setDownloadInfo(new DownloadUrlInfo(getDownloadURI(rc)));<NEW_LINE>valid.add(sc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ISelectedContent[] sels = valid.toArray(new ISelectedContent[valid.size()]);<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent("IconBarEnabler", sels, tv_subs_results);<NEW_LINE>UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();<NEW_LINE>if (uiFunctions != null) {<NEW_LINE>uiFunctions.refreshIconBar();<NEW_LINE>}<NEW_LINE>} | ] rows = tv_subs_results.getSelectedRows(); |
1,503,949 | public static void growBorder(GrayF64 src, ImageBorder_F64 border, int borderX0, int borderY0, int borderX1, int borderY1, GrayF64 dst) {<NEW_LINE>dst.reshape(src.width + borderX0 + borderX1, src.height + borderY0 + borderY1);<NEW_LINE>border.setImage(src);<NEW_LINE>// Copy src into the inner portion of dst<NEW_LINE>ImageMiscOps.copy(0, 0, borderX0, borderY0, src.width, src.height, src, dst);<NEW_LINE>// Top border<NEW_LINE>for (int y = 0; y < borderY0; y++) {<NEW_LINE>int idxDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width; x++) {<NEW_LINE>dst.data[idxDst++] = border.get(x - borderX0, y - borderY0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Bottom border<NEW_LINE>for (int y = 0; y < borderY1; y++) {<NEW_LINE>int idxDst = dst.startIndex + (dst.height - borderY1 + y) * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width; x++) {<NEW_LINE>dst.data[idxDst++] = border.get(x - borderX0, src.height + y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Left and right border<NEW_LINE>for (int y = borderY0; y < dst.height - borderY1; y++) {<NEW_LINE>int idxDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < borderX0; x++) {<NEW_LINE>dst.data[idxDst++] = border.get(<MASK><NEW_LINE>}<NEW_LINE>idxDst = dst.startIndex + y * dst.stride + src.width + borderX0;<NEW_LINE>for (int x = 0; x < borderX1; x++) {<NEW_LINE>dst.data[idxDst++] = border.get(src.width + x, y - borderY0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | x - borderX0, y - borderY0); |
1,421,167 | private BigDecimal computePriceDifference(@NonNull final ContextForCompesationOrder compensationOrderContext, @NonNull final I_C_Contract_Change contractChange) {<NEW_LINE>final List<I_C_SubscriptionProgress> sps = compensationOrderContext.getSubscriptionProgress();<NEW_LINE>final Timestamp changeDate = compensationOrderContext.getChangeDate();<NEW_LINE>final List<I_C_SubscriptionProgress> deliveries = sps.stream().filter(currentSP -> changeDate.after(currentSP.getEventDate()) && X_C_SubscriptionProgress.EVENTTYPE_Delivery.equals(currentSP.getEventType())).collect(Collectors.toList());<NEW_LINE>if (deliveries.isEmpty()) {<NEW_LINE>return BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>final ISubscriptionBL subscriptionBL = Services.get(ISubscriptionBL.class);<NEW_LINE>final I_C_Flatrate_Term currentTerm = compensationOrderContext.getCurrentTerm();<NEW_LINE>final Properties <MASK><NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(currentTerm);<NEW_LINE>final PricingSystemId pricingSystemId = getPricingSystemId(currentTerm, contractChange);<NEW_LINE>// compute the difference (see javaDoc of computePriceDifference for details)<NEW_LINE>final BigDecimal difference = subscriptionBL.computePriceDifference(ctx, pricingSystemId, deliveries, trxName);<NEW_LINE>logger.debug("The price difference to be applied on deliveries before the change is " + difference);<NEW_LINE>return difference;<NEW_LINE>} | ctx = InterfaceWrapperHelper.getCtx(currentTerm); |
1,165,703 | private static List<PluginConfig> buildPluginConfigs(PluginConfig updatedConfig, String priorVersion, AgentConfig agentConfig) throws OptimisticLockException {<NEW_LINE>List<PluginConfig> pluginConfigs = Lists.newArrayList(agentConfig.getPluginConfigList());<NEW_LINE>ListIterator<PluginConfig<MASK><NEW_LINE>boolean found = false;<NEW_LINE>while (i.hasNext()) {<NEW_LINE>PluginConfig pluginConfig = i.next();<NEW_LINE>if (pluginConfig.getId().equals(updatedConfig.getId())) {<NEW_LINE>String existingVersion = Versions.getVersion(pluginConfig);<NEW_LINE>if (!priorVersion.equals(existingVersion)) {<NEW_LINE>throw new OptimisticLockException();<NEW_LINE>}<NEW_LINE>i.set(buildPluginConfig(pluginConfig, updatedConfig.getPropertyList(), true));<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found) {<NEW_LINE>return pluginConfigs;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Plugin config not found: " + updatedConfig.getId());<NEW_LINE>}<NEW_LINE>} | > i = pluginConfigs.listIterator(); |
213,363 | /*<NEW_LINE>* Returns the source file name as defined in the given info.<NEW_LINE>* If not present in the info, infers it from this type.<NEW_LINE>*/<NEW_LINE>public String sourceFileName(IBinaryType info) {<NEW_LINE>char[] sourceFileName = info.sourceFileName();<NEW_LINE>if (sourceFileName == null) {<NEW_LINE>if (info.isMember()) {<NEW_LINE>IType enclosingType = getDeclaringType();<NEW_LINE>// play it safe<NEW_LINE>if (enclosingType == null)<NEW_LINE>return null;<NEW_LINE>while (enclosingType.getDeclaringType() != null) {<NEW_LINE>enclosingType = enclosingType.getDeclaringType();<NEW_LINE>}<NEW_LINE>return enclosingType.getElementName() + Util.defaultJavaExtension();<NEW_LINE>} else if (info.isLocal() || info.isAnonymous()) {<NEW_LINE>String typeQualifiedName = getTypeQualifiedName();<NEW_LINE>int dollar = typeQualifiedName.indexOf('$');<NEW_LINE>if (dollar == -1) {<NEW_LINE>// malformed inner type: name doesn't contain a dollar<NEW_LINE>return getElementName() + Util.defaultJavaExtension();<NEW_LINE>}<NEW_LINE>return typeQualifiedName.substring(0, dollar) + Util.defaultJavaExtension();<NEW_LINE>} else {<NEW_LINE>return getElementName() + Util.defaultJavaExtension();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int index = CharOperation.lastIndexOf('/', sourceFileName);<NEW_LINE>return new String(sourceFileName, index + 1, <MASK><NEW_LINE>}<NEW_LINE>} | sourceFileName.length - index - 1); |
1,186,428 | private static void logTrace(Plugin plugin, int severity, String message, String scope, Throwable th) {<NEW_LINE>if (isScopeEnabled(IDebugScopes.LOGGER)) {<NEW_LINE>StatusLevel newSeverity = getStatusLevel(severity);<NEW_LINE>boolean inSeverity = isSeverityEnabled(newSeverity);<NEW_LINE>String cause = StringUtil.EMPTY;<NEW_LINE>if (!inSeverity) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>cause = "Not logging items of current severity.";<NEW_LINE>} else if (!isScopeEnabled(scope)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>cause = "Scope not enabled.";<NEW_LINE>}<NEW_LINE>String traceMessage = // $NON-NLS-1$<NEW_LINE>MessageFormat.// $NON-NLS-1$<NEW_LINE>format(// $NON-NLS-1$<NEW_LINE>"(Build {0}) Skipping log of {1} {2} {3}. Cause: {4}", EclipseUtil.getPluginVersion(plugin), getLabel(severity), scope, message, cause);<NEW_LINE>if (plugin != null) {<NEW_LINE>Status logStatus = new Status(severity, plugin.getBundle().getSymbolicName(), IStatus.OK, traceMessage, th);<NEW_LINE>plugin.getLog().log(logStatus);<NEW_LINE>} else {<NEW_LINE>// CHECKSTYLE:ON<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.err.println(traceMessage); |
568,779 | public void sub(int size, Register dst, Register src, int immediate) {<NEW_LINE>assert (!dst.equals(zr) && !src.equals(zr));<NEW_LINE>if (immediate < 0) {<NEW_LINE>add(size, dst, src, -immediate);<NEW_LINE>} else if (isAddSubtractImmediate(immediate, false)) {<NEW_LINE>if (!(dst.equals(src) && immediate == 0)) {<NEW_LINE>super.sub(size, dst, src, immediate);<NEW_LINE>}<NEW_LINE>} else if (NumUtil.isUnsignedNbit(24, immediate)) {<NEW_LINE>super.sub(size, dst, src, immediate & (NumUtil.getNbitNumberInt(12) << 12));<NEW_LINE>super.sub(size, dst, dst, immediate & NumUtil.getNbitNumberInt(12));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>mov(dst, immediate);<NEW_LINE>sub(size, dst, src, dst);<NEW_LINE>}<NEW_LINE>} | assert !dst.equals(src); |
985,344 | public Response searchPermsDebug(@QueryParam("key") String apiToken, @QueryParam("id") Long dvObjectId) {<NEW_LINE>User user = findUserByApiToken(apiToken);<NEW_LINE>if (user == null) {<NEW_LINE>return error(Response.Status.UNAUTHORIZED, "Invalid apikey");<NEW_LINE>}<NEW_LINE>DvObject dvObjectToLookUp = dvObjectService.findDvObject(dvObjectId);<NEW_LINE>if (dvObjectToLookUp == null) {<NEW_LINE>return error(Status.BAD_REQUEST, "Could not find DvObject based on id " + dvObjectId);<NEW_LINE>}<NEW_LINE>List<DvObjectSolrDoc> solrDocs = SolrIndexService.determineSolrDocs(dvObjectToLookUp);<NEW_LINE>JsonObjectBuilder data = Json.createObjectBuilder();<NEW_LINE>JsonArrayBuilder permissionsData = Json.createArrayBuilder();<NEW_LINE>for (DvObjectSolrDoc solrDoc : solrDocs) {<NEW_LINE>JsonObjectBuilder dataDoc = Json.createObjectBuilder();<NEW_LINE>dataDoc.add(SearchFields.ID, solrDoc.getSolrId());<NEW_LINE>dataDoc.add(SearchFields.NAME_SORT, solrDoc.getNameOrTitle());<NEW_LINE>JsonArrayBuilder perms = Json.createArrayBuilder();<NEW_LINE>for (String perm : solrDoc.getPermissions()) {<NEW_LINE>perms.add(perm);<NEW_LINE>}<NEW_LINE>dataDoc.add(SearchFields.DISCOVERABLE_BY, perms);<NEW_LINE>permissionsData.add(dataDoc);<NEW_LINE>}<NEW_LINE>data.add("perms", permissionsData);<NEW_LINE>DvObject dvObject = dvObjectService.findDvObject(dvObjectId);<NEW_LINE>NullSafeJsonBuilder timestamps = jsonObjectBuilder();<NEW_LINE>timestamps.add(contentChanged, SearchUtil.getTimestampOrNull(dvObject.getModificationTime()));<NEW_LINE>timestamps.add(contentIndexed, SearchUtil.getTimestampOrNull(dvObject.getIndexTime()));<NEW_LINE>timestamps.add(permsChanged, SearchUtil.getTimestampOrNull(dvObject.getPermissionModificationTime()));<NEW_LINE>timestamps.add(permsIndexed, SearchUtil.getTimestampOrNull(dvObject.getPermissionIndexTime()));<NEW_LINE>Set<RoleAssignment> <MASK><NEW_LINE>JsonArrayBuilder roleAssignmentsData = Json.createArrayBuilder();<NEW_LINE>for (RoleAssignment roleAssignment : roleAssignments) {<NEW_LINE>roleAssignmentsData.add(roleAssignment.getRole() + " has been granted to " + roleAssignment.getAssigneeIdentifier() + " on " + roleAssignment.getDefinitionPoint());<NEW_LINE>}<NEW_LINE>data.add("timestamps", timestamps);<NEW_LINE>data.add("roleAssignments", roleAssignmentsData);<NEW_LINE>return ok(data);<NEW_LINE>} | roleAssignments = rolesSvc.rolesAssignments(dvObject); |
153,784 | @ApiOperation(httpMethod = "GET", value = "Get permissions by group", notes = "", produces = MediaType.APPLICATION_JSON_VALUE, response = List.class)<NEW_LINE>public List<ReadablePermission> listPermissions(@PathVariable String group) {<NEW_LINE>Group g = null;<NEW_LINE>try {<NEW_LINE>g = groupService.findByName(group);<NEW_LINE>if (g == null) {<NEW_LINE>throw new ResourceNotFoundException("Group [" + group + "] does not exist");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("An error occured while getting group [" + group + "]", e);<NEW_LINE>throw new ServiceRuntimeException("An error occured while getting group [" + group + "]");<NEW_LINE>}<NEW_LINE>Set<Permission> permissions = g.getPermissions();<NEW_LINE>List<ReadablePermission> readablePermissions = new ArrayList<ReadablePermission>();<NEW_LINE>for (Permission permission : permissions) {<NEW_LINE>ReadablePermission readablePermission = new ReadablePermission();<NEW_LINE>readablePermission.<MASK><NEW_LINE>readablePermission.setId(permission.getId());<NEW_LINE>readablePermissions.add(readablePermission);<NEW_LINE>}<NEW_LINE>return readablePermissions;<NEW_LINE>} | setName(permission.getPermissionName()); |
957,406 | public void handleDoubleClick(Widget w, WidgetAction.WidgetMouseEvent e) {<NEW_LINE>if (diagramScene.isAllVisible()) {<NEW_LINE>Set<Integer> hiddenNodes = new HashSet<Integer>(diagramScene.getModel().getGraphToView().getGroup().getAllNodes());<NEW_LINE>hiddenNodes.removeAll(this.getFigure().getSource().getSourceNodesAsSet());<NEW_LINE>this.diagramScene.showNot(hiddenNodes);<NEW_LINE>} else if (isBoundary()) {<NEW_LINE>Set<Integer> hiddenNodes = new HashSet<Integer>(diagramScene.getModel().getHiddenNodes());<NEW_LINE>hiddenNodes.removeAll(this.getFigure().<MASK><NEW_LINE>this.diagramScene.showNot(hiddenNodes);<NEW_LINE>} else {<NEW_LINE>Set<Integer> hiddenNodes = new HashSet<Integer>(diagramScene.getModel().getHiddenNodes());<NEW_LINE>hiddenNodes.addAll(this.getFigure().getSource().getSourceNodesAsSet());<NEW_LINE>this.diagramScene.showNot(hiddenNodes);<NEW_LINE>}<NEW_LINE>} | getSource().getSourceNodesAsSet()); |
166,181 | final NotifyWhenUploadedResult executeNotifyWhenUploaded(NotifyWhenUploadedRequest notifyWhenUploadedRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(notifyWhenUploadedRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<NotifyWhenUploadedRequest> request = null;<NEW_LINE>Response<NotifyWhenUploadedResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new NotifyWhenUploadedRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(notifyWhenUploadedRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "NotifyWhenUploaded");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<NotifyWhenUploadedResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new NotifyWhenUploadedResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,286,611 | public void populateProperties(WayPropertySet props) {<NEW_LINE>// Replace existing matching properties as the logic is that the first statement registered takes precedence over later statements<NEW_LINE>props.setProperties("highway=trunk_link", StreetTraversalPermission.ALL, 2.06, 2.06);<NEW_LINE>props.setProperties("highway=trunk", StreetTraversalPermission.ALL, 7.47, 7.47);<NEW_LINE>// Don't recommend walking in trunk road tunnels<NEW_LINE>props.setProperties("highway=trunk;tunnel=yes", StreetTraversalPermission.CAR, 7.47, 7.47);<NEW_LINE>// Do not walk on "moottoriliikennetie"<NEW_LINE>props.setProperties("motorroad=yes", <MASK><NEW_LINE>// Remove informal and private roads<NEW_LINE>props.setProperties("highway=*;informal=yes", StreetTraversalPermission.NONE);<NEW_LINE>props.setProperties("highway=service;access=private", StreetTraversalPermission.NONE);<NEW_LINE>props.setProperties("highway=trail", StreetTraversalPermission.NONE);<NEW_LINE>// No biking on designated footways/sidewalks<NEW_LINE>props.setProperties("highway=footway", StreetTraversalPermission.PEDESTRIAN);<NEW_LINE>// Prefer designated cycleways<NEW_LINE>props.setProperties("highway=cycleway;bicycle=designated", StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE, 0.6, 0.6);<NEW_LINE>// Remove Helsinki city center service tunnel network from graph<NEW_LINE>props.setProperties("highway=service;tunnel=yes;access=destination", StreetTraversalPermission.NONE);<NEW_LINE>props.setProperties("highway=service;access=destination", StreetTraversalPermission.ALL, 1.1, 1.1);<NEW_LINE>// = 100kph. Varies between 80 - 120 kph depending on road and season.<NEW_LINE>props.setCarSpeed("highway=motorway", 27.77f);<NEW_LINE>// = 54kph<NEW_LINE>props.setCarSpeed("highway=motorway_link", 15);<NEW_LINE>// 80kph "Valtatie"<NEW_LINE>props.setCarSpeed("highway=trunk", 22.22f);<NEW_LINE>// = 54kph<NEW_LINE>props.setCarSpeed("highway=trunk_link", 15);<NEW_LINE>// 80kph "Kantatie"<NEW_LINE>props.setCarSpeed("highway=primary", 22.22f);<NEW_LINE>// = 54kph<NEW_LINE>props.setCarSpeed("highway=primary_link", 15);<NEW_LINE>// Read the rest from the default set<NEW_LINE>new DefaultWayPropertySetSource().populateProperties(props);<NEW_LINE>} | StreetTraversalPermission.CAR, 7.47, 7.47); |
400,697 | protected boolean attach(ReferenceType theClass) {<NEW_LINE>if (theClass == null || className == null || !className.equals(parseTopLevelClassName(theClass.name()))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log("trying to attach: " + line.fileName + ":" + line.lineIdx + " to " + theClass.name());<NEW_LINE>if (!dbg.isPaused()) {<NEW_LINE>log("can't attach breakpoint, debugger not paused");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// find line in java space<NEW_LINE>LineID javaLine = dbg.sketchToJavaLine(line);<NEW_LINE>if (javaLine == null) {<NEW_LINE>log("couldn't find line " + line + " in the java code");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>log("BPs of class: " + theClass + ", line " + (javaLine.lineIdx() + 1));<NEW_LINE>List<Location> locations = theClass.locationsOfLine(<MASK><NEW_LINE>if (locations.isEmpty()) {<NEW_LINE>log("no location found for line " + line + " -> " + javaLine);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// use first found location<NEW_LINE>bpr = dbg.vm().eventRequestManager().createBreakpointRequest(locations.get(0));<NEW_LINE>bpr.enable();<NEW_LINE>log("attached breakpoint to " + line + " -> " + javaLine);<NEW_LINE>return true;<NEW_LINE>} catch (AbsentInformationException ex) {<NEW_LINE>Messages.err(null, ex);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | javaLine.lineIdx() + 1); |
1,300,842 | final ListTasksResult executeListTasks(ListTasksRequest listTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTasksRequest> request = null;<NEW_LINE>Response<ListTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTasksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTasksRequest));<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, "Snow Device Management");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTasksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTasksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,014,630 | private void forwardResults(BatchIterator<Row> it, boolean isLast) {<NEW_LINE>multiBucketBuilder.build(buckets);<NEW_LINE>AtomicInteger numActiveRequests = new AtomicInteger(downstreams.size());<NEW_LINE>for (int i = 0; i < downstreams.size(); i++) {<NEW_LINE>Downstream downstream = downstreams.get(i);<NEW_LINE>if (downstream.needsMoreData == false) {<NEW_LINE><MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (traceEnabled) {<NEW_LINE>LOGGER.trace("forwardResults targetNode={} jobId={} targetPhase={}/{} bucket={} isLast={}", downstream.nodeId, jobId, targetPhaseId, inputId, bucketIdx, isLast);<NEW_LINE>}<NEW_LINE>distributedResultAction.pushResult(downstream.nodeId, new DistributedResultRequest(jobId, targetPhaseId, inputId, bucketIdx, buckets[i], isLast), new ActionListener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(DistributedResultResponse response) {<NEW_LINE>downstream.needsMoreData = response.needMore();<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>failure = e;<NEW_LINE>downstream.needsMoreData = false;<NEW_LINE>// continue because it's necessary to send something to downstreams still waiting for data<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | countdownAndMaybeContinue(it, numActiveRequests, true); |
947,022 | public PsiElement resolve() {<NEW_LINE>// the property may belong to a field that was declared in an implemented interface<NEW_LINE>final JSGraphQLEndpointObjectTypeDefinition typeDefinition = PsiTreeUtil.getParentOfType(self, JSGraphQLEndpointObjectTypeDefinition.class);<NEW_LINE>if (typeDefinition != null && typeDefinition.getImplementsInterfaces() != null) {<NEW_LINE>final JSGraphQLEndpointNamedType[] implementedTypes = PsiTreeUtil.getChildrenOfType(typeDefinition.<MASK><NEW_LINE>if (implementedTypes != null) {<NEW_LINE>for (JSGraphQLEndpointNamedType implementedType : implementedTypes) {<NEW_LINE>final PsiReference reference = implementedType.getReference();<NEW_LINE>final PsiElement resolvedType = reference.resolve();<NEW_LINE>if (resolvedType != null && resolvedType.getParent() instanceof JSGraphQLEndpointInterfaceTypeDefinition) {<NEW_LINE>Ref<JSGraphQLEndpointPropertyPsiElement> result = new Ref<>(null);<NEW_LINE>resolvedType.getParent().accept(new PsiRecursiveElementVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitElement(PsiElement element) {<NEW_LINE>if (result.get() != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element instanceof JSGraphQLEndpointPropertyPsiElement) {<NEW_LINE>final JSGraphQLEndpointPropertyPsiElement interfaceProperty = (JSGraphQLEndpointPropertyPsiElement) element;<NEW_LINE>final String name = interfaceProperty.getName();<NEW_LINE>if (nameIdentifier.getText().equals(name)) {<NEW_LINE>result.set(interfaceProperty);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitElement(element);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result.get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getImplementsInterfaces(), JSGraphQLEndpointNamedType.class); |
1,464,632 | private void normalize(Set<EventBean> result, Map<Object, Object> submap, CompositeIndexQueryResultPostProcessor postProcessor) {<NEW_LINE>if (submap.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (next == null) {<NEW_LINE>if (postProcessor != null) {<NEW_LINE>for (Map.Entry<Object, Object> entry : submap.entrySet()) {<NEW_LINE>postProcessor.add(entry.getValue(), result);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Map.Entry<Object, Object> entry : submap.entrySet()) {<NEW_LINE>Set<EventBean> set = (Set<EventBean>) entry.getValue();<NEW_LINE>result.addAll(set);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Map.Entry<Object, Object> entry : submap.entrySet()) {<NEW_LINE>TreeMap index = (TreeMap) entry.getValue();<NEW_LINE>next.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | lookup(index, result, postProcessor); |
1,643,521 | protected void encodeMarkup(FacesContext context, InputText inputText) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = inputText.getClientId(context);<NEW_LINE>writer.startElement("input", inputText);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("name", clientId, null);<NEW_LINE>writer.writeAttribute("type", inputText.getType(), null);<NEW_LINE>String valueToRender = ComponentUtils.getValueToRender(context, inputText);<NEW_LINE>if (valueToRender != null) {<NEW_LINE>writer.writeAttribute("value", valueToRender, null);<NEW_LINE>}<NEW_LINE>if (inputText.getStyle() != null) {<NEW_LINE>writer.writeAttribute("style", inputText.getStyle(), null);<NEW_LINE>}<NEW_LINE>writer.writeAttribute("class", createStyleClass(inputText<MASK><NEW_LINE>renderAccessibilityAttributes(context, inputText);<NEW_LINE>renderRTLDirection(context, inputText);<NEW_LINE>renderPassThruAttributes(context, inputText, HTML.INPUT_TEXT_ATTRS_WITHOUT_EVENTS);<NEW_LINE>renderDomEvents(context, inputText, HTML.INPUT_TEXT_EVENTS);<NEW_LINE>renderValidationMetadata(context, inputText);<NEW_LINE>writer.endElement("input");<NEW_LINE>} | , InputText.STYLE_CLASS), "styleClass"); |
1,638,772 | public void onBreakSpeed(IToolStackView tool, int level, BreakSpeed event, Direction sideHit, boolean isEffective, float miningSpeedModifier) {<NEW_LINE>if (isEffective) {<NEW_LINE><MASK><NEW_LINE>Item item = state.getBlock().asItem();<NEW_LINE>if (item != Items.AIR) {<NEW_LINE>Level world = event.getPlayer().level;<NEW_LINE>// +7 per level if it has a melting recipe, cache to save lookup time<NEW_LINE>// TODO: consider whether we should use getCloneItemStack, problem is I don't want a position based logic and its possible the result is BE based<NEW_LINE>if (BOOSTED_BLOCKS.computeIfAbsent(item, i -> isEffective(world, i)) == Boolean.TRUE) {<NEW_LINE>event.setNewSpeed(event.getNewSpeed() + level * 6 * tool.getMultiplier(ToolStats.MINING_SPEED) * miningSpeedModifier);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BlockState state = event.getState(); |
1,538,569 | public void deleteRepositoryAttributes(Long repositoryId, List<String> attributesKeys, boolean deleteAll, boolean canNotOperateOnProtected, RepositoryEnums.RepositoryTypeEnum repositoryType) throws ModelDBException {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>session.beginTransaction();<NEW_LINE>var repositoryEntity = getRepositoryById(session, RepositoryIdentification.newBuilder().setRepoId(repositoryId).build(), true, canNotOperateOnProtected, repositoryType);<NEW_LINE>session.<MASK><NEW_LINE>if (deleteAll) {<NEW_LINE>var query = session.createQuery(DELETE_ALL_REPOSITORY_ATTRIBUTES_HQL).setLockOptions(new LockOptions().setLockMode(LockMode.PESSIMISTIC_WRITE));<NEW_LINE>query.setParameter("repoId", repositoryEntity.getId());<NEW_LINE>query.executeUpdate();<NEW_LINE>} else {<NEW_LINE>var query = session.createQuery(DELETE_SELECTED_REPOSITORY_ATTRIBUTES_HQL).setLockOptions(new LockOptions().setLockMode(LockMode.PESSIMISTIC_WRITE));<NEW_LINE>query.setParameter("keys", attributesKeys);<NEW_LINE>query.setParameter("repoId", repositoryEntity.getId());<NEW_LINE>query.executeUpdate();<NEW_LINE>}<NEW_LINE>var updateRepoTimeQuery = new StringBuilder("UPDATE RepositoryEntity rp SET rp.date_updated = :updatedTime, version_number=(version_number + 1) where rp.id = :repoId ");<NEW_LINE>var updateRepoQuery = session.createQuery(updateRepoTimeQuery.toString());<NEW_LINE>updateRepoQuery.setParameter("updatedTime", new Date().getTime());<NEW_LINE>updateRepoQuery.setParameter("repoId", repositoryId);<NEW_LINE>updateRepoQuery.executeUpdate();<NEW_LINE>session.getTransaction().commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ModelDBUtils.needToRetry(ex)) {<NEW_LINE>deleteRepositoryAttributes(repositoryId, attributesKeys, deleteAll, canNotOperateOnProtected, repositoryType);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | lock(repositoryEntity, LockMode.PESSIMISTIC_WRITE); |
1,559,593 | public void indexAll(IProject project) {<NEW_LINE>// New index is disabled, see bug 544898<NEW_LINE>// this.indexer.makeDirty(project);<NEW_LINE>if (JavaCore.getPlugin() == null)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>// Disable index manager to avoid synchronization lock contention when adding new index requests to the queue.<NEW_LINE>disable();<NEW_LINE>// Also request indexing of binaries on the classpath<NEW_LINE>// determine the new children<NEW_LINE>try {<NEW_LINE>JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel();<NEW_LINE>JavaProject javaProject = (JavaProject) model.getJavaProject(project);<NEW_LINE>// only consider immediate libraries - each project will do the same<NEW_LINE>// NOTE: force to resolve CP variables before calling indexer - 19303, so that initializers<NEW_LINE>// will be run in the current thread.<NEW_LINE>IClasspathEntry[] entries = javaProject.getResolvedClasspath();<NEW_LINE>for (int i = 0; i < entries.length; i++) {<NEW_LINE>IClasspathEntry entry = entries[i];<NEW_LINE>if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY)<NEW_LINE>indexLibrary(entry.getPath(), project, ((ClasspathEntry) entry).getLibraryIndexLocation());<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// cannot retrieve classpath info<NEW_LINE>}<NEW_LINE>// check if the same request is not already in the queue<NEW_LINE>IndexRequest request <MASK><NEW_LINE>requestIfNotWaiting(request);<NEW_LINE>} finally {<NEW_LINE>// Enable index manager after adding all new index requests to the queue.<NEW_LINE>enable();<NEW_LINE>}<NEW_LINE>} | = new IndexAllProject(project, this); |
63,529 | public void writePartitionedFanoutDataWriter(Blackhole blackhole) throws IOException {<NEW_LINE>FileIO io = table().io();<NEW_LINE>OutputFileFactory fileFactory = newFileFactory();<NEW_LINE>SparkFileWriterFactory writerFactory = SparkFileWriterFactory.builderFor(table()).dataFileFormat(fileFormat()).dataSchema(table().schema()).build();<NEW_LINE>FanoutDataWriter<InternalRow> writer = new FanoutDataWriter<>(writerFactory, fileFactory, io, TARGET_FILE_SIZE_IN_BYTES);<NEW_LINE>PartitionKey partitionKey = new PartitionKey(partitionedSpec, table().schema());<NEW_LINE>StructType dataSparkType = SparkSchemaUtil.convert(table().schema());<NEW_LINE><MASK><NEW_LINE>try (FanoutDataWriter<InternalRow> closeableWriter = writer) {<NEW_LINE>for (InternalRow row : rows) {<NEW_LINE>partitionKey.partition(internalRowWrapper.wrap(row));<NEW_LINE>closeableWriter.write(row, partitionedSpec, partitionKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>blackhole.consume(writer);<NEW_LINE>} | InternalRowWrapper internalRowWrapper = new InternalRowWrapper(dataSparkType); |
1,232,626 | private void execute(Task task) throws Exception {<NEW_LINE>try {<NEW_LINE>String series = StringTools.uniqueToken();<NEW_LINE>WorkLog workLog = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>workLog = emc.firstEqualAndEqual(WorkLog.class, WorkLog.job_FIELDNAME, task.getJob(), WorkLog.fromActivityToken_FIELDNAME, task.getActivityToken());<NEW_LINE>}<NEW_LINE>this.passExpired(task);<NEW_LINE>String taskCompletedId = this.porcessingTask(task);<NEW_LINE>this.porcessingWork(task, series);<NEW_LINE>List<Task> newTasks = new ArrayList<>();<NEW_LINE>Record record = this.record(workLog, task, taskCompletedId, series, newTasks);<NEW_LINE>this.updateTask(task, newTasks);<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionPassExpired(e, task.getId(), task.getTitle());<NEW_LINE>}<NEW_LINE>} | this.updateTaskCompleted(taskCompletedId, record); |
1,138,547 | public int onStartCommand(@Nullable Intent intent, int flags, int startId) {<NEW_LINE>int startCommand = super.onStartCommand(intent, flags, startId);<NEW_LINE>if (intent != null) {<NEW_LINE>int id = intent.getIntExtra(getPackageName() + ".ID", -1);<NEW_LINE>String mode = intent.<MASK><NEW_LINE>LogUtility.d("" + mode);<NEW_LINE>GalleryDownloaderManager manager = DownloadQueue.managerFromId(id);<NEW_LINE>if (manager != null) {<NEW_LINE>LogUtility.d("IntentAction: " + mode + " for id " + id);<NEW_LINE>assert mode != null;<NEW_LINE>switch(mode) {<NEW_LINE>case "STOP":<NEW_LINE>DownloadQueue.remove(id, true);<NEW_LINE>break;<NEW_LINE>case "PAUSE":<NEW_LINE>manager.downloader().setStatus(GalleryDownloaderV2.Status.PAUSED);<NEW_LINE>break;<NEW_LINE>case "START":<NEW_LINE>manager.downloader().setStatus(GalleryDownloaderV2.Status.NOT_STARTED);<NEW_LINE>DownloadQueue.givePriority(manager.downloader());<NEW_LINE>startWork(this);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return startCommand;<NEW_LINE>} | getStringExtra(getPackageName() + ".MODE"); |
560,369 | private void doSetResult(AsyncExecutionContextImpl<CompletionStage<R>> executionContext, MethodResult<CompletionStage<R>> result) {<NEW_LINE>CompletableFuture<R> resultWrapper = (CompletableFuture<R>) executionContext.getResultWrapper();<NEW_LINE>// Completing the return wrapper may cause user code to run, so set the thread context first as we may be on an async thread<NEW_LINE>ThreadContextDescriptor threadContext = executionContext.getThreadContextDescriptor();<NEW_LINE>try {<NEW_LINE>ArrayList<ThreadContext> contexts = null;<NEW_LINE>try {<NEW_LINE>contexts = threadContext.taskStarting();<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>// Component for captured context is no longer running<NEW_LINE>result = MethodResult.internalFailure(createAppStoppedException(e, executionContext));<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Execution {0} final fault tolerance result: {1}", executionContext.getId(), result);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (result.isFailure()) {<NEW_LINE>resultWrapper.completeExceptionally(result.getFailure());<NEW_LINE>} else {<NEW_LINE>result.getResult(<MASK><NEW_LINE>result.getResult().exceptionally((ex) -> {<NEW_LINE>resultWrapper.completeExceptionally(ex);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (contexts != null) {<NEW_LINE>threadContext.taskStopping(contexts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Tr.error(tc, "internal.error.CWMFT4998E", t);<NEW_LINE>resultWrapper.completeExceptionally(new FaultToleranceException(Tr.formatMessage(tc, "internal.error.CWMFT4998E", t), t));<NEW_LINE>}<NEW_LINE>} | ).thenAccept(resultWrapper::complete); |
308,165 | public boolean grantLock(Connection connectionInTransaction, String lockName) throws SQLException {<NEW_LINE>int updates = 0;<NEW_LINE>String needList = null;<NEW_LINE>try (PreparedStatement getNeedListPs = connectionInTransaction.prepareStatement(SQL_GET_NEED_LIST)) {<NEW_LINE>getNeedListPs.setString(1, lockName);<NEW_LINE>ResultSet resultSet = getNeedListPs.executeQuery();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>needList = resultSet.getString(COLUMN_NEED_LIST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (PreparedStatement updateSessionPs = connectionInTransaction.prepareStatement(SQL_UPDATE_SESSION_AND_NEED_LIST)) {<NEW_LINE>if (needList != null && !needList.isEmpty()) {<NEW_LINE>int <MASK><NEW_LINE>String newNeedList = needList.substring(index + 1);<NEW_LINE>String grantedSession = needList.substring(0, index);<NEW_LINE>updateSessionPs.setString(1, grantedSession);<NEW_LINE>updateSessionPs.setString(2, newNeedList);<NEW_LINE>updateSessionPs.setString(3, lockName);<NEW_LINE>updates = updateSessionPs.executeUpdate();<NEW_LINE>if (updates == 1) {<NEW_LINE>logger.debug(drdsSession + " grant the lock: " + lockName + " to " + grantedSession);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return updates == 1;<NEW_LINE>} | index = needList.indexOf(","); |
778,604 | static QuadTreeImpl buildQuadTreeForPaths(MultiPathImpl multipathImpl) {<NEW_LINE>Envelope2D extent = new Envelope2D();<NEW_LINE>multipathImpl.queryLooseEnvelope2D(extent);<NEW_LINE>if (extent.isEmpty())<NEW_LINE>return null;<NEW_LINE>QuadTreeImpl quad_tree_impl = new QuadTreeImpl(extent, 8);<NEW_LINE>int hint_index = -1;<NEW_LINE>Envelope2D boundingbox = new Envelope2D();<NEW_LINE>boolean resized_extent = false;<NEW_LINE>do {<NEW_LINE>for (int ipath = 0, npaths = multipathImpl.getPathCount(); ipath < npaths; ipath++) {<NEW_LINE>multipathImpl.queryPathEnvelope2D(ipath, boundingbox);<NEW_LINE>hint_index = quad_tree_impl.insert(ipath, boundingbox, hint_index);<NEW_LINE>if (hint_index == -1) {<NEW_LINE>if (resized_extent)<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>// This is usually happens because esri shape buffer contains geometry extent which is slightly different from the true extent.<NEW_LINE>// Recalculate extent<NEW_LINE>multipathImpl.calculateEnvelope2D(extent, false);<NEW_LINE>resized_extent = true;<NEW_LINE><MASK><NEW_LINE>// break the for loop<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>resized_extent = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (resized_extent);<NEW_LINE>return quad_tree_impl;<NEW_LINE>} | quad_tree_impl.reset(extent, 8); |
1,601,934 | private void finishCreateReplica(AgentTask task, TFinishTaskRequest request) {<NEW_LINE>// if we get here, this task will be removed from AgentTaskQueue for certain.<NEW_LINE>// because in this function, the only problem that cause failure is meta missing.<NEW_LINE>// and if meta is missing, we no longer need to resend this task<NEW_LINE>try {<NEW_LINE>CreateReplicaTask createReplicaTask = (CreateReplicaTask) task;<NEW_LINE>if (request.getTaskStatus().getStatusCode() != TStatusCode.OK) {<NEW_LINE>createReplicaTask.countDownToZero(task.getBackendId() + ": " + request.getTaskStatus().getErrorMsgs().toString());<NEW_LINE>} else {<NEW_LINE>long tabletId = createReplicaTask.getTabletId();<NEW_LINE>if (request.isSetFinishTabletInfos()) {<NEW_LINE>Replica replica = Env.getCurrentInvertedIndex().getReplica(createReplicaTask.getTabletId(), createReplicaTask.getBackendId());<NEW_LINE>replica.setPathHash(request.getFinishTabletInfos().get(0).getPathHash());<NEW_LINE>if (createReplicaTask.isRecoverTask()) {<NEW_LINE>replica.setBad(false);<NEW_LINE>LOG.info("finish recover create replica task. set replica to good. tablet {}," + " replica {}, backend {}", tabletId, task.getBackendId(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// this should be called before 'countDownLatch()'<NEW_LINE>Env.getCurrentSystemInfo().updateBackendReportVersion(task.getBackendId(), request.getReportVersion(), task.getDbId(), task.getTableId());<NEW_LINE>createReplicaTask.countDownLatch(task.getBackendId(), task.getSignature());<NEW_LINE>LOG.debug("finish create replica. tablet id: {}, be: {}, report version: {}", tabletId, task.getBackendId(), request.getReportVersion());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>AgentTaskQueue.removeTask(task.getBackendId(), TTaskType.CREATE, task.getSignature());<NEW_LINE>}<NEW_LINE>} | ), replica.getId()); |
377,085 | public void onNotificationPosted(StatusBarNotification sbn) {<NEW_LINE>for (CompoundData compoundData : dataList) {<NEW_LINE>NotificationEventData eventData = compoundData.notificationEventData;<NEW_LINE>Intent intent = match(sbn, eventData.app, eventData.title, eventData.content) ? NotificationSlot.NotifyIntentPrototype.obtainPositiveIntent(compoundData.uri) : NotificationSlot.NotifyIntentPrototype.obtainNegativeIntent(compoundData.uri);<NEW_LINE>intent.putExtra(NotificationEventData.AppDynamics.<MASK><NEW_LINE>Bundle extras = sbn.getNotification().extras;<NEW_LINE>String title = extras.getCharSequence(Notification.EXTRA_TITLE) != null ? extras.getCharSequence(Notification.EXTRA_TITLE).toString() : null;<NEW_LINE>String contentText = extras.getCharSequence(Notification.EXTRA_TEXT) != null ? extras.getCharSequence(Notification.EXTRA_TEXT).toString() : null;<NEW_LINE>intent.putExtra(NotificationEventData.TitleDynamics.id, title);<NEW_LINE>intent.putExtra(NotificationEventData.ContentDynamics.id, contentText);<NEW_LINE>sendBroadcast(intent);<NEW_LINE>}<NEW_LINE>super.onNotificationPosted(sbn);<NEW_LINE>} | id, sbn.getPackageName()); |
30,844 | public void refreshTree(final ITreeNode<CTag> tag) {<NEW_LINE>final List<DefaultMutableTreeNode> lastNodes = TreeHelpers.getLastExpandedNodes(m_tagsTree);<NEW_LINE>final List<Integer> lastNodeIds = new ArrayList<Integer>();<NEW_LINE>if ((tag != null) && (tag.getParent() != null)) {<NEW_LINE>lastNodeIds.add(tag.getParent().getObject().getId());<NEW_LINE>}<NEW_LINE>for (final DefaultMutableTreeNode lastNode : lastNodes) {<NEW_LINE>if (lastNode.getUserObject() instanceof Integer) {<NEW_LINE>final int tagId = <MASK><NEW_LINE>lastNodeIds.add(tagId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>deleteChildren();<NEW_LINE>createChildren();<NEW_LINE>final Enumeration<?> bfn = breadthFirstEnumeration();<NEW_LINE>while (bfn.hasMoreElements()) {<NEW_LINE>final Object node = bfn.nextElement();<NEW_LINE>int tagId = -1;<NEW_LINE>TreePath path = null;<NEW_LINE>if (node instanceof CRootTagTreeNode) {<NEW_LINE>final CRootTagTreeNode rootNode = (CRootTagTreeNode) node;<NEW_LINE>tagId = m_rootTag.getObject().getId();<NEW_LINE>path = new TreePath(rootNode.getPath());<NEW_LINE>} else if (node instanceof CTagTreeNode) {<NEW_LINE>final CTagTreeNode treeNode = (CTagTreeNode) node;<NEW_LINE>tagId = treeNode.getTag().getObject().getId();<NEW_LINE>path = new TreePath(treeNode.getPath());<NEW_LINE>} else if (node instanceof CTaggedGraphNodesContainerNode) {<NEW_LINE>final CTaggedGraphNodesContainerNode containerNode = (CTaggedGraphNodesContainerNode) node;<NEW_LINE>tagId = -containerNode.getTag().getObject().getId();<NEW_LINE>path = new TreePath(containerNode.getPath());<NEW_LINE>}<NEW_LINE>if (lastNodeIds.contains(tagId)) {<NEW_LINE>m_tagsTree.expandPath(path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Integer) lastNode.getUserObject(); |
1,152,570 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>final InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE><MASK><NEW_LINE>// Set sample rate(s0)<NEW_LINE>final InstrumentMethod constructor = target.getConstructor("org.springframework.http.HttpMethod", "java.net.URI", "org.springframework.http.HttpHeaders", "org.springframework.util.MultiValueMap", "org.springframework.web.reactive.function.BodyInserter", "java.util.Map");<NEW_LINE>if (constructor != null) {<NEW_LINE>constructor.addInterceptor(BodyInserterRequestBuilderConstructorInterceptor.class);<NEW_LINE>}<NEW_LINE>// RPC<NEW_LINE>final InstrumentMethod method = target.getDeclaredMethod("writeTo", "org.springframework.http.client.reactive.ClientHttpRequest", "org.springframework.web.reactive.function.client.ExchangeStrategies");<NEW_LINE>if (method != null) {<NEW_LINE>method.addInterceptor(BodyInserterRequestBuilderWriteToInterceptor.class);<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | target.addField(AsyncContextAccessor.class); |
1,391,134 | protected Hover onTrackMouseMove(Fonts.TextMeasurer m, double x, double y, int mods) {<NEW_LINE>MemorySummaryTrack.Data data = track.getData(state.toRequest(), onUiThread());<NEW_LINE>if (data == null || data.ts.length == 0) {<NEW_LINE>return Hover.NONE;<NEW_LINE>}<NEW_LINE>long time = state.pxToTime(x);<NEW_LINE>if (time < data.ts[0] || time > data.ts[data.ts.length - 1]) {<NEW_LINE>return Hover.NONE;<NEW_LINE>}<NEW_LINE>int idx = 0;<NEW_LINE>for (; idx < data.ts.length - 1; idx++) {<NEW_LINE>if (data.ts[idx + 1] > time) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long id = data.id[idx];<NEW_LINE>hovered = new HoverCard(m, data.total[idx], data.unused[idx], data.buffCache[idx]);<NEW_LINE>mouseXpos = x;<NEW_LINE>mouseYpos = (height - 2 * TRACK_MARGIN - hovered.allSize.h) / 2;<NEW_LINE>return new Hover() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Area getRedraw() {<NEW_LINE>return new Area(mouseXpos - CURSOR_SIZE, -TRACK_MARGIN, CURSOR_SIZE + HOVER_MARGIN + hovered.allSize.w + 3 * HOVER_PADDING + <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>hovered = null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean click() {<NEW_LINE>if ((mods & SWT.MOD1) == SWT.MOD1) {<NEW_LINE>state.addSelection(Kind.Memory, track.getValue(id));<NEW_LINE>} else {<NEW_LINE>state.setSelection(Kind.Memory, track.getValue(id));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | LEGEND_SIZE, HEIGHT + 2 * TRACK_MARGIN); |
1,590,969 | static PostgreDataType resolveDataType(@NotNull DBRProgressMonitor monitor, @NotNull PostgreDatabase database, long oid) throws SQLException, DBException {<NEW_LINE>// Initially cache only base types (everything but composite and arrays)<NEW_LINE>try (JDBCSession session = database.getDefaultContext(monitor, true).openSession(monitor, DBCExecutionPurpose.META, "Resolve data type by OID")) {<NEW_LINE>try (final JDBCPreparedStatement dbStat = session.prepareStatement("SELECT t.oid,t.*,c.relkind," + getBaseTypeNameClause(database.getDataSource()) + " FROM pg_catalog.pg_type t" + "\nLEFT OUTER JOIN pg_class c ON c.oid=t.typrelid" + "\nWHERE t.oid=? ")) {<NEW_LINE>dbStat.setLong(1, oid);<NEW_LINE>try (JDBCResultSet dbResult = dbStat.executeQuery()) {<NEW_LINE>if (dbResult.next()) {<NEW_LINE>long schemaOid = JDBCUtils.safeGetLong(dbResult, "typnamespace");<NEW_LINE>PostgreSchema schema = database.getSchema(monitor, schemaOid);<NEW_LINE>if (schema == null) {<NEW_LINE>throw new DBException(<MASK><NEW_LINE>}<NEW_LINE>PostgreDataType dataType = PostgreDataType.readDataType(session, database, dbResult, false);<NEW_LINE>if (dataType != null) {<NEW_LINE>return dataType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new DBException("Data type " + oid + " not found in database " + database.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Schema " + schemaOid + " not found for data type " + oid); |
1,156,229 | private static Groups prepareGroups(@Nonnull VcsLogDataPack dataPack, @Nullable Collection<VirtualFile> visibleRoots, @Nullable List<List<String>> recentItems) {<NEW_LINE>Groups filteredGroups = new Groups();<NEW_LINE>Collection<VcsRef> allRefs = dataPack.getRefs().getBranches();<NEW_LINE>for (Map.Entry<VirtualFile, Set<VcsRef>> entry : VcsLogUtil.groupRefsByRoot(allRefs).entrySet()) {<NEW_LINE>VirtualFile root = entry.getKey();<NEW_LINE>if (visibleRoots != null && !visibleRoots.contains(root))<NEW_LINE>continue;<NEW_LINE>Collection<VcsRef> refs = entry.getValue();<NEW_LINE>VcsLogProvider provider = dataPack.getLogProviders().get(root);<NEW_LINE>VcsLogRefManager refManager = provider.getReferenceManager();<NEW_LINE>List<RefGroup> refGroups = refManager.groupForBranchFilter(refs);<NEW_LINE>putActionsForReferences(refGroups, filteredGroups);<NEW_LINE>}<NEW_LINE>if (recentItems != null) {<NEW_LINE>for (List<String> recentItem : recentItems) {<NEW_LINE>if (recentItem.size() == 1) {<NEW_LINE>final String item = ContainerUtil.getFirstItem(recentItem);<NEW_LINE>if (filteredGroups.singletonGroups.contains(item) || ContainerUtil.find(filteredGroups.expandedGroups.values(), strings -> strings.contains(item)) != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredGroups;<NEW_LINE>} | filteredGroups.recentGroups.add(recentItem); |
1,625,384 | public static // of the pattern in the text in O(n+m) time.<NEW_LINE>List<Integer> rabinKarp(String text, String pattern) {<NEW_LINE>List<Integer> matches = new ArrayList<>();<NEW_LINE>if (text == null || pattern == null)<NEW_LINE>return matches;<NEW_LINE>// Find pattern length (PL) and text length (TL)<NEW_LINE>final int PL = pattern.length()<MASK><NEW_LINE>if (PL > TL)<NEW_LINE>return matches;<NEW_LINE>// Compute the initial hash values<NEW_LINE>long[] patternHash = computeHash(pattern);<NEW_LINE>long[] rollingHash = computeHash(text.substring(0, PL));<NEW_LINE>final BigInteger BIG_PL = new BigInteger(String.valueOf(PL));<NEW_LINE>final long[] POWERS = new long[N_HASHES];<NEW_LINE>for (int i = 0; i < N_HASHES; i++) POWERS[i] = BIG_ALPHA.modPow(BIG_PL, BIG_MODS[i]).longValue();<NEW_LINE>for (int i = PL - 1; ; ) {<NEW_LINE>if (Arrays.equals(patternHash, rollingHash)) {<NEW_LINE>matches.add(i - PL + 1);<NEW_LINE>}<NEW_LINE>if (++i == TL)<NEW_LINE>return matches;<NEW_LINE>char firstValue = text.charAt(i - PL);<NEW_LINE>char lastValue = text.charAt(i);<NEW_LINE>// Update rolling hash<NEW_LINE>for (int j = 0; j < patternHash.length; j++) {<NEW_LINE>rollingHash[j] = addRight(rollingHash[j], lastValue, j);<NEW_LINE>rollingHash[j] = removeLeft(rollingHash[j], POWERS[j], firstValue, j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , TL = text.length(); |
687,697 | public ThingTypeProperties unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ThingTypeProperties thingTypeProperties = new ThingTypeProperties();<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("thingTypeDescription", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thingTypeProperties.setThingTypeDescription(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("searchableAttributes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thingTypeProperties.setSearchableAttributes(new ListUnmarshaller<String>(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 thingTypeProperties;<NEW_LINE>} | class).unmarshall(context)); |
579,644 | // -----------------------------------------------------<NEW_LINE>// Actually Crud<NEW_LINE>// -------------<NEW_LINE>@Execute<NEW_LINE>@Secured({ ROLE })<NEW_LINE>public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(<MASK><NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>getDataConfig(form).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>dataConfigService.store(entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), this::asEditHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>} | form.crudMode, CrudMode.CREATE); |
298,913 | public void changedUpdate(DocumentEvent e) {<NEW_LINE>String text = formPanel.getText(IMAGE);<NEW_LINE>boolean hasImage = !((ListItemProperty) formPanel.getSelectedItem(TYPE)).getName().contains("Image") || text != null && (text = text.trim()).length() != 0;<NEW_LINE>text = formPanel.getText(NAME);<NEW_LINE>boolean hasName = text != null && (text = text.trim()).length() != 0;<NEW_LINE>boolean hasShow = formPanel.isSelected(SHOW_GM) || formPanel.isSelected(SHOW_OWNER) || formPanel.isSelected(SHOW_OTHERS);<NEW_LINE>BooleanTokenOverlay selectedState = (<MASK><NEW_LINE>boolean hasUniqueUpdateName = false;<NEW_LINE>if (selectedState != null)<NEW_LINE>hasUniqueUpdateName = selectedState.getName().equals(text) || !getNames().contains(text);<NEW_LINE>formPanel.getButton(ADD).setEnabled(hasName && !getNames().contains(text) && hasImage && hasShow);<NEW_LINE>formPanel.getButton(UPDATE).setEnabled(hasName && hasUniqueUpdateName && selectedState != null && hasShow);<NEW_LINE>} | BooleanTokenOverlay) formPanel.getSelectedItem(STATES); |
1,117,774 | public SetterDetails analyze(Class<?> setterType) {<NEW_LINE>Objects.requireNonNull(setterType, "setterType");<NEW_LINE>if (!setterType.isInterface()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Method[] methods = setterType.getDeclaredMethods();<NEW_LINE>if (methods.length != 1) {<NEW_LINE>throw new IllegalArgumentException("Setter interface must have only one method: " + setterType.getName());<NEW_LINE>}<NEW_LINE>Method setter = methods[0];<NEW_LINE>Class<?>[] arguments = setter.getParameterTypes();<NEW_LINE>if (arguments.length != 1) {<NEW_LINE>throw new IllegalArgumentException("Setter interface method must have exactly 1 argument: " + setterType.getName());<NEW_LINE>}<NEW_LINE>Class<?> fieldType = arguments[0];<NEW_LINE>Class<?> returnType = setter.getReturnType();<NEW_LINE>if (returnType != void.class) {<NEW_LINE>throw new IllegalArgumentException("Setter must have return type void: " + setterType.getName());<NEW_LINE>}<NEW_LINE>return new SetterDetails(setter, fieldType);<NEW_LINE>} | IllegalArgumentException("setterType " + setterType + "is not an interface"); |
1,384,377 | private boolean populateStreamRequestUrl(StringBuilder uriString) {<NEW_LINE>ObjectMapper objMapper = new ObjectMapper();<NEW_LINE>Formatter uriFmt = new Formatter(uriString);<NEW_LINE>String filtersStr = null;<NEW_LINE>boolean error = false;<NEW_LINE>if (null != _filter) {<NEW_LINE>try {<NEW_LINE>Map<Long, DbusKeyFilter<MASK><NEW_LINE>if (null != fMap && fMap.size() > 0)<NEW_LINE>filtersStr = objMapper.writeValueAsString(fMap);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.error("Got exception while serializing Filters. Filter Map was : " + _filter, ex);<NEW_LINE>error = true;<NEW_LINE>onRequestFailure(uriString.toString(), ex);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>LOG.error("Got exception while serializing Filters. Filter Map was : " + _filter, ex);<NEW_LINE>error = true;<NEW_LINE>onRequestFailure(uriString.toString(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>formRequest(uriFmt, filtersStr);<NEW_LINE>return error;<NEW_LINE>} | > fMap = _filter.getFilterMap(); |
1,636,246 | public ProcessPreconditionsResolution checkPreconditionsApplicable(final IProcessPreconditionsContext context) {<NEW_LINE>if (!context.isSingleSelection()) {<NEW_LINE>return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection();<NEW_LINE>}<NEW_LINE>if (!I_AD_User.Table_Name.equals(context.getTableName())) {<NEW_LINE>return ProcessPreconditionsResolution.rejectWithInternalReason("not running on AD_User table");<NEW_LINE>}<NEW_LINE>// Make sure it's NOT the current logged in user<NEW_LINE>final int adUserId = context.getSingleSelectedRecordId();<NEW_LINE>if (adUserId == Env.getAD_User_ID(Env.getCtx())) {<NEW_LINE>return ProcessPreconditionsResolution.rejectWithInternalReason("current logged in user");<NEW_LINE>}<NEW_LINE>final I_AD_User user = Services.get(IUserDAO.class).retrieveUserOrNull(Env.getCtx(), adUserId);<NEW_LINE>final I_AD_User userSystem = InterfaceWrapperHelper.<MASK><NEW_LINE>if (!userSystem.isSystemUser()) {<NEW_LINE>return ProcessPreconditionsResolution.rejectWithInternalReason("not a system user");<NEW_LINE>}<NEW_LINE>return ProcessPreconditionsResolution.accept();<NEW_LINE>} | create(user, I_AD_User.class); |
1,375,316 | public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>final String[] names = Strings.splitStringByCommaToArray(request.param("name"));<NEW_LINE>final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(names);<NEW_LINE>if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) == false) {<NEW_LINE>deprecationLogger.deprecatedAndMaybeLog("get_index_template_with_types", TYPES_DEPRECATION_MESSAGE);<NEW_LINE>}<NEW_LINE>getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local()));<NEW_LINE>getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout()));<NEW_LINE>final boolean implicitAll = getIndexTemplatesRequest.names().length == 0;<NEW_LINE>return channel -> client.admin().indices().getTemplates(getIndexTemplatesRequest, new RestToXContentListener<GetIndexTemplatesResponse>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected RestStatus getStatus(final GetIndexTemplatesResponse response) {<NEW_LINE>final boolean templateExists = response.getIndexTemplates<MASK><NEW_LINE>return (templateExists || implicitAll) ? OK : NOT_FOUND;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ().isEmpty() == false; |
1,268,492 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@public @buseventtype create json schema JsonEvent (c0 Map);\n" + "@name('s0') select * from JsonEvent#keepall;\n";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>Object[][] namesAndTypes = new Object[][] { { "c0", Map.class } };<NEW_LINE>env.assertStatement("s0", statement -> SupportEventTypeAssertionUtil.assertEventTypeProperties(namesAndTypes, statement.getEventType(), SupportEventTypeAssertionEnum.NAME, SupportEventTypeAssertionEnum.TYPE));<NEW_LINE>String[] jsons = new String[] { "{\"c0\": {\"c1\" : 10}}", "{\"c0\": {\"c1\": [\"c2\", 20]}}" };<NEW_LINE>for (String json : jsons) {<NEW_LINE>env.sendEventJson(json, "JsonEvent");<NEW_LINE>env.assertEventNew("s0", event -> assertJsonWrite(json, event));<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>env.assertIterator("s0", it -> {<NEW_LINE>for (String json : jsons) {<NEW_LINE>assertJsonWrite(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | json, it.next()); |
976,075 | ArrayList<Object> new156() /* reduce AFixedArrayDescriptor */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PFixedArrayDescriptor pfixedarraydescriptorNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TLBracket tlbracketNode2;<NEW_LINE>PImmediate pimmediateNode3;<NEW_LINE>TRBracket trbracketNode4;<NEW_LINE>tlbracketNode2 = (<MASK><NEW_LINE>pimmediateNode3 = (PImmediate) nodeArrayList2.get(0);<NEW_LINE>trbracketNode4 = (TRBracket) nodeArrayList3.get(0);<NEW_LINE>pfixedarraydescriptorNode1 = new AFixedArrayDescriptor(tlbracketNode2, pimmediateNode3, trbracketNode4);<NEW_LINE>}<NEW_LINE>nodeList.add(pfixedarraydescriptorNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | TLBracket) nodeArrayList1.get(0); |
139,733 | Object adaptOutput(Object output, AnnotatedElement element, AnnotatedType type) {<NEW_LINE>if (output == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Transparently handle unexpected wrapped results. This enables elegant exception handling, partial results etc.<NEW_LINE>if (DataFetcherResult.class.equals(output.getClass())) /*&& !DataFetcherResult.class.equals(resolver.getRawReturnType())*/<NEW_LINE>{<NEW_LINE>DataFetcherResult<?> result = (DataFetcherResult<?>) output;<NEW_LINE>if (result.getData() == null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return result.transform(res -> res.data(convert(result.getData(), element, type<MASK><NEW_LINE>}<NEW_LINE>Object converted = convert(output, element, type);<NEW_LINE>return errors.isEmpty() ? converted : DataFetcherResult.newResult().data(converted).errors(errors).build();<NEW_LINE>} | )).errors(errors)); |
286,096 | private static void runAssertionAllTypes(RegressionEnvironment env, String typeName, Object[] events) {<NEW_LINE>String graph = "@name('flow') create dataflow MyGraph " + "DefaultSupportSourceOp -> instream<" + typeName + ">{}" + "EventBusSink(instream) {}";<NEW_LINE>env.compileDeploy(graph);<NEW_LINE>env.compileDeploy("@name('s0') select * from " <MASK><NEW_LINE>DefaultSupportSourceOp source = new DefaultSupportSourceOp(events);<NEW_LINE>EPDataFlowInstantiationOptions options = new EPDataFlowInstantiationOptions();<NEW_LINE>options.operatorProvider(new DefaultSupportGraphOpProvider(source));<NEW_LINE>EPDataFlowInstance instance = env.runtime().getDataFlowService().instantiate(env.deploymentId("flow"), "MyGraph", options);<NEW_LINE>instance.run();<NEW_LINE>env.assertPropsPerRowNewFlattened("s0", "myDouble,myInt,myString".split(","), new Object[][] { { 1.1d, 1, "one" }, { 2.2d, 2, "two" } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | + typeName).addListener("s0"); |
204,500 | final UpdateSMBSecurityStrategyResult executeUpdateSMBSecurityStrategy(UpdateSMBSecurityStrategyRequest updateSMBSecurityStrategyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSMBSecurityStrategyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSMBSecurityStrategyRequest> request = null;<NEW_LINE>Response<UpdateSMBSecurityStrategyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSMBSecurityStrategyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSMBSecurityStrategyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSMBSecurityStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSMBSecurityStrategyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSMBSecurityStrategyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
235,996 | private void generateExternalTables(Properties ctx, HttpServletRequest httpRequest) {<NEW_LINE>HttpSession thisSession = httpRequest.getSession(false);<NEW_LINE>WebInfo wi = null;<NEW_LINE>if (thisSession != null)<NEW_LINE>if (thisSession.getAttribute(WebInfo.NAME) != null)<NEW_LINE>wi = (WebInfo) thisSession.getAttribute(WebInfo.NAME);<NEW_LINE>int[] tableKeys = X_CM_TemplateTable.getAllIDs("CM_TemplateTable", "CM_Template_ID=" + thisRequest.getCM_Container().getCM_Template_ID(), "WebCM");<NEW_LINE>if (tableKeys.length > 0) {<NEW_LINE>xmlCode.append("<externalTables>\n");<NEW_LINE>for (int i = 0; i < tableKeys.length; i++) {<NEW_LINE>X_CM_TemplateTable thisTemplateTable = new X_CM_TemplateTable(ctx, tableKeys[i], "WebCM");<NEW_LINE>try {<NEW_LINE>StringBuffer tempXML = new StringBuffer();<NEW_LINE>tempXML.append("<" + <MASK><NEW_LINE>MTable table = MTable.get(ctx, thisTemplateTable.getAD_Table_ID());<NEW_LINE>String trxName = null;<NEW_LINE>int[] ids = PO.getAllIDs(table.getTableName(), replaceSessionElements(wi, thisTemplateTable.getWhereClause()), trxName);<NEW_LINE>if (ids != null && ids.length > 0) {<NEW_LINE>for (int j = 0; j < ids.length; j++) {<NEW_LINE>PO po = null;<NEW_LINE>po = table.getPO(ids[j], null);<NEW_LINE>if (po != null) {<NEW_LINE>tempXML = po.get_xmlString(tempXML);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tempXML.append("\n</" + thisTemplateTable.getName() + ">\n");<NEW_LINE>xmlCode.append(tempXML);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>xmlCode.append("\n</externalTables>\n");<NEW_LINE>}<NEW_LINE>} | thisTemplateTable.getName() + ">\n"); |
945,727 | private ArrayList<UploadPart> splitFile(long fileSize, long partSize) {<NEW_LINE>ArrayList<UploadPart> parts <MASK><NEW_LINE>long partNum = fileSize / partSize;<NEW_LINE>if (partNum >= 10000) {<NEW_LINE>partSize = fileSize / (10000 - 1);<NEW_LINE>partNum = fileSize / partSize;<NEW_LINE>}<NEW_LINE>for (long i = 0; i < partNum; i++) {<NEW_LINE>UploadPart part = new UploadPart();<NEW_LINE>part.number = (int) (i + 1);<NEW_LINE>part.offset = i * partSize;<NEW_LINE>part.size = partSize;<NEW_LINE>part.isCompleted = false;<NEW_LINE>parts.add(part);<NEW_LINE>}<NEW_LINE>if (fileSize % partSize > 0) {<NEW_LINE>UploadPart part = new UploadPart();<NEW_LINE>part.number = parts.size() + 1;<NEW_LINE>part.offset = parts.size() * partSize;<NEW_LINE>part.size = fileSize % partSize;<NEW_LINE>part.isCompleted = false;<NEW_LINE>parts.add(part);<NEW_LINE>}<NEW_LINE>return parts;<NEW_LINE>} | = new ArrayList<UploadPart>(); |
67,462 | private void createBeanSymbol(DOMNode node, IJavaProject project, String docURI, long lastModified, TextDocument document, List<CachedSymbol> generatedSymbols) throws Exception {<NEW_LINE>String beanID = null;<NEW_LINE>int symbolStart = 0;<NEW_LINE>int symbolEnd = 0;<NEW_LINE>String beanClass = null;<NEW_LINE>List<DOMAttr> attributes = node.getAttributeNodes();<NEW_LINE>for (DOMAttr attribute : attributes) {<NEW_LINE>String name = attribute.getName();<NEW_LINE>if (name != null && name.equals("id")) {<NEW_LINE>beanID = attribute.getValue();<NEW_LINE>symbolStart = attribute.getStart();<NEW_LINE>symbolEnd = attribute.getEnd();<NEW_LINE>} else if (name != null && name.equals("class")) {<NEW_LINE>String value = attribute.getValue();<NEW_LINE>beanClass = value.substring(value.lastIndexOf(".") + 1);<NEW_LINE>if (symbolStart == 0 && symbolEnd == 0) {<NEW_LINE>symbolStart = attribute.getStart();<NEW_LINE>symbolEnd = attribute.getEnd();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (beanClass != null) {<NEW_LINE>int lineStart = document.getLineOfOffset(symbolStart);<NEW_LINE>int lineEnd = document.getLineOfOffset(symbolEnd);<NEW_LINE>int startInLine = symbolStart - document.getLineOffset(lineStart);<NEW_LINE>int endInLine = symbolEnd - document.getLineOffset(lineEnd);<NEW_LINE>Range range = new Range();<NEW_LINE>range.setStart(new Position(lineStart, startInLine));<NEW_LINE>range.setEnd(new Position(lineEnd, endInLine));<NEW_LINE>Location location = new Location();<NEW_LINE>location.setUri(docURI);<NEW_LINE>location.setRange(range);<NEW_LINE>if (beanID == null) {<NEW_LINE>beanID = deriveBeanIDFromClass(beanClass);<NEW_LINE>}<NEW_LINE>SymbolInformation symbol = new SymbolInformation("@+ '" + beanID + "' " + beanClass, SymbolKind.Interface, new Location(docURI, range));<NEW_LINE>SymbolAddOnInformation[] addon = new SymbolAddOnInformation[] { new BeansSymbolAddOnInformation(beanID) };<NEW_LINE>EnhancedSymbolInformation fullSymbol <MASK><NEW_LINE>CachedSymbol cachedSymbol = new CachedSymbol(docURI, lastModified, fullSymbol);<NEW_LINE>generatedSymbols.add(cachedSymbol);<NEW_LINE>}<NEW_LINE>} | = new EnhancedSymbolInformation(symbol, addon); |
1,547,088 | private static BatchOperator<?> packBatchOp(BatchOperator<?> data, final long id) {<NEW_LINE>DataSet<Row<MASK><NEW_LINE>final TypeInformation<?>[] types = data.getColTypes();<NEW_LINE>rows = rows.map(new RichMapFunction<Row, Row>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -182592464977659219L;<NEW_LINE><NEW_LINE>transient CsvFormatter formatter;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void open(Configuration parameters) throws Exception {<NEW_LINE>formatter = new CsvFormatter(types, "^", '\'');<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row map(Row value) throws Exception {<NEW_LINE>return Row.of(id, formatter.format(value));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return BatchOperator.fromTable(DataSetConversionUtil.toTable(data.getMLEnvironmentId(), rows, new String[] { "f1", "f2" }, new TypeInformation[] { Types.LONG, Types.STRING })).setMLEnvironmentId(data.getMLEnvironmentId());<NEW_LINE>} | > rows = data.getDataSet(); |
571,135 | protected void loadCheckConstraints(DefaultRelations relations) throws SQLException {<NEW_LINE>for (Record record : create().select(SYSCHECKS.sysconstraints().systables().sysschemas().SCHEMANAME, SYSCHECKS.sysconstraints().systables().TABLENAME, SYSCHECKS.sysconstraints().CONSTRAINTNAME, SYSCHECKS.CHECKDEFINITION).from(SYSCHECKS).where(SYSCHECKS.sysconstraints().systables().sysschemas().SCHEMANAME.in(getInputSchemata()))) {<NEW_LINE>SchemaDefinition schema = getSchema(record.get(SYSCHECKS.sysconstraints().systables().sysschemas().SCHEMANAME));<NEW_LINE>TableDefinition table = getTable(schema, record.get(SYSCHECKS.sysconstraints().systables().TABLENAME));<NEW_LINE>if (table != null) {<NEW_LINE>relations.addCheckConstraint(table, new DefaultCheckConstraintDefinition(schema, table, record.get(SYSCHECKS.sysconstraints().CONSTRAINTNAME), record.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(SYSCHECKS.CHECKDEFINITION))); |
1,061,135 | private AmountSourceAndAcct createPaymentFacts(final Fact fact, final DocLine_Allocation line) {<NEW_LINE>final AcctSchema as = fact.getAcctSchema();<NEW_LINE>final BigDecimal paymentAllocatedAmt = line.getAllocatedAmt();<NEW_LINE>if (paymentAllocatedAmt.signum() == 0) {<NEW_LINE>// no amount to be allocated on payment<NEW_LINE>return AmountSourceAndAcct.ZERO;<NEW_LINE>}<NEW_LINE>if (!line.hasPaymentDocument()) {<NEW_LINE>// no payment document<NEW_LINE>return AmountSourceAndAcct.ZERO;<NEW_LINE>}<NEW_LINE>final FactLineBuilder factLineBuilder = fact.createLine().setDocLine(line).setAccount(line.getPaymentAcct(as)).setCurrencyId(getCurrencyId()).setCurrencyConversionCtx(line.getPaymentCurrencyConversionCtx()).orgId(line.getPaymentOrgId()).bpartnerId(line.getPaymentBPartnerId()).alsoAddZeroLine();<NEW_LINE>if (line.isSOTrxInvoice()) {<NEW_LINE>// ARC:<NEW_LINE>if (line.isCreditMemoInvoice()) {<NEW_LINE>factLineBuilder.setAmtSource(null, paymentAllocatedAmt.negate());<NEW_LINE>} else // ARI:<NEW_LINE>{<NEW_LINE>factLineBuilder.setAmtSource(paymentAllocatedAmt, null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// APC<NEW_LINE>if (line.isCreditMemoInvoice()) {<NEW_LINE>factLineBuilder.setAmtSource(paymentAllocatedAmt, null);<NEW_LINE>} else // API<NEW_LINE>{<NEW_LINE>factLineBuilder.setAmtSource(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final FactLine factLine = factLineBuilder.buildAndAdd();<NEW_LINE>return factLine.getAmtSourceAndAcctDrOrCr();<NEW_LINE>} | null, paymentAllocatedAmt.negate()); |
253,823 | protected void encodeLegend(FacesContext context, Fieldset fieldset) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String legendText = fieldset.getLegend();<NEW_LINE>UIComponent legend = fieldset.getFacet("legend");<NEW_LINE>boolean renderFacet = ComponentUtils.shouldRenderFacet(legend);<NEW_LINE>if (renderFacet || legendText != null) {<NEW_LINE>writer.startElement("legend", null);<NEW_LINE>writer.writeAttribute("class", Fieldset.LEGEND_CLASS, null);<NEW_LINE>if (fieldset.isToggleable()) {<NEW_LINE>writer.writeAttribute("tabindex", <MASK><NEW_LINE>String togglerClass = fieldset.isCollapsed() ? Fieldset.TOGGLER_PLUS_CLASS : Fieldset.TOGGLER_MINUS_CLASS;<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", togglerClass, null);<NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>if (renderFacet) {<NEW_LINE>legend.encodeAll(context);<NEW_LINE>} else {<NEW_LINE>if (fieldset.isEscape()) {<NEW_LINE>writer.writeText(legendText, "value");<NEW_LINE>} else {<NEW_LINE>writer.write(legendText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement("legend");<NEW_LINE>}<NEW_LINE>} | fieldset.getTabindex(), null); |
521,038 | private static void collectPropertyAccessors(@Nonnull Class<?> aClass, @Nonnull List<MutableAccessor> accessors) {<NEW_LINE>// (name,(getter,setter))<NEW_LINE>final Map<String, Couple<Method>> candidates = new TreeMap<>();<NEW_LINE>for (Method method : aClass.getMethods()) {<NEW_LINE>if (!Modifier.isPublic(method.getModifiers())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// (name,isSetter)<NEW_LINE>Pair<String, Boolean> propertyData = getPropertyData(method.getName());<NEW_LINE>if (propertyData == null || propertyData.first.equals("class") || method.getParameterTypes().length != (propertyData.second ? 1 : 0)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Couple<Method> candidate = candidates.get(propertyData.first);<NEW_LINE>if (candidate == null) {<NEW_LINE>candidate = Couple.of();<NEW_LINE>}<NEW_LINE>if ((propertyData.second ? candidate.second : candidate.first) != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>candidate = Couple.of(propertyData.second ? candidate.first : method, propertyData.<MASK><NEW_LINE>candidates.put(propertyData.first, candidate);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Couple<Method>> candidate : candidates.entrySet()) {<NEW_LINE>// (getter,setter)<NEW_LINE>Couple<Method> methods = candidate.getValue();<NEW_LINE>if (methods.first != null && methods.second != null && methods.first.getReturnType().equals(methods.second.getParameterTypes()[0]) && methods.first.getAnnotation(Transient.class) == null && methods.second.getAnnotation(Transient.class) == null) {<NEW_LINE>accessors.add(new PropertyAccessor(candidate.getKey(), methods.first.getReturnType(), methods.first, methods.second));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | second ? method : candidate.second); |
1,470,072 | public void run(RegressionEnvironment env) {<NEW_LINE>EPStatement[] statements = new EPStatement[5];<NEW_LINE>sendTimer(env, 1000);<NEW_LINE>statements[0] = env.compileDeploy("@name('stmtmetric') select * from " + StatementMetric.class.getName()).statement("stmtmetric");<NEW_LINE>statements[0].addListener(env.listenerNew());<NEW_LINE>statements[1] = env.compileDeploy("@name('runtimemetric') select * from " + RuntimeMetric.class.getName()).statement("runtimemetric");<NEW_LINE>statements[1].addListener(env.listenerNew());<NEW_LINE>statements[2] = env.compileDeploy("@name('stmt-1') select * from SupportBean(intPrimitive=1)#keepall where MyMetricFunctions.takeCPUTime(longPrimitive)").statement("stmt-1");<NEW_LINE>sendEvent(env, "E1", 1, CPUGOALONENANO);<NEW_LINE>sendTimer(env, 11000);<NEW_LINE>assertTrue(env.listener("stmtmetric").getAndClearIsInvoked());<NEW_LINE>assertTrue(env.listener("runtimemetric").getAndClearIsInvoked());<NEW_LINE>env.runtime().getMetricsService().setMetricsReportingDisabled();<NEW_LINE>sendEvent(env, "E2", 2, CPUGOALONENANO);<NEW_LINE>sendTimer(env, 21000);<NEW_LINE>assertFalse(env.listener("stmtmetric").getAndClearIsInvoked());<NEW_LINE>assertFalse(env.listener("runtimemetric").getAndClearIsInvoked());<NEW_LINE>sendTimer(env, 31000);<NEW_LINE>sendEvent(env, "E3", 3, CPUGOALONENANO);<NEW_LINE>assertFalse(env.listener("stmtmetric").getAndClearIsInvoked());<NEW_LINE>assertFalse(env.listener("runtimemetric").getAndClearIsInvoked());<NEW_LINE>env.runtime().getMetricsService().setMetricsReportingEnabled();<NEW_LINE>sendEvent(env, "E4", 4, CPUGOALONENANO);<NEW_LINE>sendTimer(env, 41000);<NEW_LINE>assertTrue(env.listener("stmtmetric").getAndClearIsInvoked());<NEW_LINE>assertTrue(env.listener("runtimemetric").getAndClearIsInvoked());<NEW_LINE>env.undeployModuleContaining(statements[2].getName());<NEW_LINE>sendTimer(env, 51000);<NEW_LINE>// metrics statements reported themselves<NEW_LINE>assertTrue(env.listener("stmtmetric").isInvoked());<NEW_LINE>assertTrue(env.listener<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>} | ("runtimemetric").isInvoked()); |
730,431 | private void createTranslationInfo(Composite composite) {<NEW_LINE>Composite translation = new Composite(composite, SWT.NONE);<NEW_LINE>GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(translation);<NEW_LINE>GridLayoutFactory.fillDefaults().margins(5, 5).numColumns(1).applyTo(translation);<NEW_LINE>addSectionLabel(translation, Messages.IntroLabelTranslation);<NEW_LINE>StyledLabel text = new StyledLabel(translation, SWT.WRAP);<NEW_LINE>text.setText(Messages.IntroLabelTranslationInfo);<NEW_LINE>GridDataFactory.fillDefaults().indent(3, 0).hint(400, SWT.DEFAULT).applyTo(text);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(translation, "action:opensettings", Messages.IntroChangeLanguageInPreferences, null);<NEW_LINE>addSectionLabel(translation, Messages.PrefTitleDivvyDiary);<NEW_LINE>text = new StyledLabel(translation, SWT.WRAP);<NEW_LINE><MASK><NEW_LINE>GridDataFactory.fillDefaults().indent(3, 0).hint(400, SWT.DEFAULT).applyTo(text);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>addLink(translation, "action:opensettings", Messages.LabelSettings + "...", null);<NEW_LINE>} | text.setText(Messages.PrefDescriptionDivvyDiary); |
596,841 | public boolean isNewTransactionAllowed(TransactionCommon transaction) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>boolean allowed = true;<NEW_LINE>// Always allow non-durable subscribers to receive<NEW_LINE>if (isPubSub() && !isDurable())<NEW_LINE>allowed = true;<NEW_LINE>else {<NEW_LINE>synchronized (orderLock) {<NEW_LINE>if (streamHasInDoubtRemoves) {<NEW_LINE>if (itemStream != null)<NEW_LINE>currentTran = itemStream.getOrderedActiveTran();<NEW_LINE>else if (subscriptionItemStream != null)<NEW_LINE>currentTran = subscriptionItemStream.getOrderedActiveTran();<NEW_LINE>if (currentTran == null)<NEW_LINE>streamHasInDoubtRemoves = false;<NEW_LINE>}<NEW_LINE>// If the current tran is null or the same as the tran provided - disallow new trans<NEW_LINE>if (currentTran != null && (transaction == null || !currentTran.equals(transaction.getPersistentTranId())))<NEW_LINE>allowed = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "isNewTransactionAllowed", Boolean.valueOf(allowed));<NEW_LINE>return allowed;<NEW_LINE>} | entry(tc, "isNewTransactionAllowed", transaction); |
1,256,317 | public static boolean VRRenderModels_GetComponentStateForDevicePath(@NativeType("char const *") CharSequence pchRenderModelName, @NativeType("char const *") CharSequence pchComponentName, @NativeType("VRInputValueHandle_t") long devicePath, @NativeType("RenderModel_ControllerMode_State_t const *") RenderModelControllerModeState pState, @NativeType("RenderModel_ComponentState_t *") RenderModelComponentState pComponentState) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nASCII(pchRenderModelName, true);<NEW_LINE>long pchRenderModelNameEncoded = stack.getPointerAddress();<NEW_LINE>stack.nASCII(pchComponentName, true);<NEW_LINE>long pchComponentNameEncoded = stack.getPointerAddress();<NEW_LINE>return nVRRenderModels_GetComponentStateForDevicePath(pchRenderModelNameEncoded, pchComponentNameEncoded, devicePath, pState.address(<MASK><NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | ), pComponentState.address()); |
1,129,877 | private Object superAroundInvoke(InvocationContext inv) throws Exception {<NEW_LINE>Object results = getResultsObject(inv);<NEW_LINE>addAroundInvoke(results, CLASS_NAME, "superAroundInvoke");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("AroundInvoke")) {<NEW_LINE>data = (<MASK><NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("AroundInvoke", data);<NEW_LINE>setAroundInvokeContextData(results, data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PrePassivate")) {<NEW_LINE>throw new IllegalStateException("PrePassivate context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with AroundInvoke interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each AroundInvoke<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each AroundInvoke interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>Object rv = inv.proceed();<NEW_LINE>return rv;<NEW_LINE>} | String) map.get("AroundInvoke"); |
411,897 | public static GetMainPartListResponse unmarshall(GetMainPartListResponse getMainPartListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMainPartListResponse.setRequestId(_ctx.stringValue("GetMainPartListResponse.RequestId"));<NEW_LINE>getMainPartListResponse.setCode(_ctx.longValue("GetMainPartListResponse.Code"));<NEW_LINE>getMainPartListResponse.setSuccess(_ctx.booleanValue("GetMainPartListResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCount(_ctx.longValue("GetMainPartListResponse.Data.Count"));<NEW_LINE>List<MainPartBizs> list = new ArrayList<MainPartBizs>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMainPartListResponse.Data.List.Length"); i++) {<NEW_LINE>MainPartBizs mainPartBizs = new MainPartBizs();<NEW_LINE>mainPartBizs.setAccountNo(_ctx.stringValue("GetMainPartListResponse.Data.List[" + i + "].AccountNo"));<NEW_LINE>mainPartBizs.setAccountType(_ctx.stringValue("GetMainPartListResponse.Data.List[" + i + "].AccountType"));<NEW_LINE>mainPartBizs.setBrandUserId(_ctx.longValue("GetMainPartListResponse.Data.List[" + i + "].BrandUserId"));<NEW_LINE>mainPartBizs.setBrandUserNick(_ctx.stringValue<MASK><NEW_LINE>mainPartBizs.setMainId(_ctx.longValue("GetMainPartListResponse.Data.List[" + i + "].MainId"));<NEW_LINE>mainPartBizs.setMainName(_ctx.stringValue("GetMainPartListResponse.Data.List[" + i + "].MainName"));<NEW_LINE>mainPartBizs.setProxyUserId(_ctx.longValue("GetMainPartListResponse.Data.List[" + i + "].ProxyUserId"));<NEW_LINE>list.add(mainPartBizs);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>getMainPartListResponse.setData(data);<NEW_LINE>return getMainPartListResponse;<NEW_LINE>} | ("GetMainPartListResponse.Data.List[" + i + "].BrandUserNick")); |
176,549 | private void createReceivers() {<NEW_LINE>List<CompletableFuture<CoreMessageReceiver>> receiverFutures = partitions.stream().map(TopicPartitionInfo::getFullTopicName).map(queue -> {<NEW_LINE>MessagingFactory factory;<NEW_LINE>try {<NEW_LINE>factory = MessagingFactory.createFromConnectionStringBuilder(createConnection(queue));<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>log.error("Failed to create factory for the queue [{}]", queue);<NEW_LINE>throw new RuntimeException("Failed to create the factory", e);<NEW_LINE>}<NEW_LINE>return CoreMessageReceiver.create(factory, queue, queue, 0, new SettleModePair(SenderSettleMode.UNSETTLED, ReceiverSettleMode.SECOND), MessagingEntityType.QUEUE);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>receivers = new HashSet<>(fromList(receiverFutures).get());<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>if (stopped) {<NEW_LINE>log.<MASK><NEW_LINE>} else {<NEW_LINE>log.error("Failed to create receivers", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | info("[{}] Service Bus consumer is stopped.", getTopic()); |
1,239,568 | final ListEventsDetectionJobsResult executeListEventsDetectionJobs(ListEventsDetectionJobsRequest listEventsDetectionJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listEventsDetectionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListEventsDetectionJobsRequest> request = null;<NEW_LINE>Response<ListEventsDetectionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListEventsDetectionJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listEventsDetectionJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListEventsDetectionJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListEventsDetectionJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListEventsDetectionJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
193,939 | protected static JsonObjectBuilder toJsonObjectBuilderWithLinks(WSJobInstance jobInstance, List<WSJobExecution> jobExecList, String urlRoot) {<NEW_LINE>JsonObjectBuilder jsonObjBuilder = toJsonObjectBuilder(jobInstance);<NEW_LINE>// Get most recent job execution and look for the JES Job Name and JES Job ID job parameters<NEW_LINE>if (jobExecList != null && !jobExecList.isEmpty()) {<NEW_LINE>String jesJobName = null;<NEW_LINE>String jesJobID = null;<NEW_LINE>Properties jobParams = jobExecList.<MASK><NEW_LINE>if (jobParams != null) {<NEW_LINE>jesJobName = jobParams.getProperty("com.ibm.ws.batch.submitter.jobName");<NEW_LINE>jesJobID = jobParams.getProperty("com.ibm.ws.batch.submitter.jobId");<NEW_LINE>}<NEW_LINE>if (jesJobName != null) {<NEW_LINE>jsonObjBuilder.add("JESJobName", jesJobName);<NEW_LINE>}<NEW_LINE>if (jesJobID != null) {<NEW_LINE>jsonObjBuilder.add("JESJobId", jesJobID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add REST-specific links.<NEW_LINE>JsonArrayBuilder jsonArrayBuilder = builderFactory.createArrayBuilder().add(builderFactory.createObjectBuilder().add("rel", "self").add("href", urlRoot + "jobinstances/" + jobInstance.getInstanceId())).add(builderFactory.createObjectBuilder().add("rel", "job logs").add("href", urlRoot + "jobinstances/" + jobInstance.getInstanceId() + "/joblogs"));<NEW_LINE>;<NEW_LINE>for (WSJobExecution jobExec : ((jobExecList != null) ? jobExecList : new ArrayList<WSJobExecution>())) {<NEW_LINE>jsonArrayBuilder.add(builderFactory.createObjectBuilder().add("rel", "job execution").add("href", urlRoot + "jobinstances/" + jobInstance.getInstanceId() + "/jobexecutions/" + jobExec.getExecutionNumberForThisInstance()));<NEW_LINE>}<NEW_LINE>jsonObjBuilder.add("_links", jsonArrayBuilder);<NEW_LINE>return jsonObjBuilder;<NEW_LINE>} | get(0).getJobParameters(); |
1,246,898 | public int cost(OCommandContext ctx) {<NEW_LINE>OQueryStats stats = OQueryStats.get((ODatabaseDocumentInternal) ctx.getDatabase());<NEW_LINE>String indexName = idx.getName();<NEW_LINE>int size = keyCondition.getSubBlocks().size();<NEW_LINE>boolean range = false;<NEW_LINE>OBooleanExpression lastOp = keyCondition.getSubBlocks().get(keyCondition.getSubBlocks().size() - 1);<NEW_LINE>if (lastOp instanceof OBinaryCondition) {<NEW_LINE>OBinaryCompareOperator op = ((OBinaryCondition) lastOp).getOperator();<NEW_LINE>range = op.isRangeOperator();<NEW_LINE>}<NEW_LINE>long val = stats.getIndexStats(indexName, size, range, additionalRangeCondition != null, ctx.getDatabase());<NEW_LINE>if (val == -1) {<NEW_LINE>// TODO query the index!<NEW_LINE>}<NEW_LINE>if (val >= 0) {<NEW_LINE>return val > Integer.MAX_VALUE ? <MASK><NEW_LINE>}<NEW_LINE>return Integer.MAX_VALUE;<NEW_LINE>} | Integer.MAX_VALUE : (int) val; |
48,510 | public void generateRate(AbstractContainerStatistics container, BinomialMetrics.BinomialMetric metric) {<NEW_LINE>long uniqueImpressions = container.getImpressionCounts().getUniqueUserCount();<NEW_LINE>Estimate jointRate;<NEW_LINE>try {<NEW_LINE>jointRate = metric.estimateRate(uniqueImpressions, container.getJointActionCounts().getUniqueUserCount());<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>if (LOGGER.isWarnEnabled())<NEW_LINE>LOGGER.warn("BinomialMetric.estimateRate called with invalid arguments by " + "AnalyticsService.generateRates: ", iae);<NEW_LINE>jointRate = new Estimate(NaN, NaN, NaN);<NEW_LINE>}<NEW_LINE>container.setJointActionRate(jointRate);<NEW_LINE>Map<Event.Name, ActionRate> actionRates = new HashMap<>();<NEW_LINE>Map<Event.Name, ActionCounts> actionCounts = container.getActionCounts();<NEW_LINE>for (ActionCounts action : actionCounts.values()) {<NEW_LINE>Event.Name actionName = action.getActionName();<NEW_LINE>Estimate rate;<NEW_LINE>try {<NEW_LINE>rate = metric.estimateRate(<MASK><NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>if (LOGGER.isWarnEnabled())<NEW_LINE>LOGGER.warn("BinomialMetric.estimateRate called with invalid arguments by " + "AnalyticsService.generateRates: ", iae);<NEW_LINE>rate = new Estimate(NaN, NaN, NaN);<NEW_LINE>}<NEW_LINE>ActionRate actionRate = new ActionRate.Builder().withActionName(actionName).withEstimate(rate).build();<NEW_LINE>actionRates.put(actionName, actionRate);<NEW_LINE>}<NEW_LINE>container.setActionRates(actionRates);<NEW_LINE>} | uniqueImpressions, action.getUniqueUserCount()); |
858,373 | // reimplement this to be iterative, not recursive...<NEW_LINE>@BIF<NEW_LINE>public static ETuple2 mapfoldl(EProc proc, EObject fun0, EObject acc, EObject list0) throws Pausable {<NEW_LINE>EFun fun = fun0.testFunction2(2);<NEW_LINE><MASK><NEW_LINE>if (fun == null || list == null) {<NEW_LINE>ERT.func_info(am_lists, am_mapfoldl, 3);<NEW_LINE>}<NEW_LINE>ArrayList<EObject> map = new ArrayList<>();<NEW_LINE>while (!list.isNil()) {<NEW_LINE>EObject pair0;<NEW_LINE>proc.arg0 = list.head();<NEW_LINE>proc.arg1 = acc;<NEW_LINE>proc.tail = fun;<NEW_LINE>do {<NEW_LINE>pair0 = proc.tail.go(proc);<NEW_LINE>} while (pair0 == EProc.TAIL_MARKER);<NEW_LINE>ETuple2 out = ETuple2.cast(pair0);<NEW_LINE>if (out == null) {<NEW_LINE>throw new ErlangError(am_badmatch, pair0);<NEW_LINE>}<NEW_LINE>map.add(out.elem1);<NEW_LINE>acc = out.elem2;<NEW_LINE>list = list.tail();<NEW_LINE>}<NEW_LINE>ESeq res = ERT.NIL;<NEW_LINE>for (int i = map.size() - 1; i >= 0; i--) {<NEW_LINE>res = res.cons(map.get(i));<NEW_LINE>}<NEW_LINE>return new ETuple2(res, acc);<NEW_LINE>} | ESeq list = list0.testSeq(); |
833,678 | public static DescribeRefreshTaskByIdResponse unmarshall(DescribeRefreshTaskByIdResponse describeRefreshTaskByIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRefreshTaskByIdResponse.setRequestId(_ctx.stringValue("DescribeRefreshTaskByIdResponse.RequestId"));<NEW_LINE>describeRefreshTaskByIdResponse.setTotalCount(_ctx.longValue("DescribeRefreshTaskByIdResponse.TotalCount"));<NEW_LINE>List<CDNTask> tasks = new ArrayList<CDNTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRefreshTaskByIdResponse.Tasks.Length"); i++) {<NEW_LINE>CDNTask cDNTask = new CDNTask();<NEW_LINE>cDNTask.setTaskId(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].TaskId"));<NEW_LINE>cDNTask.setObjectPath(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].ObjectPath"));<NEW_LINE>cDNTask.setProcess(_ctx.stringValue<MASK><NEW_LINE>cDNTask.setStatus(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].Status"));<NEW_LINE>cDNTask.setCreationTime(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].CreationTime"));<NEW_LINE>cDNTask.setDescription(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].Description"));<NEW_LINE>cDNTask.setObjectType(_ctx.stringValue("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].ObjectType"));<NEW_LINE>tasks.add(cDNTask);<NEW_LINE>}<NEW_LINE>describeRefreshTaskByIdResponse.setTasks(tasks);<NEW_LINE>return describeRefreshTaskByIdResponse;<NEW_LINE>} | ("DescribeRefreshTaskByIdResponse.Tasks[" + i + "].Process")); |
741,320 | private synchronized void resolveDriver(Context ctx, WebDriverManager driverManager) throws IOException {<NEW_LINE>// Query string (for configuration parameters)<NEW_LINE>Map<String, List<String>> queryParamMap = new TreeMap<>(ctx.queryParamMap());<NEW_LINE>if (!queryParamMap.isEmpty()) {<NEW_LINE>log.info("Server query string for configuration {}", queryParamMap);<NEW_LINE>for (Entry<String, List<String>> entry : queryParamMap.entrySet()) {<NEW_LINE>String configKey <MASK><NEW_LINE>String configValue = entry.getValue().get(0);<NEW_LINE>log.trace("\t{} = {}", configKey, configValue);<NEW_LINE>System.setProperty(configKey, configValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Resolve driver<NEW_LINE>driverManager.config().setAvoidExport(true);<NEW_LINE>driverManager.config().setAvoidBrowserDetection(true);<NEW_LINE>driverManager.setup();<NEW_LINE>File driver = new File(driverManager.getDownloadedDriverPath());<NEW_LINE>String driverVersion = driverManager.getDownloadedDriverVersion();<NEW_LINE>String driverName = driver.getName();<NEW_LINE>String driverLength = String.valueOf(driver.length());<NEW_LINE>// Response<NEW_LINE>ctx.res.setHeader("Content-Disposition", "attachment; filename=\"" + driverName + "\"");<NEW_LINE>ctx.result(openInputStream(driver));<NEW_LINE>log.info("Server response: {} {} ({} bytes)", driverName, driverVersion, driverLength);<NEW_LINE>// Clear configuration<NEW_LINE>for (String key : queryParamMap.keySet()) {<NEW_LINE>System.clearProperty("wdm." + key);<NEW_LINE>}<NEW_LINE>} | = "wdm." + entry.getKey(); |
144,766 | public void drawEntities(float x, float y, float w, float h, float scaling, boolean withLabels) {<NEW_LINE>if (!withLabels) {<NEW_LINE>updateUnitArray();<NEW_LINE>} else {<NEW_LINE>units.clear();<NEW_LINE>Groups.unit.each(units::add);<NEW_LINE>}<NEW_LINE>float sz = baseSize * zoom;<NEW_LINE>float dx = (Core.camera.position.x / tilesize);<NEW_LINE>float dy = (Core.camera.position.y / tilesize);<NEW_LINE>dx = Mathf.clamp(dx, sz, world.width() - sz);<NEW_LINE>dy = Mathf.clamp(dy, sz, world.height() - sz);<NEW_LINE>rect.set((dx - sz) * tilesize, (dy - sz) * tilesize, sz * 2 * tilesize, sz * 2 * tilesize);<NEW_LINE>for (Unit unit : units) {<NEW_LINE>float rx = !withLabels ? (unit.x - rect.x) / rect.width * w : unit.x / (world.width() * tilesize) * w;<NEW_LINE>float ry = !withLabels ? (unit.y - rect.y) / rect.width * h : unit.y / (world.height() * tilesize) * h;<NEW_LINE>Draw.mixcol(unit.<MASK><NEW_LINE>float scale = Scl.scl(1f) / 2f * scaling * 32f;<NEW_LINE>var region = unit.icon();<NEW_LINE>Draw.rect(region, x + rx, y + ry, scale, scale * (float) region.height / region.width, unit.rotation() - 90);<NEW_LINE>Draw.reset();<NEW_LINE>}<NEW_LINE>if (withLabels && net.active()) {<NEW_LINE>for (Player player : Groups.player) {<NEW_LINE>if (!player.dead()) {<NEW_LINE>float rx = player.x / (world.width() * tilesize) * w;<NEW_LINE>float ry = player.y / (world.height() * tilesize) * h;<NEW_LINE>drawLabel(x + rx, y + ry, player.name, player.team().color);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Draw.reset();<NEW_LINE>} | team().color, 1f); |
1,741,268 | private void updateStats(@NonNull final Content content) {<NEW_LINE>int images;<NEW_LINE>int imgErrors = 0;<NEW_LINE>Context context = getContext();<NEW_LINE>if (null == context)<NEW_LINE>return;<NEW_LINE>if (null == content.getImageFiles())<NEW_LINE>return;<NEW_LINE>// Don't count the cover<NEW_LINE>images = content.getImageFiles().size() - 1;<NEW_LINE>for (ImageFile imgFile : content.getImageFiles()) if (imgFile.getStatus() == StatusContent.ERROR)<NEW_LINE>imgErrors++;<NEW_LINE>if (0 == images) {<NEW_LINE>images = content.getQtyPages();<NEW_LINE>imgErrors = images;<NEW_LINE>}<NEW_LINE>TextView details = rootView.findViewById(R.id.redownload_detail);<NEW_LINE>details.setText(context.getString(R.string.redownload_dialog_message, images, images - imgErrors, imgErrors));<NEW_LINE>if (content.getErrorLog() != null && !content.getErrorLog().isEmpty()) {<NEW_LINE>TextView firstErrorTxt = rootView.<MASK><NEW_LINE>ErrorRecord firstError = content.getErrorLog().get(0);<NEW_LINE>String message = context.getString(R.string.redownload_first_error, context.getString(firstError.getType().getName()));<NEW_LINE>if (!firstError.getDescription().isEmpty())<NEW_LINE>message += String.format(" - %s", firstError.getDescription());<NEW_LINE>firstErrorTxt.setText(message);<NEW_LINE>firstErrorTxt.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>} | findViewById(R.id.redownload_detail_first_error); |
1,282,994 | private Node tryFoldShift(Node n, Node left, Node right) {<NEW_LINE>Double leftVal = this.getSideEffectFreeNumberValue(left);<NEW_LINE>Double rightVal = this.getSideEffectFreeNumberValue(right);<NEW_LINE>if (!isReasonableDoubleValue(leftVal) || !isReasonableDoubleValue(rightVal)) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>if (!isMathematicalInteger(leftVal)) {<NEW_LINE>report(FRACTIONAL_BITWISE_OPERAND, left);<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>if (!isMathematicalInteger(rightVal)) {<NEW_LINE>report(FRACTIONAL_BITWISE_OPERAND, right);<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>// only the lower 5 bits are used when shifting, so don't do anything<NEW_LINE>// if the shift amount is outside [0,32)<NEW_LINE>if (!(0 <= rightVal && rightVal < 32)) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int bits = ecmascriptToInt32(leftVal);<NEW_LINE>double result;<NEW_LINE>switch(n.getToken()) {<NEW_LINE>case LSH:<NEW_LINE>result = bits << rvalInt;<NEW_LINE>break;<NEW_LINE>case RSH:<NEW_LINE>result = bits >> rvalInt;<NEW_LINE>break;<NEW_LINE>case URSH:<NEW_LINE>// JavaScript always treats the result of >>> as unsigned.<NEW_LINE>// We must force Java to do the same here.<NEW_LINE>result = 0xffffffffL & (bits >>> rvalInt);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Unknown shift operator: " + n.getToken());<NEW_LINE>}<NEW_LINE>Node newNumber = NodeUtil.numberNode(result, n);<NEW_LINE>reportChangeToEnclosingScope(n);<NEW_LINE>n.replaceWith(newNumber);<NEW_LINE>return newNumber;<NEW_LINE>} | int rvalInt = rightVal.intValue(); |
30,853 | public LayerDetail mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>LayerDetail layer = new LayerDetail();<NEW_LINE>layer.chunkSize = rs.getInt("int_chunk_size");<NEW_LINE>layer.command = rs.getString("str_cmd");<NEW_LINE>layer.dispatchOrder = rs.getInt("int_dispatch_order");<NEW_LINE>layer.id = rs.getString("pk_layer");<NEW_LINE>layer.jobId = rs.getString("pk_job");<NEW_LINE>layer.showId = rs.getString("pk_show");<NEW_LINE>layer.facilityId = rs.getString("pk_facility");<NEW_LINE>layer.name = rs.getString("str_name");<NEW_LINE>layer.range = rs.getString("str_range");<NEW_LINE>layer.minimumCores = rs.getInt("int_cores_min");<NEW_LINE>layer.<MASK><NEW_LINE>layer.minimumGpus = rs.getInt("int_gpus_min");<NEW_LINE>layer.minimumGpuMemory = rs.getLong("int_gpu_mem_min");<NEW_LINE>layer.type = LayerType.valueOf(rs.getString("str_type"));<NEW_LINE>layer.tags = Sets.newHashSet(rs.getString("str_tags").replaceAll(" ", "").split("\\|"));<NEW_LINE>layer.services.addAll(Lists.newArrayList(rs.getString("str_services").split(",")));<NEW_LINE>layer.timeout = rs.getInt("int_timeout");<NEW_LINE>layer.timeout_llu = rs.getInt("int_timeout_llu");<NEW_LINE>return layer;<NEW_LINE>} | minimumMemory = rs.getLong("int_mem_min"); |
312,043 | public Map loadAll(Collection keys) {<NEW_LINE>if (keys == null || keys.isEmpty()) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>Map<Object, Object> map = createHashMap(keys.size());<NEW_LINE>Iterator iterator = keys.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Object key = iterator.next();<NEW_LINE>Data dataKey = toHeapData(key);<NEW_LINE>DelayedEntry delayedEntry = getFromStagingArea(dataKey);<NEW_LINE>if (delayedEntry != null) {<NEW_LINE>Object value = delayedEntry.getValue();<NEW_LINE>if (value != null) {<NEW_LINE>if (isWithExpirationTime()) {<NEW_LINE>map.put(dataKey, new MetadataAwareValue(toObject(value)<MASK><NEW_LINE>} else {<NEW_LINE>map.put(dataKey, toObject(value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.putAll(super.loadAll(keys));<NEW_LINE>return map;<NEW_LINE>} | , delayedEntry.getExpirationTime())); |
1,620,014 | public int argmax() {<NEW_LINE>IntLongVectorStorage idstorage = (IntLongVectorStorage) storage;<NEW_LINE>if (idstorage.size() == 0)<NEW_LINE>return -1;<NEW_LINE>long maxval = Long.MIN_VALUE;<NEW_LINE>int maxidx = -1;<NEW_LINE>if (idstorage.isDense()) {<NEW_LINE>long[] val = idstorage.getValues();<NEW_LINE>int length = val.length;<NEW_LINE>for (int idx = 0; idx < length; idx++) {<NEW_LINE>if (val[idx] > maxval) {<NEW_LINE>maxval = val[idx];<NEW_LINE>maxidx = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (idstorage.isSparse()) {<NEW_LINE>ObjectIterator<Int2LongMap.Entry> iter = idstorage.entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Int2LongMap.Entry entry = iter.next();<NEW_LINE>int idx = entry.getIntKey();<NEW_LINE>long val = entry.getLongValue();<NEW_LINE>if (val > maxval) {<NEW_LINE>maxval = val;<NEW_LINE>maxidx = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int[<MASK><NEW_LINE>long[] val = idstorage.getValues();<NEW_LINE>int size = idstorage.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>int idx = indices[i];<NEW_LINE>if (val[i] > maxval) {<NEW_LINE>maxval = val[i];<NEW_LINE>maxidx = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return maxidx;<NEW_LINE>} | ] indices = idstorage.getIndices(); |
389,221 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>output.writeMessage(1, getCapabilities());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.writeBool(2, privileged_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeMessage(3, getSeLinuxOptions());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeInt64(4, runAsUser_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>output.writeBool(5, runAsNonRoot_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) == 0x00000080)) {<NEW_LINE>output.writeBool(6, readOnlyRootFilesystem_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000100) == 0x00000100)) {<NEW_LINE>output.writeBool(7, allowPrivilegeEscalation_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeInt64(8, runAsGroup_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000200) == 0x00000200)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 9, procMount_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>output.writeMessage(10, getWindowsOptions());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000400) == 0x00000400)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeMessage(11, getSeccompProfile()); |
294,339 | public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException {<NEW_LINE>inError = false;<NEW_LINE>String className = attributes.getValue(CLASS_ATTRIBUTE);<NEW_LINE>if (OptionHelper.isEmpty(className)) {<NEW_LINE>addError("Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <loggerContextListener> element");<NEW_LINE>inError = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(className, LoggerContextListener.class, context);<NEW_LINE>if (lcl instanceof ContextAware) {<NEW_LINE>((ContextAware<MASK><NEW_LINE>}<NEW_LINE>ec.pushObject(lcl);<NEW_LINE>addInfo("Adding LoggerContextListener of type [" + className + "] to the object stack");<NEW_LINE>} catch (Exception oops) {<NEW_LINE>inError = true;<NEW_LINE>addError("Could not create LoggerContextListener of type " + className + "].", oops);<NEW_LINE>}<NEW_LINE>} | ) lcl).setContext(context); |
902,839 | public void onClick(View v) {<NEW_LINE>final Feed feed = new Feed.Builder().setMessage("Clone it out...").setName("Simple Facebook SDK for Android").setCaption("Code less, do the same.").setDescription("Login, publish feeds and stories, invite friends and more....").setPicture("https://raw.githubusercontent.com/wiki/sromku/android-simple-facebook/images/android_facebook_sdk_logo.png").setLink("https://github.com/sromku/android-simple-facebook").build();<NEW_LINE>SimpleFacebook.getInstance().publish(feed, new OnPublishListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onException(Throwable throwable) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFail(String reason) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(reason);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onThinking() {<NEW_LINE>showDialog();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(String response) {<NEW_LINE>hideDialog();<NEW_LINE>mResult.setText(response);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setText(throwable.getMessage()); |
853,695 | private Map<Member, String[]> inspectClass(Class<?> clazz) {<NEW_LINE>InputStream is = clazz.getResourceAsStream(getClassFileName(clazz));<NEW_LINE>if (is == null) {<NEW_LINE>// We couldn't load the class file, which is not fatal as it<NEW_LINE>// simply means this method of discovering parameter names won't work.<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>}<NEW_LINE>return NO_DEBUG_INFO_MAP;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ClassReader classReader = new ClassReader(is);<NEW_LINE>Map<Member, String[]> map = new ConcurrentHashMap<Member, String[]>(32);<NEW_LINE>classReader.accept(new ParameterNameDiscoveringVisitor(clazz, map), 0);<NEW_LINE>return map;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Exception thrown while reading '.class' file for class [" + clazz + "] - unable to determine constructor/method parameter names", ex);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("ASM ClassReader failed to parse class file [" + clazz + "], probably due to a new Java class file version that isn't supported yet " + "- unable to determine constructor/method parameter names", ex);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NO_DEBUG_INFO_MAP;<NEW_LINE>} | debug("Cannot find '.class' file for class [" + clazz + "] - unable to determine constructor/method parameter names"); |
1,435,691 | private void savePreferences() {<NEW_LINE>// log reply changes.<NEW_LINE>if (!mPrefs.reply().get().equals(mReplyPref.getText().toString())) {<NEW_LINE>// Log old value and new value.<NEW_LINE>mAddLogPresenter.addLog(getString(R.string.settings_changed, mReplyPref.getDialogTitle().toString(), mPrefs.reply().get(), mReplyPref.getText().toString()));<NEW_LINE>}<NEW_LINE>mPrefs.reply().set(mReplyPref.getText().toString());<NEW_LINE>if (mPrefs.enableReplyFrmServer().get() != mEnableReplyFrmServer.isChecked()) {<NEW_LINE>boolean checked = mEnableReplyFrmServer<MASK><NEW_LINE>String check = getCheckedStatus(checked);<NEW_LINE>String status = getCheckedStatus(mPrefs.enableReplyFrmServer().get());<NEW_LINE>mAddLogPresenter.addLog(getString(R.string.settings_changed, mEnableReplyFrmServer.getTitle().toString(), status, check));<NEW_LINE>}<NEW_LINE>mPrefs.enableReplyFrmServer().set(mEnableReplyFrmServer.isChecked());<NEW_LINE>} | .isChecked() ? true : false; |
968,375 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {<NEW_LINE>super.onCreatePreferences(savedInstanceState, rootKey);<NEW_LINE><MASK><NEW_LINE>Preference copyOnTapPreference = findPreference("pref_copy_on_tap");<NEW_LINE>copyOnTapPreference.setOnPreferenceChangeListener((preference, newValue) -> {<NEW_LINE>getResult().putExtra("needsRefresh", true);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>Preference entryHighlightPreference = findPreference("pref_highlight_entry");<NEW_LINE>entryHighlightPreference.setOnPreferenceChangeListener((preference, newValue) -> {<NEW_LINE>getResult().putExtra("needsRefresh", true);<NEW_LINE>_entryPausePreference.setEnabled(_prefs.isTapToRevealEnabled() || (boolean) newValue);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>_entryPausePreference = findPreference("pref_pause_entry");<NEW_LINE>_entryPausePreference.setOnPreferenceChangeListener((preference, newValue) -> {<NEW_LINE>getResult().putExtra("needsRefresh", true);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>_entryPausePreference.setEnabled(_prefs.isTapToRevealEnabled() || _prefs.isEntryHighlightEnabled());<NEW_LINE>} | addPreferencesFromResource(R.xml.preferences_behavior); |
1,709,879 | protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder builder = null;<NEW_LINE>String type = element.getAttribute(IpAdapterParserUtils.TCP_CONNECTION_TYPE);<NEW_LINE>if (!StringUtils.hasText(type)) {<NEW_LINE>parserContext.getReaderContext().error(IpAdapterParserUtils.TCP_CONNECTION_TYPE + " is required for a tcp connection", element);<NEW_LINE>} else if (!"server".equals(type) && !"client".equals(type)) {<NEW_LINE>parserContext.getReaderContext().error(IpAdapterParserUtils.TCP_CONNECTION_TYPE + " must be 'client' or 'server' for a TCP Connection Factory", element);<NEW_LINE>}<NEW_LINE>builder = BeanDefinitionBuilder.genericBeanDefinition(TcpConnectionFactoryFactoryBean.class);<NEW_LINE>IpAdapterParserUtils.addConstructorValueIfAttributeDefined(builder, element, "type");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.HOST);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.PORT);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.USING_NIO);<NEW_LINE>IpAdapterParserUtils.addCommonSocketOptions(builder, element);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.RECEIVE_BUFFER_SIZE);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.USING_DIRECT_BUFFERS);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SO_KEEP_ALIVE);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SO_LINGER);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SO_TCP_NODELAY);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SO_TRAFFIC_CLASS);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.POOL_SIZE);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.BACKLOG);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.TASK_EXECUTOR);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.SERIALIZER);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.DESERIALIZER);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SINGLE_USE);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.INTERCEPTOR_FACTORY_CHAIN);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.LOOKUP_HOST);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.APPLY_SEQUENCE);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.SSL_CONTEXT_SUPPORT);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.SOCKET_FACTORY_SUPPORT);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.SOCKET_SUPPORT);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.NIO_CONNECTION_SUPPORT);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, IpAdapterParserUtils.NET_CONNECTION_SUPPORT);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(<MASK><NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.SSL_HANDSHAKE_TIMEOUT);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.READ_DELAY);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IpAdapterParserUtils.CONNECT_TIMEOUT);<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>} | builder, element, IpAdapterParserUtils.MAPPER); |
138,352 | static <K, V> ImmutableBiMap<K, V> fromEntryArray(int n, Entry<K, V>[] entryArray) {<NEW_LINE>checkPositionIndex(n, entryArray.length);<NEW_LINE>int tableSize = Hashing.closedTableSize(n, MAX_LOAD_FACTOR);<NEW_LINE>int mask = tableSize - 1;<NEW_LINE>ImmutableMapEntry<K, V>[] keyTable = createEntryArray(tableSize);<NEW_LINE>ImmutableMapEntry<K, V>[] valueTable = createEntryArray(tableSize);<NEW_LINE>Entry<K, V>[] entries;<NEW_LINE>if (n == entryArray.length) {<NEW_LINE>entries = entryArray;<NEW_LINE>} else {<NEW_LINE>entries = createEntryArray(n);<NEW_LINE>}<NEW_LINE>int hashCode = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>@SuppressWarnings({ "unchecked", "rawtypes" })<NEW_LINE>Entry<K, V> entry = entryArray[i];<NEW_LINE>K key = entry.getKey();<NEW_LINE>V value = entry.getValue();<NEW_LINE>checkEntryNotNull(key, value);<NEW_LINE>int keyHash = key.hashCode();<NEW_LINE>int valueHash = value.hashCode();<NEW_LINE>int keyBucket = Hashing.smear(keyHash) & mask;<NEW_LINE>int valueBucket = Hashing.smear(valueHash) & mask;<NEW_LINE>ImmutableMapEntry<K, V> nextInKeyBucket = keyTable[keyBucket];<NEW_LINE>int keyBucketLength = <MASK><NEW_LINE>ImmutableMapEntry<K, V> nextInValueBucket = valueTable[valueBucket];<NEW_LINE>int valueBucketLength = checkNoConflictInValueBucket(value, entry, nextInValueBucket);<NEW_LINE>if (keyBucketLength > RegularImmutableMap.MAX_HASH_BUCKET_LENGTH || valueBucketLength > RegularImmutableMap.MAX_HASH_BUCKET_LENGTH) {<NEW_LINE>return JdkBackedImmutableBiMap.create(n, entryArray);<NEW_LINE>}<NEW_LINE>ImmutableMapEntry<K, V> newEntry = (nextInValueBucket == null && nextInKeyBucket == null) ? RegularImmutableMap.makeImmutable(entry, key, value) : new NonTerminalImmutableBiMapEntry<>(key, value, nextInKeyBucket, nextInValueBucket);<NEW_LINE>keyTable[keyBucket] = newEntry;<NEW_LINE>valueTable[valueBucket] = newEntry;<NEW_LINE>entries[i] = newEntry;<NEW_LINE>hashCode += keyHash ^ valueHash;<NEW_LINE>}<NEW_LINE>return new RegularImmutableBiMap<>(keyTable, valueTable, entries, mask, hashCode);<NEW_LINE>} | checkNoConflictInKeyBucket(key, entry, nextInKeyBucket); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.