idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,799,542
private URI calculateNewRequestURI(URI newBaseURI, URI requestURI, boolean proxy) {<NEW_LINE>String baseURIPath = newBaseURI.getRawPath();<NEW_LINE>String reqURIPath = requestURI.getRawPath();<NEW_LINE>UriBuilder builder = new UriBuilderImpl().uri(newBaseURI);<NEW_LINE>String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();<NEW_LINE>String relativePath = reqURIPath.equals(basePath) ? "" : reqURIPath.startsWith(basePath) ? reqURIPath.substring(basePath.length()) : reqURIPath;<NEW_LINE>builder.path(relativePath);<NEW_LINE>String newQuery = newBaseURI.getRawQuery();<NEW_LINE>if (newQuery == null) {<NEW_LINE>builder.replaceQuery(requestURI.getRawQuery());<NEW_LINE>} else {<NEW_LINE>builder.replaceQuery(newQuery);<NEW_LINE>}<NEW_LINE>URI newRequestURI = builder.build();<NEW_LINE>resetBaseAddress(newBaseURI);<NEW_LINE><MASK><NEW_LINE>resetCurrentBuilder(current);<NEW_LINE>return newRequestURI;<NEW_LINE>}
URI current = proxy ? newBaseURI : newRequestURI;
214,546
public String WSTXLPS011FVT() {<NEW_LINE>System.out.println("========== LPS Disabled WSTXLPS011FVT start ==========");<NEW_LINE>XAResourceImpl.clear();<NEW_LINE>final ExtendedTransactionManager TM = TransactionManagerFactory.getTransactionManager();<NEW_LINE>boolean result1 = false, result2 = false, result3 = false, result4 = false;<NEW_LINE>try {<NEW_LINE>XAResourceImpl onePhaseXAResource = new OnePhaseXAResourceImpl();<NEW_LINE>onePhaseXAResource.setExpectedDirection(XAResourceImpl.DIRECTION_ROLLBACK);<NEW_LINE>result1 = TM.getTransaction().enlistResource(onePhaseXAResource);<NEW_LINE>final Serializable xaResInfo = XAResourceInfoFactory.getXAResourceInfo(0);<NEW_LINE>final Serializable xaResInfo2 = XAResourceInfoFactory.getXAResourceInfo(1);<NEW_LINE>XAResourceImpl xaRes = XAResourceFactoryImpl.instance().getXAResourceImpl(xaResInfo);<NEW_LINE>XAResourceImpl xaRes2 = XAResourceFactoryImpl.<MASK><NEW_LINE>final int recoveryId = TM.registerResourceInfo("xaResInfo", xaResInfo);<NEW_LINE>final int recoveryId2 = TM.registerResourceInfo("xaResInfo2", xaResInfo2);<NEW_LINE>xaRes.setExpectedDirection(XAResourceImpl.DIRECTION_ROLLBACK);<NEW_LINE>xaRes2.setExpectedDirection(XAResourceImpl.DIRECTION_ROLLBACK);<NEW_LINE>result2 = TM.enlist(xaRes, recoveryId);<NEW_LINE>result3 = TM.enlist(xaRes2, recoveryId2);<NEW_LINE>XAResourceImpl onePhaseXAResource2 = new OnePhaseXAResourceImpl();<NEW_LINE>onePhaseXAResource2.setExpectedDirection(XAResourceImpl.DIRECTION_ROLLBACK);<NEW_LINE>result4 = TM.getTransaction().enlistResource(onePhaseXAResource2);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return "IllegalStateException happens: " + e.toString() + " Operation failed.";<NEW_LINE>} catch (RollbackException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return "RollbackException happens: " + e.toString() + " Operation failed.";<NEW_LINE>} catch (SystemException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return "SystemException happens: " + e.toString() + " Operation failed.";<NEW_LINE>} catch (XAResourceNotAvailableException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return "XAResourceNotAvailableException happens: " + e.toString() + " Operation failed.";<NEW_LINE>}<NEW_LINE>return "WSTXLPS011FVT: Enlist OnePhaseResource" + (result1 ? " successful" : " failed") + "; Enlist XAResource voting rollback" + (result2 ? " successful" : " failed") + "; Enlist XAResource " + (result3 ? " successful" : " failed") + ("Enlist OnePhaseResource2" + (result4 ? " successful" : " failed"));<NEW_LINE>}
instance().getXAResourceImpl(xaResInfo2);
1,455,866
private BinInfo findBin(double x) {<NEW_LINE>BinInfo bin = new BinInfo();<NEW_LINE>bin.isInRange = false;<NEW_LINE>bin.isUnderflow = false;<NEW_LINE>bin.isOverflow = false;<NEW_LINE>// first check if x is outside the range of the normal histogram bins<NEW_LINE>if (x < m_min) {<NEW_LINE>bin.isUnderflow = true;<NEW_LINE>} else if (x > m_max) {<NEW_LINE>bin.isOverflow = true;<NEW_LINE>} else {<NEW_LINE>// search for histogram bin into which x falls<NEW_LINE>// (m_max - m_min)/m_nbins;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < m_nbins; i++) {<NEW_LINE>double highEdge = m_min + (i + 1) * binWidth;<NEW_LINE>if (x <= highEdge) {<NEW_LINE>bin.isInRange = true;<NEW_LINE>bin.index = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bin;<NEW_LINE>}
double binWidth = this.getBandWidth();
485,717
public void marshall(UpdatePatchBaselineRequest updatePatchBaselineRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updatePatchBaselineRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getBaselineId(), BASELINEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getGlobalFilters(), GLOBALFILTERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovalRules(), APPROVALRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovedPatches(), APPROVEDPATCHES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovedPatchesEnableNonSecurity(), APPROVEDPATCHESENABLENONSECURITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getRejectedPatches(), REJECTEDPATCHES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getRejectedPatchesAction(), REJECTEDPATCHESACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getSources(), SOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getReplace(), REPLACE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updatePatchBaselineRequest.getApprovedPatchesComplianceLevel(), APPROVEDPATCHESCOMPLIANCELEVEL_BINDING);
654,650
private Dialog createDialog(final FileSearchPanel panel) {<NEW_LINE>openBtn = new JButton();<NEW_LINE>Mnemonics.setLocalizedText(openBtn, NbBundle.getMessage(FileSearchAction.class, "CTL_Open"));<NEW_LINE>openBtn.getAccessibleContext().setAccessibleDescription(openBtn.getText());<NEW_LINE>openBtn.setEnabled(false);<NEW_LINE>final Object[] buttons = new Object[] { openBtn, DialogDescriptor.CANCEL_OPTION };<NEW_LINE>String title = NbBundle.getMessage(FileSearchAction.class, "MSG_FileSearchDlgTitle");<NEW_LINE>DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, title, true, buttons, openBtn, DialogDescriptor.DEFAULT_ALIGN, HelpCtx.DEFAULT_HELP, new DialogButtonListener(panel));<NEW_LINE>dialogDescriptor.setClosingOptions(buttons);<NEW_LINE>Dialog d = DialogDisplayer.getDefault().createDialog(dialogDescriptor);<NEW_LINE>d.getAccessibleContext().setAccessibleName(NbBundle.getMessage(FileSearchAction.class, "AN_FileSearchDialog"));<NEW_LINE>d.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage<MASK><NEW_LINE>// Set size<NEW_LINE>d.setPreferredSize(new Dimension(FileSearchOptions.getWidth(), FileSearchOptions.getHeight()));<NEW_LINE>// Center the dialog after the size changed.<NEW_LINE>Rectangle r = Utilities.getUsableScreenBounds();<NEW_LINE>int maxW = (r.width * 9) / 10;<NEW_LINE>int maxH = (r.height * 9) / 10;<NEW_LINE>Dimension dim = d.getPreferredSize();<NEW_LINE>dim.width = Math.min(dim.width, maxW);<NEW_LINE>dim.height = Math.min(dim.height, maxH);<NEW_LINE>initialDimension = dim;<NEW_LINE>d.setBounds(Utilities.findCenterBounds(dim));<NEW_LINE>d.addWindowListener(new WindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowClosed(WindowEvent e) {<NEW_LINE>cleanup(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return d;<NEW_LINE>}
(FileSearchAction.class, "AD_FileSearchDialog"));
1,697,738
public void loadPaySelectInfo(int paySelectionId) {<NEW_LINE>// load Banks from PaySelectLine<NEW_LINE>bankAccountId = -1;<NEW_LINE>// 1..2<NEW_LINE>String // 1..2<NEW_LINE>sql = // 3..5<NEW_LINE>"SELECT ps.C_BankAccount_ID, (b.Name || ' ' || ba.AccountNo) AS BankName," + " c.ISO_Code, CurrentBalance, dt.IsPayrollPayment, ba.PaymentExportClass, ba.PayrollPaymentExportClass " + "FROM C_PaySelection ps" + " INNER JOIN C_BankAccount ba ON (ps.C_BankAccount_ID=ba.C_BankAccount_ID)" + " INNER JOIN C_Bank b ON (ba.C_Bank_ID=b.C_Bank_ID)" + " INNER JOIN C_Currency c ON (ba.C_Currency_ID=c.C_Currency_ID) " + " INNER JOIN C_DocType dt ON(dt.C_DocType_ID = ps.C_DocType_ID) " + "WHERE ps.C_PaySelection_ID=? " + "AND ps.DocStatus IN('CO', 'CL') " + "AND ba.IsActive='Y'";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = <MASK><NEW_LINE>pstmt.setInt(1, paySelectionId);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>bankAccountId = rs.getInt("C_BankAccount_ID");<NEW_LINE>bank = rs.getString("BankName");<NEW_LINE>currency = rs.getString("ISO_Code");<NEW_LINE>balance = rs.getBigDecimal("CurrentBalance");<NEW_LINE>String isPayrollPayment = rs.getString("IsPayrollPayment");<NEW_LINE>String payrollExportClass = rs.getString("PayrollPaymentExportClass");<NEW_LINE>paymentExportClass = rs.getString("PaymentExportClass");<NEW_LINE>if (!Util.isEmpty(isPayrollPayment) && isPayrollPayment.equals("Y") && !Util.isEmpty(payrollExportClass)) {<NEW_LINE>paymentExportClass = payrollExportClass;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bankAccountId = -1;<NEW_LINE>bank = "";<NEW_LINE>currency = "";<NEW_LINE>balance = Env.ZERO;<NEW_LINE>paymentExportClass = null;<NEW_LINE>log.log(Level.SEVERE, "No active BankAccount for C_PaySelection_ID=" + paySelectionId);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
DB.prepareStatement(sql, null);
1,760,863
public static final void applyInferencing(Model geosparqlSchema, Dataset dataset) {<NEW_LINE>LOGGER.info("Applying GeoSPARQL Schema - Started");<NEW_LINE>try {<NEW_LINE>// Default Model<NEW_LINE>dataset.begin(ReadWrite.WRITE);<NEW_LINE><MASK><NEW_LINE>applyInferencing(geosparqlSchema, defaultModel, "default");<NEW_LINE>// Named Models<NEW_LINE>Iterator<String> graphNames = dataset.listNames();<NEW_LINE>while (graphNames.hasNext()) {<NEW_LINE>String graphName = graphNames.next();<NEW_LINE>Model namedModel = dataset.getNamedModel(graphName);<NEW_LINE>applyInferencing(geosparqlSchema, namedModel, graphName);<NEW_LINE>}<NEW_LINE>dataset.commit();<NEW_LINE>LOGGER.info("Applying GeoSPARQL Schema - Completed");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>try {<NEW_LINE>dataset.abort();<NEW_LINE>} catch (Throwable th) {<NEW_LINE>}<NEW_LINE>LOGGER.error("Inferencing Error: {}", ex.getMessage());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>dataset.end();<NEW_LINE>} catch (Throwable th) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Model defaultModel = dataset.getDefaultModel();
297,913
private static void fillVariantsByReference(@Nullable PsiReference reference, @NotNull PsiFile file, @NotNull CompletionResultSet result) {<NEW_LINE>if (reference == null)<NEW_LINE>return;<NEW_LINE>if (reference instanceof PsiMultiReference) {<NEW_LINE>PsiReference[] references = ((PsiMultiReference) reference).getReferences();<NEW_LINE>ContainerUtil.sort(references, PsiMultiReference.COMPARATOR);<NEW_LINE>fillVariantsByReference(ArrayUtil.getFirstElement(references), file, result);<NEW_LINE>} else if (reference instanceof GoReference) {<NEW_LINE>GoReferenceExpression refExpression = ObjectUtils.tryCast(reference.getElement(), GoReferenceExpression.class);<NEW_LINE>GoStructLiteralCompletion.Variants variants = GoStructLiteralCompletion.allowedVariants(refExpression);<NEW_LINE>fillStructFieldNameVariants(file, result, variants, refExpression);<NEW_LINE>if (variants != GoStructLiteralCompletion.Variants.FIELD_NAME_ONLY) {<NEW_LINE>((GoReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, false));<NEW_LINE>}<NEW_LINE>} else if (reference instanceof GoTypeReference) {<NEW_LINE>PsiElement element = reference.getElement();<NEW_LINE>PsiElement spec = PsiTreeUtil.getParentOfType(element, GoFieldDeclaration.class, GoTypeSpec.class);<NEW_LINE>boolean insideParameter = PsiTreeUtil.getParentOfType(element, GoParameterDeclaration.class) != null;<NEW_LINE>((GoTypeReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean accept(@NotNull PsiElement e) {<NEW_LINE>return e != spec && !(insideParameter && (e instanceof GoNamedSignatureOwner || e <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (reference instanceof GoCachedReference) {<NEW_LINE>((GoCachedReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, false));<NEW_LINE>}<NEW_LINE>}
instanceof GoVarDefinition || e instanceof GoConstDefinition));
1,192,197
public Pair<List<? extends VpnUser>, Integer> searchForVpnUsers(ListVpnUsersCmd cmd) {<NEW_LINE>String username = cmd.getUsername();<NEW_LINE>Long id = cmd.getId();<NEW_LINE>String keyword = cmd.getKeyword();<NEW_LINE>Account caller = CallContext<MASK><NEW_LINE>List<Long> permittedAccounts = new ArrayList<>();<NEW_LINE>Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<>(cmd.getDomainId(), cmd.isRecursive(), null);<NEW_LINE>_accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false);<NEW_LINE>Long domainId = domainIdRecursiveListProject.first();<NEW_LINE>Boolean isRecursive = domainIdRecursiveListProject.second();<NEW_LINE>ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();<NEW_LINE>Filter searchFilter = new Filter(VpnUserVO.class, "username", true, cmd.getStartIndex(), cmd.getPageSizeVal());<NEW_LINE>SearchBuilder<VpnUserVO> sb = _vpnUsersDao.createSearchBuilder();<NEW_LINE>_accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);<NEW_LINE>sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);<NEW_LINE>sb.and("username", sb.entity().getUsername(), SearchCriteria.Op.EQ);<NEW_LINE>sb.and("keyword", sb.entity().getUsername(), SearchCriteria.Op.LIKE);<NEW_LINE>sb.and("state", sb.entity().getState(), Op.IN);<NEW_LINE>SearchCriteria<VpnUserVO> sc = sb.create();<NEW_LINE>_accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);<NEW_LINE>sc.setParameters("state", State.Active, State.Add);<NEW_LINE>if (keyword != null) {<NEW_LINE>sc.setParameters("keyword", "%" + keyword + "%");<NEW_LINE>}<NEW_LINE>if (id != null) {<NEW_LINE>sc.setParameters("id", id);<NEW_LINE>}<NEW_LINE>if (username != null) {<NEW_LINE>sc.setParameters("username", username);<NEW_LINE>}<NEW_LINE>Pair<List<VpnUserVO>, Integer> result = _vpnUsersDao.searchAndCount(sc, searchFilter);<NEW_LINE>return new Pair<>(result.first(), result.second());<NEW_LINE>}
.current().getCallingAccount();
504,521
private List<ESRTransaction> iterateTransactionDetails(@NonNull final ReportEntry2 ntry, @NonNull final EntryDetails1 ntryDtl) {<NEW_LINE>final List<ESRTransaction> transactions = new ArrayList<>();<NEW_LINE>int countQRR = 0;<NEW_LINE>for (final EntryTransaction2 txDtl : ntryDtl.getTxDtls()) {<NEW_LINE>final <MASK><NEW_LINE>new ReferenceStringHelper().extractAndSetEsrReference(txDtl, trxBuilder);<NEW_LINE>new ReferenceStringHelper().extractAndSetType(txDtl, trxBuilder);<NEW_LINE>verifyTransactionCurrency(txDtl, trxBuilder);<NEW_LINE>extractAmountAndType(ntry, txDtl, trxBuilder);<NEW_LINE>final ESRTransaction esrTransaction = trxBuilder.accountingDate(asTimestamp(ntry.getBookgDt())).paymentDate(asTimestamp(ntry.getValDt())).esrParticipantNo(ntry.getNtryRef()).transactionKey(mkTrxKey(txDtl)).build();<NEW_LINE>transactions.add(esrTransaction);<NEW_LINE>if (ESRType.TYPE_QRR.equals(esrTransaction.getType())) {<NEW_LINE>countQRR++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (countQRR != 0 && countQRR != transactions.size()) {<NEW_LINE>throw new AdempiereException(ESRDataImporterCamt54.MSG_MULTIPLE_TRANSACTIONS_TYPES);<NEW_LINE>}<NEW_LINE>return transactions;<NEW_LINE>}
ESRTransactionBuilder trxBuilder = ESRTransaction.builder();
342,161
private void validateType(TypeElement type) {<NEW_LINE><MASK><NEW_LINE>boolean kindOk = kind.equals(ElementKind.CLASS) || (appliesToInterfaces && kind.equals(ElementKind.INTERFACE));<NEW_LINE>if (!kindOk) {<NEW_LINE>String appliesTo = appliesToInterfaces ? "classes and interfaces" : "classes";<NEW_LINE>errorReporter.abortWithError(type, "[%sWrongType] @%s only applies to %s", simpleAnnotationName, simpleAnnotationName, appliesTo);<NEW_LINE>}<NEW_LINE>checkModifiersIfNested(type);<NEW_LINE>if (!hasVisibleNoArgConstructor(type)) {<NEW_LINE>errorReporter.reportError(type, "[%sConstructor] @%s class must have a non-private no-arg constructor", simpleAnnotationName, simpleAnnotationName);<NEW_LINE>}<NEW_LINE>if (type.getModifiers().contains(Modifier.FINAL)) {<NEW_LINE>errorReporter.abortWithError(type, "[%sFinal] @%s class must not be final", simpleAnnotationName, simpleAnnotationName);<NEW_LINE>}<NEW_LINE>}
ElementKind kind = type.getKind();
1,483,988
public static void main(String[] args) {<NEW_LINE>log.info("Starting DragonProxy...");<NEW_LINE>// Check the java version<NEW_LINE>if (Float.parseFloat(System.getProperty("java.class.version")) < 52.0) {<NEW_LINE>log.error("DragonProxy requires Java 8! Current version: " + System.getProperty("java.version"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Define command-line options<NEW_LINE>OptionParser optionParser = new OptionParser();<NEW_LINE>optionParser.accepts("version", "Displays the proxy version");<NEW_LINE>OptionSpec<String> bedrockPortOption = optionParser.accepts(<MASK><NEW_LINE>OptionSpec<String> remoteAddressOption = optionParser.accepts("remoteAddress", "Overrides the remote address in the config").withRequiredArg();<NEW_LINE>OptionSpec<String> remotePortOption = optionParser.accepts("remotePort", "Overrides the remote port in the config").withRequiredArg();<NEW_LINE>optionParser.accepts("help", "Display help/usage information").forHelp();<NEW_LINE>// Handle command-line options<NEW_LINE>OptionSet options = optionParser.parse(args);<NEW_LINE>if (options.has("version")) {<NEW_LINE>log.info("Version: " + Bootstrap.class.getPackage().getImplementationVersion());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int bedrockPort = options.has(bedrockPortOption) ? Integer.parseInt(options.valueOf(bedrockPortOption)) : -1;<NEW_LINE>String remoteAddress = options.has(remoteAddressOption) ? options.valueOf(remoteAddressOption) : null;<NEW_LINE>int remotePort = options.has(remotePortOption) ? Integer.parseInt(options.valueOf(remotePortOption)) : -1;<NEW_LINE>DragonProxy proxy = new DragonProxy(PlatformType.STANDALONE, new File("."), bedrockPort, remoteAddress, remotePort);<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(proxy::shutdown, "Shutdown thread"));<NEW_LINE>}
"bedrockPort", "Overrides the bedrock UDP bind port").withRequiredArg();
378,537
public static void migrateDownloads(Properties ctx) {<NEW_LINE>String sql = "SELECT COUNT(*) FROM M_ProductDownload";<NEW_LINE>int no = DB.getSQLValue(null, sql);<NEW_LINE>if (no > 0)<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>int count = 0;<NEW_LINE>sql = "SELECT AD_Client_ID, AD_Org_ID, M_Product_ID, Name, DownloadURL " + "FROM M_Product " + "WHERE DownloadURL IS NOT NULL";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>int AD_Client_ID = rs.getInt(1);<NEW_LINE>int AD_Org_ID = rs.getInt(2);<NEW_LINE>int <MASK><NEW_LINE>String Name = rs.getString(4);<NEW_LINE>String DownloadURL = rs.getString(5);<NEW_LINE>//<NEW_LINE>MProductDownload pdl = new MProductDownload(ctx, 0, null);<NEW_LINE>pdl.setClientOrg(AD_Client_ID, AD_Org_ID);<NEW_LINE>pdl.setM_Product_ID(M_Product_ID);<NEW_LINE>pdl.setName(Name);<NEW_LINE>pdl.setDownloadURL(DownloadURL);<NEW_LINE>if (pdl.save()) {<NEW_LINE>count++;<NEW_LINE>String sqlUpdate = "UPDATE M_Product SET DownloadURL = NULL WHERE M_Product_ID=" + M_Product_ID;<NEW_LINE>int updated = DB.executeUpdate(sqlUpdate, null);<NEW_LINE>if (updated != 1)<NEW_LINE>s_log.warning("Product not updated");<NEW_LINE>} else<NEW_LINE>s_log.warning("Product Download not created M_Product_ID=" + M_Product_ID);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (pstmt != null)<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>s_log.info("#" + count);<NEW_LINE>}
M_Product_ID = rs.getInt(3);
838,420
public void paste(final ID sender) {<NEW_LINE>if (pasteboard.isEmpty()) {<NEW_LINE>NSPasteboard pboard = NSPasteboard.generalPasteboard();<NEW_LINE>this.upload(pboard);<NEW_LINE>} else {<NEW_LINE>final Map<Path, Path> <MASK><NEW_LINE>final Path parent = workdir;<NEW_LINE>for (final Path next : pasteboard) {<NEW_LINE>Path renamed = new Path(parent, next.getName(), next.getType(), new PathAttributes(next.attributes()));<NEW_LINE>files.put(next, renamed);<NEW_LINE>}<NEW_LINE>pasteboard.clear();<NEW_LINE>if (pasteboard.isCut()) {<NEW_LINE>new MoveController(this).rename(files);<NEW_LINE>}<NEW_LINE>if (pasteboard.isCopy()) {<NEW_LINE>new OverwriteController(BrowserController.this).overwrite(new ArrayList<>(files.values()), new DefaultMainAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>transfer(new CopyTransfer(pool.getHost(), pool.getHost(), files), new ArrayList<>(files.values()), true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
files = new HashMap<>();
1,803,930
private static String memoryToString(final Memory srcMem, final boolean isDoublesSketch) {<NEW_LINE>// either 1 or 2<NEW_LINE>final int preLongs = extractPreLongs(srcMem);<NEW_LINE>final int serVer = extractSerVer(srcMem);<NEW_LINE>final int familyID = extractFamilyID(srcMem);<NEW_LINE>final String famName = idToFamily(familyID).toString();<NEW_LINE>final int flags = extractFlags(srcMem);<NEW_LINE>final boolean bigEndian <MASK><NEW_LINE>final String nativeOrder = ByteOrder.nativeOrder().toString();<NEW_LINE>final boolean readOnly = (flags & READ_ONLY_FLAG_MASK) > 0;<NEW_LINE>final boolean empty = (flags & EMPTY_FLAG_MASK) > 0;<NEW_LINE>final boolean compact = (flags & COMPACT_FLAG_MASK) > 0;<NEW_LINE>final boolean ordered = (flags & ORDERED_FLAG_MASK) > 0;<NEW_LINE>final int k = extractK(srcMem);<NEW_LINE>final long n = (preLongs == 1) ? 0L : extractN(srcMem);<NEW_LINE>double minDouble = Double.NaN;<NEW_LINE>double maxDouble = Double.NaN;<NEW_LINE>if ((preLongs > 1) && isDoublesSketch) {<NEW_LINE>// preLongs = 2 or 3<NEW_LINE>minDouble = extractMinDouble(srcMem);<NEW_LINE>maxDouble = extractMaxDouble(srcMem);<NEW_LINE>}<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(LS);<NEW_LINE>sb.append("### QUANTILES SKETCH PREAMBLE SUMMARY:").append(LS);<NEW_LINE>sb.append("Byte 0: Preamble Longs : ").append(preLongs).append(LS);<NEW_LINE>sb.append("Byte 1: Serialization Version: ").append(serVer).append(LS);<NEW_LINE>sb.append("Byte 2: Family : ").append(famName).append(LS);<NEW_LINE>sb.append("Byte 3: Flags Field : ").append(String.format("%02o", flags)).append(LS);<NEW_LINE>sb.append(" BIG ENDIAN : ").append(bigEndian).append(LS);<NEW_LINE>sb.append(" (Native Byte Order) : ").append(nativeOrder).append(LS);<NEW_LINE>sb.append(" READ ONLY : ").append(readOnly).append(LS);<NEW_LINE>sb.append(" EMPTY : ").append(empty).append(LS);<NEW_LINE>sb.append(" COMPACT : ").append(compact).append(LS);<NEW_LINE>sb.append(" ORDERED : ").append(ordered).append(LS);<NEW_LINE>sb.append("Bytes 4-5 : K : ").append(k).append(LS);<NEW_LINE>if (preLongs == 1) {<NEW_LINE>sb.append(" --ABSENT, ASSUMED:").append(LS);<NEW_LINE>}<NEW_LINE>sb.append("Bytes 8-15 : N : ").append(n).append(LS);<NEW_LINE>if (isDoublesSketch) {<NEW_LINE>sb.append("MinDouble : ").append(minDouble).append(LS);<NEW_LINE>sb.append("MaxDouble : ").append(maxDouble).append(LS);<NEW_LINE>}<NEW_LINE>sb.append("Retained Items : ").append(computeRetainedItems(k, n)).append(LS);<NEW_LINE>sb.append("Total Bytes : ").append(srcMem.getCapacity()).append(LS);<NEW_LINE>sb.append("### END SKETCH PREAMBLE SUMMARY").append(LS);<NEW_LINE>return sb.toString();<NEW_LINE>}
= (flags & BIG_ENDIAN_FLAG_MASK) > 0;
1,570,854
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.sib.admin.JsEngineComponent#start(int)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void start(int mode) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "start, mode ", mode);<NEW_LINE>// _eventNotificationEnabled = isEventNotificationPropertySet();<NEW_LINE>// notifyMessagingEngineStarting(getName(), getUuid().toString(), "STANDARD_MODE");<NEW_LINE>boolean startFailed = false;<NEW_LINE>ListIterator<ComponentList> li = null;<NEW_LINE>synchronized (stateChangeLock) {<NEW_LINE>if (_state == STATE_STOPPED)<NEW_LINE>setState(STATE_STARTING);<NEW_LINE>}<NEW_LINE>// synchronized (stateChangeLock)<NEW_LINE>try {<NEW_LINE>// Start the message store<NEW_LINE>_messageStore.start();<NEW_LINE>// Start the message processor<NEW_LINE>_messageProcessor.start(0);<NEW_LINE>setState(STATE_STARTED);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!(e.getCause() instanceof SeverePersistenceException))<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(e, <MASK><NEW_LINE>SibTr.error(tc, "ME_CANNOT_BE_STARTED_SIAS0034", new Object[] { _name, "", "start()" });<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>startFailed = true;<NEW_LINE>}<NEW_LINE>if (startFailed) {<NEW_LINE>SibTr.error(tc, "ME_RESTART_CHECK_SIAS0027", getName());<NEW_LINE>stop(JsConstants.ME_STOP_FORCE);<NEW_LINE>destroy();<NEW_LINE>setState(STATE_STOPPED);<NEW_LINE>} else {<NEW_LINE>// Find the MP administrator class<NEW_LINE>_mpAdmin = ((SIMPAdmin) getMessageProcessor()).getAdministrator();<NEW_LINE>setState(STATE_STARTED);<NEW_LINE>}<NEW_LINE>if (!startFailed) {<NEW_LINE>serverStarted();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Messaging Engine " + _name + " with UUID " + _uuid + " has been started.");<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Messaging engine failed");<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "start");<NEW_LINE>}
CLASS_NAME + ".start", "626", this);
418,974
final ModifyDBClusterParameterGroupResult executeModifyDBClusterParameterGroup(ModifyDBClusterParameterGroupRequest modifyDBClusterParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBClusterParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBClusterParameterGroupRequest> request = null;<NEW_LINE>Response<ModifyDBClusterParameterGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBClusterParameterGroupRequestMarshaller().marshall(super.beforeMarshalling(modifyDBClusterParameterGroupRequest));<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, "RDS");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyDBClusterParameterGroupResult> responseHandler = new StaxResponseHandler<ModifyDBClusterParameterGroupResult>(new ModifyDBClusterParameterGroupResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBClusterParameterGroup");
1,083,050
/* Build call for throttlingPoliciesCustomGet */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesCustomGetCall(String accept, String ifNoneMatch, String ifModifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/custom".replaceAll("\\{format\\}", "json");<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>if (ifModifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Modified-Since", apiClient.parameterToString(ifModifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
HashMap<String, Object>();
1,705,199
public static serverObjects respond(final RequestHeader requestHeader, final serverObjects post, final serverSwitch env) {<NEW_LINE><MASK><NEW_LINE>final Switchboard sb = (Switchboard) env;<NEW_LINE>// the url of remote page currently viewed<NEW_LINE>String proxyurlstr = post.get("url", "");<NEW_LINE>boolean hasRights = sb.verifyAuthentication(requestHeader);<NEW_LINE>prop.put("allowbookmark", hasRights);<NEW_LINE>if (post.containsKey("addbookmark")) {<NEW_LINE>proxyurlstr = post.get("bookmark");<NEW_LINE>Bookmark bmk = sb.bookmarksDB.createorgetBookmark(proxyurlstr, null);<NEW_LINE>if (bmk != null) {<NEW_LINE>bmk.setPublic(false);<NEW_LINE>// add to bookmark folder<NEW_LINE>bmk.addTag("/proxy");<NEW_LINE>sb.bookmarksDB.saveBookmark(bmk);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>prop.put("proxyurl", proxyurlstr);<NEW_LINE>prop.put("allowbookmark_proxyurl", proxyurlstr);<NEW_LINE>if (proxyurlstr.startsWith("https") && !requestHeader.getScheme().equalsIgnoreCase("https")) {<NEW_LINE>prop.put("httpsAlertMsg", "1");<NEW_LINE>} else {<NEW_LINE>prop.put("httpsAlertMsg", "0");<NEW_LINE>}<NEW_LINE>// TODO: get some index data to display<NEW_LINE>return prop;<NEW_LINE>}
final serverObjects prop = new serverObjects();
1,642,383
public DataBuffer relocateConstantSpace(DataBuffer dataBuffer) {<NEW_LINE>// we always assume that data is sync, and valid on host side<NEW_LINE>Integer deviceId = AtomicAllocator.getInstance().getDeviceId();<NEW_LINE>ensureMaps(deviceId);<NEW_LINE>if (dataBuffer instanceof CudaIntDataBuffer) {<NEW_LINE>int[] data = dataBuffer.asInt();<NEW_LINE>return <MASK><NEW_LINE>} else if (dataBuffer instanceof CudaFloatDataBuffer) {<NEW_LINE>float[] data = dataBuffer.asFloat();<NEW_LINE>return getConstantBuffer(data, DataType.FLOAT);<NEW_LINE>} else if (dataBuffer instanceof CudaDoubleDataBuffer) {<NEW_LINE>double[] data = dataBuffer.asDouble();<NEW_LINE>return getConstantBuffer(data, DataType.DOUBLE);<NEW_LINE>} else if (dataBuffer instanceof CudaHalfDataBuffer) {<NEW_LINE>float[] data = dataBuffer.asFloat();<NEW_LINE>return getConstantBuffer(data, DataType.HALF);<NEW_LINE>} else if (dataBuffer instanceof CudaLongDataBuffer) {<NEW_LINE>long[] data = dataBuffer.asLong();<NEW_LINE>return getConstantBuffer(data, DataType.LONG);<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Unknown CudaDataBuffer opType");<NEW_LINE>}
getConstantBuffer(data, DataType.INT);
1,579,036
protected JComponent createNorthPanel() {<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints gbConstraints = new GridBagConstraints();<NEW_LINE>gbConstraints.insets = JBUI.insets(4);<NEW_LINE>gbConstraints.anchor = GridBagConstraints.EAST;<NEW_LINE>gbConstraints.fill = GridBagConstraints.BOTH;<NEW_LINE>gbConstraints.gridwidth = 1;<NEW_LINE>gbConstraints.weightx = 1;<NEW_LINE>gbConstraints.weighty = 1;<NEW_LINE>// ------------------------<NEW_LINE>gbConstraints.weightx = 0;<NEW_LINE>gbConstraints.gridx = 0;<NEW_LINE>gbConstraints.gridy = 0;<NEW_LINE>JLabel nameLabel = new JLabel("Name:");<NEW_LINE>panel.add(nameLabel, gbConstraints);<NEW_LINE>gbConstraints.weightx = 1;<NEW_LINE>gbConstraints.gridx = 1;<NEW_LINE>nameField = new JTextField(fieldName) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension getPreferredSize() {<NEW_LINE>Dimension dimension = super.getPreferredSize();<NEW_LINE>dimension.setSize(<MASK><NEW_LINE>return dimension;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>panel.add(nameField, gbConstraints);<NEW_LINE>// ------------------------<NEW_LINE>gbConstraints.weightx = 1;<NEW_LINE>gbConstraints.gridx = 0;<NEW_LINE>gbConstraints.gridy = 1;<NEW_LINE>docCheckbox = new JCheckBox("Type annotation");<NEW_LINE>panel.add(docCheckbox, gbConstraints);<NEW_LINE>return panel;<NEW_LINE>}
200, dimension.getHeight());
486,174
private void handleActionMoveWhileDragging(RecyclerView rv, MotionEvent e) {<NEW_LINE>mLastTouchX = (int) (e.getX() + 0.5f);<NEW_LINE>mLastTouchY = (int) (e.getY() + 0.5f);<NEW_LINE>mNestedScrollViewScrollX = (mNestedScrollView != null) ? mNestedScrollView.getScrollX() : 0;<NEW_LINE>mNestedScrollViewScrollY = (mNestedScrollView != null) ? mNestedScrollView.getScrollY() : 0;<NEW_LINE>mDragMinTouchX = Math.min(mDragMinTouchX, mLastTouchX);<NEW_LINE>mDragMinTouchY = Math.min(mDragMinTouchY, mLastTouchY);<NEW_LINE>mDragMaxTouchX = Math.max(mDragMaxTouchX, mLastTouchX);<NEW_LINE>mDragMaxTouchY = <MASK><NEW_LINE>// update drag direction mask<NEW_LINE>updateDragDirectionMask();<NEW_LINE>// update decorators<NEW_LINE>final boolean updated = mDraggingItemDecorator.update(getLastTouchX(), getLastTouchY(), false);<NEW_LINE>if (updated) {<NEW_LINE>if (mSwapTargetItemOperator != null) {<NEW_LINE>mSwapTargetItemOperator.update(mDraggingItemDecorator.getDraggingItemTranslationX(), mDraggingItemDecorator.getDraggingItemTranslationY());<NEW_LINE>}<NEW_LINE>// check swapping<NEW_LINE>checkItemSwapping(rv);<NEW_LINE>onItemMoveDistanceUpdated();<NEW_LINE>}<NEW_LINE>}
Math.max(mDragMaxTouchY, mLastTouchY);
553,749
private Task<List<SmartReplySuggestion>> generateReplies(List<Message> messages, boolean isEmulatingRemoteUser) {<NEW_LINE>Message lastMessage = Iterables.getLast(messages);<NEW_LINE>// If the last message in the chat thread is not sent by the "other" user, don't generate<NEW_LINE>// smart replies.<NEW_LINE>if (lastMessage.isLocalUser != isEmulatingRemoteUser) {<NEW_LINE>return Tasks.forException(new Exception("Not running smart reply!"));<NEW_LINE>}<NEW_LINE>List<TextMessage> chatHistory = new ArrayList<>();<NEW_LINE>for (Message message : messages) {<NEW_LINE>if (message.isLocalUser != isEmulatingRemoteUser) {<NEW_LINE>chatHistory.add(TextMessage.createForLocalUser(message<MASK><NEW_LINE>} else {<NEW_LINE>chatHistory.add(TextMessage.createForRemoteUser(message.text, message.timestamp, REMOTE_USER_ID));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return smartReply.suggestReplies(chatHistory).continueWith(task -> {<NEW_LINE>SmartReplySuggestionResult result = task.getResult();<NEW_LINE>switch(result.getStatus()) {<NEW_LINE>case SmartReplySuggestionResult.STATUS_NOT_SUPPORTED_LANGUAGE:<NEW_LINE>// This error happens when the detected language is not English, as that is the<NEW_LINE>// only supported language in Smart Reply.<NEW_LINE>Toast.makeText(getApplication(), R.string.error_not_supported_language, Toast.LENGTH_SHORT).show();<NEW_LINE>break;<NEW_LINE>case SmartReplySuggestionResult.STATUS_NO_REPLY:<NEW_LINE>// This error happens when the inference completed successfully, but no replies<NEW_LINE>// were returned.<NEW_LINE>Toast.makeText(getApplication(), R.string.error_no_reply, Toast.LENGTH_SHORT).show();<NEW_LINE>break;<NEW_LINE>// fall out<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>return result.getSuggestions();<NEW_LINE>});<NEW_LINE>}
.text, message.timestamp));
870,024
@ScalarFunction<NEW_LINE>@LiteralParameters({ "x", "y" })<NEW_LINE>@SqlType("varchar(x)")<NEW_LINE>public static Slice urlExtractParameter(@SqlType("varchar(x)") Slice url, @SqlType("varchar(y)") Slice parameterName) {<NEW_LINE>URI uri = parseUrl(url);<NEW_LINE>if ((uri == null) || (uri.getRawQuery() == null)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String parameter = parameterName.toStringUtf8();<NEW_LINE>Iterable<String> queryArgs = QUERY_SPLITTER.split(uri.getRawQuery());<NEW_LINE>for (String queryArg : queryArgs) {<NEW_LINE>Iterator<String> arg = ARG_SPLITTER.split(queryArg).iterator();<NEW_LINE>if (arg.next().equals(parameter)) {<NEW_LINE>if (arg.hasNext()) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>// first matched key is empty<NEW_LINE>return Slices.EMPTY_SLICE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// no key matched<NEW_LINE>return null;<NEW_LINE>}
decodeUrl(arg.next());
806,272
public static Map<CurrencyPair, Fee> adaptDynamicTradingFees(BitfinexTradingFeeResponse[] responses, List<CurrencyPair> currencyPairs) {<NEW_LINE>Map<CurrencyPair, Fee> result = new HashMap<>();<NEW_LINE>for (BitfinexTradingFeeResponse response : responses) {<NEW_LINE>BitfinexTradingFeeResponse.BitfinexTradingFeeResponseRow[] responseRows = response.getTradingFees();<NEW_LINE>for (BitfinexTradingFeeResponse.BitfinexTradingFeeResponseRow responseRow : responseRows) {<NEW_LINE>Currency currency = Currency.getInstance(responseRow.getCurrency());<NEW_LINE>BigDecimal percentToFraction = BigDecimal.ONE.divide(BigDecimal<MASK><NEW_LINE>Fee fee = new Fee(responseRow.getMakerFee().multiply(percentToFraction), responseRow.getTakerFee().multiply(percentToFraction));<NEW_LINE>for (CurrencyPair pair : currencyPairs) {<NEW_LINE>// Fee to trade for a currency is the fee to trade currency pairs with this base.<NEW_LINE>// Fee is typically assessed in units counter.<NEW_LINE>if (pair.base.equals(currency)) {<NEW_LINE>if (result.put(pair, fee) != null) {<NEW_LINE>throw new IllegalStateException("Fee for currency pair " + pair + " is overspecified");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.ONE.scaleByPowerOfTen(2));
446,731
private void generateRelationshipMapperFile(org.odpi.openmetadata.fvt.opentypes.model.OmrsBeanRelationship omrsBeanRelationship, String fileName) throws IOException {<NEW_LINE>FileWriter outputFileWriter = null;<NEW_LINE>BufferedReader reader = null;<NEW_LINE>try {<NEW_LINE>outputFileWriter = new FileWriter(fileName);<NEW_LINE>String label = omrsBeanRelationship.label;<NEW_LINE>Map<String, String> <MASK><NEW_LINE>List<String> loopRelationshipLines = new ArrayList<>();<NEW_LINE>reader = new BufferedReader(new FileReader(RELATIONSHIP_MAPPER_TEMPLATE));<NEW_LINE>String line = reader.readLine();<NEW_LINE>while (line != null) {<NEW_LINE>replacementMap.put("uname", GeneratorUtilities.uppercase1stLetter(label));<NEW_LINE>replacementMap.put("name", GeneratorUtilities.lowercase1stLetter(label));<NEW_LINE>loopRelationshipLines.add(line);<NEW_LINE>line = reader.readLine();<NEW_LINE>}<NEW_LINE>mapOMRSToOMAS("Relationship", replacementMap, outputFileWriter, loopRelationshipLines, label);<NEW_LINE>} finally {<NEW_LINE>closeReaderAndFileWriter(outputFileWriter, reader);<NEW_LINE>}<NEW_LINE>}
replacementMap = new HashMap<>();
1,340,482
private void processECR() {<NEW_LINE>// Get Requests with Request Type-AutoChangeRequest and Group with info<NEW_LINE>resetCounter();<NEW_LINE>StringBuffer whereClause = new StringBuffer("M_ChangeRequest_ID IS NULL" + " AND EXISTS(" + "SELECT 1 FROM R_RequestType rt " + "WHERE rt.R_RequestType_ID = R_Request.R_RequestType_ID" + " AND rt.IsAutoChangeRequest='Y')" + "AND EXISTS (" + "SELECT 1 FROM R_Group g " + "WHERE g.R_Group_ID = R_Request.R_Group_ID" + " AND (g.M_BOM_ID IS NOT NULL OR g.M_ChangeNotice_ID IS NOT NULL) )");<NEW_LINE>// Query for request<NEW_LINE>new Query(getCtx(), I_R_Request.Table_Name, whereClause.toString(), null).setOrderBy(I_R_Request.COLUMNNAME_R_Status_ID).<MRequest>list().forEach(request -> {<NEW_LINE>MGroup requestGroup = MGroup.get(getCtx(), request.getR_Group_ID());<NEW_LINE>MChangeRequest changeRequest = new MChangeRequest(request, requestGroup);<NEW_LINE>if (request.save()) {<NEW_LINE>request.<MASK><NEW_LINE>if (request.save()) {<NEW_LINE>addMailCount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addRecordCount();<NEW_LINE>});<NEW_LINE>m_summary.append("Auto Change Request #").append(count);<NEW_LINE>if ((count - mailCount) > 0)<NEW_LINE>m_summary.append("(fail=").append((count - mailCount)).append(")");<NEW_LINE>m_summary.append(" - ");<NEW_LINE>}
setM_ChangeRequest_ID(changeRequest.getM_ChangeRequest_ID());
566,759
protected List<IntelHexRecord> dumpMemory(Program program, Memory memory, AddressSetView addrSetView, TaskMonitor monitor) throws MemoryAccessException {<NEW_LINE>int size = (int) recordSizeOption.getValue();<NEW_LINE>boolean dropBytes = recordSizeOption.dropExtraBytes();<NEW_LINE>IntelHexRecordWriter writer = new IntelHexRecordWriter(size, dropBytes);<NEW_LINE>AddressSet set = new AddressSet(addrSetView);<NEW_LINE>MemoryBlock[] blocks = memory.getBlocks();<NEW_LINE>for (MemoryBlock block : blocks) {<NEW_LINE>if (!block.isInitialized() || block.getStart().getAddressSpace() != addressSpaceOption.getValue()) {<NEW_LINE>set.delete(new AddressRangeImpl(block.getStart(), block.getEnd()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AddressIterator addresses = set.getAddresses(true);<NEW_LINE>while (addresses.hasNext()) {<NEW_LINE>Address address = addresses.next();<NEW_LINE>byte b = memory.getByte(address);<NEW_LINE>writer.addByte(address, b);<NEW_LINE>}<NEW_LINE>Address entryPoint = null;<NEW_LINE>AddressIterator entryPointIterator = program.getSymbolTable().getExternalEntryPointIterator();<NEW_LINE>while (entryPoint == null && entryPointIterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (set.contains(address)) {<NEW_LINE>entryPoint = address;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return writer.finish(entryPoint);<NEW_LINE>}
Address address = entryPointIterator.next();
1,636,310
protected Future<Void> onExecute(SQLRequest<SQLCreateIndexStatement> request, MycatDataContext dataContext, Response response) {<NEW_LINE>LockService lockService = MetaClusterCurrent.wrapper(LockService.class);<NEW_LINE>return lockService.lock(DDL_LOCK, () -> {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>SQLExprTableSource table = (SQLExprTableSource) sqlCreateIndexStatement.getTable();<NEW_LINE>resolveSQLExprTableSource(table, dataContext);<NEW_LINE>String schema = SQLUtils.normalize(sqlCreateIndexStatement.getSchema());<NEW_LINE>String tableName = SQLUtils.normalize(sqlCreateIndexStatement.getTableName());<NEW_LINE>MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);<NEW_LINE>if (!sqlCreateIndexStatement.isGlobal()) {<NEW_LINE>SQLCreateIndexStatement clone = sqlCreateIndexStatement.clone();<NEW_LINE>createLocalIndex(clone, schema, tableName, metadataManager);<NEW_LINE>}<NEW_LINE>createGlobalIndex(sqlCreateIndexStatement);<NEW_LINE>return response.sendOk();<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>return response.sendError(throwable);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
SQLCreateIndexStatement sqlCreateIndexStatement = request.getAst();
734,798
public void initPlugin() {<NEW_LINE>// init rate controller<NEW_LINE>MetricUploader.rateController.init(nimbusData.getConf());<NEW_LINE>String metricUploadClass = ConfigExtension.getMetricUploaderClass(nimbusData.getConf());<NEW_LINE>if (StringUtils.isBlank(metricUploadClass)) {<NEW_LINE>metricUploadClass = DefaultMetricUploader.class.getName();<NEW_LINE>}<NEW_LINE>// init metric uploader<NEW_LINE>LOG.info("metric uploader classes:{}", metricUploadClass);<NEW_LINE>String[] <MASK><NEW_LINE>for (String klass : classes) {<NEW_LINE>klass = klass.trim();<NEW_LINE>if (StringUtils.isBlank(klass)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object instance = Utils.newInstance(klass);<NEW_LINE>if (!(instance instanceof MetricUploader)) {<NEW_LINE>throw new RuntimeException(klass + " isn't MetricUploader class ");<NEW_LINE>}<NEW_LINE>MetricUploader metricUploader = (MetricUploader) instance;<NEW_LINE>try {<NEW_LINE>metricUploader.init(nimbusData);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>metricUploaders.add(metricUploader);<NEW_LINE>LOG.info("Successfully init metric uploaders:{}", metricUploaders);<NEW_LINE>}<NEW_LINE>this.lastMetricUploader = metricUploaders.get(metricUploaders.size() - 1);<NEW_LINE>// init metric query client<NEW_LINE>String metricQueryClientClass = ConfigExtension.getMetricQueryClientClass(nimbusData.getConf());<NEW_LINE>if (!StringUtils.isBlank(metricQueryClientClass)) {<NEW_LINE>LOG.info("metric query client class:{}", metricQueryClientClass);<NEW_LINE>this.metricQueryClient = (MetricQueryClient) Utils.newInstance(metricQueryClientClass);<NEW_LINE>} else {<NEW_LINE>LOG.warn("use default metric query client class.");<NEW_LINE>this.metricQueryClient = new DefaultMetricQueryClient();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metricQueryClient.init(nimbusData.getConf());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>LOG.info("Successfully init MetricQureyClient ");<NEW_LINE>this.metricUploaderDelegate = new MetricUploaderDelegate();<NEW_LINE>this.readyToUpload.set(true);<NEW_LINE>}
classes = metricUploadClass.split(",");
1,654,497
public void onResume() {<NEW_LINE>// hook up to receive completion events<NEW_LINE>backgroundTasks.formSyncTask.setDiskSyncListener(this);<NEW_LINE>if (backgroundTasks.deleteFormsTask != null) {<NEW_LINE>backgroundTasks.deleteFormsTask.setDeleteListener(this);<NEW_LINE>}<NEW_LINE>super.onResume();<NEW_LINE>// async task may have completed while we were reorienting...<NEW_LINE>if (backgroundTasks.formSyncTask.getStatus() == AsyncTask.Status.FINISHED) {<NEW_LINE>syncComplete(backgroundTasks.formSyncTask.getStatusMessage());<NEW_LINE>}<NEW_LINE>if (backgroundTasks.deleteFormsTask != null && backgroundTasks.deleteFormsTask.getStatus() == AsyncTask.Status.FINISHED) {<NEW_LINE>deleteComplete(<MASK><NEW_LINE>}<NEW_LINE>if (backgroundTasks.deleteFormsTask == null) {<NEW_LINE>DialogFragmentUtils.dismissDialog(MaterialProgressDialogFragment.class, getActivity().getSupportFragmentManager());<NEW_LINE>}<NEW_LINE>}
backgroundTasks.deleteFormsTask.getDeleteCount());
1,204,818
// computes the cross rate<NEW_LINE>private static FxRate computeCross(FxRate fx1, FxRate fx2, CurrencyPair crossPairAC) {<NEW_LINE>// aim is to convert AAA/BBB and BBB/CCC to AAA/CCC<NEW_LINE>Currency currA = crossPairAC.getBase();<NEW_LINE>Currency currC = crossPairAC.getCounter();<NEW_LINE>// given the conventional cross rate pair, order the two rates to match<NEW_LINE>boolean crossBaseCurrencyInFx1 = fx1.pair.contains(currA);<NEW_LINE><MASK><NEW_LINE>FxRate fxBCorCB = crossBaseCurrencyInFx1 ? fx2 : fx1;<NEW_LINE>// extract the rates, taking the inverse if the pair is in the inverse order<NEW_LINE>double rateAB = fxABorBA.getPair().getBase().equals(currA) ? fxABorBA.rate : 1d / fxABorBA.rate;<NEW_LINE>double rateBC = fxBCorCB.getPair().getCounter().equals(currC) ? fxBCorCB.rate : 1d / fxBCorCB.rate;<NEW_LINE>return FxRate.of(crossPairAC, rateAB * rateBC);<NEW_LINE>}
FxRate fxABorBA = crossBaseCurrencyInFx1 ? fx1 : fx2;
879,045
private static void fillRwadefOperation(Operation swaggerOperation, Resource resource, Contract contract, String methodName, List<String> produces, List<String> consumes, Map<String, Object> parameters) {<NEW_LINE>if (swaggerOperation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>org.restlet.ext.platform.internal.model.Operation operation = new org.restlet.ext.platform.internal.model.Operation();<NEW_LINE>operation.addProduces(produces);<NEW_LINE>operation.addProduces(swaggerOperation.getProduces());<NEW_LINE>operation.addConsumes(consumes);<NEW_LINE>operation.addConsumes(swaggerOperation.getConsumes());<NEW_LINE>operation.setDescription(swaggerOperation.getDescription());<NEW_LINE>operation.setMethod(methodName);<NEW_LINE>operation.setName(swaggerOperation.getOperationId());<NEW_LINE>fillRwadefParameters(swaggerOperation, operation, resource, parameters);<NEW_LINE>fillRwadefResponses(swaggerOperation, operation, contract, parameters);<NEW_LINE>fillInputPayload(swaggerOperation, operation, contract);<NEW_LINE>resource.<MASK><NEW_LINE>}
getOperations().add(operation);
1,286,454
private void insertSelectedIncludedRecords(final PInstanceId pinstanceId, final Set<TableRecordReference> recordRefs) {<NEW_LINE>if (recordRefs.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>final ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.<MASK><NEW_LINE>int nextSeqNo = 1;<NEW_LINE>for (final TableRecordReference recordRef : recordRefs) {<NEW_LINE>final int seqNo = nextSeqNo;<NEW_LINE>nextSeqNo++;<NEW_LINE>final Object[] sqlParams = new Object[] { pinstanceId, recordRef.getAD_Table_ID(), recordRef.getRecord_ID(), seqNo };<NEW_LINE>DB.setParameters(pstmt, sqlParams);<NEW_LINE>pstmt.addBatch();<NEW_LINE>}<NEW_LINE>pstmt.executeBatch();<NEW_LINE>} catch (final SQLException ex) {<NEW_LINE>throw new DBException(ex, SQL_SelectAll_AD_PInstance_SelectedIncludedRecords);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
prepareStatement(SQL_InsertInto_AD_PInstance_SelectedIncludedRecords, ITrx.TRXNAME_ThreadInherited);
412,941
private void unsafeRegisterConfChange(final Configuration oldConf, final Configuration newConf, final Closure done) {<NEW_LINE>Requires.requireTrue(newConf.isValid(), "Invalid new conf: %s", newConf);<NEW_LINE>// The new conf entry(will be stored in log manager) should be valid<NEW_LINE>Requires.requireTrue(new ConfigurationEntry(null, newConf, oldConf).isValid(), "Invalid conf entry: %s", newConf);<NEW_LINE>if (this.state != State.STATE_LEADER) {<NEW_LINE>LOG.warn("Node {} refused configuration changing as the state={}.", getNodeId(), this.state);<NEW_LINE>if (done != null) {<NEW_LINE>final Status status = new Status();<NEW_LINE>if (this.state == State.STATE_TRANSFERRING) {<NEW_LINE>status.setError(RaftError.EBUSY, "Is transferring leadership.");<NEW_LINE>} else {<NEW_LINE>status.setError(RaftError.EPERM, "Not leader");<NEW_LINE>}<NEW_LINE>Utils.runClosureInThread(done, status);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check concurrent conf change<NEW_LINE>if (this.confCtx.isBusy()) {<NEW_LINE>LOG.warn("Node {} refused configuration concurrent changing.", getNodeId());<NEW_LINE>if (done != null) {<NEW_LINE>Utils.runClosureInThread(done, new Status(RaftError.EBUSY, "Doing another configuration change."));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Return immediately when the new peers equals to current configuration<NEW_LINE>if (this.conf.getConf().equals(newConf)) {<NEW_LINE>Utils.runClosureInThread(done);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.confCtx.<MASK><NEW_LINE>}
start(oldConf, newConf, done);
1,806,109
private void parseRequestData(IncomingWss incomingRequestWss) {<NEW_LINE>ByteArrayInputStream in = request == null ? new ByteArrayInputStream(new byte[0<MASK><NEW_LINE>try {<NEW_LINE>requestContentType = requestHeaders.get("Content-Type", "");<NEW_LINE>if (requestContentType != null && requestContentType.toUpperCase().startsWith("MULTIPART")) {<NEW_LINE>StringToStringMap values = StringToStringMap.fromHttpHeader(requestContentType);<NEW_LINE>requestMmSupport = new MultipartMessageSupport(new MonitorMessageExchangeDataSource("monitor request", in, requestContentType), values.get("start"), null, true, false);<NEW_LINE>requestContentType = requestMmSupport.getRootPart() != null ? requestMmSupport.getRootPart().getContentType() : null;<NEW_LINE>} else {<NEW_LINE>String charset = getCharset(requestHeaders);<NEW_LINE>this.requestContent = charset == null ? Tools.readAll(in, 0).toString() : Tools.readAll(in, 0).toString(charset);<NEW_LINE>}<NEW_LINE>processRequestWss(incomingRequestWss);<NEW_LINE>if (checkParse()) {<NEW_LINE>operation = findOperation();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>SoapUI.logError(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>in.close();<NEW_LINE>} catch (IOException e1) {<NEW_LINE>SoapUI.logError(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
]) : new ByteArrayInputStream(request);
552,888
public boolean intersectsBox(BoundingBox box, TempVars vars) {<NEW_LINE>Vector3f axis1 = getScaledAxis(0, vars.vect1);<NEW_LINE>Vector3f axis2 = getScaledAxis(1, vars.vect2);<NEW_LINE>Vector3f axis3 = getScaledAxis(2, vars.vect3);<NEW_LINE>Vector3f tn = vars.vect4;<NEW_LINE>Plane p = vars.plane;<NEW_LINE>Vector3f c = box.getCenter();<NEW_LINE>p.setNormal(0, 0, -1);<NEW_LINE>p.setConstant(-(c.z + box.getZExtent()));<NEW_LINE>if (!insidePlane(p, axis1, axis2, axis3, tn))<NEW_LINE>return false;<NEW_LINE>p.setNormal(0, 0, 1);<NEW_LINE>p.setConstant(c.z - box.getZExtent());<NEW_LINE>if (!insidePlane(p, axis1, axis2, axis3, tn))<NEW_LINE>return false;<NEW_LINE>p.setNormal(0, -1, 0);<NEW_LINE>p.setConstant(-(c.y <MASK><NEW_LINE>if (!insidePlane(p, axis1, axis2, axis3, tn))<NEW_LINE>return false;<NEW_LINE>p.setNormal(0, 1, 0);<NEW_LINE>p.setConstant(c.y - box.getYExtent());<NEW_LINE>if (!insidePlane(p, axis1, axis2, axis3, tn))<NEW_LINE>return false;<NEW_LINE>p.setNormal(-1, 0, 0);<NEW_LINE>p.setConstant(-(c.x + box.getXExtent()));<NEW_LINE>if (!insidePlane(p, axis1, axis2, axis3, tn))<NEW_LINE>return false;<NEW_LINE>p.setNormal(1, 0, 0);<NEW_LINE>p.setConstant(c.x - box.getXExtent());<NEW_LINE>return insidePlane(p, axis1, axis2, axis3, tn);<NEW_LINE>}
+ box.getYExtent()));
380,190
public void save(Message message) {<NEW_LINE>// Save message to "messages"<NEW_LINE>Datastore datastore = getDatastoreInstance();<NEW_LINE>Key key = datastore.allocateId(keyFactory.newKey());<NEW_LINE>Entity.Builder messageEntityBuilder = Entity.newBuilder(key).set("messageId", message.getMessageId());<NEW_LINE>String translated = message.getTranslated();<NEW_LINE>if (translated != null) {<NEW_LINE>messageEntityBuilder = messageEntityBuilder.set("data", translated);<NEW_LINE>}<NEW_LINE>if (message.getPublishTime() != null) {<NEW_LINE>messageEntityBuilder = messageEntityBuilder.set("publishTime", message.getPublishTime());<NEW_LINE>}<NEW_LINE>if (message.getSourceLang() != null) {<NEW_LINE>messageEntityBuilder = messageEntityBuilder.set("sourceLang", message.getSourceLang());<NEW_LINE>}<NEW_LINE>if (message.getTargetLang() != null) {<NEW_LINE>messageEntityBuilder = messageEntityBuilder.set(<MASK><NEW_LINE>}<NEW_LINE>datastore.put(messageEntityBuilder.build());<NEW_LINE>}
"targetLang", message.getTargetLang());
1,460,479
public CompletableFuture<MessagingService> start() {<NEW_LINE>if (started.get()) {<NEW_LINE>log.warn("Already running at local address: {}", advertisedAddress);<NEW_LINE>return CompletableFuture.completedFuture(this);<NEW_LINE>}<NEW_LINE>final CompletableFuture<Void> serviceLoader;<NEW_LINE>if (config.isTlsEnabled()) {<NEW_LINE>serviceLoader = loadServerSslContext().thenCompose(ok -> loadClientSslContext());<NEW_LINE>} else {<NEW_LINE>serviceLoader = CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>initTransport();<NEW_LINE>return serviceLoader.thenCompose(ok -> bootstrapServer()).thenRun(() -> {<NEW_LINE>timeoutExecutor = Executors.newSingleThreadScheduledExecutor(new DefaultThreadFactory("netty-messaging-timeout-"));<NEW_LINE>localConnection = new LocalClientConnection(handlers);<NEW_LINE>started.set(true);<NEW_LINE>log.info("Started messaging service bound to {}, advertising {}, and using {}", bindingAddresses, advertisedAddress, config.isTlsEnabled() ? "TLS" : "plaintext");<NEW_LINE>}<MASK><NEW_LINE>}
).thenApply(v -> this);
1,284,640
public boolean apply(Game game, Ability source) {<NEW_LINE>Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));<NEW_LINE>String cardName = (String) game.getState().getValue(source.getSourceId().<MASK><NEW_LINE>if (targetPlayer == null || cardName == null || cardName.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cardsToReveal = new CardsImpl();<NEW_LINE>Card namedCard = null;<NEW_LINE>for (Card card : targetPlayer.getLibrary().getCards(game)) {<NEW_LINE>cardsToReveal.add(card);<NEW_LINE>if (CardUtil.haveSameNames(card, cardName, game)) {<NEW_LINE>namedCard = card;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>targetPlayer.revealCards(source, cardsToReveal, game);<NEW_LINE>if (namedCard != null) {<NEW_LINE>cardsToReveal.remove(namedCard);<NEW_LINE>targetPlayer.moveCards(cardsToReveal, Zone.GRAVEYARD, source, game);<NEW_LINE>targetPlayer.putCardsOnTopOfLibrary(new CardsImpl(namedCard), game, source, true);<NEW_LINE>} else {<NEW_LINE>targetPlayer.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
toString() + ChooseACardNameEffect.INFO_KEY);
355,447
public void deleteTenantSettings(UUID tenantId) {<NEW_LINE>long startTimeMillis = System.currentTimeMillis();<NEW_LINE>String parameterStorePath = "/" + SAAS_BOOST_PREFIX + "/" + SAAS_BOOST_ENV + "/tenant/" + tenantId.toString();<NEW_LINE>List<String> parametersToDelete = SettingsService.TENANT_PARAMS.stream().map(s -> parameterStorePath + "/" + s).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>DeleteParametersResponse response = ssm.deleteParameters(r -> r.names(parametersToDelete));<NEW_LINE>LOGGER.info("SettingsServiceDAL::deleteTenantSettings removed " + response.deletedParameters().toString());<NEW_LINE>if (response.hasInvalidParameters() && !response.invalidParameters().isEmpty()) {<NEW_LINE>LOGGER.warn("SettingsServiceDAL::deleteTenantSettings invalid parameters " + response.invalidParameters().toString());<NEW_LINE>}<NEW_LINE>} catch (SdkServiceException ssmError) {<NEW_LINE>LOGGER.error("ssm:DeleteParameters error " + ssmError.getMessage());<NEW_LINE>throw ssmError;<NEW_LINE>}<NEW_LINE>long totalTimeMillis <MASK><NEW_LINE>LOGGER.info("SettingsServiceDAL::deleteTenantSettings exec " + totalTimeMillis);<NEW_LINE>return;<NEW_LINE>}
= System.currentTimeMillis() - startTimeMillis;
331,980
public static void main(String[] args) throws Exception {<NEW_LINE>WordprocessingMLPackage wordMLPackage = Docx4J.load(new java.io.File("manyFootnotes.docx"));<NEW_LINE>MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();<NEW_LINE>// Setup FootnotesPart if necessary,<NEW_LINE>// along with DocumentSettings<NEW_LINE>FootnotesPart footnotesPart = mdp.getFootnotesPart();<NEW_LINE>if (footnotesPart == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Delete the footnotes part.<NEW_LINE>mdp.getRelationshipsPart().removePart(footnotesPart.getPartName());<NEW_LINE>// Now go through the document, deleting...<NEW_LINE>Body body = mdp.getJaxbElement().getBody();<NEW_LINE>ClassFinder finder = new ClassFinder(CTFtnEdnRef.class);<NEW_LINE>try {<NEW_LINE>new TraversalUtil(wordMLPackage.getMainDocumentPart().getContents(), finder);<NEW_LINE>} catch (Docx4JException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>List results = finder.results;<NEW_LINE>System.out.println("Found " + results.size());<NEW_LINE>int i = 1;<NEW_LINE>for (Object o : results) {<NEW_LINE>CTFtnEdnRef result1 = (CTFtnEdnRef) o;<NEW_LINE>// System.out.println(result1.getParent().getClass().getName());<NEW_LINE>R r = (R) result1.getParent();<NEW_LINE>// Its actually wrapped in JAXBEelement, so won't work<NEW_LINE>// System.out.println(r.getContent().remove(result1));<NEW_LINE>if (r.getContent().size() == 1) {<NEW_LINE>r.getContent().clear();<NEW_LINE>} else {<NEW_LINE>System.out.println("Cowardly keeping " + i);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>if ((i % 100) == 0)<NEW_LINE>System.out.println(i);<NEW_LINE>}<NEW_LINE>if (mdp.getDocumentSettingsPart() != null && mdp.getDocumentSettingsPart().getJaxbElement().getFootnotePr() != null) {<NEW_LINE>// Word 2016 can't open the document if this is still present!<NEW_LINE>mdp.getDocumentSettingsPart().getJaxbElement().setFootnotePr(null);<NEW_LINE>}<NEW_LINE>// Save it<NEW_LINE>String filename = System.getProperty("user.dir") + "/OUT_FootnotesRemove.docx";<NEW_LINE>wordMLPackage.save(new java.io.File(filename));<NEW_LINE>System.out.println("Saved " + filename);<NEW_LINE>}
System.out.println("No FootnotesPart, so nothing to do. ");
302,629
private SAMRecord createSamRecord(final SAMFileHeader header, final String baseName, final FastqRecord frec, final boolean paired) {<NEW_LINE>final SAMRecord srec = new SAMRecord(header);<NEW_LINE>srec.setReadName(baseName);<NEW_LINE>srec.<MASK><NEW_LINE>srec.setReadUnmappedFlag(true);<NEW_LINE>srec.setAttribute(ReservedTagConstants.READ_GROUP_ID, READ_GROUP_NAME);<NEW_LINE>final byte[] quals = StringUtil.stringToBytes(frec.getBaseQualityString());<NEW_LINE>convertQuality(quals, QUALITY_FORMAT);<NEW_LINE>for (final byte qual : quals) {<NEW_LINE>final int uQual = qual & 0xff;<NEW_LINE>if (uQual < MIN_Q || uQual > MAX_Q) {<NEW_LINE>throw new PicardException("Base quality " + uQual + " is not in the range " + MIN_Q + ".." + MAX_Q + " for read " + frec.getReadHeader());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>srec.setBaseQualities(quals);<NEW_LINE>if (paired) {<NEW_LINE>srec.setReadPairedFlag(true);<NEW_LINE>srec.setMateUnmappedFlag(true);<NEW_LINE>}<NEW_LINE>return srec;<NEW_LINE>}
setReadString(frec.getReadString());
1,696,645
final GetMediaForFragmentListResult executeGetMediaForFragmentList(GetMediaForFragmentListRequest getMediaForFragmentListRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMediaForFragmentListRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMediaForFragmentListRequest> request = null;<NEW_LINE>Response<GetMediaForFragmentListResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMediaForFragmentListRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMediaForFragmentListRequest));<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, "Kinesis Video Archived Media");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMediaForFragmentList");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMediaForFragmentListResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(true), new GetMediaForFragmentListResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>response.getAwsResponse().setPayload(new com.amazonaws.util.ServiceClientHolderInputStream(response.getAwsResponse()<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.HAS_STREAMING_OUTPUT, Boolean.TRUE);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
.getPayload(), this));
1,322,937
public <T> T run(Operation<T> f) {<NEW_LINE>TaskState retryState = state.nestedState(stateKey);<NEW_LINE>TaskState operationState = retryState.nestedState(OPERATION);<NEW_LINE>T result;<NEW_LINE>try {<NEW_LINE>result = f.perform(operationState);<NEW_LINE>} catch (TaskExecutionException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>String <MASK><NEW_LINE>if (!retry(e)) {<NEW_LINE>logger.warn("{}: giving up", formattedErrorMessage, e);<NEW_LINE>throw new TaskExecutionException(e);<NEW_LINE>}<NEW_LINE>int retryIteration = retryState.params().get(RETRY, int.class, 0);<NEW_LINE>retryState.params().set(RETRY, retryIteration + 1);<NEW_LINE>int interval = (int) Math.min(retryInterval.min().getSeconds() * Math.pow(2, retryIteration), retryInterval.max().getSeconds());<NEW_LINE>logger.warn("{}: retrying in {} seconds", formattedErrorMessage, interval, e);<NEW_LINE>throw state.pollingTaskExecutionException(interval);<NEW_LINE>}<NEW_LINE>// Clear retry state<NEW_LINE>retryState.params().remove(RETRY);<NEW_LINE>return result;<NEW_LINE>}
formattedErrorMessage = errorMessageFunction.apply(e);
1,075,995
private static boolean allowInstantRename(CompilationInfo info, Element e, ElementUtilities eu) {<NEW_LINE>if (e.getKind() == ElementKind.FIELD) {<NEW_LINE>VariableElement variableElement = (VariableElement) e;<NEW_LINE>TypeElement typeElement = eu.enclosingTypeElement(e);<NEW_LINE>boolean isProperty = false;<NEW_LINE>try {<NEW_LINE>CodeStyle codeStyle = CodeStyle.getDefault(info.getDocument());<NEW_LINE>isProperty = eu.<MASK><NEW_LINE>isProperty = isProperty || (!variableElement.getModifiers().contains(Modifier.FINAL) && eu.hasSetter(typeElement, variableElement, codeStyle));<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>if (isProperty) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (org.netbeans.modules.java.editor.base.semantic.Utilities.isPrivateElement(e)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (isInaccessibleOutsideOuterClass(e, eu)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// #92160: check for local classes:<NEW_LINE>if (e.getKind() == ElementKind.CLASS) {<NEW_LINE>// only classes can be local<NEW_LINE>Element enclosing = e.getEnclosingElement();<NEW_LINE>final ElementKind enclosingKind = enclosing.getKind();<NEW_LINE>// #150352: parent is annonymous class<NEW_LINE>if (enclosingKind == ElementKind.CLASS) {<NEW_LINE>final Set<ElementKind> fm = EnumSet.of(ElementKind.METHOD, ElementKind.FIELD);<NEW_LINE>if (enclosing.getSimpleName().length() == 0 || fm.contains(enclosing.getEnclosingElement().getKind())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return LOCAL_CLASS_PARENTS.contains(enclosingKind);<NEW_LINE>}<NEW_LINE>if (e.getKind() == ElementKind.TYPE_PARAMETER) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
hasGetter(typeElement, variableElement, codeStyle);
285,840
public static void showExceptionDialog(Window parent, Thread t, Throwable e) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<html>---------- Bug report ----------\n");<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append("<b>Please include a description about what actions you were " + "performing when the exception occurred:</b>\n");<NEW_LINE>sb.append("<i>(You can edit text directly in this window)</i>\n");<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append("1. \n");<NEW_LINE>sb.append("2. \n");<NEW_LINE>sb.append("3. \n");<NEW_LINE><MASK><NEW_LINE>sb.append('\n');<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append("(Do not modify anything below this line.)\n");<NEW_LINE>sb.append("---------- Exception stack trace ----------\n");<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>PrintWriter pw = new PrintWriter(sw);<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>String stackTrace = unformatHTML(String.valueOf(sw.getBuffer()));<NEW_LINE>sb.append(stackTrace);<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append("---------- Thread information ----------\n");<NEW_LINE>if (t == null) {<NEW_LINE>sb.append("Thread is not specified.");<NEW_LINE>} else {<NEW_LINE>sb.append(t + "\n");<NEW_LINE>}<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append("---------- System information ----------\n");<NEW_LINE>addSystemInformation(sb);<NEW_LINE>sb.append("---------- Error log ----------\n");<NEW_LINE>addErrorLog(sb);<NEW_LINE>sb.append("---------- End of bug report ----------</html>\n");<NEW_LINE>sb.append('\n');<NEW_LINE>// // <html><b>Please include a short description about what you were doing when the exception occurred.</b><NEW_LINE>BugReportDialog // // <html><b>Please include a short description about what you were doing when the exception occurred.</b><NEW_LINE>reportDialog = new BugReportDialog(parent, trans.get("bugreport.reportDialog.txt2"), sb.toString(), true);<NEW_LINE>reportDialog.setVisible(true);<NEW_LINE>}
sb.append("Include your email address (optional; it helps if we can " + "contact you in case we need additional information):\n");
1,505,689
public Map<UUID, ScheduledTaskFuture<?>> scheduleAtFixedRate(Collection<UUID> memberUUIDs, Runnable runnable, long delay, long period, TimeUnit unit) {<NEW_LINE>HashMap<UUID, ScheduledTaskFuture<?>> result = new HashMap<>(2);<NEW_LINE>if (hzCore.isEnabled()) {<NEW_LINE>Collection<Member> toSubmitTo = selectMembers(memberUUIDs);<NEW_LINE>IScheduledExecutorService scheduledExecutorService = hzCore.getInstance().getScheduledExecutorService(HazelcastCore.SCHEDULED_CLUSTER_EXECUTOR_SERVICE_NAME);<NEW_LINE>Map<Member, IScheduledFuture<Object>> schedule = scheduledExecutorService.<Object>scheduleOnMembersAtFixedRate(runnable, toSubmitTo, delay, period, unit);<NEW_LINE>for (Entry<Member, IScheduledFuture<Object>> entry : schedule.entrySet()) {<NEW_LINE>Member member = entry.getKey();<NEW_LINE>result.put(member.getUuid(), new ScheduledTaskFuture<><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(entry.getValue()));
1,560,981
public static void signUp(Start start, io.supertokens.pluginInterface.thirdparty.UserInfo userInfo) throws StorageQueryException, StorageTransactionLogicException {<NEW_LINE>start.startTransaction(con -> {<NEW_LINE>Connection sqlCon = (Connection) con.getConnection();<NEW_LINE>try {<NEW_LINE>{<NEW_LINE>String QUERY = "INSERT INTO " + getConfig(start).getUsersTable() + "(user_id, recipe_id, time_joined)" + " VALUES(?, ?, ?)";<NEW_LINE>update(sqlCon, QUERY, pst -> {<NEW_LINE>pst.setString(1, userInfo.id);<NEW_LINE>pst.setString(2, THIRD_PARTY.toString());<NEW_LINE>pst.<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>{<NEW_LINE>String QUERY = "INSERT INTO " + getConfig(start).getThirdPartyUsersTable() + "(third_party_id, third_party_user_id, user_id, email, time_joined)" + " VALUES(?, ?, ?, ?, ?)";<NEW_LINE>update(sqlCon, QUERY, pst -> {<NEW_LINE>pst.setString(1, userInfo.thirdParty.id);<NEW_LINE>pst.setString(2, userInfo.thirdParty.userId);<NEW_LINE>pst.setString(3, userInfo.id);<NEW_LINE>pst.setString(4, userInfo.email);<NEW_LINE>pst.setLong(5, userInfo.timeJoined);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>sqlCon.commit();<NEW_LINE>} catch (SQLException throwables) {<NEW_LINE>throw new StorageTransactionLogicException(throwables);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
setLong(3, userInfo.timeJoined);
454,106
protected Future<KafkaUserStatus> createOrUpdate(Reconciliation reconciliation, KafkaUser resource) {<NEW_LINE>KafkaUserModel user;<NEW_LINE>KafkaUserStatus userStatus = new KafkaUserStatus();<NEW_LINE>try {<NEW_LINE>user = KafkaUserModel.fromCrd(resource, config.getSecretPrefix(), config.isAclsAdminApiSupported());<NEW_LINE>LOGGER.debugCr(reconciliation, "Updating User {} in namespace {}", reconciliation.name(), reconciliation.namespace());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warnCr(reconciliation, e);<NEW_LINE>StatusUtils.setStatusConditionAndObservedGeneration(resource, userStatus<MASK><NEW_LINE>return Future.failedFuture(new ReconciliationException(userStatus, e));<NEW_LINE>}<NEW_LINE>Promise<KafkaUserStatus> handler = Promise.promise();<NEW_LINE>secretOperations.getAsync(reconciliation.namespace(), user.getSecretName()).compose(userSecret -> maybeGenerateCredentials(reconciliation, user, userSecret)).compose(ignore -> reconcileCredentialsQuotasAndAcls(reconciliation, user, userStatus)).onComplete(reconciliationResult -> {<NEW_LINE>StatusUtils.setStatusConditionAndObservedGeneration(resource, userStatus, reconciliationResult.mapEmpty());<NEW_LINE>userStatus.setUsername(user.getUserName());<NEW_LINE>if (reconciliationResult.succeeded()) {<NEW_LINE>handler.complete(userStatus);<NEW_LINE>} else {<NEW_LINE>handler.fail(new ReconciliationException(userStatus, reconciliationResult.cause()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return handler.future();<NEW_LINE>}
, Future.failedFuture(e));
1,071,799
static final CompactSketch heapify1to3(final Memory srcMem, final short seedHash) {<NEW_LINE>final int memCap = (int) srcMem.getCapacity();<NEW_LINE>// always 3 for serVer 1<NEW_LINE>final int preLongs = extractPreLongs(srcMem);<NEW_LINE>if (preLongs != 3) {<NEW_LINE>throw new SketchesArgumentException("PreLongs must be 3 for SerVer 1: " + preLongs);<NEW_LINE>}<NEW_LINE>// 1,2,3<NEW_LINE><MASK><NEW_LINE>if ((familyId < 1) || (familyId > 3)) {<NEW_LINE>throw new SketchesArgumentException("Family ID (Sketch Type) must be 1 to 3: " + familyId);<NEW_LINE>}<NEW_LINE>final int curCount = extractCurCount(srcMem);<NEW_LINE>final long thetaLong = extractThetaLong(srcMem);<NEW_LINE>final boolean empty = (curCount == 0) && (thetaLong == Long.MAX_VALUE);<NEW_LINE>if (empty || (memCap <= 24)) {<NEW_LINE>// return empty<NEW_LINE>return EmptyCompactSketch.getInstance();<NEW_LINE>}<NEW_LINE>final int reqCap = (curCount + preLongs) << 3;<NEW_LINE>validateInputSize(reqCap, memCap);<NEW_LINE>if ((thetaLong == Long.MAX_VALUE) && (curCount == 1)) {<NEW_LINE>final long hash = srcMem.getLong(preLongs << 3);<NEW_LINE>return new SingleItemSketch(hash, seedHash);<NEW_LINE>}<NEW_LINE>// theta < 1.0 and/or curCount > 1<NEW_LINE>final long[] compactOrderedCache = new long[curCount];<NEW_LINE>srcMem.getLongArray(preLongs << 3, compactOrderedCache, 0, curCount);<NEW_LINE>return new HeapCompactSketch(compactOrderedCache, false, seedHash, curCount, thetaLong, true);<NEW_LINE>}
final int familyId = extractFamilyID(srcMem);
332,119
private void loadNode428() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, new QualifiedName(0, "Size"), new LocalizedText("en", "Size"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt64, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,145,162
private void updateConfigForCredentialProvider() {<NEW_LINE>String cpPaths = siteConfig.get(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey());<NEW_LINE>if (cpPaths != null && !Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getDefaultValue().equals(cpPaths)) {<NEW_LINE>// Already configured<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File keystoreFile = new File(getConfDir(), "credential-provider.jks");<NEW_LINE>String keystoreUri = "jceks://file" + keystoreFile.getAbsolutePath();<NEW_LINE>Configuration conf = getHadoopConfiguration();<NEW_LINE>HadoopCredentialProvider.setPath(conf, keystoreUri);<NEW_LINE>// Set the URI on the siteCfg<NEW_LINE>siteConfig.put(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey(), keystoreUri);<NEW_LINE>Iterator<Entry<String, String>> entries = siteConfig<MASK><NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Entry<String, String> entry = entries.next();<NEW_LINE>// Not a @Sensitive Property, ignore it<NEW_LINE>if (!Property.isSensitive(entry.getKey())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Add the @Sensitive Property to the CredentialProvider<NEW_LINE>try {<NEW_LINE>HadoopCredentialProvider.createEntry(conf, entry.getKey(), entry.getValue().toCharArray());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.warn("Attempted to add " + entry.getKey() + " to CredentialProvider but failed", e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Only remove it from the siteCfg if we succeeded in adding it to the CredentialProvider<NEW_LINE>entries.remove();<NEW_LINE>}<NEW_LINE>}
.entrySet().iterator();
16,005
// Uses TCCL<NEW_LINE>@Override<NEW_LINE>public Object load(String batchId) {<NEW_LINE>String methodName = "load";<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.entering(<MASK><NEW_LINE>}<NEW_LINE>ClassLoader tccl = Thread.currentThread().getContextClassLoader();<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.fine("TCCL = " + tccl);<NEW_LINE>}<NEW_LINE>initArtifactMapFromClassLoader(tccl);<NEW_LINE>Object loadedArtifact = artifactMap.getArtifactById(batchId);<NEW_LINE>if (loadedArtifact == null) {<NEW_LINE>throw new IllegalArgumentException("Could not load any artifacts with batch id=" + batchId);<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.exiting(CLASSNAME, methodName, "For batch artifact id = " + batchId + ", loaded artifact instance: " + loadedArtifact + " of type: " + loadedArtifact.getClass().getCanonicalName());<NEW_LINE>}<NEW_LINE>return loadedArtifact;<NEW_LINE>}
CLASSNAME, methodName, "Loading batch artifact id = " + batchId);
1,289,806
public static ListBodyDbsResponse unmarshall(ListBodyDbsResponse listBodyDbsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBodyDbsResponse.setRequestId<MASK><NEW_LINE>listBodyDbsResponse.setCode(_ctx.stringValue("ListBodyDbsResponse.Code"));<NEW_LINE>listBodyDbsResponse.setMessage(_ctx.stringValue("ListBodyDbsResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.longValue("ListBodyDbsResponse.Data.Total"));<NEW_LINE>List<DbListItem> dbList = new ArrayList<DbListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBodyDbsResponse.Data.DbList.Length"); i++) {<NEW_LINE>DbListItem dbListItem = new DbListItem();<NEW_LINE>dbListItem.setId(_ctx.longValue("ListBodyDbsResponse.Data.DbList[" + i + "].Id"));<NEW_LINE>dbListItem.setName(_ctx.stringValue("ListBodyDbsResponse.Data.DbList[" + i + "].Name"));<NEW_LINE>dbList.add(dbListItem);<NEW_LINE>}<NEW_LINE>data.setDbList(dbList);<NEW_LINE>listBodyDbsResponse.setData(data);<NEW_LINE>return listBodyDbsResponse;<NEW_LINE>}
(_ctx.stringValue("ListBodyDbsResponse.RequestId"));
762,585
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String automationAccountName, String packageName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (packageName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, automationAccountName, packageName, this.client.getSubscriptionId(), apiVersion, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
776,078
protected void buildErrorPanel() {<NEW_LINE>errorPanel = new JPanel();<NEW_LINE>GroupLayout layout = new GroupLayout(errorPanel);<NEW_LINE>layout.setAutoCreateGaps(true);<NEW_LINE>layout.setAutoCreateContainerGaps(true);<NEW_LINE>errorPanel.setLayout(layout);<NEW_LINE>errorMessage = new JTextPane();<NEW_LINE>errorMessage.setEditable(false);<NEW_LINE>errorMessage.setContentType("text/html");<NEW_LINE>errorMessage.setText("<html><body><center>Could not connect to the Processing server.<br>" + "Contributions cannot be installed or updated without an Internet connection.<br>" + "Please verify your network connection again, then try connecting again.</center></body></html>");<NEW_LINE>DetailPanel.setTextStyle(errorMessage, "1em");<NEW_LINE>Dimension dim = new Dimension(550, 60);<NEW_LINE>errorMessage.setMaximumSize(dim);<NEW_LINE>errorMessage.setMinimumSize(dim);<NEW_LINE>errorMessage.setOpaque(false);<NEW_LINE>closeButton = Toolkit.createIconButton("manager/close");<NEW_LINE>closeButton.setContentAreaFilled(false);<NEW_LINE>closeButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>contribDialog.makeAndShowTab(false, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tryAgainButton = new JButton("Try Again");<NEW_LINE>tryAgainButton.setFont(ManagerFrame.NORMAL_PLAIN);<NEW_LINE>tryAgainButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>contribDialog.makeAndShowTab(false, true);<NEW_LINE>contribDialog.downloadAndUpdateContributionListing(editor.getBase());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>layout.setHorizontalGroup(layout.createSequentialGroup().addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE).addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER).addComponent(errorMessage).addComponent(tryAgainButton, StatusPanel.BUTTON_WIDTH, StatusPanel.BUTTON_WIDTH, StatusPanel.BUTTON_WIDTH)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE).addComponent(closeButton));<NEW_LINE>layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(errorMessage).addComponent(closeButton)).addPreferredGap(LayoutStyle.ComponentPlacement.<MASK><NEW_LINE>errorPanel.setBackground(Color.PINK);<NEW_LINE>errorPanel.validate();<NEW_LINE>}
UNRELATED).addComponent(tryAgainButton));
1,344,765
final GetSizeConstraintSetResult executeGetSizeConstraintSet(GetSizeConstraintSetRequest getSizeConstraintSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSizeConstraintSetRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSizeConstraintSetRequest> request = null;<NEW_LINE>Response<GetSizeConstraintSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSizeConstraintSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSizeConstraintSetRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSizeConstraintSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSizeConstraintSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSizeConstraintSetResultJsonUnmarshaller());<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();
453,642
protected String doIt() {<NEW_LINE>final I_C_BPartner bPartner = bpartnerDAO.getById(BPartnerId<MASK><NEW_LINE>final BPartnerStats stats = bpartnerStatsDAO.getCreateBPartnerStats(bPartner);<NEW_LINE>final String creditStatus;<NEW_LINE>if (SetCreditStatusEnum.CreditOK.equals(setCreditStatus)) {<NEW_LINE>creditStatus = X_C_BPartner_Stats.SOCREDITSTATUS_CreditOK;<NEW_LINE>} else if (SetCreditStatusEnum.CreditStop.equals(setCreditStatus)) {<NEW_LINE>creditStatus = X_C_BPartner_Stats.SOCREDITSTATUS_CreditStop;<NEW_LINE>} else if (SetCreditStatusEnum.Calculate.equals(setCreditStatus)) {<NEW_LINE>final CalculateSOCreditStatusRequest request = CalculateSOCreditStatusRequest.builder().stat(stats).forceCheckCreditStatus(true).date(SystemTime.asDayTimestamp()).build();<NEW_LINE>creditStatus = bpartnerStatsBL.calculateProjectedSOCreditStatus(request);<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Invalid setCreditStatus value: " + setCreditStatus);<NEW_LINE>}<NEW_LINE>bpartnerStatsDAO.setSOCreditStatus(stats, creditStatus);<NEW_LINE>return "@Success@";<NEW_LINE>}
.ofRepoId(getRecord_ID()));
942,638
public FilesLimit unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FilesLimit filesLimit = new FilesLimit();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("MaxFiles", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>filesLimit.setMaxFiles(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("OrderedBy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>filesLimit.setOrderedBy(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Order", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>filesLimit.setOrder(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 filesLimit;<NEW_LINE>}
class).unmarshall(context));
1,761,478
public void finish() {<NEW_LINE>if (!spillInProgress.isDone()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkSpillSucceeded(spillInProgress);<NEW_LINE>if (state == State.NEEDS_INPUT) {<NEW_LINE>state = State.HAS_OUTPUT;<NEW_LINE>// Convert revocable memory to user memory as sortedPages holds on to memory so we no longer can revoke.<NEW_LINE>if (revocableMemoryContext.getBytes() > 0) {<NEW_LINE>long currentRevocableBytes = revocableMemoryContext.getBytes();<NEW_LINE>revocableMemoryContext.setBytes(0);<NEW_LINE>if (!localUserMemoryContext.trySetBytes(localUserMemoryContext.getBytes() + currentRevocableBytes)) {<NEW_LINE>// TODO: this might fail (even though we have just released memory), but we don't<NEW_LINE>// have a proper way to atomically convert memory reservations<NEW_LINE>revocableMemoryContext.setBytes(currentRevocableBytes);<NEW_LINE>// spill since revocable memory could not be converted to user memory immediately<NEW_LINE>// TODO: this should be asynchronous<NEW_LINE>checkSpillSucceeded(spillToDisk());<NEW_LINE>finishMemoryRevoke.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pageIndex.sort(sortChannels, sortOrder);<NEW_LINE>Iterator<Page> sortedPagesIndex = pageIndex.getSortedPages();<NEW_LINE>List<WorkProcessor<Page>> spilledPages = getSpilledPages();<NEW_LINE>if (spilledPages.isEmpty()) {<NEW_LINE>sortedPages = transform(sortedPagesIndex, Optional::of);<NEW_LINE>} else {<NEW_LINE>sortedPages = mergeSpilledAndMemoryPages(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
spilledPages, sortedPagesIndex).yieldingIterator();
251,392
private void deleteIpRanges(final CascadeAction action, List<IpRangeInventory> iprs, NoErrorCompletion completion) {<NEW_LINE>List<IpRangeDeletionMsg> msgs = new ArrayList<IpRangeDeletionMsg>();<NEW_LINE>for (IpRangeInventory iprinv : iprs) {<NEW_LINE>IpRangeDeletionMsg msg = new IpRangeDeletionMsg();<NEW_LINE>msg.setForceDelete(action<MASK><NEW_LINE>msg.setL3NetworkUuid(iprinv.getL3NetworkUuid());<NEW_LINE>msg.setIpRangeUuid(iprinv.getUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, L3NetworkConstant.SERVICE_ID, iprinv.getUuid());<NEW_LINE>msgs.add(msg);<NEW_LINE>}<NEW_LINE>new While<>(msgs).all((msg, compl) -> {<NEW_LINE>bus.send(msg, new CloudBusCallBack(compl) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>compl.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}).run(new WhileDoneCompletion(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void done(ErrorCodeList errorCodeList) {<NEW_LINE>completion.done();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE));
240,614
public void registerHost(StandardHost host) throws Exception {<NEW_LINE>if (host.getJmxName() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = host.getName();<NEW_LINE>// BEGIN S1AS 5000999<NEW_LINE>String[<MASK><NEW_LINE>boolean nameMatch = false;<NEW_LINE>if (nlNames != null) {<NEW_LINE>for (String nlName : nlNames) {<NEW_LINE>if (nlName.equals(this.networkListenerName)) {<NEW_LINE>nameMatch = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!nameMatch) {<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.log(Level.FINE, LogFacade.IGNORE_HOST_REGISTRATIONS, new Object[] { networkListenerName, name });<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// nameMatch = true here, so nlNames != null<NEW_LINE>virtualServerListenerNames.put(host.getJmxName(), nlNames);<NEW_LINE>// END S1AS 5000999<NEW_LINE>String[] aliases = host.findAliases();<NEW_LINE>mapper.addHost(name, aliases, host);<NEW_LINE>}
] nlNames = host.getNetworkListenerNames();
962,539
public PwDbHeader outputHeader(OutputStream os) throws PwDbOutputException {<NEW_LINE>// Build header<NEW_LINE>PwDbHeaderV3 header = new PwDbHeaderV3();<NEW_LINE>header.signature1 = PwDbHeader.PWM_DBSIG_1;<NEW_LINE>header.signature2 = PwDbHeaderV3.DBSIG_2;<NEW_LINE>header.flags = PwDbHeaderV3.FLAG_SHA2;<NEW_LINE>if (mPM.getEncAlgorithm() == PwEncryptionAlgorithm.Rjindal) {<NEW_LINE>header.flags |= PwDbHeaderV3.FLAG_RIJNDAEL;<NEW_LINE>} else if (mPM.getEncAlgorithm() == PwEncryptionAlgorithm.Twofish) {<NEW_LINE>header.flags |= PwDbHeaderV3.FLAG_TWOFISH;<NEW_LINE>} else {<NEW_LINE>throw new PwDbOutputException("Unsupported algorithm.");<NEW_LINE>}<NEW_LINE>header.version = PwDbHeaderV3.DBVER_DW;<NEW_LINE>header.numGroups = mPM<MASK><NEW_LINE>header.numEntries = mPM.entries.size();<NEW_LINE>header.numKeyEncRounds = mPM.getNumKeyEncRecords();<NEW_LINE>setIVs(header);<NEW_LINE>// Write checksum Checksum<NEW_LINE>MessageDigest md = null;<NEW_LINE>try {<NEW_LINE>md = MessageDigest.getInstance("SHA-256");<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new PwDbOutputException("SHA-256 not implemented here.");<NEW_LINE>}<NEW_LINE>NullOutputStream nos;<NEW_LINE>nos = new NullOutputStream();<NEW_LINE>DigestOutputStream dos = new DigestOutputStream(nos, md);<NEW_LINE>BufferedOutputStream bos = new BufferedOutputStream(dos);<NEW_LINE>try {<NEW_LINE>outputPlanGroupAndEntries(bos);<NEW_LINE>bos.flush();<NEW_LINE>bos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PwDbOutputException("Failed to generate checksum.");<NEW_LINE>}<NEW_LINE>header.contentsHash = md.digest();<NEW_LINE>// Output header<NEW_LINE>PwDbHeaderOutputV3 pho = new PwDbHeaderOutputV3(header, os);<NEW_LINE>try {<NEW_LINE>pho.output();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PwDbOutputException("Failed to output the header.");<NEW_LINE>}<NEW_LINE>return header;<NEW_LINE>}
.getGroups().size();
483,866
public // means that a message never expires.<NEW_LINE>void testSetTimeToLive_B_SecOff(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>JMSContext jmsContextQCFBindings = qcfBindings.createContext();<NEW_LINE>emptyQueue(qcfBindings, queue1);<NEW_LINE>JMSConsumer jmsConsumer = jmsContextQCFBindings.createConsumer(queue1);<NEW_LINE>JMSProducer jmsProducer = jmsContextQCFBindings.createProducer();<NEW_LINE>TextMessage msgOut = jmsContextQCFBindings.createTextMessage();<NEW_LINE>long defaultTimeToLive = jmsProducer.getTimeToLive();<NEW_LINE>System.out.println("Default time to live [ " + defaultTimeToLive + " ]");<NEW_LINE>boolean testFailed = false;<NEW_LINE>int shortTTL = 500;<NEW_LINE>jmsProducer.setTimeToLive(shortTTL);<NEW_LINE>jmsProducer.send(queue1, msgOut);<NEW_LINE>try {<NEW_LINE>Thread.sleep(shortTTL + 10000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>Message msgIn1 = jmsConsumer.receive(30000);<NEW_LINE>if (msgIn1 != null) {<NEW_LINE>System.out.println("Message did not expire within [ " + shortTTL + " ]");<NEW_LINE>testFailed = true;<NEW_LINE>} else {<NEW_LINE>System.out.println("Message expired within [ " + shortTTL + " ]");<NEW_LINE>}<NEW_LINE>jmsProducer.setTimeToLive(0);<NEW_LINE>jmsProducer.send(queue1, msgOut);<NEW_LINE>try {<NEW_LINE>Thread.sleep(10000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>Message <MASK><NEW_LINE>if (msgIn2 != null) {<NEW_LINE>System.out.println("Message did not expire within [ " + 0 + " ]");<NEW_LINE>testFailed = true;<NEW_LINE>} else {<NEW_LINE>System.out.println("Message expired within [ " + 0 + " ]");<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContextQCFBindings.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testSetTimeToLive_B_SecOff failed");<NEW_LINE>}<NEW_LINE>}
msgIn2 = jmsConsumer.receive(30000);
1,711,944
protected void addConstraintMapping(WebContainer service, ConstraintMapping constraintMapping) {<NEW_LINE>Constraint constraint = constraintMapping.getConstraint();<NEW_LINE>String[] roles = constraint.getRoles();<NEW_LINE>// name property is unavailable on constraint object :/<NEW_LINE>String name = "Constraint-" + new SecureRandom().nextInt(Integer.MAX_VALUE);<NEW_LINE>int dataConstraint = constraint.getDataConstraint();<NEW_LINE>String dataConstraintStr;<NEW_LINE>switch(dataConstraint) {<NEW_LINE>case Constraint.DC_UNSET:<NEW_LINE>dataConstraintStr = null;<NEW_LINE>break;<NEW_LINE>case Constraint.DC_NONE:<NEW_LINE>dataConstraintStr = "NONE";<NEW_LINE>break;<NEW_LINE>case Constraint.DC_CONFIDENTIAL:<NEW_LINE>dataConstraintStr = "CONFIDENTIAL";<NEW_LINE>break;<NEW_LINE>case Constraint.DC_INTEGRAL:<NEW_LINE>dataConstraintStr = "INTEGRAL";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.warnv("Unknown data constraint: " + dataConstraint);<NEW_LINE>dataConstraintStr = "CONFIDENTIAL";<NEW_LINE>}<NEW_LINE>List<String> rolesList = Arrays.asList(roles);<NEW_LINE>log.debug("Adding security constraint name=" + name + ", url=" + constraintMapping.getPathSpec() + ", dataConstraint=" + dataConstraintStr + ", canAuthenticate=" + constraint.getAuthenticate() + ", roles=" + rolesList);<NEW_LINE>service.registerConstraintMapping(name, null, constraintMapping.getPathSpec(), dataConstraintStr, constraint.<MASK><NEW_LINE>}
getAuthenticate(), rolesList, httpContext);
638,496
public void sendText(String s) {<NEW_LINE>for (int i = 0; i < s.length(); i++) {<NEW_LINE>KeyEvent event = null;<NEW_LINE>char c = s.charAt(i);<NEW_LINE>if (Character.isISOControl(c)) {<NEW_LINE>if (c == '\n') {<NEW_LINE>int keyCode = KeyEvent.KEYCODE_ENTER;<NEW_LINE>keyEvent(keyCode, new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));<NEW_LINE>try {<NEW_LINE>Thread.sleep(10);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>keyEvent(keyCode, new KeyEvent(KeyEvent.ACTION_UP, keyCode));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>event = new KeyEvent(SystemClock.uptimeMillis(), s.substring(i, i + 1), KeyCharacterMap.FULL, 0);<NEW_LINE>keyEvent(<MASK><NEW_LINE>try {<NEW_LINE>Thread.sleep(10);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
event.getKeyCode(), event);
1,728,763
private static void decode5(DataInput in, long[] tmp, long[] longs) throws IOException {<NEW_LINE>readLELongs(in, tmp, 0, 10);<NEW_LINE>shiftLongs(tmp, 10, longs, 0, 3, MASK8_5);<NEW_LINE>for (int iter = 0, tmpIdx = 0, longsIdx = 10; iter < 2; ++iter, tmpIdx += 5, longsIdx += 3) {<NEW_LINE>long l0 = (tmp[tmpIdx + 0] & MASK8_3) << 2;<NEW_LINE>l0 |= (tmp[tmpIdx + 1<MASK><NEW_LINE>longs[longsIdx + 0] = l0;<NEW_LINE>long l1 = (tmp[tmpIdx + 1] & MASK8_1) << 4;<NEW_LINE>l1 |= (tmp[tmpIdx + 2] & MASK8_3) << 1;<NEW_LINE>l1 |= (tmp[tmpIdx + 3] >>> 2) & MASK8_1;<NEW_LINE>longs[longsIdx + 1] = l1;<NEW_LINE>long l2 = (tmp[tmpIdx + 3] & MASK8_2) << 3;<NEW_LINE>l2 |= (tmp[tmpIdx + 4] & MASK8_3) << 0;<NEW_LINE>longs[longsIdx + 2] = l2;<NEW_LINE>}<NEW_LINE>}
] >>> 1) & MASK8_2;
1,098,055
public void putValue(Varnode out, Varnode result, boolean mustClear) {<NEW_LINE>if (out == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (out.isAddress() || isSymbolicSpace(out.getSpace())) {<NEW_LINE>if (!isRegister(out)) {<NEW_LINE>if (debug) {<NEW_LINE>Msg.info(this, " " + print(out) + " <- " + print(result) + " at " + offsetContext.getAddress());<NEW_LINE>}<NEW_LINE>Address location = offsetContext.getAddress();<NEW_LINE>// put the location on both the lastSet, and all locations set<NEW_LINE>addSetVarnodeToLastSetLocations(out, location);<NEW_LINE>putMemoryValue(out, result);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// don't ever store an unknown unique into a location<NEW_LINE>if (result != null && result.isUnique()) {<NEW_LINE>result = null;<NEW_LINE>}<NEW_LINE>if (out.isUnique()) {<NEW_LINE>if (mustClear) {<NEW_LINE>result = null;<NEW_LINE>}<NEW_LINE>tempUniqueVals.put(out, result);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (debug) {<NEW_LINE>Msg.info(this, " " + print(out) + " <- " + print(result) + " at " + offsetContext.getAddress());<NEW_LINE>}<NEW_LINE>if (mustClear) {<NEW_LINE>clearVals.add(out);<NEW_LINE>}<NEW_LINE>}
tempVals.put(out, result);
1,145,926
private void passwordProtectPDF() {<NEW_LINE>final MaterialDialog dialog = new MaterialDialog.Builder(mActivity).title(R.string.set_password).customView(R.layout.custom_dialog, true).positiveText(android.R.string.ok).negativeText(android.R.string.cancel).neutralText(R.string.remove_dialog).build();<NEW_LINE>final View positiveAction = <MASK><NEW_LINE>final View neutralAction = dialog.getActionButton(DialogAction.NEUTRAL);<NEW_LINE>final EditText passwordInput = dialog.getCustomView().findViewById(R.id.password);<NEW_LINE>passwordInput.setText(mPdfOptions.getPassword());<NEW_LINE>passwordInput.addTextChangedListener(new DefaultTextWatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTextChanged(CharSequence s, int start, int before, int count) {<NEW_LINE>positiveAction.setEnabled(s.toString().trim().length() > 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>positiveAction.setOnClickListener(v -> {<NEW_LINE>if (StringUtils.getInstance().isEmpty(passwordInput.getText())) {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_password_cannot_be_blank);<NEW_LINE>} else {<NEW_LINE>mPdfOptions.setPassword(passwordInput.getText().toString());<NEW_LINE>mPdfOptions.setPasswordProtected(true);<NEW_LINE>showEnhancementOptions();<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (StringUtils.getInstance().isNotEmpty(mPdfOptions.getPassword())) {<NEW_LINE>neutralAction.setOnClickListener(v -> {<NEW_LINE>mPdfOptions.setPassword(null);<NEW_LINE>mPdfOptions.setPasswordProtected(false);<NEW_LINE>showEnhancementOptions();<NEW_LINE>dialog.dismiss();<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.password_remove);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>dialog.show();<NEW_LINE>positiveAction.setEnabled(false);<NEW_LINE>}
dialog.getActionButton(DialogAction.POSITIVE);
1,254,290
public static Type resolveVariable(@Nonnull TypeVariable variable, @Nonnull Class classType, boolean resolveInInterfacesOnly) {<NEW_LINE><MASK><NEW_LINE>int index = ArrayUtilRt.find(aClass.getTypeParameters(), variable);<NEW_LINE>if (index >= 0) {<NEW_LINE>return variable;<NEW_LINE>}<NEW_LINE>final Class[] classes = aClass.getInterfaces();<NEW_LINE>final Type[] genericInterfaces = aClass.getGenericInterfaces();<NEW_LINE>for (int i = 0; i <= classes.length; i++) {<NEW_LINE>Class anInterface;<NEW_LINE>if (i < classes.length) {<NEW_LINE>anInterface = classes[i];<NEW_LINE>} else {<NEW_LINE>anInterface = aClass.getSuperclass();<NEW_LINE>if (resolveInInterfacesOnly || anInterface == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Type resolved = resolveVariable(variable, anInterface);<NEW_LINE>if (resolved instanceof Class || resolved instanceof ParameterizedType) {<NEW_LINE>return resolved;<NEW_LINE>}<NEW_LINE>if (resolved instanceof TypeVariable) {<NEW_LINE>final TypeVariable typeVariable = (TypeVariable) resolved;<NEW_LINE>index = ArrayUtilRt.find(anInterface.getTypeParameters(), typeVariable);<NEW_LINE>if (index < 0) {<NEW_LINE>LOG.error("Cannot resolve type variable:\n" + "typeVariable = " + typeVariable + "\n" + "genericDeclaration = " + declarationToString(typeVariable.getGenericDeclaration()) + "\n" + "searching in " + declarationToString(anInterface));<NEW_LINE>}<NEW_LINE>final Type type = i < genericInterfaces.length ? genericInterfaces[i] : aClass.getGenericSuperclass();<NEW_LINE>if (type instanceof Class) {<NEW_LINE>return Object.class;<NEW_LINE>}<NEW_LINE>if (type instanceof ParameterizedType) {<NEW_LINE>return getActualTypeArguments((ParameterizedType) type)[index];<NEW_LINE>}<NEW_LINE>throw new AssertionError("Invalid type: " + type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
final Class aClass = getRawType(classType);
322,242
public List<ExtractResult> extract(String input, LocalDateTime reference) {<NEW_LINE>List<Token> <MASK><NEW_LINE>tokens.addAll(matchSimpleCases(input));<NEW_LINE>List<ExtractResult> simpleCasesResults = Token.mergeAllTokens(tokens, input, getExtractorName());<NEW_LINE>List<ExtractResult> ordinalExtractions = config.getOrdinalExtractor().extract(input);<NEW_LINE>tokens.addAll(mergeTwoTimePoints(input, reference));<NEW_LINE>tokens.addAll(matchDuration(input, reference));<NEW_LINE>tokens.addAll(singleTimePointWithPatterns(input, ordinalExtractions, reference));<NEW_LINE>tokens.addAll(matchComplexCases(input, simpleCasesResults, reference));<NEW_LINE>tokens.addAll(matchYearPeriod(input, reference));<NEW_LINE>tokens.addAll(matchOrdinalNumberWithCenturySuffix(input, ordinalExtractions));<NEW_LINE>return Token.mergeAllTokens(tokens, input, getExtractorName());<NEW_LINE>}
tokens = new ArrayList<>();
432,859
public void drawU(UGraphic ug) {<NEW_LINE>final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());<NEW_LINE>final double widthTotal = dimTotal.getWidth();<NEW_LINE>final double heightTotal = dimTotal.getHeight();<NEW_LINE>final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);<NEW_LINE>final UStroke thickness;<NEW_LINE>if (UseStyle.useBetaStyle()) {<NEW_LINE>thickness = style.getStroke();<NEW_LINE>} else {<NEW_LINE>thickness = getThickness(style);<NEW_LINE>}<NEW_LINE>if (borderColor == null) {<NEW_LINE>ug = ug.apply(new HColorNone());<NEW_LINE>} else {<NEW_LINE>ug = ug.apply(borderColor);<NEW_LINE>}<NEW_LINE>if (backColor == null) {<NEW_LINE>ug = ug.apply(new HColorNone().bg());<NEW_LINE>} else {<NEW_LINE>ug = ug.apply(backColor.bg());<NEW_LINE>}<NEW_LINE>ug = ug.apply(thickness);<NEW_LINE>shape.drawU(ug);<NEW_LINE>if (horizontalAlignment == HorizontalAlignment.LEFT) {<NEW_LINE>tb.drawU(ug.apply(new UTranslate(padding.getLeft(), padding.getTop())));<NEW_LINE>} else if (horizontalAlignment == HorizontalAlignment.RIGHT) {<NEW_LINE>final Dimension2D dimTb = tb.<MASK><NEW_LINE>tb.drawU(ug.apply(new UTranslate(dimTotal.getWidth() - dimTb.getWidth() - padding.getRight(), padding.getBottom())));<NEW_LINE>} else if (horizontalAlignment == HorizontalAlignment.CENTER) {<NEW_LINE>final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());<NEW_LINE>tb.drawU(ug.apply(new UTranslate((dimTotal.getWidth() - dimTb.getWidth()) / 2, padding.getBottom())));<NEW_LINE>}<NEW_LINE>}
calculateDimension(ug.getStringBounder());
1,791,839
public I_AD_Print_Clients createPrintClientsEntry(final Properties ctx, final String hostkey) {<NEW_LINE>final String trxName = ITrx.TRXNAME_None;<NEW_LINE>I_AD_Print_Clients printClientsEntry = Services.get(IPrintingDAO.class).retrievePrintClientsEntry(ctx, hostkey);<NEW_LINE>if (printClientsEntry == null) {<NEW_LINE>// task 08021: we want to create the record with AD_Client_ID=0 etc, because there shall be just one record per host, not different ones per user, client, role etc<NEW_LINE>final Properties sysContext = Env.createSysContext(ctx);<NEW_LINE>printClientsEntry = InterfaceWrapperHelper.create(<MASK><NEW_LINE>printClientsEntry.setHostKey(hostkey);<NEW_LINE>}<NEW_LINE>printClientsEntry.setAD_Session_ID(Env.getContextAsInt(ctx, Env.CTXNAME_AD_Session_ID));<NEW_LINE>printClientsEntry.setDateLastPoll(SystemTime.asTimestamp());<NEW_LINE>InterfaceWrapperHelper.save(printClientsEntry);<NEW_LINE>return printClientsEntry;<NEW_LINE>}
sysContext, I_AD_Print_Clients.class, trxName);
960,511
private CompoundKey parseCompoundKey(final ResourceModel resource, final ServerResourceContext context, final String pathSegment) {<NEW_LINE>CompoundKey compoundKey;<NEW_LINE>try {<NEW_LINE>compoundKey = ArgumentUtils.parseCompoundKey(pathSegment, resource.getKeys(), context.getRestliProtocolVersion(), _restLiConfig.shouldValidateResourceKeys());<NEW_LINE>} catch (PathSegmentSyntaxException e) {<NEW_LINE>throw new RoutingException(String.format("input %s is not a Compound key", pathSegment), HttpStatus.S_400_BAD_REQUEST.getCode(), e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new RoutingException(String.format("input %s is not a Compound key", pathSegment), HttpStatus.S_400_BAD_REQUEST.getCode(), e);<NEW_LINE>} catch (TemplateRuntimeException e) {<NEW_LINE>// thrown from DateTemplateUtil.coerceOutput<NEW_LINE>throw new RoutingException(String.format("Compound key parameter value %s is invalid", pathSegment), HttpStatus.<MASK><NEW_LINE>}<NEW_LINE>for (String simpleKeyName : compoundKey.getPartKeys()) {<NEW_LINE>context.getPathKeys().append(simpleKeyName, compoundKey.getPart(simpleKeyName));<NEW_LINE>}<NEW_LINE>context.getPathKeys().append(resource.getKeyName(), compoundKey);<NEW_LINE>return compoundKey;<NEW_LINE>}
S_400_BAD_REQUEST.getCode(), e);
186,460
public static DescribeDcdnDomainRegionDataResponse unmarshall(DescribeDcdnDomainRegionDataResponse describeDcdnDomainRegionDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnDomainRegionDataResponse.setRequestId(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.RequestId"));<NEW_LINE>describeDcdnDomainRegionDataResponse.setDomainName(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.DomainName"));<NEW_LINE>describeDcdnDomainRegionDataResponse.setDataInterval(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.DataInterval"));<NEW_LINE>describeDcdnDomainRegionDataResponse.setStartTime(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.StartTime"));<NEW_LINE>describeDcdnDomainRegionDataResponse.setEndTime<MASK><NEW_LINE>List<RegionProportionData> value = new ArrayList<RegionProportionData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnDomainRegionDataResponse.Value.Length"); i++) {<NEW_LINE>RegionProportionData regionProportionData = new RegionProportionData();<NEW_LINE>regionProportionData.setRegion(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].Region"));<NEW_LINE>regionProportionData.setProportion(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].Proportion"));<NEW_LINE>regionProportionData.setRegionEname(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].RegionEname"));<NEW_LINE>regionProportionData.setAvgObjectSize(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].AvgObjectSize"));<NEW_LINE>regionProportionData.setAvgResponseTime(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].AvgResponseTime"));<NEW_LINE>regionProportionData.setBps(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].Bps"));<NEW_LINE>regionProportionData.setQps(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].Qps"));<NEW_LINE>regionProportionData.setAvgResponseRate(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].AvgResponseRate"));<NEW_LINE>regionProportionData.setTotalBytes(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].TotalBytes"));<NEW_LINE>regionProportionData.setBytesProportion(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].BytesProportion"));<NEW_LINE>regionProportionData.setTotalQuery(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.Value[" + i + "].TotalQuery"));<NEW_LINE>value.add(regionProportionData);<NEW_LINE>}<NEW_LINE>describeDcdnDomainRegionDataResponse.setValue(value);<NEW_LINE>return describeDcdnDomainRegionDataResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeDcdnDomainRegionDataResponse.EndTime"));
1,837,634
private void paintAnnotations(Graphics2D g, int startVisualLine, int endVisualLine) {<NEW_LINE>int x = getAnnotationsAreaOffset();<NEW_LINE>int w = getAnnotationsAreaWidthEx();<NEW_LINE>if (w == 0)<NEW_LINE>return;<NEW_LINE>AffineTransform old = setMirrorTransformIfNeeded(g, x, w);<NEW_LINE>try {<NEW_LINE>Color color = TargetAWT.to(myEditor.getColorsScheme().getColor(EditorColors.ANNOTATIONS_COLOR));<NEW_LINE>g.setColor(color != null ? color : JBColor.blue);<NEW_LINE>g.setFont(myEditor.getColorsScheme().getFont(EditorFontType.PLAIN));<NEW_LINE>for (int i = 0; i < myTextAnnotationGutters.size(); i++) {<NEW_LINE>TextAnnotationGutterProvider gutterProvider = myTextAnnotationGutters.get(i);<NEW_LINE>int lineHeight = myEditor.getLineHeight();<NEW_LINE>int lastLine = myEditor.logicalToVisualPosition(new LogicalPosition(endLineNumber(), 0)).line;<NEW_LINE>endVisualLine = Math.min(endVisualLine, lastLine);<NEW_LINE>if (startVisualLine > endVisualLine) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (startVisualLine == 0 && endVisualLine == 0) {<NEW_LINE>// allow paining gutters for empty documents<NEW_LINE>paintAnnotationLine(g, gutterProvider, 0, x, 0, annotationSize, lineHeight);<NEW_LINE>} else {<NEW_LINE>VisualLinesIterator visLinesIterator = new VisualLinesIterator(myEditor, startVisualLine);<NEW_LINE>while (!visLinesIterator.atEnd() && visLinesIterator.getVisualLine() <= endVisualLine) {<NEW_LINE>int logLine = visLinesIterator.getStartLogicalLine();<NEW_LINE>int y = visLinesIterator.getY();<NEW_LINE>paintAnnotationLine(g, gutterProvider, logLine, x, y, annotationSize, lineHeight);<NEW_LINE>visLinesIterator.advance();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>x += annotationSize;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (old != null)<NEW_LINE>g.setTransform(old);<NEW_LINE>}<NEW_LINE>}
annotationSize = myTextAnnotationGutterSizes.get(i);
839,902
private double pseudoRandom(final long seed, int input) {<NEW_LINE>// Default constants from "man drand48"<NEW_LINE>final long mult = 0x5DEECE66DL;<NEW_LINE>final long add = 0xBL;<NEW_LINE>// 48 bit<NEW_LINE>final long mask <MASK><NEW_LINE>// Produce an initial seed each<NEW_LINE>final long i1 = (input ^ seed ^ mult) & mask;<NEW_LINE>final long i2 = (input ^ (seed >>> 16) ^ mult) & mask;<NEW_LINE>// Compute the first random each<NEW_LINE>final long l1 = (i1 * mult + add) & mask;<NEW_LINE>final long l2 = (i2 * mult + add) & mask;<NEW_LINE>// Use 53 bit total:<NEW_LINE>// 48 - 22 = 26<NEW_LINE>final int r1 = (int) (l1 >>> 22);<NEW_LINE>// 48 - 21 = 27<NEW_LINE>final int r2 = (int) (l2 >>> 21);<NEW_LINE>double random = ((((long) r1) << 27) + r2) / (double) (1L << 53);<NEW_LINE>return random;<NEW_LINE>}
= (1L << 48) - 1;
1,683,762
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {<NEW_LINE>Task<?> methodCallTask;<NEW_LINE>switch(call.method) {<NEW_LINE>case "FirebaseModelDownloader#getModel":<NEW_LINE>methodCallTask = getModel(call.arguments());<NEW_LINE>break;<NEW_LINE>case "FirebaseModelDownloader#listDownloadedModels":<NEW_LINE>methodCallTask = listDownloadedModels(call.arguments());<NEW_LINE>break;<NEW_LINE>case "FirebaseModelDownloader#deleteDownloadedModel":<NEW_LINE>methodCallTask = deleteDownloadedModel(call.arguments());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>result.notImplemented();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>methodCallTask.addOnCompleteListener(task -> {<NEW_LINE>if (task.isSuccessful()) {<NEW_LINE>result.success(task.getResult());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>Map<String, String> exceptionDetails = getExceptionDetails(exception);<NEW_LINE>result.error("firebase_ml_model_downloader", exception != null ? exception.getMessage() : null, exceptionDetails);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Exception exception = task.getException();
791,167
protected BootJavaHoverProvider createHoverHandler(JavaProjectFinder javaProjectFinder, SourceLinks sourceLinks, SpringProcessLiveDataProvider liveDataProvider) {<NEW_LINE>AnnotationHierarchyAwareLookup<HoverProvider> providers = new AnnotationHierarchyAwareLookup<>();<NEW_LINE>ValueHoverProvider valueHoverProvider = new ValueHoverProvider();<NEW_LINE>RequestMappingHoverProvider requestMappingHoverProvider = new RequestMappingHoverProvider();<NEW_LINE>AutowiredHoverProvider autowiredHoverProvider = new AutowiredHoverProvider(sourceLinks);<NEW_LINE>ComponentInjectionsHoverProvider componentInjectionsHoverProvider = new ComponentInjectionsHoverProvider(sourceLinks);<NEW_LINE>BeanInjectedIntoHoverProvider beanInjectedIntoHoverProvider = new BeanInjectedIntoHoverProvider(sourceLinks);<NEW_LINE>ConditionalsLiveHoverProvider conditionalsLiveHoverProvider = new ConditionalsLiveHoverProvider();<NEW_LINE>providers.put(org.springframework.ide.vscode.boot.java.value.Constants.SPRING_VALUE, valueHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_REQUEST_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_GET_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_POST_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_PUT_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_DELETE_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_PATCH_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations<MASK><NEW_LINE>providers.put(Annotations.AUTOWIRED, autowiredHoverProvider);<NEW_LINE>providers.put(Annotations.INJECT, autowiredHoverProvider);<NEW_LINE>providers.put(Annotations.COMPONENT, componentInjectionsHoverProvider);<NEW_LINE>providers.put(Annotations.BEAN, beanInjectedIntoHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_BEAN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_MISSING_BEAN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_PROPERTY, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_RESOURCE, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_CLASS, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_MISSING_CLASS, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_CLOUD_PLATFORM, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_WEB_APPLICATION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_NOT_WEB_APPLICATION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_INFO_CONTRIBUTOR, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_RESOURCE_CHAIN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_ENDPOINT, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_HEALTH_INDICATOR, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_EXPRESSION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_JAVA, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_JNDI, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_SINGLE_CANDIDATE, conditionalsLiveHoverProvider);<NEW_LINE>return new BootJavaHoverProvider(this, javaProjectFinder, providers, liveDataProvider);<NEW_LINE>}
.PROFILE, new ActiveProfilesProvider());
1,133,753
FormatterFunc createFormat() throws Exception {<NEW_LINE>ClassLoader classLoader = jarState.getClassLoader();<NEW_LINE>// instantiate the formatter and get its format method<NEW_LINE>Class<?> <MASK><NEW_LINE>Class<?> optionsBuilderClass = classLoader.loadClass(OPTIONS_BUILDER_CLASS);<NEW_LINE>Method optionsBuilderMethod = optionsClass.getMethod(OPTIONS_BUILDER_METHOD);<NEW_LINE>Object optionsBuilder = optionsBuilderMethod.invoke(null);<NEW_LINE>Class<?> optionsStyleClass = classLoader.loadClass(OPTIONS_Style);<NEW_LINE>Object styleConstant = Enum.valueOf((Class<Enum>) optionsStyleClass, style);<NEW_LINE>Method optionsBuilderStyleMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_STYLE_METHOD, optionsStyleClass);<NEW_LINE>optionsBuilderStyleMethod.invoke(optionsBuilder, styleConstant);<NEW_LINE>Method optionsBuilderBuildMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_BUILD_METHOD);<NEW_LINE>Object options = optionsBuilderBuildMethod.invoke(optionsBuilder);<NEW_LINE>Class<?> formatterClazz = classLoader.loadClass(FORMATTER_CLASS);<NEW_LINE>Object formatter = formatterClazz.getConstructor(optionsClass).newInstance(options);<NEW_LINE>Method formatterMethod = formatterClazz.getMethod(FORMATTER_METHOD, String.class);<NEW_LINE>Function<String, String> removeUnused = constructRemoveUnusedFunction(classLoader);<NEW_LINE>Class<?> importOrdererClass = classLoader.loadClass(IMPORT_ORDERER_CLASS);<NEW_LINE>Method importOrdererMethod = importOrdererClass.getMethod(IMPORT_ORDERER_METHOD, String.class);<NEW_LINE>BiFunction<String, Object, String> reflowLongStrings = this.reflowLongStrings ? constructReflowLongStringsFunction(classLoader, formatterClazz) : (s, f) -> s;<NEW_LINE>return JVM_SUPPORT.suggestLaterVersionOnError(version, (input -> {<NEW_LINE>String formatted = (String) formatterMethod.invoke(formatter, input);<NEW_LINE>String removedUnused = removeUnused.apply(formatted);<NEW_LINE>String sortedImports = (String) importOrdererMethod.invoke(null, removedUnused);<NEW_LINE>String reflowedLongStrings = reflowLongStrings.apply(sortedImports, formatter);<NEW_LINE>return fixWindowsBug(reflowedLongStrings, version);<NEW_LINE>}));<NEW_LINE>}
optionsClass = classLoader.loadClass(OPTIONS_CLASS);
290,080
private static void generic(Exchange krakenExchange) throws IOException {<NEW_LINE><MASK><NEW_LINE>System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());<NEW_LINE>// place a limit buy order<NEW_LINE>LimitOrder limitOrder = new LimitOrder((OrderType.ASK), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));<NEW_LINE>String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);<NEW_LINE>System.out.println("Limit Order return value: " + limitOrderReturnValue);<NEW_LINE>System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());<NEW_LINE>// Cancel the added order<NEW_LINE>boolean cancelResult = tradeService.cancelOrder(limitOrderReturnValue);<NEW_LINE>System.out.println("Canceling returned " + cancelResult);<NEW_LINE>System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());<NEW_LINE>}
TradeService tradeService = krakenExchange.getTradeService();
592,679
private void createKafkaConsumer(String bootstrapServers) {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);<NEW_LINE>properties.put(ConsumerConfig.GROUP_ID_CONFIG, context.getConfig().getSortTaskId());<NEW_LINE>properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());<NEW_LINE>properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());<NEW_LINE>properties.put(ConsumerConfig.RECEIVE_BUFFER_CONFIG, context.getConfig().getKafkaSocketRecvBufferSize());<NEW_LINE>properties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);<NEW_LINE>ConsumeStrategy offsetResetStrategy = context.getConfig().getOffsetResetStrategy();<NEW_LINE>if (offsetResetStrategy == ConsumeStrategy.lastest || offsetResetStrategy == ConsumeStrategy.lastest_absolutely) {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");<NEW_LINE>} else if (offsetResetStrategy == ConsumeStrategy.earliest || offsetResetStrategy == ConsumeStrategy.earliest_absolutely) {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");<NEW_LINE>} else {<NEW_LINE>properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none");<NEW_LINE>}<NEW_LINE>properties.put(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, context.getConfig().getKafkaFetchSizeBytes());<NEW_LINE>properties.put(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, context.getConfig().getKafkaFetchWaitMs());<NEW_LINE>properties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);<NEW_LINE>properties.put(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, <MASK><NEW_LINE>properties.put(ConsumerConfig.CONNECTIONS_MAX_IDLE_MS_CONFIG, 120000L);<NEW_LINE>this.bootstrapServers = bootstrapServers;<NEW_LINE>logger.info("start to create kafka consumer:{}", properties);<NEW_LINE>this.consumer = new KafkaConsumer<>(properties);<NEW_LINE>logger.info("end to create kafka consumer:{}", consumer);<NEW_LINE>}
RangeAssignor.class.getName());
342,094
private static GoogleCredential fromStreamServiceAccount(GenericJson fileContents, HttpTransport transport, JsonFactory jsonFactory) throws IOException {<NEW_LINE>String clientId = (String) fileContents.get("client_id");<NEW_LINE>String clientEmail = (String) fileContents.get("client_email");<NEW_LINE>String privateKeyPem = (String) fileContents.get("private_key");<NEW_LINE>String privateKeyId = (String) fileContents.get("private_key_id");<NEW_LINE>if (clientId == null || clientEmail == null || privateKeyPem == null || privateKeyId == null) {<NEW_LINE>throw new IOException("Error reading service account credential from stream, " + "expecting 'client_id', 'client_email', 'private_key' and 'private_key_id'.");<NEW_LINE>}<NEW_LINE>PrivateKey privateKey = privateKeyFromPkcs8(privateKeyPem);<NEW_LINE>Collection<String> emptyScopes = Collections.emptyList();<NEW_LINE>Builder credentialBuilder = new GoogleCredential.Builder().setTransport(transport).setJsonFactory(jsonFactory).setServiceAccountId(clientEmail).setServiceAccountScopes(emptyScopes).setServiceAccountPrivateKey(privateKey).setServiceAccountPrivateKeyId(privateKeyId);<NEW_LINE>String tokenUri = (<MASK><NEW_LINE>if (tokenUri != null) {<NEW_LINE>credentialBuilder.setTokenServerEncodedUrl(tokenUri);<NEW_LINE>}<NEW_LINE>String projectId = (String) fileContents.get("project_id");<NEW_LINE>if (projectId != null) {<NEW_LINE>credentialBuilder.setServiceAccountProjectId(projectId);<NEW_LINE>}<NEW_LINE>// Don't do a refresh at this point, as it will always fail before the scopes are added.<NEW_LINE>return credentialBuilder.build();<NEW_LINE>}
String) fileContents.get("token_uri");
817,868
private int validateBackupLog(DurableDataLogFactory dataLogFactory, int containerId, DebugDurableDataLogWrapper originalDataLog, boolean createNewBackupLog) throws Exception {<NEW_LINE>// Validate that the Original and Backup logs have the same number of operations.<NEW_LINE>int operationsReadFromOriginalLog = readDurableDataLogWithCustomCallback((a, b) -> {<NEW_LINE>}, containerId, originalDataLog.asReadOnly());<NEW_LINE>@Cleanup<NEW_LINE>val validationBackupDataLog = dataLogFactory.createDebugLogWrapper(dataLogFactory.getBackupLogId());<NEW_LINE>@Cleanup<NEW_LINE>val validationBackupDataLogReadOnly = validationBackupDataLog.asReadOnly();<NEW_LINE>int backupLogReadOperations = readDurableDataLogWithCustomCallback((a, b) -> output("Reading: " + a), <MASK><NEW_LINE>output("Original DurableLog operations read: " + operationsReadFromOriginalLog + ", Backup DurableLog operations read: " + backupLogReadOperations);<NEW_LINE>// Ensure that the Original log contains the same number of Operations than the Backup log upon a new log read.<NEW_LINE>Preconditions.checkState(!createNewBackupLog || operationsReadFromOriginalLog == backupLogReadOperations, "Operations read from Backup Log (" + backupLogReadOperations + ") differ from Original Log ones (" + operationsReadFromOriginalLog + ") ");<NEW_LINE>return backupLogReadOperations;<NEW_LINE>}
dataLogFactory.getBackupLogId(), validationBackupDataLogReadOnly);
723,447
public static Pair<FetcherBase, StoreBase> discoverMonitor(MonitorConf monitorConf, SyncConf syncConf) {<NEW_LINE>try {<NEW_LINE>String pluginType = monitorConf.getType();<NEW_LINE>String storePluginClassName = PluginUtil.getPluginClassName(pluginType, OperatorType.store);<NEW_LINE>String fetcherPluginClassName = PluginUtil.getPluginClassName(pluginType, OperatorType.fetcher);<NEW_LINE>Set<URL> urlList = PluginUtil.getJarFileDirPath(pluginType, syncConf.getPluginRoot(), null, "restore-plugins");<NEW_LINE>StoreBase store = ClassLoaderManager.newInstance(urlList, cl -> {<NEW_LINE>Class<?> clazz = cl.loadClass(storePluginClassName);<NEW_LINE>Constructor<?> constructor = clazz.getConstructor(MonitorConf.class);<NEW_LINE>return (StoreBase) constructor.newInstance(monitorConf);<NEW_LINE>});<NEW_LINE>FetcherBase fetcher = ClassLoaderManager.newInstance(urlList, cl -> {<NEW_LINE>Class<?> clazz = cl.loadClass(fetcherPluginClassName);<NEW_LINE>Constructor<?> constructor = clazz.getConstructor(MonitorConf.class);<NEW_LINE>return (FetcherBase) constructor.newInstance(monitorConf);<NEW_LINE>});<NEW_LINE>return Pair.of(fetcher, store);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new NoRestartException("Load restore plugins failed!", e);
204,871
static String printVM(VirtualMachine vm) {<NEW_LINE>if (vm == null) {<NEW_LINE>return "null";<NEW_LINE>}<NEW_LINE>String sequenceNumber;<NEW_LINE>try {<NEW_LINE>java.lang.reflect.Field sequenceNumberField = vm.getClass().getDeclaredField("sequenceNumber");<NEW_LINE>sequenceNumberField.setAccessible(true);<NEW_LINE>Object <MASK><NEW_LINE>sequenceNumber = Objects.toString(sn);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>sequenceNumber = ex.toString();<NEW_LINE>logger.log(Level.INFO, "Retrieving VM's sequenceNumber", ex);<NEW_LINE>}<NEW_LINE>String target;<NEW_LINE>try {<NEW_LINE>java.lang.reflect.Field targetField = vm.getClass().getDeclaredField("target");<NEW_LINE>targetField.setAccessible(true);<NEW_LINE>Object t = targetField.get(vm);<NEW_LINE>target = Objects.toString(t);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>target = ex.toString();<NEW_LINE>logger.log(Level.INFO, "Retrieving VM's target", ex);<NEW_LINE>}<NEW_LINE>return vm.toString() + " #" + sequenceNumber + "[" + vm.name() + ", " + vm.description() + ", " + vm.version() + "\nTargetVM=" + target + "]";<NEW_LINE>}
sn = sequenceNumberField.get(vm);
959,641
public static CockroachDBSelect generateSelect(CockroachDBGlobalState globalState, int nrColumns) {<NEW_LINE>CockroachDBTables tables = globalState.getSchema().getRandomTableNonEmptyTables();<NEW_LINE>CockroachDBExpressionGenerator gen = new CockroachDBExpressionGenerator(globalState).setColumns(tables.getColumns());<NEW_LINE>CockroachDBSelect select = new CockroachDBSelect();<NEW_LINE>select.setDistinct(Randomly.getBoolean());<NEW_LINE><MASK><NEW_LINE>List<CockroachDBExpression> columns = new ArrayList<>();<NEW_LINE>List<CockroachDBExpression> columnsWithoutAggregates = new ArrayList<>();<NEW_LINE>for (int i = 0; i < nrColumns; i++) {<NEW_LINE>if (allowAggregates && Randomly.getBoolean()) {<NEW_LINE>CockroachDBExpression expression = gen.generateExpression(CockroachDBDataType.getRandom().get());<NEW_LINE>columns.add(expression);<NEW_LINE>columnsWithoutAggregates.add(expression);<NEW_LINE>} else {<NEW_LINE>columns.add(gen.generateAggregate());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>select.setFetchColumns(columns);<NEW_LINE>List<CockroachDBTableReference> tableList = tables.getTables().stream().map(t -> new CockroachDBTableReference(t)).collect(Collectors.toList());<NEW_LINE>List<CockroachDBExpression> updatedTableList = CockroachDBCommon.getTableReferences(tableList);<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setJoinList(CockroachDBNoRECOracle.getJoins(updatedTableList, globalState));<NEW_LINE>}<NEW_LINE>select.setFromList(updatedTableList);<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setWhereClause(gen.generateExpression(CockroachDBDataType.BOOL.get()));<NEW_LINE>}<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setOrderByExpressions(gen.getOrderingTerms());<NEW_LINE>}<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setGroupByExpressions(gen.generateExpressions(Randomly.smallNumber() + 1));<NEW_LINE>}<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>// TODO expression<NEW_LINE>select.setLimitClause(gen.generateConstant(CockroachDBDataType.INT.get()));<NEW_LINE>}<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setOffsetClause(gen.generateConstant(CockroachDBDataType.INT.get()));<NEW_LINE>}<NEW_LINE>if (Randomly.getBoolean()) {<NEW_LINE>select.setHavingClause(gen.generateHavingClause());<NEW_LINE>}<NEW_LINE>return select;<NEW_LINE>}
boolean allowAggregates = Randomly.getBooleanWithSmallProbability();
1,098,936
private Mono<Response<Void>> cancelWithResponseAsync(String resourceGroupName, String deploymentName, 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.<MASK><NEW_LINE>}<NEW_LINE>if (deploymentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.cancel(this.client.getEndpoint(), resourceGroupName, deploymentName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
1,796,527
public void initNew(HttpServletRequest request, HttpServletResponse response, @RequestParam("code") String code, @RequestParam("state") String state) throws IOException {<NEW_LINE>JsonObject stateJson = new JsonParser().parse(state).getAsJsonObject();<NEW_LINE>AliyunAccessTokenVO token = oauth2Util.getAccessToken(code);<NEW_LINE>log.info("Get token from aliyun, code={}, state={}, token={}", code, state, TeslaGsonUtil.toJson(token));<NEW_LINE>String topDomain = CookieUtil.getCookieDomain(request, authProperties.getCookieDomain());<NEW_LINE>String expiresAt = String.valueOf(System.currentTimeMillis() / Constants.MILLS_SECS + Long.parseLong(token.getExpiresIn()));<NEW_LINE>CookieUtil.setCookie(response, Constants.COOKIE_ALIYUN_ACCESS_TOKEN, token.<MASK><NEW_LINE>CookieUtil.setCookie(response, Constants.COOKIE_ALIYUN_REFRESH_TOKEN, token.getRefreshToken(), 0, topDomain);<NEW_LINE>CookieUtil.setCookie(response, Constants.COOKIE_ALIYUN_EXPIRES_AT, expiresAt, 0, topDomain);<NEW_LINE>// response.sendRedirect(SecurityUtil.getSafeUrl(stateJson.get("callback").getAsString()));<NEW_LINE>response.sendRedirect(stateJson.get("callback").getAsString());<NEW_LINE>}
getAccessToken(), 0, topDomain);
832,252
final ListLoggingConfigurationsResult executeListLoggingConfigurations(ListLoggingConfigurationsRequest listLoggingConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLoggingConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLoggingConfigurationsRequest> request = null;<NEW_LINE>Response<ListLoggingConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLoggingConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLoggingConfigurationsRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLoggingConfigurations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLoggingConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListLoggingConfigurationsResultJsonUnmarshaller());
1,337,585
public GraphPlotter physics(Ribbon all, Ribbon edges) {<NEW_LINE>GraphPlotter g = new GraphPlotter();<NEW_LINE>// compute force for every node<NEW_LINE>Point calc, current;<NEW_LINE>for (Map.Entry<String, Point> node : this.nodes.entrySet()) {<NEW_LINE>calc = (Point) node.getValue().clone();<NEW_LINE>current = (Point) node.getValue().clone();<NEW_LINE>for (Map.Entry<String, Point> p : this.nodes.entrySet()) {<NEW_LINE>if (!node.getKey().equals(p.getKey())) {<NEW_LINE>// System.out.println("force all: " + node.getKey() + " - " + p.getKey());<NEW_LINE>force(calc, current, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String e : this.getEdges(node.getKey(), true)) {<NEW_LINE>// System.out.println("force edge start: " + node.getKey() + " - " + e);<NEW_LINE>force(calc, current, this.getNode(e), edges);<NEW_LINE>}<NEW_LINE>for (String e : this.getEdges(node.getKey(), false)) {<NEW_LINE>// System.out.println("force edge stop: " + node.getKey() + " - " + e);<NEW_LINE>force(calc, current, this.getNode(e), edges);<NEW_LINE>}<NEW_LINE>g.addNode(node.getKey(), calc);<NEW_LINE>}<NEW_LINE>g.edges.addAll(this.edges);<NEW_LINE>return g;<NEW_LINE>}
p.getValue(), all);
607,915
protected SnippetTemplate.Arguments makeArguments(InstanceOfUsageReplacer replacer, LoweringTool tool) {<NEW_LINE>InstanceOfDynamicNode node = (InstanceOfDynamicNode) replacer.instanceOf;<NEW_LINE>if (node.isExact()) {<NEW_LINE>SnippetTemplate.Arguments args = new SnippetTemplate.Arguments(typeEquality, node.graph().getGuardsStage(), tool.getLoweringStage());<NEW_LINE>args.add("object", node.getObject());<NEW_LINE>args.add("trueValue", replacer.trueValue);<NEW_LINE>args.add("falseValue", replacer.falseValue);<NEW_LINE>args.addConst("allowsNull", node.allowsNull());<NEW_LINE>args.add("exactType", node.getMirrorOrHub());<NEW_LINE>return args;<NEW_LINE>} else {<NEW_LINE>SnippetTemplate.Arguments args = new SnippetTemplate.Arguments(instanceOfDynamic, node.graph().getGuardsStage(), tool.getLoweringStage());<NEW_LINE>args.add("type", node.getMirrorOrHub());<NEW_LINE>args.add(<MASK><NEW_LINE>args.add("trueValue", replacer.trueValue);<NEW_LINE>args.add("falseValue", replacer.falseValue);<NEW_LINE>args.addConst("allowsNull", node.allowsNull());<NEW_LINE>args.addConst("typeIDSlotOffset", runtimeConfig.getTypeIDSlotsOffset());<NEW_LINE>return args;<NEW_LINE>}<NEW_LINE>}
"object", node.getObject());
689,467
private void updateFleuron(boolean requiresPremium) {<NEW_LINE>FragmentTransaction transaction = getSupportFragmentManager().beginTransaction().setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out);<NEW_LINE>if (requiresPremium) {<NEW_LINE>transaction.hide(itemSetFragment);<NEW_LINE>binding.footerFleuron.textSubscription.setText(R.string.premium_subscribers_search);<NEW_LINE>binding.footerFleuron.containerSubscribe.setVisibility(View.VISIBLE);<NEW_LINE>binding.footerFleuron.getRoot().setVisibility(View.VISIBLE);<NEW_LINE>binding.footerFleuron.containerSubscribe.setOnClickListener(view -> UIUtils.startPremiumActivity(this));<NEW_LINE>} else {<NEW_LINE>transaction.show(itemSetFragment);<NEW_LINE>binding.footerFleuron.<MASK><NEW_LINE>binding.footerFleuron.getRoot().setVisibility(View.GONE);<NEW_LINE>binding.footerFleuron.containerSubscribe.setOnClickListener(null);<NEW_LINE>}<NEW_LINE>transaction.commit();<NEW_LINE>}
containerSubscribe.setVisibility(View.GONE);
704,680
private void initBuffer() {<NEW_LINE>logger.info("Initializing display (if last line in log then likely the game crashed from an issue with your " + "video card)");<NEW_LINE>if (!config.isVSync()) {<NEW_LINE>GLFW.glfwSwapInterval(0);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String root = "org/terasology/icons/";<NEW_LINE>ClassLoader classLoader = getClass().getClassLoader();<NEW_LINE>BufferedImage icon16 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_16.png"));<NEW_LINE>BufferedImage icon32 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_32.png"));<NEW_LINE>BufferedImage icon64 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_64.png"));<NEW_LINE>BufferedImage icon128 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_128.png"));<NEW_LINE>GLFWImage.Buffer buffer = GLFWImage.create(4);<NEW_LINE>buffer.put(0, LwjglGraphicsUtil.convertToGLFWFormat(icon16));<NEW_LINE>buffer.put(1, LwjglGraphicsUtil.convertToGLFWFormat(icon32));<NEW_LINE>buffer.put(2, LwjglGraphicsUtil.convertToGLFWFormat(icon64));<NEW_LINE>buffer.put(3<MASK><NEW_LINE>} catch (IOException | IllegalArgumentException e) {<NEW_LINE>logger.warn("Could not set icon", e);<NEW_LINE>}<NEW_LINE>display.setDisplayModeSetting(config.getDisplayModeSetting());<NEW_LINE>}
, LwjglGraphicsUtil.convertToGLFWFormat(icon128));
1,730,133
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Search your library for three creature cards<NEW_LINE>if (controller.searchLibrary(target, source, game)) {<NEW_LINE>boolean shuffleDone = false;<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>Cards cards = new CardsImpl(target.getTargets());<NEW_LINE>// Reveal them<NEW_LINE>controller.<MASK><NEW_LINE>Card[] cardsArray = cards.getCards(game).toArray(new Card[0]);<NEW_LINE>// If you reveal three cards with different names<NEW_LINE>if (Stream.of(cardsArray).map(MageObject::getName).collect(Collectors.toSet()).size() == 3) {<NEW_LINE>// Choose one of them at random and put that card into your hand<NEW_LINE>Card randomCard = cards.getRandom(game);<NEW_LINE>controller.moveCards(randomCard, Zone.HAND, source, game);<NEW_LINE>cards.remove(randomCard);<NEW_LINE>}<NEW_LINE>// Shuffle the rest into your library<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>controller.shuffleCardsToLibrary(cards, game, source);<NEW_LINE>shuffleDone = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!shuffleDone) {<NEW_LINE>controller.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
revealCards(source, cards, game);
672,338
private synchronized void sendMessage(ApnsNotification m, boolean fromBuffer) throws NetworkIOException {<NEW_LINE>logger.debug("sendMessage {} fromBuffer: {}", m, fromBuffer);<NEW_LINE>if (delegate instanceof StartSendingApnsDelegate) {<NEW_LINE>((StartSendingApnsDelegate) delegate<MASK><NEW_LINE>}<NEW_LINE>int attempts = 0;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>attempts++;<NEW_LINE>Socket socket = getOrCreateSocket(fromBuffer);<NEW_LINE>socket.getOutputStream().write(m.marshall());<NEW_LINE>socket.getOutputStream().flush();<NEW_LINE>cacheNotification(m);<NEW_LINE>delegate.messageSent(m, fromBuffer);<NEW_LINE>// logger.debug("Message \"{}\" sent", m);<NEW_LINE>attempts = 0;<NEW_LINE>break;<NEW_LINE>} catch (SSLHandshakeException e) {<NEW_LINE>// No use retrying this, it's dead Jim<NEW_LINE>throw new NetworkIOException(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Utilities.close(socket);<NEW_LINE>if (attempts >= RETRIES) {<NEW_LINE>logger.error("Couldn't send message after " + RETRIES + " retries." + m, e);<NEW_LINE>delegate.messageSendFailed(m, e);<NEW_LINE>Utilities.wrapAndThrowAsRuntimeException(e);<NEW_LINE>}<NEW_LINE>// The first failure might be due to closed connection (which in turn might be caused by<NEW_LINE>// a message containing a bad token), so don't delay for the first retry.<NEW_LINE>//<NEW_LINE>// Additionally we don't want to spam the log file in this case, only after the second retry<NEW_LINE>// which uses the delay.<NEW_LINE>if (attempts != 1) {<NEW_LINE>logger.info("Failed to send message " + m + "... trying again after delay", e);<NEW_LINE>Utilities.sleep(DELAY_IN_MS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).startSending(m, fromBuffer);
1,813,286
final DescribeAutoScalingGroupsResult executeDescribeAutoScalingGroups(DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAutoScalingGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAutoScalingGroupsRequest> request = null;<NEW_LINE>Response<DescribeAutoScalingGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAutoScalingGroupsRequestMarshaller().marshall(super.beforeMarshalling(describeAutoScalingGroupsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAutoScalingGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAutoScalingGroupsResult> responseHandler = new StaxResponseHandler<DescribeAutoScalingGroupsResult>(new DescribeAutoScalingGroupsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Auto Scaling");
1,444,974
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workId, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Work work = null;<NEW_LINE>Req req = new Req();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(workId, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (effectivePerson.isNotManager()) {<NEW_LINE>WoWorkControl workControl = business.getControl(effectivePerson, work, WoWorkControl.class);<NEW_LINE>if (!workControl.getAllowProcessing()) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getAttachmentList())) {<NEW_LINE>for (WiAttachment w : wi.getAttachmentList()) {<NEW_LINE>Attachment o = emc.find(w.getId(), Attachment.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new ExceptionEntityNotExist(w.getId(), Attachment.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, o.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, o.getJob());<NEW_LINE>}<NEW_LINE>ReqAttachment q = new ReqAttachment();<NEW_LINE>q.setId(o.getId());<NEW_LINE>q.setName(w.getName());<NEW_LINE>q.setSite(w.getSite());<NEW_LINE>req.getAttachmentList().add(q);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(req.getAttachmentList())) {<NEW_LINE>wos = ThisApplication.context().applications().postQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class, Applications.joinQueryUri("attachment", "copy", "work", work.getId()), req, work.getJob()).getDataAsList(Wo.class);<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}
ExceptionEntityNotExist(workId, Work.class);
579,925
public static PyString UnicodeTranslateError__str__(PyObject self, PyObject[] args, String[] kwargs) {<NEW_LINE>int start = self.__getattr__("start").asInt();<NEW_LINE>int end = self.__getattr__("end").asInt();<NEW_LINE>// Get reason as a string, which it might not be if it's been modified after we<NEW_LINE>// were contructed<NEW_LINE>PyObject reason = self.__getattr__("reason").__str__();<NEW_LINE>PyObject object = getUnicode(self.__getattr__("object"), "object");<NEW_LINE>String result;<NEW_LINE>if (start < object.__len__() && end == (start + 1)) {<NEW_LINE>int badchar = object.toString().codePointAt(start);<NEW_LINE>String badCharStr;<NEW_LINE>if (badchar <= 0xff) {<NEW_LINE>badCharStr = String.format("x%02x", badchar);<NEW_LINE>} else if (badchar <= 0xffff) {<NEW_LINE>badCharStr = String.format("u%04x", badchar);<NEW_LINE>} else {<NEW_LINE>badCharStr = String.format("U%08x", badchar);<NEW_LINE>}<NEW_LINE>result = String.format(<MASK><NEW_LINE>} else {<NEW_LINE>result = String.format("can't translate characters in position %d-%d: %.400s", start, end - 1, reason);<NEW_LINE>}<NEW_LINE>return Py.newString(result);<NEW_LINE>}
"can't translate character u'\\%s' in position %d: %.400s", badCharStr, start, reason);