idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
912,035 | final XAResource enlistRRSXAResource(int recoveryId, int branchCoupling) throws Exception {<NEW_LINE>RRSXAResourceFactory xaFactory = (RRSXAResourceFactory) pm.connectorSvc.rrsXAResFactorySvcRef.getService();<NEW_LINE>// Make sure that the bundle is active.<NEW_LINE>if (xaFactory == null) {<NEW_LINE>throw new IllegalStateException("Native service for RRS transactional support is not active or available. Resource enlistment is rejected.");<NEW_LINE>}<NEW_LINE>XAResource xaResource = null;<NEW_LINE>UOWCurrent currentUOW = (UOWCurrent) pm.connectorSvc.transactionManager;<NEW_LINE>UOWCoordinator uowCoord = currentUOW.getUOWCoord();<NEW_LINE>// Enlist XA resource.<NEW_LINE>if (uowCoord.isGlobal()) {<NEW_LINE>// Enlist a 2 phase XA resource in the global transaction.<NEW_LINE>xaResource = xaFactory.<MASK><NEW_LINE>pm.connectorSvc.transactionManager.enlist(uowCoord, xaResource, recoveryId, branchCoupling);<NEW_LINE>} else {<NEW_LINE>// Enlist a one phase XA resource in the local transaction. If enlisting for<NEW_LINE>// cleanup, notify the factory that the resource has been enlisted for cleanup<NEW_LINE>// with the transaction manager.<NEW_LINE>xaResource = xaFactory.getOnePhaseXAResource(uowCoord);<NEW_LINE>LocalTransactionCoordinator ltCoord = (LocalTransactionCoordinator) uowCoord;<NEW_LINE>if (ltCoord.isContainerResolved()) {<NEW_LINE>ltCoord.enlist((OnePhaseXAResource) xaResource);<NEW_LINE>} else {<NEW_LINE>ltCoord.enlistForCleanup((OnePhaseXAResource) xaResource);<NEW_LINE>}<NEW_LINE>// Enlist with the native transaction manager (factory).<NEW_LINE>xaFactory.enlist(uowCoord, xaResource);<NEW_LINE>}<NEW_LINE>return xaResource;<NEW_LINE>} | getTwoPhaseXAResource(uowCoord.getXid()); |
1,683,425 | private int lotes(int row, IDColumn id, int Warehouse_ID, int M_Product_ID, BigDecimal qtyRequired, BigDecimal qtyToDelivery, IMiniTable issue) {<NEW_LINE>int linesNo = 0;<NEW_LINE>BigDecimal qtyRequiredActual = qtyRequired;<NEW_LINE>final String sql = "SELECT " + "s.M_Product_ID , s.QtyOnHand, s.M_AttributeSetInstance_ID" + ", p.Name, masi.Description, l.M_Locator_ID , l.Value, w.Value, w.M_warehouse_ID,p.Value" + " FROM M_Storage s " + " INNER JOIN M_Product p ON (s.M_Product_ID = p.M_Product_ID) " + " INNER JOIN C_UOM u ON (u.C_UOM_ID = p.C_UOM_ID) " + " INNER JOIN M_AttributeSetInstance masi ON (masi.M_AttributeSetInstance_ID = s.M_AttributeSetInstance_ID) " + " INNER JOIN M_Warehouse w ON (w.M_Warehouse_ID = ?) " + " INNER JOIN M_Locator l ON(l.M_Warehouse_ID=w.M_Warehouse_ID and s.M_Locator_ID=l.M_Locator_ID) " + " WHERE s.M_Product_ID = ? and s.QtyOnHand > 0 " + " and s.M_AttributeSetInstance_ID <> 0 " + " ORDER BY s.Created ";<NEW_LINE>// Execute<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, Warehouse_ID);<NEW_LINE>pstmt.setInt(2, M_Product_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>issue.setRowCount(row + 1);<NEW_LINE>// Qty On Hand<NEW_LINE>final BigDecimal qtyOnHand = rs.getBigDecimal(2);<NEW_LINE>// ID/M_AttributeSetInstance_ID<NEW_LINE>IDColumn id1 = new IDColumn(rs.getInt(3));<NEW_LINE>id1.setSelected(false);<NEW_LINE>// issue.setRowSelectionAllowed(true);<NEW_LINE>issue.setValueAt(id1, row, 0);<NEW_LINE>// Product<NEW_LINE>KeyNamePair productkey = new KeyNamePair(rs.getInt(1), rs.getString(4));<NEW_LINE>issue.setValueAt(productkey, row, 3);<NEW_LINE>// QtyOnHand<NEW_LINE>issue.setValueAt(qtyOnHand, row, 10);<NEW_LINE>// ASI<NEW_LINE>issue.setValueAt(rs.getString(5), row, 5);<NEW_LINE>// Locator<NEW_LINE>KeyNamePair locatorKey = new KeyNamePair(rs.getInt(6), rs.getString(7));<NEW_LINE>issue.setValueAt(locatorKey, row, 13);<NEW_LINE>// Warehouse<NEW_LINE>KeyNamePair m_warehousekey = new KeyNamePair(rs.getInt(9), rs.getString(8));<NEW_LINE>issue.setValueAt(m_warehousekey, row, 14);<NEW_LINE>// QtyRequired<NEW_LINE>issue.setValueAt(Env.ZERO, row, 6);<NEW_LINE>// QtyToDelivery<NEW_LINE>issue.setValueAt(<MASK><NEW_LINE>// Srcap<NEW_LINE>issue.setValueAt(Env.ZERO, row, 9);<NEW_LINE>// Qty Required:<NEW_LINE>if (qtyRequiredActual.compareTo(qtyOnHand) < 0) {<NEW_LINE>issue.setValueAt(qtyRequiredActual.signum() > 0 ? qtyRequiredActual : Env.ZERO, row, 6);<NEW_LINE>} else {<NEW_LINE>issue.setValueAt(qtyOnHand, row, 6);<NEW_LINE>}<NEW_LINE>qtyRequiredActual = qtyRequiredActual.subtract(qtyOnHand);<NEW_LINE>linesNo++;<NEW_LINE>row++;<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DBException(e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>return linesNo;<NEW_LINE>} | Env.ZERO, row, 8); |
397,618 | public SqlDelete initTableInfo(TableInfo srcInfo) {<NEW_LINE>final List<SqlNode> sourceTables = new ArrayList<>();<NEW_LINE>final List<SqlNode> aliases = new ArrayList<>();<NEW_LINE>final Map<SqlNode, List<SqlIdentifier>> subQueryTableMap = new HashMap<>();<NEW_LINE>final AtomicBoolean withAlias = new AtomicBoolean(false);<NEW_LINE>srcInfo.getSrcInfos().forEach(sti -> {<NEW_LINE>sourceTables.add(sti.getTable());<NEW_LINE>final SqlNode alias = sti.getTableWithAlias();<NEW_LINE>withAlias.set(withAlias.get() & (alias instanceof SqlBasicCall && alias.getKind() == SqlKind.AS));<NEW_LINE>aliases.add(alias);<NEW_LINE>subQueryTableMap.put(sti.getTable(), sti.getRefTables().stream().map(t -> new SqlIdentifier(t.getQualifiedName(), SqlParserPos.ZERO)).collect(Collectors.toList()));<NEW_LINE>});<NEW_LINE>this.sourceTables = new SqlNodeList(sourceTables, SqlParserPos.ZERO);<NEW_LINE>this.aliases = new <MASK><NEW_LINE>this.subQueryTableMap = subQueryTableMap;<NEW_LINE>this.withTableAlias = withAlias.get();<NEW_LINE>this.sourceTableCollected = true;<NEW_LINE>return this;<NEW_LINE>} | SqlNodeList(aliases, SqlParserPos.ZERO); |
1,376,278 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasLengthAndAllElementsNotNull(sources, 2);<NEW_LINE>final Coordinate start = getCoordinate(sources[0]);<NEW_LINE>final Coordinate end = getCoordinate(sources[1]);<NEW_LINE>if (start != null && end != null) {<NEW_LINE>try {<NEW_LINE>final GeodeticCalculator calc = new GeodeticCalculator();<NEW_LINE>calc.setStartingGeographicPoint(start.y, start.x);<NEW_LINE>calc.setDestinationGeographicPoint(end.y, end.x);<NEW_LINE>return calc.getOrthodromicDistance();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(t));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "Invalid parameters";<NEW_LINE>} catch (ArgumentNullException pe) {<NEW_LINE>// silently ignore null arguments<NEW_LINE>return "";<NEW_LINE>} catch (ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(<MASK><NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | ), ctx.isJavaScriptContext()); |
6,782 | protected String doIt() {<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>String sql = "INSERT into T_Reconciliation " + "(AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, " + "IsActive, Fact_Acct_ID, " + "AD_PInstance_ID, MatchCode) " + "SELECT f.AD_Client_ID, f.AD_Org_ID, f.Created, f.CreatedBy, " + "f.Updated, f.UpdatedBy, f.IsActive, " + "f.Fact_Acct_ID, ?, r.MatchCode " + "FROM Fact_Acct f " + "LEFT OUTER JOIN Fact_Reconciliation r ON (f.Fact_Acct_ID=r.Fact_Acct_ID) " + "WHERE Account_ID = ? " + "AND DateAcct BETWEEN ? AND ? ";<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, getAD_PInstance_ID());<NEW_LINE>pstmt.setInt(2, p_Account_ID);<NEW_LINE>pstmt.setTimestamp(3, p_DateAcct_From);<NEW_LINE><MASK><NEW_LINE>int count = pstmt.executeUpdate();<NEW_LINE>String result = Msg.getMsg(getCtx(), "@Created@") + ": " + count + ", ";<NEW_LINE>log.log(Level.FINE, result);<NEW_LINE>sql = "DELETE FROM T_Reconciliation t " + "WHERE (SELECT SUM(f.amtacctdr-f.amtacctcr) FROM T_Reconciliation r " + " INNER JOIN Fact_Acct f ON (f.Fact_Acct_ID = r.Fact_Acct_ID) " + " WHERE r.MatchCode=t.MatchCode" + " AND r.AD_PInstance_ID = t.AD_PInstance_ID) = 0 " + "AND t.AD_PInstance_ID = ?";<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, getAD_PInstance_ID());<NEW_LINE>count = pstmt.executeUpdate();<NEW_LINE>result = Msg.getMsg(getCtx(), "@Deleted@") + ": " + count;<NEW_LINE>log.log(Level.FINE, result);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>return e.getLocalizedMessage();<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>log.fine((System.currentTimeMillis() - m_start) + " ms");<NEW_LINE>return "";<NEW_LINE>} | pstmt.setTimestamp(4, p_DateAcct_To); |
1,302,156 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (mapActivity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long id = args.getLong(SwitchableAction.KEY_ID);<NEW_LINE>OsmandApplication app = mapActivity.getMyApplication();<NEW_LINE>QuickActionRegistry quickActionRegistry = app.getQuickActionRegistry();<NEW_LINE>action = quickActionRegistry.getQuickAction(id);<NEW_LINE>action = QuickActionRegistry.produceAction(action);<NEW_LINE>if (action == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>selectedItem = savedInstanceState.getString(SELECTED_ITEM_KEY);<NEW_LINE>} else {<NEW_LINE>selectedItem = ((SwitchableAction<?>) action).getSelectedItem(app);<NEW_LINE>}<NEW_LINE>rbColorList = AndroidUtils.createCheckedColorStateList(app, R.color.icon_color_default_light, getActiveColorId());<NEW_LINE>items.add(new TitleItem(action.getName(app)));<NEW_LINE>NestedScrollView nestedScrollView = new NestedScrollView(app);<NEW_LINE>itemsContainer = new LinearLayout(app);<NEW_LINE>itemsContainer.setLayoutParams((new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)));<NEW_LINE>itemsContainer.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>int padding = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_content_padding_small);<NEW_LINE>itemsContainer.setPadding(0, padding, 0, padding);<NEW_LINE>int itemsSize = 0;<NEW_LINE>if (action instanceof SwitchableAction) {<NEW_LINE>SwitchableAction switchableAction = (SwitchableAction) action;<NEW_LINE>List sources = switchableAction.loadListFromParams();<NEW_LINE>itemsSize = sources.size();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < itemsSize; i++) {<NEW_LINE>LayoutInflater.from(new ContextThemeWrapper(app, themeRes)).inflate(R.layout.bottom_sheet_item_with_radio_btn, itemsContainer, true);<NEW_LINE>}<NEW_LINE>nestedScrollView.addView(itemsContainer);<NEW_LINE>items.add(new BaseBottomSheetItem.Builder().setCustomView(nestedScrollView).create());<NEW_LINE>populateItemsList();<NEW_LINE>} | OsmandSettings settings = app.getSettings(); |
1,154,810 | public static DateValue parseDate(String s) {<NEW_LINE>Matcher matcher = suTimeDateFormat.matcher(s.toUpperCase());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>String yS = matcher.group(1), mS = matcher.group(2), dS = matcher.group(3);<NEW_LINE>int y = -1, m = -1, d = -1;<NEW_LINE>if (!(yS == null || yS.isEmpty() || yS.contains("X")))<NEW_LINE>y = Integer.parseInt(yS);<NEW_LINE>if (!(mS == null || mS.isEmpty() || mS.contains("X")))<NEW_LINE>m = Integer.parseInt(mS);<NEW_LINE>if (!(dS == null || dS.isEmpty() || dS.contains("X")))<NEW_LINE>d = Integer.parseInt(dS);<NEW_LINE>if (y == -1 && m == -1 && d == -1)<NEW_LINE>return null;<NEW_LINE>return new DateValue(y, m, d);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DateTime date = americanDateFormat.parseDateTime(s);<NEW_LINE>return new DateValue(date.getYear(), date.getMonthOfYear(<MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ), date.getDayOfMonth()); |
702,749 | public JsonElement extract() {<NEW_LINE>var enchantsJson = new JsonArray();<NEW_LINE>for (var enchant : Registry.ENCHANTMENT) {<NEW_LINE>var enchantJson = new JsonObject();<NEW_LINE>enchantJson.addProperty("id", Registry.ENCHANTMENT.getRawId(enchant));<NEW_LINE>enchantJson.addProperty("name", Registry.ENCHANTMENT.getId(enchant).getPath());<NEW_LINE>enchantJson.addProperty("translation_key", enchant.getTranslationKey());<NEW_LINE>enchantJson.addProperty("min_level", enchant.getMinLevel());<NEW_LINE>enchantJson.addProperty("max_level", enchant.getMaxLevel());<NEW_LINE>enchantJson.addProperty("rarity_weight", enchant.getRarity().getWeight());<NEW_LINE>enchantJson.addProperty("cursed", enchant.isCursed());<NEW_LINE>var enchantmentSources = new JsonObject();<NEW_LINE>enchantmentSources.addProperty("treasure", enchant.isTreasure());<NEW_LINE>enchantmentSources.addProperty("enchantment_table", enchant.isAvailableForEnchantedBookOffer());<NEW_LINE>// All enchants except for 'Soul speed' and 'Swift sneak' are available for random selection and are only obtainable from loot chests.<NEW_LINE>enchantmentSources.addProperty("random_selection", enchant.isAvailableForRandomSelection());<NEW_LINE><MASK><NEW_LINE>enchantsJson.add(enchantJson);<NEW_LINE>}<NEW_LINE>return enchantsJson;<NEW_LINE>} | enchantJson.add("sources", enchantmentSources); |
983,259 | public TableColumn specifyColumn(String type, String name, String cmd, boolean newObject, boolean newColumn) throws ClassNotFoundException, IllegalAccessException, InstantiationException {<NEW_LINE>TableColumn column;<NEW_LINE>Map gprops = (Map) getSpecification().getProperties();<NEW_LINE>Map props = (Map) getSpecification().getCommandProperties(cmd);<NEW_LINE>// NOI18N<NEW_LINE>Map bindmap = (Map) props.get("Binding");<NEW_LINE>String tname = (<MASK><NEW_LINE>if (tname != null) {<NEW_LINE>Map typemap = (Map) gprops.get(tname);<NEW_LINE>if (typemap != null) {<NEW_LINE>// NOI18N<NEW_LINE>Class typeclass = Class.forName((String) typemap.get("Class"));<NEW_LINE>// NOI18N<NEW_LINE>String format = (String) typemap.get("Format");<NEW_LINE>column = (TableColumn) typeclass.newInstance();<NEW_LINE>column.setObjectName(name);<NEW_LINE>column.setObjectType(type);<NEW_LINE>column.setColumnName(name);<NEW_LINE>column.setFormat(format);<NEW_LINE>column.setNewObject(newObject);<NEW_LINE>column.setNewColumn(newColumn);<NEW_LINE>columns.add(column);<NEW_LINE>} else<NEW_LINE>throw new InstantiationException(// NOI18N<NEW_LINE>MessageFormat.// NOI18N<NEW_LINE>format(NbBundle.getBundle("org.netbeans.lib.ddl.resources.Bundle").getString("EXC_UnableLocateType"), new String[] { tname, props.keySet().toString() }));<NEW_LINE>} else<NEW_LINE>throw new InstantiationException(// NOI18N<NEW_LINE>MessageFormat.// NOI18N<NEW_LINE>format(NbBundle.getBundle("org.netbeans.lib.ddl.resources.Bundle").getString("EXC_UnableToBind"), new String[] { type, bindmap.toString() }));<NEW_LINE>return column;<NEW_LINE>} | String) bindmap.get(type); |
1,365,198 | public static ListScenarioParametersResponse unmarshall(ListScenarioParametersResponse listScenarioParametersResponse, UnmarshallerContext context) {<NEW_LINE>listScenarioParametersResponse.setRequestId(context.stringValue("ListScenarioParametersResponse.RequestId"));<NEW_LINE>listScenarioParametersResponse.setSuccess(context.booleanValue("ListScenarioParametersResponse.Success"));<NEW_LINE>listScenarioParametersResponse.setCode(context.stringValue("ListScenarioParametersResponse.Code"));<NEW_LINE>listScenarioParametersResponse.setMessage(context.stringValue("ListScenarioParametersResponse.Message"));<NEW_LINE>listScenarioParametersResponse.setHttpStatusCode<MASK><NEW_LINE>List<ScenarioParameter> scenarioParameters = new ArrayList<ScenarioParameter>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListScenarioParametersResponse.ScenarioParameters.Length"); i++) {<NEW_LINE>ScenarioParameter scenarioParameter = new ScenarioParameter();<NEW_LINE>scenarioParameter.setId(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].Id"));<NEW_LINE>scenarioParameter.setScenarioId(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].ScenarioId"));<NEW_LINE>scenarioParameter.setName(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].Name"));<NEW_LINE>scenarioParameter.setTitle(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].Title"));<NEW_LINE>scenarioParameter.setDescription(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].Description"));<NEW_LINE>scenarioParameter.setType(context.integerValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].Type"));<NEW_LINE>scenarioParameter.setDefaultValue(context.stringValue("ListScenarioParametersResponse.ScenarioParameters[" + i + "].DefaultValue"));<NEW_LINE>scenarioParameters.add(scenarioParameter);<NEW_LINE>}<NEW_LINE>listScenarioParametersResponse.setScenarioParameters(scenarioParameters);<NEW_LINE>return listScenarioParametersResponse;<NEW_LINE>} | (context.integerValue("ListScenarioParametersResponse.HttpStatusCode")); |
1,460,953 | public static IPoweredTask readFromNBT(@Nonnull NBTTagCompound nbtRoot) {<NEW_LINE>IMachineRecipe recipe;<NEW_LINE>float usedEnergy = nbtRoot.getFloat(KEY_USED_ENERGY);<NEW_LINE>long seed = nbtRoot.getLong(KEY_SEED);<NEW_LINE>float outputMultiplier = nbtRoot.getFloat(KEY_CHANCE_OUTPUT);<NEW_LINE>float chanceMultiplier = nbtRoot.getFloat(KEY_CHANCE_MULTI);<NEW_LINE>boolean hasCustomEnergyCost = false;<NEW_LINE>float requiredEnergy = 0;<NEW_LINE>if (nbtRoot.hasKey(KEY_CUSTOM_ENERGY)) {<NEW_LINE>hasCustomEnergyCost = true;<NEW_LINE>requiredEnergy = nbtRoot.getFloat(KEY_CUSTOM_ENERGY);<NEW_LINE>}<NEW_LINE>NBTTagList inputItems = (NBTTagList) nbtRoot.getTag(KEY_INPUT_STACKS);<NEW_LINE>NNList<MachineRecipeInput> ins = new NNList<MachineRecipeInput>();<NEW_LINE>for (int i = 0; i < inputItems.tagCount(); i++) {<NEW_LINE>NBTTagCompound <MASK><NEW_LINE>MachineRecipeInput mi = MachineRecipeInput.readFromNBT(stackTag);<NEW_LINE>ins.add(mi);<NEW_LINE>}<NEW_LINE>String uid = nbtRoot.getString(KEY_RECIPE);<NEW_LINE>recipe = MachineRecipeRegistry.instance.getRecipeForUid(uid);<NEW_LINE>if (recipe != null) {<NEW_LINE>// TODO: Check if it is harmful if the recipe changed its input items in the meantime. Do we use the items we got from our nbt when the task is complete?<NEW_LINE>// If not, why do we store them?<NEW_LINE>final PoweredTask poweredTask = new PoweredTask(recipe, usedEnergy, seed, outputMultiplier, chanceMultiplier, ins);<NEW_LINE>if (hasCustomEnergyCost) {<NEW_LINE>poweredTask.setRequiredEnergy(requiredEnergy);<NEW_LINE>}<NEW_LINE>return poweredTask;<NEW_LINE>}<NEW_LINE>// TODO: Do something with the items we have here. Currently they are voided, which is not ideal.<NEW_LINE>return null;<NEW_LINE>} | stackTag = inputItems.getCompoundTagAt(i); |
1,134,002 | // private void loadFileList() {<NEW_LINE>private void createFileListAdapter() {<NEW_LINE>adapter = new ArrayAdapter<Item>(this, android.R.layout.select_dialog_item, android.R.id.text1, fileList) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public View getView(int position, View convertView, ViewGroup parent) {<NEW_LINE>// creates view<NEW_LINE>View view = super.getView(position, convertView, parent);<NEW_LINE>TextView textView = (TextView) view.findViewById(<MASK><NEW_LINE>// put the image on the text view<NEW_LINE>int drawableID = 0;<NEW_LINE>if (fileList.get(position).icon != -1) {<NEW_LINE>// If icon == -1, then directory is empty<NEW_LINE>drawableID = fileList.get(position).icon;<NEW_LINE>}<NEW_LINE>textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0, 0, 0);<NEW_LINE>textView.setEllipsize(null);<NEW_LINE>// add margin between image and text (support various screen<NEW_LINE>// densities)<NEW_LINE>// int dp5 = (int) (5 *<NEW_LINE>// getResources().getDisplayMetrics().density + 0.5f);<NEW_LINE>int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);<NEW_LINE>// TODO: change next line for empty directory, so text will be<NEW_LINE>// centered<NEW_LINE>textView.setCompoundDrawablePadding(dp3);<NEW_LINE>textView.setBackgroundColor(Color.LTGRAY);<NEW_LINE>return view;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// adapter = new ArrayAdapter<Item>(this,<NEW_LINE>} | android.R.id.text1); |
1,460,381 | public Long migrate(final HaWorkVO work) {<NEW_LINE>long vmId = work.getInstanceId();<NEW_LINE><MASK><NEW_LINE>VMInstanceVO vm = _instanceDao.findById(vmId);<NEW_LINE>if (vm == null) {<NEW_LINE>s_logger.info("Unable to find vm: " + vmId + ", skipping migrate.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>s_logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId + ". Starting attempt: " + (1 + work.getTimesTried()) + "/" + _maxRetries + " times.");<NEW_LINE>try {<NEW_LINE>work.setStep(Step.Migrating);<NEW_LINE>_haDao.update(work.getId(), work);<NEW_LINE>// First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.<NEW_LINE>_itMgr.migrateAway(vm.getUuid(), srcHostId);<NEW_LINE>return null;<NEW_LINE>} catch (InsufficientServerCapacityException e) {<NEW_LINE>s_logger.warn("Migration attempt: Insufficient capacity for migrating a VM " + vm.getUuid() + " from source host id " + srcHostId + ". Exception: " + e.getMessage());<NEW_LINE>_resourceMgr.migrateAwayFailed(srcHostId, vmId);<NEW_LINE>return (System.currentTimeMillis() >> 10) + _migrateRetryInterval;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Migration attempt: Unexpected exception occurred when attempting migration of " + vm.getUuid() + e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | long srcHostId = work.getHostId(); |
445,368 | private StepMeta udjc(List<DatasetTableField> datasetTableFields, DatasourceTypes datasourceType) {<NEW_LINE>StringBuilder handleBinaryTypeCode = new StringBuilder();<NEW_LINE>String excelCompletion = "";<NEW_LINE>for (DatasetTableField datasetTableField : datasetTableFields) {<NEW_LINE>if (datasetTableField.getDeExtractType().equals(DeTypeConstants.DE_BINARY)) {<NEW_LINE>handleBinaryTypeCode.append("\n").append(handleBinaryType.replace("FIELD", datasetTableField.getDataeaseName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UserDefinedJavaClassMeta userDefinedJavaClassMeta = new UserDefinedJavaClassMeta();<NEW_LINE>List<UserDefinedJavaClassMeta.FieldInfo> fields = new ArrayList<>();<NEW_LINE>UserDefinedJavaClassMeta.FieldInfo fieldInfo = new UserDefinedJavaClassMeta.FieldInfo("dataease_uuid", ValueMetaInterface.TYPE_STRING, -1, -1);<NEW_LINE>fields.add(fieldInfo);<NEW_LINE>userDefinedJavaClassMeta.setFieldInfo(fields);<NEW_LINE>List<UserDefinedJavaClassDef> definitions = new ArrayList<>();<NEW_LINE>String tmp_code = code.replace("handleWraps", handleWraps).replace("handleBinaryType", handleBinaryTypeCode.toString());<NEW_LINE>String Column_Fields;<NEW_LINE>if (datasourceType.equals(DatasourceTypes.oracle) || datasourceType.equals(DatasourceTypes.db2)) {<NEW_LINE>Column_Fields = datasetTableFields.stream().map(DatasetTableField::getOriginName).collect<MASK><NEW_LINE>} else {<NEW_LINE>Column_Fields = datasetTableFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.joining(","));<NEW_LINE>}<NEW_LINE>if (datasourceType.equals(DatasourceTypes.excel)) {<NEW_LINE>tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn).replace("Column_Fields", Column_Fields).replace("ExcelCompletion", excelCompletion);<NEW_LINE>} else {<NEW_LINE>tmp_code = tmp_code.replace("handleExcelIntColumn", "").replace("Column_Fields", Column_Fields).replace("ExcelCompletion", "");<NEW_LINE>}<NEW_LINE>UserDefinedJavaClassDef userDefinedJavaClassDef = new UserDefinedJavaClassDef(UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "Processor", tmp_code);<NEW_LINE>userDefinedJavaClassDef.setActive(true);<NEW_LINE>definitions.add(userDefinedJavaClassDef);<NEW_LINE>userDefinedJavaClassMeta.replaceDefinitions(definitions);<NEW_LINE>StepMeta userDefinedJavaClassStep = new StepMeta("UserDefinedJavaClass", "UserDefinedJavaClass", userDefinedJavaClassMeta);<NEW_LINE>userDefinedJavaClassStep.setLocation(300, 100);<NEW_LINE>userDefinedJavaClassStep.setDraw(true);<NEW_LINE>return userDefinedJavaClassStep;<NEW_LINE>} | (Collectors.joining(",")); |
1,359,692 | public void handleAutopilot() {<NEW_LINE>if (!mc.player.isFallFlying())<NEW_LINE>return;<NEW_LINE>if (elytraFly.autoPilot.get() && mc.player.getY() > elytraFly.autoPilotMinimumHeight.get()) {<NEW_LINE>mc.options.forwardKey.setPressed(true);<NEW_LINE>lastForwardPressed = true;<NEW_LINE>}<NEW_LINE>if (elytraFly.useFireworks.get()) {<NEW_LINE>if (ticksLeft <= 0) {<NEW_LINE>ticksLeft = elytraFly.autoPilotFireworkDelay.get() * 20;<NEW_LINE>FindItemResult itemResult = InvUtils.findInHotbar(Items.FIREWORK_ROCKET);<NEW_LINE>if (!itemResult.found())<NEW_LINE>return;<NEW_LINE>if (itemResult.isOffhand()) {<NEW_LINE>mc.interactionManager.interactItem(mc.player, <MASK><NEW_LINE>mc.player.swingHand(Hand.OFF_HAND);<NEW_LINE>} else {<NEW_LINE>InvUtils.swap(itemResult.slot(), true);<NEW_LINE>mc.interactionManager.interactItem(mc.player, mc.world, Hand.MAIN_HAND);<NEW_LINE>mc.player.swingHand(Hand.MAIN_HAND);<NEW_LINE>InvUtils.swapBack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ticksLeft--;<NEW_LINE>}<NEW_LINE>} | mc.world, Hand.OFF_HAND); |
385,763 | private void serverRemovedSegment(DruidServerMetadata server, DataSegment segment) {<NEW_LINE>SegmentId segmentId = segment.getId();<NEW_LINE>final ServerSelector selector;<NEW_LINE>synchronized (lock) {<NEW_LINE>log.debug("Removing segment[%s] from server[%s].", segmentId, server);<NEW_LINE>// we don't store broker segments here, but still run the callbacks for the segment being removed from the server<NEW_LINE>// since the broker segments are not stored on the timeline, do not fire segmentRemoved event<NEW_LINE>if (server.getType().equals(ServerType.BROKER)) {<NEW_LINE>runTimelineCallbacks(callback -> callback<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>selector = selectors.get(segmentId);<NEW_LINE>if (selector == null) {<NEW_LINE>log.warn("Told to remove non-existant segment[%s]", segmentId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>QueryableDruidServer queryableDruidServer = clients.get(server.getName());<NEW_LINE>if (!selector.removeServer(queryableDruidServer)) {<NEW_LINE>log.warn("Asked to disassociate non-existant association between server[%s] and segment[%s]", server, segmentId);<NEW_LINE>} else {<NEW_LINE>runTimelineCallbacks(callback -> callback.serverSegmentRemoved(server, segment));<NEW_LINE>}<NEW_LINE>if (selector.isEmpty()) {<NEW_LINE>VersionedIntervalTimeline<String, ServerSelector> timeline = timelines.get(segment.getDataSource());<NEW_LINE>selectors.remove(segmentId);<NEW_LINE>final PartitionChunk<ServerSelector> removedPartition = timeline.remove(segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(selector));<NEW_LINE>if (removedPartition == null) {<NEW_LINE>log.warn("Asked to remove timeline entry[interval: %s, version: %s] that doesn't exist", segment.getInterval(), segment.getVersion());<NEW_LINE>} else {<NEW_LINE>runTimelineCallbacks(callback -> callback.segmentRemoved(segment));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .serverSegmentRemoved(server, segment)); |
601,328 | protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>JsonObject input = InputParser.parseJsonObjectOrThrowError(req);<NEW_LINE>String sessionHandle = InputParser.parseStringOrThrowError(input, "sessionHandle", false);<NEW_LINE>assert sessionHandle != null;<NEW_LINE>JsonObject userDataInJWT = InputParser.parseJsonObjectOrThrowError(input, "userDataInJWT", false);<NEW_LINE>assert userDataInJWT != null;<NEW_LINE>try {<NEW_LINE>Session.updateSession(main, sessionHandle, null, userDataInJWT, null);<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "OK");<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (StorageQueryException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} catch (UnauthorisedException e) {<NEW_LINE>Logging.debug(main, Utils.exceptionStacktraceToString(e));<NEW_LINE>JsonObject reply = new JsonObject();<NEW_LINE><MASK><NEW_LINE>reply.addProperty("message", e.getMessage());<NEW_LINE>super.sendJsonResponse(200, reply, resp);<NEW_LINE>}<NEW_LINE>} | reply.addProperty("status", "UNAUTHORISED"); |
56,210 | private static <T extends IPart> ColoredItemDefinition<ColoredPartItem<T>> constructColoredDefinition(String nameSuffix, String idSuffix, Class<T> partClass, Function<ColoredPartItem<T>, T> factory) {<NEW_LINE>PartModels.registerModels(PartModelsHelper.createModels(partClass));<NEW_LINE>var definition = new ColoredItemDefinition<ColoredPartItem<T>>();<NEW_LINE>for (AEColor color : AEColor.values()) {<NEW_LINE>var id = color.registryPrefix + '_' + idSuffix;<NEW_LINE>var name <MASK><NEW_LINE>var itemDef = item(name, AppEng.makeId(id), props -> new ColoredPartItem<>(props, partClass, factory, color));<NEW_LINE>definition.add(color, AppEng.makeId(id), itemDef);<NEW_LINE>}<NEW_LINE>COLORED_PARTS.add(definition);<NEW_LINE>return definition;<NEW_LINE>} | = color.englishName + " " + nameSuffix; |
1,250,672 | public PrimaryDcCheckMessage changePrimaryDcCheck(String clusterId, String shardId, String newPrimaryDc, ForwardInfo forwardInfo) {<NEW_LINE>logger.info("[changePrimaryDcCheck]{}, {}, {}, {}", clusterId, shardId, newPrimaryDc, forwardInfo);<NEW_LINE>Pair<Long, Long> clusterShard = dcMetaCache.clusterShardId2DbId(clusterId, shardId);<NEW_LINE>String currentPrimaryDc = dcMetaCache.getPrimaryDc(clusterShard.getKey(), clusterShard.getValue());<NEW_LINE>String currentDc = dcMetaCache.getCurrentDc();<NEW_LINE>if (newPrimaryDc.equalsIgnoreCase(currentPrimaryDc)) {<NEW_LINE>return new PrimaryDcCheckMessage(PRIMARY_DC_CHECK_RESULT.PRIMARY_DC_ALREADY_IS_NEW, String.format("%s already primary dc", newPrimaryDc));<NEW_LINE>}<NEW_LINE>if (currentDc.equalsIgnoreCase(newPrimaryDc)) {<NEW_LINE>List<RedisMeta> redises = dcMetaCache.getShardRedises(clusterShard.getKey(), clusterShard.getValue());<NEW_LINE>SimpleErrorMessage result = new AtLeastOneChecker(redises, keyedObjectPool, scheduled).check();<NEW_LINE>if (result.getErrorType() == SIMPLE_RETURN_CODE.SUCCESS) {<NEW_LINE>return new PrimaryDcCheckMessage(PRIMARY_DC_CHECK_RESULT.SUCCESS);<NEW_LINE>}<NEW_LINE>return new PrimaryDcCheckMessage(PRIMARY_DC_CHECK_RESULT.FAIL, "all redises dead:" + result.getErrorMessage());<NEW_LINE>}<NEW_LINE>return new PrimaryDcCheckMessage(PRIMARY_DC_CHECK_RESULT.SUCCESS, String.format<MASK><NEW_LINE>} | ("current dc :%s is not new primary: %s ", currentDc, newPrimaryDc)); |
1,403,932 | private void updateExportsPropertyAssignment(Node getpropNode, NodeTraversal t) {<NEW_LINE>if (!currentScript.isModule) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node parent = getpropNode.getParent();<NEW_LINE>checkState(parent.isAssign() || parent.isExprResult(), parent);<NEW_LINE>// Update "exports.foo = Foo" to "module$exports$pkg$Foo.foo = Foo";<NEW_LINE>Node exportsNameNode = getpropNode.getFirstChild();<NEW_LINE>checkState(exportsNameNode.getString().equals("exports"));<NEW_LINE><MASK><NEW_LINE>safeSetMaybeQualifiedString(exportsNameNode, exportedNamespace, /* isModuleNamespace= */<NEW_LINE>false);<NEW_LINE>Node jsdocNode = parent.isAssign() ? parent : getpropNode;<NEW_LINE>markConstAndCopyJsDoc(jsdocNode, jsdocNode);<NEW_LINE>// When seeing the first "exports.foo = ..." line put a "var module$exports$pkg$Foo = {};"<NEW_LINE>// before it.<NEW_LINE>if (!currentScript.hasCreatedExportObject) {<NEW_LINE>exportTheEmptyBinaryNamespaceAt(NodeUtil.getEnclosingStatement(parent), AddAt.BEFORE, t);<NEW_LINE>}<NEW_LINE>} | String exportedNamespace = currentScript.getExportedNamespace(); |
1,000,566 | public static StarlarkFunctionInfo fromNameAndFunction(String functionName, StarlarkFunction fn) throws DocstringParseException {<NEW_LINE>String functionDescription = "";<NEW_LINE>Map<String, String> paramNameToDocMap = Maps.newLinkedHashMap();<NEW_LINE>FunctionReturnInfo retInfo = FunctionReturnInfo.getDefaultInstance();<NEW_LINE>FunctionDeprecationInfo deprInfo = FunctionDeprecationInfo.getDefaultInstance();<NEW_LINE>String doc = fn.getDocumentation();<NEW_LINE>if (doc != null) {<NEW_LINE>List<DocstringParseError> parseErrors = Lists.newArrayList();<NEW_LINE>DocstringInfo docstringInfo = DocstringUtils.parseDocstring(doc, parseErrors);<NEW_LINE>if (!parseErrors.isEmpty()) {<NEW_LINE>throw new DocstringParseException(functionName, fn.getLocation(), parseErrors);<NEW_LINE>}<NEW_LINE>functionDescription += docstringInfo.getSummary();<NEW_LINE>if (!docstringInfo.getSummary().isEmpty() && !docstringInfo.getLongDescription().isEmpty()) {<NEW_LINE>functionDescription += "\n\n";<NEW_LINE>}<NEW_LINE>functionDescription += docstringInfo.getLongDescription();<NEW_LINE>for (ParameterDoc paramDoc : docstringInfo.getParameters()) {<NEW_LINE>paramNameToDocMap.put(paramDoc.getParameterName(), paramDoc.getDescription());<NEW_LINE>}<NEW_LINE>retInfo = returnInfo(docstringInfo);<NEW_LINE>deprInfo = deprecationInfo(docstringInfo);<NEW_LINE>}<NEW_LINE>List<FunctionParamInfo> <MASK><NEW_LINE>return StarlarkFunctionInfo.newBuilder().setFunctionName(functionName).setDocString(functionDescription).addAllParameter(paramsInfo).setReturn(retInfo).setDeprecated(deprInfo).build();<NEW_LINE>} | paramsInfo = parameterInfos(fn, paramNameToDocMap); |
1,611,431 | private Graph rebuildGraph(Graph graph, int[] communityIds, int communityCount) {<NEW_LINE>// count and normalize community structure<NEW_LINE>final int nodeCount = communityIds.length;<NEW_LINE>// bag of nodeId->{nodeId, ..}<NEW_LINE>final IntObjectMap<IntScatterSet> relationships = new IntObjectScatterMap<>(nodeCount);<NEW_LINE>// accumulated weights<NEW_LINE>final LongDoubleScatterMap relationshipWeights = new LongDoubleScatterMap(nodeCount);<NEW_LINE>// for each node in the current graph<NEW_LINE>for (int i = 0; i < nodeCount; i++) {<NEW_LINE>// map node nodeId to community nodeId<NEW_LINE>final int sourceCommunity = communityIds[i];<NEW_LINE>// get transitions from current node<NEW_LINE>graph.forEachOutgoing(i, (s, t, r) -> {<NEW_LINE>// mapping<NEW_LINE>final int targetCommunity = communityIds[t];<NEW_LINE>final double value = graph.weightOf(s, t);<NEW_LINE>if (sourceCommunity == targetCommunity) {<NEW_LINE>nodeWeights[sourceCommunity] += value;<NEW_LINE>}<NEW_LINE>// add IN and OUT relation<NEW_LINE>putIfAbsent(relationships, targetCommunity).add(sourceCommunity);<NEW_LINE>putIfAbsent(relationships, sourceCommunity).add(targetCommunity);<NEW_LINE>// TODO validate<NEW_LINE>relationshipWeights.addTo(RawValues.combineIntInt(sourceCommunity<MASK><NEW_LINE>relationshipWeights.addTo(RawValues.combineIntInt(targetCommunity, sourceCommunity), value / 2);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// create temporary graph<NEW_LINE>return new LouvainGraph(communityCount, relationships, relationshipWeights);<NEW_LINE>} | , targetCommunity), value / 2); |
1,055,379 | protected void runDriver(Object object) throws Exception {<NEW_LINE>int passed = 0, failed = 0;<NEW_LINE>Class<?> clazz = object.getClass();<NEW_LINE>out.println("Tests for " + clazz.getName());<NEW_LINE>// Find methods<NEW_LINE>for (Method method : clazz.getMethods()) {<NEW_LINE>List<Pair<String, TypeAnnotation.Position>> expected = expectedOf(method);<NEW_LINE>if (expected == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (method.getReturnType() != String.class) {<NEW_LINE>throw new IllegalArgumentException("Test method needs to return a string: " + method);<NEW_LINE>}<NEW_LINE>String testClass = PersistUtil.testClassOf(method);<NEW_LINE>try {<NEW_LINE>String compact = (String) method.invoke(object);<NEW_LINE>String <MASK><NEW_LINE>ClassFile cf = PersistUtil.compileAndReturn(fullFile, testClass);<NEW_LINE>boolean ignoreConstructors = !clazz.getName().equals("Constructors");<NEW_LINE>List<TypeAnnotation> actual = ReferenceInfoUtil.extendedAnnotationsOf(cf, ignoreConstructors);<NEW_LINE>String diagnostic = String.join("; ", "Tests for " + clazz.getName(), "compact=" + compact, "fullFile=" + fullFile, "testClass=" + testClass);<NEW_LINE>ReferenceInfoUtil.compare(expected, actual, cf, diagnostic);<NEW_LINE>out.println("PASSED: " + method.getName());<NEW_LINE>++passed;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>out.println("FAILED: " + method.getName());<NEW_LINE>out.println(" " + e);<NEW_LINE>++failed;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>int total = passed + failed;<NEW_LINE>out.println(total + " total tests: " + passed + " PASSED, " + failed + " FAILED");<NEW_LINE>out.flush();<NEW_LINE>if (failed != 0) {<NEW_LINE>throw new RuntimeException(failed + " tests failed");<NEW_LINE>}<NEW_LINE>} | fullFile = PersistUtil.wrap(compact); |
1,846,193 | protected void onBindMediaDetails(ViewHolder vh, Object item) {<NEW_LINE>int favoriteTextColor = vh.view.getContext().getResources().getColor(R.color.song_row_favorite_color);<NEW_LINE>Song song = (Song) item;<NEW_LINE>if (song.getNumber() == 1 && firstRowView == null) {<NEW_LINE>firstRowView = vh.getMediaItemNameView();<NEW_LINE>}<NEW_LINE>vh.getMediaItemNumberView().setText(<MASK><NEW_LINE>String songTitle = song.getTitle() + " / " + song.getDescription();<NEW_LINE>vh.getMediaItemNameView().setText(songTitle);<NEW_LINE>vh.getMediaItemDurationView().setText("" + song.getDuration());<NEW_LINE>if (song.isFavorite()) {<NEW_LINE>vh.getMediaItemNumberView().setTextColor(favoriteTextColor);<NEW_LINE>vh.getMediaItemNameView().setTextColor(favoriteTextColor);<NEW_LINE>vh.getMediaItemDurationView().setTextColor(favoriteTextColor);<NEW_LINE>} else {<NEW_LINE>Context context = vh.getMediaItemNumberView().getContext();<NEW_LINE>vh.getMediaItemNumberView().setTextAppearance(context, R.style.TextAppearance_Leanback_PlaybackMediaItemNumber);<NEW_LINE>vh.getMediaItemNameView().setTextAppearance(context, R.style.TextAppearance_Leanback_PlaybackMediaItemName);<NEW_LINE>vh.getMediaItemDurationView().setTextAppearance(context, R.style.TextAppearance_Leanback_PlaybackMediaItemDuration);<NEW_LINE>}<NEW_LINE>} | "" + song.getNumber()); |
851,586 | public void prepare(BaseDanmakuParser parser, DanmakuContext config) {<NEW_LINE>CustomParser newParser = new <MASK><NEW_LINE>DanmakuContext configCopy;<NEW_LINE>try {<NEW_LINE>configCopy = (DanmakuContext) config.clone();<NEW_LINE>configCopy.resetContext();<NEW_LINE>configCopy.transparency = AlphaValue.MAX;<NEW_LINE>configCopy.setDanmakuTransparency(config.transparency / (float) AlphaValue.MAX);<NEW_LINE>configCopy.mGlobalFlagValues.FILTER_RESET_FLAG = config.mGlobalFlagValues.FILTER_RESET_FLAG;<NEW_LINE>configCopy.setDanmakuSync(null);<NEW_LINE>configCopy.unregisterAllConfigChangedCallbacks();<NEW_LINE>configCopy.mGlobalFlagValues.updateAll();<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>configCopy = config;<NEW_LINE>}<NEW_LINE>configCopy.updateMethod = 1;<NEW_LINE>if (mOnFrameAvailableListener != null) {<NEW_LINE>mOnFrameAvailableListener.onConfig(configCopy);<NEW_LINE>}<NEW_LINE>super.prepare(newParser, configCopy);<NEW_LINE>handler.setIdleSleep(false);<NEW_LINE>handler.enableNonBlockMode(true);<NEW_LINE>} | CustomParser(parser, mBeginTimeMills, mEndTimeMills); |
952,710 | public static ConnectionCostsWriter<ConnectionCosts> build(Path path) throws IOException {<NEW_LINE>try (Reader reader = Files.newBufferedReader(path, StandardCharsets.US_ASCII);<NEW_LINE>LineNumberReader lineReader = new LineNumberReader(reader)) {<NEW_LINE><MASK><NEW_LINE>String[] dimensions = line.split("\\s+");<NEW_LINE>assert dimensions.length == 2;<NEW_LINE>int forwardSize = Integer.parseInt(dimensions[0]);<NEW_LINE>int backwardSize = Integer.parseInt(dimensions[1]);<NEW_LINE>assert forwardSize > 0 && backwardSize > 0;<NEW_LINE>ConnectionCostsWriter<ConnectionCosts> costs = new ConnectionCostsWriter<>(ConnectionCosts.class, forwardSize, backwardSize);<NEW_LINE>while ((line = lineReader.readLine()) != null) {<NEW_LINE>String[] fields = line.split("\\s+");<NEW_LINE>assert fields.length == 3;<NEW_LINE>int forwardId = Integer.parseInt(fields[0]);<NEW_LINE>int backwardId = Integer.parseInt(fields[1]);<NEW_LINE>int cost = Integer.parseInt(fields[2]);<NEW_LINE>costs.add(forwardId, backwardId, cost);<NEW_LINE>}<NEW_LINE>return costs;<NEW_LINE>}<NEW_LINE>} | String line = lineReader.readLine(); |
1,361,977 | public void open(long minSeqNum, int elementCount) throws IOException {<NEW_LINE>mapFile();<NEW_LINE>buffer.position(0);<NEW_LINE>this.version = buffer.get();<NEW_LINE>validateVersion(this.version);<NEW_LINE>this.head = 1;<NEW_LINE>this.minSeqNum = minSeqNum;<NEW_LINE>this.elementCount = elementCount;<NEW_LINE>if (this.elementCount > 0) {<NEW_LINE>// verify first seqNum to be same as expected minSeqNum<NEW_LINE><MASK><NEW_LINE>if (seqNum != this.minSeqNum) {<NEW_LINE>throw new IOException(String.format("first seqNum=%d is different than minSeqNum=%d", seqNum, this.minSeqNum));<NEW_LINE>}<NEW_LINE>// reset back position to first seqNum<NEW_LINE>buffer.position(this.head);<NEW_LINE>for (int i = 0; i < this.elementCount; i++) {<NEW_LINE>// verify that seqNum must be of strict + 1 increasing order<NEW_LINE>readNextElement(this.minSeqNum + i, !VERIFY_CHECKSUM);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | long seqNum = buffer.getLong(); |
1,363,056 | final ListDistributionsByCachePolicyIdResult executeListDistributionsByCachePolicyId(ListDistributionsByCachePolicyIdRequest listDistributionsByCachePolicyIdRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDistributionsByCachePolicyIdRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDistributionsByCachePolicyIdRequest> request = null;<NEW_LINE>Response<ListDistributionsByCachePolicyIdResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDistributionsByCachePolicyIdRequestMarshaller().marshall(super.beforeMarshalling(listDistributionsByCachePolicyIdRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDistributionsByCachePolicyId");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListDistributionsByCachePolicyIdResult> responseHandler = new StaxResponseHandler<ListDistributionsByCachePolicyIdResult>(new ListDistributionsByCachePolicyIdResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
492,566 | public static RecoveryAuthnCodesCredentialModel createFromValues(List<String> originalGeneratedCodes, long generatedAt, String userLabel) {<NEW_LINE>RecoveryAuthnCodesSecretData secretData;<NEW_LINE>RecoveryAuthnCodesCredentialData credentialData;<NEW_LINE>RecoveryAuthnCodesCredentialModel model;<NEW_LINE>try {<NEW_LINE>List<RecoveryAuthnCodeRepresentation> recoveryCodes = IntStream.range(0, originalGeneratedCodes.size()).mapToObj(i -> new RecoveryAuthnCodeRepresentation(i + 1, RecoveryAuthnCodesUtils.hashRawCode(originalGeneratedCodes.get(i)))).collect(Collectors.toList());<NEW_LINE>secretData = new RecoveryAuthnCodesSecretData(recoveryCodes);<NEW_LINE>credentialData = new RecoveryAuthnCodesCredentialData(RecoveryAuthnCodesUtils.NUM_HASH_ITERATIONS, RecoveryAuthnCodesUtils.NOM_ALGORITHM_TO_HASH, recoveryCodes.size(<MASK><NEW_LINE>model = new RecoveryAuthnCodesCredentialModel(credentialData, secretData);<NEW_LINE>model.setCredentialData(JsonSerialization.writeValueAsString(credentialData));<NEW_LINE>model.setSecretData(JsonSerialization.writeValueAsString(secretData));<NEW_LINE>model.setCreatedDate(generatedAt);<NEW_LINE>model.setType(TYPE);<NEW_LINE>if (userLabel != null) {<NEW_LINE>model.setUserLabel(userLabel);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | ), recoveryCodes.size()); |
1,417,777 | public static Map<String, Object> resolvedArtifactProps(Artifact artifact, Map<String, Object> props) {<NEW_LINE>props.putAll(artifact.getExtraProperties());<NEW_LINE>props.putAll(artifact.getResolvedExtraProperties());<NEW_LINE>String artifactFile = artifact.getEffectivePath().getFileName().toString();<NEW_LINE>String artifactFileName = getFilename(artifactFile, FileType.getSupportedExtensions());<NEW_LINE>props.put(KEY_ARTIFACT_FILE, artifactFile);<NEW_LINE>props.put(KEY_ARTIFACT_FILE_NAME, artifactFileName);<NEW_LINE>if (!artifactFile.equals(artifactFileName)) {<NEW_LINE>String artifactExtension = artifactFile.substring(artifactFileName.length());<NEW_LINE>String artifactFileFormat = artifactExtension.substring(1);<NEW_LINE><MASK><NEW_LINE>props.put(KEY_ARTIFACT_FILE_FORMAT, artifactFileFormat);<NEW_LINE>}<NEW_LINE>String artifactName = "";<NEW_LINE>String projectVersion = (String) props.get(KEY_PROJECT_EFFECTIVE_VERSION);<NEW_LINE>if (isNotBlank(projectVersion) && artifactFileName.contains(projectVersion)) {<NEW_LINE>artifactName = artifactFileName.substring(0, artifactFileName.indexOf(projectVersion));<NEW_LINE>if (artifactName.endsWith("-")) {<NEW_LINE>artifactName = artifactName.substring(0, artifactName.length() - 1);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_VERSION, projectVersion);<NEW_LINE>}<NEW_LINE>projectVersion = (String) props.get(KEY_PROJECT_VERSION);<NEW_LINE>if (isBlank(artifactName) && isNotBlank(projectVersion) && artifactFileName.contains(projectVersion)) {<NEW_LINE>artifactName = artifactFileName.substring(0, artifactFileName.indexOf(projectVersion));<NEW_LINE>if (artifactName.endsWith("-")) {<NEW_LINE>artifactName = artifactName.substring(0, artifactName.length() - 1);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_VERSION, projectVersion);<NEW_LINE>}<NEW_LINE>props.put(KEY_ARTIFACT_NAME, artifactName);<NEW_LINE>String platform = artifact.getPlatform();<NEW_LINE>if (isNotBlank(platform)) {<NEW_LINE>props.put("platform", platform);<NEW_LINE>props.put(KEY_ARTIFACT_PLATFORM, platform);<NEW_LINE>if (platform.contains("-")) {<NEW_LINE>String[] parts = platform.split("-");<NEW_LINE>props.put(KEY_ARTIFACT_OS, parts[0]);<NEW_LINE>props.put(KEY_ARTIFACT_ARCH, parts[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return props;<NEW_LINE>} | props.put(KEY_ARTIFACT_FILE_EXTENSION, artifactExtension); |
1,047,810 | public static String[] randomItems(int numberOfStrings, char[] givenValues) {<NEW_LINE>String[] strings = new String[numberOfStrings];<NEW_LINE>String[] fourCharacterFixedStrings = Exercise20_RandomFixedLengthWords.randomFixedLengthWords(10, 4);<NEW_LINE>String[] tenCharacterFixedStrings = Exercise20_RandomFixedLengthWords.randomFixedLengthWords(50, 10);<NEW_LINE>for (int string = 0; string < numberOfStrings; string++) {<NEW_LINE>StringBuilder currentString = new StringBuilder();<NEW_LINE>// Field 1: 4-character field<NEW_LINE>int random4CharacterStringIndex = StdRandom.uniform(fourCharacterFixedStrings.length);<NEW_LINE>currentString<MASK><NEW_LINE>// Field 2: 10-character field<NEW_LINE>int random10CharacterStringIndex = StdRandom.uniform(tenCharacterFixedStrings.length);<NEW_LINE>currentString.append(tenCharacterFixedStrings[random10CharacterStringIndex]);<NEW_LINE>// Field 3: 1-character field<NEW_LINE>int givenValueId = StdRandom.uniform(2);<NEW_LINE>currentString.append(givenValues[givenValueId]);<NEW_LINE>// Field 4: Variable 4 to 15 characters field<NEW_LINE>int variableLengthFieldSize = StdRandom.uniform(4, 15 + 1);<NEW_LINE>for (int character = 0; character < variableLengthFieldSize; character++) {<NEW_LINE>char characterValue;<NEW_LINE>int isUpperCaseLetter = StdRandom.uniform(2);<NEW_LINE>if (isUpperCaseLetter == 0) {<NEW_LINE>characterValue = (char) StdRandom.uniform(Constants.ASC_II_LOWERCASE_LETTERS_INITIAL_INDEX, Constants.ASC_II_LOWERCASE_LETTERS_FINAL_INDEX + 1);<NEW_LINE>} else {<NEW_LINE>characterValue = (char) StdRandom.uniform(Constants.ASC_II_UPPERCASE_LETTERS_INITIAL_INDEX, Constants.ASC_II_UPPERCASE_LETTERS_FINAL_INDEX + 1);<NEW_LINE>}<NEW_LINE>currentString.append(characterValue);<NEW_LINE>}<NEW_LINE>strings[string] = currentString.toString();<NEW_LINE>}<NEW_LINE>return strings;<NEW_LINE>} | .append(fourCharacterFixedStrings[random4CharacterStringIndex]); |
1,545,355 | public void showAndWait(KeySet keySet, List<KeyEditor> editors) {<NEW_LINE>this.keyEditors = editors;<NEW_LINE>JFXDialogLayout content = new ManageKeysDialogFxml(this);<NEW_LINE>editor.enableAddition(this::addNewEntry);<NEW_LINE>editor.addColumn("Name", KeyEntry::getName, KeyEntry::setName);<NEW_LINE>editor.addReadOnlyColumn("Type", KeyEntry::getType);<NEW_LINE>editor.addReadOnlyColumn("Value", KeyEntry::getPreview);<NEW_LINE>editor.addCustomAction(FontAwesomeIcon.PENCIL, this::editKey);<NEW_LINE>editor.addCustomAction(FontAwesomeIcon.CLONE, this::copyKey);<NEW_LINE>editor.addDeleteColumn("Delete");<NEW_LINE>editor.setItems(keySet.getEntries(), Comparator.comparing(KeyEntry::getName));<NEW_LINE>editor.setRowToStringConverter(e -> e.getName() + ": " + e.getValue());<NEW_LINE><MASK><NEW_LINE>dialog.showAndWait();<NEW_LINE>} | dialog = FxmlUtil.createDialog(content); |
981,702 | public void gen(CharRangeElement r) {<NEW_LINE>if (DEBUG_CODE_GENERATOR || DEBUG_CPP_CODE_GENERATOR)<NEW_LINE>System.out.println("genCharRangeElement(" + r.beginText + <MASK><NEW_LINE>if (!(grammar instanceof LexerGrammar))<NEW_LINE>antlrTool.error("cannot ref character range in grammar: " + r);<NEW_LINE>if (r.getLabel() != null && syntacticPredLevel == 0) {<NEW_LINE>println(r.getLabel() + " = " + lt1Value + ";");<NEW_LINE>}<NEW_LINE>// Correctly take care of saveIndex stuff...<NEW_LINE>boolean save = (grammar instanceof LexerGrammar && (!saveText || r.getAutoGenType() == GrammarElement.AUTO_GEN_BANG));<NEW_LINE>if (save)<NEW_LINE>println("_saveIndex=text.length();");<NEW_LINE>println("matchRange(" + convertJavaToCppString(r.beginText, true) + "," + convertJavaToCppString(r.endText, true) + ");");<NEW_LINE>if (save)<NEW_LINE>println("text.erase(_saveIndex);");<NEW_LINE>} | ".." + r.endText + ")"); |
324,149 | public void marshall(CreateReplicationTaskRequest createReplicationTaskRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createReplicationTaskRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getReplicationTaskIdentifier(), REPLICATIONTASKIDENTIFIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getSourceEndpointArn(), SOURCEENDPOINTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getTargetEndpointArn(), TARGETENDPOINTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getReplicationInstanceArn(), REPLICATIONINSTANCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getTableMappings(), TABLEMAPPINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getReplicationTaskSettings(), REPLICATIONTASKSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getCdcStartTime(), CDCSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getCdcStartPosition(), CDCSTARTPOSITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getCdcStopPosition(), CDCSTOPPOSITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getTaskData(), TASKDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(createReplicationTaskRequest.getResourceIdentifier(), RESOURCEIDENTIFIER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createReplicationTaskRequest.getMigrationType(), MIGRATIONTYPE_BINDING); |
79,383 | final DeleteConnectClientAddInResult executeDeleteConnectClientAddIn(DeleteConnectClientAddInRequest deleteConnectClientAddInRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConnectClientAddInRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConnectClientAddInRequest> request = null;<NEW_LINE>Response<DeleteConnectClientAddInResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConnectClientAddInRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConnectClientAddInRequest));<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, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConnectClientAddIn");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteConnectClientAddInResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConnectClientAddInResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,424,461 | private void createBodyFiles(ApiTest test, List<String> bodyUploadIds, List<MultipartFile> bodyFiles) {<NEW_LINE>if (bodyUploadIds.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String dir = BODY_FILE_DIR + "/" + test.getId();<NEW_LINE><MASK><NEW_LINE>if (!testDir.exists()) {<NEW_LINE>testDir.mkdirs();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bodyUploadIds.size(); i++) {<NEW_LINE>MultipartFile item = bodyFiles.get(i);<NEW_LINE>File file = new File(testDir + "/" + bodyUploadIds.get(i) + "_" + item.getOriginalFilename());<NEW_LINE>try (InputStream in = item.getInputStream();<NEW_LINE>OutputStream out = new FileOutputStream(file)) {<NEW_LINE>file.createNewFile();<NEW_LINE>FileUtil.copyStream(in, out);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LogUtil.error(e.getMessage(), e);<NEW_LINE>MSException.throwException(Translator.get("upload_fail"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | File testDir = new File(dir); |
1,472,703 | public synchronized void createSentDirectMessage(DirectMessageEvent status, User recipient, AppSettings settings, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>long time = status.getCreatedTimestamp().getTime();<NEW_LINE>String[] html = TweetLinkUtils.getLinksInStatus(status);<NEW_LINE>String text = html[0];<NEW_LINE>String media = html[1];<NEW_LINE>String url = html[2];<NEW_LINE>String hashtags = html[3];<NEW_LINE>String users = html[4];<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_TEXT, text);<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_TWEET_ID, status.getId());<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_NAME, settings.myName);<NEW_LINE>values.put(<MASK><NEW_LINE>values.put(DMSQLiteHelper.COLUMN_SCREEN_NAME, settings.myScreenName);<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_TIME, time);<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_RETWEETER, recipient.getScreenName());<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_EXTRA_ONE, recipient.getOriginalProfileImageURL());<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_EXTRA_TWO, recipient.getName());<NEW_LINE>values.put(HomeSQLiteHelper.COLUMN_PIC_URL, media);<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_EXTRA_THREE, TweetLinkUtils.getGIFUrl(status.getMediaEntities(), url));<NEW_LINE>MediaEntity[] entities = status.getMediaEntities();<NEW_LINE>if (entities.length > 0) {<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_PIC_URL, entities[0].getMediaURL());<NEW_LINE>}<NEW_LINE>URLEntity[] urls = status.getUrlEntities();<NEW_LINE>for (URLEntity u : urls) {<NEW_LINE>Log.v("inserting_dm", "url here: " + u.getExpandedURL());<NEW_LINE>values.put(DMSQLiteHelper.COLUMN_URL, u.getExpandedURL());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>database.insert(DMSQLiteHelper.TABLE_DM, null, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>open();<NEW_LINE>database.insert(DMSQLiteHelper.TABLE_DM, null, values);<NEW_LINE>}<NEW_LINE>} | DMSQLiteHelper.COLUMN_PRO_PIC, settings.myProfilePicUrl); |
639,466 | // https://stackoverflow.com/questions/3035692/how-to-convert-a-drawable-to-a-bitmap<NEW_LINE>public static Bitmap drawableToBitmap(@NonNull Drawable drawable) {<NEW_LINE>Bitmap bitmap;<NEW_LINE>if (drawable instanceof BitmapDrawable) {<NEW_LINE>BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;<NEW_LINE>if (bitmapDrawable.getBitmap() != null) {<NEW_LINE>return bitmapDrawable.getBitmap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {<NEW_LINE>// Single color bitmap will be created of 1x1 pixel<NEW_LINE>bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);<NEW_LINE>} else {<NEW_LINE>bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);<NEW_LINE>}<NEW_LINE>Canvas canvas = new Canvas(bitmap);<NEW_LINE>drawable.setBounds(0, 0, canvas.getWidth(<MASK><NEW_LINE>drawable.draw(canvas);<NEW_LINE>return bitmap;<NEW_LINE>} | ), canvas.getHeight()); |
434,828 | private Mono<Response<NatGatewayInner>> updateTagsWithResponseAsync(String resourceGroupName, String natGatewayName, TagsObject parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (natGatewayName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.updateTags(this.client.getEndpoint(), resourceGroupName, natGatewayName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter natGatewayName is required and cannot be null.")); |
692,346 | AsyncTimer startAsyncTimer(TimerName asyncTimerName, long startTick) {<NEW_LINE>AsyncTimer asyncTimer = new AsyncTimer((TimerNameImpl) asyncTimerName, startTick);<NEW_LINE>synchronized (asyncTimerLock) {<NEW_LINE>if (asyncTimers == null) {<NEW_LINE>asyncTimers = Lists.newArrayList();<NEW_LINE>}<NEW_LINE>if (asyncTimers.size() >= 1000) {<NEW_LINE>// this is just to conserve memory<NEW_LINE>if (alreadyMergedAsyncTimers == null) {<NEW_LINE>alreadyMergedAsyncTimers = Maps.newHashMap();<NEW_LINE>}<NEW_LINE>List<AsyncTimer<MASK><NEW_LINE>for (AsyncTimer loopAsyncTimer : asyncTimers) {<NEW_LINE>if (loopAsyncTimer.active()) {<NEW_LINE>activeAsyncTimers.add(loopAsyncTimer);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MergedAsyncTimer aggregateAsyncTimer = alreadyMergedAsyncTimers.get(loopAsyncTimer.getName());<NEW_LINE>if (aggregateAsyncTimer == null) {<NEW_LINE>aggregateAsyncTimer = new MergedAsyncTimer(loopAsyncTimer.getName());<NEW_LINE>alreadyMergedAsyncTimers.put(loopAsyncTimer.getName(), aggregateAsyncTimer);<NEW_LINE>}<NEW_LINE>aggregateAsyncTimer.totalNanos += loopAsyncTimer.getTotalNanos();<NEW_LINE>aggregateAsyncTimer.count += loopAsyncTimer.getCount();<NEW_LINE>}<NEW_LINE>asyncTimers = activeAsyncTimers;<NEW_LINE>}<NEW_LINE>asyncTimers.add(asyncTimer);<NEW_LINE>}<NEW_LINE>return asyncTimer;<NEW_LINE>} | > activeAsyncTimers = Lists.newArrayList(); |
315,392 | private boolean score(SysSite site, long userId, String itemType, long itemId, boolean score) {<NEW_LINE>if (CommonUtils.notEmpty(itemType)) {<NEW_LINE>CmsUserScoreId id = new <MASK><NEW_LINE>CmsUserScore entity = service.getEntity(id);<NEW_LINE>if (score) {<NEW_LINE>if (null == entity) {<NEW_LINE>if ("content".equals(itemType)) {<NEW_LINE>CmsContentStatistics contentStatistics = statisticsComponent.contentScores(site, itemId);<NEW_LINE>if (null != contentStatistics && site.getId().equals(contentStatistics.getSiteId())) {<NEW_LINE>entity = new CmsUserScore();<NEW_LINE>entity.setId(id);<NEW_LINE>service.save(entity);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (null != entity) {<NEW_LINE>if ("content".equals(itemType)) {<NEW_LINE>CmsContentStatistics contentStatistics = statisticsComponent.contentScores(site, itemId, false);<NEW_LINE>if (null != contentStatistics && site.getId().equals(contentStatistics.getSiteId())) {<NEW_LINE>service.delete(id);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | CmsUserScoreId(userId, itemType, itemId); |
134,987 | private List<Wo> list(Business business, Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>List<Identity> os = business.identity().pick(wi.getIdentityList());<NEW_LINE>List<String> <MASK><NEW_LINE>for (Identity identity : os) {<NEW_LINE>groupIds.addAll(business.group().listSupDirectWithIdentity(identity.getId()));<NEW_LINE>if (BooleanUtils.isTrue(wi.getReferenceFlag())) {<NEW_LINE>groupIds.addAll(business.group().listSupDirectWithUnit(identity.getUnit()));<NEW_LINE>if (BooleanUtils.isTrue(wi.getRecursiveOrgFlag())) {<NEW_LINE>List<String> orgIds = business.unit().listSupNested(identity.getUnit());<NEW_LINE>for (String orgId : orgIds) {<NEW_LINE>groupIds.addAll(business.group().listSupDirectWithUnit(orgId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>groupIds = ListTools.trim(groupIds, true, true);<NEW_LINE>List<String> groupIds2 = new ArrayList<>();<NEW_LINE>groupIds2.addAll(groupIds);<NEW_LINE>if (!BooleanUtils.isFalse(wi.getRecursiveGroupFlag())) {<NEW_LINE>for (String groupId : groupIds) {<NEW_LINE>groupIds2.addAll(business.group().listSupNested(groupId));<NEW_LINE>}<NEW_LINE>groupIds2 = ListTools.trim(groupIds2, true, true);<NEW_LINE>}<NEW_LINE>List<Group> list = business.group().pick(groupIds2);<NEW_LINE>list = business.group().sort(list);<NEW_LINE>for (Group o : list) {<NEW_LINE>wos.add(this.convert(business, o, Wo.class));<NEW_LINE>}<NEW_LINE>return wos;<NEW_LINE>} | groupIds = new ArrayList<>(); |
1,038,654 | public List<Environment> listEnvironments(String status) throws SubmarineRuntimeException {<NEW_LINE>List<Environment> environmentList = new ArrayList<Environment>(cachedEnvironments.values());<NEW_LINE>// Is it available in cache?<NEW_LINE>if (readedDB) {<NEW_LINE>try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {<NEW_LINE>EnvironmentMapper environmentMapper = sqlSession.getMapper(EnvironmentMapper.class);<NEW_LINE>List<EnvironmentEntity> environmentEntities = environmentMapper.selectAll();<NEW_LINE>for (EnvironmentEntity environmentEntity : environmentEntities) {<NEW_LINE>if (environmentEntity != null) {<NEW_LINE>Environment env = new Environment();<NEW_LINE>env.setEnvironmentSpec(new Gson().fromJson(environmentEntity.getEnvironmentSpec(), EnvironmentSpec.class));<NEW_LINE>env.setEnvironmentId(EnvironmentId.fromString(environmentEntity.getId()));<NEW_LINE>environmentList.add(env);<NEW_LINE>cachedEnvironments.put(env.getEnvironmentSpec().getName(), env);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>throw new SubmarineRuntimeException(Status.BAD_REQUEST.getStatusCode(), "Unable to get the environment list.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>readedDB = false;<NEW_LINE>return environmentList;<NEW_LINE>} | e.getMessage(), e); |
1,397,282 | private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException, IOException, URISyntaxException {<NEW_LINE>List<Class> classes = new ArrayList<>();<NEW_LINE>if (!directory.exists()) {<NEW_LINE>// maybe we are running from a jar file, so try that<NEW_LINE>File thisJarFile = new File(SpecificProfileFactory.class.getProtectionDomain().getCodeSource().<MASK><NEW_LINE>if (thisJarFile.exists()) {<NEW_LINE>List<Class> classNames = new ArrayList<>();<NEW_LINE>try (ZipInputStream zip = new ZipInputStream(new FileInputStream(thisJarFile.getPath()))) {<NEW_LINE>for (ZipEntry entry = zip.getNextEntry(); entry != null; entry = zip.getNextEntry()) if (entry.getName().endsWith(".class") && !entry.isDirectory()) {<NEW_LINE>// This ZipEntry represents a class. Now, what class does it represent?<NEW_LINE>StringBuilder className = new StringBuilder();<NEW_LINE>for (String part : entry.getName().split("/")) {<NEW_LINE>if (className.length() != 0)<NEW_LINE>className.append(".");<NEW_LINE>className.append(part);<NEW_LINE>if (part.endsWith(".class"))<NEW_LINE>className.setLength(className.length() - ".class".length());<NEW_LINE>}<NEW_LINE>if (className.toString().contains(packageName)) {<NEW_LINE>classNames.add(Class.forName(className.toString()));<NEW_LINE>}<NEW_LINE>zip.closeEntry();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classNames;<NEW_LINE>} else<NEW_LINE>return classes;<NEW_LINE>}<NEW_LINE>File[] files = directory.listFiles();<NEW_LINE>for (File file : files) {<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>assert !file.getName().contains(".");<NEW_LINE>classes.addAll(findClasses(file, packageName + "." + file.getName()));<NEW_LINE>} else if (file.getName().endsWith(".class")) {<NEW_LINE>classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>} | getLocation().toURI()); |
934,530 | protected void addEventRegistryProperties(FlowElement flowElement, ObjectNode propertiesNode) {<NEW_LINE>String eventType = getExtensionValue("eventType", flowElement);<NEW_LINE>if (StringUtils.isNotEmpty(eventType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_EVENT_KEY, eventType, propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_EVENT_NAME, getExtensionValue("eventName", flowElement), propertiesNode);<NEW_LINE>addEventOutParameters(flowElement.getExtensionElements().get("eventOutParameter"), propertiesNode);<NEW_LINE>addEventCorrelationParameters(flowElement.getExtensionElements().get("eventCorrelationParameter"), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_KEY, getExtensionValue("channelKey", flowElement), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_NAME, getExtensionValue("channelName", flowElement), propertiesNode);<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_TYPE, getExtensionValue<MASK><NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_CHANNEL_DESTINATION, getExtensionValue("channelDestination", flowElement), propertiesNode);<NEW_LINE>String keyDetectionType = getExtensionValue("keyDetectionType", flowElement);<NEW_LINE>String keyDetectionValue = getExtensionValue("keyDetectionValue", flowElement);<NEW_LINE>if (StringUtils.isNotEmpty(keyDetectionType) && StringUtils.isNotEmpty(keyDetectionValue)) {<NEW_LINE>if ("fixedValue".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_FIXED_VALUE, keyDetectionValue, propertiesNode);<NEW_LINE>} else if ("jsonField".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_JSON_FIELD, keyDetectionValue, propertiesNode);<NEW_LINE>} else if ("jsonPointer".equalsIgnoreCase(keyDetectionType)) {<NEW_LINE>setPropertyValue(PROPERTY_EVENT_REGISTRY_KEY_DETECTION_JSON_POINTER, keyDetectionValue, propertiesNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("channelType", flowElement), propertiesNode); |
1,107,789 | public void activate(BundleContext context) {<NEW_LINE>super.activate(context);<NEW_LINE>logger.info("Loading eclim plugins...");<NEW_LINE>String pluginsDir = System.getProperty("eclim.home") + File.separator + ".." + File.separator;<NEW_LINE>String[] pluginDirs = new File(pluginsDir).list(new FilenameFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>if (name.startsWith("org.eclim.") && name.indexOf("core") == -1 && name.indexOf("installer") == -1) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>plugins = new String[pluginDirs.length];<NEW_LINE>for (int ii = 0; ii < pluginDirs.length; ii++) {<NEW_LINE>plugins[ii] = pluginDirs[ii].substring(0, pluginDirs[ii].lastIndexOf('_'));<NEW_LINE>}<NEW_LINE>for (String plugin : plugins) {<NEW_LINE>logger.info("Loading plugin " + plugin);<NEW_LINE>Bundle bundle = Platform.getBundle(plugin);<NEW_LINE>if (bundle == null) {<NEW_LINE>String message = Services.getMessage("plugin.load.failed", plugin);<NEW_LINE>logger.error(message);<NEW_LINE>// throw new RuntimeException(message);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (BundleException be) {<NEW_LINE>logger.error("Failed to load plugin: " + bundle.getSymbolicName(), be);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_BUILD);<NEW_LINE>logger.info("Plugins loaded.");<NEW_LINE>EclimDaemon.getInstance().frameworkEvent(new FrameworkEvent(FrameworkEvent.INFO, getBundle(), null));<NEW_LINE>} | bundle.start(Bundle.START_TRANSIENT); |
494,162 | final AcceptDomainTransferFromAnotherAwsAccountResult executeAcceptDomainTransferFromAnotherAwsAccount(AcceptDomainTransferFromAnotherAwsAccountRequest acceptDomainTransferFromAnotherAwsAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptDomainTransferFromAnotherAwsAccountRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptDomainTransferFromAnotherAwsAccountRequest> request = null;<NEW_LINE>Response<AcceptDomainTransferFromAnotherAwsAccountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptDomainTransferFromAnotherAwsAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(acceptDomainTransferFromAnotherAwsAccountRequest));<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, "Route 53 Domains");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptDomainTransferFromAnotherAwsAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AcceptDomainTransferFromAnotherAwsAccountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptDomainTransferFromAnotherAwsAccountResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
457,328 | private static List<String> browseAlertTable() {<NEW_LINE>List<String> alerts = new ArrayList();<NEW_LINE>try {<NEW_LINE>// Initialize client that will be used to send requests<NEW_LINE>BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();<NEW_LINE>QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder("SELECT metric, usage, consumption " + "FROM `" + HOME_PROJECT + "." + DATASET + "." + TABLE + "` ").setUseLegacySql(false).build();<NEW_LINE>// Create a job ID so that we can safely retry.<NEW_LINE>JobId jobId = JobId.of(UUID.randomUUID().toString());<NEW_LINE>Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).setJobId(jobId).build());<NEW_LINE>// Wait for the query to complete.<NEW_LINE>queryJob = queryJob.waitFor();<NEW_LINE>// Check for errors<NEW_LINE>if (queryJob == null) {<NEW_LINE>throw new RuntimeException("Job no longer exists");<NEW_LINE>} else if (queryJob.getStatus().getError() != null) {<NEW_LINE>throw new RuntimeException(queryJob.getStatus().<MASK><NEW_LINE>}<NEW_LINE>// Identify the table itself<NEW_LINE>TableResult result = queryJob.getQueryResults();<NEW_LINE>// Get all pages of the results.<NEW_LINE>for (FieldValueList row : result.iterateAll()) {<NEW_LINE>// Get all values<NEW_LINE>String metric = row.get("metric").getStringValue();<NEW_LINE>String usage = row.get("usage").getStringValue();<NEW_LINE>Float consumption = row.get("consumption").getNumericValue().floatValue();<NEW_LINE>alerts.add(String.format("Metric name: %s usage: %s consumption: %.2f%s", metric, usage, consumption, "%"));<NEW_LINE>logger.info("Alert : Metric " + metric + ": Usage " + usage + ": Consumption " + consumption + "%");<NEW_LINE>}<NEW_LINE>logger.info("Query ran successfully ");<NEW_LINE>} catch (BigQueryException | InterruptedException e) {<NEW_LINE>logger.severe("Query failed to run \n" + e.toString());<NEW_LINE>}<NEW_LINE>return alerts;<NEW_LINE>} | getError().toString()); |
48,074 | private static // F743-506<NEW_LINE>Class<?> loadCustomerProvidedBeanClass(BeanMetaData bmd) throws ContainerException, EJBConfigurationException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "loadCustomerProvidedBeanClass : " + bmd.enterpriseBeanClassName);<NEW_LINE>// enterpriseBeanClass will be null only if loadCustomerProvidedBeanClass<NEW_LINE>// is called prior to loadCustomerProvidedClasses. For example, from<NEW_LINE>// processAutomaticTimerMetaData via processBean if deferred init.<NEW_LINE>if (bmd.enterpriseBeanClass == null) {<NEW_LINE>try {<NEW_LINE>bmd.enterpriseBeanClass = bmd.classLoader.loadClass(bmd.enterpriseBeanClassName);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".loadCustomerProvidedBeanClass", "6369");<NEW_LINE>Tr.error(tc, "BEANCLASS_NOT_FOUND_CNTR0075E", bmd.enterpriseBeanClassName);<NEW_LINE>String message = "Bean class " + bmd.enterpriseBeanClassName + " could not be found or loaded";<NEW_LINE>if (ex instanceof ClassNotFoundException || ex instanceof LinkageError)<NEW_LINE><MASK><NEW_LINE>throw new ContainerException(message, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "loadCustomerProvidedBeanClass");<NEW_LINE>return bmd.enterpriseBeanClass;<NEW_LINE>} | throw new EJBConfigurationException(message, ex); |
1,828,446 | private byte[] addressToBytes(String address) {<NEW_LINE>Matcher ipv4Matcher = IPv4_PATTERN.matcher(address);<NEW_LINE>if (ipv4Matcher.matches()) {<NEW_LINE>byte[] result = new byte[4];<NEW_LINE>for (int i = 0; i < result.length; ++i) {<NEW_LINE>result[i] = Integer.valueOf(ipv4Matcher.group(i + 1)).byteValue();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>Matcher ipv6Matcher = IPv6_PATTERN.matcher(address);<NEW_LINE>if (ipv6Matcher.matches()) {<NEW_LINE>byte[] result = new byte[16];<NEW_LINE>for (int i = 0; i < result.length; i += 2) {<NEW_LINE>int word = Integer.parseInt(ipv6Matcher.group(i <MASK><NEW_LINE>result[i] = (byte) ((word & 0xFF00) >>> 8);<NEW_LINE>result[i + 1] = (byte) (word & 0xFF);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | / 2 + 1), 16); |
1,094,064 | public void afterConnectionEstablished(WebSocketSession session) {<NEW_LINE>if ("graphql-ws".equalsIgnoreCase(session.getAcceptedProtocol())) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("apollographql/subscriptions-transport-ws is not supported, nor maintained. " + "Please, use https://github.com/enisdenjo/graphql-ws.");<NEW_LINE>}<NEW_LINE>GraphQlStatus.closeSession(session, GraphQlStatus.INVALID_MESSAGE_STATUS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SessionState sessionState = new SessionState(session.getId(<MASK><NEW_LINE>this.sessionInfoMap.put(session.getId(), sessionState);<NEW_LINE>Mono.delay(this.initTimeoutDuration).then(Mono.fromRunnable(() -> {<NEW_LINE>if (sessionState.setConnectionInitPayload(Collections.emptyMap())) {<NEW_LINE>GraphQlStatus.closeSession(session, GraphQlStatus.INIT_TIMEOUT_STATUS);<NEW_LINE>}<NEW_LINE>})).subscribe();<NEW_LINE>} | ), new WebMvcSessionInfo(session)); |
1,794,950 | protected void rdataFromString(Tokenizer st, Name origin) throws IOException {<NEW_LINE>elements = new ArrayList<>(1);<NEW_LINE>while (true) {<NEW_LINE>Tokenizer.Token t = st.get();<NEW_LINE>if (!t.isString()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>boolean negative = false;<NEW_LINE>int family;<NEW_LINE>int prefix;<NEW_LINE>String s = t.value;<NEW_LINE>int start = 0;<NEW_LINE>if (s.startsWith("!")) {<NEW_LINE>negative = true;<NEW_LINE>start = 1;<NEW_LINE>}<NEW_LINE>int colon = s.indexOf(':', start);<NEW_LINE>if (colon < 0) {<NEW_LINE>throw st.exception("invalid address prefix element");<NEW_LINE>}<NEW_LINE>int slash = s.indexOf('/', colon);<NEW_LINE>if (slash < 0) {<NEW_LINE>throw st.exception("invalid address prefix element");<NEW_LINE>}<NEW_LINE>String familyString = s.substring(start, colon);<NEW_LINE>String addressString = s.substring(colon + 1, slash);<NEW_LINE>String prefixString = s.substring(slash + 1);<NEW_LINE>try {<NEW_LINE>family = Integer.parseInt(familyString);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw st.exception("invalid family");<NEW_LINE>}<NEW_LINE>if (family != Address.IPv4 && family != Address.IPv6) {<NEW_LINE>throw st.exception("unknown family");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw st.exception("invalid prefix length");<NEW_LINE>}<NEW_LINE>if (!validatePrefixLength(family, prefix)) {<NEW_LINE>throw st.exception("invalid prefix length");<NEW_LINE>}<NEW_LINE>byte[] bytes = Address.toByteArray(addressString, family);<NEW_LINE>if (bytes == null) {<NEW_LINE>throw st.exception("invalid IP address " + addressString);<NEW_LINE>}<NEW_LINE>InetAddress address = InetAddress.getByAddress(bytes);<NEW_LINE>elements.add(new Element(negative, address, prefix));<NEW_LINE>}<NEW_LINE>st.unget();<NEW_LINE>} | prefix = Integer.parseInt(prefixString); |
374,550 | public void andNot(final ImmutableRoaringBitmap x2) {<NEW_LINE>int pos1 = 0, pos2 = 0, intersectionSize = 0;<NEW_LINE>final int length1 = highLowContainer.size(), length2 = x2.highLowContainer.size();<NEW_LINE>while (pos1 < length1 && pos2 < length2) {<NEW_LINE>final char s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>final char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>if (s1 == s2) {<NEW_LINE>final MappeableContainer c1 = highLowContainer.getContainerAtIndex(pos1);<NEW_LINE>final MappeableContainer c2 = x2.highLowContainer.getContainerAtIndex(pos2);<NEW_LINE>final MappeableContainer c = c1.iandNot(c2);<NEW_LINE>if (!c.isEmpty()) {<NEW_LINE>getMappeableRoaringArray().replaceKeyAndContainerAtIndex(intersectionSize++, s1, c);<NEW_LINE>}<NEW_LINE>++pos1;<NEW_LINE>++pos2;<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>if (pos1 != intersectionSize) {<NEW_LINE>final MappeableContainer c1 = highLowContainer.getContainerAtIndex(pos1);<NEW_LINE>getMappeableRoaringArray().replaceKeyAndContainerAtIndex(intersectionSize, s1, c1);<NEW_LINE>}<NEW_LINE>++intersectionSize;<NEW_LINE>++pos1;<NEW_LINE>} else {<NEW_LINE>// s1 > s2<NEW_LINE>pos2 = x2.highLowContainer.advanceUntil(s1, pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos1 < length1) {<NEW_LINE>getMappeableRoaringArray().<MASK><NEW_LINE>intersectionSize += length1 - pos1;<NEW_LINE>}<NEW_LINE>getMappeableRoaringArray().resize(intersectionSize);<NEW_LINE>} | copyRange(pos1, length1, intersectionSize); |
1,200,005 | public static void writeFastqStream(final OutputStream writer, final Iterator<FastqRead> fastqReadItr) throws IOException {<NEW_LINE>int index = 0;<NEW_LINE>while (fastqReadItr.hasNext()) {<NEW_LINE>final FastqRead read = fastqReadItr.next();<NEW_LINE>final String header = read.getHeader();<NEW_LINE>if (header.contains(" ")) {<NEW_LINE>throw new IllegalStateException("Blank found: " + header);<NEW_LINE>}<NEW_LINE>if (header == null)<NEW_LINE>writer.write(Integer.toString(<MASK><NEW_LINE>else<NEW_LINE>writer.write(header.getBytes());<NEW_LINE>writer.write('\n');<NEW_LINE>writer.write(read.getBases());<NEW_LINE>writer.write('\n');<NEW_LINE>writer.write(SVFastqUtils.LINE_SEPARATOR_CHR);<NEW_LINE>writer.write('\n');<NEW_LINE>final byte[] quals = read.getQuals();<NEW_LINE>final int nQuals = quals.length;<NEW_LINE>final byte[] fastqQuals = new byte[nQuals];<NEW_LINE>for (int idx = 0; idx != nQuals; ++idx) {<NEW_LINE>fastqQuals[idx] = (byte) SAMUtils.phredToFastq(quals[idx]);<NEW_LINE>}<NEW_LINE>writer.write(fastqQuals);<NEW_LINE>writer.write('\n');<NEW_LINE>}<NEW_LINE>} | ++index).getBytes()); |
407,364 | private void cacheAutoDetectedFileType(@Nonnull VirtualFile file, @Nonnull FileType fileType) {<NEW_LINE><MASK><NEW_LINE>boolean wasAutodetectedAsBinary = fileType == UnknownFileType.INSTANCE;<NEW_LINE>int flags = BitUtil.set(0, AUTO_DETECTED_AS_TEXT_MASK, wasAutodetectedAsText);<NEW_LINE>flags = BitUtil.set(flags, AUTO_DETECTED_AS_BINARY_MASK, wasAutodetectedAsBinary);<NEW_LINE>writeFlagsToCache(file, flags);<NEW_LINE>if (file instanceof VirtualFileWithId) {<NEW_LINE>int id = ((VirtualFileWithId) file).getId();<NEW_LINE>flags = BitUtil.set(flags, AUTO_DETECT_WAS_RUN_MASK, true);<NEW_LINE>flags = BitUtil.set(flags, ATTRIBUTES_WERE_LOADED_MASK, true);<NEW_LINE>packedFlags.set(id, flags);<NEW_LINE>if (wasAutodetectedAsText || wasAutodetectedAsBinary) {<NEW_LINE>file.putUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY, null);<NEW_LINE>if (toLog()) {<NEW_LINE>log("F: cacheAutoDetectedFileType(" + file.getName() + ") " + "cached to " + fileType.getName() + " flags = " + readableFlags(flags) + "; getUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY): " + file.getUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>file.putUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY, fileType);<NEW_LINE>if (toLog()) {<NEW_LINE>log("F: cacheAutoDetectedFileType(" + file.getName() + ") " + "cached to " + fileType.getName() + " flags = " + readableFlags(flags) + "; getUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY): " + file.getUserData(DETECTED_FROM_CONTENT_FILE_TYPE_KEY));<NEW_LINE>}<NEW_LINE>} | boolean wasAutodetectedAsText = fileType == PlainTextFileType.INSTANCE; |
1,236,149 | private List<I_M_HU> retrieveVHUsFromStorage(@NonNull final List<I_M_ShipmentSchedule> shipmentSchedules, final boolean considerAttributes, final boolean isExcludeAllReserved) {<NEW_LINE>//<NEW_LINE>// Create storage queries from shipment schedules<NEW_LINE>final IShipmentScheduleBL shipmentScheduleBL = <MASK><NEW_LINE>final Set<IStorageQuery> storageQueries = new HashSet<>();<NEW_LINE>for (final I_M_ShipmentSchedule shipmentSchedule : shipmentSchedules) {<NEW_LINE>final IStorageQuery storageQuery = shipmentScheduleBL.createStorageQuery(shipmentSchedule, considerAttributes, isExcludeAllReserved);<NEW_LINE>storageQueries.add(storageQuery);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Retrieve Storage records<NEW_LINE>final IStorageEngineService storageEngineProvider = Services.get(IStorageEngineService.class);<NEW_LINE>final IStorageEngine storageEngine = storageEngineProvider.getStorageEngine();<NEW_LINE>final IContextAware context = PlainContextAware.createUsingOutOfTransaction();<NEW_LINE>final Collection<IStorageRecord> storageRecords = storageEngine.retrieveStorageRecords(context, storageQueries);<NEW_LINE>//<NEW_LINE>// Fetch VHUs from storage records<NEW_LINE>final List<I_M_HU> vhus = new ArrayList<>();<NEW_LINE>for (final IStorageRecord storageRecord : storageRecords) {<NEW_LINE>addToVhusIfValid(storageRecord, vhus);<NEW_LINE>}<NEW_LINE>return vhus;<NEW_LINE>} | Services.get(IShipmentScheduleBL.class); |
929,454 | public String createFor(PlayerContainer player) {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>UUID playerUUID = player.getUnsafe(PlayerKeys.UUID);<NEW_LINE>PlaceholderReplacer placeholders = new PlaceholderReplacer();<NEW_LINE>placeholders.put("refresh", clockLongFormatter.apply(now));<NEW_LINE>placeholders.put("refreshFull", secondLongFormatter.apply(now));<NEW_LINE>placeholders.put("versionButton", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));<NEW_LINE>placeholders.put("version", versionChecker.getCurrentVersion());<NEW_LINE>placeholders.put("updateModal", versionChecker.getUpdateModal());<NEW_LINE>String playerName = player.getValue(PlayerKeys.NAME).orElse(playerUUID.toString());<NEW_LINE>placeholders.put("playerName", playerName);<NEW_LINE>placeholders.put("playerUUID", playerUUID);<NEW_LINE>placeholders.put("playerHeadUrl", config.get(DisplaySettings.PLAYER_HEAD_IMG_URL));<NEW_LINE>placeholders.put("timeZone", config.getTimeZoneOffsetHours());<NEW_LINE>placeholders.put("gmPieColors", theme.getValue(ThemeVal.GRAPH_GM_PIE));<NEW_LINE>placeholders.put(<MASK><NEW_LINE>PlaceholderReplacer pluginPlaceholders = new PlaceholderReplacer();<NEW_LINE>PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);<NEW_LINE>pluginPlaceholders.put("playerName", playerName);<NEW_LINE>pluginPlaceholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).create());<NEW_LINE>pluginPlaceholders.put("navPluginsTabs", pluginTabs.getNav());<NEW_LINE>pluginPlaceholders.put("pluginsTabs", pluginTabs.getTab());<NEW_LINE>return UnaryChain.of(templateHtml).chain(theme::replaceThemeColors).chain(placeholders::apply).chain(pluginPlaceholders::apply).chain(locale::replaceLanguageInHtml).apply();<NEW_LINE>} | "contributors", Contributors.generateContributorHtml()); |
674,548 | private static List<Map<GroupKey, SortedMap<Integer, DuplicateCheckRow>>> buildDuplicateCheckers(List<List<Object>> selectedRows, List<List<Integer>> ukMapping, List<List<ColumnMeta>> ukColumnMetas, List<DuplicateCheckRow> outCheckRows, AtomicInteger logicalRowIndex) {<NEW_LINE>selectedRows.forEach(row -> {<NEW_LINE>final DuplicateCheckRow duplicateCheckRow = new DuplicateCheckRow();<NEW_LINE>duplicateCheckRow.keyList = buildGroupKeys(ukMapping, ukColumnMetas, row::get);<NEW_LINE>duplicateCheckRow.before = new ArrayList<>();<NEW_LINE>duplicateCheckRow.after = new ArrayList<>();<NEW_LINE>for (Ord<Object> o : Ord.zip(row)) {<NEW_LINE>duplicateCheckRow.before.add(o.getValue());<NEW_LINE>duplicateCheckRow.after.add(o.getValue());<NEW_LINE>}<NEW_LINE>outCheckRows.add(duplicateCheckRow);<NEW_LINE>});<NEW_LINE>// Order by first uk<NEW_LINE>Collections.sort(outCheckRows);<NEW_LINE>// Set logical row index and build checker map<NEW_LINE>final List<Map<GroupKey, SortedMap<Integer, DuplicateCheckRow>>> ukCheckerMapList = new ArrayList<>(ukMapping.size());<NEW_LINE>IntStream.range(0, ukMapping.size()).forEach(i -> ukCheckerMapList.add(new TreeMap<>()));<NEW_LINE>outCheckRows.forEach(row -> {<NEW_LINE>row<MASK><NEW_LINE>for (int i = 0; i < ukMapping.size(); i++) {<NEW_LINE>ukCheckerMapList.get(i).compute(row.keyList.get(i), (k, v) -> {<NEW_LINE>final SortedMap<Integer, DuplicateCheckRow> checker = Optional.ofNullable(v).orElseGet(TreeMap::new);<NEW_LINE>checker.put(row.rowIndex, row);<NEW_LINE>return checker;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ukCheckerMapList;<NEW_LINE>} | .rowIndex = logicalRowIndex.getAndIncrement(); |
1,240,322 | public com.amazonaws.services.config.model.NoSuchRetentionConfigurationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.config.model.NoSuchRetentionConfigurationException noSuchRetentionConfigurationException = new com.amazonaws.services.config.model.NoSuchRetentionConfigurationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 noSuchRetentionConfigurationException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,157,400 | static void sortIntegerArray(int[] arr) {<NEW_LINE>int i = 0;<NEW_LINE>int n = arr.length;<NEW_LINE>int minElement = Integer.MAX_VALUE;<NEW_LINE>int maxElement = Integer.MIN_VALUE;<NEW_LINE>// Maximum and Minimum element from input array<NEW_LINE>for (i = 0; i < n; i++) {<NEW_LINE>if (arr[i] > maxElement) {<NEW_LINE>maxElement = arr[i];<NEW_LINE>}<NEW_LINE>if (arr[i] < minElement) {<NEW_LINE>minElement = arr[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int range = maxElement - minElement + 1;<NEW_LINE>int[] arrElementCount = new int[range];<NEW_LINE>int[<MASK><NEW_LINE>// count occurance of an element<NEW_LINE>for (i = 0; i < n; i++) {<NEW_LINE>arrElementCount[arr[i] - minElement]++;<NEW_LINE>}<NEW_LINE>// Accumulative sum of elements<NEW_LINE>for (i = 0; i < range - 1; i++) {<NEW_LINE>arrElementCount[i + 1] += arrElementCount[i];<NEW_LINE>}<NEW_LINE>// Shift array by one index<NEW_LINE>int temp = arrElementCount[0];<NEW_LINE>for (i = 1; i < range; i++) {<NEW_LINE>int nextTemp = arrElementCount[i];<NEW_LINE>arrElementCount[i] = temp;<NEW_LINE>temp = nextTemp;<NEW_LINE>}<NEW_LINE>arrElementCount[0] = 0;<NEW_LINE>// store element at right index<NEW_LINE>for (i = 0; i < n; i++) {<NEW_LINE>sortedArray[arrElementCount[arr[i] - minElement]] = arr[i];<NEW_LINE>arrElementCount[arr[i] - minElement]++;<NEW_LINE>}<NEW_LINE>// copy sorted array to input array<NEW_LINE>for (i = 0; i < n; i++) {<NEW_LINE>arr[i] = sortedArray[i];<NEW_LINE>}<NEW_LINE>} | ] sortedArray = new int[n]; |
1,426,768 | private void checkIdlePartition(TopicPartition topicPartition) {<NEW_LINE>Long idlePartitionEventInterval = this.containerProperties.getIdlePartitionEventInterval();<NEW_LINE>if (idlePartitionEventInterval != null) {<NEW_LINE><MASK><NEW_LINE>Long lstReceive = this.lastReceivePartition.computeIfAbsent(topicPartition, newTopicPartition -> now);<NEW_LINE>Long lstAlertAt = this.lastAlertPartition.computeIfAbsent(topicPartition, newTopicPartition -> now);<NEW_LINE>if (now > lstReceive + idlePartitionEventInterval && now > lstAlertAt + idlePartitionEventInterval) {<NEW_LINE>this.wasIdlePartition.put(topicPartition, true);<NEW_LINE>publishIdlePartitionEvent(now - lstReceive, topicPartition, this.consumer, isPartitionPauseRequested(topicPartition));<NEW_LINE>this.lastAlertPartition.put(topicPartition, now);<NEW_LINE>if (this.consumerSeekAwareListener != null) {<NEW_LINE>seekPartitions(Collections.singletonList(topicPartition), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | long now = System.currentTimeMillis(); |
1,760,043 | public static ConnectionProfile buildDefaultConnectionProfile(Settings settings) {<NEW_LINE>int connectionsPerNodeRecovery = TransportSettings.CONNECTIONS_PER_NODE_RECOVERY.get(settings);<NEW_LINE>int connectionsPerNodeBulk = TransportSettings.CONNECTIONS_PER_NODE_BULK.get(settings);<NEW_LINE>int connectionsPerNodeReg = TransportSettings.CONNECTIONS_PER_NODE_REG.get(settings);<NEW_LINE>int connectionsPerNodeState = TransportSettings.CONNECTIONS_PER_NODE_STATE.get(settings);<NEW_LINE>int connectionsPerNodePing = <MASK><NEW_LINE>Builder builder = new Builder();<NEW_LINE>builder.setConnectTimeout(TransportSettings.CONNECT_TIMEOUT.get(settings));<NEW_LINE>builder.setHandshakeTimeout(TransportSettings.CONNECT_TIMEOUT.get(settings));<NEW_LINE>builder.setPingInterval(TransportSettings.PING_SCHEDULE.get(settings));<NEW_LINE>builder.setCompressionEnabled(TransportSettings.TRANSPORT_COMPRESS.get(settings));<NEW_LINE>builder.addConnections(connectionsPerNodeBulk, TransportRequestOptions.Type.BULK);<NEW_LINE>builder.addConnections(connectionsPerNodePing, TransportRequestOptions.Type.PING);<NEW_LINE>// if we are not master eligible we don't need a dedicated channel to publish the state<NEW_LINE>builder.addConnections(DiscoveryNode.isMasterNode(settings) ? connectionsPerNodeState : 0, TransportRequestOptions.Type.STATE);<NEW_LINE>// if we are not a data-node we don't need any dedicated channels for recovery<NEW_LINE>builder.addConnections(DiscoveryNode.isDataNode(settings) ? connectionsPerNodeRecovery : 0, TransportRequestOptions.Type.RECOVERY);<NEW_LINE>builder.addConnections(connectionsPerNodeReg, TransportRequestOptions.Type.REG);<NEW_LINE>return builder.build();<NEW_LINE>} | TransportSettings.CONNECTIONS_PER_NODE_PING.get(settings); |
1,494,090 | private long indexCoverByInPredicate(IndexMeta indexMeta, TableMeta tableMeta, RexNode pred) {<NEW_LINE>if (!pred.isA(SqlKind.IN) || !(pred instanceof RexCall)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>List<ColumnMeta> indexColumnMetaList = indexMeta.getKeyColumns();<NEW_LINE>RexCall filterCall = (RexCall) pred;<NEW_LINE>if (filterCall.getOperands().size() == 2) {<NEW_LINE>RexNode leftRexNode = filterCall.getOperands().get(0);<NEW_LINE>RexNode rightRexNode = filterCall.getOperands().get(1);<NEW_LINE>if (indexColumnMetaList.size() == 1) {<NEW_LINE>if (leftRexNode instanceof RexInputRef && rightRexNode instanceof RexCall && rightRexNode.isA(SqlKind.ROW)) {<NEW_LINE>int leftIndex = ((<MASK><NEW_LINE>if (leftIndex == DrdsRelMdSelectivity.getColumnIndex(tableMeta, indexColumnMetaList.get(0))) {<NEW_LINE>return ((RexCall) rightRexNode).getOperands().size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (leftRexNode instanceof RexCall && leftRexNode.isA(SqlKind.ROW) && rightRexNode instanceof RexCall && leftRexNode.isA(SqlKind.ROW) && indexCoverByInPredicate(indexColumnMetaList, ((RexCall) leftRexNode).getOperands(), tableMeta)) {<NEW_LINE>return ((RexCall) rightRexNode).getOperands().size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | RexInputRef) leftRexNode).getIndex(); |
1,428,318 | protected void editorContextMenuAboutToShow(IMenuManager menu) {<NEW_LINE>// super.editorContextMenuAboutToShow(menu);<NEW_LINE>menu.add(new GroupMarker(GROUP_SQL_ADDITIONS));<NEW_LINE>menu.add(new GroupMarker(GROUP_SQL_EXTRAS));<NEW_LINE>menu.add(new Separator());<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY));<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT));<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND));<NEW_LINE>menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD));<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));<NEW_LINE>menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));<NEW_LINE>menu.add(new Separator(ITextEditorActionConstants.GROUP_REST));<NEW_LINE>menu.add(new Separator());<NEW_LINE>menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));<NEW_LINE>menu.add(new Separator());<NEW_LINE>menu.add(new GroupMarker(GROUP_SQL_PREFERENCES));<NEW_LINE>if (isEditable()) {<NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO);<NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE);<NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT);<NEW_LINE>addAction(menu, <MASK><NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE);<NEW_LINE>IAction action = getAction(ITextEditorActionConstants.QUICK_ASSIST);<NEW_LINE>if (action != null && action.isEnabled()) {<NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.QUICK_ASSIST);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);<NEW_LINE>}<NEW_LINE>IAction preferencesAction = getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES);<NEW_LINE>if (preferencesAction != null) {<NEW_LINE>menu.appendToGroup(GROUP_SQL_PREFERENCES, preferencesAction);<NEW_LINE>}<NEW_LINE>for (IActionContributor ac : actionContributors) {<NEW_LINE>ac.contributeActions(menu);<NEW_LINE>}<NEW_LINE>} | ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY); |
1,081,304 | public void clusterChanged(ClusterChangedEvent event) {<NEW_LINE>if (event.localNodeMaster() && refreshAndRescheduleRunnable.get() == null) {<NEW_LINE>LOGGER.trace("elected as master, scheduling cluster info update tasks");<NEW_LINE>executeRefresh(event.state(), "became master");<NEW_LINE>final RefreshAndRescheduleRunnable newRunnable = new RefreshAndRescheduleRunnable();<NEW_LINE>refreshAndRescheduleRunnable.set(newRunnable);<NEW_LINE>threadPool.scheduleUnlessShuttingDown(updateFrequency, REFRESH_EXECUTOR, newRunnable);<NEW_LINE>} else if (event.localNodeMaster() == false) {<NEW_LINE>refreshAndRescheduleRunnable.set(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enabled == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Refresh if a data node was added<NEW_LINE>for (DiscoveryNode addedNode : event.nodesDelta().addedNodes()) {<NEW_LINE>if (addedNode.isDataNode()) {<NEW_LINE>executeRefresh(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clean up info for any removed nodes<NEW_LINE>for (DiscoveryNode removedNode : event.nodesDelta().removedNodes()) {<NEW_LINE>if (removedNode.isDataNode()) {<NEW_LINE>LOGGER.trace("Removing node from cluster info: {}", removedNode.getId());<NEW_LINE>if (leastAvailableSpaceUsages.containsKey(removedNode.getId())) {<NEW_LINE>ImmutableOpenMap.Builder<String, DiskUsage> newMaxUsages = ImmutableOpenMap.builder(leastAvailableSpaceUsages);<NEW_LINE>newMaxUsages.remove(removedNode.getId());<NEW_LINE>leastAvailableSpaceUsages = newMaxUsages.build();<NEW_LINE>}<NEW_LINE>if (mostAvailableSpaceUsages.containsKey(removedNode.getId())) {<NEW_LINE>ImmutableOpenMap.Builder<String, DiskUsage> newMinUsages = ImmutableOpenMap.builder(mostAvailableSpaceUsages);<NEW_LINE>newMinUsages.remove(removedNode.getId());<NEW_LINE>mostAvailableSpaceUsages = newMinUsages.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | event.state(), "data node added"); |
1,432,969 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(getLayoutResource());<NEW_LINE>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);<NEW_LINE>if (Build.VERSION.SDK_INT >= 21) {<NEW_LINE>getWindow().setNavigationBarColor(ContextCompat.getColor(this<MASK><NEW_LINE>getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.black));<NEW_LINE>}<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>FragmentManager fm = getSupportFragmentManager();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>getWindow().setEnterTransition(constructTransitions());<NEW_LINE>getWindow().setReturnTransition(constructTransitions());<NEW_LINE>}<NEW_LINE>// If the Fragment is non-null, then it is currently being<NEW_LINE>// retained across a configuration change.<NEW_LINE>if (mStreamFragment == null) {<NEW_LINE>mStreamFragment = StreamFragment.newInstance(getStreamArguments());<NEW_LINE>fm.beginTransaction().replace(getVideoContainerResource(), mStreamFragment, getString(R.string.stream_fragment_tag)).commit();<NEW_LINE>}<NEW_LINE>if (mChatFragment == null) {<NEW_LINE>mChatFragment = ChatFragment.getInstance(getStreamArguments());<NEW_LINE>fm.beginTransaction().replace(R.id.chat_fragment, mChatFragment).commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SensorManager mSensorManager = ContextCompat.getSystemService(this, SensorManager.class);<NEW_LINE>if (mSensorManager != null) {<NEW_LINE>mRotationSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);<NEW_LINE>mSensorManager.registerListener(this, mRotationSensor, SENSOR_DELAY);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>settings = new Settings(this);<NEW_LINE>updateOrientation();<NEW_LINE>} | , R.color.black)); |
1,705,796 | public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {<NEW_LINE>_touch();<NEW_LINE>if (isEmptyImpl())<NEW_LINE>throw new GeometryException("Invalid call. This operation cannot be performed on an empty geometry.");<NEW_LINE>m_bPathStarted = false;<NEW_LINE>int pathIndex = m_paths.size() - 2;<NEW_LINE>byte pf = m_pathFlags.read(pathIndex);<NEW_LINE>m_pathFlags.write(pathIndex, (byte) (pf | PathFlags.enumClosed | PathFlags.enumHasNonlinearSegments));<NEW_LINE>_initSegmentData(6);<NEW_LINE>byte oldType = m_segmentFlags.read((byte) ((m_pointCount - 1) & SegmentFlags.enumSegmentMask));<NEW_LINE>m_segmentFlags.write(m_pointCount - 1, (byte) (SegmentFlags.enumBezierSeg));<NEW_LINE>int curveIndex = m_curveParamwritePoint;<NEW_LINE>if (getSegmentDataSize(oldType) < getSegmentDataSize((byte) SegmentFlags.enumBezierSeg)) {<NEW_LINE>m_segmentParamIndex.write(m_pointCount - 1, m_curveParamwritePoint);<NEW_LINE>m_curveParamwritePoint += 6;<NEW_LINE>} else {<NEW_LINE>// there was a closing bezier curve or an arc here. We can reuse the<NEW_LINE>// storage.<NEW_LINE>curveIndex = m_segmentParamIndex.read(m_pointCount - 1);<NEW_LINE>}<NEW_LINE>double z;<NEW_LINE>m_segmentParams.write(curveIndex, controlPoint1.x);<NEW_LINE>m_segmentParams.write(curveIndex + 1, controlPoint1.y);<NEW_LINE>// TODO: calculate me.<NEW_LINE>z = 0;<NEW_LINE>m_segmentParams.write(curveIndex + 2, z);<NEW_LINE>m_segmentParams.write(curveIndex + 3, controlPoint2.x);<NEW_LINE>m_segmentParams.write(<MASK><NEW_LINE>// TODO: calculate me.<NEW_LINE>z = 0;<NEW_LINE>m_segmentParams.write(curveIndex + 5, z);<NEW_LINE>} | curveIndex + 4, controlPoint2.y); |
1,302,408 | public SearchDef addAlias(String alias, String aliased) {<NEW_LINE>noShadowing(alias);<NEW_LINE>if (!fields.containsKey(aliased) && !views.containsKey(aliased)) {<NEW_LINE>if (aliased.contains(".")) {<NEW_LINE>// TODO Here we should nest ourself down to something that really exists.<NEW_LINE>log.warning("Aliased item '" + aliased + "' not verifiable. Allowing it to be aliased to '" + alias + " for now. Validation will come when URL/Position is structified.");<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Searchdef '" + getName() + "' has nothing named '" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String oldAliased = aliases.get(alias);<NEW_LINE>if ((oldAliased != null)) {<NEW_LINE>if (oldAliased.equals(aliased)) {<NEW_LINE>throw new IllegalArgumentException("Searchdef '" + getName() + "' already has the alias '" + alias + "' to '" + aliased + ". Why do you want to add it again.");<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Searchdef '" + getName() + "' already has the alias '" + alias + "' to '" + oldAliased + ". Cannot change it to alias '" + aliased + "'.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>aliases.put(alias, aliased);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | aliased + "'to alias to '" + alias + "'."); |
1,613,650 | public InAppMessage unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InAppMessage inAppMessage = new InAppMessage();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Content", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inAppMessage.setContent(new ListUnmarshaller<InAppMessageContent>(InAppMessageContentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CustomConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inAppMessage.setCustomConfig(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Layout", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inAppMessage.setLayout(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 inAppMessage;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,264,437 | private void appendHashTables() {<NEW_LINE>// MergingPageOutput may build hash tables for some of the small blocks. But if there're some blocks<NEW_LINE>// without hash tables, it means hash tables are not needed so far. In this case we don't send the hash tables.<NEW_LINE>if (noHashTables) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int[] hashTables = columnarMap.getHashTables();<NEW_LINE>if (hashTables == null) {<NEW_LINE>noHashTables = true;<NEW_LINE>hashTableBufferIndex = 0;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int hashTablesSize = (offsets[positionsOffset + batchSize] - offsets[positionsOffset]) * HASH_MULTIPLIER;<NEW_LINE>hashTablesBuffer = ensureCapacity(hashTablesBuffer, hashTableBufferIndex + hashTablesSize * ARRAY_INT_INDEX_SCALE, estimatedHashTableBufferMaxCapacity, LARGE, PRESERVE, bufferAllocator);<NEW_LINE>int[] positions = getPositions();<NEW_LINE>for (int i = positionsOffset; i < positionsOffset + batchSize; i++) {<NEW_LINE>int position = positions[i];<NEW_LINE>int beginOffset = columnarMap.getAbsoluteOffset(position);<NEW_LINE>int endOffset = columnarMap.getAbsoluteOffset(position + 1);<NEW_LINE>hashTableBufferIndex = setInts(hashTablesBuffer, hashTableBufferIndex, hashTables, beginOffset * HASH_MULTIPLIER, <MASK><NEW_LINE>}<NEW_LINE>} | (endOffset - beginOffset) * HASH_MULTIPLIER); |
451,129 | public void gesvd(INDArray A, INDArray S, INDArray U, INDArray VT) {<NEW_LINE>if (A.rows() > Integer.MAX_VALUE || A.columns() > Integer.MAX_VALUE)<NEW_LINE>throw new ND4JArraySizeException();<NEW_LINE>int m = (int) A.rows();<NEW_LINE>int n = (int) A.columns();<NEW_LINE>byte jobu = (byte) (U == null ? 'N' : 'A');<NEW_LINE>byte jobvt = (byte) (VT == null ? 'N' : 'A');<NEW_LINE>INDArray INFO = Nd4j.createArrayFromShapeBuffer(Nd4j.getDataBufferFactory().createInt(1), Nd4j.getShapeInfoProvider().createShapeInformation(new long[] { 1, 1 }, DataType.INT).getFirst());<NEW_LINE>if (A.data().dataType() == DataType.DOUBLE)<NEW_LINE>dgesvd(jobu, jobvt, m, n, A, S, U, VT, INFO);<NEW_LINE>else if (A.data().dataType() == DataType.FLOAT)<NEW_LINE>sgesvd(jobu, jobvt, m, n, A, <MASK><NEW_LINE>else<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>if (INFO.getInt(0) < 0) {<NEW_LINE>throw new Error("Parameter #" + INFO.getInt(0) + " to gesvd() was not valid");<NEW_LINE>} else if (INFO.getInt(0) > 0) {<NEW_LINE>log.warn("The matrix contains singular elements. Check S matrix at row " + INFO.getInt(0));<NEW_LINE>}<NEW_LINE>} | S, U, VT, INFO); |
1,729,117 | public static Date parseRSSDate(String date_str) {<NEW_LINE>date_str = date_str.trim();<NEW_LINE>if (date_str.length() == 0) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// see rfc822 [EEE,] dd MMM yyyy HH:mm::ss z<NEW_LINE>// assume 4 digit year<NEW_LINE>SimpleDateFormat format;<NEW_LINE>if (!date_str.contains(",")) {<NEW_LINE>format = new SimpleDateFormat("dd MMM yyyy HH:mm:ss z", Locale.US);<NEW_LINE>} else {<NEW_LINE>format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);<NEW_LINE>}<NEW_LINE>return (format.parse(date_str));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>String[] fallbacks = { // As above but laxer<NEW_LINE>// As above but laxer<NEW_LINE>"dd MMM yyyy HH:mm:ss z", // Fri Sep 26 00:00:00 EDT 2008<NEW_LINE>"EEE dd MMM yyyy HH:mm:ss z", // Fri Sep 26 00:00 EDT 2008<NEW_LINE>"EEE MMM dd HH:mm:ss z yyyy", // Fri Sep 26 00 EDT 2008<NEW_LINE>"EEE MMM dd HH:mm z yyyy", // 2009-02-08 22:56:45<NEW_LINE>"EEE MMM dd HH z yyyy", // 2009-02-08<NEW_LINE>"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" };<NEW_LINE>// remove commas as these keep popping up in silly places<NEW_LINE>date_str = <MASK><NEW_LINE>// remove duplicate white space<NEW_LINE>date_str = date_str.replaceAll("(\\s)+", " ");<NEW_LINE>for (int i = 0; i < fallbacks.length; i++) {<NEW_LINE>try {<NEW_LINE>return (new SimpleDateFormat(fallbacks[i], Locale.US).parse(date_str));<NEW_LINE>} catch (ParseException f) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Debug.outNoStack("RSSUtils: failed to parse RSS date: " + date_str);<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>} | date_str.replace(',', ' '); |
351,690 | public void marshall(GetPackageVersionAssetRequest getPackageVersionAssetRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getPackageVersionAssetRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getDomainOwner(), DOMAINOWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getRepository(), REPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getFormat(), FORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getNamespace(), NAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getPackage(), PACKAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getAsset(), ASSET_BINDING);<NEW_LINE>protocolMarshaller.marshall(getPackageVersionAssetRequest.getPackageVersionRevision(), PACKAGEVERSIONREVISION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | getPackageVersionAssetRequest.getPackageVersion(), PACKAGEVERSION_BINDING); |
1,109,686 | final DescribeEnvironmentResourcesResult executeDescribeEnvironmentResources(DescribeEnvironmentResourcesRequest describeEnvironmentResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEnvironmentResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEnvironmentResourcesRequest> request = null;<NEW_LINE>Response<DescribeEnvironmentResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEnvironmentResourcesRequestMarshaller().marshall(super.beforeMarshalling(describeEnvironmentResourcesRequest));<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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEnvironmentResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeEnvironmentResourcesResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | DescribeEnvironmentResourcesResult>(new DescribeEnvironmentResourcesResultStaxUnmarshaller()); |
1,381,711 | private Mono<Response<RoleAssignmentScheduleRequestInner>> createWithResponseAsync(String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (scope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (roleAssignmentScheduleRequestName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter roleAssignmentScheduleRequestName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.create(this.client.getEndpoint(), scope, roleAssignmentScheduleRequestName, <MASK><NEW_LINE>} | apiVersion, parameters, accept, context); |
47,023 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>SharedPreferences sharedPreferences = MainApplication.getSharedPreferences();<NEW_LINE>// We are only one process so it's ok to do this<NEW_LINE>SharedPreferences bootPrefs = MainApplication.bootSharedPreferences = this.getSharedPreferences("mmm_boot", MODE_PRIVATE);<NEW_LINE>long lastBoot = System.currentTimeMillis() - SystemClock.elapsedRealtime();<NEW_LINE>long lastBootPrefs = bootPrefs.getLong("last_boot", 0);<NEW_LINE>if (lastBootPrefs == 0 || Math.abs(lastBoot - lastBootPrefs) > 100) {<NEW_LINE>boolean firstBoot = sharedPreferences.getBoolean("first_boot", true);<NEW_LINE>bootPrefs.edit().clear().putLong("last_boot", lastBoot).putBoolean("first_boot", firstBoot).apply();<NEW_LINE>if (firstBoot) {<NEW_LINE>sharedPreferences.edit().putBoolean("first_boot", false).apply();<NEW_LINE>}<NEW_LINE>MainApplication.firstBoot = firstBoot;<NEW_LINE>} else {<NEW_LINE>MainApplication.firstBoot = bootPrefs.getBoolean("first_boot", false);<NEW_LINE>}<NEW_LINE>this.updateTheme();<NEW_LINE>// Update SSL Ciphers if update is possible<NEW_LINE>GMSProviderInstaller.installIfNeeded(this);<NEW_LINE>// Update emoji config<NEW_LINE>FontRequestEmojiCompatConfig fontRequestEmojiCompatConfig = DefaultEmojiCompatConfig.create(this);<NEW_LINE>if (fontRequestEmojiCompatConfig != null) {<NEW_LINE>fontRequestEmojiCompatConfig.setReplaceAll(true);<NEW_LINE>fontRequestEmojiCompatConfig.setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL);<NEW_LINE>EmojiCompat <MASK><NEW_LINE>new Thread(() -> {<NEW_LINE>Log.d("MainApplication", "Loading emoji compat...");<NEW_LINE>emojiCompat.load();<NEW_LINE>Log.d("MainApplication", "Emoji compat loaded!");<NEW_LINE>}, "Emoji compat init.").start();<NEW_LINE>}<NEW_LINE>} | emojiCompat = EmojiCompat.init(fontRequestEmojiCompatConfig); |
1,590,876 | // GuardedBy RetriableStream.lock<NEW_LINE>// state.hedgingAttemptCount is modified only here.<NEW_LINE>// The method is only called in RetriableStream.start() and HedgingRunnable.run()<NEW_LINE>State addActiveHedge(Substream substream) {<NEW_LINE>// hasPotentialHedging must be true<NEW_LINE>checkState(!hedgingFrozen, "hedging frozen");<NEW_LINE>checkState(winningSubstream == null, "already committed");<NEW_LINE>Collection<Substream> activeHedges;<NEW_LINE>if (this.activeHedges == null) {<NEW_LINE>activeHedges = Collections.singleton(substream);<NEW_LINE>} else {<NEW_LINE>activeHedges = new ArrayList<>(this.activeHedges);<NEW_LINE>activeHedges.add(substream);<NEW_LINE>activeHedges = Collections.unmodifiableCollection(activeHedges);<NEW_LINE>}<NEW_LINE>int hedgingAttemptCount = this.hedgingAttemptCount + 1;<NEW_LINE>return new State(buffer, drainedSubstreams, activeHedges, winningSubstream, <MASK><NEW_LINE>} | cancelled, passThrough, hedgingFrozen, hedgingAttemptCount); |
528,711 | protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode rootNode = instruction.getOperands().get(1).getRootNode();<NEW_LINE>final String registerNodeValue = (registerOperand1.getValue());<NEW_LINE>final OperandSize wd = OperandSize.WORD;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>long baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>final Pair<String, String> resultPair = AddressingModeTwoGenerator.generate(baseOffset, environment, instruction, instructions, rootNode);<NEW_LINE>final String tmpAddress = resultPair.first();<NEW_LINE>final String negRotateVal = environment.getNextVariableString();<NEW_LINE>final String posRotateVal = environment.getNextVariableString();<NEW_LINE>final String rotateVal1 = environment.getNextVariableString();<NEW_LINE>final String rotateVal2 = environment.getNextVariableString();<NEW_LINE>final <MASK><NEW_LINE>final String rotResult2 = environment.getNextVariableString();<NEW_LINE>final String tmpData1 = environment.getNextVariableString();<NEW_LINE>final String tmpRotResult = environment.getNextVariableString();<NEW_LINE>baseOffset = baseOffset + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createLdm(baseOffset++, dw, tmpAddress, dw, tmpData1));<NEW_LINE>// get rotate * 8<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpAddress, bt, String.valueOf(0x3L), bt, rotateVal1));<NEW_LINE>instructions.add(ReilHelpers.createMul(baseOffset++, bt, rotateVal1, bt, String.valueOf(8), wd, rotateVal2));<NEW_LINE>// subtraction to get the negative shift val<NEW_LINE>instructions.add(ReilHelpers.createSub(baseOffset++, wd, String.valueOf(0), wd, rotateVal2, dw, negRotateVal));<NEW_LINE>instructions.add(ReilHelpers.createSub(baseOffset++, wd, String.valueOf(32), wd, rotateVal2, dw, posRotateVal));<NEW_LINE>// do the rotation<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpData1, dw, negRotateVal, dw, rotResult1));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpData1, dw, posRotateVal, dw, rotResult2));<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, dw, rotResult1, dw, rotResult2, dw, tmpRotResult));<NEW_LINE>// assing it<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpRotResult, dw, String.valueOf(0xFFFFFFFFL), dw, registerNodeValue));<NEW_LINE>} | String rotResult1 = environment.getNextVariableString(); |
1,382,886 | private synchronized int createPatternRegex(String path) {<NEW_LINE>// escape path from any regex special chars<NEW_LINE>path = RE_OPERATORS_NO_STAR.matcher(path).replaceAll("\\\\$1");<NEW_LINE>// allow usage of * at the end as per documentation<NEW_LINE>if (path.charAt(path.length() - 1) == '*') {<NEW_LINE>path = path.substring(0, path.length() - 1) + "(?<rest>.*)";<NEW_LINE>state = state.setExactPath(false);<NEW_LINE>} else {<NEW_LINE>state = state.setExactPath(true);<NEW_LINE>}<NEW_LINE>// We need to search for any :<token name> tokens in the String and replace them with named capture groups<NEW_LINE>Matcher <MASK><NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>List<String> groups = new ArrayList<>();<NEW_LINE>int index = 0;<NEW_LINE>while (m.find()) {<NEW_LINE>String param = "p" + index;<NEW_LINE>String group = m.group().substring(1);<NEW_LINE>if (groups.contains(group)) {<NEW_LINE>throw new IllegalArgumentException("Cannot use identifier " + group + " more than once in pattern string");<NEW_LINE>}<NEW_LINE>m.appendReplacement(sb, "(?<" + param + ">[^/]+)");<NEW_LINE>groups.add(group);<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>m.appendTail(sb);<NEW_LINE>if (state.isExactPath() && !state.isPathEndsWithSlash()) {<NEW_LINE>sb.append("/?");<NEW_LINE>}<NEW_LINE>path = sb.toString();<NEW_LINE>state = state.setGroups(groups);<NEW_LINE>state = state.setPattern(Pattern.compile(path));<NEW_LINE>return index;<NEW_LINE>} | m = RE_TOKEN_SEARCH.matcher(path); |
943,222 | public void configure(ODocument iConfiguration, OCommandContext iContext) {<NEW_LINE>super.configure(iConfiguration, iContext);<NEW_LINE>driverClass = (String) resolve(iConfiguration.field("driver"));<NEW_LINE>url = (String) resolve(iConfiguration.field("url"));<NEW_LINE>userName = (String) resolve<MASK><NEW_LINE>userPassword = (String) resolve(iConfiguration.field("userPassword"));<NEW_LINE>query = (String) resolve(iConfiguration.field("query"));<NEW_LINE>queryCount = (String) resolve(iConfiguration.field("queryCount"));<NEW_LINE>if (iConfiguration.containsField("fetchSize"))<NEW_LINE>fetchSize = (Integer) resolve(iConfiguration.field("fetchSize"));<NEW_LINE>try {<NEW_LINE>Class.forName(driverClass).newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw OException.wrapException(new OConfigurationException("[JDBC extractor] JDBC Driver " + driverClass + " not found"), e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>conn = DriverManager.getConnection(url, userName, userPassword);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw OException.wrapException(new OConfigurationException("[JDBC extractor] error on connecting to JDBC url '" + url + "' using user '" + userName + "' and the password provided"), e);<NEW_LINE>}<NEW_LINE>} | (iConfiguration.field("userName")); |
1,509,788 | private static Long asLong(Object val, EsType columnType, String typeString) throws SQLException {<NEW_LINE>switch(columnType) {<NEW_LINE>case BOOLEAN:<NEW_LINE>return Long.valueOf(((Boolean) val).booleanValue() ? 1 : 0);<NEW_LINE>case BYTE:<NEW_LINE>case SHORT:<NEW_LINE>case INTEGER:<NEW_LINE>case LONG:<NEW_LINE>return Long.valueOf(((Number) val).longValue());<NEW_LINE>case UNSIGNED_LONG:<NEW_LINE>return safeToLong(asBigInteger(val, columnType, typeString));<NEW_LINE>case FLOAT:<NEW_LINE>case HALF_FLOAT:<NEW_LINE>case SCALED_FLOAT:<NEW_LINE>case DOUBLE:<NEW_LINE>return safeToLong(((Number) val).doubleValue());<NEW_LINE>// TODO: should we support conversion to TIMESTAMP?<NEW_LINE>// The spec says that getLong() should support the following types conversions:<NEW_LINE>// TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, BOOLEAN, CHAR, VARCHAR, LONGVARCHAR<NEW_LINE>// case TIMESTAMP:<NEW_LINE>// return ((Number) val).longValue();<NEW_LINE>case KEYWORD:<NEW_LINE>case TEXT:<NEW_LINE>try {<NEW_LINE>return Long.valueOf((String) val);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>return failConversion(val, columnType, <MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>return failConversion(val, columnType, typeString, Long.class);<NEW_LINE>} | typeString, Long.class, e); |
773,065 | public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>loadButton = getView().findViewById(R.id.adsizes_btn_loadad);<NEW_LINE>cb120x20 = getView().findViewById(R.id.adsizes_cb_120x20);<NEW_LINE>cb320x50 = getView().findViewById(R.id.adsizes_cb_320x50);<NEW_LINE>cb300x250 = getView().findViewById(R.id.adsizes_cb_300x250);<NEW_LINE>adView = getView().findViewById(R.id.adsizes_pav_main);<NEW_LINE>adView.setAdListener(new AdListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdLoaded() {<NEW_LINE>adView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>loadButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>if (!cb120x20.isChecked() && !cb320x50.isChecked() && !cb300x250.isChecked()) {<NEW_LINE>Toast.makeText(AdManagerMultipleAdSizesFragment.this.getActivity(), "At least one size is required.", Toast.LENGTH_SHORT).show();<NEW_LINE>} else {<NEW_LINE>List<AdSize> sizeList = new ArrayList<>();<NEW_LINE>if (cb120x20.isChecked()) {<NEW_LINE>sizeList.add(new AdSize(120, 20));<NEW_LINE>}<NEW_LINE>if (cb320x50.isChecked()) {<NEW_LINE>sizeList.add(AdSize.BANNER);<NEW_LINE>}<NEW_LINE>if (cb300x250.isChecked()) {<NEW_LINE>sizeList.add(AdSize.MEDIUM_RECTANGLE);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>adView.setAdSizes(sizeList.toArray(new AdSize[sizeList.size()]));<NEW_LINE>adView.loadAd(new AdManagerAdRequest.Builder().build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | adView.setVisibility(View.INVISIBLE); |
356,780 | private void addSelectedFiles(CommandContext context) {<NEW_LINE>final IStructuredSelection[] structuredSelection = new IStructuredSelection[1];<NEW_LINE>// First try to get the current selection from evaluation context, so we get selection from active view...<NEW_LINE>PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>// Grab the active project given the context. Check active view or editor, then grab project<NEW_LINE>// from it, falling back to App Explorer's active project.<NEW_LINE>IEvaluationService evaluationService = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class);<NEW_LINE>if (evaluationService != null) {<NEW_LINE>IEvaluationContext currentState = evaluationService.getCurrentState();<NEW_LINE>Object variable = <MASK><NEW_LINE>if (variable instanceof IStructuredSelection) {<NEW_LINE>structuredSelection[0] = (IStructuredSelection) variable;<NEW_LINE>} else {<NEW_LINE>// checks the active editor<NEW_LINE>variable = currentState.getVariable(ISources.ACTIVE_EDITOR_NAME);<NEW_LINE>if (variable instanceof IEditorPart) {<NEW_LINE>IEditorInput editorInput = ((IEditorPart) variable).getEditorInput();<NEW_LINE>if (editorInput instanceof IFileEditorInput) {<NEW_LINE>structuredSelection[0] = new StructuredSelection(((IFileEditorInput) editorInput).getFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// We failed to get selection from active view, may have been an editor active, fall back to selection in App<NEW_LINE>// Explorer.<NEW_LINE>if (structuredSelection[0] == null) {<NEW_LINE>CommonNavigator nav = getAppExplorer();<NEW_LINE>if (nav == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ISelection sel = nav.getCommonViewer().getSelection();<NEW_LINE>if (sel instanceof IStructuredSelection) {<NEW_LINE>structuredSelection[0] = (IStructuredSelection) sel;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (structuredSelection[0] == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>IStructuredSelection struct = structuredSelection[0];<NEW_LINE>for (Object selected : struct.toArray()) {<NEW_LINE>// TODO Should we handle IAdaptables that can be adapted to IResources?<NEW_LINE>if (selected instanceof IResource) {<NEW_LINE>IPath location = ((IResource) selected).getLocation();<NEW_LINE>if (location != null) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>builder.append("'").append(location.toOSString()).append("' ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (builder.length() > 0) {<NEW_LINE>builder.deleteCharAt(builder.length() - 1);<NEW_LINE>context.put(TM_SELECTED_FILES, builder.toString());<NEW_LINE>}<NEW_LINE>} | currentState.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); |
869,805 | static CorpusStatistics collectCorpusStatisticsForLemmas(WebCorpus corpus, TurkishMorphology analyzer, int count) throws IOException {<NEW_LINE>CorpusStatistics statistics = new CorpusStatistics(1_000_000);<NEW_LINE>int docCount = 0;<NEW_LINE>for (WebDocument document : corpus.getDocuments()) {<NEW_LINE>Histogram<String> docHistogram = new Histogram<>();<NEW_LINE>List<String> sentences = extractor.fromParagraphs(document.getLines());<NEW_LINE>for (String sentence : sentences) {<NEW_LINE>List<SingleAnalysis> analysis = analyzer.analyzeAndDisambiguate(sentence).bestAnalysis();<NEW_LINE>for (SingleAnalysis w : analysis) {<NEW_LINE>if (!analysisAcceptable(w)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String s = w.getStemAndEnding().concat();<NEW_LINE>if (TurkishStopWords.DEFAULT.contains(s)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<String> lemmas = w.getLemmas();<NEW_LINE>docHistogram.add(lemmas.get(lemmas.size() - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>statistics.termFrequencies.add(docHistogram);<NEW_LINE>for (String s : docHistogram) {<NEW_LINE>statistics.documentFrequencies.add(s);<NEW_LINE>}<NEW_LINE>if (docCount++ % 500 == 0) {<NEW_LINE>Log.info("Doc count = %d", docCount);<NEW_LINE>}<NEW_LINE>if (count > 0 && docCount > count) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>statistics.documentCount = count > 0 ? Math.min(count, corpus.documentCount(<MASK><NEW_LINE>return statistics;<NEW_LINE>} | )) : corpus.documentCount(); |
1,089,122 | private static ExpressionSequence composeSequence(final ExpressionParsingState state, final int nodeIndex) {<NEW_LINE>if (state == null || nodeIndex >= state.size()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (state.hasExpressionAt(nodeIndex)) {<NEW_LINE>// could happen if we are traversing pointers recursively, so we will consider an expression sequence<NEW_LINE>// with one expression only<NEW_LINE>final List<IStandardExpression> expressions = new ArrayList<IStandardExpression>(2);<NEW_LINE>expressions.add(state.get(nodeIndex).getExpression());<NEW_LINE>return new ExpressionSequence(expressions);<NEW_LINE>}<NEW_LINE>final String input = state.get(nodeIndex).getInput();<NEW_LINE>if (StringUtils.isEmptyOrWhitespace(input)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// First, check whether we are just dealing with a pointer input<NEW_LINE>final int pointer = ExpressionParsingUtil.parseAsSimpleIndexPlaceholder(input);<NEW_LINE>if (pointer != -1) {<NEW_LINE>return composeSequence(state, pointer);<NEW_LINE>}<NEW_LINE>final String[] inputParts = <MASK><NEW_LINE>final List<IStandardExpression> expressions = new ArrayList<IStandardExpression>(4);<NEW_LINE>for (final String inputPart : inputParts) {<NEW_LINE>final Expression expression = ExpressionParsingUtil.parseAndCompose(state, inputPart);<NEW_LINE>if (expression == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>expressions.add(expression);<NEW_LINE>}<NEW_LINE>return new ExpressionSequence(expressions);<NEW_LINE>} | StringUtils.split(input, ","); |
1,145,523 | private void addSpliteratorValueInstanceAddAll(SourceBuilder code) {<NEW_LINE>code.addLine("");<NEW_LINE>addJavadocForAddingMultipleValues(code);<NEW_LINE>code.addLine("public %s %s(%s<? extends %s> elements) {", datatype.getBuilder(), addAllMethod(property), Spliterator.class, element.type()).<MASK><NEW_LINE>Variable newSize = new Variable("newSize");<NEW_LINE>code.addLine(" long %s = elements.estimateSize() + %s.size();", newSize, property.getField()).addLine(" if (%s <= Integer.MAX_VALUE) {", newSize).addLine(" %s.ensureCapacity((int) %s);", property.getField(), newSize).addLine(" }").addLine(" }").addLine(" elements.forEachRemaining(this::%s);", addMethod(property)).addLine(" return (%s) this;", datatype.getBuilder()).addLine("}");<NEW_LINE>} | addLine(" if ((elements.characteristics() & %s.SIZED) != 0) {", Spliterator.class); |
75,886 | private void registerClassedJob(final String jobName, final String jobBootstrapBeanName, final SingletonBeanRegistry singletonBeanRegistry, final CoordinatorRegistryCenter registryCenter, final TracingConfiguration<?> tracingConfig, final ElasticJobConfigurationProperties jobConfigurationProperties) {<NEW_LINE>JobConfiguration jobConfig = jobConfigurationProperties.toJobConfiguration(jobName);<NEW_LINE>jobExtraConfigurations(jobConfig, tracingConfig);<NEW_LINE>ElasticJob elasticJob = applicationContext.getBean(jobConfigurationProperties.getElasticJobClass());<NEW_LINE>if (Strings.isNullOrEmpty(jobConfig.getCron())) {<NEW_LINE>Preconditions.checkArgument(!Strings<MASK><NEW_LINE>singletonBeanRegistry.registerSingleton(jobBootstrapBeanName, new OneOffJobBootstrap(registryCenter, elasticJob, jobConfig));<NEW_LINE>} else {<NEW_LINE>String beanName = !Strings.isNullOrEmpty(jobBootstrapBeanName) ? jobBootstrapBeanName : jobConfig.getJobName() + "ScheduleJobBootstrap";<NEW_LINE>singletonBeanRegistry.registerSingleton(beanName, new ScheduleJobBootstrap(registryCenter, elasticJob, jobConfig));<NEW_LINE>}<NEW_LINE>} | .isNullOrEmpty(jobBootstrapBeanName), "The property [jobBootstrapBeanName] is required for One-off job."); |
1,335,152 | public void run(@Nonnull ProgressIndicator indicator) {<NEW_LINE>indicator.setIndeterminate(false);<NEW_LINE>indicator.setFraction(0);<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>CommitsCounter counter = new CommitsCounter(indicator, myCommits.values().stream().mapToInt(TIntHashSet::size).sum());<NEW_LINE>LOG.debug("Indexing " + counter.allCommits + " commits");<NEW_LINE>for (VirtualFile root : myCommits.keySet()) {<NEW_LINE>try {<NEW_LINE>if (myFull) {<NEW_LINE>indexAll(root, myCommits.get(root), counter);<NEW_LINE>} else {<NEW_LINE>indexOneByOne(root, myCommits.get(root), counter);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>myNumberOfTasks.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug(StopWatch.formatTime(System.currentTimeMillis() - time) + " for indexing " + counter.newIndexedCommits + " new commits out of " + counter.allCommits);<NEW_LINE>int leftCommits = counter.allCommits - counter.newIndexedCommits - counter.oldCommits;<NEW_LINE>if (leftCommits > 0) {<NEW_LINE>LOG.warn("Did not index " + leftCommits + " commits");<NEW_LINE>}<NEW_LINE>} | get(root).decrementAndGet(); |
646,902 | public List<DirItemDTO> query(DirRequest request) {<NEW_LINE>String userId = String.valueOf(AuthUtils.getUser().getUserId());<NEW_LINE>List<PanelEntity> panelEntities = new ArrayList<>();<NEW_LINE>if (StringUtils.isNotBlank(request.getName())) {<NEW_LINE>panelEntities = mobileDirMapper.queryWithName(request.getName(), userId);<NEW_LINE>} else {<NEW_LINE>panelEntities = mobileDirMapper.query(<MASK><NEW_LINE>}<NEW_LINE>if (CollectionUtils.isEmpty(panelEntities))<NEW_LINE>return null;<NEW_LINE>List<String> filterLists = Arrays.asList(filterDirNames);<NEW_LINE>List<DirItemDTO> dtos = panelEntities.stream().filter(dto -> !filterLists.contains(dto.getText())).map(data -> {<NEW_LINE>DirItemDTO dirItemDTO = new DirItemDTO();<NEW_LINE>dirItemDTO.setId(data.getId());<NEW_LINE>dirItemDTO.setText(data.getText());<NEW_LINE>dirItemDTO.setType(data.getType());<NEW_LINE>return dirItemDTO;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return dtos;<NEW_LINE>} | request.getPid(), userId); |
44,916 | public CompletableFuture<ThreadsResponse> threads() {<NEW_LINE>if (context.getDebugSession() == null) {<NEW_LINE>CompletableFuture<ThreadsResponse> future = new CompletableFuture<>();<NEW_LINE>ErrorUtilities.completeExceptionally(future, "Debug Session doesn't exist.", ResponseErrorCode.InvalidParams);<NEW_LINE>return future;<NEW_LINE>} else {<NEW_LINE>return CompletableFuture.supplyAsync(() -> {<NEW_LINE>LOGGER.log(LOGLEVEL, "threads() START");<NEW_LINE>long t1 = System.nanoTime();<NEW_LINE>List<org.eclipse.lsp4j.debug.Thread> result = new ArrayList<>();<NEW_LINE>context.getThreadsProvider().visitThreads((id, dvThread) -> {<NEW_LINE>org.eclipse.lsp4j.debug.Thread thread = new org.eclipse<MASK><NEW_LINE>thread.setId(id);<NEW_LINE>thread.setName(dvThread.getName());<NEW_LINE>result.add(thread);<NEW_LINE>});<NEW_LINE>ThreadsResponse response = new ThreadsResponse();<NEW_LINE>response.setThreads(result.toArray(new org.eclipse.lsp4j.debug.Thread[result.size()]));<NEW_LINE>long t2 = System.nanoTime();<NEW_LINE>LOGGER.log(LOGLEVEL, "threads() END after {0} ns", (t2 - t1));<NEW_LINE>return response;<NEW_LINE>}, threadsRP);<NEW_LINE>}<NEW_LINE>} | .lsp4j.debug.Thread(); |
1,337,212 | public Iterator<V> iterator() {<NEW_LINE>Node<K, V> from;<NEW_LINE>int fromIndex;<NEW_LINE>if (subMap.hasStart) {<NEW_LINE>subMap.setFirstKey();<NEW_LINE>from = subMap.firstKeyNode;<NEW_LINE>fromIndex = subMap.firstKeyIndex;<NEW_LINE>} else {<NEW_LINE>from = minimum(subMap.backingMap.root);<NEW_LINE>fromIndex = from != null ? from.left_idx : 0;<NEW_LINE>}<NEW_LINE>if (!subMap.hasEnd) {<NEW_LINE>return new UnboundedValueIterator<K, V>(subMap.backingMap, from, from == null ? 0 : fromIndex);<NEW_LINE>}<NEW_LINE>subMap.setLastKey();<NEW_LINE>Node<K, V> to = subMap.lastKeyNode;<NEW_LINE>int toIndex = subMap.lastKeyIndex + (subMap.lastKeyNode != null && (!subMap.lastKeyNode.keys[subMap.lastKeyIndex].equals(subMap.<MASK><NEW_LINE>if (to != null && toIndex > to.right_idx) {<NEW_LINE>to = to.next;<NEW_LINE>toIndex = to != null ? to.left_idx : 0;<NEW_LINE>if (to == null) {<NEW_LINE>// has endkey but it does not exist, thus return UnboundedValueIterator<NEW_LINE>return new UnboundedValueIterator<K, V>(subMap.backingMap, from, from == null ? 0 : fromIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BoundedValueIterator<K, V>(from, from == null ? 0 : fromIndex, subMap.backingMap, to, to == null ? 0 : toIndex);<NEW_LINE>} | endKey)) ? 1 : 0); |
588,441 | // NOI18N<NEW_LINE>@TriggerPattern(value = "$v=$this")<NEW_LINE>public static ErrorDescription hintOnAssignment(HintContext ctx) {<NEW_LINE>Map<String, TreePath> variables = ctx.getVariables();<NEW_LINE>// NOI18N<NEW_LINE>TreePath thisPath = variables.get("$this");<NEW_LINE>if (thisPath.getLeaf().getKind() != Kind.IDENTIFIER || !((IdentifierTree) thisPath.getLeaf()).getName().contentEquals(THIS_KEYWORD)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!Utilities.isInConstructor(ctx)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TreePath storePath = variables.get("$v");<NEW_LINE>Tree t = storePath.getLeaf();<NEW_LINE>if (t.getKind() == Tree.Kind.MEMBER_SELECT) {<NEW_LINE>t = ((MemberSelectTree) t).getExpression();<NEW_LINE>while (t != null && t.getKind() == Tree.Kind.PARENTHESIZED) {<NEW_LINE>t = ((<MASK><NEW_LINE>}<NEW_LINE>if (t == null) {<NEW_LINE>return null;<NEW_LINE>} else if (t.getKind() == Tree.Kind.IDENTIFIER) {<NEW_LINE>IdentifierTree it = (IdentifierTree) t;<NEW_LINE>if (it.getName().contentEquals(THIS_KEYWORD) || it.getName().contentEquals(SUPER_KEYWORD)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), NbBundle.getMessage(LeakingThisInConstructor.class, "MSG_org.netbeans.modules.java.hints.LeakingThisInConstructor"));<NEW_LINE>} | ParenthesizedTree) t).getExpression(); |
1,421,993 | public static void markRegionBorders(GrayS32 labeled, GrayU8 output) {<NEW_LINE>InputSanityCheck.checkSameShape(labeled, output);<NEW_LINE>ImageMiscOps.fill(output, 0);<NEW_LINE>for (int y = 0; y < output.height - 1; y++) {<NEW_LINE>int indexLabeled = labeled.startIndex + y * labeled.stride;<NEW_LINE>int indexOutput = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < output.width - 1; x++, indexLabeled++, indexOutput++) {<NEW_LINE>int region0 = labeled.data[indexLabeled];<NEW_LINE>int region1 = labeled.data[indexLabeled + 1];<NEW_LINE>int region2 = labeled.<MASK><NEW_LINE>if (region0 != region1) {<NEW_LINE>output.data[indexOutput] = 1;<NEW_LINE>output.data[indexOutput + 1] = 1;<NEW_LINE>}<NEW_LINE>if (region0 != region2) {<NEW_LINE>output.data[indexOutput] = 1;<NEW_LINE>output.data[indexOutput + output.stride] = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int y = 0; y < output.height - 1; y++) {<NEW_LINE>int indexLabeled = labeled.startIndex + y * labeled.stride + output.width - 1;<NEW_LINE>int indexOutput = output.startIndex + y * output.stride + output.width - 1;<NEW_LINE>int region0 = labeled.data[indexLabeled];<NEW_LINE>int region2 = labeled.data[indexLabeled + labeled.stride];<NEW_LINE>if (region0 != region2) {<NEW_LINE>output.data[indexOutput] = 1;<NEW_LINE>output.data[indexOutput + output.stride] = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int y = output.height - 1;<NEW_LINE>int indexLabeled = labeled.startIndex + y * labeled.stride;<NEW_LINE>int indexOutput = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < output.width - 1; x++, indexLabeled++, indexOutput++) {<NEW_LINE>int region0 = labeled.data[indexLabeled];<NEW_LINE>int region1 = labeled.data[indexLabeled + 1];<NEW_LINE>if (region0 != region1) {<NEW_LINE>output.data[indexOutput] = 1;<NEW_LINE>output.data[indexOutput + 1] = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | data[indexLabeled + labeled.stride]; |
1,566,846 | public GeckoResult<Boolean> onVisited(@NonNull GeckoSession aSession, @NonNull String url, @Nullable String lastVisitedURL, int flags) {<NEW_LINE>if (mState.mSession == aSession) {<NEW_LINE>if (mHistoryDelegate != null) {<NEW_LINE>return mHistoryDelegate.onVisited(aSession, url, lastVisitedURL, flags);<NEW_LINE>} else {<NEW_LINE>final GeckoResult<Boolean> response = new GeckoResult<>();<NEW_LINE>mQueuedCalls.add(() -> {<NEW_LINE>if (mHistoryDelegate != null) {<NEW_LINE>try {<NEW_LINE>requireNonNull(mHistoryDelegate.onVisited(aSession, url, lastVisitedURL, flags)).then(aBoolean -> {<NEW_LINE>response.complete(aBoolean);<NEW_LINE>return null;<NEW_LINE>}).exceptionally(throwable -> {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return GeckoResult.fromValue(false);<NEW_LINE>} | Log.d(LOGTAG, "Null GeckoResult from onVisited"); |
763,372 | private void put(ExecutionEnvironment execEnv, char[] password) {<NEW_LINE>String key = ExecutionEnvironmentFactory.toUniqueID(execEnv);<NEW_LINE>if (keepPasswordsInMemory) {<NEW_LINE>char[] old;<NEW_LINE>if (password != null) {<NEW_LINE>old = cache.put(key, Arrays.copyOf(password, password.length));<NEW_LINE>// NOI18N<NEW_LINE>Logger.getInstance().log(Level.FINEST, "PasswordManager.put({0}, non-null) stored password in memory", execEnv);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getInstance().log(Level.FINEST, "PasswordManager.put({0}, null) cleared password from memory", execEnv);<NEW_LINE>old = cache.put(key, null);<NEW_LINE>}<NEW_LINE>if (old != null) {<NEW_LINE>Arrays.fill(old, 'x');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean store = NbPreferences.forModule(PasswordManager.class).getBoolean(STORE_PREFIX + key, false);<NEW_LINE>if (store) {<NEW_LINE>keyringIsActivated = true;<NEW_LINE>if (password == null) {<NEW_LINE>Keyring.delete(KEY_PREFIX + key);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>Keyring.// NOI18N<NEW_LINE>save(// NOI18N<NEW_LINE>KEY_PREFIX + key, // NOI18N<NEW_LINE>password, NbBundle.getMessage(PasswordManager.class, "PasswordManagerPasswordFor", execEnv.getDisplayName()));<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>Logger.getInstance().log(<MASK><NEW_LINE>}<NEW_LINE>} | Level.FINEST, "PasswordManager.put({0}, non-null) stored password in keyring", execEnv); |
1,710,577 | public AviatorObject defineValue(final AviatorObject value, final Map<String, Object> env) {<NEW_LINE>if (this.containsDot) {<NEW_LINE>return setProperty(value, env);<NEW_LINE>}<NEW_LINE>Object v = getAssignedValue(value, env);<NEW_LINE>// TODO refactor<NEW_LINE>// special processing for define functions.<NEW_LINE>if (v instanceof LambdaFunction) {<NEW_LINE>// try to define a function<NEW_LINE>Object existsFn = getValue(env);<NEW_LINE>if (existsFn instanceof DispatchFunction) {<NEW_LINE>// It's already an overload function, install the new branch.<NEW_LINE>((DispatchFunction) existsFn).install((LambdaFunction) v);<NEW_LINE>return AviatorRuntimeJavaType.valueOf(existsFn);<NEW_LINE>} else if (existsFn instanceof LambdaFunction) {<NEW_LINE>// cast it to an overload function<NEW_LINE>DispatchFunction newFn = new DispatchFunction(this.name);<NEW_LINE>// install the exists branch<NEW_LINE>newFn.install((LambdaFunction) existsFn);<NEW_LINE>// and the new branch.<NEW_LINE>newFn.install(((LambdaFunction) v));<NEW_LINE>v = newFn;<NEW_LINE>} else if (existsFn == null && ((LambdaFunction) v).isVariadic()) {<NEW_LINE>// cast variadic function to overload function<NEW_LINE>DispatchFunction newFn = new DispatchFunction(this.name);<NEW_LINE>newFn.install<MASK><NEW_LINE>v = newFn;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((Env) env).override(this.name, v);<NEW_LINE>return AviatorRuntimeJavaType.valueOf(v);<NEW_LINE>} | (((LambdaFunction) v)); |
1,171,835 | public List<I_ESR_ImportLine> retrieveLinesForInvoice(final I_ESR_ImportLine esrImportLine, final I_C_Invoice invoice) {<NEW_LINE>final ArrayList<I_ESR_ImportLine> linesFromDB = new ArrayList<>(fetchLinesForInvoice(esrImportLine<MASK><NEW_LINE>// check if a line with the given ID was loaded from the DB. If that's the case, replace it with the given 'esrImportLine'.<NEW_LINE>boolean lineReplaced = false;<NEW_LINE>for (int i = 0; i < linesFromDB.size(); i++) {<NEW_LINE>if (linesFromDB.get(i).getESR_ImportLine_ID() == esrImportLine.getESR_ImportLine_ID()) {<NEW_LINE>linesFromDB.set(i, esrImportLine);<NEW_LINE>lineReplaced = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!lineReplaced) {<NEW_LINE>// the given 'esrImportLine' was not loaded from DB, maybe because the invoice was just set, but not saved (or will be set soon!)<NEW_LINE>linesFromDB.add(esrImportLine);<NEW_LINE>Collections.sort(linesFromDB, esrImportLineDefaultComparator);<NEW_LINE>}<NEW_LINE>return linesFromDB;<NEW_LINE>} | .getESR_Import(), invoice)); |
1,665,656 | public void onSaveInstanceState(Bundle outState) {<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>outState.putLong(BUNDLE_KEY_EVENT_ID, mEventId);<NEW_LINE>outState.putLong(BUNDLE_KEY_START_MILLIS, mStartMillis);<NEW_LINE>outState.putLong(BUNDLE_KEY_END_MILLIS, mEndMillis);<NEW_LINE>outState.putBoolean(BUNDLE_KEY_IS_DIALOG, mIsDialog);<NEW_LINE>outState.putInt(BUNDLE_KEY_WINDOW_STYLE, mWindowStyle);<NEW_LINE>outState.putBoolean(BUNDLE_KEY_DELETE_DIALOG_VISIBLE, mDeleteDialogVisible);<NEW_LINE>outState.putInt(BUNDLE_KEY_CALENDAR_COLOR, mCalendarColor);<NEW_LINE>outState.putBoolean(BUNDLE_KEY_CALENDAR_COLOR_INIT, mCalendarColorInitialized);<NEW_LINE>outState.putInt(BUNDLE_KEY_ORIGINAL_COLOR, mOriginalColor);<NEW_LINE>outState.putBoolean(BUNDLE_KEY_ORIGINAL_COLOR_INIT, mOriginalColorInitialized);<NEW_LINE>outState.putInt(BUNDLE_KEY_CURRENT_COLOR, mCurrentColor);<NEW_LINE>outState.putBoolean(BUNDLE_KEY_CURRENT_COLOR_INIT, mCurrentColorInitialized);<NEW_LINE>outState.putString(BUNDLE_KEY_CURRENT_COLOR_KEY, mCurrentColorKey);<NEW_LINE>// We'll need the temporary response for configuration changes.<NEW_LINE>outState.putInt(BUNDLE_KEY_TENTATIVE_USER_RESPONSE, mTentativeUserSetResponse);<NEW_LINE>if (mTentativeUserSetResponse != Attendees.ATTENDEE_STATUS_NONE && mEditResponseHelper != null) {<NEW_LINE>outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mEditResponseHelper.getWhichEvents());<NEW_LINE>}<NEW_LINE>// Save the current response.<NEW_LINE>int response;<NEW_LINE>if (mAttendeeResponseFromIntent != Attendees.ATTENDEE_STATUS_NONE) {<NEW_LINE>response = mAttendeeResponseFromIntent;<NEW_LINE>} else {<NEW_LINE>response = mOriginalAttendeeResponse;<NEW_LINE>}<NEW_LINE>outState.putInt(BUNDLE_KEY_ATTENDEE_RESPONSE, response);<NEW_LINE>if (mUserSetResponse != Attendees.ATTENDEE_STATUS_NONE) {<NEW_LINE>response = mUserSetResponse;<NEW_LINE>outState.putInt(BUNDLE_KEY_USER_SET_ATTENDEE_RESPONSE, response);<NEW_LINE>outState.putInt(BUNDLE_KEY_RESPONSE_WHICH_EVENTS, mWhichEvents);<NEW_LINE>}<NEW_LINE>// Save the reminders.<NEW_LINE>mReminders = EventViewUtils.reminderItemsToReminders(mReminderViews, mReminderMinuteValues, mReminderMethodValues);<NEW_LINE>int numReminders = mReminders.size();<NEW_LINE>ArrayList<Integer> reminderMinutes = new ArrayList<Integer>(numReminders);<NEW_LINE>ArrayList<Integer> reminderMethods = new ArrayList<Integer>(numReminders);<NEW_LINE>for (ReminderEntry reminder : mReminders) {<NEW_LINE>reminderMinutes.add(reminder.getMinutes());<NEW_LINE>reminderMethods.<MASK><NEW_LINE>}<NEW_LINE>outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_MINUTES, reminderMinutes);<NEW_LINE>outState.putIntegerArrayList(BUNDLE_KEY_REMINDER_METHODS, reminderMethods);<NEW_LINE>} | add(reminder.getMethod()); |
202,576 | public int compareTo(TSummaryRequest other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTableId(), other.isSetTableId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTableId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableId, other.tableId);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetBounds(), other.isSetBounds());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetBounds()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSummarizers(), other.isSetSummarizers());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSummarizers()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summarizers, other.summarizers);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSummarizerPattern(), other.isSetSummarizerPattern());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSummarizerPattern()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summarizerPattern, other.summarizerPattern);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | this.bounds, other.bounds); |
1,551,390 | public void addDetailedEntries(@Nonnull ItemStack itemstack, @Nullable EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) {<NEW_LINE>int extractRate;<NEW_LINE>int maxIo;<NEW_LINE>if (itemstack.getItemDamage() == 0) {<NEW_LINE>extractRate = GasConduitConfig.tier1_extractRate.get();<NEW_LINE>maxIo = GasConduitConfig.tier1_maxIO.get();<NEW_LINE>} else if (itemstack.getItemDamage() == 1) {<NEW_LINE>extractRate <MASK><NEW_LINE>maxIo = GasConduitConfig.tier2_maxIO.get();<NEW_LINE>} else {<NEW_LINE>extractRate = GasConduitConfig.tier3_extractRate.get();<NEW_LINE>maxIo = GasConduitConfig.tier3_maxIO.get();<NEW_LINE>}<NEW_LINE>String mbt = new TextComponentTranslation("gasconduits.gas.millibuckets_tick").getUnformattedComponentText();<NEW_LINE>list.add(new TextComponentTranslation("gasconduits.item_gas_conduit.tooltip.max_extract").getUnformattedComponentText() + " " + extractRate + mbt);<NEW_LINE>list.add(new TextComponentTranslation("gasconduits.item_gas_conduit.tooltip.max_io").getUnformattedComponentText() + " " + maxIo + mbt);<NEW_LINE>if (itemstack.getItemDamage() == 0) {<NEW_LINE>SpecialTooltipHandler.addDetailedTooltipFromResources(list, "gasconduits.item_gas_conduit");<NEW_LINE>}<NEW_LINE>} | = GasConduitConfig.tier2_extractRate.get(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.